SiteGround Optimizer

Actieve installaties: >1+ miljoen

Buy product
Category: Tag:

Omschrijving

This plugin is designed to link WordPress with the SiteGround Performance services. It WILL NOT WORK on another hosting provider.

The SiteGround Optimizer plugin has few different parts handling speciffic performance optimizations:

Configuratie

Voor gedetailleerde informatie over onze plugin en om te zien hoe het werkt, bekijk onze SG Optimizer tutorial.

SuperCacher instellingen

In this tab, you can configure your Dynamic Caching to store your content in the server’s memory for faster access and Memcached which stores frequently executed queries to your database and reuses them for better performance. Make sure you’ve enabled them from your Site Tools or cPanel before using the plugin. You can also enable Automatic Cache purge. This will perform a Full Purge on page, posts, and category deletion, plugin and theme activation, deactivation, or update, and on WordPress core updates. Enabling the Browser-specific caching will create different cache versions based on the user agent used. From Exclude Post Types you can exclude the ones you don’t want to be cached at all. You can also exclude specific URLs or use a wildcard to exclude any sub-pages of a specific “parent-page”. We have also provided a test tool where you can check if a specific URL has Dynamic caching actually running.

You can allow other user roles to flush cache using the filter we’ve designed for that purpose. Make sure to use the user role capatability in the filter. Here’s an example of the code, you can add to your functions.php file:

add_filter( 'sgo_purge_button_capabilities', 'sgo_add_new_role' );
function sgo_add_new_role( $default_capabilities ) {
    // Allow new user role to flush cache.
    $default_capabilities[] = 'delete_others_posts'; // For Editors.
    $default_capabilities[] = 'edit_published_posts'; // For Authors.

    return $default_capabilities;
}

Environment Optimization

Here, you can force HTTPS for your site, enable or disable Gzip Compression and Browser Caching rules. You can activate Database Optimization which will remove all unnecessary items from your database and optimize its tables. If you are using the InnoDB storage engine, the optimization of tables is done automatically by the engine. Use DNS-Prefetching to increase load speeds for external resources. It works by resolving the domain name, before a resource is requested. You can also manage Heartbeat Control to modify the frequency of the WP Heartbeat for different locations. By default, the WordPress Heartbeat API checks every 15 seconds on your post edit pages and every 60 seconds on your dashboard and front end whether there are scheduled tasks to be executed. With this option, you can make the checks run less frequently or completely disable them.

Frontend Optimization

In this tab, you can enable or disable Minification of your HTML, JS and CSS resources. You can activate/deactivate JS and CSS combinations to reduce the numbers of requests to the server. With the Web Fonts Optimization we’re changing the default way we load Google fonts. A preconnect link for Google’s font repository will be added in your head tag. This informs the browser that your page intends to establish a connection to another origin, and that you’d like the process to start as soon as possible. In addition, all other local fonts will be preloaded so browsers can cache and render them faster. Also when combined with CSS Combination, we will change the font-display property to swap or add it if it’s missing, so we ensure faster rendering. You can Disable Emojis support in your pages to prevent WordPress from detecting and generating emojis on your pages. You can also Remove Query Strings from static resources to improve their caching.

Image Optimization

Here, you can enable or disable automatic optimization for your newly uploaded images or bulk optimize your old ones. You can enable the generation of WebP images for newly uploaded images or generate WebP copies of your existing ones. WebP is a next generation image format supported by modern browsers which greatly reduces the size of your images. If the browser does not support WebP, the original images will be loaded. If you wish, you can delete all WebP copies of your images and original images will be loaded by default. You can also enable or disable Lazy Load for various assets such as iframes, videos, thumbnails, widgets, shortcodes and more. You can also enable Lazy Load for mobile requests. You have an option to exclude specific images from Lazy Loading. This is done by adding the class of the image in the tab.

Speed Test

Our performance check is powered by Google PageSpeed. Here you can check how well your website is optimized. The detailed tests result will provide you with additional information on what can be optimized more.

Full-page Caching on CloudFlare

Тhis optimization links your WordPress site with Cloudflare and sets the necessary rules and workers in order to enable full-page caching on Cloudflare edges in order to improve your TTFB and overall site performance. The tab will be available only if you have properly configured your installation to work with the CDN.

Plugin compatibiliteit

If your plugin does not trigger standard WordPress hooks or you need us to purge the cache, you can use this public function in your code:

if (function_exists('sg_cachepress_purge_cache')) {
    sg_cachepress_purge_cache();
}

Preferrably, you can pass an URL to the function to clear the cache just for it instead of purging the entire cache. For example:

if (function_exists('sg_cachepress_purge_cache')) {
    sg_cachepress_purge_cache('https://yoursite.com/pluginpage');
}

You can exclude styles from being combined and minified using the filters we’ve designed for that purpose. Here’s an example of the code, you can add to your functions.php file:

add_filter( 'sgo_css_combine_exclude', 'css_combine_exclude' );
function css_combine_exclude( $exclude_list ) {
    // Add the style handle to exclude list.
    $exclude_list[] = 'style-handle';
    $exclude_list[] = 'style-handle-2';

    return $exclude_list;
}

add_filter( 'sgo_css_minify_exclude', 'css_minify_exclude' );
function css_minify_exclude( $exclude_list ) {
    // Add the style handle to exclude list.
    $exclude_list[] = 'style-handle';
    $exclude_list[] = 'style-handle-2';

    return $exclude_list;
}

You can exclude script from being minified using the filter we’ve designed for that purpose. Here’s an example of the code, you can add to your functions.php file:

