License

'.esc_html__('SpeedyCache Version', 'speedycache').' '.SPEEDYCACHE_PRO_VERSION.(defined('SPEEDYCACHE_PRO') ? ' (Pro Version)' : '').'
'.esc_html__('SpeedyCache License', 'speedycache').'
'.(defined('SPEEDYCACHE_PRO') && empty($speedycache->license) ? 'Unlicensed    ' : '').'
'; if(!empty($speedycache->license)){ $expires = $speedycache->license['expires']; $expires = substr($expires, 0, 4).'/'.substr($expires, 4, 2).'/'.substr($expires, 6); echo '
License Status : '.(empty($speedycache->license['status_txt']) ? 'N.A.' : wp_kses_post($speedycache->license['status_txt'])).'      '; if(empty($speedycache->license['has_plid']) || $speedycache->license['expires'] <= date('Ymd')){ echo 'License Expires : '.($speedycache->license['expires'] <= date('Ymd') ? ''.esc_attr($expires).'' : esc_attr($expires)); } echo '
'; } echo '
URL '.get_site_url().'
Path '.ABSPATH.'
Server\'s IP Address '.esc_html($_SERVER['SERVER_ADDR']).'
.htaccess is writable '.(is_writable(ABSPATH.'/.htaccess') ? 'Yes' : 'No').'
'; } // Earlier we use to just log deletion, but now we will log other stuff too. static function logs(){ global $speedycache; $speedycache->logs['logs'] = get_option('speedycache_delete_cache_logs', []); echo '
SpeedyCache Logs
'; if(!empty($speedycache->logs['logs']) && count($speedycache->logs['logs']) > 0){ foreach($speedycache->logs['logs'] as $key => $log){ echo '
'.(isset($log['date']) ? esc_html($log['date']) : '') . (isset($log['via']) ? esc_html(\SpeedyCache\Logs::decode_via($log['via'])) : '').'
'; } }else{ echo '
'. esc_html__('No logs found', 'speedycache'). '
'; } echo '
'; } static function stats(){ global $speedycache; if(!class_exists('\SpeedyCache\Util')){ return; } // CACHE SIZE $cache_stats = get_option('speedycache_html_size', 0); if(empty($cache_stats)){ $desktop_cache = \SpeedyCache\Util::cache_path('all'); $cache_stats = 0; if(file_exists($desktop_cache)){ $cache_stats = \SpeedyCache\Util::dir_size($desktop_cache); } $mobile_cache = \SpeedyCache\Util::cache_path('mobile-cache'); if(file_exists($mobile_cache)){ $cache_stats += \SpeedyCache\Util::dir_size($mobile_cache); } update_option('speedycache_html_size', $cache_stats); } // MINIFIED SIZE $assets_stats = get_option('speedycache_assets_size', 0); if(empty($assets_stats)){ $assets_dir = \SpeedyCache\Util::cache_path('assets'); $assets_stats = 0; if(file_exists($assets_dir)){ $assets_stats = \SpeedyCache\Util::dir_size($assets_dir); } update_option('speedycache_assets_size', $assets_stats); } $img_count = 0; if(class_exists('\SpeedyCache\Image')){ $img_count = \SpeedyCache\Image::optimized_file_count(); } echo '
Cache Stats
'.esc_html(size_format($cache_stats)).'
options['status'])? 'style="background-color:#0c6;"' : '').'>Enabled
Assets Stats
'.esc_html(size_format($assets_stats)).'
Object Cache Stats
'.esc_html($speedycache->object_memory).'
object['enable'])? 'style="background-color:#0c6;"' : '').'>Enabled
Image Stats
'.esc_html($img_count).' IMG
'; } static function image_optm(){ echo '

Image Optimization

'; \SpeedyCache\Image::statics(); \SpeedyCache\Image::settings(); \SpeedyCache\Image::list_image_html(); } static function bloat_tab(){ global $speedycache; echo '

Bloat Remover

