Page Builder: PageLayer – Drag and Drop website builder - Version 1.4.5

Version Description

(Jan 27, 2021) = * [Bug-Fix] In some cases, the apply revision was not working properly after the last version. This is fixed. * [Bug-Fix] In some cases, the global widget content was not updated properly. This is fixed.

Download this release

Release Info

Developer pagelayer
Plugin Icon 128x128 Page Builder: PageLayer – Drag and Drop website builder
Version 1.4.5
Comparing to
See all releases

Code changes from version 1.4.4 to 1.4.5

init.php CHANGED
@@ -5,7 +5,7 @@ if (!defined('ABSPATH')) exit;
5
 
6
  define('PAGELAYER_BASE', plugin_basename(PAGELAYER_FILE));
7
  define('PAGELAYER_PRO_BASE', 'pagelayer-pro/pagelayer-pro.php');
8
- define('PAGELAYER_VERSION', '1.4.4');
9
  define('PAGELAYER_DIR', dirname(PAGELAYER_FILE));
10
  define('PAGELAYER_SLUG', 'pagelayer');
11
  define('PAGELAYER_URL', plugins_url('', PAGELAYER_FILE));
@@ -200,7 +200,13 @@ function pagelayer_load_plugin(){
200
  'image' => PAGELAYER_URL.'/images/pagelayer-logo-256.png'
201
  ]);
202
 
203
- }
 
 
 
 
 
 
204
 
205
  // Show the getting started video option
206
  $seen = get_option('pagelayer_getting_started');
5
 
6
  define('PAGELAYER_BASE', plugin_basename(PAGELAYER_FILE));
7
  define('PAGELAYER_PRO_BASE', 'pagelayer-pro/pagelayer-pro.php');
8
+ define('PAGELAYER_VERSION', '1.4.5');
9
  define('PAGELAYER_DIR', dirname(PAGELAYER_FILE));
10
  define('PAGELAYER_SLUG', 'pagelayer');
11
  define('PAGELAYER_URL', plugins_url('', PAGELAYER_FILE));
200
  'image' => PAGELAYER_URL.'/images/pagelayer-logo-256.png'
201
  ]);
202
 
203
+ }
204
+
205
+ // Are we to disable the getting started promo
206
+ if(isset($_GET['pagelayer-getting-started']) && (int)$_GET['pagelayer-getting-started'] == 0){
207
+ update_option('pagelayer_getting_started', time());
208
+ die('DONE');
209
+ }
210
 
211
  // Show the getting started video option
212
  $seen = get_option('pagelayer_getting_started');
js/combined.js CHANGED
@@ -529,9 +529,13 @@ function pagelayer_pl_video(jEle){
529
  if(vidSrc[vidSrc.indexOf('&autoplay=')+10] == 0){
530
  vidElm.removeAttr('autoplay');
531
  vidElm[0].pause();
 
 
 
532
  }
533
  if(vidSrc[vidSrc.indexOf('&mute=')+6] == 1){
534
  vidElm[0].muted = "muted";
 
535
  }
536
  });
537
 
529
  if(vidSrc[vidSrc.indexOf('&autoplay=')+10] == 0){
530
  vidElm.removeAttr('autoplay');
531
  vidElm[0].pause();
532
+ }else if(vidSrc[vidSrc.indexOf('&autoplay=')+10] == 1){
533
+ vidElm.attr('autoplay','');
534
+ vidElm.attr('playsinline','');
535
  }
536
  if(vidSrc[vidSrc.indexOf('&mute=')+6] == 1){
537
  vidElm[0].muted = "muted";
538
+ vidElm.attr('muted','');
539
  }
540
  });
541
 
