Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ All notable changes to this project will be documented in this file, per [the Ke
### Developer
-->

### Fixed
* Avoid loading ElasticPress translations before the `init` action when the Co-Authors Plus feature is registered.

## [2.5.1] - 2026-05-11

### Added
Expand Down Expand Up @@ -51,7 +54,6 @@ All notable changes to this project will be documented in this file, per [the Ke
* Add Patchstack security-reporting FAQ. Props [@jeffpaul](https://github.com/jeffpaul) via [#174](https://github.com/10up/ElasticPressLabs/pull/174).
* Set explicit `permissions` on GitHub Actions workflows. Props [@jeffpaul](https://github.com/jeffpaul) via [#178](https://github.com/10up/ElasticPressLabs/pull/178).
* Add `ep_user_sync_kill` filter in Users `action_queue_meta_sync`. Props [@burhandodhy](https://github.com/burhandodhy) and [@yarovikov](https://github.com/yarovikov) via [#183](https://github.com/10up/ElasticPressLabs/pull/183).

## [2.5.0] - 2025-11-05

### Added
Expand Down
7 changes: 3 additions & 4 deletions includes/classes/Feature/CoAuthorsPlus.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ public function __construct() {

$this->requires_install_reindex = true;

$protected_content_feature = Features::factory()->get_registered_feature( 'protected_content' );

$this->is_protected_content_feature_active = $protected_content_feature && $protected_content_feature->is_active();

$this->requires_feature = 'search';

parent::__construct();
Expand Down Expand Up @@ -273,6 +269,9 @@ public function requirements_status() {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
$status = new FeatureRequirementsStatus( 0 );

$protected_content_feature = Features::factory()->get_registered_feature( 'protected_content' );
$this->is_protected_content_feature_active = $protected_content_feature && $protected_content_feature->is_active();

if ( ! \is_plugin_active( 'co-authors-plus/co-authors-plus.php' ) || ! class_exists( '\CoAuthors_Plus' ) ) {
$status->code = 2;
$status->message = esc_html__( 'You need to have Co-Authors Plus installed and activated.', 'elasticpress-labs' );
Expand Down
26 changes: 26 additions & 0 deletions tests/phpunit/feature/TestCoAuthorsPlus.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,32 @@ public function testConstruct() {
$this->assertEquals( 'Co-Authors Plus', $instance->title );
}

/**
* Test Protected Content status is checked during requirements validation.
*
* @since 2.5.2
*/
public function test_protected_content_status_is_checked_during_requirements_validation() {
ElasticPress\Features::factory()->activate_feature( 'protected_content' );

$instance = new class() extends ElasticPressLabs\Feature\CoAuthorsPlus {
/**
* Return the protected content feature state.
*
* @return bool
*/
public function is_protected_content_feature_active() {
return $this->is_protected_content_feature_active;
}
};

$this->assertFalse( $instance->is_protected_content_feature_active() );

$instance->requirements_status();

$this->assertTrue( $instance->is_protected_content_feature_active() );
}

/**
* Test box summary
*
Expand Down
Loading