$c !== $cb ) ); } return true; } } if ( ! function_exists( 'remove_action' ) ) { function remove_action( string $hook, $cb, int $p = 10 ): bool { return remove_filter( $hook, $cb, $p ); } } if ( ! function_exists( 'apply_filters' ) ) { function apply_filters( string $hook, $value, ...$args ) { foreach ( $GLOBALS['_wp_filter_callbacks'][ $hook ] ?? [] as $cb ) { $value = $cb( $value, ...$args ); } return $value; } } if ( ! function_exists( 'do_action' ) ) { function do_action( string $hook, ...$args ): void { foreach ( $GLOBALS['_wp_filter_callbacks'][ $hook ] ?? [] as $cb ) { $cb( ...$args ); } } } if ( ! function_exists( 'do_action_ref_array' ) ) { function do_action_ref_array( string $hook, array $args ): void { do_action( $hook, ...$args ); } } if ( ! function_exists( 'wp_next_scheduled' ) ) { function wp_next_scheduled( string $hook ): int|false { return false; } } if ( ! function_exists( 'wp_schedule_event' ) ) { function wp_schedule_event( int $t, string $r, string $h ): bool { return true; } } if ( ! function_exists( 'wp_schedule_single_event' ) ) { function wp_schedule_single_event( int $ts, string $hook ): bool { return true; } } if ( ! function_exists( 'wp_clear_scheduled_hook' ) ) { function wp_clear_scheduled_hook( string $hook ): int|false { return 0; } } if ( ! function_exists( 'is_admin' ) ) { function is_admin(): bool { return false; } } if ( ! function_exists( 'is_singular' ) ) { function is_singular( $t = '' ): bool { return false; } } if ( ! function_exists( 'get_the_ID' ) ) { function get_the_ID(): int|false { return false; } } if ( ! function_exists( 'wp_doing_ajax' ) ) { function wp_doing_ajax(): bool { return false; } } if ( ! function_exists( 'sanitize_text_field' ) ) { function sanitize_text_field( string $s ): string { return trim( strip_tags( $s ) ); } } if ( ! function_exists( '__' ) ) { function __( string $text, string $domain = 'default' ): string { return $text; } } if ( ! function_exists( 'esc_html' ) ) { function esc_html( string $text ): string { return htmlspecialchars( $text, ENT_QUOTES, 'UTF-8' ); } } if ( ! function_exists( 'esc_html__' ) ) { function esc_html__( string $text, string $domain = 'default' ): string { return htmlspecialchars( $text, ENT_QUOTES, 'UTF-8' ); } } if ( ! function_exists( 'esc_html_e' ) ) { function esc_html_e( string $text, string $domain = 'default' ): void { echo htmlspecialchars( $text, ENT_QUOTES, 'UTF-8' ); } } if ( ! function_exists( 'esc_attr' ) ) { function esc_attr( string $text ): string { return htmlspecialchars( $text, ENT_QUOTES, 'UTF-8' ); } } if ( ! function_exists( 'esc_url' ) ) { function esc_url( string $url ): string { return filter_var( $url, FILTER_SANITIZE_URL ) ?: ''; } } if ( ! function_exists( 'esc_sql' ) ) { function esc_sql( $s ): string { $s = is_string( $s ) ? $s : (string) $s; return addslashes( $s ); } } if ( ! function_exists( '_doing_it_wrong' ) ) { function _doing_it_wrong( string $fn, string $msg, string $ver ): void {} } if ( ! function_exists( 'get_option' ) ) { function get_option( string $key, $default = false ) { return $GLOBALS['_wp_options'][ $key ] ?? $default; } } if ( ! function_exists( 'update_option' ) ) { function update_option( string $key, $value ): bool { $GLOBALS['_wp_options'][ $key ] = $value; return true; } } if ( ! function_exists( 'delete_option' ) ) { function delete_option( string $key ): bool { unset( $GLOBALS['_wp_options'][ $key ] ); return true; } } if ( ! function_exists( 'get_post_meta' ) ) { function get_post_meta( int $post_id, string $key = '', bool $single = false ) { return $GLOBALS['_wp_postmeta'][ $post_id ][ $key ] ?? ( $single ? '' : [] ); } } if ( ! function_exists( 'update_post_meta' ) ) { function update_post_meta( int $post_id, string $key, $value, $prev = '' ): int|bool { $GLOBALS['_wp_postmeta'][ $post_id ][ $key ] = $value; return true; } } if ( ! function_exists( 'get_user_meta' ) ) { function get_user_meta( int $uid, string $key = '', bool $single = false ) { return $GLOBALS['_wp_usermeta'][ $uid ][ $key ] ?? ( $single ? '' : [] ); } } if ( ! function_exists( 'update_user_meta' ) ) { function update_user_meta( int $uid, string $key, $value, $prev = '' ): int|bool { $GLOBALS['_wp_usermeta'][ $uid ][ $key ] = $value; return true; } } if ( ! function_exists( 'get_term_meta' ) ) { function get_term_meta( int $tid, string $key = '', bool $single = false ) { return $GLOBALS['_wp_termmeta'][ $tid ][ $key ] ?? ( $single ? '' : [] ); } } if ( ! function_exists( 'update_term_meta' ) ) { function update_term_meta( int $tid, string $key, $value, $prev = '' ): int|bool { $GLOBALS['_wp_termmeta'][ $tid ][ $key ] = $value; return true; } } if ( ! function_exists( 'get_comment_meta' ) ) { function get_comment_meta( int $cid, string $key = '', bool $single = false ) { return $GLOBALS['_wp_commentmeta'][ $cid ][ $key ] ?? ( $single ? '' : [] ); } } if ( ! function_exists( 'update_comment_meta' ) ) { function update_comment_meta( int $cid, string $key, $value, $prev = '' ): int|bool { $GLOBALS['_wp_commentmeta'][ $cid ][ $key ] = $value; return true; } } if ( ! function_exists( 'get_post_type' ) ) { function get_post_type( $post_id ) { return $GLOBALS['_wp_post_types'][ (int) $post_id ] ?? false; } } if ( ! function_exists( 'get_post_status' ) ) { function get_post_status( $post_id ) { return $GLOBALS['_wp_post_status'][ (int) $post_id ] ?? 'publish'; } } if ( ! function_exists( 'is_post_publicly_viewable' ) ) { function is_post_publicly_viewable( $post_id ): bool { if ( isset( $GLOBALS['_wp_post_publicly_viewable'][ (int) $post_id ] ) ) { return (bool) $GLOBALS['_wp_post_publicly_viewable'][ (int) $post_id ]; } return 'publish' === ( $GLOBALS['_wp_post_status'][ (int) $post_id ] ?? 'publish' ); } } if ( ! function_exists( 'wp_die' ) ) { function wp_die( $message = '' ): void { throw new RuntimeException( is_string( $message ) ? $message : 'wp_die' ); } } if ( ! function_exists( 'wp_verify_nonce' ) ) { function wp_verify_nonce( $nonce, string $action = '' ) { return $GLOBALS['_wp_valid_nonces'][ (string) $nonce ] ?? false; } } if ( ! function_exists( 'wp_create_nonce' ) ) { function wp_create_nonce( string $action = '' ): string { $nonce = 'test_nonce_' . md5( $action ); $GLOBALS['_wp_valid_nonces'][ $nonce ] = 1; return $nonce; } } if ( ! function_exists( 'current_user_can' ) ) { function current_user_can( string $cap, ...$args ): bool { if ( ! empty( $args ) ) { $key = $cap . ':' . implode( ',', array_map( 'strval', $args ) ); if ( isset( $GLOBALS['_wp_current_user_can'][ $key ] ) ) { return (bool) $GLOBALS['_wp_current_user_can'][ $key ]; } } return $GLOBALS['_wp_current_user_can'][ $cap ] ?? false; } } if ( ! function_exists( 'get_current_user_id' ) ) { function get_current_user_id(): int { return (int) ( $GLOBALS['_wp_current_user_id'] ?? 0 ); } } if ( ! function_exists( 'is_multisite' ) ) { function is_multisite(): bool { return (bool) ( $GLOBALS['_wp_is_multisite'] ?? false ); } } if ( ! function_exists( 'is_super_admin' ) ) { function is_super_admin( ?int $uid = null ): bool { return (bool) ( $GLOBALS['_wp_is_super_admin'] ?? false ); } } if ( ! function_exists( 'switch_to_blog' ) ) { function switch_to_blog( int $blog_id ): bool { $GLOBALS['_wp_current_blog_id'] = $blog_id; return true; } } if ( ! function_exists( 'restore_current_blog' ) ) { function restore_current_blog(): bool { unset( $GLOBALS['_wp_current_blog_id'] ); return true; } } if ( ! function_exists( 'get_sites' ) ) { function get_sites( array $args = [] ): array { return $GLOBALS['_wp_sites'] ?? []; } } if ( ! function_exists( 'is_plugin_active_for_network' ) ) { function is_plugin_active_for_network( string $plugin ): bool { return (bool) ( $GLOBALS['_wp_plugin_active_for_network'][ $plugin ] ?? false ); } } if ( ! function_exists( 'plugin_basename' ) ) { function plugin_basename( string $file ): string { return basename( dirname( $file ) ) . '/' . basename( $file ); } } if ( ! function_exists( 'wp_generate_password' ) ) { function wp_generate_password( int $len = 12, bool $special = true ): string { return substr( str_replace( [ '/', '+', '=' ], '', base64_encode( random_bytes( $len ) ) ), 0, $len ); } } if ( ! function_exists( 'wp_json_encode' ) ) { function wp_json_encode( $data, int $flags = 0 ): string|false { return json_encode( $data, $flags ); } } if ( ! function_exists( 'is_serialized' ) ) { function is_serialized( $data ): bool { return is_string( $data ) && strlen( $data ) >= 4 && in_array( $data[0], [ 'a', 's', 'i', 'd', 'b', 'O', 'N' ], true ) && str_ends_with( $data, ';' ); } } if ( ! function_exists( 'maybe_serialize' ) ) { function maybe_serialize( $data ) { return is_array( $data ) || is_object( $data ) ? serialize( $data ) : $data; } } if ( ! function_exists( 'maybe_unserialize' ) ) { function maybe_unserialize( $value ) { if ( ! is_string( $value ) ) { return $value; } $u = @unserialize( $value ); return ( false !== $u || 'b:0;' === $value ) ? $u : $value; } } if ( ! function_exists( 'get_transient' ) ) { function get_transient( string $key ) { return $GLOBALS['_wp_options'][ '_transient_' . $key ] ?? false; } } if ( ! function_exists( 'set_transient' ) ) { function set_transient( string $key, $value, int $expiry = 0 ): bool { $GLOBALS['_wp_options'][ '_transient_' . $key ] = $value; return true; } } if ( ! function_exists( 'delete_transient' ) ) { function delete_transient( string $key ): bool { unset( $GLOBALS['_wp_options'][ '_transient_' . $key ] ); return true; } } if ( ! function_exists( 'wp_rand' ) ) { function wp_rand( int $min = 0, int $max = 0 ): int { return random_int( $min, $max ?: PHP_INT_MAX ); } } if ( ! function_exists( 'is_wp_error' ) ) { function is_wp_error( $thing ): bool { return $thing instanceof WP_Error; } } // Object cache simulation. $GLOBALS['_wp_cache'] = []; if ( ! function_exists( 'wp_cache_get' ) ) { function wp_cache_get( $key, $group = '' ) { return $GLOBALS['_wp_cache'][ $group ][ $key ] ?? false; } } if ( ! function_exists( 'wp_cache_set' ) ) { function wp_cache_set( $key, $value, $group = '', $ttl = 0 ): bool { $GLOBALS['_wp_cache'][ $group ][ $key ] = $value; return true; } } if ( ! function_exists( 'wp_cache_delete' ) ) { function wp_cache_delete( $key, $group = '' ): bool { unset( $GLOBALS['_wp_cache'][ $group ][ $key ] ); return true; } } // ── Stub classes ─────────────────────────────────────────────────────────── if ( ! class_exists( 'WP_Query' ) ) { class WP_Query { public array $posts = []; public int $found_posts = 0; public int $max_num_pages = 0; private array $args = []; public function __construct( array $args = [] ) { $this->args = $args; } public function get( string $key, $default = '' ) { return $this->args[ $key ] ?? $default; } public function set( string $key, $value ): void { $this->args[ $key ] = $value; } } } if ( ! class_exists( 'WP_Error' ) ) { class WP_Error { private string $code; private string $message; private array $data; public function __construct( string $code = '', string $message = '', $data = [] ) { $this->code = $code; $this->message = $message; $this->data = is_array( $data ) ? $data : []; } public function get_error_code(): string { return $this->code; } public function get_error_message(): string { return $this->message; } public function get_error_data() { return $this->data; } } } if ( ! class_exists( 'WP_REST_Request' ) ) { class WP_REST_Request { private array $params = []; private array $headers = []; public function __construct( string $method = 'GET', string $route = '' ) {} public function get_param( string $key ) { return $this->params[ $key ] ?? null; } public function set_param( string $key, $value ): void { $this->params[ $key ] = $value; } public function get_header( string $key ): ?string { return $this->headers[ strtolower( $key ) ] ?? null; } public function set_header( string $key, string $value ): void { $this->headers[ strtolower( $key ) ] = $value; } } } if ( ! class_exists( 'WP_REST_Response' ) ) { class WP_REST_Response { private $data; private int $status; private array $headers = []; public function __construct( $data = null, int $status = 200 ) { $this->data = $data; $this->status = $status; } public function get_data() { return $this->data; } public function get_status(): int { return $this->status; } public function header( string $k, string $v ): void { $this->headers[ $k ] = $v; } public function get_headers(): array { return $this->headers; } } } if ( ! class_exists( 'WP_REST_Server' ) ) { class WP_REST_Server { const READABLE = 'GET'; const CREATABLE = 'POST'; const EDITABLE = 'POST, PUT, PATCH'; const DELETABLE = 'DELETE'; } } if ( ! function_exists( 'register_rest_route' ) ) { function register_rest_route( string $ns, string $route, array $args ): bool { return true; } } // WP_CLI stub (needed before loading CLI classes). if ( ! class_exists( 'WP_CLI' ) ) { class WP_CLI { public static function log( string $msg ): void {} public static function warning( string $msg ): void {} public static function success( string $msg ): void {} public static function error( string $msg ): void {} public static function add_command( string $name, $class ): void {} } } // ── Load plugin classes (TMDO_ prefix, dependency order) ────────────────── require_once TMDO_PATH . 'includes/class-tmdo-capability.php'; require_once TMDO_PATH . 'includes/class-tmdo-crypto.php'; require_once TMDO_PATH . 'includes/class-tmdo-safe-unserialize.php'; require_once TMDO_PATH . 'includes/class-tmdo-db.php'; require_once TMDO_PATH . 'includes/class-tmdo-logger.php'; require_once TMDO_PATH . 'includes/class-tmdo-feature-flags.php'; require_once TMDO_PATH . 'includes/class-tmdo-sqlite-compat.php'; require_once TMDO_PATH . 'includes/class-tmdo-installer.php'; require_once TMDO_PATH . 'includes/class-tmdo-schema-registry.php'; require_once TMDO_PATH . 'includes/class-tmdo-custom-table-registry.php'; require_once TMDO_PATH . 'includes/trait-tmdo-anti-eav-aware.php'; require_once TMDO_PATH . 'includes/class-tmdo-hook-bus-bridge.php'; require_once TMDO_PATH . 'includes/class-tmdo-conflict-monitor.php'; require_once TMDO_PATH . 'includes/class-tmdo-compatibility.php'; // Interceptors. require_once TMDO_PATH . 'includes/interceptors/class-tmdo-interceptor-base.php'; require_once TMDO_PATH . 'includes/interceptors/class-tmdo-sync-bridge.php'; // Zones. require_once TMDO_PATH . 'includes/zones/class-tmdo-zone-router.php'; require_once TMDO_PATH . 'includes/class-tmdo-routing-predicate.php'; require_once TMDO_PATH . 'includes/zones/class-tmdo-zone-hot.php'; require_once TMDO_PATH . 'includes/zones/class-tmdo-zone-warm.php'; require_once TMDO_PATH . 'includes/zones/class-tmdo-zone-cold.php'; require_once TMDO_PATH . 'includes/zones/class-tmdo-zone-archive.php'; // Query. require_once TMDO_PATH . 'includes/query/class-tmdo-query-interceptor-base.php'; require_once TMDO_PATH . 'includes/query/class-tmdo-query-router.php'; require_once TMDO_PATH . 'includes/query/class-tmdo-post-query-router.php'; // Migration. require_once TMDO_PATH . 'includes/migration/class-tmdo-migration-base.php'; require_once TMDO_PATH . 'includes/migration/class-tmdo-migration-engine.php'; require_once TMDO_PATH . 'includes/migration/class-tmdo-hot-migration.php'; require_once TMDO_PATH . 'includes/migration/class-tmdo-warm-migration.php'; require_once TMDO_PATH . 'includes/migration/class-tmdo-cold-migration.php'; require_once TMDO_PATH . 'includes/migration/class-tmdo-archive-migration.php'; // Integrations. require_once TMDO_PATH . 'includes/integrations/class-tmdo-term-comment-garbage-filter.php'; require_once TMDO_PATH . 'includes/integrations/class-tmdo-term-comment-misc-bucket.php'; require_once TMDO_PATH . 'includes/integrations/class-tmdo-member-fields.php'; require_once TMDO_PATH . 'includes/integrations/class-tmdo-post-fields.php'; require_once TMDO_PATH . 'includes/integrations/class-tmdo-points-manager.php'; require_once TMDO_PATH . 'includes/integrations/class-tmdo-demo-entity-counter.php'; // Cache + Classifier. require_once TMDO_PATH . 'includes/class-tmdo-cache-layer.php'; require_once TMDO_PATH . 'includes/class-tmdo-zone-classifier.php'; // Public API. require_once TMDO_PATH . 'includes/class-tmdo-api.php'; // v2 Upgrader. require_once TMDO_PATH . 'includes/class-tmdo-v2-upgrader.php'; // Snapshot system. require_once TMDO_PATH . 'includes/snapshots/class-tmdo-snapshot-manager.php'; require_once TMDO_PATH . 'includes/snapshots/class-tmdo-snapshot-writer.php'; require_once TMDO_PATH . 'includes/snapshots/class-tmdo-snapshot-reader.php'; require_once TMDO_PATH . 'includes/snapshots/class-tmdo-snapshot-pruner.php'; // FSM safety guard. require_once TMDO_PATH . 'includes/safety/class-tmdo-fsm-guard.php'; // Diagnostic — do NOT load site-health here; its DB checks would fail with // the stub $wpdb and trigger false schema_drift criticals in HealthCronTest. // TMDO_Site_Health loads lazily if needed by integration tests. require_once TMDO_PATH . 'includes/diagnostic/class-tmdo-health-cron.php'; require_once TMDO_PATH . 'includes/diagnostic/class-tmdo-monthly-summary.php'; require_once TMDO_PATH . 'includes/diagnostic/class-tmdo-site-metrics-collector.php'; // Notifiers. require_once TMDO_PATH . 'includes/notifications/abstract-class-tmdo-notifier.php'; require_once TMDO_PATH . 'includes/notifications/class-tmdo-email-notifier.php'; require_once TMDO_PATH . 'includes/notifications/class-tmdo-slack-notifier.php'; require_once TMDO_PATH . 'includes/notifications/class-tmdo-discord-notifier.php'; require_once TMDO_PATH . 'includes/notifications/class-tmdo-telegram-notifier.php'; // FSM advisor. require_once TMDO_PATH . 'includes/advisor/class-tmdo-fsm-advisor.php'; require_once TMDO_PATH . 'includes/advisor/class-tmdo-module-rules.php'; require_once TMDO_PATH . 'includes/advisor/class-tmdo-module-detector.php'; require_once TMDO_PATH . 'includes/advisor/class-tmdo-fsm-automator.php'; // Export. require_once TMDO_PATH . 'includes/export/class-tmdo-csv-writer.php'; // REST API. require_once TMDO_PATH . 'includes/class-tmdo-rest-api.php'; // Engine (v2.0.0). require_once TMDO_PATH . 'includes/engine/class-tmdo-type-caster.php'; require_once TMDO_PATH . 'includes/engine/class-tmdo-mode-manager.php'; require_once TMDO_PATH . 'includes/engine/class-tmdo-audit-logger.php'; require_once TMDO_PATH . 'includes/engine/class-tmdo-shadow-diff-logger.php'; require_once TMDO_PATH . 'includes/engine/class-tmdo-conflict-detector.php'; require_once TMDO_PATH . 'includes/engine/class-tmdo-cache-orchestrator.php'; require_once TMDO_PATH . 'includes/engine/class-tmdo-query-compiler.php'; require_once TMDO_PATH . 'includes/engine/class-tmdo-schema-manager.php'; require_once TMDO_PATH . 'includes/engine/class-tmdo-entity-registry.php'; require_once TMDO_PATH . 'includes/engine/class-tmdo-entity-migration-engine.php'; require_once TMDO_PATH . 'includes/engine/class-tmdo-entity-health.php'; require_once TMDO_PATH . 'includes/adapters/interface-entity-adapter.php'; require_once TMDO_PATH . 'includes/adapters/class-tmdo-adapter-post.php'; require_once TMDO_PATH . 'includes/adapters/class-tmdo-adapter-user.php'; require_once TMDO_PATH . 'includes/adapters/class-tmdo-adapter-term.php'; require_once TMDO_PATH . 'includes/adapters/class-tmdo-adapter-comment.php'; // Migration Orchestrator (needs Entity_Registry). require_once TMDO_PATH . 'includes/migration/interface-migration-phase.php'; require_once TMDO_PATH . 'includes/migration/class-tmdo-migration-phase-base.php'; require_once TMDO_PATH . 'includes/migration/phases/class-tmdo-phase-diagnose.php'; require_once TMDO_PATH . 'includes/migration/phases/class-tmdo-phase-backup.php'; require_once TMDO_PATH . 'includes/migration/phases/class-tmdo-phase-demote.php'; require_once TMDO_PATH . 'includes/migration/phases/class-tmdo-phase-install-schema.php'; require_once TMDO_PATH . 'includes/migration/phases/class-tmdo-phase-backfill-bulk.php'; require_once TMDO_PATH . 'includes/migration/phases/class-tmdo-phase-backfill-unserialize.php'; require_once TMDO_PATH . 'includes/migration/phases/class-tmdo-phase-promote-shadow.php'; require_once TMDO_PATH . 'includes/migration/phases/class-tmdo-phase-verify-sample.php'; require_once TMDO_PATH . 'includes/migration/phases/class-tmdo-phase-promote-aeav.php'; require_once TMDO_PATH . 'includes/migration/phases/class-tmdo-phase-cleanup.php'; require_once TMDO_PATH . 'includes/migration/phases/class-tmdo-phase-completed.php'; require_once TMDO_PATH . 'includes/migration/class-tmdo-migration-orchestrator.php'; require_once TMDO_PATH . 'includes/migration/class-tmdo-post-migration.php'; // Options Manager. require_once TMDO_PATH . 'modules/options/class-tmdo-options-manager.php'; // Stress testers + shadow verifiers. require_once TMDO_PATH . 'includes/class-tmdo-postmeta-cleaner.php'; require_once TMDO_PATH . 'includes/class-tmdo-termmeta-cleaner.php'; require_once TMDO_PATH . 'includes/class-tmdo-commentmeta-cleaner.php'; require_once TMDO_PATH . 'includes/class-tmdo-term-comment-shadow-verifier.php'; require_once TMDO_PATH . 'includes/class-tmdo-term-comment-backfill.php'; require_once TMDO_PATH . 'includes/class-tmdo-term-stress-tester.php'; require_once TMDO_PATH . 'includes/class-tmdo-comment-stress-tester.php'; require_once TMDO_PATH . 'includes/class-tmdo-user-stress-tester.php'; require_once TMDO_PATH . 'includes/class-tmdo-post-stress-tester.php'; require_once TMDO_PATH . 'includes/class-tmdo-post-shadow-verifier.php'; // Core. require_once TMDO_PATH . 'includes/class-tmdo-core.php'; // CLI. require_once TMDO_PATH . 'cli/class-tmdo-cli.php'; require_once TMDO_PATH . 'cli/class-tmdo-cli-v2.php'; require_once TMDO_PATH . 'cli/class-tmdo-cli-member.php'; require_once TMDO_PATH . 'cli/class-tmdo-cli-post.php'; require_once TMDO_PATH . 'cli/class-tmdo-cli-term-comment.php'; // Back-compat aliases (WPDO_* → TMDO_*) — must be last. require_once TMDO_PATH . 'includes/class-tmdo-back-compat.php'; // Global FSM Guard bypass for all unit tests except FSMGuardTest itself. // FSMGuardTest::setUp() clears _wp_filter_callbacks to restore guard behavior. if ( ! function_exists( '__return_true' ) ) { function __return_true(): bool { return true; } } add_filter( 'wpdo/fsm_guard/bypass', '__return_true' ); // ── AddOn stubs (classes moved to optional AddOns) ───────────────────────── // TMDO_Listing_Stats → 2meet-data-optimizer-hivepress-addon. // Tests that hit REST endpoints using listing stats receive stub responses. if ( ! class_exists( 'TMDO_Listing_Stats' ) ) { class TMDO_Listing_Stats { public static function register(): void {} public static function get_view_count( int $post_id ): int { return 0; } public static function increment_view( int $post_id, string $ip = '' ): int { return 0; } public static function is_rate_limited( int $post_id, string $ip ): bool { return false; } } class_alias( 'TMDO_Listing_Stats', 'WPDO_Listing_Stats' ); }