Customify – A Theme Customizer Booster - Version 2.7.1

Version Description

  • Fixed a couple of inconsistencies related to cache invalidation
  • Added integrations for the main caching plugins to prevent them minifying or moving the Web Font Loader script
Download this release

Release Info

Developer pixelgrade
Plugin Icon Customify – A Theme Customizer Booster
Version 2.7.1
Comparing to
See all releases

Code changes from version 2.7.0 to 2.7.1

customify.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Customify
4
  * Plugin URI: https://wordpress.org/plugins/customify/
5
  * Description: A Theme Customizer Booster to easily and consistently customize Fonts, Colors, and other options for your site.
6
- * Version: 2.7.0
7
  * Author: Pixelgrade
8
  * Author URI: https://pixelgrade.com
9
  * Author Email: contact@pixelgrade.com
@@ -12,7 +12,7 @@
12
  * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
13
  * Domain Path: /languages/
14
  * Requires at least: 4.9.9
15
- * Tested up to: 5.4.0
16
  * Requires PHP: 5.4.0
17
  */
18
 
@@ -33,7 +33,7 @@ require_once 'includes/extras.php';
33
  function PixCustomifyPlugin() {
34
  require_once plugin_dir_path( __FILE__ ) . 'includes/class-pixcustomify.php';
35
 
36
- return PixCustomifyPlugin::instance( __FILE__, '2.7.0' );
37
  }
38
 
39
  // Now get the party started.
3
  * Plugin Name: Customify
4
  * Plugin URI: https://wordpress.org/plugins/customify/
5
  * Description: A Theme Customizer Booster to easily and consistently customize Fonts, Colors, and other options for your site.
6
+ * Version: 2.7.1
7
  * Author: Pixelgrade
8
  * Author URI: https://pixelgrade.com
9
  * Author Email: contact@pixelgrade.com
12
  * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
13
  * Domain Path: /languages/
14
  * Requires at least: 4.9.9
15
+ * Tested up to: 5.4.1
16
  * Requires PHP: 5.4.0
17
  */
18
 
33
  function PixCustomifyPlugin() {
34
  require_once plugin_dir_path( __FILE__ ) . 'includes/class-pixcustomify.php';
35
 
36
+ return PixCustomifyPlugin::instance( __FILE__, '2.7.1' );
37
  }
38
 
39
  // Now get the party started.
includes/class-customify-block-editor.php CHANGED
@@ -233,7 +233,7 @@ if ( ! class_exists( 'Customify_Block_Editor' ) ) {
233
  }
234
 
235
  wp_register_script( PixCustomifyPlugin()->get_slug() . '-web-font-loader',
236
- plugins_url( 'js/vendor/webfontloader-1-6-28.js', PixCustomifyPlugin()->get_file() ), array('wp-editor'), null );
237
 
238
  add_filter( 'customify_font_css_selector', array( $this, 'gutenbergify_font_css_selectors' ), 10, 2 );
239
  Customify_Fonts_Global::instance()->enqueue_frontend_scripts();
233
  }
234
 
235
  wp_register_script( PixCustomifyPlugin()->get_slug() . '-web-font-loader',
236
+ plugins_url( 'js/vendor/webfontloader-1-6-28.min.js', PixCustomifyPlugin()->get_file() ), array('wp-editor'), null );
237
 
238
  add_filter( 'customify_font_css_selector', array( $this, 'gutenbergify_font_css_selectors' ), 10, 2 );
239
  Customify_Fonts_Global::instance()->enqueue_frontend_scripts();
includes/class-customify-classic-editor.php CHANGED
@@ -71,7 +71,7 @@ if ( ! class_exists( 'Customify_Classic_Editor' ) ) {
71
  // Make sure the the script is enqueued in the footer. We want all the DOM to be loaded and need jQuery.
72
  wp_deregister_script( PixCustomifyPlugin()->get_slug() . '-web-font-loader' );
73
  wp_register_script( PixCustomifyPlugin()->get_slug() . '-web-font-loader',
74
- plugins_url( 'js/vendor/webfontloader-1-6-28.js', PixCustomifyPlugin()->get_file() ), array('jquery'), null, true );
75
  wp_enqueue_script( PixCustomifyPlugin()->get_slug() . '-web-font-loader' );
76
  wp_add_inline_script( PixCustomifyPlugin()->get_slug() . '-web-font-loader', $script );
77
  }