js/pagelayer-editor.js CHANGED
@@ -3444,20 +3444,20 @@ function pagelayer_sc_render(jEle){
3444
 
3445
  var gEle = pagelayer_ele_by_id(eleId);
3446
  var gId = pagelayer_get_global_id(gEle);
3447
-
 
 
3448
  // If global id exist then update the global array and restup the all global element
3449
  if(!pagelayer_empty(gId) && !pagelayer_empty(pagelayer.global_render)){
3450
  if(!pagelayer_empty(pagelayer_global_widgets[gId])){
3451
- pagelayer_global_widgets[gId].$ = gEle;
3452
  pagelayer_global_widgets[gId]['is_dirty'] = true;
3453
  pagelayer_setup_global_widgets(gId, pagelayer_ele_by_id(eleId), true);
3454
  }else{
3455
  pagelayer_set_atts(gEle, 'global_id', '');
3456
  }
3457
  };
3458
-
3459
- pagelayer_el_dump_data(jEle);
3460
-
3461
  };
3462
 
3463
  // Is the given tag a group
@@ -3665,11 +3665,11 @@ function pagelayer_generate_sc(selector, selfEle){
3665
  // If its a Row or Column or Group then it will have children
3666
  }else if(jEle.hasClass('pagelayer-row') || jEle.hasClass('pagelayer-col') || jEle.hasClass('pagelayer-inner_row') || pagelayer_is_group(tag)){
3667
 
3668
- var sel = "[pagelayer-id="+id+"]";
3669
 
3670
  // Any holder which holds children ?
3671
  if('holder' in pagelayer_shortcodes[tag]){
3672
- sel = sel+' '+pagelayer_shortcodes[tag]['holder'];
3673
  }
3674
 
3675
  // Select the top-most element
3444
 
3445
  var gEle = pagelayer_ele_by_id(eleId);
3446
  var gId = pagelayer_get_global_id(gEle);
3447
+
3448
+ pagelayer_el_dump_data(jEle);
3449
+
3450
  // If global id exist then update the global array and restup the all global element
3451
  if(!pagelayer_empty(gId) && !pagelayer_empty(pagelayer.global_render)){
3452
  if(!pagelayer_empty(pagelayer_global_widgets[gId])){
3453
+ pagelayer_global_widgets[gId].$ = gEle[0].outerHTML;
3454
  pagelayer_global_widgets[gId]['is_dirty'] = true;
3455
  pagelayer_setup_global_widgets(gId, pagelayer_ele_by_id(eleId), true);
3456
  }else{
3457
  pagelayer_set_atts(gEle, 'global_id', '');
3458
  }
3459
  };
3460
+
 
 
3461
  };
3462
 
3463
  // Is the given tag a group
3665
  // If its a Row or Column or Group then it will have children
