mirror of
https://github.com/woodchen-ink/czlexpress-for-woocommerce.git
synced 2025-07-18 14:01:58 +08:00
- 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.
46 lines
1.0 KiB
PHP
46 lines
1.0 KiB
PHP
<?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');
|