refactor(2meet-data-optimizer-hivepress-addon): remove HPCT-era interceptors and query rewriters
- Delete 7 interceptors + 5 query rewriters that read/write hpct_* tables no site has (only an empty hpct_latepoint_idx exists) - Drop their loading/registration in TMDO_HP_Bootstrap, back-compat aliases, integration bootstrap, and ListingMetaInterceptorTest - Verify: unit 141 OK, integration 49 OK, bootstrap smoke OK; phpcs 34E/40W → 25E/28W - PR: PR-014
This commit is contained in:
@@ -2,8 +2,7 @@
|
||||
/**
|
||||
* Bootstrap for 2meet Data Optimizer HivePress AddOn.
|
||||
*
|
||||
* 載入 13 adapter + 7 interceptor + 5 query interceptor + 補助組件 +
|
||||
* admin tab + CLI namespace。
|
||||
* 載入 13 adapter + 補助組件 + admin tab + CLI namespace。
|
||||
*
|
||||
* 注意:HP 的 V3.0.0 family bootstrap 內部也有一個 class TMDO_HivePress_Bootstrap
|
||||
* (在 includes/hivepress/class-tmdo-hivepress-bootstrap.php)。為避免衝突,本
|
||||
@@ -64,35 +63,6 @@ final class TMDO_HP_Bootstrap {
|
||||
require_once $base . 'includes/hivepress/class-tmdo-hivepress-benchmark.php';
|
||||
require_once $base . 'includes/hivepress/class-tmdo-hivepress-rest.php';
|
||||
|
||||
// 7 HPCT interceptors.
|
||||
// reviews / messages / memberships / requests extend the core's
|
||||
// TMDO_Standard_Post_Interceptor — requiring them against a core older than
|
||||
// v0.2.0 would fatal at parse time, so gate those four on the base class.
|
||||
$has_standard_base = class_exists( 'TMDO_Standard_Post_Interceptor' );
|
||||
foreach ( array(
|
||||
'reviews', 'messages', 'favorites', 'memberships',
|
||||
'statistics', 'requests', 'listing-meta',
|
||||
) as $intslug ) {
|
||||
$needs_base = in_array( $intslug, array( 'reviews', 'messages', 'memberships', 'requests' ), true );
|
||||
if ( $needs_base && ! $has_standard_base ) {
|
||||
continue;
|
||||
}
|
||||
$file = $base . "includes/interceptors/class-tmdo-{$intslug}-interceptor.php";
|
||||
if ( file_exists( $file ) ) {
|
||||
require_once $file;
|
||||
}
|
||||
}
|
||||
|
||||
// 5 query interceptors
|
||||
foreach ( array(
|
||||
'reviews', 'messages', 'memberships', 'requests', 'listing-meta',
|
||||
) as $qslug ) {
|
||||
$file = $base . "includes/query/class-tmdo-{$qslug}-query.php";
|
||||
if ( file_exists( $file ) ) {
|
||||
require_once $file;
|
||||
}
|
||||
}
|
||||
|
||||
// Misc HP integration files
|
||||
require_once $base . 'includes/class-tmdo-hivepress.php';
|
||||
require_once $base . 'includes/class-tmdo-hivepress-transient-filter.php';
|
||||
@@ -110,34 +80,6 @@ final class TMDO_HP_Bootstrap {
|
||||
TMDO_HivePress_Bootstrap::boot();
|
||||
}
|
||||
|
||||
// 7 HPCT interceptors
|
||||
foreach ( array(
|
||||
'TMDO_Reviews_Interceptor',
|
||||
'TMDO_Messages_Interceptor',
|
||||
'TMDO_Favorites_Interceptor',
|
||||
'TMDO_Memberships_Interceptor',
|
||||
'TMDO_Statistics_Interceptor',
|
||||
'TMDO_Requests_Interceptor',
|
||||
'TMDO_Listing_Meta_Interceptor',
|
||||
) as $cls ) {
|
||||
if ( class_exists( $cls ) ) {
|
||||
( new $cls() )->register_hooks();
|
||||
}
|
||||
}
|
||||
|
||||
// 5 query interceptors
|
||||
foreach ( array(
|
||||
'TMDO_Reviews_Query',
|
||||
'TMDO_Messages_Query',
|
||||
'TMDO_Memberships_Query',
|
||||
'TMDO_Requests_Query',
|
||||
'TMDO_Listing_Meta_Query',
|
||||
) as $cls ) {
|
||||
if ( class_exists( $cls ) ) {
|
||||
( new $cls() )->register_hooks();
|
||||
}
|
||||
}
|
||||
|
||||
// HP transient filter (init:5)
|
||||
if ( class_exists( 'TMDO_Hivepress_Transient_Filter' ) ) {
|
||||
add_action( 'init', array( 'TMDO_Hivepress_Transient_Filter', 'init' ), 5 );
|
||||
|
||||
Reference in New Issue
Block a user