| @@ -63,8 +63,23 @@ | ||
| 63 | 63 | } |
| 64 | 64 | add_action('init', 'metasync_init_review_notice'); |
| 65 | 65 | |
| 66 | 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'); | |
| 80 | + | |
| 81 | +/** | |
| 67 | 82 | * Global convenience function to get active JWT token |
| 68 | 83 | * Can be called from anywhere in WordPress (themes, other plugins, etc.) |
| 69 | 84 | * |
| 70 | 85 | * @param bool $force_refresh Force generation of new token even if cached one exists |