Version Description
Current Version of Popup Builder is 3.7
Download this release
Release Info
Developer | Sygnoos |
Plugin | Popup Builder – Responsive WordPress Pop up |
Version | 3.7 |
Comparing to | |
See all releases |
Code changes from version 3.69.6 to 3.7
- com/classes/Actions.php +12 -2
- com/classes/Ajax.php +5 -0
- com/classes/Filters.php +8 -0
- com/classes/PopupChecker.php +8 -0
- com/config/configPackage.php +1 -1
- com/config/dataConfig.php +1 -1
- com/helpers/AdminHelper.php +16 -16
- com/helpers/ConfigDataHelper.php +1 -0
- popup-builder.php +1 -1
- public/js/PopupBuilder.js +2 -4
- public/js/PopupConfig.js +16 -6
- readme.txt +8 -3
com/classes/Actions.php
CHANGED
@@ -818,6 +818,7 @@ class Actions
|
|
818 |
|
819 |
public function savePost($postId = 0, $post = array(), $update = false)
|
820 |
{
|
|
|
821 |
Functions::clearAllTransients();
|
822 |
$postData = SGPopup::parsePopupDataFromData($_POST);
|
823 |
$saveMode = '';
|
@@ -865,6 +866,10 @@ class Actions
|
|
865 |
}
|
866 |
/* In preview mode saveMode should be true*/
|
867 |
if ((!empty($post) && $post->post_type == SG_POPUP_POST_TYPE) || $saveMode || (empty($post) && !$saveMode)) {
|
|
|
|
|
|
|
|
|
868 |
if (!empty($postData['sgpb-type'])) {
|
869 |
$popupType = $postData['sgpb-type'];
|
870 |
$popupClassName = SGPopup::getPopupClassNameFormType($popupType);
|
@@ -1208,6 +1213,12 @@ class Actions
|
|
1208 |
if (!$allowToAction) {
|
1209 |
return false;
|
1210 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1211 |
$query = AdminHelper::subscribersRelatedQuery();
|
1212 |
if (isset($_GET['orderby']) && !empty($_GET['orderby'])) {
|
1213 |
if (isset($_GET['order']) && !empty($_GET['order'])) {
|
@@ -1275,8 +1286,7 @@ class Actions
|
|
1275 |
$allowToAction = AdminHelper::userCanAccessTo();
|
1276 |
if (!$allowToAction) {
|
1277 |
wp_redirect(get_home_url());
|
1278 |
-
|
1279 |
-
return false;
|
1280 |
}
|
1281 |
|
1282 |
$postData = $_POST;
|
818 |
|
819 |
public function savePost($postId = 0, $post = array(), $update = false)
|
820 |
{
|
821 |
+
$allowToAction = AdminHelper::userCanAccessTo();
|
822 |
Functions::clearAllTransients();
|
823 |
$postData = SGPopup::parsePopupDataFromData($_POST);
|
824 |
$saveMode = '';
|
866 |
}
|
867 |
/* In preview mode saveMode should be true*/
|
868 |
if ((!empty($post) && $post->post_type == SG_POPUP_POST_TYPE) || $saveMode || (empty($post) && !$saveMode)) {
|
869 |
+
if (!$allowToAction) {
|
870 |
+
wp_redirect(get_home_url());
|
871 |
+
exit();
|
872 |
+
}
|
873 |
if (!empty($postData['sgpb-type'])) {
|
874 |
$popupType = $postData['sgpb-type'];
|
875 |
$popupClassName = SGPopup::getPopupClassNameFormType($popupType);
|
1213 |
if (!$allowToAction) {
|
1214 |
return false;
|
1215 |
}
|
1216 |
+
|
1217 |
+
$allowToAction = AdminHelper::userCanAccessTo();
|
1218 |
+
if (!$allowToAction) {
|
1219 |
+
wp_redirect(get_home_url());
|
1220 |
+
exit();
|
1221 |
+
}
|
1222 |
$query = AdminHelper::subscribersRelatedQuery();
|
1223 |
if (isset($_GET['orderby']) && !empty($_GET['orderby'])) {
|
1224 |
if (isset($_GET['order']) && !empty($_GET['order'])) {
|
1286 |
$allowToAction = AdminHelper::userCanAccessTo();
|
1287 |
if (!$allowToAction) {
|
1288 |
wp_redirect(get_home_url());
|
1289 |
+
exit();
|
|
|
1290 |
}
|
1291 |
|
1292 |
$postData = $_POST;
|
com/classes/Ajax.php
CHANGED
@@ -352,6 +352,11 @@ class Ajax
|
|
352 |
|
353 |
public function sendNewsletter()
|
354 |
{
|
|
|
|
|
|
|
|
|
|
|
355 |
check_ajax_referer(SG_AJAX_NONCE, 'nonce');
|
356 |
global $wpdb;
|
357 |
|
352 |
|
353 |
public function sendNewsletter()
|
354 |
{
|
355 |
+
$allowToAction = AdminHelper::userCanAccessTo();
|
356 |
+
if (!$allowToAction) {
|
357 |
+
wp_redirect(get_home_url());
|
358 |
+
exit();
|
359 |
+
}
|
360 |
check_ajax_referer(SG_AJAX_NONCE, 'nonce');
|
361 |
global $wpdb;
|
362 |
|
com/classes/Filters.php
CHANGED
@@ -649,6 +649,14 @@ class Filters
|
|
649 |
}
|
650 |
}
|
651 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
652 |
|
653 |
return $previewLink;
|
654 |
}
|
649 |
}
|
650 |
}
|
651 |
}
|
652 |
+
if (strpos($targetData['param'], '_archive') && !empty($targetData['value'])) {
|
653 |
+
$value = array_keys($targetData['value']);
|
654 |
+
if (!empty($value[0])) {
|
655 |
+
if (get_permalink($value[0])) {
|
656 |
+
return get_permalink($value[0]);
|
657 |
+
}
|
658 |
+
}
|
659 |
+
}
|
660 |
|
661 |
return $previewLink;
|
662 |
}
|
com/classes/PopupChecker.php
CHANGED
@@ -324,6 +324,14 @@ class PopupChecker
|
|
324 |
$isSatisfy = true;
|
325 |
}
|
326 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
327 |
else if (strpos($targetData['param'], '_selected')) {
|
328 |
$values = array();
|
329 |
|
324 |
$isSatisfy = true;
|
325 |
}
|
326 |
}
|
327 |
+
else if (strpos($targetData['param'], '_archive')) {
|
328 |
+
$currentPostType = get_post_type();
|
329 |
+
if ($targetData['param'] == $currentPostType.'_archive') {
|
330 |
+
if (is_post_type_archive($currentPostType)) {
|
331 |
+
$isSatisfy = true;
|
332 |
+
}
|
333 |
+
}
|
334 |
+
}
|
335 |
else if (strpos($targetData['param'], '_selected')) {
|
336 |
$values = array();
|
337 |
|
com/config/configPackage.php
CHANGED
@@ -3,6 +3,6 @@ if (!defined('ABSPATH')) {
|
|
3 |
exit();
|
4 |
}
|
5 |
|
6 |
-
define('SG_POPUP_VERSION', '3.
|
7 |
define('SGPB_POPUP_PKG', SGPB_POPUP_PKG_FREE);
|
8 |
define('POPUP_BUILDER_BASENAME', 'popupbuilder-platinum/popup-builder.php');
|
3 |
exit();
|
4 |
}
|
5 |
|
6 |
+
define('SG_POPUP_VERSION', '3.7.0');
|
7 |
define('SGPB_POPUP_PKG', SGPB_POPUP_PKG_FREE);
|
8 |
define('POPUP_BUILDER_BASENAME', 'popupbuilder-platinum/popup-builder.php');
|
com/config/dataConfig.php
CHANGED
@@ -273,7 +273,7 @@ class SgpbDataConfig
|
|
273 |
);
|
274 |
|
275 |
$eventsInitialData = array(
|
276 |
-
array('param' => 'load', 'value' => '')
|
277 |
);
|
278 |
|
279 |
$eventsAttrs = array(
|
273 |
);
|
274 |
|
275 |
$eventsInitialData = array(
|
276 |
+
array('param' => 'load', 'value' => '', 'hiddenOption' => array())
|
277 |
);
|
278 |
|
279 |
$eventsAttrs = array(
|
com/helpers/AdminHelper.php
CHANGED
@@ -465,18 +465,7 @@ class AdminHelper
|
|
465 |
|
466 |
public static function showMenuForCurrentUser()
|
467 |
{
|
468 |
-
|
469 |
-
return true;
|
470 |
-
}
|
471 |
-
|
472 |
-
$savedUserRoles = self::getPopupPostAllowedUserRoles();
|
473 |
-
$currentUserRole = self::getCurrentUserRole();
|
474 |
-
$userSavedRoles = get_option('sgpb-user-roles');
|
475 |
-
if (!is_array($savedUserRoles) || !is_array($currentUserRole) || empty($userSavedRoles)) {
|
476 |
-
return true;
|
477 |
-
}
|
478 |
-
|
479 |
-
return array_intersect($currentUserRole, $savedUserRoles);
|
480 |
}
|
481 |
|
482 |
public static function getPopupsIdAndTitle($excludesPopups = array())
|
@@ -1957,12 +1946,23 @@ class AdminHelper
|
|
1957 |
// checking user roles capability to do actions
|
1958 |
public static function userCanAccessTo()
|
1959 |
{
|
1960 |
-
// if
|
1961 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1962 |
$currentUserRole = self::getCurrentUserRole();
|
1963 |
-
|
1964 |
-
|
|
|
|
|
|
|
1965 |
}
|
|
|
|
|
1966 |
}
|
1967 |
|
1968 |
public static function filterUserCapabilitiesForTheUserRoles($hook = 'save')
|
465 |
|
466 |
public static function showMenuForCurrentUser()
|
467 |
{
|
468 |
+
return self::userCanAccessTo();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
469 |
}
|
470 |
|
471 |
public static function getPopupsIdAndTitle($excludesPopups = array())
|
1946 |
// checking user roles capability to do actions
|
1947 |
public static function userCanAccessTo()
|
1948 |
{
|
1949 |
+
// if this is not admin side screen we don't need to check roles and capabilities
|
1950 |
+
if (!is_admin()) {
|
1951 |
+
return true;
|
1952 |
+
}
|
1953 |
+
|
1954 |
+
$allow = false;
|
1955 |
+
|
1956 |
+
$savedUserRolesInPopup = self::getPopupPostAllowedUserRoles();
|
1957 |
$currentUserRole = self::getCurrentUserRole();
|
1958 |
+
|
1959 |
+
// we need to check if there are any intersections between saved user roles and current user
|
1960 |
+
$hasIntersection = array_intersect($currentUserRole, $savedUserRolesInPopup);
|
1961 |
+
if (!empty($hasIntersection)) {
|
1962 |
+
$allow = true;
|
1963 |
}
|
1964 |
+
|
1965 |
+
return $allow;
|
1966 |
}
|
1967 |
|
1968 |
public static function filterUserCapabilitiesForTheUserRoles($hook = 'save')
|
com/helpers/ConfigDataHelper.php
CHANGED
@@ -73,6 +73,7 @@ class ConfigDataHelper
|
|
73 |
foreach ($allCustomPostTypes as $customPostType) {
|
74 |
$targetParams[$customPostType] = array(
|
75 |
$customPostType.'_all' => 'All '.ucfirst($customPostType).'s',
|
|
|
76 |
$customPostType.'_selected' => 'Select '.ucfirst($customPostType).'s',
|
77 |
$customPostType.'_categories' => 'Select '.ucfirst($customPostType).' categories'
|
78 |
);
|
73 |
foreach ($allCustomPostTypes as $customPostType) {
|
74 |
$targetParams[$customPostType] = array(
|
75 |
$customPostType.'_all' => 'All '.ucfirst($customPostType).'s',
|
76 |
+
$customPostType.'_archive' => 'Archives '.ucfirst($customPostType).'s',
|
77 |
$customPostType.'_selected' => 'Select '.ucfirst($customPostType).'s',
|
78 |
$customPostType.'_categories' => 'Select '.ucfirst($customPostType).' categories'
|
79 |
);
|
popup-builder.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Popup Builder
|
4 |
* Plugin URI: https://popup-builder.com
|
5 |
* Description: The most complete popup plugin. Html, image, iframe, shortcode, video and many other popup types. Manage popup dimensions, effects, themes and more.
|
6 |
-
* Version: 3.
|
7 |
* Author: Sygnoos
|
8 |
* Author URI: https://sygnoos.com
|
9 |
* License: GPLv2
|
3 |
* Plugin Name: Popup Builder
|
4 |
* Plugin URI: https://popup-builder.com
|
5 |
* Description: The most complete popup plugin. Html, image, iframe, shortcode, video and many other popup types. Manage popup dimensions, effects, themes and more.
|
6 |
+
* Version: 3.7
|
7 |
* Author: Sygnoos
|
8 |
* Author URI: https://sygnoos.com
|
9 |
* License: GPLv2
|
public/js/PopupBuilder.js
CHANGED
@@ -2583,10 +2583,8 @@ SgpbEventListener.prototype.sgpbClick = function(listenerObj, eventData)
|
|
2583 |
|
2584 |
var attr = currentTarget.parent().attr('data-popup-id');
|
2585 |
var attr2 = currentTarget.attr('data-popup-id');
|
2586 |
-
if (jQuery(e.originalEvent.target).
|
2587 |
-
|
2588 |
-
return true;
|
2589 |
-
}
|
2590 |
}
|
2591 |
|
2592 |
var allowToOpen = popupObj.forceCheckCurrentPopupType(popupObj);
|
2583 |
|
2584 |
var attr = currentTarget.parent().attr('data-popup-id');
|
2585 |
var attr2 = currentTarget.attr('data-popup-id');
|
2586 |
+
if (jQuery(e.originalEvent.target).parents('li').length && typeof jQuery(e.originalEvent.target).parents('li').attr('data-popup-id') == 'undefined') {
|
2587 |
+
return false;
|
|
|
|
|
2588 |
}
|
2589 |
|
2590 |
var allowToOpen = popupObj.forceCheckCurrentPopupType(popupObj);
|
public/js/PopupConfig.js
CHANGED
@@ -1,6 +1,16 @@
|
|
1 |
-
function PopupConfig()
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
function PopupConfig()
|
2 |
+
{this.prefix='sgpb';this.popupId;this.popupData;this.openDelay=0;this.currentObj={};this.allowed=true;this.showButton=true;this.buttonPosition='topRight';this.buttonInside=true;this.autoclose=false;this.overlayShouldClose=true;this.contentShouldClose=false;this.escShouldClose=true;this.closeButtonImage='img/close.png';this.popupTheme=1;this.popupType='html';this.closeButtonWidth=21;this.closeButtonHeight=21;this.closeButtonWidthType='px';this.closeButtonHeightType='px';this.closeButtonType='IMG';this.closeButtonText='Close';this.closeButtonDelay=0;this.overlayVisible=true;this.overlayColor='black';this.overlayOpacity=80;this.overlayAddClass='sgpb-popup-overlay sg-popup-overlay';this.contentPadding=8;this.zIndex=9999;this.contentShowBackground=true;this.contentBackgroundColor='#ffffff';this.contentBackgroundImage='';this.contentBackgroundMode='none';this.contentBackgroundPosition='';this.contentBorderStyle='solid';this.contentBorderRadius=0;this.contentBorderRadiusType='%';this.contentBorderColor='#f00';this.contentBorderWidth=0;this.boxBorderWidth=0;this.contentShadowColor='#ccc';this.contentShadowBlur=0;this.scrollingEnabled=false;this.shadowSpread=0;this.contentAddClass='class2';this.contents=false;this.positionRight=false;this.positionTop=false;this.positionBottom=false;this.positionLeft=false;this.width='-1';this.height='-1';this.maxWidth='-1';this.maxHeight='-1';this.minWidth='-1';this.minHeight='-1';this.srcElement='';this.openAnimationEffect='';this.openAnimationSpeed=0;this.openAnimationStatus=false;this.closeAnimationEffect='';this.closeAnimationSpeed=0;this.closeAnimationStatus=false;this.customShouldOpen=false;this.customShouldClose=false;}
|
3 |
+
PopupConfig.firstToUpperCase=function(string)
|
4 |
+
{return string[0].toUpperCase()+string.slice(1);};PopupConfig.firstToLowerCase=function(string)
|
5 |
+
{return string[0].toLowerCase()+string.slice(1);};PopupConfig.prototype.magicCall=function(functionName,arrgname)
|
6 |
+
{if(functionName.indexOf('get')!=-1){var param=functionName.replace(/^get/g,"");var param=PopupConfig.firstToLowerCase(functionName.replace(/^get/g,""));return this[param];}
|
7 |
+
else{var param=PopupConfig.firstToLowerCase(functionName.replace(/^set/g,""));this[param]=arrgname;}};PopupConfig.prototype.isIE=function()
|
8 |
+
{var ua=navigator.userAgent;var isIE=ua.indexOf('MSIE ')>-1||ua.indexOf('Trident/')>-1;return isIE;};PopupConfig.prototype.addCustomEvent=function(eventName,args)
|
9 |
+
{if(this.isIE()){var event=document.createEvent('CustomEvent');event.initCustomEvent(eventName,true,true,args);}
|
10 |
+
else{var event=new CustomEvent(eventName,{detail:args,bubbles:true,cancelable:true});}
|
11 |
+
window.dispatchEvent(event);};PopupConfig.prototype.combineConfigObj=function()
|
12 |
+
{var that=this;var eventSendArgs={'popupId':that.popupId,'popupData':that.popupData,'currentObj':that.currentObj};window.sgWindowOldWidth=window.innerWidth;window.sgWindowOldHeight=window.innerHeight;var config={popupId:that.popupId,openDelay:this.openDelay,popupTheme:this.popupTheme,popupType:this.popupType,closeBehavior:{allowed:this.allowed,showButton:this.showButton,buttonPosition:this.buttonPosition,buttonInside:this.buttonInside,autoclose:this.autoclose,overlayShouldClose:this.overlayShouldClose,contentShouldClose:this.contentShouldClose,escShouldClose:this.escShouldClose,right:this.closeButtonPositionRight,top:this.closeButtonPositionTop,bottom:this.closeButtonPositionBottom,left:this.closeButtonPositionLeft},openAnimation:{type:this.openAnimationEffect,speed:this.openAnimationSpeed,status:this.openAnimationStatus},closeAnimation:{type:this.closeAnimationEffect,speed:this.closeAnimationSpeed,status:this.closeAnimationStatus},closeButton:{data:this.buttonImage,width:this.closeButtonWidth,height:this.closeButtonHeight,widthType:this.closeButtonWidthType,heightType:this.closeButtonHeightType,type:this.closeButtonType,text:this.closeButtonText},overlay:{visible:this.overlayVisible,color:this.overlayColor,opacity:this.overlayOpacity,addClass:this.overlayAddClass},contentBox:{padding:this.contentPadding,zIndex:this.zIndex,showBackground:this.contentShowBackground,backgroundColor:this.contentBackgroundColor,backgroundImage:this.contentBackgroundImage,backgroundMode:this.contentBackgroundMode,backgroundPosition:this.contentBackgroundPosition,borderStyle:this.contentBorderStyle,borderRadius:this.contentBorderRadius,borderRadiusType:this.contentBorderRadiusType,borderColor:this.contentBorderColor,borderWidth:this.contentBorderWidth,boxBorderWidth:this.boxBorderWidth,shadowColor:this.contentShadowColor,shadowBlur:this.contentShadowBlur,scrollingEnabled:this.scrollingEnabled,shadowSpread:this.shadowSpread,addClass:this.contentAddClass},contents:this.contents,inline:this.srcElement,iframe:false,position:{right:this.positionRight,top:this.positionTop,bottom:this.positionBottom,left:this.positionLeft},sizingRanges:[{screenFrom:{width:0,height:0},screenTo:{width:300,height:3000},width:'100%',height:this.height,maxWidth:this.maxWidth,maxHeight:this.maxHeight,minWidth:this.minWidth,minHeight:this.minHeight},{screenFrom:{width:300,height:0},screenTo:{width:5000,height:3000},width:this.width,height:this.height,maxWidth:this.maxWidth,maxHeight:this.maxHeight,minWidth:this.minWidth,minHeight:this.minHeight}],shouldOpen:function(){return true;},willOpen:function(){that.addCustomEvent('sgpbWillOpen',eventSendArgs);},didOpen:function(args){if(that.isIE()){var finalArgs=[args,eventSendArgs],finalArgs=finalArgs.reduce(function(r,o){Object.keys(o).forEach(function(k){r[k]=o[k];});return r;},{});}
|
13 |
+
else{var finalArgs=Object.assign(args,eventSendArgs);}
|
14 |
+
that.addCustomEvent('sgpbDidOpen',finalArgs);},shouldClose:function(){return true;},willClose:function(){that.addCustomEvent('sgpbWillClose',eventSendArgs);},didClose:function(){that.addCustomEvent('sgpbDidClose',eventSendArgs);}};if(this.customShouldOpen){config.shouldOpen=this.customShouldOpen;}
|
15 |
+
if(this.customShouldClose){config.shouldClose=this.customShouldClose;}
|
16 |
+
return config;};var obj=new PopupConfig();
|
readme.txt
CHANGED
@@ -7,9 +7,9 @@ Plugin URI: https://popup-builder.com
|
|
7 |
Donate link: https://popup-builder.com
|
8 |
Tags: popup, pop up, wordpress popup, popup maker, exit popup, popup builder, wordpress popup plugin
|
9 |
Requires at least: 4.2
|
10 |
-
Tested up to: 5.
|
11 |
Requires PHP: 5.3.3
|
12 |
-
Stable tag: 3.
|
13 |
License: GPLv2 or later
|
14 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
15 |
|
@@ -186,6 +186,11 @@ Go to the Popup Builder settings and set your desired options.
|
|
186 |
|
187 |
== Changelog ==
|
188 |
|
|
|
|
|
|
|
|
|
|
|
189 |
= Version 3.69.6 =
|
190 |
* JavaScript improvements.
|
191 |
* Bug fixes.
|
@@ -1249,7 +1254,7 @@ Leave us a good review :)
|
|
1249 |
|
1250 |
== Upgrade Notice ==
|
1251 |
|
1252 |
-
Current Version of Popup Builder is 3.
|
1253 |
|
1254 |
== Other Notes ==
|
1255 |
|
7 |
Donate link: https://popup-builder.com
|
8 |
Tags: popup, pop up, wordpress popup, popup maker, exit popup, popup builder, wordpress popup plugin
|
9 |
Requires at least: 4.2
|
10 |
+
Tested up to: 5.6
|
11 |
Requires PHP: 5.3.3
|
12 |
+
Stable tag: 3.7
|
13 |
License: GPLv2 or later
|
14 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
15 |
|
186 |
|
187 |
== Changelog ==
|
188 |
|
189 |
+
= Version 3.7 =
|
190 |
+
* Improvement of "Display Rules" settings, showing popups on archive pages for all custom post types is added.
|
191 |
+
* Bug fixed related to "Settings" button when popup's opening event is set to on load.
|
192 |
+
* Bug fixed related to on click popups that are set to appear on dropdown’s menu items.
|
193 |
+
|
194 |
= Version 3.69.6 =
|
195 |
* JavaScript improvements.
|
196 |
* Bug fixes.
|
1254 |
|
1255 |
== Upgrade Notice ==
|
1256 |
|
1257 |
+
Current Version of Popup Builder is 3.7
|
1258 |
|
1259 |
== Other Notes ==
|
1260 |
|