Skip to content

fix: defer protected content status check until init - #211

Open
rickalee wants to merge 1 commit into
10up:developfrom
rickalee:fix/coauthors-plus-early-translation
Open

fix: defer protected content status check until init#211
rickalee wants to merge 1 commit into
10up:developfrom
rickalee:fix/coauthors-plus-early-translation

Conversation

@rickalee

Copy link
Copy Markdown

Summary

  • move the Protected Content active-state check out of the Co-Authors Plus constructor
  • evaluate the dependency during feature requirements validation on init
  • add regression coverage and an unreleased changelog entry

This keeps feature registration available before ElasticPress processes registered features while avoiding ElasticPress translation calls during plugins_loaded. The dependency state is still populated before the Co-Authors Plus feature setup runs.

Closes #210

Testing instructions

  1. Install Composer dependencies.
  2. Start a supported Elasticsearch instance and set EP_HOST.
  3. Run vendor/bin/phpunit tests/phpunit/feature/TestCoAuthorsPlus.php.
  4. Run vendor/bin/phpcs includes/classes/Feature/CoAuthorsPlus.php tests/phpunit/feature/TestCoAuthorsPlus.php --runtime-set testVersion 7.4-.

Test results

  • Co-Authors Plus suite: 9 tests, 25 assertions passed.
  • PHPCS: passed for both changed PHP files.
  • Full PHPUnit suite: 185 tests completed with 5 unrelated local-environment failures in existing GeoLocation and User analyzer tests using Elasticsearch 8.15 and PHP 8.5.

Evaluate the Protected Content feature while ElasticPress validates feature requirements on init instead of during Co-Authors Plus construction on plugins_loaded.

Closes 10up#210

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 50c48fa8-36d5-c9ca8a0c82fa
@felipeelia felipeelia added this to the 2.5.2 milestone Aug 28, 2026
@rickalee
rickalee requested a review from felipeelia August 28, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Early ElasticPress textdomain loading in CoAuthorsPlus constructor

2 participants