-
Notifications
You must be signed in to change notification settings - Fork 847
Photon Functions: PHPCS fixes #12159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: November 5, 2019. |
|
Caution: This PR has changes that must be merged to WordPress.com |
|
Moving this out of milestone so I can look at the wp.com diff in more detail before merging here. |
|
This PR has been marked as stale. This happened because:
No further action is needed. But it's worth checking if this PR has clear testing instructions, is it up to date with master, and it is still valid. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation. |
1ee8438 to
1915813
Compare
1915813 to
d99bed9
Compare
|
kraftbj, Your synced wpcom patch D27441-code has been updated. |
|
Fusion trips up a bit when there are changes at the beginning of a file (e.g. new file-level docblock) when the corresponding wpcom file has the "this is in Jetpack" notice. Manually patched in D27441-code. |
|
kraftbj, Your synced wpcom patch D27441-code has been updated. |
59fb72e to
4f59b6c
Compare
|
The only functional change is the subdomain determination. Per the advice of Systems ( pMz3w-arH-p2 ), in 7.9, I'd like to only use the new technique for 1/3rd of URLs and then roll out to another third in 8.0, etc. |
functions.photon.php contains a number of PHPCS issues and use of outdated methods (
parse_urlwith a wrapper to incompletely do whatwp_parse_urldoes now, seeding arand, etc).The major change is to the way we determine the subdomain. The issue with the previous way, beyond the PHPCS violation, is that
srandis disabled on some systems. The benefit of seeding with the image URL is to net a consistent subdomain to avoid the same image being served from two different subdomains, thus having a browser download the same image twice.Since we don't really need anything particular randomized, we can convert the image path to a value between 0 and 2 using a combo of abs, crc32 and the
%operator.Changes proposed in this Pull Request:
Testing instructions:
Proposed changelog entry for your changes: