Files
2meet-data-optimizer-hivepr…/includes/hivepress/adapters/class-tmdo-hivepress-favorites-adapter.php
T
wpdev 5777210184 refactor(2meet-data-optimizer-hivepress-addon): remove comment mirror writes to never-created tables
- Favorites/Messages adapters reduced to detection only; Requests keeps hot_hp_request fields, drops hp_offer mirror
- Delete TMDO_HivePress_Comment_Router (read path to wpdo_comment_hp_* tables that no installer creates)
- Verify: addon unit 141 OK, integration 52 OK; phpcs 41E/57W → 35E/48W
- PR: PR-013
2026-09-25 22:58:34 +08:00

64 lines
1.6 KiB
PHP

<?php
/**
* Favorites adapter — `hivepress-favorites`.
*
* The Favorite model extends Comment (`comment_type = hp_favorite`):
*
* - user → user_id
* - listing → comment_post_ID
* - added_at → comment_date
*
* Nothing is stored in comment meta, so there is no EAV surface to flatten:
* the adapter only reports detection and doctor status. (It used to mirror
* favorites into `wpdo_comment_hp_favorite`, a table nothing ever created.)
*
* @package WP_Data_Optimizer
* @since 3.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'TMDO_HivePress_Favorites_Adapter' ) ) {
/**
* Favorites addon adapter (detection and doctor only).
*/
final class TMDO_HivePress_Favorites_Adapter implements TMDO_HivePress_Adapter {
use TMDO_HivePress_Adapter_Trait;
/** Comment_type of the Favorite model. */
public const COMMENT_TYPE = 'hp_favorite';
/**
* Constructor — bind register hooks via inherited trait.
*/
public function __construct() {
$this->bind_anti_eav_hooks();
}
/** Adapter slug (matches wp.org plugin slug). */
public function plugin_slug(): string {
return 'hivepress-favorites';
}
/** Class probed for addon presence. */
public function detection_class(): string {
return 'HivePress\\Favorites\\Plugin';
}
/** Version constant probed for addon presence. */
public function detection_const(): string {
return 'HIVEPRESS_FAVORITES_VERSION';
}
/** Minimum addon version supported. */
public function minimum_addon_version(): string {
return '1.2.0';
}
}
} // end if ( ! class_exists )