fix(2meet-data-optimizer): 1.4.2 acceptance fixes for archive sweep and uninstall
Anti-EAV Lint + Quality Gate / anti-eav-lint (pull_request) Successful in 21s
Tests / PHP Lint (pull_request) Successful in 18s
Tests / Unit Tests (pull_request) Successful in 41s
Tests / Integration Tests (pull_request) Successful in 1m25s
Tests / PHPCS (pull_request) Successful in 44s
Tests / PHPStan (pull_request) Successful in 47s
Anti-EAV Lint + Quality Gate / anti-eav-lint (pull_request) Successful in 21s
Tests / PHP Lint (pull_request) Successful in 18s
Tests / Unit Tests (pull_request) Successful in 41s
Tests / Integration Tests (pull_request) Successful in 1m25s
Tests / PHPCS (pull_request) Successful in 44s
Tests / PHPStan (pull_request) Successful in 47s
- Archive sweep waits until idx_original_meta exists (a plugin update does not run dbDelta; without the index NOT EXISTS scans the archive per row) - Duplicate archive cleanup runs from WP-CLI only, never in a web activation - Uninstall keeps the LatePoint add-on's tmdo_latepoint_db_version - AJAX save errors stay on screen instead of fading after 2.5 s - Verify: 2 new integration tests; unit 711, integration 612, phpcs 0, stan OK - PR: PR-141 (2.4.2 correctness review)
This commit is contained in:
@@ -218,7 +218,8 @@ class TMDO_Installer {
|
||||
self::install_v2_tables();
|
||||
|
||||
// 1.4.2: archive sweeps before this release copied trashed meta daily.
|
||||
if ( class_exists( 'TMDO_Zone_Archive' ) ) {
|
||||
// One unbounded DELETE: CLI only, never in a web activation.
|
||||
if ( defined( 'WP_CLI' ) && WP_CLI && class_exists( 'TMDO_Zone_Archive' ) ) {
|
||||
global $wpdb;
|
||||
$archive = TMDO_Zone_Archive::table();
|
||||
if ( $archive === $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $archive ) ) ) ) {
|
||||
@@ -993,6 +994,7 @@ class TMDO_Installer {
|
||||
// accidental option removal.
|
||||
// 1.4.2: tmdo_* options and their transients too (tmdo_schema_deferred,
|
||||
// tmdo_entity_indexes, tmdo_cov_* …) — a reinstall saw stale ones.
|
||||
// tmdo_latepoint_* belongs to the LatePoint add-on.
|
||||
foreach ( array( 'wpdo_', 'tmdo_', '_transient_tmdo_', '_transient_timeout_tmdo_' ) as $prefix ) {
|
||||
$residual = $wpdb->get_col(
|
||||
$wpdb->prepare(
|
||||
@@ -1001,7 +1003,7 @@ class TMDO_Installer {
|
||||
)
|
||||
);
|
||||
foreach ( (array) $residual as $opt ) {
|
||||
if ( preg_match( '/^(_transient_(timeout_)?)?(wpdo|tmdo)_[a-zA-Z0-9_]+$/', $opt ) && delete_option( $opt ) ) {
|
||||
if ( preg_match( '/^(_transient_(timeout_)?)?(wpdo|tmdo)_(?!latepoint_)[a-zA-Z0-9_]+$/', $opt ) && delete_option( $opt ) ) {
|
||||
++$options_deleted;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user