get_results('SELECT * FROM ' . self::get_table_name(), ARRAY_A); // phpcs:ignore foreach ( $results as $data ) { $option_name = $data['option_name']; $option_name = \str_replace( 'wsal-', 'wsal_', $option_name ); $option_exists = WP_Helper::get_global_option( $option_name, false ); if ( false === $option_exists ) { WP_Helper::set_global_option( $option_name, \maybe_unserialize( $data['option_value'] ) ); } } } /** * Drop the table from the DB. * The method from the abstract class is not used because that table must be in the local database, so we just need to user WP_DB. * * @param \WPDB $connection - \WPDB connection to be used for name extraction. Not in use here just for compatibility with the parent class. * * @since 4.4.2.1 */ public static function drop_table( $connection = null ) { global $wpdb; $table_name = self::get_table_name(); $wpdb->query('DROP TABLE IF EXISTS ' . $table_name); // phpcs:ignore } /** * Returns the the table name * The method from the abstract class is not used because that table must be in the local database, so we just need to user WP_DB. * * @param \WPDB $connection - \WPDB connection to be used for name extraction. Not in use here just for compatibility with the parent class. * * @since 4.4.2.1 */ public static function get_table_name( $connection = null ): string { global $wpdb; return $wpdb->prefix . static::$table; } } }