diff --git a/2meet-data-optimizer-latepoint-addon.php b/2meet-data-optimizer-latepoint-addon.php index bd77c18..6ee3a2f 100644 --- a/2meet-data-optimizer-latepoint-addon.php +++ b/2meet-data-optimizer-latepoint-addon.php @@ -3,7 +3,7 @@ * Plugin Name: 2meet Data Optimizer — Latepoint AddOn * Plugin URI: https://2meet.io/2meet-data-optimizer/latepoint * Description: LatePoint 預約系統 booking 索引同步(4 hook → wp_hpct_latepoint_idx) - * Version: 0.1.1 + * Version: 0.1.2 * Requires at least: 6.0 * Tested up to: 6.9.4 * Requires PHP: 8.1 @@ -24,7 +24,7 @@ if ( ! defined( 'ABSPATH' ) ) { exit; } -define( 'TMDO_LATEPOINT_VERSION', '0.1.1' ); +define( 'TMDO_LATEPOINT_VERSION', '0.1.2' ); define( 'TMDO_LATEPOINT_PATH', plugin_dir_path( __FILE__ ) ); define( 'TMDO_LATEPOINT_URL', plugin_dir_url( __FILE__ ) ); define( 'TMDO_LATEPOINT_FILE', __FILE__ ); diff --git a/CHANGELOG.md b/CHANGELOG.md index cb564ca..15e437f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,17 @@ Versioning follows [Semantic Versioning](https://semver.org/). --- +## [0.1.2] — 2026-09-26 + +### Fixed + +- Uninstall now drops `wp_hpct_latepoint_idx` (every site on multisite) and the + `tmdo_latepoint_db_version` option. 0.1.1 started creating the table, but + `uninstall.php` was still the Phase 0 stub and left it behind. The table is + an index rebuilt from LatePoint's bookings; LatePoint's own tables are kept. + +--- + ## [0.1.1] — 2026-08-08 — 補上從未存在的 `wp_hpct_latepoint_idx` 建表流程 ### Fixed diff --git a/uninstall.php b/uninstall.php index d603e12..6e58c0d 100644 --- a/uninstall.php +++ b/uninstall.php @@ -11,4 +11,18 @@ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { exit; } -// Phase 3 完整實作。Phase 0 stub:保留所有資料以避免誤刪。 +// wp_hpct_latepoint_idx is an index rebuilt from LatePoint's own bookings, so +// dropping it loses no data; LatePoint's tables are left untouched. +global $wpdb; + +$tmdo_latepoint_blogs = is_multisite() ? get_sites( array( 'fields' => 'ids' ) ) : array( get_current_blog_id() ); +foreach ( $tmdo_latepoint_blogs as $tmdo_latepoint_blog ) { + if ( is_multisite() ) { + switch_to_blog( $tmdo_latepoint_blog ); + } + $wpdb->query( 'DROP TABLE IF EXISTS `' . $wpdb->prefix . 'hpct_latepoint_idx`' ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.SchemaChange + delete_option( 'tmdo_latepoint_db_version' ); + if ( is_multisite() ) { + restore_current_blog(); + } +}