add_filter( 'sgo_js_minify_exclude', 'js_minify_exclude' );
function js_minify_exclude( $exclude_list ) {
    $exclude_list[] = 'script-handle';
    $exclude_list[] = 'script-handle-2';

    return $exclude_list;
}

You can exclude script from being combined using the filter we’ve designed for that purpose. Here’s an example of the code, you can add to your functions.php file:

add_filter( 'sgo_javascript_combine_exclude', 'js_combine_exclude' );
function js_combine_exclude( $exclude_list ) {
    $exclude_list[] = 'script-handle';
    $exclude_list[] = 'script-handle-2';

    return $exclude_list;
}

You can exclude external script from being combined using the filter we’ve designed for that purpose. Here’s an example of the code, you can add to your functions.php file:

add_filter( 'sgo_javascript_combine_excluded_external_paths', 'js_combine_exclude_external_script' );
function js_combine_exclude_external_script( $exclude_list ) {
    $exclude_list[] = 'script-host.com';
    $exclude_list[] = 'script-host-2.com';

    return $exclude_list;
}

You can exclude inline script from being combined using the filter we’ve designed for that purpose. Here’s an example of the code, you can add to your functions.php file:

add_filter( 'sgo_javascript_combine_excluded_inline_content', 'js_combine_exclude_inline_script' );
function js_combine_exclude_inline_script( $exclude_list ) {
    $exclude_list[] = 'first few symbols of inline content script';

    return $exclude_list;
}

You can exclude script from being loaded asynchronous using the filter we’ve designed for that purpose. Here’s an example of the code, you can add to your functions.php file:

add_filter( 'sgo_js_async_exclude', 'js_async_exclude' );
function js_async_exclude( $exclude_list ) {
    $exclude_list[] = 'script-handle';
    $exclude_list[] = 'script-handle-2';

    return $exclude_list;
}

You can exclude url or url that contain specific query param using the following filters:

add_filter( 'sgo_html_minify_exclude_params', 'html_minify_exclude_params' );
function html_minify_exclude_params( $exclude_params ) {
    // Add the query params that you want to exclude.
    $exclude_params[] = 'test';

    return $exclude_params;
}

add_filter( 'sgo_html_minify_exclude_urls', 'html_minify_exclude' );
function html_minify_exclude( $exclude_urls ) {
    // Add the url that you want to exclude.
    $exclude_urls[] = 'http://mydomain.com/page-slug';

    return $exclude_urls;
}

You can exclude images from Lazy Load using the following filter:

add_filter( 'sgo_lazy_load_exclude_classes', 'exclude_images_with_specific_class' );
function exclude_images_with_specific_class( $classes ) {
    // Add the class name that you want to exclude from lazy load.
    $classes[] = 'test-class';

    return $classes;
}

WP-CLI ondersteuning

In version 5.0 we’ve added full WP-CLI support for all plugin options and functionalities.

  • wp sg purge (url) – purges the entire cache or if URL is passed
  • wp sg memcached enable|disable – enables or disables Memcached
  • wp sg forcehttps enable|disable – enables or disables HTTPS for your site
  • wp sg optimize – enables or disables different optimization options for your site:
  • wp sg optimize html enable|disable – enables or disables HTML minification
  • wp sg optimize js enable|disable – enables or disables JS minification
  • wp sg optimize css enable|disable – enables or disables CSS minification
  • wp sg optimize combine-css enable|disable – enables or disables CSS combination
  • wp sg optimize combine-js enable|disable – enables or disables JS combination
  • wp sg optimize querystring enable|disable – enables or disables query strings removal
  • wp sg optimize emojis enable|disable – enables or disables stripping of the Emoji scripts
  • wp sg optimize images enable|disable – optimalisatie nieuwe afbeeldingen inschakelen of uitschakelen
  • wp sg optimize webp enable|disable – enables or disables WebP image optimization
  • wp sg optimize lazyload enable|disable – enables or disables Lazy loading of images
  • wp sg optimize gzip enable|disable – enables or disables Gzip compression for your site
  • wp sg optimize browsercache enable|disable – enables or disables Browser caching rules
  • wp sg optimize dynamic-cache enable|disable – enables or disables Dynamic caching rules
  • wp sg optimize web-fonts enable|disable – enables or disables Web Fonts Optimization
  • wp sg optimize fix_insecure_content enable|disable – enables or disables Insecure Content Fix
  • wp sg optimize database-optimization enable|disable – enables or disables the DB Optimization
  • wp sg optimize dns-prefetch enable|disable add|remove|urls – enables or disables the DNS Prefetching, add, remove or list urls.
  • wp sg optimize heartbeat-control enable|disable frontend|dashboard|post --frequency= enables or disables the Heartbeat control for a specific location and sets the frequency
  • wp sg settings export – exports the current plugin settings
  • wp sg settings import --hash= – imports plugin settings and applies them
  • wp sg status (optimization option) – returns optimization current status (enabled|disabled)

Available WP-CLI optimization options

  • dynamic-cache|autoflush-cache|mobile-cache|browser-caching
  • html|js|css
  • combine-css|combine-js
  • js-async
  • querystring
  • emojis
  • images|webp
  • lazyload_images|lazyload_gravatars|lazyload_thumbnails|lazyload_responsive|lazyload_textwidgets
  • gzip
  • memcache
  • ssl|ssl-fix
  • web-fonts

Eigenschappen

Om de plugin goed te laten werken, moet je server aan de volgende criteria voldoen:

  • SiteGround account
  • WordPress 4.7
  • PHP 5.5
  • Als je site niet bij SiteGround wordt gehost, zal deze plugin NIET WERKEN omdat deze afhankelijk is van een specifieke server configuratie.

Our plugin uses a cookie in order to function properly. It does not store personal data and is used solely for the needs of our caching system.

Main Menu