71
  // Make sure the the script is enqueued in the footer. We want all the DOM to be loaded and need jQuery.
72
  wp_deregister_script( PixCustomifyPlugin()->get_slug() . '-web-font-loader' );
73
  wp_register_script( PixCustomifyPlugin()->get_slug() . '-web-font-loader',
74
+ plugins_url( 'js/vendor/webfontloader-1-6-28.min.js', PixCustomifyPlugin()->get_file() ), array('jquery'), null, true );
75
  wp_enqueue_script( PixCustomifyPlugin()->get_slug() . '-web-font-loader' );
76
  wp_add_inline_script( PixCustomifyPlugin()->get_slug() . '-web-font-loader', $script );
77
  }
includes/class-customify-customizer.php CHANGED
@@ -87,7 +87,7 @@ if ( ! class_exists( 'PixCustomify_Customizer' ) ) :
87
  'config' => array(
88
  'options_name' => PixCustomifyPlugin()->get_options_key(),
89
  'ajax_url' => admin_url( 'admin-ajax.php' ),
90
- 'webfontloader_url' => plugins_url( 'js/vendor/webfontloader-1-6-28.js', PixCustomifyPlugin()->get_file() ),
91
  'px_dependent_css_props' => self::$pixel_dependent_css_properties,
92
  ),
93
  // For localizing strings.
87
  'config' => array(
88
  'options_name' => PixCustomifyPlugin()->get_options_key(),
89
  'ajax_url' => admin_url( 'admin-ajax.php' ),
90
+ 'webfontloader_url' => plugins_url( 'js/vendor/webfontloader-1-6-28.min.js', PixCustomifyPlugin()->get_file() ),
91
  'px_dependent_css_props' => self::$pixel_dependent_css_properties,
92
  ),
93
  // For localizing strings.
