Version Description
Current Version of Popup Builder is 2.3.3
Download this release
Release Info
Developer | Sygnoos |
Plugin | Popup Builder – Responsive WordPress Pop up |
Version | 2.3.5 |
Comparing to | |
See all releases |
Code changes from version 2.3.4 to 2.3.5
- classes/PopupInstaller.php +14 -0
- classes/SGFblikePopup.php +21 -4
- classes/SGHtmlPopup.php +19 -4
- classes/SGPopup.php +19 -0
- classes/SGPopupBuilderMain.php +75 -0
- classes/SGShortcodePopup.php +12 -1
- config-pkg.php +2 -1
- config.php +3 -1
- files/sg_admin_post.php +28 -2
- files/sg_functions.php +14 -2
- files/sg_more_plugins.php +11 -0
- files/sg_popup_create.php +18 -11
- files/sg_popup_create_new.php +1 -1
- files/sg_popup_settings.php +20 -0
- helpers/Integrate_external_settings.php +12 -0
- helpers/SgPopupGetData.php +57 -0
- img/blog-wp-kicker.png +0 -0
- img/mailchimpPro.png +0 -0
- javascript/sg_popup_init.js +19 -0
- javascript/sg_popup_javascript.php +1 -1
- popup-builder.php +17 -49
- readme.txt +54 -8
- style/sg_popup_style.css +28 -0
- style/sg_popup_style.php +1 -0
classes/PopupInstaller.php
CHANGED
@@ -14,6 +14,14 @@ class PopupInstaller
|
|
14 |
`options` LONGTEXT NOT NULL,
|
15 |
PRIMARY KEY (id)
|
16 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
$sgPopupImageBase = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$blogsId."sg_image_popup (
|
18 |
`id` int(11) NOT NULL,
|
19 |
`url` varchar(255) NOT NULL
|
@@ -42,6 +50,8 @@ class PopupInstaller
|
|
42 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ";
|
43 |
|
44 |
$wpdb->query($sgPopupBase);
|
|
|
|
|
45 |
$wpdb->query($sgPopupImageBase);
|
46 |
$wpdb->query($sgPopupHtmlBase);
|
47 |
$wpdb->query($sgPopupFblikeBase);
|
@@ -88,12 +98,16 @@ class PopupInstaller
|
|
88 |
$popupAddonDrop = $wpdb->prefix.$blogsId."sg_popup_addons";
|
89 |
$popupAddonSql = "DROP TABLE ". $popupAddonDrop;
|
90 |
|
|
|
|
|
|
|
91 |
$wpdb->query($popupSql);
|
92 |
$wpdb->query($popupImageSql);
|
93 |
$wpdb->query($popupHtmlSql);
|
94 |
$wpdb->query($popupFblikeSql);
|
95 |
$wpdb->query($popupShortcodeSql);
|
96 |
$wpdb->query($popupAddonSql);
|
|
|
97 |
}
|
98 |
|
99 |
public static function deleteSgPopupOptions($blogsId)
|
14 |
`options` LONGTEXT NOT NULL,
|
15 |
PRIMARY KEY (id)
|
16 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ";
|
17 |
+
$sgPopupSettingsBase = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$blogsId."sg_popup_settings (
|
18 |
+
`id` int(11) NOT NULL AUTO_INCREMENT,
|
19 |
+
`options` LONGTEXT NOT NULL,
|
20 |
+
PRIMARY KEY (id)
|
21 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ";
|
22 |
+
$optionsDefault = SgPopupGetData::getDefaultValues();
|
23 |
+
$sgPopupInsertSettingsSql = $wpdb->prepare("INSERT IGNORE ". $wpdb->prefix.$blogsId."sg_popup_settings (id, options) VALUES(%d,%s) ", 1, json_encode($optionsDefault['settingsParamas']));
|
24 |
+
|
25 |
$sgPopupImageBase = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix.$blogsId."sg_image_popup (
|
26 |
`id` int(11) NOT NULL,
|
27 |
`url` varchar(255) NOT NULL
|
50 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ";
|
51 |
|
52 |
$wpdb->query($sgPopupBase);
|
53 |
+
$wpdb->query($sgPopupSettingsBase);
|
54 |
+
$wpdb->query($sgPopupInsertSettingsSql);
|
55 |
$wpdb->query($sgPopupImageBase);
|
56 |
$wpdb->query($sgPopupHtmlBase);
|
57 |
$wpdb->query($sgPopupFblikeBase);
|
98 |
$popupAddonDrop = $wpdb->prefix.$blogsId."sg_popup_addons";
|
99 |
$popupAddonSql = "DROP TABLE ". $popupAddonDrop;
|
100 |
|
101 |
+
$popupSettingsDrop = $wpdb->prefix.$blogsId."sg_popup_settings";
|
102 |
+
$popupSettingsSql = "DROP TABLE ". $popupSettingsDrop;
|
103 |
+
|
104 |
$wpdb->query($popupSql);
|
105 |
$wpdb->query($popupImageSql);
|
106 |
$wpdb->query($popupHtmlSql);
|
107 |
$wpdb->query($popupFblikeSql);
|
108 |
$wpdb->query($popupShortcodeSql);
|
109 |
$wpdb->query($popupAddonSql);
|
110 |
+
$wpdb->query($popupSettingsSql);
|
111 |
}
|
112 |
|
113 |
public static function deleteSgPopupOptions($blogsId)
|
classes/SGFblikePopup.php
CHANGED
@@ -79,7 +79,7 @@ class SGFblikePopup extends SGPopup
|
|
79 |
$layout = $options['fblike-layout'];
|
80 |
|
81 |
$content = $this->getContent();
|
82 |
-
|
83 |
$content .= "<div id=\"sg-facebook-like\"><script type=\"text/javascript\">
|
84 |
(function(d, s, id) {
|
85 |
var js, fjs = d.getElementsByTagName(s)[0];
|
@@ -99,9 +99,26 @@ class SGFblikePopup extends SGPopup
|
|
99 |
max-width: none !important;
|
100 |
}
|
101 |
</style>';
|
102 |
-
|
103 |
-
|
104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
}
|
106 |
|
107 |
public function render()
|
79 |
$layout = $options['fblike-layout'];
|
80 |
|
81 |
$content = $this->getContent();
|
82 |
+
|
83 |
$content .= "<div id=\"sg-facebook-like\"><script type=\"text/javascript\">
|
84 |
(function(d, s, id) {
|
85 |
var js, fjs = d.getElementsByTagName(s)[0];
|
99 |
max-width: none !important;
|
100 |
}
|
101 |
</style>';
|
102 |
+
$hasShortcode = $this->hasPopupContentShortcode($content);
|
103 |
+
|
104 |
+
if($hasShortcode) {
|
105 |
+
|
106 |
+
$content = $this->improveContent($content);
|
107 |
+
/*Add this part of code right into the page to escape conflicts with shortcodes init functionlity*/
|
108 |
+
$currentPopupContent = "<div id=\"sg-popup-content-".$this->getId()."\" style=\"display: none;\"> <div id=\"sgpb-all-content-".$this->getId()."\">".$content."</div></div>";
|
109 |
+
/*For line brake error*/
|
110 |
+
$currentPopupContent = trim(preg_replace('/\s+/', ' ', $currentPopupContent));
|
111 |
+
$currentPopupContent = preg_replace('/<\/script>/', '<\/script>', addslashes($currentPopupContent));
|
112 |
+
/*Append to body for shortcode break to new line*/
|
113 |
+
echo "<script type=\"text/javascript\">
|
114 |
+
jQuery(document).ready(function() {
|
115 |
+
jQuery('body').append(\"jQuery('".$currentPopupContent."')\");
|
116 |
+
});
|
117 |
+
</script>";
|
118 |
+
$content = ' ';
|
119 |
+
}
|
120 |
+
|
121 |
+
return array('html'=>$content);
|
122 |
}
|
123 |
|
124 |
public function render()
|
classes/SGHtmlPopup.php
CHANGED
@@ -49,11 +49,26 @@ class SGHtmlPopup extends SGPopup {
|
|
49 |
|
50 |
protected function getExtraRenderOptions() {
|
51 |
$content = $this->getContent();
|
52 |
-
$
|
53 |
-
/*Add this part of code right into the page to escape conflicts with shortcodes init functionlity*/
|
54 |
-
echo "<div id=\"sg-popup-content-".$this->getId()."\" style=\"display: none;\"> <div id=\"sgpb-all-content-".$this->getId()."\">".$content."</div></div>";
|
55 |
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
}
|
58 |
|
59 |
public function render() {
|
49 |
|
50 |
protected function getExtraRenderOptions() {
|
51 |
$content = $this->getContent();
|
52 |
+
$hasShortcode = $this->hasPopupContentShortcode($content);
|
|
|
|
|
53 |
|
54 |
+
if($hasShortcode) {
|
55 |
+
|
56 |
+
$content = $this->improveContent($content);
|
57 |
+
/*Add this part of code right into the page to escape conflicts with shortcodes init functionlity*/
|
58 |
+
$currentPopupContent = "<div id=\"sg-popup-content-".$this->getId()."\" style=\"display: none;\"> <div id=\"sgpb-all-content-".$this->getId()."\">".$content."</div></div>";
|
59 |
+
/*For line brake error*/
|
60 |
+
$currentPopupContent = trim(preg_replace('/\s+/', ' ', $currentPopupContent));
|
61 |
+
$currentPopupContent = preg_replace('/<\/script>/', '<\/script>', addslashes($currentPopupContent));
|
62 |
+
/*Append to body for shortcode break to new line*/
|
63 |
+
echo "<script type=\"text/javascript\">
|
64 |
+
jQuery(document).ready(function() {
|
65 |
+
jQuery('body').append(\"jQuery('".$currentPopupContent."')\");
|
66 |
+
});
|
67 |
+
</script>";
|
68 |
+
$content = ' ';
|
69 |
+
}
|
70 |
+
|
71 |
+
return array('html' => $content);
|
72 |
}
|
73 |
|
74 |
public function render() {
|
classes/SGPopup.php
CHANGED
@@ -233,6 +233,25 @@ abstract class SGPopup {
|
|
233 |
return $content;
|
234 |
}
|
235 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
236 |
public function render() {
|
237 |
/* When have popup with same id in the same page */
|
238 |
if(!in_array($this->getId(), SGPopup::$currentPopups)) {
|
233 |
return $content;
|
234 |
}
|
235 |
|
236 |
+
public function hasPopupContentShortcode($content) {
|
237 |
+
|
238 |
+
global $shortcode_tags;
|
239 |
+
|
240 |
+
if(POPUP_BUILDER_PKG == POPUP_BUILDER_PKG_FREE) {
|
241 |
+
return false;
|
242 |
+
}
|
243 |
+
|
244 |
+
preg_match_all( '@\[([^<>&/\[\]\x00-\x20=]++)@', $content, $matches );
|
245 |
+
$tagnames = array_intersect( array_keys( $shortcode_tags ), $matches[1] );
|
246 |
+
|
247 |
+
/* If tagnames is empty it's mean content does not have shortcode */
|
248 |
+
if (empty($tagnames)) {
|
249 |
+
return false;
|
250 |
+
}
|
251 |
+
return true;
|
252 |
+
|
253 |
+
}
|
254 |
+
|
255 |
public function render() {
|
256 |
/* When have popup with same id in the same page */
|
257 |
if(!in_array($this->getId(), SGPopup::$currentPopups)) {
|
classes/SGPopupBuilderMain.php
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class SGPopupBuilderMain {
|
3 |
+
|
4 |
+
public function init() {
|
5 |
+
|
6 |
+
$this->filters();
|
7 |
+
$this->sgpbActions();
|
8 |
+
}
|
9 |
+
|
10 |
+
public function sgpbActions() {
|
11 |
+
|
12 |
+
add_action("admin_menu",array($this, "sgAddMenu"));
|
13 |
+
}
|
14 |
+
|
15 |
+
public function sgAddMenu($args) {
|
16 |
+
|
17 |
+
add_menu_page("Popup Builder", "Popup Builder", "manage_options","PopupBuilder", array($this, "sgPopupMenu"),"dashicons-welcome-widgets-menus");
|
18 |
+
add_submenu_page("PopupBuilder", "All Popups", "All Popups", 'manage_options', "PopupBuilder", array($this, "sgPopupMenu"));
|
19 |
+
add_submenu_page("PopupBuilder", "Add New", "Add New", 'manage_options', "create-popup", array($this,"sgCreatePopup"));
|
20 |
+
add_submenu_page("PopupBuilder", "Edit Popup", "Edit Popup", 'manage_options', "edit-popup", array($this,"sgEditPopup"));
|
21 |
+
add_submenu_page("PopupBuilder", "Settings", "Settings", 'manage_options', "popup-settings", array($this,"sgPopupSettings"));
|
22 |
+
if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_SILVER) {
|
23 |
+
add_submenu_page("PopupBuilder", "Subscribers", "Subscribers", 'manage_options', "subscribers", array($this,"sgSubscribers"));
|
24 |
+
}
|
25 |
+
add_submenu_page("PopupBuilder", "More plugins", "More plugins", 'manage_options', "more-plugins", array($this,"showMorePlugins"));
|
26 |
+
}
|
27 |
+
|
28 |
+
public function sgPopupMenu() {
|
29 |
+
|
30 |
+
require_once( SG_APP_POPUP_FILES . '/sg_popup_main.php');
|
31 |
+
}
|
32 |
+
|
33 |
+
public function sgCreatePopup() {
|
34 |
+
|
35 |
+
require_once( SG_APP_POPUP_FILES . '/sg_popup_create.php'); // here is inculde file in the first sub menu
|
36 |
+
}
|
37 |
+
|
38 |
+
public function sgPopupSettings() {
|
39 |
+
|
40 |
+
require_once( SG_APP_POPUP_FILES . '/sg_popup_settings.php');
|
41 |
+
}
|
42 |
+
|
43 |
+
public function sgEditPopup() {
|
44 |
+
|
45 |
+
require_once( SG_APP_POPUP_FILES . '/sg_popup_create_new.php');
|
46 |
+
}
|
47 |
+
|
48 |
+
public function sgSubscribers() {
|
49 |
+
|
50 |
+
require_once( SG_APP_POPUP_FILES . '/sg_subscribers.php');
|
51 |
+
}
|
52 |
+
|
53 |
+
public function showMorePlugins() {
|
54 |
+
|
55 |
+
require_once( SG_APP_POPUP_FILES . '/sg_more_plugins.php');
|
56 |
+
}
|
57 |
+
|
58 |
+
public function filters() {
|
59 |
+
|
60 |
+
add_filter('plugin_action_links_'. POPUP_BUILDER_BASENAME, array($this, 'popupPluginActionLinks'));
|
61 |
+
}
|
62 |
+
|
63 |
+
public function popupPluginActionLinks($links) {
|
64 |
+
|
65 |
+
$popupActionLinks = array(
|
66 |
+
'<a href="' . SG_POPUP_EXTENTIONS_URL . '" target="_blank">Extensions</a>',
|
67 |
+
);
|
68 |
+
|
69 |
+
if(POPUP_BUILDER_PKG == POPUP_BUILDER_PKG_FREE) {
|
70 |
+
array_push($popupActionLinks, '<a href="' . SG_POPUP_PRO_URL . '" target="_blank">Pro</a>');
|
71 |
+
}
|
72 |
+
|
73 |
+
return array_merge( $links, $popupActionLinks );
|
74 |
+
}
|
75 |
+
}
|
classes/SGShortcodePopup.php
CHANGED
@@ -45,8 +45,19 @@ class SGShortcodePopup extends SGPopup {
|
|
45 |
}
|
46 |
protected function getExtraRenderOptions() {
|
47 |
$content = do_shortcode($this->getShortcode());
|
|
|
48 |
/*Add this part of code right into the page to escape conflicts with shortcodes init functionlity*/
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
return array('shortcode'=> ' ');
|
51 |
}
|
52 |
|
45 |
}
|
46 |
protected function getExtraRenderOptions() {
|
47 |
$content = do_shortcode($this->getShortcode());
|
48 |
+
|
49 |
/*Add this part of code right into the page to escape conflicts with shortcodes init functionlity*/
|
50 |
+
$currentPopupContent = "<div id=\"sg-popup-content-".$this->getId()."\" style=\"display: none;\"> <div id=\"sgpb-all-content-".$this->getId()."\">".$content."</div></div>";
|
51 |
+
/*For line brake error*/
|
52 |
+
$currentPopupContent = trim(preg_replace('/\s+/', ' ', $currentPopupContent));
|
53 |
+
$currentPopupContent = preg_replace('/<\/script>/', '<\/script>', addslashes($currentPopupContent));
|
54 |
+
/*Append to body for shortcode break to new line*/
|
55 |
+
echo "<script type=\"text/javascript\">
|
56 |
+
jQuery(document).ready(function() {
|
57 |
+
jQuery('body').append(\"jQuery('".$currentPopupContent."')\");
|
58 |
+
});
|
59 |
+
</script>";
|
60 |
+
|
61 |
return array('shortcode'=> ' ');
|
62 |
}
|
63 |
|
config-pkg.php
CHANGED
@@ -1,2 +1,3 @@
|
|
1 |
<?php
|
2 |
-
define('POPUP_BUILDER_PKG', POPUP_BUILDER_PKG_FREE);
|
|
1 |
<?php
|
2 |
+
define('POPUP_BUILDER_PKG', POPUP_BUILDER_PKG_FREE);
|
3 |
+
define('POPUP_BUILDER_BASENAME', 'popup-builder/popup-builder.php');
|
config.php
CHANGED
@@ -9,8 +9,10 @@ define('SG_APP_POPUP_CLASSES', SG_APP_POPUP_PATH . '/classes');
|
|
9 |
define('SG_APP_POPUP_JS', SG_APP_POPUP_PATH . '/javascript');
|
10 |
define('SG_APP_POPUP_HELPERS', SG_APP_POPUP_PATH . '/helpers/');
|
11 |
define('SG_APP_POPUP_TABLE_LIMIT', 15);
|
12 |
-
define('SG_POPUP_VERSION', 2.
|
13 |
define('SG_POPUP_PRO_URL', 'http://popup-builder.com/');
|
|
|
|
|
14 |
define('SG_IP_TO_COUNTRY_SERVICE_TIMEOUT', 2);
|
15 |
define('SG_IP_TO_COUNTRY_SERVICE_URL', 'http://sygnoos.in/ip2data/?ip=');
|
16 |
define('SG_IP_TO_COUNTRY_SERVICE_TOKEN', 'd=b32e509a0c6da4147e7903f4bc0b60aa');
|
9 |
define('SG_APP_POPUP_JS', SG_APP_POPUP_PATH . '/javascript');
|
10 |
define('SG_APP_POPUP_HELPERS', SG_APP_POPUP_PATH . '/helpers/');
|
11 |
define('SG_APP_POPUP_TABLE_LIMIT', 15);
|
12 |
+
define('SG_POPUP_VERSION', 2.35);
|
13 |
define('SG_POPUP_PRO_URL', 'http://popup-builder.com/');
|
14 |
+
define('SG_POPUP_EXTENTIONS_URL', 'http://popup-builder.com/extensions');
|
15 |
+
define('SG_MAILCHIMP_EXTENTION_URL', 'http://popup-builder.com/mailchimp/');
|
16 |
define('SG_IP_TO_COUNTRY_SERVICE_TIMEOUT', 2);
|
17 |
define('SG_IP_TO_COUNTRY_SERVICE_URL', 'http://sygnoos.in/ip2data/?ip=');
|
18 |
define('SG_IP_TO_COUNTRY_SERVICE_TOKEN', 'd=b32e509a0c6da4147e7903f4bc0b60aa');
|
files/sg_admin_post.php
CHANGED
@@ -85,7 +85,7 @@ add_action('admin_post_popup_clone', 'sgPopupClone');
|
|
85 |
|
86 |
function sgPopupDataExport() {
|
87 |
global $wpdb;
|
88 |
-
|
89 |
$allData = array();
|
90 |
$exportArray = array();
|
91 |
$wpOptions = array();
|
@@ -156,7 +156,7 @@ function sgPopupDataExport() {
|
|
156 |
$allData['customData'] = $customTablesData;
|
157 |
$allData['customTablesColumsName'] = $customTablesColumsName;
|
158 |
$allData['wpOptions'] = $wpOptions;
|
159 |
-
|
160 |
header("Pragma: public");
|
161 |
header("Expires: 0");
|
162 |
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
@@ -169,3 +169,29 @@ function sgPopupDataExport() {
|
|
169 |
|
170 |
add_action('admin_post_popup_export', 'sgPopupDataExport');
|
171 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
|
86 |
function sgPopupDataExport() {
|
87 |
global $wpdb;
|
88 |
+
|
89 |
$allData = array();
|
90 |
$exportArray = array();
|
91 |
$wpOptions = array();
|
156 |
$allData['customData'] = $customTablesData;
|
157 |
$allData['customTablesColumsName'] = $customTablesColumsName;
|
158 |
$allData['wpOptions'] = $wpOptions;
|
159 |
+
|
160 |
header("Pragma: public");
|
161 |
header("Expires: 0");
|
162 |
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
169 |
|
170 |
add_action('admin_post_popup_export', 'sgPopupDataExport');
|
171 |
|
172 |
+
function sgPopupSaveSettings() {
|
173 |
+
|
174 |
+
global $wpdb;
|
175 |
+
|
176 |
+
$st = $wpdb->prepare("SELECT options FROM ". $wpdb->prefix ."sg_popup_settings WHERE id = %d",1);
|
177 |
+
$options = $wpdb->get_row($st, ARRAY_A);
|
178 |
+
|
179 |
+
$settingsOptions = array(
|
180 |
+
'tables-delete-status' => sanitize_text_field($_POST['tables-delete-status'])
|
181 |
+
);
|
182 |
+
|
183 |
+
$settingsOptions = json_encode($settingsOptions);
|
184 |
+
if(is_null($options) || empty($options)) {
|
185 |
+
|
186 |
+
$sql = $wpdb->prepare( "INSERT INTO ". $wpdb->prefix ."sg_popup_settings (id, options) VALUES (%d,%s)",'1',$settingsOptions);
|
187 |
+
$res = $wpdb->query($sql);
|
188 |
+
}
|
189 |
+
else {
|
190 |
+
$sql = $wpdb->prepare("UPDATE ". $wpdb->prefix ."sg_popup_settings SET options=%s WHERE id=%d",$settingsOptions,1);
|
191 |
+
$res = $wpdb->query($sql);
|
192 |
+
}
|
193 |
+
wp_redirect(SG_APP_POPUP_ADMIN_URL."admin.php?page=popup-settings&saved=1");
|
194 |
+
}
|
195 |
+
|
196 |
+
add_action('admin_post_save_settings', 'sgPopupSaveSettings');
|
197 |
+
|
files/sg_functions.php
CHANGED
@@ -11,9 +11,21 @@ class SGFunctions
|
|
11 |
echo $sgInfo;
|
12 |
}
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
public static function addReview()
|
15 |
{
|
16 |
-
return '<div class="updated updated notice is-dismissible reviewPanel">
|
17 |
<div class="reviewPanelContent">
|
18 |
<span class="reviewPanelSpan">
|
19 |
Dear user, we always do our best to help you and your opinion is very important for us!
|
@@ -31,7 +43,7 @@ class SGFunctions
|
|
31 |
}
|
32 |
|
33 |
public static function noticeForShortcode() {
|
34 |
-
$notice = '<span class="shortcode-use-info">NOTE: Shortcodes doesn\'t work inside the HTML Popup. Please use <a href="
|
35 |
return $notice;
|
36 |
}
|
37 |
|
11 |
echo $sgInfo;
|
12 |
}
|
13 |
|
14 |
+
public static function popupTablesDeleteSatus() {
|
15 |
+
|
16 |
+
global $wpdb;
|
17 |
+
|
18 |
+
$st = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix ."sg_popup_settings WHERE id = %d",1);
|
19 |
+
$arr = $wpdb->get_row($st,ARRAY_A);
|
20 |
+
$options = json_decode($arr['options'], true);
|
21 |
+
$deleteStatus = ($options['tables-delete-status'] == 'on' ? true: false);
|
22 |
+
|
23 |
+
return $deleteStatus;
|
24 |
+
}
|
25 |
+
|
26 |
public static function addReview()
|
27 |
{
|
28 |
+
return '<div class="updated updated notice is-dismissible reviewPanel sg-review-panel">
|
29 |
<div class="reviewPanelContent">
|
30 |
<span class="reviewPanelSpan">
|
31 |
Dear user, we always do our best to help you and your opinion is very important for us!
|
43 |
}
|
44 |
|
45 |
public static function noticeForShortcode() {
|
46 |
+
$notice = '<span class="shortcode-use-info">NOTE: Shortcodes doesn\'t work inside the HTML Popup. Please use <a href="'.SG_APP_POPUP_ADMIN_URL.'admin.php?page=edit-popup&type=shortcode">Shortcode Popup</a> instead.</span>';
|
47 |
return $notice;
|
48 |
}
|
49 |
|
files/sg_more_plugins.php
CHANGED
@@ -51,4 +51,15 @@
|
|
51 |
</div>
|
52 |
</div>
|
53 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
</div>
|
51 |
</div>
|
52 |
</div>
|
53 |
</div>
|
54 |
+
<div class="plugin-card" onclick="window.open('http://wpkicker.com/')">
|
55 |
+
<div class="plugin-card-top">
|
56 |
+
<a href="#" class="plugin-icon"><style type="text/css">#plugin-icon-kicker { width:128px; height:128px; background-size:128px 128px; }</style><div class="plugin-icon" style="float:left; margin: 3px 6px 6px 0px;"><img id="plugin-icon-kicker" src="<?php echo SG_APP_POPUP_URL.'/img/blog-wp-kicker.png';?>"></div></a>
|
57 |
+
<div class="name column-name">
|
58 |
+
<h4><a href="#">WP Kicker</a></h4>
|
59 |
+
</div>
|
60 |
+
<div class="desc column-description">
|
61 |
+
<p>Wp Kicker has a definite mission, to provide WordPress users with all the necessary information they may be needing concerning the security, the aim or the instructions of usage of WordPress in general.</p>
|
62 |
+
</div>
|
63 |
+
</div>
|
64 |
+
</div>
|
65 |
</div>
|
files/sg_popup_create.php
CHANGED
@@ -4,7 +4,7 @@ if(!SG_SHOW_POPUP_REVIEW) {
|
|
4 |
}
|
5 |
|
6 |
$externalPlugins = IntegrateExternalSettings::getAllExternalPlugins();
|
7 |
-
|
8 |
?>
|
9 |
<h2>Add New Popup</h2>
|
10 |
<div class="popups-wrapper">
|
@@ -60,6 +60,16 @@ $externalPlugins = IntegrateExternalSettings::getAllExternalPlugins();
|
|
60 |
</a>
|
61 |
<?php endif; ?>
|
62 |
<?php endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
<?php if (POPUP_BUILDER_PKG == POPUP_BUILDER_PKG_FREE): ?>
|
64 |
<a class="create-popup-link" href="<?php echo SG_POPUP_PRO_URL;?>" target="_blank">
|
65 |
<div class="popups-div iframe-popup-pro">
|
@@ -93,15 +103,12 @@ $externalPlugins = IntegrateExternalSettings::getAllExternalPlugins();
|
|
93 |
<div class="popups-div contact-pro">
|
94 |
</div>
|
95 |
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
<?php endif; ?>
|
97 |
-
|
98 |
-
if(!empty($externalPlugins)) {
|
99 |
-
foreach ($externalPlugins as $externalPlugin) { ?>
|
100 |
-
<a class="create-popup-link" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=<?php echo $externalPlugin['name']?>">
|
101 |
-
<div class="popups-div <?php echo $externalPlugin['name'].'-image';?>">
|
102 |
-
</div>
|
103 |
-
</a>
|
104 |
-
<?php }
|
105 |
-
}
|
106 |
-
?>
|
107 |
</div>
|
4 |
}
|
5 |
|
6 |
$externalPlugins = IntegrateExternalSettings::getAllExternalPlugins();
|
7 |
+
$mailchimpExist = IntegrateExternalSettings::isExtensionExists('mailchimp');
|
8 |
?>
|
9 |
<h2>Add New Popup</h2>
|
10 |
<div class="popups-wrapper">
|
60 |
</a>
|
61 |
<?php endif; ?>
|
62 |
<?php endif; ?>
|
63 |
+
<?php
|
64 |
+
if(!empty($externalPlugins)) {
|
65 |
+
foreach ($externalPlugins as $externalPlugin) { ?>
|
66 |
+
<a class="create-popup-link" href="<?php echo SG_APP_POPUP_ADMIN_URL?>admin.php?page=edit-popup&type=<?php echo $externalPlugin['name']?>">
|
67 |
+
<div class="popups-div <?php echo $externalPlugin['name'].'-image';?>">
|
68 |
+
</div>
|
69 |
+
</a>
|
70 |
+
<?php }
|
71 |
+
}
|
72 |
+
?>
|
73 |
<?php if (POPUP_BUILDER_PKG == POPUP_BUILDER_PKG_FREE): ?>
|
74 |
<a class="create-popup-link" href="<?php echo SG_POPUP_PRO_URL;?>" target="_blank">
|
75 |
<div class="popups-div iframe-popup-pro">
|
103 |
<div class="popups-div contact-pro">
|
104 |
</div>
|
105 |
</a>
|
106 |
+
<?php if(!$mailchimpExist): ?>
|
107 |
+
<a class="create-popup-link" href="<?php echo SG_MAILCHIMP_EXTENTION_URL;?>" target="_blank">
|
108 |
+
<div class="popups-div mailchimp-pro">
|
109 |
+
</div>
|
110 |
+
</a>
|
111 |
+
<?php endif;?>
|
112 |
<?php endif; ?>
|
113 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
</div>
|
files/sg_popup_create_new.php
CHANGED
@@ -1065,7 +1065,7 @@
|
|
1065 |
<span class="liquid-width">Enable content scrolling:</span><input class="input-width-static" type="checkbox" name="scrolling" <?php echo $sgScrolling;?> />
|
1066 |
<span class="dashicons dashicons-info scrollingImg sameImageStyle"></span><span class="infoScrolling samefontStyle">If the containt is larger then the specified dimentions, then the content will be scrollable.</span><br>
|
1067 |
|
1068 |
-
<span class="liquid-width">Enable
|
1069 |
<span class="dashicons dashicons-info repositionImg sameImageStyle"></span><span class="infoReposition samefontStyle">The popup will be resized/repositioned automatically when window is being resized.</span><br>
|
1070 |
|
1071 |
<span class="liquid-width">Dismiss on overlay click:</span><input class="input-width-static" type="checkbox" name="overlayClose" <?php echo $sgOverlayClose;?> />
|
1065 |
<span class="liquid-width">Enable content scrolling:</span><input class="input-width-static" type="checkbox" name="scrolling" <?php echo $sgScrolling;?> />
|
1066 |
<span class="dashicons dashicons-info scrollingImg sameImageStyle"></span><span class="infoScrolling samefontStyle">If the containt is larger then the specified dimentions, then the content will be scrollable.</span><br>
|
1067 |
|
1068 |
+
<span class="liquid-width">Enable reposition:</span><input class="input-width-static" type="checkbox" name="reposition" <?php echo $sgReposition;?> />
|
1069 |
<span class="dashicons dashicons-info repositionImg sameImageStyle"></span><span class="infoReposition samefontStyle">The popup will be resized/repositioned automatically when window is being resized.</span><br>
|
1070 |
|
1071 |
<span class="liquid-width">Dismiss on overlay click:</span><input class="input-width-static" type="checkbox" name="overlayClose" <?php echo $sgOverlayClose;?> />
|
files/sg_popup_settings.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$tableDeleteValue = SgPopupGetData::getValue('tables-delete-status','settings');
|
3 |
+
$tableDeleteSatatus = SgPopupGetData::sgSetChecked($tableDeleteValue);
|
4 |
+
if (isset($_GET['saved']) && $_GET['saved']==1) {
|
5 |
+
echo '<div id="default-message" class="updated notice notice-success is-dismissible" ><p>Popup updated.</p></div>';
|
6 |
+
}
|
7 |
+
?>
|
8 |
+
<div class="crud-wrapper">
|
9 |
+
<form method="POST" action="<?php echo SG_APP_POPUP_ADMIN_URL;?>admin-post.php?action=save_settings" id="sg-settings-form">
|
10 |
+
<div>
|
11 |
+
<h2>General settings</h2>
|
12 |
+
</div>
|
13 |
+
<span class="setting-label">Delete popup data:</span>
|
14 |
+
<input type="checkbox" name="tables-delete-status" <?php echo $tableDeleteSatatus;?>>
|
15 |
+
<div class="setting-submit-wrraper">
|
16 |
+
<input type="submit" class="button-primary" value="<?php echo 'Save Changes'; ?>">
|
17 |
+
</div>
|
18 |
+
</form>
|
19 |
+
</div>
|
20 |
+
|
helpers/Integrate_external_settings.php
CHANGED
@@ -15,6 +15,18 @@ Class IntegrateExternalSettings {
|
|
15 |
return $addons;
|
16 |
}
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
/* retrun All paths */
|
19 |
public static function getCurrentPopupAppPaths($popupType) {
|
20 |
|
15 |
return $addons;
|
16 |
}
|
17 |
|
18 |
+
public static function isExtensionExists($extentionName) {
|
19 |
+
|
20 |
+
global $wpdb;
|
21 |
+
$sql = $wpdb->prepare("SELECT * FROM ". $wpdb->prefix ."sg_popup_addons WHERE type='plugin' AND name=%s", $extentionName);
|
22 |
+
$ressults = $wpdb->get_results($sql, ARRAY_A);
|
23 |
+
|
24 |
+
if(empty($ressults)) {
|
25 |
+
return false;
|
26 |
+
}
|
27 |
+
return true;
|
28 |
+
}
|
29 |
+
|
30 |
/* retrun All paths */
|
31 |
public static function getCurrentPopupAppPaths($popupType) {
|
32 |
|
helpers/SgPopupGetData.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class SgPopupGetData {
|
3 |
+
|
4 |
+
public static function getDefaultValues() {
|
5 |
+
|
6 |
+
$settingsParamas = array(
|
7 |
+
'tables-delete-status' => 'on'
|
8 |
+
);
|
9 |
+
|
10 |
+
$deafultParams = array(
|
11 |
+
'settingsParamas' => $settingsParamas
|
12 |
+
);
|
13 |
+
|
14 |
+
return $deafultParams;
|
15 |
+
}
|
16 |
+
|
17 |
+
public static function getValue($optionName,$optionType) {
|
18 |
+
|
19 |
+
$optionType = strtolower($optionType);
|
20 |
+
$optionFunctionName = 'get'.ucfirst($optionType).'Options';
|
21 |
+
$options = self::$optionFunctionName();
|
22 |
+
|
23 |
+
|
24 |
+
if(isset($options[$optionName])) {
|
25 |
+
return $options[$optionName];
|
26 |
+
}
|
27 |
+
|
28 |
+
$deafaultValues = self::getDefaultValues();
|
29 |
+
$deafultSettings = $deafaultValues[$optionType.'Paramas'];
|
30 |
+
|
31 |
+
return $deafultSettings[$optionName];
|
32 |
+
}
|
33 |
+
|
34 |
+
public static function getSettingsOptions() {
|
35 |
+
|
36 |
+
global $wpdb;
|
37 |
+
|
38 |
+
$st = $wpdb->prepare("SELECT options FROM ". $wpdb->prefix ."sg_popup_settings WHERE id = %d",1);
|
39 |
+
$options = $wpdb->get_row($st, ARRAY_A);
|
40 |
+
|
41 |
+
/*Option can be null when ex settings table does now exists for old users*/
|
42 |
+
if(is_null($options)) {
|
43 |
+
return array();
|
44 |
+
}
|
45 |
+
$options = json_decode($options['options'], true);
|
46 |
+
|
47 |
+
return $options;
|
48 |
+
}
|
49 |
+
|
50 |
+
public static function sgSetChecked($value) {
|
51 |
+
|
52 |
+
if($value == '') {
|
53 |
+
return '';
|
54 |
+
}
|
55 |
+
return 'checked';
|
56 |
+
}
|
57 |
+
}
|
img/blog-wp-kicker.png
ADDED
Binary file
|
img/mailchimpPro.png
ADDED
Binary file
|
javascript/sg_popup_init.js
CHANGED
@@ -6,13 +6,32 @@ function SgPopupInit(popupData) {
|
|
6 |
|
7 |
SgPopupInit.prototype.cloneToHtmlPopup = function() {
|
8 |
var currentPopupId = this.popupData['id'];
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
jQuery("#sgpb-all-content-"+currentPopupId).appendTo('.sg-current-popup-'+currentPopupId);
|
10 |
|
|
|
11 |
jQuery('#sgcolorbox').bind('sgPopupCleanup', function() {
|
12 |
jQuery('#sgpb-all-content-'+currentPopupId).appendTo(jQuery("#sg-popup-content-"+currentPopupId));
|
13 |
});
|
14 |
}
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
SgPopupInit.prototype.shortcodeInPopupContent = function() {
|
17 |
|
18 |
jQuery(".sg-show-popup").bind('click',function() {
|
6 |
|
7 |
SgPopupInit.prototype.cloneToHtmlPopup = function() {
|
8 |
var currentPopupId = this.popupData['id'];
|
9 |
+
|
10 |
+
/*When content does not have shortcode*/
|
11 |
+
if(jQuery("#sgpb-all-content-"+currentPopupId).length == 0) {
|
12 |
+
return;
|
13 |
+
}
|
14 |
+
|
15 |
jQuery("#sgpb-all-content-"+currentPopupId).appendTo('.sg-current-popup-'+currentPopupId);
|
16 |
|
17 |
+
this.popupResizing(currentPopupId);
|
18 |
jQuery('#sgcolorbox').bind('sgPopupCleanup', function() {
|
19 |
jQuery('#sgpb-all-content-'+currentPopupId).appendTo(jQuery("#sg-popup-content-"+currentPopupId));
|
20 |
});
|
21 |
}
|
22 |
|
23 |
+
SgPopupInit.prototype.popupResizing = function(currentPopupId) {
|
24 |
+
|
25 |
+
var width = this.popupData['width'];
|
26 |
+
var height = this.popupData['height'];
|
27 |
+
var maxWidth = this.popupData['maxWidth'];
|
28 |
+
var maxHeight = this.popupData['maxHeight'];
|
29 |
+
|
30 |
+
if(maxWidth == '' && maxHeight == '') {
|
31 |
+
jQuery.sgcolorbox.resize({'width': width, 'height': height});
|
32 |
+
}
|
33 |
+
}
|
34 |
+
|
35 |
SgPopupInit.prototype.shortcodeInPopupContent = function() {
|
36 |
|
37 |
jQuery(".sg-show-popup").bind('click',function() {
|
javascript/sg_popup_javascript.php
CHANGED
@@ -16,7 +16,7 @@ function sg_popup_admin_scripts($hook) {
|
|
16 |
wp_enqueue_script('javascript');
|
17 |
|
18 |
}
|
19 |
-
else if('toplevel_page_PopupBuilder' == $hook){
|
20 |
wp_register_script('javascript', SG_APP_POPUP_URL . '/javascript/sg_popup_backend.js', array('jquery', 'wp-color-picker'));
|
21 |
wp_enqueue_script('jquery');
|
22 |
wp_enqueue_script('javascript');
|
16 |
wp_enqueue_script('javascript');
|
17 |
|
18 |
}
|
19 |
+
else if('toplevel_page_PopupBuilder' == $hook || 'toplevel_page_popup-settings'){
|
20 |
wp_register_script('javascript', SG_APP_POPUP_URL . '/javascript/sg_popup_backend.js', array('jquery', 'wp-color-picker'));
|
21 |
wp_enqueue_script('jquery');
|
22 |
wp_enqueue_script('javascript');
|
popup-builder.php
CHANGED
@@ -1,19 +1,24 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: Popup Builder
|
4 |
-
* Plugin URI: http://
|
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: 2.3.
|
7 |
* Author: Sygnoos
|
8 |
* Author URI: http://www.sygnoos.com
|
9 |
* License: GPLv2
|
10 |
*/
|
11 |
|
12 |
require_once(dirname(__FILE__)."/config.php");
|
|
|
|
|
|
|
|
|
13 |
|
14 |
require_once(SG_APP_POPUP_CLASSES .'/SGPopup.php');
|
15 |
require_once(SG_APP_POPUP_FILES .'/sg_functions.php');
|
16 |
require_once(SG_APP_POPUP_HELPERS .'/Integrate_external_settings.php');
|
|
|
17 |
|
18 |
require_once(SG_APP_POPUP_CLASSES .'/PopupInstaller.php'); //cretae tables
|
19 |
|
@@ -49,51 +54,16 @@ function sgPopupActivate()
|
|
49 |
|
50 |
function sgPopupDeactivate()
|
51 |
{
|
52 |
-
|
53 |
-
if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
|
54 |
-
PopupProInstaller::uninstall();
|
55 |
-
}
|
56 |
-
|
57 |
-
}
|
58 |
-
|
59 |
|
60 |
-
|
61 |
-
|
62 |
-
{
|
63 |
-
|
64 |
-
|
65 |
-
add_submenu_page("PopupBuilder", "All Popups", "All Popups", 'manage_options', "PopupBuilder", "sgPopupMenu");
|
66 |
-
add_submenu_page("PopupBuilder", "Add New", "Add New", 'manage_options', "create-popup", "sgCreatePopup");
|
67 |
-
add_submenu_page("PopupBuilder", "Edit Popup", "Edit Popup", 'manage_options', "edit-popup", "sgEditPopup");
|
68 |
-
if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_SILVER) {
|
69 |
-
add_submenu_page("PopupBuilder", "Subscribers", "Subscribers", 'manage_options', "subscribers", "sgSubscribers");
|
70 |
}
|
71 |
-
add_submenu_page("PopupBuilder", "More plugins", "More plugins", 'manage_options', "more-plugins", "showMorePlugins");
|
72 |
-
}
|
73 |
-
|
74 |
-
function sgPopupMenu()
|
75 |
-
{
|
76 |
-
require_once( SG_APP_POPUP_FILES . '/sg_popup_main.php');
|
77 |
-
}
|
78 |
-
|
79 |
-
function sgCreatePopup()
|
80 |
-
{
|
81 |
-
require_once( SG_APP_POPUP_FILES . '/sg_popup_create.php'); // here is inculde file in the first sub menu
|
82 |
}
|
83 |
|
84 |
-
function sgEditPopup()
|
85 |
-
{
|
86 |
-
require_once( SG_APP_POPUP_FILES . '/sg_popup_create_new.php');
|
87 |
-
}
|
88 |
-
|
89 |
-
function sgSubscribers()
|
90 |
-
{
|
91 |
-
require_once( SG_APP_POPUP_FILES . '/sg_subscribers.php');
|
92 |
-
}
|
93 |
-
|
94 |
-
function showMorePlugins() {
|
95 |
-
require_once( SG_APP_POPUP_FILES . '/sg_more_plugins.php');
|
96 |
-
}
|
97 |
|
98 |
function sgRegisterScripts()
|
99 |
{
|
@@ -107,8 +77,6 @@ function sgRegisterScripts()
|
|
107 |
wp_enqueue_script('jquery');
|
108 |
wp_register_script('sg_colorbox', SG_APP_POPUP_URL . '/javascript/jquery.sgcolorbox-min.js', array('jquery'), '5.0');
|
109 |
wp_enqueue_script('sg_colorbox');
|
110 |
-
wp_register_script('sg_popup_support_plugins', SG_APP_POPUP_URL . '/javascript/sg_popup_support_plugins.js', array('jquery'));
|
111 |
-
wp_enqueue_script('sg_popup_support_plugins');
|
112 |
if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
|
113 |
wp_register_script('sgPopupPro', SG_APP_POPUP_URL . '/javascript/sg_popup_pro.js?ver=4.2.3');
|
114 |
wp_enqueue_script('sgPopupPro');
|
@@ -331,14 +299,14 @@ function sgOnloadPopup()
|
|
331 |
|
332 |
/* Retrun all popups id width selected On All Pages */
|
333 |
$popupsId = SgPopupPro::allowPopupInAllPages($page);
|
334 |
-
$
|
335 |
-
$
|
336 |
|
337 |
-
if(!empty($
|
338 |
/* Add to popups Queue */
|
339 |
$popupsId = array_merge(get_option("SG_ALL_POSTS"), $popupsId);
|
340 |
}
|
341 |
-
if(!empty($
|
342 |
/* Add to popups Queue */
|
343 |
$popupsId = array_merge(get_option("SG_ALL_PAGES"), $popupsId);
|
344 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: Popup Builder
|
4 |
+
* Plugin URI: http://sygnoos.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: 2.3.5
|
7 |
* Author: Sygnoos
|
8 |
* Author URI: http://www.sygnoos.com
|
9 |
* License: GPLv2
|
10 |
*/
|
11 |
|
12 |
require_once(dirname(__FILE__)."/config.php");
|
13 |
+
require_once(SG_APP_POPUP_CLASSES .'/SGPopupBuilderMain.php');
|
14 |
+
|
15 |
+
$mainPopupObj = new SGPopupBuilderMain();
|
16 |
+
$mainPopupObj->init();
|
17 |
|
18 |
require_once(SG_APP_POPUP_CLASSES .'/SGPopup.php');
|
19 |
require_once(SG_APP_POPUP_FILES .'/sg_functions.php');
|
20 |
require_once(SG_APP_POPUP_HELPERS .'/Integrate_external_settings.php');
|
21 |
+
require_once(SG_APP_POPUP_HELPERS .'/SgPopupGetData.php');
|
22 |
|
23 |
require_once(SG_APP_POPUP_CLASSES .'/PopupInstaller.php'); //cretae tables
|
24 |
|
54 |
|
55 |
function sgPopupDeactivate()
|
56 |
{
|
57 |
+
$deleteStatus = SGFunctions::popupTablesDeleteSatus();
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
+
if($deleteStatus) {
|
60 |
+
PopupInstaller::uninstall();
|
61 |
+
if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
|
62 |
+
PopupProInstaller::uninstall();
|
63 |
+
}
|
|
|
|
|
|
|
|
|
|
|
64 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
}
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
|
68 |
function sgRegisterScripts()
|
69 |
{
|
77 |
wp_enqueue_script('jquery');
|
78 |
wp_register_script('sg_colorbox', SG_APP_POPUP_URL . '/javascript/jquery.sgcolorbox-min.js', array('jquery'), '5.0');
|
79 |
wp_enqueue_script('sg_colorbox');
|
|
|
|
|
80 |
if (POPUP_BUILDER_PKG > POPUP_BUILDER_PKG_FREE) {
|
81 |
wp_register_script('sgPopupPro', SG_APP_POPUP_URL . '/javascript/sg_popup_pro.js?ver=4.2.3');
|
82 |
wp_enqueue_script('sgPopupPro');
|
299 |
|
300 |
/* Retrun all popups id width selected On All Pages */
|
301 |
$popupsId = SgPopupPro::allowPopupInAllPages($page);
|
302 |
+
$sgpbAllPosts = get_option("SG_ALL_POSTS");
|
303 |
+
$sgpbAllPages = get_option("SG_ALL_PAGES");
|
304 |
|
305 |
+
if(!empty($sgpbAllPosts) && is_array($sgpbAllPosts) && !(is_page() || is_home() || is_front_page())) {
|
306 |
/* Add to popups Queue */
|
307 |
$popupsId = array_merge(get_option("SG_ALL_POSTS"), $popupsId);
|
308 |
}
|
309 |
+
if(!empty($sgpbAllPages) && is_array($sgpbAllPages) && (is_page() || is_home() || is_front_page())) {
|
310 |
/* Add to popups Queue */
|
311 |
$popupsId = array_merge(get_option("SG_ALL_PAGES"), $popupsId);
|
312 |
}
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
=== Popup
|
2 |
-
Plugin Name: Popup
|
3 |
Contributors: Sygnoos, Popup By Sygnoos
|
4 |
Author: Sygnoos
|
5 |
Donate link: http://popup-builder.com
|
6 |
-
Tags: popup,
|
7 |
Requires at least: 3.8
|
8 |
Tested up to: 4.5.3
|
9 |
Stable tag: trunk
|
@@ -16,7 +16,7 @@ Popup Builder is the most complete popup plugin. Html, image, shortcode and many
|
|
16 |
|
17 |
#### Popup Builder
|
18 |
|
19 |
-
Popup
|
20 |
|
21 |
https://www.youtube.com/watch?v=3ZwRKPhHMzY
|
22 |
|
@@ -36,6 +36,8 @@ With popup builder plugin you can insert any type of content, right into your Po
|
|
36 |
* Set popup location on the screen
|
37 |
* Change popup content background color
|
38 |
* Customize popup overlay color and opacity
|
|
|
|
|
39 |
* Redirect user to another page when he/she clicks on popup content
|
40 |
* Responsive popup
|
41 |
* Network/Multisite popup
|
@@ -72,9 +74,11 @@ With popup builder plugin you can insert any type of content, right into your Po
|
|
72 |
* Exit Intent popup - catch your users attention when they decide to leave your site without doing any of the things you want them to do. Exit-Intent popup can briefly interrupt them with a popup message, steering them towards a singular call to action.
|
73 |
|
74 |
* Subscription popup - this kind of popup provides the easiest way to create an efficient connection between users and your website through subscription popup. With this simple popup solution you can quickly collect subscribers in a very pleasant and elegant way.
|
75 |
-
|
76 |
* Create contact form popup - contact popup will allow your clients to write you a message right from the popup.
|
77 |
|
|
|
|
|
78 |
* Show popup only when user is scrolling - sometimes you don't want to show the popup right away, it's a good idea to set this option so the popup will be shown to the visitor only when he scrolls.
|
79 |
|
80 |
* Show popup once per visitor - useful when you don't want to show the popup to the same visitor more than once.
|
@@ -147,6 +151,14 @@ Go to the Popup Builder settings and set your desired options.
|
|
147 |
|
148 |
== Changelog ==
|
149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
= Version 2.3.4 =
|
151 |
* PHP version bug fixed.
|
152 |
|
@@ -338,11 +350,39 @@ After creating your popup, go to the desired page or post and you will see a met
|
|
338 |
|
339 |
Yes. There is an "Insert popup" button which will insert the popup shortcode over any element (text, image, button, etc.) you want. Just select the element, click on the button, choose a popup and you are done!
|
340 |
|
341 |
-
Ex. [sg_popup id="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
342 |
|
343 |
-
|
344 |
|
|
|
|
|
345 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
346 |
**How to make the Popup responsive?**
|
347 |
|
348 |
To make your popup responsive you should do the following:
|
@@ -366,7 +406,9 @@ You should enter the URL of the site you want to share.
|
|
366 |
|
367 |
**How to redirect user to specific page when he/she clicks on popup?**
|
368 |
|
369 |
-
|
|
|
|
|
370 |
|
371 |
**Can I make the video play automatically in the Video popup? (PRO)**
|
372 |
|
@@ -384,6 +426,10 @@ You can select "Use active URL" and the current page URL will be shared.
|
|
384 |
|
385 |
The Free version of Popup Builder gives you anything you need for creating unlimited fully functional popups and insert them wherever you want. Our PRO package gives you the ability to create more specific popups, like iframe, video or shortcode popups. Also, advanced options will be available for you to disable popup closing, disable popup for mobile devices, show the popup only once, and many other features. So if you need these advanced popups and functionalities, get Popup Builder PRO <a href="http://popup-builder.com">here</a>.
|
386 |
|
|
|
|
|
|
|
|
|
387 |
**Can I create a popup and make it invisible for some countries? (PRO)**
|
388 |
|
389 |
Our plugin has an option for such cases. You can select "Filter popup for selected countries" option, which allows you to select the countries in which you want the popup to be shown or hidden, because there can be some popups which you make for specific countries and you may not want them to be seen in some other countries in cases of targeting groups for your marketing. (Allow/Disallow)
|
1 |
+
=== Popup ===
|
2 |
+
Plugin Name: Popup
|
3 |
Contributors: Sygnoos, Popup By Sygnoos
|
4 |
Author: Sygnoos
|
5 |
Donate link: http://popup-builder.com
|
6 |
+
Tags: popup, pop up, modal popup, responsive popup, lightbox, youtube, video popup, iframe popup, vimeo, contact form, html popup, social popup, age restriction popup, countdown popup, facebook popup, subscription popup, exit intent popup
|
7 |
Requires at least: 3.8
|
8 |
Tested up to: 4.5.3
|
9 |
Stable tag: trunk
|
16 |
|
17 |
#### Popup Builder
|
18 |
|
19 |
+
Popup anything with Popup builder, create and manage powerful promotion popups for your WordPress blog or website. Powerful, and yet, easy to use popup plugin that will help you to grab your visitors' attention to introduce them your offers, discounts or other kind of promotional notices.
|
20 |
|
21 |
https://www.youtube.com/watch?v=3ZwRKPhHMzY
|
22 |
|
36 |
* Set popup location on the screen
|
37 |
* Change popup content background color
|
38 |
* Customize popup overlay color and opacity
|
39 |
+
* Add custom class for popup overlay
|
40 |
+
* Add custom class for popup content
|
41 |
* Redirect user to another page when he/she clicks on popup content
|
42 |
* Responsive popup
|
43 |
* Network/Multisite popup
|
74 |
* Exit Intent popup - catch your users attention when they decide to leave your site without doing any of the things you want them to do. Exit-Intent popup can briefly interrupt them with a popup message, steering them towards a singular call to action.
|
75 |
|
76 |
* Subscription popup - this kind of popup provides the easiest way to create an efficient connection between users and your website through subscription popup. With this simple popup solution you can quickly collect subscribers in a very pleasant and elegant way.
|
77 |
+
|
78 |
* Create contact form popup - contact popup will allow your clients to write you a message right from the popup.
|
79 |
|
80 |
+
* Mailchimp popup - create eye-catching, beautiful MailChimp popups to make your users sign up to the mail list right from the popup. You can set up all the design customization according to your needs and preferences!
|
81 |
+
|
82 |
* Show popup only when user is scrolling - sometimes you don't want to show the popup right away, it's a good idea to set this option so the popup will be shown to the visitor only when he scrolls.
|
83 |
|
84 |
* Show popup once per visitor - useful when you don't want to show the popup to the same visitor more than once.
|
151 |
|
152 |
== Changelog ==
|
153 |
|
154 |
+
= Version 2.3.5 =
|
155 |
+
* Added new menu item `Settings` where user can choose weather to delete tables or not. This is helpfull when user upgrades to PRO version and don't want to lost previous data.
|
156 |
+
* Third party shortcodes improvments.
|
157 |
+
* New type of popup Mailchimp (PRO).
|
158 |
+
* Bug fixed connected to onclick popup integration.
|
159 |
+
* Dimenssions fixed when using shortcode popup.
|
160 |
+
|
161 |
+
|
162 |
= Version 2.3.4 =
|
163 |
* PHP version bug fixed.
|
164 |
|
350 |
|
351 |
Yes. There is an "Insert popup" button which will insert the popup shortcode over any element (text, image, button, etc.) you want. Just select the element, click on the button, choose a popup and you are done!
|
352 |
|
353 |
+
Ex. [sg_popup id="1" event="click"]Your text, or HTML element[/sg_popup]
|
354 |
+
|
355 |
+
Ex. [sg_popup id="1" event="click" wrap="span"]Your text, which will be wraped inside span element[/sg_popup]
|
356 |
+
|
357 |
+
Ex. [sg_popup id="1" event="click"]`<img src="https://sygnoos.com/images/sygnoos_logo_grey.png">`[/sg_popup]
|
358 |
+
|
359 |
+
Alternative method in case if shortcode doesn't satisfy your needs
|
360 |
+
|
361 |
+
Adding the following class `sg-popup-id-1`
|
362 |
|
363 |
+
Example: `<span class='sg-popup-id-1'>Popup #1</span>`
|
364 |
|
365 |
+
**Can I change the wrapping element of onclick popup?**
|
366 |
+
|
367 |
|
368 |
+
Example: `[sg_popup id="1" event="click" wrap="span"]Your text, which will be wraped inside span element[/sg_popup]`
|
369 |
+
|
370 |
+
**Can I put a popup to show after hovering an element?**
|
371 |
+
|
372 |
+
Sure, you can! Just insert your text into the following code: `[sg_popup id="1" event="hover" wrap="span"]Your text, which will be wrapped inside span element[/sg_popup]`
|
373 |
+
|
374 |
+
**Can I change the wrapping element of hovering popup?**
|
375 |
+
|
376 |
+
|
377 |
+
Example: `[sg_popup id="1" event="hover" wrap="span"]Your text, which will be wraped inside span element[/sg_popup]`
|
378 |
+
|
379 |
+
**How to create a shortcode popup?**
|
380 |
+
|
381 |
+
It's a very easy thing to do, just follow the steps!
|
382 |
+
|
383 |
+
* Find "Popup Builder" plugin on the left bar
|
384 |
+
* Find the popup you created in "All popups" on the left bar
|
385 |
+
|
386 |
**How to make the Popup responsive?**
|
387 |
|
388 |
To make your popup responsive you should do the following:
|
406 |
|
407 |
**How to redirect user to specific page when he/she clicks on popup?**
|
408 |
|
409 |
+
You should create any type of popup.
|
410 |
+
|
411 |
+
|
412 |
|
413 |
**Can I make the video play automatically in the Video popup? (PRO)**
|
414 |
|
426 |
|
427 |
The Free version of Popup Builder gives you anything you need for creating unlimited fully functional popups and insert them wherever you want. Our PRO package gives you the ability to create more specific popups, like iframe, video or shortcode popups. Also, advanced options will be available for you to disable popup closing, disable popup for mobile devices, show the popup only once, and many other features. So if you need these advanced popups and functionalities, get Popup Builder PRO <a href="http://popup-builder.com">here</a>.
|
428 |
|
429 |
+
**How to upgrade to PRO version without losing popup's data?**
|
430 |
+
|
431 |
+
|
432 |
+
|
433 |
**Can I create a popup and make it invisible for some countries? (PRO)**
|
434 |
|
435 |
Our plugin has an option for such cases. You can select "Filter popup for selected countries" option, which allows you to select the countries in which you want the popup to be shown or hidden, because there can be some popups which you make for specific countries and you may not want them to be seen in some other countries in cases of targeting groups for your marketing. (Allow/Disallow)
|
style/sg_popup_style.css
CHANGED
@@ -449,6 +449,10 @@ span.phpErrorStyle {
|
|
449 |
background-image: url("../img/ContactFormButtonPro.png");
|
450 |
}
|
451 |
|
|
|
|
|
|
|
|
|
452 |
.pro-options {
|
453 |
clear: both;
|
454 |
width: 100%;
|
@@ -1096,6 +1100,11 @@ input[name="theme"] {
|
|
1096 |
padding: 30px;
|
1097 |
}
|
1098 |
|
|
|
|
|
|
|
|
|
|
|
1099 |
.sub-options-content {
|
1100 |
width: 100%;
|
1101 |
margin-left: 16px;
|
@@ -1135,6 +1144,25 @@ input[name="theme"] {
|
|
1135 |
cursor: pointer;
|
1136 |
}
|
1137 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1138 |
@media only screen and (min-width:800px) {
|
1139 |
.sgmb-container {
|
1140 |
min-width:800px;
|
449 |
background-image: url("../img/ContactFormButtonPro.png");
|
450 |
}
|
451 |
|
452 |
+
.mailchimp-pro {
|
453 |
+
background-image: url("../img/mailchimpPro.png");
|
454 |
+
}
|
455 |
+
|
456 |
.pro-options {
|
457 |
clear: both;
|
458 |
width: 100%;
|
1100 |
padding: 30px;
|
1101 |
}
|
1102 |
|
1103 |
+
.sg-review-panel {
|
1104 |
+
margin-left: 0px !important;
|
1105 |
+
margin-right: 38px !important;
|
1106 |
+
}
|
1107 |
+
|
1108 |
.sub-options-content {
|
1109 |
width: 100%;
|
1110 |
margin-left: 16px;
|
1144 |
cursor: pointer;
|
1145 |
}
|
1146 |
|
1147 |
+
/*Settings tabe style*/
|
1148 |
+
.setting-label{
|
1149 |
+
display: inline-block;
|
1150 |
+
width: 200px;
|
1151 |
+
font-size: 14px;
|
1152 |
+
color: #23282d;
|
1153 |
+
line-height: 1.3;
|
1154 |
+
font-weight: 600;
|
1155 |
+
}
|
1156 |
+
|
1157 |
+
.setting-submit-wrraper {
|
1158 |
+
margin-top: 20px;
|
1159 |
+
}
|
1160 |
+
|
1161 |
+
#sg-settings-form,.sg-settings-nots {
|
1162 |
+
width: 48%;
|
1163 |
+
display: inline-block;
|
1164 |
+
}
|
1165 |
+
|
1166 |
@media only screen and (min-width:800px) {
|
1167 |
.sgmb-container {
|
1168 |
min-width:800px;
|
style/sg_popup_style.php
CHANGED
@@ -5,6 +5,7 @@ function sg_popup_admin_style($hook) {
|
|
5 |
'popup-builder_page_edit-popup' != $hook &&
|
6 |
'popup-builder_page_sgPopupMenu' != $hook &&
|
7 |
'popup-builder_page_more-plugins' != $hook &&
|
|
|
8 |
'popup-builder_page_subscribers' != $hook) {
|
9 |
return;
|
10 |
}
|
5 |
'popup-builder_page_edit-popup' != $hook &&
|
6 |
'popup-builder_page_sgPopupMenu' != $hook &&
|
7 |
'popup-builder_page_more-plugins' != $hook &&
|
8 |
+
'popup-builder_page_popup-settings' != $hook &&
|
9 |
'popup-builder_page_subscribers' != $hook) {
|
10 |
return;
|
11 |
}
|