From 2c300652a6e5168faec43e0b26ac9497092f66e2 Mon Sep 17 00:00:00 2001 From: Javier Casares Date: Mon, 2 Mar 2026 14:31:34 +0000 Subject: [PATCH] v1.1.0 --- changelog.txt | 19 +++ .../class-robotstxt-mlp2-mlp5-admin-page.php | 22 ++- ...class-robotstxt-mlp2-mlp5-step-cleanup.php | 32 +++-- ...ass-robotstxt-mlp2-mlp5-table-preparer.php | 86 +++++++++++- languages/robotstxt-mlp2-mlp5-es_ES.mo | Bin 16604 -> 16884 bytes languages/robotstxt-mlp2-mlp5-es_ES.po | 6 + languages/robotstxt-mlp2-mlp5.pot | 130 ++++++++++-------- readme.txt | 13 +- robotstxt-mlp2-mlp5.php | 4 +- 9 files changed, 230 insertions(+), 82 deletions(-) diff --git a/changelog.txt b/changelog.txt index c9f98e4..24eb1c0 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,24 @@ == Changelog == += 1.1.0 = + +_Release date: 2026-03-02_ + +**Fixed** + +* `mlp_migrator_log` (the plugin's own table) was incorrectly listed in the System Status as an MLP2 table requiring renaming. It is now excluded from `get_original_tables()` as it already was from `rename_to_backup()`. + +**Changed** + +* MLP2 sitemeta keys (`inpsyde_multilingual*`) are now **renamed** to `mlp2bak_inpsyde_multilingual*` during the table preparation step, instead of being deleted. This makes the operation fully reversible. +* Restoring original table names (`Restore original table names`) now also restores the original sitemeta key names. +* Cleanup step (Step 6, "Delete MLP2 network settings") now also deletes the backed-up `mlp2bak_inpsyde_multilingual*` sitemeta keys alongside the existing `mlp_*` keys. + +**Compatibility** + +* WordPress: 6.7 – 6.9 +* PHP: 8.2 – 8.5 + = 1.0.0 = _Release date: 2026-02-27_ diff --git a/includes/class-robotstxt-mlp2-mlp5-admin-page.php b/includes/class-robotstxt-mlp2-mlp5-admin-page.php index a844f83..44a8bb2 100644 --- a/includes/class-robotstxt-mlp2-mlp5-admin-page.php +++ b/includes/class-robotstxt-mlp2-mlp5-admin-page.php @@ -89,11 +89,15 @@ class Robotstxt_Mlp2_Mlp5_Admin_Page { if ( ! current_user_can( self::CAPABILITY ) ) { wp_die( esc_html__( 'You do not have permission to perform this action.', 'robotstxt-mlp2-mlp5' ) ); } - $result = Robotstxt_Mlp2_Mlp5_Table_Preparer::rename_to_backup(); - $args = array( 'renamed' => count( $result['renamed'] ) ); + $result = Robotstxt_Mlp2_Mlp5_Table_Preparer::rename_to_backup(); + $sitemeta_renamed = Robotstxt_Mlp2_Mlp5_Table_Preparer::rename_mlp2_sitemeta(); + $args = array( 'renamed' => count( $result['renamed'] ) ); if ( ! empty( $result['errors'] ) ) { $args['rename_errors'] = count( $result['errors'] ); } + if ( $sitemeta_renamed > 0 ) { + $args['sitemeta_renamed'] = $sitemeta_renamed; + } wp_safe_redirect( self::page_url( $args ) ); exit; } @@ -106,11 +110,15 @@ class Robotstxt_Mlp2_Mlp5_Admin_Page { if ( ! current_user_can( self::CAPABILITY ) ) { wp_die( esc_html__( 'You do not have permission to perform this action.', 'robotstxt-mlp2-mlp5' ) ); } - $result = Robotstxt_Mlp2_Mlp5_Table_Preparer::restore_from_backup(); - $args = array( 'restored' => count( $result['restored'] ) ); + $result = Robotstxt_Mlp2_Mlp5_Table_Preparer::restore_from_backup(); + $sitemeta_restored = Robotstxt_Mlp2_Mlp5_Table_Preparer::restore_mlp2_sitemeta(); + $args = array( 'restored' => count( $result['restored'] ) ); if ( ! empty( $result['errors'] ) ) { $args['restore_errors'] = count( $result['errors'] ); } + if ( $sitemeta_restored > 0 ) { + $args['sitemeta_restored'] = $sitemeta_restored; + } wp_safe_redirect( self::page_url( $args ) ); exit; } @@ -423,6 +431,12 @@ class Robotstxt_Mlp2_Mlp5_Admin_Page { /* translators: %d: number of tables that could not be renamed */ printf( '

%s

', esc_html( sprintf( _n( '%d table could not be renamed. Check database permissions.', '%d tables could not be renamed. Check database permissions.', $count, 'robotstxt-mlp2-mlp5' ), $count ) ) ); // phpcs:ignore WordPress.WP.I18n.MismatchedPlaceholders } + if ( isset( $_GET['sitemeta_renamed'] ) ) { + printf( '

%s

', esc_html__( 'MLP2 sitemeta backed up. MultilingualPress 5 can now activate cleanly.', 'robotstxt-mlp2-mlp5' ) ); + } + if ( isset( $_GET['sitemeta_restored'] ) ) { + printf( '

%s

', esc_html__( 'MLP2 sitemeta restored to original keys.', 'robotstxt-mlp2-mlp5' ) ); + } if ( isset( $_GET['restored'] ) ) { $count = (int) $_GET['restored']; /* translators: %d: number of restored tables */ diff --git a/includes/class-robotstxt-mlp2-mlp5-step-cleanup.php b/includes/class-robotstxt-mlp2-mlp5-step-cleanup.php index b58faf3..8f22877 100644 --- a/includes/class-robotstxt-mlp2-mlp5-step-cleanup.php +++ b/includes/class-robotstxt-mlp2-mlp5-step-cleanup.php @@ -80,26 +80,36 @@ class Robotstxt_Mlp2_Mlp5_Step_Cleanup { /** * Delete MLP2-related entries from wp_sitemeta. * - * Removes all sitemeta keys whose name starts with 'mlp_' (MLP2 prefix). + * Removes sitemeta keys matching 'mlp_*' (MLP2 prefix) and + * 'mlp2bak_inpsyde_multilingual*' (backed-up MLP2 sitemeta). * * @return int Number of keys deleted. */ public static function remove_mlp2_sitemeta(): int { global $wpdb; - $like = $wpdb->esc_like( 'mlp_' ) . '%'; - - // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching - $keys = $wpdb->get_col( - $wpdb->prepare( - "SELECT meta_key FROM {$wpdb->sitemeta} WHERE meta_key LIKE %s AND site_id = %d", - $like, - get_current_network_id() - ) + $patterns = array( + $wpdb->esc_like( 'mlp_' ) . '%', + $wpdb->esc_like( Robotstxt_Mlp2_Mlp5_Table_Preparer::SITEMETA_BACKUP_PREFIX ) . '%', ); + $keys = array(); + foreach ( $patterns as $like ) { + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching + $found = $wpdb->get_col( + $wpdb->prepare( + "SELECT meta_key FROM {$wpdb->sitemeta} WHERE meta_key LIKE %s AND site_id = %d", + $like, + get_current_network_id() + ) + ); + if ( is_array( $found ) ) { + $keys = array_merge( $keys, $found ); + } + } + $deleted = 0; - foreach ( (array) $keys as $key ) { + foreach ( array_unique( $keys ) as $key ) { if ( delete_site_option( $key ) ) { ++$deleted; } diff --git a/includes/class-robotstxt-mlp2-mlp5-table-preparer.php b/includes/class-robotstxt-mlp2-mlp5-table-preparer.php index 193d0ad..751ff75 100644 --- a/includes/class-robotstxt-mlp2-mlp5-table-preparer.php +++ b/includes/class-robotstxt-mlp2-mlp5-table-preparer.php @@ -84,7 +84,8 @@ class Robotstxt_Mlp2_Mlp5_Table_Preparer { } /** - * Return all tables in the database with the original MLP2 prefix. + * Return all tables in the database with the original MLP2 prefix, + * excluding tables that belong to this plugin. * * @return string[] Array of full table names. */ @@ -96,7 +97,21 @@ class Robotstxt_Mlp2_Mlp5_Table_Preparer { // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching $tables = $wpdb->get_col( $wpdb->prepare( 'SHOW TABLES LIKE %s', $like ) ); - return is_array( $tables ) ? $tables : array(); + if ( ! is_array( $tables ) ) { + return array(); + } + + $prefix = $wpdb->base_prefix . self::ORIGINAL_FRAGMENT; + + return array_values( + array_filter( + $tables, + static function ( string $table ) use ( $prefix ): bool { + $suffix = substr( $table, strlen( $prefix ) ); + return ! in_array( $suffix, self::PLUGIN_TABLE_SUFFIXES, true ); + } + ) + ); } /** @@ -115,6 +130,73 @@ class Robotstxt_Mlp2_Mlp5_Table_Preparer { return is_array( $tables ) ? $tables : array(); } + /** + * Sitemeta key prefix used by MLP2 that blocks MLP5 activation. + * + * @var string + */ + const SITEMETA_ORIGINAL_PREFIX = 'inpsyde_multilingual'; + + /** + * Prefix prepended to MLP2 sitemeta keys when backing them up. + * + * @var string + */ + const SITEMETA_BACKUP_PREFIX = 'mlp2bak_inpsyde_multilingual'; + + /** + * Rename MLP2 blocking sitemeta keys to backup names. + * + * MLP5's SystemChecker detects any sitemeta key starting with + * `inpsyde_multilingual` and refuses to activate. This method renames + * those keys to `mlp2bak_inpsyde_multilingual*` so MLP5 can activate + * cleanly while the original data is preserved for restore or cleanup. + * + * @return int Number of sitemeta rows renamed. + */ + public static function rename_mlp2_sitemeta(): int { + global $wpdb; + + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching + $renamed = $wpdb->query( + $wpdb->prepare( + "UPDATE {$wpdb->sitemeta} SET meta_key = CONCAT( %s, SUBSTR( meta_key, %d ) ) WHERE meta_key LIKE %s AND site_id = %d", + 'mlp2bak_', + 1, + $wpdb->esc_like( self::SITEMETA_ORIGINAL_PREFIX ) . '%', + get_current_network_id() + ) + ); + + return is_int( $renamed ) ? $renamed : 0; + } + + /** + * Restore backup sitemeta keys to their original MLP2 names. + * + * Reverses rename_mlp2_sitemeta(). Only use this before MLP5 has been + * activated, as restoring these keys will block MLP5 activation again. + * + * @return int Number of sitemeta rows restored. + */ + public static function restore_mlp2_sitemeta(): int { + global $wpdb; + + $prefix_length = strlen( 'mlp2bak_' ) + 1; // SUBSTR is 1-indexed. + + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching + $restored = $wpdb->query( + $wpdb->prepare( + "UPDATE {$wpdb->sitemeta} SET meta_key = SUBSTR( meta_key, %d ) WHERE meta_key LIKE %s AND site_id = %d", + $prefix_length, + $wpdb->esc_like( self::SITEMETA_BACKUP_PREFIX ) . '%', + get_current_network_id() + ) + ); + + return is_int( $restored ) ? $restored : 0; + } + /** * Whether any original MLP2 tables exist in the database. * diff --git a/languages/robotstxt-mlp2-mlp5-es_ES.mo b/languages/robotstxt-mlp2-mlp5-es_ES.mo index 06d4530330021c1a7b4b579ff798f4fa38045b96..726b354d2a8d480dfb7a5a663cf7ad44b6936449 100644 GIT binary patch delta 3274 zcmZwJdrZ}39LMo5iGmlrpyCBDM@#X7sCYrVAd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BewGAd|9A)C+H8 zF%G16NpvjF&~@oGOoiSrlllp z#|?ND3owf_%$ThiH{(YbiLoSrRv-!W-dwzcYcg2>5-J6x=wUp8d}lM5zGkuwNe^pA zw%Oi8W%*^)3vXi(!&&b(Ovat~32H^BkzrcVJkzKL3?Ur`f?$nk$~(vYrfZiou2ZjH#G z?Ida|x=|wza9DLe9ytJ3gc?vCMq>yE;~|W}V@Tdvhimtsp8pHABLBMY1G)YWTxcp4 z&3Gwlg!QNw9YxK!9koK=U@ZQPn&Hr=`~ggM&Os(=#kdp?ppIn^j>0iB{0_762<=jA z()s_B%5iSg@^mf6k-F9R7OJCvP%})-GkX;$;?sB%wQ{}40kDMG{_$IggJ{>G2Hu2P z>J!M%jJM6JQ6*gGpZ>j)#Z`O83VDUoV$Zv}l4gsmYY@tTNGA+mF0x;MWw{Y%MVps zi6Ei;IY7KXD2e9~esSx+lh$Y=;BG(X)X(Q;S6_=dl0#fO4~vLRgfhO0c$rX9LRNS+ z{#)iOz}>_?B84a=YSsTlVhy3Pl~C5cMAQ?-L|=J@$}Yl<**n*RXlJ?yRyvjKa|xY} sBqE0xPw02Vk~aj`tzExmM@_JH?YgZS+aseEMYdmxxf0(Vo8C42KQpZ+^Z)<= diff --git a/languages/robotstxt-mlp2-mlp5-es_ES.po b/languages/robotstxt-mlp2-mlp5-es_ES.po index cd7e0ff..3959c73 100644 --- a/languages/robotstxt-mlp2-mlp5-es_ES.po +++ b/languages/robotstxt-mlp2-mlp5-es_ES.po @@ -112,6 +112,12 @@ msgstr "Limpieza completada." msgid "Cleanup confirmation invalid. Type DELETE exactly." msgstr "Confirmación de limpieza inválida. Escribe DELETE exactamente." +msgid "MLP2 sitemeta backed up. MultilingualPress 5 can now activate cleanly." +msgstr "Sitemeta de MLP2 respaldado. MultilingualPress 5 ya puede activarse sin problemas." + +msgid "MLP2 sitemeta restored to original keys." +msgstr "Sitemeta de MLP2 restaurado a sus claves originales." + msgid "Action required: MLP2 tables must be renamed before MultilingualPress 5 can be activated." msgstr "Acción requerida: las tablas de MLP2 deben renombrarse antes de activar MultilingualPress 5." diff --git a/languages/robotstxt-mlp2-mlp5.pot b/languages/robotstxt-mlp2-mlp5.pot index 19bf9b3..51ee3e8 100644 --- a/languages/robotstxt-mlp2-mlp5.pot +++ b/languages/robotstxt-mlp2-mlp5.pot @@ -2,14 +2,14 @@ # This file is distributed under the GPL-3.0-or-later. msgid "" msgstr "" -"Project-Id-Version: MLP2 to MLP5 (by ROBOTSTXT) 1.0.0\n" +"Project-Id-Version: MLP2 to MLP5 (by ROBOTSTXT) 1.1.0\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/robotstxt-mlp2-mlp5\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2026-02-27T10:21:22+00:00\n" +"POT-Creation-Date: 2026-03-02T14:12:27+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.12.0\n" "X-Domain: robotstxt-mlp2-mlp5\n" @@ -40,7 +40,7 @@ msgid "https://git.robotstxt.es/ROBOTSTXT" msgstr "" #: includes/class-robotstxt-mlp2-mlp5-admin-page.php:61 -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:290 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:298 msgid "MLP2 to MLP5 Migrator" msgstr "" @@ -49,59 +49,59 @@ msgid "MLP Migrator" msgstr "" #: includes/class-robotstxt-mlp2-mlp5-admin-page.php:90 -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:107 -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:131 -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:254 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:111 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:139 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:262 msgid "You do not have permission to perform this action." msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:271 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:279 msgid "You do not have permission to access this page." msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:321 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:329 msgid "Preflight" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:322 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:330 msgid "Analysis" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:323 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:331 #: includes/class-robotstxt-mlp2-mlp5-step-verification.php:30 msgid "Site Relations" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:324 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:332 msgid "Content Relations" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:325 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:333 msgid "Verification" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:326 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:334 msgid "Cleanup" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:383 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:391 msgid "Reset migration (start over)" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:385 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:393 msgid "This will reset the wizard to Step 1 and clear the migration log. It does not modify MLP5 data." msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:389 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:397 msgid "Reset wizard" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:398 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:406 msgid "System status" msgstr "" #. translators: %d: number of renamed tables -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:419 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:427 #, php-format msgid "%d table renamed successfully." msgid_plural "%d tables renamed successfully." @@ -109,15 +109,23 @@ msgstr[0] "" msgstr[1] "" #. translators: %d: number of tables that could not be renamed -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:424 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:432 #, php-format msgid "%d table could not be renamed. Check database permissions." msgid_plural "%d tables could not be renamed. Check database permissions." msgstr[0] "" msgstr[1] "" +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:435 +msgid "MLP2 sitemeta backed up. MultilingualPress 5 can now activate cleanly." +msgstr "" + +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:438 +msgid "MLP2 sitemeta restored to original keys." +msgstr "" + #. translators: %d: number of restored tables -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:429 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:443 #, php-format msgid "%d table restored to original name." msgid_plural "%d tables restored to original names." @@ -125,127 +133,127 @@ msgstr[0] "" msgstr[1] "" #. translators: %d: number of tables that could not be restored -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:434 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:448 #, php-format msgid "%d table could not be restored. Check database permissions." msgid_plural "%d tables could not be restored. Check database permissions." msgstr[0] "" msgstr[1] "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:437 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:451 msgid "Wizard reset. You can start the migration from Step 1." msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:440 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:454 msgid "Cleanup completed." msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:443 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:457 msgid "Cleanup confirmation invalid. Type DELETE exactly." msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:458 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:472 msgid "Action required: MLP2 tables must be renamed before MultilingualPress 5 can be activated." msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:461 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:475 msgid "MLP2 tables renamed. Now go to Network Admin > Plugins and activate MultilingualPress 5." msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:464 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:478 msgid "Warning: both original and backup MLP2 tables were found. Investigate before proceeding." msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:467 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:481 msgid "No MLP2 tables found. Migration cannot proceed. Restore your database from a backup." msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:494 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:508 msgid "System Status" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:498 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:512 msgid "MLP2 tables (original names)" msgstr "" #. translators: %d: number of tables -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:501 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:515 #, php-format msgid "%d table — must be renamed" msgid_plural "%d tables — must be renamed" msgstr[0] "" msgstr[1] "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:503 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:517 msgid "None" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:508 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:522 msgid "MLP2 tables (backup copies)" msgstr "" #. translators: %d: number of backup tables -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:511 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:525 #, php-format msgid "%d backup table ready" msgid_plural "%d backup tables ready" msgstr[0] "" msgstr[1] "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:513 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:527 msgid "Not yet renamed" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:518 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:532 #: includes/class-robotstxt-mlp2-mlp5-step-preflight.php:105 msgid "MultilingualPress 5 (network-active)" msgstr "" #. translators: %s: version -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:521 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:535 #: includes/class-robotstxt-mlp2-mlp5-step-preflight.php:108 #, php-format msgid "Active (v%s)" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:523 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:537 #: includes/class-robotstxt-mlp2-mlp5-step-preflight.php:110 msgid "Not active" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:544 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:558 msgid "Step 1 — Rename MLP2 Tables" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:545 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:559 msgid "MultilingualPress 5 cannot activate while the original MLP2 table names are present. Click below to rename them to temporary backup copies ({prefix}mlp2bak_*). This is safe and fully reversible." msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:549 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:563 msgid "Rename MLP2 tables (prepare for MLP5 activation)" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:558 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:572 msgid "Step 2 — Activate MultilingualPress 5" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:559 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:573 msgid "MLP2 tables have been renamed. MultilingualPress 5 can now be activated without the old-version compatibility error." msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:560 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:574 msgid "Go to Network Admin › Plugins" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:569 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:583 msgid "Emergency: restore original MLP2 table names" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:571 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:585 msgid "This renames backup tables back to their original MLP2 names. Only use this before MLP5 has been activated." msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:575 +#: includes/class-robotstxt-mlp2-mlp5-admin-page.php:589 msgid "Restore original table names" msgstr "" @@ -363,45 +371,45 @@ msgid "Backup table dropped: %s" msgstr "" #. translators: %d: key count -#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:108 +#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:118 #, php-format msgid "Removed %d MLP2 sitemeta entries." msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:119 +#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:129 msgid "Step 6 — Cleanup (Optional)" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:122 +#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:132 msgid "Migration complete!" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:122 +#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:132 msgid "MultilingualPress 5 is now configured with your migrated data. Verify that everything works before performing the optional cleanup below." msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:125 +#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:135 msgid "The cleanup actions below are optional and irreversible. MultilingualPress 5 will work correctly whether or not you perform them." msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:138 +#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:148 msgid "Deactivate MultilingualPress 2 (network-wide)" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:140 +#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:150 msgid "Deactivate MultilingualPress 2" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:141 +#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:151 msgid "already inactive" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:148 +#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:158 msgid "Delete MLP2 backup database tables" msgstr "" #. translators: %d: table count -#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:149 +#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:159 #, php-format msgid "%d table" msgid_plural "%d tables" @@ -409,19 +417,19 @@ msgstr[0] "" msgstr[1] "" #. translators: %d: table count -#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:150 +#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:160 msgid "Irreversible. Only do this after verifying the migration in MLP5." msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:156 +#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:166 msgid "Delete MLP2 network settings from wp_sitemeta" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:163 +#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:173 msgid "Type DELETE to confirm:" msgstr "" -#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:169 +#: includes/class-robotstxt-mlp2-mlp5-step-cleanup.php:179 msgid "Proceed with cleanup" msgstr "" diff --git a/readme.txt b/readme.txt index 62953cf..60378aa 100644 --- a/readme.txt +++ b/readme.txt @@ -3,9 +3,9 @@ Contributors: javiercasares, robotstxt Tags: multisite, multilingual, multilingualpress, migration, mlp Requires at least: 6.7 Tested up to: 6.9 -Stable tag: 1.0.0 +Stable tag: 1.1.0 Requires PHP: 8.2 -Version: 1.0.0 +Version: 1.1.0 License: GPL-3.0-or-later License URI: https://www.gnu.org/licenses/gpl-3.0.txt Network: true @@ -373,6 +373,15 @@ PHP 8.2 through 8.5. Note that MultilingualPress 2 is not compatible with PHP 8. == Changelog == += 1.1.0 = + +_Release date: 2026-03-02_ + +* MLP2 sitemeta keys (`inpsyde_multilingual*`) are now renamed to `mlp2bak_inpsyde_multilingual*` during table preparation instead of being deleted, making the operation fully reversible. +* Restoring original table names also restores the original sitemeta keys. +* Cleanup step (Step 6) now also deletes the backed-up sitemeta keys. +* Fixed: `mlp_migrator_log` (plugin's own table) was incorrectly listed as an MLP2 table requiring renaming. + = 1.0.0 = _Release date: 2026-02-27_ diff --git a/robotstxt-mlp2-mlp5.php b/robotstxt-mlp2-mlp5.php index 8473b03..a4b9f3c 100644 --- a/robotstxt-mlp2-mlp5.php +++ b/robotstxt-mlp2-mlp5.php @@ -3,7 +3,7 @@ * Plugin Name: MLP2 to MLP5 (by ROBOTSTXT) * Plugin URI: https://git.robotstxt.es/ROBOTSTXT/robotstxt-mlp2-mlp5 * Description: Guided, safe, and reversible migration from MultilingualPress 2 to MultilingualPress 5. - * Version: 1.0.0 + * Version: 1.1.0 * Author: ROBOTSTXT * Author URI: https://git.robotstxt.es/ROBOTSTXT * License: GPL-3.0-or-later @@ -31,7 +31,7 @@ if ( ! defined( 'ABSPATH' ) ) { * in the `mlp_migrator_db_version` sitemeta key and runs any pending upgrade * routines automatically on the next request after a plugin update. */ -define( 'ROBOTSTXT_MLP2_MLP5_VERSION', '1.0.0' ); +define( 'ROBOTSTXT_MLP2_MLP5_VERSION', '1.1.0' ); define( 'ROBOTSTXT_MLP2_MLP5_DB_VERSION', '1.0' ); require_once __DIR__ . '/includes/class-robotstxt-mlp2-mlp5-logger.php';