includes/class-customify-fonts-global.php CHANGED
@@ -133,7 +133,7 @@ class Customify_Fonts_Global {
133
  // Add a preconnect links as early as possible for faster external fonts loading.
134
  add_action('wp_head', array( $this, 'add_preconnect_links' ), 0);
135
  wp_register_script( PixCustomifyPlugin()->get_slug() . '-web-font-loader',
136
- plugins_url( 'js/vendor/webfontloader-1-6-28.js', PixCustomifyPlugin()->get_file() ), array(), null, ( 'wp_head' === $load_location ) ? false : true );
137
  add_action('wp_enqueue_scripts', array( $this, 'enqueue_frontend_scripts' ) );
138
  add_action( $load_location, array( $this, 'output_fonts_dynamic_style' ), 100 );
139
 
133
  // Add a preconnect links as early as possible for faster external fonts loading.
134
  add_action('wp_head', array( $this, 'add_preconnect_links' ), 0);
135
  wp_register_script( PixCustomifyPlugin()->get_slug() . '-web-font-loader',
136
+ plugins_url( 'js/vendor/webfontloader-1-6-28.min.js', PixCustomifyPlugin()->get_file() ), array(), null, ( 'wp_head' === $load_location ) ? false : true );
137
  add_action('wp_enqueue_scripts', array( $this, 'enqueue_frontend_scripts' ) );
138
  add_action( $load_location, array( $this, 'output_fonts_dynamic_style' ), 100 );
139
 
includes/class-pixcustomify.php CHANGED
@@ -216,6 +216,8 @@ class PixCustomifyPlugin {
216
 
217
  // Put the current version in the database.
218
  update_option( 'customify_dbversion', $this->get_version(), true );
 
 
219
  }
220
 
221
  /**
216
 
217
  // Put the current version in the database.
218
  update_option( 'customify_dbversion', $this->get_version(), true );
219
+
220
+ $this->invalidate_all_caches();
221
  }
222
 
223
  /**
includes/integrations.php CHANGED
@@ -13,3 +13,8 @@ if ( ! defined( 'ABSPATH' ) ) {
13
 
14
  require_once 'integrations/pixelgrade-care.php';
15
  require_once 'integrations/pixelgrade-assistant.php';
 
 
 
 
 
13
 
14
  require_once 'integrations/pixelgrade-care.php';
15
  require_once 'integrations/pixelgrade-assistant.php';
16
+ require_once 'integrations/autoptimize.php';
17
+ require_once 'integrations/w3-total-cache.php';
18
+ require_once 'integrations/wp-fastest-cache.php';
19
+ require_once 'integrations/wp-optimize.php';
20
+ require_once 'integrations/wp-rocket.php';
includes/integrations/autoptimize.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This is logic for integrating with the Autoptimize plugin.
4
+ *
5
+ * @link https://wordpress.org/plugins/autoptimize/
6
+ *
7
+ * @see https://pixelgrade.com
8
+ * @author Pixelgrade
9
+ * @since 2.7.1
10
+ */
11
+
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit; // Exit if accessed directly
14
+ }
15
+
16
+ // Prevent moving the webfontloader script.
17
+ add_filter( 'autoptimize_filter_js_dontmove', function( $dontmove ) {
18
+ $dontmove[] = 'js/vendor/webfontloader';
19
+
20
+ return $dontmove;
21
+ }, 10, 1 );
22
+
23
+ // Exclude the webfontloader script.
24
+ add_filter( 'autoptimize_filter_js_exclude', function( $excludeJS ) {
25
+ if ( is_string( $excludeJS ) ) {
26
+ $excludeJS .= ',js/vendor/webfontloader';
27
+ } elseif ( is_array( $excludeJS ) ) {
28
+ $excludeJS[] = 'js/vendor/webfontloader';
29
+ }
30
+
31
+ return $excludeJS;
32
+ }, 10, 1 );
includes/integrations/w3-total-cache.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This is logic for integrating with the W3 Total Cache plugin.
4
+ *
5
+ * @link https://wordpress.org/plugins/w3-total-cache/
6
+ *
7
+ * @see https://pixelgrade.com
8
+ * @author Pixelgrade
9
+ * @since 2.7.1
10
+ */
11
+
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit; // Exit if accessed directly
14
+ }
15
+
16
+ // Exclude the webfontloader script and the inline script.
17
+ add_filter( 'w3tc_minify_js_script_tags', function ( $script_tags ) {
18
+ if ( ! empty( $script_tags ) && is_array( $script_tags ) ) {
19
+ $webfontloader_script_url = trailingslashit( dirname( plugin_basename( PixCustomifyPlugin::instance()->get_file() ) ) ) . 'js/vendor/webfontloader';
20
+ $webfontloader_inline_script = 'customifyFontLoader = function()';
21
+ foreach ( $script_tags as $key => $tag ) {
22
+ if ( is_string( $tag ) &&
23
+ ( false !== strpos( $tag, $webfontloader_script_url ) || false !== strpos( $tag, $webfontloader_inline_script ) ) ) {
24
+
25
+ unset( $script_tags[ $key ] );
26
+ }
27
+ }
28
+ }
29
+
30
+ return $script_tags;
31
+ }, 10, 1 );
includes/integrations/wp-fastest-cache.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This is logic for integrating with the WP Fastest Cache plugin.
4
+ *
5
+ * @link https://wordpress.org/plugins/wp-fastest-cache/
6
+ *
7
+ * @see https://pixelgrade.com
8
+ * @author Pixelgrade
9
+ * @since 2.7.1
10
+ */
11
+
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit; // Exit if accessed directly
14
+ }
15
+
16
+ // Try to exclude the webfontloader script by adding a default rule in the plugin options.
17
+ add_filter( 'default_option_WpFastestCacheExclude', function ( $default ) {
18
+ $webfontloader_script_url = trailingslashit( dirname( plugin_basename( PixCustomifyPlugin::instance()->get_file() ) ) ) . 'js/vendor/webfontloader';
19
+ if ( empty( $default ) ) {
20
+ $default = json_encode( [
21
+ [
22
+ 'prefix' => 'contain',
23
+ 'content' => $webfontloader_script_url,
24
+ 'type' => 'js',
25
+ ]
26
+ ] );
27
+ }
28
+
29
+ return $default;
30
+ }, 10, 1 );
includes/integrations/wp-optimize.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This is logic for integrating with the WP-Optimize plugin.
4
+ *
5
+ * @link https://wordpress.org/plugins/wp-optimize/
6
+ *
7
+ * @see https://pixelgrade.com
8
+ * @author Pixelgrade
9
+ * @since 2.7.1
10
+ */
11
+
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit; // Exit if accessed directly
14
+ }
15
+
16
+ // Try to exclude the webfontloader script by adding a default rule in the plugin options.
17
+ // The free version doesn't do minification right now.
includes/integrations/wp-rocket.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This is logic for integrating with the WP-Rocket plugin.
4
+ *
5
+ * @link https://wp-rocket.me/
6
+ *
7
+ * @see https://pixelgrade.com
8
+ * @author Pixelgrade
9
+ * @since 2.7.1
10
+ */
11
+
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit; // Exit if accessed directly
14
+ }
15
+
16
+ // Exclude the webfontloader script and the inline script.
17
+ function customify_wp_rocket_exclude_webfontloader_script( $list ) {
18
+ $list[] = rocket_clean_exclude_file( plugins_url( 'js/vendor/webfontloader-1-6-28.min.js', PixCustomifyPlugin()->get_file() ) );
19
+
20
+ return $list;
21
+ }
22
+ add_filter( 'rocket_exclude_js', 'customify_wp_rocket_exclude_webfontloader_script', 10, 1 );
23
+ add_filter( 'rocket_exclude_defer_js', 'customify_wp_rocket_exclude_webfontloader_script', 10, 1 );
24
+ add_filter( 'rocket_exclude_cache_busting', 'customify_wp_rocket_exclude_webfontloader_script', 10, 1 );
25
+
26
+ add_filter( 'rocket_excluded_inline_js_content', function( $inline_js ) {
27
+ $webfontloader_inline_script = 'customifyFontLoader = function()';
28
+ $inline_js[] = $webfontloader_inline_script;
29
+
30
+ return $inline_js;
31
+ }, 10, 1 );
js/vendor/{webfontloader-1-6-28.js → webfontloader-1-6-28.min.js} RENAMED
File without changes
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: pixelgrade, vlad.olaru, babbardel, razvanonofrei, gorby31
3
  Tags: customizer, css, editor, gutenberg, live, preview, customizer
