hardening 2.3: 2meet-data-optimizer-hivepress-addon 0.4.0 (listing indexes, transient TTLs, site attributes) #4

Merged
wpdev merged 8 commits from hardening/2.3 into main 2026-09-27 18:37:52 +08:00
2 changed files with 25 additions and 1 deletions
Showing only changes of commit f06a80eae5 - Show all commits
@@ -257,7 +257,16 @@ final class TMDO_HivePress_Entity_Groups {
'label' => 'Hourly rate',
),
),
array( 'post_types' => array( 'hp_listing' ) )
array(
'post_types' => array( 'hp_listing' ),
// Filtered and sorted on by HivePress search. Declared as indexes
// (added in place) rather than `searchable`, which would change
// the schema hash and rebuild a table that may hold aeav_only data.
'indexes' => array(
'hourly_rate' => array( 'hp_hourly_rate' ),
'rating_count' => array( 'hp_rating_count' ),
),
)
);
}
/**
+15
View File
@@ -58,6 +58,21 @@ class HivePressEntityGroupsTest extends TestCase {
}
}
/**
* HivePress filters and sorts listings by these; they are declared as
* group indexes (added in place by core) rather than `searchable`, which
* would change the pinned hash and rebuild the table.
*/
public function test_listing_columns_filtered_and_sorted_on_are_indexed(): void {
$this->assertSame(
array(
'hourly_rate' => array( 'hp_hourly_rate' ),
'rating_count' => array( 'hp_rating_count' ),
),
TMDO_Entity_Registry::get_group_indexes( 'post', 'hp_listing_core' )
);
}
public function test_shared_keys_keep_their_current_owner(): void {
foreach ( self::SHARED_KEY_OWNERS as $key => $group ) {
$this->assertSame( $group, TMDO_Entity_Registry::get_field( 'post', $key )['group'], $key );