prefix . 'devis'; $migrated = get_option('devis_pro_migrated', false); $migration_count = get_option('devis_pro_migration_count', 0); $migration_errors = get_option('devis_pro_migration_errors', array()); // Résultat import CSV (traité via admin-post — pas de $_POST ici). $import_message = ''; $import_notice = get_transient( 'torlann_csv_import_notice_' . get_current_user_id() ); if ( is_array( $import_notice ) ) { delete_transient( 'torlann_csv_import_notice_' . get_current_user_id() ); if ( ! empty( $import_notice['success'] ) ) { $import_message = '

' . esc_html( sprintf( /* translators: %d: number of imported quotes */ __( '%d quotes imported successfully!', 'torlann' ), (int) ( $import_notice['count'] ?? 0 ) ) ) . '

'; if ( ! empty( $import_notice['errors'] ) && is_array( $import_notice['errors'] ) ) { $import_message .= '

' . esc_html__( 'Warnings:', 'torlann' ) . '
' . esc_html( implode( "\n", array_slice( $import_notice['errors'], 0, 10 ) ) ) . '

'; } } else { $import_message = '

' . esc_html( (string) ( $import_notice['message'] ?? __( 'Import failed.', 'torlann' ) ) ) . '

'; } } // Vérifier si l'ancienne table existe $old_table_exists = $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $old_table ) ) ) === $old_table; $old_count = 0; if ($old_table_exists) { $old_count = (int) $wpdb->get_var( $wpdb->prepare( 'SELECT COUNT(*) FROM %i', $old_table ) ); } ?>







1. quote list', 'torlann') ) ); ?>
2.
3.

admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce( 'devis_pro_nonce' ), 'quotesUrl' => admin_url( 'admin.php?page=torlann-quotes' ), 'i18n' => array( 'inProgress' => __( 'Migration in progress…', 'torlann' ), 'complete' => __( 'Migration complete!', 'torlann' ), 'viewQuotes' => __( 'View migrated quotes', 'torlann' ), 'error' => __( 'Error:', 'torlann' ), 'unknownError' => __( 'Unknown error', 'torlann' ), 'ajaxError' => __( 'An error occurred during migration. Please try again.', 'torlann' ), ), ) ); ?>