'; wp_nonce_field('speedycache_ajax_nonce'); if(!defined('SPEEDYCACHE_PRO')){ return; } $bloat_options = array( 'disable_xmlrpc' => array( 'id' => 'speedycache_disable_xmlrpc', 'title' => __('Disable XML RPC', 'speedycache'), 'description' => __('XML-RPC can cause performance and security issues'), ), 'remove_gfonts' => array( 'id' => 'speedycache_remove_gfonts', 'title' => __('Disable Google Fonts', 'speedycache'), 'description' => __('Use users system fonts to prevent loading of fonts from server', 'speedycache'), ), 'disable_jmigrate' => array( 'id' => 'speedycache_disable_jmigrate', 'title' => __('Disable jQuery Migrate', 'speedycache'), 'description' => __('Disable jQuery Migrate for better speed.', 'speedycache'), 'docs' => 'https://speedycache.com/docs/bloat-remover/how-to-remove-jquery-migrate-in-wordpress/', ), 'disable_dashicons' => array( 'id' => 'speedycache_disable_dashicons', 'title' => __('Disable DashIcons', 'speedycache'), 'description' => __('DashIcons are used on WordPress admin and might not be used on Front End.', 'speedycache'), ), 'disable_gutenberg' => array( 'id' => 'speedycache_disable_gutenberg', 'title' => __('Disable Gutenberg', 'speedycache'), 'description' => __('Decouple Gutenberg if you use another page builder.', 'speedycache'), ), 'disable_block_css' => array( 'id' => 'speedycache_disable_block_css', 'title' => __('Disable Block Editor CSS', 'speedycache'), 'description' => __('Some themes might not use Block Editor CSS on the front.', 'speedycache'), ), 'disable_oembeds' => array( 'id' => 'speedycache_disable_oembeds', 'title' => __('Disable OEmbeds', 'speedycache'), 'description' => __('OEmbeds increases load on site if a lot of embeds are being used.', 'speedycache'), ), 'update_heartbeat' => array( 'id' => 'speedycache_update_heartbeat', 'title' => __('Update Heartbeat', 'speedycache'), 'description' => __('Change how frequently heartbeat is checked.', 'speedycache'), 'settings' => 'speedycache_update_heartbeat', ), 'limit_post_revision' => array( 'id' => 'speedycache_limit_post_revision', 'title' => __('Limit Post Revision', 'speedycache'), 'description' => __('Change how many post revision you want to keep.', 'speedycache'), 'settings' => 'speedycache_limit_post_revision', ), 'disable_cart_fragment' => array( 'id' => 'speedycache_disable_cart_fragment', 'title' => __('Disable Cart Fragments', 'speedycache'), 'description' => __('Disable WooCommerce cart fragments for better performance.', 'speedycache'), ), 'disable_woo_assets' => array( 'id' => 'speedycache_disable_woo_assets', 'title' => __('Disable WooCommerce Assets', 'speedycache'), 'description' => __('Disables WooCommerce assets to reduce unwanted asset loading.', 'speedycache'), 'docs' => 'https://speedycache.com/docs/bloat-remover/how-to-remove-woocommerce-assets/', ), 'disable_rss' => array( 'id' => 'speedycache_disable_rss', 'title' => __('Disable RSS feeds', 'speedycache'), 'description' => __('Disable RSS feeds to reduce request which use server resources.', 'speedycache'), ), ); foreach($bloat_options as $bloat_key => $bloat_option){ echo '
'.esc_html($bloat_option['title']). ''; // Docs Link here if(isset($bloat_option['docs'])){ echo ''; } // Setting if any if(isset($bloat_option['settings'])){ echo '- '.esc_html__('Settings', 'speedycache').''; } echo ' '. esc_html($bloat_option['description']).'
'; } // Bloat modals echo '
'.esc_html__('Limit Post Revision', 'speedycache').'
'.esc_html__('Update HeartBeat', 'speedycache').'
'; $heartbeat_modes = array( '15' => esc_html__('15 Seconds(Default)', 'speedycache'), '30' => esc_html__('30 seconds', 'speedycache'), '45' => esc_html__('45 Seconds', 'speedycache'), '60' => esc_html__('60 seconds', 'speedycache'), '120' => esc_html__('2 Minutes', 'speedycache'), ); $disable_heartbeat = array( 'dont' => esc_html__('Do not Disable', 'speedycache'), 'disable' => esc_html__('Disable', 'speedycache'), 'editor' => esc_html__('Allow on Editor only', 'speedycache'), ); echo ''; echo '
'; echo '
'; \SpeedyCache\Settings::save_btn(); echo '
'; } static function db_tab(){ global $wpdb; echo '

Database Optimizer

