Version Description
Download this release
Release Info
Developer | danieliser |
Plugin | Popup Maker – Popup Forms, Optins & More |
Version | 1.17.1 |
Comparing to | |
See all releases |
Code changes from version 1.17.0 to 1.17.1
- classes/Admin/Tools.php +4 -5
- classes/Extension/License.php +60 -14
- classes/Extension/Updater.php +395 -267
- classes/Extensions.php +169 -0
- classes/Model/Popup.php +7 -1
- classes/Utils/Alerts.php +19 -1
- includes/modules/reviews.php +2 -2
- languages/popup-maker.pot +33 -24
- popup-maker.php +4 -2
- readme.txt +10 -1
classes/Admin/Tools.php
CHANGED
@@ -72,7 +72,7 @@ class PUM_Admin_Tools {
|
|
72 |
*/
|
73 |
public static function page() {
|
74 |
|
75 |
-
$active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], self::tabs() ) ? $_GET['tab'] : '
|
76 |
wp_enqueue_style( 'pum-admin-general' );
|
77 |
?>
|
78 |
|
@@ -122,10 +122,9 @@ class PUM_Admin_Tools {
|
|
122 |
$tabs = apply_filters(
|
123 |
'pum_tools_tabs',
|
124 |
[
|
125 |
-
'betas'
|
126 |
-
'error_log'
|
127 |
-
'
|
128 |
-
'import' => __( 'Import / Export', 'popup-maker' ),
|
129 |
]
|
130 |
);
|
131 |
|
72 |
*/
|
73 |
public static function page() {
|
74 |
|
75 |
+
$active_tab = isset( $_GET['tab'] ) && array_key_exists( $_GET['tab'], self::tabs() ) ? $_GET['tab'] : 'error_log';
|
76 |
wp_enqueue_style( 'pum-admin-general' );
|
77 |
?>
|
78 |
|
122 |
$tabs = apply_filters(
|
123 |
'pum_tools_tabs',
|
124 |
[
|
125 |
+
'betas' => __( 'Beta Versions', 'popup-maker' ),
|
126 |
+
'error_log' => __( 'Error Log', 'popup-maker' ),
|
127 |
+
'import' => __( 'Import / Export', 'popup-maker' ),
|
|
|
128 |
]
|
129 |
);
|
130 |
|
classes/Extension/License.php
CHANGED
@@ -1,11 +1,12 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
*
|
4 |
-
|
|
|
|
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
}
|
9 |
|
10 |
/**
|
11 |
* License handler for Popup Maker
|
@@ -18,20 +19,60 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
18 |
*/
|
19 |
class PUM_Extension_License {
|
20 |
|
|
|
|
|
|
|
|
|
|
|
21 |
private $file;
|
22 |
|
|
|
|
|
|
|
|
|
|
|
23 |
private $license;
|
24 |
|
|
|
|
|
|
|
|
|
|
|
25 |
private $item_name;
|
26 |
|
|
|
|
|
|
|
|
|
|
|
27 |
private $item_id;
|
28 |
|
|
|
|
|
|
|
|
|
|
|
29 |
private $item_shortname;
|
30 |
|
|
|
|
|
|
|
|
|
|
|
31 |
private $version;
|
32 |
|
|
|
|
|
|
|
|
|
|
|
33 |
private $author;
|
34 |
|
|
|
|
|
|
|
|
|
|
|
35 |
private $api_url = 'https://wppopupmaker.com/edd-sl-api/';
|
36 |
|
37 |
/**
|
@@ -195,6 +236,7 @@ class PUM_Extension_License {
|
|
195 |
if ( ! isset( $_POST['pum_settings'] ) ) {
|
196 |
return;
|
197 |
}
|
|
|
198 |
if ( ! isset( $_POST['pum_settings'][ $this->item_shortname . '_license_key' ] ) ) {
|
199 |
return;
|
200 |
}
|
@@ -280,10 +322,12 @@ class PUM_Extension_License {
|
|
280 |
|
281 |
// Data to send to the API
|
282 |
$api_params = [
|
283 |
-
'edd_action'
|
284 |
-
'license'
|
285 |
-
'
|
286 |
-
'
|
|
|
|
|
287 |
];
|
288 |
|
289 |
// Call the API
|
@@ -329,10 +373,12 @@ class PUM_Extension_License {
|
|
329 |
|
330 |
// data to send in our API request
|
331 |
$api_params = [
|
332 |
-
'edd_action'
|
333 |
-
'license'
|
334 |
-
'
|
335 |
-
'
|
|
|
|
|
336 |
];
|
337 |
|
338 |
// Call the API
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Popup Maker Extension Licinging.
|
4 |
+
*
|
5 |
+
* @package PUM
|
6 |
+
*/
|
7 |
|
8 |
+
// Exit if accessed directly.
|
9 |
+
defined( 'ABSPATH' ) || exit;
|
|
|
10 |
|
11 |
/**
|
12 |
* License handler for Popup Maker
|
19 |
*/
|
20 |
class PUM_Extension_License {
|
21 |
|
22 |
+
/**
|
23 |
+
* Plugin file.
|
24 |
+
*
|
25 |
+
* @var string
|
26 |
+
*/
|
27 |
private $file;
|
28 |
|
29 |
+
/**
|
30 |
+
* License key.
|
31 |
+
*
|
32 |
+
* @var string
|
33 |
+
*/
|
34 |
private $license;
|
35 |
|
36 |
+
/**
|
37 |
+
* Plugin name.
|
38 |
+
*
|
39 |
+
* @var string
|
40 |
+
*/
|
41 |
private $item_name;
|
42 |
|
43 |
+
/**
|
44 |
+
* Plugin EDD item ID.
|
45 |
+
*
|
46 |
+
* @var int
|
47 |
+
*/
|
48 |
private $item_id;
|
49 |
|
50 |
+
/**
|
51 |
+
* Plugin shortname.
|
52 |
+
*
|
53 |
+
* @var string
|
54 |
+
*/
|
55 |
private $item_shortname;
|
56 |
|
57 |
+
/**
|
58 |
+
* Plugin version.
|
59 |
+
*
|
60 |
+
* @var string
|
61 |
+
*/
|
62 |
private $version;
|
63 |
|
64 |
+
/**
|
65 |
+
* Plugin author.
|
66 |
+
*
|
67 |
+
* @var string
|
68 |
+
*/
|
69 |
private $author;
|
70 |
|
71 |
+
/**
|
72 |
+
* API URL.
|
73 |
+
*
|
74 |
+
* @var string
|
75 |
+
*/
|
76 |
private $api_url = 'https://wppopupmaker.com/edd-sl-api/';
|
77 |
|
78 |
/**
|
236 |
if ( ! isset( $_POST['pum_settings'] ) ) {
|
237 |
return;
|
238 |
}
|
239 |
+
|
240 |
if ( ! isset( $_POST['pum_settings'][ $this->item_shortname . '_license_key' ] ) ) {
|
241 |
return;
|
242 |
}
|
322 |
|
323 |
// Data to send to the API
|
324 |
$api_params = [
|
325 |
+
'edd_action' => 'deactivate_license',
|
326 |
+
'license' => $this->license,
|
327 |
+
'item_id' => $this->item_id,
|
328 |
+
'item_name' => rawurlencode( $this->item_name ),
|
329 |
+
'url' => home_url(),
|
330 |
+
'environment' => function_exists( 'wp_get_environment_type' ) ? wp_get_environment_type() : 'production',
|
331 |
];
|
332 |
|
333 |
// Call the API
|
373 |
|
374 |
// data to send in our API request
|
375 |
$api_params = [
|
376 |
+
'edd_action' => 'check_license',
|
377 |
+
'license' => $this->license,
|
378 |
+
'item_id' => $this->item_id,
|
379 |
+
'item_name' => rawurlencode( $this->item_name ),
|
380 |
+
'url' => home_url(),
|
381 |
+
'environment' => function_exists( 'wp_get_environment_type' ) ? wp_get_environment_type() : 'production',
|
382 |
];
|
383 |
|
384 |
// Call the API
|
classes/Extension/Updater.php
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
*
|
4 |
-
|
|
|
|
|
5 |
|
6 |
-
// Exit if accessed directly
|
7 |
-
|
8 |
-
exit;
|
9 |
-
}
|
10 |
|
11 |
/**
|
12 |
* Allows paid/commercial extensions to update from our own servers.
|
@@ -14,19 +14,72 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
14 |
* Note for wordpress.org admins. This is not called in the free hosted version and is simply used for hooking in addons to one update system rather than including it in each plugin.
|
15 |
*
|
16 |
* @author Easy Digital Downloads
|
17 |
-
* @version 1.
|
18 |
*/
|
19 |
class PUM_Extension_Updater {
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
private $wp_override = false;
|
27 |
-
private $cache_key = '';
|
28 |
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
/**
|
32 |
* Class constructor.
|
@@ -42,14 +95,15 @@ class PUM_Extension_Updater {
|
|
42 |
|
43 |
global $edd_plugin_data;
|
44 |
|
45 |
-
$this->api_url
|
46 |
-
$this->api_data
|
47 |
-
$this->
|
48 |
-
$this->
|
49 |
-
$this->
|
50 |
-
$this->
|
51 |
-
$this->
|
52 |
-
$this->
|
|
|
53 |
|
54 |
$edd_plugin_data[ $this->slug ] = $this->api_data;
|
55 |
|
@@ -75,13 +129,10 @@ class PUM_Extension_Updater {
|
|
75 |
* @return void
|
76 |
*/
|
77 |
public function init() {
|
78 |
-
|
79 |
add_filter( 'pre_set_site_transient_update_plugins', [ $this, 'check_update' ] );
|
80 |
add_filter( 'plugins_api', [ $this, 'plugins_api_filter' ], 10, 3 );
|
81 |
-
|
82 |
-
add_action( 'after_plugin_row_' . $this->name, [ $this, 'show_update_notification' ], 10, 2 );
|
83 |
add_action( 'admin_init', [ $this, 'show_changelog' ] );
|
84 |
-
|
85 |
}
|
86 |
|
87 |
/**
|
@@ -105,14 +156,32 @@ class PUM_Extension_Updater {
|
|
105 |
$_transient_data = new stdClass();
|
106 |
}
|
107 |
|
108 |
-
if (
|
109 |
return $_transient_data;
|
110 |
}
|
111 |
|
112 |
-
|
113 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
}
|
|
|
|
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
$version_info = $this->get_cached_version_info();
|
117 |
|
118 |
if ( false === $version_info ) {
|
@@ -123,149 +192,176 @@ class PUM_Extension_Updater {
|
|
123 |
'beta' => $this->beta,
|
124 |
]
|
125 |
);
|
|
|
|
|
|
|
126 |
|
127 |
-
|
|
|
|
|
|
|
128 |
|
|
|
129 |
}
|
130 |
|
131 |
-
|
|
|
132 |
|
133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
|
135 |
-
|
|
|
|
|
|
|
136 |
|
137 |
-
|
138 |
-
|
139 |
|
140 |
-
|
141 |
-
|
142 |
-
$
|
143 |
-
|
|
|
|
|
144 |
|
|
|
|
|
|
|
145 |
}
|
146 |
|
147 |
-
return $
|
148 |
}
|
149 |
|
150 |
/**
|
151 |
-
*
|
152 |
*
|
153 |
-
* @param string $file
|
154 |
-
* @param array $plugin
|
155 |
*/
|
156 |
public function show_update_notification( $file, $plugin ) {
|
157 |
|
158 |
-
if
|
159 |
-
|
160 |
-
}
|
161 |
-
|
162 |
-
if ( ! current_user_can( 'update_plugins' ) ) {
|
163 |
return;
|
164 |
}
|
165 |
|
166 |
-
|
|
|
167 |
return;
|
168 |
}
|
169 |
|
170 |
-
if ( $this->name
|
171 |
return;
|
172 |
}
|
173 |
|
174 |
-
//
|
175 |
-
remove_filter( 'pre_set_site_transient_update_plugins', [ $this, 'check_update' ], 10 );
|
176 |
-
|
177 |
$update_cache = get_site_transient( 'update_plugins' );
|
178 |
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
$version_info = $this->get_cached_version_info();
|
184 |
-
|
185 |
-
if ( false === $version_info ) {
|
186 |
-
$version_info = $this->api_request(
|
187 |
-
'plugin_latest_version',
|
188 |
-
[
|
189 |
-
'slug' => $this->slug,
|
190 |
-
'beta' => $this->beta,
|
191 |
-
]
|
192 |
-
);
|
193 |
-
|
194 |
-
// Since we disabled our filter for the transient, we aren't running our object conversion on banners, sections, or icons. Do this now:
|
195 |
-
if ( isset( $version_info->banners ) && ! is_array( $version_info->banners ) ) {
|
196 |
-
$version_info->banners = $this->convert_object_to_array( $version_info->banners );
|
197 |
-
}
|
198 |
-
|
199 |
-
if ( isset( $version_info->sections ) && ! is_array( $version_info->sections ) ) {
|
200 |
-
$version_info->sections = $this->convert_object_to_array( $version_info->sections );
|
201 |
-
}
|
202 |
-
|
203 |
-
if ( isset( $version_info->icons ) && ! is_array( $version_info->icons ) ) {
|
204 |
-
$version_info->icons = $this->convert_object_to_array( $version_info->icons );
|
205 |
-
}
|
206 |
-
|
207 |
-
$this->set_version_info_cache( $version_info );
|
208 |
-
}
|
209 |
-
|
210 |
-
if ( ! is_object( $version_info ) ) {
|
211 |
-
return;
|
212 |
}
|
|
|
|
|
213 |
|
214 |
-
|
|
|
|
|
|
|
215 |
|
216 |
-
|
|
|
|
|
|
|
|
|
|
|
217 |
|
218 |
-
|
|
|
219 |
|
220 |
-
|
221 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
|
223 |
-
|
|
|
|
|
|
|
|
|
224 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
225 |
} else {
|
226 |
-
|
227 |
-
|
228 |
-
|
|
|
|
|
|
|
229 |
}
|
230 |
|
231 |
-
//
|
232 |
-
|
233 |
|
234 |
-
|
235 |
-
|
236 |
-
// build a plugin list row, with update notification
|
237 |
-
$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
|
238 |
-
// <tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange">
|
239 |
-
echo '<tr class="plugin-update-tr" id="' . $this->slug . '-update" data-slug="' . $this->slug . '" data-plugin="' . $this->slug . '/' . $file . '">';
|
240 |
-
echo '<td colspan="3" class="plugin-update colspanchange">';
|
241 |
-
echo '<div class="update-message notice inline notice-warning notice-alt">';
|
242 |
-
|
243 |
-
$changelog_link = self_admin_url( 'index.php?edd_sl_action=view_plugin_changelog&plugin=' . $this->name . '&slug=' . $this->slug . '&TB_iframe=true&width=772&height=911' );
|
244 |
-
|
245 |
-
if ( empty( $version_info->download_link ) ) {
|
246 |
-
printf(
|
247 |
-
__( 'There is a new version of %1$s available. %2$sView version %3$s details%4$s.', 'popup-maker' ),
|
248 |
-
esc_html( $version_info->name ),
|
249 |
-
'<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
|
250 |
-
esc_html( $version_info->new_version ),
|
251 |
-
'</a>'
|
252 |
-
);
|
253 |
-
} else {
|
254 |
-
printf(
|
255 |
-
__( 'There is a new version of %1$s available. %2$sView version %3$s details%4$s or %5$supdate now%6$s.', 'popup-maker' ),
|
256 |
-
esc_html( $version_info->name ),
|
257 |
-
'<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
|
258 |
-
esc_html( $version_info->new_version ),
|
259 |
-
'</a>',
|
260 |
-
'<a href="' . esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) ) . '">',
|
261 |
-
'</a>'
|
262 |
-
);
|
263 |
-
}
|
264 |
|
265 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
266 |
|
267 |
-
|
268 |
-
}
|
269 |
}
|
270 |
|
271 |
/**
|
@@ -273,20 +369,20 @@ class PUM_Extension_Updater {
|
|
273 |
*
|
274 |
* @uses api_request()
|
275 |
*
|
276 |
-
* @param mixed $_data
|
277 |
-
* @param string $_action
|
278 |
-
* @param object $_args
|
279 |
* @return object $_data
|
280 |
*/
|
281 |
public function plugins_api_filter( $_data, $_action = '', $_args = null ) {
|
282 |
|
283 |
-
if (
|
284 |
|
285 |
return $_data;
|
286 |
|
287 |
}
|
288 |
|
289 |
-
if ( ! isset( $_args->slug ) || ( $_args->slug
|
290 |
|
291 |
return $_data;
|
292 |
|
@@ -302,18 +398,16 @@ class PUM_Extension_Updater {
|
|
302 |
],
|
303 |
];
|
304 |
|
305 |
-
|
306 |
-
|
307 |
-
// Get the transient where we store the api request for this plugin for 24 hours
|
308 |
-
$edd_api_request_transient = $this->get_cached_version_info( $cache_key );
|
309 |
|
310 |
// If we have no transient-saved value, run the API, set a fresh transient with the API value, and return that value too right now.
|
311 |
if ( empty( $edd_api_request_transient ) ) {
|
312 |
|
313 |
$api_response = $this->api_request( 'plugin_information', $to_send );
|
314 |
|
315 |
-
// Expires in 3 hours
|
316 |
-
$this->set_version_info_cache( $api_response
|
317 |
|
318 |
if ( false !== $api_response ) {
|
319 |
$_data = $api_response;
|
@@ -337,6 +431,11 @@ class PUM_Extension_Updater {
|
|
337 |
$_data->icons = $this->convert_object_to_array( $_data->icons );
|
338 |
}
|
339 |
|
|
|
|
|
|
|
|
|
|
|
340 |
if ( ! isset( $_data->plugin ) ) {
|
341 |
$_data->plugin = $this->name;
|
342 |
}
|
@@ -352,14 +451,17 @@ class PUM_Extension_Updater {
|
|
352 |
*
|
353 |
* @since 3.6.5
|
354 |
*
|
355 |
-
* @param stdClass $data
|
356 |
*
|
357 |
* @return array
|
358 |
*/
|
359 |
private function convert_object_to_array( $data ) {
|
|
|
|
|
|
|
360 |
$new_data = [];
|
361 |
foreach ( $data as $key => $value ) {
|
362 |
-
$new_data[ $key ] = $value;
|
363 |
}
|
364 |
|
365 |
return $new_data;
|
@@ -368,15 +470,14 @@ class PUM_Extension_Updater {
|
|
368 |
/**
|
369 |
* Disable SSL verification in order to prevent download update failures
|
370 |
*
|
371 |
-
* @param array $args
|
372 |
-
* @param string $url
|
373 |
* @return object $array
|
374 |
*/
|
375 |
public function http_request_args( $args, $url ) {
|
376 |
|
377 |
-
$verify_ssl = $this->verify_ssl();
|
378 |
if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
|
379 |
-
$args['sslverify'] = $verify_ssl;
|
380 |
}
|
381 |
return $args;
|
382 |
|
@@ -391,77 +492,151 @@ class PUM_Extension_Updater {
|
|
391 |
*
|
392 |
* @param string $_action The requested action.
|
393 |
* @param array $_data Parameters for the API action.
|
394 |
-
* @return false|object
|
395 |
*/
|
396 |
private function api_request( $_action, $_data ) {
|
|
|
397 |
|
398 |
-
|
|
|
|
|
399 |
|
400 |
-
|
|
|
|
|
|
|
401 |
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
$test_url_parts = parse_url( $this->api_url );
|
406 |
|
407 |
-
|
408 |
-
|
409 |
-
$port = ! empty( $test_url_parts['port'] ) ? ':' . $test_url_parts['port'] : '';
|
410 |
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
424 |
}
|
425 |
|
426 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
427 |
return;
|
428 |
}
|
429 |
|
430 |
-
|
|
|
|
|
431 |
|
432 |
-
if ( $
|
433 |
return;
|
434 |
}
|
435 |
|
436 |
-
|
437 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
438 |
}
|
439 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
440 |
$api_params = [
|
441 |
-
'edd_action'
|
442 |
-
'license'
|
443 |
-
'item_name'
|
444 |
-
'item_id'
|
445 |
-
'version'
|
446 |
-
'slug'
|
447 |
-
'author'
|
448 |
-
'url'
|
449 |
-
'beta'
|
|
|
|
|
450 |
];
|
451 |
|
452 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
453 |
$this->api_url,
|
454 |
[
|
455 |
'timeout' => 15,
|
456 |
-
'sslverify' => $verify_ssl,
|
457 |
'body' => $api_params,
|
458 |
]
|
459 |
);
|
460 |
|
461 |
-
if (
|
462 |
-
$
|
|
|
|
|
463 |
}
|
464 |
|
|
|
|
|
465 |
if ( $request && isset( $request->sections ) ) {
|
466 |
$request->sections = maybe_unserialize( $request->sections );
|
467 |
} else {
|
@@ -485,90 +660,23 @@ class PUM_Extension_Updater {
|
|
485 |
return $request;
|
486 |
}
|
487 |
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
}
|
495 |
-
|
496 |
-
if ( empty( $_REQUEST['plugin'] ) ) {
|
497 |
-
return;
|
498 |
-
}
|
499 |
-
|
500 |
-
if ( empty( $_REQUEST['slug'] ) ) {
|
501 |
-
return;
|
502 |
-
}
|
503 |
-
|
504 |
-
if ( ! current_user_can( 'update_plugins' ) ) {
|
505 |
-
wp_die( __( 'You do not have permission to install plugin updates', 'popup-maker' ), __( 'Error', 'popup-maker' ), [ 'response' => 403 ] );
|
506 |
-
}
|
507 |
-
|
508 |
-
$data = $edd_plugin_data[ $_REQUEST['slug'] ];
|
509 |
-
$beta = ! empty( $data['beta'] ) ? true : false;
|
510 |
-
$cache_key = md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $beta . '_version_info' );
|
511 |
-
$version_info = $this->get_cached_version_info( $cache_key );
|
512 |
-
|
513 |
-
if ( false === $version_info ) {
|
514 |
-
|
515 |
-
$api_params = [
|
516 |
-
'edd_action' => 'get_version',
|
517 |
-
'item_name' => isset( $data['item_name'] ) ? $data['item_name'] : false,
|
518 |
-
'item_id' => isset( $data['item_id'] ) ? $data['item_id'] : false,
|
519 |
-
'slug' => $_REQUEST['slug'],
|
520 |
-
'author' => $data['author'],
|
521 |
-
'url' => home_url(),
|
522 |
-
'beta' => ! empty( $data['beta'] ),
|
523 |
-
];
|
524 |
-
|
525 |
-
$verify_ssl = $this->verify_ssl();
|
526 |
-
$request = wp_remote_get(
|
527 |
-
$this->api_url,
|
528 |
-
[
|
529 |
-
'timeout' => 15,
|
530 |
-
'sslverify' => $verify_ssl,
|
531 |
-
'body' => $api_params,
|
532 |
-
]
|
533 |
-
);
|
534 |
-
|
535 |
-
if ( ! is_wp_error( $request ) ) {
|
536 |
-
$version_info = json_decode( wp_remote_retrieve_body( $request ) );
|
537 |
-
}
|
538 |
-
|
539 |
-
if ( ! empty( $version_info ) && isset( $version_info->sections ) ) {
|
540 |
-
$version_info->sections = maybe_unserialize( $version_info->sections );
|
541 |
-
} else {
|
542 |
-
$version_info = false;
|
543 |
-
}
|
544 |
-
|
545 |
-
if ( ! empty( $version_info ) ) {
|
546 |
-
foreach ( $version_info->sections as $key => $section ) {
|
547 |
-
$version_info->$key = (array) $section;
|
548 |
-
}
|
549 |
-
}
|
550 |
-
|
551 |
-
$this->set_version_info_cache( $version_info, $cache_key );
|
552 |
-
|
553 |
-
}
|
554 |
-
|
555 |
-
if ( ! empty( $version_info ) && isset( $version_info->sections['changelog'] ) ) {
|
556 |
-
echo '<div style="background:#fff;padding:10px;">' . $version_info->sections['changelog'] . '</div>';
|
557 |
-
}
|
558 |
-
|
559 |
-
exit;
|
560 |
-
}
|
561 |
-
|
562 |
public function get_cached_version_info( $cache_key = '' ) {
|
563 |
|
564 |
if ( empty( $cache_key ) ) {
|
565 |
-
$cache_key = $this->
|
566 |
}
|
567 |
|
568 |
$cache = get_option( $cache_key );
|
569 |
|
|
|
570 |
if ( empty( $cache['timeout'] ) || time() > $cache['timeout'] ) {
|
571 |
-
return false;
|
572 |
}
|
573 |
|
574 |
// We need to turn the icons into an array, thanks to WP Core forcing these into an object at some point.
|
@@ -581,19 +689,27 @@ class PUM_Extension_Updater {
|
|
581 |
|
582 |
}
|
583 |
|
|
|
|
|
|
|
|
|
|
|
|
|
584 |
public function set_version_info_cache( $value = '', $cache_key = '' ) {
|
585 |
|
586 |
if ( empty( $cache_key ) ) {
|
587 |
-
$cache_key = $this->
|
588 |
}
|
589 |
|
590 |
$data = [
|
591 |
'timeout' => strtotime( '+3 hours', time() ),
|
592 |
-
'value' =>
|
593 |
];
|
594 |
|
595 |
update_option( $cache_key, $data, 'no' );
|
596 |
|
|
|
|
|
597 |
}
|
598 |
|
599 |
/**
|
@@ -606,4 +722,16 @@ class PUM_Extension_Updater {
|
|
606 |
return (bool) apply_filters( 'edd_sl_api_request_verify_ssl', true, $this );
|
607 |
}
|
608 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
609 |
}
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Popup Maker Extension Updater
|
4 |
+
*
|
5 |
+
* @package PUM
|
6 |
+
*/
|
7 |
|
8 |
+
// Exit if accessed directly.
|
9 |
+
defined( 'ABSPATH' ) || exit;
|
|
|
|
|
10 |
|
11 |
/**
|
12 |
* Allows paid/commercial extensions to update from our own servers.
|
14 |
* Note for wordpress.org admins. This is not called in the free hosted version and is simply used for hooking in addons to one update system rather than including it in each plugin.
|
15 |
*
|
16 |
* @author Easy Digital Downloads
|
17 |
+
* @version 1.9.2
|
18 |
*/
|
19 |
class PUM_Extension_Updater {
|
20 |
|
21 |
+
/**
|
22 |
+
* The plugin file.
|
23 |
+
*
|
24 |
+
* @var string
|
25 |
+
*/
|
26 |
+
private $api_url = '';
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Array of plugin api data.
|
30 |
+
*
|
31 |
+
* @var array
|
32 |
+
*/
|
33 |
+
private $api_data = [];
|
34 |
+
|
35 |
+
/**
|
36 |
+
* The plugin file.
|
37 |
+
*
|
38 |
+
* @var string
|
39 |
+
*/
|
40 |
+
private $plugin_file = '';
|
41 |
+
|
42 |
+
/**
|
43 |
+
* The plugin name.
|
44 |
+
*
|
45 |
+
* @var string
|
46 |
+
*/
|
47 |
+
private $name = '';
|
48 |
+
|
49 |
+
/**
|
50 |
+
* The plugin slug.
|
51 |
+
*
|
52 |
+
* @var string
|
53 |
+
*/
|
54 |
+
private $slug = '';
|
55 |
+
|
56 |
+
/**
|
57 |
+
* The plugin version.
|
58 |
+
*
|
59 |
+
* @var string
|
60 |
+
*/
|
61 |
+
private $version = '';
|
62 |
+
|
63 |
+
/**
|
64 |
+
* WP override boolean.
|
65 |
+
*
|
66 |
+
* @var bool
|
67 |
+
*/
|
68 |
private $wp_override = false;
|
|
|
69 |
|
70 |
+
/**
|
71 |
+
* Allow beta updates.
|
72 |
+
*
|
73 |
+
* @var bool
|
74 |
+
*/
|
75 |
+
private $beta = false;
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Failed request cache key.
|
79 |
+
*
|
80 |
+
* @var string
|
81 |
+
*/
|
82 |
+
private $failed_request_cache_key;
|
83 |
|
84 |
/**
|
85 |
* Class constructor.
|
95 |
|
96 |
global $edd_plugin_data;
|
97 |
|
98 |
+
$this->api_url = trailingslashit( $_api_url );
|
99 |
+
$this->api_data = $_api_data;
|
100 |
+
$this->plugin_file = $_plugin_file;
|
101 |
+
$this->name = plugin_basename( $_plugin_file );
|
102 |
+
$this->slug = basename( $_plugin_file, '.php' );
|
103 |
+
$this->version = $_api_data['version'];
|
104 |
+
$this->wp_override = isset( $_api_data['wp_override'] ) ? (bool) $_api_data['wp_override'] : false;
|
105 |
+
$this->beta = ! empty( $this->api_data['beta'] ) ? true : false;
|
106 |
+
$this->failed_request_cache_key = 'edd_sl_failed_http_' . md5( $this->api_url );
|
107 |
|
108 |
$edd_plugin_data[ $this->slug ] = $this->api_data;
|
109 |
|
129 |
* @return void
|
130 |
*/
|
131 |
public function init() {
|
|
|
132 |
add_filter( 'pre_set_site_transient_update_plugins', [ $this, 'check_update' ] );
|
133 |
add_filter( 'plugins_api', [ $this, 'plugins_api_filter' ], 10, 3 );
|
134 |
+
add_action( 'after_plugin_row', [ $this, 'show_update_notification' ], 10, 2 );
|
|
|
135 |
add_action( 'admin_init', [ $this, 'show_changelog' ] );
|
|
|
136 |
}
|
137 |
|
138 |
/**
|
156 |
$_transient_data = new stdClass();
|
157 |
}
|
158 |
|
159 |
+
if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[ $this->name ] ) && false === $this->wp_override ) {
|
160 |
return $_transient_data;
|
161 |
}
|
162 |
|
163 |
+
$current = $this->get_repo_api_data();
|
164 |
+
if ( false !== $current && is_object( $current ) && isset( $current->new_version ) ) {
|
165 |
+
if ( version_compare( $this->version, $current->new_version, '<' ) ) {
|
166 |
+
$_transient_data->response[ $this->name ] = $current;
|
167 |
+
} else {
|
168 |
+
// Populating the no_update information is required to support auto-updates in WordPress 5.5.
|
169 |
+
$_transient_data->no_update[ $this->name ] = $current;
|
170 |
+
}
|
171 |
}
|
172 |
+
$_transient_data->last_checked = time();
|
173 |
+
$_transient_data->checked[ $this->name ] = $this->version;
|
174 |
|
175 |
+
return $_transient_data;
|
176 |
+
}
|
177 |
+
|
178 |
+
/**
|
179 |
+
* Get repo API data from store.
|
180 |
+
* Save to cache.
|
181 |
+
*
|
182 |
+
* @return \stdClass
|
183 |
+
*/
|
184 |
+
public function get_repo_api_data() {
|
185 |
$version_info = $this->get_cached_version_info();
|
186 |
|
187 |
if ( false === $version_info ) {
|
192 |
'beta' => $this->beta,
|
193 |
]
|
194 |
);
|
195 |
+
if ( ! $version_info ) {
|
196 |
+
return false;
|
197 |
+
}
|
198 |
|
199 |
+
// This is required for your plugin to support auto-updates in WordPress 5.5.
|
200 |
+
$version_info->plugin = $this->name;
|
201 |
+
$version_info->id = $this->name;
|
202 |
+
$version_info->tested = $this->get_tested_version( $version_info );
|
203 |
|
204 |
+
$this->set_version_info_cache( $version_info );
|
205 |
}
|
206 |
|
207 |
+
return $version_info;
|
208 |
+
}
|
209 |
|
210 |
+
/**
|
211 |
+
* Gets the plugin's tested version.
|
212 |
+
*
|
213 |
+
* @since 1.9.2
|
214 |
+
* @param object $version_info The plugin's version info.
|
215 |
+
* @return null|string
|
216 |
+
*/
|
217 |
+
private function get_tested_version( $version_info ) {
|
218 |
|
219 |
+
// There is no tested version.
|
220 |
+
if ( empty( $version_info->tested ) ) {
|
221 |
+
return null;
|
222 |
+
}
|
223 |
|
224 |
+
// Strip off extra version data so the result is x.y or x.y.z.
|
225 |
+
list( $current_wp_version ) = explode( '-', get_bloginfo( 'version' ) );
|
226 |
|
227 |
+
// The tested version is greater than or equal to the current WP version, no need to do anything.
|
228 |
+
if ( version_compare( $version_info->tested, $current_wp_version, '>=' ) ) {
|
229 |
+
return $version_info->tested;
|
230 |
+
}
|
231 |
+
$current_version_parts = explode( '.', $current_wp_version );
|
232 |
+
$tested_parts = explode( '.', $version_info->tested );
|
233 |
|
234 |
+
// The current WordPress version is x.y.z, so update the tested version to match it.
|
235 |
+
if ( isset( $current_version_parts[2] ) && $current_version_parts[0] === $tested_parts[0] && $current_version_parts[1] === $tested_parts[1] ) {
|
236 |
+
$tested_parts[2] = $current_version_parts[2];
|
237 |
}
|
238 |
|
239 |
+
return implode( '.', $tested_parts );
|
240 |
}
|
241 |
|
242 |
/**
|
243 |
+
* Show the update notification on multisite subsites.
|
244 |
*
|
245 |
+
* @param string $file Plugin file.
|
246 |
+
* @param array $plugin Plugin data.
|
247 |
*/
|
248 |
public function show_update_notification( $file, $plugin ) {
|
249 |
|
250 |
+
// Return early if in the network admin, or if this is not a multisite install.
|
251 |
+
if ( is_network_admin() || ! is_multisite() ) {
|
|
|
|
|
|
|
252 |
return;
|
253 |
}
|
254 |
|
255 |
+
// Allow single site admins to see that an update is available.
|
256 |
+
if ( ! current_user_can( 'activate_plugins' ) ) {
|
257 |
return;
|
258 |
}
|
259 |
|
260 |
+
if ( $this->name !== $file ) {
|
261 |
return;
|
262 |
}
|
263 |
|
264 |
+
// Do not print any message if update does not exist.
|
|
|
|
|
265 |
$update_cache = get_site_transient( 'update_plugins' );
|
266 |
|
267 |
+
if ( ! isset( $update_cache->response[ $this->name ] ) ) {
|
268 |
+
if ( ! is_object( $update_cache ) ) {
|
269 |
+
$update_cache = new stdClass();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
}
|
271 |
+
$update_cache->response[ $this->name ] = $this->get_repo_api_data();
|
272 |
+
}
|
273 |
|
274 |
+
// Return early if this plugin isn't in the transient->response or if the site is running the current or newer version of the plugin.
|
275 |
+
if ( empty( $update_cache->response[ $this->name ] ) || version_compare( $this->version, $update_cache->response[ $this->name ]->new_version, '>=' ) ) {
|
276 |
+
return;
|
277 |
+
}
|
278 |
|
279 |
+
printf(
|
280 |
+
'<tr class="plugin-update-tr %3$s" id="%1$s-update" data-slug="%1$s" data-plugin="%2$s">',
|
281 |
+
$this->slug,
|
282 |
+
$file,
|
283 |
+
in_array( $this->name, $this->get_active_plugins(), true ) ? 'active' : 'inactive'
|
284 |
+
);
|
285 |
|
286 |
+
echo '<td colspan="3" class="plugin-update colspanchange">';
|
287 |
+
echo '<div class="update-message notice inline notice-warning notice-alt"><p>';
|
288 |
|
289 |
+
$changelog_link = '';
|
290 |
+
if ( ! empty( $update_cache->response[ $this->name ]->sections->changelog ) ) {
|
291 |
+
$changelog_link = add_query_arg(
|
292 |
+
[
|
293 |
+
'edd_sl_action' => 'view_plugin_changelog',
|
294 |
+
'plugin' => rawurlencode( $this->name ),
|
295 |
+
'slug' => rawurlencode( $this->slug ),
|
296 |
+
'TB_iframe' => 'true',
|
297 |
+
'width' => 77,
|
298 |
+
'height' => 911,
|
299 |
+
],
|
300 |
+
self_admin_url( 'index.php' )
|
301 |
+
);
|
302 |
+
}
|
303 |
+
$update_link = add_query_arg(
|
304 |
+
[
|
305 |
+
'action' => 'upgrade-plugin',
|
306 |
+
'plugin' => rawurlencode( $this->name ),
|
307 |
+
],
|
308 |
+
self_admin_url( 'update.php' )
|
309 |
+
);
|
310 |
|
311 |
+
printf(
|
312 |
+
/* translators: the plugin name. */
|
313 |
+
esc_html__( 'There is a new version of %1$s available.', 'popup-maker' ),
|
314 |
+
esc_html( $plugin['Name'] )
|
315 |
+
);
|
316 |
|
317 |
+
if ( ! current_user_can( 'update_plugins' ) ) {
|
318 |
+
echo ' ';
|
319 |
+
esc_html_e( 'Contact your network administrator to install the update.', 'popup-maker' );
|
320 |
+
} elseif ( empty( $update_cache->response[ $this->name ]->package ) && ! empty( $changelog_link ) ) {
|
321 |
+
echo ' ';
|
322 |
+
printf(
|
323 |
+
/* translators: 1. opening anchor tag, do not translate 2. the new plugin version 3. closing anchor tag, do not translate. */
|
324 |
+
wp_kses_post( __( '%1$sView version %2$s details%3$s.', 'popup-maker' ) ),
|
325 |
+
'<a target="_blank" class="thickbox open-plugin-details-modal" href="' . esc_url( $changelog_link ) . '">',
|
326 |
+
esc_html( $update_cache->response[ $this->name ]->new_version ),
|
327 |
+
'</a>'
|
328 |
+
);
|
329 |
+
} elseif ( ! empty( $changelog_link ) ) {
|
330 |
+
echo ' ';
|
331 |
+
printf(
|
332 |
+
/* translators: 1. opening anchor tag, do not translate 2. the new plugin version 3. closing anchor tag, do not translate 4. opening anchor tag, do not translate 5. closing anchor tag, do not translate</a>. */
|
333 |
+
wp_kses_post( __( '%1$sView version %2$s details%3$s or %4$supdate now%5$s.', 'popup-maker' ) ),
|
334 |
+
'<a target="_blank" class="thickbox open-plugin-details-modal" href="' . esc_url( $changelog_link ) . '">',
|
335 |
+
esc_html( $update_cache->response[ $this->name ]->new_version ),
|
336 |
+
'</a>',
|
337 |
+
'<a target="_blank" class="update-link" href="' . esc_url( wp_nonce_url( $update_link, 'upgrade-plugin_' . $file ) ) . '">',
|
338 |
+
'</a>'
|
339 |
+
);
|
340 |
} else {
|
341 |
+
printf(
|
342 |
+
' %1$s%2$s%3$s',
|
343 |
+
'<a target="_blank" class="update-link" href="' . esc_url( wp_nonce_url( $update_link, 'upgrade-plugin_' . $file ) ) . '">',
|
344 |
+
esc_html__( 'Update now.', 'popup-maker' ),
|
345 |
+
'</a>'
|
346 |
+
);
|
347 |
}
|
348 |
|
349 |
+
// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
|
350 |
+
do_action( "in_plugin_update_message-{$file}", $plugin, $plugin );
|
351 |
|
352 |
+
echo '</p></div></td></tr>';
|
353 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
354 |
|
355 |
+
/**
|
356 |
+
* Gets the plugins active in a multisite network.
|
357 |
+
*
|
358 |
+
* @return array
|
359 |
+
*/
|
360 |
+
private function get_active_plugins() {
|
361 |
+
$active_plugins = (array) get_option( 'active_plugins' );
|
362 |
+
$active_network_plugins = (array) get_site_option( 'active_sitewide_plugins' );
|
363 |
|
364 |
+
return array_merge( $active_plugins, array_keys( $active_network_plugins ) );
|
|
|
365 |
}
|
366 |
|
367 |
/**
|
369 |
*
|
370 |
* @uses api_request()
|
371 |
*
|
372 |
+
* @param mixed $_data Plugin data.
|
373 |
+
* @param string $_action The type of information being requested from the Plugin Installation API.
|
374 |
+
* @param object $_args Plugin API arguments.
|
375 |
* @return object $_data
|
376 |
*/
|
377 |
public function plugins_api_filter( $_data, $_action = '', $_args = null ) {
|
378 |
|
379 |
+
if ( 'plugin_information' !== $_action ) {
|
380 |
|
381 |
return $_data;
|
382 |
|
383 |
}
|
384 |
|
385 |
+
if ( ! isset( $_args->slug ) || ( $_args->slug !== $this->slug ) ) {
|
386 |
|
387 |
return $_data;
|
388 |
|
398 |
],
|
399 |
];
|
400 |
|
401 |
+
// Get the transient where we store the api request for this plugin for 24 hours.
|
402 |
+
$edd_api_request_transient = $this->get_cached_version_info();
|
|
|
|
|
403 |
|
404 |
// If we have no transient-saved value, run the API, set a fresh transient with the API value, and return that value too right now.
|
405 |
if ( empty( $edd_api_request_transient ) ) {
|
406 |
|
407 |
$api_response = $this->api_request( 'plugin_information', $to_send );
|
408 |
|
409 |
+
// Expires in 3 hours.
|
410 |
+
$this->set_version_info_cache( $api_response );
|
411 |
|
412 |
if ( false !== $api_response ) {
|
413 |
$_data = $api_response;
|
431 |
$_data->icons = $this->convert_object_to_array( $_data->icons );
|
432 |
}
|
433 |
|
434 |
+
// Convert contributors into an associative array, since we're getting an object, but Core expects an array.
|
435 |
+
if ( isset( $_data->contributors ) && ! is_array( $_data->contributors ) ) {
|
436 |
+
$_data->contributors = $this->convert_object_to_array( $_data->contributors );
|
437 |
+
}
|
438 |
+
|
439 |
if ( ! isset( $_data->plugin ) ) {
|
440 |
$_data->plugin = $this->name;
|
441 |
}
|
451 |
*
|
452 |
* @since 3.6.5
|
453 |
*
|
454 |
+
* @param stdClass $data The object to convert to an array.
|
455 |
*
|
456 |
* @return array
|
457 |
*/
|
458 |
private function convert_object_to_array( $data ) {
|
459 |
+
if ( ! is_array( $data ) && ! is_object( $data ) ) {
|
460 |
+
return [];
|
461 |
+
}
|
462 |
$new_data = [];
|
463 |
foreach ( $data as $key => $value ) {
|
464 |
+
$new_data[ $key ] = is_object( $value ) ? $this->convert_object_to_array( $value ) : $value;
|
465 |
}
|
466 |
|
467 |
return $new_data;
|
470 |
/**
|
471 |
* Disable SSL verification in order to prevent download update failures
|
472 |
*
|
473 |
+
* @param array $args Args to be passed to wp_remote_get.
|
474 |
+
* @param string $url Url string.
|
475 |
* @return object $array
|
476 |
*/
|
477 |
public function http_request_args( $args, $url ) {
|
478 |
|
|
|
479 |
if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
|
480 |
+
$args['sslverify'] = $this->verify_ssl();
|
481 |
}
|
482 |
return $args;
|
483 |
|
492 |
*
|
493 |
* @param string $_action The requested action.
|
494 |
* @param array $_data Parameters for the API action.
|
495 |
+
* @return false|object|void
|
496 |
*/
|
497 |
private function api_request( $_action, $_data ) {
|
498 |
+
$data = array_merge( $this->api_data, $_data );
|
499 |
|
500 |
+
if ( $data['slug'] !== $this->slug ) {
|
501 |
+
return;
|
502 |
+
}
|
503 |
|
504 |
+
// Don't allow a plugin to ping itself.
|
505 |
+
if ( trailingslashit( home_url() ) === $this->api_url ) {
|
506 |
+
return false;
|
507 |
+
}
|
508 |
|
509 |
+
if ( $this->request_recently_failed() ) {
|
510 |
+
return false;
|
511 |
+
}
|
|
|
512 |
|
513 |
+
return $this->get_version_from_remote();
|
514 |
+
}
|
|
|
515 |
|
516 |
+
/**
|
517 |
+
* Determines if a request has recently failed.
|
518 |
+
*
|
519 |
+
* @since 1.9.1
|
520 |
+
*
|
521 |
+
* @return bool
|
522 |
+
*/
|
523 |
+
private function request_recently_failed() {
|
524 |
+
$failed_request_details = get_option( $this->failed_request_cache_key );
|
525 |
+
|
526 |
+
// Request has never failed.
|
527 |
+
if ( empty( $failed_request_details ) || ! is_numeric( $failed_request_details ) ) {
|
528 |
+
return false;
|
529 |
+
}
|
530 |
+
|
531 |
+
/*
|
532 |
+
* Request previously failed, but the timeout has expired.
|
533 |
+
* This means we're allowed to try again.
|
534 |
+
*/
|
535 |
+
if ( time() > $failed_request_details ) {
|
536 |
+
delete_option( $this->failed_request_cache_key );
|
537 |
+
|
538 |
+
return false;
|
539 |
}
|
540 |
|
541 |
+
return true;
|
542 |
+
}
|
543 |
+
|
544 |
+
/**
|
545 |
+
* Logs a failed HTTP request for this API URL.
|
546 |
+
* We set a timestamp for 1 hour from now. This prevents future API requests from being
|
547 |
+
* made to this domain for 1 hour. Once the timestamp is in the past, API requests
|
548 |
+
* will be allowed again. This way if the site is down for some reason we don't bombard
|
549 |
+
* it with failed API requests.
|
550 |
+
*
|
551 |
+
* @see EDD_SL_Plugin_Updater::request_recently_failed
|
552 |
+
*
|
553 |
+
* @since 1.9.1
|
554 |
+
*/
|
555 |
+
private function log_failed_request() {
|
556 |
+
update_option( $this->failed_request_cache_key, strtotime( '+1 hour' ) );
|
557 |
+
}
|
558 |
+
|
559 |
+
/**
|
560 |
+
* If available, show the changelog for sites in a multisite install.
|
561 |
+
*/
|
562 |
+
public function show_changelog() {
|
563 |
+
// phpcs:disable WordPress.Security.NonceVerification.Recommended
|
564 |
+
|
565 |
+
if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' !== $_REQUEST['edd_sl_action'] ) {
|
566 |
return;
|
567 |
}
|
568 |
|
569 |
+
if ( empty( $_REQUEST['plugin'] ) ) {
|
570 |
+
return;
|
571 |
+
}
|
572 |
|
573 |
+
if ( empty( $_REQUEST['slug'] ) || $this->slug !== $_REQUEST['slug'] ) {
|
574 |
return;
|
575 |
}
|
576 |
|
577 |
+
// phpcs:enable WordPress.Security.NonceVerification.Recommended
|
578 |
+
|
579 |
+
if ( ! current_user_can( 'update_plugins' ) ) {
|
580 |
+
wp_die( esc_html__( 'You do not have permission to install plugin updates', 'popup-maker' ), esc_html__( 'Error', 'popup-maker' ), [ 'response' => 403 ] );
|
581 |
+
}
|
582 |
+
|
583 |
+
$version_info = $this->get_repo_api_data();
|
584 |
+
if ( isset( $version_info->sections ) ) {
|
585 |
+
$sections = $this->convert_object_to_array( $version_info->sections );
|
586 |
+
if ( ! empty( $sections['changelog'] ) ) {
|
587 |
+
echo '<div style="background:#fff;padding:10px;">' . wp_kses_post( $sections['changelog'] ) . '</div>';
|
588 |
+
}
|
589 |
}
|
590 |
|
591 |
+
exit;
|
592 |
+
}
|
593 |
+
|
594 |
+
/**
|
595 |
+
* Gets the current version information from the remote site.
|
596 |
+
*
|
597 |
+
* @return array|false
|
598 |
+
*/
|
599 |
+
private function get_version_from_remote() {
|
600 |
$api_params = [
|
601 |
+
'edd_action' => 'get_version',
|
602 |
+
'license' => ! empty( $this->api_data['license'] ) ? $this->api_data['license'] : '',
|
603 |
+
'item_name' => isset( $this->api_data['item_name'] ) ? $this->api_data['item_name'] : false,
|
604 |
+
'item_id' => isset( $this->api_data['item_id'] ) ? $this->api_data['item_id'] : false,
|
605 |
+
'version' => isset( $this->api_data['version'] ) ? $this->api_data['version'] : false,
|
606 |
+
'slug' => $this->slug,
|
607 |
+
'author' => $this->api_data['author'],
|
608 |
+
'url' => home_url(),
|
609 |
+
'beta' => $this->beta,
|
610 |
+
'php_version' => phpversion(),
|
611 |
+
'wp_version' => get_bloginfo( 'version' ),
|
612 |
];
|
613 |
|
614 |
+
/**
|
615 |
+
* Filters the parameters sent in the API request.
|
616 |
+
*
|
617 |
+
* @param array $api_params The array of data sent in the request.
|
618 |
+
* @param array $this->api_data The array of data set up in the class constructor.
|
619 |
+
* @param string $this->plugin_file The full path and filename of the file.
|
620 |
+
*/
|
621 |
+
$api_params = apply_filters( 'edd_sl_plugin_updater_api_params', $api_params, $this->api_data, $this->plugin_file );
|
622 |
+
|
623 |
+
$request = wp_remote_post(
|
624 |
$this->api_url,
|
625 |
[
|
626 |
'timeout' => 15,
|
627 |
+
'sslverify' => $this->verify_ssl(),
|
628 |
'body' => $api_params,
|
629 |
]
|
630 |
);
|
631 |
|
632 |
+
if ( is_wp_error( $request ) || ( 200 !== wp_remote_retrieve_response_code( $request ) ) ) {
|
633 |
+
$this->log_failed_request();
|
634 |
+
|
635 |
+
return false;
|
636 |
}
|
637 |
|
638 |
+
$request = json_decode( wp_remote_retrieve_body( $request ) );
|
639 |
+
|
640 |
if ( $request && isset( $request->sections ) ) {
|
641 |
$request->sections = maybe_unserialize( $request->sections );
|
642 |
} else {
|
660 |
return $request;
|
661 |
}
|
662 |
|
663 |
+
/**
|
664 |
+
* Get the version info from the cache, if it exists.
|
665 |
+
*
|
666 |
+
* @param string $cache_key Cache key.
|
667 |
+
* @return object
|
668 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
669 |
public function get_cached_version_info( $cache_key = '' ) {
|
670 |
|
671 |
if ( empty( $cache_key ) ) {
|
672 |
+
$cache_key = $this->get_cache_key();
|
673 |
}
|
674 |
|
675 |
$cache = get_option( $cache_key );
|
676 |
|
677 |
+
// Cache is expired.
|
678 |
if ( empty( $cache['timeout'] ) || time() > $cache['timeout'] ) {
|
679 |
+
return false;
|
680 |
}
|
681 |
|
682 |
// We need to turn the icons into an array, thanks to WP Core forcing these into an object at some point.
|
689 |
|
690 |
}
|
691 |
|
692 |
+
/**
|
693 |
+
* Adds the plugin version information to the database.
|
694 |
+
*
|
695 |
+
* @param string $value Value.
|
696 |
+
* @param string $cache_key Cache key.
|
697 |
+
*/
|
698 |
public function set_version_info_cache( $value = '', $cache_key = '' ) {
|
699 |
|
700 |
if ( empty( $cache_key ) ) {
|
701 |
+
$cache_key = $this->get_cache_key();
|
702 |
}
|
703 |
|
704 |
$data = [
|
705 |
'timeout' => strtotime( '+3 hours', time() ),
|
706 |
+
'value' => wp_json_encode( $value ),
|
707 |
];
|
708 |
|
709 |
update_option( $cache_key, $data, 'no' );
|
710 |
|
711 |
+
// Delete the duplicate option.
|
712 |
+
delete_option( 'edd_api_request_' . md5( maybe_serialize( $this->slug . $this->api_data['license'] . $this->beta ) ) );
|
713 |
}
|
714 |
|
715 |
/**
|
722 |
return (bool) apply_filters( 'edd_sl_api_request_verify_ssl', true, $this );
|
723 |
}
|
724 |
|
725 |
+
/**
|
726 |
+
* Gets the unique key (option name) for a plugin.
|
727 |
+
*
|
728 |
+
* @since 1.9.0
|
729 |
+
* @return string
|
730 |
+
*/
|
731 |
+
private function get_cache_key() {
|
732 |
+
$string = $this->slug . $this->api_data['license'] . $this->beta;
|
733 |
+
|
734 |
+
return 'edd_sl_' . md5( maybe_serialize( $string ) );
|
735 |
+
}
|
736 |
+
|
737 |
}
|
classes/Extensions.php
ADDED
@@ -0,0 +1,169 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Extension handlers.
|
4 |
+
*
|
5 |
+
* @package PUM\Core
|
6 |
+
*/
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || exit;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Class PUM_Extensions
|
12 |
+
*/
|
13 |
+
class PUM_Extensions {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Get everything going.
|
17 |
+
*
|
18 |
+
* @return void
|
19 |
+
*/
|
20 |
+
public function __construct() {
|
21 |
+
$this->init();
|
22 |
+
}
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Initialize actions & filters.
|
26 |
+
*
|
27 |
+
* @return void
|
28 |
+
*/
|
29 |
+
public function init() {
|
30 |
+
add_action( 'init', [ $this, 'rename_plugins' ] );
|
31 |
+
add_action( 'upgrader_process_complete', [ $this, 'monitor_plugin_udpates_for_renaming' ], 10, 2 );
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Get list of plugins that need renaming.
|
36 |
+
*
|
37 |
+
* @return string[]
|
38 |
+
*/
|
39 |
+
public function get_renamed_plugin_map() {
|
40 |
+
// Array of old plugin name => new plugin name.
|
41 |
+
$renamed_plugin_map = [
|
42 |
+
// phpcs:disable Squiz.PHP.CommentedOutCode.Found
|
43 |
+
// 'popup-maker-edd/popup-maker-edd.php' => 'popup-maker-edd-pro/popup-maker-edd-pro.php',
|
44 |
+
// 'pum-aweber-integration/pum-aweber-integration.php' => 'popup-maker-aweber-integration/popup-maker-aweber-integration.php',
|
45 |
+
// 'pum-mailchimp-integration/pum-mailchimp-integration.php' => 'popup-maker-mailchimp-integration/popup-maker-mailchimp-integration.php',
|
46 |
+
'pum-scheduling/pum-scheduling.php' => 'popup-maker-scheduling/popup-maker-scheduling.php',
|
47 |
+
// 'pum-videos/pum-videos.php' => 'popup-maker-videos/popup-maker-videos.php',
|
48 |
+
// phpcs:enable Squiz.PHP.CommentedOutCode.Found
|
49 |
+
];
|
50 |
+
|
51 |
+
return $renamed_plugin_map;
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* This function runs when WordPress completes its upgrade process.
|
56 |
+
* It iterates through each plugin updated to see if it is included in our renamed plugin map.
|
57 |
+
*
|
58 |
+
* @param array $upgrader_object Array of information regarding the upgrade process.
|
59 |
+
* @param array $options Array of bulk item update data.
|
60 |
+
*/
|
61 |
+
public function monitor_plugin_udpates_for_renaming( $upgrader_object, $options ) {
|
62 |
+
$renamed_plugin_map = $this->get_renamed_plugin_map();
|
63 |
+
$renamed_plugins = array_keys( $renamed_plugin_map );
|
64 |
+
$_transient_data = [];
|
65 |
+
|
66 |
+
// If an update has taken place and the updated type is plugins and the plugins element exists.
|
67 |
+
if ( 'update' === $options['action'] && 'plugin' === $options['type'] && isset( $options['plugins'] ) ) {
|
68 |
+
// Iterate through the plugins being updated and check if ours is there.
|
69 |
+
foreach ( $options['plugins'] as $plugin ) {
|
70 |
+
if ( in_array( $plugin, $renamed_plugins, true ) ) {
|
71 |
+
// Set a transient to record that our plugin has just been updated.
|
72 |
+
$_transient_data[ $plugin ] = $renamed_plugin_map[ $plugin ];
|
73 |
+
}
|
74 |
+
}
|
75 |
+
}
|
76 |
+
|
77 |
+
if ( ! empty( $_transient_data ) ) {
|
78 |
+
set_transient( 'pum_renamed_plugins', $_transient_data, DAY_IN_SECONDS );
|
79 |
+
}
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Forces reactivation of renamed plugin.
|
84 |
+
*
|
85 |
+
* @param string $plugin The plugin to check.
|
86 |
+
* @param bool $network_wide Whether to check for network wide activation.
|
87 |
+
* @return void
|
88 |
+
*/
|
89 |
+
public function force_activate_renamed_plugin( $plugin, $network_wide ) {
|
90 |
+
$renamed_plugin_map = $this->get_renamed_plugin_map();
|
91 |
+
|
92 |
+
if ( isset( $renamed_plugin_map[ $plugin ] ) ) {
|
93 |
+
$renamed_plugin = $renamed_plugin_map[ $plugin ];
|
94 |
+
|
95 |
+
// Deactivate the old plugin.
|
96 |
+
if ( is_plugin_active( $plugin ) ) {
|
97 |
+
deactivate_plugins( $plugin, true, $network_wide );
|
98 |
+
}
|
99 |
+
|
100 |
+
// Activate the new plugin.
|
101 |
+
activate_plugin( $renamed_plugin, '', $network_wide );
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* This function reactivates plugins that have been renamed, without requireing user interaction.
|
107 |
+
*
|
108 |
+
* @return void
|
109 |
+
*/
|
110 |
+
public function rename_plugins() {
|
111 |
+
$renamed_plugin_map = $this->get_renamed_plugin_map();
|
112 |
+
|
113 |
+
// If we have no renamed plugins, return early.
|
114 |
+
if ( empty( $renamed_plugin_map ) ) {
|
115 |
+
return;
|
116 |
+
}
|
117 |
+
|
118 |
+
// Get the transient data.
|
119 |
+
$_transient_data = get_transient( 'pum_renamed_plugins' );
|
120 |
+
|
121 |
+
// If we have no transient data, return early.
|
122 |
+
if ( empty( $_transient_data ) ) {
|
123 |
+
return;
|
124 |
+
}
|
125 |
+
|
126 |
+
// Require neccesary functions if they don't exist.
|
127 |
+
if ( ! function_exists( 'is_plugin_active' ) ) {
|
128 |
+
include_once ABSPATH . 'wp-admin/includes/plugin.php';
|
129 |
+
}
|
130 |
+
|
131 |
+
// Foreach plugin in pum_renamed_plugins transient as $old_plugin => $new_plugin.
|
132 |
+
foreach ( $_transient_data as $old_plugin => $new_plugin ) {
|
133 |
+
// 1. If the old file exists & new file does not, the migration we're fixing didn't occur, unset & continue.
|
134 |
+
if ( file_exists( WP_PLUGIN_DIR . '/' . $old_plugin ) && ! file_exists( WP_PLUGIN_DIR . '/' . $new_plugin ) ) {
|
135 |
+
unset( $_transient_data[ $old_plugin ] );
|
136 |
+
continue;
|
137 |
+
}
|
138 |
+
|
139 |
+
// 2. Check if the old plugin was network active.
|
140 |
+
$network_wide = is_multisite() && is_plugin_active_for_network( $old_plugin );
|
141 |
+
|
142 |
+
// 3. If is multisite & not network wide, loop over every site and force activate the new plugin. Else just force activate the new plugin.
|
143 |
+
if ( is_multisite() && ! $network_wide ) {
|
144 |
+
$sites = get_sites();
|
145 |
+
|
146 |
+
foreach ( $sites as $site ) {
|
147 |
+
switch_to_blog( $site->blog_id );
|
148 |
+
// Only force activate if the plugin was active on this site before.
|
149 |
+
if ( is_plugin_active( $old_plugin ) ) {
|
150 |
+
$this->force_activate_renamed_plugin( $old_plugin, false );
|
151 |
+
}
|
152 |
+
restore_current_blog();
|
153 |
+
}
|
154 |
+
} else {
|
155 |
+
$this->force_activate_renamed_plugin( $old_plugin, $network_wide );
|
156 |
+
}
|
157 |
+
|
158 |
+
// 4. Remove $old_plugin from pum_renamed_plugins transient.
|
159 |
+
unset( $_transient_data[ $old_plugin ] );
|
160 |
+
}
|
161 |
+
|
162 |
+
if ( empty( $_transient_data ) ) {
|
163 |
+
delete_transient( 'pum_renamed_plugins' );
|
164 |
+
} else {
|
165 |
+
set_transient( 'pum_renamed_plugins', $_transient_data, DAY_IN_SECONDS );
|
166 |
+
}
|
167 |
+
}
|
168 |
+
|
169 |
+
}
|
classes/Model/Popup.php
CHANGED
@@ -277,7 +277,7 @@ class PUM_Model_Popup extends PUM_Abstract_Model_Post {
|
|
277 |
/**
|
278 |
* Preprocess PHP conditions in order for more accurate JS handling.
|
279 |
*
|
280 |
-
* @return array
|
281 |
*/
|
282 |
public function get_parsed_js_conditions() {
|
283 |
$parsed_conditions = $this->get_conditions();
|
@@ -970,6 +970,12 @@ class PUM_Model_Popup extends PUM_Abstract_Model_Post {
|
|
970 |
// At least one group condition must be true. Break this loop if any condition is true.
|
971 |
foreach ( $conditions as $condition ) {
|
972 |
|
|
|
|
|
|
|
|
|
|
|
|
|
973 |
// If any condition passes, set $group_check true and break.
|
974 |
if ( ! $condition['not_operand'] && $this->check_condition( $condition ) ) {
|
975 |
$group_check = true;
|
277 |
/**
|
278 |
* Preprocess PHP conditions in order for more accurate JS handling.
|
279 |
*
|
280 |
+
* @return array Array of conditions, whith PHP conditions replaced with boolean values.
|
281 |
*/
|
282 |
public function get_parsed_js_conditions() {
|
283 |
$parsed_conditions = $this->get_conditions();
|
970 |
// At least one group condition must be true. Break this loop if any condition is true.
|
971 |
foreach ( $conditions as $condition ) {
|
972 |
|
973 |
+
// If this is JS condition, popup must load to check it later. Group can't be known false til then.
|
974 |
+
if ( $this->is_js_condition( $condition ) ) {
|
975 |
+
$group_check = true;
|
976 |
+
break;
|
977 |
+
}
|
978 |
+
|
979 |
// If any condition passes, set $group_check true and break.
|
980 |
if ( ! $condition['not_operand'] && $this->check_condition( $condition ) ) {
|
981 |
$group_check = true;
|
classes/Utils/Alerts.php
CHANGED
@@ -340,6 +340,19 @@ class PUM_Utils_Alerts {
|
|
340 |
return $styles;
|
341 |
}
|
342 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
343 |
/**
|
344 |
* Render admin alerts if available.
|
345 |
*/
|
@@ -401,7 +414,12 @@ class PUM_Utils_Alerts {
|
|
401 |
<?php endif; ?>
|
402 |
|
403 |
<?php if ( ! empty( $alert['html'] ) ) : ?>
|
404 |
-
<?php
|
|
|
|
|
|
|
|
|
|
|
405 |
<?php endif; ?>
|
406 |
|
407 |
<?php if ( ! empty( $alert['actions'] ) && is_array( $alert['actions'] ) ) : ?>
|
340 |
return $styles;
|
341 |
}
|
342 |
|
343 |
+
/**
|
344 |
+
* Return array of allowed html tags.
|
345 |
+
*
|
346 |
+
* @return array
|
347 |
+
*/
|
348 |
+
public static function allowed_tags() {
|
349 |
+
return array_merge_recursive(
|
350 |
+
wp_kses_allowed_html( 'post' ),
|
351 |
+
// Allow script tags with type="" attribute.
|
352 |
+
[ 'script' => [ 'type' => true ] ]
|
353 |
+
);
|
354 |
+
}
|
355 |
+
|
356 |
/**
|
357 |
* Render admin alerts if available.
|
358 |
*/
|
414 |
<?php endif; ?>
|
415 |
|
416 |
<?php if ( ! empty( $alert['html'] ) ) : ?>
|
417 |
+
<?php
|
418 |
+
echo wp_kses(
|
419 |
+
function_exists( 'wp_encode_emoji' ) ? wp_encode_emoji( $alert['html'] ) : $alert['html'],
|
420 |
+
self::allowed_tags()
|
421 |
+
);
|
422 |
+
?>
|
423 |
<?php endif; ?>
|
424 |
|
425 |
<?php if ( ! empty( $alert['actions'] ) && is_array( $alert['actions'] ) ) : ?>
|
includes/modules/reviews.php
CHANGED
@@ -340,7 +340,7 @@ class PUM_Modules_Reviews {
|
|
340 |
|
341 |
<ul>
|
342 |
<li>
|
343 |
-
<a class="pum-dismiss" target="_blank" href="<?php echo esc_attr( $trigger['link'] );
|
344 |
</li>
|
345 |
<li>
|
346 |
<a href="#" class="pum-dismiss" data-reason="maybe_later">
|
@@ -477,7 +477,7 @@ class PUM_Modules_Reviews {
|
|
477 |
</p>
|
478 |
<ul>
|
479 |
<li>
|
480 |
-
<a class="pum-dismiss" target="_blank" href="<?php echo esc_attr( $trigger['link'] );
|
481 |
<strong><?php esc_html_e( 'Ok, you deserve it', 'popup-maker' ); ?></strong>
|
482 |
</a>
|
483 |
</li>
|
340 |
|
341 |
<ul>
|
342 |
<li>
|
343 |
+
<a class="pum-dismiss" target="_blank" href="<?php echo esc_attr( $trigger['link'] ); ?>" data-reason="am_now"> <strong><?php _e( 'Ok, you deserve it', 'popup-maker' ); ?></strong> </a>
|
344 |
</li>
|
345 |
<li>
|
346 |
<a href="#" class="pum-dismiss" data-reason="maybe_later">
|
477 |
</p>
|
478 |
<ul>
|
479 |
<li>
|
480 |
+
<a class="pum-dismiss" target="_blank" href="<?php echo esc_attr( $trigger['link'] ); ?>" data-reason="am_now">
|
481 |
<strong><?php esc_html_e( 'Ok, you deserve it', 'popup-maker' ); ?></strong>
|
482 |
</a>
|
483 |
</li>
|
languages/popup-maker.pot
CHANGED
@@ -195,7 +195,7 @@ msgstr ""
|
|
195 |
msgid "Any Supported Form*"
|
196 |
msgstr ""
|
197 |
|
198 |
-
#: classes/Cookies.php:97, classes/Privacy.php:33, classes/Triggers.php:219, classes/Types.php:23, classes/Site/Assets.php:265, classes/Utils/Alerts.php:
|
199 |
msgid "Popup Maker"
|
200 |
msgstr ""
|
201 |
|
@@ -933,7 +933,7 @@ msgstr ""
|
|
933 |
msgid "Add"
|
934 |
msgstr ""
|
935 |
|
936 |
-
#: classes/Admin/Assets.php:73, classes/Admin/Settings.php:661, classes/Admin/Tools.php:83, classes/Admin/Tools.php:
|
937 |
msgid "Save"
|
938 |
msgstr ""
|
939 |
|
@@ -2307,62 +2307,71 @@ msgid "Error Log"
|
|
2307 |
msgstr ""
|
2308 |
|
2309 |
#: classes/Admin/Tools.php:127
|
2310 |
-
msgid "Scheduled Actions"
|
2311 |
-
msgstr ""
|
2312 |
-
|
2313 |
-
#: classes/Admin/Tools.php:128
|
2314 |
msgid "Import / Export"
|
2315 |
msgstr ""
|
2316 |
|
2317 |
-
#: classes/Admin/Tools.php:
|
2318 |
msgid "Enable Beta Versions"
|
2319 |
msgstr ""
|
2320 |
|
2321 |
-
#: classes/Admin/Tools.php:
|
2322 |
msgid "Checking any of the below checkboxes will opt you in to receive pre-release update notifications. You can opt-out at any time. Pre-release updates do not install automatically, you will still have the opportunity to ignore update notifications."
|
2323 |
msgstr ""
|
2324 |
|
2325 |
-
#: classes/Admin/Tools.php:
|
2326 |
msgid "Get updates for pre-release versions of %s"
|
2327 |
msgstr ""
|
2328 |
|
2329 |
-
#: classes/Admin/Tools.php:
|
2330 |
msgid "Import From Easy Modal v2"
|
2331 |
msgstr ""
|
2332 |
|
2333 |
-
#: classes/Extension/License.php:
|
2334 |
msgid "Enter your extension license keys here to receive updates for purchased extensions. If your license key has expired, please %1$srenew your license%2$s."
|
2335 |
msgstr ""
|
2336 |
|
2337 |
-
#: classes/Extension/License.php:
|
2338 |
msgid "%1$s"
|
2339 |
msgstr ""
|
2340 |
|
2341 |
-
#: classes/Extension/License.php:
|
2342 |
msgid "You have invalid or expired license keys for Popup Maker. Please go to the %1$sLicenses page%2$s to correct this issue."
|
2343 |
msgstr ""
|
2344 |
|
2345 |
-
#: classes/Extension/License.php:
|
2346 |
msgid "One or more of your extensions are missing license keys. You will not be able to receive updates until the extension has a valid license key entered. Please go to the %1$sLicenses page%2$s to add your license keys."
|
2347 |
msgstr ""
|
2348 |
|
2349 |
-
#: classes/Extension/License.php:
|
2350 |
msgid "Enter valid license key for automatic updates."
|
2351 |
msgstr ""
|
2352 |
|
2353 |
-
|
2354 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2355 |
msgstr ""
|
2356 |
|
2357 |
-
#: classes/Extension/Updater.php:
|
2358 |
-
msgid "
|
2359 |
msgstr ""
|
2360 |
|
2361 |
-
#: classes/Extension/Updater.php:
|
2362 |
msgid "You do not have permission to install plugin updates"
|
2363 |
msgstr ""
|
2364 |
|
2365 |
-
#: classes/Extension/Updater.php:
|
2366 |
msgid "Error"
|
2367 |
msgstr ""
|
2368 |
|
@@ -2767,15 +2776,15 @@ msgstr ""
|
|
2767 |
msgid "%1$sDid you know:%2$s Popup Maker has custom integrations with %3$s, %4$slearn more%5$s or %6$s%7$s%8$s!"
|
2768 |
msgstr ""
|
2769 |
|
2770 |
-
#: classes/Utils/Alerts.php:
|
2771 |
msgid "Notifications"
|
2772 |
msgstr ""
|
2773 |
|
2774 |
-
#: classes/Utils/Alerts.php:
|
2775 |
msgid "Check out the following notifications from Popup Maker."
|
2776 |
msgstr ""
|
2777 |
|
2778 |
-
#: classes/Utils/Alerts.php:
|
2779 |
msgid "Dismiss this item."
|
2780 |
msgstr ""
|
2781 |
|
195 |
msgid "Any Supported Form*"
|
196 |
msgstr ""
|
197 |
|
198 |
+
#: classes/Cookies.php:97, classes/Privacy.php:33, classes/Triggers.php:219, classes/Types.php:23, classes/Site/Assets.php:265, classes/Utils/Alerts.php:387, includes/admin/class-pum-admin-upgrades.php:250, includes/integrations/class-pum-gravity-forms.php:51, includes/modules/admin-bar.php:71
|
199 |
msgid "Popup Maker"
|
200 |
msgstr ""
|
201 |
|
933 |
msgid "Add"
|
934 |
msgstr ""
|
935 |
|
936 |
+
#: classes/Admin/Assets.php:73, classes/Admin/Settings.php:661, classes/Admin/Tools.php:83, classes/Admin/Tools.php:194, includes/integrations/class-pum-gravity-forms.php:175
|
937 |
msgid "Save"
|
938 |
msgstr ""
|
939 |
|
2307 |
msgstr ""
|
2308 |
|
2309 |
#: classes/Admin/Tools.php:127
|
|
|
|
|
|
|
|
|
2310 |
msgid "Import / Export"
|
2311 |
msgstr ""
|
2312 |
|
2313 |
+
#: classes/Admin/Tools.php:175
|
2314 |
msgid "Enable Beta Versions"
|
2315 |
msgstr ""
|
2316 |
|
2317 |
+
#: classes/Admin/Tools.php:177
|
2318 |
msgid "Checking any of the below checkboxes will opt you in to receive pre-release update notifications. You can opt-out at any time. Pre-release updates do not install automatically, you will still have the opportunity to ignore update notifications."
|
2319 |
msgstr ""
|
2320 |
|
2321 |
+
#: classes/Admin/Tools.php:186
|
2322 |
msgid "Get updates for pre-release versions of %s"
|
2323 |
msgstr ""
|
2324 |
|
2325 |
+
#: classes/Admin/Tools.php:245
|
2326 |
msgid "Import From Easy Modal v2"
|
2327 |
msgstr ""
|
2328 |
|
2329 |
+
#: classes/Extension/License.php:211
|
2330 |
msgid "Enter your extension license keys here to receive updates for purchased extensions. If your license key has expired, please %1$srenew your license%2$s."
|
2331 |
msgstr ""
|
2332 |
|
2333 |
+
#: classes/Extension/License.php:218
|
2334 |
msgid "%1$s"
|
2335 |
msgstr ""
|
2336 |
|
2337 |
+
#: classes/Extension/License.php:449, classes/Extension/License.php:485
|
2338 |
msgid "You have invalid or expired license keys for Popup Maker. Please go to the %1$sLicenses page%2$s to correct this issue."
|
2339 |
msgstr ""
|
2340 |
|
2341 |
+
#: classes/Extension/License.php:441
|
2342 |
msgid "One or more of your extensions are missing license keys. You will not be able to receive updates until the extension has a valid license key entered. Please go to the %1$sLicenses page%2$s to add your license keys."
|
2343 |
msgstr ""
|
2344 |
|
2345 |
+
#: classes/Extension/License.php:516
|
2346 |
msgid "Enter valid license key for automatic updates."
|
2347 |
msgstr ""
|
2348 |
|
2349 |
+
#. translators: the plugin name.
|
2350 |
+
#: classes/Extension/Updater.php:313
|
2351 |
+
msgid "There is a new version of %1$s available."
|
2352 |
+
msgstr ""
|
2353 |
+
|
2354 |
+
#: classes/Extension/Updater.php:344
|
2355 |
+
msgid "Update now."
|
2356 |
+
msgstr ""
|
2357 |
+
|
2358 |
+
#: classes/Extension/Updater.php:333
|
2359 |
+
msgid "%1$sView version %2$s details%3$s or %4$supdate now%5$s."
|
2360 |
+
msgstr ""
|
2361 |
+
|
2362 |
+
#: classes/Extension/Updater.php:324
|
2363 |
+
msgid "%1$sView version %2$s details%3$s."
|
2364 |
msgstr ""
|
2365 |
|
2366 |
+
#: classes/Extension/Updater.php:319
|
2367 |
+
msgid "Contact your network administrator to install the update."
|
2368 |
msgstr ""
|
2369 |
|
2370 |
+
#: classes/Extension/Updater.php:580
|
2371 |
msgid "You do not have permission to install plugin updates"
|
2372 |
msgstr ""
|
2373 |
|
2374 |
+
#: classes/Extension/Updater.php:580, includes/admin/class-pum-admin-upgrades.php:274, classes/Admin/Subscribers/Table.php:383, classes/Admin/Subscribers/Table.php:373, classes/Admin/Subscribers/Table.php:395, classes/Admin/Subscribers/Table.php:464, includes/admin/upgrades/class-pum-admin-upgrade-routine-2.php:32, includes/admin/upgrades/class-pum-admin-upgrade-routine-3.php:43, includes/admin/upgrades/class-pum-admin-upgrade-routine-4.php:43, includes/admin/upgrades/class-pum-admin-upgrade-routine-5.php:38, includes/admin/upgrades/class-pum-admin-upgrade-routine-6.php:50
|
2375 |
msgid "Error"
|
2376 |
msgstr ""
|
2377 |
|
2776 |
msgid "%1$sDid you know:%2$s Popup Maker has custom integrations with %3$s, %4$slearn more%5$s or %6$s%7$s%8$s!"
|
2777 |
msgstr ""
|
2778 |
|
2779 |
+
#: classes/Utils/Alerts.php:387
|
2780 |
msgid "Notifications"
|
2781 |
msgstr ""
|
2782 |
|
2783 |
+
#: classes/Utils/Alerts.php:390
|
2784 |
msgid "Check out the following notifications from Popup Maker."
|
2785 |
msgstr ""
|
2786 |
|
2787 |
+
#: classes/Utils/Alerts.php:456
|
2788 |
msgid "Dismiss this item."
|
2789 |
msgstr ""
|
2790 |
|
popup-maker.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Popup Maker
|
4 |
* Plugin URI: https://wppopupmaker.com/?utm_campaign=plugin-info&utm_source=plugin-header&utm_medium=plugin-uri
|
5 |
* Description: Easily create & style popups with any content. Theme editor to quickly style your popups. Add forms, social media boxes, videos & more.
|
6 |
-
* Version: 1.17.
|
7 |
* Requires PHP: 5.6
|
8 |
* Requires at least: 4.9
|
9 |
* Author: Popup Maker
|
@@ -101,7 +101,7 @@ class Popup_Maker {
|
|
101 |
/**
|
102 |
* @var string Plugin Version
|
103 |
*/
|
104 |
-
public static $VER = '1.17.
|
105 |
|
106 |
/**
|
107 |
* @var int DB Version
|
@@ -337,6 +337,8 @@ class Popup_Maker {
|
|
337 |
PUM_Shortcode_PopupCookie::init();
|
338 |
|
339 |
PUM_Telemetry::init();
|
|
|
|
|
340 |
}
|
341 |
|
342 |
/**
|
3 |
* Plugin Name: Popup Maker
|
4 |
* Plugin URI: https://wppopupmaker.com/?utm_campaign=plugin-info&utm_source=plugin-header&utm_medium=plugin-uri
|
5 |
* Description: Easily create & style popups with any content. Theme editor to quickly style your popups. Add forms, social media boxes, videos & more.
|
6 |
+
* Version: 1.17.1
|
7 |
* Requires PHP: 5.6
|
8 |
* Requires at least: 4.9
|
9 |
* Author: Popup Maker
|
101 |
/**
|
102 |
* @var string Plugin Version
|
103 |
*/
|
104 |
+
public static $VER = '1.17.1';
|
105 |
|
106 |
/**
|
107 |
* @var int DB Version
|
337 |
PUM_Shortcode_PopupCookie::init();
|
338 |
|
339 |
PUM_Telemetry::init();
|
340 |
+
|
341 |
+
new PUM_Extensions();
|
342 |
}
|
343 |
|
344 |
/**
|
readme.txt
CHANGED
@@ -7,7 +7,7 @@ Tags: marketing, ecommerce, popup, popups, optin, conversion, promotion, pop-up
|
|
7 |
Requires at least: 4.9
|
8 |
Tested up to: 6.1.1
|
9 |
Requires PHP: 5.6
|
10 |
-
Stable tag: 1.17.
|
11 |
License: GPLv2 or later
|
12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
13 |
|
@@ -181,6 +181,15 @@ There are several common causes for this, check [this guide for help](https://do
|
|
181 |
|
182 |
View our [complete changelog](https://github.com/PopupMaker/Popup-Maker/blob/master/CHANGELOG.md) for up-to-date information on what has been going on with the development of Popup Maker.
|
183 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
= v1.17.0 - 11/24/2022 =
|
185 |
|
186 |
* Improvement: Added contextual notification system to be able to notify site admins about important information including security notices, beta tests, extension sales & more without requiring a plugin update.
|
7 |
Requires at least: 4.9
|
8 |
Tested up to: 6.1.1
|
9 |
Requires PHP: 5.6
|
10 |
+
Stable tag: 1.17.1
|
11 |
License: GPLv2 or later
|
12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
13 |
|
181 |
|
182 |
View our [complete changelog](https://github.com/PopupMaker/Popup-Maker/blob/master/CHANGELOG.md) for up-to-date information on what has been going on with the development of Popup Maker.
|
183 |
|
184 |
+
= v1.17.1 - 12/04/2022 =
|
185 |
+
|
186 |
+
* Improvement: Update EDD Updater to latest for extension update handling.
|
187 |
+
* Improvement: Add handler for properly renaming extension folder names during update without manual reactivation by user.
|
188 |
+
* Tweak: Set proper default tab on Tools page.
|
189 |
+
* Tweak: Removed deprecated Scheduled Actions tab.
|
190 |
+
* Fix: Rendering issue with review request.
|
191 |
+
* Fix: ATC Cookie condition was preventing popup from loading.
|
192 |
+
|
193 |
= v1.17.0 - 11/24/2022 =
|
194 |
|
195 |
* Improvement: Added contextual notification system to be able to notify site admins about important information including security notices, beta tests, extension sales & more without requiring a plugin update.
|