4
  Requires at least: 4.9.9
5
- Tested up to: 5.4.0
6
- Stable tag: 2.7.0
7
  Requires PHP: 5.4.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -28,6 +28,10 @@ This plugin is **primarily intended** to be used together with [Pixelgrade theme
28
 
29
  == Changelog ==
30
 
 
 
 
 
31
  = 2.7.0 =
32
  * Overall performance improvements, especially on the client-side (JavaScript).
33
  * Overall logic cleanup with a focus on consistency both on the server-side and client-side.
2
  Contributors: pixelgrade, vlad.olaru, babbardel, razvanonofrei, gorby31
3
  Tags: customizer, css, editor, gutenberg, live, preview, customizer
4
  Requires at least: 4.9.9
5
+ Tested up to: 5.4.1
6
+ Stable tag: 2.7.1
7
  Requires PHP: 5.4.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
28
 
29
  == Changelog ==
30
 
31
+ = 2.7.1 =
32
+ * Fixed a couple of inconsistencies related to cache invalidation
33
+ * Added integrations for the main caching plugins to prevent them minifying or moving the Web Font Loader script
34
+
35
  = 2.7.0 =
36
  * Overall performance improvements, especially on the client-side (JavaScript).
37
  * Overall logic cleanup with a focus on consistency both on the server-side and client-side.