PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 4.7.0
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v4.7.0
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
← All changes | wp-optimize.php +43 -9 4.6.0 → 4.7.0 View file →
@@ -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.0
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.0');
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);
@@ -120,9 +120,9 @@
120 120 * Add action for display Images > Compress images tab.
121 121 */
122 122 add_action('wp_optimize_admin_page_wpo_images_smush', array($this, 'admin_page_wpo_images_smush'));
123 123
124 - include_once(WPO_PLUGIN_MAIN_PATH.'includes/updraftcentral.php');
124 + include_once(WPO_PLUGIN_MAIN_PATH.'includes/updraftcentral/updraftcentral.php');
125 125
126 126 include_once(WPO_PLUGIN_MAIN_PATH.'includes/backward-compatibility-functions.php');
127 127
128 128 register_shutdown_function(array($this, 'log_fatal_errors'));
@@ -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,13 +264,15 @@
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',
272 273 'webp',
274 + 'includes/updraftcentral',
273 275 );
274 276 }
275 277
276 278 /**
@@ -385,13 +387,18 @@
385 387 /**
386 388 * Adds 3rd party plugin compatibilities.
387 389 */
388 390 public function load_compatibilities() {
391 + global $wp_version;
389 392
390 393 if (class_exists('Polylang')) {
391 394 WPO_Polylang_Compatibility::instance();
392 395 }
393 396
397 + if (version_compare($wp_version, '5.2', '<')) {
398 + WPO_WP_Kses_Compatibility::instance();
399 + }
400 +
394 401 WPO_Page_Builder_Compatibility::instance();
395 402 WPO_KD_Submissions_Compatibility::instance();
396 403
397 404 if (class_exists('Custom_Permalinks')) {
@@ -549,8 +556,17 @@
549 556 wp_enqueue_style('wp-optimize-global', WPO_PLUGIN_URL.'css/wp-optimize-global'.$min_or_not_internal.'.css', array(), $enqueue_version);
550 557
551 558 // load scripts and styles only on WP-Optimize pages.
552 559 if (!$this->is_wpo_page()) return;
560 +
561 + wp_enqueue_script( 'jquery-ui-tooltip' );
562 + // Defeat other plugins/themes which dump their jQuery UI CSS onto our settings page
563 + wp_deregister_style('jquery-ui');
564 + wp_enqueue_style('jquery-ui', WPO_PLUGIN_URL.'css/jquery-ui.custom' . $min_or_not_internal . '.css', array(), $enqueue_version);
565 +
566 +
567 + wp_enqueue_script('select2', WPO_PLUGIN_URL . 'js/select2/select2' . $min_or_not . '.js', array('jquery'), $enqueue_version);
568 + wp_enqueue_style('select2', WPO_PLUGIN_URL . 'css/select2/select2' . $min_or_not . '.css', array(), $enqueue_version);
553 569
554 570 wp_enqueue_script('jquery-serialize-json', WPO_PLUGIN_URL.'js/serialize-json/jquery.serializejson'.$min_or_not.'.js', array('jquery'), $enqueue_version);
555 571
556 572 wp_register_script('updraft-queue-js', WPO_PLUGIN_URL.'js/queue'.$min_or_not_internal.'.js', array(), $enqueue_version);
@@ -568,9 +584,9 @@
568 584
569 585 $js_variables = $this->wpo_js_translations();
570 586 $js_variables['loggers_classes_info'] = $this->get_loggers_classes_info();
571 587 wp_localize_script('wp-optimize-admin-js', 'wpoptimize', $js_variables);
572 -
588 +
573 589 do_action('wpo_premium_scripts_styles', $min_or_not_internal, $min_or_not, $enqueue_version);
574 590
575 591 $status_report_dependencies = array('wp-optimize-admin-js');
576 592
@@ -1084,12 +1100,21 @@
1084 1100 'hide' => __('Hide', 'wp-optimize'),
1085 1101 'please_wait' => __('Please wait a moment...', 'wp-optimize'),
1086 1102 'clipboard_failed' => __('Copy to clipboard failed, please do it manually', 'wp-optimize'),
1087 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'),
1088 1110 'show_information' => __('Show information', 'wp-optimize'),
1089 1111 'hide_information' => __('Hide information', 'wp-optimize'),
1090 1112 'data_not_available' => __('Not available', 'wp-optimize'),
1091 - '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')
1092 1117 );
1093 1118 $filtered_translations = apply_filters('wpo_js_translations', $translations);
1094 1119 return is_array($filtered_translations) ? $filtered_translations : $translations;
1095 1120 }
@@ -1103,19 +1128,24 @@
1103 1128 public function plugin_settings_link($links) {
1104 1129
1105 1130 $admin_page_url = $this->get_options()->admin_page_url();
1106 1131 $settings_page_url = $this->get_options()->admin_page_url('wpo_settings');
1132 + $database_page_url = $this->get_options()->admin_page_url('wpo_database');
1107 1133
1108 1134 if (!self::is_premium()) {
1109 - $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>';
1110 1136 array_unshift($links, $premium_link);
1111 1137 }
1112 1138
1113 - $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>';
1114 1140 array_unshift($links, $settings_link);
1115 1141
1116 - $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>';
1117 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 +
1118 1148 return $links;
1119 1149 }
1120 1150
1121 1151 /**
@@ -1302,8 +1332,12 @@
1302 1332 /**
1303 1333 * Run updates on plugin activation.
1304 1334 */
1305 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');
1306 1340 include_once(WPO_PLUGIN_MAIN_PATH.'includes/class-wp-optimize-updates.php');
1307 1341 WP_Optimize_Updates::check_updates();
1308 1342 }
1309 1343