2 ) ); require __DIR__ . '/db-performance-data.php'; list( $aieo_dbp_open, $aieo_dbp_close ) = AIEO_DMM_UI::card( array( 'anchor' => 'db-performance-page', 'description' => __('Checks whether orders use WooCommerce\'s HPOS tables and whether this database\'s indexes and table collations are set up for speed.', 'ai-eshop-optimizer'), 'icon' => 'database', 'title' => __( 'HPOS, indexes and collations', 'ai-eshop-optimizer' ), 'col' => 1, ) ); echo $aieo_dbp_open; if ( class_exists( 'Automattic\WooCommerce\Utilities\OrderUtil' ) && function_exists( 'WC' ) ) { if ( Automattic\WooCommerce\Utilities\OrderUtil::custom_orders_table_usage_is_enabled() ) { echo \Rooster\Admin\Ui::notice( esc_html__( 'Great Job: High Performance Order Storage in Woocommerce is active in your installation!!!', 'ai-eshop-optimizer' ), 'success', array( 'inline' => true ) ); } else { echo \Rooster\Admin\Ui::notice( esc_html__( 'Tip: High Performance Order Storage (HPOS) is not active in your installation. It improves not only the orders export process but your eshop\'s overall performance.', 'ai-eshop-optimizer' ) . ' ' . sprintf( wp_kses_post( __( 'Here is how you can enable it with a couple of clicks!. It is also bound to multiply the speed of your transactions! :)', 'ai-eshop-optimizer' ) ), 'https://woocommerce.com/document/high-performance-order-storage/' ), 'info', array( 'inline' => true ) ); } } if ( aieo_is_index_wp_mysql_for_speed_active() ) { echo \Rooster\Admin\Ui::notice( esc_html__( 'Also, your DB tables are properly indexed as you have actived Index WP MySQL For Speed!', 'ai-eshop-optimizer' ), 'success', array( 'inline' => true ) ); } else { echo \Rooster\Admin\Ui::notice( sprintf( esc_html__( 'Please consider the highly recommended %s to speed up your DB queries. It is bound to boost your overall performance!', 'ai-eshop-optimizer' ), '' . esc_html__( 'Index WP MySQL For Speed', 'ai-eshop-optimizer' ) . '' ), 'info', array( 'inline' => true ) ); } echo \Rooster\Admin\Ui::notice( esc_html( $db_check['message'] ), 'mono', array( 'inline' => true ) ); ?> true ) ); ?>
array( 'id' => 'aieo-show-indexes-button' ) ) ); echo $aieo_dbp_show; if ( function_exists( 'rooster_admin_table_assets' ) ) { rooster_admin_table_assets( array( 'local' ) ); } ?>
' . esc_html__( 'Rooster One\'s tables in another collation are converted to the WordPress tables\' collation. The shop keeps working meanwhile; a large table may take a few minutes.', 'ai-eshop-optimizer' ) . '
' . esc_html( sprintf( _n( '%s table is in another collation now.', '%s tables are in another collation now.', $aieo_dbp_tables, 'ai-eshop-optimizer' ), number_format_i18n( $aieo_dbp_tables ) ) ) . '
', array( 'confirm' => __( 'Fix Database Collations', 'ai-eshop-optimizer' ) ) ); echo $aieo_dbp_ask; $aieo_dbp_best = AIEO_Analytics_Collation::best_collation(); if ( '' !== $aieo_dbp_best ) { $aieo_dbp_wp = (string) aieo_get_wp_collation(); if ( AIEO_Analytics_Collation::whole_database() || $aieo_dbp_wp === $aieo_dbp_best ) { $aieo_dbp_left = AIEO_Analytics_Collation::left_count(); if ( $aieo_dbp_left > 0 && AIEO_Analytics_Collation::whole_database() ) { $aieo_dbp_tone = 'info'; $aieo_dbp_state = esc_html( sprintf( _n( 'Converting in the background: %s table left.', 'Converting in the background: %s tables left.', $aieo_dbp_left, 'ai-eshop-optimizer' ), number_format_i18n( $aieo_dbp_left ) ) ); } else { $aieo_dbp_tone = 'success'; $aieo_dbp_state = esc_html( sprintf( __( 'This site\'s tables are in %s, the fastest collation this database offers.', 'ai-eshop-optimizer' ), $aieo_dbp_best ) ); } $aieo_dbp_line = ''; if ( ! defined( 'DB_COLLATE' ) || DB_COLLATE !== $aieo_dbp_best ) { $aieo_dbp_line = '' . sprintf(
esc_html__( 'So that new tables and the connection use it too, set this line in wp-config.php: %s', 'ai-eshop-optimizer' ),
'' . esc_html( "define( 'DB_COLLATE', '" . $aieo_dbp_best . "' );" ) . ''
) . '
' . esc_html( sprintf( _n( '%1$s table of this site (%2$s MB), WordPress\'s, WooCommerce\'s, other plugins\' and Rooster One\'s, is converted to %3$s, one at a time, while the shop keeps working. Columns that are binary on purpose keep theirs; large tables go on in the background.', '%1$s tables of this site (%2$s MB), WordPress\'s, WooCommerce\'s, other plugins\' and Rooster One\'s, are converted to %3$s, one at a time, while the shop keeps working. Columns that are binary on purpose keep theirs; large tables go on in the background.', count( $aieo_dbp_whole ), 'ai-eshop-optimizer' ), number_format_i18n( count( $aieo_dbp_whole ) ), number_format_i18n( (int) round( array_sum( $aieo_dbp_whole ) / 1048576 ) ), $aieo_dbp_best ) ) . '
' . esc_html__( 'Back up the database first, pick a quiet hour, and keep this page open until it finishes: while tables are converted, a query that joins a converted table with one not yet converted can fail.', 'ai-eshop-optimizer' ) . '
', array( 'confirm' => __( 'Convert', 'ai-eshop-optimizer' ) ) ); } } ?>