Add backwards compatibility for ACTIVITYPUB_DISABLE_SIDELOADING#2973
Merged
Add backwards compatibility for ACTIVITYPUB_DISABLE_SIDELOADING#2973
Conversation
The 7.9.1 release shipped `ACTIVITYPUB_DISABLE_SIDELOADING` constant and `activitypub_sideloading_enabled` filter. A subsequent refactor replaced these with a new caching system but dropped the old names. This restores backwards compatibility by mapping the old constant to the new `ACTIVITYPUB_DISABLE_REMOTE_CACHE` and deprecating the old filter via `apply_filters_deprecated()` pointing to `activitypub_remote_cache_enabled`. Also renames the unreleased `ACTIVITYPUB_DISABLE_MEDIA_CACHE` to `ACTIVITYPUB_DISABLE_REMOTE_CACHE` for unified naming with the filter.
There was a problem hiding this comment.
Pull request overview
This PR restores backwards compatibility for the ACTIVITYPUB_DISABLE_SIDELOADING constant and activitypub_sideloading_enabled filter that were shipped in version 7.9.1 but removed during a remote cache refactor. It also renames the unreleased ACTIVITYPUB_DISABLE_MEDIA_CACHE constant to ACTIVITYPUB_DISABLE_REMOTE_CACHE for consistency with the new filter name.
Changes:
- Add backwards compatibility mapping from
ACTIVITYPUB_DISABLE_SIDELOADINGtoACTIVITYPUB_DISABLE_REMOTE_CACHE - Deprecate the
activitypub_sideloading_enabledfilter usingapply_filters_deprecated() - Update documentation to reflect the constant rename and backwards compatibility
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| includes/constants.php | Adds backwards compatibility logic to map old constant to new constant name |
| includes/class-cache.php | Updates to use new constant name and adds deprecated filter hook with proper deprecation handling |
| tests/phpunit/tests/includes/class-test-cache.php | Adds test coverage for the deprecated filter hook behavior |
| readme.txt | Documents the new constant name and notes the replacement of the old constant |
| .github/changelog/2973-from-description | Adds changelog entry for the backwards compatibility addition |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes:
ACTIVITYPUB_DISABLE_SIDELOADINGconstant andactivitypub_sideloading_enabledfilter that were shipped in 7.9.1 but removed during the remote cache refactor.ACTIVITYPUB_DISABLE_MEDIA_CACHEconstant toACTIVITYPUB_DISABLE_REMOTE_CACHEfor unified naming with theactivitypub_remote_cache_enabledfilter.activitypub_sideloading_enabledfilter viaapply_filters_deprecated().Other information:
Testing instructions:
Cache::is_enabled()returnstrueby default.define( 'ACTIVITYPUB_DISABLE_SIDELOADING', true );towp-config.phpand verify remote media caching is disabled.add_filter( 'activitypub_sideloading_enabled', '__return_false' );and verify caching is disabled and a deprecation notice is triggered inWP_DEBUGmode.npm run env-test -- --filter=Test_Cache— all 6 tests should pass.Changelog entry
Changelog Entry Details
Significance
Type
Message
Add backwards compatibility for the
ACTIVITYPUB_DISABLE_SIDELOADINGconstant andactivitypub_sideloading_enabledfilter from version 7.9.1.