initial commit

This commit is contained in:
2024-04-29 13:12:44 +05:45
commit 34887303c5
19300 changed files with 5268802 additions and 0 deletions

View File

@@ -0,0 +1,107 @@
<?php if (!defined('WPO_VERSION')) die('No direct access.'); ?>
<div id='smush-metabox-inside-wrapper'>
<div class='wpo_restore_single_image' <?php echo $restore_display; ?>>
<div class='restore_possible' <?php echo $restore_action; ?>>
<label for='wpo_restore_single_image_<?php echo $post_id; ?>'>
<span class='alignleft'> <?php _e('Restore original', 'wp-optimize'); ?></span>
</label>
<input type='button' id='wpo_restore_single_image_<?php echo $post_id; ?>' data-blog='<?php echo get_current_blog_id(); ?>' data-id="<?php echo $post_id; ?>" class='button-primary button alignright' value="<?php esc_attr_e('Restore', 'wp-optimize');?>">
</div>
<p id='smush_info' class='wpo_restore_single_image'><?php echo $smush_info; ?></p>
<div id="wpo_smush_details"><?php echo $smush_details; ?></div>
</div>
<div class='wpo_smush_single_image compression_level' <?php echo $smush_display; ?>>
<label for="enable_lossy_compression">
<input type="radio" id="enable_lossy_compression" name="compression_level" class="smush-options compression_level" <?php checked($smush_options['image_quality'], 90); ?>>
<?php _e('Prioritize maximum compression', 'wp-optimize');?>
<span tabindex="0" data-tooltip="<?php _e('Potentially uses lossy compression to ensure maximum savings per image, the resulting images are of a slightly lower quality', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
</label>
<label for="enable_lossless_compression">
<input type="radio" id="enable_lossless_compression" name="compression_level" class="smush-options compression_level" <?php checked($smush_options['image_quality'], 100); ?>>
<?php _e('Prioritize retention of detail', 'wp-optimize');?>
<span tabindex="0" data-tooltip="<?php _e('Uses lossless compression, which results in much better image quality but lower filesize savings per image', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
</label>
<label for="enable_custom_compression">
<input id="enable_custom_compression" type="radio" name="compression_level" class="smush-options compression_level" <?php checked($custom); ?>>
<?php _e('Custom', 'wp-optimize');?>
</label>
<div class="smush-options custom_compression" <?php if (!$custom) echo 'style="display:none;"';?>>
<span class="alignleft"><?php _e('Maximum compression', 'wp-optimize');?></span>
<input id="custom_compression_slider" class="compression_level" data-max="Maximum Compression" type="range" step="5" value="<?php echo intval($smush_options['image_quality']); ?>" min="60" max="85" list="number" />
<datalist id="number">
<option value="60"/>
<option value="65"/>
<option value="70"/>
<option value="75"/>
<option value="80"/>
<option value="85"/>
</datalist>
<span class="alignright"><?php _e('Best image quality', 'wp-optimize');?></span>
</div>
</div>
<a href="#" class="wpo-toggle-advanced-options wpo_smush_single_image" <?php echo $smush_display; ?>><?php _e('Show advanced options', 'wp-optimize');?></a>
<div class='smush-advanced wpo-advanced-options'>
<h4><?php _e('Service provider', 'wp-optimize');?></h4>
<fieldset class="compression_server">
<label for="resmushit">
<input type="radio" id="resmushit" name="compression_server_<?php echo $post_id; ?>" value="resmushit" <?php checked($smush_options['compression_server'], 'resmushit'); ?>>
<a href="http://resmush.it" target="_blank"><?php _e('reSmush.it', 'wp-optimize');?></a>
</label>
</fieldset>
<h4><?php _e('Other options', 'wp-optimize');?></h4>
<fieldset class="other_options">
<label for='smush_backup_<?php echo $post_id; ?>'>
<input type='checkbox' name='smush_backup_<?php echo $post_id; ?>' id='smush_backup_<?php echo $post_id; ?>' <?php checked($smush_options['back_up_original']); ?>>
<span><?php _e('Backup original', 'wp-optimize'); ?></span>
</label>
<label for='smush_exif_<?php echo $post_id; ?>'>
<input type='checkbox' name='smush_exif_<?php echo $post_id; ?>' id='smush_exif_<?php echo $post_id; ?>' class="preserve_exif" <?php checked($smush_options['preserve_exif']); ?>>
<span><?php _e('Keep EXIF data', 'wp-optimize'); ?></span>
</label>
</fieldset>
</div>
<?php if ($compressed_by_another_plugin) { ?>
<p><b><?php _e('Note: This image is already compressed by another plugin', 'wp-optimize'); ?></b></p>
<?php } ?>
<div class='wpo_smush_single_image action_button' <?php echo $smush_display; ?> >
<input type='button' data-blog='<?php echo get_current_blog_id(); ?>' data-id="<?php echo $post_id; ?>" id='smush_compress_<?php echo $post_id; ?>' class='button-primary button' value='<?php _e('Compress', 'wp-optimize'); ?>'/>
</div>
<div class='wpo_smush_mark_single_image action_button' <?php echo $smush_mark; ?> >
<input type='button' data-blog='<?php echo get_current_blog_id(); ?>' data-id="<?php echo $post_id; ?>" id='smush_mark_<?php echo $post_id; ?>' class='button' value='<?php _e('Mark as already compressed', 'wp-optimize'); ?>'/>
</div>
<div class='wpo_smush_unmark_single_image action_button' <?php echo $smush_unmark; ?> >
<input type='button' data-blog='<?php echo get_current_blog_id(); ?>' data-id="<?php echo $post_id; ?>" id='smush_unmark_<?php echo $post_id; ?>' class='button' value='<?php _e('Mark as uncompressed', 'wp-optimize'); ?>'/>
</div>
<?php
$menu_page_url = menu_page_url('wpo_images', false);
if ('' === $menu_page_url && !is_multisite()) {
$menu_page_url = admin_url('admin.php?page=wpo_images');
}
if (is_multisite()) {
$menu_page_url = network_admin_url('admin.php?page=wpo_images');
}
?>
<div class="smush-metabox-dashboard-link">
<a href="<?php echo $menu_page_url; ?>"><?php _e('WP-Optimize image settings', 'wp-optimize'); ?></a>
</div>
</div>
<div id="smush-information-modal" class="wp-core-ui" style="display:none;">
<div class="smush-information"></div>
<input type="button" class="wpo_primary_small button-primary information-modal-close" value="<?php esc_attr_e('Close', 'wp-optimize'); ?>" />
</div>
<div id="smush-information-modal-cancel-btn" style="display:none;">
<div class="smush-information"></div>
<input type="button" class="wpo_primary_small button-primary" value="<?php esc_attr_e('Cancel', 'wp-optimize'); ?>" />
</div>
<script type="text/javascript">jQuery(document).trigger('admin-metabox-smush-loaded');</script>

View File

@@ -0,0 +1,46 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<?php if (0 < count($tabs)) : ?>
<h2 id="wp-optimize-nav-tab-wrapper__<?php echo esc_attr($page); ?>" class="nav-tab-wrapper">
<a id="wp-optimize-nav-tab-menu" href="#" class="nav-tab" role="toggle-menu">
<span><?php _e('Menu', 'wp-optimize'); ?></span>
</a>
<?php
foreach ($tabs as $tab_id => $tab) {
$tab_icon = '';
if (is_array($tab)) {
$tab_title = $tab['title'];
$tab_icon = isset($tab['icon']) ? $tab['icon'] : '';
} else {
$tab_title = $tab;
}
?>
<a id="wp-optimize-nav-tab-<?php echo esc_attr($page.'-'.$tab_id); ?>" data-tab="<?php echo esc_attr($tab_id); ?>" data-page="<?php echo esc_attr($page); ?>" href="<?php esc_attr_e($options->admin_page_url($page)); ?>&amp;tab=wp_optimize_<?php echo $tab_id; ?>" class="nav-tab <?php if ($active_tab == $tab_id) echo 'nav-tab-active'; ?>">
<?php if ($tab_icon) : ?>
<span class="dashicons dashicons-<?php echo $tab_icon; ?>"></span>
<?php endif; ?>
<span><?php echo $tab_title; ?></span>
</a>
<?php } ?>
<span class="wpo-feedback">
<a href="#" class="nav-tab">
<span class="dashicons dashicons-admin-comments"></span>
<span><?php _e('Feedback', 'wp-optimize'); ?></span>
</a>
<div class="wpo-feedback-box">
<a href="<?php echo WP_Optimize()->maybe_add_affiliate_params('https://getwpo.com/feature-request/?utm_source=wp-optimize&utm_medium=quick_feedback&utm_campaign=feature_request'); ?>" target="_blank"><?php _e('I have an idea to improve WP-Optimize', 'wp-optimize'); ?></a>
<?php if ($wpo_is_premium) : ?>
<a href="<?php echo WP_Optimize()->maybe_add_affiliate_params('https://getwpo.com/premium-support/?utm_source=wp-optimize&utm_medium=quick_feedback&utm_campaign=help_or_bug_report'); ?>" target="_blank"><?php _e('I need help / something is not working', 'wp-optimize'); ?></a>
<?php else : ?>
<a href="https://wordpress.org/support/plugin/wp-optimize/" target="_blank"><?php _e('I need help / something is not working', 'wp-optimize'); ?></a>
<?php endif; ?>
</div>
</span>
</h2>
<?php endif;

View File

@@ -0,0 +1,51 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<header class="wpo-main-header">
<p class="wpo-header-links">
<span class="wpo-header-links__label"><?php _e('Useful links', 'wp-optimize'); ?></span>
<?php $wp_optimize->wp_optimize_url('https://getwpo.com/', __('Home', 'wp-optimize')); ?> |
<?php $wp_optimize->wp_optimize_url('https://updraftplus.com/', 'UpdraftPlus'); ?> |
<?php $wp_optimize->wp_optimize_url('https://updraftplus.com/news/', __('News', 'wp-optimize')); ?> |
<?php $wp_optimize->wp_optimize_url('https://twitter.com/updraftplus', __('Twitter', 'wp-optimize')); ?> |
<?php $wp_optimize->wp_optimize_url('https://wordpress.org/support/plugin/wp-optimize/', __('Support', 'wp-optimize')); ?> |
<?php $wp_optimize->wp_optimize_url('https://updraftplus.com/newsletter-signup', __('Newsletter', 'wp-optimize')); ?> |
<?php $wp_optimize->wp_optimize_url('https://david.dw-perspective.org.uk', __("Team lead", 'wp-optimize')); ?> |
<?php $wp_optimize->wp_optimize_url('https://getwpo.com/faqs/', __("FAQs", 'wp-optimize')); ?> |
<?php $wp_optimize->wp_optimize_url('https://www.simbahosting.co.uk/s3/shop/', __("More plugins", 'wp-optimize')); ?>
</p>
<div class="wpo-logo__container">
<img class="wpo-logo" src="<?php echo trailingslashit(WPO_PLUGIN_URL); ?>images/notices/wp_optimize_logo.png" alt="" />
<?php
$sqlversion = (string) $wp_optimize->get_db_info()->get_version();
echo '<strong>WP-Optimize '.(WP_Optimize::is_premium() ? __('Premium', 'wp-optimize') : '' ).' <span class="wpo-version">'.WPO_VERSION.'</span></strong>';
?>
<span class="wpo-subheader"><?php echo htmlspecialchars(__('Make your site fast & efficient', 'wp-optimize')); ?></span>
</div>
<?php
$wp_optimize->include_template('pages-menu.php', false, array('menu_items' => WP_Optimize()->get_submenu_items()));
?>
</header>
<?php
if ($show_notices) {
$installed = $wp_optimize->get_options()->get_option('installed-for', 0);
$installed_for = time() - $installed;
$advert = false;
if ($installed && $installed_for > 28*86400 && $installed_for < 84*86400) {
$advert = 'rate_plugin';
}
if ($installed && $installed_for > 14*86400) {
// This is to display the notices.
$wp_optimize_notices->do_notice($advert);
}
}

View File

@@ -0,0 +1,66 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<div class="wpo_section wpo_group">
<h3 class="wpo-first-child"><?php _e('Browser static file caching settings (via headers)', 'wp-optimize');?></h3>
<p>
<?php echo __("Browser static file caching uses HTTP response headers to advise a visitor's browser to cache non-changing files for a while, so that it doesn't attempt to retrieve them upon every visit.", 'wp-optimize').' '.sprintf('<a href="%s" target="_blank">%s</a>', $info_link, __('Follow this link to get more information.', 'wp-optimize')); ?>
</p>
<div class="wpo-fieldgroup">
<?php if ($is_cloudflare_site) : ?>
<p class="wpo-enabled"><span class="dashicons dashicons-yes"></span>
<em><?php _e('Your website seems to use Cloudflare, which handles the browser caching rules.', 'wp-optimize'); ?></em>
</p>
<?php else : ?>
<div id="wpo_browser_cache_status" class="<?php echo $class_name; ?>">
<span class="wpo-enabled"><span class="dashicons dashicons-yes"></span> <?php printf(__('Browser static file caching headers are currently %s.', 'wp-optimize'), '<strong>'.__('enabled', 'wp-optimize').'</strong>'); ?></span>
<span class="wpo-disabled"><?php printf(__('Browser static file caching headers are currently %s.', 'wp-optimize'), '<strong>'.__('disabled', 'wp-optimize').'</strong>'); ?></span>
</div>
<br>
<?php
// add browser cache control section only if browser cache disabled or we added cache settings to .htaccess.
if (false == $wpo_browser_cache_enabled || $wpo_browser_cache_settings_added) {
?>
<div id="wpo_browser_cache_error_message" class="notice error below-h2"><?php
if (is_wp_error($wpo_browser_cache_enabled) && $wp_optimize->is_apache_server()) {
echo htmlspecialchars($wpo_browser_cache_enabled->get_error_message());
}
?></div>
<?php
if ($wp_optimize->is_apache_server()) {
$button_text = $wpo_browser_cache_enabled ? __('Update', 'wp-optimize') : __('Enable', 'wp-optimize');
?>
<form>
<label><?php _e('Expiration time:', 'wp-optimize'); ?></label>
<input id="wpo_browser_cache_expire_days" type="number" min="0" step="1" name="browser_cache_expire_days" value="<?php echo esc_attr($wpo_browser_cache_expire_days); ?>">
<label for="wpo_browser_cache_expire"><?php _e('day(s)', 'wp-optimize'); ?></label>
<input id="wpo_browser_cache_expire_hours" type="number" min="0" step="1" name="browser_cache_expire_hours" value="<?php echo esc_attr($wpo_browser_cache_expire_hours); ?>">
<label for="wpo_browser_cache_expire_hours"><?php _e('hour(s)', 'wp-optimize'); ?></label>
<button class="button-primary" type="button" id="wp_optimize_browser_cache_enable"><?php echo $button_text; ?></button>
<img class="wpo_spinner display-none" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>"
width="20" height="20" alt="...">
<p><?php _e('Empty or 0 values disable the headers.', 'wp-optimize'); ?></p>
</form>
<?php
} else {
printf('<a href="%s" target="_blank">%s</a>', $faq_link, __('Follow this link to read the article about how to enable browser cache with your server software.', 'wp-optimize'));
}
?>
<div id="wpo_browser_cache_message"></div>
<pre id="wpo_browser_cache_output" style="display: none;"></pre>
<?php
}
endif;
?>
</div><!-- END .wpo-fieldgroup -->
</div><!-- END .wpo_section -->

View File

