| @@ -114,8 +114,16 @@ | ||
| 114 | 114 | * |
| 115 | 115 | * Guarded with SHOW INDEX so it stays idempotent on sites where the index |
| 116 | 116 | * may already have been applied manually. |
| 117 | 117 | * |
| 118 | + * Return value follows the batched-migration contract documented on | |
| 119 | + * Wpfnl_Activator::run_update_callback_end(): true means "there is more work | |
| 120 | + * left, queue me again", false means "finished". This callback completes in a | |
| 121 | + * single pass, so it always returns false. Returning true here is what caused | |
| 122 | + * the runaway ActionScheduler loop fixed in 3.12.13 — do not change it back. | |
| 123 | + * | |
| 124 | + * @return bool Always false; this migration never needs a second pass. | |
| 125 | + * | |
| 118 | 126 | * @since 3.12.12 |
| 119 | 127 | */ |
| 120 | 128 | function wpf_add_31212_stats_funnel_status_index() { |
| 121 | 129 | global $wpdb; |
| @@ -125,9 +133,9 @@ | ||
| 125 | 133 | // first. Sites that predate the stats table get it from the 3.5.0 |
| 126 | 134 | // callback, which ActionScheduler runs ahead of this one. |
| 127 | 135 | $table_exists = $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $table ) ); // phpcs:ignore |
| 128 | 136 | if ( ! $table_exists ) { |
| 129 | - return true; | |
| 137 | + return false; | |
| 130 | 138 | } |
| 131 | 139 | |
| 132 | 140 | $exists = $wpdb->get_var( $wpdb->prepare( |
| 133 | 141 | 'SHOW INDEX FROM ' . $table . ' WHERE Key_name = %s', |
| @@ -137,6 +145,6 @@ | ||
| 137 | 145 | if ( ! $exists ) { |
| 138 | 146 | $wpdb->query( "ALTER TABLE {$table} ADD INDEX idx_funnel_status (funnel_id, status)" ); // phpcs:ignore |
| 139 | 147 | } |
| 140 | 148 | |
| 141 | - return true; | |
| 149 | + return false; | |
| 142 | 150 | } |