Brizy – Page Builder - Version 1.0.108

Version Description

  • 2019-12-18 =
  • Fixed: Editor config cache
  • Fixed: Compilation and save post
Download this release

Release Info

Developer themefusecom
Plugin Icon 128x128 Brizy – Page Builder
Version 1.0.108
Comparing to
See all releases

Code changes from version 1.0.107 to 1.0.108

README.md CHANGED
@@ -3,7 +3,7 @@ Contributors: themefuse<br>
3
  Requires at least: 4.5<br>
4
  Tested up to: 5.2.3<br>
5
  Requires PHP: 5.6<br>
6
- Stable tag: 1.0.107<br>
7
  License: GPLv3<br>
8
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -118,6 +118,10 @@ $bodyHtml = apply_filters( 'brizy_content', $html->get_body(), Brizy_Editor_Proj
118
 
119
  ## Changelog
120
 
 
 
 
 
121
  ### 1.0.107 - 2019-12-11 ###
122
  * Fixed: Compile if there is no autosave post on vew page
123
 
3
  Requires at least: 4.5<br>
4
  Tested up to: 5.2.3<br>
5
  Requires PHP: 5.6<br>
6
+ Stable tag: 1.0.108<br>
7
  License: GPLv3<br>
8
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
9
 
118
 
119
  ## Changelog
120
 
121
+ ### 1.0.108 - 2019-12-18 ###
122
+ * Fixed: Editor config cache
123
+ * Fixed: Compilation and save post
124
+
125
  ### 1.0.107 - 2019-12-11 ###
126
  * Fixed: Compile if there is no autosave post on vew page
127
 
admin/popups/main.php CHANGED
@@ -26,7 +26,7 @@ class Brizy_Admin_Popups_Main {
26
  }
27
 
28
  public function initialize() {
29
- add_filter( 'brizy_content', array( $this, 'insertPopupsHtml' ), -999999, 4 );
30
  add_action( 'brizy_after_enabled_for_post', array( $this, 'afterBrizyEnabledForPopup' ) );
31
 
32
  if ( is_admin() ) {
@@ -74,7 +74,7 @@ class Brizy_Admin_Popups_Main {
74
  'has_archive' => false,
75
  'description' => __( 'Popups', 'brizy' ),
76
  'publicly_queryable' => Brizy_Editor::is_user_allowed(),
77
- 'show_ui' => defined('BRIZY_PRO_VERSION'),
78
  'show_in_menu' => Brizy_Admin_Settings::menu_slug(),
79
  'query_var' => false,
80
  'rewrite' => array( 'slug' => 'brizy-popup' ),
@@ -119,6 +119,16 @@ class Brizy_Admin_Popups_Main {
119
  $popups = $this->getMatchingBrizyPopups();
120
 
121
  foreach ( $popups as $brizyPopup ) {
 
 
 
 
 
 
 
 
 
 
122
  $compiledPage = $brizyPopup->get_compiled_page();
123
 
124
  if ( $context == 'document' ) {
@@ -167,7 +177,7 @@ class Brizy_Admin_Popups_Main {
167
  * @throws Brizy_Editor_Exceptions_NotFound
168
  */
169
  public function getMatchingBrizyPopups() {
170
- list( $applyFor, $entityType, $entityValues ) = Brizy_Admin_Rules_Manager::getCurrentPageGroupAndType();
171
 
172
  return $this->findMatchingPopups( $applyFor, $entityType, $entityValues );
173
  }
26
  }
27
 
28
  public function initialize() {
29
+ add_filter( 'brizy_content', array( $this, 'insertPopupsHtml' ), - 999999, 4 );
30
  add_action( 'brizy_after_enabled_for_post', array( $this, 'afterBrizyEnabledForPopup' ) );
31
 
32
  if ( is_admin() ) {
74
  'has_archive' => false,
75
  'description' => __( 'Popups', 'brizy' ),
76
  'publicly_queryable' => Brizy_Editor::is_user_allowed(),
77
+ 'show_ui' => defined( 'BRIZY_PRO_VERSION' ),
78
  'show_in_menu' => Brizy_Admin_Settings::menu_slug(),
79
  'query_var' => false,
80
  'rewrite' => array( 'slug' => 'brizy-popup' ),
119
  $popups = $this->getMatchingBrizyPopups();
120
 
121
  foreach ( $popups as $brizyPopup ) {
122
+ /**
123
+ * @var Brizy_Editor_Post $brizyPopup ;
124
+ */
125
+
126
+ if ( $brizyPopup->get_needs_compile() ) {
127
+ $brizyPopup->compile_page();
128
+ $brizyPopup->save();
129
+ $brizyPopup->save_wp_post();
130
+ }
131
+
132
  $compiledPage = $brizyPopup->get_compiled_page();
133
 
134
  if ( $context == 'document' ) {
177
  * @throws Brizy_Editor_Exceptions_NotFound
178
  */
179
  public function getMatchingBrizyPopups() {
180
+ list( $applyFor, $entityType, $entityValues ) = Brizy_Admin_Rules_Manager::getCurrentPageGroupAndTypeForPopoup();
181
 
182
  return $this->findMatchingPopups( $applyFor, $entityType, $entityValues );
183
  }
admin/rules/manager.php CHANGED
@@ -50,6 +50,55 @@ class Brizy_Admin_Rules_Manager {
50
  return array( $applyFor, $entityType, $entityValues );
51
  }
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  /**
54
  * @param $entities
55
  *
50
  return array( $applyFor, $entityType, $entityValues );
51
  }
52
 
53
+ /**
54
+ * @return array|null
55
+ */
56
+ static function getCurrentPageGroupAndTypeForPopoup() {
57
+ global $wp_query;
58
+
59
+ if ( ! isset( $wp_query ) || is_admin() ) {
60
+ return null;
61
+ }
62
+
63
+ $applyFor = Brizy_Admin_Rule::TEMPLATE;
64
+ $entityType = null;
65
+ $entityValues = array();
66
+
67
+ /* if ( is_404() ) {
68
+ $applyFor = Brizy_Admin_Rule::TEMPLATE;
69
+ $entityType = '404';
70
+ } elseif ( is_author() ) {
71
+ $applyFor = Brizy_Admin_Rule::TEMPLATE;
72
+ $entityType = 'author';
73
+ } elseif ( is_search() ) {
74
+ $applyFor = Brizy_Admin_Rule::TEMPLATE;
75
+ $entityType = 'search';
76
+ } elseif ( is_front_page() ) {
77
+ $applyFor = Brizy_Admin_Rule::TEMPLATE;
78
+ $entityType = 'front_page';
79
+ } elseif ( is_home() ) {
80
+ $applyFor = Brizy_Admin_Rule::TEMPLATE;
81
+ $entityType = 'home_page';
82
+ } else*/
83
+
84
+ if ( is_category() || is_tag() || is_tax() ) {
85
+ $applyFor = Brizy_Admin_Rule::TAXONOMY;
86
+ $entityType = $wp_query->queried_object->taxonomy;
87
+ $entityValues[] = $wp_query->queried_object_id;
88
+ } elseif ( is_archive() ) {
89
+ $applyFor = Brizy_Admin_Rule::ARCHIVE;
90
+ if ( $wp_query->queried_object ) {
91
+ $entityType = $wp_query->queried_object->name;
92
+ }
93
+ } elseif ( ( $wp_query->queried_object instanceof WP_Post || $wp_query->post instanceof WP_Post ) && get_queried_object() ) {
94
+ $applyFor = Brizy_Admin_Rule::POSTS;
95
+ $entityType = get_queried_object()->post_type;
96
+ $entityValues[] = get_queried_object_id();
97
+ }
98
+
99
+ return array( $applyFor, $entityType, $entityValues );
100
+ }
101
+
102
  /**
103
  * @param $entities
104
  *
brizy.php CHANGED
@@ -5,7 +5,7 @@
5
  * Plugin URI: https://brizy.io/
6
  * Author: Brizy.io
7
  * Author URI: https://brizy.io/
8
- * Version: 1.0.107
9
  * Text Domain: brizy
10
  * License: GPLv3
11
  * Domain Path: /languages
@@ -19,7 +19,7 @@ if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && stripos( $_SERVER['HTTP_X_FO
19
 
20
  define( 'BRIZY_DEVELOPMENT', false );
21
  define( 'BRIZY_LOG', false );
22
- define( 'BRIZY_VERSION', '1.0.107' );
23
  define( 'BRIZY_EDITOR_VERSION', '125' );
24
  define( 'BRIZY_FILE', __FILE__ );
25
  define( 'BRIZY_PLUGIN_BASE', plugin_basename( BRIZY_FILE ) );
5
  * Plugin URI: https://brizy.io/
6
  * Author: Brizy.io
7
  * Author URI: https://brizy.io/
8
+ * Version: 1.0.108
9
  * Text Domain: brizy
10
  * License: GPLv3
11
  * Domain Path: /languages
19
 
20
  define( 'BRIZY_DEVELOPMENT', false );
21
  define( 'BRIZY_LOG', false );
22
+ define( 'BRIZY_VERSION', '1.0.108' );
23
  define( 'BRIZY_EDITOR_VERSION', '125' );
24
  define( 'BRIZY_FILE', __FILE__ );
25
  define( 'BRIZY_PLUGIN_BASE', plugin_basename( BRIZY_FILE ) );
editor/editor/editor.php CHANGED
@@ -35,11 +35,12 @@ class Brizy_Editor_Editor_Editor {
35
  */
36
  public static function get( Brizy_Editor_Project $project, Brizy_Editor_Post $post ) {
37
 
38
- if ( self::$insance ) {
39
- return self::$insance;
 
40
  }
41
 
42
- return self::$insance = new self( $project, $post );
43
  }
44
 
45
  /**
@@ -59,8 +60,9 @@ class Brizy_Editor_Editor_Editor {
59
  */
60
  public function config() {
61
 
62
- if ( self::$config ) {
63
- return self::$config;
 
64
  }
65
 
66
  global $wp_registered_sidebars;
@@ -79,7 +81,6 @@ class Brizy_Editor_Editor_Editor {
79
  $isTemplate = $parent_post_type === Brizy_Admin_Templates::CP_TEMPLATE;
80
  $isPopup = $parent_post_type === Brizy_Admin_Popups_Main::CP_POPUP;
81
 
82
-
83
  $config = array(
84
  'user' => array( 'role' => 'admin' ),
85
  'project' => array(
@@ -202,7 +203,7 @@ class Brizy_Editor_Editor_Editor {
202
  'editorVersion' => BRIZY_EDITOR_VERSION
203
  );
204
 
205
- return self::$config = apply_filters( 'brizy_editor_config', $config );
206
  }
207
 
208
  /**
@@ -282,8 +283,7 @@ class Brizy_Editor_Editor_Editor {
282
  $rule = null;
283
 
284
 
285
- if(!function_exists('addQueryStringToUrl'))
286
- {
287
  function addQueryStringToUrl( $link, $query ) {
288
  $parsedUrl = parse_url( $link );
289
  $separator = ( ! isset( $parsedUrl['query'] ) || $parsedUrl['query'] == null ) ? '?' : '&';
35
  */
36
  public static function get( Brizy_Editor_Project $project, Brizy_Editor_Post $post ) {
37
 
38
+ $postId = $post && $post->get_id() ? $post->get_id() : 0;
39
+ if ( isset( self::$insance[ $postId ] ) ) {
40
+ return self::$insance[ $postId ];
41
  }
42
 
43
+ return self::$insance[ $postId ] = new self( $project, $post );
44
  }
45
 
46
  /**
60
  */
61
  public function config() {
62
 
63
+ $cachePostId = $this->post ? $this->post->get_id() : 0;
64
+ if ( isset( self::$config[ $cachePostId ] ) ) {
65
+ return self::$config[ $cachePostId ];
66
  }
67
 
68
  global $wp_registered_sidebars;
81
  $isTemplate = $parent_post_type === Brizy_Admin_Templates::CP_TEMPLATE;
82
  $isPopup = $parent_post_type === Brizy_Admin_Popups_Main::CP_POPUP;
83
 
 
84
  $config = array(
85
  'user' => array( 'role' => 'admin' ),
86
  'project' => array(
203
  'editorVersion' => BRIZY_EDITOR_VERSION
204
  );
205
 
206
+ return self::$config[ $cachePostId ] = apply_filters( 'brizy_editor_config', $config );
207
  }
208
 
209
  /**
283
  $rule = null;
284
 
285
 
286
+ if ( ! function_exists( 'addQueryStringToUrl' ) ) {
 
287
  function addQueryStringToUrl( $link, $query ) {
288
  $parsedUrl = parse_url( $link );
289
  $separator = ( ! isset( $parsedUrl['query'] ) || $parsedUrl['query'] == null ) ? '?' : '&';
editor/post.php CHANGED
@@ -437,7 +437,7 @@ class Brizy_Editor_Post extends Brizy_Admin_Serializable {
437
 
438
  $params = array(
439
  'ID' => $this->get_parent_id(),
440
- 'post_content' => $brizy_compiled_page->get_body()
441
  );
442
 
443
  if ( $can_publish ) {
437
 
438
  $params = array(
439
  'ID' => $this->get_parent_id(),
440
+ 'post_content' => $brizy_compiled_page->get_body() . '<div class="brz-root__container"></div>'
441
  );
442
 
443
  if ( $can_publish ) {
public/main.php CHANGED
@@ -344,7 +344,7 @@ class Brizy_Public_Main {
344
 
345
  $params['content'] = $compiled_html_head;
346
  } else {
347
- $compiled_page = $this->post->get_compiled_page();
348
  $head = $compiled_page->get_head();
349
  $params['content'] = $head;
350
  }
@@ -367,7 +367,8 @@ class Brizy_Public_Main {
367
 
368
  global $post;
369
 
370
- if ( false === strpos( $content, 'brz-root__container' ) || ( $post && $post->ID !== $this->post->get_parent_id() ) ) {
 
371
  return $content;
372
  }
373
 
344
 
345
  $params['content'] = $compiled_html_head;
346
  } else {
347
+ $compiled_page = $this->post->get_compiled_page();
348
  $head = $compiled_page->get_head();
349
  $params['content'] = $head;
350
  }
367
 
368
  global $post;
369
 
370
+ if ( false === strpos( $content, 'brz-root__container' ) ||
371
+ ( $post && $post->ID !== $this->post->get_parent_id() ) ) {
372
  return $content;
373
  }
374
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: brizy, page builder, editor, visual editor, unyson, wysiwyg, landing page,
4
  Requires at least: 4.5
5
  Tested up to: 5.2.3
6
  Requires PHP: 5.6
7
- Stable tag: 1.0.107
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -139,6 +139,10 @@ The progress you're making while building your page is always backed up in the c
139
 
140
  == Changelog ==
141
 
 
 
 
 
142
  = 1.0.107 - 2019-12-11 =
143
  * Fixed: Compile if there is no autosave post on vew page
144
 
4
  Requires at least: 4.5
5
  Tested up to: 5.2.3
6
  Requires PHP: 5.6
7
+ Stable tag: 1.0.108
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
139
 
140
  == Changelog ==
141
 
142
+ = 1.0.108 - 2019-12-18 =
143
+ * Fixed: Editor config cache
144
+ * Fixed: Compilation and save post
145
+
146
  = 1.0.107 - 2019-12-11 =
147
  * Fixed: Compile if there is no autosave post on vew page
148
 
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitd34042fae96051e0b41eea856ce23368::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInite587bba7bc7461474e908cd0f5fd4806::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitd34042fae96051e0b41eea856ce23368
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInitd34042fae96051e0b41eea856ce23368
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitd34042fae96051e0b41eea856ce23368', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitd34042fae96051e0b41eea856ce23368', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInitd34042fae96051e0b41eea856ce23368::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
@@ -48,19 +48,19 @@ class ComposerAutoloaderInitd34042fae96051e0b41eea856ce23368
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
- $includeFiles = Composer\Autoload\ComposerStaticInitd34042fae96051e0b41eea856ce23368::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
- composerRequired34042fae96051e0b41eea856ce23368($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
- function composerRequired34042fae96051e0b41eea856ce23368($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInite587bba7bc7461474e908cd0f5fd4806
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInite587bba7bc7461474e908cd0f5fd4806', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInite587bba7bc7461474e908cd0f5fd4806', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInite587bba7bc7461474e908cd0f5fd4806::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
+ $includeFiles = Composer\Autoload\ComposerStaticInite587bba7bc7461474e908cd0f5fd4806::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
+ composerRequiree587bba7bc7461474e908cd0f5fd4806($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
+ function composerRequiree587bba7bc7461474e908cd0f5fd4806($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInitd34042fae96051e0b41eea856ce23368
8
  {
9
  public static $files = array (
10
  '8ec4222c68e580a23520eef4abe4380f' => __DIR__ . '/..' . '/shortpixel/shortpixel-php/lib/ShortPixel.php',
@@ -52,9 +52,9 @@ class ComposerStaticInitd34042fae96051e0b41eea856ce23368
52
  public static function getInitializer(ClassLoader $loader)
53
  {
54
  return \Closure::bind(function () use ($loader) {
55
- $loader->prefixLengthsPsr4 = ComposerStaticInitd34042fae96051e0b41eea856ce23368::$prefixLengthsPsr4;
56
- $loader->prefixDirsPsr4 = ComposerStaticInitd34042fae96051e0b41eea856ce23368::$prefixDirsPsr4;
57
- $loader->prefixesPsr0 = ComposerStaticInitd34042fae96051e0b41eea856ce23368::$prefixesPsr0;
58
 
59
  }, null, ClassLoader::class);
60
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInite587bba7bc7461474e908cd0f5fd4806
8
  {
9
  public static $files = array (
10
  '8ec4222c68e580a23520eef4abe4380f' => __DIR__ . '/..' . '/shortpixel/shortpixel-php/lib/ShortPixel.php',
52
  public static function getInitializer(ClassLoader $loader)
53
  {
54
  return \Closure::bind(function () use ($loader) {
55
+ $loader->prefixLengthsPsr4 = ComposerStaticInite587bba7bc7461474e908cd0f5fd4806::$prefixLengthsPsr4;
56
+ $loader->prefixDirsPsr4 = ComposerStaticInite587bba7bc7461474e908cd0f5fd4806::$prefixDirsPsr4;
57
+ $loader->prefixesPsr0 = ComposerStaticInite587bba7bc7461474e908cd0f5fd4806::$prefixesPsr0;
58
 
59
  }, null, ClassLoader::class);
60
  }