Skip to content

Add backwards compatibility for ACTIVITYPUB_DISABLE_SIDELOADING#2973

Merged
pfefferle merged 2 commits intotrunkfrom
add/sideloading-backwards-compat
Feb 24, 2026
Merged

Add backwards compatibility for ACTIVITYPUB_DISABLE_SIDELOADING#2973
pfefferle merged 2 commits intotrunkfrom
add/sideloading-backwards-compat

Conversation

@pfefferle
Copy link
Member

Proposed changes:

  • Add backwards compatibility for the ACTIVITYPUB_DISABLE_SIDELOADING constant and activitypub_sideloading_enabled filter that were shipped in 7.9.1 but removed during the remote cache refactor.
  • Rename the unreleased ACTIVITYPUB_DISABLE_MEDIA_CACHE constant to ACTIVITYPUB_DISABLE_REMOTE_CACHE for unified naming with the activitypub_remote_cache_enabled filter.
  • Deprecate the old activitypub_sideloading_enabled filter via apply_filters_deprecated().

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  • Verify Cache::is_enabled() returns true by default.
  • Add define( 'ACTIVITYPUB_DISABLE_SIDELOADING', true ); to wp-config.php and verify remote media caching is disabled.
  • Add add_filter( 'activitypub_sideloading_enabled', '__return_false' ); and verify caching is disabled and a deprecation notice is triggered in WP_DEBUG mode.
  • Run npm run env-test -- --filter=Test_Cache — all 6 tests should pass.

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch

Type

  • Added - for new features

Message

Add backwards compatibility for the ACTIVITYPUB_DISABLE_SIDELOADING constant and activitypub_sideloading_enabled filter from version 7.9.1.

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.
Copilot AI review requested due to automatic review settings February 24, 2026 17:12
@pfefferle pfefferle self-assigned this Feb 24, 2026
@pfefferle pfefferle requested a review from a team February 24, 2026 17:12
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_SIDELOADING to ACTIVITYPUB_DISABLE_REMOTE_CACHE
  • Deprecate the activitypub_sideloading_enabled filter using apply_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

@pfefferle pfefferle merged commit 04c25e1 into trunk Feb 24, 2026
10 checks passed
@pfefferle pfefferle deleted the add/sideloading-backwards-compat branch February 24, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants