| 1 |
<?php |
| 2 |
/** |
| 3 |
* What removing ThinkRank has to clean up. |
| 4 |
* |
| 5 |
* Deactivation and uninstall both need the cron-hook and capability lists, and |
| 6 |
* uninstall runs with no autoloader — `WP_UNINSTALL_PLUGIN` loads `uninstall.php` |
| 7 |
* on its own, without the plugin. So the lists live here as a plain array this |
| 8 |
* file returns, which both paths `require`, rather than as three hand-maintained |
| 9 |
* copies that drift (#389, #399). |
| 10 |
* |
| 11 |
* Deliberately nothing in the `thinkrank_pro_` namespace: ThinkRank Pro creates |
| 12 |
* those hooks and ships its own uninstaller, and removing only the free plugin |
| 13 |
* must not tear down a still-active Pro install (#384). |
| 14 |
* |
| 15 |
* @package ThinkRank |
| 16 |
* @since 2.0.1 |
| 17 |
*/ |
| 18 |
|
| 19 |
declare(strict_types=1); |
| 20 |
|
| 21 |
// Prevent direct access. Reached only via require() from the deactivator and |
| 22 |
// uninstall.php, both of which run with WordPress loaded, so this costs the |
| 23 |
// callers nothing — it was the one tracked file in the plugin without the |
| 24 |
// guard, which Plugin Check flags as direct file access (#517). |
| 25 |
if (!defined('ABSPATH')) { |
| 26 |
exit; |
| 27 |
} |
| 28 |
|
| 29 |
return [ |
| 30 |
/* |
| 31 |
* Every hook the free plugin schedules. Clearing one that was never |
| 32 |
* scheduled is a no-op, so a hook that only some configurations reach is |
| 33 |
* still safe to list — and cheaper than discovering it survived. |
| 34 |
* |
| 35 |
* Keep in sync with the wp_schedule_event() / wp_schedule_single_event() |
| 36 |
* call sites; CleanupManifestTest fails when a new one appears. |
| 37 |
*/ |
| 38 |
'cron_hooks' => [ |
| 39 |
'thinkrank_cache_cleanup', |
| 40 |
'thinkrank_daily_cleanup', |
| 41 |
'thinkrank_usage_analytics', |
| 42 |
'thinkrank_put_do_daily_action', |
| 43 |
// Google token refresh. Scheduled on the custom `thinkrank_45min` |
| 44 |
// recurrence, whose cron_schedules filter disappears with the plugin — |
| 45 |
// so a survivor here is a recurring event WordPress can no longer |
| 46 |
// resolve an interval for. |
| 47 |
'thinkrank_google_token_refresh', |
| 48 |
'thinkrank_collect_performance_data', |
| 49 |
'thinkrank_regenerate_sitemap', |
| 50 |
'thinkrank_regenerate_sitemap_settings', |
| 51 |
'thinkrank_ai_traffic_prune', |
| 52 |
'thinkrank_instant_indexing_reconcile', |
| 53 |
'thinkrank_instant_indexing_submit', |
| 54 |
'thinkrank_email_report_tick', |
| 55 |
// Retired with the Brand Visibility feature. Still listed so deactivation |
| 56 |
// and uninstall clear events a site scheduled before it was removed. |
| 57 |
'thinkrank_bv_tick', |
| 58 |
'thinkrank_bv_watchdog', |
| 59 |
// Moved to ThinkRank Pro with Auto AI metadata, which schedules its own |
| 60 |
// `thinkrank_pro_` hook. Still listed so events queued before the move |
| 61 |
// are cleared. |
| 62 |
'thinkrank_auto_ai_optimize', |
| 63 |
], |
| 64 |
|
| 65 |
/* |
| 66 |
* Every capability the plugin grants, including the pre-Role-Manager slugs |
| 67 |
* older versions handed out, so a historical role is cleaned too. |
| 68 |
* |
| 69 |
* Keep in sync with ThinkRank\Core\Capability_Manager::capabilities(); |
| 70 |
* CleanupManifestTest pins the two together. |
| 71 |
*/ |
| 72 |
'capabilities' => [ |
| 73 |
'thinkrank_access', |
| 74 |
'thinkrank_site_identity', |
| 75 |
'thinkrank_analytics', |
| 76 |
'thinkrank_performance', |
| 77 |
'thinkrank_global_seo', |
| 78 |
'thinkrank_image_seo', |
| 79 |
'thinkrank_schema', |
| 80 |
'thinkrank_social_media', |
| 81 |
'thinkrank_crawling', |
| 82 |
'thinkrank_instant_indexing', |
| 83 |
'thinkrank_author_archives', |
| 84 |
'thinkrank_content_tools', |
| 85 |
'thinkrank_ai_insights', |
| 86 |
'thinkrank_internal_links', |
| 87 |
'thinkrank_redirections', |
| 88 |
'thinkrank_broken_links', |
| 89 |
'thinkrank_external_links', |
| 90 |
'thinkrank_woocommerce', |
| 91 |
'thinkrank_settings', |
| 92 |
'thinkrank_manage_roles', |
| 93 |
// Legacy slugs (pre-Role Manager). |
| 94 |
'thinkrank_manage_settings', |
| 95 |
'thinkrank_view_analytics', |
| 96 |
'thinkrank_manage_credits', |
| 97 |
'thinkrank_use_ai_features', |
| 98 |
], |
| 99 |
]; |
| 100 |
|