Popup Maker – Popup Forms, Optins & More - Version 1.11.1

Version Description

Download this release

Release Info

Developer fpcorso
Plugin Icon 128x128 Popup Maker – Popup Forms, Optins & More
Version 1.11.1
Comparing to
See all releases

Code changes from version 1.11.0 to 1.11.1

CHANGELOG.md CHANGED
@@ -1,848 +1,851 @@
1
- ### v1.11.0 - 06/25/2020
2
- * Feature: Add new floating bar theme.
3
- * Feature: New guided tour of popup editor for first time users.
4
- * Feature: New href attribute on the popup_close shortcode for when setting the shortcode to use the `a` tag.
5
- * Fix: Shortcode popup_close tag attribute not functioning properly.
6
- * Tweak: Change popup_close tag setting to use a drop-down for more easily selecting which tag to use.
7
- * Tweak: Improve explanation of cookies in new trigger modal.
8
- * Tweak: Ensure all admin pages have visible page headings.
9
- * Tweak: Simplify name and title fields in popup editor.
10
- * Tweak: Add popup ID to quick links on All Popups.
11
- * Tweak: Move CSS and JS for our admin bar node to external file.
12
- * Tweak: Add our new optional telemetry system.
13
-
14
- ### v1.10.2 - 06/09/2020
15
- * Fix: Popup Settings not working when WP Forms is active without forms
16
- * Fix: Missing closing div in new [popup_cookie] shortcode.
17
- * Fix: Shortcode popup_close tag attribute not functioning properly.
18
-
19
- ### v1.10.1 - 04/21/2020
20
- * Fix: Typo in filter name caused extra p tags.
21
- * Fix: Add wp version check to prevent calling block functions on older versions or classicpress.
22
- * Fix: Font Awesome support now works for v4 fonts.
23
-
24
- ### v1.10.0 - 04/20/2020
25
- * Feature: Display presets for top bar, bottom right slide-ins, full-screen popups & bottom left notifications to make it simple to get common setups done much quicker
26
- * Feature: Popup Trigger inline text format for the block editor.
27
- * Feature: Turn any block in Gutenberg block editor into a popup trigger.
28
- * Feature: Font Awesome support added to close button text setting.
29
- * Feature: Play a sound when a popup is opened. Choose from 5 included sounds or upload your own.
30
- * Feature: Insert customizable [popup_cookie] shortcode on thank you pages when using non-integrated forms.
31
- * Tweak: Add option to disable or adjust the padding-right added to body.
32
- * Tweak: Remove Freemius integration from Popup Maker.
33
- * Improvement: Detect file permission issues with Asset Caching functionality.
34
- * Fix: Prevent popups from going off the screen when using center position for a tall popup.
35
- * Fix: Bug in slide animation origin positioning for bottom or right origins.
36
- * Fix: Bug where Middle Center caused tall popups to hang off the screen on small screens.
37
- * Fix: Typo in admin editor CSS path.
38
- * Fix: Bug on fresh installs where default theme's close position is wrong.
39
-
40
- ### v1.9.2 - 03/26/2020
41
- * Tweak: Add support for WP 5.4's new method of adding custom fields to the nav menu editor.
42
-
43
- ### v1.9.1 - 02/13/2020
44
- * Fix: JS error when MailChimp for WordPress was active but no forms on the page.
45
-
46
- ### v1.9.0 - 02/11/2020
47
- * Feature: New Form Submission trigger with option to choose specific forms for integrated forms.
48
- * Feature: New Form Submission cookie event with option to choose specific forms.
49
- * Feature: New Close on Form Submission with optional delay.
50
- * Feature: WP Forms integration.
51
- * Feature: Caldera Forms integration.
52
- * Feature: MailChimp for WordPress integration
53
- * Improvement: Enhanced asset cache to identify issues with a site's filesystem.
54
- * Improvement: Various changes to ensure PHP 7.4 compatibility.
55
- * Improvement: Minimum PHP version updated to v5.6 to match WP core.
56
- * Improvement: Simplified form integration interfaces to more easily support additional form plugins or custom integrations. Includes full AJAX & non-AJAX form support.
57
- * Improvement: Added RTL CSS support.
58
- * Improvement: Added new SVG admin menu icon which plays well with custom admin color schemes. Thanks @KZeni (Kurt Zenisek)
59
- * Improvement: Simplified form integration apis.
60
- * Improvement: Various performance improvements.
61
- * Tweak: Remove unnecessary usage of esc_attr_e causing extra translation calls.
62
- * Fix: Bug when accept language header is not supplied causes undefined index notice.
63
- * Fix: Error caused by invalid post ID returned by CF7 when saving new forms.
64
- * Fix: Bug when selecting more than 10 items in targeting rule post/page select fields.
65
-
66
- ### v1.8.14 - 10/24/2019
67
- * Improvement: Updated nav menu editor walker class for adding custom fields to further improve compatibility.
68
- * Fix: Ninja Forms popup actions missing.
69
-
70
- ### v1.8.13 - 10/11/2019
71
- * Tweak: Added cap check to ensure only authorized users can access support debug text file. @Credit goes to Ilias Dimopoulos from Neurosoft S.A , RedyOps Team.
72
-
73
- ### v1.8.12 - 10/01/2019
74
- * Improvement: Changed hook that we initialize Ninja Forms on so that it can be disabled from theme functions.php.
75
- * Improvement: Don't load CF7 scripts if they are forced off.
76
- * Improvement: Fixed some old options checks that were always being detected as true resulting in minor performance improvements.
77
- * Tweak: Added nonce to the system info file download available under Popup Maker -> Tools and simplified the pum_actions system. @Credit goes to Ilias Dimopoulos from Neurosoft S.A , RedyOps Team.
78
-
79
- ### v1.8.11 - 08/18/2019
80
- * Improvement: Trigger window resize event when popups open to fix issues with some sliders & JS sized content.
81
- * Fix: Updated form value processing to prevent some edge cases where string values were converted to Infinity.
82
- * Fix: Custom "already subscribed" messages in MailChimp integration were not working correctly.
83
-
84
- ### v1.8.10 - 07/06/2019
85
- * Fix: PHP backward compatibility issue due to short array syntax usage.
86
-
87
- ### v1.8.9 - 07/04/2019
88
- * Fix: Issue where popup titles wouldn't render.
89
-
90
- ### v1.8.8 - 06/30/2019
91
- * Fix: Bug where red alert icons didn't go away when visiting the tabs from the "Extend" menu.
92
-
93
- ### v1.8.7 - 06/29/2019
94
- * Tweak: Restricted the admin toolbar to only show under strict circumstances.
95
- * Tweak: Updated available WooCommerce endpoints in our targeting conditions
96
- * Fix: Issue with instance based shortcodes when asset caching was enabled but running on every request.
97
-
98
- ### v1.8.6 - 05/05/2019
99
- * Fix: Typo in GDPR eraser that could sometimes result in errors when processing GDPR requests
100
- * Fix: Added function exists check to prevent errors on WP 4.1
101
-
102
- ### v1.8.5 - 04/17/2019
103
- * Tweak: Removed unused settings.
104
- * Fix: Typo in method name that would generate errors in some extension migration routines.
105
- * Fix: Issue when using class="" in our Popup Trigger shortcode would not get converted to classes on the element.
106
- * Fix: Bug in JS due to missing default value.
107
- * Fix: Bug older extensions caused by deprecated filter not getting loaded properly.
108
-
109
- ### v1.8.4 - 03/21/2019
110
- * Improvement: Added content caching in the head to prevent second call to do_shortcode in the footer.
111
- * Improvement: Added runtime model caching to reduce memory usage.
112
-
113
- ### v1.8.3 - 02/27/2019
114
- * Fix: Added back deprecated function that got truncated previously.
115
-
116
- ### v1.8.2 - 02/25/2019
117
- * Fix: Bug on older versions of PHP due to usage of [] rather than array().
118
-
119
- ### v1.8.1 - 02/22/2019
120
- * Fix: Error on older versions of PHP when calling get_plugin_data on a plugin that wasn't installed.
121
- * Fix: "Fatal error: Can not use method return value in write context" on older versions of PHP.
122
-
123
- ### v1.8.0 - 02/20/2019
124
- * Feature: New popup theme settings:
125
- * New close button positions top center, bottom center, middle left & middle right.
126
- * New option to position close button outside of popup.
127
- * Improvement: Add constant to disable logging.
128
- * Improvement: Added complete uninstall option.
129
- * Improvement: Added limited experimental support for Gutenberg editor when creating popups. Complete support in the works.
130
- * Improvement: Added new unified alerts interface on PM dash pages. This will keep you up to date on required migration changes, new features & more.
131
- * Improvement: Added new translation request for detected polyglot admins when their language doesn't have an updated Language Pack.
132
- * Tweak: Removed option setting to 'Hide Admin Support Widget' which is no longer relevant.
133
- * Tweak: Add constant to disable logging.
134
- * Fix: Condition options for BuddyPress integration had values & labels switched.
135
- * Fix: Bug with Gravity Forms Personal Data menu item missing.
136
- * Fix: iOS Click overlay close not working.
137
- * Fix: Analytics not working for themes with incorrect wp_footer usage.
138
-
139
- ### v1.7.30 - 09/06/2018
140
- * Improvement: Further added methods to log unique messages only once.
141
- * Tweak: Remove usage of Freemius.
142
- * Fix: Added option to disable popups accessibility functionality to resolve some issues with focus trapping.
143
- * Fix: Issues with log files growing too large. Max file size of 1MB and auto truncate to 250 lines now.
144
- * Fix: Typo causing issues with Page Template condition.
145
- * Fix: Typo in privacy link example text.
146
- * Fix: Typo pointing to incorrect internal method call in new has_cookie method.
147
- * Fix: Issues with fields not being readonly.
148
-
149
- ### v1.7.29 - 06/13/2018
150
- * Improvement: Added new enabled() method for the PUM_AssetCache class that checks both is writable and not disabled.
151
- * Improvement: Added option to disable just asset caching. This should help in the case your server is blocking the use of our JS from the /uploads/ folder with a 403 error.
152
- * Fix: Bug caused by string representations of boolean values passed in our subscription forms.
153
-
154
- ### v1.7.28 - 06/10/2018
155
- * Tweak: Improved validation of subscription form data and messaging.
156
- * Fix: Bug with front end form serialization issue with single checkboxes (privacy field).
157
-
158
- ### v1.7.27 - 06/08/2018
159
- * Improvement: Added additional variable checks to allow graceful failing during certain JS errors when page cache is out of date.
160
-
161
- ### v1.7.26 - 06/07/2018
162
- * Fix: Add empty popups array to prevent errors due to page caching.
163
-
164
- ### v1.7.25 - 06/05/2018
165
- * Tweak: Localized most variables earlier to prevent errors. Added in default values in case they do not get rendered to prevent fatal JS errors.
166
- * Fix: Tweaked extension activation class to be compatible with PHP 5.2.
167
- * Fix: Bug where boolean scalar values were changed to "" for json_encode.
168
-
169
- ### v1.7.24 - 06/04/2018
170
- * Tweak: Updated subscriber table for existing sites that failed to add it properly before.
171
-
172
- ### v1.7.23 - 06/04/2018
173
- * Improvement: Converted cookie privacy info to tabular rendering.
174
- * Tweak: Improved update notice text.
175
- * Fix: Issues with subscriber table not being created. Thanks @jnorell
176
- * Fix: Bug not allowing more than one cookie for a trigger.
177
- * Fix: Undefined index errors in shortcake/shortcode-ui integration.
178
-
179
- ### v1.7.22 - 05/25/2018
180
- * Tweak: Updated Freemius library for GDPR optin support.
181
- * Improvement: Made all popup loops more reliable.
182
- * Fix: Error where objects were processed incorrectly.
183
- * Fix: "Uncaught Error: Call to a member function get_setting() on boolean in /popup-maker/classes/AssetCache.php:314"
184
-
185
- ### v1.7.21 - 05/24/2018
186
- * Tweak: Clear asset cache on settings save.
187
- * Improvement: Check that post is singular to prevent Post Selected conditions from working on site index.
188
- * Improvement: Remove jquery-cookie from assets as we no longer use or load it anywhere.
189
- * Fix: Missing function errors if you don't have WordPress v4.9.6.
190
- * Fix: Added better & safer json encoding function that properly sanitizes data for encoding to prevent empty strings for non english sites.
191
-
192
- ### v1.7.20 - 05/19/2018
193
- * Feature: Support for GDPR Personal Data Exporter
194
- * Feature: Support for GDPR Personal Data Eraser
195
- * Feature: New privacy consent field for Subscription Forms for GDPR consent collection.
196
- * Feature: GDPR privacy policy guide text added.
197
- * Improvement: Updated dependency libs.
198
- * Fix: Bug in subscriber tables if no popup ID was stored.
199
-
200
- ### v1.7.19 - 05/01/2018
201
- * Version bump due to svn file add issues during last commit.
202
-
203
- ### v1.7.18 - 05/01/2018
204
- * Fix: Typo in JS that may cause errors for some.
205
-
206
- ### v1.7.17 - 05/01/2018
207
- * Improvement: Added popup option to disable automatic re-triggering of popup after non-ajax form submission.
208
- * Improvement: Added notice when JS errors occur in Popup Maker admin interfaces with link to documentation for proper diagnosis & reporting.
209
- * Tweak: Added asset cache reset on update of core version & db version.
210
- * Tweak: Removed debug code.
211
- * Tweak: Simplified the post type batch processor setup for extensions.
212
- * Dev: Added base PUM_Extension_Activator class to standardize extension activation and various other things.
213
-
214
- ### v1.7.16 - 04/24/2018
215
- * Tweak: Removed debug code.
216
- * Fix: Issue with valueless shortcode attributes not processing properly.
217
- * Fix: Issues where our scripts loaded before Ninja Forms scripts did and our integration didn't initialize.
218
- * Dev: Added helper function to return array of shortcodes and data in usable format from any content.
219
- * Dev: Added support for measure fields for shortcodes.
220
-
221
- ### v1.7.15 - 04/14/2018
222
- * Improvement: Removed metadata from object models to reduce cache size as WordPress already has them cached.
223
- * Tweak: Added new filter and corrected typo in existing ones for extension integrations.
224
- * Fix: Bug for potentially missing variable.
225
- * Fix: Bug when using WordPress older than v4.4 and viewing the subscribers table.
226
- * Fix: Bug where google fonts didn't always get loaded correctly.
227
- * Fix: Missing styles from Advanced Theme Builder due to misordering.
228
-
229
- ### v1.7.14 - 03/28/2018
230
- * Fix: Obscure PHP error caused by method from interface was marked abstract in an abstract class inheriting the interface.
231
- * Fix: Bug when jquery cookie is called from another plugin.
232
- * Fix: Bug where form submit button triggered popup close when overlay click to close was enabled.
233
- * Fix: Typo in previous patch for db_var not being updated properly.
234
-
235
- ### v1.7.13 - 03/27/2018
236
- * Tweak: Added fallback methods for conditions using MobileDetect to prevent errors when for whatever reason it was not loaded properly.
237
- * Tweak: Added value type check to prevent errors in popup data.
238
- * Fix: Bug with accessibility forced focus when there is a link in the popup, causing the close button to focus the link before closing.
239
- * Fix: Bug that caused issues with MC extensions JS loading properly.
240
- * Fix: Added fail-safe in case variables were not properly declared on page for mce-buttons.js.
241
- * Fix: Set a deprecated option on new installs for backward compatibility issues.
242
- * Fix: Selector correction in z-index setting application.
243
-
244
- ### v1.7.12 - 03/21/2018
245
- * Improvement: Added option to disable the shortcode ui.
246
- * Tweak: Removed private popup type links from the nav menu editor.
247
- * Fix: Bug with long term cached assets causing JS errors on nginx servers.
248
- * Fix: Bug with support for custom popup z-index setting.
249
- * Fix: Bug where NF loaded before Popup Maker and form actions were missing.
250
- * Fix: Bugs in close delay settings for form integrations. Was in ms but needed to be in seconds.
251
- * Fix: Bug where Yoast SEO plugin shows popups in the xml sitemaps and showing Yoast metabox on popup editor.
252
-
253
- ### v1.7.11 - 03/14/2018
254
- * Fix: Bug where Middle Center option wouldn't stay selected after saving.
255
- * Fix: Bug with incorrect field dependency for custom height & scrollable options.
256
-
257
- ### v1.7.10 - 03/14/2018
258
- * Improvement: Further improved compatibility with shortcodes that echo/print rather than return content.
259
- * Fix: Bug where cookies wouldn't always be set in Edge & Safari due to cookie path including the root url.
260
- * Fix: Bug that changed the default tag for popup_trigger & popup_close shortcodes.
261
- * Fix: Bug where extra close buttons didn't always work correctly.
262
- * Fix: Removal of deprecated function that triggered warnings in PHP 7.2.
263
-
264
- ### v1.7.9 - 03/14/2018
265
- * Improvement: Replaced usage of pumSerializeForm with pumSerializeObject which is more reliable.
266
- * Fix: Bug where deprecated directory reference causes popup html not to render properly breaking popups that should have worked otherwise.
267
- * Fix: Bug where checkbox defaults continuously applied making it impossible to uncheck them.
268
-
269
- ### v1.7.8 - 03/13/2018
270
- * Improvement: Added output buffering to early calls to do_shortcode to prevent premature output in the head.
271
- * Improvement: Added sanity checks to make sure only valid popup objects are used in some older template functions.
272
-
273
- ### v1.7.7 - 03/13/2018
274
- * Fix: Removed jQuery.serializeJSON functionality which was unused and causing conflicts with WooCommerce.
275
- * Fix: SSL Issues due to not specifying protocol.
276
- * Fix: Error caused by invalid popup object being used in function.
277
- * Fix: PHP 5.2 compatibility issue.
278
-
279
- ### v1.7.6 - 03/12/2018
280
- * Fix: Undid previous changes from 1.7.1 and reworked in a new way to be backward compatible with existing extensions.
281
-
282
- ### v1.7.5 - 03/12/2018
283
- * Fix: Sticky Popup Maker settings checkboxes that wouldn't uncheck after save.
284
-
285
- ### v1.7.4 - 03/12/2018
286
- * Fix: Invalid method declaration error introduced by v1.7.2 patch to Shortcode core class.
287
-
288
- ### v1.7.3 - 03/12/2018
289
- * Fix: Error due to usage of __CLASS__ rather than $this.
290
- * Fix: Edge case where function returns can't be used inside empty().
291
-
292
- ### v1.7.2 - 03/12/2018
293
- * Fix: Initialization variable wasn't set to true early enough.
294
-
295
- ### v1.7.1 - 03/12/2018
296
- * Fix: Empty value errors.
297
- * Fix: Missing function for 3rd party plugin backward compatibility (Elementor).
298
-
299
- ### v1.7.0 - 03/12/2018
300
- This was a monster update, our largest to date in terms of improving existing functionality, reducing maintenance and the time it takes to implement new features in the future.
301
-
302
- Noticeably there are a lot of interface changes with this version as we simplified from having many meta boxes in the popup editor to a new single panel interface.
303
-
304
- Lastly we now have include our extendable subscription forms right in the free version. We currently don't provide support for mail/service providers in the free version, but have opened up our form API in the hopes that 3rd party developers will help us fill that gap. Don't fret though, submissions are stored in a custom table for retroactive syncing to lists or export (not yet available).
305
-
306
- * Feature: Subscriber forms now included without a paid extension.
307
- * Provider API for easily extending forms to work with 3rd party providers.
308
- * New shortcode with tons of options built in.
309
- * Stores subscribers into a new custom table for import into your favorite system at a later time.
310
- * Feature: Front end asset overhaul, now uses cached static assets.
311
- * All front end assets now combined into single js & css file.
312
- * Custom styles are now saved along with all core & extension styles eliminating inline style blocks.
313
- * Reduction of footprint means massively improved loading performance.
314
- * Dynamic file creation allows for some awesome upcoming features.
315
- * Now completely compatible with plugins like Autoptimize (Thanks Frank).
316
- * Feature: Support for nearly any form, including non ajax forms.
317
- * Helper functions to integrate your 3rd party form plugins quickly.
318
- * Show thank you popups, set cookies & close popups with a delay after success (requires code).
319
- * Automatically reopen popup forms after refresh from a form submission.
320
- * Improvement: Lots of text, label & description changes to be more intuitive.
321
- * Improvement: Better 3rd party plugin support including page builders:
322
- * Popup post type is now public.
323
- * Better support for 3rd party shortcodes which require extra assets loaded (JS/CSS).
324
- * Improvement: Adding trigger now gives optional choices to create a cookie, rather than being automatic.
325
- * Improvement: New Popup Settings tabbed interface to help make settings more intuitive & easy to find on one screen.
326
- * Now all popup settings are stored in a single meta key reducing DB clutter.
327
- * Improvement: New Popup Maker Settings tabbed interface to help make settings more intuitive & easy to find on one screen.
328
- * Improvement: New Popup preview mode.
329
- * Improvement: Better page builder support by changing popup post type arg for public to true.
330
- * Improvement: Resource reduction & optimization.
331
- * Added class autoloader for core and extensions.
332
- * Greatly simplified code base & internal API structures.
333
- * Converted many internal APIs to use passive loading.
334
- * Added internal caching.
335
- * Improvement: Integrated [WPJSF](https://github.com/danieliser/WP-JS-Form-Sample-Plugin) lib for easier maintenance and quicker updates of our admin forms.
336
- * Improvement: Various improvements to smart select fields (jQuery select2) including:
337
- * Allow multiple page/post selections without reopening/searching again.
338
- * Properly highlights & shows selected items after save/reload.
339
- * Paginated/scroll based loading of more results over ajax.
340
- * Now shows list of recent "items" immediately upon clicking the field rather than requiring search.
341
- * Improvement: Admin asset handling
342
- * Modularized admin assets for easier debugging & maintenance.
343
- * Improvement: Popup Trigger shortcode can now use custom popup IDs.
344
- * Improvement: Added new batch processing system for upgrades and other processes.
345
- * Improvement: Removed a lot of old code.
346
- * Improvement: Rebuilt Shortcode UI that should be more reliable.
347
- * Improvement: Addressed most all PHP 7 notices.
348
- * Improvement: iOS scrolling issue fixes.
349
- * Improvement: Added support for KingComposer.
350
- * Tweak: Support for subdirectory sites having their own sitewide cookies.
351
- * Fix: Incorrect BuddyPress condition labels
352
- * Fix: Bug when WPML isn't yet available.
353
-
354
-
355
- ### v1.6.7 - Rolled into v1.7.0
356
- * Fix: Typo in JS event name prevented forceFocus for popups.
357
- * Fix: JS errors when Marionette JS library on page without Ninja Forms.
358
- * Fix: WPML missing variable errors.
359
-
360
- ### v1.6.6 - 07/29/2017
361
- * Fix: Bug with closing forms using newest version of Gravity Forms.
362
-
363
- ### v1.6.5 - 07/16/2017
364
- * Tweak: Added new popup class for theme names. Thanks @bluantinoo.
365
- * Fix: Bug in menu popups save and render functionality not working correctly.
366
- * Fix: Finally found issue where randomly assets tab checkboxes wouldn't uncheck & save properly.
367
- * Fix: Sanitized active tab key against whitelist.
368
- * Fix: Errors in w3c validation scans from form meta fields.
369
- * Fix: Settings asset label mismatch.
370
-
371
- ### v1.6.4 - 07/07/2017
372
- * Imporvement: Reworked all form integrations to be as DRY as possible making it more reliable.
373
- * Tweak: Added sanity check in case previous filter mucks up the $item object variable in menu item filters causing warnings.
374
- * Tweak: Disabled the open count & sorting when Popup Analytics is activated.
375
- * Tweak: Added NF datepicker CSS fix.
376
- * Tweak: Added media type to head styles to force optimization plugins to keep them in order.
377
- * Tweak: Reverted to older method of click trigger assignment to better work with multiple popups on one trigger with conditions.
378
- * Fix: Bug caused by use of a function some users host blocked.
379
- * Fix: Bug caused by debug mode being enabled with a form success cookie.
380
- * Fix: Bug when Gravity Form was not in popup but triggered a thank you popup.
381
- * Fix: Bug with GForms closing popup after submission.
382
- * Fix: Bug where CF7 Forms with required fields trigger popup to close without being filled properly.
383
-
384
- ### v1.6.3 - 05/19/2017
385
- * Fix: Removed 3rd parameter from number_format as it only accepts 1, 2 or 4 arguments, not 3 per php.net documentation.
386
-
387
- ### v1.6.2 - 05/18/2017
388
- * Fix: Bug caused by rounding to whole numbers in opacity values.
389
-
390
- ### v1.6.1 - 05/17/2017
391
- * Improvement: Major improvements to the Shortcode UI (builder & in editor previews). Now supports true live rendering of PM shortcodes. This will be most apparent in upcoming extension updates.
392
- * Fix: Forced decimal formatting in CSS output functions in case of locale changes to formatting. Fix thanks to @timhavinga
393
-
394
-
395
- ### v1.6.0 - 04/26/2017
396
- * Feature: Added Gravity Forms direct integrations.
397
- * Close popup with delay when Gravity Form is submitted.
398
- * Trigger a thank you popup when Gravity Form is submitted.
399
- * Set cookies easily when the Gravity Form is in a popup.
400
- * Feature: Added Contact Form 7 (CF7) direct integrations.
401
- * Close popup with delay when contact form 7 is submitted.
402
- * Trigger a thank you popup when contact form 7 is submitted.
403
- * Set cookies easily when the CF7 form is in a popup.
404
- * Forced CF7 assets to load when used in a popup on the off chance they don't automatically.
405
- * Tweak: Increased action priority for condition registration in case plugins register post types late, such as PODs.
406
- * Tweak: Moved popup theme styles to a very late position in the head to prevent them from being overwritten when minifying CSS.
407
- * Fix: Bug where you couldn't enter values higher than the rangeslider max.
408
- * Fix: JS error when creating a cookie before a trigger exists.
409
-
410
- ### v1.5.8 - 04/04/2017
411
- * Fix: Error when extensions were active due to null values for checkboxes.
412
-
413
-
414
- ### v1.5.7 - 03/27/2017
415
- * Improvement: Added option to disable the menu editors in case of a conflict.
416
- * Fix: Forced 100% width on page select boxes to prevent them from being too small.
417
- * Fix: Bug where checkboxes were not staying checked.
418
-
419
- ### v1.5.6 - 03/16/2017
420
- * Feature: Admin Bar helper tool to assist in getting proper click trigger selectors easily.
421
- * Improvement: Further tweaks for maximium compatibitlity with nav menu editor.
422
- * Improvement: Added Popup option to nav menu editor Screen Options to easily hide them.
423
- * Fix: Updated the freemius-sdk to fix an obscure secured php core function error.
424
-
425
- ### v1.5.5 - 03/13/2017
426
- * Improvment: Used generic Nav Menu Editor Walker classes for better support. This should remove the notices from other plugins as well.
427
- * Fix: Bug that causes click triggers to lag.
428
-
429
- ### v1.5.4 - 03/13/2017
430
- * Fix: Typos in conditions.
431
- * Fix: Moved class_exists checks to better handle possible missing class errors.
432
-
433
- ### v1.5.3 - 03/13/2017
434
- * Improvement: Added a catch for any triggers not initialized at page load.
435
- * Fix: Typo in multi check field template that led to admin JS errors.
436
-
437
- ### v1.5.2 - 03/10/2017
438
- * Improvement: Added option to disable the admin bar Popups helper menu item.
439
- * Improvement: Simplified the nav menu editor modification class to reduce un-needed translation strings.
440
- * Fix: Added check for missing class in the nav menu editor walker classes.
441
-
442
- ### v1.5.1 - 03/09/2017
443
- * Fix: PHP 5.2 Compatibility issue.
444
-
445
- ### v1.5.0 - 03/08/2017
446
- * Feature: Position popups based on the click trigger. Tooltips & Popovers are now possible.
447
- * Feature: Added new conditions for targeting children & grandchildren / ancestors of selected content.
448
- * Feature: Added new settings to the Nav Menu editor to choose a popup that a menu item will trigger.
449
- * Feature: Addded option to Disable on Tablets as well as mobile phones.
450
- * Feature: Added WooCommerce is_wc_endpoint_url conditions.
451
- * Feature: Added new click selector presets for quicker targeting & more user friendly.
452
- * Feature: Added a new debug mode. Including:
453
- * Admin Bar with manual open, close & cookie resets for loaded popups.
454
- * Improvement: New global JS functions for easily working with popups. PUM.open(123), PUM.close(123), PUM.clearCookies(123).
455
- * Improvement: Added inline links to docs for various settings.
456
- * Improvement: Reworked popup analytics to improving response times and decreasing server loads.
457
- * Moved Analytic tracking to the WP-API with a new endpoint.
458
- * Reduced number of queries by 75% for analytics tracking.
459
- * Added option to disable it entirely if absolutely neccessary.
460
- * Improvement: Many improvements to JavaScript including object caching.
461
- * Tweak: Creating a new trigger will automatically create a cookie and assign it if one doesn't exist.
462
- * Tweak: Mobile Disable was also applied to tablets, now only to phones.
463
- * Tweak: Removed readonly from rangesliders to make the fact you can manually enter any value more intuitive.
464
- * Tweak: Use CSS to display a popup immediately if has trigger: auto open: delay 0.
465
- * Tweak: Clicking elements in the visual theme preview will now scroll to the relevant section of settings.
466
- * Fix: Bug in admin when editing a trigger, cookie field didn't repopulate properly.
467
- * Fix: Bug where rangeslider values can be set to strings.
468
- * Fix: Bug where links in the close button were not triggered even when do_default was enabled.
469
- * Fix: Bug with scrollbar "flashing" when popup opens.
470
-
471
- ### v1.4.21 - 12/12/2016
472
- * Feature: Added option to disable popup on mobile to comply with [Google's new interstital policy](https://webmasters.googleblog.com/2016/08/helping-users-easily-access-content-on.html).
473
- * Tweak: Added additional paramter to the pum_popup_get_conditions filter.
474
- * Tweak: Fixed possible false init of NF integration if NF is not enabled.
475
- * Tweak: Added CSS override for Ninja Forms datepickers to properly layer them above popups.
476
-
477
- ### v1.4.20 - 10/13/2016
478
- * Feature: Added [Ninja Forms](https://wppopupmaker.com/grab/ninja-forms?utm_source=readme-changelog&utm_medium=text-link&utm_campaign=Readme&utm_content=ninja-forms-features) success actions for opening & closing popups.
479
- * Feature: Added new cookie event for successful submission of a [Ninja Forms](https://wppopupmaker.com/recommends/ninja-forms) form.
480
- * Improvement: Added wp.hooks JS library, allowing actions & filters via our plugin JS.
481
- * Tweaks: Added various admin css tweaks.
482
-
483
- ### v1.4.19 - 9/30/2016
484
- * Feature: Added a do_default parameter to the trigger & close shortcodes. This allows making close buttons that also download a file.
485
- * Improvement: Added support for JS (advanced) conditions & condition processing after checking for cookies.
486
- * Improvement: Upgraded from jQuery-Cookie (modified) to JS-Cookie (modified) for more flexibility.
487
- * Fix: Bug where color didn't update properly when first clicked in theme editor.
488
- * Fix: Added prefix to admin pages to prevent conflicts.
489
- * Fix: Removed usage of deprecated filter.
490
-
491
- ### v1.4.18 - 8/15/2016
492
- * Fix: Bug with PHP 5.2 compatibility.
493
- * Fix: Added missing post_type index condition callback.
494
-
495
- ### v1.4.17 - 8/14/2016
496
- * Fix: Bug caused by using return value in write context.
497
-
498
- ### v1.4.16 - 8/14/2016
499
- * Feature: New Condition: Pages: With Template. Thanks @cedmund.
500
- * Feature: Option to Disable reposition on window resize/scroll.
501
- * Improvement: Enable Visual Composer for Popups by default (VC 4.8+). Thanks @NoahjChampion.
502
- * Improvement: Replaced usage of gif hex code with loading of an actual tracking gif to prevent security scanners from throwing false positives.
503
- * Improvement: Changed default analytics response with a 204 no content heading, saving the need to load & return a tracking gif.
504
- * Fix: Missing condition value bug fixed by adding sanity checks to conditions on get.
505
- * Fix: Auto Height checkbox wouldn't stay unchecked.
506
- * Fix: CSS class pum-open-overlay wasn't being removed from HTML element on popup close causing issues for next popup.
507
- * Fix: Error in JS due to shortcodes: Uncaught Error: Syntax error, unrecognized expression.
508
- * Fix: Issue where some custom post types not working with conditions.
509
-
510
- ### v1.4.15 - 7/20/2016
511
- * Improvement: Only showed the aria-label attribute if the label will be shown.
512
- * Tweak: Updated the Freemius SDK.
513
- * Tweak: Updated the #popmake-{ID} selector to work at the end of a link.
514
- * Fix: Bug where stackable popups would lose their scroll bar after one was closed.
515
-
516
- ### v1.4.14 - 7/14/2016
517
- * Feature: Links with the url #popmake-{ID} will now trigger a popup when clicked. Links with this href will work similar to elements with the popmake-{ID} class.
518
-
519
- ### v1.4.13 - 6/26/2016
520
- * Feature: Added 12 of the most commonly needed BuddyPress content types & targeting conditions. Target any BP content type. Now full support for BuddyPress.
521
- * Tweak: Moved a few functions from the plugins_loaded action to the init action for minor compatibility benefits.
522
- * Tweak: Removed Popup & Popup Theme Meta Revisioning as it adds unneeded clutter to the DB.
523
-
524
- ### v1.4.12 - 6/24/2016
525
- * Improvement: Reduced translatable strings from 569 total to 439 which is about a 23% reduction which will reduce work for our translators.
526
- * Tweak: Removed the welcome page and associated CSS, images etc. This cleans up some useless strings for translation.
527
- * Fix: Bug where add_new cookie wasn't properly replaced for the first trigger.
528
-
529
- ### v1.4.11 - 6/10/2016
530
- * Feature: New conditions for targeting posts & taxonomy by ID.
531
- * Improvement: Added link to Conditions Documentation to the Conditions editor.
532
- * Tweak: Namespaced jQuery.serializeObject to prevent conflicts with other plugins/themes in the admin editor.
533
- * Fix: Bug on add new page/post and during post update.
534
- * Fix: Bug in edit this theme link on page load.
535
-
536
- ### v1.4.10 - 5/23/2016
537
- * Feature: Added Do Default option to the click triggers. Allows a triggers default browsers behavior to occur and still open a popup, such as a file link.
538
- * Improvement: Added additional links to the theme editor for better visibility and to guide users there.
539
- * Tweak: Older methods are only loaded when needed, this also removes usage of a deprecated filter.
540
- * Tweak: All Pages now includes Home Page / Front Page.
541
- * Tweak: A default click trigger is always added. (Like pre v1.4)
542
- * Fix: Low z-index caused issues when the overlay is disabled.
543
- * Fix: Bug where none animation couldn't be re-opened.
544
- * Fix: Cleaned up issues allowing popup post type to be added directly to menus and sitemaps.
545
- * Fix: Bug where auto height checkbox would not stay checked.
546
-
547
- ### v1.4.9 - 5/01/2016
548
- * Improvement: Reduced front end queries by over 85%. Avgerage sites should now only have 2 to 3.
549
- * Improvement: Added caching enhancements for even better performance on servers with page, object & query caching.
550
- * Improvement: Added a fully namespaced version of Select2 for compatiblitiy while other plugins await updating. Will gracefully fall back to the non namespaced version when it no longer causes issues.
551
- * Fix: Undefined 'amd' JS errors.
552
- * Fix: The "Use Your Theme" font option was not working correctly.
553
- * Fix: Removed leftover console.logs in our JavaScript.
554
-
555
- ### v1.4.8 - 4/27/2016
556
- * Improvement: Sandboxed Select2 v4 since it breaks other plugins when loaded properly. v4 adds accessiblity enhancements that we are not going to sacrifice for compatiblity with plugins who have not updated to include it. This provides a safe alternative in the meantime.
557
- * Tweak: Removed extra shortcode files.
558
- * Tweak: Allow popup Click Triggers to target another popups close button. Close one triggers another etc.
559
- * Fix: Bug caused by pum_shortcode_ui not loading properly everywhere.
560
- * Fix: Bug in popup position calculation when the popup used Fixed Position and Disable Overlay
561
-
562
- ### v1.4.7 - 4/24/2016
563
- * Improvement: Removed the old styles dropdown as it is no longer needed.
564
- * Improvement: Added check for old versions of Select2 and replace them with latest which is backward compatible.
565
- * Fix: Bug that caused Close button delay to not show the close button.
566
- * Fix: Replaced usage of <% style JS template with <# & {{ for PHP asp_tags compatibility.
567
-
568
- ### v1.4.6 - 4/22/2016
569
- * Fix: Bug in new post editor JS.
570
- * Fix: Added filter to override permissions for upgrade routines.
571
-
572
- ### v1.4.5 - 4/21/2016
573
- * Fix: Replaced all usage of static:: for PHP 5.2 compatiblity.
574
- * Fix: Forced the latest version of Select2 to load on Popup Maker admin pages in the case that an older version was enqueued.
575
-
576
- ### v1.4.4 - 4/20/2016
577
- * Fix: Version Bump to fix upgrade issues.
578
-
579
- ### v1.4.3 - 4/20/2016
580
- * Fix: Removed extra whitespace before opening php tags.
581
-
582
- ### v1.4.2 - 4/20/2016
583
- * Fix: Bug in popup maker deprecated filter caused by no defaults passed.
584
-
585
- ### v1.4.1 - 4/20/2016
586
- * Fix: Bug in popup maker upgrade class for older versions of PHP.
587
-
588
- ### v1.4 - 4/20/2016
589
- * Feature: Added basic analytics. Tracks how many unique opens each popup has.
590
- * Feature: Added new Popup Maker shortcodes button to the editor with visual previews.
591
- * Feature: Added option to reset popup open counts demand.
592
- * Feature: New add / remove targeting conditions UI.
593
- * Feature: Conditions can now be negative as well as grouped as AND / OR.
594
- * Feature: New conditions for targeting posts & cpt by taxonomy. IE Posts with Tag / Category.
595
- * Feature: New add / remove triggers UI that allows multiple of the same trigger per popup.
596
- * Feature: Added a new add / remove cookies UI that manages cookies separate from triggers.
597
- * Feature: Added 5 new built in themes.
598
- * Feature: Added support for pods content types.
599
- * Feature: Added full screen front end previews for admins and editors.
600
- * Feature: Added additional WooCommerce conditions such as on checkout.
601
- * Improvement: Added CSS resets to all core popup elements to ensure a reliable look.
602
- * Improvement: Popups are now rendered with their own overlay. This allows the popup to scroll inside the overlay.
603
- * Improvement: Cookie names can now be set to anything, including cookies from other plugins.
604
- * Improvement: Triggers now support checking more than one cookie.
605
- * Improvement: Accessibility & screen reader enhancements to the popups and admin.
606
- * Improvement: Auto Focus the first element in the popup when it opens for screen readers.
607
- * Improvement: Better JavaScript encapsulation and organization.
608
- * Improvement: Added support for Select2 smart dropdowns for admin interfaces.
609
- * Improvement: Added a more reliable upgrade routine system.
610
- * Improvement: Added an option to disable popup taxonomies if not in use.
611
- * Improvement: Added more reliable usage tracking via [Freemius](https://freemius.com/wordpress/).
612
- * Tweak: Updated extensions page and added a list of plugins that work well with Popup Maker.
613
- * Fixed: Super annoying fixed position checkbox glitch.
614
- * Fixed: Missing check for disabled google fonts before loading them.
615
- * Fixed: Bug where hidden about pages showed up when certain admin menu editing plugins were active.
616
- * Fixed: Bug where default theme was not properly created on install.
617
- * Fixed: Bug where non utf-8 characters were used in the name field and caused JS errors.
618
- * Fixed: Bug where popup triggers inside their own popup would cause it to close and reopen when clicked.
619
- * Dev: Introduced PUM_Fields a settings API that support _.js Templ fields.
620
- * Dev: Added new action 'pum_styles' that can be used to render custom CSS.
621
- * Dev: Added new PUM_Popup class with nearly all methods built in.
622
- * Dev: Introduced new prefix pum_ rather than popmake_.
623
-
624
- **v1.4 Change Set Statistics:**
625
- 365 Commits / 53 Major & Minor Issues Closed.
626
- 285 changed files with 20,437 additions and 3,607 deletions.
627
-
628
- ### v1.3.9 - 10/14/2015
629
- * Feature: New shortcode - [popup_close] allows adding custom close buttons/text. Ex. [popup_close] Click Me [/popup_close].
630
- * Improvement: Added SASS/SCSS files for the site & admin styles.
631
- * Improvement: Added better support for current & legacy versions of Visual Composer.
632
- * Improvement: Added check for preventClose class on a popup just before closing. If found the popup won't close.
633
- * Fix: Fixed bug in theme editor that caused Google Font variants to not show up.
634
- * Fix: Fixed bug in CSS generation where Google Font URL would become corrupted and cause a 404.
635
- * Fix: Fixed bug where fixed position would show unchecked even if it was checked.
636
- * Fix: Fixed bug in CSS that caused popup to appear below site on mobile.
637
- * Fix: WP Multi Site: Fatal Error.
638
-
639
- ### v1.3.8 - 9/29/2015
640
- * Fix: Updated links to documentation.
641
- * Fix: Removed exploitable bug allowing script execution in the admin. Discovered 9/29/15 - Patched 9/29/15
642
-
643
- ### v1.3.7 - 9/21/2015
644
- * Feature: Added support for Visual Composer to popups. (Backend Editor Only). Works Perfectly with Responsive Popups.
645
- * Tweak: Disable position fixed on mobile screens for responsive popups.
646
- * Tweak: Improved UI with better popup formats selection.
647
- * Fix: Bug with default theme not properly being created.
648
- * Fix: Bug where default & theme formats were overridden in the WP Editor.
649
- * Fix: Bug with default theme not being used for [popup] shortcode.
650
- * Fix: Bug with loading Google Fonts properly.
651
- * Fix: Errors generated by incorrectly formatted colors in the editor.
652
- * Fix: Bug with targeting conditions for categories.
653
- * Fix: Bug in positioning left & right values. Credit to @invik for the solution.
654
-
655
- ### v1.3.6 - 8/25/2015
656
- * Confirmed WP v4.3 compatibility.
657
- * Tweak: Default theme is automatically used if a popup does not have one assigned.
658
- * Fix: UI bug where fixed position checkbox wouldn't stay checked.
659
- * Fix: Bug with Theme Default values & v1.2 values not being merged.
660
-
661
- ### v1.3.5 - 8/18/2015
662
- * Tweak: Corrected missing keys for required script checks.
663
- * Fix: Error message caused by non array value from get_post_custom.
664
- * Fix: Removed missing variable.
665
- * Fix: Text corrections.
666
-
667
- ### v1.3.4 - 8/12/2015
668
- * Fix: Added px to font-size & line-height.
669
-
670
- ### v1.3.3 - 8/12/2015
671
- * Fix: Added current_action fallback function for older versions of WP.
672
- * Fix: Theme CSS rendering incorrect font settings.
673
-
674
- ### v1.3.2 - 8/10/2015
675
- * Tweak: Pause HTML5 Videos when popup closes.
676
- * Fix: Prefixed several functions that collided with some themes.
677
- * Fix: Changed default Close Height & Width to 0/auto.
678
-
679
- ### v1.3.1 - 8/8/2015
680
- * Fix: Error in get_called_class alternate function for PHP 5.2
681
- * Fix: Force theme css builder to check for empty themes.
682
- * Fix: Bug where z-indexes were incorrectly set.
683
-
684
- ### v1.3 - 8/7/2015
685
- * Feature: Added unlimited themes functionality to the core.
686
- * Feature: Allow disabling of event.prevendDefault() for on click events by adding do-default class.
687
- * Feature: Added support for session based cookies.
688
- * Feature: Add Height & Width options to Close Button for better control.
689
- * Feature: Theme styling is now rendered in the head via inline CSS with an option to disable in the case that popup styles have been moved to the theme stylesheet.
690
- * Feature: Delay showing the close button after the popup opens. Set the delay in ms.
691
- * Feature: Added stackable popups option to show more than one popup at a time. ( A stackable popup won't close other popups when its opened. )
692
- * Feature: Added WooCommerce Targeting Conditions.
693
- * Feature: Added new system info tab on the tools page to make debugging faster.
694
- * Tweak: Change default responsive mobile size to 95%.
695
- * Tweak: Change default z-index to 1999999999.
696
- * Tweak: Add ability to pass a callback to the popmake('close') method.
697
- * Tweak: Add namespace to click open event ('click.popmakeOpen').
698
- * Tweak: Add $default arg to popmake_get_popup_meta_group function.
699
- * Tweak: Auto close content tags using balanceTags().
700
- * Tweak: Added new popmake_get_popup(), get_the_popup_ID(), popmake_get_the_popup_ID(), popmake_the_popup_ID() functions.
701
- * Tweak: Check if popup is already open before auto opening.
702
- * Tweak: Add ajax="true" to gravity forms shortcodes if not there.
703
- * Tweak: Make auto open cookie key optional.
704
- * Tweak: Disable fixed position for responsive sizes.
705
- * Tweak: Compensate for Admin Bar when visible.
706
- * Tweak: Added options to disable Support & Share admin widgets.
707
- * Tweak: Added new filter popmake_popup_default_close_text to allow filtering of popup close text.
708
- * Tweak: Added close text override on a per popup basis. New option under Close Settings.
709
- * Tweak: Choosing a responsive size will automatically disable fixed position & scrollable content.
710
- * Tweak: Unneeded data attributes are now removed to clean up html.
711
- * Tweak: Meta has now been compressed into serialized arrays for popups and themes.
712
- * Tweak: Added new Meta Field management class as a step toward a more maintainable code base.
713
- * Fix: Add option to disable moving of popup to end of <body>.
714
- * Fix: Corrected input type under Click-Open Settings meta box.
715
- * Fix: Description cleanup for popup location.
716
- * Fix: Correct French translation file name.
717
- * Fix: Rewrote popup loop to not overwrite global $post breaking some content shortcodes.
718
- * Fix: Bug when clicking publish with empty name field publish becomes unclickable again.
719
- * Fix: Sitewide cookie option will not stay unchecked.
720
- * Fix: Bug where popup & popup_theme meta was stored with other post types on revision.
721
- * Fix: Bug in the popup_trigger shortcode with $content not being rendered properly.
722
-
723
- ### v1.2.2
724
- * Added (string) typecast to prevent errors in wp_localize_script when passing integers.
725
- * Added 100% French & Hungarian translations.
726
- * Added partial German translation.
727
- * Moved template.php require line to load for both admin and front end for use in ajax responses.
728
- * Changed order of admin pages to allow extensions to load before settings/help/tools pages on menu.
729
- * Added troubleshooting FAQ to readme.
730
- * Added version to JS object for backward compatibility checks.
731
- * Added check for preventOpen class before opening. This class will prevent the popup from opening.
732
- * Corrected minWidth variable name.
733
- * Added namespace to the auto open cookie event.
734
- * Changed the last open trigger to use the jQuery object instead of xpath.
735
- * Added an isScrolling variable to detect when the browser is actively scrolling.
736
- * Checked isScrolling before adding overflow styles to the HTML element to prevent glitching.
737
- * Temporarily removed the grow animations due to removal of Greensock Animation Platform.
738
- * Removed Greensock Animation Platform dependancy.
739
-
740
- ### v1.2.1
741
- * Fixed bug caused by null value passed to JS data attr.
742
-
743
- ### v1.2
744
- * Added full screen preview for themes when editing using the Preview button.
745
- * Added full screen preview for popup when editing using the Preview button.
746
- * Added new shortcode 'popup_trigger' that allows users to easily add the correct popmake- class. Accepts id, tag & class parameters.
747
- * Updated GSAP JS plugin to latest version.
748
- * Removed jQuery.gsap.js usage.
749
- * Added fallback list of Google Fonts for when API is unavailable.
750
- * Setup extensions page to use a static list of extensions for the time being.
751
- * Updated API url.
752
- * Removed Popmake_Admin_Notices class as it was unused.
753
- * Fixed bug where share metabox wouldn't stay hidden.
754
- * Added function to prevent deletion of default theme.
755
- * Fixed bug which caused Popup Maker menu to show to all users.
756
-
757
- ### v1.1.10
758
- * Fixed invalid argument bug passed to google font foreach.
759
- * Fixed CSS box-sizing cross browser support.
760
-
761
- ### v1.1.9
762
- * Added %'s to reponsive sizes in size dropdown.
763
- * Remove usage of the_content and the_content filters.
764
- * Fixed responsive sizes.
765
-
766
- ### v1.1.8
767
- * Fixed issue with admin menu position collisions.
768
- * Fixed issue with banner not staying dismissed.
769
- * Removed dependency jQuery.cookie
770
- * Fixed bug in auto open when cookie was set before delay was up.
771
- * Added new setCookie JS event. Used to manually set a popups cookies. Usage jQuery('#popmake-123').trigger('popmakeSetCookie');
772
- * Added new z-index override values. This helps with theme compatibility and future multi popup capability.
773
- * Added Blog Index support. Available under targeting conditions 'On Blog Index' & 'Exclude On Blog Index'.
774
- * Added better responsive image handling.
775
- * Added Admin Debug option for popups.
776
- * Changed jquery-ui-position collission property to none to solve positioning issues.
777
- * Disabled Popup Maker JS & CSS when no popups detected to load.
778
- * Added new function popmake_enqueue_scripts() which allows manual enqueuing of scripts and styles.
779
-
780
- ### v1.1.7
781
- * Fixed undefined function popmake_default_settings.
782
- * Fixed specific pages not saving properly.
783
- * Now removes ?autoplay parameter from Videos preventing them from playing again without interaction.
784
-
785
- ### v1.1.6
786
- * Fixed bug in js not setting correct CSS value for min-width.
787
- * Changed close link element tag from a > span.
788
-
789
- ### v1.1.5
790
- * Fixed bug when clicking add selected buttons.
791
- * Changed how popmake_popup_is_loadable works. It is now more organized and readable.
792
- * Added 2 new Targeting Conditions: Search & 404.
793
-
794
- ### v1.1.4
795
- * Fixed bug in scrollable content styles.
796
- * Fixed bug in admin JS for duplicate input names.
797
- * Changed Powered By Setting to Off by Default.
798
- * Changed default permissions required to use theme builder.
799
- * Fixed bug in targeting conditions.
800
-
801
- ### v1.1.3
802
- * Fixed some incorrect links to resources and kb.
803
- * Removed Auto Open Promotional Material ( as it is now included ).
804
-
805
- ### v1.1.2
806
- * Further enhancements to ensure proper checking of Auto Open Enabled.
807
-
808
- ### v1.1.1
809
- * Fixed bug in JS that didn't properly check if Auto Open was enabled.
810
-
811
- ### v1.1
812
- * Added Importer for Easy Modal v2 - Availabe under Tools -> Import
813
- * Added Easy Modal v2 Compatibility Option - Available under Settings -> Misc (This will allow all of your existing eModal classes to open the proper Popup once imported)
814
- * Added custom selector functionality - Availabe on Modal editor (This will allow you to use your own css selectors that when clicked will trigger the popup to open. Ex. #main-menu li.menu-item-3 would cause the corresponding menu item to trigger that popup)
815
-
816
- ### v1.0.5
817
- * Fixed bug caused by changes in v1.0.4.
818
-
819
- ### v1.0.4
820
- * Admin UI Adjustments & Tweaks.
821
- * Fixed bug in removing specific post types.
822
- * Reformatted Code.
823
- * Fixed incorrect variable.
824
-
825
- ### v1.0.3
826
- * Fixed bug with recursive filter.
827
- * Fixed bug caused by typo.
828
- * Fixed bug in JS for removing specific post type posts.
829
-
830
- ### v1.0.2
831
- * Resized Extension page images to load quicker on extensions page.
832
- * Added last_open_popup proerty to popmake jQuery function.
833
- * Resized Extension page images to load quicker on extensions page.
834
- * Fixed misc Admin Styles.
835
- * Corrected support links.
836
- * Fixed Bug in Meta boxes on settings page.
837
- * Renamed files appropriately.
838
- * Added new section callback for settings API.
839
- * Fixed small glitch in Opt In for Credit Link.
840
-
841
- ### v1.0.1
842
- * Removed links to getting started from "Dashboard" Admin Menu.
843
- * Added Line Height Setting to Both Title and Close, Allowing Perfect Circles for close button.
844
- * Updated admin styles.
845
- * Misc Admin changes, including new filters/hooks for upcoming extensions.
846
-
847
- ### v1.0.0
848
- * Initial Release
 
 
 
1
+ ### v1.11.1 - 07/22/2020
2
+ * Fix: Form submission cookies no longer set with Contact Form 7 5.2
3
+
4
+ ### v1.11.0 - 06/25/2020
5
+ * Feature: Add new floating bar theme.
6
+ * Feature: New guided tour of popup editor for first time users.
7
+ * Feature: New href attribute on the popup_close shortcode for when setting the shortcode to use the `a` tag.
8
+ * Fix: Shortcode popup_close tag attribute not functioning properly.
9
+ * Tweak: Change popup_close tag setting to use a drop-down for more easily selecting which tag to use.
10
+ * Tweak: Improve explanation of cookies in new trigger modal.
11
+ * Tweak: Ensure all admin pages have visible page headings.
12
+ * Tweak: Simplify name and title fields in popup editor.
13
+ * Tweak: Add popup ID to quick links on All Popups.
14
+ * Tweak: Move CSS and JS for our admin bar node to external file.
15
+ * Tweak: Add our new optional telemetry system.
16
+
17
+ ### v1.10.2 - 06/09/2020
18
+ * Fix: Popup Settings not working when WP Forms is active without forms
19
+ * Fix: Missing closing div in new [popup_cookie] shortcode.
20
+ * Fix: Shortcode popup_close tag attribute not functioning properly.
21
+
22
+ ### v1.10.1 - 04/21/2020
23
+ * Fix: Typo in filter name caused extra p tags.
24
+ * Fix: Add wp version check to prevent calling block functions on older versions or classicpress.
25
+ * Fix: Font Awesome support now works for v4 fonts.
26
+
27
+ ### v1.10.0 - 04/20/2020
28
+ * Feature: Display presets for top bar, bottom right slide-ins, full-screen popups & bottom left notifications to make it simple to get common setups done much quicker
29
+ * Feature: Popup Trigger inline text format for the block editor.
30
+ * Feature: Turn any block in Gutenberg block editor into a popup trigger.
31
+ * Feature: Font Awesome support added to close button text setting.
32
+ * Feature: Play a sound when a popup is opened. Choose from 5 included sounds or upload your own.
33
+ * Feature: Insert customizable [popup_cookie] shortcode on thank you pages when using non-integrated forms.
34
+ * Tweak: Add option to disable or adjust the padding-right added to body.
35
+ * Tweak: Remove Freemius integration from Popup Maker.
36
+ * Improvement: Detect file permission issues with Asset Caching functionality.
37
+ * Fix: Prevent popups from going off the screen when using center position for a tall popup.
38
+ * Fix: Bug in slide animation origin positioning for bottom or right origins.
39
+ * Fix: Bug where Middle Center caused tall popups to hang off the screen on small screens.
40
+ * Fix: Typo in admin editor CSS path.
41
+ * Fix: Bug on fresh installs where default theme's close position is wrong.
42
+
43
+ ### v1.9.2 - 03/26/2020
44
+ * Tweak: Add support for WP 5.4's new method of adding custom fields to the nav menu editor.
45
+
46
+ ### v1.9.1 - 02/13/2020
47
+ * Fix: JS error when MailChimp for WordPress was active but no forms on the page.
48
+
49
+ ### v1.9.0 - 02/11/2020
50
+ * Feature: New Form Submission trigger with option to choose specific forms for integrated forms.
51
+ * Feature: New Form Submission cookie event with option to choose specific forms.
52
+ * Feature: New Close on Form Submission with optional delay.
53
+ * Feature: WP Forms integration.
54
+ * Feature: Caldera Forms integration.
55
+ * Feature: MailChimp for WordPress integration
56
+ * Improvement: Enhanced asset cache to identify issues with a site's filesystem.
57
+ * Improvement: Various changes to ensure PHP 7.4 compatibility.
58
+ * Improvement: Minimum PHP version updated to v5.6 to match WP core.
59
+ * Improvement: Simplified form integration interfaces to more easily support additional form plugins or custom integrations. Includes full AJAX & non-AJAX form support.
60
+ * Improvement: Added RTL CSS support.
61
+ * Improvement: Added new SVG admin menu icon which plays well with custom admin color schemes. Thanks @KZeni (Kurt Zenisek)
62
+ * Improvement: Simplified form integration apis.
63
+ * Improvement: Various performance improvements.
64
+ * Tweak: Remove unnecessary usage of esc_attr_e causing extra translation calls.
65
+ * Fix: Bug when accept language header is not supplied causes undefined index notice.
66
+ * Fix: Error caused by invalid post ID returned by CF7 when saving new forms.
67
+ * Fix: Bug when selecting more than 10 items in targeting rule post/page select fields.
68
+
69
+ ### v1.8.14 - 10/24/2019
70
+ * Improvement: Updated nav menu editor walker class for adding custom fields to further improve compatibility.
71
+ * Fix: Ninja Forms popup actions missing.
72
+
73
+ ### v1.8.13 - 10/11/2019
74
+ * Tweak: Added cap check to ensure only authorized users can access support debug text file. @Credit goes to Ilias Dimopoulos from Neurosoft S.A , RedyOps Team.
75
+
76
+ ### v1.8.12 - 10/01/2019
77
+ * Improvement: Changed hook that we initialize Ninja Forms on so that it can be disabled from theme functions.php.
78
+ * Improvement: Don't load CF7 scripts if they are forced off.
79
+ * Improvement: Fixed some old options checks that were always being detected as true resulting in minor performance improvements.
80
+ * Tweak: Added nonce to the system info file download available under Popup Maker -> Tools and simplified the pum_actions system. @Credit goes to Ilias Dimopoulos from Neurosoft S.A , RedyOps Team.
81
+
82
+ ### v1.8.11 - 08/18/2019
83
+ * Improvement: Trigger window resize event when popups open to fix issues with some sliders & JS sized content.
84
+ * Fix: Updated form value processing to prevent some edge cases where string values were converted to Infinity.
85
+ * Fix: Custom "already subscribed" messages in MailChimp integration were not working correctly.
86
+
87
+ ### v1.8.10 - 07/06/2019
88
+ * Fix: PHP backward compatibility issue due to short array syntax usage.
89
+
90
+ ### v1.8.9 - 07/04/2019
91
+ * Fix: Issue where popup titles wouldn't render.
92
+
93
+ ### v1.8.8 - 06/30/2019
94
+ * Fix: Bug where red alert icons didn't go away when visiting the tabs from the "Extend" menu.
95
+
96
+ ### v1.8.7 - 06/29/2019
97
+ * Tweak: Restricted the admin toolbar to only show under strict circumstances.
98
+ * Tweak: Updated available WooCommerce endpoints in our targeting conditions
99
+ * Fix: Issue with instance based shortcodes when asset caching was enabled but running on every request.
100
+
101
+ ### v1.8.6 - 05/05/2019
102
+ * Fix: Typo in GDPR eraser that could sometimes result in errors when processing GDPR requests
103
+ * Fix: Added function exists check to prevent errors on WP 4.1
104
+
105
+ ### v1.8.5 - 04/17/2019
106
+ * Tweak: Removed unused settings.
107
+ * Fix: Typo in method name that would generate errors in some extension migration routines.
108
+ * Fix: Issue when using class="" in our Popup Trigger shortcode would not get converted to classes on the element.
109
+ * Fix: Bug in JS due to missing default value.
110
+ * Fix: Bug older extensions caused by deprecated filter not getting loaded properly.
111
+
112
+ ### v1.8.4 - 03/21/2019
113
+ * Improvement: Added content caching in the head to prevent second call to do_shortcode in the footer.
114
+ * Improvement: Added runtime model caching to reduce memory usage.
115
+
116
+ ### v1.8.3 - 02/27/2019
117
+ * Fix: Added back deprecated function that got truncated previously.
118
+
119
+ ### v1.8.2 - 02/25/2019
120
+ * Fix: Bug on older versions of PHP due to usage of [] rather than array().
121
+
122
+ ### v1.8.1 - 02/22/2019
123
+ * Fix: Error on older versions of PHP when calling get_plugin_data on a plugin that wasn't installed.
124
+ * Fix: "Fatal error: Can not use method return value in write context" on older versions of PHP.
125
+
126
+ ### v1.8.0 - 02/20/2019
127
+ * Feature: New popup theme settings:
128
+ * New close button positions top center, bottom center, middle left & middle right.
129
+ * New option to position close button outside of popup.
130
+ * Improvement: Add constant to disable logging.
131
+ * Improvement: Added complete uninstall option.
132
+ * Improvement: Added limited experimental support for Gutenberg editor when creating popups. Complete support in the works.
133
+ * Improvement: Added new unified alerts interface on PM dash pages. This will keep you up to date on required migration changes, new features & more.
134
+ * Improvement: Added new translation request for detected polyglot admins when their language doesn't have an updated Language Pack.
135
+ * Tweak: Removed option setting to 'Hide Admin Support Widget' which is no longer relevant.
136
+ * Tweak: Add constant to disable logging.
137
+ * Fix: Condition options for BuddyPress integration had values & labels switched.
138
+ * Fix: Bug with Gravity Forms Personal Data menu item missing.
139
+ * Fix: iOS Click overlay close not working.
140
+ * Fix: Analytics not working for themes with incorrect wp_footer usage.
141
+
142
+ ### v1.7.30 - 09/06/2018
143
+ * Improvement: Further added methods to log unique messages only once.
144
+ * Tweak: Remove usage of Freemius.
145
+ * Fix: Added option to disable popups accessibility functionality to resolve some issues with focus trapping.
146
+ * Fix: Issues with log files growing too large. Max file size of 1MB and auto truncate to 250 lines now.
147
+ * Fix: Typo causing issues with Page Template condition.
148
+ * Fix: Typo in privacy link example text.
149
+ * Fix: Typo pointing to incorrect internal method call in new has_cookie method.
150
+ * Fix: Issues with fields not being readonly.
151
+
152
+ ### v1.7.29 - 06/13/2018
153
+ * Improvement: Added new enabled() method for the PUM_AssetCache class that checks both is writable and not disabled.
154
+ * Improvement: Added option to disable just asset caching. This should help in the case your server is blocking the use of our JS from the /uploads/ folder with a 403 error.
155
+ * Fix: Bug caused by string representations of boolean values passed in our subscription forms.
156
+
157
+ ### v1.7.28 - 06/10/2018
158
+ * Tweak: Improved validation of subscription form data and messaging.
159
+ * Fix: Bug with front end form serialization issue with single checkboxes (privacy field).
160
+
161
+ ### v1.7.27 - 06/08/2018
162
+ * Improvement: Added additional variable checks to allow graceful failing during certain JS errors when page cache is out of date.
163
+
164
+ ### v1.7.26 - 06/07/2018
165
+ * Fix: Add empty popups array to prevent errors due to page caching.
166
+
167
+ ### v1.7.25 - 06/05/2018
168
+ * Tweak: Localized most variables earlier to prevent errors. Added in default values in case they do not get rendered to prevent fatal JS errors.
169
+ * Fix: Tweaked extension activation class to be compatible with PHP 5.2.
170
+ * Fix: Bug where boolean scalar values were changed to "" for json_encode.
171
+
172
+ ### v1.7.24 - 06/04/2018
173
+ * Tweak: Updated subscriber table for existing sites that failed to add it properly before.
174
+
175
+ ### v1.7.23 - 06/04/2018
176
+ * Improvement: Converted cookie privacy info to tabular rendering.
177
+ * Tweak: Improved update notice text.
178
+ * Fix: Issues with subscriber table not being created. Thanks @jnorell
179
+ * Fix: Bug not allowing more than one cookie for a trigger.
180
+ * Fix: Undefined index errors in shortcake/shortcode-ui integration.
181
+
182
+ ### v1.7.22 - 05/25/2018
183
+ * Tweak: Updated Freemius library for GDPR optin support.
184
+ * Improvement: Made all popup loops more reliable.
185
+ * Fix: Error where objects were processed incorrectly.
186
+ * Fix: "Uncaught Error: Call to a member function get_setting() on boolean in /popup-maker/classes/AssetCache.php:314"
187
+
188
+ ### v1.7.21 - 05/24/2018
189
+ * Tweak: Clear asset cache on settings save.
190
+ * Improvement: Check that post is singular to prevent Post Selected conditions from working on site index.
191
+ * Improvement: Remove jquery-cookie from assets as we no longer use or load it anywhere.
192
+ * Fix: Missing function errors if you don't have WordPress v4.9.6.
193
+ * Fix: Added better & safer json encoding function that properly sanitizes data for encoding to prevent empty strings for non english sites.
194
+
195
+ ### v1.7.20 - 05/19/2018
196
+ * Feature: Support for GDPR Personal Data Exporter
197
+ * Feature: Support for GDPR Personal Data Eraser
198
+ * Feature: New privacy consent field for Subscription Forms for GDPR consent collection.
199
+ * Feature: GDPR privacy policy guide text added.
200
+ * Improvement: Updated dependency libs.
201
+ * Fix: Bug in subscriber tables if no popup ID was stored.
202
+
203
+ ### v1.7.19 - 05/01/2018
204
+ * Version bump due to svn file add issues during last commit.
205
+
206
+ ### v1.7.18 - 05/01/2018
207
+ * Fix: Typo in JS that may cause errors for some.
208
+
209
+ ### v1.7.17 - 05/01/2018
210
+ * Improvement: Added popup option to disable automatic re-triggering of popup after non-ajax form submission.
211
+ * Improvement: Added notice when JS errors occur in Popup Maker admin interfaces with link to documentation for proper diagnosis & reporting.
212
+ * Tweak: Added asset cache reset on update of core version & db version.
213
+ * Tweak: Removed debug code.
214
+ * Tweak: Simplified the post type batch processor setup for extensions.
215
+ * Dev: Added base PUM_Extension_Activator class to standardize extension activation and various other things.
216
+
217
+ ### v1.7.16 - 04/24/2018
218
+ * Tweak: Removed debug code.
219
+ * Fix: Issue with valueless shortcode attributes not processing properly.
220
+ * Fix: Issues where our scripts loaded before Ninja Forms scripts did and our integration didn't initialize.
221
+ * Dev: Added helper function to return array of shortcodes and data in usable format from any content.
222
+ * Dev: Added support for measure fields for shortcodes.
223
+
224
+ ### v1.7.15 - 04/14/2018
225
+ * Improvement: Removed metadata from object models to reduce cache size as WordPress already has them cached.
226
+ * Tweak: Added new filter and corrected typo in existing ones for extension integrations.
227
+ * Fix: Bug for potentially missing variable.
228
+ * Fix: Bug when using WordPress older than v4.4 and viewing the subscribers table.
229
+ * Fix: Bug where google fonts didn't always get loaded correctly.
230
+ * Fix: Missing styles from Advanced Theme Builder due to misordering.
231
+
232
+ ### v1.7.14 - 03/28/2018
233
+ * Fix: Obscure PHP error caused by method from interface was marked abstract in an abstract class inheriting the interface.
234
+ * Fix: Bug when jquery cookie is called from another plugin.
235
+ * Fix: Bug where form submit button triggered popup close when overlay click to close was enabled.
236
+ * Fix: Typo in previous patch for db_var not being updated properly.
237
+
238
+ ### v1.7.13 - 03/27/2018
239
+ * Tweak: Added fallback methods for conditions using MobileDetect to prevent errors when for whatever reason it was not loaded properly.
240
+ * Tweak: Added value type check to prevent errors in popup data.
241
+ * Fix: Bug with accessibility forced focus when there is a link in the popup, causing the close button to focus the link before closing.
242
+ * Fix: Bug that caused issues with MC extensions JS loading properly.
243
+ * Fix: Added fail-safe in case variables were not properly declared on page for mce-buttons.js.
244
+ * Fix: Set a deprecated option on new installs for backward compatibility issues.
245
+ * Fix: Selector correction in z-index setting application.
246
+
247
+ ### v1.7.12 - 03/21/2018
248
+ * Improvement: Added option to disable the shortcode ui.
249
+ * Tweak: Removed private popup type links from the nav menu editor.
250
+ * Fix: Bug with long term cached assets causing JS errors on nginx servers.
251
+ * Fix: Bug with support for custom popup z-index setting.
252
+ * Fix: Bug where NF loaded before Popup Maker and form actions were missing.
253
+ * Fix: Bugs in close delay settings for form integrations. Was in ms but needed to be in seconds.
254
+ * Fix: Bug where Yoast SEO plugin shows popups in the xml sitemaps and showing Yoast metabox on popup editor.
255
+
256
+ ### v1.7.11 - 03/14/2018
257
+ * Fix: Bug where Middle Center option wouldn't stay selected after saving.
258
+ * Fix: Bug with incorrect field dependency for custom height & scrollable options.
259
+
260
+ ### v1.7.10 - 03/14/2018
261
+ * Improvement: Further improved compatibility with shortcodes that echo/print rather than return content.
262
+ * Fix: Bug where cookies wouldn't always be set in Edge & Safari due to cookie path including the root url.
263
+ * Fix: Bug that changed the default tag for popup_trigger & popup_close shortcodes.
264
+ * Fix: Bug where extra close buttons didn't always work correctly.
265
+ * Fix: Removal of deprecated function that triggered warnings in PHP 7.2.
266
+
267
+ ### v1.7.9 - 03/14/2018
268
+ * Improvement: Replaced usage of pumSerializeForm with pumSerializeObject which is more reliable.
269
+ * Fix: Bug where deprecated directory reference causes popup html not to render properly breaking popups that should have worked otherwise.
270
+ * Fix: Bug where checkbox defaults continuously applied making it impossible to uncheck them.
271
+
272
+ ### v1.7.8 - 03/13/2018
273
+ * Improvement: Added output buffering to early calls to do_shortcode to prevent premature output in the head.
274
+ * Improvement: Added sanity checks to make sure only valid popup objects are used in some older template functions.
275
+
276
+ ### v1.7.7 - 03/13/2018
277
+ * Fix: Removed jQuery.serializeJSON functionality which was unused and causing conflicts with WooCommerce.
278
+ * Fix: SSL Issues due to not specifying protocol.
279
+ * Fix: Error caused by invalid popup object being used in function.
280
+ * Fix: PHP 5.2 compatibility issue.
281
+
282
+ ### v1.7.6 - 03/12/2018
283
+ * Fix: Undid previous changes from 1.7.1 and reworked in a new way to be backward compatible with existing extensions.
284
+
285
+ ### v1.7.5 - 03/12/2018
286
+ * Fix: Sticky Popup Maker settings checkboxes that wouldn't uncheck after save.
287
+
288
+ ### v1.7.4 - 03/12/2018
289
+ * Fix: Invalid method declaration error introduced by v1.7.2 patch to Shortcode core class.
290
+
291
+ ### v1.7.3 - 03/12/2018
292
+ * Fix: Error due to usage of __CLASS__ rather than $this.
293
+ * Fix: Edge case where function returns can't be used inside empty().
294
+
295
+ ### v1.7.2 - 03/12/2018
296
+ * Fix: Initialization variable wasn't set to true early enough.
297
+
298
+ ### v1.7.1 - 03/12/2018
299
+ * Fix: Empty value errors.
300
+ * Fix: Missing function for 3rd party plugin backward compatibility (Elementor).
301
+
302
+ ### v1.7.0 - 03/12/2018
303
+ This was a monster update, our largest to date in terms of improving existing functionality, reducing maintenance and the time it takes to implement new features in the future.
304
+
305
+ Noticeably there are a lot of interface changes with this version as we simplified from having many meta boxes in the popup editor to a new single panel interface.
306
+
307
+ Lastly we now have include our extendable subscription forms right in the free version. We currently don't provide support for mail/service providers in the free version, but have opened up our form API in the hopes that 3rd party developers will help us fill that gap. Don't fret though, submissions are stored in a custom table for retroactive syncing to lists or export (not yet available).
308
+
309
+ * Feature: Subscriber forms now included without a paid extension.
310
+ * Provider API for easily extending forms to work with 3rd party providers.
311
+ * New shortcode with tons of options built in.
312
+ * Stores subscribers into a new custom table for import into your favorite system at a later time.
313
+ * Feature: Front end asset overhaul, now uses cached static assets.
314
+ * All front end assets now combined into single js & css file.
315
+ * Custom styles are now saved along with all core & extension styles eliminating inline style blocks.
316
+ * Reduction of footprint means massively improved loading performance.
317
+ * Dynamic file creation allows for some awesome upcoming features.
318
+ * Now completely compatible with plugins like Autoptimize (Thanks Frank).
319
+ * Feature: Support for nearly any form, including non ajax forms.
320
+ * Helper functions to integrate your 3rd party form plugins quickly.
321
+ * Show thank you popups, set cookies & close popups with a delay after success (requires code).
322
+ * Automatically reopen popup forms after refresh from a form submission.
323
+ * Improvement: Lots of text, label & description changes to be more intuitive.
324
+ * Improvement: Better 3rd party plugin support including page builders:
325
+ * Popup post type is now public.
326
+ * Better support for 3rd party shortcodes which require extra assets loaded (JS/CSS).
327
+ * Improvement: Adding trigger now gives optional choices to create a cookie, rather than being automatic.
328
+ * Improvement: New Popup Settings tabbed interface to help make settings more intuitive & easy to find on one screen.
329
+ * Now all popup settings are stored in a single meta key reducing DB clutter.
330
+ * Improvement: New Popup Maker Settings tabbed interface to help make settings more intuitive & easy to find on one screen.
331
+ * Improvement: New Popup preview mode.
332
+ * Improvement: Better page builder support by changing popup post type arg for public to true.
333
+ * Improvement: Resource reduction & optimization.
334
+ * Added class autoloader for core and extensions.
335
+ * Greatly simplified code base & internal API structures.
336
+ * Converted many internal APIs to use passive loading.
337
+ * Added internal caching.
338
+ * Improvement: Integrated [WPJSF](https://github.com/danieliser/WP-JS-Form-Sample-Plugin) lib for easier maintenance and quicker updates of our admin forms.
339
+ * Improvement: Various improvements to smart select fields (jQuery select2) including:
340
+ * Allow multiple page/post selections without reopening/searching again.
341
+ * Properly highlights & shows selected items after save/reload.
342
+ * Paginated/scroll based loading of more results over ajax.
343
+ * Now shows list of recent "items" immediately upon clicking the field rather than requiring search.
344
+ * Improvement: Admin asset handling
345
+ * Modularized admin assets for easier debugging & maintenance.
346
+ * Improvement: Popup Trigger shortcode can now use custom popup IDs.
347
+ * Improvement: Added new batch processing system for upgrades and other processes.
348
+ * Improvement: Removed a lot of old code.
349
+ * Improvement: Rebuilt Shortcode UI that should be more reliable.
350
+ * Improvement: Addressed most all PHP 7 notices.
351
+ * Improvement: iOS scrolling issue fixes.
352
+ * Improvement: Added support for KingComposer.
353
+ * Tweak: Support for subdirectory sites having their own sitewide cookies.
354
+ * Fix: Incorrect BuddyPress condition labels
355
+ * Fix: Bug when WPML isn't yet available.
356
+
357
+
358
+ ### v1.6.7 - Rolled into v1.7.0
359
+ * Fix: Typo in JS event name prevented forceFocus for popups.
360
+ * Fix: JS errors when Marionette JS library on page without Ninja Forms.
361
+ * Fix: WPML missing variable errors.
362
+
363
+ ### v1.6.6 - 07/29/2017
364
+ * Fix: Bug with closing forms using newest version of Gravity Forms.
365
+
366
+ ### v1.6.5 - 07/16/2017
367
+ * Tweak: Added new popup class for theme names. Thanks @bluantinoo.
368
+ * Fix: Bug in menu popups save and render functionality not working correctly.
369
+ * Fix: Finally found issue where randomly assets tab checkboxes wouldn't uncheck & save properly.
370
+ * Fix: Sanitized active tab key against whitelist.
371
+ * Fix: Errors in w3c validation scans from form meta fields.
372
+ * Fix: Settings asset label mismatch.
373
+
374
+ ### v1.6.4 - 07/07/2017
375
+ * Imporvement: Reworked all form integrations to be as DRY as possible making it more reliable.
376
+ * Tweak: Added sanity check in case previous filter mucks up the $item object variable in menu item filters causing warnings.
377
+ * Tweak: Disabled the open count & sorting when Popup Analytics is activated.
378
+ * Tweak: Added NF datepicker CSS fix.
379
+ * Tweak: Added media type to head styles to force optimization plugins to keep them in order.
380
+ * Tweak: Reverted to older method of click trigger assignment to better work with multiple popups on one trigger with conditions.
381
+ * Fix: Bug caused by use of a function some users host blocked.
382
+ * Fix: Bug caused by debug mode being enabled with a form success cookie.
383
+ * Fix: Bug when Gravity Form was not in popup but triggered a thank you popup.
384
+ * Fix: Bug with GForms closing popup after submission.
385
+ * Fix: Bug where CF7 Forms with required fields trigger popup to close without being filled properly.
386
+
387
+ ### v1.6.3 - 05/19/2017
388
+ * Fix: Removed 3rd parameter from number_format as it only accepts 1, 2 or 4 arguments, not 3 per php.net documentation.
389
+
390
+ ### v1.6.2 - 05/18/2017
391
+ * Fix: Bug caused by rounding to whole numbers in opacity values.
392
+
393
+ ### v1.6.1 - 05/17/2017
394
+ * Improvement: Major improvements to the Shortcode UI (builder & in editor previews). Now supports true live rendering of PM shortcodes. This will be most apparent in upcoming extension updates.
395
+ * Fix: Forced decimal formatting in CSS output functions in case of locale changes to formatting. Fix thanks to @timhavinga
396
+
397
+
398
+ ### v1.6.0 - 04/26/2017
399
+ * Feature: Added Gravity Forms direct integrations.
400
+ * Close popup with delay when Gravity Form is submitted.
401
+ * Trigger a thank you popup when Gravity Form is submitted.
402
+ * Set cookies easily when the Gravity Form is in a popup.
403
+ * Feature: Added Contact Form 7 (CF7) direct integrations.
404
+ * Close popup with delay when contact form 7 is submitted.
405
+ * Trigger a thank you popup when contact form 7 is submitted.
406
+ * Set cookies easily when the CF7 form is in a popup.
407
+ * Forced CF7 assets to load when used in a popup on the off chance they don't automatically.
408
+ * Tweak: Increased action priority for condition registration in case plugins register post types late, such as PODs.
409
+ * Tweak: Moved popup theme styles to a very late position in the head to prevent them from being overwritten when minifying CSS.
410
+ * Fix: Bug where you couldn't enter values higher than the rangeslider max.
411
+ * Fix: JS error when creating a cookie before a trigger exists.
412
+
413
+ ### v1.5.8 - 04/04/2017
414
+ * Fix: Error when extensions were active due to null values for checkboxes.
415
+
416
+
417
+ ### v1.5.7 - 03/27/2017
418
+ * Improvement: Added option to disable the menu editors in case of a conflict.
419
+ * Fix: Forced 100% width on page select boxes to prevent them from being too small.
420
+ * Fix: Bug where checkboxes were not staying checked.
421
+
422
+ ### v1.5.6 - 03/16/2017
423
+ * Feature: Admin Bar helper tool to assist in getting proper click trigger selectors easily.
424
+ * Improvement: Further tweaks for maximium compatibitlity with nav menu editor.
425
+ * Improvement: Added Popup option to nav menu editor Screen Options to easily hide them.
426
+ * Fix: Updated the freemius-sdk to fix an obscure secured php core function error.
427
+
428
+ ### v1.5.5 - 03/13/2017
429
+ * Improvment: Used generic Nav Menu Editor Walker classes for better support. This should remove the notices from other plugins as well.
430
+ * Fix: Bug that causes click triggers to lag.
431
+
432
+ ### v1.5.4 - 03/13/2017
433
+ * Fix: Typos in conditions.
434
+ * Fix: Moved class_exists checks to better handle possible missing class errors.
435
+
436
+ ### v1.5.3 - 03/13/2017
437
+ * Improvement: Added a catch for any triggers not initialized at page load.
438
+ * Fix: Typo in multi check field template that led to admin JS errors.
439
+
440
+ ### v1.5.2 - 03/10/2017
441
+ * Improvement: Added option to disable the admin bar Popups helper menu item.
442
+ * Improvement: Simplified the nav menu editor modification class to reduce un-needed translation strings.
443
+ * Fix: Added check for missing class in the nav menu editor walker classes.
444
+
445
+ ### v1.5.1 - 03/09/2017
446
+ * Fix: PHP 5.2 Compatibility issue.
447
+
448
+ ### v1.5.0 - 03/08/2017
449
+ * Feature: Position popups based on the click trigger. Tooltips & Popovers are now possible.
450
+ * Feature: Added new conditions for targeting children & grandchildren / ancestors of selected content.
451
+ * Feature: Added new settings to the Nav Menu editor to choose a popup that a menu item will trigger.
452
+ * Feature: Addded option to Disable on Tablets as well as mobile phones.
453
+ * Feature: Added WooCommerce is_wc_endpoint_url conditions.
454
+ * Feature: Added new click selector presets for quicker targeting & more user friendly.
455
+ * Feature: Added a new debug mode. Including:
456
+ * Admin Bar with manual open, close & cookie resets for loaded popups.
457
+ * Improvement: New global JS functions for easily working with popups. PUM.open(123), PUM.close(123), PUM.clearCookies(123).
458
+ * Improvement: Added inline links to docs for various settings.
459
+ * Improvement: Reworked popup analytics to improving response times and decreasing server loads.
460
+ * Moved Analytic tracking to the WP-API with a new endpoint.
461
+ * Reduced number of queries by 75% for analytics tracking.
462
+ * Added option to disable it entirely if absolutely neccessary.
463
+ * Improvement: Many improvements to JavaScript including object caching.
464
+ * Tweak: Creating a new trigger will automatically create a cookie and assign it if one doesn't exist.
465
+ * Tweak: Mobile Disable was also applied to tablets, now only to phones.
466
+ * Tweak: Removed readonly from rangesliders to make the fact you can manually enter any value more intuitive.
467
+ * Tweak: Use CSS to display a popup immediately if has trigger: auto open: delay 0.
468
+ * Tweak: Clicking elements in the visual theme preview will now scroll to the relevant section of settings.
469
+ * Fix: Bug in admin when editing a trigger, cookie field didn't repopulate properly.
470
+ * Fix: Bug where rangeslider values can be set to strings.
471
+ * Fix: Bug where links in the close button were not triggered even when do_default was enabled.
472
+ * Fix: Bug with scrollbar "flashing" when popup opens.
473
+
474
+ ### v1.4.21 - 12/12/2016
475
+ * Feature: Added option to disable popup on mobile to comply with [Google's new interstital policy](https://webmasters.googleblog.com/2016/08/helping-users-easily-access-content-on.html).
476
+ * Tweak: Added additional paramter to the pum_popup_get_conditions filter.
477
+ * Tweak: Fixed possible false init of NF integration if NF is not enabled.
478
+ * Tweak: Added CSS override for Ninja Forms datepickers to properly layer them above popups.
479
+
480
+ ### v1.4.20 - 10/13/2016
481
+ * Feature: Added [Ninja Forms](https://wppopupmaker.com/grab/ninja-forms?utm_source=readme-changelog&utm_medium=text-link&utm_campaign=Readme&utm_content=ninja-forms-features) success actions for opening & closing popups.
482
+ * Feature: Added new cookie event for successful submission of a [Ninja Forms](https://wppopupmaker.com/recommends/ninja-forms) form.
483
+ * Improvement: Added wp.hooks JS library, allowing actions & filters via our plugin JS.
484
+ * Tweaks: Added various admin css tweaks.
485
+
486
+ ### v1.4.19 - 9/30/2016
487
+ * Feature: Added a do_default parameter to the trigger & close shortcodes. This allows making close buttons that also download a file.
488
+ * Improvement: Added support for JS (advanced) conditions & condition processing after checking for cookies.
489
+ * Improvement: Upgraded from jQuery-Cookie (modified) to JS-Cookie (modified) for more flexibility.
490
+ * Fix: Bug where color didn't update properly when first clicked in theme editor.
491
+ * Fix: Added prefix to admin pages to prevent conflicts.
492
+ * Fix: Removed usage of deprecated filter.
493
+
494
+ ### v1.4.18 - 8/15/2016
495
+ * Fix: Bug with PHP 5.2 compatibility.
496
+ * Fix: Added missing post_type index condition callback.
497
+
498
+ ### v1.4.17 - 8/14/2016
499
+ * Fix: Bug caused by using return value in write context.
500
+
501
+ ### v1.4.16 - 8/14/2016
502
+ * Feature: New Condition: Pages: With Template. Thanks @cedmund.
503
+ * Feature: Option to Disable reposition on window resize/scroll.
504
+ * Improvement: Enable Visual Composer for Popups by default (VC 4.8+). Thanks @NoahjChampion.
505
+ * Improvement: Replaced usage of gif hex code with loading of an actual tracking gif to prevent security scanners from throwing false positives.
506
+ * Improvement: Changed default analytics response with a 204 no content heading, saving the need to load & return a tracking gif.
507
+ * Fix: Missing condition value bug fixed by adding sanity checks to conditions on get.
508
+ * Fix: Auto Height checkbox wouldn't stay unchecked.
509
+ * Fix: CSS class pum-open-overlay wasn't being removed from HTML element on popup close causing issues for next popup.
510
+ * Fix: Error in JS due to shortcodes: Uncaught Error: Syntax error, unrecognized expression.
511
+ * Fix: Issue where some custom post types not working with conditions.
512
+
513
+ ### v1.4.15 - 7/20/2016
514
+ * Improvement: Only showed the aria-label attribute if the label will be shown.
515
+ * Tweak: Updated the Freemius SDK.
516
+ * Tweak: Updated the #popmake-{ID} selector to work at the end of a link.
517
+ * Fix: Bug where stackable popups would lose their scroll bar after one was closed.
518
+
519
+ ### v1.4.14 - 7/14/2016
520
+ * Feature: Links with the url #popmake-{ID} will now trigger a popup when clicked. Links with this href will work similar to elements with the popmake-{ID} class.
521
+
522
+ ### v1.4.13 - 6/26/2016
523
+ * Feature: Added 12 of the most commonly needed BuddyPress content types & targeting conditions. Target any BP content type. Now full support for BuddyPress.
524
+ * Tweak: Moved a few functions from the plugins_loaded action to the init action for minor compatibility benefits.
525
+ * Tweak: Removed Popup & Popup Theme Meta Revisioning as it adds unneeded clutter to the DB.
526
+
527
+ ### v1.4.12 - 6/24/2016
528
+ * Improvement: Reduced translatable strings from 569 total to 439 which is about a 23% reduction which will reduce work for our translators.
529
+ * Tweak: Removed the welcome page and associated CSS, images etc. This cleans up some useless strings for translation.
530
+ * Fix: Bug where add_new cookie wasn't properly replaced for the first trigger.
531
+
532
+ ### v1.4.11 - 6/10/2016
533
+ * Feature: New conditions for targeting posts & taxonomy by ID.
534
+ * Improvement: Added link to Conditions Documentation to the Conditions editor.
535
+ * Tweak: Namespaced jQuery.serializeObject to prevent conflicts with other plugins/themes in the admin editor.
536
+ * Fix: Bug on add new page/post and during post update.
537
+ * Fix: Bug in edit this theme link on page load.
538
+
539
+ ### v1.4.10 - 5/23/2016
540
+ * Feature: Added Do Default option to the click triggers. Allows a triggers default browsers behavior to occur and still open a popup, such as a file link.
541
+ * Improvement: Added additional links to the theme editor for better visibility and to guide users there.
542
+ * Tweak: Older methods are only loaded when needed, this also removes usage of a deprecated filter.
543
+ * Tweak: All Pages now includes Home Page / Front Page.
544
+ * Tweak: A default click trigger is always added. (Like pre v1.4)
545
+ * Fix: Low z-index caused issues when the overlay is disabled.
546
+ * Fix: Bug where none animation couldn't be re-opened.
547
+ * Fix: Cleaned up issues allowing popup post type to be added directly to menus and sitemaps.
548
+ * Fix: Bug where auto height checkbox would not stay checked.
549
+
550
+ ### v1.4.9 - 5/01/2016
551
+ * Improvement: Reduced front end queries by over 85%. Avgerage sites should now only have 2 to 3.
552
+ * Improvement: Added caching enhancements for even better performance on servers with page, object & query caching.
553
+ * Improvement: Added a fully namespaced version of Select2 for compatiblitiy while other plugins await updating. Will gracefully fall back to the non namespaced version when it no longer causes issues.
554
+ * Fix: Undefined 'amd' JS errors.
555
+ * Fix: The "Use Your Theme" font option was not working correctly.
556
+ * Fix: Removed leftover console.logs in our JavaScript.
557
+
558
+ ### v1.4.8 - 4/27/2016
559
+ * Improvement: Sandboxed Select2 v4 since it breaks other plugins when loaded properly. v4 adds accessiblity enhancements that we are not going to sacrifice for compatiblity with plugins who have not updated to include it. This provides a safe alternative in the meantime.
560
+ * Tweak: Removed extra shortcode files.
561
+ * Tweak: Allow popup Click Triggers to target another popups close button. Close one triggers another etc.
562
+ * Fix: Bug caused by pum_shortcode_ui not loading properly everywhere.
563
+ * Fix: Bug in popup position calculation when the popup used Fixed Position and Disable Overlay
564
+
565
+ ### v1.4.7 - 4/24/2016
566
+ * Improvement: Removed the old styles dropdown as it is no longer needed.
567
+ * Improvement: Added check for old versions of Select2 and replace them with latest which is backward compatible.
568
+ * Fix: Bug that caused Close button delay to not show the close button.
569
+ * Fix: Replaced usage of <% style JS template with <# & {{ for PHP asp_tags compatibility.
570
+
571
+ ### v1.4.6 - 4/22/2016
572
+ * Fix: Bug in new post editor JS.
573
+ * Fix: Added filter to override permissions for upgrade routines.
574
+
575
+ ### v1.4.5 - 4/21/2016
576
+ * Fix: Replaced all usage of static:: for PHP 5.2 compatiblity.
577
+ * Fix: Forced the latest version of Select2 to load on Popup Maker admin pages in the case that an older version was enqueued.
578
+
579
+ ### v1.4.4 - 4/20/2016
580
+ * Fix: Version Bump to fix upgrade issues.
581
+
582
+ ### v1.4.3 - 4/20/2016
583
+ * Fix: Removed extra whitespace before opening php tags.
584
+
585
+ ### v1.4.2 - 4/20/2016
586
+ * Fix: Bug in popup maker deprecated filter caused by no defaults passed.
587
+
588
+ ### v1.4.1 - 4/20/2016
589
+ * Fix: Bug in popup maker upgrade class for older versions of PHP.
590
+
591
+ ### v1.4 - 4/20/2016
592
+ * Feature: Added basic analytics. Tracks how many unique opens each popup has.
593
+ * Feature: Added new Popup Maker shortcodes button to the editor with visual previews.
594
+ * Feature: Added option to reset popup open counts demand.
595
+ * Feature: New add / remove targeting conditions UI.
596
+ * Feature: Conditions can now be negative as well as grouped as AND / OR.
597
+ * Feature: New conditions for targeting posts & cpt by taxonomy. IE Posts with Tag / Category.
598
+ * Feature: New add / remove triggers UI that allows multiple of the same trigger per popup.
599
+ * Feature: Added a new add / remove cookies UI that manages cookies separate from triggers.
600
+ * Feature: Added 5 new built in themes.
601
+ * Feature: Added support for pods content types.
602
+ * Feature: Added full screen front end previews for admins and editors.
603
+ * Feature: Added additional WooCommerce conditions such as on checkout.
604
+ * Improvement: Added CSS resets to all core popup elements to ensure a reliable look.
605
+ * Improvement: Popups are now rendered with their own overlay. This allows the popup to scroll inside the overlay.
606
+ * Improvement: Cookie names can now be set to anything, including cookies from other plugins.
607
+ * Improvement: Triggers now support checking more than one cookie.
608
+ * Improvement: Accessibility & screen reader enhancements to the popups and admin.
609
+ * Improvement: Auto Focus the first element in the popup when it opens for screen readers.
610
+ * Improvement: Better JavaScript encapsulation and organization.
611
+ * Improvement: Added support for Select2 smart dropdowns for admin interfaces.
612
+ * Improvement: Added a more reliable upgrade routine system.
613
+ * Improvement: Added an option to disable popup taxonomies if not in use.
614
+ * Improvement: Added more reliable usage tracking via [Freemius](https://freemius.com/wordpress/).
615
+ * Tweak: Updated extensions page and added a list of plugins that work well with Popup Maker.
616
+ * Fixed: Super annoying fixed position checkbox glitch.
617
+ * Fixed: Missing check for disabled google fonts before loading them.
618
+ * Fixed: Bug where hidden about pages showed up when certain admin menu editing plugins were active.
619
+ * Fixed: Bug where default theme was not properly created on install.
620
+ * Fixed: Bug where non utf-8 characters were used in the name field and caused JS errors.
621
+ * Fixed: Bug where popup triggers inside their own popup would cause it to close and reopen when clicked.
622
+ * Dev: Introduced PUM_Fields a settings API that support _.js Templ fields.
623
+ * Dev: Added new action 'pum_styles' that can be used to render custom CSS.
624
+ * Dev: Added new PUM_Popup class with nearly all methods built in.
625
+ * Dev: Introduced new prefix pum_ rather than popmake_.
626
+
627
+ **v1.4 Change Set Statistics:**
628
+ 365 Commits / 53 Major & Minor Issues Closed.
629
+ 285 changed files with 20,437 additions and 3,607 deletions.
630
+
631
+ ### v1.3.9 - 10/14/2015
632
+ * Feature: New shortcode - [popup_close] allows adding custom close buttons/text. Ex. [popup_close] Click Me [/popup_close].
633
+ * Improvement: Added SASS/SCSS files for the site & admin styles.
634
+ * Improvement: Added better support for current & legacy versions of Visual Composer.
635
+ * Improvement: Added check for preventClose class on a popup just before closing. If found the popup won't close.
636
+ * Fix: Fixed bug in theme editor that caused Google Font variants to not show up.
637
+ * Fix: Fixed bug in CSS generation where Google Font URL would become corrupted and cause a 404.
638
+ * Fix: Fixed bug where fixed position would show unchecked even if it was checked.
639
+ * Fix: Fixed bug in CSS that caused popup to appear below site on mobile.
640
+ * Fix: WP Multi Site: Fatal Error.
641
+
642
+ ### v1.3.8 - 9/29/2015
643
+ * Fix: Updated links to documentation.
644
+ * Fix: Removed exploitable bug allowing script execution in the admin. Discovered 9/29/15 - Patched 9/29/15
645
+
646
+ ### v1.3.7 - 9/21/2015
647
+ * Feature: Added support for Visual Composer to popups. (Backend Editor Only). Works Perfectly with Responsive Popups.
648
+ * Tweak: Disable position fixed on mobile screens for responsive popups.
649
+ * Tweak: Improved UI with better popup formats selection.
650
+ * Fix: Bug with default theme not properly being created.
651
+ * Fix: Bug where default & theme formats were overridden in the WP Editor.
652
+ * Fix: Bug with default theme not being used for [popup] shortcode.
653
+ * Fix: Bug with loading Google Fonts properly.
654
+ * Fix: Errors generated by incorrectly formatted colors in the editor.
655
+ * Fix: Bug with targeting conditions for categories.
656
+ * Fix: Bug in positioning left & right values. Credit to @invik for the solution.
657
+
658
+ ### v1.3.6 - 8/25/2015
659
+ * Confirmed WP v4.3 compatibility.
660
+ * Tweak: Default theme is automatically used if a popup does not have one assigned.
661
+ * Fix: UI bug where fixed position checkbox wouldn't stay checked.
662
+ * Fix: Bug with Theme Default values & v1.2 values not being merged.
663
+
664
+ ### v1.3.5 - 8/18/2015
665
+ * Tweak: Corrected missing keys for required script checks.
666
+ * Fix: Error message caused by non array value from get_post_custom.
667
+ * Fix: Removed missing variable.
668
+ * Fix: Text corrections.
669
+
670
+ ### v1.3.4 - 8/12/2015
671
+ * Fix: Added px to font-size & line-height.
672
+
673
+ ### v1.3.3 - 8/12/2015
674
+ * Fix: Added current_action fallback function for older versions of WP.
675
+ * Fix: Theme CSS rendering incorrect font settings.
676
+
677
+ ### v1.3.2 - 8/10/2015
678
+ * Tweak: Pause HTML5 Videos when popup closes.
679
+ * Fix: Prefixed several functions that collided with some themes.
680
+ * Fix: Changed default Close Height & Width to 0/auto.
681
+
682
+ ### v1.3.1 - 8/8/2015
683
+ * Fix: Error in get_called_class alternate function for PHP 5.2
684
+ * Fix: Force theme css builder to check for empty themes.
685
+ * Fix: Bug where z-indexes were incorrectly set.
686
+
687
+ ### v1.3 - 8/7/2015
688
+ * Feature: Added unlimited themes functionality to the core.
689
+ * Feature: Allow disabling of event.prevendDefault() for on click events by adding do-default class.
690
+ * Feature: Added support for session based cookies.
691
+ * Feature: Add Height & Width options to Close Button for better control.
692
+ * Feature: Theme styling is now rendered in the head via inline CSS with an option to disable in the case that popup styles have been moved to the theme stylesheet.
693
+ * Feature: Delay showing the close button after the popup opens. Set the delay in ms.
694
+ * Feature: Added stackable popups option to show more than one popup at a time. ( A stackable popup won't close other popups when its opened. )
695
+ * Feature: Added WooCommerce Targeting Conditions.
696
+ * Feature: Added new system info tab on the tools page to make debugging faster.
697
+ * Tweak: Change default responsive mobile size to 95%.
698
+ * Tweak: Change default z-index to 1999999999.
699
+ * Tweak: Add ability to pass a callback to the popmake('close') method.
700
+ * Tweak: Add namespace to click open event ('click.popmakeOpen').
701
+ * Tweak: Add $default arg to popmake_get_popup_meta_group function.
702
+ * Tweak: Auto close content tags using balanceTags().
703
+ * Tweak: Added new popmake_get_popup(), get_the_popup_ID(), popmake_get_the_popup_ID(), popmake_the_popup_ID() functions.
704
+ * Tweak: Check if popup is already open before auto opening.
705
+ * Tweak: Add ajax="true" to gravity forms shortcodes if not there.
706
+ * Tweak: Make auto open cookie key optional.
707
+ * Tweak: Disable fixed position for responsive sizes.
708
+ * Tweak: Compensate for Admin Bar when visible.
709
+ * Tweak: Added options to disable Support & Share admin widgets.
710
+ * Tweak: Added new filter popmake_popup_default_close_text to allow filtering of popup close text.
711
+ * Tweak: Added close text override on a per popup basis. New option under Close Settings.
712
+ * Tweak: Choosing a responsive size will automatically disable fixed position & scrollable content.
713
+ * Tweak: Unneeded data attributes are now removed to clean up html.
714
+ * Tweak: Meta has now been compressed into serialized arrays for popups and themes.
715
+ * Tweak: Added new Meta Field management class as a step toward a more maintainable code base.
716
+ * Fix: Add option to disable moving of popup to end of <body>.
717
+ * Fix: Corrected input type under Click-Open Settings meta box.
718
+ * Fix: Description cleanup for popup location.
719
+ * Fix: Correct French translation file name.
720
+ * Fix: Rewrote popup loop to not overwrite global $post breaking some content shortcodes.
721
+ * Fix: Bug when clicking publish with empty name field publish becomes unclickable again.
722
+ * Fix: Sitewide cookie option will not stay unchecked.
723
+ * Fix: Bug where popup & popup_theme meta was stored with other post types on revision.
724
+ * Fix: Bug in the popup_trigger shortcode with $content not being rendered properly.
725
+
726
+ ### v1.2.2
727
+ * Added (string) typecast to prevent errors in wp_localize_script when passing integers.
728
+ * Added 100% French & Hungarian translations.
729
+ * Added partial German translation.
730
+ * Moved template.php require line to load for both admin and front end for use in ajax responses.
731
+ * Changed order of admin pages to allow extensions to load before settings/help/tools pages on menu.
732
+ * Added troubleshooting FAQ to readme.
733
+ * Added version to JS object for backward compatibility checks.
734
+ * Added check for preventOpen class before opening. This class will prevent the popup from opening.
735
+ * Corrected minWidth variable name.
736
+ * Added namespace to the auto open cookie event.
737
+ * Changed the last open trigger to use the jQuery object instead of xpath.
738
+ * Added an isScrolling variable to detect when the browser is actively scrolling.
739
+ * Checked isScrolling before adding overflow styles to the HTML element to prevent glitching.
740
+ * Temporarily removed the grow animations due to removal of Greensock Animation Platform.
741
+ * Removed Greensock Animation Platform dependancy.
742
+
743
+ ### v1.2.1
744
+ * Fixed bug caused by null value passed to JS data attr.
745
+
746
+ ### v1.2
747
+ * Added full screen preview for themes when editing using the Preview button.
748
+ * Added full screen preview for popup when editing using the Preview button.
749
+ * Added new shortcode 'popup_trigger' that allows users to easily add the correct popmake- class. Accepts id, tag & class parameters.
750
+ * Updated GSAP JS plugin to latest version.
751
+ * Removed jQuery.gsap.js usage.
752
+ * Added fallback list of Google Fonts for when API is unavailable.
753
+ * Setup extensions page to use a static list of extensions for the time being.
754
+ * Updated API url.
755
+ * Removed Popmake_Admin_Notices class as it was unused.
756
+ * Fixed bug where share metabox wouldn't stay hidden.
757
+ * Added function to prevent deletion of default theme.
758
+ * Fixed bug which caused Popup Maker menu to show to all users.
759
+
760
+ ### v1.1.10
761
+ * Fixed invalid argument bug passed to google font foreach.
762
+ * Fixed CSS box-sizing cross browser support.
763
+
764
+ ### v1.1.9
765
+ * Added %'s to reponsive sizes in size dropdown.
766
+ * Remove usage of the_content and the_content filters.
767
+ * Fixed responsive sizes.
768
+
769
+ ### v1.1.8
770
+ * Fixed issue with admin menu position collisions.
771
+ * Fixed issue with banner not staying dismissed.
772
+ * Removed dependency jQuery.cookie
773
+ * Fixed bug in auto open when cookie was set before delay was up.
774
+ * Added new setCookie JS event. Used to manually set a popups cookies. Usage jQuery('#popmake-123').trigger('popmakeSetCookie');
775
+ * Added new z-index override values. This helps with theme compatibility and future multi popup capability.
776
+ * Added Blog Index support. Available under targeting conditions 'On Blog Index' & 'Exclude On Blog Index'.
777
+ * Added better responsive image handling.
778
+ * Added Admin Debug option for popups.
779
+ * Changed jquery-ui-position collission property to none to solve positioning issues.
780
+ * Disabled Popup Maker JS & CSS when no popups detected to load.
781
+ * Added new function popmake_enqueue_scripts() which allows manual enqueuing of scripts and styles.
782
+
783
+ ### v1.1.7
784
+ * Fixed undefined function popmake_default_settings.
785
+ * Fixed specific pages not saving properly.
786
+ * Now removes ?autoplay parameter from Videos preventing them from playing again without interaction.
787
+
788
+ ### v1.1.6
789
+ * Fixed bug in js not setting correct CSS value for min-width.
790
+ * Changed close link element tag from a > span.
791
+
792
+ ### v1.1.5
793
+ * Fixed bug when clicking add selected buttons.
794
+ * Changed how popmake_popup_is_loadable works. It is now more organized and readable.
795
+ * Added 2 new Targeting Conditions: Search & 404.
796
+
797
+ ### v1.1.4
798
+ * Fixed bug in scrollable content styles.
799
+ * Fixed bug in admin JS for duplicate input names.
800
+ * Changed Powered By Setting to Off by Default.
801
+ * Changed default permissions required to use theme builder.
802
+ * Fixed bug in targeting conditions.
803
+
804
+ ### v1.1.3
805
+ * Fixed some incorrect links to resources and kb.
806
+ * Removed Auto Open Promotional Material ( as it is now included ).
807
+
808
+ ### v1.1.2
809
+ * Further enhancements to ensure proper checking of Auto Open Enabled.
810
+
811
+ ### v1.1.1
812
+ * Fixed bug in JS that didn't properly check if Auto Open was enabled.
813
+
814
+ ### v1.1
815
+ * Added Importer for Easy Modal v2 - Availabe under Tools -> Import
816
+ * Added Easy Modal v2 Compatibility Option - Available under Settings -> Misc (This will allow all of your existing eModal classes to open the proper Popup once imported)
817
+ * Added custom selector functionality - Availabe on Modal editor (This will allow you to use your own css selectors that when clicked will trigger the popup to open. Ex. #main-menu li.menu-item-3 would cause the corresponding menu item to trigger that popup)
818
+
819
+ ### v1.0.5
820
+ * Fixed bug caused by changes in v1.0.4.
821
+
822
+ ### v1.0.4
823
+ * Admin UI Adjustments & Tweaks.
824
+ * Fixed bug in removing specific post types.
825
+ * Reformatted Code.
826
+ * Fixed incorrect variable.
827
+
828
+ ### v1.0.3
829
+ * Fixed bug with recursive filter.
830
+ * Fixed bug caused by typo.
831
+ * Fixed bug in JS for removing specific post type posts.
832
+
833
+ ### v1.0.2
834
+ * Resized Extension page images to load quicker on extensions page.
835
+ * Added last_open_popup proerty to popmake jQuery function.
836
+ * Resized Extension page images to load quicker on extensions page.
837
+ * Fixed misc Admin Styles.
838
+ * Corrected support links.
839
+ * Fixed Bug in Meta boxes on settings page.
840
+ * Renamed files appropriately.
841
+ * Added new section callback for settings API.
842
+ * Fixed small glitch in Opt In for Credit Link.
843
+
844
+ ### v1.0.1
845
+ * Removed links to getting started from "Dashboard" Admin Menu.
846
+ * Added Line Height Setting to Both Title and Close, Allowing Perfect Circles for close button.
847
+ * Updated admin styles.
848
+ * Misc Admin changes, including new filters/hooks for upcoming extensions.
849
+
850
+ ### v1.0.0
851
+ * Initial Release
assets/js/pum-integration-contactform7.js CHANGED
@@ -103,16 +103,16 @@ __webpack_require__.r(__webpack_exports__);
103
  * Copyright (c) 2020, WP Popup Maker
104
  ******************************************************************************/
105
  {
106
- var formProvider = 'contactform7';
107
  var $ = window.jQuery;
108
- $(document).on('wpcf7:mailsent', '.wpcf7', function (event, details) {
109
- var $form = $(this),
110
- formId = $form.find('input[name="_wpcf7"]').val(),
111
  // Converts string like wpcf7-f190-p2-o11 and reduces it to simply 11, the last o11 is the instance ID.
112
  // More accurate way of doing it in case things change in the future, this version filters out all but the o param.
113
  // formInstanceId = .split('-').filter((string) => string.indexOf('o') === 0)[0].replace('o','');
114
  // Simpler version that simply splits and pops the last item in the array. This requires it always be the last.
115
- formInstanceId = $form.attr('id').split('-').pop().replace('o', ''); // All the magic happens here.
116
 
117
  window.PUM.integrations.formSubmission($form, {
118
  formProvider: formProvider,
@@ -130,11 +130,11 @@ __webpack_require__.r(__webpack_exports__);
130
  * This is here for backward compatibility with form actions prior to v1.9.
131
  */
132
 
133
- var $settings = $form.find('input.wpcf7-pum'),
134
  settings = $settings.length ? JSON.parse($settings.val()) : false;
135
 
136
- if (_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(settings) === 'object' && settings.closedelay !== undefined && settings.closedelay.toString().length >= 3) {
137
- settings['closedelay'] = settings.closedelay / 1000;
138
  } // Nothing should happen if older action settings not applied
139
  // except triggering of pumFormSuccess event for old cookie method.
140
 
103
  * Copyright (c) 2020, WP Popup Maker
104
  ******************************************************************************/
105
  {
106
+ var formProvider = "contactform7";
107
  var $ = window.jQuery;
108
+ $(document).on("wpcf7mailsent", function (event, details) {
109
+ var formId = event.detail.contactFormId,
110
+ $form = $(event.target),
111
  // Converts string like wpcf7-f190-p2-o11 and reduces it to simply 11, the last o11 is the instance ID.
112
  // More accurate way of doing it in case things change in the future, this version filters out all but the o param.
113
  // formInstanceId = .split('-').filter((string) => string.indexOf('o') === 0)[0].replace('o','');
114
  // Simpler version that simply splits and pops the last item in the array. This requires it always be the last.
115
+ formInstanceId = event.detail.id.split("-").pop().replace("o", ""); // All the magic happens here.
116
 
117
  window.PUM.integrations.formSubmission($form, {
118
  formProvider: formProvider,
130
  * This is here for backward compatibility with form actions prior to v1.9.
131
  */
132
 
133
+ var $settings = $form.find("input.wpcf7-pum"),
134
  settings = $settings.length ? JSON.parse($settings.val()) : false;
135
 
136
+ if (_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(settings) === "object" && settings.closedelay !== undefined && settings.closedelay.toString().length >= 3) {
137
+ settings.closedelay = settings.closedelay / 1000;
138
  } // Nothing should happen if older action settings not applied
139
  // except triggering of pumFormSuccess event for old cookie method.
140
 
assets/js/pum-integration-contactform7.min.js CHANGED
@@ -2,7 +2,7 @@
2
  /*!***************************************************!*\
3
  !*** ./assets/js/src/integration/contactform7.js ***!
4
  \***************************************************/
5
- /*! no exports provided */function(e,t,o){"use strict";o.r(t);var n=o(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js"),s=o.n(n),c=window.jQuery;c(document).on("wpcf7:mailsent",".wpcf7",function(e,t){var o=c(this),n=o.find('input[name="_wpcf7"]').val(),r=o.attr("id").split("-").pop().replace("o","");window.PUM.integrations.formSubmission(o,{formProvider:"contactform7",formId:n,formInstanceId:r,extras:{details:t}});var i=o.find("input.wpcf7-pum"),u=!!i.length&&JSON.parse(i.val());"object"===s()(u)&&void 0!==u.closedelay&&3<=u.closedelay.toString().length&&(u.closedelay=u.closedelay/1e3),window.PUM.forms.success(o,u)})},"./node_modules/@babel/runtime/helpers/typeof.js":
6
  /*!*******************************************************!*\
7
  !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
8
  \*******************************************************/
2
  /*!***************************************************!*\
3
  !*** ./assets/js/src/integration/contactform7.js ***!
4
  \***************************************************/
5
+ /*! no exports provided */function(e,t,o){"use strict";o.r(t);var n=o(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js"),c=o.n(n),l=window.jQuery;l(document).on("wpcf7mailsent",function(e,t){var o=e.detail.contactFormId,n=l(e.target),r=e.detail.id.split("-").pop().replace("o","");window.PUM.integrations.formSubmission(n,{formProvider:"contactform7",formId:o,formInstanceId:r,extras:{details:t}});var i=n.find("input.wpcf7-pum"),u=!!i.length&&JSON.parse(i.val());"object"===c()(u)&&void 0!==u.closedelay&&3<=u.closedelay.toString().length&&(u.closedelay=u.closedelay/1e3),window.PUM.forms.success(n,u)})},"./node_modules/@babel/runtime/helpers/typeof.js":
6
  /*!*******************************************************!*\
7
  !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
8
  \*******************************************************/
classes/Admin/Popups.php CHANGED
@@ -1,1361 +1,1361 @@
1
- <?php
2
- /*******************************************************************************
3
- * Copyright (c) 2019, Code Atlantic LLC
4
- ******************************************************************************/
5
-
6
- if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
- }
9
-
10
- /**
11
- * Class PUM_Admin_Popups
12
- *
13
- * @since 1.7.0
14
- */
15
- class PUM_Admin_Popups {
16
-
17
- /**
18
- * Hook the initialize method to the WP init action.
19
- */
20
- public static function init() {
21
- // Change title to popup name.
22
- add_filter( 'enter_title_here', array( __CLASS__, '_default_title' ) );
23
-
24
- // Add popup title field.
25
- add_action( 'edit_form_advanced', array( __CLASS__, 'title_meta_field' ) );
26
-
27
- // Add Contextual help to post_name field.
28
- add_action( 'edit_form_before_permalink', array( __CLASS__, 'popup_post_title_contextual_message' ) );
29
-
30
- // Regitster Metaboxes
31
- add_action( 'add_meta_boxes', array( __CLASS__, 'meta_box' ) );
32
-
33
- // Process meta saving.
34
- add_action( 'save_post', array( __CLASS__, 'save' ), 10, 2 );
35
-
36
-
37
- // Set the slug properly on save.
38
- add_filter( 'wp_insert_post_data', array( __CLASS__, 'set_slug' ), 99, 2 );
39
-
40
- // Dashboard columns & filters.
41
- add_filter( 'manage_edit-popup_columns', array( __CLASS__, 'dashboard_columns' ) );
42
- add_action( 'manage_posts_custom_column', array( __CLASS__, 'render_columns' ), 10, 2 );
43
- add_filter( 'manage_edit-popup_sortable_columns', array( __CLASS__, 'sortable_columns' ) );
44
- add_action( 'load-edit.php', array( __CLASS__, 'load' ), 9999 );
45
- add_action( 'restrict_manage_posts', array( __CLASS__, 'add_popup_filters' ), 100 );
46
- add_filter( 'post_row_actions', array( __CLASS__, 'add_id_row_actions' ), 2, 100 );
47
- }
48
-
49
- /**
50
- * Change default "Enter title here" input
51
- *
52
- * @param string $title Default title placeholder text
53
- *
54
- * @return string $title New placeholder text
55
- */
56
- public static function _default_title( $title ) {
57
-
58
- if ( ! is_admin() ) {
59
- return $title;
60
- }
61
-
62
- $screen = get_current_screen();
63
-
64
- if ( 'popup_theme' == $screen->post_type ) {
65
- $label = $screen->post_type == 'popup' ? __( 'Popup', 'popup-maker' ) : __( 'Popup Theme', 'popup-maker' );
66
- $title = sprintf( __( '%s Name', 'popup-maker' ), $label );
67
- }
68
-
69
- if ( 'popup' == $screen->post_type ) {
70
- $title = __( 'Popup Name', 'popup-maker' );
71
- }
72
-
73
- return $title;
74
- }
75
-
76
- /**
77
- * Renders the popup title meta field.
78
- */
79
- public static function title_meta_field() {
80
- global $post, $pagenow, $typenow;
81
-
82
- if ( has_blocks( $post ) || ( function_exists( 'use_block_editor_for_post' ) && use_block_editor_for_post( $post ) ) ) {
83
- return;
84
- }
85
-
86
- if ( ! is_admin() ) {
87
- return;
88
- }
89
-
90
- if ( 'popup' == $typenow && in_array( $pagenow, array( 'post-new.php', 'post.php' ) ) ) { ?>
91
-
92
- <div id="popup-titlediv" class="pum-form">
93
- <div id="popup-titlewrap">
94
- <label class="screen-reader-text" id="popup-title-prompt-text" for="popup-title">
95
- <?php _e( 'Popup Title', 'popup-maker' ); ?>
96
- </label>
97
- <input tabindex="2" name="popup_title" size="30" value="<?php echo esc_attr( get_post_meta( $post->ID, 'popup_title', true ) ); ?>" id="popup-title" autocomplete="off" placeholder="<?php _e( 'Popup Title', 'popup-maker' ); ?>" />
98
- <p class="pum-desc"><?php echo '(' . __( 'Optional', 'popup-maker' ) . ') ' . __( 'Shown as headline inside the popup. Can be left blank.', 'popup-maker' ); ?></p>
99
- </div>
100
- <div class="inside"></div>
101
- </div>
102
- <script>jQuery('#popup-titlediv').insertAfter('#titlediv');</script>
103
- <?php
104
- }
105
- }
106
-
107
- /**
108
- * Renders contextual help for title.
109
- */
110
- public static function popup_post_title_contextual_message() {
111
- global $post, $pagenow, $typenow;
112
-
113
- if ( has_blocks( $post ) || ( function_exists( 'use_block_editor_for_post' ) && use_block_editor_for_post( $post ) ) ) {
114
- return;
115
- }
116
-
117
- if ( ! is_admin() ) {
118
- return;
119
- }
120
-
121
- if ( 'popup' == $typenow && in_array( $pagenow, array( 'post-new.php', 'post.php' ) ) ) { ?>
122
- <p class="pum-desc"><?php echo '(' . __( 'Required', 'popup-maker' ) . ') ' . __( 'Enter a name to help you remember what this popup is about. Only you will see this.', 'popup-maker' ); ?></p>
123
- <?php
124
- }
125
- }
126
-
127
- /**
128
- * Registers popup metaboxes.
129
- */
130
- public static function meta_box() {
131
- add_meta_box( 'pum_popup_settings', __( 'Popup Settings', 'popup-maker' ), array( __CLASS__, 'render_settings_meta_box' ), 'popup', 'normal', 'high' );
132
- add_meta_box( 'pum_popup_analytics', __( 'Analytics', 'popup-maker' ), array( __CLASS__, 'render_analytics_meta_box' ), 'popup', 'side', 'high' );
133
- }
134
-
135
- /**
136
- * Ensures integrity of values.
137
- *
138
- * @param array $values
139
- *
140
- * @return array
141
- */
142
- public static function parse_values( $values = [] ) {
143
- $defaults = self::defaults();
144
-
145
- if ( empty( $values ) ) {
146
- return $defaults;
147
- }
148
-
149
- $values = self::fill_missing_defaults( $values );
150
-
151
- return $values;
152
- }
153
-
154
- /**
155
- * Render the settings meta box wrapper and JS vars.
156
- */
157
- public static function render_settings_meta_box() {
158
- global $post;
159
-
160
- $popup = pum_get_popup( $post->ID );
161
-
162
- // Get the meta directly rather than from cached object.
163
- $settings = self::parse_values( $popup->get_settings() );
164
-
165
- wp_nonce_field( basename( __FILE__ ), 'pum_popup_settings_nonce' );
166
- wp_enqueue_script( 'popup-maker-admin' );
167
- ?>
168
- <script type="text/javascript">
169
- window.pum_popup_settings_editor = <?php echo PUM_Utils_Array::safe_json_encode( apply_filters( 'pum_popup_settings_editor_var', array(
170
- 'form_args' => array(
171
- 'id' => 'pum-popup-settings',
172
- 'tabs' => self::tabs(),
173
- 'sections' => self::sections(),
174
- 'fields' => self::fields(),
175
- ),
176
- 'conditions' => PUM_Conditions::instance()->get_conditions(),
177
- 'conditions_selectlist' => PUM_Conditions::instance()->dropdown_list(),
178
- 'triggers' => PUM_Triggers::instance()->get_triggers(),
179
- 'cookies' => PUM_Cookies::instance()->get_cookies(),
180
- 'current_values' => self::render_form_values( $settings ),
181
- ) ) ); ?>;
182
- </script>
183
-
184
- <div id="pum-popup-settings-container" class="pum-popup-settings-container">
185
- <div class="pum-no-js" style="padding: 0 12px;">
186
- <p><?php printf( __( 'If you are seeing this, the page is still loading or there are Javascript errors on this page. %sView troubleshooting guide%s', 'popup-maker' ), '<a href="https://docs.wppopupmaker.com/article/373-checking-for-javascript-errors" target="_blank">', '</a>' ); ?></p>
187
- </div>
188
- </div>
189
- <?php
190
- }
191
-
192
- /**
193
- * Used to get deprecated fields for metabox saving of old extensions.
194
- *
195
- * @deprecated 1.7.0
196
- *
197
- * @return mixed
198
- */
199
- public static function deprecated_meta_fields() {
200
- $fields = array();
201
- foreach ( self::deprecated_meta_field_groups() as $group ) {
202
- foreach ( apply_filters( 'popmake_popup_meta_field_group_' . $group, array() ) as $field ) {
203
- $fields[] = 'popup_' . $group . '_' . $field;
204
- }
205
- }
206
-
207
- return apply_filters( 'popmake_popup_meta_fields', $fields );
208
- }
209
-
210
- /**
211
- * Used to get field groups from extensions.
212
- *
213
- * @deprecated 1.7.0
214
- *
215
- * @return mixed
216
- */
217
- public static function deprecated_meta_field_groups() {
218
- return apply_filters( 'popmake_popup_meta_field_groups', array( 'display', 'close' ) );
219
- }
220
-
221
- /**
222
- * @param $post_id
223
- * @param $post
224
- */
225
- public static function save( $post_id, $post ) {
226
-
227
- if ( isset( $post->post_type ) && 'popup' != $post->post_type ) {
228
- return;
229
- }
230
-
231
- if ( ! isset( $_POST['pum_popup_settings_nonce'] ) || ! wp_verify_nonce( $_POST['pum_popup_settings_nonce'], basename( __FILE__ ) ) ) {
232
- return;
233
- }
234
-
235
- if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || isset( $_REQUEST['bulk_edit'] ) ) {
236
- return;
237
- }
238
-
239
- if ( isset( $post->post_type ) && 'revision' == $post->post_type ) {
240
- return;
241
- }
242
-
243
- if ( ! current_user_can( 'edit_post', $post_id ) ) {
244
- return;
245
- }
246
-
247
- $popup = pum_get_popup( $post_id );
248
-
249
- if ( isset( $_POST['popup_reset_counts'] ) ) {
250
- /**
251
- * Reset popup open count, per user request.
252
- */
253
- $popup->reset_counts();
254
- }
255
-
256
-
257
- $title = ! empty ( $_POST['popup_title'] ) ? trim( sanitize_text_field( $_POST['popup_title'] ) ) : '';
258
- $popup->update_meta( 'popup_title', $title );
259
-
260
- $settings = ! empty( $_POST['popup_settings'] ) ? $_POST['popup_settings'] : array();
261
-
262
- // Sanitize JSON values.
263
- $settings['conditions'] = isset( $settings['conditions'] ) ? self::sanitize_meta( $settings['conditions'] ) : array();
264
- $settings['triggers'] = isset( $settings['triggers'] ) ? self::sanitize_meta( $settings['triggers'] ) : array();
265
- $settings['cookies'] = isset( $settings['cookies'] ) ? self::sanitize_meta( $settings['cookies'] ) : array();
266
-
267
- $settings = apply_filters( 'pum_popup_setting_pre_save', $settings, $post->ID );
268
-
269
- $settings = self::sanitize_settings( $settings );
270
- $settings = self::parse_values( $settings );
271
-
272
- $popup->update_settings( $settings, false );
273
-
274
- // TODO Remove this and all other code here. This should be clean and all code more compartmentalized.
275
- foreach ( self::deprecated_meta_fields() as $field ) {
276
- if ( isset( $_POST[ $field ] ) ) {
277
- $new = apply_filters( 'popmake_metabox_save_' . $field, $_POST[ $field ] );
278
- update_post_meta( $post_id, $field, $new );
279
- } else {
280
- delete_post_meta( $post_id, $field );
281
- }
282
- }
283
-
284
- do_action( 'pum_save_popup', $post_id, $post );
285
- }
286
-
287
- /**
288
- * Parse & prepare values for form rendering.
289
- *
290
- * Add additional data for license_key fields, split the measure fields etc.
291
- *
292
- * @param $settings
293
- *
294
- * @return mixed
295
- */
296
- public static function render_form_values( $settings ) {
297
- foreach ( $settings as $key => $value ) {
298
- $field = self::get_field( $key );
299
-
300
-
301
- if ( $field ) {
302
- switch ( $field['type'] ) {
303
- case 'measure':
304
- break;
305
- }
306
- }
307
- }
308
-
309
- return $settings;
310
- }
311
-
312
- /**
313
- * List of tabs & labels for the settings panel.
314
- *
315
- * @return array
316
- */
317
- public static function tabs() {
318
- return apply_filters( 'pum_popup_settings_tabs', array(
319
- 'general' => __( 'General', 'popup-maker' ),
320
- 'display' => __( 'Display', 'popup-maker' ),
321
- 'close' => __( 'Close', 'popup-maker' ),
322
- 'triggers' => __( 'Triggers', 'popup-maker' ),
323
- 'targeting' => __( 'Targeting', 'popup-maker' ),
324
- 'advanced' => __( 'Advanced', 'popup-maker' ),
325
- ) );
326
- }
327
-
328
- /**
329
- * List of tabs & labels for the settings panel.
330
- *
331
- * @return array
332
- */
333
- public static function sections() {
334
- return apply_filters( 'pum_popup_settings_sections', array(
335
- 'general' => array(
336
- 'main' => __( 'General Settings', 'popup-maker' ),
337
- ),
338
- 'triggers' => array(
339
- 'main' => __( 'Triggers & Cookies', 'popup-maker' ),
340
- ),
341
- 'targeting' => array(
342
- 'main' => __( 'Conditions', 'popup-maker' ),
343
- ),
344
- 'display' => array(
345
- 'preset' => __( 'Display Presets', 'popup-maker' ),
346
- 'main' => __( 'Appearance', 'popup-maker' ),
347
- 'size' => __( 'Size', 'popup-maker' ),
348
- 'animation' => __( 'Animation', 'popup-maker' ),
349
- 'sound' => __( 'Sounds', 'popup-maker' ),
350
- 'position' => __( 'Position', 'popup-maker' ),
351
- 'advanced' => __( 'Advanced', 'popup-maker' ),
352
- ),
353
- 'close' => array(
354
- 'button' => __( 'Button', 'popup-maker' ),
355
- 'forms' => __( 'Form Submission', 'popup-maker' ),
356
- 'alternate_methods' => __( 'Alternate Methods', 'popup-maker' ),
357
- ),
358
- 'advanced' => array(
359
- 'main' => __( 'Advanced', 'popup-maker' ),
360
- ),
361
- ) );
362
- }
363
-
364
- /**
365
- * Returns array of popup settings fields.
366
- *
367
- * @return mixed
368
- */
369
- public static function fields() {
370
-
371
- static $tabs;
372
-
373
- if ( ! isset( $tabs ) ) {
374
- $tabs = apply_filters( 'pum_popup_settings_fields', array(
375
- 'general' => apply_filters( 'pum_popup_general_settings_fields', array(
376
- 'main' => array(),
377
- ) ),
378
- 'triggers' => apply_filters( 'pum_popup_triggers_settings_fields', array(
379
- 'main' => array(
380
- 'triggers' => array(
381
- 'type' => 'triggers',
382
- 'std' => array(),
383
- 'priority' => 10,
384
- ),
385
- 'separator1' => array(
386
- 'type' => 'separator',
387
- 'private' => true,
388
- ),
389
- 'cookies' => array(
390
- 'type' => 'cookies',
391
- 'std' => array(),
392
- 'priority' => 20,
393
- ),
394
- ),
395
- ) ),
396
- 'targeting' => apply_filters( 'pum_popup_targeting_settings_fields', array(
397
- 'main' => array(
398
- 'conditions' => array(
399
- 'type' => 'conditions',
400
- 'std' => array(),
401
- 'priority' => 10,
402
- 'private' => true,
403
- ),
404
- 'disable_on_mobile' => array(
405
- 'label' => __( 'Disable this popup on mobile devices.', 'popup-maker' ),
406
- 'type' => 'checkbox',
407
- 'priority' => 20,
408
- ),
409
- 'disable_on_tablet' => array(
410
- 'label' => __( 'Disable this popup on tablet devices.', 'popup-maker' ),
411
- 'type' => 'checkbox',
412
- 'priority' => 20,
413
- ),
414
- ),
415
- ) ),
416
- 'display' => apply_filters( 'pum_popup_display_settings_fields', array(
417
- 'preset' => array(
418
- 'explain' => array(
419
- 'type' => 'html',
420
- 'content' => '<p>Select one of the types below to get started! Once selected, you can adjust the display settings using the tabs above.</p>'
421
- ),
422
- 'type_section' => array(
423
- 'type' => 'section',
424
- 'classes' => 'popup-types',
425
- 'fields' => array(
426
- '<div class="popup-type" data-popup-type="center-popup"><img src="' . Popup_Maker::$URL . 'assets/images/admin/display-switcher/center-popup.png" alt="' . __( 'Center Popup', 'popup-maker' ) . '"/><button class="button">' . __( 'Center Popup', 'popup-maker' ) . '</button></div>',
427
- '<div class="popup-type" data-popup-type="right-bottom-slidein"><img src="' . Popup_Maker::$URL . 'assets/images/admin/display-switcher/right-bottom-slidein.png" alt="' . __( 'Right Bottom Slide-in', 'popup-maker' ) . '"/><button class="button">' . __( 'Right Bottom Slide-in', 'popup-maker' ) . '</button></div>',
428
- '<div class="popup-type" data-popup-type="top-bar"><img src="' . Popup_Maker::$URL . 'assets/images/admin/display-switcher/top-bar.png" alt="' . __( 'Top Bar', 'popup-maker' ) . '"/><button class="button">' . __( 'Top Bar', 'popup-maker' ) . '</button></div>',
429
- '<div class="popup-type" data-popup-type="left-bottom-notice"><img src="' . Popup_Maker::$URL . 'assets/images/admin/display-switcher/left-bottom-notice.png" alt="' . __( 'Left Bottom Notice', 'popup-maker' ) . '"/><button class="button">' . __( 'Left Bottom Notice', 'popup-maker' ) . '</button></div>',
430
- ),
431
- ),
432
- ),
433
- 'main' => array(
434
- 'theme_id' => array(
435
- 'label' => __( 'Popup Theme', 'popup-maker' ),
436
- 'dynamic_desc' => sprintf( '%1$s<br/><a id="edit_theme_link" href="%3$s">%2$s</a>', __( 'Choose a theme for this popup.', 'popup-maker' ), __( 'Customize This Theme', 'popup-maker' ), admin_url( "post.php?action=edit&post={{data.value}}" ) ),
437
- 'type' => 'select',
438
- 'options' => pum_is_popup_editor() ? PUM_Helpers::popup_theme_selectlist() : null,
439
- 'std' => pum_get_default_theme_id(),
440
- ),
441
- ),
442
- 'size' => array(
443
- 'size' => array(
444
- 'label' => __( 'Size', 'popup-maker' ),
445
- 'desc' => __( 'Select the size of the popup.', 'popup-maker' ),
446
- 'type' => 'select',
447
- 'std' => 'medium',
448
- 'priority' => 10,
449
- 'options' => array(
450
- __( 'Responsive Sizes', 'popup-maker' ) => array(
451
- 'nano' => __( 'Nano - 10%', 'popup-maker' ),
452
- 'micro' => __( 'Micro - 20%', 'popup-maker' ),
453
- 'tiny' => __( 'Tiny - 30%', 'popup-maker' ),
454
- 'small' => __( 'Small - 40%', 'popup-maker' ),
455
- 'medium' => __( 'Medium - 60%', 'popup-maker' ),
456
- 'normal' => __( 'Normal - 70%', 'popup-maker' ),
457
- 'large' => __( 'Large - 80%', 'popup-maker' ),
458
- 'xlarge' => __( 'X Large - 95%', 'popup-maker' ),
459
- ),
460
- __( 'Other Sizes', 'popup-maker' ) => array(
461
- 'auto' => __( 'Auto', 'popup-maker' ),
462
- 'custom' => __( 'Custom', 'popup-maker' ),
463
- ),
464
- ),
465
- ),
466
- 'responsive_min_width' => array(
467
- 'label' => __( 'Min Width', 'popup-maker' ),
468
- 'desc' => __( 'Set a minimum width for the popup.', 'popup-maker' ),
469
- 'type' => 'measure',
470
- 'std' => '0%',
471
- 'priority' => 20,
472
- 'dependencies' => array(
473
- 'size' => array( 'nano', 'micro', 'tiny', 'small', 'medium', 'normal', 'large', 'xlarge' ),
474
- ),
475
- ),
476
- 'responsive_max_width' => array(
477
- 'label' => __( 'Max Width', 'popup-maker' ),
478
- 'desc' => __( 'Set a maximum width for the popup.', 'popup-maker' ),
479
- 'type' => 'measure',
480
- 'std' => '100%',
481
- 'priority' => 30,
482
- 'dependencies' => array(
483
- 'size' => array( 'nano', 'micro', 'tiny', 'small', 'medium', 'normal', 'large', 'xlarge' ),
484
- ),
485
- ),
486
- 'custom_width' => array(
487
- 'label' => __( 'Width', 'popup-maker' ),
488
- 'desc' => __( 'Set a custom width for the popup.', 'popup-maker' ),
489
- 'type' => 'measure',
490
- 'std' => '640px',
491
- 'priority' => 40,
492
- 'dependencies' => array(
493
- 'size' => 'custom',
494
- ),
495
- ),
496
- 'custom_height_auto' => array(
497
- 'label' => __( 'Auto Adjusted Height', 'popup-maker' ),
498
- 'desc' => __( 'Checking this option will set height to fit the content.', 'popup-maker' ),
499
- 'type' => 'checkbox',
500
- 'priority' => 50,
501
- 'dependencies' => array(
502
- 'size' => 'custom',
503
- ),
504
- ),
505
- 'custom_height' => array(
506
- 'label' => __( 'Height', 'popup-maker' ),
507
- 'desc' => __( 'Set a custom height for the popup.', 'popup-maker' ),
508
- 'type' => 'measure',
509
- 'std' => '380px',
510
- 'priority' => 60,
511
- 'dependencies' => array(
512
- 'size' => 'custom',
513
- 'custom_height_auto' => false,
514
- ),
515
- ),
516
- 'scrollable_content' => array(
517
- 'label' => __( 'Scrollable Content', 'popup-maker' ),
518
- 'desc' => __( 'Checking this option will add a scroll bar to your content.', 'popup-maker' ),
519
- 'type' => 'checkbox',
520
- 'std' => false,
521
- 'priority' => 70,
522
- 'dependencies' => array(
523
- 'size' => 'custom',
524
- 'custom_height_auto' => false,
525
- ),
526
- ),
527
- ),
528
- 'animation' => array(
529
- 'animation_type' => array(
530
- 'label' => __( 'Animation Type', 'popup-maker' ),
531
- 'desc' => __( 'Select an animation type for your popup.', 'popup-maker' ),
532
- 'type' => 'select',
533
- 'std' => 'fade',
534
- 'priority' => 10,
535
- 'options' => array(
536
- 'none' => __( 'None', 'popup-maker' ),
537
- 'slide' => __( 'Slide', 'popup-maker' ),
538
- 'fade' => __( 'Fade', 'popup-maker' ),
539
- 'fadeAndSlide' => __( 'Fade and Slide', 'popup-maker' ),
540
- // 'grow' => __( 'Grow', 'popup-maker' ),
541
- // 'growAndSlide' => __( 'Grow and Slide', 'popup-maker' ),
542
- ),
543
- ),
544
- 'animation_speed' => array(
545
- 'label' => __( 'Animation Speed', 'popup-maker' ),
546
- 'desc' => __( 'Set the animation speed for the popup.', 'popup-maker' ),
547
- 'type' => 'rangeslider',
548
- 'std' => 350,
549
- 'step' => 10,
550
- 'min' => 50,
551
- 'max' => 1000,
552
- 'unit' => __( 'ms', 'popup-maker' ),
553
- 'priority' => 20,
554
- 'dependencies' => array(
555
- 'animation_type' => array( 'slide', 'fade', 'fadeAndSlide', 'grow', 'growAndSlide' ),
556
- ),
557
- ),
558
- 'animation_origin' => array(
559
- 'label' => __( 'Animation Origin', 'popup-maker' ),
560
- 'desc' => __( 'Choose where the animation will begin.', 'popup-maker' ),
561
- 'type' => 'select',
562
- 'std' => 'center top',
563
- 'options' => array(
564
- 'top' => __( 'Top', 'popup-maker' ),
565
- 'left' => __( 'Left', 'popup-maker' ),
566
- 'bottom' => __( 'Bottom', 'popup-maker' ),
567
- 'right' => __( 'Right', 'popup-maker' ),
568
- 'left top' => __( 'Top Left', 'popup-maker' ),
569
- 'center top' => __( 'Top Center', 'popup-maker' ),
570
- 'right top' => __( 'Top Right', 'popup-maker' ),
571
- 'left center' => __( 'Middle Left', 'popup-maker' ),
572
- 'center center' => __( 'Middle Center', 'popup-maker' ),
573
- 'right center' => __( 'Middle Right', 'popup-maker' ),
574
- 'left bottom' => __( 'Bottom Left', 'popup-maker' ),
575
- 'center bottom' => __( 'Bottom Center', 'popup-maker' ),
576
- 'right bottom' => __( 'Bottom Right', 'popup-maker' ),
577
- ),
578
- 'priority' => 30,
579
- 'dependencies' => array(
580
- 'animation_type' => array( 'slide', 'fadeAndSlide', 'grow', 'growAndSlide' ),
581
- ),
582
- ),
583
- ),
584
- 'sound' => array(
585
- 'open_sound' => array(
586
- 'label' => __( 'Opening Sound', 'popup-maker' ),
587
- 'desc' => __( 'Select a sound to play when the popup opens.', 'popup-maker' ),
588
- 'type' => 'select',
589
- 'std' => 'none',
590
- 'priority' => 10,
591
- 'options' => array(
592
- 'none' => __( 'None', 'popup-maker' ),
593
- 'beep.mp3' => __( 'Beep', 'popup-maker' ),
594
- 'beep-two.mp3' => __( 'Beep 2', 'popup-maker' ),
595
- 'beep-up.mp3' => __( 'Beep Up', 'popup-maker' ),
596
- 'chimes.mp3' => __( 'Chimes', 'popup-maker' ),
597
- 'correct.mp3' => __( 'Correct', 'popup-maker' ),
598
- 'custom' => __( 'Custom Sound', 'popup-maker' ),
599
- ),
600
- ),
601
- 'custom_sound' => array(
602
- 'label' => __( 'Custom Sound URL', 'popup-maker' ),
603
- 'desc' => __( 'Enter URL to sound file.', 'popup-maker' ),
604
- 'type' => 'text',
605
- 'std' => '',
606
- 'priority' => 10,
607
- 'dependencies' => array(
608
- 'open_sound' => array( 'custom' ),
609
- ),
610
- ),
611
- ),
612
- 'position' => array(
613
- 'location' => array(
614
- 'label' => __( 'Location', 'popup-maker' ),
615
- 'desc' => __( 'Choose where the popup will be displayed.', 'popup-maker' ),
616
- 'type' => 'select',
617
- 'std' => 'center top',
618
- 'priority' => 10,
619
- 'options' => array(
620
- 'left top' => __( 'Top Left', 'popup-maker' ),
621
- 'center top' => __( 'Top Center', 'popup-maker' ),
622
- 'right top' => __( 'Top Right', 'popup-maker' ),
623
- 'left center' => __( 'Middle Left', 'popup-maker' ),
624
- 'center' => __( 'Middle Center', 'popup-maker' ),
625
- 'right center' => __( 'Middle Right', 'popup-maker' ),
626
- 'left bottom' => __( 'Bottom Left', 'popup-maker' ),
627
- 'center bottom' => __( 'Bottom Center', 'popup-maker' ),
628
- 'right bottom' => __( 'Bottom Right', 'popup-maker' ),
629
- ),
630
- ),
631
- 'position_top' => array(
632
- 'label' => __( 'Top', 'popup-maker' ),
633
- 'desc' => sprintf( _x( 'Distance from the %s edge of the screen.', 'Screen Edge: top, bottom', 'popup-maker' ), strtolower( __( 'Top', 'popup-maker' ) ) ),
634
- 'type' => 'rangeslider',
635
- 'std' => 100,
636
- 'step' => 1,
637
- 'min' => 0,
638
- 'max' => 500,
639
- 'unit' => 'px',
640
- 'priority' => 20,
641
- 'dependencies' => array(
642
- 'location' => array( 'left top', 'center top', 'right top' ),
643
- ),
644
- ),
645
- 'position_bottom' => array(
646
- 'label' => __( 'Bottom', 'popup-maker' ),
647
- 'desc' => sprintf( _x( 'Distance from the %s edge of the screen.', 'Screen Edge: top, bottom', 'popup-maker' ), strtolower( __( 'Bottom', 'popup-maker' ) ) ),
648
- 'type' => 'rangeslider',
649
- 'std' => 0,
650
- 'step' => 1,
651
- 'min' => 0,
652
- 'max' => 500,
653
- 'unit' => 'px',
654
- 'priority' => 20,
655
- 'dependencies' => array(
656
- 'location' => array( 'left bottom', 'center bottom', 'right bottom' ),
657
- ),
658
- ),
659
- 'position_left' => array(
660
- 'label' => __( 'Left', 'popup-maker' ),
661
- 'desc' => sprintf( _x( 'Distance from the %s edge of the screen.', 'Screen Edge: top, bottom', 'popup-maker' ), strtolower( __( 'Left', 'popup-maker' ) ) ),
662
- 'type' => 'rangeslider',
663
- 'std' => 0,
664
- 'step' => 1,
665
- 'min' => 0,
666
- 'max' => 500,
667
- 'unit' => 'px',
668
- 'priority' => 30,
669
- 'dependencies' => array(
670
- 'location' => array( 'left top', 'left center', 'left bottom' ),
671
- ),
672
- ),
673
- 'position_right' => array(
674
- 'label' => __( 'Right', 'popup-maker' ),
675
- 'desc' => sprintf( _x( 'Distance from the %s edge of the screen.', 'Screen Edge: top, bottom', 'popup-maker' ), strtolower( __( 'Right', 'popup-maker' ) ) ),
676
- 'type' => 'rangeslider',
677
- 'std' => 0,
678
- 'step' => 1,
679
- 'min' => 0,
680
- 'max' => 500,
681
- 'unit' => 'px',
682
- 'priority' => 30,
683
- 'dependencies' => array(
684
- 'location' => array( 'right top', 'right center', 'right bottom' ),
685
- ),
686
- ),
687
- 'position_from_trigger' => array(
688
- 'label' => __( 'Position from Trigger', 'popup-maker' ),
689
- 'desc' => sprintf( __( 'This will position the popup in relation to the %sClick Trigger%s.', 'popup-maker' ), '<a target="_blank" href="https://docs.wppopupmaker.com/article/144-trigger-click-open?utm_medium=inline-doclink&utm_campaign=ContextualHelp&utm_source=plugin-popup-editor&utm_content=position-from-trigger">', '</a>' ),
690
- 'type' => 'checkbox',
691
- 'std' => false,
692
- 'priority' => 40,
693
- ),
694
- 'position_fixed' => array(
695
- 'label' => __( 'Fixed Postioning', 'popup-maker' ),
696
- 'desc' => __( 'Checking this sets the positioning of the popup to fixed.', 'popup-maker' ),
697
- 'type' => 'checkbox',
698
- 'priority' => 50,
699
- ),
700
- ),
701
- 'advanced' => array(
702
- 'overlay_disabled' => array(
703
- 'label' => __( 'Disable Overlay', 'popup-maker' ),
704
- 'desc' => __( 'Checking this will disable and hide the overlay for this popup.', 'popup-maker' ),
705
- 'type' => 'checkbox',
706
- 'priority' => 10,
707
- ),
708
- 'stackable' => array(
709
- 'label' => __( 'Stackable', 'popup-maker' ),
710
- 'desc' => __( 'This enables other popups to remain open.', 'popup-maker' ),
711
- 'type' => 'checkbox',
712
- 'priority' => 20,
713
- ),
714
- 'disable_reposition' => array(
715
- 'label' => __( 'Disable Repositioning', 'popup-maker' ),
716
- 'desc' => __( 'This will disable automatic repositioning of the popup on window resizing.', 'popup-maker' ),
717
- 'type' => 'checkbox',
718
- 'priority' => 30,
719
- ),
720
- 'zindex' => array(
721
- 'label' => __( 'Popup Z-Index', 'popup-maker' ),
722
- 'desc' => __( 'Change the z-index layer level for the popup.', 'popup-maker' ),
723
- 'type' => 'number',
724
- 'min' => 999,
725
- 'max' => 2147483647,
726
- 'std' => 1999999999,
727
- 'priority' => 40,
728
- ),
729
- ),
730
- ) ),
731
- 'close' => apply_filters( 'pum_popup_close_settings_fields', array(
732
- 'button' => array(
733
- 'close_text' => array(
734
- 'label' => __( 'Close Text', 'popup-maker' ),
735
- 'placeholder' => __( 'Close', 'popup-maker' ),
736
- 'desc' => __( 'Override the default close text. To use a Font Awesome icon instead of text, enter the CSS classes such as "fas fa-camera".', 'popup-maker' ),
737
- 'priority' => 10,
738
- 'private' => true,
739
- ),
740
- 'close_button_delay' => array(
741
- 'label' => __( 'Close Button Delay', 'popup-maker' ),
742
- 'desc' => __( 'This delays the display of the close button.', 'popup-maker' ),
743
- 'type' => 'rangeslider',
744
- 'std' => 0,
745
- 'step' => 100,
746
- 'min' => 0,
747
- 'max' => 3000,
748
- 'unit' => __( 'ms', 'popup-maker' ),
749
- 'priority' => 20,
750
- ),
751
- ),
752
- 'forms' => [
753
- 'close_on_form_submission' => [
754
- 'label' => __( 'Close on Form Submission', 'popup-maker' ),
755
- 'desc' => __( 'Close the popup automatically after integrated form plugin submissions.', 'popup-maker' ),
756
- 'type' => 'checkbox',
757
- ],
758
- 'close_on_form_submission_delay' => [
759
- 'type' => 'rangeslider',
760
- 'label' => __( 'Delay', 'popup-maker' ),
761
- 'desc' => __( 'The delay before the popup will close after submission (in milliseconds).', 'popup-maker' ),
762
- 'std' => 0,
763
- 'min' => 0,
764
- 'max' => 10000,
765
- 'step' => 500,
766
- 'unit' => 'ms',
767
- 'dependencies' => [
768
- 'close_on_form_submission' => true,
769
- ],
770
- ],
771
- ],
772
- 'alternate_methods' => array(
773
- 'close_on_overlay_click' => array(
774
- 'label' => __( 'Click Overlay to Close', 'popup-maker' ),
775
- 'desc' => __( 'Checking this will cause popup to close when user clicks on overlay.', 'popup-maker' ),
776
- 'type' => 'checkbox',
777
- 'priority' => 10,
778
- ),
779
- 'close_on_esc_press' => array(
780
- 'label' => __( 'Press ESC to Close', 'popup-maker' ),
781
- 'desc' => __( 'Checking this will cause popup to close when user presses ESC key.', 'popup-maker' ),
782
- 'type' => 'checkbox',
783
- 'priority' => 20,
784
- ),
785
- 'close_on_f4_press' => array(
786
- 'label' => __( 'Press F4 to Close', 'popup-maker' ),
787
- 'desc' => __( 'Checking this will cause popup to close when user presses F4 key.', 'popup-maker' ),
788
- 'type' => 'checkbox',
789
- 'priority' => 30,
790
- ),
791
- ),
792
- ) ),
793
- 'advanced' => apply_filters( 'pum_popup_advanced_settings_fields', array(
794
- 'main' => array(
795
- 'disable_form_reopen' => array(
796
- 'label' => __( 'Disable automatic re-triggering of popup after non-ajax form submission.', 'popup-maker' ),
797
- 'type' => 'checkbox',
798
- 'priority' => 10,
799
- ),
800
- 'disable_accessibility' => array(
801
- 'label' => __( 'Disable accessibility features.', 'popup-maker' ),
802
- 'desc' => __( 'This includes trapping the tab key & focus inside popup while open, force focus the first element when popup open, and refocus last click trigger when closed.', 'popup-maker' ),
803
- 'type' => 'checkbox',
804
- 'priority' => 10,
805
- ),
806
- ),
807
- ) ),
808
- ) );
809
-
810
- foreach ( $tabs as $tab_id => $sections ) {
811
-
812
- foreach ( $sections as $section_id => $fields ) {
813
-
814
- if ( PUM_Admin_Helpers::is_field( $fields ) ) {
815
- // Allow for flat tabs with no sections.
816
- $section_id = 'main';
817
- $fields = array(
818
- $section_id => $fields,
819
- );
820
- }
821
-
822
- foreach ( $fields as $field_id => $field ) {
823
- if ( ! is_array( $field ) || ! PUM_Admin_Helpers::is_field( $field ) ) {
824
- continue;
825
- }
826
-
827
- if ( empty( $field['id'] ) ) {
828
- $field['id'] = $field_id;
829
- }
830
- if ( empty( $field['name'] ) ) {
831
- $field['name'] = 'popup_settings[' . $field_id . ']';
832
- }
833
-
834
- $tabs[ $tab_id ][ $section_id ][ $field_id ] = wp_parse_args( $field, array(
835
- 'section' => 'main',
836
- 'type' => 'text',
837
- 'id' => null,
838
- 'label' => '',
839
- 'desc' => '',
840
- 'name' => null,
841
- 'templ_name' => null,
842
- 'size' => 'regular',
843
- 'options' => array(),
844
- 'std' => null,
845
- 'rows' => 5,
846
- 'cols' => 50,
847
- 'min' => 0,
848
- 'max' => 50,
849
- 'force_minmax' => false,
850
- 'step' => 1,
851
- 'select2' => null,
852
- 'object_type' => 'post_type',
853
- 'object_key' => 'post',
854
- 'post_type' => null,
855
- 'taxonomy' => null,
856
- 'multiple' => null,
857
- 'as_array' => false,
858
- 'placeholder' => null,
859
- 'checkbox_val' => 1,
860
- 'allow_blank' => true,
861
- 'readonly' => false,
862
- 'required' => false,
863
- 'disabled' => false,
864
- 'hook' => null,
865
- 'unit' => __( 'ms', 'popup-maker' ),
866
- 'units' => array(
867
- 'px' => 'px',
868
- '%' => '%',
869
- 'em' => 'em',
870
- 'rem' => 'rem',
871
- ),
872
- 'priority' => null,
873
- 'doclink' => '',
874
- 'button_type' => 'submit',
875
- 'class' => '',
876
- 'private' => false,
877
- ) );
878
-
879
- }
880
- }
881
- }
882
- }
883
-
884
-
885
- return $tabs;
886
- }
887
-
888
- public static function get_field( $id ) {
889
- $tabs = self::fields();
890
-
891
- foreach ( $tabs as $tab => $sections ) {
892
-
893
- if ( PUM_Admin_Helpers::is_field( $sections ) ) {
894
- $sections = array(
895
- 'main' => array(
896
- $tab => $sections,
897
- ),
898
- );
899
- }
900
-
901
- foreach ( $sections as $section => $fields ) {
902
-
903
- foreach ( $fields as $key => $args ) {
904
- if ( $key == $id ) {
905
- return $args;
906
- }
907
- }
908
- }
909
- }
910
-
911
- return false;
912
- }
913
-
914
- /**
915
- * Sanitizes fields after submission.
916
- *
917
- * Also handles pre save manipulations for some field types (measure/license).
918
- *
919
- * @param array $settings
920
- *
921
- * @return array
922
- */
923
- public static function sanitize_settings( $settings = array() ) {
924
-
925
- $fields = self::fields();
926
- $fields = PUM_Admin_Helpers::flatten_fields_array( $fields );
927
-
928
- foreach ( $fields as $field_id => $field ) {
929
- switch ( $field['type'] ) {
930
- case 'checkbox':
931
-
932
- if ( ! isset( $settings[ $field_id ] ) ) {
933
- $settings[ $field_id ] = false;
934
- }
935
- break;
936
- }
937
- }
938
-
939
- foreach ( $settings as $key => $value ) {
940
- $field = self::get_field( $key );
941
-
942
- if ( $field ) {
943
-
944
- // Sanitize every string value.
945
- if ( is_string( $value ) ) {
946
- $settings[ $key ] = sanitize_text_field( $value );
947
- }
948
-
949
- switch ( $field['type'] ) {
950
- default:
951
- $settings[ $key ] = is_string( $value ) ? trim( $value ) : $value;
952
- break;
953
-
954
-
955
- case 'measure':
956
- $settings[ $key ] .= $settings[ $key . '_unit' ];
957
- break;
958
- }
959
- } else {
960
- // Some custom field types include multiple additional fields that do not need to be saved, strip out any non-whitelisted fields.
961
- unset( $settings[ $key ] );
962
- }
963
-
964
-
965
- }
966
-
967
- return $settings;
968
- }
969
-
970
- /**
971
- * @return array
972
- */
973
- public static function defaults() {
974
- $tabs = self::fields();
975
-
976
- $defaults = array();
977
-
978
- foreach ( $tabs as $tab_id => $sections ) {
979
- foreach ( $sections as $section_id => $fields ) {
980
- foreach ( $fields as $key => $field ) {
981
- if ( $field['type'] == 'checkbox' ) {
982
- $defaults[ $key ] = isset( $field['std'] ) ? $field['std'] : ( $field['type'] == 'checkbox' ? false : null );
983
- }
984
- }
985
- }
986
- }
987
-
988
- return $defaults;
989
- }
990
-
991
- /**
992
- * Fills default settings only when missing.
993
- *
994
- * Excludes checkbox type fields where a false value is represented by the field being unset.
995
- *
996
- * @param array $settings
997
- *
998
- * @return array
999
- */
1000
- public static function fill_missing_defaults( $settings = [] ) {
1001
- $excluded_field_types = [ 'checkbox', 'multicheck' ];
1002
-
1003
- $defaults = self::defaults();
1004
- foreach ( $defaults as $field_id => $default_value ) {
1005
- $field = self::get_field( $field_id );
1006
- if ( isset( $settings[ $field_id ] ) || in_array( $field['type'], $excluded_field_types ) ) {
1007
- continue;
1008
- }
1009
-
1010
- $settings[ $field_id ] = $default_value;
1011
- }
1012
-
1013
- return $settings;
1014
-
1015
- }
1016
-
1017
- /**
1018
- * Display analytics metabox
1019
- *
1020
- * @return void
1021
- */
1022
- public static function render_analytics_meta_box() {
1023
- global $post;
1024
-
1025
- $popup = pum_get_popup( $post->ID ); ?>
1026
- <div id="pum-popup-analytics" class="pum-meta-box">
1027
-
1028
- <?php do_action( 'pum_popup_analytics_metabox_before', $post->ID ); ?>
1029
-
1030
- <?php
1031
- $opens = $popup->get_event_count( 'open', 'current' );
1032
- //$conversions = $popup->get_event_count( 'conversion', 'current' );
1033
- //$conversion_rate = $opens > 0 && $opens >= $conversions ? $conversions / $opens * 100 : false;
1034
- ?>
1035
-
1036
- <div id="pum-popup-analytics" class="pum-popup-analytics">
1037
-
1038
- <table class="form-table">
1039
- <tbody>
1040
- <tr>
1041
- <td><?php _e( 'Opens', 'popup-maker' ); ?></td>
1042
- <td><?php echo $opens; ?></td>
1043
- </tr>
1044
- <?php /* if ( $conversion_rate > 0 ) : ?>
1045
- <tr>
1046
- <td><?php _e( 'Conversions', 'popup-maker' ); ?></td>
1047
- <td><?php echo $conversions; ?></td>
1048
- </tr>
1049
- <?php endif; */ ?>
1050
- <?php /* if ( $conversion_rate > 0 ) : ?>
1051
- <tr>
1052
- <td><?php _e( 'Conversion Rate', 'popup-maker' ); ?></td>
1053
- <td><?php echo round( $conversion_rate, 2 ); ?>%</td>
1054
- </tr>
1055
- <?php endif; */ ?>
1056
- <tr class="separator">
1057
- <td colspan="2">
1058
- <label> <input type="checkbox" name="popup_reset_counts" id="popup_reset_counts" value="1" />
1059
- <?php _e( 'Reset Counts', 'popup-maker' ); ?>
1060
- </label>
1061
- <?php if ( ( $reset = $popup->get_last_count_reset() ) ) : ?><br />
1062
- <small>
1063
- <strong><?php _e( 'Last Reset', 'popup-maker' ); ?>:</strong> <?php echo date( 'm-d-Y H:i', $reset['timestamp'] ); ?>
1064
- <br /> <strong><?php _e( 'Previous Opens', 'popup-maker' ); ?>:</strong> <?php echo $reset['opens']; ?>
1065
-
1066
- <?php /* if ( $reset['conversions'] > 0 ) : ?>
1067
- <br />
1068
- <strong><?php _e( 'Previous Conversions', 'popup-maker' ); ?>:</strong> <?php echo $reset['conversions']; ?>
1069
- <?php endif; */ ?>
1070
-
1071
- <br /> <strong><?php _e( 'Lifetime Opens', 'popup-maker' ); ?>:</strong> <?php echo $popup->get_event_count( 'open', 'total' ); ?>
1072
-
1073
- <?php /* if ( $popup->get_event_count( 'conversion', 'total' ) > 0 ) : ?>
1074
- <br />
1075
- <strong><?php _e( 'Lifetime Conversions', 'popup-maker' ); ?>:</strong> <?php echo $popup->get_event_count( 'conversion', 'total' ); ?>
1076
- <?php endif; */ ?>
1077
- </small>
1078
- <?php endif; ?>
1079
- </td>
1080
- </tr>
1081
- </tbody>
1082
- </table>
1083
- </div>
1084
-
1085
- <?php do_action( 'pum_popup_analytics_metabox_after', $post->ID ); ?>
1086
-
1087
- </div>
1088
-
1089
- <?php
1090
- }
1091
-
1092
- /**
1093
- * @param array $meta
1094
- *
1095
- * @return array
1096
- */
1097
- public static function sanitize_meta( $meta = array() ) {
1098
- if ( ! empty( $meta ) ) {
1099
-
1100
- foreach ( $meta as $key => $value ) {
1101
-
1102
- if ( is_array( $value ) ) {
1103
- $meta[ $key ] = self::sanitize_meta( $value );
1104
- } else if ( is_string( $value ) ) {
1105
- try {
1106
- $value = json_decode( stripslashes( $value ) );
1107
- if ( is_object( $value ) || is_array( $value ) ) {
1108
- $meta[ $key ] = PUM_Admin_Helpers::object_to_array( $value );
1109
- }
1110
- } catch ( Exception $e ) {
1111
- }
1112
- }
1113
-
1114
- }
1115
- }
1116
-
1117
- return $meta;
1118
- }
1119
-
1120
-
1121
- /**
1122
- * Ensures that the popups have unique slugs.
1123
- *
1124
- * @param $data
1125
- * @param $postarr
1126
- *
1127
- * @return mixed
1128
- */
1129
- public static function set_slug( $data, $postarr ) {
1130
- if ( $data['post_type'] == 'popup' ) {
1131
- $data['post_name'] = wp_unique_post_slug( sanitize_title( popmake_post( 'popup_name' ) ), $postarr['ID'], $data['post_status'], $data['post_type'], $data['post_parent'] );
1132
- }
1133
-
1134
- return $data;
1135
- }
1136
-
1137
-
1138
- /**
1139
- * Defines the custom columns and their order
1140
- *
1141
- * @param array $_columns Array of popup columns
1142
- *
1143
- * @return array $columns Updated array of popup columns for
1144
- * Post Type List Table
1145
- */
1146
- public static function dashboard_columns( $_columns ) {
1147
- wp_enqueue_style( 'pum-admin-general' );
1148
- $columns = array(
1149
- 'cb' => '<input type="checkbox"/>',
1150
- 'title' => __( 'Name', 'popup-maker' ),
1151
- 'popup_title' => __( 'Title', 'popup-maker' ),
1152
- 'class' => __( 'CSS Classes', 'popup-maker' ),
1153
- 'opens' => __( 'Opens', 'popup-maker' ),
1154
- //'conversions' => __( 'Conversions', 'popup-maker' ),
1155
- //'conversion_rate' => __( 'Conversion Rate', 'popup-maker' ),
1156
- );
1157
-
1158
- // Add the date column preventing our own translation
1159
- if ( ! empty( $_columns['date'] ) ) {
1160
- $columns['date'] = $_columns['date'];
1161
- }
1162
-
1163
- if ( get_taxonomy( 'popup_tag' ) ) {
1164
- $columns['popup_tag'] = __( 'Tags', 'popup-maker' );
1165
- }
1166
-
1167
- if ( get_taxonomy( 'popup_category' ) ) {
1168
- $columns['popup_category'] = __( 'Categories', 'popup-maker' );
1169
- }
1170
-
1171
- // Deprecated filter.
1172
- $columns = apply_filters( 'popmake_popup_columns', $columns );
1173
-
1174
- return apply_filters( 'pum_popup_columns', $columns );
1175
- }
1176
-
1177
- /**
1178
- * Render Columns
1179
- *
1180
- * @param string $column_name Column name
1181
- * @param int $post_id (Post) ID
1182
- */
1183
- public static function render_columns( $column_name, $post_id ) {
1184
- if ( get_post_type( $post_id ) == 'popup' ) {
1185
-
1186
- $popup = pum_get_popup( $post_id );
1187
- //setup_postdata( $popup );
1188
-
1189
- /**
1190
- * Uncomment if need to check for permissions on certain columns.
1191
- * *
1192
- * $post_type_object = get_post_type_object( $popup->post_type );
1193
- * $can_edit_post = current_user_can( $post_type_object->cap->edit_post, $popup->ID );
1194
- */
1195
-
1196
- switch ( $column_name ) {
1197
- case 'popup_title':
1198
- echo esc_html( $popup->get_title() );
1199
- break;
1200
- case 'popup_category':
1201
- echo get_the_term_list( $post_id, 'popup_category', '', ', ', '' );
1202
- break;
1203
- case 'popup_tag':
1204
- echo get_the_term_list( $post_id, 'popup_tag', '', ', ', '' );
1205
- break;
1206
- case 'class':
1207
- echo '<pre style="display:inline-block;margin:0;"><code>popmake-' . absint( $post_id ) . '</code></pre>';
1208
- if ( $popup->post_name != $popup->ID ) {
1209
- echo '|';
1210
- echo '<pre style="display:inline-block;margin:0;"><code>popmake-' . $popup->post_name . '</code></pre>';
1211
- }
1212
- break;
1213
- case 'opens':
1214
- if ( ! pum_extension_enabled( 'popup-analytics' ) ) {
1215
- echo $popup->get_event_count( 'open' );
1216
- }
1217
- break;
1218
-
1219
- /*
1220
- case 'conversions':
1221
- if ( ! pum_extension_enabled( 'popup-analytics' ) ) {
1222
- echo $popup->get_event_count( 'conversion' );
1223
- }
1224
- break;
1225
- case 'conversion_rate':
1226
- $views = $popup->get_event_count( 'view', 'current' );
1227
- $conversions = $popup->get_event_count( 'conversion', 'current' );
1228
-
1229
- $conversion_rate = $views > 0 && $views >= $conversions ? $conversions / $views * 100 : __( 'N/A', 'popup-maker' );
1230
- echo round( $conversion_rate, 2 ) . '%';
1231
- break;
1232
- */
1233
- }
1234
- }
1235
- }
1236
-
1237
- /**
1238
- * Registers the sortable columns in the list table
1239
- *
1240
- * @param array $columns Array of the columns
1241
- *
1242
- * @return array $columns Array of sortable columns
1243
- */
1244
- public static function sortable_columns( $columns ) {
1245
- $columns['popup_title'] = 'popup_title';
1246
- $columns['opens'] = 'opens';
1247
-
1248
- // $columns['conversions'] = 'conversions';
1249
-
1250
- return $columns;
1251
- }
1252
-
1253
- /**
1254
- * Sorts Columns in the List Table
1255
- *
1256
- * @param array $vars Array of all the sort variables
1257
- *
1258
- * @return array $vars Array of all the sort variables
1259
- */
1260
- public static function sort_columns( $vars ) {
1261
- // Check if we're viewing the "popup" post type
1262
- if ( isset( $vars['post_type'] ) && 'popup' == $vars['post_type'] ) {
1263
- // Check if 'orderby' is set to "name"
1264
- if ( isset( $vars['orderby'] ) ) {
1265
- switch ( $vars['orderby'] ) {
1266
- case 'popup_title':
1267
- $vars = array_merge( $vars, array(
1268
- 'meta_key' => 'popup_title',
1269
- 'orderby' => 'meta_value',
1270
- ) );
1271
- break;
1272
- case 'opens':
1273
- if ( ! pum_extension_enabled( 'popup-analytics' ) ) {
1274
- $vars = array_merge( $vars, array(
1275
- 'meta_key' => 'popup_open_count',
1276
- 'orderby' => 'meta_value_num',
1277
- ) );
1278
- }
1279
- break;
1280
- /*
1281
- case 'conversions':
1282
- if ( ! pum_extension_enabled( 'popup-analytics' ) ) {
1283
- $vars = array_merge( $vars, array(
1284
- 'meta_key' => 'popup_conversion_count',
1285
- 'orderby' => 'meta_value_num',
1286
- ) );
1287
- }
1288
- break;
1289
- */
1290
- }
1291
- }
1292
- }
1293
-
1294
- return $vars;
1295
- }
1296
-
1297
- /**
1298
- * Initialize sorting
1299
- */
1300
- public static function load() {
1301
- add_filter( 'request', array( __CLASS__, 'sort_columns' ) );
1302
- }
1303
-
1304
- /**
1305
- * Add Popup Filters
1306
- *
1307
- * Adds taxonomy drop down filters for popups.
1308
- */
1309
- public static function add_popup_filters() {
1310
- global $typenow;
1311
-
1312
- // Checks if the current post type is 'popup'
1313
- if ( $typenow == 'popup' ) {
1314
-
1315
- if ( get_taxonomy( 'popup_category' ) ) {
1316
- $terms = get_terms( 'popup_category' );
1317
- if ( count( $terms ) > 0 ) {
1318
- echo "<select name='popup_category' id='popup_category' class='postform'>";
1319
- echo "<option value=''>" . __( 'Show all categories', 'popup-maker' ) . "</option>";
1320
- foreach ( $terms as $term ) {
1321
- $selected = isset( $_GET['popup_category'] ) && $_GET['popup_category'] == $term->slug ? 'selected="selected"' : '';
1322
- echo '<option value="' . esc_attr( $term->slug ) . '" ' . $selected . '>' . esc_html( $term->name ) . ' (' . $term->count . ')</option>';
1323
- }
1324
- echo "</select>";
1325
- }
1326
- }
1327
-
1328
- if ( get_taxonomy( 'popup_tag' ) ) {
1329
- $terms = get_terms( 'popup_tag' );
1330
- if ( count( $terms ) > 0 ) {
1331
- echo "<select name='popup_tag' id='popup_tag' class='postform'>";
1332
- echo "<option value=''>" . __( 'Show all tags', 'popup-maker' ) . "</option>";
1333
- foreach ( $terms as $term ) {
1334
- $selected = isset( $_GET['popup_tag'] ) && $_GET['popup_tag'] == $term->slug ? 'selected="selected"' : '';
1335
- echo '<option value="' . esc_attr( $term->slug ) . '" ' . $selected . '>' . esc_html( $term->name ) . ' (' . $term->count . ')</option>';
1336
- }
1337
- echo "</select>";
1338
- }
1339
- }
1340
- }
1341
-
1342
- }
1343
-
1344
- /**
1345
- * Prepends Popup ID to the action row on All Popups
1346
- * @param array $actions The row actions.
1347
- * @param $post The post
1348
- *
1349
- * @return array The new actions.
1350
- */
1351
- public static function add_id_row_actions( $actions, $post ) {
1352
- // Only adjust if we are dealing with our popups.
1353
- if ( 'popup' === $post->post_type ) {
1354
- return array_merge( array( 'id' => 'ID: ' . $post->ID ), $actions );
1355
- }
1356
-
1357
- return $actions;
1358
- }
1359
-
1360
- }
1361
-
1
+ <?php
2
+ /*******************************************************************************
3
+ * Copyright (c) 2019, Code Atlantic LLC
4
+ ******************************************************************************/
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) {
7
+ exit;
8
+ }
9
+
10
+ /**
11
+ * Class PUM_Admin_Popups
12
+ *
13
+ * @since 1.7.0
14
+ */
15
+ class PUM_Admin_Popups {
16
+
17
+ /**
18
+ * Hook the initialize method to the WP init action.
19
+ */
20
+ public static function init() {
21
+ // Change title to popup name.
22
+ add_filter( 'enter_title_here', array( __CLASS__, '_default_title' ) );
23
+
24
+ // Add popup title field.
25
+ add_action( 'edit_form_advanced', array( __CLASS__, 'title_meta_field' ) );
26
+
27
+ // Add Contextual help to post_name field.
28
+ add_action( 'edit_form_before_permalink', array( __CLASS__, 'popup_post_title_contextual_message' ) );
29
+
30
+ // Regitster Metaboxes
31
+ add_action( 'add_meta_boxes', array( __CLASS__, 'meta_box' ) );
32
+
33
+ // Process meta saving.
34
+ add_action( 'save_post', array( __CLASS__, 'save' ), 10, 2 );
35
+
36
+
37
+ // Set the slug properly on save.
38
+ add_filter( 'wp_insert_post_data', array( __CLASS__, 'set_slug' ), 99, 2 );
39
+
40
+ // Dashboard columns & filters.
41
+ add_filter( 'manage_edit-popup_columns', array( __CLASS__, 'dashboard_columns' ) );
42
+ add_action( 'manage_posts_custom_column', array( __CLASS__, 'render_columns' ), 10, 2 );
43
+ add_filter( 'manage_edit-popup_sortable_columns', array( __CLASS__, 'sortable_columns' ) );
44
+ add_action( 'load-edit.php', array( __CLASS__, 'load' ), 9999 );
45
+ add_action( 'restrict_manage_posts', array( __CLASS__, 'add_popup_filters' ), 100 );
46
+ add_filter( 'post_row_actions', array( __CLASS__, 'add_id_row_actions' ), 2, 100 );
47
+ }
48
+
49
+ /**
50
+ * Change default "Enter title here" input
51
+ *
52
+ * @param string $title Default title placeholder text
53
+ *
54
+ * @return string $title New placeholder text
55
+ */
56
+ public static function _default_title( $title ) {
57
+
58
+ if ( ! is_admin() ) {
59
+ return $title;
60
+ }
61
+
62
+ $screen = get_current_screen();
63
+
64
+ if ( 'popup_theme' == $screen->post_type ) {
65
+ $label = $screen->post_type == 'popup' ? __( 'Popup', 'popup-maker' ) : __( 'Popup Theme', 'popup-maker' );
66
+ $title = sprintf( __( '%s Name', 'popup-maker' ), $label );
67
+ }
68
+
69
+ if ( 'popup' == $screen->post_type ) {
70
+ $title = __( 'Popup Name', 'popup-maker' );
71
+ }
72
+
73
+ return $title;
74
+ }
75
+
76
+ /**
77
+ * Renders the popup title meta field.
78
+ */
79
+ public static function title_meta_field() {
80
+ global $post, $pagenow, $typenow;
81
+
82
+ if ( has_blocks( $post ) || ( function_exists( 'use_block_editor_for_post' ) && use_block_editor_for_post( $post ) ) ) {
83
+ return;
84
+ }
85
+
86
+ if ( ! is_admin() ) {
87
+ return;
88
+ }
89
+
90
+ if ( 'popup' == $typenow && in_array( $pagenow, array( 'post-new.php', 'post.php' ) ) ) { ?>
91
+
92
+ <div id="popup-titlediv" class="pum-form">
93
+ <div id="popup-titlewrap">
94
+ <label class="screen-reader-text" id="popup-title-prompt-text" for="popup-title">
95
+ <?php _e( 'Popup Title', 'popup-maker' ); ?>
96
+ </label>
97
+ <input tabindex="2" name="popup_title" size="30" value="<?php echo esc_attr( get_post_meta( $post->ID, 'popup_title', true ) ); ?>" id="popup-title" autocomplete="off" placeholder="<?php _e( 'Popup Title', 'popup-maker' ); ?>" />
98
+ <p class="pum-desc"><?php echo '(' . __( 'Optional', 'popup-maker' ) . ') ' . __( 'Shown as headline inside the popup. Can be left blank.', 'popup-maker' ); ?></p>
99
+ </div>
100
+ <div class="inside"></div>
101
+ </div>
102
+ <script>jQuery('#popup-titlediv').insertAfter('#titlediv');</script>
103
+ <?php
104
+ }
105
+ }
106
+
107
+ /**
108
+ * Renders contextual help for title.
109
+ */
110
+ public static function popup_post_title_contextual_message() {
111
+ global $post, $pagenow, $typenow;
112
+
113
+ if ( has_blocks( $post ) || ( function_exists( 'use_block_editor_for_post' ) && use_block_editor_for_post( $post ) ) ) {
114
+ return;
115
+ }
116
+
117
+ if ( ! is_admin() ) {
118
+ return;
119
+ }
120
+
121
+ if ( 'popup' == $typenow && in_array( $pagenow, array( 'post-new.php', 'post.php' ) ) ) { ?>
122
+ <p class="pum-desc"><?php echo '(' . __( 'Required', 'popup-maker' ) . ') ' . __( 'Enter a name to help you remember what this popup is about. Only you will see this.', 'popup-maker' ); ?></p>
123
+ <?php
124
+ }
125
+ }
126
+
127
+ /**
128
+ * Registers popup metaboxes.
129
+ */
130
+ public static function meta_box() {
131
+ add_meta_box( 'pum_popup_settings', __( 'Popup Settings', 'popup-maker' ), array( __CLASS__, 'render_settings_meta_box' ), 'popup', 'normal', 'high' );
132
+ add_meta_box( 'pum_popup_analytics', __( 'Analytics', 'popup-maker' ), array( __CLASS__, 'render_analytics_meta_box' ), 'popup', 'side', 'high' );
133
+ }
134
+
135
+ /**
136
+ * Ensures integrity of values.
137
+ *
138
+ * @param array $values
139
+ *
140
+ * @return array
141
+ */
142
+ public static function parse_values( $values = [] ) {
143
+ $defaults = self::defaults();
144
+
145
+ if ( empty( $values ) ) {
146
+ return $defaults;
147
+ }
148
+
149
+ $values = self::fill_missing_defaults( $values );
150
+
151
+ return $values;
152
+ }
153
+
154
+ /**
155
+ * Render the settings meta box wrapper and JS vars.
156
+ */
157
+ public static function render_settings_meta_box() {
158
+ global $post;
159
+
160
+ $popup = pum_get_popup( $post->ID );
161
+
162
+ // Get the meta directly rather than from cached object.
163
+ $settings = self::parse_values( $popup->get_settings() );
164
+
165
+ wp_nonce_field( basename( __FILE__ ), 'pum_popup_settings_nonce' );
166
+ wp_enqueue_script( 'popup-maker-admin' );
167
+ ?>
168
+ <script type="text/javascript">
169
+ window.pum_popup_settings_editor = <?php echo PUM_Utils_Array::safe_json_encode( apply_filters( 'pum_popup_settings_editor_var', array(
170
+ 'form_args' => array(
171
+ 'id' => 'pum-popup-settings',
172
+ 'tabs' => self::tabs(),
173
+ 'sections' => self::sections(),
174
+ 'fields' => self::fields(),
175
+ ),
176
+ 'conditions' => PUM_Conditions::instance()->get_conditions(),
177
+ 'conditions_selectlist' => PUM_Conditions::instance()->dropdown_list(),
178
+ 'triggers' => PUM_Triggers::instance()->get_triggers(),
179
+ 'cookies' => PUM_Cookies::instance()->get_cookies(),
180
+ 'current_values' => self::render_form_values( $settings ),
181
+ ) ) ); ?>;
182
+ </script>
183
+
184
+ <div id="pum-popup-settings-container" class="pum-popup-settings-container">
185
+ <div class="pum-no-js" style="padding: 0 12px;">
186
+ <p><?php printf( __( 'If you are seeing this, the page is still loading or there are Javascript errors on this page. %sView troubleshooting guide%s', 'popup-maker' ), '<a href="https://docs.wppopupmaker.com/article/373-checking-for-javascript-errors" target="_blank">', '</a>' ); ?></p>
187
+ </div>
188
+ </div>
189
+ <?php
190
+ }
191
+
192
+ /**
193
+ * Used to get deprecated fields for metabox saving of old extensions.
194
+ *
195
+ * @deprecated 1.7.0
196
+ *
197
+ * @return mixed
198
+ */
199
+ public static function deprecated_meta_fields() {
200
+ $fields = array();
201
+ foreach ( self::deprecated_meta_field_groups() as $group ) {
202
+ foreach ( apply_filters( 'popmake_popup_meta_field_group_' . $group, array() ) as $field ) {
203
+ $fields[] = 'popup_' . $group . '_' . $field;
204
+ }
205
+ }
206
+
207
+ return apply_filters( 'popmake_popup_meta_fields', $fields );
208
+ }
209
+
210
+ /**
211
+ * Used to get field groups from extensions.
212
+ *
213
+ * @deprecated 1.7.0
214
+ *
215
+ * @return mixed
216
+ */
217
+ public static function deprecated_meta_field_groups() {
218
+ return apply_filters( 'popmake_popup_meta_field_groups', array( 'display', 'close' ) );
219
+ }
220
+
221
+ /**
222
+ * @param $post_id
223
+ * @param $post
224
+ */
225
+ public static function save( $post_id, $post ) {
226
+
227
+ if ( isset( $post->post_type ) && 'popup' != $post->post_type ) {
228
+ return;
229
+ }
230
+
231
+ if ( ! isset( $_POST['pum_popup_settings_nonce'] ) || ! wp_verify_nonce( $_POST['pum_popup_settings_nonce'], basename( __FILE__ ) ) ) {
232
+ return;
233
+ }
234
+
235
+ if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || isset( $_REQUEST['bulk_edit'] ) ) {
236
+ return;
237
+ }
238
+
239
+ if ( isset( $post->post_type ) && 'revision' == $post->post_type ) {
240
+ return;
241
+ }
242
+
243
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
244
+ return;
245
+ }
246
+
247
+ $popup = pum_get_popup( $post_id );
248
+
249
+ if ( isset( $_POST['popup_reset_counts'] ) ) {
250
+ /**
251
+ * Reset popup open count, per user request.
252
+ */
253
+ $popup->reset_counts();
254
+ }
255
+
256
+
257
+ $title = ! empty ( $_POST['popup_title'] ) ? trim( sanitize_text_field( $_POST['popup_title'] ) ) : '';
258
+ $popup->update_meta( 'popup_title', $title );
259
+
260
+ $settings = ! empty( $_POST['popup_settings'] ) ? $_POST['popup_settings'] : array();
261
+
262
+ // Sanitize JSON values.
263
+ $settings['conditions'] = isset( $settings['conditions'] ) ? self::sanitize_meta( $settings['conditions'] ) : array();
264
+ $settings['triggers'] = isset( $settings['triggers'] ) ? self::sanitize_meta( $settings['triggers'] ) : array();
265
+ $settings['cookies'] = isset( $settings['cookies'] ) ? self::sanitize_meta( $settings['cookies'] ) : array();
266
+
267
+ $settings = apply_filters( 'pum_popup_setting_pre_save', $settings, $post->ID );
268
+
269
+ $settings = self::sanitize_settings( $settings );
270
+ $settings = self::parse_values( $settings );
271
+
272
+ $popup->update_settings( $settings, false );
273
+
274
+ // TODO Remove this and all other code here. This should be clean and all code more compartmentalized.
275
+ foreach ( self::deprecated_meta_fields() as $field ) {
276
+ if ( isset( $_POST[ $field ] ) ) {
277
+ $new = apply_filters( 'popmake_metabox_save_' . $field, $_POST[ $field ] );
278
+ update_post_meta( $post_id, $field, $new );
279
+ } else {
280
+ delete_post_meta( $post_id, $field );
281
+ }
282
+ }
283
+
284
+ do_action( 'pum_save_popup', $post_id, $post );
285
+ }
286
+
287
+ /**
288
+ * Parse & prepare values for form rendering.
289
+ *
290
+ * Add additional data for license_key fields, split the measure fields etc.
291
+ *
292
+ * @param $settings
293
+ *
294
+ * @return mixed
295
+ */
296
+ public static function render_form_values( $settings ) {
297
+ foreach ( $settings as $key => $value ) {
298
+ $field = self::get_field( $key );
299
+
300
+
301
+ if ( $field ) {
302
+ switch ( $field['type'] ) {
303
+ case 'measure':
304
+ break;
305
+ }
306
+ }
307
+ }
308
+
309
+ return $settings;
310
+ }
311
+
312
+ /**
313
+ * List of tabs & labels for the settings panel.
314
+ *
315
+ * @return array
316
+ */
317
+ public static function tabs() {
318
+ return apply_filters( 'pum_popup_settings_tabs', array(
319
+ 'general' => __( 'General', 'popup-maker' ),
320
+ 'display' => __( 'Display', 'popup-maker' ),
321
+ 'close' => __( 'Close', 'popup-maker' ),
322
+ 'triggers' => __( 'Triggers', 'popup-maker' ),
323
+ 'targeting' => __( 'Targeting', 'popup-maker' ),
324
+ 'advanced' => __( 'Advanced', 'popup-maker' ),
325
+ ) );
326
+ }
327
+
328
+ /**
329
+ * List of tabs & labels for the settings panel.
330
+ *
331
+ * @return array
332
+ */
333
+ public static function sections() {
334
+ return apply_filters( 'pum_popup_settings_sections', array(
335
+ 'general' => array(
336
+ 'main' => __( 'General Settings', 'popup-maker' ),
337
+ ),
338
+ 'triggers' => array(
339
+ 'main' => __( 'Triggers & Cookies', 'popup-maker' ),
340
+ ),
341
+ 'targeting' => array(
342
+ 'main' => __( 'Conditions', 'popup-maker' ),
343
+ ),
344
+ 'display' => array(
345
+ 'preset' => __( 'Display Presets', 'popup-maker' ),
346
+ 'main' => __( 'Appearance', 'popup-maker' ),
347
+ 'size' => __( 'Size', 'popup-maker' ),
348
+ 'animation' => __( 'Animation', 'popup-maker' ),
349
+ 'sound' => __( 'Sounds', 'popup-maker' ),
350
+ 'position' => __( 'Position', 'popup-maker' ),
351
+ 'advanced' => __( 'Advanced', 'popup-maker' ),
352
+ ),
353
+ 'close' => array(
354
+ 'button' => __( 'Button', 'popup-maker' ),
355
+ 'forms' => __( 'Form Submission', 'popup-maker' ),
356
+ 'alternate_methods' => __( 'Alternate Methods', 'popup-maker' ),
357
+ ),
358
+ 'advanced' => array(
359
+ 'main' => __( 'Advanced', 'popup-maker' ),
360
+ ),
361
+ ) );
362
+ }
363
+
364
+ /**
365
+ * Returns array of popup settings fields.
366
+ *
367
+ * @return mixed
368
+ */
369
+ public static function fields() {
370
+
371
+ static $tabs;
372
+
373
+ if ( ! isset( $tabs ) ) {
374
+ $tabs = apply_filters( 'pum_popup_settings_fields', array(
375
+ 'general' => apply_filters( 'pum_popup_general_settings_fields', array(
376
+ 'main' => array(),
377
+ ) ),
378
+ 'triggers' => apply_filters( 'pum_popup_triggers_settings_fields', array(
379
+ 'main' => array(
380
+ 'triggers' => array(
381
+ 'type' => 'triggers',
382
+ 'std' => array(),
383
+ 'priority' => 10,
384
+ ),
385
+ 'separator1' => array(
386
+ 'type' => 'separator',
387
+ 'private' => true,
388
+ ),
389
+ 'cookies' => array(
390
+ 'type' => 'cookies',
391
+ 'std' => array(),
392
+ 'priority' => 20,
393
+ ),
394
+ ),
395
+ ) ),
396
+ 'targeting' => apply_filters( 'pum_popup_targeting_settings_fields', array(
397
+ 'main' => array(
398
+ 'conditions' => array(
399
+ 'type' => 'conditions',
400
+ 'std' => array(),
401
+ 'priority' => 10,
402
+ 'private' => true,
403
+ ),
404
+ 'disable_on_mobile' => array(
405
+ 'label' => __( 'Disable this popup on mobile devices.', 'popup-maker' ),
406
+ 'type' => 'checkbox',
407
+ 'priority' => 20,
408
+ ),
409
+ 'disable_on_tablet' => array(
410
+ 'label' => __( 'Disable this popup on tablet devices.', 'popup-maker' ),
411
+ 'type' => 'checkbox',
412
+ 'priority' => 20,
413
+ ),
414
+ ),
415
+ ) ),
416
+ 'display' => apply_filters( 'pum_popup_display_settings_fields', array(
417
+ 'preset' => array(
418
+ 'explain' => array(
419
+ 'type' => 'html',
420
+ 'content' => '<p>Select one of the types below to get started! Once selected, you can adjust the display settings using the tabs above.</p>'
421
+ ),
422
+ 'type_section' => array(
423
+ 'type' => 'section',
424
+ 'classes' => 'popup-types',
425
+ 'fields' => array(
426
+ '<div class="popup-type" data-popup-type="center-popup"><img src="' . Popup_Maker::$URL . 'assets/images/admin/display-switcher/center-popup.png" alt="' . __( 'Center Popup', 'popup-maker' ) . '"/><button class="button">' . __( 'Center Popup', 'popup-maker' ) . '</button></div>',
427
+ '<div class="popup-type" data-popup-type="right-bottom-slidein"><img src="' . Popup_Maker::$URL . 'assets/images/admin/display-switcher/right-bottom-slidein.png" alt="' . __( 'Right Bottom Slide-in', 'popup-maker' ) . '"/><button class="button">' . __( 'Right Bottom Slide-in', 'popup-maker' ) . '</button></div>',
428
+ '<div class="popup-type" data-popup-type="top-bar"><img src="' . Popup_Maker::$URL . 'assets/images/admin/display-switcher/top-bar.png" alt="' . __( 'Top Bar', 'popup-maker' ) . '"/><button class="button">' . __( 'Top Bar', 'popup-maker' ) . '</button></div>',
429
+ '<div class="popup-type" data-popup-type="left-bottom-notice"><img src="' . Popup_Maker::$URL . 'assets/images/admin/display-switcher/left-bottom-notice.png" alt="' . __( 'Left Bottom Notice', 'popup-maker' ) . '"/><button class="button">' . __( 'Left Bottom Notice', 'popup-maker' ) . '</button></div>',
430
+ ),
431
+ ),
432
+ ),
433
+ 'main' => array(
434
+ 'theme_id' => array(
435
+ 'label' => __( 'Popup Theme', 'popup-maker' ),
436
+ 'dynamic_desc' => sprintf( '%1$s<br/><a id="edit_theme_link" href="%3$s">%2$s</a>', __( 'Choose a theme for this popup.', 'popup-maker' ), __( 'Customize This Theme', 'popup-maker' ), admin_url( "post.php?action=edit&post={{data.value}}" ) ),
437
+ 'type' => 'select',
438
+ 'options' => pum_is_popup_editor() ? PUM_Helpers::popup_theme_selectlist() : null,
439
+ 'std' => pum_get_default_theme_id(),
440
+ ),
441
+ ),
442
+ 'size' => array(
443
+ 'size' => array(
444
+ 'label' => __( 'Size', 'popup-maker' ),
445
+ 'desc' => __( 'Select the size of the popup.', 'popup-maker' ),
446
+ 'type' => 'select',
447
+ 'std' => 'medium',
448
+ 'priority' => 10,
449
+ 'options' => array(
450
+ __( 'Responsive Sizes', 'popup-maker' ) => array(
451
+ 'nano' => __( 'Nano - 10%', 'popup-maker' ),
452
+ 'micro' => __( 'Micro - 20%', 'popup-maker' ),
453
+ 'tiny' => __( 'Tiny - 30%', 'popup-maker' ),
454
+ 'small' => __( 'Small - 40%', 'popup-maker' ),
455
+ 'medium' => __( 'Medium - 60%', 'popup-maker' ),
456
+ 'normal' => __( 'Normal - 70%', 'popup-maker' ),
457
+ 'large' => __( 'Large - 80%', 'popup-maker' ),
458
+ 'xlarge' => __( 'X Large - 95%', 'popup-maker' ),
459
+ ),
460
+ __( 'Other Sizes', 'popup-maker' ) => array(
461
+ 'auto' => __( 'Auto', 'popup-maker' ),
462
+ 'custom' => __( 'Custom', 'popup-maker' ),
463
+ ),
464
+ ),
465
+ ),
466
+ 'responsive_min_width' => array(
467
+ 'label' => __( 'Min Width', 'popup-maker' ),
468
+ 'desc' => __( 'Set a minimum width for the popup.', 'popup-maker' ),
469
+ 'type' => 'measure',
470
+ 'std' => '0%',
471
+ 'priority' => 20,
472
+ 'dependencies' => array(
473
+ 'size' => array( 'nano', 'micro', 'tiny', 'small', 'medium', 'normal', 'large', 'xlarge' ),
474
+ ),
475
+ ),
476
+ 'responsive_max_width' => array(
477
+ 'label' => __( 'Max Width', 'popup-maker' ),
478
+ 'desc' => __( 'Set a maximum width for the popup.', 'popup-maker' ),
479
+ 'type' => 'measure',
480
+ 'std' => '100%',
481
+ 'priority' => 30,
482
+ 'dependencies' => array(
483
+ 'size' => array( 'nano', 'micro', 'tiny', 'small', 'medium', 'normal', 'large', 'xlarge' ),
484
+ ),
485
+ ),
486
+ 'custom_width' => array(
487
+ 'label' => __( 'Width', 'popup-maker' ),
488
+ 'desc' => __( 'Set a custom width for the popup.', 'popup-maker' ),
489
+ 'type' => 'measure',
490
+ 'std' => '640px',
491
+ 'priority' => 40,
492
+ 'dependencies' => array(
493
+ 'size' => 'custom',
494
+ ),
495
+ ),
496
+ 'custom_height_auto' => array(
497
+ 'label' => __( 'Auto Adjusted Height', 'popup-maker' ),
498
+ 'desc' => __( 'Checking this option will set height to fit the content.', 'popup-maker' ),
499
+ 'type' => 'checkbox',
500
+ 'priority' => 50,
501
+ 'dependencies' => array(
502
+ 'size' => 'custom',
503
+ ),
504
+ ),
505
+ 'custom_height' => array(
506
+ 'label' => __( 'Height', 'popup-maker' ),
507
+ 'desc' => __( 'Set a custom height for the popup.', 'popup-maker' ),
508
+ 'type' => 'measure',
509
+ 'std' => '380px',
510
+ 'priority' => 60,
511
+ 'dependencies' => array(
512
+ 'size' => 'custom',
513
+ 'custom_height_auto' => false,
514
+ ),
515
+ ),
516
+ 'scrollable_content' => array(
517
+ 'label' => __( 'Scrollable Content', 'popup-maker' ),
518
+ 'desc' => __( 'Checking this option will add a scroll bar to your content.', 'popup-maker' ),
519
+ 'type' => 'checkbox',
520
+ 'std' => false,
521
+ 'priority' => 70,
522
+ 'dependencies' => array(
523
+ 'size' => 'custom',
524
+ 'custom_height_auto' => false,
525
+ ),
526
+ ),
527
+ ),
528
+ 'animation' => array(
529
+ 'animation_type' => array(
530
+ 'label' => __( 'Animation Type', 'popup-maker' ),
531
+ 'desc' => __( 'Select an animation type for your popup.', 'popup-maker' ),
532
+ 'type' => 'select',
533
+ 'std' => 'fade',
534
+ 'priority' => 10,
535
+ 'options' => array(
536
+ 'none' => __( 'None', 'popup-maker' ),
537
+ 'slide' => __( 'Slide', 'popup-maker' ),
538
+ 'fade' => __( 'Fade', 'popup-maker' ),
539
+ 'fadeAndSlide' => __( 'Fade and Slide', 'popup-maker' ),
540
+ // 'grow' => __( 'Grow', 'popup-maker' ),
541
+ // 'growAndSlide' => __( 'Grow and Slide', 'popup-maker' ),
542
+ ),
543
+ ),
544
+ 'animation_speed' => array(
545
+ 'label' => __( 'Animation Speed', 'popup-maker' ),
546
+ 'desc' => __( 'Set the animation speed for the popup.', 'popup-maker' ),
547
+ 'type' => 'rangeslider',
548
+ 'std' => 350,
549
+ 'step' => 10,
550
+ 'min' => 50,
551
+ 'max' => 1000,
552
+ 'unit' => __( 'ms', 'popup-maker' ),
553
+ 'priority' => 20,
554
+ 'dependencies' => array(
555
+ 'animation_type' => array( 'slide', 'fade', 'fadeAndSlide', 'grow', 'growAndSlide' ),
556
+ ),
557
+ ),
558
+ 'animation_origin' => array(
559
+ 'label' => __( 'Animation Origin', 'popup-maker' ),
560
+ 'desc' => __( 'Choose where the animation will begin.', 'popup-maker' ),
561
+ 'type' => 'select',
562
+ 'std' => 'center top',
563
+ 'options' => array(
564
+ 'top' => __( 'Top', 'popup-maker' ),
565
+ 'left' => __( 'Left', 'popup-maker' ),
566
+ 'bottom' => __( 'Bottom', 'popup-maker' ),
567
+ 'right' => __( 'Right', 'popup-maker' ),
568
+ 'left top' => __( 'Top Left', 'popup-maker' ),
569
+ 'center top' => __( 'Top Center', 'popup-maker' ),
570
+ 'right top' => __( 'Top Right', 'popup-maker' ),
571
+ 'left center' => __( 'Middle Left', 'popup-maker' ),
572
+ 'center center' => __( 'Middle Center', 'popup-maker' ),
573
+ 'right center' => __( 'Middle Right', 'popup-maker' ),
574
+ 'left bottom' => __( 'Bottom Left', 'popup-maker' ),
575
+ 'center bottom' => __( 'Bottom Center', 'popup-maker' ),
576
+ 'right bottom' => __( 'Bottom Right', 'popup-maker' ),
577
+ ),
578
+ 'priority' => 30,
579
+ 'dependencies' => array(
580
+ 'animation_type' => array( 'slide', 'fadeAndSlide', 'grow', 'growAndSlide' ),
581
+ ),
582
+ ),
583
+ ),
584
+ 'sound' => array(
585
+ 'open_sound' => array(
586
+ 'label' => __( 'Opening Sound', 'popup-maker' ),
587
+ 'desc' => __( 'Select a sound to play when the popup opens.', 'popup-maker' ),
588
+ 'type' => 'select',
589
+ 'std' => 'none',
590
+ 'priority' => 10,
591
+ 'options' => array(
592
+ 'none' => __( 'None', 'popup-maker' ),
593
+ 'beep.mp3' => __( 'Beep', 'popup-maker' ),
594
+ 'beep-two.mp3' => __( 'Beep 2', 'popup-maker' ),
595
+ 'beep-up.mp3' => __( 'Beep Up', 'popup-maker' ),
596
+ 'chimes.mp3' => __( 'Chimes', 'popup-maker' ),
597
+ 'correct.mp3' => __( 'Correct', 'popup-maker' ),
598
+ 'custom' => __( 'Custom Sound', 'popup-maker' ),
599
+ ),
600
+ ),
601
+ 'custom_sound' => array(
602
+ 'label' => __( 'Custom Sound URL', 'popup-maker' ),
603
+ 'desc' => __( 'Enter URL to sound file.', 'popup-maker' ),
604
+ 'type' => 'text',
605
+ 'std' => '',
606
+ 'priority' => 10,
607
+ 'dependencies' => array(
608
+ 'open_sound' => array( 'custom' ),
609
+ ),
610
+ ),
611
+ ),
612
+ 'position' => array(
613
+ 'location' => array(
614
+ 'label' => __( 'Location', 'popup-maker' ),
615
+ 'desc' => __( 'Choose where the popup will be displayed.', 'popup-maker' ),
616
+ 'type' => 'select',
617
+ 'std' => 'center top',
618
+ 'priority' => 10,
619
+ 'options' => array(
620
+ 'left top' => __( 'Top Left', 'popup-maker' ),
621
+ 'center top' => __( 'Top Center', 'popup-maker' ),
622
+ 'right top' => __( 'Top Right', 'popup-maker' ),
623
+ 'left center' => __( 'Middle Left', 'popup-maker' ),
624
+ 'center' => __( 'Middle Center', 'popup-maker' ),
625
+ 'right center' => __( 'Middle Right', 'popup-maker' ),
626
+ 'left bottom' => __( 'Bottom Left', 'popup-maker' ),
627
+ 'center bottom' => __( 'Bottom Center', 'popup-maker' ),
628
+ 'right bottom' => __( 'Bottom Right', 'popup-maker' ),
629
+ ),
630
+ ),
631
+ 'position_top' => array(
632
+ 'label' => __( 'Top', 'popup-maker' ),
633
+ 'desc' => sprintf( _x( 'Distance from the %s edge of the screen.', 'Screen Edge: top, bottom', 'popup-maker' ), strtolower( __( 'Top', 'popup-maker' ) ) ),
634
+ 'type' => 'rangeslider',
635
+ 'std' => 100,
636
+ 'step' => 1,
637
+ 'min' => 0,
638
+ 'max' => 500,
639
+ 'unit' => 'px',
640
+ 'priority' => 20,
641
+ 'dependencies' => array(
642
+ 'location' => array( 'left top', 'center top', 'right top' ),
643
+ ),
644
+ ),
645
+ 'position_bottom' => array(
646
+ 'label' => __( 'Bottom', 'popup-maker' ),
647
+ 'desc' => sprintf( _x( 'Distance from the %s edge of the screen.', 'Screen Edge: top, bottom', 'popup-maker' ), strtolower( __( 'Bottom', 'popup-maker' ) ) ),
648
+ 'type' => 'rangeslider',
649
+ 'std' => 0,
650
+ 'step' => 1,
651
+ 'min' => 0,
652
+ 'max' => 500,
653
+ 'unit' => 'px',
654
+ 'priority' => 20,
655
+ 'dependencies' => array(
656
+ 'location' => array( 'left bottom', 'center bottom', 'right bottom' ),
657
+ ),
658
+ ),
659
+ 'position_left' => array(
660
+ 'label' => __( 'Left', 'popup-maker' ),
661
+ 'desc' => sprintf( _x( 'Distance from the %s edge of the screen.', 'Screen Edge: top, bottom', 'popup-maker' ), strtolower( __( 'Left', 'popup-maker' ) ) ),
662
+ 'type' => 'rangeslider',
663
+ 'std' => 0,
664
+ 'step' => 1,
665
+ 'min' => 0,
666
+ 'max' => 500,
667
+ 'unit' => 'px',
668
+ 'priority' => 30,
669
+ 'dependencies' => array(
670
+ 'location' => array( 'left top', 'left center', 'left bottom' ),
671
+ ),
672
+ ),
673
+ 'position_right' => array(
674
+ 'label' => __( 'Right', 'popup-maker' ),
675
+ 'desc' => sprintf( _x( 'Distance from the %s edge of the screen.', 'Screen Edge: top, bottom', 'popup-maker' ), strtolower( __( 'Right', 'popup-maker' ) ) ),
676
+ 'type' => 'rangeslider',
677
+ 'std' => 0,
678
+ 'step' => 1,
679
+ 'min' => 0,
680
+ 'max' => 500,
681
+ 'unit' => 'px',
682
+ 'priority' => 30,
683
+ 'dependencies' => array(
684
+ 'location' => array( 'right top', 'right center', 'right bottom' ),
685
+ ),
686
+ ),
687
+ 'position_from_trigger' => array(
688
+ 'label' => __( 'Position from Trigger', 'popup-maker' ),
689
+ 'desc' => sprintf( __( 'This will position the popup in relation to the %sClick Trigger%s.', 'popup-maker' ), '<a target="_blank" href="https://docs.wppopupmaker.com/article/144-trigger-click-open?utm_medium=inline-doclink&utm_campaign=ContextualHelp&utm_source=plugin-popup-editor&utm_content=position-from-trigger">', '</a>' ),
690
+ 'type' => 'checkbox',
691
+ 'std' => false,
692
+ 'priority' => 40,
693
+ ),
694
+ 'position_fixed' => array(
695
+ 'label' => __( 'Fixed Postioning', 'popup-maker' ),
696
+ 'desc' => __( 'Checking this sets the positioning of the popup to fixed.', 'popup-maker' ),
697
+ 'type' => 'checkbox',
698
+ 'priority' => 50,
699
+ ),
700
+ ),
701
+ 'advanced' => array(
702
+ 'overlay_disabled' => array(
703
+ 'label' => __( 'Disable Overlay', 'popup-maker' ),
704
+ 'desc' => __( 'Checking this will disable and hide the overlay for this popup.', 'popup-maker' ),
705
+ 'type' => 'checkbox',
706
+ 'priority' => 10,
707
+ ),
708
+ 'stackable' => array(
709
+ 'label' => __( 'Stackable', 'popup-maker' ),
710
+ 'desc' => __( 'This enables other popups to remain open.', 'popup-maker' ),
711
+ 'type' => 'checkbox',
712
+ 'priority' => 20,
713
+ ),
714
+ 'disable_reposition' => array(
715
+ 'label' => __( 'Disable Repositioning', 'popup-maker' ),
716
+ 'desc' => __( 'This will disable automatic repositioning of the popup on window resizing.', 'popup-maker' ),
717
+ 'type' => 'checkbox',
718
+ 'priority' => 30,
719
+ ),
720
+ 'zindex' => array(
721
+ 'label' => __( 'Popup Z-Index', 'popup-maker' ),
722
+ 'desc' => __( 'Change the z-index layer level for the popup.', 'popup-maker' ),
723
+ 'type' => 'number',
724
+ 'min' => 999,
725
+ 'max' => 2147483647,
726
+ 'std' => 1999999999,
727
+ 'priority' => 40,
728
+ ),
729
+ ),
730
+ ) ),
731
+ 'close' => apply_filters( 'pum_popup_close_settings_fields', array(
732
+ 'button' => array(
733
+ 'close_text' => array(
734
+ 'label' => __( 'Close Text', 'popup-maker' ),
735
+ 'placeholder' => __( 'Close', 'popup-maker' ),
736
+ 'desc' => __( 'Override the default close text. To use a Font Awesome icon instead of text, enter the CSS classes such as "fas fa-camera".', 'popup-maker' ),
737
+ 'priority' => 10,
738
+ 'private' => true,
739
+ ),
740
+ 'close_button_delay' => array(
741
+ 'label' => __( 'Close Button Delay', 'popup-maker' ),
742
+ 'desc' => __( 'This delays the display of the close button.', 'popup-maker' ),
743
+ 'type' => 'rangeslider',
744
+ 'std' => 0,
745
+ 'step' => 100,
746
+ 'min' => 0,
747
+ 'max' => 3000,
748
+ 'unit' => __( 'ms', 'popup-maker' ),
749
+ 'priority' => 20,
750
+ ),
751
+ ),
752
+ 'forms' => [
753
+ 'close_on_form_submission' => [
754
+ 'label' => __( 'Close on Form Submission', 'popup-maker' ),
755
+ 'desc' => __( 'Close the popup automatically after integrated form plugin submissions.', 'popup-maker' ),
756
+ 'type' => 'checkbox',
757
+ ],
758
+ 'close_on_form_submission_delay' => [
759
+ 'type' => 'rangeslider',
760
+ 'label' => __( 'Delay', 'popup-maker' ),
761
+ 'desc' => __( 'The delay before the popup will close after submission (in milliseconds).', 'popup-maker' ),
762
+ 'std' => 0,
763
+ 'min' => 0,
764
+ 'max' => 10000,
765
+ 'step' => 500,
766
+ 'unit' => 'ms',
767
+ 'dependencies' => [
768
+ 'close_on_form_submission' => true,
769
+ ],
770
+ ],
771
+ ],
772
+ 'alternate_methods' => array(
773
+ 'close_on_overlay_click' => array(
774
+ 'label' => __( 'Click Overlay to Close', 'popup-maker' ),
775
+ 'desc' => __( 'Checking this will cause popup to close when user clicks on overlay.', 'popup-maker' ),
776
+ 'type' => 'checkbox',
777
+ 'priority' => 10,
778
+ ),
779
+ 'close_on_esc_press' => array(
780
+ 'label' => __( 'Press ESC to Close', 'popup-maker' ),
781
+ 'desc' => __( 'Checking this will cause popup to close when user presses ESC key.', 'popup-maker' ),
782
+ 'type' => 'checkbox',
783
+ 'priority' => 20,
784
+ ),
785
+ 'close_on_f4_press' => array(
786
+ 'label' => __( 'Press F4 to Close', 'popup-maker' ),
787
+ 'desc' => __( 'Checking this will cause popup to close when user presses F4 key.', 'popup-maker' ),
788
+ 'type' => 'checkbox',
789
+ 'priority' => 30,
790
+ ),
791
+ ),
792
+ ) ),
793
+ 'advanced' => apply_filters( 'pum_popup_advanced_settings_fields', array(
794
+ 'main' => array(
795
+ 'disable_form_reopen' => array(
796
+ 'label' => __( 'Disable automatic re-triggering of popup after non-ajax form submission.', 'popup-maker' ),
797
+ 'type' => 'checkbox',
798
+ 'priority' => 10,
799
+ ),
800
+ 'disable_accessibility' => array(
801
+ 'label' => __( 'Disable accessibility features.', 'popup-maker' ),
802
+ 'desc' => __( 'This includes trapping the tab key & focus inside popup while open, force focus the first element when popup open, and refocus last click trigger when closed.', 'popup-maker' ),
803
+ 'type' => 'checkbox',
804
+ 'priority' => 10,
805
+ ),
806
+ ),
807
+ ) ),
808
+ ) );
809
+
810
+ foreach ( $tabs as $tab_id => $sections ) {
811
+
812
+ foreach ( $sections as $section_id => $fields ) {
813
+
814
+ if ( PUM_Admin_Helpers::is_field( $fields ) ) {
815
+ // Allow for flat tabs with no sections.
816
+ $section_id = 'main';
817
+ $fields = array(
818
+ $section_id => $fields,
819
+ );
820
+ }
821
+
822
+ foreach ( $fields as $field_id => $field ) {
823
+ if ( ! is_array( $field ) || ! PUM_Admin_Helpers::is_field( $field ) ) {
824
+ continue;
825
+ }
826
+
827
+ if ( empty( $field['id'] ) ) {
828
+ $field['id'] = $field_id;
829
+ }
830
+ if ( empty( $field['name'] ) ) {
831
+ $field['name'] = 'popup_settings[' . $field_id . ']';
832
+ }
833
+
834
+ $tabs[ $tab_id ][ $section_id ][ $field_id ] = wp_parse_args( $field, array(
835
+ 'section' => 'main',
836
+ 'type' => 'text',
837
+ 'id' => null,
838
+ 'label' => '',
839
+ 'desc' => '',
840
+ 'name' => null,
841
+ 'templ_name' => null,
842
+ 'size' => 'regular',
843
+ 'options' => array(),
844
+ 'std' => null,
845
+ 'rows' => 5,
846
+ 'cols' => 50,
847
+ 'min' => 0,
848
+ 'max' => 50,
849
+ 'force_minmax' => false,
850
+ 'step' => 1,
851
+ 'select2' => null,
852
+ 'object_type' => 'post_type',
853
+ 'object_key' => 'post',
854
+ 'post_type' => null,
855
+ 'taxonomy' => null,
856
+ 'multiple' => null,
857
+ 'as_array' => false,
858
+ 'placeholder' => null,
859
+ 'checkbox_val' => 1,
860
+ 'allow_blank' => true,
861
+ 'readonly' => false,
862
+ 'required' => false,
863
+ 'disabled' => false,
864
+ 'hook' => null,
865
+ 'unit' => __( 'ms', 'popup-maker' ),
866
+ 'units' => array(
867
+ 'px' => 'px',
868
+ '%' => '%',
869
+ 'em' => 'em',
870
+ 'rem' => 'rem',
871
+ ),
872
+ 'priority' => null,
873
+ 'doclink' => '',
874
+ 'button_type' => 'submit',
875
+ 'class' => '',
876
+ 'private' => false,
877
+ ) );
878
+
879
+ }
880
+ }
881
+ }
882
+ }
883
+
884
+
885
+ return $tabs;
886
+ }
887
+
888
+ public static function get_field( $id ) {
889
+ $tabs = self::fields();
890
+
891
+ foreach ( $tabs as $tab => $sections ) {
892
+
893
+ if ( PUM_Admin_Helpers::is_field( $sections ) ) {
894
+ $sections = array(
895
+ 'main' => array(
896
+ $tab => $sections,
897
+ ),
898
+ );
899
+ }
900
+
901
+ foreach ( $sections as $section => $fields ) {
902
+
903
+ foreach ( $fields as $key => $args ) {
904
+ if ( $key == $id ) {
905
+ return $args;
906
+ }
907
+ }
908
+ }
909
+ }
910
+
911
+ return false;
912
+ }
913
+
914
+ /**
915
+ * Sanitizes fields after submission.
916
+ *
917
+ * Also handles pre save manipulations for some field types (measure/license).
918
+ *
919
+ * @param array $settings
920
+ *
921
+ * @return array
922
+ */
923
+ public static function sanitize_settings( $settings = array() ) {
924
+
925
+ $fields = self::fields();
926
+ $fields = PUM_Admin_Helpers::flatten_fields_array( $fields );
927
+
928
+ foreach ( $fields as $field_id => $field ) {
929
+ switch ( $field['type'] ) {
930
+ case 'checkbox':
931
+
932
+ if ( ! isset( $settings[ $field_id ] ) ) {
933
+ $settings[ $field_id ] = false;
934
+ }
935
+ break;
936
+ }
937
+ }
938
+
939
+ foreach ( $settings as $key => $value ) {
940
+ $field = self::get_field( $key );
941
+
942
+ if ( $field ) {
943
+
944
+ // Sanitize every string value.
945
+ if ( is_string( $value ) ) {
946
+ $settings[ $key ] = sanitize_text_field( $value );
947
+ }
948
+
949
+ switch ( $field['type'] ) {
950
+ default:
951
+ $settings[ $key ] = is_string( $value ) ? trim( $value ) : $value;
952
+ break;
953
+
954
+
955
+ case 'measure':
956
+ $settings[ $key ] .= $settings[ $key . '_unit' ];
957
+ break;
958
+ }
959
+ } else {
960
+ // Some custom field types include multiple additional fields that do not need to be saved, strip out any non-whitelisted fields.
961
+ unset( $settings[ $key ] );
962
+ }
963
+
964
+
965
+ }
966
+
967
+ return $settings;
968
+ }
969
+
970
+ /**
971
+ * @return array
972
+ */
973
+ public static function defaults() {
974
+ $tabs = self::fields();
975
+
976
+ $defaults = array();
977
+
978
+ foreach ( $tabs as $tab_id => $sections ) {
979
+ foreach ( $sections as $section_id => $fields ) {
980
+ foreach ( $fields as $key => $field ) {
981
+ if ( $field['type'] == 'checkbox' ) {
982
+ $defaults[ $key ] = isset( $field['std'] ) ? $field['std'] : ( $field['type'] == 'checkbox' ? false : null );
983
+ }
984
+ }
985
+ }
986
+ }
987
+
988
+ return $defaults;
989
+ }
990
+
991
+ /**
992
+ * Fills default settings only when missing.
993
+ *
994
+ * Excludes checkbox type fields where a false value is represented by the field being unset.
995
+ *
996
+ * @param array $settings
997
+ *
998
+ * @return array
999
+ */
1000
+ public static function fill_missing_defaults( $settings = [] ) {
1001
+ $excluded_field_types = [ 'checkbox', 'multicheck' ];
1002
+
1003
+ $defaults = self::defaults();
1004
+ foreach ( $defaults as $field_id => $default_value ) {
1005
+ $field = self::get_field( $field_id );
1006
+ if ( isset( $settings[ $field_id ] ) || in_array( $field['type'], $excluded_field_types ) ) {
1007
+ continue;
1008
+ }
1009
+
1010
+ $settings[ $field_id ] = $default_value;
1011
+ }
1012
+
1013
+ return $settings;
1014
+
1015
+ }
1016
+
1017
+ /**
1018
+ * Display analytics metabox
1019
+ *
1020
+ * @return void
1021
+ */
1022
+ public static function render_analytics_meta_box() {
1023
+ global $post;
1024
+
1025
+ $popup = pum_get_popup( $post->ID ); ?>
1026
+ <div id="pum-popup-analytics" class="pum-meta-box">
1027
+
1028
+ <?php do_action( 'pum_popup_analytics_metabox_before', $post->ID ); ?>
1029
+
1030
+ <?php
1031
+ $opens = $popup->get_event_count( 'open', 'current' );
1032
+ //$conversions = $popup->get_event_count( 'conversion', 'current' );
1033
+ //$conversion_rate = $opens > 0 && $opens >= $conversions ? $conversions / $opens * 100 : false;
1034
+ ?>
1035
+
1036
+ <div id="pum-popup-analytics" class="pum-popup-analytics">
1037
+
1038
+ <table class="form-table">
1039
+ <tbody>
1040
+ <tr>
1041
+ <td><?php _e( 'Opens', 'popup-maker' ); ?></td>
1042
+ <td><?php echo $opens; ?></td>
1043
+ </tr>
1044
+ <?php /* if ( $conversion_rate > 0 ) : ?>
1045
+ <tr>
1046
+ <td><?php _e( 'Conversions', 'popup-maker' ); ?></td>
1047
+ <td><?php echo $conversions; ?></td>
1048
+ </tr>
1049
+ <?php endif; */ ?>
1050
+ <?php /* if ( $conversion_rate > 0 ) : ?>
1051
+ <tr>
1052
+ <td><?php _e( 'Conversion Rate', 'popup-maker' ); ?></td>
1053
+ <td><?php echo round( $conversion_rate, 2 ); ?>%</td>
1054
+ </tr>
1055
+ <?php endif; */ ?>
1056
+ <tr class="separator">
1057
+ <td colspan="2">
1058
+ <label> <input type="checkbox" name="popup_reset_counts" id="popup_reset_counts" value="1" />
1059
+ <?php _e( 'Reset Counts', 'popup-maker' ); ?>
1060
+ </label>
1061
+ <?php if ( ( $reset = $popup->get_last_count_reset() ) ) : ?><br />
1062
+ <small>
1063
+ <strong><?php _e( 'Last Reset', 'popup-maker' ); ?>:</strong> <?php echo date( 'm-d-Y H:i', $reset['timestamp'] ); ?>
1064
+ <br /> <strong><?php _e( 'Previous Opens', 'popup-maker' ); ?>:</strong> <?php echo $reset['opens']; ?>
1065
+
1066
+ <?php /* if ( $reset['conversions'] > 0 ) : ?>
1067
+ <br />
1068
+ <strong><?php _e( 'Previous Conversions', 'popup-maker' ); ?>:</strong> <?php echo $reset['conversions']; ?>
1069
+ <?php endif; */ ?>
1070
+
1071
+ <br /> <strong><?php _e( 'Lifetime Opens', 'popup-maker' ); ?>:</strong> <?php echo $popup->get_event_count( 'open', 'total' ); ?>
1072
+
1073
+ <?php /* if ( $popup->get_event_count( 'conversion', 'total' ) > 0 ) : ?>
1074
+ <br />
1075
+ <strong><?php _e( 'Lifetime Conversions', 'popup-maker' ); ?>:</strong> <?php echo $popup->get_event_count( 'conversion', 'total' ); ?>
1076
+ <?php endif; */ ?>
1077
+ </small>
1078
+ <?php endif; ?>
1079
+ </td>
1080
+ </tr>
1081
+ </tbody>
1082
+ </table>
1083
+ </div>
1084
+
1085
+ <?php do_action( 'pum_popup_analytics_metabox_after', $post->ID ); ?>
1086
+
1087
+ </div>
1088
+
1089
+ <?php
1090
+ }
1091
+
1092
+ /**
1093
+ * @param array $meta
1094
+ *
1095
+ * @return array
1096
+ */
1097
+ public static function sanitize_meta( $meta = array() ) {
1098
+ if ( ! empty( $meta ) ) {
1099
+
1100
+ foreach ( $meta as $key => $value ) {
1101
+
1102
+ if ( is_array( $value ) ) {
1103
+ $meta[ $key ] = self::sanitize_meta( $value );
1104
+ } else if ( is_string( $value ) ) {
1105
+ try {
1106
+ $value = json_decode( stripslashes( $value ) );
1107
+ if ( is_object( $value ) || is_array( $value ) ) {
1108
+ $meta[ $key ] = PUM_Admin_Helpers::object_to_array( $value );
1109
+ }
1110
+ } catch ( Exception $e ) {
1111
+ }
1112
+ }
1113
+
1114
+ }
1115
+ }
1116
+
1117
+ return $meta;
1118
+ }
1119
+
1120
+
1121
+ /**
1122
+ * Ensures that the popups have unique slugs.
1123
+ *
1124
+ * @param $data
1125
+ * @param $postarr
1126
+ *
1127
+ * @return mixed
1128
+ */
1129
+ public static function set_slug( $data, $postarr ) {
1130
+ if ( $data['post_type'] == 'popup' ) {
1131
+ $data['post_name'] = wp_unique_post_slug( sanitize_title( popmake_post( 'popup_name' ) ), $postarr['ID'], $data['post_status'], $data['post_type'], $data['post_parent'] );
1132
+ }
1133
+
1134
+ return $data;
1135
+ }
1136
+
1137
+
1138
+ /**
1139
+ * Defines the custom columns and their order
1140
+ *
1141
+ * @param array $_columns Array of popup columns
1142
+ *
1143
+ * @return array $columns Updated array of popup columns for
1144
+ * Post Type List Table
1145
+ */
1146
+ public static function dashboard_columns( $_columns ) {
1147
+ wp_enqueue_style( 'pum-admin-general' );
1148
+ $columns = array(
1149
+ 'cb' => '<input type="checkbox"/>',
1150
+ 'title' => __( 'Name', 'popup-maker' ),
1151
+ 'popup_title' => __( 'Title', 'popup-maker' ),
1152
+ 'class' => __( 'CSS Classes', 'popup-maker' ),
1153
+ 'opens' => __( 'Opens', 'popup-maker' ),
1154
+ //'conversions' => __( 'Conversions', 'popup-maker' ),
1155
+ //'conversion_rate' => __( 'Conversion Rate', 'popup-maker' ),
1156
+ );
1157
+
1158
+ // Add the date column preventing our own translation
1159
+ if ( ! empty( $_columns['date'] ) ) {
1160
+ $columns['date'] = $_columns['date'];
1161
+ }
1162
+
1163
+ if ( get_taxonomy( 'popup_tag' ) ) {
1164
+ $columns['popup_tag'] = __( 'Tags', 'popup-maker' );
1165
+ }
1166
+
1167
+ if ( get_taxonomy( 'popup_category' ) ) {
1168
+ $columns['popup_category'] = __( 'Categories', 'popup-maker' );
1169
+ }
1170
+
1171
+ // Deprecated filter.
1172
+ $columns = apply_filters( 'popmake_popup_columns', $columns );
1173
+
1174
+ return apply_filters( 'pum_popup_columns', $columns );
1175
+ }
1176
+
1177
+ /**
1178
+ * Render Columns
1179
+ *
1180
+ * @param string $column_name Column name
1181
+ * @param int $post_id (Post) ID
1182
+ */
1183
+ public static function render_columns( $column_name, $post_id ) {
1184
+ if ( get_post_type( $post_id ) == 'popup' ) {
1185
+
1186
+ $popup = pum_get_popup( $post_id );
1187
+ //setup_postdata( $popup );
1188
+
1189
+ /**
1190
+ * Uncomment if need to check for permissions on certain columns.
1191
+ * *
1192
+ * $post_type_object = get_post_type_object( $popup->post_type );
1193
+ * $can_edit_post = current_user_can( $post_type_object->cap->edit_post, $popup->ID );
1194
+ */
1195
+
1196
+ switch ( $column_name ) {
1197
+ case 'popup_title':
1198
+ echo esc_html( $popup->get_title() );
1199
+ break;
1200
+ case 'popup_category':
1201
+ echo get_the_term_list( $post_id, 'popup_category', '', ', ', '' );
1202
+ break;
1203
+ case 'popup_tag':
1204
+ echo get_the_term_list( $post_id, 'popup_tag', '', ', ', '' );
1205
+ break;
1206
+ case 'class':
1207
+ echo '<pre style="display:inline-block;margin:0;"><code>popmake-' . absint( $post_id ) . '</code></pre>';
1208
+ if ( $popup->post_name != $popup->ID ) {
1209
+ echo '|';
1210
+ echo '<pre style="display:inline-block;margin:0;"><code>popmake-' . $popup->post_name . '</code></pre>';
1211
+ }
1212
+ break;
1213
+ case 'opens':
1214
+ if ( ! pum_extension_enabled( 'popup-analytics' ) ) {
1215
+ echo $popup->get_event_count( 'open' );
1216
+ }
1217
+ break;
1218
+
1219
+ /*
1220
+ case 'conversions':
1221
+ if ( ! pum_extension_enabled( 'popup-analytics' ) ) {
1222
+ echo $popup->get_event_count( 'conversion' );
1223
+ }
1224
+ break;
1225
+ case 'conversion_rate':
1226
+ $views = $popup->get_event_count( 'view', 'current' );
1227
+ $conversions = $popup->get_event_count( 'conversion', 'current' );
1228
+
1229
+ $conversion_rate = $views > 0 && $views >= $conversions ? $conversions / $views * 100 : __( 'N/A', 'popup-maker' );
1230
+ echo round( $conversion_rate, 2 ) . '%';
1231
+ break;
1232
+ */
1233
+ }
1234
+ }
1235
+ }
1236
+
1237
+ /**
1238
+ * Registers the sortable columns in the list table
1239
+ *
1240
+ * @param array $columns Array of the columns
1241
+ *
1242
+ * @return array $columns Array of sortable columns
1243
+ */
1244
+ public static function sortable_columns( $columns ) {
1245
+ $columns['popup_title'] = 'popup_title';
1246
+ $columns['opens'] = 'opens';
1247
+
1248
+ // $columns['conversions'] = 'conversions';
1249
+
1250
+ return $columns;
1251
+ }
1252
+
1253
+ /**
1254
+ * Sorts Columns in the List Table
1255
+ *
1256
+ * @param array $vars Array of all the sort variables
1257
+ *
1258
+ * @return array $vars Array of all the sort variables
1259
+ */
1260
+ public static function sort_columns( $vars ) {
1261
+ // Check if we're viewing the "popup" post type
1262
+ if ( isset( $vars['post_type'] ) && 'popup' == $vars['post_type'] ) {
1263
+ // Check if 'orderby' is set to "name"
1264
+ if ( isset( $vars['orderby'] ) ) {
1265
+ switch ( $vars['orderby'] ) {
1266
+ case 'popup_title':
1267
+ $vars = array_merge( $vars, array(
1268
+ 'meta_key' => 'popup_title',
1269
+ 'orderby' => 'meta_value',
1270
+ ) );
1271
+ break;
1272
+ case 'opens':
1273
+ if ( ! pum_extension_enabled( 'popup-analytics' ) ) {
1274
+ $vars = array_merge( $vars, array(
1275
+ 'meta_key' => 'popup_open_count',
1276
+ 'orderby' => 'meta_value_num',
1277
+ ) );
1278
+ }
1279
+ break;
1280
+ /*
1281
+ case 'conversions':
1282
+ if ( ! pum_extension_enabled( 'popup-analytics' ) ) {
1283
+ $vars = array_merge( $vars, array(
1284
+ 'meta_key' => 'popup_conversion_count',
1285
+ 'orderby' => 'meta_value_num',
1286
+ ) );
1287
+ }
1288
+ break;
1289
+ */
1290
+ }
1291
+ }
1292
+ }
1293
+
1294
+ return $vars;
1295
+ }
1296
+
1297
+ /**
1298
+ * Initialize sorting
1299
+ */
1300
+ public static function load() {
1301
+ add_filter( 'request', array( __CLASS__, 'sort_columns' ) );
1302
+ }
1303
+
1304
+ /**
1305
+ * Add Popup Filters
1306
+ *
1307
+ * Adds taxonomy drop down filters for popups.
1308
+ */
1309
+ public static function add_popup_filters() {
1310
+ global $typenow;
1311
+
1312
+ // Checks if the current post type is 'popup'
1313
+ if ( $typenow == 'popup' ) {
1314
+
1315
+ if ( get_taxonomy( 'popup_category' ) ) {
1316
+ $terms = get_terms( 'popup_category' );
1317
+ if ( count( $terms ) > 0 ) {
1318
+ echo "<select name='popup_category' id='popup_category' class='postform'>";
1319
+ echo "<option value=''>" . __( 'Show all categories', 'popup-maker' ) . "</option>";
1320
+ foreach ( $terms as $term ) {
1321
+ $selected = isset( $_GET['popup_category'] ) && $_GET['popup_category'] == $term->slug ? 'selected="selected"' : '';
1322
+ echo '<option value="' . esc_attr( $term->slug ) . '" ' . $selected . '>' . esc_html( $term->name ) . ' (' . $term->count . ')</option>';
1323
+ }
1324
+ echo "</select>";
1325
+ }
1326
+ }
1327
+
1328
+ if ( get_taxonomy( 'popup_tag' ) ) {
1329
+ $terms = get_terms( 'popup_tag' );
1330
+ if ( count( $terms ) > 0 ) {
1331
+ echo "<select name='popup_tag' id='popup_tag' class='postform'>";
1332
+ echo "<option value=''>" . __( 'Show all tags', 'popup-maker' ) . "</option>";
1333
+ foreach ( $terms as $term ) {
1334
+ $selected = isset( $_GET['popup_tag'] ) && $_GET['popup_tag'] == $term->slug ? 'selected="selected"' : '';
1335
+ echo '<option value="' . esc_attr( $term->slug ) . '" ' . $selected . '>' . esc_html( $term->name ) . ' (' . $term->count . ')</option>';
1336
+ }
1337
+ echo "</select>";
1338
+ }
1339
+ }
1340
+ }
1341
+
1342
+ }
1343
+
1344
+ /**
1345
+ * Prepends Popup ID to the action row on All Popups
1346
+ * @param array $actions The row actions.
1347
+ * @param $post The post
1348
+ *
1349
+ * @return array The new actions.
1350
+ */
1351
+ public static function add_id_row_actions( $actions, $post ) {
1352
+ // Only adjust if we are dealing with our popups.
1353
+ if ( 'popup' === $post->post_type ) {
1354
+ return array_merge( array( 'id' => 'ID: ' . $post->ID ), $actions );
1355
+ }
1356
+
1357
+ return $actions;
1358
+ }
1359
+
1360
+ }
1361
+
classes/Telemetry.php CHANGED
@@ -1,360 +1,360 @@
1
- <?php
2
- /*******************************************************************************
3
- * Copyright (c) 2019, Code Atlantic LLC
4
- ******************************************************************************/
5
-
6
- if ( ! defined( 'ABSPATH' ) ) {
7
- // Exit if accessed directly
8
- exit;
9
- }
10
-
11
- /**
12
- * Our telemetry class.
13
- *
14
- * Handles sending usage data back to our servers for those who have opted into our telemetry.
15
- *
16
- * @since 1.11.0
17
- */
18
- class PUM_Telemetry {
19
-
20
- public static function init() {
21
- add_action( 'pum_daily_scheduled_events', array( __CLASS__, 'track_check' ) );
22
- if ( is_admin() && current_user_can( 'manage_options' ) ) {
23
- add_filter( 'pum_alert_list', array( __CLASS__, 'optin_alert' ) );
24
- add_action( 'pum_alert_dismissed', array( __CLASS__, 'optin_alert_check' ), 10, 2 );
25
- }
26
- }
27
-
28
- /**
29
- * Prepares and sends data, if it is time to do so
30
- * @since 1.11.0
31
- */
32
- public static function track_check() {
33
- if ( self::is_time_to_send() ) {
34
- $data = self::setup_data();
35
- self::send_data( $data );
36
- set_transient( 'pum_tracking_last_send', true, 6 * DAY_IN_SECONDS );
37
- }
38
- }
39
-
40
- /**
41
- * Prepares telemetry data to be sent
42
- * @return array
43
- * @since 1.11.0
44
- */
45
- public static function setup_data() {
46
- global $wpdb;
47
-
48
- // Retrieve current theme info
49
- $theme_data = wp_get_theme();
50
- $theme = $theme_data->Name . ' ' . $theme_data->Version;
51
-
52
- // Retrieve current plugin information
53
- if ( ! function_exists( 'get_plugins' ) ) {
54
- include ABSPATH . '/wp-admin/includes/plugin.php';
55
- }
56
-
57
- $plugins = array_keys( get_plugins() );
58
- $active_plugins = get_option( 'active_plugins', array() );
59
-
60
- foreach ( $plugins as $key => $plugin ) {
61
- if ( in_array( $plugin, $active_plugins ) ) {
62
- // Remove active plugins from list so we can show active and inactive separately
63
- unset( $plugins[ $key ] );
64
- }
65
- }
66
-
67
- $popups = 0;
68
- foreach ( wp_count_posts( 'popup' ) as $status ) {
69
- $popups += $status;
70
- }
71
-
72
- $popup_themes = 0;
73
- foreach ( wp_count_posts( 'popup_theme' ) as $status ) {
74
- $popup_themes += $status;
75
- }
76
-
77
- // Aggregates important settings across all popups.
78
- $all_popups = pum_get_all_popups();
79
- $triggers = array();
80
- $cookies = array();
81
- $conditions = array();
82
- $location = array();
83
- $sizes = array();
84
- $sounds = array();
85
-
86
- // Cycle through each popup
87
- foreach ( $all_popups as $popup ) {
88
- $settings = $popup->get_settings();
89
-
90
- // Cycle through each trigger to count the number of unique triggers.
91
- foreach ( $settings['triggers'] as $trigger ) {
92
- if ( isset( $triggers[ $trigger['type'] ] ) ) {
93
- $triggers[ $trigger['type'] ] += 1;
94
- } else {
95
- $triggers[ $trigger['type'] ] = 1;
96
- }
97
- }
98
-
99
- // Cycle through each cookie to count the number of unique cookie.
100
- foreach ( $settings['cookies'] as $cookie ) {
101
- if ( isset( $cookies[ $cookie['event'] ] ) ) {
102
- $cookies[ $cookie['event'] ] += 1;
103
- } else {
104
- $cookies[ $cookie['event'] ] = 1;
105
- }
106
- }
107
-
108
- // Cycle through each condition to count the number of unique condition.
109
- foreach ( $settings['conditions'] as $condition ) {
110
- foreach ( $condition as $target ) {
111
- if ( isset( $conditions[ $target['target'] ] ) ) {
112
- $conditions[ $target['target'] ] += 1;
113
- } else {
114
- $conditions[ $target['target'] ] = 1;
115
- }
116
- }
117
- }
118
-
119
- // Add locations setting.
120
- if ( isset( $location[ $settings['location'] ] ) ) {
121
- $location[ $settings['location'] ] += 1;
122
- } else {
123
- $location[ $settings['location'] ] = 1;
124
- }
125
-
126
- // Add size setting.
127
- if ( isset( $sizes[ $settings['size'] ] ) ) {
128
- $sizes[ $settings['size'] ] += 1;
129
- } else {
130
- $sizes[ $settings['size'] ] = 1;
131
- }
132
-
133
- // Add opening sound setting.
134
- if ( isset( $sounds[ $settings['open_sound'] ] ) ) {
135
- $sounds[ $settings['open_sound'] ] += 1;
136
- } else {
137
- $sounds[ $settings['open_sound'] ] = 1;
138
- }
139
- }
140
-
141
- $args = array(
142
- // UID
143
- 'uid' => self::get_uuid(),
144
-
145
- // Language Info
146
- 'language' => get_bloginfo( 'language' ), // Language
147
- 'charset' => get_bloginfo( 'charset' ), // Character Set
148
-
149
- // Server Info
150
- 'php_version' => phpversion(),
151
- 'mysql_version' => $wpdb->db_version(),
152
- 'is_localhost' => self::is_localhost(),
153
-
154
- // WP Install Info
155
- 'url' => get_site_url(),
156
- 'version' => Popup_Maker::$VER, // Plugin Version
157
- 'wp_version' => get_bloginfo( 'version' ), // WP Version
158
- 'theme' => $theme,
159
- 'active_plugins' => $active_plugins,
160
- 'inactive_plugins' => array_values( $plugins ),
161
-
162
- // Popup Metrics
163
- 'popups' => $popups,
164
- 'popup_themes' => $popup_themes,
165
- 'open_count' => get_option( 'pum_total_open_count', 0 ),
166
-
167
- // Popup Maker Settings
168
- 'block_editor_enabled' => pum_get_option( 'gutenberg_support_enabled' ),
169
- 'bypass_ad_blockers' => pum_get_option( 'bypass_adblockers' ),
170
- 'disable_taxonimies' => pum_get_option( 'disable_popup_category_tag' ),
171
- 'disable_asset_cache' => pum_get_option( 'disable_asset_caching' ),
172
- 'disable_open_tracking' => pum_get_option( 'disable_popup_open_tracking' ),
173
- 'default_email_provider' => pum_get_option( 'newsletter_default_provider', 'none' ),
174
-
175
- // Aggregate Popup Settings
176
- 'triggers' => $triggers,
177
- 'cookies' => $cookies,
178
- 'conditions' => $conditions,
179
- 'locations' => $location,
180
- 'sizes' => $sizes,
181
- 'sounds' => $sounds,
182
- );
183
-
184
- return $args;
185
- }
186
-
187
- /**
188
- * Sends check_in data
189
- *
190
- * @param array $data Telemetry data to send.
191
- * @since 1.11.0
192
- */
193
- public static function send_data( $data = array() ) {
194
- self::api_call( 'check_in', $data );
195
- }
196
-
197
- /**
198
- * Makes HTTP request to our API endpoint
199
- *
200
- * @param string $action The specific endpoint in our API.
201
- * @param array $data Any data to send in the body.
202
- * @return array|bool False if WP Error. Otherwise, array response from wp_remote_post.
203
- * @since 1.11.0
204
- */
205
- public static function api_call( $action = '', $data = array() ) {
206
- $response = wp_remote_post( 'https://api.wppopupmaker.com/wp-json/pmapi/v2/' . $action, array(
207
- 'method' => 'POST',
208
- 'timeout' => 20,
209
- 'redirection' => 5,
210
- 'httpversion' => '1.1',
211
- 'blocking' => false,
212
- 'body' => $data,
213
- 'user-agent' => 'POPMAKE/' . Popup_Maker::$VER . '; ' . get_site_url(),
214
- ));
215
-
216
- if ( is_wp_error( $response ) ) {
217
- $error_message = $response->get_error_message();
218
- PUM_Utils_Logging::instance()->log( sprintf( 'Cannot send telemetry data. Error received was: %s', esc_html( $error_message ) ) );
219
- return false;
220
- }
221
-
222
- return $response;
223
- }
224
-
225
- /**
226
- * Adds admin notice if we haven't asked before.
227
- *
228
- * @param array $alerts The alerts currently in the alert system.
229
- * @return array Alerts for the alert system.
230
- * @since 1.11.0
231
- */
232
- public static function optin_alert( $alerts ) {
233
- if ( ! self::should_show_alert() ) {
234
- return $alerts;
235
- }
236
-
237
- $alerts[] = array(
238
- 'code' => 'pum_telemetry_notice',
239
- 'type' => 'info',
240
- 'message' => esc_html__( "Allow Popup Maker to track this plugin's usage and help us make this plugin better? No user data is sent to our servers. No sensitive data is tracked.", 'popup-maker' ),
241
- 'priority' => 10,
242
- 'dismissible' => true,
243
- 'global' => false,
244
- 'actions' => array(
245
- array(
246
- 'primary' => true,
247
- 'type' => 'action',
248
- 'action' => 'pum_optin_check_allow',
249
- 'text' => __( 'Allow', 'popup-maker' ),
250
- ),
251
- array(
252
- 'primary' => false,
253
- 'type' => 'action',
254
- 'action' => 'dismiss',
255
- 'text' => __( 'Do not allow', 'popup-maker' ),
256
- ),
257
- array(
258
- 'primary' => false,
259
- 'type' => 'link',
260
- 'action' => '',
261
- 'href' => 'https://docs.wppopupmaker.com/article/528-the-data-the-popup-maker-plugin-collects',
262
- 'text' => __( 'Learn more', 'popup-maker' ),
263
- ),
264
- ),
265
- );
266
- return $alerts;
267
- }
268
-
269
- /**
270
- * Checks if any options have been clicked from admin notices.
271
- *
272
- * @param string $code
273
- * @param string $action
274
- *
275
- * @since 1.11.0
276
- */
277
- public static function optin_alert_check( $code, $action ) {
278
- if ( 'pum_telemetry_notice' === $code ) {
279
- if ( 'pum_optin_check_allow' === $action ) {
280
- pum_update_option( 'telemetry', true );
281
- }
282
- }
283
- }
284
-
285
- /**
286
- * Whether or not we should show optin alert
287
- *
288
- * @since 1.11.0
289
- * @return bool True if alert should be shown
290
- */
291
- public static function should_show_alert() {
292
- return false === self::has_opted_in() && current_user_can( 'manage_options' );
293
- }
294
-
295
- /**
296
- * Determines if it is time to send telemetry data.
297
- * @return bool True if it is time.
298
- * @since 1.11.0
299
- */
300
- public static function is_time_to_send() {
301
-
302
- // Only send if admin has opted in.
303
- if ( ! self::has_opted_in() ) {
304
- return false;
305
- }
306
-
307
- // Send a maximum of once per week.
308
- if ( get_transient( 'pum_tracking_last_send' ) ) {
309
- return false;
310
- }
311
- return true;
312
- }
313
-
314
- /**
315
- * Wrapper to check if site has opted into telemetry
316
- *
317
- * @return bool True if has opted into telemetry
318
- * @since 1.11.0
319
- */
320
- public static function has_opted_in() {
321
- return false !== pum_get_option( 'telemetry', false );
322
- }
323
-
324
- /**
325
- * Determines if the site is in a local environment
326
- * @return bool True for local
327
- * @since 1.11.0
328
- */
329
- public static function is_localhost() {
330
- $url = network_site_url( '/' );
331
- return stristr( $url, 'dev' ) !== false || stristr( $url, 'localhost' ) !== false || stristr( $url, ':8888' ) !== false;
332
-
333
- }
334
-
335
- /**
336
- * Generates a new UUID for this site.
337
- *
338
- * @return string
339
- * @since 1.11.0
340
- */
341
- public static function add_uuid() {
342
- $uuid = wp_generate_uuid4();
343
- update_option( 'pum_site_uuid', $uuid );
344
- return $uuid;
345
- }
346
-
347
- /**
348
- * Retrieves the site UUID
349
- *
350
- * @return string
351
- * @since 1.11.0
352
- */
353
- public static function get_uuid() {
354
- $uuid = get_option( 'pum_site_uuid', false );
355
- if ( false === $uuid || ! wp_is_uuid( $uuid ) ) {
356
- $uuid = self::add_uuid();
357
- }
358
- return $uuid;
359
- }
360
- }
1
+ <?php
2
+ /*******************************************************************************
3
+ * Copyright (c) 2019, Code Atlantic LLC
4
+ ******************************************************************************/
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) {
7
+ // Exit if accessed directly
8
+ exit;
9
+ }
10
+
11
+ /**
12
+ * Our telemetry class.
13
+ *
14
+ * Handles sending usage data back to our servers for those who have opted into our telemetry.
15
+ *
16
+ * @since 1.11.0
17
+ */
18
+ class PUM_Telemetry {
19
+
20
+ public static function init() {
21
+ add_action( 'pum_daily_scheduled_events', array( __CLASS__, 'track_check' ) );
22
+ if ( is_admin() && current_user_can( 'manage_options' ) ) {
23
+ add_filter( 'pum_alert_list', array( __CLASS__, 'optin_alert' ) );
24
+ add_action( 'pum_alert_dismissed', array( __CLASS__, 'optin_alert_check' ), 10, 2 );
25
+ }
26
+ }
27
+
28
+ /**
29
+ * Prepares and sends data, if it is time to do so
30
+ * @since 1.11.0
31
+ */
32
+ public static function track_check() {
33
+ if ( self::is_time_to_send() ) {
34
+ $data = self::setup_data();
35
+ self::send_data( $data );
36
+ set_transient( 'pum_tracking_last_send', true, 6 * DAY_IN_SECONDS );
37
+ }
38
+ }
39
+
40
+ /**
41
+ * Prepares telemetry data to be sent
42
+ * @return array
43
+ * @since 1.11.0
44
+ */
45
+ public static function setup_data() {
46
+ global $wpdb;
47
+
48
+ // Retrieve current theme info
49
+ $theme_data = wp_get_theme();
50
+ $theme = $theme_data->Name . ' ' . $theme_data->Version;
51
+
52
+ // Retrieve current plugin information
53
+ if ( ! function_exists( 'get_plugins' ) ) {
54
+ include ABSPATH . '/wp-admin/includes/plugin.php';
55
+ }
56
+
57
+ $plugins = array_keys( get_plugins() );
58
+ $active_plugins = get_option( 'active_plugins', array() );
59
+
60
+ foreach ( $plugins as $key => $plugin ) {
61
+ if ( in_array( $plugin, $active_plugins ) ) {
62
+ // Remove active plugins from list so we can show active and inactive separately
63
+ unset( $plugins[ $key ] );
64
+ }
65
+ }
66
+
67
+ $popups = 0;
68
+ foreach ( wp_count_posts( 'popup' ) as $status ) {
69
+ $popups += $status;
70
+ }
71
+
72
+ $popup_themes = 0;
73
+ foreach ( wp_count_posts( 'popup_theme' ) as $status ) {
74
+ $popup_themes += $status;
75
+ }
76
+
77
+ // Aggregates important settings across all popups.
78
+ $all_popups = pum_get_all_popups();
79
+ $triggers = array();
80
+ $cookies = array();
81
+ $conditions = array();
82
+ $location = array();
83
+ $sizes = array();
84
+ $sounds = array();
85
+
86
+ // Cycle through each popup
87
+ foreach ( $all_popups as $popup ) {
88
+ $settings = $popup->get_settings();
89
+
90
+ // Cycle through each trigger to count the number of unique triggers.
91
+ foreach ( $settings['triggers'] as $trigger ) {
92
+ if ( isset( $triggers[ $trigger['type'] ] ) ) {
93
+ $triggers[ $trigger['type'] ] += 1;
94
+ } else {
95
+ $triggers[ $trigger['type'] ] = 1;
96
+ }
97
+ }
98
+
99
+ // Cycle through each cookie to count the number of unique cookie.
100
+ foreach ( $settings['cookies'] as $cookie ) {
101
+ if ( isset( $cookies[ $cookie['event'] ] ) ) {
102
+ $cookies[ $cookie['event'] ] += 1;
103
+ } else {
104
+ $cookies[ $cookie['event'] ] = 1;
105
+ }
106
+ }
107
+
108
+ // Cycle through each condition to count the number of unique condition.
109
+ foreach ( $settings['conditions'] as $condition ) {
110
+ foreach ( $condition as $target ) {
111
+ if ( isset( $conditions[ $target['target'] ] ) ) {
112
+ $conditions[ $target['target'] ] += 1;
113
+ } else {
114
+ $conditions[ $target['target'] ] = 1;
115
+ }
116
+ }
117
+ }
118
+
119
+ // Add locations setting.
120
+ if ( isset( $location[ $settings['location'] ] ) ) {
121
+ $location[ $settings['location'] ] += 1;
122
+ } else {
123
+ $location[ $settings['location'] ] = 1;
124
+ }
125
+
126
+ // Add size setting.
127
+ if ( isset( $sizes[ $settings['size'] ] ) ) {
128
+ $sizes[ $settings['size'] ] += 1;
129
+ } else {
130
+ $sizes[ $settings['size'] ] = 1;
131
+ }
132
+
133
+ // Add opening sound setting.
134
+ if ( isset( $sounds[ $settings['open_sound'] ] ) ) {
135
+ $sounds[ $settings['open_sound'] ] += 1;
136
+ } else {
137
+ $sounds[ $settings['open_sound'] ] = 1;
138
+ }
139
+ }
140
+
141
+ $args = array(
142
+ // UID
143
+ 'uid' => self::get_uuid(),
144
+
145
+ // Language Info
146
+ 'language' => get_bloginfo( 'language' ), // Language
147
+ 'charset' => get_bloginfo( 'charset' ), // Character Set
148
+
149
+ // Server Info
150
+ 'php_version' => phpversion(),
151
+ 'mysql_version' => $wpdb->db_version(),
152
+ 'is_localhost' => self::is_localhost(),
153
+
154
+ // WP Install Info
155
+ 'url' => get_site_url(),
156
+ 'version' => Popup_Maker::$VER, // Plugin Version
157
+ 'wp_version' => get_bloginfo( 'version' ), // WP Version
158
+ 'theme' => $theme,
159
+ 'active_plugins' => $active_plugins,
160
+ 'inactive_plugins' => array_values( $plugins ),
161
+
162
+ // Popup Metrics
163
+ 'popups' => $popups,
164
+ 'popup_themes' => $popup_themes,
165
+ 'open_count' => get_option( 'pum_total_open_count', 0 ),
166
+
167
+ // Popup Maker Settings
168
+ 'block_editor_enabled' => pum_get_option( 'gutenberg_support_enabled' ),
169
+ 'bypass_ad_blockers' => pum_get_option( 'bypass_adblockers' ),
170
+ 'disable_taxonimies' => pum_get_option( 'disable_popup_category_tag' ),
171
+ 'disable_asset_cache' => pum_get_option( 'disable_asset_caching' ),
172
+ 'disable_open_tracking' => pum_get_option( 'disable_popup_open_tracking' ),
173
+ 'default_email_provider' => pum_get_option( 'newsletter_default_provider', 'none' ),
174
+
175
+ // Aggregate Popup Settings
176
+ 'triggers' => $triggers,
177
+ 'cookies' => $cookies,
178
+ 'conditions' => $conditions,
179
+ 'locations' => $location,
180
+ 'sizes' => $sizes,
181
+ 'sounds' => $sounds,
182
+ );
183
+
184
+ return $args;
185
+ }
186
+
187
+ /**
188
+ * Sends check_in data
189
+ *
190
+ * @param array $data Telemetry data to send.
191
+ * @since 1.11.0
192
+ */
193
+ public static function send_data( $data = array() ) {
194
+ self::api_call( 'check_in', $data );
195
+ }
196
+
197
+ /**
198
+ * Makes HTTP request to our API endpoint
199
+ *
200
+ * @param string $action The specific endpoint in our API.
201
+ * @param array $data Any data to send in the body.
202
+ * @return array|bool False if WP Error. Otherwise, array response from wp_remote_post.
203
+ * @since 1.11.0
204
+ */
205
+ public static function api_call( $action = '', $data = array() ) {
206
+ $response = wp_remote_post( 'https://api.wppopupmaker.com/wp-json/pmapi/v2/' . $action, array(
207
+ 'method' => 'POST',
208
+ 'timeout' => 20,
209
+ 'redirection' => 5,
210
+ 'httpversion' => '1.1',
211
+ 'blocking' => false,
212
+ 'body' => $data,
213
+ 'user-agent' => 'POPMAKE/' . Popup_Maker::$VER . '; ' . get_site_url(),
214
+ ));
215
+
216
+ if ( is_wp_error( $response ) ) {
217
+ $error_message = $response->get_error_message();
218
+ PUM_Utils_Logging::instance()->log( sprintf( 'Cannot send telemetry data. Error received was: %s', esc_html( $error_message ) ) );
219
+ return false;
220
+ }
221
+
222
+ return $response;
223
+ }
224
+
225
+ /**
226
+ * Adds admin notice if we haven't asked before.
227
+ *
228
+ * @param array $alerts The alerts currently in the alert system.
229
+ * @return array Alerts for the alert system.
230
+ * @since 1.11.0
231
+ */
232
+ public static function optin_alert( $alerts ) {
233
+ if ( ! self::should_show_alert() ) {
234
+ return $alerts;
235
+ }
236
+
237
+ $alerts[] = array(
238
+ 'code' => 'pum_telemetry_notice',
239
+ 'type' => 'info',
240
+ 'message' => esc_html__( "Allow Popup Maker to track this plugin's usage and help us make this plugin better? No user data is sent to our servers. No sensitive data is tracked.", 'popup-maker' ),
241
+ 'priority' => 10,
242
+ 'dismissible' => true,
243
+ 'global' => false,
244
+ 'actions' => array(
245
+ array(
246
+ 'primary' => true,
247
+ 'type' => 'action',
248
+ 'action' => 'pum_optin_check_allow',
249
+ 'text' => __( 'Allow', 'popup-maker' ),
250
+ ),
251
+ array(
252
+ 'primary' => false,
253
+ 'type' => 'action',
254
+ 'action' => 'dismiss',
255
+ 'text' => __( 'Do not allow', 'popup-maker' ),
256
+ ),
257
+ array(
258
+ 'primary' => false,
259
+ 'type' => 'link',
260
+ 'action' => '',
261
+ 'href' => 'https://docs.wppopupmaker.com/article/528-the-data-the-popup-maker-plugin-collects',
262
+ 'text' => __( 'Learn more', 'popup-maker' ),
263
+ ),
264
+ ),
265
+ );
266
+ return $alerts;
267
+ }
268
+
269
+ /**
270
+ * Checks if any options have been clicked from admin notices.
271
+ *
272
+ * @param string $code
273
+ * @param string $action
274
+ *
275
+ * @since 1.11.0
276
+ */
277
+ public static function optin_alert_check( $code, $action ) {
278
+ if ( 'pum_telemetry_notice' === $code ) {
279
+ if ( 'pum_optin_check_allow' === $action ) {
280
+ pum_update_option( 'telemetry', true );
281
+ }
282
+ }
283
+ }
284
+
285
+ /**
286
+ * Whether or not we should show optin alert
287
+ *
288
+ * @since 1.11.0
289
+ * @return bool True if alert should be shown
290
+ */
291
+ public static function should_show_alert() {
292
+ return false === self::has_opted_in() && current_user_can( 'manage_options' );
293
+ }
294
+
295
+ /**
296
+ * Determines if it is time to send telemetry data.
297
+ * @return bool True if it is time.
298
+ * @since 1.11.0
299
+ */
300
+ public static function is_time_to_send() {
301
+
302
+ // Only send if admin has opted in.
303
+ if ( ! self::has_opted_in() ) {
304
+ return false;
305
+ }
306
+
307
+ // Send a maximum of once per week.
308
+ if ( get_transient( 'pum_tracking_last_send' ) ) {
309
+ return false;
310
+ }
311
+ return true;
312
+ }
313
+
314
+ /**
315
+ * Wrapper to check if site has opted into telemetry
316
+ *
317
+ * @return bool True if has opted into telemetry
318
+ * @since 1.11.0
319
+ */
320
+ public static function has_opted_in() {
321
+ return false !== pum_get_option( 'telemetry', false );
322
+ }
323
+
324
+ /**
325
+ * Determines if the site is in a local environment
326
+ * @return bool True for local
327
+ * @since 1.11.0
328
+ */
329
+ public static function is_localhost() {
330
+ $url = network_site_url( '/' );
331
+ return stristr( $url, 'dev' ) !== false || stristr( $url, 'localhost' ) !== false || stristr( $url, ':8888' ) !== false;
332
+
333
+ }
334
+
335
+ /**
336
+ * Generates a new UUID for this site.
337
+ *
338
+ * @return string
339
+ * @since 1.11.0
340
+ */
341
+ public static function add_uuid() {
342
+ $uuid = wp_generate_uuid4();
343
+ update_option( 'pum_site_uuid', $uuid );
344
+ return $uuid;
345
+ }
346
+
347
+ /**
348
+ * Retrieves the site UUID
349
+ *
350
+ * @return string
351
+ * @since 1.11.0
352
+ */
353
+ public static function get_uuid() {
354
+ $uuid = get_option( 'pum_site_uuid', false );
355
+ if ( false === $uuid || ! wp_is_uuid( $uuid ) ) {
356
+ $uuid = self::add_uuid();
357
+ }
358
+ return $uuid;
359
+ }
360
+ }
includes/pum-install-functions.php CHANGED
@@ -1,109 +1,109 @@
1
- <?php
2
- /**
3
- * Install Functions
4
- *
5
- * @package PUM
6
- * @subpackage Functions/Install
7
- * @copyright Copyright (c) 2019, Code Atlantic LLC
8
- * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
- * @since 1.4
10
- */
11
-
12
- // Exit if accessed directly
13
- if ( ! defined( 'ABSPATH' ) ) {
14
- exit;
15
- }
16
-
17
- /**
18
- * Enqueues our install theme function on wp_loaded if Popup Maker core was updated.
19
- *
20
- * @since 1.11.0
21
- */
22
- function pum_install_new_themes_on_update() {
23
- add_action( 'wp_loaded', 'pum_install_built_in_themes' );
24
- }
25
-
26
- add_action( 'pum_update_core_version', 'pum_install_new_themes_on_update' );
27
-
28
-
29
- /**
30
- * @param bool $network_wide
31
- */
32
- function pum_install_built_in_themes( $network_wide = false ) {
33
-
34
- $installed_themes = get_option( '_pum_installed_themes', array() );
35
-
36
- $built_in_themes = array(
37
- 'lightbox' => array(
38
- 'post_title' => __( 'Light Box', 'popup-maker' ),
39
- 'meta_input' => array(
40
- 'popup_theme_settings' => 'a:67:{s:24:"overlay_background_color";s:7:"#000000";s:26:"overlay_background_opacity";s:2:"60";s:17:"container_padding";s:2:"18";s:26:"container_background_color";s:7:"#ffffff";s:28:"container_background_opacity";s:3:"100";s:22:"container_border_style";s:5:"solid";s:22:"container_border_color";s:7:"#000000";s:22:"container_border_width";s:1:"8";s:23:"container_border_radius";s:1:"3";s:25:"container_boxshadow_inset";s:2:"no";s:30:"container_boxshadow_horizontal";s:1:"0";s:28:"container_boxshadow_vertical";s:1:"0";s:24:"container_boxshadow_blur";s:2:"30";s:26:"container_boxshadow_spread";s:1:"0";s:25:"container_boxshadow_color";s:7:"#020202";s:27:"container_boxshadow_opacity";s:3:"100";s:16:"title_font_color";s:7:"#000000";s:17:"title_line_height";s:2:"36";s:15:"title_font_size";s:2:"32";s:17:"title_font_family";s:7:"inherit";s:17:"title_font_weight";s:3:"100";s:16:"title_font_style";s:0:"";s:16:"title_text_align";s:4:"left";s:27:"title_textshadow_horizontal";s:1:"0";s:25:"title_textshadow_vertical";s:1:"0";s:21:"title_textshadow_blur";s:1:"0";s:22:"title_textshadow_color";s:7:"#020202";s:24:"title_textshadow_opacity";s:2:"23";s:18:"content_font_color";s:7:"#000000";s:19:"content_font_family";s:7:"inherit";s:19:"content_font_weight";s:3:"100";s:18:"content_font_style";s:0:"";s:10:"close_text";s:7:"&times;";s:14:"close_location";s:8:"topright";s:18:"close_position_top";s:3:"-13";s:19:"close_position_left";s:1:"0";s:21:"close_position_bottom";s:1:"0";s:20:"close_position_right";s:3:"-13";s:13:"close_padding";s:1:"0";s:12:"close_height";s:2:"26";s:11:"close_width";s:2:"26";s:22:"close_background_color";s:7:"#000000";s:24:"close_background_opacity";s:3:"100";s:16:"close_font_color";s:7:"#ffffff";s:17:"close_line_height";s:2:"24";s:15:"close_font_size";s:2:"24";s:17:"close_font_family";s:5:"Arial";s:17:"close_font_weight";s:3:"100";s:16:"close_font_style";s:0:"";s:18:"close_border_style";s:5:"solid";s:18:"close_border_color";s:7:"#ffffff";s:18:"close_border_width";s:1:"2";s:19:"close_border_radius";s:2:"26";s:21:"close_boxshadow_inset";s:2:"no";s:26:"close_boxshadow_horizontal";s:1:"0";s:24:"close_boxshadow_vertical";s:1:"0";s:20:"close_boxshadow_blur";s:2:"15";s:22:"close_boxshadow_spread";s:1:"1";s:21:"close_boxshadow_color";s:7:"#020202";s:23:"close_boxshadow_opacity";s:2:"75";s:27:"close_textshadow_horizontal";s:1:"0";s:25:"close_textshadow_vertical";s:1:"0";s:21:"close_textshadow_blur";s:1:"0";s:22:"close_textshadow_color";s:7:"#000000";s:24:"close_textshadow_opacity";s:2:"23";s:13:"atc_promotion";N;s:22:"close_position_outside";i:0;}',
41
- 'popup_theme_data_version' => 3,
42
- ),
43
- ),
44
- 'enterprise-blue' => array(
45
- 'post_title' => __( 'Enterprise Blue', 'popup-maker' ),
46
- 'meta_input' => array(
47
- 'popup_theme_settings' => 'a:67:{s:24:"overlay_background_color";s:7:"#000000";s:26:"overlay_background_opacity";s:2:"70";s:17:"container_padding";s:2:"28";s:26:"container_background_color";s:7:"#ffffff";s:28:"container_background_opacity";s:3:"100";s:22:"container_border_style";s:4:"none";s:22:"container_border_color";s:7:"#000000";s:22:"container_border_width";s:1:"1";s:23:"container_border_radius";s:1:"5";s:25:"container_boxshadow_inset";s:2:"no";s:30:"container_boxshadow_horizontal";s:1:"0";s:28:"container_boxshadow_vertical";s:2:"10";s:24:"container_boxshadow_blur";s:2:"25";s:26:"container_boxshadow_spread";s:1:"4";s:25:"container_boxshadow_color";s:7:"#020202";s:27:"container_boxshadow_opacity";s:2:"50";s:16:"title_font_color";s:7:"#315b7c";s:17:"title_line_height";s:2:"36";s:15:"title_font_size";s:2:"34";s:17:"title_font_family";s:7:"inherit";s:17:"title_font_weight";s:3:"100";s:16:"title_font_style";s:0:"";s:16:"title_text_align";s:4:"left";s:27:"title_textshadow_horizontal";s:1:"0";s:25:"title_textshadow_vertical";s:1:"0";s:21:"title_textshadow_blur";s:1:"0";s:22:"title_textshadow_color";s:7:"#020202";s:24:"title_textshadow_opacity";s:2:"23";s:18:"content_font_color";s:7:"#2d2d2d";s:19:"content_font_family";s:7:"inherit";s:19:"content_font_weight";s:3:"100";s:18:"content_font_style";s:0:"";s:10:"close_text";s:2:"×";s:14:"close_location";s:8:"topright";s:18:"close_position_top";s:1:"8";s:19:"close_position_left";s:1:"0";s:21:"close_position_bottom";s:1:"0";s:20:"close_position_right";s:1:"8";s:13:"close_padding";s:1:"4";s:12:"close_height";s:2:"28";s:11:"close_width";s:2:"28";s:22:"close_background_color";s:7:"#315b7c";s:24:"close_background_opacity";s:3:"100";s:16:"close_font_color";s:7:"#ffffff";s:17:"close_line_height";s:2:"20";s:15:"close_font_size";s:2:"20";s:17:"close_font_family";s:15:"Times New Roman";s:17:"close_font_weight";s:3:"100";s:16:"close_font_style";s:0:"";s:18:"close_border_style";s:4:"none";s:18:"close_border_color";s:7:"#ffffff";s:18:"close_border_width";s:1:"1";s:19:"close_border_radius";s:2:"42";s:21:"close_boxshadow_inset";s:2:"no";s:26:"close_boxshadow_horizontal";s:1:"0";s:24:"close_boxshadow_vertical";s:1:"0";s:20:"close_boxshadow_blur";s:1:"0";s:22:"close_boxshadow_spread";s:1:"0";s:21:"close_boxshadow_color";s:7:"#020202";s:23:"close_boxshadow_opacity";s:2:"23";s:27:"close_textshadow_horizontal";s:1:"0";s:25:"close_textshadow_vertical";s:1:"0";s:21:"close_textshadow_blur";s:1:"0";s:22:"close_textshadow_color";s:7:"#000000";s:24:"close_textshadow_opacity";s:2:"23";s:13:"atc_promotion";N;s:22:"close_position_outside";i:0;}',
48
- 'popup_theme_data_version' => 3,
49
- ),
50
- ),
51
- 'hello-box' => array(
52
- 'post_title' => __( 'Hello Box', 'popup-maker' ),
53
- 'meta_input' => array(
54
- 'popup_theme_settings' => 'a:67:{s:24:"overlay_background_color";s:7:"#000000";s:26:"overlay_background_opacity";s:2:"75";s:17:"container_padding";s:2:"30";s:26:"container_background_color";s:7:"#ffffff";s:28:"container_background_opacity";s:3:"100";s:22:"container_border_style";s:5:"solid";s:22:"container_border_color";s:7:"#81d742";s:22:"container_border_width";s:2:"14";s:23:"container_border_radius";s:2:"80";s:25:"container_boxshadow_inset";s:2:"no";s:30:"container_boxshadow_horizontal";s:1:"0";s:28:"container_boxshadow_vertical";s:1:"0";s:24:"container_boxshadow_blur";s:1:"0";s:26:"container_boxshadow_spread";s:1:"0";s:25:"container_boxshadow_color";s:7:"#020202";s:27:"container_boxshadow_opacity";s:1:"0";s:16:"title_font_color";s:7:"#2d2d2d";s:17:"title_line_height";s:2:"36";s:15:"title_font_size";s:2:"32";s:17:"title_font_family";s:10:"Montserrat";s:17:"title_font_weight";s:3:"100";s:16:"title_font_style";s:0:"";s:16:"title_text_align";s:4:"left";s:27:"title_textshadow_horizontal";s:1:"0";s:25:"title_textshadow_vertical";s:1:"0";s:21:"title_textshadow_blur";s:1:"0";s:22:"title_textshadow_color";s:7:"#020202";s:24:"title_textshadow_opacity";s:2:"23";s:18:"content_font_color";s:7:"#2d2d2d";s:19:"content_font_family";s:7:"inherit";s:19:"content_font_weight";s:3:"100";s:18:"content_font_style";s:0:"";s:10:"close_text";s:2:"×";s:14:"close_location";s:8:"topright";s:18:"close_position_top";s:3:"-30";s:19:"close_position_left";s:3:"-30";s:21:"close_position_bottom";s:1:"0";s:20:"close_position_right";s:3:"-30";s:13:"close_padding";s:1:"0";s:12:"close_height";s:1:"0";s:11:"close_width";s:1:"0";s:22:"close_background_color";s:7:"#ffffff";s:24:"close_background_opacity";s:3:"100";s:16:"close_font_color";s:7:"#2d2d2d";s:17:"close_line_height";s:2:"28";s:15:"close_font_size";s:2:"32";s:17:"close_font_family";s:15:"Times New Roman";s:17:"close_font_weight";s:3:"100";s:16:"close_font_style";s:0:"";s:18:"close_border_style";s:4:"none";s:18:"close_border_color";s:7:"#ffffff";s:18:"close_border_width";s:1:"1";s:19:"close_border_radius";s:2:"28";s:21:"close_boxshadow_inset";s:2:"no";s:26:"close_boxshadow_horizontal";s:1:"0";s:24:"close_boxshadow_vertical";s:1:"0";s:20:"close_boxshadow_blur";s:1:"0";s:22:"close_boxshadow_spread";s:1:"0";s:21:"close_boxshadow_color";s:7:"#020202";s:23:"close_boxshadow_opacity";s:2:"23";s:27:"close_textshadow_horizontal";s:1:"0";s:25:"close_textshadow_vertical";s:1:"0";s:21:"close_textshadow_blur";s:1:"0";s:22:"close_textshadow_color";s:7:"#000000";s:24:"close_textshadow_opacity";s:2:"23";s:13:"atc_promotion";N;s:22:"close_position_outside";i:0;}',
55
- 'popup_theme_data_version' => 3,
56
- ),
57
- ),
58
- 'cutting-edge' => array(
59
- 'post_title' => __( 'Cutting Edge', 'popup-maker' ),
60
- 'meta_input' => array(
61
- 'popup_theme_settings' => 'a:67:{s:24:"overlay_background_color";s:7:"#000000";s:26:"overlay_background_opacity";s:2:"50";s:17:"container_padding";s:2:"18";s:26:"container_background_color";s:7:"#1e73be";s:28:"container_background_opacity";s:3:"100";s:22:"container_border_style";s:4:"none";s:22:"container_border_color";s:7:"#000000";s:22:"container_border_width";s:1:"1";s:23:"container_border_radius";s:1:"0";s:25:"container_boxshadow_inset";s:2:"no";s:30:"container_boxshadow_horizontal";s:1:"0";s:28:"container_boxshadow_vertical";s:2:"10";s:24:"container_boxshadow_blur";s:2:"25";s:26:"container_boxshadow_spread";s:1:"0";s:25:"container_boxshadow_color";s:7:"#020202";s:27:"container_boxshadow_opacity";s:2:"50";s:16:"title_font_color";s:7:"#ffffff";s:17:"title_line_height";s:2:"28";s:15:"title_font_size";s:2:"26";s:17:"title_font_family";s:10:"Sans-Serif";s:17:"title_font_weight";s:3:"100";s:16:"title_font_style";s:0:"";s:16:"title_text_align";s:4:"left";s:27:"title_textshadow_horizontal";s:1:"0";s:25:"title_textshadow_vertical";s:1:"0";s:21:"title_textshadow_blur";s:1:"0";s:22:"title_textshadow_color";s:7:"#020202";s:24:"title_textshadow_opacity";s:2:"23";s:18:"content_font_color";s:7:"#ffffff";s:19:"content_font_family";s:7:"inherit";s:19:"content_font_weight";s:3:"100";s:18:"content_font_style";s:0:"";s:10:"close_text";s:2:"×";s:14:"close_location";s:8:"topright";s:18:"close_position_top";s:1:"0";s:19:"close_position_left";s:1:"0";s:21:"close_position_bottom";s:1:"0";s:20:"close_position_right";s:1:"0";s:13:"close_padding";s:1:"0";s:12:"close_height";s:2:"24";s:11:"close_width";s:2:"24";s:22:"close_background_color";s:7:"#eeee22";s:24:"close_background_opacity";s:3:"100";s:16:"close_font_color";s:7:"#1e73be";s:17:"close_line_height";s:2:"24";s:15:"close_font_size";s:2:"32";s:17:"close_font_family";s:15:"Times New Roman";s:17:"close_font_weight";s:3:"100";s:16:"close_font_style";s:0:"";s:18:"close_border_style";s:4:"none";s:18:"close_border_color";s:7:"#ffffff";s:18:"close_border_width";s:1:"1";s:19:"close_border_radius";s:1:"0";s:21:"close_boxshadow_inset";s:2:"no";s:26:"close_boxshadow_horizontal";s:2:"-1";s:24:"close_boxshadow_vertical";s:1:"1";s:20:"close_boxshadow_blur";s:1:"1";s:22:"close_boxshadow_spread";s:1:"0";s:21:"close_boxshadow_color";s:7:"#020202";s:23:"close_boxshadow_opacity";s:2:"10";s:27:"close_textshadow_horizontal";s:2:"-1";s:25:"close_textshadow_vertical";s:1:"1";s:21:"close_textshadow_blur";s:1:"1";s:22:"close_textshadow_color";s:7:"#000000";s:24:"close_textshadow_opacity";s:2:"10";s:13:"atc_promotion";N;s:22:"close_position_outside";i:0;}',
62
- 'popup_theme_data_version' => 3,
63
- ),
64
- ),
65
- 'framed-border' => array(
66
- 'post_title' => __( 'Framed Border', 'popup-maker' ),
67
- 'meta_input' => array(
68
- 'popup_theme_settings' => 'a:67:{s:24:"overlay_background_color";s:7:"#ffffff";s:26:"overlay_background_opacity";s:2:"50";s:17:"container_padding";s:2:"18";s:26:"container_background_color";s:7:"#fffbef";s:28:"container_background_opacity";s:3:"100";s:22:"container_border_style";s:6:"outset";s:22:"container_border_color";s:7:"#dd3333";s:22:"container_border_width";s:2:"20";s:23:"container_border_radius";s:1:"0";s:25:"container_boxshadow_inset";s:3:"yes";s:30:"container_boxshadow_horizontal";s:1:"1";s:28:"container_boxshadow_vertical";s:1:"1";s:24:"container_boxshadow_blur";s:1:"3";s:26:"container_boxshadow_spread";s:1:"0";s:25:"container_boxshadow_color";s:7:"#020202";s:27:"container_boxshadow_opacity";s:2:"97";s:16:"title_font_color";s:7:"#000000";s:17:"title_line_height";s:2:"36";s:15:"title_font_size";s:2:"32";s:17:"title_font_family";s:7:"inherit";s:17:"title_font_weight";s:3:"100";s:16:"title_font_style";s:0:"";s:16:"title_text_align";s:4:"left";s:27:"title_textshadow_horizontal";s:1:"0";s:25:"title_textshadow_vertical";s:1:"0";s:21:"title_textshadow_blur";s:1:"0";s:22:"title_textshadow_color";s:7:"#020202";s:24:"title_textshadow_opacity";s:2:"23";s:18:"content_font_color";s:7:"#2d2d2d";s:19:"content_font_family";s:7:"inherit";s:19:"content_font_weight";s:3:"100";s:18:"content_font_style";s:0:"";s:10:"close_text";s:2:"×";s:14:"close_location";s:8:"topright";s:18:"close_position_top";s:3:"-20";s:19:"close_position_left";s:3:"-20";s:21:"close_position_bottom";s:1:"0";s:20:"close_position_right";s:3:"-20";s:13:"close_padding";s:1:"0";s:12:"close_height";s:2:"20";s:11:"close_width";s:2:"20";s:22:"close_background_color";s:7:"#000000";s:24:"close_background_opacity";s:2:"55";s:16:"close_font_color";s:7:"#ffffff";s:17:"close_line_height";s:2:"18";s:15:"close_font_size";s:2:"16";s:17:"close_font_family";s:6:"Tahoma";s:17:"close_font_weight";s:3:"700";s:16:"close_font_style";s:0:"";s:18:"close_border_style";s:4:"none";s:18:"close_border_color";s:7:"#ffffff";s:18:"close_border_width";s:1:"1";s:19:"close_border_radius";s:1:"0";s:21:"close_boxshadow_inset";s:2:"no";s:26:"close_boxshadow_horizontal";s:1:"0";s:24:"close_boxshadow_vertical";s:1:"0";s:20:"close_boxshadow_blur";s:1:"0";s:22:"close_boxshadow_spread";s:1:"0";s:21:"close_boxshadow_color";s:7:"#020202";s:23:"close_boxshadow_opacity";s:2:"23";s:27:"close_textshadow_horizontal";s:1:"0";s:25:"close_textshadow_vertical";s:1:"0";s:21:"close_textshadow_blur";s:1:"0";s:22:"close_textshadow_color";s:7:"#000000";s:24:"close_textshadow_opacity";s:2:"23";s:13:"atc_promotion";N;s:22:"close_position_outside";i:0;}',
69
- 'popup_theme_data_version' => 3,
70
- ),
71
- ),
72
- 'floating-bar' => array(
73
- 'post_title' => __( 'Floating Bar - Soft Blue', 'popup-maker' ),
74
- 'meta_input' => array(
75
- 'popup_theme_settings' => 'a:67:{s:24:"overlay_background_color";s:7:"#ffffff";s:26:"overlay_background_opacity";s:1:"0";s:13:"atc_promotion";N;s:17:"container_padding";s:1:"8";s:23:"container_border_radius";s:1:"0";s:26:"container_background_color";s:7:"#eef6fc";s:28:"container_background_opacity";s:3:"100";s:22:"container_border_style";s:4:"none";s:22:"container_border_color";s:7:"#000000";s:22:"container_border_width";s:1:"1";s:25:"container_boxshadow_color";s:7:"#020202";s:27:"container_boxshadow_opacity";s:2:"23";s:30:"container_boxshadow_horizontal";s:1:"1";s:28:"container_boxshadow_vertical";s:1:"1";s:24:"container_boxshadow_blur";s:1:"3";s:26:"container_boxshadow_spread";s:1:"0";s:25:"container_boxshadow_inset";s:2:"no";s:16:"title_font_color";s:7:"#505050";s:15:"title_font_size";s:2:"32";s:17:"title_line_height";s:2:"36";s:17:"title_font_family";s:7:"inherit";s:17:"title_font_weight";s:3:"400";s:16:"title_font_style";s:0:"";s:16:"title_text_align";s:4:"left";s:22:"title_textshadow_color";s:7:"#020202";s:24:"title_textshadow_opacity";s:2:"23";s:27:"title_textshadow_horizontal";s:1:"0";s:25:"title_textshadow_vertical";s:1:"0";s:21:"title_textshadow_blur";s:1:"0";s:18:"content_font_color";s:7:"#505050";s:19:"content_font_family";s:7:"inherit";s:19:"content_font_weight";s:3:"400";s:18:"content_font_style";s:0:"";s:10:"close_text";s:2:"×";s:22:"close_position_outside";i:0;s:14:"close_location";s:11:"middleright";s:18:"close_position_top";s:1:"0";s:21:"close_position_bottom";s:1:"0";s:19:"close_position_left";s:1:"0";s:20:"close_position_right";s:1:"5";s:13:"close_padding";s:1:"0";s:12:"close_height";s:2:"18";s:11:"close_width";s:2:"18";s:19:"close_border_radius";s:2:"15";s:22:"close_background_color";s:7:"#ffffff";s:24:"close_background_opacity";s:1:"0";s:16:"close_font_color";s:7:"#505050";s:15:"close_font_size";s:2:"15";s:17:"close_line_height";s:2:"18";s:17:"close_font_family";s:10:"Sans-Serif";s:17:"close_font_weight";s:3:"700";s:16:"close_font_style";s:0:"";s:18:"close_border_style";s:5:"solid";s:18:"close_border_color";s:7:"#505050";s:18:"close_border_width";s:1:"1";s:21:"close_boxshadow_color";s:7:"#020202";s:23:"close_boxshadow_opacity";s:1:"0";s:26:"close_boxshadow_horizontal";s:1:"0";s:24:"close_boxshadow_vertical";s:1:"0";s:20:"close_boxshadow_blur";s:1:"0";s:22:"close_boxshadow_spread";s:1:"0";s:21:"close_boxshadow_inset";s:2:"no";s:22:"close_textshadow_color";s:7:"#000000";s:24:"close_textshadow_opacity";s:1:"0";s:27:"close_textshadow_horizontal";s:1:"0";s:25:"close_textshadow_vertical";s:1:"0";s:21:"close_textshadow_blur";s:1:"0";}',
76
- 'popup_theme_data_version' => 3,
77
- ),
78
- ),
79
- );
80
-
81
- $new_theme_installed = false;
82
-
83
- foreach ( $built_in_themes as $post_name => $_theme ) {
84
-
85
- if ( ! in_array( $post_name, $installed_themes ) ) {
86
- $_theme['post_name'] = $post_name;
87
- $_theme['post_type'] = 'popup_theme';
88
- $_theme['post_status'] = 'publish';
89
- $_theme['meta_input']['_pum_built_in'] = $post_name;
90
-
91
- foreach ( $_theme['meta_input'] as $key => $value ) {
92
- $_theme['meta_input'][ $key ] = maybe_unserialize( $value );
93
- }
94
-
95
- wp_insert_post( $_theme );
96
-
97
- $installed_themes[] = $post_name;
98
-
99
- $new_theme_installed = true;
100
- }
101
-
102
- }
103
-
104
- if ( $new_theme_installed ) {
105
- pum_reset_assets();
106
- update_option( '_pum_installed_themes', $installed_themes );
107
- }
108
-
109
- }
1
+ <?php
2
+ /**
3
+ * Install Functions
4
+ *
5
+ * @package PUM
6
+ * @subpackage Functions/Install
7
+ * @copyright Copyright (c) 2019, Code Atlantic LLC
8
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9
+ * @since 1.4
10
+ */
11
+
12
+ // Exit if accessed directly
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit;
15
+ }
16
+
17
+ /**
18
+ * Enqueues our install theme function on wp_loaded if Popup Maker core was updated.
19
+ *
20
+ * @since 1.11.0
21
+ */
22
+ function pum_install_new_themes_on_update() {
23
+ add_action( 'wp_loaded', 'pum_install_built_in_themes' );
24
+ }
25
+
26
+ add_action( 'pum_update_core_version', 'pum_install_new_themes_on_update' );
27
+
28
+
29
+ /**
30
+ * @param bool $network_wide
31
+ */
32
+ function pum_install_built_in_themes( $network_wide = false ) {
33
+
34
+ $installed_themes = get_option( '_pum_installed_themes', array() );
35
+
36
+ $built_in_themes = array(
37
+ 'lightbox' => array(
38
+ 'post_title' => __( 'Light Box', 'popup-maker' ),
39
+ 'meta_input' => array(
40
+ 'popup_theme_settings' => 'a:67:{s:24:"overlay_background_color";s:7:"#000000";s:26:"overlay_background_opacity";s:2:"60";s:17:"container_padding";s:2:"18";s:26:"container_background_color";s:7:"#ffffff";s:28:"container_background_opacity";s:3:"100";s:22:"container_border_style";s:5:"solid";s:22:"container_border_color";s:7:"#000000";s:22:"container_border_width";s:1:"8";s:23:"container_border_radius";s:1:"3";s:25:"container_boxshadow_inset";s:2:"no";s:30:"container_boxshadow_horizontal";s:1:"0";s:28:"container_boxshadow_vertical";s:1:"0";s:24:"container_boxshadow_blur";s:2:"30";s:26:"container_boxshadow_spread";s:1:"0";s:25:"container_boxshadow_color";s:7:"#020202";s:27:"container_boxshadow_opacity";s:3:"100";s:16:"title_font_color";s:7:"#000000";s:17:"title_line_height";s:2:"36";s:15:"title_font_size";s:2:"32";s:17:"title_font_family";s:7:"inherit";s:17:"title_font_weight";s:3:"100";s:16:"title_font_style";s:0:"";s:16:"title_text_align";s:4:"left";s:27:"title_textshadow_horizontal";s:1:"0";s:25:"title_textshadow_vertical";s:1:"0";s:21:"title_textshadow_blur";s:1:"0";s:22:"title_textshadow_color";s:7:"#020202";s:24:"title_textshadow_opacity";s:2:"23";s:18:"content_font_color";s:7:"#000000";s:19:"content_font_family";s:7:"inherit";s:19:"content_font_weight";s:3:"100";s:18:"content_font_style";s:0:"";s:10:"close_text";s:7:"&times;";s:14:"close_location";s:8:"topright";s:18:"close_position_top";s:3:"-13";s:19:"close_position_left";s:1:"0";s:21:"close_position_bottom";s:1:"0";s:20:"close_position_right";s:3:"-13";s:13:"close_padding";s:1:"0";s:12:"close_height";s:2:"26";s:11:"close_width";s:2:"26";s:22:"close_background_color";s:7:"#000000";s:24:"close_background_opacity";s:3:"100";s:16:"close_font_color";s:7:"#ffffff";s:17:"close_line_height";s:2:"24";s:15:"close_font_size";s:2:"24";s:17:"close_font_family";s:5:"Arial";s:17:"close_font_weight";s:3:"100";s:16:"close_font_style";s:0:"";s:18:"close_border_style";s:5:"solid";s:18:"close_border_color";s:7:"#ffffff";s:18:"close_border_width";s:1:"2";s:19:"close_border_radius";s:2:"26";s:21:"close_boxshadow_inset";s:2:"no";s:26:"close_boxshadow_horizontal";s:1:"0";s:24:"close_boxshadow_vertical";s:1:"0";s:20:"close_boxshadow_blur";s:2:"15";s:22:"close_boxshadow_spread";s:1:"1";s:21:"close_boxshadow_color";s:7:"#020202";s:23:"close_boxshadow_opacity";s:2:"75";s:27:"close_textshadow_horizontal";s:1:"0";s:25:"close_textshadow_vertical";s:1:"0";s:21:"close_textshadow_blur";s:1:"0";s:22:"close_textshadow_color";s:7:"#000000";s:24:"close_textshadow_opacity";s:2:"23";s:13:"atc_promotion";N;s:22:"close_position_outside";i:0;}',
41
+ 'popup_theme_data_version' => 3,
42
+ ),
43
+ ),
44
+ 'enterprise-blue' => array(
45
+ 'post_title' => __( 'Enterprise Blue', 'popup-maker' ),
46
+ 'meta_input' => array(
47
+ 'popup_theme_settings' => 'a:67:{s:24:"overlay_background_color";s:7:"#000000";s:26:"overlay_background_opacity";s:2:"70";s:17:"container_padding";s:2:"28";s:26:"container_background_color";s:7:"#ffffff";s:28:"container_background_opacity";s:3:"100";s:22:"container_border_style";s:4:"none";s:22:"container_border_color";s:7:"#000000";s:22:"container_border_width";s:1:"1";s:23:"container_border_radius";s:1:"5";s:25:"container_boxshadow_inset";s:2:"no";s:30:"container_boxshadow_horizontal";s:1:"0";s:28:"container_boxshadow_vertical";s:2:"10";s:24:"container_boxshadow_blur";s:2:"25";s:26:"container_boxshadow_spread";s:1:"4";s:25:"container_boxshadow_color";s:7:"#020202";s:27:"container_boxshadow_opacity";s:2:"50";s:16:"title_font_color";s:7:"#315b7c";s:17:"title_line_height";s:2:"36";s:15:"title_font_size";s:2:"34";s:17:"title_font_family";s:7:"inherit";s:17:"title_font_weight";s:3:"100";s:16:"title_font_style";s:0:"";s:16:"title_text_align";s:4:"left";s:27:"title_textshadow_horizontal";s:1:"0";s:25:"title_textshadow_vertical";s:1:"0";s:21:"title_textshadow_blur";s:1:"0";s:22:"title_textshadow_color";s:7:"#020202";s:24:"title_textshadow_opacity";s:2:"23";s:18:"content_font_color";s:7:"#2d2d2d";s:19:"content_font_family";s:7:"inherit";s:19:"content_font_weight";s:3:"100";s:18:"content_font_style";s:0:"";s:10:"close_text";s:2:"×";s:14:"close_location";s:8:"topright";s:18:"close_position_top";s:1:"8";s:19:"close_position_left";s:1:"0";s:21:"close_position_bottom";s:1:"0";s:20:"close_position_right";s:1:"8";s:13:"close_padding";s:1:"4";s:12:"close_height";s:2:"28";s:11:"close_width";s:2:"28";s:22:"close_background_color";s:7:"#315b7c";s:24:"close_background_opacity";s:3:"100";s:16:"close_font_color";s:7:"#ffffff";s:17:"close_line_height";s:2:"20";s:15:"close_font_size";s:2:"20";s:17:"close_font_family";s:15:"Times New Roman";s:17:"close_font_weight";s:3:"100";s:16:"close_font_style";s:0:"";s:18:"close_border_style";s:4:"none";s:18:"close_border_color";s:7:"#ffffff";s:18:"close_border_width";s:1:"1";s:19:"close_border_radius";s:2:"42";s:21:"close_boxshadow_inset";s:2:"no";s:26:"close_boxshadow_horizontal";s:1:"0";s:24:"close_boxshadow_vertical";s:1:"0";s:20:"close_boxshadow_blur";s:1:"0";s:22:"close_boxshadow_spread";s:1:"0";s:21:"close_boxshadow_color";s:7:"#020202";s:23:"close_boxshadow_opacity";s:2:"23";s:27:"close_textshadow_horizontal";s:1:"0";s:25:"close_textshadow_vertical";s:1:"0";s:21:"close_textshadow_blur";s:1:"0";s:22:"close_textshadow_color";s:7:"#000000";s:24:"close_textshadow_opacity";s:2:"23";s:13:"atc_promotion";N;s:22:"close_position_outside";i:0;}',
48
+ 'popup_theme_data_version' => 3,
49
+ ),
50
+ ),
51
+ 'hello-box' => array(
52
+ 'post_title' => __( 'Hello Box', 'popup-maker' ),
53
+ 'meta_input' => array(
54
+ 'popup_theme_settings' => 'a:67:{s:24:"overlay_background_color";s:7:"#000000";s:26:"overlay_background_opacity";s:2:"75";s:17:"container_padding";s:2:"30";s:26:"container_background_color";s:7:"#ffffff";s:28:"container_background_opacity";s:3:"100";s:22:"container_border_style";s:5:"solid";s:22:"container_border_color";s:7:"#81d742";s:22:"container_border_width";s:2:"14";s:23:"container_border_radius";s:2:"80";s:25:"container_boxshadow_inset";s:2:"no";s:30:"container_boxshadow_horizontal";s:1:"0";s:28:"container_boxshadow_vertical";s:1:"0";s:24:"container_boxshadow_blur";s:1:"0";s:26:"container_boxshadow_spread";s:1:"0";s:25:"container_boxshadow_color";s:7:"#020202";s:27:"container_boxshadow_opacity";s:1:"0";s:16:"title_font_color";s:7:"#2d2d2d";s:17:"title_line_height";s:2:"36";s:15:"title_font_size";s:2:"32";s:17:"title_font_family";s:10:"Montserrat";s:17:"title_font_weight";s:3:"100";s:16:"title_font_style";s:0:"";s:16:"title_text_align";s:4:"left";s:27:"title_textshadow_horizontal";s:1:"0";s:25:"title_textshadow_vertical";s:1:"0";s:21:"title_textshadow_blur";s:1:"0";s:22:"title_textshadow_color";s:7:"#020202";s:24:"title_textshadow_opacity";s:2:"23";s:18:"content_font_color";s:7:"#2d2d2d";s:19:"content_font_family";s:7:"inherit";s:19:"content_font_weight";s:3:"100";s:18:"content_font_style";s:0:"";s:10:"close_text";s:2:"×";s:14:"close_location";s:8:"topright";s:18:"close_position_top";s:3:"-30";s:19:"close_position_left";s:3:"-30";s:21:"close_position_bottom";s:1:"0";s:20:"close_position_right";s:3:"-30";s:13:"close_padding";s:1:"0";s:12:"close_height";s:1:"0";s:11:"close_width";s:1:"0";s:22:"close_background_color";s:7:"#ffffff";s:24:"close_background_opacity";s:3:"100";s:16:"close_font_color";s:7:"#2d2d2d";s:17:"close_line_height";s:2:"28";s:15:"close_font_size";s:2:"32";s:17:"close_font_family";s:15:"Times New Roman";s:17:"close_font_weight";s:3:"100";s:16:"close_font_style";s:0:"";s:18:"close_border_style";s:4:"none";s:18:"close_border_color";s:7:"#ffffff";s:18:"close_border_width";s:1:"1";s:19:"close_border_radius";s:2:"28";s:21:"close_boxshadow_inset";s:2:"no";s:26:"close_boxshadow_horizontal";s:1:"0";s:24:"close_boxshadow_vertical";s:1:"0";s:20:"close_boxshadow_blur";s:1:"0";s:22:"close_boxshadow_spread";s:1:"0";s:21:"close_boxshadow_color";s:7:"#020202";s:23:"close_boxshadow_opacity";s:2:"23";s:27:"close_textshadow_horizontal";s:1:"0";s:25:"close_textshadow_vertical";s:1:"0";s:21:"close_textshadow_blur";s:1:"0";s:22:"close_textshadow_color";s:7:"#000000";s:24:"close_textshadow_opacity";s:2:"23";s:13:"atc_promotion";N;s:22:"close_position_outside";i:0;}',
55
+ 'popup_theme_data_version' => 3,
56
+ ),
57
+ ),
58
+ 'cutting-edge' => array(
59
+ 'post_title' => __( 'Cutting Edge', 'popup-maker' ),
60
+ 'meta_input' => array(
61
+ 'popup_theme_settings' => 'a:67:{s:24:"overlay_background_color";s:7:"#000000";s:26:"overlay_background_opacity";s:2:"50";s:17:"container_padding";s:2:"18";s:26:"container_background_color";s:7:"#1e73be";s:28:"container_background_opacity";s:3:"100";s:22:"container_border_style";s:4:"none";s:22:"container_border_color";s:7:"#000000";s:22:"container_border_width";s:1:"1";s:23:"container_border_radius";s:1:"0";s:25:"container_boxshadow_inset";s:2:"no";s:30:"container_boxshadow_horizontal";s:1:"0";s:28:"container_boxshadow_vertical";s:2:"10";s:24:"container_boxshadow_blur";s:2:"25";s:26:"container_boxshadow_spread";s:1:"0";s:25:"container_boxshadow_color";s:7:"#020202";s:27:"container_boxshadow_opacity";s:2:"50";s:16:"title_font_color";s:7:"#ffffff";s:17:"title_line_height";s:2:"28";s:15:"title_font_size";s:2:"26";s:17:"title_font_family";s:10:"Sans-Serif";s:17:"title_font_weight";s:3:"100";s:16:"title_font_style";s:0:"";s:16:"title_text_align";s:4:"left";s:27:"title_textshadow_horizontal";s:1:"0";s:25:"title_textshadow_vertical";s:1:"0";s:21:"title_textshadow_blur";s:1:"0";s:22:"title_textshadow_color";s:7:"#020202";s:24:"title_textshadow_opacity";s:2:"23";s:18:"content_font_color";s:7:"#ffffff";s:19:"content_font_family";s:7:"inherit";s:19:"content_font_weight";s:3:"100";s:18:"content_font_style";s:0:"";s:10:"close_text";s:2:"×";s:14:"close_location";s:8:"topright";s:18:"close_position_top";s:1:"0";s:19:"close_position_left";s:1:"0";s:21:"close_position_bottom";s:1:"0";s:20:"close_position_right";s:1:"0";s:13:"close_padding";s:1:"0";s:12:"close_height";s:2:"24";s:11:"close_width";s:2:"24";s:22:"close_background_color";s:7:"#eeee22";s:24:"close_background_opacity";s:3:"100";s:16:"close_font_color";s:7:"#1e73be";s:17:"close_line_height";s:2:"24";s:15:"close_font_size";s:2:"32";s:17:"close_font_family";s:15:"Times New Roman";s:17:"close_font_weight";s:3:"100";s:16:"close_font_style";s:0:"";s:18:"close_border_style";s:4:"none";s:18:"close_border_color";s:7:"#ffffff";s:18:"close_border_width";s:1:"1";s:19:"close_border_radius";s:1:"0";s:21:"close_boxshadow_inset";s:2:"no";s:26:"close_boxshadow_horizontal";s:2:"-1";s:24:"close_boxshadow_vertical";s:1:"1";s:20:"close_boxshadow_blur";s:1:"1";s:22:"close_boxshadow_spread";s:1:"0";s:21:"close_boxshadow_color";s:7:"#020202";s:23:"close_boxshadow_opacity";s:2:"10";s:27:"close_textshadow_horizontal";s:2:"-1";s:25:"close_textshadow_vertical";s:1:"1";s:21:"close_textshadow_blur";s:1:"1";s:22:"close_textshadow_color";s:7:"#000000";s:24:"close_textshadow_opacity";s:2:"10";s:13:"atc_promotion";N;s:22:"close_position_outside";i:0;}',
62
+ 'popup_theme_data_version' => 3,
63
+ ),
64
+ ),
65
+ 'framed-border' => array(
66
+ 'post_title' => __( 'Framed Border', 'popup-maker' ),
67
+ 'meta_input' => array(
68
+ 'popup_theme_settings' => 'a:67:{s:24:"overlay_background_color";s:7:"#ffffff";s:26:"overlay_background_opacity";s:2:"50";s:17:"container_padding";s:2:"18";s:26:"container_background_color";s:7:"#fffbef";s:28:"container_background_opacity";s:3:"100";s:22:"container_border_style";s:6:"outset";s:22:"container_border_color";s:7:"#dd3333";s:22:"container_border_width";s:2:"20";s:23:"container_border_radius";s:1:"0";s:25:"container_boxshadow_inset";s:3:"yes";s:30:"container_boxshadow_horizontal";s:1:"1";s:28:"container_boxshadow_vertical";s:1:"1";s:24:"container_boxshadow_blur";s:1:"3";s:26:"container_boxshadow_spread";s:1:"0";s:25:"container_boxshadow_color";s:7:"#020202";s:27:"container_boxshadow_opacity";s:2:"97";s:16:"title_font_color";s:7:"#000000";s:17:"title_line_height";s:2:"36";s:15:"title_font_size";s:2:"32";s:17:"title_font_family";s:7:"inherit";s:17:"title_font_weight";s:3:"100";s:16:"title_font_style";s:0:"";s:16:"title_text_align";s:4:"left";s:27:"title_textshadow_horizontal";s:1:"0";s:25:"title_textshadow_vertical";s:1:"0";s:21:"title_textshadow_blur";s:1:"0";s:22:"title_textshadow_color";s:7:"#020202";s:24:"title_textshadow_opacity";s:2:"23";s:18:"content_font_color";s:7:"#2d2d2d";s:19:"content_font_family";s:7:"inherit";s:19:"content_font_weight";s:3:"100";s:18:"content_font_style";s:0:"";s:10:"close_text";s:2:"×";s:14:"close_location";s:8:"topright";s:18:"close_position_top";s:3:"-20";s:19:"close_position_left";s:3:"-20";s:21:"close_position_bottom";s:1:"0";s:20:"close_position_right";s:3:"-20";s:13:"close_padding";s:1:"0";s:12:"close_height";s:2:"20";s:11:"close_width";s:2:"20";s:22:"close_background_color";s:7:"#000000";s:24:"close_background_opacity";s:2:"55";s:16:"close_font_color";s:7:"#ffffff";s:17:"close_line_height";s:2:"18";s:15:"close_font_size";s:2:"16";s:17:"close_font_family";s:6:"Tahoma";s:17:"close_font_weight";s:3:"700";s:16:"close_font_style";s:0:"";s:18:"close_border_style";s:4:"none";s:18:"close_border_color";s:7:"#ffffff";s:18:"close_border_width";s:1:"1";s:19:"close_border_radius";s:1:"0";s:21:"close_boxshadow_inset";s:2:"no";s:26:"close_boxshadow_horizontal";s:1:"0";s:24:"close_boxshadow_vertical";s:1:"0";s:20:"close_boxshadow_blur";s:1:"0";s:22:"close_boxshadow_spread";s:1:"0";s:21:"close_boxshadow_color";s:7:"#020202";s:23:"close_boxshadow_opacity";s:2:"23";s:27:"close_textshadow_horizontal";s:1:"0";s:25:"close_textshadow_vertical";s:1:"0";s:21:"close_textshadow_blur";s:1:"0";s:22:"close_textshadow_color";s:7:"#000000";s:24:"close_textshadow_opacity";s:2:"23";s:13:"atc_promotion";N;s:22:"close_position_outside";i:0;}',
69
+ 'popup_theme_data_version' => 3,
70
+ ),
71
+ ),
72
+ 'floating-bar' => array(
73
+ 'post_title' => __( 'Floating Bar - Soft Blue', 'popup-maker' ),
74
+ 'meta_input' => array(
75
+ 'popup_theme_settings' => 'a:67:{s:24:"overlay_background_color";s:7:"#ffffff";s:26:"overlay_background_opacity";s:1:"0";s:13:"atc_promotion";N;s:17:"container_padding";s:1:"8";s:23:"container_border_radius";s:1:"0";s:26:"container_background_color";s:7:"#eef6fc";s:28:"container_background_opacity";s:3:"100";s:22:"container_border_style";s:4:"none";s:22:"container_border_color";s:7:"#000000";s:22:"container_border_width";s:1:"1";s:25:"container_boxshadow_color";s:7:"#020202";s:27:"container_boxshadow_opacity";s:2:"23";s:30:"container_boxshadow_horizontal";s:1:"1";s:28:"container_boxshadow_vertical";s:1:"1";s:24:"container_boxshadow_blur";s:1:"3";s:26:"container_boxshadow_spread";s:1:"0";s:25:"container_boxshadow_inset";s:2:"no";s:16:"title_font_color";s:7:"#505050";s:15:"title_font_size";s:2:"32";s:17:"title_line_height";s:2:"36";s:17:"title_font_family";s:7:"inherit";s:17:"title_font_weight";s:3:"400";s:16:"title_font_style";s:0:"";s:16:"title_text_align";s:4:"left";s:22:"title_textshadow_color";s:7:"#020202";s:24:"title_textshadow_opacity";s:2:"23";s:27:"title_textshadow_horizontal";s:1:"0";s:25:"title_textshadow_vertical";s:1:"0";s:21:"title_textshadow_blur";s:1:"0";s:18:"content_font_color";s:7:"#505050";s:19:"content_font_family";s:7:"inherit";s:19:"content_font_weight";s:3:"400";s:18:"content_font_style";s:0:"";s:10:"close_text";s:2:"×";s:22:"close_position_outside";i:0;s:14:"close_location";s:11:"middleright";s:18:"close_position_top";s:1:"0";s:21:"close_position_bottom";s:1:"0";s:19:"close_position_left";s:1:"0";s:20:"close_position_right";s:1:"5";s:13:"close_padding";s:1:"0";s:12:"close_height";s:2:"18";s:11:"close_width";s:2:"18";s:19:"close_border_radius";s:2:"15";s:22:"close_background_color";s:7:"#ffffff";s:24:"close_background_opacity";s:1:"0";s:16:"close_font_color";s:7:"#505050";s:15:"close_font_size";s:2:"15";s:17:"close_line_height";s:2:"18";s:17:"close_font_family";s:10:"Sans-Serif";s:17:"close_font_weight";s:3:"700";s:16:"close_font_style";s:0:"";s:18:"close_border_style";s:5:"solid";s:18:"close_border_color";s:7:"#505050";s:18:"close_border_width";s:1:"1";s:21:"close_boxshadow_color";s:7:"#020202";s:23:"close_boxshadow_opacity";s:1:"0";s:26:"close_boxshadow_horizontal";s:1:"0";s:24:"close_boxshadow_vertical";s:1:"0";s:20:"close_boxshadow_blur";s:1:"0";s:22:"close_boxshadow_spread";s:1:"0";s:21:"close_boxshadow_inset";s:2:"no";s:22:"close_textshadow_color";s:7:"#000000";s:24:"close_textshadow_opacity";s:1:"0";s:27:"close_textshadow_horizontal";s:1:"0";s:25:"close_textshadow_vertical";s:1:"0";s:21:"close_textshadow_blur";s:1:"0";}',
76
+ 'popup_theme_data_version' => 3,
77
+ ),
78
+ ),
79
+ );
80
+
81
+ $new_theme_installed = false;
82
+
83
+ foreach ( $built_in_themes as $post_name => $_theme ) {
84
+
85
+ if ( ! in_array( $post_name, $installed_themes ) ) {
86
+ $_theme['post_name'] = $post_name;
87
+ $_theme['post_type'] = 'popup_theme';
88
+ $_theme['post_status'] = 'publish';
89
+ $_theme['meta_input']['_pum_built_in'] = $post_name;
90
+
91
+ foreach ( $_theme['meta_input'] as $key => $value ) {
92
+ $_theme['meta_input'][ $key ] = maybe_unserialize( $value );
93
+ }
94
+
95
+ wp_insert_post( $_theme );
96
+
97
+ $installed_themes[] = $post_name;
98
+
99
+ $new_theme_installed = true;
100
+ }
101
+
102
+ }
103
+
104
+ if ( $new_theme_installed ) {
105
+ pum_reset_assets();
106
+ update_option( '_pum_installed_themes', $installed_themes );
107
+ }
108
+
109
+ }
popup-maker.php CHANGED
@@ -1,420 +1,420 @@
1
- <?php
2
- /**
3
- * Plugin Name: Popup Maker
4
- * Plugin URI: https://wppopupmaker.com/?utm_campaign=PluginInfo&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.11.0
7
- * Author: Popup Maker
8
- * Author URI: https://wppopupmaker.com/?utm_campaign=PluginInfo&utm_source=plugin-header&utm_medium=author-uri
9
- * License: GPL2 or later
10
- * License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
- * Text Domain: popup-maker
12
- * Domain Path: /languages/
13
- *
14
- * @package POPMAKE
15
- * @author Daniel Iser
16
- * @copyright Copyright (c) 2019, Code Atlantic LLC
17
- */
18
-
19
- // Exit if accessed directly
20
- if ( ! defined( 'ABSPATH' ) ) {
21
- exit;
22
- }
23
-
24
- /**
25
- * Class Autoloader
26
- *
27
- * @param $class
28
- */
29
- function pum_autoloader( $class ) {
30
-
31
- if ( strncmp( 'PUM_Newsletter_', $class, strlen( 'PUM_Newsletter_' ) ) === 0 && class_exists( 'PUM_MCI' ) && ! empty( PUM_MCI::$VER ) && version_compare( PUM_MCI::$VER, '1.3.0', '<' ) ) {
32
- return;
33
- }
34
-
35
- $pum_autoloaders = apply_filters( 'pum_autoloaders', array(
36
- array(
37
- 'prefix' => 'PUM_',
38
- 'dir' => dirname( __FILE__ ) . '/classes/',
39
- ),
40
- ) );
41
-
42
- foreach ( $pum_autoloaders as $autoloader ) {
43
- $autoloader = wp_parse_args( $autoloader, array(
44
- 'prefix' => 'PUM_',
45
- 'dir' => dirname( __FILE__ ) . '/classes/',
46
- 'search' => '_',
47
- 'replace' => '/',
48
- ) );
49
-
50
- // project-specific namespace prefix
51
- $prefix = $autoloader['prefix'];
52
-
53
- // does the class use the namespace prefix?
54
- $len = strlen( $prefix );
55
- if ( strncmp( $prefix, $class, $len ) !== 0 ) {
56
- // no, move to the next registered autoloader
57
- continue;
58
- }
59
-
60
- // get the relative class name
61
- $relative_class = substr( $class, $len );
62
-
63
- // replace the namespace prefix with the base directory, replace namespace
64
- // separators with directory separators in the relative class name, append
65
- // with .php
66
- $file = $autoloader['dir'] . str_replace( $autoloader['search'], $autoloader['replace'], $relative_class ) . '.php';
67
-
68
- // if the file exists, require it
69
- if ( file_exists( $file ) ) {
70
- require_once $file;
71
- }
72
- }
73
- }
74
-
75
- if ( ! function_exists( 'spl_autoload_register' ) ) {
76
- include 'includes/compat.php';
77
- }
78
-
79
- spl_autoload_register( 'pum_autoloader' ); // Register autoloader
80
-
81
- /**
82
- * Main Popup_Maker Class
83
- *
84
- * @since 1.0
85
- */
86
- class Popup_Maker {
87
-
88
- /**
89
- * @var string Plugin Name
90
- */
91
- public static $NAME = 'Popup Maker';
92
-
93
- /**
94
- * @var string Plugin Version
95
- */
96
- public static $VER = '1.11.0';
97
-
98
- /**
99
- * @var int DB Version
100
- */
101
- public static $DB_VER = 8;
102
-
103
- /**
104
- * @var string License API URL
105
- */
106
- public static $API_URL = 'https://wppopupmaker.com';
107
-
108
- /**
109
- * @var string
110
- */
111
- public static $MIN_PHP_VER = '5.6';
112
-
113
- /**
114
- * @var string
115
- */
116
- public static $MIN_WP_VER = '3.6';
117
-
118
- /**
119
- * @var string Plugin URL
120
- */
121
- public static $URL;
122
-
123
- /**
124
- * @var string Plugin Directory
125
- */
126
- public static $DIR;
127
-
128
- /**
129
- * @var string Plugin FILE
130
- */
131
- public static $FILE;
132
-
133
- /**
134
- * Used to test if debug_mode is enabled.
135
- *
136
- * @var bool
137
- */
138
- public static $DEBUG_MODE = false;
139
-
140
- /**
141
- * @var PUM_Utils_Cron
142
- */
143
- public $cron;
144
-
145
- /**
146
- * @var PUM_Repository_Popups
147
- */
148
- public $popups;
149
-
150
- /**
151
- * @var PUM_Repository_Themes
152
- */
153
- public $themes;
154
-
155
- /**
156
- * @var null|PUM_Model_Popup
157
- */
158
- public $current_popup;
159
-
160
- /**
161
- * @var null|PUM_Model_Theme
162
- */
163
- public $current_theme;
164
-
165
- /**
166
- * @var Popup_Maker The one true Popup_Maker
167
- */
168
- private static $instance;
169
-
170
- /**
171
- * Main instance
172
- *
173
- * @return Popup_Maker
174
- */
175
- public static function instance() {
176
- if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Popup_Maker ) ) {
177
- self::$instance = new Popup_Maker;
178
- self::$instance->setup_constants();
179
- self::$instance->includes();
180
- add_action( 'init', array( self::$instance, 'load_textdomain' ) );
181
- self::$instance->init();
182
- }
183
-
184
- return self::$instance;
185
- }
186
-
187
- /**
188
- * Setup plugin constants
189
- */
190
- private function setup_constants() {
191
-
192
- self::$DIR = plugin_dir_path( __FILE__ );
193
- self::$URL = plugins_url( '/', __FILE__ );
194
- self::$FILE = __FILE__;
195
-
196
- if ( isset( $_GET['pum_debug'] ) || PUM_Utils_Options::get( 'debug_mode', false ) ) {
197
- self::$DEBUG_MODE = true;
198
- }
199
-
200
- if ( ! defined( 'POPMAKE' ) ) {
201
- define( 'POPMAKE', self::$FILE );
202
- }
203
-
204
- if ( ! defined( 'POPMAKE_NAME' ) ) {
205
- define( 'POPMAKE_NAME', self::$NAME );
206
- }
207
-
208
- if ( ! defined( 'POPMAKE_SLUG' ) ) {
209
- define( 'POPMAKE_SLUG', trim( dirname( plugin_basename( __FILE__ ) ), '/' ) );
210
- }
211
-
212
- if ( ! defined( 'POPMAKE_DIR' ) ) {
213
- define( 'POPMAKE_DIR', self::$DIR );
214
- }
215
-
216
- if ( ! defined( 'POPMAKE_URL' ) ) {
217
- define( 'POPMAKE_URL', self::$URL );
218
- }
219
-
220
- if ( ! defined( 'POPMAKE_NONCE' ) ) {
221
- define( 'POPMAKE_NONCE', 'popmake_nonce' );
222
- }
223
-
224
- if ( ! defined( 'POPMAKE_VERSION' ) ) {
225
- define( 'POPMAKE_VERSION', self::$VER );
226
- }
227
-
228
- if ( ! defined( 'POPMAKE_DB_VERSION' ) ) {
229
- define( 'POPMAKE_DB_VERSION', self::$DB_VER );
230
- }
231
-
232
- if ( ! defined( 'POPMAKE_API_URL' ) ) {
233
- define( 'POPMAKE_API_URL', self::$API_URL );
234
- }
235
- }
236
-
237
- /**
238
- * Include required files
239
- */
240
- private function includes() {
241
-
242
- require_once self::$DIR . 'includes/compat.php';
243
-
244
- // Initialize global options
245
- PUM_Utils_Options::init();
246
-
247
- /** Loads most of our core functions */
248
- require_once self::$DIR . 'includes/functions.php';
249
-
250
- /** Deprecated functionality */
251
- require_once self::$DIR . 'includes/functions-backcompat.php';
252
- require_once self::$DIR . 'includes/functions-deprecated.php';
253
- require_once self::$DIR . 'includes/deprecated-classes.php';
254
- require_once self::$DIR . 'includes/deprecated-filters.php';
255
- require_once self::$DIR . 'includes/integrations.php';
256
-
257
- // Old Stuff.
258
- require_once self::$DIR . 'includes/defaults.php';
259
- require_once self::$DIR . 'includes/input-options.php';
260
-
261
- require_once self::$DIR . 'includes/importer/easy-modal-v2.php';
262
-
263
- // Phasing Out
264
- require_once self::$DIR . 'includes/class-popmake-fields.php';
265
- require_once self::$DIR . 'includes/class-popmake-popup-fields.php';
266
-
267
- /**
268
- * v1.4 Additions
269
- */
270
- require_once self::$DIR . 'includes/class-pum-fields.php';
271
- require_once self::$DIR . 'includes/class-pum-form.php';
272
-
273
- // Modules
274
- require_once self::$DIR . 'includes/modules/menus.php';
275
- require_once self::$DIR . 'includes/modules/admin-bar.php';
276
- require_once self::$DIR . 'includes/modules/reviews.php';
277
-
278
- require_once self::$DIR . 'includes/pum-install-functions.php';
279
- }
280
-
281
- /**
282
- * Loads the plugin language files
283
- */
284
- public function load_textdomain() {
285
- // Set filter for plugin's languages directory
286
- $lang_dir = apply_filters( 'pum_lang_dir', dirname( plugin_basename( POPMAKE ) ) . '/languages/' );
287
- $lang_dir = apply_filters( 'popmake_languages_directory', $lang_dir );
288
-
289
- // Try to load Langpacks first, if they are not available fallback to local files.
290
- if ( ! load_plugin_textdomain( 'popup-maker', false, $lang_dir ) ) {
291
- // Traditional WordPress plugin locale filter
292
- $locale = apply_filters( 'plugin_locale', get_locale(), 'popup-maker' );
293
- $mofile = sprintf( '%1$s-%2$s.mo', 'popup-maker', $locale );
294
-
295
- // Setup paths to current locale file
296
- $mofile_local = $lang_dir . $mofile;
297
- $mofile_global = WP_LANG_DIR . '/popup-maker/' . $mofile;
298
-
299
- if ( file_exists( $mofile_global ) ) {
300
- // Look in global /wp-content/languages/popup-maker folder
301
- load_textdomain( 'popup-maker', $mofile_global );
302
- } elseif ( file_exists( $mofile_local ) ) {
303
- // Look in local /wp-content/plugins/popup-maker/languages/ folder
304
- load_textdomain( 'popup-maker', $mofile_local );
305
- }
306
- }
307
- }
308
-
309
- public function init() {
310
- $this->cron = new PUM_Utils_Cron;
311
- $this->popups = new PUM_Repository_Popups();
312
- $this->themes = new PUM_Repository_Themes();
313
-
314
- PUM_Types::init();
315
- PUM_AssetCache::init();
316
- PUM_Site::init();
317
- PUM_Admin::init();
318
- PUM_Utils_Upgrades::instance();
319
- PUM_Newsletters::init();
320
- PUM_Previews::init();
321
- PUM_Integrations::init();
322
- PUM_Privacy::init();
323
-
324
- PUM_Utils_Alerts::init();
325
-
326
- PUM_Shortcode_Popup::init();
327
- PUM_Shortcode_PopupTrigger::init();
328
- PUM_Shortcode_PopupClose::init();
329
- PUM_Shortcode_PopupCookie::init();
330
-
331
- PUM_Telemetry::init();
332
- }
333
-
334
- /**
335
- * Returns true when debug mode is enabled.
336
- *
337
- * @return bool
338
- */
339
- public static function debug_mode() {
340
- return true === self::$DEBUG_MODE;
341
- }
342
-
343
- }
344
-
345
- /**
346
- * The main function responsible for returning the one true Popup_Maker
347
- * Instance to functions everywhere.
348
- *
349
- * Use this function like you would a global variable, except without needing
350
- * to declare the global.
351
- *
352
- * @return Popup_Maker
353
- * @since 1.8.0
354
- *
355
- */
356
- function pum() {
357
- return Popup_Maker::instance();
358
- }
359
-
360
- /**
361
- * Initialize Popup Maker if requirements are met.
362
- */
363
- function pum_init() {
364
- if ( ! PUM_Install::meets_activation_requirements() ) {
365
- require_once 'includes/failsafes.php';
366
- add_action( 'admin_notices', array( 'PUM_Install', 'activation_failure_admin_notice' ) );
367
- return;
368
- }
369
-
370
- // Get Popup Maker
371
- pum();
372
-
373
- add_action( 'plugins_loaded', 'popmake_initialize' );
374
- }
375
-
376
- // Get Popup Maker running
377
- add_action( 'plugins_loaded', 'pum_init', 9 );
378
-
379
- // Ensure plugin & environment compatibility.
380
- register_activation_hook( __FILE__, array( 'PUM_Install', 'activation_check' ) );
381
-
382
- // Register activation, deactivation & uninstall hooks.
383
- register_activation_hook( __FILE__, array( 'PUM_Install', 'activate_plugin' ) );
384
- register_deactivation_hook( __FILE__, array( 'PUM_Install', 'deactivate_plugin' ) );
385
- register_uninstall_hook( __FILE__, array( 'PUM_Install', 'uninstall_plugin' ) );
386
-
387
- /**
388
- * @deprecated 1.7.0
389
- */
390
- function popmake_initialize() {
391
- // Disable Unlimited Themes extension if active.
392
- remove_action( 'popmake_initialize', 'popmake_ut_initialize' );
393
-
394
- // Initialize old PUM extensions
395
- do_action( 'pum_initialize' );
396
- do_action( 'popmake_initialize' );
397
- }
398
-
399
- /**
400
- * The main function responsible for returning the one true Popup_Maker
401
- * Instance to functions everywhere.
402
- *
403
- * Use this function like you would a global variable, except without needing
404
- * to declare the global.
405
- *
406
- * Example: <?php $popmake = PopMake(); ?>
407
- *
408
- * @return object The one true Popup_Maker Instance
409
- * @deprecated 1.7.0
410
- *
411
- * @since 1.0
412
- */
413
- function PopMake() {
414
- return Popup_Maker::instance();
415
- }
416
-
417
- /**
418
- * This is currently here until we reorganize the plugin file structure to handle package loading & composer autoloading with failure notices.
419
- */
420
- require_once( plugin_dir_path( __FILE__ ) . '/packages/action-scheduler/action-scheduler.php' );
1
+ <?php
2
+ /**
3
+ * Plugin Name: Popup Maker
4
+ * Plugin URI: https://wppopupmaker.com/?utm_campaign=PluginInfo&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.11.1
7
+ * Author: Popup Maker
8
+ * Author URI: https://wppopupmaker.com/?utm_campaign=PluginInfo&utm_source=plugin-header&utm_medium=author-uri
9
+ * License: GPL2 or later
10
+ * License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
+ * Text Domain: popup-maker
12
+ * Domain Path: /languages/
13
+ *
14
+ * @package POPMAKE
15
+ * @author Daniel Iser
16
+ * @copyright Copyright (c) 2020, Code Atlantic LLC
17
+ */
18
+
19
+ // Exit if accessed directly.
20
+ if ( ! defined( 'ABSPATH' ) ) {
21
+ exit;
22
+ }
23
+
24
+ /**
25
+ * Class Autoloader
26
+ *
27
+ * @param $class
28
+ */
29
+ function pum_autoloader( $class ) {
30
+
31
+ if ( strncmp( 'PUM_Newsletter_', $class, strlen( 'PUM_Newsletter_' ) ) === 0 && class_exists( 'PUM_MCI' ) && ! empty( PUM_MCI::$VER ) && version_compare( PUM_MCI::$VER, '1.3.0', '<' ) ) {
32
+ return;
33
+ }
34
+
35
+ $pum_autoloaders = apply_filters( 'pum_autoloaders', array(
36
+ array(
37
+ 'prefix' => 'PUM_',
38
+ 'dir' => dirname( __FILE__ ) . '/classes/',
39
+ ),
40
+ ) );
41
+
42
+ foreach ( $pum_autoloaders as $autoloader ) {
43
+ $autoloader = wp_parse_args( $autoloader, array(
44
+ 'prefix' => 'PUM_',
45
+ 'dir' => dirname( __FILE__ ) . '/classes/',
46
+ 'search' => '_',
47
+ 'replace' => '/',
48
+ ) );
49
+
50
+ // project-specific namespace prefix
51
+ $prefix = $autoloader['prefix'];
52
+
53
+ // does the class use the namespace prefix?
54
+ $len = strlen( $prefix );
55
+ if ( strncmp( $prefix, $class, $len ) !== 0 ) {
56
+ // no, move to the next registered autoloader
57
+ continue;
58
+ }
59
+
60
+ // get the relative class name
61
+ $relative_class = substr( $class, $len );
62
+
63
+ // replace the namespace prefix with the base directory, replace namespace
64
+ // separators with directory separators in the relative class name, append
65
+ // with .php
66
+ $file = $autoloader['dir'] . str_replace( $autoloader['search'], $autoloader['replace'], $relative_class ) . '.php';
67
+
68
+ // if the file exists, require it
69
+ if ( file_exists( $file ) ) {
70
+ require_once $file;
71
+ }
72
+ }
73
+ }
74
+
75
+ if ( ! function_exists( 'spl_autoload_register' ) ) {
76
+ include 'includes/compat.php';
77
+ }
78
+
79
+ spl_autoload_register( 'pum_autoloader' ); // Register autoloader
80
+
81
+ /**
82
+ * Main Popup_Maker Class
83
+ *
84
+ * @since 1.0
85
+ */
86
+ class Popup_Maker {
87
+
88
+ /**
89
+ * @var string Plugin Name
90
+ */
91
+ public static $NAME = 'Popup Maker';
92
+
93
+ /**
94
+ * @var string Plugin Version
95
+ */
96
+ public static $VER = '1.11.1';
97
+
98
+ /**
99
+ * @var int DB Version
100
+ */
101
+ public static $DB_VER = 8;
102
+
103
+ /**
104
+ * @var string License API URL
105
+ */
106
+ public static $API_URL = 'https://wppopupmaker.com';
107
+
108
+ /**
109
+ * @var string
110
+ */
111
+ public static $MIN_PHP_VER = '5.6';
112
+
113
+ /**
114
+ * @var string
115
+ */
116
+ public static $MIN_WP_VER = '3.6';
117
+
118
+ /**
119
+ * @var string Plugin URL
120
+ */
121
+ public static $URL;
122
+
123
+ /**
124
+ * @var string Plugin Directory
125
+ */
126
+ public static $DIR;
127
+
128
+ /**
129
+ * @var string Plugin FILE
130
+ */
131
+ public static $FILE;
132
+
133
+ /**
134
+ * Used to test if debug_mode is enabled.
135
+ *
136
+ * @var bool
137
+ */
138
+ public static $DEBUG_MODE = false;
139
+
140
+ /**
141
+ * @var PUM_Utils_Cron
142
+ */
143
+ public $cron;
144
+
145
+ /**
146
+ * @var PUM_Repository_Popups
147
+ */
148
+ public $popups;
149
+
150
+ /**
151
+ * @var PUM_Repository_Themes
152
+ */
153
+ public $themes;
154
+
155
+ /**
156
+ * @var null|PUM_Model_Popup
157
+ */
158
+ public $current_popup;
159
+
160
+ /**
161
+ * @var null|PUM_Model_Theme
162
+ */
163
+ public $current_theme;
164
+
165
+ /**
166
+ * @var Popup_Maker The one true Popup_Maker
167
+ */
168
+ private static $instance;
169
+
170
+ /**
171
+ * Main instance
172
+ *
173
+ * @return Popup_Maker
174
+ */
175
+ public static function instance() {
176
+ if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Popup_Maker ) ) {
177
+ self::$instance = new Popup_Maker;
178
+ self::$instance->setup_constants();
179
+ self::$instance->includes();
180
+ add_action( 'init', array( self::$instance, 'load_textdomain' ) );
181
+ self::$instance->init();
182
+ }
183
+
184
+ return self::$instance;
185
+ }
186
+
187
+ /**
188
+ * Setup plugin constants
189
+ */
190
+ private function setup_constants() {
191
+
192
+ self::$DIR = plugin_dir_path( __FILE__ );
193
+ self::$URL = plugins_url( '/', __FILE__ );
194
+ self::$FILE = __FILE__;
195
+
196
+ if ( isset( $_GET['pum_debug'] ) || PUM_Utils_Options::get( 'debug_mode', false ) ) {
197
+ self::$DEBUG_MODE = true;
198
+ }
199
+
200
+ if ( ! defined( 'POPMAKE' ) ) {
201
+ define( 'POPMAKE', self::$FILE );
202
+ }
203
+
204
+ if ( ! defined( 'POPMAKE_NAME' ) ) {
205
+ define( 'POPMAKE_NAME', self::$NAME );
206
+ }
207
+
208
+ if ( ! defined( 'POPMAKE_SLUG' ) ) {
209
+ define( 'POPMAKE_SLUG', trim( dirname( plugin_basename( __FILE__ ) ), '/' ) );
210
+ }
211
+
212
+ if ( ! defined( 'POPMAKE_DIR' ) ) {
213
+ define( 'POPMAKE_DIR', self::$DIR );
214
+ }
215
+
216
+ if ( ! defined( 'POPMAKE_URL' ) ) {
217
+ define( 'POPMAKE_URL', self::$URL );
218
+ }
219
+
220
+ if ( ! defined( 'POPMAKE_NONCE' ) ) {
221
+ define( 'POPMAKE_NONCE', 'popmake_nonce' );
222
+ }
223
+
224
+ if ( ! defined( 'POPMAKE_VERSION' ) ) {
225
+ define( 'POPMAKE_VERSION', self::$VER );
226
+ }
227
+
228
+ if ( ! defined( 'POPMAKE_DB_VERSION' ) ) {
229
+ define( 'POPMAKE_DB_VERSION', self::$DB_VER );
230
+ }
231
+
232
+ if ( ! defined( 'POPMAKE_API_URL' ) ) {
233
+ define( 'POPMAKE_API_URL', self::$API_URL );
234
+ }
235
+ }
236
+
237
+ /**
238
+ * Include required files
239
+ */
240
+ private function includes() {
241
+
242
+ require_once self::$DIR . 'includes/compat.php';
243
+
244
+ // Initialize global options
245
+ PUM_Utils_Options::init();
246
+
247
+ /** Loads most of our core functions */
248
+ require_once self::$DIR . 'includes/functions.php';
249
+
250
+ /** Deprecated functionality */
251
+ require_once self::$DIR . 'includes/functions-backcompat.php';
252
+ require_once self::$DIR . 'includes/functions-deprecated.php';
253
+ require_once self::$DIR . 'includes/deprecated-classes.php';
254
+ require_once self::$DIR . 'includes/deprecated-filters.php';
255
+ require_once self::$DIR . 'includes/integrations.php';
256
+
257
+ // Old Stuff.
258
+ require_once self::$DIR . 'includes/defaults.php';
259
+ require_once self::$DIR . 'includes/input-options.php';
260
+
261
+ require_once self::$DIR . 'includes/importer/easy-modal-v2.php';
262
+
263
+ // Phasing Out
264
+ require_once self::$DIR . 'includes/class-popmake-fields.php';
265
+ require_once self::$DIR . 'includes/class-popmake-popup-fields.php';
266
+
267
+ /**
268
+ * v1.4 Additions
269
+ */
270
+ require_once self::$DIR . 'includes/class-pum-fields.php';
271
+ require_once self::$DIR . 'includes/class-pum-form.php';
272
+
273
+ // Modules
274
+ require_once self::$DIR . 'includes/modules/menus.php';
275
+ require_once self::$DIR . 'includes/modules/admin-bar.php';
276
+ require_once self::$DIR . 'includes/modules/reviews.php';
277
+
278
+ require_once self::$DIR . 'includes/pum-install-functions.php';
279
+ }
280
+
281
+ /**
282
+ * Loads the plugin language files
283
+ */
284
+ public function load_textdomain() {
285
+ // Set filter for plugin's languages directory
286
+ $lang_dir = apply_filters( 'pum_lang_dir', dirname( plugin_basename( POPMAKE ) ) . '/languages/' );
287
+ $lang_dir = apply_filters( 'popmake_languages_directory', $lang_dir );
288
+
289
+ // Try to load Langpacks first, if they are not available fallback to local files.
290
+ if ( ! load_plugin_textdomain( 'popup-maker', false, $lang_dir ) ) {
291
+ // Traditional WordPress plugin locale filter
292
+ $locale = apply_filters( 'plugin_locale', get_locale(), 'popup-maker' );
293
+ $mofile = sprintf( '%1$s-%2$s.mo', 'popup-maker', $locale );
294
+
295
+ // Setup paths to current locale file
296
+ $mofile_local = $lang_dir . $mofile;
297
+ $mofile_global = WP_LANG_DIR . '/popup-maker/' . $mofile;
298
+
299
+ if ( file_exists( $mofile_global ) ) {
300
+ // Look in global /wp-content/languages/popup-maker folder
301
+ load_textdomain( 'popup-maker', $mofile_global );
302
+ } elseif ( file_exists( $mofile_local ) ) {
303
+ // Look in local /wp-content/plugins/popup-maker/languages/ folder
304
+ load_textdomain( 'popup-maker', $mofile_local );
305
+ }
306
+ }
307
+ }
308
+
309
+ public function init() {
310
+ $this->cron = new PUM_Utils_Cron;
311
+ $this->popups = new PUM_Repository_Popups();
312
+ $this->themes = new PUM_Repository_Themes();
313
+
314
+ PUM_Types::init();
315
+ PUM_AssetCache::init();
316
+ PUM_Site::init();
317
+ PUM_Admin::init();
318
+ PUM_Utils_Upgrades::instance();
319
+ PUM_Newsletters::init();
320
+ PUM_Previews::init();
321
+ PUM_Integrations::init();
322
+ PUM_Privacy::init();
323
+
324
+ PUM_Utils_Alerts::init();
325
+
326
+ PUM_Shortcode_Popup::init();
327
+ PUM_Shortcode_PopupTrigger::init();
328
+ PUM_Shortcode_PopupClose::init();
329
+ PUM_Shortcode_PopupCookie::init();
330
+
331
+ PUM_Telemetry::init();
332
+ }
333
+
334
+ /**
335
+ * Returns true when debug mode is enabled.
336
+ *
337
+ * @return bool
338
+ */
339
+ public static function debug_mode() {
340
+ return true === self::$DEBUG_MODE;
341
+ }
342
+
343
+ }
344
+
345
+ /**
346
+ * The main function responsible for returning the one true Popup_Maker
347
+ * Instance to functions everywhere.
348
+ *
349
+ * Use this function like you would a global variable, except without needing
350
+ * to declare the global.
351
+ *
352
+ * @return Popup_Maker
353
+ * @since 1.8.0
354
+ *
355
+ */
356
+ function pum() {
357
+ return Popup_Maker::instance();
358
+ }
359
+
360
+ /**
361
+ * Initialize Popup Maker if requirements are met.
362
+ */
363
+ function pum_init() {
364
+ if ( ! PUM_Install::meets_activation_requirements() ) {
365
+ require_once 'includes/failsafes.php';
366
+ add_action( 'admin_notices', array( 'PUM_Install', 'activation_failure_admin_notice' ) );
367
+ return;
368
+ }
369
+
370
+ // Get Popup Maker
371
+ pum();
372
+
373
+ add_action( 'plugins_loaded', 'popmake_initialize' );
374
+ }
375
+
376
+ // Get Popup Maker running
377
+ add_action( 'plugins_loaded', 'pum_init', 9 );
378
+
379
+ // Ensure plugin & environment compatibility.
380
+ register_activation_hook( __FILE__, array( 'PUM_Install', 'activation_check' ) );
381
+
382
+ // Register activation, deactivation & uninstall hooks.
383
+ register_activation_hook( __FILE__, array( 'PUM_Install', 'activate_plugin' ) );
384
+ register_deactivation_hook( __FILE__, array( 'PUM_Install', 'deactivate_plugin' ) );
385
+ register_uninstall_hook( __FILE__, array( 'PUM_Install', 'uninstall_plugin' ) );
386
+
387
+ /**
388
+ * @deprecated 1.7.0
389
+ */
390
+ function popmake_initialize() {
391
+ // Disable Unlimited Themes extension if active.
392
+ remove_action( 'popmake_initialize', 'popmake_ut_initialize' );
393
+
394
+ // Initialize old PUM extensions
395
+ do_action( 'pum_initialize' );
396
+ do_action( 'popmake_initialize' );
397
+ }
398
+
399
+ /**
400
+ * The main function responsible for returning the one true Popup_Maker
401
+ * Instance to functions everywhere.
402
+ *
403
+ * Use this function like you would a global variable, except without needing
404
+ * to declare the global.
405
+ *
406
+ * Example: <?php $popmake = PopMake(); ?>
407
+ *
408
+ * @return object The one true Popup_Maker Instance
409
+ * @deprecated 1.7.0
410
+ *
411
+ * @since 1.0
412
+ */
413
+ function PopMake() {
414
+ return Popup_Maker::instance();
415
+ }
416
+
417
+ /**
418
+ * This is currently here until we reorganize the plugin file structure to handle package loading & composer autoloading with failure notices.
419
+ */
420
+ require_once( plugin_dir_path( __FILE__ ) . '/packages/action-scheduler/action-scheduler.php' );
readme.txt CHANGED
@@ -1,176 +1,179 @@
1
- === Popup Maker - Popup Forms, Opt-ins & More ===
2
- Contributors: danieliser, codeatlantic
3
- Author URI: https://wppopupmaker.com/?utm_source=readme-header&utm_campaign=Readme&utm_medium=author-uri
4
- Plugin URI: https://wppopupmaker.com/?utm_capmaign=Readme&utm_source=readme-header&utm_medium=plugin-uri
5
- Donate link:
6
- Tags: marketing, popup, popups, optin, advertising, conversion, responsive popups, promotion, popover, pop-up, pop over, lightbox, conversion, modal
7
- Requires at least: 4.1
8
- Tested up to: 5.4
9
- Requires PHP: 5.6
10
- Stable tag: 1.11.0
11
- License: GPLv2 or later
12
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
-
14
- Everything you need to create unique popup user experiences. Insert forms & other content from your favorite plugins to create custom responsive popups.
15
-
16
- == Description ==
17
-
18
- = Create Effective Popups For WordPress =
19
- [Popup Maker](https://wppopupmaker.com)™ is the **best popup plugin WordPress** has to offer. It is incredibly versatile & flexible. Bend it to create any type of popup, modal, or content overlay for your WordPress website.
20
-
21
- > **Great plugin! Got the job done**
22
- > "Love how easy it was to make popups with this!" ~[Zac Gordon](https://wordpress.org/support/topic/great-plugin-got-the-job-done/)
23
-
24
- With Popup Maker, you can create popups such as:
25
-
26
- * Email opt-in popups,
27
- * Content upgrade popups,
28
- * Popups to greet visitors from ProductHunt,
29
- * Contact form popups,
30
- * Coronavirus/COVID-19 announcements,
31
- * [EU cookie notices](https://ninjaforms.com/eu-cookie-notices-ninja-forms/),
32
- * Slide-ins,
33
- * & more.
34
-
35
- Check out some examples in our video below:
36
-
37
- https://www.youtube.com/watch?v=PomnMganMVM
38
-
39
- [Stunning examples of what you can create in Popup Maker **(View Video)**](https://www.youtube.com/watch?v=PomnMganMVM)
40
-
41
- Create unlimited popups of every type you need and customize every facet of each of your popups from theme and position, to targeting and cookies.
42
-
43
- = Trusted by many people just like you! =
44
- Popup Maker is used on over 500,000 websites and has received over 3,500 5-star reviews just like this one:
45
-
46
- > **Great product – best I’ve used!**
47
- > "I’ve tried many different popup programs, but I must say I find this one the best!" ~[@jessefjosserand](https://wordpress.org/support/topic/great-product-best-ive-used/)
48
-
49
- = What's Included for Free: =
50
-
51
- * This popup plugin has limitless potential with no restrictions. If you can’t get the functionality you’re after, we’ll be happy to help you! Just ask at [https://wppopupmaker.com/support/](https://wppopupmaker.com/support/).
52
- * Slide Out Popups, Banner Bars, Floating Sticky Popups, Notification Popups, Loading Screen Popups, Video Lightboxes, and Opt-In Form Popups.
53
- * Our popups support the most popular form building plugins available: Ninja Forms, Gravity Forms, Contact Form 7 (CF7), Caldera Forms, WPForms, Mailchimp for WordPress (MC4WP), & More.
54
- * We support every list building form, including but not limited to: MailChimp, AWeber, InfusionSoft, GetResponse, Constant Contact, Mail Poet, Mad Mimi, Hubspot, and Emma.
55
- * Use our unique **Popup Editor** to build any content you can imagine inside of our popups, plus control popup sizing, position, animation, and so much more.
56
- * **Conditions** allow you to target exactly who will (and will not) see your popups. Target any WordPress content such as: posts, pages, and 26 more!
57
- * Create WooCommerce popups easily with built in targeting rules for Products & Shop pages.
58
- * Dictate the frequency at which users see your popups using **Cookies**, and edit how the cookies are created using Cookie Creation Events.
59
- * **Click Triggers** allows you to trigger a popup on click of menu items, sidebars, buttons, images, or any other content on your site. We have various methods allowing you to integrate our click triggers with nearly any plugin or theme.
60
- * **Auto Open Triggers** allows you to set a **timed delay**, then the popup will display according to your preference.
61
- * Trove of options to customize the look of your popup using our unique **Theme Editor**. Change colors, shadows, fonts, paddings, and much, much more.
62
-
63
- > **Great plugin, everything I needed**
64
- > "Really nice plugin, simple to use, responsive, a good catch !" ~[@lemmmy](https://wordpress.org/support/topic/great-plugin-everything-i-needed/)
65
-
66
- = Enhance Your WordPress Popups Using Our Premium Features =
67
-
68
- * [Exit Intent](https://wppopupmaker.com/extensions/exit-intent/?utm_source=readme-description&utm_medium=text-link&utm_campaign=Upsell&utm_content=exit-intent "Exit Intent")
69
- * [AJAX Login Modals](https://wppopupmaker.com/extensions/ajax-login-modals/?utm_source=readme-description&utm_medium=text-link&utm_campaign=Upsell&utm_content=ajax-login-modal "AJAX Login Modals")
70
- * [Age Verification Modals](https://wppopupmaker.com/extensions/age-verification-modals/?utm_source=readme-description&utm_medium=text-link&utm_campaign=Upsell&utm_content=age-verification-modals "Age Verification Modals") - Verify the age of your users before allowing them to view pages or click buttons/links.
71
- * [Popup Analytics](https://wppopupmaker.com/extensions/popup-analytics/?utm_source=readme-description&utm_medium=text-link&utm_campaign=Upsell&utm_content=popup-analytics "Popup Analytics")
72
- * [Advanced Targeting Conditions](https://wppopupmaker.com/extensions/advanced-targeting-conditions/?utm_source=readme-description&utm_medium=text-link&utm_campaign=Upsell&utm_content=advanced-targeting-conditions "Advanced Targeting Conditions")
73
- * And [many more](https://wppopupmaker.com/extensions/)!
74
-
75
- Follow this plugin on [GitHub](https://github.com/PopupMaker/Popup-Maker) and [Twitter](https://twitter.com/wppopupmaker)!
76
-
77
- Would you like to help translate the **best WordPress popup plugin** into more languages? [Join our WP-Translations Community](https://translate.wordpress.org/projects/wp-plugins/popup-maker).
78
-
79
- If you are enjoying this wonderful popup plugin, [please rate & review it](https://wppopupmaker.com/rate-us/?utm_source=readme-description&utm_medium=text-link&utm_campaign=Readme&utm_content=rate-us) to share the love <3!
80
-
81
- = Created by Code Atlantic =
82
-
83
- Popup Maker is built by the [Code Atlantic][codeatlantic] team. We create high-quality WordPress plugins that help you grow your WordPress sites.
84
-
85
- Check out some of our most popular plugins:
86
-
87
- * [User Menus][usermenus] - Show Or Hide Menu Items For Different Users
88
- * [Content Control][contentcontrol] - Restrict Access to Pages and Posts
89
-
90
-
91
- [codeatlantic]: https://code-atlantic.com "Code Atlantic - High Quality WordPress Plugins"
92
-
93
- [usermenus]: https://wordpress.org/plugins/user-menus/ "Show Or Hide Menu Items For Different Users"
94
-
95
- [contentcontrol]: https://wordpress.org/plugins/content-control/ "Control Who Can Access Content"
96
-
97
- == Frequently Asked Questions ==
98
-
99
- = Where is your documentation? =
100
- You can find our documentation over on [our docs site](https://docs.wppopupmaker.com?utm_medium=text-doclink&utm_campaign=Readme&utm_source=readme-faq&utm_content=where-are-docs)
101
-
102
- = How do I open a popup? =
103
- Using "triggers", you can customize what makes each popup open. Review [our triggers documentation here](https://docs.wppopupmaker.com/article/141-triggers-cookies?utm_medium=text-doclink&utm_campaign=Readme&utm_source=readme-faq&utm_content=open-a-popup)
104
-
105
- = How do I stop popups from opening repeatedly? =
106
- Using "cookies", you can set up how long until the popup opens again, if ever. Review [our cookies documentation](https://docs.wppopupmaker.com/article/148-cookies?utm_medium=text-doclink&utm_campaign=Readme&utm_source=readme-faq&utm_content=stop-opening-repeatedly)
107
-
108
- = What do I do if I want a popup to show only on a certain page/post/etc? =
109
- Using "conditions", you can specify where the popup will be shown. Check out [our conditions documentation](https://docs.wppopupmaker.com/article/140-conditions?utm_medium=text-doclink&utm_campaign=Readme&utm_source=readme-faq&utm_content=target-certain-pages)
110
-
111
- = How do I make it work with my 3rd party forms? =
112
- Beginning with Popup Maker v1.7, we now support most forms by default. We do this by adding a hidden field using JavaScript to any form inserted in a popup. This field contains the popup ID.
113
-
114
- When we detect that ID in PHP, we queue up that popup to reopen immediately after refresh to show errors or success messages.
115
-
116
- = How do I take advantage of the success actions Popup Maker provides for 3rd party forms? =
117
- We have built-in support for the most popular form plugins. But if we don't, then we have a few helper functions that allow you to take full advantage of our success actions and setting cookies.
118
-
119
- This link contains AJAX (JavaScript) & Non-AJAX (PHP) based solutions which you can hack with your forms hooks & events. https://gist.github.com/danieliser/0060112b18b6013f2683653236b02439
120
-
121
- = Why aren't my popups opening/working? =
122
- There are several common causes for this, check [this guide for help](https://docs.wppopupmaker.com/article/265-my-popup-wont-work-how-can-i-fix-it?utm_medium=text-doclink&utm_campaign=Readme&utm_source=readme-faq&utm_content=popup-wont-open) resolving it.
123
-
124
- == Screenshots ==
125
-
126
- 1. Create and edit an infinite number of unique popups to get any job done.
127
- 2. Use our popup editor to customize every facet of your popup completely.
128
- 3. Use the display settings in the popup editor and choose from an abundance of options, including responsive sizes and animation types!
129
- 4. Add triggers to your popups to determine what causes it to open. Our free triggers include: Click Open and Auto Open.
130
- 5. Choose from many conditions to target exactly who will (and will not) see your popups.
131
- 6. Prevent your popups from being annoying to users by using cookies to disable them once they have been viewed.
132
- 7. Create and edit an unlimited number of popup themes for every situation.
133
- 8. Use the theme editor to choose from over 60 options and theme every element of your popup: Background Overlay, Popup Container, Close Button, Google Fonts, and much more.
134
-
135
- == Changelog ==
136
-
137
- 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.
138
-
139
- = v1.11.0 - 06/25/2020 =
140
- * Feature: Add new floating bar theme.
141
- * Feature: New guided tour of popup editor for first time users.
142
- * Feature: New href attribute on the popup_close shortcode for when setting the shortcode to use the `a` tag.
143
- * Fix: Shortcode popup_close tag attribute not functioning properly.
144
- * Tweak: Change popup_close tag setting to use a drop-down for more easily selecting which tag to use.
145
- * Tweak: Improve explanation of cookies in new trigger modal.
146
- * Tweak: Ensure all admin pages have visible page headings.
147
- * Tweak: Simplify name and title fields in popup editor.
148
- * Tweak: Add popup ID to quick links on All Popups.
149
- * Tweak: Move CSS and JS for our admin bar node to external file.
150
- * Tweak: Add our new optional telemetry system.
151
-
152
- = v1.10.2 - 06/09/2020 =
153
- * Fix: Popup Settings not working when WP Forms is active without forms
154
- * Fix: Missing closing div in new [popup_cookie] shortcode.
155
-
156
- = v1.10.1 - 04/21/2020 =
157
- * Fix: Typo in filter name caused extra p tags.
158
- * Fix: Add wp version check to prevent calling block functions on older versions or classicpress.
159
- * Fix: Font Awesome support now works for v4 fonts.
160
-
161
- = v1.10.0 - 04/20/2020 =
162
- * Feature: Display presets for top bar, bottom right slide-ins, full-screen popups & bottom left notifications to make it simple to get common setups done much quicker
163
- * Feature: Popup Trigger inline text format for the block editor.
164
- * Feature: Turn any block in Gutenberg block editor into a popup trigger.
165
- * Feature: Font Awesome support added to close button text setting.
166
- * Feature: Play a sound when a popup is opened. Choose from 5 included sounds or upload your own.
167
- * Feature: Insert customizable [popup_cookie] shortcode on thank you pages when using non-integrated forms.
168
- * Tweak: Add option to disable or adjust the padding-right added to body.
169
- * Tweak: Remove Freemius integration from Popup Maker.
170
- * Improvement: Detect file permission issues with Asset Caching functionality.
171
- * Improvement: Update popup content filters to match core, including responsive image handling.
172
- * Fix: Prevent popups from going off the screen when using center position for a tall popup.
173
- * Fix: Bug in slide animation origin positioning for bottom or right origins.
174
- * Fix: Bug where Middle Center caused tall popups to hang off the screen on small screens.
175
- * Fix: Typo in admin editor CSS path.
176
- * Fix: Bug on fresh installs where default theme's close position is wrong.
 
 
 
1
+ === Popup Maker - Popup Forms, Opt-ins & More ===
2
+ Contributors: danieliser, codeatlantic
3
+ Author URI: https://wppopupmaker.com/?utm_source=readme-header&utm_campaign=Readme&utm_medium=author-uri
4
+ Plugin URI: https://wppopupmaker.com/?utm_capmaign=Readme&utm_source=readme-header&utm_medium=plugin-uri
5
+ Donate link:
6
+ Tags: marketing, popup, popups, optin, advertising, conversion, responsive popups, promotion, popover, pop-up, pop over, lightbox, conversion, modal
7
+ Requires at least: 4.1
8
+ Tested up to: 5.4
9
+ Requires PHP: 5.6
10
+ Stable tag: 1.11.1
11
+ License: GPLv2 or later
12
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
+
14
+ Everything you need to create unique popup user experiences. Insert forms & other content from your favorite plugins to create custom responsive popups.
15
+
16
+ == Description ==
17
+
18
+ = Create Effective Popups For WordPress =
19
+ [Popup Maker](https://wppopupmaker.com)™ is the **best popup plugin WordPress** has to offer. It is incredibly versatile & flexible. Bend it to create any type of popup, modal, or content overlay for your WordPress website.
20
+
21
+ > **Great plugin! Got the job done**
22
+ > "Love how easy it was to make popups with this!" ~[Zac Gordon](https://wordpress.org/support/topic/great-plugin-got-the-job-done/)
23
+
24
+ With Popup Maker, you can create popups such as:
25
+
26
+ * Email opt-in popups,
27
+ * Content upgrade popups,
28
+ * Popups to greet visitors from ProductHunt,
29
+ * Contact form popups,
30
+ * Coronavirus/COVID-19 announcements,
31
+ * [EU cookie notices](https://ninjaforms.com/eu-cookie-notices-ninja-forms/),
32
+ * Slide-ins,
33
+ * & more.
34
+
35
+ Check out some examples in our video below:
36
+
37
+ https://www.youtube.com/watch?v=PomnMganMVM
38
+
39
+ [Stunning examples of what you can create in Popup Maker **(View Video)**](https://www.youtube.com/watch?v=PomnMganMVM)
40
+
41
+ Create unlimited popups of every type you need and customize every facet of each of your popups from theme and position, to targeting and cookies.
42
+
43
+ = Trusted by many people just like you! =
44
+ Popup Maker is used on over 500,000 websites and has received over 3,500 5-star reviews just like this one:
45
+
46
+ > **Great product – best I’ve used!**
47
+ > "I’ve tried many different popup programs, but I must say I find this one the best!" ~[@jessefjosserand](https://wordpress.org/support/topic/great-product-best-ive-used/)
48
+
49
+ = What's Included for Free: =
50
+
51
+ * This popup plugin has limitless potential with no restrictions. If you can’t get the functionality you’re after, we’ll be happy to help you! Just ask at [https://wppopupmaker.com/support/](https://wppopupmaker.com/support/).
52
+ * Slide Out Popups, Banner Bars, Floating Sticky Popups, Notification Popups, Loading Screen Popups, Video Lightboxes, and Opt-In Form Popups.
53
+ * Our popups support the most popular form building plugins available: Ninja Forms, Gravity Forms, Contact Form 7 (CF7), Caldera Forms, WPForms, Mailchimp for WordPress (MC4WP), & More.
54
+ * We support every list building form, including but not limited to: MailChimp, AWeber, InfusionSoft, GetResponse, Constant Contact, Mail Poet, Mad Mimi, Hubspot, and Emma.
55
+ * Use our unique **Popup Editor** to build any content you can imagine inside of our popups, plus control popup sizing, position, animation, and so much more.
56
+ * **Conditions** allow you to target exactly who will (and will not) see your popups. Target any WordPress content such as: posts, pages, and 26 more!
57
+ * Create WooCommerce popups easily with built in targeting rules for Products & Shop pages.
58
+ * Dictate the frequency at which users see your popups using **Cookies**, and edit how the cookies are created using Cookie Creation Events.
59
+ * **Click Triggers** allows you to trigger a popup on click of menu items, sidebars, buttons, images, or any other content on your site. We have various methods allowing you to integrate our click triggers with nearly any plugin or theme.
60
+ * **Auto Open Triggers** allows you to set a **timed delay**, then the popup will display according to your preference.
61
+ * Trove of options to customize the look of your popup using our unique **Theme Editor**. Change colors, shadows, fonts, paddings, and much, much more.
62
+
63
+ > **Great plugin, everything I needed**
64
+ > "Really nice plugin, simple to use, responsive, a good catch !" ~[@lemmmy](https://wordpress.org/support/topic/great-plugin-everything-i-needed/)
65
+
66
+ = Enhance Your WordPress Popups Using Our Premium Features =
67
+
68
+ * [Exit Intent](https://wppopupmaker.com/extensions/exit-intent/?utm_source=readme-description&utm_medium=text-link&utm_campaign=Upsell&utm_content=exit-intent "Exit Intent")
69
+ * [AJAX Login Modals](https://wppopupmaker.com/extensions/ajax-login-modals/?utm_source=readme-description&utm_medium=text-link&utm_campaign=Upsell&utm_content=ajax-login-modal "AJAX Login Modals")
70
+ * [Age Verification Modals](https://wppopupmaker.com/extensions/age-verification-modals/?utm_source=readme-description&utm_medium=text-link&utm_campaign=Upsell&utm_content=age-verification-modals "Age Verification Modals") - Verify the age of your users before allowing them to view pages or click buttons/links.
71
+ * [Popup Analytics](https://wppopupmaker.com/extensions/popup-analytics/?utm_source=readme-description&utm_medium=text-link&utm_campaign=Upsell&utm_content=popup-analytics "Popup Analytics")
72
+ * [Advanced Targeting Conditions](https://wppopupmaker.com/extensions/advanced-targeting-conditions/?utm_source=readme-description&utm_medium=text-link&utm_campaign=Upsell&utm_content=advanced-targeting-conditions "Advanced Targeting Conditions")
73
+ * And [many more](https://wppopupmaker.com/extensions/)!
74
+
75
+ Follow this plugin on [GitHub](https://github.com/PopupMaker/Popup-Maker) and [Twitter](https://twitter.com/wppopupmaker)!
76
+
77
+ Would you like to help translate the **best WordPress popup plugin** into more languages? [Join our WP-Translations Community](https://translate.wordpress.org/projects/wp-plugins/popup-maker).
78
+
79
+ If you are enjoying this wonderful popup plugin, [please rate & review it](https://wppopupmaker.com/rate-us/?utm_source=readme-description&utm_medium=text-link&utm_campaign=Readme&utm_content=rate-us) to share the love <3!
80
+
81
+ = Created by Code Atlantic =
82
+
83
+ Popup Maker is built by the [Code Atlantic][codeatlantic] team. We create high-quality WordPress plugins that help you grow your WordPress sites.
84
+
85
+ Check out some of our most popular plugins:
86
+
87
+ * [User Menus][usermenus] - Show Or Hide Menu Items For Different Users
88
+ * [Content Control][contentcontrol] - Restrict Access to Pages and Posts
89
+
90
+
91
+ [codeatlantic]: https://code-atlantic.com "Code Atlantic - High Quality WordPress Plugins"
92
+
93
+ [usermenus]: https://wordpress.org/plugins/user-menus/ "Show Or Hide Menu Items For Different Users"
94
+
95
+ [contentcontrol]: https://wordpress.org/plugins/content-control/ "Control Who Can Access Content"
96
+
97
+ == Frequently Asked Questions ==
98
+
99
+ = Where is your documentation? =
100
+ You can find our documentation over on [our docs site](https://docs.wppopupmaker.com?utm_medium=text-doclink&utm_campaign=Readme&utm_source=readme-faq&utm_content=where-are-docs)
101
+
102
+ = How do I open a popup? =
103
+ Using "triggers", you can customize what makes each popup open. Review [our triggers documentation here](https://docs.wppopupmaker.com/article/141-triggers-cookies?utm_medium=text-doclink&utm_campaign=Readme&utm_source=readme-faq&utm_content=open-a-popup)
104
+
105
+ = How do I stop popups from opening repeatedly? =
106
+ Using "cookies", you can set up how long until the popup opens again, if ever. Review [our cookies documentation](https://docs.wppopupmaker.com/article/148-cookies?utm_medium=text-doclink&utm_campaign=Readme&utm_source=readme-faq&utm_content=stop-opening-repeatedly)
107
+
108
+ = What do I do if I want a popup to show only on a certain page/post/etc? =
109
+ Using "conditions", you can specify where the popup will be shown. Check out [our conditions documentation](https://docs.wppopupmaker.com/article/140-conditions?utm_medium=text-doclink&utm_campaign=Readme&utm_source=readme-faq&utm_content=target-certain-pages)
110
+
111
+ = How do I make it work with my 3rd party forms? =
112
+ Beginning with Popup Maker v1.7, we now support most forms by default. We do this by adding a hidden field using JavaScript to any form inserted in a popup. This field contains the popup ID.
113
+
114
+ When we detect that ID in PHP, we queue up that popup to reopen immediately after refresh to show errors or success messages.
115
+
116
+ = How do I take advantage of the success actions Popup Maker provides for 3rd party forms? =
117
+ We have built-in support for the most popular form plugins. But if we don't, then we have a few helper functions that allow you to take full advantage of our success actions and setting cookies.
118
+
119
+ This link contains AJAX (JavaScript) & Non-AJAX (PHP) based solutions which you can hack with your forms hooks & events. https://gist.github.com/danieliser/0060112b18b6013f2683653236b02439
120
+
121
+ = Why aren't my popups opening/working? =
122
+ There are several common causes for this, check [this guide for help](https://docs.wppopupmaker.com/article/265-my-popup-wont-work-how-can-i-fix-it?utm_medium=text-doclink&utm_campaign=Readme&utm_source=readme-faq&utm_content=popup-wont-open) resolving it.
123
+
124
+ == Screenshots ==
125
+
126
+ 1. Create and edit an infinite number of unique popups to get any job done.
127
+ 2. Use our popup editor to customize every facet of your popup completely.
128
+ 3. Use the display settings in the popup editor and choose from an abundance of options, including responsive sizes and animation types!
129
+ 4. Add triggers to your popups to determine what causes it to open. Our free triggers include: Click Open and Auto Open.
130
+ 5. Choose from many conditions to target exactly who will (and will not) see your popups.
131
+ 6. Prevent your popups from being annoying to users by using cookies to disable them once they have been viewed.
132
+ 7. Create and edit an unlimited number of popup themes for every situation.
133
+ 8. Use the theme editor to choose from over 60 options and theme every element of your popup: Background Overlay, Popup Container, Close Button, Google Fonts, and much more.
134
+
135
+ == Changelog ==
136
+
137
+ 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.
138
+
139
+ = v1.11.1 - 07/22/2020 =
140
+ * Fix: Form submission cookies no longer set with Contact Form 7 5.2
141
+
142
+ = v1.11.0 - 06/25/2020 =
143
+ * Feature: Add new floating bar theme.
144
+ * Feature: New guided tour of popup editor for first time users.
145
+ * Feature: New href attribute on the popup_close shortcode for when setting the shortcode to use the `a` tag.
146
+ * Fix: Shortcode popup_close tag attribute not functioning properly.
147
+ * Tweak: Change popup_close tag setting to use a drop-down for more easily selecting which tag to use.
148
+ * Tweak: Improve explanation of cookies in new trigger modal.
149
+ * Tweak: Ensure all admin pages have visible page headings.
150
+ * Tweak: Simplify name and title fields in popup editor.
151
+ * Tweak: Add popup ID to quick links on All Popups.
152
+ * Tweak: Move CSS and JS for our admin bar node to external file.
153
+ * Tweak: Add our new optional telemetry system.
154
+
155
+ = v1.10.2 - 06/09/2020 =
156
+ * Fix: Popup Settings not working when WP Forms is active without forms
157
+ * Fix: Missing closing div in new [popup_cookie] shortcode.
158
+
159
+ = v1.10.1 - 04/21/2020 =
160
+ * Fix: Typo in filter name caused extra p tags.
161
+ * Fix: Add wp version check to prevent calling block functions on older versions or classicpress.
162
+ * Fix: Font Awesome support now works for v4 fonts.
163
+
164
+ = v1.10.0 - 04/20/2020 =
165
+ * Feature: Display presets for top bar, bottom right slide-ins, full-screen popups & bottom left notifications to make it simple to get common setups done much quicker
166
+ * Feature: Popup Trigger inline text format for the block editor.
167
+ * Feature: Turn any block in Gutenberg block editor into a popup trigger.
168
+ * Feature: Font Awesome support added to close button text setting.
169
+ * Feature: Play a sound when a popup is opened. Choose from 5 included sounds or upload your own.
170
+ * Feature: Insert customizable [popup_cookie] shortcode on thank you pages when using non-integrated forms.
171
+ * Tweak: Add option to disable or adjust the padding-right added to body.
172
+ * Tweak: Remove Freemius integration from Popup Maker.
173
+ * Improvement: Detect file permission issues with Asset Caching functionality.
174
+ * Improvement: Update popup content filters to match core, including responsive image handling.
175
+ * Fix: Prevent popups from going off the screen when using center position for a tall popup.
176
+ * Fix: Bug in slide animation origin positioning for bottom or right origins.
177
+ * Fix: Bug where Middle Center caused tall popups to hang off the screen on small screens.
178
+ * Fix: Typo in admin editor CSS path.
179
+ * Fix: Bug on fresh installs where default theme's close position is wrong.