- Implement singleton pattern for HVAC_Enhanced_Settings to prevent duplicate initialization - Fix jQuery selector error by checking for valid hash selectors before using $(href) - Add default email templates with professional copy for trainer notifications - Update plugin version to 1.0.1 for cache busting - Remove duplicate Enhanced Settings initialization from HVAC_Community_Events - Add force cache refresh suffix to admin scripts This resolves the duplicate content issue on email templates page and fixes JavaScript errors in the admin interface. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
57 lines
No EOL
1.4 KiB
PHP
57 lines
No EOL
1.4 KiB
PHP
<?php
|
|
/**
|
|
* Plugin Deactivator for HVAC Community Events
|
|
*
|
|
* Handles plugin deactivation tasks
|
|
*
|
|
* @package HVAC_Community_Events
|
|
* @since 1.0.0
|
|
*/
|
|
|
|
if (!defined('ABSPATH')) {
|
|
exit;
|
|
}
|
|
|
|
/**
|
|
* HVAC_Deactivator class
|
|
*/
|
|
class HVAC_Deactivator {
|
|
|
|
/**
|
|
* Deactivate the plugin
|
|
*
|
|
* @return void
|
|
*/
|
|
public static function deactivate() {
|
|
HVAC_Logger::info('Starting plugin deactivation', 'Deactivator');
|
|
|
|
// Clear scheduled cron jobs
|
|
self::clear_cron_jobs();
|
|
|
|
// Flush rewrite rules
|
|
flush_rewrite_rules();
|
|
|
|
HVAC_Logger::info('Plugin deactivation completed', 'Deactivator');
|
|
}
|
|
|
|
/**
|
|
* Clear scheduled cron jobs
|
|
*
|
|
* @return void
|
|
*/
|
|
private static function clear_cron_jobs() {
|
|
// Clear daily trainer status check
|
|
$timestamp = wp_next_scheduled('hvac_daily_trainer_status_check');
|
|
if ($timestamp) {
|
|
wp_unschedule_event($timestamp, 'hvac_daily_trainer_status_check');
|
|
HVAC_Logger::info('Cleared daily trainer status check cron', 'Deactivator');
|
|
}
|
|
|
|
// Clear weekly cleanup
|
|
$timestamp = wp_next_scheduled('hvac_weekly_cleanup');
|
|
if ($timestamp) {
|
|
wp_unschedule_event($timestamp, 'hvac_weekly_cleanup');
|
|
HVAC_Logger::info('Cleared weekly cleanup cron', 'Deactivator');
|
|
}
|
|
}
|
|
} |