| @@ -2,9 +2,9 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | Plugin Name: WP-Optimize - Clean, Compress, Cache |
| 4 | 4 | Plugin URI: https://teamupdraft.com/wp-optimize |
| 5 | 5 | Description: WP-Optimize makes your site fast and efficient. It cleans the database, compresses images and caches pages. Fast sites attract more traffic and users. |
| 6 | -Version: 4.6.1 | |
| 6 | +Version: 4.7.0 | |
| 7 | 7 | Requires at least: 4.9 |
| 8 | 8 | Requires PHP: 7.2 |
| 9 | 9 | Update URI: https://wordpress.org/plugins/wp-optimize/ |
| 10 | 10 | Author: TeamUpdraft, DavidAnderson |
| @@ -17,9 +17,9 @@ | ||
| 17 | 17 | if (!defined('ABSPATH')) die('No direct access allowed'); |
| 18 | 18 | |
| 19 | 19 | // Check to make sure if WP_Optimize is already call and returns. |
| 20 | 20 | if (!class_exists('WP_Optimize')) : |
| 21 | -define('WPO_VERSION', '4.6.1'); | |
| 21 | +define('WPO_VERSION', '4.7.0'); | |
| 22 | 22 | define('WPO_PLUGIN_URL', plugin_dir_url(__FILE__)); |
| 23 | 23 | define('WPO_PLUGIN_MAIN_PATH', plugin_dir_path(__FILE__)); |
| 24 | 24 | define('WPO_PLUGIN_SLUG', plugin_basename(__FILE__)); |
| 25 | 25 | define('WPO_PREMIUM_NOTIFICATION', false); |
| @@ -246,9 +246,9 @@ | ||
| 246 | 246 | require_once($class_file); |
| 247 | 247 | return; |
| 248 | 248 | } |
| 249 | 249 | } |
| 250 | - | |
| 250 | + | |
| 251 | 251 | if ('Minify_HTML' === $class_name) { |
| 252 | 252 | require_once WPO_PLUGIN_MAIN_PATH.'vendor/mrclay/minify/lib/Minify/HTML.php'; |
| 253 | 253 | } |
| 254 | 254 | } |
| @@ -264,8 +264,9 @@ | ||
| 264 | 264 | 'compatibility', |
| 265 | 265 | 'includes', |
| 266 | 266 | 'includes/tables', |
| 267 | 267 | 'includes/list-tables', |
| 268 | + 'includes/dashboard', | |
| 268 | 269 | 'includes/gravatars', |
| 269 | 270 | 'includes/lcp', |
| 270 | 271 | 'minify', |
| 271 | 272 | 'optimizations', |
| @@ -386,13 +387,18 @@ | ||
| 386 | 387 | /** |
| 387 | 388 | * Adds 3rd party plugin compatibilities. |
| 388 | 389 | */ |
| 389 | 390 | public function load_compatibilities() { |
| 391 | + global $wp_version; | |
| 390 | 392 | |
| 391 | 393 | if (class_exists('Polylang')) { |
| 392 | 394 | WPO_Polylang_Compatibility::instance(); |
| 393 | 395 | } |
| 394 | 396 | |
| 397 | + if (version_compare($wp_version, '5.2', '<')) { | |
| 398 | + WPO_WP_Kses_Compatibility::instance(); | |
| 399 | + } | |
| 400 | + | |
| 395 | 401 | WPO_Page_Builder_Compatibility::instance(); |
| 396 | 402 | WPO_KD_Submissions_Compatibility::instance(); |
| 397 | 403 | |
| 398 | 404 | if (class_exists('Custom_Permalinks')) { |
| @@ -578,9 +584,9 @@ | ||
| 578 | 584 | |
| 579 | 585 | $js_variables = $this->wpo_js_translations(); |
| 580 | 586 | $js_variables['loggers_classes_info'] = $this->get_loggers_classes_info(); |
| 581 | 587 | wp_localize_script('wp-optimize-admin-js', 'wpoptimize', $js_variables); |
| 582 | - | |
| 588 | + | |
| 583 | 589 | do_action('wpo_premium_scripts_styles', $min_or_not_internal, $min_or_not, $enqueue_version); |
| 584 | 590 | |
| 585 | 591 | $status_report_dependencies = array('wp-optimize-admin-js'); |
| 586 | 592 | |
| @@ -1094,12 +1100,21 @@ | ||
| 1094 | 1100 | 'hide' => __('Hide', 'wp-optimize'), |
| 1095 | 1101 | 'please_wait' => __('Please wait a moment...', 'wp-optimize'), |
| 1096 | 1102 | 'clipboard_failed' => __('Copy to clipboard failed, please do it manually', 'wp-optimize'), |
| 1097 | 1103 | 'clipboard_success' => __('System status has been copied to the clipboard', 'wp-optimize'), |
| 1104 | + 'high_table_count_threshold' => WP_Optimizer::HIGH_TABLE_COUNT_THRESHOLD, | |
| 1105 | + // translators: 1: starting table count, 2: ending table count | |
| 1106 | + 'loading_tables_in_batches' => esc_html__('Loading tables %1$s to %2$s', 'wp-optimize'), | |
| 1107 | + // translators: %s time to finish | |
| 1108 | + 'time_left' => esc_html__('Aproximate time to finish: %s', 'wp-optimize'), | |
| 1109 | + 'done_reloading' => esc_html__('Done, reloading', 'wp-optimize'), | |
| 1098 | 1110 | 'show_information' => __('Show information', 'wp-optimize'), |
| 1099 | 1111 | 'hide_information' => __('Hide information', 'wp-optimize'), |
| 1100 | 1112 | 'data_not_available' => __('Not available', 'wp-optimize'), |
| 1101 | - 'something_wrong_try_again' => __('Something went wrong; please try again.', 'wp-optimize') | |
| 1113 | + 'something_wrong_try_again' => __('Something went wrong; please try again.', 'wp-optimize'), | |
| 1114 | + 'db_tables_scan_pending_list' => __('Your database tables need to be scanned before they can be listed.', 'wp-optimize'), | |
| 1115 | + 'db_tables_scan_pending_optimize' => __('Your database tables need to be scanned before they can be optimized.', 'wp-optimize'), | |
| 1116 | + 'db_tables_scan_button' => __('Scan tables', 'wp-optimize') | |
| 1102 | 1117 | ); |
| 1103 | 1118 | $filtered_translations = apply_filters('wpo_js_translations', $translations); |
| 1104 | 1119 | return is_array($filtered_translations) ? $filtered_translations : $translations; |
| 1105 | 1120 | } |
| @@ -1113,19 +1128,24 @@ | ||
| 1113 | 1128 | public function plugin_settings_link($links) { |
| 1114 | 1129 | |
| 1115 | 1130 | $admin_page_url = $this->get_options()->admin_page_url(); |
| 1116 | 1131 | $settings_page_url = $this->get_options()->admin_page_url('wpo_settings'); |
| 1132 | + $database_page_url = $this->get_options()->admin_page_url('wpo_database'); | |
| 1117 | 1133 | |
| 1118 | 1134 | if (!self::is_premium()) { |
| 1119 | - $premium_link = '<a href="' . esc_url($this->premium_version_link) . '&utm_content=plugin-page' . '" target="_blank">' . __('Premium', 'wp-optimize') . '</a>'; | |
| 1135 | + $premium_link = '<a href="' . esc_url($this->premium_version_link) . '&utm_content=plugin-page' . '" target="_blank">' . esc_html__('Premium', 'wp-optimize') . '</a>'; | |
| 1120 | 1136 | array_unshift($links, $premium_link); |
| 1121 | 1137 | } |
| 1122 | 1138 | |
| 1123 | - $settings_link = '<a href="' . esc_url($settings_page_url) . '">' . __('Settings', 'wp-optimize') . '</a>'; | |
| 1139 | + $settings_link = '<a href="' . esc_url($settings_page_url) . '">' . esc_html__('Settings', 'wp-optimize') . '</a>'; | |
| 1124 | 1140 | array_unshift($links, $settings_link); |
| 1125 | 1141 | |
| 1126 | - $optimize_link = '<a href="' . esc_url($admin_page_url) . '">' . __('Optimize', 'wp-optimize') . '</a>'; | |
| 1142 | + $optimize_link = '<a href="' . esc_url($database_page_url) . '">' . esc_html__('Optimize', 'wp-optimize') . '</a>'; | |
| 1127 | 1143 | array_unshift($links, $optimize_link); |
| 1144 | + | |
| 1145 | + $dashboard_link = '<a href="' . esc_url($admin_page_url) . '">' . esc_html__('Overview', 'wp-optimize') . '</a>'; | |
| 1146 | + array_unshift($links, $dashboard_link); | |
| 1147 | + | |
| 1128 | 1148 | return $links; |
| 1129 | 1149 | } |
| 1130 | 1150 | |
| 1131 | 1151 | /** |
| @@ -1312,8 +1332,12 @@ | ||
| 1312 | 1332 | /** |
| 1313 | 1333 | * Run updates on plugin activation. |
| 1314 | 1334 | */ |
| 1315 | 1335 | public function run_updates() { |
| 1336 | + | |
| 1337 | + if (!defined('WPO_CACHE_FILES_DIR')) define('WPO_CACHE_FILES_DIR', untrailingslashit(WP_CONTENT_DIR).'/cache/wpo-cache'); | |
| 1338 | + | |
| 1339 | + require_once(WPO_PLUGIN_MAIN_PATH . 'cache/file-based-page-cache-functions.php'); | |
| 1316 | 1340 | include_once(WPO_PLUGIN_MAIN_PATH.'includes/class-wp-optimize-updates.php'); |
| 1317 | 1341 | WP_Optimize_Updates::check_updates(); |
| 1318 | 1342 | } |
| 1319 | 1343 | |