'Breeze', 'wp-rocket' => 'WP Rocket', 'litespeed-cache' => 'LiteSpeed Cache', 'w3-total-cache' => 'W3 Total Cache', 'wp-fastest-cache' => 'WP Fastest Cache', 'autoptimize' => 'Autoptimize', 'wp-optimize' => 'WP-Optimize', ); $active = (array) get_option( 'active_plugins', array() ); if ( is_multisite() ) { $active = array_merge( $active, array_keys( (array) get_site_option( 'active_sitewide_plugins', array() ) ) ); } foreach ( $active as $basename ) { $dir = strtok( (string) $basename, '/' ); if ( isset( $known[ $dir ] ) ) { return $known[ $dir ]; } } return ''; } public static function asset_min_should_stand_down() { return (bool) apply_filters( 'aieo_asset_min_stand_down', false, self::asset_optimiser() ); } public static function status_lines() { $lines = array(); if ( ! self::woocommerce_active() ) { $lines[] = array( 'level' => 'info', 'text' => __( 'WooCommerce is not active, so everything that reads orders, products or pricing is hidden rather than broken. SEO, consent, forms, popups and the login hardening all work without it. Install WooCommerce and the rest of the menu appears.', 'ai-eshop-optimizer' ), ); } $optimiser = self::asset_optimiser(); if ( '' !== $optimiser ) { $lines[] = array( 'level' => 'info', 'text' => sprintf( __( '%s is active and handling your caching. Rooster One does not compete with it: we serve our own pre-built minified files and touch nothing else. If you ever see broken styling after a Rooster One update, clear that plugin\'s cache first, because a cached bundle built before the update is the usual cause.', 'ai-eshop-optimizer' ), $optimiser ), ); } if ( self::is_unsupported_multisite() ) { $lines[] = array( 'level' => 'warn', 'text' => __( 'This is a multisite network, which this release does not support. Rooster One will run on this one site, but its tables, background jobs and licence identity are all per-site, so nothing here is network-aware. Do not network-activate it.', 'ai-eshop-optimizer' ), ); } if ( function_exists( 'aieo_db_supports_analytics' ) && ! aieo_db_supports_analytics() ) { $lines[] = array( 'level' => 'warn', 'text' => self::database_text(), ); } return $lines; } private static function database_text() { global $wpdb; return sprintf( __( 'This site\'s database server is %s. Rooster One\'s analytics need MySQL 8.0.21 or MariaDB 10.3 or newer, so the analytics reports are not built here. Everything else works. Ask your host to upgrade the database server to turn them on.', 'ai-eshop-optimizer' ), (string) $wpdb->get_var( 'SELECT VERSION()' ) ); } public static function render_notices() { if ( ! current_user_can( 'activate_plugins' ) ) { return; } if ( function_exists( 'aieo_db_supports_analytics' ) && ! aieo_db_supports_analytics() && ! get_option( 'aieo_database_notice_dismissed' ) ) { echo '
' . esc_html__( 'Rooster One\'s analytics need a newer database server', 'ai-eshop-optimizer' ) . '
' . esc_html( self::database_text() ) . '
' . esc_html__( 'Understood, do not show this again', 'ai-eshop-optimizer' ) . '
' . esc_html__( 'Rooster One does not support multisite yet', 'ai-eshop-optimizer' ) . '
' . esc_html__( 'It will run on this single site, and nothing is broken. But its database tables, background jobs and licence identity are all per-site, so it is not network-aware: do not network-activate it, and do not expect settings to be shared between sites. We would rather tell you now than have you find out later.', 'ai-eshop-optimizer' ) . '
' . esc_html__( 'Understood, do not show this again', 'ai-eshop-optimizer' ) . '