'; // TODO: Show notice which mentions about the bloat settings as we will slowly migrate the html code of bloat to the Pro version, to prevent the GPL plugin providers from making users fool. if(!defined('SPEEDYCACHE_PRO')){ return; } $statics = array('all_warnings' => 0, 'post_revisions' => 0, 'trashed_contents' => 0, 'trashed_spam_comments' => 0, 'trackback_pingback' => 0, 'transient_options' => 0, 'expired_transient' => 0); $statics['post_revisions'] = $wpdb->get_var("SELECT COUNT(*) FROM `$wpdb->posts` WHERE post_type = 'revision';"); $statics['trashed_contents'] = $wpdb->get_var("SELECT COUNT(*) FROM `$wpdb->posts` WHERE post_status = 'trash';"); $statics['trashed_spam_comments'] = $wpdb->get_var("SELECT COUNT(*) FROM `$wpdb->comments` WHERE comment_approved = 'spam' OR comment_approved = 'trash' ;"); $statics['trackback_pingback'] = $wpdb->get_var("SELECT COUNT(*) FROM `$wpdb->comments` WHERE comment_type = 'trackback' OR comment_type = 'pingback' ;"); $element = "SELECT COUNT(*) FROM `$wpdb->options` WHERE option_name LIKE '%\_transient\_%' ;"; $statics['transient_options'] = $wpdb->get_var( $element ) > 20 ? $wpdb->get_var( $element ) : 0; $statics['expired_transient'] = $wpdb->get_var( "SELECT COUNT(*) FROM `$wpdb->options` WHERE option_name LIKE '_transient_timeout%' AND option_value < " . time() ); $statics['all_warnings'] = $statics['all_warnings'] + $statics['transient_options'] + $statics['trackback_pingback']+ $statics['trashed_spam_comments']+ $statics['trashed_contents']+ $statics['post_revisions']; echo '
'.esc_html__('Clean everything', 'speedycache').' ('.esc_html($statics['all_warnings']).')
'.esc_html__('Run the all options', 'speedycache').'
'.esc_html__('Post Revisions', 'speedycache').' ('.esc_html($statics['post_revisions']).')
'.esc_html__('Clean the all post revisions', 'speedycache').'
'.esc_html__('Trashed Contents', 'speedycache').'('.esc_html($statics['trashed_contents']).')
'.esc_html__('Clean the all trashed posts & pages', 'speedycache').'
'.esc_html__('Trashed & Spam Comments', 'speedycache').' ('.esc_html($statics['trashed_spam_comments']).')
'.esc_html__('Clean the all comments from trash & spam', 'speedycache').'
'.esc_html__('Trackbacks and Pingbacks', 'speedycache').' ('.esc_html($statics['trackback_pingback']).')
'.esc_html__('Clean the all trackbacks and pingbacks', 'speedycache').'
'.esc_html__('Transient Options', 'speedycache').' ('.esc_html($statics['transient_options']).')
'.esc_html__('Clean the all transient options', 'speedycache').'
'.esc_html__('Expired Transients', 'speedycache').' ('.esc_html($statics['expired_transient']).')
'.esc_html__('Clean the expired transients', 'speedycache').'
'; } static function object_tab(){ global $speedycache; echo '

'.esc_html__('Object Cache', 'speedycache').'

'; echo '
Caching Status: '.(!empty($speedycache->object['enable']) ? 'Enabled' : 'Disabled').'
Memory Usage: '.esc_html__($speedycache->object_memory).'
Drop In: '.(defined('SPEEDYCACHE_OBJECT_CACHE') ? 'Valid' : 'Not Valid').'
phpRedis Status: '.(empty(phpversion('redis')) ? '' . esc_html__('phpRedis Not Found', 'speedycache') : (version_compare(phpversion('redis'), '3.1.1') > 0 ? ''. esc_html__('Available', 'speedycache') . '('.esc_html(phpversion('redis')).')' : '' . esc_html__('You are using older version of PHPRedis'))).'
'; if(!empty($speedycache->object['hashed_prefix'])){ echo'
Hashed Prefix: '.esc_html($speedycache->object['hashed_prefix']).'
'; } echo'
'; wp_nonce_field('speedycache_ajax_nonce'); echo '

'.esc_html__('Settings', 'speedycache').'

'.esc_html__('Enables Object caching, if you have full page caching then it might show some conflicts.', 'speedycache').'
'.esc_html__('Choose which Object Cache Driver you want to use.', 'speedycache').'
'.esc_html__('Your Redis host name or IP address.', 'speedycache').'
'.esc_html__('Your Redis host port number', 'speedycache').'
'.esc_html__('Username of your Redis acccount.', 'speedycache').'
'.esc_html__('Password for your Redis Account.', 'speedycache').'
'.esc_html__('How long you want the cached Object to persist', 'speedycache').'
'.esc_html__('Set the database number, make sure to keep it different for every website you use it on', 'speedycache').'
'.esc_html__('This will Keep Alive the connection to redis.', 'speedycache').'
'.esc_html__('This will cache the admin pages too.', 'speedycache').'
'.esc_html__('Deletes asynchronously, without blocking', 'speedycache').'
'; $serialization_methods = ['SERIALIZER_PHP', 'SERIALIZER_IGBINARY']; echo '
'.esc_html('If you don\'t see IG_BINARY option then the phpredis is not built with IG_BINARY, IG_BINARY can save upto 50% space', 'speedycache').'
'; $serialization_methods = ['None', 'COMPRESSION_ZSTD', 'COMPRESSION_LZ4', 'COMPRESSION_LZF']; echo '
'.esc_html('If you dont see any option then your phpredis is not built with compression options', 'speedycache').'
'.esc_html__('These are the groups which should not be cached, One Per Line', 'speedycache').'
'; \SpeedyCache\Settings::save_btn(); echo '
'; } }