3666
  }else if(jEle.hasClass('pagelayer-row') || jEle.hasClass('pagelayer-col') || jEle.hasClass('pagelayer-inner_row') || pagelayer_is_group(tag)){
3667
 
3668
+ var sel = jEle;
3669
 
3670
  // Any holder which holds children ?
3671
  if('holder' in pagelayer_shortcodes[tag]){
3672
+ sel = jEle.find(pagelayer_shortcodes[tag]['holder']);
3673
  }
3674
 
3675
  // Select the top-most element
lib/pquery/pQuery.php CHANGED
@@ -54,6 +54,8 @@ class pagelayerQuery implements ArrayAccess, IteratorAggregate, IQuery {
54
  foreach ($this->nodes as $node) {
55
  if ($value === null)
56
  return $node->attr($name);
 
 
57
  $node->attr($name, $value);
58
  }
59
  return $this;
54
  foreach ($this->nodes as $node) {
55
  if ($value === null)
56
  return $node->attr($name);
57
+ $value = str_replace('<', '&lt;', $value);
58
+ $value = str_replace('>', '&gt;', $value);
59
  $node->attr($name, $value);
60
  }
61
  return $this;
main/ajax.php CHANGED
@@ -309,6 +309,7 @@ function pagelayer_save_templ_content($echo = false){
309
 
310
  // Decode base64 data
311
  $value['content'] = base64_decode($value['content']);
 
312
 
313
  $is_xss = pagelayer_xss_content($value['content']);
314
 
@@ -632,6 +633,7 @@ function pagelayer_create_post_autosave(){
632
 
633
  // Decode base64 data
634
  $content = base64_decode($content);
 
635
 
636
  // Are you allowed to edit ?
637
  if(!pagelayer_user_can_edit($postID)){
309
 
310
  // Decode base64 data
311
  $value['content'] = base64_decode($value['content']);
312
+ $value['content'] = wp_slash($value['content']);
313
 
314
  $is_xss = pagelayer_xss_content($value['content']);
315
 
633
 
634
  // Decode base64 data
635
  $content = base64_decode($content);
636
+ $content = wp_slash($content);
637
 
638
  // Are you allowed to edit ?
639
  if(!pagelayer_user_can_edit($postID)){
main/functions.php CHANGED
@@ -585,12 +585,17 @@ function pagelayer_the_content($content, $dump = false){
585
  $content = do_shortcode( $content );
586
 
587
  if($dump){
588
- preg_match_all('/pagelayer-id="(.*?)"/', $content, $matches);
589
- $matches = array_unique($matches[1]);
590
 
591
- foreach($matches as $id){
 
 
 
 
 
 
592
  $data_attr = '<!-- '.pagelayer_serialize_attributes($pagelayer->data_attr[$id]).' -->';
593
- $content = preg_replace('/<div ([^>]*)pagelayer-id="'.preg_quote($id).'"([^>]*)>/is', '<div ${1}pagelayer-id="'.$id.'"${2}>'. $data_attr, $content);
594
  }
595
  }
596
 
@@ -1113,12 +1118,6 @@ function pagelayer_getting_started_notice(){
1113
  return;
1114
  }
1115
 
1116
- // Are we to disable the promo
1117
- if(isset($_GET['pagelayer-getting-started']) && (int)$_GET['pagelayer-getting-started'] == 0){
1118
- update_option('pagelayer_getting_started', time());
1119
- die('DONE');
1120
- }
1121
-
1122
  echo '
1123
  <script type="application/javascript">
1124
  jQuery(document).ready(function(){
@@ -2798,7 +2797,7 @@ function pagelayer_captcha_verify(){
2798
 
2799
  // Pagelayer serialize attributes
2800
  function pagelayer_serialize_attributes( $block_attributes ) {
2801
- $encoded_attributes = json_encode( $block_attributes );
2802
  $encoded_attributes = preg_replace( '/--/', '\\u002d\\u002d', $encoded_attributes );
2803
  $encoded_attributes = preg_replace( '/</', '\\u003c', $encoded_attributes );
2804
  $encoded_attributes = preg_replace( '/>/', '\\u003e', $encoded_attributes );
585
  $content = do_shortcode( $content );
586
 
587
  if($dump){
588
+ preg_match_all('/<div ([^>]*)pagelayer-id="([^"]*)"([^>]*)>/', $content, $matches);
 
589
 
590
+ foreach($matches[0] as $k => $div){
591
+ $id = $matches[2][$k];
592
+
593
+ if(empty($pagelayer->data_attr[$id])){
594
+ continue;
595
+ }
596
+
597
  $data_attr = '<!-- '.pagelayer_serialize_attributes($pagelayer->data_attr[$id]).' -->';
598
+ $content = str_replace($div, $div.$data_attr, $content);
599
  }
600
  }
601
 
1118
  return;
1119
  }
1120
 
 
 
 
 
 
 
1121
  echo '
1122
  <script type="application/javascript">
1123
  jQuery(document).ready(function(){
2797
 
2798
  // Pagelayer serialize attributes
2799
  function pagelayer_serialize_attributes( $block_attributes ) {
2800
+ $encoded_attributes = json_encode( $block_attributes, JSON_FORCE_OBJECT);
2801
  $encoded_attributes = preg_replace( '/--/', '\\u002d\\u002d', $encoded_attributes );
2802
  $encoded_attributes = preg_replace( '/</', '\\u003c', $encoded_attributes );
2803
  $encoded_attributes = preg_replace( '/>/', '\\u003e', $encoded_attributes );
main/shortcode_functions.php CHANGED
@@ -639,15 +639,12 @@ function pagelayer_render_shortcode($atts, $content = '', $tag = '', $inner_bloc
639
  function pagelayer_change_id($content){
640
  global $pagelayer;
641
 
642
- if(pagelayer_is_live()){
643
-
644
- preg_match_all('/pagelayer-id="(.*?)"/', $content, $matches);
645
- $matches = array_unique($matches[1]);
646
 
647
- foreach($matches as $val){
648
- $id = pagelayer_create_id();
649
- $content = str_replace($val, $id, $content);
650
- }
651
  }
652
 
653
  return $content;
639
  function pagelayer_change_id($content){
640
  global $pagelayer;
641
 
642
+ preg_match_all('/pagelayer-id="(.*?)"/', $content, $matches);
643
+ $matches = array_unique($matches[1]);
 
 
644
 
645
+ foreach($matches as $val){
646
+ $id = pagelayer_create_id();
647
+ $content = str_replace($val, $id, $content);
 
648
  }
649
 
650
  return $content;
main/template.php CHANGED
@@ -811,7 +811,7 @@ function pagelayer_builder_template_redirect(){
811
 
812
  // If there is a match for a popup, get all ids with priority
813
  $pagelayer->template_popup_ids = pagelayer_builder_try_to_apply('popup', true);
814
-
815
  // Return all the posts
816
  //return $query['posts'];
817
 
@@ -820,6 +820,8 @@ function pagelayer_builder_template_redirect(){
820
 
821
  // Add the filter again
822
  add_filter('template_include', 'pagelayer_template_include', 1000, 1);
 
 
823
 
824
  }
825
 
811
 
812
  // If there is a match for a popup, get all ids with priority
813
  $pagelayer->template_popup_ids = pagelayer_builder_try_to_apply('popup', true);
814
+
815
  // Return all the posts
816
  //return $query['posts'];
817
 
820
 
821
  // Add the filter again
822
  add_filter('template_include', 'pagelayer_template_include', 1000, 1);
823
+
824
+ do_action('pagelayer_builder_template_redirect');
825
 
826
  }
827
 
pagelayer.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: PageLayer
4
  Plugin URI: http://wordpress.org/plugins/pagelayer/
5
  Description: PageLayer is a WordPress page builder plugin. Its very easy to use and very light on the browser.
6
- Version: 1.4.4
7
  Author: Pagelayer Team
8
  Author URI: https://pagelayer.com/
9
  License: LGPL v2.1
3
  Plugin Name: PageLayer
4
  Plugin URI: http://wordpress.org/plugins/pagelayer/
5
  Description: PageLayer is a WordPress page builder plugin. Its very easy to use and very light on the browser.
6
+ Version: 1.4.5
7
  Author: Pagelayer Team
8
  Author URI: https://pagelayer.com/
9
  License: LGPL v2.1
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: page builder, editor, landing page, drag-and-drop, pagelayer, form-builder
4
  Requires at least: 4.7
5
  Tested up to: 5.6
6
  Requires PHP: 5.5
7
- Stable tag: 1.4.4
8
  License: LGPL v2.1
9
  License URI: http://www.gnu.org/licenses/lgpl-2.1.html
10
 
@@ -109,6 +109,10 @@ Do you have questions related to PageLayer ? Use the following links :
109
 
110
  == Changelog ==
111
 
 
 
 
 
112
  = 1.4.4 (Jan 22, 2021) =
113
  * [Feature] Added the option to revert a setting to the default.
114
  * [Feature] Added All Archive type for all registered posts for Pagelayer Templates.
4
  Requires at least: 4.7
5
  Tested up to: 5.6
6
  Requires PHP: 5.5
7
+ Stable tag: 1.4.5
8
  License: LGPL v2.1
9
  License URI: http://www.gnu.org/licenses/lgpl-2.1.html
10
 
109
 
110
  == Changelog ==
111
 
112
+ = 1.4.5 (Jan 27, 2021) =
113
+ * [Bug-Fix] In some cases, the apply revision was not working properly after the last version. This is fixed.
114
+ * [Bug-Fix] In some cases, the global widget content was not updated properly. This is fixed.
115
+
116
  = 1.4.4 (Jan 22, 2021) =
117
  * [Feature] Added the option to revert a setting to the default.
118
  * [Feature] Added All Archive type for all registered posts for Pagelayer Templates.