@@ -0,0 +1,75 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<div class="wpo_section wpo_group">
<h3 class="wpo-first-child"><?php _e('Gzip compression settings', 'wp-optimize');?></h3>
<p>
<span class="dashicons dashicons-info"></span> <span><?php _e("This option improves the performance of your website and decreases its loading time. When a visitor makes a request, the server compresses the requested resource before sending it leading to smaller file sizes and faster loading.", 'wp-optimize'); ?>
<?php printf('<a href="%s" target="_blank">%s</a>', $info_link, __('Follow this link to get more information about Gzip compression.', 'wp-optimize')); ?>
</span>
</p>
<?php if (is_wp_error($wpo_gzip_headers_information)) {
$class = 'notice notice-error';
printf('<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), esc_html( $wpo_gzip_headers_information->get_error_message()));
} else {
?>
<?php if ($wpo_gzip_compression_enabled && !is_wp_error($wpo_gzip_compression_enabled) && !$wpo_gzip_compression_enabled_by_wpo) : ?>
<div class="wpo-fieldgroup wpo-gzip-already-enabled">
<p><span class="dashicons dashicons-yes"></span>
<?php if (is_array($wpo_gzip_headers_information) && 'brotli' == $wpo_gzip_headers_information['compression']) { ?>
<?php _e('Your server uses Brotli compression instead of Gzip, which is good.', 'wp-optimize'); ?>
<?php } else { ?>
<?php _e('Gzip compression is already enabled.', 'wp-optimize'); ?>
<?php } ?>
<?php if ($is_cloudflare_site) { ?>
<em><?php _e('It seems to be handled by Cloudflare.', 'wp-optimize'); ?></em>
<?php } ?>
</p>
</div>
<?php else : ?>
<div class="wpo-fieldgroup">
<p id="wpo_gzip_compression_status" class="<?php echo $class_name; ?>">
<strong class="wpo-enabled"><?php _e('Gzip compression is currently ENABLED.', 'wp-optimize'); ?></strong>
<strong class="wpo-disabled"><?php _e('Gzip compression is currently DISABLED.', 'wp-optimize'); ?></strong>
<?php if (!$wp_optimize->is_apache_server() || ($wpo_gzip_compression_enabled && false == $wpo_gzip_compression_settings_added)) : ?>
<a href="#" class="wpo-refresh-gzip-status" title="<?php esc_attr_e('Press this to see if any changes were made to your Gzip configuration', 'wp-optimize'); ?>"><?php _e('Check status again', 'wp-optimize'); ?> <img class="wpo_spinner display-none" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>"></a>
<?php endif; ?>
</p>
<br>
<?php
// add gzip compression section only if gzip compression disabled or we added cache settings to .htaccess.
if (is_wp_error($wpo_gzip_compression_enabled) || false == $wpo_gzip_compression_enabled || $wpo_gzip_compression_settings_added) {
if ($wp_optimize->is_apache_server()) {
$button_text = (!is_wp_error($wpo_gzip_compression_enabled) && $wpo_gzip_compression_enabled) ? __('Disable', 'wp-optimize') : __('Enable', 'wp-optimize');
?>
<form>
<button class="button-primary" type="button"
id="wp_optimize_gzip_compression_enable" data-enable="<?php echo $wpo_gzip_compression_enabled ? '0' : '1'; ?>"><?php echo $button_text; ?></button>
<img class="wpo_spinner display-none" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>"
width="20" height="20" alt="...">
<br>
</form>
<?php
} else {
printf('<a href="%s" target="_blank">%s</a>', $faq_link, __('Follow this link to read the article about how to enable Gzip compression with your server software.', 'wp-optimize'));
}
}
?>
</div>
<div id="wpo_gzip_compression_error_message">
<?php
if (is_wp_error($wpo_gzip_compression_enabled)) {
echo htmlspecialchars($wpo_gzip_compression_enabled->get_error_message());
}
?>
</div>
<pre id="wpo_gzip_compression_output" style="display: none;"></pre>
<?php endif; ?>
<?php } ?>
</div>

View File

@@ -0,0 +1,50 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<h3 class="wpo-first-child"><?php _e('URLs to exclude from caching', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<p>
<label for="cache_exception_urls"><?php printf(__('List paths (e.g. %s) that should not be cached (one per line)', 'wp-optimize'), '<code>'._x('/product/green-beans', 'an example path', 'wp-optimize').'</code>'); ?> </label>
<textarea name="cache_exception_urls" id="cache_exception_urls" class="cache-settings" placeholder="/members/*"><?php echo htmlspecialchars($cache_exception_urls); ?></textarea>
</p>
<span>
<?php _e('Use the wildcard * to exclude child URLs.', 'wp-optimize'); ?> <?php printf(_x('e.g. %s or %s', '%s are examples of path using the wildcard *', 'wp-optimize'), '<code>'._x('/shop/*', 'an example path with the wildcard (*)', 'wp-optimize').'</code>', '<code>'._x('*sample-path*', 'a second example path using the wildcard (*) twice', 'wp-optimize').'</code>'); ?>
</span>
<?php do_action('wpo_after_cache_exception_urls'); ?>
</div>
<?php do_action('wpo_after_cache_exception_urls_fieldgroup'); ?>
<h3 class="wpo-first-child"><?php _e('Cookies which, if present, will prevent caching (one per line)', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<p>
<label for="cache_exception_cookies"><?php _e('List of cookies that will prevent caching when set.', 'wp-optimize'); ?></label>
<textarea name="cache_exception_cookies" id="cache_exception_cookies" class="cache-settings" placeholder="wordpress_*"><?php echo htmlspecialchars($cache_exception_cookies); ?></textarea>
</p>
</div>
<h3 class="wpo-first-child"><?php _e('List of browser agent strings which, if detected, will prevent caching', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<p>
<label for="cache_exception_browser_agents"><?php _e('List of browser agents strings or substrings that should not be served cached files (one per line)', 'wp-optimize'); ?></label>
<textarea name="cache_exception_browser_agents" id="cache_exception_browser_agents" class="cache-settings" placeholder="AppleWebKit/*"><?php echo htmlspecialchars($cache_exception_browser_agents); ?></textarea>
</p>
<span><?php _e('If any of the above strings is found in the User-Agent HTTP header, then the requested page will not be cached.', 'wp-optimize'); ?> </span>
</div>
<?php do_action('wpo_page_cache_advanced_settings', $wpo_cache_options); ?>
<input id="wp-optimize-save-cache-advanced-rules" class="button button-primary" type="submit" name="wp-optimize-save-cache-advanced-rules" value="Save changes">
<img class="wpo_spinner" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="...">
<span class="save-done dashicons dashicons-yes display-none"></span>

View File

@@ -0,0 +1,9 @@
<?php if (!defined('ABSPATH')) die('No direct access.'); ?>
<h3 class="wpo-cloudflare-cache-options purge-cache"> <?php _e('Cloudflare settings', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup cache-options wpo-cloudflare-cache-options purge-cache">
<p>
<input id="purge_cloudflare_cache" disabled type="checkbox" name="purge_cloudflare_cache" class="cache-settings">
<label for="purge_cloudflare_cache"><?php _e('Purge Cloudflare cached pages when the WP-Optimize cache is purged', 'wp-optimize'); ?> <em><?php printf(__('(This feature requires %s)', 'wp-optimize'), '<a target="_blank" href="'.WP_Optimize()->maybe_add_affiliate_params('https://getwpo.com/buy/').'">WP Optimize Premium</a>'); ?></em></label>
</p>
</div>

View File

@@ -0,0 +1,53 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<h3 class="wpo-first-child"><?php _e('Preload now', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<p>
<input id="wp_optimize_run_cache_preload" class="button button-primary" type="submit" name="wp_optimize_run_cache_preload" value="<?php echo $is_running ? esc_attr__('Cancel', 'wp-optimize') : esc_attr__('Run now', 'wp-optimize'); ?>" <?php echo $is_running ? 'data-running="1"' : ''; ?>>
<span id="wp_optimize_preload_cache_status"><?php
echo htmlspecialchars($status_message);
?></span>
</p>
<span>
<?php _e('This action will trigger WP-Optimize to cache the site by visiting pages to preload them (so that they are ready the first time a human visitor wants them).', 'wp-optimize'); ?>
<?php _e('If a sitemap is available, then it will be used to determine which content gets cached.', 'wp-optimize'); ?>
</span>
</div>
<h3 class="wpo-first-child"><?php _e('Schedule preloader', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<p>
<label>
<input name="enable_schedule_preload" id="enable_schedule_preload" class="cache-settings" type="checkbox" value="true" <?php checked($wpo_cache_options['enable_schedule_preload']); ?>>
<?php _e('Activate scheduled cache preloading', 'wp-optimize'); ?>
</label>
<p>
<?php _e('The scheduled preloading will run automatically in your chosen time period.', 'wp-optimize'); ?>
</p>
</p>
<label for="preload_schedule_type"><?php _e('Select schedule type', 'wp-optimize'); ?></label><br>
<select id="preload_schedule_type" class="cache-settings" name="preload_schedule_type" disabled>
<?php
foreach ($schedule_options as $opt_id => $opt_description) {
?>
<option value="<?php echo esc_attr($opt_id); ?>" <?php selected($wpo_cache_options['preload_schedule_type'], $opt_id); ?> <?php if ('wpo_use_cache_lifespan' == $opt_id && $wpo_cache_options['page_cache_length_value'] <= 0) disabled(true); ?>><?php echo htmlspecialchars($opt_description); ?></option>
<?php
}
?>
</select>
</div>
<input id="wp-optimize-save-cache-preload-settings" class="button button-primary" type="submit" name="wp-optimize-save-cache-preload-settings" value="<?php esc_attr_e('Save changes', 'wp-optimize');?>">
<img class="wpo_spinner" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="...">
<span class="save-done dashicons dashicons-yes display-none"></span>

View File

@@ -0,0 +1,111 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<?php if ($does_server_handles_cache) : ?>
<div class="wpo-info highlight-dashicons">
<h3><?php _e('Your web hosting company/server handles: ', 'wp-optimize'); ?></h3>
<p><?php _e('Page caching', 'wp-optimize'); ?><span class="dashicons dashicons-saved"></span></p>
<p><?php _e('Gzip compression', 'wp-optimize'); ?><span class="dashicons dashicons-saved"></span></p>
<p><?php _e('Browser static file caching (via headers)', 'wp-optimize'); ?><span class="dashicons dashicons-saved"></span></p>
</div>
<?php else : ?>
<div class="wpo-info">
<a class="wpo-info__trigger" href="#"><span class="dashicons dashicons-sos"></span> <?php _e('How to use the cache feature', 'wp-optimize'); ?> <span class="wpo-info__close"><?php _e('Close', 'wp-optimize'); ?></span></a>
<div class="wpo-info__content">
<p><strong><?php _e('Not sure how to use the cache feature?', 'wp-optimize'); ?></strong> <br><?php _e('Watch our how-to video below.', 'wp-optimize'); ?></p>
<div class="wpo-video-preview">
<a href="https://vimeo.com/337247770" data-embed="https://player.vimeo.com/video/337247770?color=df6926&title=0&byline=0&portrait=0" target="_blank"><img src="<?php echo trailingslashit(WPO_PLUGIN_URL); ?>images/notices/cache-video-preview.png" alt="<?php _e('Cache video preview', 'wp-optimize');?>" /></a>
</div>
<small>(<?php _e('Loads a video hosted on vimeo.com', 'wp-optimize'); ?>) - <a href="https://vimeo.com/337247770" target="_blank"><?php _e('Open the video in a new window', 'wp-optimize'); ?></a></small>
</div>
</div>
<div class="wpo-fieldgroup wpo-first-child cache-options">
<div class="notice notice-warning below-h2 wpo-warnings__enabling-cache wpo_hidden"><p></p><ul></ul></div>
<div class="notice error below-h2 wpo-error wpo-error__enabling-cache wpo_hidden"><p></p></div>
<pre id="wpo_advanced_cache_output" style="display: none;"></pre>
<div class="switch-container">
<label class="switch">
<input name="enable_page_caching" id="enable_page_caching" class="cache-settings" type="checkbox" value="true" <?php checked($wpo_cache_options['enable_page_caching'] || $wpo_cache->is_enabled()); ?>>
<span class="slider round"></span>
</label>
<label for="enable_page_caching">
<?php _e('Enable page caching', 'wp-optimize'); ?>
</label>
</div>
<p>
<?php echo __("This is all that's needed for caching to work.", 'wp-optimize').' '.__('WP-Optimize will automatically detect and configure itself optimally for your site.', 'wp-optimize').' '.__('You can tweak the the settings below and in the advanced settings tab, if needed.', 'wp-optimize'); ?>
</p>
<?php if (!empty($active_cache_plugins)) { ?>
<p class="wpo-error">
<?php
printf(__('It looks like you already have an active caching plugin (%s) installed. Having more than one active page cache might cause unexpected results.', 'wp-optimize'), implode(', ', $active_cache_plugins));
?>
</p>
<?php } ?>
</div>
<h3 class="purge-cache" <?php echo $display; ?>> <?php _e('Purge the cache', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup cache-options purge-cache" <?php echo $display; ?> >
<p class="wpo-button-wrap">
<input id="wp-optimize-purge-cache" class="button button-primary <?php echo $can_purge_the_cache ? '' : 'disabled'; ?>" type="submit" value="<?php esc_attr_e('Purge cache', 'wp-optimize'); ?>" <?php echo $can_purge_the_cache ? '' : 'disabled'; ?>>
<img class="wpo_spinner" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="...">
<span class="save-done dashicons dashicons-yes display-none"></span>
</p>
<p>
<?php _e('Deletes the entire cache contents but keeps the page cache enabled.', 'wp-optimize'); ?>
</p>
<p>
<span id="wpo_current_cache_size_information"><?php _e('Current cache size:', 'wp-optimize'); ?> <?php echo WP_Optimize()->format_size($cache_size['size']); ?></span>
<br><span id="wpo_current_cache_file_count"><?php _e('Number of files:', 'wp-optimize'); ?> <?php echo $cache_size['file_count']; ?></span>
</p>
</div>
<h3><?php _e('Cache settings', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup cache-options">
<div class="wpo-fieldgroup__subgroup">
<label for="enable_mobile_caching">
<input name="enable_mobile_caching" id="enable_mobile_caching" class="cache-settings" type="checkbox" value="true" <?php checked($wpo_cache_options['enable_mobile_caching'], 1); ?>>
<?php _e('Generate separate files for mobile devices', 'wp-optimize'); ?>
</label>
<span tabindex="0" data-tooltip="<?php _e('Useful if your website has mobile-specific content.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
</div>
<div class="wpo-fieldgroup__subgroup">
<label for="enable_user_caching">
<input name="enable_user_caching" id="enable_user_caching" class="cache-settings wpo-select-group" type="checkbox" value="true" <?php checked($wpo_cache_options['enable_user_caching']); ?>>
<?php _e('Serve cached pages to logged in users', 'wp-optimize'); ?>
</label>
<span tabindex="0" data-tooltip="<?php _e('Enable this option if you do not have user-specific or restricted content on your website.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
</div>
<?php do_action('wpo_after_cache_settings'); ?>
<div class="wpo-fieldgroup__subgroup">
<label for="page_cache_length_value"><?php _e('Cache lifespan', 'wp-optimize'); ?></label>
<p>
<input name="page_cache_length_value" id="page_cache_length_value" class="cache-settings" type="number" value="<?php echo esc_attr($wpo_cache_options['page_cache_length_value']); ?>">
<select name="page_cache_length_unit" id="page_cache_length_unit" class="cache-settings">
<option value="hours" <?php selected('hours', $wpo_cache_options['page_cache_length_unit']); ?>><?php _e('Hours', 'wp-optimize'); ?></option>
<option value="days" <?php selected('days', $wpo_cache_options['page_cache_length_unit']); ?>><?php _e('Days', 'wp-optimize'); ?></option>
<option value="months" <?php selected('months', $wpo_cache_options['page_cache_length_unit']); ?>><?php _e('Months', 'wp-optimize'); ?></option>
</select>
</p>
<span>
<?php _e('Time after which a new cached version will be generated (0 = only when the cache is emptied)', 'wp-optimize'); ?>
</span>
</div>
<?php do_action('wpo_page_cache_settings_after', $wpo_cache_options); ?>
</div>
<input id="wp-optimize-save-cache-settings" class="button button-primary" type="submit" name="wp-optimize-save-cache-settings" value="<?php esc_attr_e('Save changes', 'wp-optimize'); ?>">
<img class="wpo_spinner" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="....">
<span class="save-done dashicons dashicons-yes display-none"></span>
<?php endif;

View File

@@ -0,0 +1,89 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<table id="optimizations_list" class="wp-list-table widefat striped">
<thead>
<tr>
<td class="check-column"><input id="select_all_optimizations" type="checkbox" /></td>
<th><?php _e('Optimization', 'wp-optimize'); ?></th>
<th></th>
<!-- <th></th>-->
</tr>
</thead>
<tbody>
<?php
$optimizations = $optimizer->sort_optimizations($optimizer->get_optimizations());
foreach ($optimizations as $id => $optimization) {
if ('optimizetables' == $id && false === $does_server_allows_table_optimization) continue;
// If we don't want to show optimization on the first tab.
if (false === $optimization->display_in_optimizations_list()) continue;
// This is an array, with attributes dom_id, activated, settings_label, info; all values are strings.
$use_ajax = defined('WP_OPTIMIZE_DEBUG_OPTIMIZATIONS') && WP_OPTIMIZE_DEBUG_OPTIMIZATIONS ? false : true;
$html = $optimization->get_settings_html($use_ajax);
$optimize_table_list_disabled = '';
$optimize_table_list_data_disabled = '';
// Check if the DOM is optimize-db to generate a list of tables.
if ('optimize-db' == $html['dom_id']) {
$table_list = $optimizer->get_table_information();
// Make sure that optimization_table_inno_db is set.
if ($table_list['inno_db_tables'] > 0 && 0 == $table_list['is_optimizable'] && 0 == $table_list['non_inno_db_tables']) {
$optimize_table_list_disabled .= 'disabled';
$optimize_table_list_data_disabled = 'data-disabled="1"';
$html['activated'] = '';
}
}
$sensitive_items = array(
'clean-transient',
'clean-pingbacks',
'clean-trackbacks',
'clean-postmeta',
'clean-orphandata',
'clean-commentmeta',
);
?>
<tr class="wp-optimize-settings wp-optimize-settings-<?php echo $html['dom_id']; ?><?php echo (in_array($html['dom_id'], $sensitive_items)) ? ' wp-optimize-setting-is-sensitive' : ''; ?>" id="wp-optimize-settings-<?php echo $html['dom_id']; ?>" data-optimization_id="<?php echo esc_attr($id); ?>" data-optimization_run_sort_order="<?php echo $optimization->get_run_sort_order(); ?>" >
<?php
if (!empty($html['settings_label'])) {
?>
<th class="wp-optimize-settings-optimization-checkbox check-column">
<input name="<?php echo $html['dom_id']; ?>" id="optimization_checkbox_<?php echo $id; ?>" class="optimization_checkbox" type="checkbox" value="true" <?php if ($html['activated']) echo 'checked="checked"'; ?> <?php echo $optimize_table_list_data_disabled; ?> <?php echo $optimize_table_list_disabled; ?> >
<img id="optimization_spinner_<?php echo $id; ?>" class="optimization_spinner display-none" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="...">
</th>
<td>
<label for="optimization_checkbox_<?php echo $id; ?>"><?php echo $html['settings_label']; ?></label>
<div class="wp-optimize-settings-optimization-info" id="optimization_info_<?php echo $id; ?>">
<?php
if ($use_ajax && array_key_exists('support_ajax_get_info', $html) && $html['support_ajax_get_info']) {
$last_output = $optimization->get_last_output();
if ($last_output) {
echo join('<br>', $last_output);
} else {
echo '<span class="wp-optimize-optimization-info-ajax" data-id="'.$id.'">...</span>';
}
} else {
echo join('<br>', $html['info']);
}
?>
</div>
</td>
<td class="wp-optimize-settings-optimization-run">
<button id="optimization_button_<?php echo $id; ?>_big" class="button button-secondary wp-optimize-settings-optimization-run-button show_on_default_sizes optimization_button_<?php echo $id; ?>" type="button" <?php echo $optimize_table_list_data_disabled; ?> <?php echo $optimize_table_list_disabled; ?> ><?php _e('Run optimization', 'wp-optimize'); ?></button>
<button id="optimization_button_<?php echo $id; ?>_small" class="button button-secondary wp-optimize-settings-optimization-run-button show_on_mobile_sizes optimization_button_<?php echo $id; ?>" type="button" <?php echo $optimize_table_list_data_disabled; ?> <?php echo $optimize_table_list_disabled; ?> ><?php _e('Go', 'wp-optimize'); ?></button>
</td>
<?php } ?>
</tr>
<?php } ?>
</tbody>
</table>

View File

@@ -0,0 +1,57 @@
<?php
if (!defined('WPO_VERSION')) die('No direct access allowed');
?>
<div class="wpo_shade hidden">
<div class="wpo_shade_inner">
<span class="dashicons dashicons-update-alt wpo-rotate"></span>
<h4><?php _e('Loading data...', 'wp-optimize'); ?></h4>
</div>
</div>
<div class="wpo_section wpo_group">
<?php
if (!empty($optimization_results)) {
echo '<div id="message" class="updated below-h2"><strong>';
foreach ($optimization_results as $optimization_result) {
if (!empty($optimization_result->output)) {
foreach ($optimization_result->output as $line) {
echo $line."<br>";
}
}
}
echo '</strong></div>';
}
?>
<?php WP_Optimize()->include_template('database/status-box-contents.php', false, array('optimize_db' => false)); ?>
<form onsubmit="return confirm('<?php echo esc_js(__('Warning: This operation is permanent. Continue?', 'wp-optimize')); ?>')" action="#" method="post" enctype="multipart/form-data" name="optimize_form" id="optimize_form">
<?php wp_nonce_field('wpo_optimization'); ?>
<h3><?php _e('Optimizations', 'wp-optimize'); ?></h3>
<div class="wpo-run-optimizations__container">
<?php $button_caption = apply_filters('wpo_run_button_caption', __('Run all selected optimizations', 'wp-optimize')); ?>
<input class="button button-primary button-large" type="submit" id="wp-optimize" name="wp-optimize" value="<?php echo esc_attr($button_caption); ?>" /><?php WP_Optimize()->include_template('take-a-backup.php', false, array('checkbox_name' => 'enable-auto-backup')); ?>
</div>
<?php do_action('wpo_additional_options'); ?>
<?php
if ($load_data) {
WP_Optimize()->include_template('database/optimizations-table.php', false, array('does_server_allows_table_optimization' => $does_server_allows_table_optimization));
} else {
?>
<div class="wp-optimize-optimizations-table-placeholder">
</div>
<?php } ?>
<p class="wp-optimize-sensitive-tables-warning">
<span style="color: #E07575;"><span class="dashicons dashicons-warning"></span> <?php echo __('Warning:', 'wp-optimize').'</span> '.__('Items marked with this icon perform more intensive database operations. In very rare cases, if your database server happened to crash or be forcibly powered down at the same time as an optimization operation was running, data might be corrupted. ', 'wp-optimize').' '.__('You may wish to run a backup before optimizing.', 'wp-optimize'); ?>
</p>
</form>
</div>

View File

@@ -0,0 +1,84 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<h3><?php _e('Scheduled clean-up settings', 'wp-optimize'); ?></h3>
<p>
<a href="<?php echo WP_Optimize()->premium_version_link; ?>" target="_blank"><?php _e('Take control of clean-ups: Upgrade to Premium for a more powerful and flexible scheduler', 'wp-optimize'); ?></a>
</p>
<div class="wpo-fieldgroup">
<p>
<input name="enable-schedule" id="enable-schedule" type="checkbox" value ="true" <?php checked($options->get_option('schedule'), 'true'); ?>>
<label for="enable-schedule"><?php _e('Enable scheduled clean-up and optimization', 'wp-optimize'); ?></label>
</p>
<div id="wp-optimize-auto-options">
<p>
<?php _e('Select schedule type (default is Weekly)', 'wp-optimize'); ?><br>
<select id="schedule_type" name="schedule_type">
<?php
$schedule_options = array(
'wpo_daily' => __('Daily', 'wp-optimize'),
'wpo_weekly' => __('Weekly', 'wp-optimize'),
'wpo_fortnightly' => __('Fortnightly', 'wp-optimize'),
'wpo_monthly' => __('Monthly (approx. - every 30 days)', 'wp-optimize'),
);
$schedule_type_saved_id = $options->get_option('schedule-type', 'wpo_weekly');
// Backwards compatibility:
if ('wpo_otherweekly' == $schedule_type_saved_id) $schedule_type_saved_id = 'wpo_fortnightly';
foreach ($schedule_options as $opt_id => $opt_description) {
?>
<option value="<?php echo esc_attr($opt_id); ?>" <?php if ($opt_id == $schedule_type_saved_id) echo 'selected="selected"'; ?>><?php echo htmlspecialchars($opt_description); ?></option>
<?php
}
?>
</select>
</p>
<?php
$wpo_auto_options = $options->get_option('auto');
$optimizations = $optimizer->sort_optimizations($optimizer->get_optimizations());
foreach ($optimizations as $id => $optimization) {
if (empty($optimization->available_for_auto)) continue;
$auto_id = $optimization->get_auto_id();
$auto_dom_id = 'wp-optimize-auto-'.$auto_id;
$setting_activated = (empty($wpo_auto_options[$auto_id]) || 'false' == $wpo_auto_options[$auto_id]) ? false : true;
?>
<p>
<input name="wp-optimize-auto[<?php echo $auto_id; ?>]" id="<?php echo esc_attr($auto_dom_id); ?>" type="checkbox" value="true" <?php if ($setting_activated) echo 'checked="checked"'; ?>> <label for="<?php echo esc_attr($auto_dom_id); ?>"><?php echo $optimization->get_auto_option_description(); ?></label>
</p>
<?php
}
?>
<!-- disabled email notification
<p>
<label>
<input name="enable-email" id="enable-email" type="checkbox" value ="true" />
</label>
</p>
<p>
<label for="enable-email-address">
<input name="enable-email-address" id="enable-email-address" type="text" value ="" />
</label>
</p> -->
</div><!-- END #wp-optimize-auto-options -->
</div><!-- END .wpo-fieldgroup -->

View File

@@ -0,0 +1,39 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<h3 class="wpo-first-child"><?php _e('General settings', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<p>
<?php _e('Whether manually or on a schedule, these settings apply whenever a relevant optimization is run.', 'wp-optimize'); ?>
</p>
<p>
<input name="enable-retention" id="enable-retention" type="checkbox" value ="true" <?php echo ($options->get_option('retention-enabled') == 'true') ? 'checked="checked"' : ''; ?> />
<?php
$retention_period = max((int) $options->get_option('retention-period', '2'), 1);
echo '<label for="enable-retention">';
printf(
__('Keep last %s weeks data', 'wp-optimize'),
'</label><input id="retention-period" name="retention-period" type="number" step="1" min="2" max="99" value="'.$retention_period.'"><label for="enable-retention">'
);
echo '</label>';
?>
<br>
<small><?php _e('This option will, where relevant, retain data from the chosen period, and remove any garbage data before that period.', 'wp-optimize').' '.__('If the option is not active, then all garbage data will be removed.', 'wp-optimize').' '.__('This will also affect Auto Clean-up process', 'wp-optimize'); ?></small>
</p>
<p>
<input name="enable-revisions-retention" id="enable-revisions-retention" type="checkbox" value ="true" <?php echo ('true' == $options->get_option('revisions-retention-enabled')) ? 'checked="checked"' : ''; ?> />
<?php
$revisions_retention_count = (int) $options->get_option('revisions-retention-count', '2');
echo '<label for="enable-revisions-retention">';
printf(
__('Always keep %s post revisions', 'wp-optimize'),
'</label><input id="revisions-retention-count" name="revisions-retention-count" type="number" step="1" min="2" max="99" value="'.$revisions_retention_count.'"><label for="revisions-retention-count">'
);
echo '</label>';
?>
<br>
<small><?php _e('This option will retain specified number of post revisions, and remove other revisions.', 'wp-optimize').' '.__('If the option is not active, then all garbage data will be removed.', 'wp-optimize').' '.__('This will also affect Auto Clean-up process', 'wp-optimize'); ?></small>
</p>
<?php WP_Optimize()->include_template('take-a-backup.php', false, array('label' => __('Take a backup with UpdraftPlus before running scheduled optimizations', 'wp-optimize'), 'checkbox_name' => 'enable-auto-backup-scheduled')); ?>
</div>

View File

@@ -0,0 +1,26 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<div id="wp-optimize-database-settings" class="wpo_section wpo_group">
<form action="#" method="post" enctype="multipart/form-data" name="database_settings_form" id="database_settings_form">
<div id="wpo_database_settings_warnings"></div>
<?php
WP_Optimize()->include_template('database/settings-general.php');
WP_Optimize()->include_template('database/settings-auto-cleanup.php', false, array('show_innodb_option' => false));
?>
<div id="wp-optimize-save-database-settings-results"></div>
<input type="hidden" name="action" value="save_redirect">
<?php wp_nonce_field('wpo_optimization', '_wpnonce_db_settings'); ?>
<div class="wp-optimize-settings-save-results"></div>
<input id="wp-optimize-save-database-settings" class="button button-primary wpo-save-settings" type="submit" name="wp-optimize-settings" value="<?php esc_attr_e('Save settings', 'wp-optimize'); ?>" />
<img class="wpo_spinner wpo-saving-settings" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="...">
<span class="dashicons dashicons-yes display-none save-done"></span>
</form>
</div><!-- end #wp-optimize-general-settings -->

View File

@@ -0,0 +1,127 @@
<?php
if (!defined('WPO_VERSION')) die('No direct access allowed');
$retention_enabled = $options->get_option('retention-enabled', 'false');
$retention_period = $options->get_option('retention-period', '2');
$admin_page_url = $options->admin_page_url();
$revisions_retention_enabled = $options->get_option('revisions-retention-enabled', 'false');
$revisions_retention_count = $options->get_option('revisions-retention-count', '2');
?>
<h3 class="wpo-first-child"><?php _e('Status', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup" id="wp_optimize_status_box">
<p>
<?php
$lastopt = $options->get_option('last-optimized', 'Never');
if ('Never' !== $lastopt) {
// check if last optimized value is integer.
if (is_numeric($lastopt)) {
$lastopt = date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $lastopt + ( get_option('gmt_offset') * HOUR_IN_SECONDS ));
}
echo __('Last scheduled optimization was at', 'wp-optimize').': ';
echo '<span style="font-color: #004600; font-weight:bold;">';
echo htmlspecialchars($lastopt);
echo '</span>';
} else {
echo __('There was no scheduled optimization', 'wp-optimize');
}
?>
<br>
<?php
$scheduled_optimizations_enabled = false;
if (WP_Optimize::is_premium()) {
$scheduled_optimizations = WP_Optimize_Premium()->get_scheduled_optimizations();
if (!empty($scheduled_optimizations)) {
foreach ($scheduled_optimizations as $optimization) {
if (isset($optimization['status']) && 1 == $optimization['status']) {
$scheduled_optimizations_enabled = true;
break;
}
}
}
} else {
$scheduled_optimizations_enabled = $options->get_option('schedule', 'false') == 'true';
}
if ($scheduled_optimizations_enabled) {
echo '<strong>';
_e('Scheduled cleaning', 'wp-optimize');
echo ' <span style="color: #009B24;">'.__('enabled', 'wp-optimize').'</span>';
echo ', </strong>';
$timestamp = apply_filters('wpo_cron_next_event', wp_next_scheduled('wpo_cron_event2'));
if ($timestamp) {
$timestamp = $timestamp + 60 * 60 * get_option('gmt_offset');
$wp_optimize->cron_activate();
$date = new DateTime("@".$timestamp);
_e('Next schedule:', 'wp-optimize');
echo ' ';
echo '<span style="font-color: #004600">';
echo gmdate(get_option('date_format') . ' ' . get_option('time_format'), $timestamp);
echo '</span>';
echo ' - <a id="wp_optimize_status_box_refresh" href="'.esc_attr($admin_page_url).'">'.__('Refresh', 'wp-optimize').'</a>';
}
} else {
echo '<strong>';
_e('Scheduled cleaning disabled', 'wp-optimize');
echo '</strong>';
}
echo '<br>';
if ('true' == $retention_enabled) {
echo '<strong><span style="font-color: #0000FF;">';
printf(__('Keeping last %s weeks data', 'wp-optimize'), $retention_period);
echo '</span></strong>';
} else {
echo '<strong>'.__('Not keeping recent data', 'wp-optimize').'</strong>';
}
echo '<br>';
if ('true' == $revisions_retention_enabled) {
echo '<strong><span style="font-color: #0000FF;">';
printf(__('Keeping last %s revisions', 'wp-optimize'), $revisions_retention_count);
echo '</span></strong>';
} else {
echo '<strong>'.__('Not keeping any revisions', 'wp-optimize').'</strong>';
}
?>
</p>
<p>
<?php
$total_cleaned = $options->get_option('total-cleaned');
$total_cleaned_num = floatval($total_cleaned);
if ($total_cleaned_num > 0) {
echo '<h5>'.__('Total clean up overall:', 'wp-optimize').' ';
echo '<span style="font-color: #004600">';
echo $wp_optimize->format_size($total_cleaned);
echo '</span></h5>';
}
?>
</p>
<?php
$corrupted_tables_count = $options->get_option('corrupted-tables-count', 0);
if ($corrupted_tables_count > 0) {
?>
<p>
<span style="color: #E07575;"><?php printf(_n('Your database has %s corrupted table.', 'Your database has %s corrupted tables.', $corrupted_tables_count, 'wp-optimize'), $corrupted_tables_count); ?></span><br>
<a href="<?php echo esc_attr($admin_page_url); ?>&tab=wp_optimize_tables" onclick="jQuery('.wpo-pages-menu > a').first().trigger('click'); jQuery('#wp-optimize-nav-tab-wpo_database-tables').trigger('click'); return false;"><?php _e('Repair corrupted tables here.', 'wp-optimize'); ?></a>
</p>
<?php } ?>
</div>

View File

@@ -0,0 +1,117 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<tbody id="the-list">
<?php
// Check for InnoDB tables.
// Check for windows servers.
$sqlversion = $wp_optimize->get_db_info()->get_version();
$tablesstatus = $wp_optimize->get_optimizer()->get_tables();
$is_multisite_mode = $wp_optimize->is_multisite_mode();
$total_gain = 0;
$no = 0;
$row_usage = 0;
$data_usage = 0;
$index_usage = 0;
$overhead_usage = 0;
$non_inno_db_tables = 0;
$inno_db_tables = 0;
$small_overhead_size = 1048576;
foreach ($tablesstatus as $tablestatus) {
$no++;
echo '<tr
data-tablename="'.esc_attr($tablestatus->Name).'"
data-type="'.esc_attr($tablestatus->Engine).'"
data-optimizable="'.($tablestatus->is_optimizable ? 1 : 0).'"
'.($is_multisite_mode ? 'data-blog_id="'.($tablestatus->blog_id).'"' : '').'
>'."\n";
echo '<td data-colname="'.__('No.', 'wp-optimize').'">'.number_format_i18n($no).'</td>'."\n";
echo '<td data-tablename="'.esc_attr($tablestatus->Name).'" data-colname="'.__('Table', 'wp-optimize').'">'.htmlspecialchars($tablestatus->Name);
if (!empty($tablestatus->plugin_status)) {
if ($tablestatus->wp_core_table) {
echo "<br><span style='font-size: 11px;'>".__('Belongs to:', 'wp-optimize')."</span> ";
echo "<span style='font-size: 11px;'>".__('WordPress core', 'wp-optimize')."</span>";
} else {
echo '<div class="table-plugins">';
echo "<span style='font-size: 11px;'>".__('Known plugins that use this table name:', 'wp-optimize')."</span> ";
$separator = '<br>';
foreach ($tablestatus->plugin_status as $plugins_status) {
$plugin = $plugins_status['plugin'];
$status = $plugins_status['status'];
echo $separator;
echo " <a href='https://wordpress.org/plugins/{$plugin}/' target='_blank'><span style='font-size: 11px;'>{$plugin}</a>";
if (false == $status['installed']) {
echo " <span style='font-size: 11px; color: #9B0000; font-weight: bold;'>[".__('not installed', 'wp-optimize')."]</span>";
} elseif (false == $status['active']) {
echo " <span style='font-size: 11px; color: #9B0000; font-weight: bold;'>[".__('inactive', 'wp-optimize')."]</span>";
}
}
echo '</div>';
}
}
echo "</td>\n";
echo '<td data-colname="'.__('Records', 'wp-optimize').'" data-raw_value="'.esc_attr(intval($tablestatus->Rows)).'">'.number_format_i18n($tablestatus->Rows).'</td>'."\n";
echo '<td data-colname="'.__('Data Size', 'wp-optimize').'" data-raw_value="'.esc_attr(intval($tablestatus->Data_length)).'">'.$wp_optimize->format_size($tablestatus->Data_length).'</td>'."\n";
echo '<td data-colname="'.__('Index Size', 'wp-optimize').'" data-raw_value="'.esc_attr(intval($tablestatus->Index_length)).'">'.$wp_optimize->format_size($tablestatus->Index_length).'</td>'."\n";
if ($tablestatus->is_optimizable) {
echo '<td data-colname="'.__('Type', 'wp-optimize').'" data-optimizable="1">'.htmlspecialchars($tablestatus->Engine).'</td>'."\n";
echo '<td data-colname="'.__('Overhead', 'wp-optimize').'" data-raw_value="'.esc_attr(intval($tablestatus->Data_free)).'">';
$font_colour = ($optimize_db ? (($tablestatus->Data_free > $small_overhead_size) ? '#0000FF' : '#004600') : (($tablestatus->Data_free > $small_overhead_size) ? '#9B0000' : '#004600'));
echo '<span style="color:'.$font_colour.';">';
echo $wp_optimize->format_size($tablestatus->Data_free);
echo '</span>';
echo '</td>'."\n";
$overhead_usage += $tablestatus->Data_free;
$total_gain += $tablestatus->Data_free;
$non_inno_db_tables++;
} else {
echo '<td data-colname="'.__('Type', 'wp-optimize').'" data-optimizable="0">'.htmlspecialchars($tablestatus->Engine).'</td>'."\n";
echo '<td data-colname="'.__('Overhead', 'wp-optimize').'">';
echo '<span style="color:#0000FF;">-</span>';
echo '</td>'."\n";
$inno_db_tables++;
}
echo '<td data-colname="'.__('Actions', 'wp-optimize').'">'.apply_filters('wpo_tables_list_additional_column_data', '', $tablestatus).'</td>';
$row_usage += $tablestatus->Rows;
$data_usage += $tablestatus->Data_length;
$index_usage += $tablestatus->Index_length;
echo '</tr>'."\n";
}
// THis extra tbody with class of tablesorter-no-sort
// Is for tablesorter and it will not allow the total bar
// At the bottom of the table information to be sorted with the rest of the data
echo '<tbody class="tablesorter-no-sort">'."\n";
echo '<tr class="thead">'."\n";
echo '<th>'.__('Total:', 'wp-optimize').'</th>'."\n";
echo '<th>'.sprintf(_n('%s Table', '%s Tables', $no, 'wp-optimize'), number_format_i18n($no)).'</th>'."\n";
echo '<th>'.number_format_i18n($row_usage).'</th>'."\n";
echo '<th>'.$wp_optimize->format_size($data_usage).'</th>'."\n";
echo '<th>'.$wp_optimize->format_size($index_usage).'</th>'."\n";
echo '<th>'.'-'.'</th>'."\n";
echo '<th>';
$font_colour = (($optimize_db) ? (($overhead_usage > $small_overhead_size) ? '#0000FF' : '#004600') : (($overhead_usage > $small_overhead_size) ? '#9B0000' : '#004600'));
echo '<span style="color:'.$font_colour.'">'.$wp_optimize->format_size($overhead_usage).'</span>';
?>
</th>
<th><?php _e('Actions', 'wp-optimize'); ?></th>
</tr>
</tbody>

View File

@@ -0,0 +1,59 @@
<?php
if (!defined('WPO_VERSION')) die('No direct access allowed');
if ($load_data) {
$optimizer = WP_Optimize()->get_optimizer();
list ($db_size, $total_gain) = $optimizer->get_current_db_size();
}
?>
<h3><?php _e('Total size of database:', 'wp-optimize'); ?> <span id="optimize_current_db_size"><?php
if ($load_data) {
echo $db_size;
} else {
echo '...';
}
?></span></h3>
<?php
if ($optimize_db) {
?>
<h3><?php _e('Optimization results:', 'wp-optimize'); ?></h3>
<p style="color: #0000ff;" id="optimization_table_total_gain">
<?php
if ($total_gain > 0) {
echo __('Total space saved:', 'wp-optimize').' <span>'.$wp_optimize->format_size($total_gain).'</span> ';
$optimizer->update_total_cleaned(strval($total_gain));
}
?>
</p>
<?php
}
?>
<script type="text/html" id="tmpl-wpo-table-delete">
<h3><span class="dashicons dashicons-warning"></span> <?php _e('Are you sure?', 'wp-optimize'); ?></h3>
<div class="notice notice-warning">
<p><?php _e('WARNING - some plugins might not be detected as installed or activated if they are in unknown folders (for example premium plugins).', 'wp-optimize').' '.__('Only delete a table if you are sure of what you are doing, and after taking a backup.', 'wp-optimize'); ?></p>
<p><?php _e('If none of the plugins listed were ever installed on this website, you should not delete this table as it is likely to be used by an unlisted plugin.', 'wp-optimize'); ?></p>
</div>
<h4><?php printf(__('You are about to remove the table %s.', 'wp-optimize'), '<span class="table-name">{{data.table_name}}</span>'); ?></h4>
<div class="wpo-table-delete--plugins">
{{{data.plugins_list}}}
</div>
<# if (data.no_backup) { #>
<p class="no-backup-detected">
<input type="checkbox" id="confirm_deletion_without_backup"> <strong><?php _e('No automatic backup was detected.', 'wp-optimize'); ?></strong> <?php _e('I confirm that I will be able to revert the changes if needed.', 'wp-optimize'); ?>
</p>
<# } #>
<p>
<input type="checkbox" id="confirm_table_deletion"> <?php _e('I confirm that I have understood the risks in doing that, and that I know what I am doing.', 'wp-optimize'); ?>
</p>
<p>
<input type="checkbox" id="ignores_table_delete_warning"> <?php _e('Do not show this warning again.', 'wp-optimize'); ?>
</p>
<button type="button" class="button button-primary delete-table" disabled><?php _e('Remove the table', 'wp-optimize'); ?></button>
<button type="button" class="button cancel wpo-modal--close"><?php _e('Cancel', 'wp-optimize'); ?></button>
</script>

View File

@@ -0,0 +1,69 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<div class="wpo_shade hidden">
<div class="wpo_shade_inner">
<span class="dashicons dashicons-update-alt wpo-rotate"></span>
<h4><?php _e('Loading data...', 'wp-optimize'); ?></h4>
</div>
</div>
<?php
// This next bit belongs somewhere else, I think.
?>
<?php if ($optimize_db) { ?>
<p><?php _e('Optimized all the tables found in the database.', 'wp-optimize'); ?></p>
<?php } ?>
<?php
// used for output premium functionality
do_action('wpo_tables_list_before');
?>
<?php $wp_optimize->include_template('take-a-backup.php', false, array('label' => __('Take a backup with UpdraftPlus before any actions upon tables (recommended).', 'wp-optimize'), 'default_checkbox_value' => 'true', 'checkbox_name' => 'enable-auto-backup-1')); ?>
<p class="wpo-table-list-filter"><strong><?php echo __('Database name:', 'wp-optimize')." '".htmlspecialchars(DB_NAME)."'"; ?><a id="wp_optimize_table_list_refresh" href="#" class="wpo-refresh-button"><span class="dashicons dashicons-image-rotate"></span><?php _e('Refresh data', 'wp-optimize'); ?></a></strong> <input id="wpoptimize_table_list_filter" class="search" type="search" value="" placeholder="<?php esc_attr_e('Search for table', 'wp-optimize'); ?>" data-column="1" /></p>
<?php
$optimizer = WP_Optimize()->get_optimizer();
$table_prefix = $optimizer->get_table_prefix();
if (!$table_prefix) {
?>
<p class="wpo-table-list-filter"><span style="color: #0073aa;"><span class="dashicons dashicons-info"></span> <?php echo __('Note:', 'wp-optimize').'</span> '.__('Your WordPress install does not use a database prefix, so WP-Optimize was not able to differentiate which tables belong to WordPress so all tables are listed below.', 'wp-optimize'); ?></p>
<?php
}
?>
<table id="wpoptimize_table_list" class="wp-list-table widefat striped tablesorter wp-list-table-mobile-labels">
<thead>
<tr>
<th><?php _e('No.', 'wp-optimize'); ?></th>
<th class="column-primary"><?php _e('Table', 'wp-optimize'); ?></th>
<th><?php _e('Records', 'wp-optimize'); ?></th>
<th><?php _e('Data Size', 'wp-optimize'); ?></th>
<th><?php _e('Index Size', 'wp-optimize'); ?></th>
<th><?php _e('Type', 'wp-optimize'); ?></th>
<th><?php _e('Overhead', 'wp-optimize'); ?></th>
<th><?php _e('Actions', 'wp-optimize'); ?></th>
</tr>
</thead>
<?php
if ($load_data) {
WP_Optimize()->include_template('database/tables-body.php', false, array('optimize_db' => $optimize_db));
} else {
?>
<tbody>
<tr>
<td></td>
<td class="loading" align="center" colspan="6"><img class="wpo-ajax-template-loader" width="16" height="16" src="<?php echo admin_url(); ?>images/spinner-2x.gif" /> <?php _e('Loading tables list...', 'wp-optimize'); ?></td>
<td></td>
</tr>
</tbody>
<?php } ?>
</table>
<div id="wpoptimize_table_list_tables_not_found"><?php _e('Tables not found.', 'wp-optimize'); ?></div>
<?php
WP_Optimize()->include_template('database/tables-list-after.php', false, array('optimize_db' => $optimize_db, 'load_data' => $load_data));

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,36 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<?php
$lazyload_options = $options->get_option('lazyload', array(
'images' => false,
'iframes' => false,
'skip_classes' => '',
));
$read_more_link = 'https://developers.google.com/web/fundamentals/performance/lazy-loading-guidance/images-and-video/';
?>
<div id="wpo_lazy_load_settings">
<h3 class="wpo-first-child"><?php _e('Lazy-load images'); ?></h3>
<div class="wpo-fieldgroup premium-only">
<p>
<?php _e('Lazy-loading is technique that defers loading of non-critical resources (images, video) at page load time. Instead, these non-critical resources are loaded at the point they are needed (e.g. the user scrolls down to them).', 'wp-optimize'); ?>
<br>
<a href="<?php echo $read_more_link; ?>" target="_blank"><?php _e('Follow this link to read more about lazy-loading images and video', 'wp-optimize'); ?></a>
</p>
<ul>
<li><label><input type="checkbox" name="lazyload[images]" <?php checked($lazyload_options['images']); ?> disabled /><?php _e('Images', 'wp-optimize'); ?></label></li>
<li><label><input type="checkbox" name="lazyload[iframes]" <?php checked($lazyload_options['iframes']); ?> disabled /><?php _e('Iframes and Videos', 'wp-optimize'); ?></label></li>
</ul>
<p>
<?php _e('Skip image classes', 'wp-optimize');?><br>
<input type="text" name="lazyload[skip_classes]" id="wpo_lazyload_skip_classes" value="<?php echo esc_attr($lazyload_options['skip_classes']); ?>" disabled readonly /><br>
<small><?php _e('Enter the image class or classes comma-separated. Supports wildcards. Example: image-class1, image-class2, thumbnail*, ...', 'wp-optimize'); ?></small>
</p>
<div class="wpo-unused-image-sizes__premium-mask">
<a class="wpo-unused-images__premium-link" href="<?php esc_attr_e($wp_optimize->premium_version_link); ?>" target="_blank"><?php _e('Enable Lazy-loading with WP-Optimize Premium.', 'wp-optimize'); ?></a>
</div>
</div>
</div>

View File

@@ -0,0 +1,26 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<a class="wpo-collapsible"><?php _e('More', 'wp-optimize'); ?></a>
<div class="wpo-collapsible-content">
<table class="smush-details">
<thead>
<tr>
<th><?php _e('Size name', 'wp-optimze'); ?></th>
<th><?php _e('Original', 'wp-optimze'); ?></th>
<th><?php _e('Compressed', 'wp-optimze'); ?></th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($sizes_info as $size => $info) {
$saved = round((($info['original'] - $info['compressed']) / $info['original'] * 100), 2);
?>
<tr>
<td><?php echo htmlentities($size); ?></td>
<td><?php echo WP_Optimize()->format_size($info['original'], 1); ?></td>
<td><?php echo WP_Optimize()->format_size($info['compressed'], 1); ?></td>
<td><?php echo $saved; ?>%</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>

View File

@@ -0,0 +1,216 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<div id="wpo_smush_settings">
<div class="wpo-info">
<a class="wpo-info__trigger" href="#"><span class="dashicons dashicons-sos"></span> <?php _e('How to use the image compression feature', 'wp-optimize'); ?> <span class="wpo-info__close"><?php _e('Close', 'wp-optimize'); ?></span></a>
<div class="wpo-info__content">
<p><strong><?php _e('Not sure how to use the image compression feature?', 'wp-optimize'); ?></strong> <br><?php _e('Watch our howto video below.', 'wp-optimize'); ?></p>
<div class="wpo-video-preview">
<a href="https://vimeo.com/333938451" data-embed="https://player.vimeo.com/video/333938451?color=df6926&title=0&byline=0&portrait=0" target="_blank"><img src="<?php echo trailingslashit(WPO_PLUGIN_URL); ?>images/notices/image-compression-video-preview.png" alt="Video preview" /></a>
</div>
<small>(<?php _e('Loads a video hosted on vimeo.com', 'wp-optimize'); ?>) - <a href="https://vimeo.com/333938451" target="_blank"><?php _e('Open the video in a new window', 'wp-optimize'); ?></a></small>
</div>
</div>
<p>
<?php _e('Note: Currently this feature uses third party services from reSmush.it. The performance of this free image compression service may be limited for large workloads. We are working on a premium service.', 'wp-optimize'); ?>
</p>
<div class="wpo-fieldgroup">
<div class="autosmush wpo-fieldgroup__subgroup<?php echo $smush_options['autosmush'] ? ' active' : ''; ?>">
<label class="switch" for="smush-automatically">
<input type="checkbox" id="smush-automatically" <?php checked($smush_options['autosmush']); ?> >
<span class="slider round"></span>
</label>
<label for="smush-automatically"><?php _e('Automatically compress newly-added images', 'wp-optimize');?>
<span tabindex="0" data-tooltip="<?php echo __('The images will be added to a background queue, which will start automatically within the next hour.', 'wp-optimize').' '.__('This prevents the site from being slowed down during media uploads.', 'wp-optimize').' '.__('The time taken to complete the compression will depend upon the size and quantity of the images.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
</label>
</div>
<div class="wpo-fieldgroup__subgroup">
<label class="switch">
<input type="checkbox" id="smush-show-metabox" class="smush-options" <?php checked($smush_options['show_smush_metabox']); ?> >
<span class="slider round"></span>
</label>
<label for="smush-show-metabox" class="smush-options">
<?php _e('Show compression meta-box on an image\'s dashboard media page.', 'wp-optimize');?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('The image compression metabox allows you to compress specific images from the media library. But if you are using a solution other than WP-Optimize to compress your images, you can hide these metaboxes by disabling this switch.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
</label>
</div>
<div class="compression_options">
<h3><?php _e('Compression options', 'wp-optimize');?></h3>
<input type="radio" id="enable_lossy_compression" name="compression_level" <?php checked($smush_options['image_quality'], 90); ?> class="smush-options compression_level">
<label for="enable_lossy_compression"><?php _e('Prioritize maximum compression', 'wp-optimize');?></label>
<span tabindex="0" data-tooltip="<?php _e('Uses lossy compression to ensure maximum savings per image. The resulting images are of a slightly lower quality', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
<br>
<input type="radio" id="enable_lossless_compression" <?php checked($smush_options['image_quality'], 100); ?>name="compression_level" class="smush-options compression_level">
<label for="enable_lossless_compression"><?php _e('Prioritize retention of detail', 'wp-optimize');?></label>
<span tabindex="0" data-tooltip="<?php _e('Uses lossless compression, which results in much better image quality but lower file size savings per image', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
<br>
<input id="enable_custom_compression" <?php checked($custom); ?> type="radio" name="compression_level" class="smush-options compression_level">
<label for="enable_custom_compression"><?php _e('Custom', 'wp-optimize');?></label>
<br>
<div class="smush-options custom_compression" <?php if (!$custom) echo 'style="display:none;"';?> >
<span class="slider-start"><?php _e('Maximum compression', 'wp-optimize');?></span>
<input id="custom_compression_slider" class="compression_level" data-max="Maximum Compression" type="range" step="5" value="<?php echo $smush_options['image_quality']; ?>" min="60" max="85" list="number" />
<datalist id="number">
<option value="60"/>
<option value="65"/>
<option value="70"/>
<option value="75"/>
<option value="80"/>
<option value="85"/>
</datalist>
<span class="slider-end"><?php _e('Best image quality', 'wp-optimize');?></span>
</div>
<p><?php _e('Not sure what to choose?', 'wp-optimize'); ?> <a href="https://getwpo.com/lossy-vs-lossless-image-compression-a-guide-to-the-trade-off-between-image-size-and-quality/" target="_blank"><?php _e('Read our article "Lossy vs Lossless image compression"', 'wp-optimize'); ?></a></p>
<?php if (defined('WPO_USE_WEBP_CONVERSION') && true === WPO_USE_WEBP_CONVERSION) : ?>
<h3><?php _e('WebP conversion', 'wp-optimize');?></h3>
<?php
$converters = WP_Optimize()->get_options()->get_option('webp_converters', false);
if (!$does_server_allows_local_webp_conversion) {
printf('<p>%1$s</p>', __('Note: Local WebP conversion tools are not allowed on your server.', 'wp-optimize'));
} elseif (!empty($converters)) {
printf('<p>%1$s <strong>' . implode(', ', $converters) . '</strong></p>', __('Available WebP conversion tools:', 'wp-optimize'));
?>
<input type="checkbox" id="enable_webp_conversion" name="webp_conversion" <?php checked($smush_options['webp_conversion']); ?> class="smush-options webp_conversion">
<label for="enable_webp_conversion"><?php _e('Create WebP version of image', 'wp-optimize');?></label>
<span tabindex="0" data-tooltip="<?php _e('Creates WebP image format and serves it whenever possible.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
<br>
<?php
} else {
printf('<p>%1$s</p>', __('No WebP conversion tools are available on your web-server.', 'wp-optimize'));
}
endif;
?>
</div>
<button type="button" class="button button-link wpo-toggle-advanced-options"><span class="text"><span class="dashicons dashicons-arrow-down-alt2"></span> <span class="wpo-toggle-advanced-options__text-show"><?php _e('Show advanced options', 'wp-optimize');?></span><span class="wpo-toggle-advanced-options__text-hide"><?php _e('Hide advanced options', 'wp-optimize');?></span></span></button>
<div class="smush-advanced wpo-advanced-options">
<div class="compression_server">
<h3><?php _e('Compression service', 'wp-optimize');?></h3>
<div> <input type="radio" name="compression_server" id="resmushit" value="resmushit" <?php checked($smush_options['compression_server'], 'resmushit'); ?> >
<label for="resmushit">
<h4><?php _e('reSmush.it', 'wp-optimize');?></h4>
<p><?php _e('Can keep EXIF data', 'wp-optimize');?></p>
<small><?php _e('Service provided by reSmush.it', 'wp-optimize'); ?></small>
</label>
</div>
</div>
<br>
<h3><?php _e('More options', 'wp-optimize');?></h3>
<div class="image_options">
<input type="checkbox" id="smush-preserve-exif" class="smush-options preserve_exif" <?php checked($smush_options['preserve_exif']); ?> >
<label for="smush-preserve-exif" class="smush-options preserve_exif"><?php _e('Preserve EXIF data', 'wp-optimize');?></label>
<br>
<input type="checkbox" id="smush-backup-original" class="smush-options back_up_original" <?php checked($smush_options['back_up_original']); ?> >
<label for="smush-backup-original"><?php _e('Backup original images', 'wp-optimize');?></label>
<span tabindex="0" data-tooltip="<?php _e('The original images are stored alongside the compressed images, you can visit the edit screen of the individual images in the Media Library to restore them.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
<br>
<input type="checkbox" id="smush-backup-delete" class="smush-options back_up_original" <?php checked($smush_options['back_up_delete_after']); ?> >
<label for="smush-backup-delete"><?php _e('Automatically delete image backups after', 'wp-optimize');?><input id="smush-backup-delete-days" type="number" min="1" value="<?php echo (0 !== intval($smush_options['back_up_delete_after_days'])) ? intval($smush_options['back_up_delete_after_days']) : 50; ?>"><?php _e('days', 'wp-optimize');?></label><label> — <?php _e('or', 'wp-optimize'); ?></label> <button type="button" id="wpo_smush_delete_backup_btn" class="wpo_primary_small button"><?php _e('Delete all backup images now', 'wp-optimize'); ?></button>
<img id="wpo_smush_delete_backup_spinner" class="display-none" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="...">
<span id="wpo_smush_delete_backup_done" class="dashicons dashicons-yes display-none save-done"></span>
<br>
<button type="button" id="wpo_smush_mark_all_as_uncompressed_btn" class="wpo_primary_small button"><?php _e('Mark all images as uncompressed', 'wp-optimize'); ?></button>
<br>
<br>
<button type="button" id="wpo_smush_restore_all_compressed_images_btn" class="wpo_primary_small button"><?php _e('Restore all compressed images', 'wp-optimize'); ?></button> <span tabindex="0" data-tooltip="<?php esc_attr_e('Only the original image will be restored. In order to restore the other sizes, you should use a plugin such as "Regenerate Thumbnails".', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
</div>
</div>
<div class="save-options">
<input type="button" id="wpo_smush_images_save_options_button" style="display:none" class="wpo_primary_small button-primary" value="<?php esc_attr_e('Save options', 'wp-optimize'); ?>" />
<img id="wpo_smush_images_save_options_spinner" class="display-none" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="...">
<span id="wpo_smush_images_save_options_done" class="display-none"><span class="dashicons dashicons-yes"></span> <?php _e('Saved options', 'wp-optimize');?></span>
<span id="wpo_smush_images_save_options_fail" class="display-none"><span class="dashicons dashicons-no"></span> <?php _e('Failed to save options', 'wp-optimize');?></span>
</div>
</div>
<div class="uncompressed-images">
<h3><?php _e('Uncompressed images', 'wp-optimize');?></h3>
<div class="wpo_smush_images_buttons_wrap">
<div class="smush-select-actions. align-left">
<a href="javascript:;" id="wpo_smush_images_select_all"><?php _e('Select all', 'wp-optimize');?></a> /
<a href="javascript:;" id="wpo_smush_images_select_none"><?php _e('Select none', 'wp-optimize');?></a>
</div>
<div class="smush-refresh-icon align-right">
<a href="javascript:;" id="wpo_smush_images_refresh" class="wpo-refresh-button"><?php _e('Refresh image list', 'wp-optimize');?>
<span class="dashicons dashicons-image-rotate"></span>
</a>
<img class="wpo_smush_images_loader" width="16" height="16" src="<?php echo admin_url(); ?>/images/spinner-2x.gif" />
</div>
</div>
<div id="wpo_smush_images_grid"></div>
<div class="smush-actions">
<input type="button" id="wpo_smush_images_btn" class="wpo_primary_small button-primary align-left" value="<?php esc_attr_e('Compress the selected images', 'wp-optimize'); ?>" />
<input type="button" id="wpo_smush_mark_as_compressed" class="wpo_primary_small button align-left" value="<?php esc_attr_e('Mark as already compressed', 'wp-optimize'); ?>" />
<input type="button" id="wpo_smush_get_logs" class="wpo_smush_get_logs wpo_primary_small button-primary align-right" value="<?php esc_attr_e('View logs', 'wp-optimize'); ?>" />
</div>
</div>
</div>
<div id="wpo_smush_images_information_container" style="display:none;">
<div id="wpo_smush_images_information_wrapper">
<h3 id="wpo_smush_images_information_heading"><?php _e('Compressing images', 'wp-optimize');?></h3>
<h4 id="wpo_smush_images_information_server"></h4>
<div class="progress-bar orange stripes">
<span style="width: 100%"></span>
</div>
<p><?php _e('The selected images are being processed; please do not close the browser', 'wp-optimize');?></p>
<table id="smush_stats" class="smush_stats_table">
<tbody>
<tr class="smush_stats_row">
<td> <?php _e('Images pending', 'wp-optimize');?></td>
<td id="smush_stats_pending_images">&nbsp;...</td>
</tr>
<tr class="smush_stats_row">
<td> <?php _e('Images completed', 'wp-optimize');?></td>
<td id="smush_stats_completed_images">&nbsp;...</td>
</tr>
<tr class="smush_stats_row">
<td> <?php _e('Size savings', 'wp-optimize');?></td>
<td id="smush_stats_bytes_saved">&nbsp;...</td>
</tr>
<tr class="smush_stats_row">
<td> <?php _e('Average savings per image', 'wp-optimize');?></td>
<td id="smush_stats_percent_saved">&nbsp;...</td>
</tr>
<tr class="smush_stats_row">
<td> <?php _e('Time elapsed', 'wp-optimize');?></td>
<td id="smush_stats_timer">&nbsp;</td>
</tr>
</tbody>
</table>
</div>
<input type="button" id="wpo_smush_images_pending_tasks_cancel_button" class="wpo_primary_small button-primary" value="<?php esc_attr_e('Cancel', 'wp-optimize'); ?>" />
</div>
<div id="smush-complete-summary" class="complete-animation" style="display:none;">
<span class="dashicons dashicons-no-alt close"></span>
<div class="animation">
<div class="checkmark-circle">
<div class="background"></div>
<div class="checkmark draw"></div>
</div>
</div>
<div id="summary-message"></div>
<input type="button" id="wpo_smush_get_logs" class="wpo_smush_get_logs wpo_primary_small button-primary" value="<?php esc_attr_e('View logs', 'wp-optimize'); ?>" />
<input type="button" id="wpo_smush_clear_stats_btn" class="wpo_primary_small button-primary align-right" value="<?php esc_attr_e('Clear compression statistics', 'wp-optimize'); ?>" />
<img id="wpo_smush_images_clear_stats_spinner" class="display-none align-right" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="...">
<span id="wpo_smush_images_clear_stats_done" class="dashicons dashicons-yes display-none save-done align-right"></span>
<span class="clearfix"></span>
<input type="button" class="wpo_primary_small button-primary wpo_smush_stats_cta_btn" value="<?php esc_attr_e('Close', 'wp-optimize'); ?>" />
</div>
<div id="smush-log-modal" class="complete-animation" style="display:none;">
<div id="log-panel"></div>
<a href="#" class="wpo_primary_small button-primary"> <?php _e('Download log file', 'wp-optimize'); ?></a>
<input type="button" class="wpo_primary_small button-primary close" value="<?php esc_attr_e('Close', 'wp-optimize'); ?>" />
</div>
<div id="smush-information-modal" style="display:none;">
<div class="smush-information"></div>
<input type="button" class="wpo_primary_small button-primary information-modal-close" value="<?php esc_attr_e('Close', 'wp-optimize'); ?>" />
</div>
<div id="smush-information-modal-cancel-btn" style="display:none;">
<div class="smush-information"></div>
<input type="button" class="wpo_primary_small button-primary" value="<?php esc_attr_e('Cancel', 'wp-optimize'); ?>" />
</div>

View File

@@ -0,0 +1,60 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<div class="wpo-unused-images-section">
<h3 class="wpo-first-child"><?php _e('Unused images', 'wp-optimize');?></h3>
<div id="wpo_unused_images">
<?php for ($i=0; $i < 10; $i++) : ?>
<div class="wpo_unused_image">
<label class="wpo_unused_image_thumb_label">
<div class="thumbnail">
<span class="dashicons dashicons-format-image"></span>
</div>
</label>
</div>
<?php endfor; ?>
<div class="wpo-unused-images__premium-mask">
<a class="wpo-unused-images__premium-link" href="<?php esc_attr_e($wp_optimize->premium_version_link); ?>" target="_blank"><?php _e('Manage unused images with WP-Optimize Premium.', 'wp-optimize'); ?></a>
</div>
</div>
</div>
<div class="wpo-image-sizes-section">
<h3><?php _e('Image sizes', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup premium-only">
<h3><?php _e('Registered image sizes', 'wp-optimize'); ?></h3>
<p class="red"><?php _e("This feature is for experienced users. Don't remove registered image sizes if you are not sure that images with selected sizes are not used on your site.", 'wp-optimize'); ?></p>
<div id="registered_image_sizes">
<label class="unused-image-sizes__label">
<input type="checkbox" class="unused-image-sizes">registered-image-size (42.2 KB - Total: 3)<br>
</label>
<label class="unused-image-sizes__label">
<input type="checkbox" class="unused-image-sizes">registered-image-size (42.2 KB - Total: 3)<br>
</label>
<label class="unused-image-sizes__label">
<input type="checkbox" class="unused-image-sizes">registered-image-size (42.2 KB - Total: 3)<br>
</label>
</div>
<h3><?php _e('Unused image sizes', 'wp-optimize');?></h3>
<p class="hide_on_empty">
<?php _e('These image sizes were used by some of the themes or plugins installed previously and they remain within your database.', 'wp-optimize'); ?>
<a href="https://codex.wordpress.org/Post_Thumbnails#Add_New_Post_Thumbnail_Sizes" target="_blank"><?php _e('Read more about custom image sizes here.', 'wp-optimize'); ?></a>
</p>
<div id="unused_image_sizes">
<label class="unused-image-sizes__label">
<input type="checkbox" class="unused-image-sizes">unused-image-size (42.2 KB - Total: 3)<br>
</label>
<label class="unused-image-sizes__label">
<input type="checkbox" class="unused-image-sizes">unused-image-size (42.2 KB - Total: 3)<br>
</label>
<label class="unused-image-sizes__label">
<input type="checkbox" class="unused-image-sizes">unused-image-size (42.2 KB - Total: 3)<br>
</label>
</div>
<div class="wpo_remove_selected_sizes_btn__container">
<button type="buton" class="button button-primary" disabled="disabled"><?php _e('Remove selected sizes', 'wp-optimize'); ?></button>
</div>
<div class="wpo-unused-image-sizes__premium-mask">
<a class="wpo-unused-images__premium-link" href="<?php esc_attr_e($wp_optimize->premium_version_link); ?>" target="_blank"><?php _e('Take control of WordPress image sizes with WP-Optimize Premium.', 'wp-optimize'); ?></a>
</div>
</div>
</div>

View File

@@ -0,0 +1,4 @@
<?php if (!defined('ABSPATH')) die('No direct access.'); ?>
<div class="wpo_info">
<?php echo $message; ?>
</div>

View File

@@ -0,0 +1,329 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<div id="wp-optimize-minify-advanced" class="wpo_section wpo_group">
<h3><?php _e('Minify cache information', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<p>
<?php _e('Current cache path:', 'wp-optimize'); ?>
<strong class="wpo_min_cache_path">
<?php
$cache_path = WPO_MINIFY_PHP_VERSION_MET ? WP_Optimize_Minify_Cache_Functions::cache_path() : array("cachedir" => __('none', 'wp-optimize'));
echo htmlspecialchars($cache_path['cachedir']);
?>
</strong>
</p>
<h3><?php _e('List of processed files', 'wp-optimize'); ?></h3>
<h4><?php _e('JavaScript files', 'wp-optimize'); ?></h4>
<div id="wpo_min_jsprocessed">
<ul class="processed">
<?php
$processed_js = 0;
// Some files exist
if ($files && isset($files['js']) && is_array($files['js']) && $files['js']) {
$processed_js = count($files['js']);
foreach ($files['js'] as $js_file) {
WP_Optimize()->include_template(
'minify/cached-file.php',
false,
array(
'file' => $js_file
)
);
}
}
?>
<li class="no-files-yet<?php echo $processed_js ? ' hidden' : ''; ?>">
<span class="filename"><?php _e('There are no processed files yet.', 'wp-optimize'); ?></span>
</li>
</ul>
</div>
<h4><?php _e('CSS files', 'wp-optimize'); ?></h4>
<div id="wpo_min_cssprocessed">
<?php if ($wpo_minify_options['inline_css']) : ?>
<p><?php _e('There are no merged CSS files listed here, because you are inlining all CSS directly', 'wp-optimize'); ?></p>
<?php else : ?>
<ul class="processed">
<?php
$processed_css = 0;
if ($files && isset($files['css']) && is_array($files['css']) && $files['css']) {
$processed_css = count($files['css']);
foreach ($files['css'] as $css_file) {
WP_Optimize()->include_template(
'minify/cached-file.php',
false,
array(
'file' => $css_file
)
);
}
}
// No files were found
?>
<li class="no-files-yet<?php echo $processed_css ? ' hidden' : ''; ?>">
<span class="filename"><?php _e('There are no processed files yet.', 'wp-optimize'); ?></span>
</li>
</ul>
<?php endif; ?>
</div>
</div>
<form method="post" action="#">
<h3><?php _e('Advanced options', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<div class="wpo-fieldgroup__subgroup">
<label for="wpo_min_cache_lifespan">
<?php _e('Cache lifespan', 'wp-optimize'); ?>
</label>
<p>
<input
name="cache_lifespan"
id="wpo_min_cache_lifespan"
class="cache_lifespan wpo-save-setting"
type="number"
min="0"
value="<?php echo intval($wpo_minify_options['cache_lifespan']);?>"
> <?php _e('days', 'wp-optimize'); ?>
</p>
<p>
<?php _e('In order to prevent broken pages when using a third party page caching, WP-Optimize keeps the stale minified cache for 30 days.', 'wp-optimize'); ?>
<br><?php _e('Enter 0 to never keep stale cache.', 'wp-optimize'); ?>
</p>
</div>
<div class="switch-container">
<label class="switch">
<input
name="debug"
id="wpo_min_enable_minify_debug"
class="debug wpo-save-setting"
type="checkbox"
value="true"
<?php checked($wpo_minify_options['debug']);?>
>
<span class="slider round"></span>
</label>
<label for="wpo_min_enable_minify_debug">
<?php _e('Enable debug mode', 'wp-optimize'); ?>
</label>
</div>
<p><?php _e('Enabling the debug mode will add various comments and show more information in the files list.', 'wp-optimize'); ?> <?php _e('It also adds extra actions in the status tab.', 'wp-optimize'); ?></p>
</div>
<h3><?php _e('Default exclusions', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<div class="switch-container">
<label class="switch">
<input
name="edit_default_exclutions"
id="wpo_min_edit_default_exclutions"
class="debug wpo-save-setting"
type="checkbox"
value="true"
<?php checked($wpo_minify_options['edit_default_exclutions']);?>
>
<span class="slider round"></span>
</label>
<label for="wpo_min_edit_default_exclutions">
<?php _e('Edit default exclusions', 'wp-optimize'); ?>
</label>
</div>
<p><?php _e('By default, WP-Optimize excludes a list of files that are known to cause problems when minified or combined.'); ?>
<?php _e('Enable this option to see or edit those files.'); ?></p>
<div class="wpo-minify-default-exclusions<?php echo $wpo_minify_options['edit_default_exclutions'] ? '' : ' hidden'; ?>">
<h3><?php _e('Known incompatible files', 'wp-optimize'); ?></h3>
<fieldset>
<label for="ignore_list">
<?php _e('List of files that can\'t or shouldn\'t be minified or merged.', 'wp-optimize'); ?>
<?php _e('Do not edit this if you are not sure what it is.', 'wp-optimize'); ?>
<br><?php _e('Tick the checkbox to merge / minify the corresponding file anyways.', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('Files that have been consistently reported by other users to cause trouble when merged', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
</label>
<?php
$user_excluded_ignorelist_items = is_array($wpo_minify_options['ignore_list']) ? $wpo_minify_options['ignore_list'] : array();
if (empty($default_ignore)) {
echo '<p>'.__('Refresh the page to see the list', 'wp-optimize').'</p>';
} else {
foreach ($default_ignore as $ignore_item) {
?>
<label class="ignore-list-item"><input type="checkbox" name="ignore_list[]" value="<?php echo esc_attr($ignore_item); ?>"<?php checked(in_array($ignore_item, $user_excluded_ignorelist_items)); ?>><span class="ignore-item"><?php echo $ignore_item; ?></span></label>
<?php
}
}
?>
</fieldset>
<h3><?php _e('IE incompatible files', 'wp-optimize'); ?></h3>
<fieldset>
<label for="blacklist">
<?php _e('List of excluded files used for IE compatibility.', 'wp-optimize'); ?>
<?php _e('Do not edit this if you are not sure what it is.', 'wp-optimize'); ?>
<br><?php _e('Tick the checkbox to merge / minify the corresponding file anyways.', 'wp-optimize'); ?>
</label>
<?php
$user_excluded_blacklist_items = is_array($wpo_minify_options['blacklist']) ? $wpo_minify_options['blacklist'] : array();
if (empty($default_ie_blacklist)) {
echo '<p>'.__('Refresh the page to see the list', 'wp-optimize').'</p>';
} else {
foreach ($default_ie_blacklist as $blacklist_item) {
?>
<label class="black-list-item"><input type="checkbox" name="blacklist[]" value="<?php echo esc_attr($blacklist_item); ?>"<?php checked(in_array($blacklist_item, $user_excluded_blacklist_items)); ?>><span class="ignore-item"><?php echo $blacklist_item; ?></span></label>
<?php
}
}
?>
</fieldset>
</div>
</div>
<?php if (WP_OPTIMIZE_SHOW_MINIFY_ADVANCED) : ?>
<div class="wpo-fieldgroup">
<fieldset>
<br />
<label for="enabled_css_preload">
<input
name="enabled_css_preload"
type="checkbox"
id="enabled_css_preload"
value="1"
<?php echo checked($wpo_minify_options['enabled_css_preload']); ?>
>
<?php _e('Enable WP-O Minify CSS files preloading', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('Automatically create HTTP headers for WP-O Minify-generated CSS files (when not inlined)', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
</label>
<br />
<label for="enabled_js_preload">
<input
name="enabled_js_preload"
type="checkbox"
id="enabled_js_preload"
value="1"
<?php echo checked($wpo_minify_options['enabled_js_preload']); ?>
>
<?php _e('Enable WP-O Minify JavaScript files Preload', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('Automatically create HTTP headers for WP-O Minify-generated JS files', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
</label>
</fieldset>
</div>
<h3 class="title">
<?php _e('HTTP Headers', 'wp-optimize'); ?>
</h3>
<p class="wpo_min-bold-green">
<?php _e('Preconnect Headers: This will add link headers to your HTTP response to instruct the browser to preconnect to other domains (e.g.: fonts, images, videos, etc)', 'wp-optimize'); ?>
</p>
<p class="wpo_min-bold-green">
<?php _e('Preload Headers: Use this for preloading specific, high priority resources that exist across all of your pages.', 'wp-optimize'); ?>
</p>
<p class="wpo_min-bold-green">
<?php _e('Note: Some servers do not support http push or headers. If you get a server error: a) rename the plugin directory via (S)FTP or your hosting control panel, b) go to your plugins page (plugin will be disabled on access), c) rename it back and d) activate it back (reset to default settings).', 'wp-optimize'); ?>
</p>
<h3><?php _e('Preconnect Headers', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<fieldset>
<legend class="screen-reader-text">
<?php _e('Preconnect', 'wp-optimize'); ?>
</legend>
<label for="hpreconnect">
<span class="wpo_min-label-pad">
<?php _e('Use only the strictly minimum necessary domain names, (CDN or frequent embeds):', 'wp-optimize'); ?>
</span>
</label>
<textarea
name="hpreconnect"
rows="7"
cols="50"
id="hpreconnect"
class="large-text code"
placeholder="https://cdn.example.com"
disabled
><?php echo esc_textarea($wpo_minify_options['hpreconnect']); ?></textarea>
<p>
<?php _e('Use the complete scheme (http:// or https://) followed by the domain name only (no file paths).', 'wp-optimize'); ?>
</p>
<p>
<?php _e('Examples: https://fonts.googleapis.com, https://fonts.gstatic.com', 'wp-optimize'); ?>
</p>
</fieldset>
</div>
<h3><?php _e('External URLs to merge', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<fieldset>
<label for="merge_allowed_urls">
<?php _e('List of external domains that can be fetched and merged:', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('Add any external "domain" for JavaScript or CSS files that can be fetched and merged by WP-Optimize, e.g.: cdnjs.cloudflare.com', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
</label>
<textarea
name="merge_allowed_urls"
rows="7"
cols="50"
id="merge_allowed_urls"
class="large-text code"
placeholder="<?php esc_attr_e('e.g.: example.com', 'wp-optimize'); ?>"
><?php echo esc_textarea($wpo_minify_options['merge_allowed_urls']); ?></textarea>
</fieldset>
</div>
<h1><?php _e('CDN Options', 'wp-optimize'); ?></h1>
<p class="wpo_min-bold-green">
<?php printf(__('When the "Enable defer on processed JavaScript files" option is enabled, JavaScript and CSS files will not be loaded from the CDN due to %scompatibility%s reasons.', 'wp-optimize'), '<a target="_blank" href="https://www.chromestatus.com/feature/5718547946799104">', '</a>'); ?>
<?php _e('However, you can define a CDN Domain below, in order to use it for all of the static assets "inside" your CSS and JS files.', 'wp-optimize'); ?>
</p>
<h3><?php _e('Your CDN domain', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<fieldset>
<label for="cdn_url">
<p>
<input
type="text"
name="cdn_url"
id="cdn_url"
value="<?php echo isset($wpo_minify_options['cdn_url']) ? esc_attr($wpo_minify_options['cdn_url']) : ''; ?>"
size="80"
/>
</p>
<p>
<?php _e('Will rewrite the static assets urls inside WP-O Minify-merged files to your CDN domain. Usage: cdn.example.com', 'wp-optimize'); ?>
</p>
</label>
</fieldset>
</div>
<h3><?php _e('Force the CDN Usage', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<p class="wpo_min-bold-green wpo_min-rowintro">
<?php _e('If you force this, your JS files may not load for certain slow internet users on Google Chrome.', 'wp-optimize'); ?>
</p>
<fieldset>
<label for="cdn_force">
<input
name="cdn_force"
type="checkbox"
id="cdn_force"
value="1"
<?php echo checked($wpo_minify_options['cdn_force']); ?>
>
<?php _e('I know what I\'m doing...', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('Load my JS files from the CDN, even when "defer for Pagespeed Insights" is enabled', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
</label>
</fieldset>
</div>
<?php endif; ?>
<p class="submit">
<input
class="wp-optimize-save-minify-settings button button-primary"
type="submit"
value="<?php esc_attr_e('Save settings', 'wp-optimize'); ?>"
>
<img class="wpo_spinner" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="...">
<span class="save-done dashicons dashicons-yes display-none"></span>
</p>
<input type="hidden" name="minify_advanced_tab" value="1">
</form>
</div>

View File

@@ -0,0 +1,14 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<h3><?php _e('Preload key requests / assets', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<p class="wpo_min-bold-green wpo_min-rowintro">
<?php _e('Preload critical assets to improve loading speed.', 'wp-optimize'); ?>
<a href="https://getwpo.com/faqs/preload-critical-assets/"><?php _e('Learn more about preloading key requests.', 'wp-optimize'); ?></a>
</p>
<fieldset>
<legend class="screen-reader-text">
<?php _e('Preload key requests', 'wp-optimize'); ?>
</legend>
<p><strong><?php _e('Preload key requests is a premium feature.', 'wp-optimize'); ?></strong> <a href="<?php echo esc_url(WP_Optimize()->premium_version_link); ?>"><?php _e('Find out more here.', 'wp-optimize'); ?></a></p>
</fieldset>
</div>

View File

@@ -0,0 +1,23 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<h5><?php echo esc_html($log->header); ?></h5>
<ul><?php
foreach ((array) $log->files as $handle => $file) {
$file_path = untrailingslashit(get_home_path()) . $file->url;
$file_size = file_exists($file_path) ? ' (' . WP_Optimize()->format_size(@filesize($file_path)) . ')' : ''; // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
echo '<li'.($file->success ? '' : ' class="failed"').'><span class="wpo_min_file_url"><a href="'.esc_url(get_home_url().$file->url).'" target="_blank">'.htmlspecialchars($file->url).'</a>'.$file_size.'</span>';
if (property_exists($file, 'debug')) echo '<span class="wpo_min_file_debug">'.htmlspecialchars($file->debug).'</span>';
echo ' <span class="wrapper">';
printf(' <a href="#" data-url="%1$s" class="exclude">%2$s</a>', htmlspecialchars($file->url), __('Exclude', 'wp-optimize'));
$minify_config = get_option('wpo_minify_config');
if (preg_match('/\.js$/i', $file->url, $matches)) {
if ('individual' === $minify_config['enable_defer_js']) {
printf(' | <a href="#" data-url="%1$s" class="defer">%2$s</a>', htmlspecialchars($file->url), __('Defer loading', 'wp-optimize'));
}
} elseif (preg_match('/\.css$/i', $file->url, $matches)) {
printf(' | <a href="#" data-url="%1$s" class="async">%2$s</a>', htmlspecialchars($file->url), __('Load asynchronously', 'wp-optimize'));
}
echo '</span></li>';
}
?>
</ul>

View File

@@ -0,0 +1,20 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<li id="<?php echo $file['uid']; ?>">
<span class="filename"><a href="<?php echo esc_url($file['file_url']); ?>" target="_blank"><?php echo htmlspecialchars($file['filename']); ?></a> (<?php echo $file['fsize']; ?>)</span>
<a href="#" class="log"><?php _e('Show information', 'wp-optimize'); ?></a>
<div class="hidden save_notice">
<p><?php _e('The file was added to the list', 'wp-optimize'); ?></p>
<p><button class="button button-primary save-exclusions"><?php _e('Save the changes', 'wp-optimize'); ?></button></p>
</div>
<div class="hidden wpo_min_log"><?php
if ($file['log']) {
WP_Optimize()->include_template(
'minify/cached-file-log.php',
false,
array(
'log' => $file['log']
)
);
}
?></div>
</li>

View File

@@ -0,0 +1,168 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<div class="wpo_section wpo_group">
<div id="wpo_settings_warnings"></div>
<form>
<h3><?php _e('CSS options', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<fieldset>
<label for="enable_css_minification">
<input
name="enable_css_minification"
type="checkbox"
id="enable_css_minification"
value="1"
<?php echo checked($wpo_minify_options['enable_css_minification']); ?>
>
<?php _e('Enable minification of CSS files', 'wp-optimize'); ?>
</label>
<label for="enable_merging_of_css">
<input
name="enable_merging_of_css"
type="checkbox"
id="enable_merging_of_css"
value="1"
<?php echo checked($wpo_minify_options['enable_merging_of_css']); ?>
>
<?php _e('Enable merging of CSS files', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php _e('If some of the design is breaking on the frontend, disabling merging of CSS might fix the issues.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
</label>
<label for="inline_css">
<input
name="inline_css"
type="checkbox"
id="inline_css"
value="1"
<?php echo checked($wpo_minify_options['inline_css']); ?>
>
<?php _e('Inline CSS', 'wp-optimize'); ?> - <?php _e('Recommended if the CSS files are small enough.', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php _e('When enabled, small CSS files will be inlined.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
</label>
<label for="remove_print_mediatypes">
<input
name="remove_print_mediatypes"
type="checkbox"
id="remove_print_mediatypes"
value="1"
<?php echo checked($wpo_minify_options['remove_print_mediatypes']); ?>
>
<?php _e('Strip the "print" related stylesheets', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip='<?php _e('When selected, any CSS files with the media type "print" will be removed.', 'wp-optimize');?> <?php _e('Enable if your site does not need specific print styles.', 'wp-optimize');?>'><span class="dashicons dashicons-editor-help"></span> </span>
</label>
<?php if (WP_OPTIMIZE_SHOW_MINIFY_ADVANCED) : ?>
<label for="remove_css">
<input
name="remove_css"
type="checkbox"
id="remove_css"
value="1"
<?php echo checked($wpo_minify_options['remove_css']); ?>
>
<?php _e('Dequeue all CSS files', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php _e('This is useful if you want to test your critical path CSS', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
</label>
<?php endif; ?>
</fieldset>
</div>
<h3><?php _e('Exclude the following CSS files from processing', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<fieldset>
<label class="wpo-label__bold" for="exclude_css">
<?php _e('Any CSS files that match the paths below will be completely ignored.', 'wp-optimize'); ?>
<br/><?php _e('Use this if you are having issues with a specific CSS file', 'wp-optmize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('Any file present here will be loaded normally by WordPress', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
<textarea
name="exclude_css"
rows="7" cols="50"
id="exclude_css"
class="large-text code"
placeholder="<?php esc_attr_e('e.g.: /bootstrap.css', 'wp-optimize'); ?>"
><?php echo esc_textarea($wpo_minify_options['exclude_css']);?></textarea>
<br>
<?php _e('Some files known for causing issues when combined / minified are excluded by default.', 'wp-optimize'); ?> <?php _e('You can see / edit them in the Advanced tab.', 'wp-optimize'); ?>
</fieldset>
</div>
<h3><?php _e('Load the following CSS files asynchronously', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<fieldset>
<label class="wpo-label__bold" for="async_css">
<?php _e('Any CSS files that match the paths below will be loaded asynchronously.', 'wp-optimize'); ?><br>
<?php _e('Use this if you have a completely independent stylesheet or would like to exclude stylesheets from page speed tests (PageSpeed Insights, GTMetrix...)', 'wp-optmize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e("e.g. You may want to exclude 'fontawesome' or other libraries from the initial load", 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
<textarea
name="async_css"
rows="7"
cols="50"
id="async_css"
class="large-text code"
placeholder="<?php esc_attr_e('e.g.: /wp-content/themes/my-theme/css/custom-font.css', 'wp-optimize'); ?>"
><?php echo esc_textarea($wpo_minify_options['async_css']); ?></textarea>
</fieldset>
</div>
<?php if (WP_OPTIMIZE_SHOW_MINIFY_ADVANCED) : ?>
<h3><?php _e('Enable asynchronous CSS', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<fieldset>
<label for="loadcss">
<input
name="loadcss"
type="checkbox"
id="loadcss"
value="1"
<?php echo checked($wpo_minify_options['loadcss']); ?>
>
<?php _e('Load all CSS files asynchronously', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php _e('Note that inline CSS won\'t work if this is active', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
</label>
<p>
<?php _e('If you have multiple css files per media type, they may load out of order and break your design when loaded asynchronously.', 'wp-optimize'); ?>
</p>
</fieldset>
</div>
<?php endif; ?>
<?php if (WP_OPTIMIZE_SHOW_MINIFY_ADVANCED) : ?>
<h3>
<?php _e('Critical path CSS', 'wp-optimize'); ?>
</h3>
<div class="wpo-fieldgroup">
<fieldset>
<label class="wpo-label__bold" for="critical_path_css"><?php _e('Fallback CSS', 'wp-optimize'); ?></label>
<textarea
name="critical_path_css"
rows="7"
cols="50"
id="critical_path_css" class="large-text code"
placeholder=".css-code { display: block; }"
><?php echo esc_textarea($wpo_minify_options['critical_path_css']); ?></textarea>
</fieldset>
<fieldset>
<label class="wpo-label__bold" for="critical_path_css_is_front_page"><?php _e('is_front_page (conditional)', 'wp-optimize'); ?> <span tabindex="0" data-tooltip="<?php esc_attr_e('This will be inlined after the above if your page matches the WP conditional is_front_page()', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span></label>
<textarea
name="critical_path_css_is_front_page"
rows="7"
cols="50"
id="critical_path_css_is_front_page"
class="large-text code"
placeholder=".css-code { display: block; }"
><?php echo esc_textarea($wpo_minify_options['critical_path_css_is_front_page']); ?></textarea>
</fieldset>
</div>
<?php endif; ?>
<p class="submit">
<input
class="wp-optimize-save-minify-settings button button-primary"
type="submit"
value="<?php esc_attr_e('Save settings', 'wp-optimize'); ?>"
>
<img class="wpo_spinner" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="...">
<span class="save-done dashicons dashicons-yes display-none"></span>
</p>
</form>
</div>

View File

@@ -0,0 +1,146 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<div class="wpo_section wpo_group">
<form>
<div id="wpo_settings_warnings"></div>
<h3><?php _e('Google Fonts', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<fieldset>
<?php if (WP_OPTIMIZE_SHOW_MINIFY_ADVANCED) : ?>
<label for="merge_google_fonts">
<input
name="merge_google_fonts"
type="checkbox"
id="merge_google_fonts"
value="1"
<?php echo checked($wpo_minify_options['merge_google_fonts']); ?>
>
<?php _e('Merge fonts from Google Fonts into one request', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php _e('This improves speed when loading multiple fonts from Google Fonts.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
<?php endif; ?>
<label for="remove_googlefonts">
<input
name="remove_googlefonts"
type="checkbox"
id="remove_googlefonts"
value="1"
<?php echo checked($wpo_minify_options['remove_googlefonts']); ?>
>
<?php _e('Do not load Google Fonts', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php _e('If enabled, stylesheets from Google Fonts will not be loaded on the site and system fallback fonts will be used instead.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
<label for="enable_display_swap">
<input
name="enable_display_swap"
type="checkbox"
id="enable_display_swap"
value="1"
<?php echo checked($wpo_minify_options['enable_display_swap']); ?>
>
<?php _e('Add "display=swap" to Google Fonts requests', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('This feature of Google Fonts is encouraged for better accessibility, but may result in a visible font change.', 'wp-optimize'); ?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
</fieldset>
<p class="wpo_min-bold-green wpo_min-rowintro">
<?php _e('Choose how to include fonts from Google Fonts on your pages, when available:', 'wp-optimize'); ?>
</p>
<fieldset>
<label>
<input
type="radio"
name="gfonts_method"
value="inherit"
<?php echo checked('inherit' === $wpo_minify_options['gfonts_method']); ?>
>
<?php _e('Inherit from the CSS settings', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('The stylesheets will be merged or inlined.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
<label>
<input
type="radio"
name="gfonts_method"
value="inline"
<?php echo checked('inline' === $wpo_minify_options['gfonts_method']); ?>
>
<?php _e('Inline google font CSS files', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('The stylesheets will be inlined.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
<label>
<input
type="radio"
name="gfonts_method"
value="async"
<?php echo checked('async' === $wpo_minify_options['gfonts_method']); ?>
>
<?php _e('Asynchronously load CSS files from Google Fonts', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('Will use \'preload\' with LoadCSS polyfill', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
<label>
<input
type="radio"
name="gfonts_method"
value="exclude"
<?php echo checked('exclude' === $wpo_minify_options['gfonts_method']); ?>
>
<?php _e('Asynchronously load fonts from Google Fonts using JavaScript', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php _e('Use if you want to exclude the CSS from Google Fonts from performance tests.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
</fieldset>
</div>
<h3><?php _e('Font Awesome', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<p class="wpo_min-bold-green wpo_min-rowintro">
<?php _e('Choose how to include Font Awesome (only available if it has \'font-awesome\' in the url):', 'wp-optimize'); ?>
</p>
<fieldset>
<label><input
type="radio"
name="fawesome_method"
value="inherit"
<?php echo checked('inherit' === $wpo_minify_options['fawesome_method']); ?>
>
<?php _e('Inherit from the CSS settings', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('The stylesheets will be merged or inlined.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
<label><input
type="radio"
name="fawesome_method"
value="inline"
<?php echo checked('inline' === $wpo_minify_options['fawesome_method']); ?>
>
<?php _e('Inline the Font Awesome CSS file', 'wp-optimize'); ?>
</label>
<label>
<input
type="radio"
name="fawesome_method"
value="async"
<?php echo checked('async' === $wpo_minify_options['fawesome_method']); ?>
>
<?php _e('Asynchronously load the Font Awesome CSS file', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php _e('Will use \'preload\' with LoadCSS polyfill', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
<label><input
type="radio"
name="fawesome_method"
value="exclude"
<?php echo checked('exclude' === $wpo_minify_options['fawesome_method']); ?>
>
<?php _e('Asynchronously load the Font Awesome stylesheet using JavaScript', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php _e('Use if you want to exclude Font Awesome from page speed tests (PageSpeed Insights, GTMetrix...)', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
</fieldset>
</div>
<p class="submit">
<input
class="wp-optimize-save-minify-settings button button-primary"
type="submit"
value="<?php esc_attr_e('Save settings', 'wp-optimize'); ?>"
>
<img class="wpo_spinner" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="...">
<span class="save-done dashicons dashicons-yes display-none"></span>
</p>
</form>
</div>

View File

@@ -0,0 +1,7 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<div class="wpo_section wpo_group<?php echo (!$wpo_minify_options['html_minification']) ? ' wpo-feature-is-disabled' : ''; ?>">
<div id="wpo_settings_warnings"></div>
<div class="wpo-fieldgroup wpo-show">
</div>
</div>

View File

@@ -0,0 +1,159 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<div class="wpo_section wpo_group">
<div id="wpo_settings_warnings"></div>
<form>
<h3><?php _e('JavaScript options', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<fieldset>
<label for="enable_js_minification">
<input
name="enable_js_minification"
type="checkbox"
id="enable_js_minification"
value="1"
<?php echo checked($wpo_minify_options['enable_js_minification']); ?>
>
<?php _e('Enable minification of JavaScript files', 'wp-optimize'); ?>
</label>
<label for="enable_merging_of_js">
<input
name="enable_merging_of_js"
type="checkbox"
id="enable_merging_of_js"
value="1"
<?php echo checked($wpo_minify_options['enable_merging_of_js']); ?>
>
<?php _e('Enable merging of JavaScript files', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php _e('If some functionality is breaking on the frontend, disabling merging of JavaScript might fix the issues.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
</label>
<label for="enable_js_trycatch">
<input
name="enable_js_trycatch"
type="checkbox"
id="enable_js_trycatch"
value="1"
<?php echo checked($wpo_minify_options['enable_js_trycatch']); ?>
>
<?php _e('Contain each included file in its own block', 'wp-optimize'); ?>
<em><?php _e('(enable if trying to isolate a JavaScript error introduced by minifying or merging)', 'wp-optimize'); ?></em>
<span tabindex="0" data-tooltip="<?php esc_attr_e('When enabled, the content of each JavaScript file that is combined will be wrapped in its own "try / catch" statement. This means that if one file has an error, it should not impede execution of other, independent files.', 'wp-optimize'); ?>"><span class="dashicons dashicons-editor-help"></span> </span>
</label>
</fieldset>
</div>
<h3><?php _e('Exclude JavaScript from processing', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<fieldset>
<label for="exclude_js">
<?php _e('Any JavaScript files that match the paths below will be completely ignored', 'wp-optmize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('Use this if you are having issues with a certain JavaScript file.', 'wp-optmize'); ?> <?php esc_attr_e('Any file present here will be loaded normally by WordPress', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
<textarea
name="exclude_js"
rows="7" cols="50"
id="exclude_js"
class="large-text code"
placeholder="<?php esc_attr_e('e.g.: /wp-includes/js/jquery/jquery.js', 'wp-optimize'); ?>"
><?php echo esc_textarea($wpo_minify_options['exclude_js']);?></textarea>
<br>
<?php _e('Some files known for causing issues when combined / minified are excluded by default.', 'wp-optimize'); ?> <?php _e('You can see / edit them in the Advanced tab.', 'wp-optimize'); ?>
</fieldset>
</div>
<h3><?php _e('Defer JavaScript', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<fieldset class="async-js-manual-list">
<h4><label>
<input
name="enable_defer_js"
type="radio"
value="individual"
<?php echo checked($wpo_minify_options['enable_defer_js'], 'individual'); ?>
>
<?php _e('Defer selected JavaScript files', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('The files in the list will be loaded asynchronously, and will not be minified or merged.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
</h4>
<div class="defer-js-settings">
<label for="async_js">
<?php _e('Any JavaScript files that match the paths below will be loaded asynchronously.', 'wp-optmize'); ?>
<br/>
<?php _e('Use this if you have a completely independent script or would like to exclude scripts from page speed tests (PageSpeed Insights, GTMetrix...)', 'wp-optmize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('Independent scripts are for example \'analytics\' or \'pixel\' scripts. They are not required for the website to work', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
<textarea
name="async_js"
rows="7"
cols="50"
id="async_js"
class="large-text code"
placeholder="<?php esc_attr_e('e.g.: /js/main.js', 'wp-optimize'); ?>"
><?php echo esc_textarea($wpo_minify_options['async_js']); ?></textarea>
</div>
</fieldset>
<fieldset>
<h4>
<label>
<input
name="enable_defer_js"
type="radio"
value="all"
<?php echo checked($wpo_minify_options['enable_defer_js'], 'all'); ?>
>
<?php _e('Defer all the JavaScript files', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('All files - including the ones processed by WP-Optimize - will be deferred, except the ones in the exclusion list above.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
</h4>
<div class="defer-js-settings">
<div class="notice notice-warning below-h2">
<p class="wpo_min-bold-green wpo_min-rowintro">
<?php _e('Some themes and plugins need render blocking scripts to work.', 'wp-optimize'); ?> <?php _e('Please check the browser console for any eventual JavaScript errors caused by deferring the scripts.', 'wp-optimize'); ?>
</p>
</div>
<h4><?php _e('Defer method:', 'wp-optimize'); ?></h4>
<label>
<input
name="defer_js_type"
type="radio"
value="defer"
<?php echo checked($wpo_minify_options['defer_js_type'], 'defer'); ?>
>
<?php _e('Use the "defer" html attribute', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('Supported by all modern browsers.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
<label>
<input
name="defer_js_type"
type="radio"
value="async_using_js"
<?php echo checked($wpo_minify_options['defer_js_type'], 'async_using_js'); ?>
>
<?php _e('Defer using JavaScript', 'wp-optimize'); ?>
<em><?php printf(__('(Use this method if you require support for %solder browsers%s).', 'wp-optimize'), '<a href="https://www.w3schools.com/tags/att_script_defer.asp" target="_blank">', '</a>');?></em>
</label>
<label for="defer_jquery">
<input
name="defer_jquery"
type="checkbox"
id="defer_jquery"
value="1"
<?php echo checked($wpo_minify_options['defer_jquery']); ?>
>
<?php _e('Defer jQuery', 'wp-optimize'); ?> <em><?php _e('(Note that as jQuery is a common dependency, it probably needs to be loaded synchronously).', 'wp-optimize'); ?></em>
<span tabindex="0" data-tooltip="<?php esc_attr_e('Disable this setting if you have an error \'jQuery undefined\'.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
</div>
</fieldset>
</div>
<p class="submit">
<input
class="wp-optimize-save-minify-settings button button-primary"
type="submit"
value="<?php esc_attr_e('Save settings', 'wp-optimize'); ?>"
>
<img class="wpo_spinner" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="...">
<span class="save-done dashicons dashicons-yes display-none"></span>
</p>
</form>
</div>

View File

@@ -0,0 +1,32 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<div class="wpo_section wpo_group">
<form>
<?php if ($is_cache_enabled) : ?>
<div id="minify-preload" class="notice notice-warning wpo-warning below-h2 wp-optimize-minify-status-information-notice wpo-show">
<p>
<span class="dashicons dashicons-info"></span>
<?php printf(__('You are using WP-Optimize for page caching. Because of that, the pre-load settings used for page-caching are used. i.e. To configure pre-loading, go to the <a href="%s">settings in the caching section</a> instead.', 'wp-optimize'), admin_url('admin.php?page=wpo_cache&tab=wp_optimize_preload'), __('Cache Preload', 'wp-optimize')); ?><br>
</p>
</div>
<?php endif; ?>
<h3 class="wpo-first-child"><?php _e('Preload now', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<p>
<input id="wp_optimize_run_minify_preload"
class="button button-primary" type="submit"
name="wp_optimize_run_minify_preload"
value="<?php echo $is_running ? esc_attr__('Cancel', 'wp-optimize') : esc_attr__('Run now', 'wp-optimize'); ?>"
<?php echo $is_running ? 'data-running="1"' : ''; ?>
<?php echo $is_cache_enabled ? "disabled" : ""; ?>
>
<span id="wp_optimize_preload_minify_status"><?php
echo htmlspecialchars($status_message);
?></span>
</p>
<span>
<?php _e('This action will trigger WP-Optimize to generate minify assets by visiting pages to preload them (so that they are ready the first time a human visitor wants them).', 'wp-optimize'); ?>
<?php _e('If a sitemap is available, then it will be used to determine which assets get minified.', 'wp-optimize'); ?>
</span>
</div>
</form>
</div>

View File

@@ -0,0 +1,114 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<div class="wpo_section wpo_group">
<form>
<div id="wpo_settings_warnings"></div>
<h3><?php _e('Miscellaneous', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<fieldset>
<label for="merge_inline_extra_css_js">
<input
name="merge_inline_extra_css_js"
type="checkbox"
id="merge_inline_extra_css_js"
value="1"
<?php echo checked($wpo_minify_options['merge_inline_extra_css_js']);?>
>
<?php _e('Merge inline extra css and javascript', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('Inline JavaScript and CSS that should come before or after other enqueued files will be merged.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
<label for="disable_when_logged_in">
<input
name="disable_when_logged_in"
type="checkbox"
id="disable_when_logged_in"
value="1"
<?php echo checked($wpo_minify_options['disable_when_logged_in']);?>
>
<?php _e('Disable Minify for logged-in users', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('HTML, JavaScript and CSS will be loaded normally by WordPress.', 'wp-optimize');?> <?php esc_attr_e('Useful for debugging or to improve compatibility with some visual editors.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
<label for="clean_header_one">
<input
name="clean_header_one"
type="checkbox"
id="clean_header_one"
value="1"
<?php echo checked($wpo_minify_options['clean_header_one']); ?>
>
<?php _e('Remove meta information from page header', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('Remove resource hints, generator tag, shortlinks, manifest link, etc.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
<label for="emoji_removal">
<input
name="emoji_removal"
type="checkbox"
id="emoji_removal"
class="jsprocessor"
value="1"
<?php echo checked($wpo_minify_options['emoji_removal']); ?>
>
<?php _e('Remove default WordPress and TinyMCE icons', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('When selected, the site will use the device\'s built in Emoji', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
</fieldset>
</div>
<h3><?php _e('SSL options', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<p class="wpo_min-bold-green wpo_min-rowintro">
<?php _e('Force HTTP or HTTPS on the assets generated by WP-Optimize Minify.', 'wp-optimize'); ?>
<?php _e('You may need it for some CDN plugins to work:', 'wp-optimize'); ?>
</p>
<fieldset>
<label>
<input
type="radio"
name="default_protocol"
value="dynamic"
<?php checked('dynamic' === $wpo_minify_options['default_protocol']); ?>
>
<?php _e('Same as home URL', 'wp-optimize'); ?> (<?php printf(__('Currently: %s', 'wp-optimize'), $default_protocol);?>)
<span tabindex="0" data-tooltip="<?php esc_attr_e('Uses your site\'s default protocol.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
<label>
<input
type="radio"
name="default_protocol"
value="http"
<?php checked('http' === $wpo_minify_options['default_protocol']); ?>
>
<?php _e('Force HTTP', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('If you do not have SSL', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
<label>
<input
type="radio"
name="default_protocol"
value="https"
<?php checked('https' === $wpo_minify_options['default_protocol']); ?>
>
<?php _e('Force HTTPS', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('Recommended if you have SSL', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
</label>
</fieldset>
</div>
<?php
/**
* Called before outputing the submit button in the setting fields in Minify > Advanced
*/
do_action('wpo_minify_settings_tabs', $wpo_minify_options);
?>
<p class="submit">
<input
class="wp-optimize-save-minify-settings button button-primary"
type="submit"
value="<?php esc_attr_e('Save settings', 'wp-optimize'); ?>"
>
<img class="wpo_spinner" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="...">
<span class="save-done dashicons dashicons-yes display-none"></span>
</p>
</form>
</div>

View File

@@ -0,0 +1,231 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<div id="wp-optimize-minify-status" class="wpo_section wpo_group<?php echo (!$wpo_minify_options['enabled']) ? ' wpo-feature-is-disabled' : ''; ?>">
<form>
<div class="wpo-info wpo-show">
<a class="wpo-info__trigger" href="#"><span class="dashicons dashicons-sos"></span> <?php _e('How to use the minify feature', 'wp-optimize'); ?> <span class="wpo-info__close"><?php _e('Close', 'wp-optimize'); ?></span></a>
<div class="wpo-info__content">
<p><strong><?php _e('Not sure how to use the Minify feature?', 'wp-optimize'); ?></strong> <br><?php _e('Watch our how-to video below.', 'wp-optimize'); ?></p>
<div class="wpo-video-preview">
<a href="https://vimeo.com/402556749" data-embed="https://player.vimeo.com/video/402556749?color=df6926&title=0&byline=0&portrait=0" target="_blank"><img src="<?php echo trailingslashit(WPO_PLUGIN_URL); ?>images/notices/minify-video-preview.png" alt="<?php _e('Minify video preview', 'wp-optimize');?>" /></a>
</div>
<small>(<?php _e('Loads a video hosted on vimeo.com', 'wp-optimize'); ?>) - <a href="https://vimeo.com/402556749" target="_blank"><?php _e('Open the video in a new window', 'wp-optimize'); ?></a></small>
<p><a href="<?php echo WP_Optimize()->maybe_add_affiliate_params('https://getwpo.com/faqs/category/minification/'); ?>"><?php _e('Read the documentation', 'wp-optimize'); ?></a></p>
</div>
</div>
<div id="wpo_settings_warnings"></div>
<?php if ($show_information_notice) : ?>
<div class="notice notice-warning wpo-warning is-dismissible below-h2 wp-optimize-minify-status-information-notice wpo-show">
<p>
<span class="dashicons dashicons-shield"></span>
<strong><?php _e('CSS, JavaScript and HTML minification is an advanced feature.', 'wp-optimize'); ?></strong><br>
<?php _ex('While enabling it will work just fine for most sites, it might need specific configuration to work properly on your website.', '"it" refers to the Minify feature.', 'wp-optimize'); ?><br>
<?php _ex('If you encounter an issue and are not sure what to do, disable the feature and ask for help on the support forum.', '"it" refers to the Minify feature.', 'wp-optimize'); ?>
<?php _ex('We will do our best to help you configure it.', '"it" refers to the Minify feature.', 'wp-optimize'); ?>
<a href="<?php echo WP_Optimize()->maybe_add_affiliate_params('https://getwpo.com/faqs/category/minification/'); ?>"><?php _e('Read the documentation', 'wp-optimize'); ?></a>
</p>
</div>
<?php endif; ?>
<div class="wpo-fieldgroup wpo-show">
<div class="switch-container">
<label class="switch">
<input
name="enabled"
id="wpo_min_enable_minify"
class="wpo-save-setting"
type="checkbox"
value="true"
<?php echo WPO_MINIFY_PHP_VERSION_MET ? '' : 'disabled'; ?>
<?php checked($wpo_minify_options['enabled']); ?>
>
<span class="slider round"></span>
</label>
<label for="wpo_min_enable_minify">
<?php if (WPO_MINIFY_PHP_VERSION_MET) {
_e('Enable Minify', 'wp-optimize');
} else {
echo __('The PHP version on your server is too old.', 'wp-optimize').' '.__('Update PHP to enable minification of JS, CSS and HTML on this website', 'wp-optimize');
?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('PHP version requirement (5.4 minimum) not met', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
<?php
}
?>
</label>
</div>
<p><?php _e('If this is turned on, then the default settings are that JavaScript and CSS on this website will be concatenated and minified and HTML will be minified.', 'wp-optimize'); ?> <?php _e('You can adjust the settings in the tabs above to control this to meet your requirements.', 'wp-optimize'); ?></p>
<?php if (!empty($active_minify_plugins)) : ?>
<div class="notice notice-error">
<p>
<?php printf(__('It looks like you already have an active minify plugin (%s) installed. Having more than one active plugin to minify front end assets might cause unexpected results and waste of resources.', 'wp-optimize'), implode(', ', $active_minify_plugins)); ?>
</p>
</div>
<?php endif; ?>
<?php if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) : ?>
<div class="notice notice-warning">
<p><span class="dashicons dashicons-info"></span> <?php printf(__('The constant %s is set to true, so no JavaScript or CSS file will be minified.', 'wp-optimize'), '<code>SCRIPT_DEBUG</code>'); ?></p>
</div>
<?php endif; ?>
<div class="wpo-minify-features">
<div class="wpo-fieldgroup__subgroup">
<div class="switch-container">
<label class="switch">
<input
name="html_minification"
id="wpo_min_enable_minify_html"
class="wpo-save-setting"
type="checkbox"
value="true"
<?php checked($wpo_minify_options['html_minification']);?>
>
<span class="slider round"></span>
</label>
<label for="wpo_min_enable_minify_html">
<?php _e('Process HTML (works only when cache pre-loading)', 'wp-optimize'); ?>
<?php // Note: the comment added by WPO regarding cacheing will not be removed (it's added later in the process) ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('All HTML will be minified. It takes effect only when cache pre-loading because it takes time.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
</label>
</div>
</div>
<div class="wpo-fieldgroup__subgroup">
<div class="switch-container">
<label class="switch">
<input
name="enable_js"
id="wpo_min_enable_minify_js"
class="wpo-save-setting"
type="checkbox"
value="true"
data-tabname="js"
<?php checked($wpo_minify_options['enable_js']);?>
>
<span class="slider round"></span>
</label>
<label for="wpo_min_enable_minify_js">
<?php _e('Process JavaScript files', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('The JavaScript files will be combined and minified to lower the number and size of requests.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
<a href="#" class="js--wpo-goto" data-tab="js"><?php _e('Settings', 'wp-optimize'); ?></a>
</label>
</div>
</div>
<div class="wpo-fieldgroup__subgroup">
<div class="switch-container">
<label class="switch">
<input
name="enable_css"
id="wpo_min_enable_minify_css"
class="wpo-save-setting"
type="checkbox"
value="true"
data-tabname="css"
<?php checked($wpo_minify_options['enable_css']);?>
>
<span class="slider round"></span>
</label>
<label for="wpo_min_enable_minify_css">
<?php _e('Process CSS files', 'wp-optimize'); ?>
<span tabindex="0" data-tooltip="<?php esc_attr_e('The stylesheets will be combined and minified to lower the number and size of requests.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
<a href="#" class="js--wpo-goto" data-tab="css"><?php _e('Settings', 'wp-optimize'); ?></a>
</label>
</div>
</div>
</div>
</div>
<div class="wpo-fieldgroup">
<p class="actions">
<input
class="button button-primary purge_minify_cache <?php echo $can_purge_the_cache ? '' : 'disabled'; ?>"
type="submit"
value="<?php wp_optimize_minify_config()->always_purge_everything() ? esc_attr_e('Purge the minified files', 'wp-optimize') : esc_attr_e('Reset the minified files', 'wp-optimize'); ?>"
<?php echo WPO_MINIFY_PHP_VERSION_MET && $can_purge_the_cache ? '' : 'disabled'; ?>
/>
<img class="wpo_spinner" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="...">
<span class="save-done dashicons dashicons-yes display-none"></span>
</p>
<p>
<span><?php _e("The new minified files will be regenerated when visiting your website's pages.", 'wp-optimize'); ?> <a href="https://getwpo.com/faqs/what-does-reset-the-minified-files-actually-do/"><?php _e('Read more about what this does in our FAQs.', 'wp-optimize'); ?></a> (<?php _e('This will also purge the page cache', 'wp-optimize'); ?>)</span>
</p>
<?php if (WPO_MINIFY_PHP_VERSION_MET) : ?>
<?php _e('Minify cache size:', 'wp-optimize'); ?>
<ul class="ul-disc">
<li><?php _e('Current cache:', 'wp-optimize'); ?>
<strong id="wpo_min_cache_size">
<?php
if ($wpo_minify_options['enabled']) {
echo esc_html(WP_Optimize_Minify_Cache_Functions::get_cachestats($cache_dir));
} else {
_e('No minified files are present', 'wp-optimize');
}
?>
</strong>
<a href="#" class="js--wpo-goto" data-tab="advanced"><?php _e('View the files', 'wp-optimize'); ?></a>
</li>
<li>
<?php _e('Total cache:', 'wp-optimize'); ?>
<strong id="wpo_min_cache_total_size">
<?php
if ($wpo_minify_options['enabled']) {
echo esc_html(WP_Optimize_Minify_Cache_Functions::get_cachestats(WPO_CACHE_MIN_FILES_DIR));
} else {
_e('No minified files are present', 'wp-optimize');
}
?>
</strong>
<strong tabindex="0" data-tooltip="<?php _e('This includes the older, non-expired cache, as well as the temporary files used to generate the minified files.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></strong>
</li>
</ul>
<?php endif; ?>
<p>
<?php _e('Last Minify cache update:', 'wp-optimize'); ?>
<strong id="wpo_min_cache_time">
<?php
if (empty($wpo_minify_options['last-cache-update'])) {
_e('Never.', 'wp-optimize');
} elseif (!$wpo_minify_options['enabled']) {
echo '-';
} else {
echo WP_Optimize_Minify_Cache_Functions::format_date_time($wpo_minify_options['last-cache-update']);
}
?>
</strong>
</p>
<?php if ($wpo_minify_options['debug']) : ?>
<p class="actions">
<input
class="button minify_increment_cache"
type="button"
value="<?php esc_attr_e('Increment cache', 'wp-optimize'); ?>"
<?php echo WPO_MINIFY_PHP_VERSION_MET ? '' : 'disabled'; ?>
/>
<img class="wpo_spinner" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="...">
<span class="save-done dashicons dashicons-yes display-none"></span>
<strong tabindex="0" data-tooltip="<?php _e('This will reset the files generated by minify, but use the existing minify temporary files.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></strong>
</p>
<?php
// This is only necessary if the everything isn't purged
if (!wp_optimize_minify_config()->always_purge_everything()) :
?>
<p class="actions">
<input
class="button purge_all_minify_cache"
type="button"
value="<?php esc_attr_e('Delete all the files generated by minifcation', 'wp-optimize'); ?>"
<?php echo WPO_MINIFY_PHP_VERSION_MET ? '' : 'disabled'; ?>
/>
<img class="wpo_spinner" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="...">
<span class="save-done dashicons dashicons-yes display-none"></span>
<strong tabindex="0" data-tooltip="<?php _e('If you are using an unsupported cache plugin, then you will also need to purge your page cache when doing this.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></strong>
</p>
<?php
endif;
?>
<?php endif; ?>
</div>
</form>
</div><!-- end #wp-optimize-minify-status -->

View File

@@ -0,0 +1,7 @@
<script type="text/html" id="tmpl-wpo-modal">
<div class="wpo-modal--bg"></div>
<div class="wpo-modal" tabindex="0">
<button type="button" class="wpo-modal--close"><span class="dashicons dashicons-no"></span> <span class="screen-reader-text"><?php _e('Close'); ?></button>
<div class="wpo-modal--content"></div>
</div>
</script>

View File

@@ -0,0 +1,9 @@
<?php if (!defined('ABSPATH')) die('No direct access.'); ?>
<div class="wpo_info below-h2">
<?php if ($message) : ?>
<h3><?php _e('Page caching issue.', 'wp-optimize'); ?></h3>
<p><?php echo $message; ?></p>
<?php endif; ?>
</div>

View File

@@ -0,0 +1,88 @@
<?php if (!defined('WPO_PLUGIN_MAIN_PATH')) die('No direct access allowed'); ?>
<?php if (!empty($button_meta) && 'review' == $button_meta) : ?>
<div class="updraft-ad-container updated below-h2">
<div class="updraft_notice_container updraft_review_notice_container">
<div class="updraft_advert_content_left_extra">
<img src="<?php echo WPO_PLUGIN_URL.'/images/'.$image;?>" width="85" alt="<?php _e('notice image', 'wp-optimize');?>" />
</div>
<div class="updraft_advert_content_right">
<p>
<?php echo $text; ?>
</p>
<?php if (!empty($button_link)) { ?>
<div class="updraft_advert_button_container">
<a class="button button-primary" href="<?php esc_attr_e($button_link);?>" target="_blank" onclick="jQuery('.updraft-ad-container').slideUp(); jQuery.post(ajaxurl, {action: 'wp_optimize_ajax', subaction: '<?php echo $dismiss_time;?>', nonce: '<?php echo wp_create_nonce('wp-optimize-ajax-nonce');?>', dismiss_forever: '1' });">
<?php _e('Ok, you deserve it', 'wp-optimize'); ?>
</a>
<div class="dashicons dashicons-calendar"></div>
<a class="updraft_notice_link" href="#" onclick="jQuery('.updraft-ad-container').slideUp(); jQuery.post(ajaxurl, {action: 'wp_optimize_ajax', subaction: '<?php echo $dismiss_time;?>', nonce: '<?php echo wp_create_nonce('wp-optimize-ajax-nonce');?>', dismiss_forever: '0' });">
<?php _e('Maybe later', 'wp-optimize'); ?>
</a>
<div class="dashicons dashicons-no-alt"></div>
<a class="updraft_notice_link" href="#" onclick="jQuery('.updraft-ad-container').slideUp(); jQuery.post(ajaxurl, {action: 'wp_optimize_ajax', subaction: '<?php echo $dismiss_time;?>', nonce: '<?php echo wp_create_nonce('wp-optimize-ajax-nonce');?>', dismiss_forever: '1' });"><?php _e('Never', 'wp-optimize'); ?></a>
</div>
<?php } ?>
</div>
</div>
<div class="clear"></div>
</div>
<?php else : ?>
<div class="updraft-ad-container updated below-h2">
<div class="updraft_notice_container">
<div class="updraft_advert_content_left">
<img src="<?php echo WPO_PLUGIN_URL.'/images/'.$image; ?>" width="60" height="60" alt="<?php _e('notice image', 'wp-optimize'); ?>" />
</div>
<div class="updraft_advert_content_right">
<h3 class="updraft_advert_heading">
<?php
if (!empty($prefix)) echo $prefix.' ';
echo $title;
?>
<div class="updraft-advert-dismiss">
<?php if (!empty($dismiss_time)) { ?>
<a href="#" onclick="jQuery('.updraft-ad-container').slideUp(); jQuery.post(ajaxurl, {action: 'wp_optimize_ajax', subaction: '<?php echo $dismiss_time; ?>', nonce: '<?php echo wp_create_nonce('wp-optimize-ajax-nonce'); ?>' });"><?php _e('Dismiss', 'wp-optimize'); ?></a>
<?php } else { ?>
<a href="#" onclick="jQuery('.updraft-ad-container').slideUp();"><?php _e('Dismiss', 'wp-optimize'); ?></a>
<?php } ?>
</div>
</h3>
<p>
<?php
echo $text;
$button_text = '';
if (isset($discount_code)) echo ' <b>' . $discount_code . '</b>';
if (!empty($button_link) && !empty($button_meta)) {
// Check which Message is going to be used.
if ('updraftcentral' == $button_meta) {
$button_text = __('Get UpdraftCentral', 'wp-optimize');
} elseif ('updraftplus' == $button_meta) {
$button_text = __('Get UpdraftPlus', 'wp-optimize');
} elseif ('signup' == $button_meta) {
$button_text = __('Sign up', 'wp-optimize');
} elseif ('go_there' == $button_meta) {
$button_text = __('Go there', 'wp-optimize');
} elseif ('wpo-premium' == $button_meta) {
$button_text = __('Find out more.', 'wp-optimize');
} elseif ('wp-optimize' == $button_meta) {
$button_text = __('Find out more.', 'wp-optimize');
} elseif ('collection' == $button_meta) {
$button_text = __('Read more.', 'wp-optimize');
}
$wp_optimize->wp_optimize_url($button_link, $button_text, null, 'class="updraft_notice_link"');
}
?>
</p>
</div>
</div>
<div class="clear"></div>
</div>
<?php
endif;

View File

@@ -0,0 +1,59 @@
<?php if (!defined('ABSPATH')) die('No direct access.'); ?>
<div class="notice wpo-introduction-notice is-dismissible below-h2">
<?php if ($is_new_install) : ?>
<h3><?php _e('Thank you for installing WP-Optimize!', 'wp-optimize'); ?></h3>
<p><?php _e('The team at WP-Optimize is working hard to make your site fast and efficient.', 'wp-optimize'); ?></p>
<p>
<?php printf(_x('The plugin settings are split into three parts: %sclean%s the database, %scompress%s images and %scaching%s.', '%s will be replaced by a "strong" tag', 'wp-optimize'), '<strong>', '</strong>', '<strong>', '</strong>', '<strong>', '</strong>'); ?>
</p>
<p><?php printf(__('If you are unsure what settings to use, please take a look at the %sdocumentation%s.', 'wp-optimize'), '<a href="'.WP_Optimize()->maybe_add_affiliate_params('https://getwpo.com/support/').'">', '</a>'); ?></p>
<p>
<?php printf(_x('We also recently added the ability to %scombine and minify%s CSS, JavaScript and HTML, for an increased performance boost.', '%s will be replaced by a "strong" tag', 'wp-optimize'), '<strong>', '</strong>'); ?>
<?php printf(_x('Read more about this feature %son our website%s.', '%s will be replaced by a link tag', 'wp-optimize'), '<a href="'.WP_Optimize()->maybe_add_affiliate_params('https://getwpo.com/faqs/category/minification/').'" target="_blank">', '</a>'); ?>
</p>
<?php if (!$is_updraftplus_installed) : ?>
<p>
<?php printf(__('But first, we strongly recommend you backup your site with %sUpdraftPlus%s.', 'wp-optimize'), '<a href="'.WP_Optimize()->maybe_add_affiliate_params('https://updraftplus.com/').'">', '</a>'); ?>
<?php _e('WP-Optimize can trigger UpdraftPlus to automatically back up right before any optimization takes place, so you can undo any changes you make.', 'wp-optimize'); ?>
</p>
<?php endif; ?>
<?php if (!$is_premium) : ?>
<p><?php printf(__('Finally, please take a look at our %spremium version%s, which is packed full of additional speed enhancements to make your site go even faster!', 'wp-optimize'), '<a href="'.WP_Optimize()->maybe_add_affiliate_params('https://getwpo.com/buy/').'">', '</a>'); ?></p>
<?php endif; ?>
<div class="wpo-introduction-notice__footer">
<p class="wpo-introduction-notice__footer-links font-size__normal">
<button type="button" class="button button-primary close"><?php _e('Dismiss', 'wp-optimize'); ?></button>
</p>
</div>
<?php else : ?>
<h3><?php _e('Thank you for updating WP-Optimize!', 'wp-optimize'); ?></h3>
<p><?php _e('The team at WP-Optimize is working hard to make your site fast and efficient.', 'wp-optimize'); ?></p>
<p>
<?php printf(_x('This new version includes a new major feature: the ability to %s minify your scripts and stylesheets.%s', '%s will be replaced by a "strong" tag', 'wp-optimize'), '<strong>', '</strong>'); ?>
<?php _e("This highly requested feature adds an extra layer of optimization to your website, lowering the number of requests sent to your server by combining and minifying the JavaScript and CSS files.", 'wp-optimize'); ?>
<a href="#" class="js--wpo-goto" data-page="wpo_minify" data-tab="status"><?php _e('Go to minify settings.', 'wp-optimize'); ?></a>
</p>
<p><?php _e("If you already have plugins for minifying, don't worry - WP-Optimize won't interfere unless you turn these options on.", 'wp-optimize'); ?></p>
<p><?php printf(_x('Read more about this feature %son our website%s.', '%s will be replaced by a link tag', 'wp-optimize'), '<a href="'.WP_Optimize()->maybe_add_affiliate_params('https://getwpo.com/faqs/category/minification/').'" target="_blank">', '</a>'); ?></p>
<?php if (!$is_premium) : ?>
<p class="wpo-introduction-notice__footer-links--premium"><?php printf(_x('PS - check out our new improved Premium version %shere%s.', '%s is replaced by a link tag', 'wp-optimize'), '<a href="'.'https://getwpo.com/buy/'.'" target="_blank">', '</a>'); ?></p>
<?php endif; ?>
<div class="wpo-introduction-notice__footer">
<p class="wpo-introduction-notice__footer-links font-size__normal">
<button type="button" class="button button-primary close"><?php _e('Dismiss', 'wp-optimize'); ?></button>
<?php if ($is_premium) : ?>
<?php printf(__('%sRead the full WP-Optimize documentation%s, or if you have any questions, please ask %sPremium support%s', 'wp-optimize'), '<a target="_blank" href="'.WP_Optimize()->maybe_add_affiliate_params('https://getwpo.com/faqs/').'">', '</a>', '<a target="_blank" href="'.WP_Optimize()->maybe_add_affiliate_params('https://getwpo.com/premium-support/').'">', '</a>'); ?>
<?php else : ?>
<?php WP_Optimize()->wp_optimize_url('https://getwpo.com/faqs/', __('Read the documentation', 'wp-optimize')); ?>
| <?php WP_Optimize()->wp_optimize_url('https://wordpress.org/support/plugin/wp-optimize/', __('Support', 'wp-optimize')); ?>
<?php endif; ?>
</p>
</div>
<?php endif; ?>
</div>

View File

@@ -0,0 +1,34 @@
<?php if (!defined('WPO_PLUGIN_MAIN_PATH')) die('No direct access allowed'); ?>
<div id="wp-optimize-dashnotice" class="updated below-h2">
<div style="float:right;"><a href="#" onclick="jQuery('#wp-optimize-dashnotice').slideUp(); jQuery.post(ajaxurl, {action: 'wp_optimize_ajax', subaction: 'dismiss_dash_notice_until', nonce: '<?php echo wp_create_nonce('wp-optimize-ajax-nonce'); ?>' });"><?php printf(__('Dismiss (for %s months)', 'wp-optimize'), 12); ?></a></div>
<h3><?php _e("Thank you for installing WP-Optimize!", 'wp-optimize'); ?></h3>
<a href="https://getwpo.com"><img style="border: 0px; float: right; height: 125px; width: 150px; margin-right: 40px;" alt="WP-Optimize" src="<?php echo WPO_PLUGIN_URL.'/images/logo/wpo_logo_small.png'; ?>"></a>
<div id="wp-optimize-dashnotice-wrapper" style="max-width: 800px;">
<p>
<?php echo htmlspecialchars(__('Super-charge and secure your WordPress site with our other top plugins:', 'wp-optimize')); ?>
</p>
<p>
<?php printf(__('%s offers powerful extra features and flexibility, and WordPress multisite support.', 'wp-optimize'), '<strong>'.$wp_optimize->wp_optimize_url('https://getwpo.com', __('WP-Optimize Premium:', 'wp-optimize'), '', '', true).'</strong>'); ?>
</p>
<p>
<?php printf(__('%s simplifies backups and restoration. It is the worlds highest ranking and most popular scheduled backup plugin, with over a million currently-active installs.', 'wp-optimize'), '<strong>'.$wp_optimize->wp_optimize_url('https://wordpress.org/plugins/updraftplus/', 'UpdraftPlus', '', '', true).'</strong>'); ?>
</p>
<p>
<?php printf(__('%s is a highly efficient way to manage, optimize, update and backup multiple websites from one place.', 'wp-optimize'), '<strong>'.$wp_optimize->wp_optimize_url('https://updraftcentral.com', 'UpdraftCentral', '', '', true).'</strong>'); ?>
</p>
<p>
<strong><?php $wp_optimize->wp_optimize_url('https://www.simbahosting.co.uk/s3/shop/', __('Premium WooCommerce extensions', 'wp-optimize')); ?></strong>
</p>
</div>
</div>

View File

@@ -0,0 +1,44 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<a id="wp-optimize-nav-page-menu" href="#" role="toggle-menu">
<span class="dashicons dashicons-no-alt"></span>
<span class="dashicons dashicons-menu"></span>
<span><?php _e('Menu', 'wp-optimize'); ?></span>
</a>
<div class="wpo-pages-menu">
<?php
$active_page = !empty($_REQUEST['page']) ? $_REQUEST['page'] : '';
foreach ($menu_items as $menu) :
?>
<?php if (isset($menu['icon']) && 'separator' == $menu['icon']) : ?>
<span class="separator"></span>
<?php else : ?>
<a class="<?php echo ($active_page === $menu['menu_slug']) ? 'active' : ''; ?>" href="<?php esc_attr_e(menu_page_url($menu['menu_slug'], false)); ?>" data-menuslug="<?php echo $menu['menu_slug']; ?>">
<span class="dashicons dashicons-<?php echo $menu['icon']; ?>"></span>
<span class="title"><?php esc_html_e($menu['menu_title']); ?></span>
</a>
<?php endif; ?>
<?php endforeach; ?>
<p class="wpo-header-links__mobile">
<span class="wpo-header-links__label"><?php _e('Useful links', 'wp-optimize'); ?></span>
<?php $wp_optimize->wp_optimize_url('https://getwpo.com/', __('Home', 'wp-optimize')); ?> |
<?php $wp_optimize->wp_optimize_url('https://updraftplus.com/', 'UpdraftPlus'); ?> |
<?php $wp_optimize->wp_optimize_url('https://updraftplus.com/news/', __('News', 'wp-optimize')); ?> |
<?php $wp_optimize->wp_optimize_url('https://twitter.com/updraftplus', __('Twitter', 'wp-optimize')); ?> |
<?php $wp_optimize->wp_optimize_url('https://wordpress.org/support/plugin/wp-optimize/', __('Support', 'wp-optimize')); ?> |
<?php $wp_optimize->wp_optimize_url('https://updraftplus.com/newsletter-signup', __('Newsletter', 'wp-optimize')); ?> |
<?php $wp_optimize->wp_optimize_url('https://david.dw-perspective.org.uk', __("Team lead", 'wp-optimize')); ?> |
<?php $wp_optimize->wp_optimize_url('https://getwpo.com/faqs/', __("FAQs", 'wp-optimize')); ?> |
<?php $wp_optimize->wp_optimize_url('https://www.simbahosting.co.uk/s3/shop/', __("More plugins", 'wp-optimize')); ?>
</p>
</div>

View File

@@ -0,0 +1,335 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<div class="wpo_col wpo_half_width wpo_feature_cont">
<header>
<h2><?php _e("WP-Optimize free / premium comparison", 'wp-optimize');?></h2>
<p>
<?php $wp_optimize->wp_optimize_url('https://getwpo.com/faqs/', __('FAQs', 'wp-optimize')); ?> |
<?php $wp_optimize->wp_optimize_url('https://getwpo.com/ask-pre-sales-question/', __('Ask a pre-sales question', 'wp-optimize')); ?>
</p>
</header>
<table class="wpo_feat_table">
<tbody>
<tr>
<td></td>
<td>
<img src="<?php echo WPO_PLUGIN_URL.'/images/notices/wp_optimize_logo.png';?>" alt="WP-Optimize" width="80" height="80">
<br>
<?php _e('Free', 'wp-optimize');?>
</td>
<td>
<img src="<?php echo WPO_PLUGIN_URL.'/images/notices/wp_optimize_logo.png';?>" alt="<?php esc_attr_e('WP-Optimize Premium', 'wp-optimize');?>" width="80" height="80">
<br>
<?php _e('Premium', 'wp-optimize');?>
</td>
</tr>
<tr>
<td></td>
<td>
<p><?php _e('Installed', 'wp-optimize');?></p>
</td>
<td>
<p><a href="<?php esc_attr_e(apply_filters('wpo_premium_buy_url', 'https://getwpo.com/buy/'));?>"><?php _e('Upgrade now', 'wp-optimize');?></a></p>
</td>
</tr>
<tr class="wpo-main-feature-row">
<td>
<img src="<?php echo WPO_PLUGIN_URL.'/images/features/database-optimization-vehicle-64x64.png';?>" alt="<?php esc_attr_e('Database cleaning', 'wp-optimize');?>" class="wpo-premium-image">
<h4><?php _e('Database cleaning', 'wp-optimize');?></h4>
<p><?php _e('Clears out unnecessary data, cleans up your tables and retrieves space lost to data fragmentation.', 'wp-optimize'); ?></p>
</td>
<td>
<p><span class="dashicons dashicons-yes" aria-label="<?php esc_attr_e('Yes', 'wp-optimize');?>"></span></p>
</td>
<td>
<p><span class="dashicons dashicons-yes" aria-label="<?php esc_attr_e('Yes', 'wp-optimize');?>"></span></p>
</td>
</tr>
<tr class="wpo-main-feature-row">
<td>
<img src="<?php echo WPO_PLUGIN_URL.'images/features/image-compression-vehicle-64x64.png';?>" alt="<?php esc_attr_e('Image compression', 'wp-optimize');?>" class="wpo-premium-image">
<h4><?php _e('Image compression', 'wp-optimize');?></h4>
<p><?php _e('Compress your images for a much faster page load.', 'wp-optimize');?></p>
</td>
<td>
<p><span class="dashicons dashicons-yes" aria-label="<?php esc_attr_e('Yes', 'wp-optimize');?>"></span></p>
</td>
<td>
<p><span class="dashicons dashicons-yes" aria-label="<?php esc_attr_e('Yes', 'wp-optimize');?>"></span></p>
</td>
</tr>
<tr class="wpo-main-feature-row">
<td>
<img src="<?php echo WPO_PLUGIN_URL.'images/features/cache-vehicle-64x64.png';?>" alt="<?php esc_attr_e('Caching', 'wp-optimize');?>" class="wpo-premium-image">
<h4><?php _e('Caching', 'wp-optimize');?></h4>
<p><?php _e('Cache your page and post for even more speed.', 'wp-optimize');?></p>
</td>
<td>
<p><span class="dashicons dashicons-yes" aria-label="<?php esc_attr_e('Yes', 'wp-optimize');?>"></span></p>
</td>
<td>
<p><span class="dashicons dashicons-yes" aria-label="<?php esc_attr_e('Yes', 'wp-optimize');?>"></span></p>
</td>
</tr>
<tr>
<td>
<img src="<?php echo WPO_PLUGIN_URL.'/images/features/multisite-support.png';?>" alt="<?php esc_attr_e('Multisite support', 'wp-optimize');?>" class="wpo-premium-image">
<h4><?php _e('Multisite support', 'wp-optimize');?></h4>
<p><?php _e('Optimize any site (or combination of sites) on your WordPress Multisite or network', 'wp-optimize');?></p>
</td>
<td>
<p><span class="dashicons dashicons-no-alt" aria-label="<?php esc_attr_e('No', 'wp-optimize');?>"></span></p>
</td>
<td>
<p><span class="dashicons dashicons-yes" aria-label="<?php esc_attr_e('Yes', 'wp-optimize');?>"></span></p>
</td>
</tr>
<tr>
<td>
<img src="<?php echo WPO_PLUGIN_URL.'/images/features/optimize-individual.png';?>" alt="<?php esc_attr_e('Optimize individual tables', 'wp-optimize');?>" class="wpo-premium-image">
<h4><?php _e('Optimize individual tables', 'wp-optimize');?></h4>
<p><?php _e('Perform optimizations on single tables', 'wp-optimize');?></p>
</td>
<td>
<p><span class="dashicons dashicons-no-alt" aria-label="<?php esc_attr_e('No', 'wp-optimize');?>"></span></p>
</td>
<td>
<p><span class="dashicons dashicons-yes" aria-label="<?php esc_attr_e('Yes', 'wp-optimize');?>"></span></p>
</td>
</tr>
<tr>
<td>
<img src="<?php echo WPO_PLUGIN_URL.'/images/features/remove-unwanted-img.png';?>" alt="<?php esc_attr_e('Remove unwanted images', 'wp-optimize');?>" class="wpo-premium-image">
<h4><?php _e('Remove unwanted images', 'wp-optimize');?></h4>
<p><?php _e('Remove images that have been orphaned or are no longer in use', 'wp-optimize');?></p>
</td>
<td>
<p><span class="dashicons dashicons-no-alt" aria-label="<?php esc_attr_e('No', 'wp-optimize');?>"></span></p>
</td>
<td>
<p><span class="dashicons dashicons-yes" aria-label="<?php esc_attr_e('Yes', 'wp-optimize');?>"></span></p>
</td>
</tr>
<tr>
<td>
<img src="<?php echo WPO_PLUGIN_URL.'/images/features/scheduling.png';?>" alt="<?php esc_attr_e('Multisite support', 'wp-optimize');?>" class="wpo-premium-image">
<h4><?php _e('Sophisticated scheduling', 'wp-optimize');?></h4>
<p><?php _e('A more advanced scheduling system to make regular routine optimizations whenever you prefer', 'wp-optimize');?></p>
</td>
<td>
<p><span class="dashicons dashicons-no-alt" aria-label="<?php esc_attr_e('No', 'wp-optimize');?>"></span></p>
</td>
<td>
<p><span class="dashicons dashicons-yes" aria-label="<?php esc_attr_e('Yes', 'wp-optimize');?>"></span></p>
</td>
</tr>
<tr>
<td>
<img src="<?php echo WPO_PLUGIN_URL.'/images/features/wp-cli.png';?>" alt="<?php esc_attr_e('Control with WP-CLI', 'wp-optimize');?>" class="wpo-premium-image">
<h4><?php _e('Control with WP-CLI', 'wp-optimize');?></h4>
<p><?php _e('Save time managing multiple sites from the WP command line', 'wp-optimize');?></p>
</td>
<td>
<p><span class="dashicons dashicons-no-alt" aria-label="<?php esc_attr_e('No', 'wp-optimize');?>"></span></p>
</td>
<td>
<p><span class="dashicons dashicons-yes" aria-label="<?php esc_attr_e('Yes', 'wp-optimize');?>"></span></p>
</td>
</tr>
<tr>
<td>
<img src="<?php echo WPO_PLUGIN_URL.'/images/features/lazy-load.png';?>" alt="<?php esc_attr_e('Lazy Loading', 'wp-optimize');?>" class="wpo-premium-image">
<h4><?php _e('Lazy Loading', 'wp-optimize');?></h4>
<p><?php _e('Make your site run faster by only loading parts of a web-page when it is visible to the user', 'wp-optimize');?></p>
</td>
<td>
<p><span class="dashicons dashicons-no-alt" aria-label="<?php esc_attr_e('No', 'wp-optimize');?>"></span></p>
</td>
<td>
<p><span class="dashicons dashicons-yes" aria-label="<?php esc_attr_e('Yes', 'wp-optimize');?>"></span></p>
</td>
</tr>
<tr>
<td>
<img src="<?php echo WPO_PLUGIN_URL.'/images/features/optimization-preview.png';?>" alt="<?php esc_attr_e('Optimization Preview', 'wp-optimize');?>" class="wpo-premium-image">
<h4><?php _e('Optimization Preview', 'wp-optimize');?></h4>
<p><?php _e('Preview, select and remove data and records available for optimization from the database', 'wp-optimize');?></p>
</td>
<td>
<p><span class="dashicons dashicons-no-alt" aria-label="<?php esc_attr_e('No', 'wp-optimize');?>"></span></p>
</td>
<td>
<p><span class="dashicons dashicons-yes" aria-label="<?php esc_attr_e('Yes', 'wp-optimize');?>"></span></p>
</td>
</tr>
<tr>
<td>
<img src="<?php echo WPO_PLUGIN_URL.'/images/features/logging-n-reporting.png';?>" alt="<?php esc_attr_e('Enhanced logging and reporting', 'wp-optimize');?>" class="wpo-premium-image">
<h4><?php _e('Enhanced logging and reporting', 'wp-optimize');?></h4>
<p><?php _e('Send log messages to three additional locations: Slack, Syslog and Simple History', 'wp-optimize');?></p>
</td>
<td>
<p><span class="dashicons dashicons-no-alt" aria-label="<?php esc_attr_e('No', 'wp-optimize');?>"></span></p>
</td>
<td>
<p><span class="dashicons dashicons-yes" aria-label="<?php esc_attr_e('Yes', 'wp-optimize');?>"></span></p>
</td>
</tr>
<tr>
<td>
<img src="<?php echo WPO_PLUGIN_URL.'/images/features/choice-n-flexibility.png';?>" alt="<?php esc_attr_e('More choice and flexibility', 'wp-optimize');?>" class="wpo-premium-image">
<h4><?php _e('More choice and flexibility', 'wp-optimize');?></h4>
<p><?php _e('Choose from a number of advanced options, like the ability to optimize individual DB tables', 'wp-optimize');?></p>
</td>
<td>
<p><span class="dashicons dashicons-no-alt" aria-label="<?php esc_attr_e('No', 'wp-optimize');?>"></span></p>
</td>
<td>
<p><span class="dashicons dashicons-yes" aria-label="<?php esc_attr_e('Yes', 'wp-optimize');?>"></span></p>
</td>
</tr>
<tr>
<td>
<img src="<?php echo WPO_PLUGIN_URL.'/images/features/geolocation.png';?>" alt="<?php esc_attr_e('Geolocation for WooCommerce', 'wp-optimize');?>" class="wpo-premium-image">
<h4><?php _e('Geolocation and tax country for WooCommerce', 'wp-optimize');?></h4>
<p><?php _e('Anyone running an international WooCommerce store needs this: serve country specific content to your customers, appropriate VAT, pricing, all cached for great performance', 'wp-optimize');?></p>
</td>
<td>
<p><span class="dashicons dashicons-no-alt" aria-label="<?php esc_attr_e('No', 'wp-optimize');?>"></span></p>
</td>
<td>
<p><span class="dashicons dashicons-yes" aria-label="<?php esc_attr_e('Yes', 'wp-optimize');?>"></span></p>
</td>
</tr>
<tr>
<td>
<img src="<?php echo WPO_PLUGIN_URL.'/images/features/more-settings.png';?>" alt="<?php esc_attr_e('Multilingual and multi-currency compatible', 'wp-optimize');?>" class="wpo-premium-image">
<h4><?php _e('Multilingual and multi-currency compatible', 'wp-optimize');?></h4>
<p><?php _e('Cache supports WPML multilingual plugin and multiple currencies for WooCommerce', 'wp-optimize');?></p>
</td>
<td>
<p><span class="dashicons dashicons-no-alt" aria-label="<?php esc_attr_e('No', 'wp-optimize');?>"></span></p>
</td>
<td>
<p><span class="dashicons dashicons-yes" aria-label="<?php esc_attr_e('Yes', 'wp-optimize');?>"></span></p>
</td>
</tr>
<tr>
<td>
<img src="<?php echo WPO_PLUGIN_URL.'/images/features/choice-n-flexibility.png';?>" alt="<?php esc_attr_e('More caching options', 'wp-optimize');?>" class="wpo-premium-image">
<h4><?php _e('More caching options', 'wp-optimize');?></h4>
<p><?php _e('Exclude posts and pages from the cache, straight from the post edit screen.', 'wp-optimize');?></p>
</td>
<td>
<p><span class="dashicons dashicons-no-alt" aria-label="<?php esc_attr_e('No', 'wp-optimize');?>"></span></p>
</td>
<td>
<p><span class="dashicons dashicons-yes" aria-label="<?php esc_attr_e('Yes', 'wp-optimize');?>"></span></p>
</td>
</tr>
<tr>
<td>
<img src="<?php echo WPO_PLUGIN_URL.'/images/features/lazy-load.png';?>" alt="<?php esc_attr_e('Preload key requests', 'wp-optimize');?>" class="wpo-premium-image">
<h4><?php _e('Preload key requests', 'wp-optimize');?></h4>
<p><?php _e('Preload assets such as web fonts and icon fonts, as recommended by Google PageSpeed Insights', 'wp-optimize');?></p>
</td>
<td>
<p><span class="dashicons dashicons-no-alt" aria-label="<?php esc_attr_e('No', 'wp-optimize');?>"></span></p>
</td>
<td>
<p><span class="dashicons dashicons-yes" aria-label="<?php esc_attr_e('Yes', 'wp-optimize');?>"></span></p>
</td>
</tr>
<tr>
<td>
<img src="<?php echo WPO_PLUGIN_URL.'/images/features/advanced.png';?>" alt="<?php esc_attr_e('Power tweaks', 'wp-optimize');?>" class="wpo-premium-image">
<h4><?php _e('Power tweaks', 'wp-optimize');?></h4>
<p><?php _e('Catered towards more advanced users, the power tweaks will enable you to improve performance by targeting specific weak points, either in WordPress Core, or in popular plugins', 'wp-optimize');?></p>
</td>
<td>
<p><span class="dashicons dashicons-no-alt" aria-label="<?php esc_attr_e('No', 'wp-optimize');?>"></span></p>
</td>
<td>
<p><span class="dashicons dashicons-yes" aria-label="<?php esc_attr_e('Yes', 'wp-optimize');?>"></span></p>
</td>
</tr>
<tr>
<td>
<img src="<?php echo WPO_PLUGIN_URL.'/images/features/premium-support.png';?>" alt="<?php esc_attr_e('Premium support', 'wp-optimize');?>" class="wpo-premium-image">
<h4><?php _e('Premium support', 'wp-optimize');?></h4>
<p><?php _e('Get your specific queries addressed directly by our experts', 'wp-optimize');?></p>
</td>
<td>
<p><span class="dashicons dashicons-no-alt" aria-label="<?php esc_attr_e('No', 'wp-optimize');?>"></span></p>
</td>
<td>
<p><span class="dashicons dashicons-yes" aria-label="<?php esc_attr_e('Yes', 'wp-optimize');?>"></span></p>
</td>
</tr>
<tr>
<td></td>
<td>
<p><?php _e('Installed', 'wp-optimize');?></p>
</td>
<td>
<p><a href="<?php esc_attr_e(apply_filters('wpo_premium_buy_url', 'https://getwpo.com/buy/'));?>"><?php _e('Upgrade now', 'wp-optimize');?></a></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="wpo_col wpo_half_width wpo_plugin_family_cont wpo-plugin-family__free">
<header>
<h2><?php _e("Our other plugins", 'wp-optimize');?></h2>
<p>
<?php $wp_optimize->wp_optimize_url('https://updraftplus.com/', 'UpdraftPlus'); ?> |
<?php $wp_optimize->wp_optimize_url('https://updraftplus.com/updraftcentral/', 'UpdraftCentral'); ?> |
</p>
</header>
<div class="wpo-plugin-family__plugins">
<div class="wpo-plugin-family__plugin">
<?php
$wp_optimize->wp_optimize_url('https://updraftplus.com/', null, '<img class="addons" alt="'.__("UpdraftPlus", 'wp-optimize').'" src="'. WPO_PLUGIN_URL.'images/features/updraftplus_logo.png' .'">');
$wp_optimize->wp_optimize_url('https://updraftplus.com/', null, '<h3>'.__('UpdraftPlus the ultimate protection for your site, hard work and business', 'wp-optimize').'</h3>', 'class="other-plugin-title"');
?>
<p>
<?php _e("If youve got a WordPress website, you need a backup.", 'wp-optimize');?>
</p>
<p>
<?php _e("Hacking, server crashes, dodgy updates or simple user error can ruin everything.", 'wp-optimize');?>
</p>
<p>
<?php _e("With UpdraftPlus, you can rest assured that if the worst does happen, it's no big deal. rather than losing everything, you can simply restore the backup and be up and running again in no time at all.", 'wp-optimize');?>
</p>
<p>
<?php _e("You can also migrate your website with few clicks without hassle.", 'wp-optimize');?>
</p>
<p>
<?php _e("With a long-standing reputation for excellence and outstanding reviews, its no wonder that UpdraftPlus is the worlds most popular WordPress backup plugin.", 'wp-optimize');?>
</p>
<?php $wp_optimize->wp_optimize_url('https://updraftplus.com/', null, __('Try for free', 'wp-optimize')); ?>
</div>
<div class="wpo-plugin-family__plugin">
<?php
$wp_optimize->wp_optimize_url('https://updraftplus.com/updraftcentral/', null, '<img class="addons" alt="'.__("UpdraftCentral Dashboard
", 'wp-optimize').'" src="'. WPO_PLUGIN_URL.'images/features/updraftcentral_logo.png' .'">');
$wp_optimize->wp_optimize_url('https://updraftplus.com/', null, '<h3>'.__('UpdraftCentral save hours managing multiple WP sites from one place', 'wp-optimize').'</h3>', 'class="other-plugin-title"');
?>
<p>
<?php _e("If you manage a few WordPress sites, you need UpdraftCentral.", 'wp-optimize');?>
</p>
<p>
<?php _e("UpdraftCentral is a powerful tool that allows you to efficiently manage, update, backup and even restore multiple websites from just one location. You can also manage users and comments on all the sites at once, and through its central login feature, you can access each WP-dashboard with a single click.", 'wp-optimize');?>
</p>
<p>
<?php _e("With a wide range of useful features, including automated backup schedules and sophisticated one click updates, UpdraftCentral is sure to boost to your productivity and save you time.", 'wp-optimize');?>
</p>
<?php $wp_optimize->wp_optimize_url('https://updraftplus.com/updraftcentral/', null, __('Try for free', 'wp-optimize')); ?>
</div>
</div><!-- END wpo-plugin-family__plugins -->
</div>
<div class="clear"></div>

View File

@@ -0,0 +1,21 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<h3 class="wpo-first-child"><?php _e('General settings', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<p>
<label>
<input name="enable-admin-bar" id="enable-admin-bar" type="checkbox" value ="true" <?php echo ($options->get_option('enable-admin-menu', 'false') == 'true') ? 'checked="checked"' : ''; ?> />
<?php _e('Enable admin bar menu', 'wp-optimize'); ?>
</label>
<br>
<small><?php _e('This option will add a link labeled "WP-Optimize" in the top admin bar, for easy access to the different features.', 'wp-optimize'); ?> <?php _e('Requires a page refresh after saving the settings.', 'wp-optimize'); ?></small>
</p>
<p>
<label>
<input name="enable_cache_in_admin_bar" id="enable-cache-admin-bar" type="checkbox" value ="1" <?php checked($options->get_option('enable_cache_in_admin_bar', true)); ?> />
<?php _e('Enable the caching menu in the admin bar', 'wp-optimize'); ?>
</label>
<br>
<small><?php _e('This option will add a caching menu on the top admin bar.', 'wp-optimize'); ?> <?php _e('Requires a page refresh after saving the settings.', 'wp-optimize'); ?></small>
</p>
</div>

View File

@@ -0,0 +1,91 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<h3><?php _e('Logging settings', 'wp-optimize'); ?></h3>
<div id="wp-optimize-logger-settings" class="wpo-fieldgroup">
<p>
<a href="#" id="wpo_add_logger_link" class="wpo-repeater__add"><span class="dashicons dashicons-plus"></span> <?php _e('Add logging destination', 'wp-optimize'); ?></a>
</p>
<div class="save_settings_reminder"><?php _e('Remember to save your settings so that your changes take effect.', 'wp-optimize');?></div>
<div id="wp-optimize-logging-options">
<?php
$loggers = $wp_optimize->get_logger()->get_loggers();
if (count($loggers) > 0) {
?>
<div class="wpo_logging_header">
<div class="wpo_logging_logger_title"><?php _e('Destination', 'wp-optimize'); ?></div>
<div class="wpo_logging_options_title"><?php _e('Options', 'wp-optimize'); ?></div>
<div class="wpo_logging_status_title"><?php _e('Status', 'wp-optimize'); ?></div>
<div class="wpo_logging_actions_title"><?php _e('Actions', 'wp-optimize'); ?></div>
</div>
<?php
foreach ($loggers as $logger) {
$logger_id = strtolower(get_class($logger));
?>
<div class="wpo_logging_row" data-id="<?php echo $logger_id; ?>">
<div class="wpo_logging_logger_row"><span
class="dashicons dashicons-arrow-right"></span><?php echo $logger->get_description(); ?>
</div>
<div class="wpo_logging_options_row"><?php echo $logger->get_options_text(); ?></div>
<div class="wpo_logging_status_row"><?php echo ($logger->is_enabled() && $logger->is_available()) ? __('Active', 'wp-optimize') : __('Inactive', 'wp-optimize'); ?></div>
<div class="wpo_logging_actions_row"><a href="#" class="dashicons dashicons-edit"></a><a
href="#" class="wpo_delete_logger dashicons dashicons-no-alt"></a></div>
<div class="wpo_additional_logger_options wpo_hidden">
<input class="wpo_hidden" type="hidden" name="wpo-logger-type[]"
value="<?php echo $logger_id; ?>"/>
<?php
$options_list = $logger->get_options_list();
$options_values = $logger->get_options_values();
if (!empty($options_list)) {
foreach ($options_list as $option_name => $placeholder) {
// check if settings item defined as array.
if (is_array($placeholder)) {
$validate = $placeholder[1];
$placeholder = $placeholder[0];
} else {
$validate = '';
}
$data_validate_attr = ('' !== $validate ? 'data-validate="'.esc_attr($validate).'"' : '');
?>
<input class="wpo_logger_addition_option" type="text"
name="wpo-logger-options[<?php echo esc_attr($option_name); ?>][]"
value="<?php echo esc_attr($options_values[$option_name]); ?>"
placeholder="<?php echo esc_attr($placeholder); ?>"
<?php echo $data_validate_attr; ?> "/>
<?php
}
}
?>
<label>
<input class="wpo_logger_active_checkbox"
type="checkbox" <?php checked($logger->is_enabled() && $logger->is_available()); ?> <?php disabled($logger->is_available(), false); ?>>
<input type="hidden" name="wpo-logger-options[active][]"
value="<?php echo $logger->is_enabled() ? '1' : '0'; ?>"/>
<?php _e('Active', 'wp-optimize'); ?>
</label>
</div>
</div>
<?php
}
?>
<?php
}
?>
</div><!-- End #wp-optimize-logging-options -->
</div><!-- End #wp-optimize-logger-settings -->

View File

@@ -0,0 +1,71 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<?php
$trackback_action_arr = $options->get_option('trackbacks_action', array());
$comments_action_arr = $options->get_option('comments_action', array());
?>
<h3><?php _e('Trackback/comments actions', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<div class="wpo-fieldgroup__subgroup">
<h3 class="wpo-first-child"><?php _e('Trackbacks', 'wp-optimize'); ?></h3>
<div id="trackbacks_notice"></div>
<p>
<small><?php _e('Use these buttons to enable or disable any future trackbacks on all your previously published posts.', 'wp-optimize'); ?></small>
</p>
<p>
<button class="button btn-updraftplus" type="button" id="wp-optimize-disable-enable-trackbacks-enable" name="wp-optimize-disable-enable-trackbacks-enable"><?php _e('Enable', 'wp-optimize'); ?></button>
<button class="button btn-updraftplus" type="button" id="wp-optimize-disable-enable-trackbacks-disable" name="wp-optimize-disable-enable-trackbacks-disable"><?php _e('Disable', 'wp-optimize'); ?></button>
<img id="trackbacks_spinner" class="wpo_spinner" src="<?php esc_attr_e(admin_url('images/spinner-2x.gif')); ?>" alt="...">
<span id="trackbacks_actionmsg">
<?php
if (!empty($trackback_action_arr)) {
$trackback_action_timestamp = WP_Optimize()->format_date_time($trackback_action_arr['timestamp']);
if ($trackback_action_arr['action']) {
echo sprintf(__('All trackbacks on existing posts were enabled on the %s.', 'wp-optimize'), $trackback_action_timestamp);
} else {
echo sprintf(__('All trackbacks on existing posts were disabled on the %s.', 'wp-optimize'), $trackback_action_timestamp);
}
}
?>
</span>
</p>
</div>
<div class="wpo-fieldgroup__subgroup">
<h3><?php _e('Comments', 'wp-optimize'); ?></h3>
<div id="comments_notice"></div>
<p><small><?php _e('Use these buttons to enable or disable any future comments on all your previously published posts.', 'wp-optimize'); ?></small></p>
<p>
<button class="button btn-updraftplus" type="button" id="wp-optimize-disable-enable-comments-enable" name="wp-optimize-disable-enable-comments-enable"><?php _e('Enable', 'wp-optimize'); ?></button>
<button class="button btn-updraftplus" type="button" id="wp-optimize-disable-enable-comments-disable" name="wp-optimize-disable-enable-comments-disable"><?php _e('Disable', 'wp-optimize'); ?></button>
<img id="comments_spinner" class="wpo_spinner" src="<?php esc_attr_e(admin_url('images/spinner-2x.gif')); ?>" alt="...">
<span id="comments_actionmsg">
<?php
if (!empty($comments_action_arr)) {
$comments_action_timestamp = WP_Optimize()->format_date_time($comments_action_arr['timestamp']);
if ($comments_action_arr['action']) {
echo sprintf(__('All comments on existing posts were enabled on the %s.', 'wp-optimize'), $comments_action_timestamp);
} else {
echo sprintf(__('All comments on existing posts were disabled on the %s.', 'wp-optimize'), $comments_action_timestamp);
}
}
?>
</span>
</p>
</div>
</div>

View File

@@ -0,0 +1,45 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<div id="wp-optimize-general-settings" class="wpo_section wpo_group">
<form action="#" method="post" enctype="multipart/form-data" name="settings_form" id="settings_form">
<div id="wpo_settings_warnings"></div>
<?php WP_Optimize()->include_template('settings/settings-general.php'); ?>
<?php WP_Optimize()->include_template('settings/settings-trackback-and-comments.php'); ?>
<?php WP_Optimize()->include_template('settings/settings-logging.php'); ?>
<?php do_action('wpo_after_general_settings'); ?>
<div id="wp-optimize-settings-save-results"></div>
<input type="hidden" name="action" value="save_redirect">
<?php wp_nonce_field('wpo_optimization'); ?>
<h3 class="wpo-first-child"><?php _e('Wipe settings', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<p>
<small><?php _e('This button will delete all of WP-Optimize\'s settings. You will then need to enter all your settings again. You can also do this before deactivating/deinstalling WP-Optimize if you wish.', 'wp-optimize'); ?></small>
<br>
<br>
<input class="button wpo-wipe-settings" type="button" name="wp-optimize-wipe-settings" value="<?php esc_attr_e('Wipe settings', 'wp-optimize'); ?>" />
<img class="wpo_spinner" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="...">
<span class="dashicons dashicons-yes display-none save-done"></span>
</p>
</div>
<div>
<input class="button button-primary wpo-save-settings" type="submit" name="wp-optimize-settings" value="<?php esc_attr_e('Save settings', 'wp-optimize'); ?>" />
<img class="wpo_spinner wpo-saving-settings" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="...">
<span class="dashicons dashicons-yes display-none save-done"></span>
</div>
</form>
</div><!-- end #wp-optimize-general-settings -->

View File

@@ -0,0 +1,11 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
<h3><?php _e('Support and feedback', 'wp-optimize'); ?></h3>
<div class="wpo-fieldgroup">
<?php WP_Optimize()->include_template('settings/system-status.php'); ?>
<ul>
<li><?php WP_Optimize()->wp_optimize_url('https://getwpo.com/faqs/', __("Read our FAQ here", 'wp-optimize')); ?></li>
<li><a href="https://wordpress.org/support/plugin/wp-optimize/"><?php _e('Support is available here.', 'wp-optimize'); ?></a></li>
<li><?php echo __('If you like WP-Optimize,', 'wp-optimize').' <a href="https://wordpress.org/support/plugin/wp-optimize/reviews/?rate=5#new-post" target="_blank">'.__('please give us a positive review, here.', 'wp-optimize'); ?></a> <?php echo __('Or, if you did not like it,', 'wp-optimize').' <a target="_blank" href="https://wordpress.org/support/plugin/wp-optimize/">'.__('please tell us why at this link.', 'wp-optimize'); ?></a></li>
</ul>
</div>

View File

@@ -0,0 +1,6 @@
<?php if (!defined('WPO_VERSION')) die('No direct access allowed');
$sqlversion = (string) $wp_optimize->get_db_info()->get_version();
?>
<p class="wpo-system-status"><em>WP-Optimize <?php echo WPO_VERSION; ?> - <?php _e('running on:', 'wp-optimize'); ?> PHP <?php echo htmlspecialchars(PHP_VERSION); ?>, MySQL <?php echo htmlspecialchars($sqlversion); ?> - <?php echo htmlspecialchars(PHP_OS); ?></em></p>

View File

@@ -0,0 +1,96 @@
<?php
if (!defined('WPO_VERSION')) die('No direct access allowed');
global $wpo_backup_initialized, $wpo_take_backup_checkbox_id;
$updraftplus_admin = !empty($GLOBALS['updraftplus_admin']) ? $GLOBALS['updraftplus_admin'] : null;
$updraftplus = !empty($GLOBALS['updraftplus']) ? $GLOBALS['updraftplus'] : null;
// Check if UpdraftPlus plugin status.
$updraftplus_status = $this->is_installed('UpdraftPlus - Backup/Restore');
$check_version = false;
// If UpdraftPlus Admin exists along with Method and active, then call the update modal.
if (is_a($updraftplus_admin, 'UpdraftPlus_Admin') && is_callable(array($updraftplus_admin, 'add_backup_scaffolding'))) {
if (!$wpo_backup_initialized) {
$updraftplus_admin->add_backup_scaffolding(__('Backup before running optimizations', 'wp-optimize'), array($updraftplus_admin, 'backupnow_modal_contents'));
}
$wpo_backup_initialized = true;
$check_version = true;
} else {
// When pulling this template from UDC-RPC it gives $updraftplus_admin as null and the above condition
// will always result into $disabled_backup = 'disabled', making the backup checkbox on UDC unclickable,
// this makes sense since we're not logging directly into the admin dashboard but through UDC. Since,
// we're giving the user an option to make a backup using UDP before optimizing on UDC, therefore we
// need a way to enable the checkbox (making it clickable), giving control to the user whether he or she
// needs to backup before running the optimization process.
//
// Having to check whether UDP is installed and active is enough for UDC to run its local backup process
// if the user wishes to backup before optimizing. Of course, when $updraftplus_admin is null we assumed
// that the request is coming from UDC-RPC.
if (null === $updraftplus_admin && true === $updraftplus_status['installed'] && true === $updraftplus_status['active']) {
$disabled_backup = '';
$check_version = true;
} else {
// Disabled UpdraftPlus.
$disabled_backup = 'disabled';
}
}
if (true === $check_version) {
// Check version.
if (version_compare($updraftplus->version, '1.12.33', '<')) {
$disabled_backup = 'disabled';
$updraftplus_version_check = true;
} else {
$disabled_backup = '';
$updraftplus_version_check = false;
}
}
$label_text = (isset($label) && '' !== $label) ? $label : __('Take a backup with UpdraftPlus before doing this', 'wp-optimize');
if (!isset($default_checkbox_value)) {
$default_checkbox_value = 'false';
}
$option_value = $options->get_option($checkbox_name, $default_checkbox_value);
$is_checked = ('true' == $option_value);
?>
<p class="wpo-take-a-backup">
<input class="enable-auto-backup" name="<?php echo $checkbox_name; ?>" id="<?php echo $checkbox_name; ?>" type="checkbox" value="true" <?php checked($is_checked);?> <?php echo $disabled_backup; ?> />
<label for="<?php echo $checkbox_name; ?>"> <?php echo $label_text; ?> </label>
<?php
// UpdraftPlus is not installed.
if ('disabled' == $disabled_backup && !$updraftplus_status['installed']) {
echo '<small><a href="'.wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=updraftplus'), 'install-plugin_updraftplus').'"> '.__('Follow this link to install UpdraftPlus, to take a backup before optimization', 'wp-optimize').' </a></small>';
} else {
// Build activate url.
$activate_url = add_query_arg(array(
'_wpnonce' => wp_create_nonce('activate-plugin_updraftplus/updraftplus.php'),
'action' => 'activate',
'plugin' => 'updraftplus/updraftplus.php'
), network_admin_url('plugins.php'));
// If is network admin then add to link newtwork activation.
if (is_network_admin()) {
$activate_url = add_query_arg(array('networkwide' => 1), $activate_url);
}
// Check updraftplus version first.
if (!empty($updraftplus_version_check)) {
echo '<small>'.__('UpdraftPlus needs to be updated to 1.12.33 or higher in order to backup the database before optimization.', 'wp-optimize').' <a href="'.admin_url('update-core.php').'">'.__('Please update UpdraftPlus to the latest version.', 'wp-optimize').'</a></small>';
} else {
if ($updraftplus_status['installed'] && !$updraftplus_status['active']) {
echo '<small><a href="'.$activate_url.'"> '.__('UpdraftPlus is installed but currently not active. Follow this link to activate UpdraftPlus, to take a backup before optimization.', 'wp-optimize').' </a></small>';
}
}
}
?>
</p>