5777210184
- 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
62 lines
1.6 KiB
PHP
62 lines
1.6 KiB
PHP
<?php
|
|
/**
|
|
* Messages adapter — `hivepress-messages`.
|
|
*
|
|
* The Message model extends Comment (`comment_type = hp_message`) and stores
|
|
* the recipient in `comment_karma`, the sender in `user_id` and the read flag
|
|
* in `comment_approved`.
|
|
*
|
|
* 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
|
|
* messages into `wpdo_comment_hp_message`, a table nothing ever created.)
|
|
*
|
|
* @package WP_Data_Optimizer
|
|
* @since 3.0.0
|
|
*/
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit;
|
|
}
|
|
|
|
if ( ! class_exists( 'TMDO_HivePress_Messages_Adapter' ) ) {
|
|
|
|
/**
|
|
* Messages addon adapter (detection and doctor only).
|
|
*/
|
|
final class TMDO_HivePress_Messages_Adapter implements TMDO_HivePress_Adapter {
|
|
|
|
use TMDO_HivePress_Adapter_Trait;
|
|
|
|
/** Comment_type of the Message model. */
|
|
public const COMMENT_TYPE = 'hp_message';
|
|
|
|
/**
|
|
* 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-messages';
|
|
}
|
|
|
|
/** Class probed for addon presence. */
|
|
public function detection_class(): string {
|
|
return 'HivePress\\Messages\\Plugin';
|
|
}
|
|
|
|
/** Version constant probed for addon presence. */
|
|
public function detection_const(): string {
|
|
return 'HIVEPRESS_MESSAGES_VERSION';
|
|
}
|
|
|
|
/** Minimum addon version supported. */
|
|
public function minimum_addon_version(): string {
|
|
return '1.4.0';
|
|
}
|
|
}
|
|
|
|
} // end if ( ! class_exists )
|