| @@ -2,9 +2,9 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * MetaSync — Runtime Feature Initialisers |
| 4 | 4 | * |
| 5 | 5 | * GA4 analytics, API backoff, review notice, the global metasync_get_jwt_token() |
| 6 | - * accessor, and the debug mode manager. Extracted from metasync.php (WP-530) to | |
| 6 | + * accessor, and the debug mode manager. Extracted from metasync.php to | |
| 7 | 7 | * keep the plugin entry file a lean bootstrap. Loaded via require_once from |
| 8 | 8 | * metasync.php; each initialiser registers its own hook. Function names and hook |
| 9 | 9 | * timing are unchanged. |
| 10 | 10 | * |
| @@ -61,8 +61,23 @@ | ||
| 61 | 61 | Metasync_Review_Notice::get_instance(); |
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | add_action('init', 'metasync_init_review_notice'); |
| 65 | + | |
| 66 | +/** | |
| 67 | + * Initialize Host Blocking Check | |
| 68 | + * Owns the shared GET/POST reachability probe, its post-activation + weekly crons, | |
| 69 | + * and the warning notice. Initialised unconditionally (not gated on is_admin) because | |
| 70 | + * the cron callbacks must be registered on WP-Cron requests, where is_admin() is false. | |
| 71 | + * @since 2.8.x | |
| 72 | + */ | |
| 73 | +function metasync_init_host_blocking_check() { | |
| 74 | + if (metasync_is_non_metasync_admin_ajax()) { | |
| 75 | + return; | |
| 76 | + } | |
| 77 | + Metasync_Host_Blocking_Check::get_instance(); | |
| 78 | +} | |
| 79 | +add_action('plugins_loaded', 'metasync_init_host_blocking_check'); | |
| 65 | 80 | |
| 66 | 81 | /** |
| 67 | 82 | * Global convenience function to get active JWT token |
| 68 | 83 | * Can be called from anywhere in WordPress (themes, other plugins, etc.) |