wood chen 16965b29e1 Enhance CZL Express for WooCommerce Plugin Functionality
- Updated plugin URI for better branding consistency.
- Added environment checks to ensure WooCommerce is installed and meets version requirements.
- Improved AJAX handling for shipment creation and tracking updates, including enhanced error messages.
- Streamlined order management with new custom order statuses and improved logging for better tracking.
- Removed deprecated API test page and updated admin interface for clarity.
- Enhanced localization by ensuring all translatable strings use esc_html functions for security.

These changes improve the robustness, usability, and maintainability of the CZL Express plugin.
2025-01-15 00:08:34 +08:00

46 lines
1.0 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// 如果没有通过WordPress调用则退出
if (!defined('WP_UNINSTALL_PLUGIN')) {
exit;
}
// 删除数据表
global $wpdb;
// 删除所有相关的数据表
$tables = array(
'czl_shipments',
'czl_tracking_history',
'czl_shipping_rules',
'czl_product_groups'
);
foreach ($tables as $table) {
$wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}{$table}");
}
// 删除所有相关的选项
$options = array(
'czl_express_api_url',
'czl_express_api_key',
'czl_express_api_secret',
'czl_express_test_mode',
'czl_express_version',
'czl_last_tracking_sync',
'czl_express_db_version',
'czl_product_groups',
'czl_username',
'czl_password',
'czl_rate_adjustment'
);
foreach ($options as $option) {
delete_option($option);
}
// 删除所有订单的相关元数据
$wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE meta_key LIKE '_czl_%'");
// 清理定时任务
wp_clear_scheduled_hook('czl_sync_tracking_numbers_hook');
wp_clear_scheduled_hook('czl_update_tracking_info');