| @@ -75,17 +75,18 @@ | ||
| 75 | 75 | wp_cache_flush(); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | ################################################################# |
| 79 | - // Schedule AI Cache Cleanup Cron /////////////////////////////// | |
| 80 | - WPF()->ai_client->schedule_cache_cleanup(); | |
| 79 | + // Reconcile AI crons against current connection state. | |
| 80 | + // Connected tenants get the recurring AI maintenance crons; everyone | |
| 81 | + // else (free installs that never enabled AI, disconnected accounts) gets | |
| 82 | + // stale AI events cleared out of wp_options.cron. | |
| 83 | + WPF()->ai_client->sync_cron_state(); | |
| 81 | 84 | |
| 82 | - // Schedule daily subscription sync (updates cached subscription status) | |
| 83 | - WPF()->ai_client->schedule_daily_subscription_sync(); | |
| 85 | + // Schedule Email Queue Cleanup Cron (non-AI, always on) | |
| 86 | + WPF()->email_queue->schedule_cleanup_cron(); | |
| 87 | + WPF()->email_queue->reset_stuck_processing(); | |
| 84 | 88 | |
| 85 | - // Schedule AI Moderation Log Cleanup Cron | |
| 86 | - \wpforo\classes\AIContentModeration::get_instance()->schedule_moderation_cleanup(); | |
| 87 | - | |
| 88 | 89 | // Note: AI Pending Topics Indexing Cron is scheduled when user |
| 89 | 90 | // enables auto-indexing in the admin settings (disabled by default) |
| 90 | 91 | } |
| 91 | 92 | |
| @@ -503,8 +504,16 @@ | ||
| 503 | 504 | OR `option_name` REGEXP '^" . WPF()->base_prefix . "'" |
| 504 | 505 | ); |
| 505 | 506 | WPF()->db->query( "DELETE FROM `" . WPF()->db->usermeta . "` WHERE `meta_key` REGEXP '^" . WPF()->base_prefix . "'" ); |
| 506 | 507 | foreach( WPF()->_base_tables as $table ) WPF()->db->query( "DROP TABLE IF EXISTS `" . wpforo_fix_table_name( $table ) . "`" ); |
| 508 | + | |
| 509 | + // gVectors News module cleanup — shared gvectors_* data is removed only when | |
| 510 | + // no other gVectors plugin (wpDiscuz, ...) carrying the module remains installed | |
| 511 | + if( class_exists( \gVectors\News\NewsModule::class ) ) { | |
| 512 | + $gv_news_config = \gVectors\News\NewsModule::get( WPFORO_BASEFOLDER, 'config' ); | |
| 513 | + if( $gv_news_config ) \gVectors\News\NewsModule::uninstall( $gv_news_config ); | |
| 514 | + } | |
| 515 | + | |
| 507 | 516 | deactivate_plugins( WPFORO_BASENAME ); |
| 508 | 517 | } |
| 509 | 518 | |
| 510 | 519 | function wpforo_profile_notice() { |