mirror of
https://github.com/WenPai-org/wptag.git
synced 2025-08-04 04:44:55 +08:00
Refactor plugin structure and remove legacy admin code
Removed old admin controllers, interfaces, AJAX handlers, and partials. Introduced new classes in the includes directory for admin, config, frontend, loader, output manager, and validator. Updated asset files and main plugin entry point to use the new structure. Cleaned up obsolete files and improved overall maintainability.
This commit is contained in:
parent
840a779a84
commit
6d56c60b26
28 changed files with 3276 additions and 4899 deletions
|
@ -1,41 +1,16 @@
|
|||
<?php
|
||||
|
||||
if (!defined('WP_UNINSTALL_PLUGIN')) {
|
||||
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$settings = get_option('wptag_settings', []);
|
||||
delete_option( 'universal_tracking_codes_settings' );
|
||||
|
||||
if (empty($settings['cleanup_on_uninstall'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
global $wpdb;
|
||||
|
||||
$tables = [
|
||||
$wpdb->prefix . 'wptag_snippets',
|
||||
$wpdb->prefix . 'wptag_templates',
|
||||
$wpdb->prefix . 'wptag_logs'
|
||||
];
|
||||
|
||||
foreach ($tables as $table) {
|
||||
$wpdb->query("DROP TABLE IF EXISTS {$table}");
|
||||
}
|
||||
|
||||
$options = [
|
||||
'wptag_db_version',
|
||||
'wptag_settings',
|
||||
'wptag_activated',
|
||||
'wptag_cache_cleared'
|
||||
];
|
||||
|
||||
foreach ($options as $option) {
|
||||
delete_option($option);
|
||||
}
|
||||
|
||||
delete_transient('wptag_admin_notice');
|
||||
|
||||
wp_clear_scheduled_hook('wptag_cleanup_logs');
|
||||
wp_clear_scheduled_hook('wptag_cache_cleanup');
|
||||
|
||||
wp_cache_flush();
|
||||
if ( is_multisite() ) {
|
||||
$sites = get_sites();
|
||||
foreach ( $sites as $site ) {
|
||||
switch_to_blog( $site->blog_id );
|
||||
delete_option( 'universal_tracking_codes_settings' );
|
||||
restore_current_blog();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue