Skip to content

Commit

Permalink
Update QTS migration notice checks (#1171)
Browse files Browse the repository at this point in the history
- the checks on migrated items is made obsolete by new migration
- the quick check is incompatible with renamed `qts_options`.
  Disable it temporarily, to be restored before new release.
  • Loading branch information
herrvigg committed May 29, 2022
1 parent 346d2ee commit 3d395bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
9 changes: 5 additions & 4 deletions admin/qtx_activation_hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -935,10 +935,11 @@ function qtranxf_admin_notices_slugs_migrate() {
if ( qtranxf_check_admin_notice( 'slugs-migrate' ) || ! QTX_Module_Loader::is_module_active( 'slugs' ) ) {
return;
}
$old_value = get_option( 'qts_options' ); // Very quick check to avoid loading more code.
if ( ! $old_value ) {
return;
}
// TODO: restore quick check before release (temporarily disabled for master dev)
// $old_value = get_option( 'qts_options' ); // Very quick check to avoid loading more code.
// if ( ! $old_value ) {
// return;
// }
require_once( QTRANSLATE_DIR . '/modules/slugs/admin/slugs-migrate-qts.php' );
$msg = qtranxf_slugs_check_migrate_qts(); // More advanced checks with QTS meta.
if ( empty( $msg ) ) {
Expand Down
8 changes: 0 additions & 8 deletions modules/slugs/admin/slugs-migrate-qts.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ function qtranxf_slugs_check_migrate_qts() {
}
};

$msg = [];
$count_slugs( $wpdb->postmeta, QTX_SLUGS_META_PREFIX, $msg );
$count_slugs( $wpdb->termmeta, QTX_SLUGS_META_PREFIX, $msg );
if ( ! empty( $msg ) ) {
// Found some post/term meta with the new keys, no migrate to suggest (it can still be done manually).
return '';
}

$msg = [];
$count_slugs( $wpdb->postmeta, QTX_SLUGS_LEGACY_QTS_META_PREFIX, $msg );
$count_slugs( $wpdb->termmeta, QTX_SLUGS_LEGACY_QTS_META_PREFIX, $msg );
Expand Down

0 comments on commit 3d395bd

Please sign in to comment.