This commit is contained in:
Javier Casares 2026-03-02 14:33:11 +00:00
commit 64c47936e3
4 changed files with 42 additions and 4 deletions

View file

@ -43,6 +43,25 @@ class Robotstxt_Mlp2_Mlp5_Step_Preflight {
$original_present = Robotstxt_Mlp2_Mlp5_Table_Preparer::has_original_tables();
$mlp5_active = $mlp5->is_active();
/*
* Once MLP5 is active it creates its own mlp_* tables, which match the
* same pattern used to detect leftover MLP2 originals. Suppress that
* false positive: if MLP5 is active the rename step was already done.
*/
if ( $mlp5_active ) {
$original_present = false;
}
/*
* After a successful cleanup (Step 6) the backup tables are dropped,
* so $tables_renamed would be false even though everything is fine.
* Treat the wizard-done state as equivalent to "tables were renamed".
*/
$wizard_done = Robotstxt_Mlp2_Mlp5_Wizard_State::is_step_complete( Robotstxt_Mlp2_Mlp5_Wizard_State::TOTAL_STEPS );
if ( $wizard_done ) {
$tables_renamed = true;
}
if ( ! $tables_renamed ) {
if ( $original_present ) {
$issues[] = __( 'MLP2 tables have not been renamed yet. Go back to the plugin status page and click "Rename MLP2 tables".', 'robotstxt-mlp2-mlp5' );