[Step 1] Custom colors: stop serving discontinued COLOURLovers backgrounds#50011
[Step 1] Custom colors: stop serving discontinued COLOURLovers backgrounds#50011Copons wants to merge 1 commit into
Conversation
COLOURLovers support has been discontinued. Atomic sites store background images on COLOURLovers' S3 bucket and emit those URLs directly into the page, so visitors' browsers request them on every load. Blank colourlovers.com.s3.amazonaws.com and colourlovers-static-replica.s3.amazonaws.com URLs at render time via the theme_mod_background_image and theme_mod_background_image_thumb filters. No fallback: broken backgrounds are acceptable.
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Wpcomsh plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 1 file.
Coverage check overridden by
I don't care about code coverage for this PR
|
There was a problem hiding this comment.
Pull request overview
This PR updates the wpcomsh “custom-colors” functionality to prevent Atomic sites from continuing to serve (and therefore request) discontinued COLOURLovers-hosted background images by blanking those theme mods at render time.
Changes:
- Add render-time filters for
theme_mod_background_imageandtheme_mod_background_image_thumbto blank COLOURLovers S3 URLs. - Introduce
Colors_Manager_Common::remove_colourlovers_background()to detect and remove legacy COLOURLovers background image URLs. - Add a wpcomsh changelog entry documenting the behavioral change.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| projects/plugins/wpcomsh/custom-colors/colors.php | Adds unconditional theme-mod filters and a helper to blank COLOURLovers background URLs at render time. |
| projects/plugins/wpcomsh/changelog/dotcom-1758-stop-colourlovers-backgrounds | Documents the change in wpcomsh’s changelog system. |
| public static function remove_colourlovers_background( $url ) { | ||
| if ( is_string( $url ) && ( | ||
| false !== stripos( $url, 'colourlovers.com.s3.amazonaws.com' ) | ||
| || false !== stripos( $url, 'colourlovers-static-replica.s3.amazonaws.com' ) | ||
| ) ) { | ||
| return ''; | ||
| } | ||
|
|
||
| return $url; | ||
| } | ||
|
|
Proposed changes
colourlovers.com.s3.amazonaws.com) and emitted straight into the page, so every visitor's browser requests it on each load. This adds atheme_mod_background_image/theme_mod_background_image_thumbrender filter (Colors_Manager_Common::remove_colourlovers_background()) that blanks anycolourlovers.com.s3.amazonaws.comorcolourlovers-static-replica.s3.amazonaws.comURL, so those requests stop.enable_custom_customizerguard, so the requests stop even where the rest of the custom-colors tool is disabled.Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
wp theme mod set background_image "https://colourlovers-static-replica.s3.amazonaws.com/images/patterns/5814/5814723.png"wp theme mod set background_image_thumb "https://colourlovers-static-replica.s3.amazonaws.com/images/patterns/5814/5814723.png"#custom-background-cssblock contains that URL and the browser requests it (visible in DevTools → Network).custom-backgroundblock is gone,get_theme_mod( 'background_image' )returns empty, and no request is made to either COLOURLovers host.