FooGallery – Image Gallery WordPress Plugin - Version 1.9.37

Version Description

  • Date Updated : 2020-10-29
  • Update : Ensure Gallery Items and Settings metaboxes are always visible when editing a gallery
Download this release

Release Info

Developer bradvin
Plugin Icon 128x128 FooGallery – Image Gallery WordPress Plugin
Version 1.9.37
Comparing to
See all releases

Code changes from version 1.9.34 to 1.9.37

Files changed (45) hide show
  1. README.txt +40 -4
  2. foogallery.php +2 -2
  3. freemius/assets/css/admin/account.css +1 -1
  4. freemius/assets/css/admin/add-ons.css +2 -2
  5. freemius/config.php +4 -1
  6. freemius/includes/class-freemius.php +107 -6
  7. freemius/includes/class-fs-plugin-updater.php +49 -6
  8. freemius/includes/customizer/class-fs-customizer-support-section.php +101 -101
  9. freemius/includes/entities/class-fs-payment.php +167 -167
  10. freemius/includes/entities/class-fs-plugin-license.php +330 -330
  11. freemius/includes/entities/class-fs-site.php +235 -235
  12. freemius/includes/fs-plugin-info-dialog.php +16 -10
  13. freemius/includes/i18n.php +2 -0
  14. freemius/includes/managers/class-fs-admin-menu-manager.php +1005 -1005
  15. freemius/includes/sdk/FreemiusWordPress.php +5 -1
  16. freemius/includes/supplements/fs-essential-functions-1.1.7.1.php +43 -43
  17. freemius/languages/freemius-cs_CZ.mo +0 -0
  18. freemius/languages/freemius-da_DK.mo +0 -0
  19. freemius/languages/freemius-en.mo +0 -0
  20. freemius/languages/freemius-es_ES.mo +0 -0
  21. freemius/languages/freemius-fr_FR.mo +0 -0
  22. freemius/languages/freemius-he_IL.mo +0 -0
  23. freemius/languages/freemius-hu_HU.mo +0 -0
  24. freemius/languages/freemius-it_IT.mo +0 -0
  25. freemius/languages/freemius-ja.mo +0 -0
  26. freemius/languages/freemius-nl_NL.mo +0 -0
  27. freemius/languages/freemius-ru_RU.mo +0 -0
  28. freemius/languages/freemius-ta.mo +0 -0
  29. freemius/languages/freemius-zh_CN.mo +0 -0
  30. freemius/languages/freemius.pot +2524 -2492
  31. freemius/start.php +529 -529
  32. freemius/templates/account.php +23 -0
  33. freemius/templates/account/payments.php +58 -58
  34. freemius/templates/auto-installation.php +249 -249
  35. freemius/templates/forms/affiliation.php +508 -506
  36. freemius/templates/forms/deactivation/form.php +543 -543
  37. freemius/templates/forms/subscription-cancellation.php +276 -276
  38. freemius/templates/forms/trial-start.php +181 -181
  39. freemius/templates/partials/index.php +2 -2
  40. freemius/templates/pricing.php +208 -208
  41. freemius/templates/secure-https-header.php +38 -38
  42. includes/WPThumb/wpthumb.php +12 -10
  43. includes/admin/class-admin-notices.php +123 -1
  44. includes/admin/class-gallery-metaboxes.php +40 -0
  45. includes/functions.php +909 -839
README.txt CHANGED
@@ -12,6 +12,8 @@ FooGallery is a powerful, responsive photo gallery plugin. Stunning gallery layo
12
 
13
  == Description ==
14
 
 
 
15
  Make gallery management in WordPress great again! With FooGallery you can easily add a stunning photo gallery to your website in minutes.
16
 
17
  FooGallery is an easy-to-use image gallery plugin, with stunning gallery layouts. It is also responsive, retina-ready and supports lazy loading for lightning fast photo galleries.
@@ -22,11 +24,11 @@ FooGallery was built to be highly configurable and extendable for developers or
22
 
23
  That is why we think FooGallery is the best gallery plugin. After using it, we hope you will agree.
24
 
25
- [Visit the FooGallery Homepage](http://fooplugins.com/foogallery)
26
 
27
- **Features**
28
 
29
- The following free features make FooGallery the best gallery plugin on the market!
30
 
31
  * 6 Beautiful Image Gallery templates
32
  * Responsive Image Gallery - [demo](https://fooplugins.com/foogallery/wordpress-responsive-image-gallery/)
@@ -59,7 +61,7 @@ The following free features make FooGallery the best gallery plugin on the marke
59
  * NextGen importer tool (albums and galleries and shortcodes)
60
  * Multisite Support
61
 
62
- **PRO Features**
63
 
64
  * 3 more beautiful PRO responsive gallery templates:
65
  * Polaroid gallery template - [demo](https://fooplugins.com/foogallery/wordpress-polaroid-gallery/)
@@ -131,6 +133,12 @@ FooGallery was designed to be the most developer-friendly image gallery plugin a
131
 
132
  Thanks to Fortinet FortiGuard Labs for the security testing conducted on the plugin. FooGallery is a safer plugin thanks to them.
133
 
 
 
 
 
 
 
134
  == Installation ==
135
 
136
  1. Upload `foogallery` folder to the `/wp-content/plugins/` directory
@@ -201,6 +209,10 @@ Simply go to the FooGallery extensions page and activate the Albums extension. I
201
 
202
  Goto FooGallery Settings -> Advanced Tab and check "Disable PRO Promotions" and then save your settings.
203
 
 
 
 
 
204
  == Screenshots ==
205
 
206
  1. Gallery Edit Page
@@ -215,6 +227,19 @@ Please update in order to for FooGallery to work in WP 5.5+!
215
 
216
  == Changelog ==
217
 
 
 
 
 
 
 
 
 
 
 
 
 
 
218
  = 1.9.34 =
219
  * Date Updated : 2020-08-30
220
  * Fix : Fix for incorrect captions in some scenarios
@@ -225,6 +250,7 @@ Please update in order to for FooGallery to work in WP 5.5+!
225
  * Date Updated : 2020-08-07
226
  * Fix : IMPORTANT fix for WP 5.5 compatibility when editing galleries (gallery preview button was not showing)
227
 
 
228
  = 1.9.30 =
229
  * Date Updated : 2020-08-03
230
  * Fix : IMPORTANT fix for WP 5.5 compatibility when editing galleries (gallery template selector was not showing)
@@ -232,24 +258,28 @@ Please update in order to for FooGallery to work in WP 5.5+!
232
  * Update : improved lightbox messages when no lightboxes are installed
233
  * Update : Freemius SDK 2.4.0.1
234
 
 
235
  = 1.9.28 =
236
  * Date Updated : 2020-07-18
237
  * Fix : Fix for some installs showing thumbnail generation error
238
  * Update : better mobile support for admin settings tabs
239
  * Update : FooGallery client side 1.4.16
240
 
 
241
  = 1.9.26 =
242
  * Date Updated : 2020-06-29
243
  * Fix : Fix for All-In-One album hidden items still clickable
244
  * Fix : Fix for fatal error on some versions of PHP
245
  * Update : FooGallery client side 1.4.15
246
 
 
247
  = 1.9.25 =
248
  * Date Updated : 2020-06-04
249
  * Fix : Fixed bug to prevent infinite loop with ResizeObserver in some themes
250
  * Fix : Fixed possible text-domain issue
251
  * Update : FooGallery client side 1.4.13
252
 
 
253
  = 1.9.24 =
254
  * Date Updated : 2020-05-04
255
  * Fix : Fixed bug where thumbs were not loading on mobile in Justified and Portfolio galleries
@@ -280,6 +310,7 @@ Please update in order to for FooGallery to work in WP 5.5+!
280
  * Fix : Updated RankMath compatibility to work with pre PHP 5.4
281
  * New : Added filter "foogallery_build_dynamic_gallery" for dynamic gallery creation
282
  * New : Added WPML config file for better translations. (Also improves Polylang compatibility.)
 
283
  * Update : FooGallery client side 1.4.6 (including multiple bug fixes)
284
 
285
  = 1.9.8 =
@@ -288,24 +319,29 @@ Please update in order to for FooGallery to work in WP 5.5+!
288
  * New : Added new setting under Hover Effects : Invert Color. Invert the caption icon colors from dark to light.
289
  * New : All hover and loading icons converted to SVG format.
290
  * New : Lazy load gallery images when editing a gallery (improved performance for large galleries in the admin).
 
291
  * Fix : Previews not updating in some cases.
292
  * Update : FooGallery client side 1.4.0 (MAJOR UPDATE).
293
 
294
  = 1.8.20 =
295
  * Date Updated : 2019-11-22
296
  * Fix : Fix for Masonry template layout issue in Firefox
 
297
  * Update : FooGallery client side 1.3.6
298
 
299
  = 1.8.18 =
300
  * Date Updated : 2019-10-23
301
  * New : Elementor compatibility - gallery previews in Elementor editor work, and added a FooGallery widget to the Elementor editor
 
302
  * Fix : Images in Yoast SEO sitemaps pull correctly for all types of gallery embedding
303
  * Fix : Lazy-load issues on certain browsers (reverted back to old logic)
304
  * Fix : Updated WPThumb so that images with querystrings in the URL will work
305
  * Fix : Minor security issue fixed on the FooGallery settings page (only exploitable by administrators)
306
 
307
  = 1.8.14 =
 
308
  * New : Added setting to move "Add Media" button to front of attachment listing (Advanced tab in FooGallery Settings)
 
309
  * Fix : Lazy-load issues with Gutenberg Editor
310
  * Fix : Simple portfolio layout issue with certain themes
311
  * Update : FooGallery client side 1.3.4
12
 
13
  == Description ==
14
 
15
+ = Best Gallery Plugin =
16
+
17
  Make gallery management in WordPress great again! With FooGallery you can easily add a stunning photo gallery to your website in minutes.
18
 
19
  FooGallery is an easy-to-use image gallery plugin, with stunning gallery layouts. It is also responsive, retina-ready and supports lazy loading for lightning fast photo galleries.
24
 
25
  That is why we think FooGallery is the best gallery plugin. After using it, we hope you will agree.
26
 
27
+ [Visit the FooGallery Wordpress Gallery Plugin Homepage](http://fooplugins.com/foogallery)
28
 
29
+ = WordPress Gallery Plugin Features =
30
 
31
+ The following free features make FooGallery the **best gallery plugin** on the market!
32
 
33
  * 6 Beautiful Image Gallery templates
34
  * Responsive Image Gallery - [demo](https://fooplugins.com/foogallery/wordpress-responsive-image-gallery/)
61
  * NextGen importer tool (albums and galleries and shortcodes)
62
  * Multisite Support
63
 
64
+ = PRO Gallery Features =
65
 
66
  * 3 more beautiful PRO responsive gallery templates:
67
  * Polaroid gallery template - [demo](https://fooplugins.com/foogallery/wordpress-polaroid-gallery/)
133
 
134
  Thanks to Fortinet FortiGuard Labs for the security testing conducted on the plugin. FooGallery is a safer plugin thanks to them.
135
 
136
+ == Best Wordpress Gallery Plugin ==
137
+
138
+ We did the research. FooGallery has the best performance and has the most features out of any free WordPress gallery plugin. Read our blog post about it:
139
+
140
+ [What is the Best WordPress Gallery Plugin?](https://fooplugins.com/best-wordpress-gallery-plugin/)
141
+
142
  == Installation ==
143
 
144
  1. Upload `foogallery` folder to the `/wp-content/plugins/` directory
209
 
210
  Goto FooGallery Settings -> Advanced Tab and check "Disable PRO Promotions" and then save your settings.
211
 
212
+ = How can you claim that FooGallery is the best WordPress gallery plugin? =
213
+
214
+ We did the research and comparison. See our findings : [What is the Best WordPress Gallery Plugin?](https://fooplugins.com/best-wordpress-gallery-plugin/)
215
+
216
  == Screenshots ==
217
 
218
  1. Gallery Edit Page
227
 
228
  == Changelog ==
229
 
230
+ = 1.9.37 =
231
+ * Date Updated : 2020-10-29
232
+ * Update : Ensure Gallery Items and Settings metaboxes are always visible when editing a gallery
233
+
234
+ = 1.9.36 =
235
+ * Date Updated : 2020-10-27
236
+ * Update : Freemius SDK 2.4.1
237
+
238
+ = 1.9.35 =
239
+ * Date Updated : 2020-10-12
240
+ * Fix : Fix for thumbnail generation not working when upload folder is not HTTPS
241
+
242
+
243
  = 1.9.34 =
244
  * Date Updated : 2020-08-30
245
  * Fix : Fix for incorrect captions in some scenarios
250
  * Date Updated : 2020-08-07
251
  * Fix : IMPORTANT fix for WP 5.5 compatibility when editing galleries (gallery preview button was not showing)
252
 
253
+
254
  = 1.9.30 =
255
  * Date Updated : 2020-08-03
256
  * Fix : IMPORTANT fix for WP 5.5 compatibility when editing galleries (gallery template selector was not showing)
258
  * Update : improved lightbox messages when no lightboxes are installed
259
  * Update : Freemius SDK 2.4.0.1
260
 
261
+
262
  = 1.9.28 =
263
  * Date Updated : 2020-07-18
264
  * Fix : Fix for some installs showing thumbnail generation error
265
  * Update : better mobile support for admin settings tabs
266
  * Update : FooGallery client side 1.4.16
267
 
268
+
269
  = 1.9.26 =
270
  * Date Updated : 2020-06-29
271
  * Fix : Fix for All-In-One album hidden items still clickable
272
  * Fix : Fix for fatal error on some versions of PHP
273
  * Update : FooGallery client side 1.4.15
274
 
275
+
276
  = 1.9.25 =
277
  * Date Updated : 2020-06-04
278
  * Fix : Fixed bug to prevent infinite loop with ResizeObserver in some themes
279
  * Fix : Fixed possible text-domain issue
280
  * Update : FooGallery client side 1.4.13
281
 
282
+
283
  = 1.9.24 =
284
  * Date Updated : 2020-05-04
285
  * Fix : Fixed bug where thumbs were not loading on mobile in Justified and Portfolio galleries
310
  * Fix : Updated RankMath compatibility to work with pre PHP 5.4
311
  * New : Added filter "foogallery_build_dynamic_gallery" for dynamic gallery creation
312
  * New : Added WPML config file for better translations. (Also improves Polylang compatibility.)
313
+
314
  * Update : FooGallery client side 1.4.6 (including multiple bug fixes)
315
 
316
  = 1.9.8 =
319
  * New : Added new setting under Hover Effects : Invert Color. Invert the caption icon colors from dark to light.
320
  * New : All hover and loading icons converted to SVG format.
321
  * New : Lazy load gallery images when editing a gallery (improved performance for large galleries in the admin).
322
+
323
  * Fix : Previews not updating in some cases.
324
  * Update : FooGallery client side 1.4.0 (MAJOR UPDATE).
325
 
326
  = 1.8.20 =
327
  * Date Updated : 2019-11-22
328
  * Fix : Fix for Masonry template layout issue in Firefox
329
+
330
  * Update : FooGallery client side 1.3.6
331
 
332
  = 1.8.18 =
333
  * Date Updated : 2019-10-23
334
  * New : Elementor compatibility - gallery previews in Elementor editor work, and added a FooGallery widget to the Elementor editor
335
+
336
  * Fix : Images in Yoast SEO sitemaps pull correctly for all types of gallery embedding
337
  * Fix : Lazy-load issues on certain browsers (reverted back to old logic)
338
  * Fix : Updated WPThumb so that images with querystrings in the URL will work
339
  * Fix : Minor security issue fixed on the FooGallery settings page (only exploitable by administrators)
340
 
341
  = 1.8.14 =
342
+
343
  * New : Added setting to move "Add Media" button to front of attachment listing (Advanced tab in FooGallery Settings)
344
+
345
  * Fix : Lazy-load issues with Gutenberg Editor
346
  * Fix : Simple portfolio layout issue with certain themes
347
  * Update : FooGallery client side 1.3.4
foogallery.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin Name: FooGallery
5
  Description: FooGallery is the most intuitive and extensible gallery management tool ever created for WordPress
6
- Version: 1.9.34
7
  Author: FooPlugins
8
  Plugin URI: http://fooplugins.com/foogallery/
9
  Author URI: http://fooplugins.com
@@ -25,7 +25,7 @@ if ( function_exists( 'foogallery_fs' ) ) {
25
  define( 'FOOGALLERY_PATH', plugin_dir_path( __FILE__ ) );
26
  define( 'FOOGALLERY_URL', plugin_dir_url( __FILE__ ) );
27
  define( 'FOOGALLERY_FILE', __FILE__ );
28
- define( 'FOOGALLERY_VERSION', '1.9.34' );
29
  define( 'FOOGALLERY_SETTINGS_VERSION', '2' );
30
  require_once FOOGALLERY_PATH . 'includes/constants.php';
31
  // Create a helper function for easy SDK access.
3
  /*
4
  Plugin Name: FooGallery
5
  Description: FooGallery is the most intuitive and extensible gallery management tool ever created for WordPress
6
+ Version: 1.9.37
7
  Author: FooPlugins
8
  Plugin URI: http://fooplugins.com/foogallery/
9
  Author URI: http://fooplugins.com
25
  define( 'FOOGALLERY_PATH', plugin_dir_path( __FILE__ ) );
26
  define( 'FOOGALLERY_URL', plugin_dir_url( __FILE__ ) );
27
  define( 'FOOGALLERY_FILE', __FILE__ );
28
+ define( 'FOOGALLERY_VERSION', '1.9.37' );
29
  define( 'FOOGALLERY_SETTINGS_VERSION', '2' );
30
  require_once FOOGALLERY_PATH . 'includes/constants.php';
31
  // Create a helper function for easy SDK access.
freemius/assets/css/admin/account.css CHANGED
@@ -1 +1 @@
1
- label.fs-tag,span.fs-tag{background:#ffba00;color:#fff;display:inline-block;border-radius:3px;padding:5px;font-size:11px;line-height:11px;vertical-align:baseline}label.fs-tag.fs-warn,span.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-info,span.fs-tag.fs-info{background:#00a0d2}label.fs-tag.fs-success,span.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error,span.fs-tag.fs-error{background:#dc3232}#fs_account .postbox,#fs_account .widefat{max-width:800px}#fs_account h3{font-size:1.3em;padding:12px 15px;margin:0 0 12px 0;line-height:1.4;border-bottom:1px solid #F1F1F1}#fs_account h3 .dashicons{width:26px;height:26px;font-size:1.3em}#fs_account i.dashicons{font-size:1.2em;height:1.2em;width:1.2em}#fs_account .dashicons{vertical-align:middle}#fs_account .fs-header-actions{position:absolute;top:17px;right:15px;font-size:0.9em}#fs_account .fs-header-actions ul{margin:0}#fs_account .fs-header-actions li{float:left}#fs_account .fs-header-actions li form{display:inline-block}#fs_account .fs-header-actions li a{text-decoration:none}#fs_account_details .button-group{float:right}.rtl #fs_account .fs-header-actions{left:15px;right:auto}.fs-key-value-table{width:100%}.fs-key-value-table form{display:inline-block}.fs-key-value-table tr td:first-child{text-align:right}.fs-key-value-table tr td:first-child nobr{font-weight:bold}.fs-key-value-table tr td:first-child form{display:block}.fs-key-value-table tr td.fs-right{text-align:right}.fs-key-value-table tr.fs-odd{background:#ebebeb}.fs-key-value-table td,.fs-key-value-table th{padding:10px}.fs-key-value-table code{line-height:28px}.fs-key-value-table var,.fs-key-value-table code,.fs-key-value-table input[type="text"]{color:#0073AA;font-size:16px;background:none}.fs-key-value-table input[type="text"]{width:100%;font-weight:bold}.fs-field-beta_program label{margin-left:7px}label.fs-tag{background:#ffba00;color:#fff;display:inline-block;border-radius:3px;padding:5px;font-size:11px;line-height:11px;vertical-align:baseline}label.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error{background:#dc3232}#fs_sites .fs-scrollable-table .fs-table-body{max-height:200px;overflow:auto;border:1px solid #e5e5e5}#fs_sites .fs-scrollable-table .fs-table-body>table.widefat{border:none !important}#fs_sites .fs-scrollable-table .fs-main-column{width:100%}#fs_sites .fs-scrollable-table .fs-site-details td:first-of-type{text-align:right;color:grey;width:1px}#fs_sites .fs-scrollable-table .fs-site-details td:last-of-type{text-align:right}#fs_sites .fs-scrollable-table .fs-install-details table tr td{width:1px;white-space:nowrap}#fs_sites .fs-scrollable-table .fs-install-details table tr td:last-of-type{width:auto}#fs_addons h3{border:none;margin-bottom:0;padding:4px 5px}#fs_addons td{vertical-align:middle}#fs_addons thead{white-space:nowrap}#fs_addons td:first-child,#fs_addons th:first-child{text-align:left;font-weight:bold}#fs_addons td:last-child,#fs_addons th:last-child{text-align:right}#fs_addons th{font-weight:bold}#fs_billing_address{width:100%}#fs_billing_address tr td{width:50%;padding:5px}#fs_billing_address tr:first-of-type td{padding-top:0}#fs_billing_address span{font-weight:bold}#fs_billing_address input,#fs_billing_address select{display:block;width:100%;margin-top:5px}#fs_billing_address input::-moz-placeholder,#fs_billing_address select::-moz-placeholder{color:transparent;opacity:1}#fs_billing_address input:-ms-input-placeholder,#fs_billing_address select:-ms-input-placeholder{color:transparent}#fs_billing_address input::-webkit-input-placeholder,#fs_billing_address select::-webkit-input-placeholder{color:transparent}#fs_billing_address input.fs-read-mode,#fs_billing_address select.fs-read-mode{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode td span{display:none}#fs_billing_address.fs-read-mode input,#fs_billing_address.fs-read-mode select{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode input::-moz-placeholder,#fs_billing_address.fs-read-mode select::-moz-placeholder{color:#ccc;opacity:1}#fs_billing_address.fs-read-mode input:-ms-input-placeholder,#fs_billing_address.fs-read-mode select:-ms-input-placeholder{color:#ccc}#fs_billing_address.fs-read-mode input::-webkit-input-placeholder,#fs_billing_address.fs-read-mode select::-webkit-input-placeholder{color:#ccc}#fs_billing_address button{display:block;width:100%}
1
+ label.fs-tag,span.fs-tag{background:#ffba00;color:#fff;display:inline-block;border-radius:3px;padding:5px;font-size:11px;line-height:11px;vertical-align:baseline}label.fs-tag.fs-warn,span.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-info,span.fs-tag.fs-info{background:#00a0d2}label.fs-tag.fs-success,span.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error,span.fs-tag.fs-error{background:#dc3232}.fs-notice[data-id="license_not_whitelabeled"].success,.fs-notice[data-id="license_whitelabeled"].success{color:inherit;border-left-color:#00a0d2}.fs-notice[data-id="license_not_whitelabeled"].success label.fs-plugin-title,.fs-notice[data-id="license_whitelabeled"].success label.fs-plugin-title{display:none}#fs_account .postbox,#fs_account .widefat{max-width:800px}#fs_account h3{font-size:1.3em;padding:12px 15px;margin:0 0 12px 0;line-height:1.4;border-bottom:1px solid #F1F1F1}#fs_account h3 .dashicons{width:26px;height:26px;font-size:1.3em}#fs_account i.dashicons{font-size:1.2em;height:1.2em;width:1.2em}#fs_account .dashicons{vertical-align:middle}#fs_account .fs-header-actions{position:absolute;top:17px;right:15px;font-size:0.9em}#fs_account .fs-header-actions ul{margin:0}#fs_account .fs-header-actions li{float:left}#fs_account .fs-header-actions li form{display:inline-block}#fs_account .fs-header-actions li a{text-decoration:none}#fs_account_details .button-group{float:right}.rtl #fs_account .fs-header-actions{left:15px;right:auto}.fs-key-value-table{width:100%}.fs-key-value-table form{display:inline-block}.fs-key-value-table tr td:first-child{text-align:right}.fs-key-value-table tr td:first-child nobr{font-weight:bold}.fs-key-value-table tr td:first-child form{display:block}.fs-key-value-table tr td.fs-right{text-align:right}.fs-key-value-table tr.fs-odd{background:#ebebeb}.fs-key-value-table td,.fs-key-value-table th{padding:10px}.fs-key-value-table code{line-height:28px}.fs-key-value-table var,.fs-key-value-table code,.fs-key-value-table input[type="text"]{color:#0073AA;font-size:16px;background:none}.fs-key-value-table input[type="text"]{width:100%;font-weight:bold}.fs-field-beta_program label{margin-left:7px}label.fs-tag{background:#ffba00;color:#fff;display:inline-block;border-radius:3px;padding:5px;font-size:11px;line-height:11px;vertical-align:baseline}label.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error{background:#dc3232}#fs_sites .fs-scrollable-table .fs-table-body{max-height:200px;overflow:auto;border:1px solid #e5e5e5}#fs_sites .fs-scrollable-table .fs-table-body>table.widefat{border:none !important}#fs_sites .fs-scrollable-table .fs-main-column{width:100%}#fs_sites .fs-scrollable-table .fs-site-details td:first-of-type{text-align:right;color:grey;width:1px}#fs_sites .fs-scrollable-table .fs-site-details td:last-of-type{text-align:right}#fs_sites .fs-scrollable-table .fs-install-details table tr td{width:1px;white-space:nowrap}#fs_sites .fs-scrollable-table .fs-install-details table tr td:last-of-type{width:auto}#fs_addons h3{border:none;margin-bottom:0;padding:4px 5px}#fs_addons td{vertical-align:middle}#fs_addons thead{white-space:nowrap}#fs_addons td:first-child,#fs_addons th:first-child{text-align:left;font-weight:bold}#fs_addons td:last-child,#fs_addons th:last-child{text-align:right}#fs_addons th{font-weight:bold}#fs_billing_address{width:100%}#fs_billing_address tr td{width:50%;padding:5px}#fs_billing_address tr:first-of-type td{padding-top:0}#fs_billing_address span{font-weight:bold}#fs_billing_address input,#fs_billing_address select{display:block;width:100%;margin-top:5px}#fs_billing_address input::-moz-placeholder,#fs_billing_address select::-moz-placeholder{color:transparent;opacity:1}#fs_billing_address input:-ms-input-placeholder,#fs_billing_address select:-ms-input-placeholder{color:transparent}#fs_billing_address input::-webkit-input-placeholder,#fs_billing_address select::-webkit-input-placeholder{color:transparent}#fs_billing_address input.fs-read-mode,#fs_billing_address select.fs-read-mode{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode td span{display:none}#fs_billing_address.fs-read-mode input,#fs_billing_address.fs-read-mode select{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode input::-moz-placeholder,#fs_billing_address.fs-read-mode select::-moz-placeholder{color:#ccc;opacity:1}#fs_billing_address.fs-read-mode input:-ms-input-placeholder,#fs_billing_address.fs-read-mode select:-ms-input-placeholder{color:#ccc}#fs_billing_address.fs-read-mode input::-webkit-input-placeholder,#fs_billing_address.fs-read-mode select::-webkit-input-placeholder{color:#ccc}#fs_billing_address button{display:block;width:100%}
freemius/assets/css/admin/add-ons.css CHANGED
@@ -1,2 +1,2 @@
1
- .fs-badge{position:absolute;top:10px;right:0;background:#71ae00;color:white;text-transform:uppercase;padding:5px 10px;-moz-border-radius:3px 0 0 3px;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;font-weight:bold;border-right:0;-moz-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);-webkit-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);box-shadow:0 2px 1px -1px rgba(0,0,0,0.3)}#fs_addons .fs-cards-list{list-style:none}#fs_addons .fs-cards-list .fs-card{float:left;height:152px;width:310px;padding:0;margin:0 0 30px 30px;font-size:14px;list-style:none;border:1px solid #ddd;cursor:pointer;position:relative}#fs_addons .fs-cards-list .fs-card .fs-overlay{position:absolute;left:0;right:0;bottom:0;top:0;z-index:9}#fs_addons .fs-cards-list .fs-card .fs-inner{background-color:#fff;overflow:hidden;height:100%;position:relative}#fs_addons .fs-cards-list .fs-card .fs-inner>ul{-moz-transition:all,0.15s;-o-transition:all,0.15s;-ms-transition:all,0.15s;-webkit-transition:all,0.15s;transition:all,0.15s;left:0;right:0;top:0;position:absolute}#fs_addons .fs-cards-list .fs-card .fs-inner>ul>li{list-style:none;line-height:18px;padding:0 15px;width:100%;display:block;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-card-banner{padding:0;margin:0;line-height:0;display:block;height:100px;background-repeat:repeat-x;background-size:100% 100%;-moz-transition:all,0.15s;-o-transition:all,0.15s;-ms-transition:all,0.15s;-webkit-transition:all,0.15s;transition:all,0.15s}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-card-banner .fs-badge.fs-installed-addon-badge{font-size:1.02em;line-height:1.3em}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-title{margin:10px 0 0 0;height:18px;overflow:hidden;color:#000;white-space:nowrap;text-overflow:ellipsis;font-weight:bold}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-offer{font-size:0.9em}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-description{background-color:#f9f9f9;padding:10px 15px 100px 15px;border-top:1px solid #eee;margin:0 0 10px 0;color:#777}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-tag{position:absolute;top:10px;right:0px;background:greenyellow;display:block;padding:2px 10px;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.3);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.3);box-shadow:1px 1px 1px rgba(0,0,0,0.3);text-transform:uppercase;font-size:0.9em;font-weight:bold}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-cta .button,#fs_addons .fs-cards-list .fs-card .fs-inner .fs-cta .button-group{position:absolute;top:112px;right:10px}@media screen and (min-width: 960px){#fs_addons .fs-cards-list .fs-card:hover .fs-overlay{border:2px solid #29abe1;margin-left:-1px;margin-top:-1px}#fs_addons .fs-cards-list .fs-card:hover .fs-inner ul{top:-100px}#fs_addons .fs-cards-list .fs-card:hover .fs-inner .fs-title,#fs_addons .fs-cards-list .fs-card:hover .fs-inner .fs-offer{color:#29abe1}}
2
- #TB_window,#TB_window iframe{width:821px !important}#plugin-information .fyi{width:266px !important}#plugin-information #section-holder{margin-right:299px}#plugin-information #section-description h2,#plugin-information #section-description h3,#plugin-information #section-description p,#plugin-information #section-description b,#plugin-information #section-description i,#plugin-information #section-description blockquote,#plugin-information #section-description li,#plugin-information #section-description ul,#plugin-information #section-description ol{clear:none}#plugin-information #section-description iframe{max-width:100%}#plugin-information #section-description .fs-selling-points{padding-bottom:10px;border-bottom:1px solid #ddd}#plugin-information #section-description .fs-selling-points ul{margin:0}#plugin-information #section-description .fs-selling-points ul li{padding:0;list-style:none outside none}#plugin-information #section-description .fs-selling-points ul li i.dashicons{color:#71ae00;font-size:3em;vertical-align:middle;line-height:30px;float:left;margin:0 0 0 -15px}#plugin-information #section-description .fs-selling-points ul li h3{margin:1em 30px !important}#plugin-information #section-description .fs-screenshots:after{content:"";display:table;clear:both}#plugin-information #section-description .fs-screenshots ul{list-style:none;margin:0}#plugin-information #section-description .fs-screenshots ul li{width:225px;height:225px;float:left;margin-bottom:20px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}#plugin-information #section-description .fs-screenshots ul li a{display:block;width:100%;height:100%;border:1px solid;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.2);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.2);box-shadow:1px 1px 1px rgba(0,0,0,0.2);background-size:cover}#plugin-information #section-description .fs-screenshots ul li.odd{margin-right:20px}#plugin-information .plugin-information-pricing{margin:-16px;border-bottom:1px solid #ddd}#plugin-information .plugin-information-pricing .fs-plan h3{margin-top:0;padding:20px;font-size:16px}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper{border-bottom:1px solid #ddd}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab{cursor:pointer;position:relative;padding:0 10px;font-size:0.9em}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab label{text-transform:uppercase;color:green;background:greenyellow;position:absolute;left:-1px;right:-1px;bottom:100%;border:1px solid darkgreen;padding:2px;text-align:center;font-size:0.9em;line-height:1em}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab.nav-tab-active{cursor:default;background:#fffeec;border-bottom-color:#fffeec}#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle h3{background:#fffeec;margin:0;padding-bottom:0;color:#0073aa}#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle .nav-tab-wrapper,#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle .fs-billing-frequency{display:none}#plugin-information .plugin-information-pricing .fs-plan .fs-pricing-body{background:#fffeec;padding:20px}#plugin-information .plugin-information-pricing .fs-plan .button{width:100%;text-align:center;font-weight:bold;text-transform:uppercase;font-size:1.1em}#plugin-information .plugin-information-pricing .fs-plan label{white-space:nowrap}#plugin-information .plugin-information-pricing .fs-plan var{font-style:normal}#plugin-information .plugin-information-pricing .fs-plan .fs-billing-frequency,#plugin-information .plugin-information-pricing .fs-plan .fs-annual-discount{text-align:center;display:block;font-weight:bold;margin-bottom:10px;text-transform:uppercase;background:#F3F3F3;padding:2px;border:1px solid #ccc}#plugin-information .plugin-information-pricing .fs-plan .fs-annual-discount{text-transform:none;color:green;background:greenyellow}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms{font-size:0.9em}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms i{float:left;margin:0 0 0 -15px}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms li{margin:10px 0 0 0}#plugin-information #section-features .fs-features{margin:-20px -26px}#plugin-information #section-features table{width:100%;border-spacing:0;border-collapse:separate}#plugin-information #section-features table thead th{padding:10px 0}#plugin-information #section-features table thead .fs-price{color:#71ae00;font-weight:normal;display:block;text-align:center}#plugin-information #section-features table tbody td{border-top:1px solid #ccc;padding:10px 0;text-align:center;width:100px;color:#71ae00}#plugin-information #section-features table tbody td:first-child{text-align:left;width:auto;color:inherit;padding-left:26px}#plugin-information #section-features table tbody tr.fs-odd td{background:#fefefe}#plugin-information #section-features .dashicons-yes{width:30px;height:30px;font-size:30px}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .button-group .button,#plugin-information .fs-dropdown .button-group .button{position:relative;width:auto;top:0;right:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .button-group .button:focus,#plugin-information .fs-dropdown .button-group .button:focus{z-index:10}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .button-group .fs-dropdown-arrow,#plugin-information .fs-dropdown .button-group .fs-dropdown-arrow{border-top:6px solid white;border-right:4px solid transparent;border-left:4px solid transparent;top:12px;position:relative}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active:not(.up) .button:not(.fs-dropdown-arrow-button),#plugin-information .fs-dropdown.active:not(.up) .button:not(.fs-dropdown-arrow-button){border-bottom-left-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active:not(.up) .fs-dropdown-arrow-button,#plugin-information .fs-dropdown.active:not(.up) .fs-dropdown-arrow-button{border-bottom-right-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active.up .button:not(.fs-dropdown-arrow-button),#plugin-information .fs-dropdown.active.up .button:not(.fs-dropdown-arrow-button){border-top-left-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active.up .fs-dropdown-arrow-button,#plugin-information .fs-dropdown.active.up .fs-dropdown-arrow-button{border-top-right-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list,#plugin-information .fs-dropdown .fs-dropdown-list{position:absolute;right:-1px;top:100%;margin-left:auto;padding:3px 0;border:1px solid #bfbfbf;background-color:#fff;z-index:1;width:230px;text-align:left;-moz-box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12);-webkit-box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12);box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li,#plugin-information .fs-dropdown .fs-dropdown-list li{margin:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li a,#plugin-information .fs-dropdown .fs-dropdown-list li a{display:block;padding:5px 10px;text-decoration:none;text-shadow:none}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li:hover,#plugin-information .fs-dropdown .fs-dropdown-list li:hover{background-color:#0074a3;color:#fff}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li:hover a,#plugin-information .fs-dropdown .fs-dropdown-list li:hover a{color:#fff}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown:not(.up) .fs-dropdown-list,#plugin-information .fs-dropdown:not(.up) .fs-dropdown-list{-moz-border-radius:3px 0 3px 3px;-webkit-border-radius:3px 0 3px 3px;border-radius:3px 0 3px 3px}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.up .fs-dropdown-list,#plugin-information .fs-dropdown.up .fs-dropdown-list{-moz-border-radius:3px 3px 0 3px;-webkit-border-radius:3px 3px 0 3px;border-radius:3px 3px 0 3px}#plugin-information .fs-dropdown .button-group{width:100%}#plugin-information .fs-dropdown .button-group .button{float:none;font-size:14px;font-weight:normal;text-transform:none}#plugin-information .fs-dropdown .fs-dropdown-list{margin-top:1px}#plugin-information .fs-dropdown.up .fs-dropdown-list{top:auto;bottom:100%;margin-bottom:2px}#plugin-information.wp-core-ui .fs-pricing-body .fs-dropdown .button-group{text-align:center;display:table}#plugin-information.wp-core-ui .fs-pricing-body .fs-dropdown .button-group .button{display:table-cell}#plugin-information.wp-core-ui .fs-pricing-body .fs-dropdown .button-group .button:not(.fs-dropdown-arrow-button){left:1px;width:100%}#plugin-information-footer>.button,#plugin-information-footer .fs-dropdown{position:relative;top:3px}#plugin-information-footer>.button.left,#plugin-information-footer .fs-dropdown.left{float:left}#plugin-information-footer>.right,#plugin-information-footer .fs-dropdown{float:right}@media screen and (max-width: 961px){#fs_addons .fs-cards-list .fs-card{height:265px}}
1
+ .fs-badge{position:absolute;top:10px;right:0;background:#71ae00;color:white;text-transform:uppercase;padding:5px 10px;-moz-border-radius:3px 0 0 3px;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;font-weight:bold;border-right:0;-moz-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);-webkit-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);box-shadow:0 2px 1px -1px rgba(0,0,0,0.3)}#fs_addons .fs-cards-list{list-style:none}#fs_addons .fs-cards-list .fs-card{float:left;height:152px;width:310px;padding:0;margin:0 0 30px 30px;font-size:14px;list-style:none;border:1px solid #ddd;cursor:pointer;position:relative}#fs_addons .fs-cards-list .fs-card .fs-overlay{position:absolute;left:0;right:0;bottom:0;top:0;z-index:9}#fs_addons .fs-cards-list .fs-card .fs-inner{background-color:#fff;overflow:hidden;height:100%;position:relative}#fs_addons .fs-cards-list .fs-card .fs-inner>ul{-moz-transition:all,0.15s;-o-transition:all,0.15s;-ms-transition:all,0.15s;-webkit-transition:all,0.15s;transition:all,0.15s;left:0;right:0;top:0;position:absolute}#fs_addons .fs-cards-list .fs-card .fs-inner>ul>li{list-style:none;line-height:18px;padding:0 15px;width:100%;display:block;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-card-banner{padding:0;margin:0;line-height:0;display:block;height:100px;background-repeat:repeat-x;background-size:100% 100%;-moz-transition:all,0.15s;-o-transition:all,0.15s;-ms-transition:all,0.15s;-webkit-transition:all,0.15s;transition:all,0.15s}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-card-banner .fs-badge.fs-installed-addon-badge{font-size:1.02em;line-height:1.3em}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-title{margin:10px 0 0 0;height:18px;overflow:hidden;color:#000;white-space:nowrap;text-overflow:ellipsis;font-weight:bold}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-offer{font-size:0.9em}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-description{background-color:#f9f9f9;padding:10px 15px 100px 15px;border-top:1px solid #eee;margin:0 0 10px 0;color:#777}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-tag{position:absolute;top:10px;right:0px;background:greenyellow;display:block;padding:2px 10px;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.3);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.3);box-shadow:1px 1px 1px rgba(0,0,0,0.3);text-transform:uppercase;font-size:0.9em;font-weight:bold}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-cta .button,#fs_addons .fs-cards-list .fs-card .fs-inner .fs-cta .button-group{position:absolute;top:112px;right:10px}@media screen and (min-width: 960px){#fs_addons .fs-cards-list .fs-card:hover .fs-overlay{border:2px solid #29abe1;margin-left:-1px;margin-top:-1px}#fs_addons .fs-cards-list .fs-card:hover .fs-inner ul{top:-100px}#fs_addons .fs-cards-list .fs-card:hover .fs-inner .fs-title,#fs_addons .fs-cards-list .fs-card:hover .fs-inner .fs-offer{color:#29abe1}}
2
+ #TB_window,#TB_window iframe{width:821px !important}#plugin-information .fyi{width:266px !important}#plugin-information #section-holder{margin-right:299px}#plugin-information #section-description h2,#plugin-information #section-description h3,#plugin-information #section-description p,#plugin-information #section-description b,#plugin-information #section-description i,#plugin-information #section-description blockquote,#plugin-information #section-description li,#plugin-information #section-description ul,#plugin-information #section-description ol{clear:none}#plugin-information #section-description iframe{max-width:100%}#plugin-information #section-description .fs-selling-points{padding-bottom:10px;border-bottom:1px solid #ddd}#plugin-information #section-description .fs-selling-points ul{margin:0}#plugin-information #section-description .fs-selling-points ul li{padding:0;list-style:none outside none}#plugin-information #section-description .fs-selling-points ul li i.dashicons{color:#71ae00;font-size:3em;vertical-align:middle;line-height:30px;float:left;margin:0 0 0 -15px}#plugin-information #section-description .fs-selling-points ul li h3{margin:1em 30px !important}#plugin-information #section-description .fs-screenshots:after{content:"";display:table;clear:both}#plugin-information #section-description .fs-screenshots ul{list-style:none;margin:0}#plugin-information #section-description .fs-screenshots ul li{width:225px;height:225px;float:left;margin-bottom:20px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}#plugin-information #section-description .fs-screenshots ul li a{display:block;width:100%;height:100%;border:1px solid;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.2);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.2);box-shadow:1px 1px 1px rgba(0,0,0,0.2);background-size:cover}#plugin-information #section-description .fs-screenshots ul li.odd{margin-right:20px}#plugin-information .plugin-information-pricing{margin:-16px;border-bottom:1px solid #ddd}#plugin-information .plugin-information-pricing .fs-plan h3{margin-top:0;padding:20px;font-size:16px}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper{border-bottom:1px solid #ddd}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab{cursor:pointer;position:relative;padding:0 10px;font-size:0.9em}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab label{text-transform:uppercase;color:green;background:greenyellow;position:absolute;left:-1px;right:-1px;bottom:100%;border:1px solid darkgreen;padding:2px;text-align:center;font-size:0.9em;line-height:1em}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab.nav-tab-active{cursor:default;background:#fffeec;border-bottom-color:#fffeec}#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle h3{background:#fffeec;margin:0;padding-bottom:0;color:#0073aa}#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle .nav-tab-wrapper,#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle .fs-billing-frequency{display:none}#plugin-information .plugin-information-pricing .fs-plan .fs-pricing-body{background:#fffeec;padding:20px}#plugin-information .plugin-information-pricing .fs-plan .button{width:100%;text-align:center;font-weight:bold;text-transform:uppercase;font-size:1.1em}#plugin-information .plugin-information-pricing .fs-plan label{white-space:nowrap}#plugin-information .plugin-information-pricing .fs-plan var{font-style:normal}#plugin-information .plugin-information-pricing .fs-plan .fs-billing-frequency,#plugin-information .plugin-information-pricing .fs-plan .fs-annual-discount{text-align:center;display:block;font-weight:bold;margin-bottom:10px;text-transform:uppercase;background:#F3F3F3;padding:2px;border:1px solid #ccc}#plugin-information .plugin-information-pricing .fs-plan .fs-annual-discount{text-transform:none;color:green;background:greenyellow}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms{font-size:0.9em}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms i{float:left;margin:0 0 0 -15px}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms li{margin:10px 0 0 0}#plugin-information #section-features .fs-features{margin:-20px -26px}#plugin-information #section-features table{width:100%;border-spacing:0;border-collapse:separate}#plugin-information #section-features table thead th{padding:10px 0}#plugin-information #section-features table thead .fs-price{color:#71ae00;font-weight:normal;display:block;text-align:center}#plugin-information #section-features table tbody td{border-top:1px solid #ccc;padding:10px 0;text-align:center;width:100px;color:#71ae00}#plugin-information #section-features table tbody td:first-child{text-align:left;width:auto;color:inherit;padding-left:26px}#plugin-information #section-features table tbody tr.fs-odd td{background:#fefefe}#plugin-information #section-features .dashicons-yes{width:30px;height:30px;font-size:30px}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .button-group .button,#plugin-information .fs-dropdown .button-group .button{position:relative;width:auto;top:0;right:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .button-group .button:focus,#plugin-information .fs-dropdown .button-group .button:focus{z-index:10}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .button-group .fs-dropdown-arrow,#plugin-information .fs-dropdown .button-group .fs-dropdown-arrow{border-top:6px solid white;border-right:4px solid transparent;border-left:4px solid transparent;top:12px;position:relative}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active:not(.up) .button:not(.fs-dropdown-arrow-button),#plugin-information .fs-dropdown.active:not(.up) .button:not(.fs-dropdown-arrow-button){border-bottom-left-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active:not(.up) .fs-dropdown-arrow-button,#plugin-information .fs-dropdown.active:not(.up) .fs-dropdown-arrow-button{border-bottom-right-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active.up .button:not(.fs-dropdown-arrow-button),#plugin-information .fs-dropdown.active.up .button:not(.fs-dropdown-arrow-button){border-top-left-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.active.up .fs-dropdown-arrow-button,#plugin-information .fs-dropdown.active.up .fs-dropdown-arrow-button{border-top-right-radius:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list,#plugin-information .fs-dropdown .fs-dropdown-list{position:absolute;right:-1px;top:100%;margin-left:auto;padding:3px 0;border:1px solid #bfbfbf;background-color:#fff;z-index:1;width:230px;text-align:left;-moz-box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12);-webkit-box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12);box-shadow:0px 2px 4px -1px rgba(0,0,0,0.2),0px 4px 5px 0px rgba(0,0,0,0.14),0px 1px 10px 0px rgba(0,0,0,0.12)}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li,#plugin-information .fs-dropdown .fs-dropdown-list li{margin:0}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li a,#plugin-information .fs-dropdown .fs-dropdown-list li a{display:block;padding:5px 10px;text-decoration:none;text-shadow:none}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li:hover,#plugin-information .fs-dropdown .fs-dropdown-list li:hover{background-color:#0074a3;color:#fff}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown .fs-dropdown-list li:hover a,#plugin-information .fs-dropdown .fs-dropdown-list li:hover a{color:#fff}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown:not(.up) .fs-dropdown-list,#plugin-information .fs-dropdown:not(.up) .fs-dropdown-list{-moz-border-radius:3px 0 3px 3px;-webkit-border-radius:3px 0 3px 3px;border-radius:3px 0 3px 3px}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-dropdown.up .fs-dropdown-list,#plugin-information .fs-dropdown.up .fs-dropdown-list{-moz-border-radius:3px 3px 0 3px;-webkit-border-radius:3px 3px 0 3px;border-radius:3px 3px 0 3px}#plugin-information .fs-dropdown .button-group{width:100%}#plugin-information .fs-dropdown .button-group .button{float:none;font-size:14px;font-weight:normal;text-transform:none}#plugin-information .fs-dropdown .fs-dropdown-list{margin-top:1px}#plugin-information .fs-dropdown.up .fs-dropdown-list{top:auto;bottom:100%;margin-bottom:2px}#plugin-information.wp-core-ui .fs-pricing-body .fs-dropdown .button-group{text-align:center;display:table}#plugin-information.wp-core-ui .fs-pricing-body .fs-dropdown .button-group .button{display:table-cell}#plugin-information.wp-core-ui .fs-pricing-body .fs-dropdown .button-group .button:not(.fs-dropdown-arrow-button){left:1px;width:100%}#plugin-information-footer>.button,#plugin-information-footer .fs-dropdown{position:relative;top:3px}#plugin-information-footer>.button.left,#plugin-information-footer .fs-dropdown.left{float:left}#plugin-information-footer>.right,#plugin-information-footer .fs-dropdown{float:right}@media screen and (max-width: 961px){#fs_addons .fs-cards-list .fs-card{height:265px}}
freemius/config.php CHANGED
@@ -385,4 +385,7 @@
385
 
386
  if ( ! defined( 'WP_FS__DEMO_MODE' ) ) {
387
  define( 'WP_FS__DEMO_MODE', false );
388
- }
 
 
 
385
 
386
  if ( ! defined( 'WP_FS__DEMO_MODE' ) ) {
387
  define( 'WP_FS__DEMO_MODE', false );
388
+ }
389
+ if ( ! defined( 'FS_SDK__SSLVERIFY' ) ) {
390
+ define( 'FS_SDK__SSLVERIFY', false );
391
+ }
freemius/includes/class-freemius.php CHANGED
@@ -1674,6 +1674,7 @@
1674
  $this->add_ajax_action( 'update_billing', array( &$this, '_update_billing_ajax_action' ) );
1675
  $this->add_ajax_action( 'start_trial', array( &$this, '_start_trial_ajax_action' ) );
1676
  $this->add_ajax_action( 'set_data_debug_mode', array( &$this, '_set_data_debug_mode' ) );
 
1677
 
1678
  if ( $this->_is_network_active && fs_is_network_admin() ) {
1679
  $this->add_ajax_action( 'network_activate', array( &$this, '_network_activate_ajax_action' ) );
@@ -7736,7 +7737,10 @@
7736
  * @author Leo Fajardo (@leorw)
7737
  * @since 1.2.2
7738
  */
7739
- if ( is_plugin_active( $other_version_basename ) ) {
 
 
 
7740
  deactivate_plugins( $other_version_basename );
7741
  }
7742
  }
@@ -9021,12 +9025,25 @@
9021
  'is_uninstalled' => false,
9022
  );
9023
 
9024
- $plugins_update_data[] = $new_plugin;
9025
  $network_plugins_cache->plugins[ $basename ] = $new_plugin;
9026
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9027
  if ( isset( $site_active_plugins[ $basename ] ) ) {
9028
  $site_active_plugins_cache->plugins[ $basename ] = $new_plugin;
9029
- $site_active_plugins_cache->plugins[ $basename ]['is_active'] = true;
9030
  }
9031
  }
9032
  }
@@ -13130,6 +13147,61 @@
13130
  }
13131
  }
13132
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13133
  /**
13134
  * @author Leo Fajardo (@leorw)
13135
  * @since 2.3.0
@@ -20679,6 +20751,13 @@
20679
  }
20680
 
20681
  if ( 'none' !== $plan_change ) {
 
 
 
 
 
 
 
20682
  $this->do_action( 'after_license_change', $plan_change, $this->get_plan() );
20683
  }
20684
  }
@@ -22293,6 +22372,26 @@
22293
 
22294
  $this->_handle_account_edits();
22295
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22296
  $this->do_action( 'account_page_load_before_departure' );
22297
  }
22298
 
@@ -23453,10 +23552,12 @@
23453
  * @since 1.0.3
23454
  */
23455
  function _redirect_on_activation_hook() {
23456
- $url = $this->get_after_plugin_activation_redirect_url();
 
23457
 
23458
- if ( is_string( $url ) ) {
23459
- fs_redirect( $url );
 
23460
  }
23461
  }
23462
 
1674
  $this->add_ajax_action( 'update_billing', array( &$this, '_update_billing_ajax_action' ) );
1675
  $this->add_ajax_action( 'start_trial', array( &$this, '_start_trial_ajax_action' ) );
1676
  $this->add_ajax_action( 'set_data_debug_mode', array( &$this, '_set_data_debug_mode' ) );
1677
+ $this->add_ajax_action( 'toggle_whitelabel_mode', array( &$this, '_toggle_whitelabel_mode_ajax_handler' ) );
1678
 
1679
  if ( $this->_is_network_active && fs_is_network_admin() ) {
1680
  $this->add_ajax_action( 'network_activate', array( &$this, '_network_activate_ajax_action' ) );
7737
  * @author Leo Fajardo (@leorw)
7738
  * @since 1.2.2
7739
  */
7740
+ if (
7741
+ is_plugin_active( $other_version_basename ) &&
7742
+ $this->apply_filters( 'deactivate_on_activation', true )
7743
+ ) {
7744
  deactivate_plugins( $other_version_basename );
7745
  }
7746
  }
9025
  'is_uninstalled' => false,
9026
  );
9027
 
 
9028
  $network_plugins_cache->plugins[ $basename ] = $new_plugin;
9029
 
9030
+ $is_site_level_active = (
9031
+ isset( $site_active_plugins[ $basename ] ) &&
9032
+ $site_active_plugins[ $basename ]['is_active']
9033
+ );
9034
+
9035
+ /**
9036
+ * If not network active, set the activity status based on the site-level plugin status.
9037
+ */
9038
+ if ( ! $new_plugin['is_active'] ) {
9039
+ $new_plugin['is_active'] = $is_site_level_active;
9040
+ }
9041
+
9042
+ $plugins_update_data[] = $new_plugin;
9043
+
9044
  if ( isset( $site_active_plugins[ $basename ] ) ) {
9045
  $site_active_plugins_cache->plugins[ $basename ] = $new_plugin;
9046
+ $site_active_plugins_cache->plugins[ $basename ]['is_active'] = $is_site_level_active;
9047
  }
9048
  }
9049
  }
13147
  }
13148
  }
13149
 
13150
+ /**
13151
+ * @author Edgar Melkonyan
13152
+ * @since 2.4.1
13153
+ *
13154
+ * @throws Freemius_Exception
13155
+ */
13156
+ function _toggle_whitelabel_mode_ajax_handler() {
13157
+ $this->_logger->entrance();
13158
+
13159
+ $this->check_ajax_referer( 'toggle_whitelabel_mode' );
13160
+
13161
+ if ( ! $this->is_user_admin() ) {
13162
+ // Only for admins.
13163
+ self::shoot_ajax_failure();
13164
+ }
13165
+
13166
+ $license = $this->get_api_user_scope()->call(
13167
+ "/licenses/{$this->_site->license_id}.json",
13168
+ 'put',
13169
+ array( 'is_whitelabeled' => ! $this->_license->is_whitelabeled )
13170
+ );
13171
+
13172
+ if ( ! $this->is_api_result_entity( $license ) ) {
13173
+ self::shoot_ajax_failure(
13174
+ FS_Api::is_api_error_object( $license ) ?
13175
+ $license->error->message :
13176
+ fs_text_inline( "An unknown error has occurred while trying to toggle the license's white-label mode.", 'unknown-error-occurred', $this->get_slug() )
13177
+ );
13178
+ }
13179
+
13180
+ $this->_license->is_whitelabeled = $license->is_whitelabeled;
13181
+ $this->_store_licenses();
13182
+
13183
+ $this->_sync_license();
13184
+
13185
+ if ( ! $license->is_whitelabeled ) {
13186
+ $this->_admin_notices->remove_sticky( 'license_whitelabeled' );
13187
+ } else {
13188
+ $this->_admin_notices->add_sticky(
13189
+ sprintf(
13190
+ $this->get_text_inline(
13191
+ 'Your %s license was flagged as white-labeled to hide sensitive information from the WP Admin (e.g. your email, license key, prices, billing address & invoices). If you ever wish to revert it back, you can easily do it through your %s. If this was a mistake you can also %s.',
13192
+ 'license_whitelabeled'
13193
+ ),
13194
+ "<strong>{$this->get_plugin_title()}</strong>",
13195
+ sprintf( '<a href="https://users.freemius.com" target="_blank">%s</a>', $this->get_text_inline( 'User Dashboard', 'user-dashboard' ) ),
13196
+ sprintf( '<a href="#" class="fs-toggle-whitelabel-mode">%s</a>', $this->get_text_inline( 'revert it now', 'revert-it-now' ) )
13197
+ ),
13198
+ 'license_whitelabeled'
13199
+ );
13200
+ }
13201
+
13202
+ self::shoot_ajax_response( array( 'success' => true ) );
13203
+ }
13204
+
13205
  /**
13206
  * @author Leo Fajardo (@leorw)
13207
  * @since 2.3.0
20751
  }
20752
 
20753
  if ( 'none' !== $plan_change ) {
20754
+ if (
20755
+ ! is_object( $this->_license ) ||
20756
+ ! $this->_license->is_whitelabeled
20757
+ ) {
20758
+ $this->_admin_notices->remove_sticky( 'license_whitelabeled' );
20759
+ }
20760
+
20761
  $this->do_action( 'after_license_change', $plan_change, $this->get_plan() );
20762
  }
20763
  }
22372
 
22373
  $this->_handle_account_edits();
22374
 
22375
+ if (
22376
+ is_object( $this->_license ) &&
22377
+ $this->_license->user_id == $this->_user->id &&
22378
+ ! $this->is_whitelabeled( true )
22379
+ ) {
22380
+ $this->_admin_notices->add(
22381
+ sprintf(
22382
+ $this->get_text_inline( "Is this your client's site? %s if you wish to hide sensitive info like your email, license key, prices, billing address & invoices from the WP Admin.", 'license_not_whitelabeled' ),
22383
+ sprintf(
22384
+ '<a href="#" class="fs-toggle-whitelabel-mode">%s</a>',
22385
+ $this->get_text_inline( 'Click here', 'click-here' )
22386
+ )
22387
+ ),
22388
+ '',
22389
+ 'success',
22390
+ false,
22391
+ 'license_not_whitelabeled'
22392
+ );
22393
+ }
22394
+
22395
  $this->do_action( 'account_page_load_before_departure' );
22396
  }
22397
 
23552
  * @since 1.0.3
23553
  */
23554
  function _redirect_on_activation_hook() {
23555
+ if ( $this->apply_filters( 'redirect_on_activation', true ) ) {
23556
+ $url = $this->get_after_plugin_activation_redirect_url();
23557
 
23558
+ if ( is_string( $url ) ) {
23559
+ fs_redirect( $url );
23560
+ }
23561
  }
23562
  }
23563
 
freemius/includes/class-fs-plugin-updater.php CHANGED
@@ -542,23 +542,66 @@
542
  }
543
  }
544
 
 
 
 
545
  if ( is_object( $this->_update_details ) ) {
 
 
 
 
546
  if ( ! isset( $transient_data->response ) ) {
547
  $transient_data->response = array();
548
  }
549
 
550
  // Add plugin to transient data.
551
- $transient_data->response[ $this->_fs->premium_plugin_basename() ] = $this->_fs->is_plugin() ?
552
  $this->_update_details :
553
  (array) $this->_update_details;
554
- } else if ( isset( $transient_data->response ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
555
  /**
556
- * Ensure that there's no update data for the plugin to prevent upgrading the premium version to the latest free version.
557
  *
558
- * @author Leo Fajardo (@leorw)
559
- * @since 2.3.0
560
  */
561
- unset( $transient_data->response[ $this->_fs->premium_plugin_basename() ] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
562
  }
563
 
564
  $slug = $this->_fs->get_slug();
542
  }
543
  }
544
 
545
+ // Alias.
546
+ $basename = $this->_fs->premium_plugin_basename();
547
+
548
  if ( is_object( $this->_update_details ) ) {
549
+ if ( isset( $transient_data->no_update ) ) {
550
+ unset( $transient_data->no_update[ $basename ] );
551
+ }
552
+
553
  if ( ! isset( $transient_data->response ) ) {
554
  $transient_data->response = array();
555
  }
556
 
557
  // Add plugin to transient data.
558
+ $transient_data->response[ $basename ] = $this->_fs->is_plugin() ?
559
  $this->_update_details :
560
  (array) $this->_update_details;
561
+ } else {
562
+ if ( isset( $transient_data->response ) ) {
563
+ /**
564
+ * Ensure that there's no update data for the plugin to prevent upgrading the premium version to the latest free version.
565
+ *
566
+ * @author Leo Fajardo (@leorw)
567
+ * @since 2.3.0
568
+ */
569
+ unset( $transient_data->response[ $basename ] );
570
+ }
571
+
572
+ if ( ! isset( $transient_data->no_update ) ) {
573
+ $transient_data->no_update = array();
574
+ }
575
+
576
  /**
577
+ * Add product to no_update transient data to properly integrate with WP 5.5 auto-updates UI.
578
  *
579
+ * @since 2.4.1
580
+ * @link https://make.wordpress.org/core/2020/07/30/recommended-usage-of-the-updates-api-to-support-the-auto-updates-ui-for-plugins-and-themes-in-wordpress-5-5/
581
  */
582
+ $transient_data->no_update[ $basename ] = $this->_fs->is_plugin() ?
583
+ (object) array(
584
+ 'id' => $basename,
585
+ 'slug' => $this->_fs->get_slug(),
586
+ 'plugin' => $basename,
587
+ 'new_version' => $this->_fs->get_plugin_version(),
588
+ 'url' => '',
589
+ 'package' => '',
590
+ 'icons' => array(),
591
+ 'banners' => array(),
592
+ 'banners_rtl' => array(),
593
+ 'tested' => '',
594
+ 'requires_php' => '',
595
+ 'compatibility' => new stdClass(),
596
+ ) :
597
+ array(
598
+ 'theme' => $basename,
599
+ 'new_version' => $this->_fs->get_plugin_version(),
600
+ 'url' => '',
601
+ 'package' => '',
602
+ 'requires' => '',
603
+ 'requires_php' => '',
604
+ );
605
  }
606
 
607
  $slug = $this->_fs->get_slug();
freemius/includes/customizer/class-fs-customizer-support-section.php CHANGED
@@ -1,102 +1,102 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.2.2.7
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * Class Zerif_Customizer_Theme_Info_Main
15
- *
16
- * @since 1.0.0
17
- * @access public
18
- */
19
- class FS_Customizer_Support_Section extends WP_Customize_Section {
20
-
21
- function __construct( $manager, $id, $args = array() ) {
22
- $manager->register_section_type( 'FS_Customizer_Support_Section' );
23
-
24
- parent::__construct( $manager, $id, $args );
25
- }
26
-
27
- /**
28
- * The type of customize section being rendered.
29
- *
30
- * @since 1.0.0
31
- * @access public
32
- * @var string
33
- */
34
- public $type = 'freemius-support-section';
35
-
36
- /**
37
- * @var Freemius
38
- */
39
- public $fs = null;
40
-
41
- /**
42
- * Add custom parameters to pass to the JS via JSON.
43
- *
44
- * @since 1.0.0
45
- */
46
- public function json() {
47
- $json = parent::json();
48
-
49
- $is_contact_visible = $this->fs->is_page_visible( 'contact' );
50
- $is_support_visible = $this->fs->is_page_visible( 'support' );
51
-
52
- $json['theme_title'] = $this->fs->get_plugin_name();
53
-
54
- if ( $is_contact_visible && $is_support_visible ) {
55
- $json['theme_title'] .= ' ' . $this->fs->get_text_inline( 'Support', 'support' );
56
- }
57
-
58
- if ( $is_contact_visible ) {
59
- $json['contact'] = array(
60
- 'label' => $this->fs->get_text_inline( 'Contact Us', 'contact-us' ),
61
- 'url' => $this->fs->contact_url(),
62
- );
63
- }
64
-
65
- if ( $is_support_visible ) {
66
- $json['support'] = array(
67
- 'label' => $this->fs->get_text_inline( 'Support Forum', 'support-forum' ),
68
- 'url' => $this->fs->get_support_forum_url()
69
- );
70
- }
71
-
72
- return $json;
73
- }
74
-
75
- /**
76
- * Outputs the Underscore.js template.
77
- *
78
- * @since 1.0.0
79
- */
80
- protected function render_template() {
81
- ?>
82
- <li id="fs_customizer_support"
83
- class="accordion-section control-section control-section-{{ data.type }} cannot-expand">
84
- <h3 class="accordion-section-title">
85
- <span>{{ data.theme_title }}</span>
86
- <# if ( data.contact && data.support ) { #>
87
- <div class="button-group">
88
- <# } #>
89
- <# if ( data.contact ) { #>
90
- <a class="button" href="{{ data.contact.url }}" target="_blank" rel="noopener noreferrer">{{ data.contact.label }} </a>
91
- <# } #>
92
- <# if ( data.support ) { #>
93
- <a class="button" href="{{ data.support.url }}" target="_blank" rel="noopener noreferrer">{{ data.support.label }} </a>
94
- <# } #>
95
- <# if ( data.contact && data.support ) { #>
96
- </div>
97
- <# } #>
98
- </h3>
99
- </li>
100
- <?php
101
- }
102
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.2.2.7
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Class Zerif_Customizer_Theme_Info_Main
15
+ *
16
+ * @since 1.0.0
17
+ * @access public
18
+ */
19
+ class FS_Customizer_Support_Section extends WP_Customize_Section {
20
+
21
+ function __construct( $manager, $id, $args = array() ) {
22
+ $manager->register_section_type( 'FS_Customizer_Support_Section' );
23
+
24
+ parent::__construct( $manager, $id, $args );
25
+ }
26
+
27
+ /**
28
+ * The type of customize section being rendered.
29
+ *
30
+ * @since 1.0.0
31
+ * @access public
32
+ * @var string
33
+ */
34
+ public $type = 'freemius-support-section';
35
+
36
+ /**
37
+ * @var Freemius
38
+ */
39
+ public $fs = null;
40
+
41
+ /**
42
+ * Add custom parameters to pass to the JS via JSON.
43
+ *
44
+ * @since 1.0.0
45
+ */
46
+ public function json() {
47
+ $json = parent::json();
48
+
49
+ $is_contact_visible = $this->fs->is_page_visible( 'contact' );
50
+ $is_support_visible = $this->fs->is_page_visible( 'support' );
51
+
52
+ $json['theme_title'] = $this->fs->get_plugin_name();
53
+
54
+ if ( $is_contact_visible && $is_support_visible ) {
55
+ $json['theme_title'] .= ' ' . $this->fs->get_text_inline( 'Support', 'support' );
56
+ }
57
+
58
+ if ( $is_contact_visible ) {
59
+ $json['contact'] = array(
60
+ 'label' => $this->fs->get_text_inline( 'Contact Us', 'contact-us' ),
61
+ 'url' => $this->fs->contact_url(),
62
+ );
63
+ }
64
+
65
+ if ( $is_support_visible ) {
66
+ $json['support'] = array(
67
+ 'label' => $this->fs->get_text_inline( 'Support Forum', 'support-forum' ),
68
+ 'url' => $this->fs->get_support_forum_url()
69
+ );
70
+ }
71
+
72
+ return $json;
73
+ }
74
+
75
+ /**
76
+ * Outputs the Underscore.js template.
77
+ *
78
+ * @since 1.0.0
79
+ */
80
+ protected function render_template() {
81
+ ?>
82
+ <li id="fs_customizer_support"
83
+ class="accordion-section control-section control-section-{{ data.type }} cannot-expand">
84
+ <h3 class="accordion-section-title">
85
+ <span>{{ data.theme_title }}</span>
86
+ <# if ( data.contact && data.support ) { #>
87
+ <div class="button-group">
88
+ <# } #>
89
+ <# if ( data.contact ) { #>
90
+ <a class="button" href="{{ data.contact.url }}" target="_blank" rel="noopener noreferrer">{{ data.contact.label }} </a>
91
+ <# } #>
92
+ <# if ( data.support ) { #>
93
+ <a class="button" href="{{ data.support.url }}" target="_blank" rel="noopener noreferrer">{{ data.support.label }} </a>
94
+ <# } #>
95
+ <# if ( data.contact && data.support ) { #>
96
+ </div>
97
+ <# } #>
98
+ </h3>
99
+ </li>
100
+ <?php
101
+ }
102
  }
freemius/includes/entities/class-fs-payment.php CHANGED
@@ -1,168 +1,168 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2016, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.0
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_Payment extends FS_Entity {
14
-
15
- #region Properties
16
-
17
- /**
18
- * @var number
19
- */
20
- public $plugin_id;
21
- /**
22
- * @var number
23
- */
24
- public $user_id;
25
- /**
26
- * @var number
27
- */
28
- public $install_id;
29
- /**
30
- * @var number
31
- */
32
- public $subscription_id;
33
- /**
34
- * @var number
35
- */
36
- public $plan_id;
37
- /**
38
- * @var number
39
- */
40
- public $license_id;
41
- /**
42
- * @var float
43
- */
44
- public $gross;
45
- /**
46
- * @author Leo Fajardo (@leorw)
47
- * @since 2.3.0
48
- *
49
- * @var string One of the following: `usd`, `gbp`, `eur`.
50
- */
51
- public $currency;
52
- /**
53
- * @var number
54
- */
55
- public $bound_payment_id;
56
- /**
57
- * @var string
58
- */
59
- public $external_id;
60
- /**
61
- * @var string
62
- */
63
- public $gateway;
64
- /**
65
- * @var string ISO 3166-1 alpha-2 - two-letter country code.
66
- *
67
- * @link http://www.wikiwand.com/en/ISO_3166-1_alpha-2
68
- */
69
- public $country_code;
70
- /**
71
- * @var string
72
- */
73
- public $vat_id;
74
- /**
75
- * @var float Actual Tax / VAT in $$$
76
- */
77
- public $vat;
78
- /**
79
- * @var int Payment source.
80
- */
81
- public $source = 0;
82
-
83
- #endregion Properties
84
-
85
- const CURRENCY_USD = 'usd';
86
- const CURRENCY_GBP = 'gbp';
87
- const CURRENCY_EUR = 'eur';
88
-
89
- /**
90
- * @param object|bool $payment
91
- */
92
- function __construct( $payment = false ) {
93
- parent::__construct( $payment );
94
- }
95
-
96
- static function get_type() {
97
- return 'payment';
98
- }
99
-
100
- /**
101
- * @author Vova Feldman (@svovaf)
102
- * @since 1.0.0
103
- *
104
- * @return bool
105
- */
106
- function is_refund() {
107
- return ( parent::is_valid_id( $this->bound_payment_id ) && 0 > $this->gross );
108
- }
109
-
110
- /**
111
- * Checks if the payment was migrated from another platform.
112
- *
113
- * @author Vova Feldman (@svovaf)
114
- * @since 2.0.2
115
- *
116
- * @return bool
117
- */
118
- function is_migrated() {
119
- return ( 0 != $this->source );
120
- }
121
-
122
- /**
123
- * Returns the gross in this format:
124
- * `{symbol}{amount | 2 decimal digits} {currency | uppercase}`
125
- *
126
- * Examples: £9.99 GBP, -£9.99 GBP.
127
- *
128
- * @author Leo Fajardo (@leorw)
129
- * @since 2.3.0
130
- *
131
- * @return string
132
- */
133
- function formatted_gross()
134
- {
135
- return (
136
- ( $this->gross < 0 ? '-' : '' ) .
137
- $this->get_symbol() .
138
- number_format( abs( $this->gross ), 2, '.', ',' ) . ' ' .
139
- strtoupper( $this->currency )
140
- );
141
- }
142
-
143
- /**
144
- * A map between supported currencies with their symbols.
145
- *
146
- * @var array<string,string>
147
- */
148
- static $CURRENCY_2_SYMBOL;
149
-
150
- /**
151
- * @author Leo Fajardo (@leorw)
152
- * @since 2.3.0
153
- *
154
- * @return string
155
- */
156
- private function get_symbol() {
157
- if ( ! isset( self::$CURRENCY_2_SYMBOL ) ) {
158
- // Lazy load.
159
- self::$CURRENCY_2_SYMBOL = array(
160
- self::CURRENCY_USD => '$',
161
- self::CURRENCY_GBP => '&pound;',
162
- self::CURRENCY_EUR => '&euro;',
163
- );
164
- }
165
-
166
- return self::$CURRENCY_2_SYMBOL[ $this->currency ];
167
- }
168
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2016, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.0
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Payment extends FS_Entity {
14
+
15
+ #region Properties
16
+
17
+ /**
18
+ * @var number
19
+ */
20
+ public $plugin_id;
21
+ /**
22
+ * @var number
23
+ */
24
+ public $user_id;
25
+ /**
26
+ * @var number
27
+ */
28
+ public $install_id;
29
+ /**
30
+ * @var number
31
+ */
32
+ public $subscription_id;
33
+ /**
34
+ * @var number
35
+ */
36
+ public $plan_id;
37
+ /**
38
+ * @var number
39
+ */
40
+ public $license_id;
41
+ /**
42
+ * @var float
43
+ */
44
+ public $gross;
45
+ /**
46
+ * @author Leo Fajardo (@leorw)
47
+ * @since 2.3.0
48
+ *
49
+ * @var string One of the following: `usd`, `gbp`, `eur`.
50
+ */
51
+ public $currency;
52
+ /**
53
+ * @var number
54
+ */
55
+ public $bound_payment_id;
56
+ /**
57
+ * @var string
58
+ */
59
+ public $external_id;
60
+ /**
61
+ * @var string
62
+ */
63
+ public $gateway;
64
+ /**
65
+ * @var string ISO 3166-1 alpha-2 - two-letter country code.
66
+ *
67
+ * @link http://www.wikiwand.com/en/ISO_3166-1_alpha-2
68
+ */
69
+ public $country_code;
70
+ /**
71
+ * @var string
72
+ */
73
+ public $vat_id;
74
+ /**
75
+ * @var float Actual Tax / VAT in $$$
76
+ */
77
+ public $vat;
78
+ /**
79
+ * @var int Payment source.
80
+ */
81
+ public $source = 0;
82
+
83
+ #endregion Properties
84
+
85
+ const CURRENCY_USD = 'usd';
86
+ const CURRENCY_GBP = 'gbp';
87
+ const CURRENCY_EUR = 'eur';
88
+
89
+ /**
90
+ * @param object|bool $payment
91
+ */
92
+ function __construct( $payment = false ) {
93
+ parent::__construct( $payment );
94
+ }
95
+
96
+ static function get_type() {
97
+ return 'payment';
98
+ }
99
+
100
+ /**
101
+ * @author Vova Feldman (@svovaf)
102
+ * @since 1.0.0
103
+ *
104
+ * @return bool
105
+ */
106
+ function is_refund() {
107
+ return ( parent::is_valid_id( $this->bound_payment_id ) && 0 > $this->gross );
108
+ }
109
+
110
+ /**
111
+ * Checks if the payment was migrated from another platform.
112
+ *
113
+ * @author Vova Feldman (@svovaf)
114
+ * @since 2.0.2
115
+ *
116
+ * @return bool
117
+ */
118
+ function is_migrated() {
119
+ return ( 0 != $this->source );
120
+ }
121
+
122
+ /**
123
+ * Returns the gross in this format:
124
+ * `{symbol}{amount | 2 decimal digits} {currency | uppercase}`
125
+ *
126
+ * Examples: £9.99 GBP, -£9.99 GBP.
127
+ *
128
+ * @author Leo Fajardo (@leorw)
129
+ * @since 2.3.0
130
+ *
131
+ * @return string
132
+ */
133
+ function formatted_gross()
134
+ {
135
+ return (
136
+ ( $this->gross < 0 ? '-' : '' ) .
137
+ $this->get_symbol() .
138
+ number_format( abs( $this->gross ), 2, '.', ',' ) . ' ' .
139
+ strtoupper( $this->currency )
140
+ );
141
+ }
142
+
143
+ /**
144
+ * A map between supported currencies with their symbols.
145
+ *
146
+ * @var array<string,string>
147
+ */
148
+ static $CURRENCY_2_SYMBOL;
149
+
150
+ /**
151
+ * @author Leo Fajardo (@leorw)
152
+ * @since 2.3.0
153
+ *
154
+ * @return string
155
+ */
156
+ private function get_symbol() {
157
+ if ( ! isset( self::$CURRENCY_2_SYMBOL ) ) {
158
+ // Lazy load.
159
+ self::$CURRENCY_2_SYMBOL = array(
160
+ self::CURRENCY_USD => '$',
161
+ self::CURRENCY_GBP => '&pound;',
162
+ self::CURRENCY_EUR => '&euro;',
163
+ );
164
+ }
165
+
166
+ return self::$CURRENCY_2_SYMBOL[ $this->currency ];
167
+ }
168
  }
freemius/includes/entities/class-fs-plugin-license.php CHANGED
@@ -1,330 +1,330 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.5
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * Class FS_Plugin_License
15
- */
16
- class FS_Plugin_License extends FS_Entity {
17
-
18
- #region Properties
19
-
20
- /**
21
- * @var number
22
- */
23
- public $plugin_id;
24
- /**
25
- * @var number
26
- */
27
- public $user_id;
28
- /**
29
- * @var number
30
- */
31
- public $plan_id;
32
- /**
33
- * @author Leo Fajardo (@leorw)
34
- * @since 2.3.0
35
- *
36
- * @var string
37
- */
38
- public $parent_plan_name;
39
- /**
40
- * @author Leo Fajardo (@leorw)
41
- * @since 2.3.0
42
- *
43
- * @var string
44
- */
45
- public $parent_plan_title;
46
- /**
47
- * @author Leo Fajardo (@leorw)
48
- * @since 2.3.0
49
- *
50
- * @var number
51
- */
52
- public $parent_license_id;
53
- /**
54
- * @author Leo Fajardo (@leorw)
55
- * @since 2.4.0
56
- *
57
- * @var array
58
- */
59
- public $products;
60
- /**
61
- * @var number
62
- */
63
- public $pricing_id;
64
- /**
65
- * @var int|null
66
- */
67
- public $quota;
68
- /**
69
- * @var int
70
- */
71
- public $activated;
72
- /**
73
- * @var int
74
- */
75
- public $activated_local;
76
- /**
77
- * @var string
78
- */
79
- public $expiration;
80
- /**
81
- * @var string
82
- */
83
- public $secret_key;
84
- /**
85
- * @var bool
86
- */
87
- public $is_whitelabeled;
88
- /**
89
- * @var bool $is_free_localhost Defaults to true. If true, allow unlimited localhost installs with the same
90
- * license.
91
- */
92
- public $is_free_localhost;
93
- /**
94
- * @var bool $is_block_features Defaults to true. If false, don't block features after license expiry - only
95
- * block updates and support.
96
- */
97
- public $is_block_features;
98
- /**
99
- * @var bool
100
- */
101
- public $is_cancelled;
102
-
103
- #endregion Properties
104
-
105
- /**
106
- * @param stdClass|bool $license
107
- */
108
- function __construct( $license = false ) {
109
- parent::__construct( $license );
110
- }
111
-
112
- /**
113
- * Get entity type.
114
- *
115
- * @return string
116
- */
117
- static function get_type() {
118
- return 'license';
119
- }
120
-
121
- /**
122
- * Check how many site activations left.
123
- *
124
- * @author Vova Feldman (@svovaf)
125
- * @since 1.0.5
126
- *
127
- * @return int
128
- */
129
- function left() {
130
- if ( ! $this->is_features_enabled() ) {
131
- return 0;
132
- }
133
-
134
- if ( $this->is_unlimited() ) {
135
- return 999;
136
- }
137
-
138
- return ( $this->quota - $this->activated - ( $this->is_free_localhost ? 0 : $this->activated_local ) );
139
- }
140
-
141
- /**
142
- * Check if single site license.
143
- *
144
- * @author Vova Feldman (@svovaf)
145
- * @since 1.1.8.1
146
- *
147
- * @return bool
148
- */
149
- function is_single_site() {
150
- return ( is_numeric( $this->quota ) && 1 == $this->quota );
151
- }
152
-
153
- /**
154
- * @author Vova Feldman (@svovaf)
155
- * @since 1.0.5
156
- *
157
- * @return bool
158
- */
159
- function is_expired() {
160
- return ! $this->is_lifetime() && ( strtotime( $this->expiration ) < WP_FS__SCRIPT_START_TIME );
161
- }
162
-
163
- /**
164
- * Check if license is not expired.
165
- *
166
- * @author Vova Feldman (@svovaf)
167
- * @since 1.2.1
168
- *
169
- * @return bool
170
- */
171
- function is_valid() {
172
- return ! $this->is_expired();
173
- }
174
-
175
- /**
176
- * @author Vova Feldman (@svovaf)
177
- * @since 1.0.6
178
- *
179
- * @return bool
180
- */
181
- function is_lifetime() {
182
- return is_null( $this->expiration );
183
- }
184
-
185
- /**
186
- * @author Vova Feldman (@svovaf)
187
- * @since 1.2.0
188
- *
189
- * @return bool
190
- */
191
- function is_unlimited() {
192
- return is_null( $this->quota );
193
- }
194
-
195
- /**
196
- * Check if license is fully utilized.
197
- *
198
- * @author Vova Feldman (@svovaf)
199
- * @since 1.0.6
200
- *
201
- * @param bool|null $is_localhost
202
- *
203
- * @return bool
204
- */
205
- function is_utilized( $is_localhost = null ) {
206
- if ( is_null( $is_localhost ) ) {
207
- $is_localhost = WP_FS__IS_LOCALHOST_FOR_SERVER;
208
- }
209
-
210
- if ( $this->is_unlimited() ) {
211
- return false;
212
- }
213
-
214
- return ! ( $this->is_free_localhost && $is_localhost ) &&
215
- ( $this->quota <= $this->activated + ( $this->is_free_localhost ? 0 : $this->activated_local ) );
216
- }
217
-
218
- /**
219
- * Check if license can be activated.
220
- *
221
- * @author Vova Feldman (@svovaf)
222
- * @since 2.0.0
223
- *
224
- * @param bool|null $is_localhost
225
- *
226
- * @return bool
227
- */
228
- function can_activate( $is_localhost = null ) {
229
- return ! $this->is_utilized( $is_localhost ) && $this->is_features_enabled();
230
- }
231
-
232
- /**
233
- * Check if license can be activated on a given number of production and localhost sites.
234
- *
235
- * @author Vova Feldman (@svovaf)
236
- * @since 2.0.0
237
- *
238
- * @param int $production_count
239
- * @param int $localhost_count
240
- *
241
- * @return bool
242
- */
243
- function can_activate_bulk( $production_count, $localhost_count ) {
244
- if ( $this->is_unlimited() ) {
245
- return true;
246
- }
247
-
248
- /**
249
- * For simplicity, the logic will work as following: when given X sites to activate the license on, if it's
250
- * possible to activate on ALL of them, do the activation. If it's not possible to activate on ALL of them,
251
- * do NOT activate on any of them.
252
- */
253
- return ( $this->quota >= $this->activated + $production_count + ( $this->is_free_localhost ? 0 : $this->activated_local + $localhost_count ) );
254
- }
255
-
256
- /**
257
- * @author Vova Feldman (@svovaf)
258
- * @since 1.2.1
259
- *
260
- * @return bool
261
- */
262
- function is_active() {
263
- return ( ! $this->is_cancelled );
264
- }
265
-
266
- /**
267
- * Check if license's plan features are enabled.
268
- *
269
- * - Either if plan not expired
270
- * - If expired, based on the configuration to block features or not.
271
- *
272
- * @author Vova Feldman (@svovaf)
273
- * @since 1.0.6
274
- *
275
- * @return bool
276
- */
277
- function is_features_enabled() {
278
- return $this->is_active() && ( ! $this->is_block_features || ! $this->is_expired() );
279
- }
280
-
281
- /**
282
- * Subscription considered to be new without any payments
283
- * if the license expires in less than 24 hours
284
- * from the license creation.
285
- *
286
- * @author Vova Feldman (@svovaf)
287
- * @since 1.0.9
288
- *
289
- * @return bool
290
- */
291
- function is_first_payment_pending() {
292
- return ( WP_FS__TIME_24_HOURS_IN_SEC >= strtotime( $this->expiration ) - strtotime( $this->created ) );
293
- }
294
-
295
- /**
296
- * @return int
297
- */
298
- function total_activations() {
299
- return ( $this->activated + $this->activated_local );
300
- }
301
-
302
- /**
303
- * @author Vova Feldman (@svovaf)
304
- * @since 2.3.1
305
- *
306
- * @return string
307
- */
308
- function get_html_escaped_masked_secret_key() {
309
- return self::mask_secret_key_for_html( $this->secret_key );
310
- }
311
-
312
- /**
313
- * @author Vova Feldman (@svovaf)
314
- * @since 2.3.1
315
- *
316
- * @param string $secret_key
317
- *
318
- * @return string
319
- */
320
- static function mask_secret_key_for_html( $secret_key ) {
321
- return (
322
- // Initial 6 chars - sk_ABC
323
- htmlspecialchars( substr( $secret_key, 0, 6 ) ) .
324
- // Masking
325
- str_pad( '', ( strlen( $secret_key ) - 9 ) * 6, '&bull;' ) .
326
- // Last 3 chars.
327
- htmlspecialchars( substr( $secret_key, - 3 ) )
328
- );
329
- }
330
- }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.5
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Class FS_Plugin_License
15
+ */
16
+ class FS_Plugin_License extends FS_Entity {
17
+
18
+ #region Properties
19
+
20
+ /**
21
+ * @var number
22
+ */
23
+ public $plugin_id;
24
+ /**
25
+ * @var number
26
+ */
27
+ public $user_id;
28
+ /**
29
+ * @var number
30
+ */
31
+ public $plan_id;
32
+ /**
33
+ * @author Leo Fajardo (@leorw)
34
+ * @since 2.3.0
35
+ *
36
+ * @var string
37
+ */
38
+ public $parent_plan_name;
39
+ /**
40
+ * @author Leo Fajardo (@leorw)
41
+ * @since 2.3.0
42
+ *
43
+ * @var string
44
+ */
45
+ public $parent_plan_title;
46
+ /**
47
+ * @author Leo Fajardo (@leorw)
48
+ * @since 2.3.0
49
+ *
50
+ * @var number
51
+ */
52
+ public $parent_license_id;
53
+ /**
54
+ * @author Leo Fajardo (@leorw)
55
+ * @since 2.4.0
56
+ *
57
+ * @var array
58
+ */
59
+ public $products;
60
+ /**
61
+ * @var number
62
+ */
63
+ public $pricing_id;
64
+ /**
65
+ * @var int|null
66
+ */
67
+ public $quota;
68
+ /**
69
+ * @var int
70
+ */
71
+ public $activated;
72
+ /**
73
+ * @var int
74
+ */
75
+ public $activated_local;
76
+ /**
77
+ * @var string
78
+ */
79
+ public $expiration;
80
+ /**
81
+ * @var string
82
+ */
83
+ public $secret_key;
84
+ /**
85
+ * @var bool
86
+ */
87
+ public $is_whitelabeled;
88
+ /**
89
+ * @var bool $is_free_localhost Defaults to true. If true, allow unlimited localhost installs with the same
90
+ * license.
91
+ */
92
+ public $is_free_localhost;
93
+ /**
94
+ * @var bool $is_block_features Defaults to true. If false, don't block features after license expiry - only
95
+ * block updates and support.
96
+ */
97
+ public $is_block_features;
98
+ /**
99
+ * @var bool
100
+ */
101
+ public $is_cancelled;
102
+
103
+ #endregion Properties
104
+
105
+ /**
106
+ * @param stdClass|bool $license
107
+ */
108
+ function __construct( $license = false ) {
109
+ parent::__construct( $license );
110
+ }
111
+
112
+ /**
113
+ * Get entity type.
114
+ *
115
+ * @return string
116
+ */
117
+ static function get_type() {
118
+ return 'license';
119
+ }
120
+
121
+ /**
122
+ * Check how many site activations left.
123
+ *
124
+ * @author Vova Feldman (@svovaf)
125
+ * @since 1.0.5
126
+ *
127
+ * @return int
128
+ */
129
+ function left() {
130
+ if ( ! $this->is_features_enabled() ) {
131
+ return 0;
132
+ }
133
+
134
+ if ( $this->is_unlimited() ) {
135
+ return 999;
136
+ }
137
+
138
+ return ( $this->quota - $this->activated - ( $this->is_free_localhost ? 0 : $this->activated_local ) );
139
+ }
140
+
141
+ /**
142
+ * Check if single site license.
143
+ *
144
+ * @author Vova Feldman (@svovaf)
145
+ * @since 1.1.8.1
146
+ *
147
+ * @return bool
148
+ */
149
+ function is_single_site() {
150
+ return ( is_numeric( $this->quota ) && 1 == $this->quota );
151
+ }
152
+
153
+ /**
154
+ * @author Vova Feldman (@svovaf)
155
+ * @since 1.0.5
156
+ *
157
+ * @return bool
158
+ */
159
+ function is_expired() {
160
+ return ! $this->is_lifetime() && ( strtotime( $this->expiration ) < WP_FS__SCRIPT_START_TIME );
161
+ }
162
+
163
+ /**
164
+ * Check if license is not expired.
165
+ *
166
+ * @author Vova Feldman (@svovaf)
167
+ * @since 1.2.1
168
+ *
169
+ * @return bool
170
+ */
171
+ function is_valid() {
172
+ return ! $this->is_expired();
173
+ }
174
+
175
+ /**
176
+ * @author Vova Feldman (@svovaf)
177
+ * @since 1.0.6
178
+ *
179
+ * @return bool
180
+ */
181
+ function is_lifetime() {
182
+ return is_null( $this->expiration );
183
+ }
184
+
185
+ /**
186
+ * @author Vova Feldman (@svovaf)
187
+ * @since 1.2.0
188
+ *
189
+ * @return bool
190
+ */
191
+ function is_unlimited() {
192
+ return is_null( $this->quota );
193
+ }
194
+
195
+ /**
196
+ * Check if license is fully utilized.
197
+ *
198
+ * @author Vova Feldman (@svovaf)
199
+ * @since 1.0.6
200
+ *
201
+ * @param bool|null $is_localhost
202
+ *
203
+ * @return bool
204
+ */
205
+ function is_utilized( $is_localhost = null ) {
206
+ if ( is_null( $is_localhost ) ) {
207
+ $is_localhost = WP_FS__IS_LOCALHOST_FOR_SERVER;
208
+ }
209
+
210
+ if ( $this->is_unlimited() ) {
211
+ return false;
212
+ }
213
+
214
+ return ! ( $this->is_free_localhost && $is_localhost ) &&
215
+ ( $this->quota <= $this->activated + ( $this->is_free_localhost ? 0 : $this->activated_local ) );
216
+ }
217
+
218
+ /**
219
+ * Check if license can be activated.
220
+ *
221
+ * @author Vova Feldman (@svovaf)
222
+ * @since 2.0.0
223
+ *
224
+ * @param bool|null $is_localhost
225
+ *
226
+ * @return bool
227
+ */
228
+ function can_activate( $is_localhost = null ) {
229
+ return ! $this->is_utilized( $is_localhost ) && $this->is_features_enabled();
230
+ }
231
+
232
+ /**
233
+ * Check if license can be activated on a given number of production and localhost sites.
234
+ *
235
+ * @author Vova Feldman (@svovaf)
236
+ * @since 2.0.0
237
+ *
238
+ * @param int $production_count
239
+ * @param int $localhost_count
240
+ *
241
+ * @return bool
242
+ */
243
+ function can_activate_bulk( $production_count, $localhost_count ) {
244
+ if ( $this->is_unlimited() ) {
245
+ return true;
246
+ }
247
+
248
+ /**
249
+ * For simplicity, the logic will work as following: when given X sites to activate the license on, if it's
250
+ * possible to activate on ALL of them, do the activation. If it's not possible to activate on ALL of them,
251
+ * do NOT activate on any of them.
252
+ */
253
+ return ( $this->quota >= $this->activated + $production_count + ( $this->is_free_localhost ? 0 : $this->activated_local + $localhost_count ) );
254
+ }
255
+
256
+ /**
257
+ * @author Vova Feldman (@svovaf)
258
+ * @since 1.2.1
259
+ *
260
+ * @return bool
261
+ */
262
+ function is_active() {
263
+ return ( ! $this->is_cancelled );
264
+ }
265
+
266
+ /**
267
+ * Check if license's plan features are enabled.
268
+ *
269
+ * - Either if plan not expired
270
+ * - If expired, based on the configuration to block features or not.
271
+ *
272
+ * @author Vova Feldman (@svovaf)
273
+ * @since 1.0.6
274
+ *
275
+ * @return bool
276
+ */
277
+ function is_features_enabled() {
278
+ return $this->is_active() && ( ! $this->is_block_features || ! $this->is_expired() );
279
+ }
280
+
281
+ /**
282
+ * Subscription considered to be new without any payments
283
+ * if the license expires in less than 24 hours
284
+ * from the license creation.
285
+ *
286
+ * @author Vova Feldman (@svovaf)
287
+ * @since 1.0.9
288
+ *
289
+ * @return bool
290
+ */
291
+ function is_first_payment_pending() {
292
+ return ( WP_FS__TIME_24_HOURS_IN_SEC >= strtotime( $this->expiration ) - strtotime( $this->created ) );
293
+ }
294
+
295
+ /**
296
+ * @return int
297
+ */
298
+ function total_activations() {
299
+ return ( $this->activated + $this->activated_local );
300
+ }
301
+
302
+ /**
303
+ * @author Vova Feldman (@svovaf)
304
+ * @since 2.3.1
305
+ *
306
+ * @return string
307
+ */
308
+ function get_html_escaped_masked_secret_key() {
309
+ return self::mask_secret_key_for_html( $this->secret_key );
310
+ }
311
+
312
+ /**
313
+ * @author Vova Feldman (@svovaf)
314
+ * @since 2.3.1
315
+ *
316
+ * @param string $secret_key
317
+ *
318
+ * @return string
319
+ */
320
+ static function mask_secret_key_for_html( $secret_key ) {
321
+ return (
322
+ // Initial 6 chars - sk_ABC
323
+ htmlspecialchars( substr( $secret_key, 0, 6 ) ) .
324
+ // Masking
325
+ str_pad( '', ( strlen( $secret_key ) - 9 ) * 6, '&bull;' ) .
326
+ // Last 3 chars.
327
+ htmlspecialchars( substr( $secret_key, - 3 ) )
328
+ );
329
+ }
330
+ }
freemius/includes/entities/class-fs-site.php CHANGED
@@ -1,236 +1,236 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.3
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_Site extends FS_Scope_Entity {
14
- /**
15
- * @var number
16
- */
17
- public $site_id;
18
- /**
19
- * @var number
20
- */
21
- public $plugin_id;
22
- /**
23
- * @var number
24
- */
25
- public $user_id;
26
- /**
27
- * @var string
28
- */
29
- public $title;
30
- /**
31
- * @var string
32
- */
33
- public $url;
34
- /**
35
- * @var string
36
- */
37
- public $version;
38
- /**
39
- * @var string E.g. en-GB
40
- */
41
- public $language;
42
- /**
43
- * @var string E.g. UTF-8
44
- */
45
- public $charset;
46
- /**
47
- * @var string Platform version (e.g WordPress version).
48
- */
49
- public $platform_version;
50
- /**
51
- * Freemius SDK version
52
- *
53
- * @author Leo Fajardo (@leorw)
54
- * @since 1.2.2
55
- *
56
- * @var string SDK version (e.g.: 1.2.2)
57
- */
58
- public $sdk_version;
59
- /**
60
- * @var string Programming language version (e.g PHP version).
61
- */
62
- public $programming_language_version;
63
- /**
64
- * @var number|null
65
- */
66
- public $plan_id;
67
- /**
68
- * @var number|null
69
- */
70
- public $license_id;
71
- /**
72
- * @var number|null
73
- */
74
- public $trial_plan_id;
75
- /**
76
- * @var string|null
77
- */
78
- public $trial_ends;
79
- /**
80
- * @since 1.0.9
81
- *
82
- * @var bool
83
- */
84
- public $is_premium = false;
85
- /**
86
- * @author Leo Fajardo (@leorw)
87
- *
88
- * @since 1.2.1.5
89
- *
90
- * @var bool
91
- */
92
- public $is_disconnected = false;
93
- /**
94
- * @since 2.0.0
95
- *
96
- * @var bool
97
- */
98
- public $is_active = true;
99
- /**
100
- * @since 2.0.0
101
- *
102
- * @var bool
103
- */
104
- public $is_uninstalled = false;
105
-
106
- /**
107
- * @param stdClass|bool $site
108
- */
109
- function __construct( $site = false ) {
110
- parent::__construct( $site );
111
-
112
- if ( is_object( $site ) ) {
113
- $this->plan_id = $site->plan_id;
114
- }
115
-
116
- if ( ! is_bool( $this->is_disconnected ) ) {
117
- $this->is_disconnected = false;
118
- }
119
- }
120
-
121
- static function get_type() {
122
- return 'install';
123
- }
124
-
125
- /**
126
- * @author Vova Feldman (@svovaf)
127
- * @since 2.0.0
128
- *
129
- * @param string $url
130
- *
131
- * @return bool
132
- */
133
- static function is_localhost_by_address( $url ) {
134
- if ( false !== strpos( $url, '127.0.0.1' ) ||
135
- false !== strpos( $url, 'localhost' )
136
- ) {
137
- return true;
138
- }
139
-
140
- if ( ! fs_starts_with( $url, 'http' ) ) {
141
- $url = 'http://' . $url;
142
- }
143
-
144
- $url_parts = parse_url( $url );
145
-
146
- $subdomain = $url_parts['host'];
147
-
148
- return (
149
- // Starts with.
150
- fs_starts_with( $subdomain, 'local.' ) ||
151
- fs_starts_with( $subdomain, 'dev.' ) ||
152
- fs_starts_with( $subdomain, 'test.' ) ||
153
- fs_starts_with( $subdomain, 'stage.' ) ||
154
- fs_starts_with( $subdomain, 'staging.' ) ||
155
-
156
- // Ends with.
157
- fs_ends_with( $subdomain, '.dev' ) ||
158
- fs_ends_with( $subdomain, '.test' ) ||
159
- fs_ends_with( $subdomain, '.staging' ) ||
160
- fs_ends_with( $subdomain, '.local' ) ||
161
- fs_ends_with( $subdomain, '.example' ) ||
162
- fs_ends_with( $subdomain, '.invalid' ) ||
163
- // GoDaddy test/dev.
164
- fs_ends_with( $subdomain, '.myftpupload.com' ) ||
165
- // ngrok tunneling.
166
- fs_ends_with( $subdomain, '.ngrok.io' ) ||
167
- // wpsandbox.
168
- fs_ends_with( $subdomain, '.wpsandbox.pro' ) ||
169
- // SiteGround staging.
170
- fs_starts_with( $subdomain, 'staging' ) ||
171
- // WPEngine staging.
172
- fs_ends_with( $subdomain, '.staging.wpengine.com' ) ||
173
- fs_ends_with( $subdomain, '.dev.wpengine.com' ) ||
174
- fs_ends_with( $subdomain, '.wpengine.com' ) ||
175
- // Pantheon
176
- ( fs_ends_with( $subdomain, 'pantheonsite.io' ) &&
177
- ( fs_starts_with( $subdomain, 'test-' ) || fs_starts_with( $subdomain, 'dev-' ) ) ) ||
178
- // Cloudways
179
- fs_ends_with( $subdomain, '.cloudwaysapps.com' ) ||
180
- // Kinsta
181
- ( fs_starts_with( $subdomain, 'staging-' ) && ( fs_ends_with( $subdomain, '.kinsta.com' ) || fs_ends_with( $subdomain, '.kinsta.cloud' ) ) ) ||
182
- // DesktopServer
183
- fs_ends_with( $subdomain, '.dev.cc' ) ||
184
- // Pressable
185
- fs_ends_with( $subdomain, '.mystagingwebsite.com' )
186
- );
187
- }
188
-
189
- function is_localhost() {
190
- return ( WP_FS__IS_LOCALHOST_FOR_SERVER || self::is_localhost_by_address( $this->url ) );
191
- }
192
-
193
- /**
194
- * Check if site in trial.
195
- *
196
- * @author Vova Feldman (@svovaf)
197
- * @since 1.0.9
198
- *
199
- * @return bool
200
- */
201
- function is_trial() {
202
- return is_numeric( $this->trial_plan_id ) && ( strtotime( $this->trial_ends ) > WP_FS__SCRIPT_START_TIME );
203
- }
204
-
205
- /**
206
- * Check if user already utilized the trial with the current install.
207
- *
208
- * @author Vova Feldman (@svovaf)
209
- * @since 1.0.9
210
- *
211
- * @return bool
212
- */
213
- function is_trial_utilized() {
214
- return is_numeric( $this->trial_plan_id );
215
- }
216
-
217
- /**
218
- * @author Vova Feldman (@svovaf)
219
- * @since 2.0.0
220
- *
221
- * @return bool
222
- */
223
- function is_tracking_allowed() {
224
- return ( true !== $this->is_disconnected );
225
- }
226
-
227
- /**
228
- * @author Vova Feldman (@svovaf)
229
- * @since 2.0.0
230
- *
231
- * @return bool
232
- */
233
- function is_tracking_prohibited() {
234
- return ! $this->is_tracking_allowed();
235
- }
236
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Site extends FS_Scope_Entity {
14
+ /**
15
+ * @var number
16
+ */
17
+ public $site_id;
18
+ /**
19
+ * @var number
20
+ */
21
+ public $plugin_id;
22
+ /**
23
+ * @var number
24
+ */
25
+ public $user_id;
26
+ /**
27
+ * @var string
28
+ */
29
+ public $title;
30
+ /**
31
+ * @var string
32
+ */
33
+ public $url;
34
+ /**
35
+ * @var string
36
+ */
37
+ public $version;
38
+ /**
39
+ * @var string E.g. en-GB
40
+ */
41
+ public $language;
42
+ /**
43
+ * @var string E.g. UTF-8
44
+ */
45
+ public $charset;
46
+ /**
47
+ * @var string Platform version (e.g WordPress version).
48
+ */
49
+ public $platform_version;
50
+ /**
51
+ * Freemius SDK version
52
+ *
53
+ * @author Leo Fajardo (@leorw)
54
+ * @since 1.2.2
55
+ *
56
+ * @var string SDK version (e.g.: 1.2.2)
57
+ */
58
+ public $sdk_version;
59
+ /**
60
+ * @var string Programming language version (e.g PHP version).
61
+ */
62
+ public $programming_language_version;
63
+ /**
64
+ * @var number|null
65
+ */
66
+ public $plan_id;
67
+ /**
68
+ * @var number|null
69
+ */
70
+ public $license_id;
71
+ /**
72
+ * @var number|null
73
+ */
74
+ public $trial_plan_id;
75
+ /**
76
+ * @var string|null
77
+ */
78
+ public $trial_ends;
79
+ /**
80
+ * @since 1.0.9
81
+ *
82
+ * @var bool
83
+ */
84
+ public $is_premium = false;
85
+ /**
86
+ * @author Leo Fajardo (@leorw)
87
+ *
88
+ * @since 1.2.1.5
89
+ *
90
+ * @var bool
91
+ */
92
+ public $is_disconnected = false;
93
+ /**
94
+ * @since 2.0.0
95
+ *
96
+ * @var bool
97
+ */
98
+ public $is_active = true;
99
+ /**
100
+ * @since 2.0.0
101
+ *
102
+ * @var bool
103
+ */
104
+ public $is_uninstalled = false;
105
+
106
+ /**
107
+ * @param stdClass|bool $site
108
+ */
109
+ function __construct( $site = false ) {
110
+ parent::__construct( $site );
111
+
112
+ if ( is_object( $site ) ) {
113
+ $this->plan_id = $site->plan_id;
114
+ }
115
+
116
+ if ( ! is_bool( $this->is_disconnected ) ) {
117
+ $this->is_disconnected = false;
118
+ }
119
+ }
120
+
121
+ static function get_type() {
122
+ return 'install';
123
+ }
124
+
125
+ /**
126
+ * @author Vova Feldman (@svovaf)
127
+ * @since 2.0.0
128
+ *
129
+ * @param string $url
130
+ *
131
+ * @return bool
132
+ */
133
+ static function is_localhost_by_address( $url ) {
134
+ if ( false !== strpos( $url, '127.0.0.1' ) ||
135
+ false !== strpos( $url, 'localhost' )
136
+ ) {
137
+ return true;
138
+ }
139
+
140
+ if ( ! fs_starts_with( $url, 'http' ) ) {
141
+ $url = 'http://' . $url;
142
+ }
143
+
144
+ $url_parts = parse_url( $url );
145
+
146
+ $subdomain = $url_parts['host'];
147
+
148
+ return (
149
+ // Starts with.
150
+ fs_starts_with( $subdomain, 'local.' ) ||
151
+ fs_starts_with( $subdomain, 'dev.' ) ||
152
+ fs_starts_with( $subdomain, 'test.' ) ||
153
+ fs_starts_with( $subdomain, 'stage.' ) ||
154
+ fs_starts_with( $subdomain, 'staging.' ) ||
155
+
156
+ // Ends with.
157
+ fs_ends_with( $subdomain, '.dev' ) ||
158
+ fs_ends_with( $subdomain, '.test' ) ||
159
+ fs_ends_with( $subdomain, '.staging' ) ||
160
+ fs_ends_with( $subdomain, '.local' ) ||
161
+ fs_ends_with( $subdomain, '.example' ) ||
162
+ fs_ends_with( $subdomain, '.invalid' ) ||
163
+ // GoDaddy test/dev.
164
+ fs_ends_with( $subdomain, '.myftpupload.com' ) ||
165
+ // ngrok tunneling.
166
+ fs_ends_with( $subdomain, '.ngrok.io' ) ||
167
+ // wpsandbox.
168
+ fs_ends_with( $subdomain, '.wpsandbox.pro' ) ||
169
+ // SiteGround staging.
170
+ fs_starts_with( $subdomain, 'staging' ) ||
171
+ // WPEngine staging.
172
+ fs_ends_with( $subdomain, '.staging.wpengine.com' ) ||
173
+ fs_ends_with( $subdomain, '.dev.wpengine.com' ) ||
174
+ fs_ends_with( $subdomain, '.wpengine.com' ) ||
175
+ // Pantheon
176
+ ( fs_ends_with( $subdomain, 'pantheonsite.io' ) &&
177
+ ( fs_starts_with( $subdomain, 'test-' ) || fs_starts_with( $subdomain, 'dev-' ) ) ) ||
178
+ // Cloudways
179
+ fs_ends_with( $subdomain, '.cloudwaysapps.com' ) ||
180
+ // Kinsta
181
+ ( fs_starts_with( $subdomain, 'staging-' ) && ( fs_ends_with( $subdomain, '.kinsta.com' ) || fs_ends_with( $subdomain, '.kinsta.cloud' ) ) ) ||
182
+ // DesktopServer
183
+ fs_ends_with( $subdomain, '.dev.cc' ) ||
184
+ // Pressable
185
+ fs_ends_with( $subdomain, '.mystagingwebsite.com' )
186
+ );
187
+ }
188
+
189
+ function is_localhost() {
190
+ return ( WP_FS__IS_LOCALHOST_FOR_SERVER || self::is_localhost_by_address( $this->url ) );
191
+ }
192
+
193
+ /**
194
+ * Check if site in trial.
195
+ *
196
+ * @author Vova Feldman (@svovaf)
197
+ * @since 1.0.9
198
+ *
199
+ * @return bool
200
+ */
201
+ function is_trial() {
202
+ return is_numeric( $this->trial_plan_id ) && ( strtotime( $this->trial_ends ) > WP_FS__SCRIPT_START_TIME );
203
+ }
204
+
205
+ /**
206
+ * Check if user already utilized the trial with the current install.
207
+ *
208
+ * @author Vova Feldman (@svovaf)
209
+ * @since 1.0.9
210
+ *
211
+ * @return bool
212
+ */
213
+ function is_trial_utilized() {
214
+ return is_numeric( $this->trial_plan_id );
215
+ }
216
+
217
+ /**
218
+ * @author Vova Feldman (@svovaf)
219
+ * @since 2.0.0
220
+ *
221
+ * @return bool
222
+ */
223
+ function is_tracking_allowed() {
224
+ return ( true !== $this->is_disconnected );
225
+ }
226
+
227
+ /**
228
+ * @author Vova Feldman (@svovaf)
229
+ * @since 2.0.0
230
+ *
231
+ * @return bool
232
+ */
233
+ function is_tracking_prohibited() {
234
+ return ! $this->is_tracking_allowed();
235
+ }
236
  }
freemius/includes/fs-plugin-info-dialog.php CHANGED
@@ -260,14 +260,20 @@
260
  if ( $has_valid_blog_id ) {
261
  restore_current_blog();
262
  }
 
263
 
264
- if ( is_object( $fs_addon ) ) {
265
- $data->has_purchased_license = $fs_addon->has_active_valid_license();
266
- } else {
267
- $account_addons = $this->_fs->get_account_addons();
268
- if ( ! empty( $account_addons ) && in_array( $selected_addon->id, $account_addons ) ) {
269
- $data->has_purchased_license = true;
270
- }
 
 
 
 
 
271
  }
272
  }
273
 
@@ -577,7 +583,7 @@
577
 
578
  $has_installed_version = ( 'install' !== $this->status['status'] );
579
 
580
- if ( ! $api->has_paid_plan ) {
581
  /**
582
  * Free-only add-on.
583
  *
@@ -1203,7 +1209,7 @@
1203
 
1204
  $(document).ready(function () {
1205
  var $plan = $('.plugin-information-pricing .fs-plan[data-plan-id=<?php echo $plan->id ?>]');
1206
- $plan.find('input[type=radio]').live('click', function () {
1207
  _updateCtaUrl(
1208
  $plan.attr('data-plan-id'),
1209
  $(this).val(),
@@ -1635,4 +1641,4 @@
1635
  iframe_footer();
1636
  exit;
1637
  }
1638
- }
260
  if ( $has_valid_blog_id ) {
261
  restore_current_blog();
262
  }
263
+ }
264
 
265
+ /**
266
+ * Check if there's a purchased license in case the add-on can only be installed/downloaded as part of a purchased bundle.
267
+ *
268
+ * @author Leo Fajardo (@leorw)
269
+ * @since 2.4.1
270
+ */
271
+ if ( is_object( $fs_addon ) ) {
272
+ $data->has_purchased_license = $fs_addon->has_active_valid_license();
273
+ } else {
274
+ $account_addons = $this->_fs->get_account_addons();
275
+ if ( ! empty( $account_addons ) && in_array( $selected_addon->id, $account_addons ) ) {
276
+ $data->has_purchased_license = true;
277
  }
278
  }
279
 
583
 
584
  $has_installed_version = ( 'install' !== $this->status['status'] );
585
 
586
+ if ( ! $api->has_paid_plan && ! $api->has_purchased_license ) {
587
  /**
588
  * Free-only add-on.
589
  *
1209
 
1210
  $(document).ready(function () {
1211
  var $plan = $('.plugin-information-pricing .fs-plan[data-plan-id=<?php echo $plan->id ?>]');
1212
+ $plan.find('input[type=radio]').on('click', function () {
1213
  _updateCtaUrl(
1214
  $plan.attr('data-plan-id'),
1215
  $(this).val(),
1641
  iframe_footer();
1642
  exit;
1643
  }
1644
+ }
freemius/includes/i18n.php CHANGED
@@ -98,6 +98,8 @@
98
  'error' => _fs_text( 'Error' ),
99
  'failed-finding-main-path' => _fs_text( 'Freemius SDK couldn\'t find the plugin\'s main file. Please contact sdk@freemius.com with the current error.' ),
100
  'learn-more' => _fs_text( 'Learn more' ),
 
 
101
 
102
  #region Affiliation
103
  'affiliation' => _fs_text( 'Affiliation' ),
98
  'error' => _fs_text( 'Error' ),
99
  'failed-finding-main-path' => _fs_text( 'Freemius SDK couldn\'t find the plugin\'s main file. Please contact sdk@freemius.com with the current error.' ),
100
  'learn-more' => _fs_text( 'Learn more' ),
101
+ 'license_not_whitelabeled' => _fs_text( "Is this your client's site? %s if you wish to hide sensitive info like your billing address and invoices from the WP Admin."),
102
+ 'license_whitelabeled' => _fs_text( 'Your %s license was flagged as white-labeled to hide sensitive information from the WP Admin (e.g. your billing address and invoices). If you ever wish to revert it back, you can easily do it through your %s. If this was a mistake you can also %s.'),
103
 
104
  #region Affiliation
105
  'affiliation' => _fs_text( 'Affiliation' ),
freemius/includes/managers/class-fs-admin-menu-manager.php CHANGED
@@ -1,1006 +1,1006 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.1.3
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_Admin_Menu_Manager {
14
-
15
- #region Properties
16
-
17
- /**
18
- * @since 1.2.2
19
- *
20
- * @var string
21
- */
22
- protected $_module_unique_affix;
23
-
24
- /**
25
- * @since 1.2.2
26
- *
27
- * @var number
28
- */
29
- protected $_module_id;
30
-
31
- /**
32
- * @since 1.2.2
33
- *
34
- * @var string
35
- */
36
- protected $_module_type;
37
-
38
- /**
39
- * @since 1.0.6
40
- *
41
- * @var string
42
- */
43
- private $_menu_slug;
44
- /**
45
- * @since 1.1.3
46
- *
47
- * @var string
48
- */
49
- private $_parent_slug;
50
- /**
51
- * @since 1.1.3
52
- *
53
- * @var string
54
- */
55
- private $_parent_type;
56
- /**
57
- * @since 1.1.3
58
- *
59
- * @var string
60
- */
61
- private $_type;
62
- /**
63
- * @since 1.1.3
64
- *
65
- * @var bool
66
- */
67
- private $_is_top_level;
68
- /**
69
- * @since 1.1.3
70
- *
71
- * @var bool
72
- */
73
- private $_is_override_exact;
74
- /**
75
- * @since 1.1.3
76
- *
77
- * @var array<string,bool>
78
- */
79
- private $_default_submenu_items;
80
- /**
81
- * @since 1.1.3
82
- *
83
- * @var string
84
- */
85
- private $_first_time_path;
86
- /**
87
- * @since 1.2.2
88
- *
89
- * @var bool
90
- */
91
- private $_menu_exists;
92
- /**
93
- * @since 2.0.0
94
- *
95
- * @var bool
96
- */
97
- private $_network_menu_exists;
98
-
99
- #endregion Properties
100
-
101
- /**
102
- * @var FS_Logger
103
- */
104
- protected $_logger;
105
-
106
- #region Singleton
107
-
108
- /**
109
- * @var FS_Admin_Menu_Manager[]
110
- */
111
- private static $_instances = array();
112
-
113
- /**
114
- * @param number $module_id
115
- * @param string $module_type
116
- * @param string $module_unique_affix
117
- *
118
- * @return FS_Admin_Menu_Manager
119
- */
120
- static function instance( $module_id, $module_type, $module_unique_affix ) {
121
- $key = 'm_' . $module_id;
122
-
123
- if ( ! isset( self::$_instances[ $key ] ) ) {
124
- self::$_instances[ $key ] = new FS_Admin_Menu_Manager( $module_id, $module_type, $module_unique_affix );
125
- }
126
-
127
- return self::$_instances[ $key ];
128
- }
129
-
130
- protected function __construct( $module_id, $module_type, $module_unique_affix ) {
131
- $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $module_id . '_admin_menu', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
132
-
133
- $this->_module_id = $module_id;
134
- $this->_module_type = $module_type;
135
- $this->_module_unique_affix = $module_unique_affix;
136
- }
137
-
138
- #endregion Singleton
139
-
140
- #region Helpers
141
-
142
- private function get_option( &$options, $key, $default = false ) {
143
- return ! empty( $options[ $key ] ) ? $options[ $key ] : $default;
144
- }
145
-
146
- private function get_bool_option( &$options, $key, $default = false ) {
147
- return isset( $options[ $key ] ) && is_bool( $options[ $key ] ) ? $options[ $key ] : $default;
148
- }
149
-
150
- #endregion Helpers
151
-
152
- /**
153
- * @param array $menu
154
- * @param bool $is_addon
155
- */
156
- function init( $menu, $is_addon = false ) {
157
- $this->_menu_exists = ( isset( $menu['slug'] ) && ! empty( $menu['slug'] ) );
158
- $this->_network_menu_exists = ( ! empty( $menu['network'] ) && true === $menu['network'] );
159
-
160
- $this->_menu_slug = ( $this->_menu_exists ? $menu['slug'] : $this->_module_unique_affix );
161
-
162
- $this->_default_submenu_items = array();
163
- // @deprecated
164
- $this->_type = 'page';
165
- $this->_is_top_level = true;
166
- $this->_is_override_exact = false;
167
- $this->_parent_slug = false;
168
- // @deprecated
169
- $this->_parent_type = 'page';
170
-
171
- if ( isset( $menu ) ) {
172
- if ( ! $is_addon ) {
173
- $this->_default_submenu_items = array(
174
- 'contact' => $this->get_bool_option( $menu, 'contact', true ),
175
- 'support' => $this->get_bool_option( $menu, 'support', true ),
176
- 'affiliation' => $this->get_bool_option( $menu, 'affiliation', true ),
177
- 'account' => $this->get_bool_option( $menu, 'account', true ),
178
- 'pricing' => $this->get_bool_option( $menu, 'pricing', true ),
179
- 'addons' => $this->get_bool_option( $menu, 'addons', true ),
180
- );
181
-
182
- // @deprecated
183
- $this->_type = $this->get_option( $menu, 'type', 'page' );
184
- }
185
-
186
- $this->_is_override_exact = $this->get_bool_option( $menu, 'override_exact' );
187
-
188
- if ( isset( $menu['parent'] ) ) {
189
- $this->_parent_slug = $this->get_option( $menu['parent'], 'slug' );
190
- // @deprecated
191
- $this->_parent_type = $this->get_option( $menu['parent'], 'type', 'page' );
192
-
193
- // If parent's slug is different, then it's NOT a top level menu item.
194
- $this->_is_top_level = ( $this->_parent_slug === $this->_menu_slug );
195
- } else {
196
- /**
197
- * If no parent then top level if:
198
- * - Has custom admin menu ('page')
199
- * - CPT menu type ('cpt')
200
- */
201
- // $this->_is_top_level = in_array( $this->_type, array(
202
- // 'cpt',
203
- // 'page'
204
- // ) );
205
- }
206
-
207
- $first_path = $this->get_option( $menu, 'first-path', false );
208
-
209
- if ( ! empty( $first_path ) && is_string( $first_path ) ) {
210
- $this->_first_time_path = $first_path;
211
- }
212
- }
213
- }
214
-
215
- /**
216
- * Check if top level menu.
217
- *
218
- * @author Vova Feldman (@svovaf)
219
- * @since 1.1.3
220
- *
221
- * @return bool False if submenu item.
222
- */
223
- function is_top_level() {
224
- return $this->_is_top_level;
225
- }
226
-
227
- /**
228
- * Check if the page should be override on exact URL match.
229
- *
230
- * @author Vova Feldman (@svovaf)
231
- * @since 1.1.3
232
- *
233
- * @return bool False if submenu item.
234
- */
235
- function is_override_exact() {
236
- return $this->_is_override_exact;
237
- }
238
-
239
-
240
- /**
241
- * Get the path of the page the user should be forwarded to after first activation.
242
- *
243
- * @author Vova Feldman (@svovaf)
244
- * @since 1.1.3
245
- *
246
- * @param bool $is_network Since 2.4.5
247
- *
248
- * @return string
249
- */
250
- function get_first_time_path( $is_network = false ) {
251
- if ( empty ( $this->_first_time_path ) ) {
252
- return $this->_first_time_path;
253
- }
254
-
255
- if ( $is_network ) {
256
- return network_admin_url( $this->_first_time_path );
257
- } else {
258
- return admin_url( $this->_first_time_path );
259
- }
260
- }
261
-
262
- /**
263
- * Check if plugin's menu item is part of a custom top level menu.
264
- *
265
- * @author Vova Feldman (@svovaf)
266
- * @since 1.1.3
267
- *
268
- * @return bool
269
- */
270
- function has_custom_parent() {
271
- return ! $this->_is_top_level && is_string( $this->_parent_slug );
272
- }
273
-
274
- /**
275
- * @author Leo Fajardo (@leorw)
276
- * @since 1.2.2
277
- *
278
- * @return bool
279
- */
280
- function has_menu() {
281
- return $this->_menu_exists;
282
- }
283
-
284
- /**
285
- * @author Vova Feldman (@svovaf)
286
- * @since 2.0.0
287
- *
288
- * @return bool
289
- */
290
- function has_network_menu() {
291
- return $this->_network_menu_exists;
292
- }
293
-
294
- /**
295
- * @author Leo Fajardo (@leorw)
296
- *
297
- * @param string $menu_slug
298
- *
299
- * @since 2.1.3
300
- */
301
- function set_slug_and_network_menu_exists_flag($menu_slug ) {
302
- $this->_menu_slug = $menu_slug;
303
- $this->_network_menu_exists = false;
304
- }
305
-
306
- /**
307
- * @author Vova Feldman (@svovaf)
308
- * @since 1.1.3
309
- *
310
- * @param string $id
311
- * @param bool $default
312
- * @param bool $ignore_menu_existence Since 1.2.2.7 If true, check if the submenu item visible even if there's no parent menu.
313
- *
314
- * @return bool
315
- */
316
- function is_submenu_item_visible( $id, $default = true, $ignore_menu_existence = false ) {
317
- if ( ! $ignore_menu_existence && ! $this->has_menu() ) {
318
- return false;
319
- }
320
-
321
- return fs_apply_filter(
322
- $this->_module_unique_affix,
323
- 'is_submenu_visible',
324
- $this->get_bool_option( $this->_default_submenu_items, $id, $default ),
325
- $id
326
- );
327
- }
328
-
329
- /**
330
- * Calculates admin settings menu slug.
331
- * If plugin's menu slug is a file (e.g. CPT), uses plugin's slug as the menu slug.
332
- *
333
- * @author Vova Feldman (@svovaf)
334
- * @since 1.1.3
335
- *
336
- * @param string $page
337
- *
338
- * @return string
339
- */
340
- function get_slug( $page = '' ) {
341
- return ( ( false === strpos( $this->_menu_slug, '.php?' ) ) ?
342
- $this->_menu_slug :
343
- $this->_module_unique_affix ) . ( empty( $page ) ? '' : ( '-' . $page ) );
344
- }
345
-
346
- /**
347
- * @author Vova Feldman (@svovaf)
348
- * @since 1.1.3
349
- *
350
- * @return string
351
- */
352
- function get_parent_slug() {
353
- return $this->_parent_slug;
354
- }
355
-
356
- /**
357
- * @author Vova Feldman (@svovaf)
358
- * @since 1.1.3
359
- *
360
- * @return string
361
- */
362
- function get_type() {
363
- return $this->_type;
364
- }
365
-
366
- /**
367
- * @author Vova Feldman (@svovaf)
368
- * @since 1.1.3
369
- *
370
- * @return bool
371
- */
372
- function is_cpt() {
373
- return ( 0 === strpos( $this->_menu_slug, 'edit.php?post_type=' ) ||
374
- // Back compatibility.
375
- 'cpt' === $this->_type
376
- );
377
- }
378
-
379
- /**
380
- * @author Vova Feldman (@svovaf)
381
- * @since 1.1.3
382
- *
383
- * @return string
384
- */
385
- function get_parent_type() {
386
- return $this->_parent_type;
387
- }
388
-
389
- /**
390
- * @author Vova Feldman (@svovaf)
391
- * @since 1.1.3
392
- *
393
- * @return string
394
- */
395
- function get_raw_slug() {
396
- return $this->_menu_slug;
397
- }
398
-
399
- /**
400
- * Get plugin's original menu slug.
401
- *
402
- * @author Vova Feldman (@svovaf)
403
- * @since 1.1.3
404
- *
405
- * @return string
406
- */
407
- function get_original_menu_slug() {
408
- if ( 'cpt' === $this->_type ) {
409
- return add_query_arg( array(
410
- 'post_type' => $this->_menu_slug
411
- ), 'edit.php' );
412
- }
413
-
414
- if ( false === strpos( $this->_menu_slug, '.php?' ) ) {
415
- return $this->_menu_slug;
416
- } else {
417
- return $this->_module_unique_affix;
418
- }
419
- }
420
-
421
- /**
422
- * @author Vova Feldman (@svovaf)
423
- * @since 1.1.3
424
- *
425
- * @return string
426
- */
427
- function get_top_level_menu_slug() {
428
- return $this->has_custom_parent() ?
429
- $this->get_parent_slug() :
430
- $this->get_raw_slug();
431
- }
432
-
433
- /**
434
- * Is user on plugin's admin activation page.
435
- *
436
- * @author Vova Feldman (@svovaf)
437
- * @since 1.0.8
438
- *
439
- * @param bool $show_opt_in_on_themes_page Since 2.3.1
440
- *
441
- * @return bool
442
- *
443
- * @deprecated Please use is_activation_page() instead.
444
- */
445
- function is_main_settings_page( $show_opt_in_on_themes_page = false ) {
446
- return $this->is_activation_page( $show_opt_in_on_themes_page );
447
- }
448
-
449
- /**
450
- * Is user on product's admin activation page.
451
- *
452
- * @author Vova Feldman (@svovaf)
453
- * @since 2.3.1
454
- *
455
- * @param bool $show_opt_in_on_themes_page Since 2.3.1
456
- *
457
- * @return bool
458
- */
459
- function is_activation_page( $show_opt_in_on_themes_page = false ) {
460
- if ( $show_opt_in_on_themes_page ) {
461
- /**
462
- * In activation only when show_optin query string param is given.
463
- *
464
- * @since 1.2.2
465
- */
466
- return (
467
- ( WP_FS__MODULE_TYPE_THEME === $this->_module_type ) &&
468
- Freemius::is_themes_page() &&
469
- fs_request_get_bool( $this->_module_unique_affix . '_show_optin' )
470
- );
471
- }
472
-
473
- if ( $this->_menu_exists &&
474
- ( fs_is_plugin_page( $this->_menu_slug ) || fs_is_plugin_page( $this->_module_unique_affix ) )
475
- ) {
476
- /**
477
- * Module has a settings menu and the context page is the main settings page, so assume it's in
478
- * activation (doesn't really check if already opted-in/skipped or not).
479
- *
480
- * @since 1.2.2
481
- */
482
- return true;
483
- }
484
-
485
- return false;
486
- }
487
-
488
- #region Submenu Override
489
-
490
- /**
491
- * Override submenu's action.
492
- *
493
- * @author Vova Feldman (@svovaf)
494
- * @since 1.1.0
495
- *
496
- * @param string $parent_slug
497
- * @param string $menu_slug
498
- * @param callable $function
499
- *
500
- * @return false|string If submenu exist, will return the hook name.
501
- */
502
- function override_submenu_action( $parent_slug, $menu_slug, $function ) {
503
- global $submenu;
504
-
505
- $menu_slug = plugin_basename( $menu_slug );
506
- $parent_slug = plugin_basename( $parent_slug );
507
-
508
- if ( ! isset( $submenu[ $parent_slug ] ) ) {
509
- // Parent menu not exist.
510
- return false;
511
- }
512
-
513
- $found_submenu_item = false;
514
- foreach ( $submenu[ $parent_slug ] as $submenu_item ) {
515
- if ( $menu_slug === $submenu_item[2] ) {
516
- $found_submenu_item = $submenu_item;
517
- break;
518
- }
519
- }
520
-
521
- if ( false === $found_submenu_item ) {
522
- // Submenu item not found.
523
- return false;
524
- }
525
-
526
- // Remove current function.
527
- $hookname = get_plugin_page_hookname( $menu_slug, $parent_slug );
528
- remove_all_actions( $hookname );
529
-
530
- // Attach new action.
531
- add_action( $hookname, $function );
532
-
533
- return $hookname;
534
- }
535
-
536
- #endregion Submenu Override
537
-
538
- #region Top level menu Override
539
-
540
- /**
541
- * Find plugin's admin dashboard main menu item.
542
- *
543
- * @author Vova Feldman (@svovaf)
544
- * @since 1.0.2
545
- *
546
- * @return string[]|false
547
- */
548
- private function find_top_level_menu() {
549
- global $menu;
550
-
551
- $position = - 1;
552
- $found_menu = false;
553
-
554
- $menu_slug = $this->get_raw_slug();
555
-
556
- $hook_name = get_plugin_page_hookname( $menu_slug, '' );
557
- foreach ( $menu as $pos => $m ) {
558
- if ( $menu_slug === $m[2] ) {
559
- $position = $pos;
560
- $found_menu = $m;
561
- break;
562
- }
563
- }
564
-
565
- if ( false === $found_menu ) {
566
- return false;
567
- }
568
-
569
- return array(
570
- 'menu' => $found_menu,
571
- 'position' => $position,
572
- 'hook_name' => $hook_name
573
- );
574
- }
575
-
576
- /**
577
- * Find plugin's admin dashboard main submenu item.
578
- *
579
- * @author Vova Feldman (@svovaf)
580
- * @since 1.2.1.6
581
- *
582
- * @return array|false
583
- */
584
- private function find_main_submenu() {
585
- global $submenu;
586
-
587
- $top_level_menu_slug = $this->get_top_level_menu_slug();
588
-
589
- if ( ! isset( $submenu[ $top_level_menu_slug ] ) ) {
590
- return false;
591
- }
592
-
593
- $submenu_slug = $this->get_raw_slug();
594
-
595
- $position = - 1;
596
- $found_submenu = false;
597
-
598
- $hook_name = get_plugin_page_hookname( $submenu_slug, '' );
599
-
600
- foreach ( $submenu[ $top_level_menu_slug ] as $pos => $sub ) {
601
- if ( $submenu_slug === $sub[2] ) {
602
- $position = $pos;
603
- $found_submenu = $sub;
604
- }
605
- }
606
-
607
- if ( false === $found_submenu ) {
608
- return false;
609
- }
610
-
611
- return array(
612
- 'menu' => $found_submenu,
613
- 'parent_slug' => $top_level_menu_slug,
614
- 'position' => $position,
615
- 'hook_name' => $hook_name
616
- );
617
- }
618
-
619
- /**
620
- * Remove all sub-menu items.
621
- *
622
- * @author Vova Feldman (@svovaf)
623
- * @since 1.0.7
624
- *
625
- * @return bool If submenu with plugin's menu slug was found.
626
- */
627
- private function remove_all_submenu_items() {
628
- global $submenu;
629
-
630
- $menu_slug = $this->get_raw_slug();
631
-
632
- if ( ! isset( $submenu[ $menu_slug ] ) ) {
633
- return false;
634
- }
635
-
636
- /**
637
- * This method is NOT executed for WordPress.org themes.
638
- * Since we maintain only one version of the SDK we added this small
639
- * hack to avoid the error from Theme Check since it's a false-positive.
640
- *
641
- * @author Vova Feldman (@svovaf)
642
- * @since 1.2.2.7
643
- */
644
- $submenu_ref = &$submenu;
645
- $submenu_ref[ $menu_slug ] = array();
646
-
647
- return true;
648
- }
649
-
650
- /**
651
- *
652
- * @author Vova Feldman (@svovaf)
653
- * @since 1.0.9
654
- *
655
- * @param bool $remove_top_level_menu
656
- *
657
- * @return false|array[string]mixed
658
- */
659
- function remove_menu_item( $remove_top_level_menu = false ) {
660
- $this->_logger->entrance();
661
-
662
- // Find main menu item.
663
- $top_level_menu = $this->find_top_level_menu();
664
-
665
- if ( false === $top_level_menu ) {
666
- return false;
667
- }
668
-
669
- // Remove it with its actions.
670
- remove_all_actions( $top_level_menu['hook_name'] );
671
-
672
- // Remove all submenu items.
673
- $this->remove_all_submenu_items();
674
-
675
- if ( $remove_top_level_menu ) {
676
- global $menu;
677
- unset( $menu[ $top_level_menu['position'] ] );
678
- }
679
-
680
- return $top_level_menu;
681
- }
682
-
683
- /**
684
- * Get module's main admin setting page URL.
685
- *
686
- * @todo This method was only tested for wp.org compliant themes with a submenu item. Need to test for plugins with top level, submenu, and CPT top level, menu items.
687
- *
688
- * @author Vova Feldman (@svovaf)
689
- * @since 1.2.2.7
690
- *
691
- * @return string
692
- */
693
- function main_menu_url() {
694
- $this->_logger->entrance();
695
-
696
- if ( $this->_is_top_level ) {
697
- $menu = $this->find_top_level_menu();
698
- } else {
699
- $menu = $this->find_main_submenu();
700
- }
701
-
702
- $parent_slug = isset( $menu['parent_slug'] ) ?
703
- $menu['parent_slug'] :
704
- 'admin.php';
705
-
706
- return admin_url(
707
- $parent_slug .
708
- ( false === strpos( $parent_slug, '?' ) ? '?' : '&' ) .
709
- 'page=' .
710
- $menu['menu'][2]
711
- );
712
- }
713
-
714
- /**
715
- * @author Vova Feldman (@svovaf)
716
- * @since 1.1.4
717
- *
718
- * @param callable $function
719
- *
720
- * @return false|array[string]mixed
721
- */
722
- function override_menu_item( $function ) {
723
- $found_menu = $this->remove_menu_item();
724
-
725
- if ( false === $found_menu ) {
726
- return false;
727
- }
728
-
729
- if ( ! $this->is_top_level() || ! $this->is_cpt() ) {
730
- $menu_slug = plugin_basename( $this->get_slug() );
731
-
732
- $hookname = get_plugin_page_hookname( $menu_slug, '' );
733
-
734
- // Override menu action.
735
- add_action( $hookname, $function );
736
- } else {
737
- global $menu;
738
-
739
- // Remove original CPT menu.
740
- unset( $menu[ $found_menu['position'] ] );
741
-
742
- // Create new top-level menu action.
743
- $hookname = self::add_page(
744
- $found_menu['menu'][3],
745
- $found_menu['menu'][0],
746
- 'manage_options',
747
- $this->get_slug(),
748
- $function,
749
- $found_menu['menu'][6],
750
- $found_menu['position']
751
- );
752
- }
753
-
754
- return $hookname;
755
- }
756
-
757
- /**
758
- * Adds a counter to the module's top level menu item.
759
- *
760
- * @author Vova Feldman (@svovaf)
761
- * @since 1.2.1.5
762
- *
763
- * @param int $counter
764
- * @param string $class
765
- */
766
- function add_counter_to_menu_item( $counter = 1, $class = '' ) {
767
- global $menu, $submenu;
768
-
769
- $mask = '%s <span class="update-plugins %s count-%3$s" aria-hidden="true"><span>%3$s<span class="screen-reader-text">%3$s notifications</span></span></span>';
770
-
771
- /**
772
- * This method is NOT executed for WordPress.org themes.
773
- * Since we maintain only one version of the SDK we added this small
774
- * hack to avoid the error from Theme Check since it's a false-positive.
775
- *
776
- * @author Vova Feldman (@svovaf)
777
- * @since 1.2.2.7
778
- */
779
- $menu_ref = &$menu;
780
- $submenu_ref = &$submenu;
781
-
782
- if ( $this->_is_top_level ) {
783
- // Find main menu item.
784
- $found_menu = $this->find_top_level_menu();
785
-
786
- if ( false !== $found_menu ) {
787
- // Override menu label.
788
- $menu_ref[ $found_menu['position'] ][0] = sprintf(
789
- $mask,
790
- $found_menu['menu'][0],
791
- $class,
792
- $counter
793
- );
794
- }
795
- } else {
796
- $found_submenu = $this->find_main_submenu();
797
-
798
- if ( false !== $found_submenu ) {
799
- // Override menu label.
800
- $submenu_ref[ $found_submenu['parent_slug'] ][ $found_submenu['position'] ][0] = sprintf(
801
- $mask,
802
- $found_submenu['menu'][0],
803
- $class,
804
- $counter
805
- );
806
- }
807
- }
808
- }
809
-
810
- #endregion Top level menu Override
811
-
812
- /**
813
- * Add a top-level menu page.
814
- *
815
- * Note for WordPress.org Theme/Plugin reviewer:
816
- *
817
- * This is a replication of `add_menu_page()` to avoid Theme Check warning.
818
- *
819
- * Why?
820
- * ====
821
- * Freemius is an SDK for plugin and theme developers. Since the core
822
- * of the SDK is relevant both for plugins and themes, for obvious reasons,
823
- * we only develop and maintain one code base.
824
- *
825
- * This method will not run for wp.org themes (only plugins) since theme
826
- * admin settings/options are now only allowed in the customizer.
827
- *
828
- * If you have any questions or need clarifications, please don't hesitate
829
- * pinging me on slack, my username is @svovaf.
830
- *
831
- * @author Vova Feldman (@svovaf)
832
- * @since 1.2.2
833
- *
834
- * @param string $page_title The text to be displayed in the title tags of the page when the menu is
835
- * selected.
836
- * @param string $menu_title The text to be used for the menu.
837
- * @param string $capability The capability required for this menu to be displayed to the user.
838
- * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
839
- * @param callable|string $function The function to be called to output the content for this page.
840
- * @param string $icon_url The URL to the icon to be used for this menu.
841
- * * Pass a base64-encoded SVG using a data URI, which will be colored to
842
- * match the color scheme. This should begin with
843
- * 'data:image/svg+xml;base64,'.
844
- * * Pass the name of a Dashicons helper class to use a font icon,
845
- * e.g. 'dashicons-chart-pie'.
846
- * * Pass 'none' to leave div.wp-menu-image empty so an icon can be added
847
- * via CSS.
848
- * @param int $position The position in the menu order this one should appear.
849
- *
850
- * @return string The resulting page's hook_suffix.
851
- */
852
- static function add_page(
853
- $page_title,
854
- $menu_title,
855
- $capability,
856
- $menu_slug,
857
- $function = '',
858
- $icon_url = '',
859
- $position = null
860
- ) {
861
- $fn = 'add_menu' . '_page';
862
-
863
- return $fn(
864
- $page_title,
865
- $menu_title,
866
- $capability,
867
- $menu_slug,
868
- $function,
869
- $icon_url,
870
- $position
871
- );
872
- }
873
-
874
- /**
875
- * Add page and update menu instance settings.
876
- *
877
- * @author Vova Feldman (@svovaf)
878
- * @since 2.0.0
879
- *
880
- * @param string $page_title
881
- * @param string $menu_title
882
- * @param string $capability
883
- * @param string $menu_slug
884
- * @param callable|string $function
885
- * @param string $icon_url
886
- * @param int|null $position
887
- *
888
- * @return string
889
- */
890
- function add_page_and_update(
891
- $page_title,
892
- $menu_title,
893
- $capability,
894
- $menu_slug,
895
- $function = '',
896
- $icon_url = '',
897
- $position = null
898
- ) {
899
- $this->_menu_slug = $menu_slug;
900
- $this->_is_top_level = true;
901
- $this->_menu_exists = true;
902
- $this->_network_menu_exists = true;
903
-
904
- return self::add_page(
905
- $page_title,
906
- $menu_title,
907
- $capability,
908
- $menu_slug,
909
- $function,
910
- $icon_url,
911
- $position
912
- );
913
- }
914
-
915
- /**
916
- * Add a submenu page.
917
- *
918
- * Note for WordPress.org Theme/Plugin reviewer:
919
- *
920
- * This is a replication of `add_submenu_page()` to avoid Theme Check warning.
921
- *
922
- * Why?
923
- * ====
924
- * Freemius is an SDK for plugin and theme developers. Since the core
925
- * of the SDK is relevant both for plugins and themes, for obvious reasons,
926
- * we only develop and maintain one code base.
927
- *
928
- * This method will not run for wp.org themes (only plugins) since theme
929
- * admin settings/options are now only allowed in the customizer.
930
- *
931
- * If you have any questions or need clarifications, please don't hesitate
932
- * pinging me on slack, my username is @svovaf.
933
- *
934
- * @author Vova Feldman (@svovaf)
935
- * @since 1.2.2
936
- *
937
- * @param string $parent_slug The slug name for the parent menu (or the file name of a standard
938
- * WordPress admin page).
939
- * @param string $page_title The text to be displayed in the title tags of the page when the menu is
940
- * selected.
941
- * @param string $menu_title The text to be used for the menu.
942
- * @param string $capability The capability required for this menu to be displayed to the user.
943
- * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
944
- * @param callable|string $function The function to be called to output the content for this page.
945
- *
946
- * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability
947
- * required.
948
- */
949
- static function add_subpage(
950
- $parent_slug,
951
- $page_title,
952
- $menu_title,
953
- $capability,
954
- $menu_slug,
955
- $function = ''
956
- ) {
957
- $fn = 'add_submenu' . '_page';
958
-
959
- return $fn( $parent_slug,
960
- $page_title,
961
- $menu_title,
962
- $capability,
963
- $menu_slug,
964
- $function
965
- );
966
- }
967
-
968
- /**
969
- * Add sub page and update menu instance settings.
970
- *
971
- * @author Vova Feldman (@svovaf)
972
- * @since 2.0.0
973
- *
974
- * @param string $parent_slug
975
- * @param string $page_title
976
- * @param string $menu_title
977
- * @param string $capability
978
- * @param string $menu_slug
979
- * @param callable|string $function
980
- *
981
- * @return string
982
- */
983
- function add_subpage_and_update(
984
- $parent_slug,
985
- $page_title,
986
- $menu_title,
987
- $capability,
988
- $menu_slug,
989
- $function = ''
990
- ) {
991
- $this->_menu_slug = $menu_slug;
992
- $this->_parent_slug = $parent_slug;
993
- $this->_is_top_level = false;
994
- $this->_menu_exists = true;
995
- $this->_network_menu_exists = true;
996
-
997
- return self::add_subpage(
998
- $parent_slug,
999
- $page_title,
1000
- $menu_title,
1001
- $capability,
1002
- $menu_slug,
1003
- $function
1004
- );
1005
- }
1006
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.1.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Admin_Menu_Manager {
14
+
15
+ #region Properties
16
+
17
+ /**
18
+ * @since 1.2.2
19
+ *
20
+ * @var string
21
+ */
22
+ protected $_module_unique_affix;
23
+
24
+ /**
25
+ * @since 1.2.2
26
+ *
27
+ * @var number
28
+ */
29
+ protected $_module_id;
30
+
31
+ /**
32
+ * @since 1.2.2
33
+ *
34
+ * @var string
35
+ */
36
+ protected $_module_type;
37
+
38
+ /**
39
+ * @since 1.0.6
40
+ *
41
+ * @var string
42
+ */
43
+ private $_menu_slug;
44
+ /**
45
+ * @since 1.1.3
46
+ *
47
+ * @var string
48
+ */
49
+ private $_parent_slug;
50
+ /**
51
+ * @since 1.1.3
52
+ *
53
+ * @var string
54
+ */
55
+ private $_parent_type;
56
+ /**
57
+ * @since 1.1.3
58
+ *
59
+ * @var string
60
+ */
61
+ private $_type;
62
+ /**
63
+ * @since 1.1.3
64
+ *
65
+ * @var bool
66
+ */
67
+ private $_is_top_level;
68
+ /**
69
+ * @since 1.1.3
70
+ *
71
+ * @var bool
72
+ */
73
+ private $_is_override_exact;
74
+ /**
75
+ * @since 1.1.3
76
+ *
77
+ * @var array<string,bool>
78
+ */
79
+ private $_default_submenu_items;
80
+ /**
81
+ * @since 1.1.3
82
+ *
83
+ * @var string
84
+ */
85
+ private $_first_time_path;
86
+ /**
87
+ * @since 1.2.2
88
+ *
89
+ * @var bool
90
+ */
91
+ private $_menu_exists;
92
+ /**
93
+ * @since 2.0.0
94
+ *
95
+ * @var bool
96
+ */
97
+ private $_network_menu_exists;
98
+
99
+ #endregion Properties
100
+
101
+ /**
102
+ * @var FS_Logger
103
+ */
104
+ protected $_logger;
105
+
106
+ #region Singleton
107
+
108
+ /**
109
+ * @var FS_Admin_Menu_Manager[]
110
+ */
111
+ private static $_instances = array();
112
+
113
+ /**
114
+ * @param number $module_id
115
+ * @param string $module_type
116
+ * @param string $module_unique_affix
117
+ *
118
+ * @return FS_Admin_Menu_Manager
119
+ */
120
+ static function instance( $module_id, $module_type, $module_unique_affix ) {
121
+ $key = 'm_' . $module_id;
122
+
123
+ if ( ! isset( self::$_instances[ $key ] ) ) {
124
+ self::$_instances[ $key ] = new FS_Admin_Menu_Manager( $module_id, $module_type, $module_unique_affix );
125
+ }
126
+
127
+ return self::$_instances[ $key ];
128
+ }
129
+
130
+ protected function __construct( $module_id, $module_type, $module_unique_affix ) {
131
+ $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $module_id . '_admin_menu', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
132
+
133
+ $this->_module_id = $module_id;
134
+ $this->_module_type = $module_type;
135
+ $this->_module_unique_affix = $module_unique_affix;
136
+ }
137
+
138
+ #endregion Singleton
139
+
140
+ #region Helpers
141
+
142
+ private function get_option( &$options, $key, $default = false ) {
143
+ return ! empty( $options[ $key ] ) ? $options[ $key ] : $default;
144
+ }
145
+
146
+ private function get_bool_option( &$options, $key, $default = false ) {
147
+ return isset( $options[ $key ] ) && is_bool( $options[ $key ] ) ? $options[ $key ] : $default;
148
+ }
149
+
150
+ #endregion Helpers
151
+
152
+ /**
153
+ * @param array $menu
154
+ * @param bool $is_addon
155
+ */
156
+ function init( $menu, $is_addon = false ) {
157
+ $this->_menu_exists = ( isset( $menu['slug'] ) && ! empty( $menu['slug'] ) );
158
+ $this->_network_menu_exists = ( ! empty( $menu['network'] ) && true === $menu['network'] );
159
+
160
+ $this->_menu_slug = ( $this->_menu_exists ? $menu['slug'] : $this->_module_unique_affix );
161
+
162
+ $this->_default_submenu_items = array();
163
+ // @deprecated
164
+ $this->_type = 'page';
165
+ $this->_is_top_level = true;
166
+ $this->_is_override_exact = false;
167
+ $this->_parent_slug = false;
168
+ // @deprecated
169
+ $this->_parent_type = 'page';
170
+
171
+ if ( isset( $menu ) ) {
172
+ if ( ! $is_addon ) {
173
+ $this->_default_submenu_items = array(
174
+ 'contact' => $this->get_bool_option( $menu, 'contact', true ),
175
+ 'support' => $this->get_bool_option( $menu, 'support', true ),
176
+ 'affiliation' => $this->get_bool_option( $menu, 'affiliation', true ),
177
+ 'account' => $this->get_bool_option( $menu, 'account', true ),
178
+ 'pricing' => $this->get_bool_option( $menu, 'pricing', true ),
179
+ 'addons' => $this->get_bool_option( $menu, 'addons', true ),
180
+ );
181
+
182
+ // @deprecated
183
+ $this->_type = $this->get_option( $menu, 'type', 'page' );
184
+ }
185
+
186
+ $this->_is_override_exact = $this->get_bool_option( $menu, 'override_exact' );
187
+
188
+ if ( isset( $menu['parent'] ) ) {
189
+ $this->_parent_slug = $this->get_option( $menu['parent'], 'slug' );
190
+ // @deprecated
191
+ $this->_parent_type = $this->get_option( $menu['parent'], 'type', 'page' );
192
+
193
+ // If parent's slug is different, then it's NOT a top level menu item.
194
+ $this->_is_top_level = ( $this->_parent_slug === $this->_menu_slug );
195
+ } else {
196
+ /**
197
+ * If no parent then top level if:
198
+ * - Has custom admin menu ('page')
199
+ * - CPT menu type ('cpt')
200
+ */
201
+ // $this->_is_top_level = in_array( $this->_type, array(
202
+ // 'cpt',
203
+ // 'page'
204
+ // ) );
205
+ }
206
+
207
+ $first_path = $this->get_option( $menu, 'first-path', false );
208
+
209
+ if ( ! empty( $first_path ) && is_string( $first_path ) ) {
210
+ $this->_first_time_path = $first_path;
211
+ }
212
+ }
213
+ }
214
+
215
+ /**
216
+ * Check if top level menu.
217
+ *
218
+ * @author Vova Feldman (@svovaf)
219
+ * @since 1.1.3
220
+ *
221
+ * @return bool False if submenu item.
222
+ */
223
+ function is_top_level() {
224
+ return $this->_is_top_level;
225
+ }
226
+
227
+ /**
228
+ * Check if the page should be override on exact URL match.
229
+ *
230
+ * @author Vova Feldman (@svovaf)
231
+ * @since 1.1.3
232
+ *
233
+ * @return bool False if submenu item.
234
+ */
235
+ function is_override_exact() {
236
+ return $this->_is_override_exact;
237
+ }
238
+
239
+
240
+ /**
241
+ * Get the path of the page the user should be forwarded to after first activation.
242
+ *
243
+ * @author Vova Feldman (@svovaf)
244
+ * @since 1.1.3
245
+ *
246
+ * @param bool $is_network Since 2.4.5
247
+ *
248
+ * @return string
249
+ */
250
+ function get_first_time_path( $is_network = false ) {
251
+ if ( empty ( $this->_first_time_path ) ) {
252
+ return $this->_first_time_path;
253
+ }
254
+
255
+ if ( $is_network ) {
256
+ return network_admin_url( $this->_first_time_path );
257
+ } else {
258
+ return admin_url( $this->_first_time_path );
259
+ }
260
+ }
261
+
262
+ /**
263
+ * Check if plugin's menu item is part of a custom top level menu.
264
+ *
265
+ * @author Vova Feldman (@svovaf)
266
+ * @since 1.1.3
267
+ *
268
+ * @return bool
269
+ */
270
+ function has_custom_parent() {
271
+ return ! $this->_is_top_level && is_string( $this->_parent_slug );
272
+ }
273
+
274
+ /**
275
+ * @author Leo Fajardo (@leorw)
276
+ * @since 1.2.2
277
+ *
278
+ * @return bool
279
+ */
280
+ function has_menu() {
281
+ return $this->_menu_exists;
282
+ }
283
+
284
+ /**
285
+ * @author Vova Feldman (@svovaf)
286
+ * @since 2.0.0
287
+ *
288
+ * @return bool
289
+ */
290
+ function has_network_menu() {
291
+ return $this->_network_menu_exists;
292
+ }
293
+
294
+ /**
295
+ * @author Leo Fajardo (@leorw)
296
+ *
297
+ * @param string $menu_slug
298
+ *
299
+ * @since 2.1.3
300
+ */
301
+ function set_slug_and_network_menu_exists_flag($menu_slug ) {
302
+ $this->_menu_slug = $menu_slug;
303
+ $this->_network_menu_exists = false;
304
+ }
305
+
306
+ /**
307
+ * @author Vova Feldman (@svovaf)
308
+ * @since 1.1.3
309
+ *
310
+ * @param string $id
311
+ * @param bool $default
312
+ * @param bool $ignore_menu_existence Since 1.2.2.7 If true, check if the submenu item visible even if there's no parent menu.
313
+ *
314
+ * @return bool
315
+ */
316
+ function is_submenu_item_visible( $id, $default = true, $ignore_menu_existence = false ) {
317
+ if ( ! $ignore_menu_existence && ! $this->has_menu() ) {
318
+ return false;
319
+ }
320
+
321
+ return fs_apply_filter(
322
+ $this->_module_unique_affix,
323
+ 'is_submenu_visible',
324
+ $this->get_bool_option( $this->_default_submenu_items, $id, $default ),
325
+ $id
326
+ );
327
+ }
328
+
329
+ /**
330
+ * Calculates admin settings menu slug.
331
+ * If plugin's menu slug is a file (e.g. CPT), uses plugin's slug as the menu slug.
332
+ *
333
+ * @author Vova Feldman (@svovaf)
334
+ * @since 1.1.3
335
+ *
336
+ * @param string $page
337
+ *
338
+ * @return string
339
+ */
340
+ function get_slug( $page = '' ) {
341
+ return ( ( false === strpos( $this->_menu_slug, '.php?' ) ) ?
342
+ $this->_menu_slug :
343
+ $this->_module_unique_affix ) . ( empty( $page ) ? '' : ( '-' . $page ) );
344
+ }
345
+
346
+ /**
347
+ * @author Vova Feldman (@svovaf)
348
+ * @since 1.1.3
349
+ *
350
+ * @return string
351
+ */
352
+ function get_parent_slug() {
353
+ return $this->_parent_slug;
354
+ }
355
+
356
+ /**
357
+ * @author Vova Feldman (@svovaf)
358
+ * @since 1.1.3
359
+ *
360
+ * @return string
361
+ */
362
+ function get_type() {
363
+ return $this->_type;
364
+ }
365
+
366
+ /**
367
+ * @author Vova Feldman (@svovaf)
368
+ * @since 1.1.3
369
+ *
370
+ * @return bool
371
+ */
372
+ function is_cpt() {
373
+ return ( 0 === strpos( $this->_menu_slug, 'edit.php?post_type=' ) ||
374
+ // Back compatibility.
375
+ 'cpt' === $this->_type
376
+ );
377
+ }
378
+
379
+ /**
380
+ * @author Vova Feldman (@svovaf)
381
+ * @since 1.1.3
382
+ *
383
+ * @return string
384
+ */
385
+ function get_parent_type() {
386
+ return $this->_parent_type;
387
+ }
388
+
389
+ /**
390
+ * @author Vova Feldman (@svovaf)
391
+ * @since 1.1.3
392
+ *
393
+ * @return string
394
+ */
395
+ function get_raw_slug() {
396
+ return $this->_menu_slug;
397
+ }
398
+
399
+ /**
400
+ * Get plugin's original menu slug.
401
+ *
402
+ * @author Vova Feldman (@svovaf)
403
+ * @since 1.1.3
404
+ *
405
+ * @return string
406
+ */
407
+ function get_original_menu_slug() {
408
+ if ( 'cpt' === $this->_type ) {
409
+ return add_query_arg( array(
410
+ 'post_type' => $this->_menu_slug
411
+ ), 'edit.php' );
412
+ }
413
+
414
+ if ( false === strpos( $this->_menu_slug, '.php?' ) ) {
415
+ return $this->_menu_slug;
416
+ } else {
417
+ return $this->_module_unique_affix;
418
+ }
419
+ }
420
+
421
+ /**
422
+ * @author Vova Feldman (@svovaf)
423
+ * @since 1.1.3
424
+ *
425
+ * @return string
426
+ */
427
+ function get_top_level_menu_slug() {
428
+ return $this->has_custom_parent() ?
429
+ $this->get_parent_slug() :
430
+ $this->get_raw_slug();
431
+ }
432
+
433
+ /**
434
+ * Is user on plugin's admin activation page.
435
+ *
436
+ * @author Vova Feldman (@svovaf)
437
+ * @since 1.0.8
438
+ *
439
+ * @param bool $show_opt_in_on_themes_page Since 2.3.1
440
+ *
441
+ * @return bool
442
+ *
443
+ * @deprecated Please use is_activation_page() instead.
444
+ */
445
+ function is_main_settings_page( $show_opt_in_on_themes_page = false ) {
446
+ return $this->is_activation_page( $show_opt_in_on_themes_page );
447
+ }
448
+
449
+ /**
450
+ * Is user on product's admin activation page.
451
+ *
452
+ * @author Vova Feldman (@svovaf)
453
+ * @since 2.3.1
454
+ *
455
+ * @param bool $show_opt_in_on_themes_page Since 2.3.1
456
+ *
457
+ * @return bool
458
+ */
459
+ function is_activation_page( $show_opt_in_on_themes_page = false ) {
460
+ if ( $show_opt_in_on_themes_page ) {
461
+ /**
462
+ * In activation only when show_optin query string param is given.
463
+ *
464
+ * @since 1.2.2
465
+ */
466
+ return (
467
+ ( WP_FS__MODULE_TYPE_THEME === $this->_module_type ) &&
468
+ Freemius::is_themes_page() &&
469
+ fs_request_get_bool( $this->_module_unique_affix . '_show_optin' )
470
+ );
471
+ }
472
+
473
+ if ( $this->_menu_exists &&
474
+ ( fs_is_plugin_page( $this->_menu_slug ) || fs_is_plugin_page( $this->_module_unique_affix ) )
475
+ ) {
476
+ /**
477
+ * Module has a settings menu and the context page is the main settings page, so assume it's in
478
+ * activation (doesn't really check if already opted-in/skipped or not).
479
+ *
480
+ * @since 1.2.2
481
+ */
482
+ return true;
483
+ }
484
+
485
+ return false;
486
+ }
487
+
488
+ #region Submenu Override
489
+
490
+ /**
491
+ * Override submenu's action.
492
+ *
493
+ * @author Vova Feldman (@svovaf)
494
+ * @since 1.1.0
495
+ *
496
+ * @param string $parent_slug
497
+ * @param string $menu_slug
498
+ * @param callable $function
499
+ *
500
+ * @return false|string If submenu exist, will return the hook name.
501
+ */
502
+ function override_submenu_action( $parent_slug, $menu_slug, $function ) {
503
+ global $submenu;
504
+
505
+ $menu_slug = plugin_basename( $menu_slug );
506
+ $parent_slug = plugin_basename( $parent_slug );
507
+
508
+ if ( ! isset( $submenu[ $parent_slug ] ) ) {
509
+ // Parent menu not exist.
510
+ return false;
511
+ }
512
+
513
+ $found_submenu_item = false;
514
+ foreach ( $submenu[ $parent_slug ] as $submenu_item ) {
515
+ if ( $menu_slug === $submenu_item[2] ) {
516
+ $found_submenu_item = $submenu_item;
517
+ break;
518
+ }
519
+ }
520
+
521
+ if ( false === $found_submenu_item ) {
522
+ // Submenu item not found.
523
+ return false;
524
+ }
525
+
526
+ // Remove current function.
527
+ $hookname = get_plugin_page_hookname( $menu_slug, $parent_slug );
528
+ remove_all_actions( $hookname );
529
+
530
+ // Attach new action.
531
+ add_action( $hookname, $function );
532
+
533
+ return $hookname;
534
+ }
535
+
536
+ #endregion Submenu Override
537
+
538
+ #region Top level menu Override
539
+
540
+ /**
541
+ * Find plugin's admin dashboard main menu item.
542
+ *
543
+ * @author Vova Feldman (@svovaf)
544
+ * @since 1.0.2
545
+ *
546
+ * @return string[]|false
547
+ */
548
+ private function find_top_level_menu() {
549
+ global $menu;
550
+
551
+ $position = - 1;
552
+ $found_menu = false;
553
+
554
+ $menu_slug = $this->get_raw_slug();
555
+
556
+ $hook_name = get_plugin_page_hookname( $menu_slug, '' );
557
+ foreach ( $menu as $pos => $m ) {
558
+ if ( $menu_slug === $m[2] ) {
559
+ $position = $pos;
560
+ $found_menu = $m;
561
+ break;
562
+ }
563
+ }
564
+
565
+ if ( false === $found_menu ) {
566
+ return false;
567
+ }
568
+
569
+ return array(
570
+ 'menu' => $found_menu,
571
+ 'position' => $position,
572
+ 'hook_name' => $hook_name
573
+ );
574
+ }
575
+
576
+ /**
577
+ * Find plugin's admin dashboard main submenu item.
578
+ *
579
+ * @author Vova Feldman (@svovaf)
580
+ * @since 1.2.1.6
581
+ *
582
+ * @return array|false
583
+ */
584
+ private function find_main_submenu() {
585
+ global $submenu;
586
+
587
+ $top_level_menu_slug = $this->get_top_level_menu_slug();
588
+
589
+ if ( ! isset( $submenu[ $top_level_menu_slug ] ) ) {
590
+ return false;
591
+ }
592
+
593
+ $submenu_slug = $this->get_raw_slug();
594
+
595
+ $position = - 1;
596
+ $found_submenu = false;
597
+
598
+ $hook_name = get_plugin_page_hookname( $submenu_slug, '' );
599
+
600
+ foreach ( $submenu[ $top_level_menu_slug ] as $pos => $sub ) {
601
+ if ( $submenu_slug === $sub[2] ) {
602
+ $position = $pos;
603
+ $found_submenu = $sub;
604
+ }
605
+ }
606
+
607
+ if ( false === $found_submenu ) {
608
+ return false;
609
+ }
610
+
611
+ return array(
612
+ 'menu' => $found_submenu,
613
+ 'parent_slug' => $top_level_menu_slug,
614
+ 'position' => $position,
615
+ 'hook_name' => $hook_name
616
+ );
617
+ }
618
+
619
+ /**
620
+ * Remove all sub-menu items.
621
+ *
622
+ * @author Vova Feldman (@svovaf)
623
+ * @since 1.0.7
624
+ *
625
+ * @return bool If submenu with plugin's menu slug was found.
626
+ */
627
+ private function remove_all_submenu_items() {
628
+ global $submenu;
629
+
630
+ $menu_slug = $this->get_raw_slug();
631
+
632
+ if ( ! isset( $submenu[ $menu_slug ] ) ) {
633
+ return false;
634
+ }
635
+
636
+ /**
637
+ * This method is NOT executed for WordPress.org themes.
638
+ * Since we maintain only one version of the SDK we added this small
639
+ * hack to avoid the error from Theme Check since it's a false-positive.
640
+ *
641
+ * @author Vova Feldman (@svovaf)
642
+ * @since 1.2.2.7
643
+ */
644
+ $submenu_ref = &$submenu;
645
+ $submenu_ref[ $menu_slug ] = array();
646
+
647
+ return true;
648
+ }
649
+
650
+ /**
651
+ *
652
+ * @author Vova Feldman (@svovaf)
653
+ * @since 1.0.9
654
+ *
655
+ * @param bool $remove_top_level_menu
656
+ *
657
+ * @return false|array[string]mixed
658
+ */
659
+ function remove_menu_item( $remove_top_level_menu = false ) {
660
+ $this->_logger->entrance();
661
+
662
+ // Find main menu item.
663
+ $top_level_menu = $this->find_top_level_menu();
664
+
665
+ if ( false === $top_level_menu ) {
666
+ return false;
667
+ }
668
+
669
+ // Remove it with its actions.
670
+ remove_all_actions( $top_level_menu['hook_name'] );
671
+
672
+ // Remove all submenu items.
673
+ $this->remove_all_submenu_items();
674
+
675
+ if ( $remove_top_level_menu ) {
676
+ global $menu;
677
+ unset( $menu[ $top_level_menu['position'] ] );
678
+ }
679
+
680
+ return $top_level_menu;
681
+ }
682
+
683
+ /**
684
+ * Get module's main admin setting page URL.
685
+ *
686
+ * @todo This method was only tested for wp.org compliant themes with a submenu item. Need to test for plugins with top level, submenu, and CPT top level, menu items.
687
+ *
688
+ * @author Vova Feldman (@svovaf)
689
+ * @since 1.2.2.7
690
+ *
691
+ * @return string
692
+ */
693
+ function main_menu_url() {
694
+ $this->_logger->entrance();
695
+
696
+ if ( $this->_is_top_level ) {
697
+ $menu = $this->find_top_level_menu();
698
+ } else {
699
+ $menu = $this->find_main_submenu();
700
+ }
701
+
702
+ $parent_slug = isset( $menu['parent_slug'] ) ?
703
+ $menu['parent_slug'] :
704
+ 'admin.php';
705
+
706
+ return admin_url(
707
+ $parent_slug .
708
+ ( false === strpos( $parent_slug, '?' ) ? '?' : '&' ) .
709
+ 'page=' .
710
+ $menu['menu'][2]
711
+ );
712
+ }
713
+
714
+ /**
715
+ * @author Vova Feldman (@svovaf)
716
+ * @since 1.1.4
717
+ *
718
+ * @param callable $function
719
+ *
720
+ * @return false|array[string]mixed
721
+ */
722
+ function override_menu_item( $function ) {
723
+ $found_menu = $this->remove_menu_item();
724
+
725
+ if ( false === $found_menu ) {
726
+ return false;
727
+ }
728
+
729
+ if ( ! $this->is_top_level() || ! $this->is_cpt() ) {
730
+ $menu_slug = plugin_basename( $this->get_slug() );
731
+
732
+ $hookname = get_plugin_page_hookname( $menu_slug, '' );
733
+
734
+ // Override menu action.
735
+ add_action( $hookname, $function );
736
+ } else {
737
+ global $menu;
738
+
739
+ // Remove original CPT menu.
740
+ unset( $menu[ $found_menu['position'] ] );
741
+
742
+ // Create new top-level menu action.
743
+ $hookname = self::add_page(
744
+ $found_menu['menu'][3],
745
+ $found_menu['menu'][0],
746
+ 'manage_options',
747
+ $this->get_slug(),
748
+ $function,
749
+ $found_menu['menu'][6],
750
+ $found_menu['position']
751
+ );
752
+ }
753
+
754
+ return $hookname;
755
+ }
756
+
757
+ /**
758
+ * Adds a counter to the module's top level menu item.
759
+ *
760
+ * @author Vova Feldman (@svovaf)
761
+ * @since 1.2.1.5
762
+ *
763
+ * @param int $counter
764
+ * @param string $class
765
+ */
766
+ function add_counter_to_menu_item( $counter = 1, $class = '' ) {
767
+ global $menu, $submenu;
768
+
769
+ $mask = '%s <span class="update-plugins %s count-%3$s" aria-hidden="true"><span>%3$s<span class="screen-reader-text">%3$s notifications</span></span></span>';
770
+
771
+ /**
772
+ * This method is NOT executed for WordPress.org themes.
773
+ * Since we maintain only one version of the SDK we added this small
774
+ * hack to avoid the error from Theme Check since it's a false-positive.
775
+ *
776
+ * @author Vova Feldman (@svovaf)
777
+ * @since 1.2.2.7
778
+ */
779
+ $menu_ref = &$menu;
780
+ $submenu_ref = &$submenu;
781
+
782
+ if ( $this->_is_top_level ) {
783
+ // Find main menu item.
784
+ $found_menu = $this->find_top_level_menu();
785
+
786
+ if ( false !== $found_menu ) {
787
+ // Override menu label.
788
+ $menu_ref[ $found_menu['position'] ][0] = sprintf(
789
+ $mask,
790
+ $found_menu['menu'][0],
791
+ $class,
792
+ $counter
793
+ );
794
+ }
795
+ } else {
796
+ $found_submenu = $this->find_main_submenu();
797
+
798
+ if ( false !== $found_submenu ) {
799
+ // Override menu label.
800
+ $submenu_ref[ $found_submenu['parent_slug'] ][ $found_submenu['position'] ][0] = sprintf(
801
+ $mask,
802
+ $found_submenu['menu'][0],
803
+ $class,
804
+ $counter
805
+ );
806
+ }
807
+ }
808
+ }
809
+
810
+ #endregion Top level menu Override
811
+
812
+ /**
813
+ * Add a top-level menu page.
814
+ *
815
+ * Note for WordPress.org Theme/Plugin reviewer:
816
+ *
817
+ * This is a replication of `add_menu_page()` to avoid Theme Check warning.
818
+ *
819
+ * Why?
820
+ * ====
821
+ * Freemius is an SDK for plugin and theme developers. Since the core
822
+ * of the SDK is relevant both for plugins and themes, for obvious reasons,
823
+ * we only develop and maintain one code base.
824
+ *
825
+ * This method will not run for wp.org themes (only plugins) since theme
826
+ * admin settings/options are now only allowed in the customizer.
827
+ *
828
+ * If you have any questions or need clarifications, please don't hesitate
829
+ * pinging me on slack, my username is @svovaf.
830
+ *
831
+ * @author Vova Feldman (@svovaf)
832
+ * @since 1.2.2
833
+ *
834
+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is
835
+ * selected.
836
+ * @param string $menu_title The text to be used for the menu.
837
+ * @param string $capability The capability required for this menu to be displayed to the user.
838
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
839
+ * @param callable|string $function The function to be called to output the content for this page.
840
+ * @param string $icon_url The URL to the icon to be used for this menu.
841
+ * * Pass a base64-encoded SVG using a data URI, which will be colored to
842
+ * match the color scheme. This should begin with
843
+ * 'data:image/svg+xml;base64,'.
844
+ * * Pass the name of a Dashicons helper class to use a font icon,
845
+ * e.g. 'dashicons-chart-pie'.
846
+ * * Pass 'none' to leave div.wp-menu-image empty so an icon can be added
847
+ * via CSS.
848
+ * @param int $position The position in the menu order this one should appear.
849
+ *
850
+ * @return string The resulting page's hook_suffix.
851
+ */
852
+ static function add_page(
853
+ $page_title,
854
+ $menu_title,
855
+ $capability,
856
+ $menu_slug,
857
+ $function = '',
858
+ $icon_url = '',
859
+ $position = null
860
+ ) {
861
+ $fn = 'add_menu' . '_page';
862
+
863
+ return $fn(
864
+ $page_title,
865
+ $menu_title,
866
+ $capability,
867
+ $menu_slug,
868
+ $function,
869
+ $icon_url,
870
+ $position
871
+ );
872
+ }
873
+
874
+ /**
875
+ * Add page and update menu instance settings.
876
+ *
877
+ * @author Vova Feldman (@svovaf)
878
+ * @since 2.0.0
879
+ *
880
+ * @param string $page_title
881
+ * @param string $menu_title
882
+ * @param string $capability
883
+ * @param string $menu_slug
884
+ * @param callable|string $function
885
+ * @param string $icon_url
886
+ * @param int|null $position
887
+ *
888
+ * @return string
889
+ */
890
+ function add_page_and_update(
891
+ $page_title,
892
+ $menu_title,
893
+ $capability,
894
+ $menu_slug,
895
+ $function = '',
896
+ $icon_url = '',
897
+ $position = null
898
+ ) {
899
+ $this->_menu_slug = $menu_slug;
900
+ $this->_is_top_level = true;
901
+ $this->_menu_exists = true;
902
+ $this->_network_menu_exists = true;
903
+
904
+ return self::add_page(
905
+ $page_title,
906
+ $menu_title,
907
+ $capability,
908
+ $menu_slug,
909
+ $function,
910
+ $icon_url,
911
+ $position
912
+ );
913
+ }
914
+
915
+ /**
916
+ * Add a submenu page.
917
+ *
918
+ * Note for WordPress.org Theme/Plugin reviewer:
919
+ *
920
+ * This is a replication of `add_submenu_page()` to avoid Theme Check warning.
921
+ *
922
+ * Why?
923
+ * ====
924
+ * Freemius is an SDK for plugin and theme developers. Since the core
925
+ * of the SDK is relevant both for plugins and themes, for obvious reasons,
926
+ * we only develop and maintain one code base.
927
+ *
928
+ * This method will not run for wp.org themes (only plugins) since theme
929
+ * admin settings/options are now only allowed in the customizer.
930
+ *
931
+ * If you have any questions or need clarifications, please don't hesitate
932
+ * pinging me on slack, my username is @svovaf.
933
+ *
934
+ * @author Vova Feldman (@svovaf)
935
+ * @since 1.2.2
936
+ *
937
+ * @param string $parent_slug The slug name for the parent menu (or the file name of a standard
938
+ * WordPress admin page).
939
+ * @param string $page_title The text to be displayed in the title tags of the page when the menu is
940
+ * selected.
941
+ * @param string $menu_title The text to be used for the menu.
942
+ * @param string $capability The capability required for this menu to be displayed to the user.
943
+ * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
944
+ * @param callable|string $function The function to be called to output the content for this page.
945
+ *
946
+ * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability
947
+ * required.
948
+ */
949
+ static function add_subpage(
950
+ $parent_slug,
951
+ $page_title,
952
+ $menu_title,
953
+ $capability,
954
+ $menu_slug,
955
+ $function = ''
956
+ ) {
957
+ $fn = 'add_submenu' . '_page';
958
+
959
+ return $fn( $parent_slug,
960
+ $page_title,
961
+ $menu_title,
962
+ $capability,
963
+ $menu_slug,
964
+ $function
965
+ );
966
+ }
967
+
968
+ /**
969
+ * Add sub page and update menu instance settings.
970
+ *
971
+ * @author Vova Feldman (@svovaf)
972
+ * @since 2.0.0
973
+ *
974
+ * @param string $parent_slug
975
+ * @param string $page_title
976
+ * @param string $menu_title
977
+ * @param string $capability
978
+ * @param string $menu_slug
979
+ * @param callable|string $function
980
+ *
981
+ * @return string
982
+ */
983
+ function add_subpage_and_update(
984
+ $parent_slug,
985
+ $page_title,
986
+ $menu_title,
987
+ $capability,
988
+ $menu_slug,
989
+ $function = ''
990
+ ) {
991
+ $this->_menu_slug = $menu_slug;
992
+ $this->_parent_slug = $parent_slug;
993
+ $this->_is_top_level = false;
994
+ $this->_menu_exists = true;
995
+ $this->_network_menu_exists = true;
996
+
997
+ return self::add_subpage(
998
+ $parent_slug,
999
+ $page_title,
1000
+ $menu_title,
1001
+ $capability,
1002
+ $menu_slug,
1003
+ $function
1004
+ );
1005
+ }
1006
  }
freemius/includes/sdk/FreemiusWordPress.php CHANGED
@@ -59,6 +59,10 @@
59
  }
60
  }
61
 
 
 
 
 
62
  $curl_version = FS_SDK__HAS_CURL ?
63
  curl_version() :
64
  array( 'version' => '7.37' );
@@ -401,7 +405,7 @@
401
  }
402
 
403
  if ( 'https' === substr( strtolower( $request_url ), 0, 5 ) ) {
404
- $pWPRemoteArgs['sslverify'] = false;
405
  }
406
 
407
  if ( false !== $pBeforeExecutionFunction &&
59
  }
60
  }
61
 
62
+ if ( ! defined( 'FS_SDK__SSLVERIFY' ) ) {
63
+ define( 'FS_SDK__SSLVERIFY', false );
64
+ }
65
+
66
  $curl_version = FS_SDK__HAS_CURL ?
67
  curl_version() :
68
  array( 'version' => '7.37' );
405
  }
406
 
407
  if ( 'https' === substr( strtolower( $request_url ), 0, 5 ) ) {
408
+ $pWPRemoteArgs['sslverify'] = FS_SDK__SSLVERIFY;
409
  }
410
 
411
  if ( false !== $pBeforeExecutionFunction &&
freemius/includes/supplements/fs-essential-functions-1.1.7.1.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.1.7
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * Find the plugin main file path based on any given file inside the plugin's folder.
15
- *
16
- * @author Vova Feldman (@svovaf)
17
- * @since 1.1.7.1
18
- *
19
- * @param string $file Absolute path to a file inside a plugin's folder.
20
- *
21
- * @return string
22
- */
23
- function fs_find_direct_caller_plugin_file( $file ) {
24
- /**
25
- * All the code below will be executed once on activation.
26
- * If the user changes the main plugin's file name, the file_exists()
27
- * will catch it.
28
- */
29
- $all_plugins = fs_get_plugins( true );
30
-
31
- $file_real_path = fs_normalize_path( realpath( $file ) );
32
-
33
- // Get active plugin's main files real full names (might be symlinks).
34
- foreach ( $all_plugins as $relative_path => $data ) {
35
- if ( 0 === strpos( $file_real_path, fs_normalize_path( dirname( realpath( WP_PLUGIN_DIR . '/' . $relative_path ) ) . '/' ) ) ) {
36
- if ( '.' !== dirname( trailingslashit( $relative_path ) ) ) {
37
- return $relative_path;
38
- }
39
- }
40
- }
41
-
42
- return null;
43
- }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.1.7
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Find the plugin main file path based on any given file inside the plugin's folder.
15
+ *
16
+ * @author Vova Feldman (@svovaf)
17
+ * @since 1.1.7.1
18
+ *
19
+ * @param string $file Absolute path to a file inside a plugin's folder.
20
+ *
21
+ * @return string
22
+ */
23
+ function fs_find_direct_caller_plugin_file( $file ) {
24
+ /**
25
+ * All the code below will be executed once on activation.
26
+ * If the user changes the main plugin's file name, the file_exists()
27
+ * will catch it.
28
+ */
29
+ $all_plugins = fs_get_plugins( true );
30
+
31
+ $file_real_path = fs_normalize_path( realpath( $file ) );
32
+
33
+ // Get active plugin's main files real full names (might be symlinks).
34
+ foreach ( $all_plugins as $relative_path => $data ) {
35
+ if ( 0 === strpos( $file_real_path, fs_normalize_path( dirname( realpath( WP_PLUGIN_DIR . '/' . $relative_path ) ) . '/' ) ) ) {
36
+ if ( '.' !== dirname( trailingslashit( $relative_path ) ) ) {
37
+ return $relative_path;
38
+ }
39
+ }
40
+ }
41
+
42
+ return null;
43
+ }
freemius/languages/freemius-cs_CZ.mo CHANGED
Binary file
freemius/languages/freemius-da_DK.mo CHANGED
Binary file
freemius/languages/freemius-en.mo CHANGED
Binary file
freemius/languages/freemius-es_ES.mo CHANGED
Binary file
freemius/languages/freemius-fr_FR.mo CHANGED
Binary file
freemius/languages/freemius-he_IL.mo CHANGED
Binary file
freemius/languages/freemius-hu_HU.mo CHANGED
Binary file
freemius/languages/freemius-it_IT.mo CHANGED
Binary file
freemius/languages/freemius-ja.mo CHANGED
Binary file
freemius/languages/freemius-nl_NL.mo CHANGED
Binary file
freemius/languages/freemius-ru_RU.mo CHANGED
Binary file
freemius/languages/freemius-ta.mo CHANGED
Binary file
freemius/languages/freemius-zh_CN.mo CHANGED
Binary file
freemius/languages/freemius.pot CHANGED
@@ -1,2492 +1,2524 @@
1
- # Copyright (C) 2020 freemius
2
- # This file is distributed under the same license as the freemius package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: freemius\n"
6
- "MIME-Version: 1.0\n"
7
- "Content-Type: text/plain; charset=UTF-8\n"
8
- "Content-Transfer-Encoding: 8bit\n"
9
- "Language-Team: Freemius Team <admin@freemius.com>\n"
10
- "Last-Translator: Vova Feldman <vova@freemius.com>\n"
11
- "Report-Msgid-Bugs-To: https://github.com/Freemius/wordpress-sdk/issues\n"
12
- "X-Poedit-Basepath: ..\n"
13
- "X-Poedit-KeywordsList: get_text_inline;fs_text_inline;fs_echo_inline;fs_esc_js_inline;fs_esc_attr_inline;fs_esc_attr_echo_inline;fs_esc_html_inline;fs_esc_html_echo_inline;get_text_x_inline:1,2c;fs_text_x_inline:1,2c;fs_echo_x_inline:1,2c;fs_esc_attr_x_inline:1,2c;fs_esc_js_x_inline:1,2c;fs_esc_js_echo_x_inline:1,2c;fs_esc_html_x_inline:1,2c;fs_esc_html_echo_x_inline:1,2c\n"
14
- "X-Poedit-SearchPath-0: .\n"
15
- "X-Poedit-SearchPathExcluded-0: *.js\n"
16
- "X-Poedit-SourceCharset: UTF-8\n"
17
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
-
19
- #: includes/class-freemius.php:1911, templates/account.php:910
20
- msgid "An update to a Beta version will replace your installed version of %s with the latest Beta release - use with caution, and not on production sites. You have been warned."
21
- msgstr ""
22
-
23
- #: includes/class-freemius.php:1918
24
- msgid "Would you like to proceed with the update?"
25
- msgstr ""
26
-
27
- #: includes/class-freemius.php:2130
28
- msgid "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
29
- msgstr ""
30
-
31
- #: includes/class-freemius.php:2132
32
- msgid "Error"
33
- msgstr ""
34
-
35
- #: includes/class-freemius.php:2532
36
- msgid "I found a better %s"
37
- msgstr ""
38
-
39
- #: includes/class-freemius.php:2534
40
- msgid "What's the %s's name?"
41
- msgstr ""
42
-
43
- #: includes/class-freemius.php:2540
44
- msgid "It's a temporary %s. I'm just debugging an issue."
45
- msgstr ""
46
-
47
- #: includes/class-freemius.php:2542
48
- msgid "Deactivation"
49
- msgstr ""
50
-
51
- #: includes/class-freemius.php:2543
52
- msgid "Theme Switch"
53
- msgstr ""
54
-
55
- #: includes/class-freemius.php:2552, templates/forms/resend-key.php:24, templates/forms/user-change.php:29
56
- msgid "Other"
57
- msgstr ""
58
-
59
- #: includes/class-freemius.php:2560
60
- msgid "I no longer need the %s"
61
- msgstr ""
62
-
63
- #: includes/class-freemius.php:2567
64
- msgid "I only needed the %s for a short period"
65
- msgstr ""
66
-
67
- #: includes/class-freemius.php:2573
68
- msgid "The %s broke my site"
69
- msgstr ""
70
-
71
- #: includes/class-freemius.php:2580
72
- msgid "The %s suddenly stopped working"
73
- msgstr ""
74
-
75
- #: includes/class-freemius.php:2590
76
- msgid "I can't pay for it anymore"
77
- msgstr ""
78
-
79
- #: includes/class-freemius.php:2592
80
- msgid "What price would you feel comfortable paying?"
81
- msgstr ""
82
-
83
- #: includes/class-freemius.php:2598
84
- msgid "I don't like to share my information with you"
85
- msgstr ""
86
-
87
- #: includes/class-freemius.php:2619
88
- msgid "The %s didn't work"
89
- msgstr ""
90
-
91
- #: includes/class-freemius.php:2629
92
- msgid "I couldn't understand how to make it work"
93
- msgstr ""
94
-
95
- #: includes/class-freemius.php:2637
96
- msgid "The %s is great, but I need specific feature that you don't support"
97
- msgstr ""
98
-
99
- #: includes/class-freemius.php:2639
100
- msgid "What feature?"
101
- msgstr ""
102
-
103
- #: includes/class-freemius.php:2643
104
- msgid "The %s is not working"
105
- msgstr ""
106
-
107
- #: includes/class-freemius.php:2645
108
- msgid "Kindly share what didn't work so we can fix it for future users..."
109
- msgstr ""
110
-
111
- #: includes/class-freemius.php:2649
112
- msgid "It's not what I was looking for"
113
- msgstr ""
114
-
115
- #: includes/class-freemius.php:2651
116
- msgid "What you've been looking for?"
117
- msgstr ""
118
-
119
- #: includes/class-freemius.php:2655
120
- msgid "The %s didn't work as expected"
121
- msgstr ""
122
-
123
- #: includes/class-freemius.php:2657
124
- msgid "What did you expect?"
125
- msgstr ""
126
-
127
- #: includes/class-freemius.php:3512, templates/debug.php:20
128
- msgid "Freemius Debug"
129
- msgstr ""
130
-
131
- #: includes/class-freemius.php:4264
132
- msgid "I don't know what is cURL or how to install it, help me!"
133
- msgstr ""
134
-
135
- #: includes/class-freemius.php:4266
136
- msgid "We'll make sure to contact your hosting company and resolve the issue. You will get a follow-up email to %s once we have an update."
137
- msgstr ""
138
-
139
- #: includes/class-freemius.php:4273
140
- msgid "Great, please install cURL and enable it in your php.ini file. In addition, search for the 'disable_functions' directive in your php.ini file and remove any disabled methods starting with 'curl_'. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the %s and reactivate it back again."
141
- msgstr ""
142
-
143
- #: includes/class-freemius.php:4378
144
- msgid "Yes - do your thing"
145
- msgstr ""
146
-
147
- #: includes/class-freemius.php:4383
148
- msgid "No - just deactivate"
149
- msgstr ""
150
-
151
- #: includes/class-freemius.php:4428, includes/class-freemius.php:4922, includes/class-freemius.php:6178, includes/class-freemius.php:13282, includes/class-freemius.php:14000, includes/class-freemius.php:17451, includes/class-freemius.php:17556, includes/class-freemius.php:17731, includes/class-freemius.php:19965, includes/class-freemius.php:20323, includes/class-freemius.php:20333, includes/class-freemius.php:20997, includes/class-freemius.php:21903, includes/class-freemius.php:22036, includes/class-freemius.php:22192, templates/add-ons.php:57
152
- msgctxt "exclamation"
153
- msgid "Oops"
154
- msgstr ""
155
-
156
- #: includes/class-freemius.php:4497
157
- msgid "Thank for giving us the chance to fix it! A message was just sent to our technical staff. We will get back to you as soon as we have an update to %s. Appreciate your patience."
158
- msgstr ""
159
-
160
- #: includes/class-freemius.php:4919
161
- msgctxt "addonX cannot run without pluginY"
162
- msgid "%s cannot run without %s."
163
- msgstr ""
164
-
165
- #: includes/class-freemius.php:4920
166
- msgctxt "addonX cannot run..."
167
- msgid "%s cannot run without the plugin."
168
- msgstr ""
169
-
170
- #: includes/class-freemius.php:5119, includes/class-freemius.php:5144, includes/class-freemius.php:21068
171
- msgid "Unexpected API error. Please contact the %s's author with the following error."
172
- msgstr ""
173
-
174
- #: includes/class-freemius.php:5844
175
- msgid "Premium %s version was successfully activated."
176
- msgstr ""
177
-
178
- #: includes/class-freemius.php:5856, includes/class-freemius.php:7755
179
- msgctxt "Used to express elation, enthusiasm, or triumph (especially in electronic communication)."
180
- msgid "W00t"
181
- msgstr ""
182
-
183
- #: includes/class-freemius.php:5871
184
- msgid "You have a %s license."
185
- msgstr ""
186
-
187
- #: includes/class-freemius.php:5875, includes/class-freemius.php:16850, includes/class-freemius.php:16861, includes/class-freemius.php:20234, includes/class-freemius.php:20584, includes/class-freemius.php:20653, includes/class-freemius.php:20818
188
- msgctxt "interjection expressing joy or exuberance"
189
- msgid "Yee-haw"
190
- msgstr ""
191
-
192
- #: includes/class-freemius.php:6161
193
- msgid "%s free trial was successfully cancelled. Since the add-on is premium only it was automatically deactivated. If you like to use it in the future, you'll have to purchase a license."
194
- msgstr ""
195
-
196
- #: includes/class-freemius.php:6165
197
- msgid "%s is a premium only add-on. You have to purchase a license first before activating the plugin."
198
- msgstr ""
199
-
200
- #: includes/class-freemius.php:6174, templates/add-ons.php:186, templates/account/partials/addon.php:381
201
- msgid "More information about %s"
202
- msgstr ""
203
-
204
- #: includes/class-freemius.php:6175
205
- msgid "Purchase License"
206
- msgstr ""
207
-
208
- #: includes/class-freemius.php:7114, templates/connect.php:171
209
- msgid "You should receive an activation email for %s to your mailbox at %s. Please make sure you click the activation button in that email to %s."
210
- msgstr ""
211
-
212
- #: includes/class-freemius.php:7118
213
- msgid "start the trial"
214
- msgstr ""
215
-
216
- #: includes/class-freemius.php:7119, templates/connect.php:175
217
- msgid "complete the install"
218
- msgstr ""
219
-
220
- #: includes/class-freemius.php:7237
221
- msgid "You are just one step away - %s"
222
- msgstr ""
223
-
224
- #: includes/class-freemius.php:7240
225
- msgctxt "%s - plugin name. As complete \"PluginX\" activation now"
226
- msgid "Complete \"%s\" Activation Now"
227
- msgstr ""
228
-
229
- #: includes/class-freemius.php:7318
230
- msgid "We made a few tweaks to the %s, %s"
231
- msgstr ""
232
-
233
- #: includes/class-freemius.php:7322
234
- msgid "Opt in to make \"%s\" better!"
235
- msgstr ""
236
-
237
- #: includes/class-freemius.php:7754
238
- msgid "The upgrade of %s was successfully completed."
239
- msgstr ""
240
-
241
- #: includes/class-freemius.php:10223, includes/class-fs-plugin-updater.php:1044, includes/class-fs-plugin-updater.php:1239, includes/class-fs-plugin-updater.php:1246, templates/auto-installation.php:32
242
- msgid "Add-On"
243
- msgstr ""
244
-
245
- #: includes/class-freemius.php:10225, templates/account.php:392, templates/account.php:400, templates/debug.php:358, templates/debug.php:549
246
- msgid "Plugin"
247
- msgstr ""
248
-
249
- #: includes/class-freemius.php:10226, templates/account.php:393, templates/account.php:401, templates/debug.php:358, templates/debug.php:549, templates/forms/deactivation/form.php:71
250
- msgid "Theme"
251
- msgstr ""
252
-
253
- #: includes/class-freemius.php:13180
254
- msgid "An unknown error has occurred while trying to set the user's beta mode."
255
- msgstr ""
256
-
257
- #: includes/class-freemius.php:13253
258
- msgid "Invalid new user ID or email address."
259
- msgstr ""
260
-
261
- #: includes/class-freemius.php:13283, includes/class-freemius.php:22147
262
- msgid "Sorry, we could not complete the email update. Another user with the same email is already registered."
263
- msgstr ""
264
-
265
- #: includes/class-freemius.php:13284, includes/class-freemius.php:22148
266
- msgid "If you would like to give up the ownership of the %s's account to %s click the Change Ownership button."
267
- msgstr ""
268
-
269
- #: includes/class-freemius.php:13291, includes/class-freemius.php:22155
270
- msgid "Change Ownership"
271
- msgstr ""
272
-
273
- #: includes/class-freemius.php:13867
274
- msgid "Invalid site details collection."
275
- msgstr ""
276
-
277
- #: includes/class-freemius.php:13987
278
- msgid "We couldn't find your email address in the system, are you sure it's the right address?"
279
- msgstr ""
280
-
281
- #: includes/class-freemius.php:13989
282
- msgid "We can't see any active licenses associated with that email address, are you sure it's the right address?"
283
- msgstr ""
284
-
285
- #: includes/class-freemius.php:14263
286
- msgid "Account is pending activation."
287
- msgstr ""
288
-
289
- #: includes/class-freemius.php:14375, templates/forms/premium-versions-upgrade-handler.php:47
290
- msgid "Buy a license now"
291
- msgstr ""
292
-
293
- #: includes/class-freemius.php:14387, templates/forms/premium-versions-upgrade-handler.php:46
294
- msgid "Renew your license now"
295
- msgstr ""
296
-
297
- #: includes/class-freemius.php:14391
298
- msgid "%s to access version %s security & feature updates, and support."
299
- msgstr ""
300
-
301
- #: includes/class-freemius.php:16832
302
- msgid "%s activation was successfully completed."
303
- msgstr ""
304
-
305
- #: includes/class-freemius.php:16846
306
- msgid "Your account was successfully activated with the %s plan."
307
- msgstr ""
308
-
309
- #: includes/class-freemius.php:16857, includes/class-freemius.php:20649
310
- msgid "Your trial has been successfully started."
311
- msgstr ""
312
-
313
- #: includes/class-freemius.php:17449, includes/class-freemius.php:17554, includes/class-freemius.php:17729
314
- msgid "Couldn't activate %s."
315
- msgstr ""
316
-
317
- #: includes/class-freemius.php:17450, includes/class-freemius.php:17555, includes/class-freemius.php:17730
318
- msgid "Please contact us with the following message:"
319
- msgstr ""
320
-
321
- #: includes/class-freemius.php:17551, templates/forms/data-debug-mode.php:162
322
- msgid "An unknown error has occurred."
323
- msgstr ""
324
-
325
- #: includes/class-freemius.php:18087, includes/class-freemius.php:23208
326
- msgid "Upgrade"
327
- msgstr ""
328
-
329
- #: includes/class-freemius.php:18093
330
- msgid "Start Trial"
331
- msgstr ""
332
-
333
- #: includes/class-freemius.php:18095
334
- msgid "Pricing"
335
- msgstr ""
336
-
337
- #: includes/class-freemius.php:18175, includes/class-freemius.php:18177
338
- msgid "Affiliation"
339
- msgstr ""
340
-
341
- #: includes/class-freemius.php:18205, includes/class-freemius.php:18207, templates/account.php:240, templates/debug.php:324
342
- msgid "Account"
343
- msgstr ""
344
-
345
- #: includes/class-freemius.php:18221, includes/class-freemius.php:18223, includes/customizer/class-fs-customizer-support-section.php:60
346
- msgid "Contact Us"
347
- msgstr ""
348
-
349
- #: includes/class-freemius.php:18234, includes/class-freemius.php:18236, includes/class-freemius.php:23222, templates/account.php:119, templates/account/partials/addon.php:44
350
- msgid "Add-Ons"
351
- msgstr ""
352
-
353
- #: includes/class-freemius.php:18270
354
- msgctxt "ASCII arrow left icon"
355
- msgid "&#x2190;"
356
- msgstr ""
357
-
358
- #: includes/class-freemius.php:18270
359
- msgctxt "ASCII arrow right icon"
360
- msgid "&#x27a4;"
361
- msgstr ""
362
-
363
- #: includes/class-freemius.php:18272, templates/pricing.php:109
364
- msgctxt "noun"
365
- msgid "Pricing"
366
- msgstr ""
367
-
368
- #: includes/class-freemius.php:18485, includes/customizer/class-fs-customizer-support-section.php:67
369
- msgid "Support Forum"
370
- msgstr ""
371
-
372
- #: includes/class-freemius.php:19459
373
- msgid "Your email has been successfully verified - you are AWESOME!"
374
- msgstr ""
375
-
376
- #: includes/class-freemius.php:19460
377
- msgctxt "a positive response"
378
- msgid "Right on"
379
- msgstr ""
380
-
381
- #: includes/class-freemius.php:19966
382
- msgid "seems like the key you entered doesn't match our records."
383
- msgstr ""
384
-
385
- #: includes/class-freemius.php:19990
386
- msgid "Debug mode was successfully enabled and will be automatically disabled in 60 min. You can also disable it earlier by clicking the \"Stop Debug\" link."
387
- msgstr ""
388
-
389
- #: includes/class-freemius.php:20225
390
- msgid "Your %s Add-on plan was successfully upgraded."
391
- msgstr ""
392
-
393
- #: includes/class-freemius.php:20227
394
- msgid "%s Add-on was successfully purchased."
395
- msgstr ""
396
-
397
- #: includes/class-freemius.php:20230
398
- msgid "Download the latest version"
399
- msgstr ""
400
-
401
- #: includes/class-freemius.php:20316
402
- msgid "Your server is blocking the access to Freemius' API, which is crucial for %1$s synchronization. Please contact your host to whitelist %2$s"
403
- msgstr ""
404
-
405
- #: includes/class-freemius.php:20322, includes/class-freemius.php:20332, includes/class-freemius.php:20777, includes/class-freemius.php:20866
406
- msgid "Error received from the server:"
407
- msgstr ""
408
-
409
- #: includes/class-freemius.php:20332
410
- msgid "It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again."
411
- msgstr ""
412
-
413
- #: includes/class-freemius.php:20546, includes/class-freemius.php:20782, includes/class-freemius.php:20837, includes/class-freemius.php:20944
414
- msgctxt "something somebody says when they are thinking about what you have just said."
415
- msgid "Hmm"
416
- msgstr ""
417
-
418
- #: includes/class-freemius.php:20559
419
- msgid "It looks like you are still on the %s plan. If you did upgrade or change your plan, it's probably an issue on our side - sorry."
420
- msgstr ""
421
-
422
- #: includes/class-freemius.php:20560, templates/account.php:121, templates/add-ons.php:250, templates/account/partials/addon.php:46
423
- msgctxt "trial period"
424
- msgid "Trial"
425
- msgstr ""
426
-
427
- #: includes/class-freemius.php:20565
428
- msgid "I have upgraded my account but when I try to Sync the License, the plan remains %s."
429
- msgstr ""
430
-
431
- #: includes/class-freemius.php:20569, includes/class-freemius.php:20628
432
- msgid "Please contact us here"
433
- msgstr ""
434
-
435
- #: includes/class-freemius.php:20580
436
- msgid "Your plan was successfully activated."
437
- msgstr ""
438
-
439
- #: includes/class-freemius.php:20581
440
- msgid "Your plan was successfully upgraded."
441
- msgstr ""
442
-
443
- #: includes/class-freemius.php:20598
444
- msgid "Your plan was successfully changed to %s."
445
- msgstr ""
446
-
447
- #: includes/class-freemius.php:20614
448
- msgid "Your license has expired. You can still continue using the free %s forever."
449
- msgstr ""
450
-
451
- #: includes/class-freemius.php:20616
452
- msgid "Your license has expired. %1$sUpgrade now%2$s to continue using the %3$s without interruptions."
453
- msgstr ""
454
-
455
- #: includes/class-freemius.php:20624
456
- msgid "Your license has been cancelled. If you think it's a mistake, please contact support."
457
- msgstr ""
458
-
459
- #: includes/class-freemius.php:20637
460
- msgid "Your license has expired. You can still continue using all the %s features, but you'll need to renew your license to continue getting updates and support."
461
- msgstr ""
462
-
463
- #: includes/class-freemius.php:20663
464
- msgid "Your free trial has expired. You can still continue using all our free features."
465
- msgstr ""
466
-
467
- #: includes/class-freemius.php:20665
468
- msgid "Your free trial has expired. %1$sUpgrade now%2$s to continue using the %3$s without interruptions."
469
- msgstr ""
470
-
471
- #: includes/class-freemius.php:20773
472
- msgid "It looks like the license could not be activated."
473
- msgstr ""
474
-
475
- #: includes/class-freemius.php:20815
476
- msgid "Your license was successfully activated."
477
- msgstr ""
478
-
479
- #: includes/class-freemius.php:20841
480
- msgid "It looks like your site currently doesn't have an active license."
481
- msgstr ""
482
-
483
- #: includes/class-freemius.php:20865
484
- msgid "It looks like the license deactivation failed."
485
- msgstr ""
486
-
487
- #: includes/class-freemius.php:20894
488
- msgid "Your %s license was successfully deactivated."
489
- msgstr ""
490
-
491
- #: includes/class-freemius.php:20895
492
- msgid "Your license was successfully deactivated, you are back to the %s plan."
493
- msgstr ""
494
-
495
- #: includes/class-freemius.php:20898
496
- msgid "O.K"
497
- msgstr ""
498
-
499
- #: includes/class-freemius.php:20951
500
- msgid "Seems like we are having some temporary issue with your subscription cancellation. Please try again in few minutes."
501
- msgstr ""
502
-
503
- #: includes/class-freemius.php:20960
504
- msgid "Your subscription was successfully cancelled. Your %s plan license will expire in %s."
505
- msgstr ""
506
-
507
- #: includes/class-freemius.php:21002
508
- msgid "You are already running the %s in a trial mode."
509
- msgstr ""
510
-
511
- #: includes/class-freemius.php:21013
512
- msgid "You already utilized a trial before."
513
- msgstr ""
514
-
515
- #: includes/class-freemius.php:21027
516
- msgid "Plan %s do not exist, therefore, can't start a trial."
517
- msgstr ""
518
-
519
- #: includes/class-freemius.php:21038
520
- msgid "Plan %s does not support a trial period."
521
- msgstr ""
522
-
523
- #: includes/class-freemius.php:21049
524
- msgid "None of the %s's plans supports a trial period."
525
- msgstr ""
526
-
527
- #: includes/class-freemius.php:21099
528
- msgid "It looks like you are not in trial mode anymore so there's nothing to cancel :)"
529
- msgstr ""
530
-
531
- #: includes/class-freemius.php:21135
532
- msgid "Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes."
533
- msgstr ""
534
-
535
- #: includes/class-freemius.php:21154
536
- msgid "Your %s free trial was successfully cancelled."
537
- msgstr ""
538
-
539
- #: includes/class-freemius.php:21470
540
- msgid "Version %s was released."
541
- msgstr ""
542
-
543
- #: includes/class-freemius.php:21470
544
- msgid "Please download %s."
545
- msgstr ""
546
-
547
- #: includes/class-freemius.php:21477
548
- msgid "the latest %s version here"
549
- msgstr ""
550
-
551
- #: includes/class-freemius.php:21482
552
- msgid "New"
553
- msgstr ""
554
-
555
- #: includes/class-freemius.php:21487
556
- msgid "Seems like you got the latest release."
557
- msgstr ""
558
-
559
- #: includes/class-freemius.php:21488
560
- msgid "You are all good!"
561
- msgstr ""
562
-
563
- #: includes/class-freemius.php:21791
564
- msgid "Verification mail was just sent to %s. If you can't find it after 5 min, please check your spam box."
565
- msgstr ""
566
-
567
- #: includes/class-freemius.php:21931
568
- msgid "Site successfully opted in."
569
- msgstr ""
570
-
571
- #: includes/class-freemius.php:21932, includes/class-freemius.php:22918
572
- msgid "Awesome"
573
- msgstr ""
574
-
575
- #: includes/class-freemius.php:21948, templates/forms/optout.php:41
576
- msgid "We appreciate your help in making the %s better by letting us track some usage data."
577
- msgstr ""
578
-
579
- #: includes/class-freemius.php:21949
580
- msgid "Thank you!"
581
- msgstr ""
582
-
583
- #: includes/class-freemius.php:21956
584
- msgid "We will no longer be sending any usage data of %s on %s to %s."
585
- msgstr ""
586
-
587
- #: includes/class-freemius.php:22114
588
- msgid "Please check your mailbox, you should receive an email via %s to confirm the ownership change. From security reasons, you must confirm the change within the next 15 min. If you cannot find the email, please check your spam folder."
589
- msgstr ""
590
-
591
- #: includes/class-freemius.php:22120
592
- msgid "Thanks for confirming the ownership change. An email was just sent to %s for final approval."
593
- msgstr ""
594
-
595
- #: includes/class-freemius.php:22125
596
- msgid "%s is the new owner of the account."
597
- msgstr ""
598
-
599
- #: includes/class-freemius.php:22127
600
- msgctxt "as congratulations"
601
- msgid "Congrats"
602
- msgstr ""
603
-
604
- #: includes/class-freemius.php:22163
605
- msgid "Your email was successfully updated. You should receive an email with confirmation instructions in few moments."
606
- msgstr ""
607
-
608
- #: includes/class-freemius.php:22175
609
- msgid "Please provide your full name."
610
- msgstr ""
611
-
612
- #: includes/class-freemius.php:22180
613
- msgid "Your name was successfully updated."
614
- msgstr ""
615
-
616
- #: includes/class-freemius.php:22241
617
- msgid "You have successfully updated your %s."
618
- msgstr ""
619
-
620
- #: includes/class-freemius.php:22381
621
- msgid "Just letting you know that the add-ons information of %s is being pulled from an external server."
622
- msgstr ""
623
-
624
- #: includes/class-freemius.php:22382
625
- msgctxt "advance notice of something that will need attention."
626
- msgid "Heads up"
627
- msgstr ""
628
-
629
- #: includes/class-freemius.php:22958
630
- msgctxt "exclamation"
631
- msgid "Hey"
632
- msgstr ""
633
-
634
- #: includes/class-freemius.php:22958
635
- msgid "How do you like %s so far? Test all our %s premium features with a %d-day free trial."
636
- msgstr ""
637
-
638
- #: includes/class-freemius.php:22966
639
- msgid "No commitment for %s days - cancel anytime!"
640
- msgstr ""
641
-
642
- #: includes/class-freemius.php:22967
643
- msgid "No credit card required"
644
- msgstr ""
645
-
646
- #: includes/class-freemius.php:22974, templates/forms/trial-start.php:53
647
- msgctxt "call to action"
648
- msgid "Start free trial"
649
- msgstr ""
650
-
651
- #: includes/class-freemius.php:23051
652
- msgid "Hey there, did you know that %s has an affiliate program? If you like the %s you can become our ambassador and earn some cash!"
653
- msgstr ""
654
-
655
- #: includes/class-freemius.php:23060
656
- msgid "Learn more"
657
- msgstr ""
658
-
659
- #: includes/class-freemius.php:23246, templates/account.php:556, templates/account.php:706, templates/connect.php:179, templates/connect.php:455, templates/forms/license-activation.php:27, templates/account/partials/addon.php:321
660
- msgid "Activate License"
661
- msgstr ""
662
-
663
- #: includes/class-freemius.php:23247, templates/account.php:650, templates/account.php:705, templates/account/partials/addon.php:322, templates/account/partials/site.php:271
664
- msgid "Change License"
665
- msgstr ""
666
-
667
- #: includes/class-freemius.php:23356, templates/account/partials/site.php:169
668
- msgid "Opt Out"
669
- msgstr ""
670
-
671
- #: includes/class-freemius.php:23358, includes/class-freemius.php:23364, templates/account/partials/site.php:49, templates/account/partials/site.php:169
672
- msgid "Opt In"
673
- msgstr ""
674
-
675
- #: includes/class-freemius.php:23592
676
- msgid " The paid version of %1$s is already installed. Please activate it to start benefiting the %2$s features. %3$s"
677
- msgstr ""
678
-
679
- #: includes/class-freemius.php:23600
680
- msgid "Activate %s features"
681
- msgstr ""
682
-
683
- #: includes/class-freemius.php:23613
684
- msgid "Please follow these steps to complete the upgrade"
685
- msgstr ""
686
-
687
- #: includes/class-freemius.php:23617
688
- msgid "Download the latest %s version"
689
- msgstr ""
690
-
691
- #: includes/class-freemius.php:23621
692
- msgid "Upload and activate the downloaded version"
693
- msgstr ""
694
-
695
- #: includes/class-freemius.php:23623
696
- msgid "How to upload and activate?"
697
- msgstr ""
698
-
699
- #: includes/class-freemius.php:23757
700
- msgid "%sClick here%s to choose the sites where you'd like to activate the license on."
701
- msgstr ""
702
-
703
- #: includes/class-freemius.php:23926
704
- msgid "Auto installation only works for opted-in users."
705
- msgstr ""
706
-
707
- #: includes/class-freemius.php:23936, includes/class-freemius.php:23969, includes/class-fs-plugin-updater.php:1218, includes/class-fs-plugin-updater.php:1232
708
- msgid "Invalid module ID."
709
- msgstr ""
710
-
711
- #: includes/class-freemius.php:23945, includes/class-fs-plugin-updater.php:1254
712
- msgid "Premium version already active."
713
- msgstr ""
714
-
715
- #: includes/class-freemius.php:23952
716
- msgid "You do not have a valid license to access the premium version."
717
- msgstr ""
718
-
719
- #: includes/class-freemius.php:23959
720
- msgid "Plugin is a \"Serviceware\" which means it does not have a premium code version."
721
- msgstr ""
722
-
723
- #: includes/class-freemius.php:23977, includes/class-fs-plugin-updater.php:1253
724
- msgid "Premium add-on version already installed."
725
- msgstr ""
726
-
727
- #: includes/class-freemius.php:24327
728
- msgid "View paid features"
729
- msgstr ""
730
-
731
- #: includes/class-freemius.php:24649
732
- msgid "Thank you so much for using %s and its add-ons!"
733
- msgstr ""
734
-
735
- #: includes/class-freemius.php:24650
736
- msgid "Thank you so much for using %s!"
737
- msgstr ""
738
-
739
- #: includes/class-freemius.php:24656
740
- msgid "You've already opted-in to our usage-tracking, which helps us keep improving the %s."
741
- msgstr ""
742
-
743
- #: includes/class-freemius.php:24660
744
- msgid "Thank you so much for using our products!"
745
- msgstr ""
746
-
747
- #: includes/class-freemius.php:24661
748
- msgid "You've already opted-in to our usage-tracking, which helps us keep improving them."
749
- msgstr ""
750
-
751
- #: includes/class-freemius.php:24680
752
- msgid "%s and its add-ons"
753
- msgstr ""
754
-
755
- #: includes/class-freemius.php:24689
756
- msgid "Products"
757
- msgstr ""
758
-
759
- #: includes/class-freemius.php:24696, templates/connect.php:280
760
- msgid "Yes"
761
- msgstr ""
762
-
763
- #: includes/class-freemius.php:24697, templates/connect.php:281
764
- msgid "send me security & feature updates, educational content and offers."
765
- msgstr ""
766
-
767
- #: includes/class-freemius.php:24698, templates/connect.php:286
768
- msgid "No"
769
- msgstr ""
770
-
771
- #: includes/class-freemius.php:24700, templates/connect.php:288
772
- msgid "do %sNOT%s send me security & feature updates, educational content and offers."
773
- msgstr ""
774
-
775
- #: includes/class-freemius.php:24710
776
- msgid "Due to the new %sEU General Data Protection Regulation (GDPR)%s compliance requirements it is required that you provide your explicit consent, again, confirming that you are onboard :-)"
777
- msgstr ""
778
-
779
- #: includes/class-freemius.php:24712, templates/connect.php:295
780
- msgid "Please let us know if you'd like us to contact you for security & feature updates, educational content, and occasional offers:"
781
- msgstr ""
782
-
783
- #: includes/class-freemius.php:24994
784
- msgid "License key is empty."
785
- msgstr ""
786
-
787
- #: includes/class-fs-plugin-updater.php:206, templates/forms/premium-versions-upgrade-handler.php:57
788
- msgid "Renew license"
789
- msgstr ""
790
-
791
- #: includes/class-fs-plugin-updater.php:211, templates/forms/premium-versions-upgrade-handler.php:58
792
- msgid "Buy license"
793
- msgstr ""
794
-
795
- #: includes/class-fs-plugin-updater.php:327, includes/class-fs-plugin-updater.php:360
796
- msgid "There is a %s of %s available."
797
- msgstr ""
798
-
799
- #: includes/class-fs-plugin-updater.php:329, includes/class-fs-plugin-updater.php:365
800
- msgid "new Beta version"
801
- msgstr ""
802
-
803
- #: includes/class-fs-plugin-updater.php:330, includes/class-fs-plugin-updater.php:366
804
- msgid "new version"
805
- msgstr ""
806
-
807
- #: includes/class-fs-plugin-updater.php:389
808
- msgid "Important Upgrade Notice:"
809
- msgstr ""
810
-
811
- #: includes/class-fs-plugin-updater.php:1283
812
- msgid "Installing plugin: %s"
813
- msgstr ""
814
-
815
- #: includes/class-fs-plugin-updater.php:1324
816
- msgid "Unable to connect to the filesystem. Please confirm your credentials."
817
- msgstr ""
818
-
819
- #: includes/class-fs-plugin-updater.php:1506
820
- msgid "The remote plugin package does not contain a folder with the desired slug and renaming did not work."
821
- msgstr ""
822
-
823
- #: includes/fs-plugin-info-dialog.php:535
824
- msgid "Purchase More"
825
- msgstr ""
826
-
827
- #: includes/fs-plugin-info-dialog.php:536, templates/account/partials/addon.php:385
828
- msgctxt "verb"
829
- msgid "Purchase"
830
- msgstr ""
831
-
832
- #: includes/fs-plugin-info-dialog.php:540
833
- msgid "Start my free %s"
834
- msgstr ""
835
-
836
- #: includes/fs-plugin-info-dialog.php:738
837
- msgid "Install Free Version Update Now"
838
- msgstr ""
839
-
840
- #: includes/fs-plugin-info-dialog.php:739, templates/account.php:639
841
- msgid "Install Update Now"
842
- msgstr ""
843
-
844
- #: includes/fs-plugin-info-dialog.php:748
845
- msgid "Install Free Version Now"
846
- msgstr ""
847
-
848
- #: includes/fs-plugin-info-dialog.php:749, templates/add-ons.php:323, templates/auto-installation.php:111, templates/account/partials/addon.php:365, templates/account/partials/addon.php:418
849
- msgid "Install Now"
850
- msgstr ""
851
-
852
- #: includes/fs-plugin-info-dialog.php:765
853
- msgctxt "as download latest version"
854
- msgid "Download Latest Free Version"
855
- msgstr ""
856
-
857
- #: includes/fs-plugin-info-dialog.php:766, templates/account.php:99, templates/add-ons.php:37, templates/account/partials/addon.php:25
858
- msgctxt "as download latest version"
859
- msgid "Download Latest"
860
- msgstr ""
861
-
862
- #: includes/fs-plugin-info-dialog.php:781, templates/add-ons.php:329, templates/account/partials/addon.php:356, templates/account/partials/addon.php:412
863
- msgid "Activate this add-on"
864
- msgstr ""
865
-
866
- #: includes/fs-plugin-info-dialog.php:783, templates/connect.php:452
867
- msgid "Activate Free Version"
868
- msgstr ""
869
-
870
- #: includes/fs-plugin-info-dialog.php:784, templates/account.php:123, templates/add-ons.php:330, templates/account/partials/addon.php:48
871
- msgid "Activate"
872
- msgstr ""
873
-
874
- #: includes/fs-plugin-info-dialog.php:996
875
- msgctxt "Plugin installer section title"
876
- msgid "Description"
877
- msgstr ""
878
-
879
- #: includes/fs-plugin-info-dialog.php:997
880
- msgctxt "Plugin installer section title"
881
- msgid "Installation"
882
- msgstr ""
883
-
884
- #: includes/fs-plugin-info-dialog.php:998
885
- msgctxt "Plugin installer section title"
886
- msgid "FAQ"
887
- msgstr ""
888
-
889
- #: includes/fs-plugin-info-dialog.php:999, templates/plugin-info/description.php:55
890
- msgid "Screenshots"
891
- msgstr ""
892
-
893
- #: includes/fs-plugin-info-dialog.php:1000
894
- msgctxt "Plugin installer section title"
895
- msgid "Changelog"
896
- msgstr ""
897
-
898
- #: includes/fs-plugin-info-dialog.php:1001
899
- msgctxt "Plugin installer section title"
900
- msgid "Reviews"
901
- msgstr ""
902
-
903
- #: includes/fs-plugin-info-dialog.php:1002
904
- msgctxt "Plugin installer section title"
905
- msgid "Other Notes"
906
- msgstr ""
907
-
908
- #: includes/fs-plugin-info-dialog.php:1017
909
- msgctxt "Plugin installer section title"
910
- msgid "Features & Pricing"
911
- msgstr ""
912
-
913
- #: includes/fs-plugin-info-dialog.php:1027
914
- msgid "Plugin Install"
915
- msgstr ""
916
-
917
- #: includes/fs-plugin-info-dialog.php:1099
918
- msgctxt "e.g. Professional Plan"
919
- msgid "%s Plan"
920
- msgstr ""
921
-
922
- #: includes/fs-plugin-info-dialog.php:1125
923
- msgctxt "e.g. the best product"
924
- msgid "Best"
925
- msgstr ""
926
-
927
- #: includes/fs-plugin-info-dialog.php:1131, includes/fs-plugin-info-dialog.php:1151
928
- msgctxt "as every month"
929
- msgid "Monthly"
930
- msgstr ""
931
-
932
- #: includes/fs-plugin-info-dialog.php:1134
933
- msgctxt "as once a year"
934
- msgid "Annual"
935
- msgstr ""
936
-
937
- #: includes/fs-plugin-info-dialog.php:1137
938
- msgid "Lifetime"
939
- msgstr ""
940
-
941
- #: includes/fs-plugin-info-dialog.php:1151, includes/fs-plugin-info-dialog.php:1153, includes/fs-plugin-info-dialog.php:1155
942
- msgctxt "e.g. billed monthly"
943
- msgid "Billed %s"
944
- msgstr ""
945
-
946
- #: includes/fs-plugin-info-dialog.php:1153
947
- msgctxt "as once a year"
948
- msgid "Annually"
949
- msgstr ""
950
-
951
- #: includes/fs-plugin-info-dialog.php:1155
952
- msgctxt "as once a year"
953
- msgid "Once"
954
- msgstr ""
955
-
956
- #: includes/fs-plugin-info-dialog.php:1161
957
- msgid "Single Site License"
958
- msgstr ""
959
-
960
- #: includes/fs-plugin-info-dialog.php:1163
961
- msgid "Unlimited Licenses"
962
- msgstr ""
963
-
964
- #: includes/fs-plugin-info-dialog.php:1165
965
- msgid "Up to %s Sites"
966
- msgstr ""
967
-
968
- #: includes/fs-plugin-info-dialog.php:1175, templates/plugin-info/features.php:82
969
- msgctxt "as monthly period"
970
- msgid "mo"
971
- msgstr ""
972
-
973
- #: includes/fs-plugin-info-dialog.php:1182, templates/plugin-info/features.php:80
974
- msgctxt "as annual period"
975
- msgid "year"
976
- msgstr ""
977
-
978
- #: includes/fs-plugin-info-dialog.php:1236
979
- msgctxt "noun"
980
- msgid "Price"
981
- msgstr ""
982
-
983
- #: includes/fs-plugin-info-dialog.php:1284
984
- msgid "Save %s"
985
- msgstr ""
986
-
987
- #: includes/fs-plugin-info-dialog.php:1294
988
- msgid "No commitment for %s - cancel anytime"
989
- msgstr ""
990
-
991
- #: includes/fs-plugin-info-dialog.php:1297
992
- msgid "After your free %s, pay as little as %s"
993
- msgstr ""
994
-
995
- #: includes/fs-plugin-info-dialog.php:1308
996
- msgid "Details"
997
- msgstr ""
998
-
999
- #: includes/fs-plugin-info-dialog.php:1312, templates/account.php:110, templates/debug.php:201, templates/debug.php:238, templates/debug.php:455, templates/account/partials/addon.php:36
1000
- msgctxt "product version"
1001
- msgid "Version"
1002
- msgstr ""
1003
-
1004
- #: includes/fs-plugin-info-dialog.php:1319
1005
- msgctxt "as the plugin author"
1006
- msgid "Author"
1007
- msgstr ""
1008
-
1009
- #: includes/fs-plugin-info-dialog.php:1326
1010
- msgid "Last Updated"
1011
- msgstr ""
1012
-
1013
- #: includes/fs-plugin-info-dialog.php:1331, templates/account.php:525
1014
- msgctxt "x-ago"
1015
- msgid "%s ago"
1016
- msgstr ""
1017
-
1018
- #: includes/fs-plugin-info-dialog.php:1340
1019
- msgid "Requires WordPress Version"
1020
- msgstr ""
1021
-
1022
- #: includes/fs-plugin-info-dialog.php:1341
1023
- msgid "%s or higher"
1024
- msgstr ""
1025
-
1026
- #: includes/fs-plugin-info-dialog.php:1348
1027
- msgid "Compatible up to"
1028
- msgstr ""
1029
-
1030
- #: includes/fs-plugin-info-dialog.php:1356
1031
- msgid "Downloaded"
1032
- msgstr ""
1033
-
1034
- #: includes/fs-plugin-info-dialog.php:1360
1035
- msgid "%s time"
1036
- msgstr ""
1037
-
1038
- #: includes/fs-plugin-info-dialog.php:1362
1039
- msgid "%s times"
1040
- msgstr ""
1041
-
1042
- #: includes/fs-plugin-info-dialog.php:1373
1043
- msgid "WordPress.org Plugin Page"
1044
- msgstr ""
1045
-
1046
- #: includes/fs-plugin-info-dialog.php:1382
1047
- msgid "Plugin Homepage"
1048
- msgstr ""
1049
-
1050
- #: includes/fs-plugin-info-dialog.php:1391, includes/fs-plugin-info-dialog.php:1475
1051
- msgid "Donate to this plugin"
1052
- msgstr ""
1053
-
1054
- #: includes/fs-plugin-info-dialog.php:1398
1055
- msgid "Average Rating"
1056
- msgstr ""
1057
-
1058
- #: includes/fs-plugin-info-dialog.php:1405
1059
- msgid "based on %s"
1060
- msgstr ""
1061
-
1062
- #: includes/fs-plugin-info-dialog.php:1409
1063
- msgid "%s rating"
1064
- msgstr ""
1065
-
1066
- #: includes/fs-plugin-info-dialog.php:1411
1067
- msgid "%s ratings"
1068
- msgstr ""
1069
-
1070
- #: includes/fs-plugin-info-dialog.php:1426
1071
- msgid "%s star"
1072
- msgstr ""
1073
-
1074
- #: includes/fs-plugin-info-dialog.php:1428
1075
- msgid "%s stars"
1076
- msgstr ""
1077
-
1078
- #: includes/fs-plugin-info-dialog.php:1440
1079
- msgid "Click to see reviews that provided a rating of %s"
1080
- msgstr ""
1081
-
1082
- #: includes/fs-plugin-info-dialog.php:1453
1083
- msgid "Contributors"
1084
- msgstr ""
1085
-
1086
- #: includes/fs-plugin-info-dialog.php:1483, includes/fs-plugin-info-dialog.php:1485
1087
- msgid "Warning"
1088
- msgstr ""
1089
-
1090
- #: includes/fs-plugin-info-dialog.php:1483
1091
- msgid "This plugin has not been tested with your current version of WordPress."
1092
- msgstr ""
1093
-
1094
- #: includes/fs-plugin-info-dialog.php:1485
1095
- msgid "This plugin has not been marked as compatible with your version of WordPress."
1096
- msgstr ""
1097
-
1098
- #: includes/fs-plugin-info-dialog.php:1504
1099
- msgid "Paid add-on must be deployed to Freemius."
1100
- msgstr ""
1101
-
1102
- #: includes/fs-plugin-info-dialog.php:1505
1103
- msgid "Add-on must be deployed to WordPress.org or Freemius."
1104
- msgstr ""
1105
-
1106
- #: includes/fs-plugin-info-dialog.php:1526
1107
- msgid "Newer Version (%s) Installed"
1108
- msgstr ""
1109
-
1110
- #: includes/fs-plugin-info-dialog.php:1527
1111
- msgid "Newer Free Version (%s) Installed"
1112
- msgstr ""
1113
-
1114
- #: includes/fs-plugin-info-dialog.php:1534
1115
- msgid "Latest Version Installed"
1116
- msgstr ""
1117
-
1118
- #: includes/fs-plugin-info-dialog.php:1535
1119
- msgid "Latest Free Version Installed"
1120
- msgstr ""
1121
-
1122
- #: templates/account.php:100, templates/forms/subscription-cancellation.php:96, templates/account/partials/addon.php:26, templates/account/partials/site.php:311
1123
- msgid "Downgrading your plan"
1124
- msgstr ""
1125
-
1126
- #: templates/account.php:101, templates/forms/subscription-cancellation.php:97, templates/account/partials/addon.php:27, templates/account/partials/site.php:312
1127
- msgid "Cancelling the subscription"
1128
- msgstr ""
1129
-
1130
- #. translators: %1$s: Either 'Downgrading your plan' or 'Cancelling the subscription'
1131
- #: templates/account.php:103, templates/forms/subscription-cancellation.php:99, templates/account/partials/site.php:314
1132
- msgid "%1$s will immediately stop all future recurring payments and your %2$s plan license will expire in %3$s."
1133
- msgstr ""
1134
-
1135
- #: templates/account.php:104, templates/forms/subscription-cancellation.php:100, templates/account/partials/addon.php:30, templates/account/partials/site.php:315
1136
- msgid "Please note that we will not be able to grandfather outdated pricing for renewals/new subscriptions after a cancellation. If you choose to renew the subscription manually in the future, after a price increase, which typically occurs once a year, you will be charged the updated price."
1137
- msgstr ""
1138
-
1139
- #: templates/account.php:105, templates/forms/subscription-cancellation.php:106, templates/account/partials/addon.php:31
1140
- msgid "Cancelling the trial will immediately block access to all premium features. Are you sure?"
1141
- msgstr ""
1142
-
1143
- #: templates/account.php:106, templates/forms/subscription-cancellation.php:101, templates/account/partials/addon.php:32, templates/account/partials/site.php:316
1144
- msgid "You can still enjoy all %s features but you will not have access to %s security & feature updates, nor support."
1145
- msgstr ""
1146
-
1147
- #: templates/account.php:107, templates/forms/subscription-cancellation.php:102, templates/account/partials/addon.php:33, templates/account/partials/site.php:317
1148
- msgid "Once your license expires you can still use the Free version but you will NOT have access to the %s features."
1149
- msgstr ""
1150
-
1151
- #. translators: %s: Plan title (e.g. "Professional")
1152
- #: templates/account.php:109, templates/account/partials/activate-license-button.php:31, templates/account/partials/addon.php:35
1153
- msgid "Activate %s Plan"
1154
- msgstr ""
1155
-
1156
- #. translators: %s: Time period (e.g. Auto renews in "2 months")
1157
- #: templates/account.php:112, templates/account/partials/addon.php:38, templates/account/partials/site.php:291
1158
- msgid "Auto renews in %s"
1159
- msgstr ""
1160
-
1161
- #. translators: %s: Time period (e.g. Expires in "2 months")
1162
- #: templates/account.php:114, templates/account/partials/addon.php:40, templates/account/partials/site.php:293
1163
- msgid "Expires in %s"
1164
- msgstr ""
1165
-
1166
- #: templates/account.php:115
1167
- msgctxt "as synchronize license"
1168
- msgid "Sync License"
1169
- msgstr ""
1170
-
1171
- #: templates/account.php:116, templates/account/partials/addon.php:41
1172
- msgid "Cancel Trial"
1173
- msgstr ""
1174
-
1175
- #: templates/account.php:117, templates/account/partials/addon.php:42
1176
- msgid "Change Plan"
1177
- msgstr ""
1178
-
1179
- #: templates/account.php:118, templates/account/partials/addon.php:43
1180
- msgctxt "verb"
1181
- msgid "Upgrade"
1182
- msgstr ""
1183
-
1184
- #: templates/account.php:120, templates/account/partials/addon.php:45, templates/account/partials/site.php:318
1185
- msgctxt "verb"
1186
- msgid "Downgrade"
1187
- msgstr ""
1188
-
1189
- #: templates/account.php:122, templates/add-ons.php:246, templates/plugin-info/features.php:72, templates/account/partials/addon.php:47, templates/account/partials/site.php:33
1190
- msgid "Free"
1191
- msgstr ""
1192
-
1193
- #: templates/account.php:124, templates/debug.php:371, includes/customizer/class-fs-customizer-upsell-control.php:110, templates/account/partials/addon.php:49
1194
- msgctxt "as product pricing plan"
1195
- msgid "Plan"
1196
- msgstr ""
1197
-
1198
- #: templates/account.php:125
1199
- msgid "Bundle Plan"
1200
- msgstr ""
1201
-
1202
- #: templates/account.php:248
1203
- msgid "Free Trial"
1204
- msgstr ""
1205
-
1206
- #: templates/account.php:259
1207
- msgid "Account Details"
1208
- msgstr ""
1209
-
1210
- #: templates/account.php:266, templates/forms/data-debug-mode.php:33
1211
- msgid "Start Debug"
1212
- msgstr ""
1213
-
1214
- #: templates/account.php:268
1215
- msgid "Stop Debug"
1216
- msgstr ""
1217
-
1218
- #: templates/account.php:275
1219
- msgid "Billing & Invoices"
1220
- msgstr ""
1221
-
1222
- #: templates/account.php:286
1223
- msgid "Deleting the account will automatically deactivate your %s plan license so you can use it on other sites. If you want to terminate the recurring payments as well, click the \"Cancel\" button, and first \"Downgrade\" your account. Are you sure you would like to continue with the deletion?"
1224
- msgstr ""
1225
-
1226
- #: templates/account.php:288
1227
- msgid "Deletion is not temporary. Only delete if you no longer want to use this %s anymore. Are you sure you would like to continue with the deletion?"
1228
- msgstr ""
1229
-
1230
- #: templates/account.php:291
1231
- msgid "Delete Account"
1232
- msgstr ""
1233
-
1234
- #: templates/account.php:303, templates/account/partials/addon.php:231, templates/account/partials/deactivate-license-button.php:35
1235
- msgid "Deactivate License"
1236
- msgstr ""
1237
-
1238
- #: templates/account.php:326, templates/forms/subscription-cancellation.php:125
1239
- msgid "Are you sure you want to proceed?"
1240
- msgstr ""
1241
-
1242
- #: templates/account.php:326, templates/account/partials/addon.php:255
1243
- msgid "Cancel Subscription"
1244
- msgstr ""
1245
-
1246
- #: templates/account.php:355, templates/account/partials/addon.php:340
1247
- msgctxt "as synchronize"
1248
- msgid "Sync"
1249
- msgstr ""
1250
-
1251
- #: templates/account.php:370, templates/debug.php:505
1252
- msgid "Name"
1253
- msgstr ""
1254
-
1255
- #: templates/account.php:376, templates/debug.php:506
1256
- msgid "Email"
1257
- msgstr ""
1258
-
1259
- #: templates/account.php:383, templates/debug.php:369, templates/debug.php:555
1260
- msgid "User ID"
1261
- msgstr ""
1262
-
1263
- #: templates/account.php:401, templates/account.php:719, templates/account.php:752, templates/debug.php:236, templates/debug.php:363, templates/debug.php:452, templates/debug.php:504, templates/debug.php:553, templates/debug.php:632, templates/account/payments.php:35, templates/debug/logger.php:21
1264
- msgid "ID"
1265
- msgstr ""
1266
-
1267
- #: templates/account.php:408
1268
- msgid "Site ID"
1269
- msgstr ""
1270
-
1271
- #: templates/account.php:411
1272
- msgid "No ID"
1273
- msgstr ""
1274
-
1275
- #: templates/account.php:416, templates/debug.php:243, templates/debug.php:372, templates/debug.php:456, templates/debug.php:508, templates/account/partials/site.php:227
1276
- msgid "Public Key"
1277
- msgstr ""
1278
-
1279
- #: templates/account.php:422, templates/debug.php:373, templates/debug.php:457, templates/debug.php:509, templates/account/partials/site.php:239
1280
- msgid "Secret Key"
1281
- msgstr ""
1282
-
1283
- #: templates/account.php:425
1284
- msgctxt "as secret encryption key missing"
1285
- msgid "No Secret"
1286
- msgstr ""
1287
-
1288
- #: templates/account.php:452, templates/account/partials/site.php:120, templates/account/partials/site.php:122
1289
- msgid "Trial"
1290
- msgstr ""
1291
-
1292
- #: templates/account.php:479, templates/debug.php:561, templates/account/partials/site.php:260
1293
- msgid "License Key"
1294
- msgstr ""
1295
-
1296
- #: templates/account.php:510
1297
- msgid "Join the Beta program"
1298
- msgstr ""
1299
-
1300
- #: templates/account.php:516
1301
- msgid "not verified"
1302
- msgstr ""
1303
-
1304
- #: templates/account.php:525, templates/account/partials/addon.php:190
1305
- msgid "Expired"
1306
- msgstr ""
1307
-
1308
- #: templates/account.php:585
1309
- msgid "Premium version"
1310
- msgstr ""
1311
-
1312
- #: templates/account.php:587
1313
- msgid "Free version"
1314
- msgstr ""
1315
-
1316
- #: templates/account.php:599
1317
- msgid "Verify Email"
1318
- msgstr ""
1319
-
1320
- #: templates/account.php:613
1321
- msgid "Download %s Version"
1322
- msgstr ""
1323
-
1324
- #: templates/account.php:629
1325
- msgid "Download Paid Version"
1326
- msgstr ""
1327
-
1328
- #: templates/account.php:647, templates/account.php:890, templates/account/partials/site.php:248, templates/account/partials/site.php:270
1329
- msgctxt "verb"
1330
- msgid "Show"
1331
- msgstr ""
1332
-
1333
- #: templates/account.php:662
1334
- msgid "What is your %s?"
1335
- msgstr ""
1336
-
1337
- #: templates/account.php:670, templates/account/billing.php:21
1338
- msgctxt "verb"
1339
- msgid "Edit"
1340
- msgstr ""
1341
-
1342
- #: templates/account.php:674, templates/forms/user-change.php:27
1343
- msgid "Change User"
1344
- msgstr ""
1345
-
1346
- #: templates/account.php:698
1347
- msgid "Sites"
1348
- msgstr ""
1349
-
1350
- #: templates/account.php:711
1351
- msgid "Search by address"
1352
- msgstr ""
1353
-
1354
- #: templates/account.php:720, templates/debug.php:366
1355
- msgid "Address"
1356
- msgstr ""
1357
-
1358
- #: templates/account.php:721
1359
- msgid "License"
1360
- msgstr ""
1361
-
1362
- #: templates/account.php:722
1363
- msgid "Plan"
1364
- msgstr ""
1365
-
1366
- #: templates/account.php:755
1367
- msgctxt "as software license"
1368
- msgid "License"
1369
- msgstr ""
1370
-
1371
- #: templates/account.php:884
1372
- msgctxt "verb"
1373
- msgid "Hide"
1374
- msgstr ""
1375
-
1376
- #: templates/account.php:906, templates/forms/data-debug-mode.php:31
1377
- msgid "Processing"
1378
- msgstr ""
1379
-
1380
- #: templates/account.php:909
1381
- msgid "Get updates for bleeding edge Beta versions of %s."
1382
- msgstr ""
1383
-
1384
- #: templates/account.php:967
1385
- msgid "Cancelling %s"
1386
- msgstr ""
1387
-
1388
- #: templates/account.php:967, templates/account.php:984, templates/forms/subscription-cancellation.php:27, templates/forms/deactivation/form.php:133
1389
- msgid "trial"
1390
- msgstr ""
1391
-
1392
- #: templates/account.php:982, templates/forms/deactivation/form.php:150
1393
- msgid "Cancelling %s..."
1394
- msgstr ""
1395
-
1396
- #: templates/account.php:985, templates/forms/subscription-cancellation.php:28, templates/forms/deactivation/form.php:134
1397
- msgid "subscription"
1398
- msgstr ""
1399
-
1400
- #: templates/account.php:999
1401
- msgid "Deactivating your license will block all premium features, but will enable activating the license on another site. Are you sure you want to proceed?"
1402
- msgstr ""
1403
-
1404
- #: templates/add-ons.php:38
1405
- msgid "View details"
1406
- msgstr ""
1407
-
1408
- #: templates/add-ons.php:48
1409
- msgid "Add Ons for %s"
1410
- msgstr ""
1411
-
1412
- #: templates/add-ons.php:58
1413
- msgid "We couldn't load the add-ons list. It's probably an issue on our side, please try to come back in few minutes."
1414
- msgstr ""
1415
-
1416
- #: templates/add-ons.php:229
1417
- msgctxt "active add-on"
1418
- msgid "Active"
1419
- msgstr ""
1420
-
1421
- #: templates/add-ons.php:230
1422
- msgctxt "installed add-on"
1423
- msgid "Installed"
1424
- msgstr ""
1425
-
1426
- #: templates/admin-notice.php:13, templates/forms/license-activation.php:220, templates/forms/resend-key.php:77
1427
- msgctxt "as close a window"
1428
- msgid "Dismiss"
1429
- msgstr ""
1430
-
1431
- #: templates/auto-installation.php:45
1432
- msgid "%s sec"
1433
- msgstr ""
1434
-
1435
- #: templates/auto-installation.php:83
1436
- msgid "Automatic Installation"
1437
- msgstr ""
1438
-
1439
- #: templates/auto-installation.php:93
1440
- msgid "An automated download and installation of %s (paid version) from %s will start in %s. If you would like to do it manually - click the cancellation button now."
1441
- msgstr ""
1442
-
1443
- #: templates/auto-installation.php:104
1444
- msgid "The installation process has started and may take a few minutes to complete. Please wait until it is done - do not refresh this page."
1445
- msgstr ""
1446
-
1447
- #: templates/auto-installation.php:109
1448
- msgid "Cancel Installation"
1449
- msgstr ""
1450
-
1451
- #: templates/checkout.php:180
1452
- msgid "Checkout"
1453
- msgstr ""
1454
-
1455
- #: templates/checkout.php:180
1456
- msgid "PCI compliant"
1457
- msgstr ""
1458
-
1459
- #. translators: %s: name (e.g. Hey John,)
1460
- #: templates/connect.php:112
1461
- msgctxt "greeting"
1462
- msgid "Hey %s,"
1463
- msgstr ""
1464
-
1465
- #: templates/connect.php:162
1466
- msgid "Allow & Continue"
1467
- msgstr ""
1468
-
1469
- #: templates/connect.php:166
1470
- msgid "Re-send activation email"
1471
- msgstr ""
1472
-
1473
- #: templates/connect.php:170
1474
- msgid "Thanks %s!"
1475
- msgstr ""
1476
-
1477
- #: templates/connect.php:180, templates/forms/license-activation.php:46
1478
- msgid "Agree & Activate License"
1479
- msgstr ""
1480
-
1481
- #: templates/connect.php:189
1482
- msgid "Thanks for purchasing %s! To get started, please enter your license key:"
1483
- msgstr ""
1484
-
1485
- #: templates/connect.php:196
1486
- msgid "Never miss an important update - opt in to our security & feature updates notifications, educational content, offers, and non-sensitive diagnostic tracking with %4$s."
1487
- msgstr ""
1488
-
1489
- #: templates/connect.php:197
1490
- msgid "Never miss an important update - opt in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s."
1491
- msgstr ""
1492
-
1493
- #: templates/connect.php:203
1494
- msgid "Never miss an important update - opt in to our security & feature updates notifications, educational content, offers, and non-sensitive diagnostic tracking with %4$s. If you skip this, that's okay! %1$s will still work just fine."
1495
- msgstr ""
1496
-
1497
- #: templates/connect.php:204
1498
- msgid "Never miss an important update - opt in to our security & feature updates notifications, and non-sensitive diagnostic tracking with %4$s. If you skip this, that's okay! %1$s will still work just fine."
1499
- msgstr ""
1500
-
1501
- #: templates/connect.php:238
1502
- msgid "We're excited to introduce the Freemius network-level integration."
1503
- msgstr ""
1504
-
1505
- #: templates/connect.php:241
1506
- msgid "During the update process we detected %d site(s) that are still pending license activation."
1507
- msgstr ""
1508
-
1509
- #: templates/connect.php:243
1510
- msgid "If you'd like to use the %s on those sites, please enter your license key below and click the activation button."
1511
- msgstr ""
1512
-
1513
- #: templates/connect.php:245
1514
- msgid "%s's paid features"
1515
- msgstr ""
1516
-
1517
- #: templates/connect.php:250
1518
- msgid "Alternatively, you can skip it for now and activate the license later, in your %s's network-level Account page."
1519
- msgstr ""
1520
-
1521
- #: templates/connect.php:252
1522
- msgid "During the update process we detected %s site(s) in the network that are still pending your attention."
1523
- msgstr ""
1524
-
1525
- #: templates/connect.php:261, templates/forms/data-debug-mode.php:35, templates/forms/license-activation.php:49
1526
- msgid "License key"
1527
- msgstr ""
1528
-
1529
- #: templates/connect.php:264, templates/forms/license-activation.php:22
1530
- msgid "Can't find your license key?"
1531
- msgstr ""
1532
-
1533
- #: templates/connect.php:323, templates/connect.php:694, templates/forms/deactivation/retry-skip.php:20
1534
- msgctxt "verb"
1535
- msgid "Skip"
1536
- msgstr ""
1537
-
1538
- #: templates/connect.php:326
1539
- msgid "Delegate to Site Admins"
1540
- msgstr ""
1541
-
1542
- #: templates/connect.php:326
1543
- msgid "If you click it, this decision will be delegated to the sites administrators."
1544
- msgstr ""
1545
-
1546
- #: templates/connect.php:364
1547
- msgid "Your Profile Overview"
1548
- msgstr ""
1549
-
1550
- #: templates/connect.php:365
1551
- msgid "Name and email address"
1552
- msgstr ""
1553
-
1554
- #: templates/connect.php:372
1555
- msgid "Your Site Overview"
1556
- msgstr ""
1557
-
1558
- #: templates/connect.php:373
1559
- msgid "Site URL, WP version, PHP info"
1560
- msgstr ""
1561
-
1562
- #: templates/connect.php:379
1563
- msgid "Admin Notices"
1564
- msgstr ""
1565
-
1566
- #: templates/connect.php:380, templates/connect.php:396
1567
- msgid "Updates, announcements, marketing, no spam"
1568
- msgstr ""
1569
-
1570
- #: templates/connect.php:386
1571
- msgid "Current %s Events"
1572
- msgstr ""
1573
-
1574
- #: templates/connect.php:387
1575
- msgid "Activation, deactivation and uninstall"
1576
- msgstr ""
1577
-
1578
- #: templates/connect.php:395
1579
- msgid "Newsletter"
1580
- msgstr ""
1581
-
1582
- #: templates/connect.php:403
1583
- msgid "Plugins & Themes"
1584
- msgstr ""
1585
-
1586
- #: templates/connect.php:404
1587
- msgid "Title, slug, version, and is active"
1588
- msgstr ""
1589
-
1590
- #: templates/connect.php:420, templates/forms/license-activation.php:41
1591
- msgid "The %1$s will be periodically sending data to %2$s to check for security and feature updates, and verify the validity of your license."
1592
- msgstr ""
1593
-
1594
- #: templates/connect.php:425
1595
- msgid "What permissions are being granted?"
1596
- msgstr ""
1597
-
1598
- #: templates/connect.php:451
1599
- msgid "Don't have a license key?"
1600
- msgstr ""
1601
-
1602
- #: templates/connect.php:454
1603
- msgid "Have a license key?"
1604
- msgstr ""
1605
-
1606
- #: templates/connect.php:462
1607
- msgid "Privacy Policy"
1608
- msgstr ""
1609
-
1610
- #: templates/connect.php:464
1611
- msgid "License Agreement"
1612
- msgstr ""
1613
-
1614
- #: templates/connect.php:464
1615
- msgid "Terms of Service"
1616
- msgstr ""
1617
-
1618
- #: templates/connect.php:853
1619
- msgctxt "as in the process of sending an email"
1620
- msgid "Sending email"
1621
- msgstr ""
1622
-
1623
- #: templates/connect.php:854
1624
- msgctxt "as activating plugin"
1625
- msgid "Activating"
1626
- msgstr ""
1627
-
1628
- #: templates/contact.php:78
1629
- msgid "Contact"
1630
- msgstr ""
1631
-
1632
- #: templates/debug.php:17
1633
- msgctxt "as turned off"
1634
- msgid "Off"
1635
- msgstr ""
1636
-
1637
- #: templates/debug.php:18
1638
- msgctxt "as turned on"
1639
- msgid "On"
1640
- msgstr ""
1641
-
1642
- #: templates/debug.php:20
1643
- msgid "SDK"
1644
- msgstr ""
1645
-
1646
- #: templates/debug.php:24
1647
- msgctxt "as code debugging"
1648
- msgid "Debugging"
1649
- msgstr ""
1650
-
1651
- #: templates/debug.php:52, templates/debug.php:248, templates/debug.php:374, templates/debug.php:510
1652
- msgid "Actions"
1653
- msgstr ""
1654
-
1655
- #: templates/debug.php:62
1656
- msgid "Are you sure you want to delete all Freemius data?"
1657
- msgstr ""
1658
-
1659
- #: templates/debug.php:62
1660
- msgid "Delete All Accounts"
1661
- msgstr ""
1662
-
1663
- #: templates/debug.php:69
1664
- msgid "Clear API Cache"
1665
- msgstr ""
1666
-
1667
- #: templates/debug.php:77
1668
- msgid "Clear Updates Transients"
1669
- msgstr ""
1670
-
1671
- #: templates/debug.php:84
1672
- msgid "Sync Data From Server"
1673
- msgstr ""
1674
-
1675
- #: templates/debug.php:93
1676
- msgid "Migrate Options to Network"
1677
- msgstr ""
1678
-
1679
- #: templates/debug.php:98
1680
- msgid "Load DB Option"
1681
- msgstr ""
1682
-
1683
- #: templates/debug.php:101
1684
- msgid "Set DB Option"
1685
- msgstr ""
1686
-
1687
- #: templates/debug.php:180
1688
- msgid "Key"
1689
- msgstr ""
1690
-
1691
- #: templates/debug.php:181
1692
- msgid "Value"
1693
- msgstr ""
1694
-
1695
- #: templates/debug.php:197
1696
- msgctxt "as software development kit versions"
1697
- msgid "SDK Versions"
1698
- msgstr ""
1699
-
1700
- #: templates/debug.php:202
1701
- msgid "SDK Path"
1702
- msgstr ""
1703
-
1704
- #: templates/debug.php:203, templates/debug.php:242
1705
- msgid "Module Path"
1706
- msgstr ""
1707
-
1708
- #: templates/debug.php:204
1709
- msgid "Is Active"
1710
- msgstr ""
1711
-
1712
- #: templates/debug.php:232, templates/debug/plugins-themes-sync.php:35
1713
- msgid "Plugins"
1714
- msgstr ""
1715
-
1716
- #: templates/debug.php:232, templates/debug/plugins-themes-sync.php:56
1717
- msgid "Themes"
1718
- msgstr ""
1719
-
1720
- #: templates/debug.php:237, templates/debug.php:368, templates/debug.php:454, templates/debug/scheduled-crons.php:80
1721
- msgid "Slug"
1722
- msgstr ""
1723
-
1724
- #: templates/debug.php:239, templates/debug.php:453
1725
- msgid "Title"
1726
- msgstr ""
1727
-
1728
- #: templates/debug.php:240
1729
- msgctxt "as application program interface"
1730
- msgid "API"
1731
- msgstr ""
1732
-
1733
- #: templates/debug.php:241
1734
- msgid "Freemius State"
1735
- msgstr ""
1736
-
1737
- #: templates/debug.php:245
1738
- msgid "Network Blog"
1739
- msgstr ""
1740
-
1741
- #: templates/debug.php:246
1742
- msgid "Network User"
1743
- msgstr ""
1744
-
1745
- #: templates/debug.php:283
1746
- msgctxt "as connection was successful"
1747
- msgid "Connected"
1748
- msgstr ""
1749
-
1750
- #: templates/debug.php:284
1751
- msgctxt "as connection blocked"
1752
- msgid "Blocked"
1753
- msgstr ""
1754
-
1755
- #: templates/debug.php:320
1756
- msgid "Simulate Trial Promotion"
1757
- msgstr ""
1758
-
1759
- #: templates/debug.php:332
1760
- msgid "Simulate Network Upgrade"
1761
- msgstr ""
1762
-
1763
- #: templates/debug.php:357
1764
- msgid "%s Installs"
1765
- msgstr ""
1766
-
1767
- #: templates/debug.php:359
1768
- msgctxt "like websites"
1769
- msgid "Sites"
1770
- msgstr ""
1771
-
1772
- #: templates/debug.php:365, templates/account/partials/site.php:156
1773
- msgid "Blog ID"
1774
- msgstr ""
1775
-
1776
- #: templates/debug.php:370
1777
- msgid "License ID"
1778
- msgstr ""
1779
-
1780
- #: templates/debug.php:434, templates/debug.php:533, templates/account/partials/addon.php:435
1781
- msgctxt "verb"
1782
- msgid "Delete"
1783
- msgstr ""
1784
-
1785
- #: templates/debug.php:448
1786
- msgid "Add Ons of module %s"
1787
- msgstr ""
1788
-
1789
- #: templates/debug.php:500
1790
- msgid "Users"
1791
- msgstr ""
1792
-
1793
- #: templates/debug.php:507
1794
- msgid "Verified"
1795
- msgstr ""
1796
-
1797
- #: templates/debug.php:549
1798
- msgid "%s Licenses"
1799
- msgstr ""
1800
-
1801
- #: templates/debug.php:554
1802
- msgid "Plugin ID"
1803
- msgstr ""
1804
-
1805
- #: templates/debug.php:556
1806
- msgid "Plan ID"
1807
- msgstr ""
1808
-
1809
- #: templates/debug.php:557
1810
- msgid "Quota"
1811
- msgstr ""
1812
-
1813
- #: templates/debug.php:558
1814
- msgid "Activated"
1815
- msgstr ""
1816
-
1817
- #: templates/debug.php:559
1818
- msgid "Blocking"
1819
- msgstr ""
1820
-
1821
- #: templates/debug.php:560, templates/debug.php:631, templates/debug/logger.php:22
1822
- msgid "Type"
1823
- msgstr ""
1824
-
1825
- #: templates/debug.php:562
1826
- msgctxt "as expiration date"
1827
- msgid "Expiration"
1828
- msgstr ""
1829
-
1830
- #: templates/debug.php:590
1831
- msgid "Debug Log"
1832
- msgstr ""
1833
-
1834
- #: templates/debug.php:594
1835
- msgid "All Types"
1836
- msgstr ""
1837
-
1838
- #: templates/debug.php:601
1839
- msgid "All Requests"
1840
- msgstr ""
1841
-
1842
- #: templates/debug.php:606, templates/debug.php:635, templates/debug/logger.php:25
1843
- msgid "File"
1844
- msgstr ""
1845
-
1846
- #: templates/debug.php:607, templates/debug.php:633, templates/debug/logger.php:23
1847
- msgid "Function"
1848
- msgstr ""
1849
-
1850
- #: templates/debug.php:608
1851
- msgid "Process ID"
1852
- msgstr ""
1853
-
1854
- #: templates/debug.php:609
1855
- msgid "Logger"
1856
- msgstr ""
1857
-
1858
- #: templates/debug.php:610, templates/debug.php:634, templates/debug/logger.php:24
1859
- msgid "Message"
1860
- msgstr ""
1861
-
1862
- #: templates/debug.php:612
1863
- msgid "Filter"
1864
- msgstr ""
1865
-
1866
- #: templates/debug.php:620
1867
- msgid "Download"
1868
- msgstr ""
1869
-
1870
- #: templates/debug.php:636, templates/debug/logger.php:26
1871
- msgid "Timestamp"
1872
- msgstr ""
1873
-
1874
- #: templates/secure-https-header.php:28
1875
- msgid "Secure HTTPS %s page, running from an external domain"
1876
- msgstr ""
1877
-
1878
- #: includes/customizer/class-fs-customizer-support-section.php:55, templates/plugin-info/features.php:43
1879
- msgid "Support"
1880
- msgstr ""
1881
-
1882
- #: includes/debug/class-fs-debug-bar-panel.php:48, templates/debug/api-calls.php:54, templates/debug/logger.php:62
1883
- msgctxt "milliseconds"
1884
- msgid "ms"
1885
- msgstr ""
1886
-
1887
- #: includes/debug/debug-bar-start.php:41
1888
- msgid "Freemius API"
1889
- msgstr ""
1890
-
1891
- #: includes/debug/debug-bar-start.php:42
1892
- msgid "Requests"
1893
- msgstr ""
1894
-
1895
- #: templates/account/billing.php:22
1896
- msgctxt "verb"
1897
- msgid "Update"
1898
- msgstr ""
1899
-
1900
- #: templates/account/billing.php:33
1901
- msgid "Billing"
1902
- msgstr ""
1903
-
1904
- #: templates/account/billing.php:38, templates/account/billing.php:38
1905
- msgid "Business name"
1906
- msgstr ""
1907
-
1908
- #: templates/account/billing.php:39, templates/account/billing.php:39
1909
- msgid "Tax / VAT ID"
1910
- msgstr ""
1911
-
1912
- #: templates/account/billing.php:42, templates/account/billing.php:42, templates/account/billing.php:43, templates/account/billing.php:43
1913
- msgid "Address Line %d"
1914
- msgstr ""
1915
-
1916
- #: templates/account/billing.php:46, templates/account/billing.php:46
1917
- msgid "City"
1918
- msgstr ""
1919
-
1920
- #: templates/account/billing.php:46, templates/account/billing.php:46
1921
- msgid "Town"
1922
- msgstr ""
1923
-
1924
- #: templates/account/billing.php:47, templates/account/billing.php:47
1925
- msgid "ZIP / Postal Code"
1926
- msgstr ""
1927
-
1928
- #: templates/account/billing.php:302
1929
- msgid "Country"
1930
- msgstr ""
1931
-
1932
- #: templates/account/billing.php:304
1933
- msgid "Select Country"
1934
- msgstr ""
1935
-
1936
- #: templates/account/billing.php:311, templates/account/billing.php:312
1937
- msgid "State"
1938
- msgstr ""
1939
-
1940
- #: templates/account/billing.php:311, templates/account/billing.php:312
1941
- msgid "Province"
1942
- msgstr ""
1943
-
1944
- #: templates/account/payments.php:29
1945
- msgid "Payments"
1946
- msgstr ""
1947
-
1948
- #: templates/account/payments.php:36
1949
- msgid "Date"
1950
- msgstr ""
1951
-
1952
- #: templates/account/payments.php:37
1953
- msgid "Amount"
1954
- msgstr ""
1955
-
1956
- #: templates/account/payments.php:38, templates/account/payments.php:50
1957
- msgid "Invoice"
1958
- msgstr ""
1959
-
1960
- #: templates/debug/api-calls.php:56
1961
- msgid "API"
1962
- msgstr ""
1963
-
1964
- #: templates/debug/api-calls.php:68
1965
- msgid "Method"
1966
- msgstr ""
1967
-
1968
- #: templates/debug/api-calls.php:69
1969
- msgid "Code"
1970
- msgstr ""
1971
-
1972
- #: templates/debug/api-calls.php:70
1973
- msgid "Length"
1974
- msgstr ""
1975
-
1976
- #: templates/debug/api-calls.php:71
1977
- msgctxt "as file/folder path"
1978
- msgid "Path"
1979
- msgstr ""
1980
-
1981
- #: templates/debug/api-calls.php:73
1982
- msgid "Body"
1983
- msgstr ""
1984
-
1985
- #: templates/debug/api-calls.php:75
1986
- msgid "Result"
1987
- msgstr ""
1988
-
1989
- #: templates/debug/api-calls.php:76
1990
- msgid "Start"
1991
- msgstr ""
1992
-
1993
- #: templates/debug/api-calls.php:77
1994
- msgid "End"
1995
- msgstr ""
1996
-
1997
- #: templates/debug/logger.php:15
1998
- msgid "Log"
1999
- msgstr ""
2000
-
2001
- #. translators: %s: time period (e.g. In "2 hours")
2002
- #: templates/debug/plugins-themes-sync.php:18, templates/debug/scheduled-crons.php:91
2003
- msgid "In %s"
2004
- msgstr ""
2005
-
2006
- #. translators: %s: time period (e.g. "2 hours" ago)
2007
- #: templates/debug/plugins-themes-sync.php:20, templates/debug/scheduled-crons.php:93
2008
- msgid "%s ago"
2009
- msgstr ""
2010
-
2011
- #: templates/debug/plugins-themes-sync.php:21, templates/debug/scheduled-crons.php:74
2012
- msgctxt "seconds"
2013
- msgid "sec"
2014
- msgstr ""
2015
-
2016
- #: templates/debug/plugins-themes-sync.php:23
2017
- msgid "Plugins & Themes Sync"
2018
- msgstr ""
2019
-
2020
- #: templates/debug/plugins-themes-sync.php:28
2021
- msgid "Total"
2022
- msgstr ""
2023
-
2024
- #: templates/debug/plugins-themes-sync.php:29, templates/debug/scheduled-crons.php:84
2025
- msgid "Last"
2026
- msgstr ""
2027
-
2028
- #: templates/debug/scheduled-crons.php:76
2029
- msgid "Scheduled Crons"
2030
- msgstr ""
2031
-
2032
- #: templates/debug/scheduled-crons.php:81
2033
- msgid "Module"
2034
- msgstr ""
2035
-
2036
- #: templates/debug/scheduled-crons.php:82
2037
- msgid "Module Type"
2038
- msgstr ""
2039
-
2040
- #: templates/debug/scheduled-crons.php:83
2041
- msgid "Cron Type"
2042
- msgstr ""
2043
-
2044
- #: templates/debug/scheduled-crons.php:85
2045
- msgid "Next"
2046
- msgstr ""
2047
-
2048
- #: templates/forms/affiliation.php:82
2049
- msgid "Non-expiring"
2050
- msgstr ""
2051
-
2052
- #: templates/forms/affiliation.php:85
2053
- msgid "Apply to become an affiliate"
2054
- msgstr ""
2055
-
2056
- #: templates/forms/affiliation.php:107
2057
- msgid "Your affiliate application for %s has been accepted! Log in to your affiliate area at: %s."
2058
- msgstr ""
2059
-
2060
- #: templates/forms/affiliation.php:122
2061
- msgid "Thank you for applying for our affiliate program, we'll review your details during the next 14 days and will get back to you with further information."
2062
- msgstr ""
2063
-
2064
- #: templates/forms/affiliation.php:125
2065
- msgid "Your affiliation account was temporarily suspended."
2066
- msgstr ""
2067
-
2068
- #: templates/forms/affiliation.php:128
2069
- msgid "Thank you for applying for our affiliate program, unfortunately, we've decided at this point to reject your application. Please try again in 30 days."
2070
- msgstr ""
2071
-
2072
- #: templates/forms/affiliation.php:131
2073
- msgid "Due to violation of our affiliation terms, we decided to temporarily block your affiliation account. If you have any questions, please contact support."
2074
- msgstr ""
2075
-
2076
- #: templates/forms/affiliation.php:144
2077
- msgid "Like the %s? Become our ambassador and earn cash ;-)"
2078
- msgstr ""
2079
-
2080
- #: templates/forms/affiliation.php:145
2081
- msgid "Refer new customers to our %s and earn %s commission on each successful sale you refer!"
2082
- msgstr ""
2083
-
2084
- #: templates/forms/affiliation.php:148
2085
- msgid "Program Summary"
2086
- msgstr ""
2087
-
2088
- #: templates/forms/affiliation.php:150
2089
- msgid "%s commission when a customer purchases a new license."
2090
- msgstr ""
2091
-
2092
- #: templates/forms/affiliation.php:152
2093
- msgid "Get commission for automated subscription renewals."
2094
- msgstr ""
2095
-
2096
- #: templates/forms/affiliation.php:155
2097
- msgid "%s tracking cookie after the first visit to maximize earnings potential."
2098
- msgstr ""
2099
-
2100
- #: templates/forms/affiliation.php:158
2101
- msgid "Unlimited commissions."
2102
- msgstr ""
2103
-
2104
- #: templates/forms/affiliation.php:160
2105
- msgid "%s minimum payout amount."
2106
- msgstr ""
2107
-
2108
- #: templates/forms/affiliation.php:161
2109
- msgid "Payouts are in USD and processed monthly via PayPal."
2110
- msgstr ""
2111
-
2112
- #: templates/forms/affiliation.php:162
2113
- msgid "As we reserve 30 days for potential refunds, we only pay commissions that are older than 30 days."
2114
- msgstr ""
2115
-
2116
- #: templates/forms/affiliation.php:165
2117
- msgid "Affiliate"
2118
- msgstr ""
2119
-
2120
- #: templates/forms/affiliation.php:168, templates/forms/resend-key.php:23
2121
- msgid "Email address"
2122
- msgstr ""
2123
-
2124
- #: templates/forms/affiliation.php:172
2125
- msgid "Full name"
2126
- msgstr ""
2127
-
2128
- #: templates/forms/affiliation.php:176
2129
- msgid "PayPal account email address"
2130
- msgstr ""
2131
-
2132
- #: templates/forms/affiliation.php:180
2133
- msgid "Where are you going to promote the %s?"
2134
- msgstr ""
2135
-
2136
- #: templates/forms/affiliation.php:182
2137
- msgid "Enter the domain of your website or other websites from where you plan to promote the %s."
2138
- msgstr ""
2139
-
2140
- #: templates/forms/affiliation.php:184
2141
- msgid "Add another domain"
2142
- msgstr ""
2143
-
2144
- #: templates/forms/affiliation.php:188
2145
- msgid "Extra Domains"
2146
- msgstr ""
2147
-
2148
- #: templates/forms/affiliation.php:189
2149
- msgid "Extra domains where you will be marketing the product from."
2150
- msgstr ""
2151
-
2152
- #: templates/forms/affiliation.php:199
2153
- msgid "Promotion methods"
2154
- msgstr ""
2155
-
2156
- #: templates/forms/affiliation.php:202
2157
- msgid "Social media (Facebook, Twitter, etc.)"
2158
- msgstr ""
2159
-
2160
- #: templates/forms/affiliation.php:206
2161
- msgid "Mobile apps"
2162
- msgstr ""
2163
-
2164
- #: templates/forms/affiliation.php:210
2165
- msgid "Website, email, and social media statistics (optional)"
2166
- msgstr ""
2167
-
2168
- #: templates/forms/affiliation.php:213
2169
- msgid "Please feel free to provide any relevant website or social media statistics, e.g. monthly unique site visits, number of email subscribers, followers, etc. (we will keep this information confidential)."
2170
- msgstr ""
2171
-
2172
- #: templates/forms/affiliation.php:217
2173
- msgid "How will you promote us?"
2174
- msgstr ""
2175
-
2176
- #: templates/forms/affiliation.php:220
2177
- msgid "Please provide details on how you intend to promote %s (please be as specific as possible)."
2178
- msgstr ""
2179
-
2180
- #: templates/forms/affiliation.php:230, templates/forms/resend-key.php:22
2181
- msgid "Cancel"
2182
- msgstr ""
2183
-
2184
- #: templates/forms/affiliation.php:232
2185
- msgid "Become an affiliate"
2186
- msgstr ""
2187
-
2188
- #: templates/forms/data-debug-mode.php:25
2189
- msgid "Please enter the license key to enable the debug mode:"
2190
- msgstr ""
2191
-
2192
- #: templates/forms/data-debug-mode.php:27
2193
- msgid "To enter the debug mode, please enter the secret key of the license owner (UserID = %d), which you can find in your \"My Profile\" section of your User Dashboard:"
2194
- msgstr ""
2195
-
2196
- #: templates/forms/data-debug-mode.php:32
2197
- msgid "Submit"
2198
- msgstr ""
2199
-
2200
- #: templates/forms/data-debug-mode.php:36
2201
- msgid "User key"
2202
- msgstr ""
2203
-
2204
- #: templates/forms/license-activation.php:23
2205
- msgid "Please enter the license key that you received in the email right after the purchase:"
2206
- msgstr ""
2207
-
2208
- #: templates/forms/license-activation.php:28
2209
- msgid "Update License"
2210
- msgstr ""
2211
-
2212
- #: templates/forms/license-activation.php:181
2213
- msgid "Associate with the license owner's account."
2214
- msgstr ""
2215
-
2216
- #: templates/forms/optout.php:30
2217
- msgctxt "verb"
2218
- msgid "Opt Out"
2219
- msgstr ""
2220
-
2221
- #: templates/forms/optout.php:31
2222
- msgctxt "verb"
2223
- msgid "Opt In"
2224
- msgstr ""
2225
-
2226
- #: templates/forms/optout.php:34
2227
- msgid "Connectivity to the licensing engine was successfully re-established. Automatic security & feature updates are now available through the WP Admin Dashboard."
2228
- msgstr ""
2229
-
2230
- #: templates/forms/optout.php:36
2231
- msgid "Warning: Opting out will block automatic updates"
2232
- msgstr ""
2233
-
2234
- #: templates/forms/optout.php:37
2235
- msgid "Ongoing connectivity with the licensing engine is essential for receiving automatic security & feature updates of the paid product. To receive these updates, data like your license key, %1$s version, and WordPress version, is periodically sent to the server to check for updates. By opting out, you understand that your site won't receive automatic updates for %2$s from within the WP Admin Dashboard. This can put your site at risk, and we highly recommend to keep this connection active. If you do choose to opt-out, you'll need to check for %1$s updates and install them manually."
2236
- msgstr ""
2237
-
2238
- #: templates/forms/optout.php:39
2239
- msgid "I'd like to keep automatic updates"
2240
- msgstr ""
2241
-
2242
- #: templates/forms/optout.php:44
2243
- msgid "Usage tracking is done in the name of making %s better. Making a better user experience, prioritizing new features, and more good things. We'd really appreciate if you'll reconsider letting us continue with the tracking."
2244
- msgstr ""
2245
-
2246
- #: templates/forms/optout.php:45
2247
- msgid "On second thought - I want to continue helping"
2248
- msgstr ""
2249
-
2250
- #: templates/forms/optout.php:49
2251
- msgid "By clicking \"Opt Out\", we will no longer be sending any data from %s to %s."
2252
- msgstr ""
2253
-
2254
- #: templates/forms/optout.php:74
2255
- msgid "Plugins & themes tracking"
2256
- msgstr ""
2257
-
2258
- #: templates/forms/optout.php:261
2259
- msgid "Saved"
2260
- msgstr ""
2261
-
2262
- #: templates/forms/premium-versions-upgrade-handler.php:40
2263
- msgid "There is a new version of %s available."
2264
- msgstr ""
2265
-
2266
- #: templates/forms/premium-versions-upgrade-handler.php:41
2267
- msgid " %s to access version %s security & feature updates, and support."
2268
- msgstr ""
2269
-
2270
- #: templates/forms/premium-versions-upgrade-handler.php:54
2271
- msgid "New Version Available"
2272
- msgstr ""
2273
-
2274
- #: templates/forms/premium-versions-upgrade-handler.php:75
2275
- msgctxt "close a window"
2276
- msgid "Dismiss"
2277
- msgstr ""
2278
-
2279
- #: templates/forms/resend-key.php:21
2280
- msgid "Send License Key"
2281
- msgstr ""
2282
-
2283
- #: templates/forms/resend-key.php:57
2284
- msgid "Enter the email address you've used for the upgrade below and we will resend you the license key."
2285
- msgstr ""
2286
-
2287
- #: templates/forms/subscription-cancellation.php:37
2288
- msgid "Deactivating or uninstalling the %s will automatically disable the license, which you'll be able to use on another site."
2289
- msgstr ""
2290
-
2291
- #: templates/forms/subscription-cancellation.php:47
2292
- msgid "In case you are NOT planning on using this %s on this site (or any other site) - would you like to cancel the %s as well?"
2293
- msgstr ""
2294
-
2295
- #: templates/forms/subscription-cancellation.php:52
2296
- msgid "license"
2297
- msgstr ""
2298
-
2299
- #: templates/forms/subscription-cancellation.php:57
2300
- msgid "Cancel %s - I no longer need any security & feature updates, nor support for %s because I'm not planning to use the %s on this, or any other site."
2301
- msgstr ""
2302
-
2303
- #: templates/forms/subscription-cancellation.php:68
2304
- msgid "Don't cancel %s - I'm still interested in getting security & feature updates, as well as be able to contact support."
2305
- msgstr ""
2306
-
2307
- #: templates/forms/subscription-cancellation.php:103
2308
- msgid "Once your license expires you will no longer be able to use the %s, unless you activate it again with a valid premium license."
2309
- msgstr ""
2310
-
2311
- #: templates/forms/subscription-cancellation.php:136
2312
- msgid "Cancel %s?"
2313
- msgstr ""
2314
-
2315
- #: templates/forms/subscription-cancellation.php:143
2316
- msgid "Proceed"
2317
- msgstr ""
2318
-
2319
- #: templates/forms/subscription-cancellation.php:191, templates/forms/deactivation/form.php:171
2320
- msgid "Cancel %s & Proceed"
2321
- msgstr ""
2322
-
2323
- #: templates/forms/trial-start.php:22
2324
- msgid "You are 1-click away from starting your %1$s-day free trial of the %2$s plan."
2325
- msgstr ""
2326
-
2327
- #: templates/forms/trial-start.php:28
2328
- msgid "For compliance with the WordPress.org guidelines, before we start the trial we ask that you opt in with your user and non-sensitive site information, allowing the %s to periodically send data to %s to check for version updates and to validate your trial."
2329
- msgstr ""
2330
-
2331
- #: templates/forms/user-change.php:26
2332
- msgid "By changing the user, you agree to transfer the account ownership to:"
2333
- msgstr ""
2334
-
2335
- #: templates/forms/user-change.php:28
2336
- msgid "I Agree - Change User"
2337
- msgstr ""
2338
-
2339
- #: templates/forms/user-change.php:30
2340
- msgid "Enter email address"
2341
- msgstr ""
2342
-
2343
- #: templates/forms/user-change.php:81
2344
- msgctxt "close window"
2345
- msgid "Dismiss"
2346
- msgstr ""
2347
-
2348
- #: templates/js/style-premium-theme.php:39
2349
- msgid "Premium"
2350
- msgstr ""
2351
-
2352
- #: templates/js/style-premium-theme.php:42
2353
- msgid "Beta"
2354
- msgstr ""
2355
-
2356
- #: templates/partials/network-activation.php:27
2357
- msgid "Activate license on all sites in the network."
2358
- msgstr ""
2359
-
2360
- #: templates/partials/network-activation.php:28
2361
- msgid "Apply on all sites in the network."
2362
- msgstr ""
2363
-
2364
- #: templates/partials/network-activation.php:31
2365
- msgid "Activate license on all pending sites."
2366
- msgstr ""
2367
-
2368
- #: templates/partials/network-activation.php:32
2369
- msgid "Apply on all pending sites."
2370
- msgstr ""
2371
-
2372
- #: templates/partials/network-activation.php:40, templates/partials/network-activation.php:74
2373
- msgid "allow"
2374
- msgstr ""
2375
-
2376
- #: templates/partials/network-activation.php:43, templates/partials/network-activation.php:77
2377
- msgid "delegate"
2378
- msgstr ""
2379
-
2380
- #: templates/partials/network-activation.php:47, templates/partials/network-activation.php:81
2381
- msgid "skip"
2382
- msgstr ""
2383
-
2384
- #: templates/plugin-info/description.php:72, templates/plugin-info/screenshots.php:31
2385
- msgid "Click to view full-size screenshot %d"
2386
- msgstr ""
2387
-
2388
- #: templates/plugin-info/features.php:56
2389
- msgid "Unlimited Updates"
2390
- msgstr ""
2391
-
2392
- #: templates/account/partials/activate-license-button.php:46
2393
- msgid "Localhost"
2394
- msgstr ""
2395
-
2396
- #: templates/account/partials/activate-license-button.php:50
2397
- msgctxt "as 5 licenses left"
2398
- msgid "%s left"
2399
- msgstr ""
2400
-
2401
- #: templates/account/partials/activate-license-button.php:51
2402
- msgid "Last license"
2403
- msgstr ""
2404
-
2405
- #. translators: %1$s: Either 'Downgrading your plan' or 'Cancelling the subscription'
2406
- #: templates/account/partials/addon.php:29
2407
- msgid "%1$s will immediately stop all future recurring payments and your %s plan license will expire in %s."
2408
- msgstr ""
2409
-
2410
- #: templates/account/partials/addon.php:185
2411
- msgid "Cancelled"
2412
- msgstr ""
2413
-
2414
- #: templates/account/partials/addon.php:195
2415
- msgid "No expiration"
2416
- msgstr ""
2417
-
2418
- #: templates/account/partials/site.php:189
2419
- msgid "Owner Name"
2420
- msgstr ""
2421
-
2422
- #: templates/account/partials/site.php:201
2423
- msgid "Owner Email"
2424
- msgstr ""
2425
-
2426
- #: templates/account/partials/site.php:213
2427
- msgid "Owner ID"
2428
- msgstr ""
2429
-
2430
- #: templates/account/partials/site.php:286
2431
- msgid "Subscription"
2432
- msgstr ""
2433
-
2434
- #: templates/forms/deactivation/contact.php:19
2435
- msgid "Sorry for the inconvenience and we are here to help if you give us a chance."
2436
- msgstr ""
2437
-
2438
- #: templates/forms/deactivation/contact.php:22
2439
- msgid "Contact Support"
2440
- msgstr ""
2441
-
2442
- #: templates/forms/deactivation/form.php:64
2443
- msgid "Anonymous feedback"
2444
- msgstr ""
2445
-
2446
- #: templates/forms/deactivation/form.php:70
2447
- msgid "Deactivate"
2448
- msgstr ""
2449
-
2450
- #: templates/forms/deactivation/form.php:72
2451
- msgid "Activate %s"
2452
- msgstr ""
2453
-
2454
- #: templates/forms/deactivation/form.php:87
2455
- msgid "Quick Feedback"
2456
- msgstr ""
2457
-
2458
- #: templates/forms/deactivation/form.php:91
2459
- msgid "If you have a moment, please let us know why you are %s"
2460
- msgstr ""
2461
-
2462
- #: templates/forms/deactivation/form.php:91
2463
- msgid "deactivating"
2464
- msgstr ""
2465
-
2466
- #: templates/forms/deactivation/form.php:91
2467
- msgid "switching"
2468
- msgstr ""
2469
-
2470
- #: templates/forms/deactivation/form.php:369
2471
- msgid "Submit & %s"
2472
- msgstr ""
2473
-
2474
- #: templates/forms/deactivation/form.php:390
2475
- msgid "Kindly tell us the reason so we can improve."
2476
- msgstr ""
2477
-
2478
- #: templates/forms/deactivation/form.php:515
2479
- msgid "Yes - %s"
2480
- msgstr ""
2481
-
2482
- #: templates/forms/deactivation/form.php:522
2483
- msgid "Skip & %s"
2484
- msgstr ""
2485
-
2486
- #: templates/forms/deactivation/retry-skip.php:21
2487
- msgid "Click here to use the plugin anonymously"
2488
- msgstr ""
2489
-
2490
- #: templates/forms/deactivation/retry-skip.php:23
2491
- msgid "You might have missed it, but you don't have to share any data and can just %s the opt-in."
2492
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2020 freemius
2
+ # This file is distributed under the same license as the freemius package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: freemius\n"
6
+ "MIME-Version: 1.0\n"
7
+ "Content-Type: text/plain; charset=UTF-8\n"
8
+ "Content-Transfer-Encoding: 8bit\n"
9
+ "Language-Team: Freemius Team <admin@freemius.com>\n"
10
+ "Last-Translator: Vova Feldman <vova@freemius.com>\n"
11
+ "Report-Msgid-Bugs-To: https://github.com/Freemius/wordpress-sdk/issues\n"
12
+ "X-Poedit-Basepath: ..\n"
13
+ "X-Poedit-KeywordsList: get_text_inline;fs_text_inline;fs_echo_inline;fs_esc_js_inline;fs_esc_attr_inline;fs_esc_attr_echo_inline;fs_esc_html_inline;fs_esc_html_echo_inline;get_text_x_inline:1,2c;fs_text_x_inline:1,2c;fs_echo_x_inline:1,2c;fs_esc_attr_x_inline:1,2c;fs_esc_js_x_inline:1,2c;fs_esc_js_echo_x_inline:1,2c;fs_esc_html_x_inline:1,2c;fs_esc_html_echo_x_inline:1,2c\n"
14
+ "X-Poedit-SearchPath-0: .\n"
15
+ "X-Poedit-SearchPathExcluded-0: *.js\n"
16
+ "X-Poedit-SourceCharset: UTF-8\n"
17
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+
19
+ #: includes/class-freemius.php:1912, templates/account.php:910
20
+ msgid "An update to a Beta version will replace your installed version of %s with the latest Beta release - use with caution, and not on production sites. You have been warned."
21
+ msgstr ""
22
+
23
+ #: includes/class-freemius.php:1919
24
+ msgid "Would you like to proceed with the update?"
25
+ msgstr ""
26
+
27
+ #: includes/class-freemius.php:2131
28
+ msgid "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
29
+ msgstr ""
30
+
31
+ #: includes/class-freemius.php:2133
32
+ msgid "Error"
33
+ msgstr ""
34
+
35
+ #: includes/class-freemius.php:2533
36
+ msgid "I found a better %s"
37
+ msgstr ""
38
+
39
+ #: includes/class-freemius.php:2535
40
+ msgid "What's the %s's name?"
41
+ msgstr ""
42
+
43
+ #: includes/class-freemius.php:2541
44
+ msgid "It's a temporary %s. I'm just debugging an issue."
45
+ msgstr ""
46
+
47
+ #: includes/class-freemius.php:2543
48
+ msgid "Deactivation"
49
+ msgstr ""
50
+
51
+ #: includes/class-freemius.php:2544
52
+ msgid "Theme Switch"
53
+ msgstr ""
54
+
55
+ #: includes/class-freemius.php:2553, templates/forms/resend-key.php:24, templates/forms/user-change.php:29
56
+ msgid "Other"
57
+ msgstr ""
58
+
59
+ #: includes/class-freemius.php:2561
60
+ msgid "I no longer need the %s"
61
+ msgstr ""
62
+
63
+ #: includes/class-freemius.php:2568
64
+ msgid "I only needed the %s for a short period"
65
+ msgstr ""
66
+
67
+ #: includes/class-freemius.php:2574
68
+ msgid "The %s broke my site"
69
+ msgstr ""
70
+
71
+ #: includes/class-freemius.php:2581
72
+ msgid "The %s suddenly stopped working"
73
+ msgstr ""
74
+
75
+ #: includes/class-freemius.php:2591
76
+ msgid "I can't pay for it anymore"
77
+ msgstr ""
78
+
79
+ #: includes/class-freemius.php:2593
80
+ msgid "What price would you feel comfortable paying?"
81
+ msgstr ""
82
+
83
+ #: includes/class-freemius.php:2599
84
+ msgid "I don't like to share my information with you"
85
+ msgstr ""
86
+
87
+ #: includes/class-freemius.php:2620
88
+ msgid "The %s didn't work"
89
+ msgstr ""
90
+
91
+ #: includes/class-freemius.php:2630
92
+ msgid "I couldn't understand how to make it work"
93
+ msgstr ""
94
+
95
+ #: includes/class-freemius.php:2638
96
+ msgid "The %s is great, but I need specific feature that you don't support"
97
+ msgstr ""
98
+
99
+ #: includes/class-freemius.php:2640
100
+ msgid "What feature?"
101
+ msgstr ""
102
+
103
+ #: includes/class-freemius.php:2644
104
+ msgid "The %s is not working"
105
+ msgstr ""
106
+
107
+ #: includes/class-freemius.php:2646
108
+ msgid "Kindly share what didn't work so we can fix it for future users..."
109
+ msgstr ""
110
+
111
+ #: includes/class-freemius.php:2650
112
+ msgid "It's not what I was looking for"
113
+ msgstr ""
114
+
115
+ #: includes/class-freemius.php:2652
116
+ msgid "What you've been looking for?"
117
+ msgstr ""
118
+
119
+ #: includes/class-freemius.php:2656
120
+ msgid "The %s didn't work as expected"
121
+ msgstr ""
122
+
123
+ #: includes/class-freemius.php:2658
124
+ msgid "What did you expect?"
125
+ msgstr ""
126
+
127
+ #: includes/class-freemius.php:3513, templates/debug.php:20
128
+ msgid "Freemius Debug"
129
+ msgstr ""
130
+
131
+ #: includes/class-freemius.php:4265
132
+ msgid "I don't know what is cURL or how to install it, help me!"
133
+ msgstr ""
134
+
135
+ #: includes/class-freemius.php:4267
136
+ msgid "We'll make sure to contact your hosting company and resolve the issue. You will get a follow-up email to %s once we have an update."
137
+ msgstr ""
138
+
139
+ #: includes/class-freemius.php:4274
140
+ msgid "Great, please install cURL and enable it in your php.ini file. In addition, search for the 'disable_functions' directive in your php.ini file and remove any disabled methods starting with 'curl_'. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the %s and reactivate it back again."
141
+ msgstr ""
142
+
143
+ #: includes/class-freemius.php:4379
144
+ msgid "Yes - do your thing"
145
+ msgstr ""
146
+
147
+ #: includes/class-freemius.php:4384
148
+ msgid "No - just deactivate"
149
+ msgstr ""
150
+
151
+ #: includes/class-freemius.php:4429, includes/class-freemius.php:4923, includes/class-freemius.php:6182, includes/class-freemius.php:13357, includes/class-freemius.php:14075, includes/class-freemius.php:17526, includes/class-freemius.php:17631, includes/class-freemius.php:17806, includes/class-freemius.php:20040, includes/class-freemius.php:20398, includes/class-freemius.php:20408, includes/class-freemius.php:21079, includes/class-freemius.php:21985, includes/class-freemius.php:22118, includes/class-freemius.php:22274, templates/add-ons.php:57
152
+ msgctxt "exclamation"
153
+ msgid "Oops"
154
+ msgstr ""
155
+
156
+ #: includes/class-freemius.php:4498
157
+ msgid "Thank for giving us the chance to fix it! A message was just sent to our technical staff. We will get back to you as soon as we have an update to %s. Appreciate your patience."
158
+ msgstr ""
159
+
160
+ #: includes/class-freemius.php:4920
161
+ msgctxt "addonX cannot run without pluginY"
162
+ msgid "%s cannot run without %s."
163
+ msgstr ""
164
+
165
+ #: includes/class-freemius.php:4921
166
+ msgctxt "addonX cannot run..."
167
+ msgid "%s cannot run without the plugin."
168
+ msgstr ""
169
+
170
+ #: includes/class-freemius.php:5120, includes/class-freemius.php:5145, includes/class-freemius.php:21150
171
+ msgid "Unexpected API error. Please contact the %s's author with the following error."
172
+ msgstr ""
173
+
174
+ #: includes/class-freemius.php:5848
175
+ msgid "Premium %s version was successfully activated."
176
+ msgstr ""
177
+
178
+ #: includes/class-freemius.php:5860, includes/class-freemius.php:7762
179
+ msgctxt "Used to express elation, enthusiasm, or triumph (especially in electronic communication)."
180
+ msgid "W00t"
181
+ msgstr ""
182
+
183
+ #: includes/class-freemius.php:5875
184
+ msgid "You have a %s license."
185
+ msgstr ""
186
+
187
+ #: includes/class-freemius.php:5879, includes/class-freemius.php:16925, includes/class-freemius.php:16936, includes/class-freemius.php:20309, includes/class-freemius.php:20659, includes/class-freemius.php:20728, includes/class-freemius.php:20900
188
+ msgctxt "interjection expressing joy or exuberance"
189
+ msgid "Yee-haw"
190
+ msgstr ""
191
+
192
+ #: includes/class-freemius.php:6165
193
+ msgid "%s free trial was successfully cancelled. Since the add-on is premium only it was automatically deactivated. If you like to use it in the future, you'll have to purchase a license."
194
+ msgstr ""
195
+
196
+ #: includes/class-freemius.php:6169
197
+ msgid "%s is a premium only add-on. You have to purchase a license first before activating the plugin."
198
+ msgstr ""
199
+
200
+ #: includes/class-freemius.php:6178, templates/add-ons.php:186, templates/account/partials/addon.php:381
201
+ msgid "More information about %s"
202
+ msgstr ""
203
+
204
+ #: includes/class-freemius.php:6179
205
+ msgid "Purchase License"
206
+ msgstr ""
207
+
208
+ #: includes/class-freemius.php:7118, templates/connect.php:171
209
+ msgid "You should receive an activation email for %s to your mailbox at %s. Please make sure you click the activation button in that email to %s."
210
+ msgstr ""
211
+
212
+ #: includes/class-freemius.php:7122
213
+ msgid "start the trial"
214
+ msgstr ""
215
+
216
+ #: includes/class-freemius.php:7123, templates/connect.php:175
217
+ msgid "complete the install"
218
+ msgstr ""
219
+
220
+ #: includes/class-freemius.php:7241
221
+ msgid "You are just one step away - %s"
222
+ msgstr ""
223
+
224
+ #: includes/class-freemius.php:7244
225
+ msgctxt "%s - plugin name. As complete \"PluginX\" activation now"
226
+ msgid "Complete \"%s\" Activation Now"
227
+ msgstr ""
228
+
229
+ #: includes/class-freemius.php:7322
230
+ msgid "We made a few tweaks to the %s, %s"
231
+ msgstr ""
232
+
233
+ #: includes/class-freemius.php:7326
234
+ msgid "Opt in to make \"%s\" better!"
235
+ msgstr ""
236
+
237
+ #: includes/class-freemius.php:7761
238
+ msgid "The upgrade of %s was successfully completed."
239
+ msgstr ""
240
+
241
+ #: includes/class-freemius.php:10243, includes/class-fs-plugin-updater.php:1099, includes/class-fs-plugin-updater.php:1294, includes/class-fs-plugin-updater.php:1301, templates/auto-installation.php:32
242
+ msgid "Add-On"
243
+ msgstr ""
244
+
245
+ #: includes/class-freemius.php:10245, templates/account.php:392, templates/account.php:400, templates/debug.php:358, templates/debug.php:549
246
+ msgid "Plugin"
247
+ msgstr ""
248
+
249
+ #: includes/class-freemius.php:10246, templates/account.php:393, templates/account.php:401, templates/debug.php:358, templates/debug.php:549, templates/forms/deactivation/form.php:71
250
+ msgid "Theme"
251
+ msgstr ""
252
+
253
+ #: includes/class-freemius.php:13176
254
+ msgid "An unknown error has occurred while trying to toggle the license's white-label mode."
255
+ msgstr ""
256
+
257
+ #: includes/class-freemius.php:13190
258
+ msgid "Your %s license was flagged as white-labeled to hide sensitive information from the WP Admin (e.g. your email, license key, prices, billing address & invoices). If you ever wish to revert it back, you can easily do it through your %s. If this was a mistake you can also %s."
259
+ msgstr ""
260
+
261
+ #: includes/class-freemius.php:13195
262
+ msgid "User Dashboard"
263
+ msgstr ""
264
+
265
+ #: includes/class-freemius.php:13196
266
+ msgid "revert it now"
267
+ msgstr ""
268
+
269
+ #: includes/class-freemius.php:13255
270
+ msgid "An unknown error has occurred while trying to set the user's beta mode."
271
+ msgstr ""
272
+
273
+ #: includes/class-freemius.php:13328
274
+ msgid "Invalid new user ID or email address."
275
+ msgstr ""
276
+
277
+ #: includes/class-freemius.php:13358, includes/class-freemius.php:22229
278
+ msgid "Sorry, we could not complete the email update. Another user with the same email is already registered."
279
+ msgstr ""
280
+
281
+ #: includes/class-freemius.php:13359, includes/class-freemius.php:22230
282
+ msgid "If you would like to give up the ownership of the %s's account to %s click the Change Ownership button."
283
+ msgstr ""
284
+
285
+ #: includes/class-freemius.php:13366, includes/class-freemius.php:22237
286
+ msgid "Change Ownership"
287
+ msgstr ""
288
+
289
+ #: includes/class-freemius.php:13942
290
+ msgid "Invalid site details collection."
291
+ msgstr ""
292
+
293
+ #: includes/class-freemius.php:14062
294
+ msgid "We couldn't find your email address in the system, are you sure it's the right address?"
295
+ msgstr ""
296
+
297
+ #: includes/class-freemius.php:14064
298
+ msgid "We can't see any active licenses associated with that email address, are you sure it's the right address?"
299
+ msgstr ""
300
+
301
+ #: includes/class-freemius.php:14338
302
+ msgid "Account is pending activation."
303
+ msgstr ""
304
+
305
+ #: includes/class-freemius.php:14450, templates/forms/premium-versions-upgrade-handler.php:47
306
+ msgid "Buy a license now"
307
+ msgstr ""
308
+
309
+ #: includes/class-freemius.php:14462, templates/forms/premium-versions-upgrade-handler.php:46
310
+ msgid "Renew your license now"
311
+ msgstr ""
312
+
313
+ #: includes/class-freemius.php:14466
314
+ msgid "%s to access version %s security & feature updates, and support."
315
+ msgstr ""
316
+
317
+ #: includes/class-freemius.php:16907
318
+ msgid "%s activation was successfully completed."
319
+ msgstr ""
320
+
321
+ #: includes/class-freemius.php:16921
322
+ msgid "Your account was successfully activated with the %s plan."
323
+ msgstr ""
324
+
325
+ #: includes/class-freemius.php:16932, includes/class-freemius.php:20724
326
+ msgid "Your trial has been successfully started."
327
+ msgstr ""
328
+
329
+ #: includes/class-freemius.php:17524, includes/class-freemius.php:17629, includes/class-freemius.php:17804
330
+ msgid "Couldn't activate %s."
331
+ msgstr ""
332
+
333
+ #: includes/class-freemius.php:17525, includes/class-freemius.php:17630, includes/class-freemius.php:17805
334
+ msgid "Please contact us with the following message:"
335
+ msgstr ""
336
+
337
+ #: includes/class-freemius.php:17626, templates/forms/data-debug-mode.php:162
338
+ msgid "An unknown error has occurred."
339
+ msgstr ""
340
+
341
+ #: includes/class-freemius.php:18162, includes/class-freemius.php:23310
342
+ msgid "Upgrade"
343
+ msgstr ""
344
+
345
+ #: includes/class-freemius.php:18168
346
+ msgid "Start Trial"
347
+ msgstr ""
348
+
349
+ #: includes/class-freemius.php:18170
350
+ msgid "Pricing"
351
+ msgstr ""
352
+
353
+ #: includes/class-freemius.php:18250, includes/class-freemius.php:18252
354
+ msgid "Affiliation"
355
+ msgstr ""
356
+
357
+ #: includes/class-freemius.php:18280, includes/class-freemius.php:18282, templates/account.php:240, templates/debug.php:324
358
+ msgid "Account"
359
+ msgstr ""
360
+
361
+ #: includes/class-freemius.php:18296, includes/class-freemius.php:18298, includes/customizer/class-fs-customizer-support-section.php:60
362
+ msgid "Contact Us"
363
+ msgstr ""
364
+
365
+ #: includes/class-freemius.php:18309, includes/class-freemius.php:18311, includes/class-freemius.php:23324, templates/account.php:119, templates/account/partials/addon.php:44
366
+ msgid "Add-Ons"
367
+ msgstr ""
368
+
369
+ #: includes/class-freemius.php:18345
370
+ msgctxt "ASCII arrow left icon"
371
+ msgid "&#x2190;"
372
+ msgstr ""
373
+
374
+ #: includes/class-freemius.php:18345
375
+ msgctxt "ASCII arrow right icon"
376
+ msgid "&#x27a4;"
377
+ msgstr ""
378
+
379
+ #: includes/class-freemius.php:18347, templates/pricing.php:109
380
+ msgctxt "noun"
381
+ msgid "Pricing"
382
+ msgstr ""
383
+
384
+ #: includes/class-freemius.php:18560, includes/customizer/class-fs-customizer-support-section.php:67
385
+ msgid "Support Forum"
386
+ msgstr ""
387
+
388
+ #: includes/class-freemius.php:19534
389
+ msgid "Your email has been successfully verified - you are AWESOME!"
390
+ msgstr ""
391
+
392
+ #: includes/class-freemius.php:19535
393
+ msgctxt "a positive response"
394
+ msgid "Right on"
395
+ msgstr ""
396
+
397
+ #: includes/class-freemius.php:20041
398
+ msgid "seems like the key you entered doesn't match our records."
399
+ msgstr ""
400
+
401
+ #: includes/class-freemius.php:20065
402
+ msgid "Debug mode was successfully enabled and will be automatically disabled in 60 min. You can also disable it earlier by clicking the \"Stop Debug\" link."
403
+ msgstr ""
404
+
405
+ #: includes/class-freemius.php:20300
406
+ msgid "Your %s Add-on plan was successfully upgraded."
407
+ msgstr ""
408
+
409
+ #: includes/class-freemius.php:20302
410
+ msgid "%s Add-on was successfully purchased."
411
+ msgstr ""
412
+
413
+ #: includes/class-freemius.php:20305
414
+ msgid "Download the latest version"
415
+ msgstr ""
416
+
417
+ #: includes/class-freemius.php:20391
418
+ msgid "Your server is blocking the access to Freemius' API, which is crucial for %1$s synchronization. Please contact your host to whitelist %2$s"
419
+ msgstr ""
420
+
421
+ #: includes/class-freemius.php:20397, includes/class-freemius.php:20407, includes/class-freemius.php:20859, includes/class-freemius.php:20948
422
+ msgid "Error received from the server:"
423
+ msgstr ""
424
+
425
+ #: includes/class-freemius.php:20407
426
+ msgid "It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again."
427
+ msgstr ""
428
+
429
+ #: includes/class-freemius.php:20621, includes/class-freemius.php:20864, includes/class-freemius.php:20919, includes/class-freemius.php:21026
430
+ msgctxt "something somebody says when they are thinking about what you have just said."
431
+ msgid "Hmm"
432
+ msgstr ""
433
+
434
+ #: includes/class-freemius.php:20634
435
+ msgid "It looks like you are still on the %s plan. If you did upgrade or change your plan, it's probably an issue on our side - sorry."
436
+ msgstr ""
437
+
438
+ #: includes/class-freemius.php:20635, templates/account.php:121, templates/add-ons.php:250, templates/account/partials/addon.php:46
439
+ msgctxt "trial period"
440
+ msgid "Trial"
441
+ msgstr ""
442
+
443
+ #: includes/class-freemius.php:20640
444
+ msgid "I have upgraded my account but when I try to Sync the License, the plan remains %s."
445
+ msgstr ""
446
+
447
+ #: includes/class-freemius.php:20644, includes/class-freemius.php:20703
448
+ msgid "Please contact us here"
449
+ msgstr ""
450
+
451
+ #: includes/class-freemius.php:20655
452
+ msgid "Your plan was successfully activated."
453
+ msgstr ""
454
+
455
+ #: includes/class-freemius.php:20656
456
+ msgid "Your plan was successfully upgraded."
457
+ msgstr ""
458
+
459
+ #: includes/class-freemius.php:20673
460
+ msgid "Your plan was successfully changed to %s."
461
+ msgstr ""
462
+
463
+ #: includes/class-freemius.php:20689
464
+ msgid "Your license has expired. You can still continue using the free %s forever."
465
+ msgstr ""
466
+
467
+ #: includes/class-freemius.php:20691
468
+ msgid "Your license has expired. %1$sUpgrade now%2$s to continue using the %3$s without interruptions."
469
+ msgstr ""
470
+
471
+ #: includes/class-freemius.php:20699
472
+ msgid "Your license has been cancelled. If you think it's a mistake, please contact support."
473
+ msgstr ""
474
+
475
+ #: includes/class-freemius.php:20712
476
+ msgid "Your license has expired. You can still continue using all the %s features, but you'll need to renew your license to continue getting updates and support."
477
+ msgstr ""
478
+
479
+ #: includes/class-freemius.php:20738
480
+ msgid "Your free trial has expired. You can still continue using all our free features."
481
+ msgstr ""
482
+
483
+ #: includes/class-freemius.php:20740
484
+ msgid "Your free trial has expired. %1$sUpgrade now%2$s to continue using the %3$s without interruptions."
485
+ msgstr ""
486
+
487
+ #: includes/class-freemius.php:20855
488
+ msgid "It looks like the license could not be activated."
489
+ msgstr ""
490
+
491
+ #: includes/class-freemius.php:20897
492
+ msgid "Your license was successfully activated."
493
+ msgstr ""
494
+
495
+ #: includes/class-freemius.php:20923
496
+ msgid "It looks like your site currently doesn't have an active license."
497
+ msgstr ""
498
+
499
+ #: includes/class-freemius.php:20947
500
+ msgid "It looks like the license deactivation failed."
501
+ msgstr ""
502
+
503
+ #: includes/class-freemius.php:20976
504
+ msgid "Your %s license was successfully deactivated."
505
+ msgstr ""
506
+
507
+ #: includes/class-freemius.php:20977
508
+ msgid "Your license was successfully deactivated, you are back to the %s plan."
509
+ msgstr ""
510
+
511
+ #: includes/class-freemius.php:20980
512
+ msgid "O.K"
513
+ msgstr ""
514
+
515
+ #: includes/class-freemius.php:21033
516
+ msgid "Seems like we are having some temporary issue with your subscription cancellation. Please try again in few minutes."
517
+ msgstr ""
518
+
519
+ #: includes/class-freemius.php:21042
520
+ msgid "Your subscription was successfully cancelled. Your %s plan license will expire in %s."
521
+ msgstr ""
522
+
523
+ #: includes/class-freemius.php:21084
524
+ msgid "You are already running the %s in a trial mode."
525
+ msgstr ""
526
+
527
+ #: includes/class-freemius.php:21095
528
+ msgid "You already utilized a trial before."
529
+ msgstr ""
530
+
531
+ #: includes/class-freemius.php:21109
532
+ msgid "Plan %s do not exist, therefore, can't start a trial."
533
+ msgstr ""
534
+
535
+ #: includes/class-freemius.php:21120
536
+ msgid "Plan %s does not support a trial period."
537
+ msgstr ""
538
+
539
+ #: includes/class-freemius.php:21131
540
+ msgid "None of the %s's plans supports a trial period."
541
+ msgstr ""
542
+
543
+ #: includes/class-freemius.php:21181
544
+ msgid "It looks like you are not in trial mode anymore so there's nothing to cancel :)"
545
+ msgstr ""
546
+
547
+ #: includes/class-freemius.php:21217
548
+ msgid "Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes."
549
+ msgstr ""
550
+
551
+ #: includes/class-freemius.php:21236
552
+ msgid "Your %s free trial was successfully cancelled."
553
+ msgstr ""
554
+
555
+ #: includes/class-freemius.php:21552
556
+ msgid "Version %s was released."
557
+ msgstr ""
558
+
559
+ #: includes/class-freemius.php:21552
560
+ msgid "Please download %s."
561
+ msgstr ""
562
+
563
+ #: includes/class-freemius.php:21559
564
+ msgid "the latest %s version here"
565
+ msgstr ""
566
+
567
+ #: includes/class-freemius.php:21564
568
+ msgid "New"
569
+ msgstr ""
570
+
571
+ #: includes/class-freemius.php:21569
572
+ msgid "Seems like you got the latest release."
573
+ msgstr ""
574
+
575
+ #: includes/class-freemius.php:21570
576
+ msgid "You are all good!"
577
+ msgstr ""
578
+
579
+ #: includes/class-freemius.php:21873
580
+ msgid "Verification mail was just sent to %s. If you can't find it after 5 min, please check your spam box."
581
+ msgstr ""
582
+
583
+ #: includes/class-freemius.php:22013
584
+ msgid "Site successfully opted in."
585
+ msgstr ""
586
+
587
+ #: includes/class-freemius.php:22014, includes/class-freemius.php:23020
588
+ msgid "Awesome"
589
+ msgstr ""
590
+
591
+ #: includes/class-freemius.php:22030, templates/forms/optout.php:41
592
+ msgid "We appreciate your help in making the %s better by letting us track some usage data."
593
+ msgstr ""
594
+
595
+ #: includes/class-freemius.php:22031
596
+ msgid "Thank you!"
597
+ msgstr ""
598
+
599
+ #: includes/class-freemius.php:22038
600
+ msgid "We will no longer be sending any usage data of %s on %s to %s."
601
+ msgstr ""
602
+
603
+ #: includes/class-freemius.php:22196
604
+ msgid "Please check your mailbox, you should receive an email via %s to confirm the ownership change. From security reasons, you must confirm the change within the next 15 min. If you cannot find the email, please check your spam folder."
605
+ msgstr ""
606
+
607
+ #: includes/class-freemius.php:22202
608
+ msgid "Thanks for confirming the ownership change. An email was just sent to %s for final approval."
609
+ msgstr ""
610
+
611
+ #: includes/class-freemius.php:22207
612
+ msgid "%s is the new owner of the account."
613
+ msgstr ""
614
+
615
+ #: includes/class-freemius.php:22209
616
+ msgctxt "as congratulations"
617
+ msgid "Congrats"
618
+ msgstr ""
619
+
620
+ #: includes/class-freemius.php:22245
621
+ msgid "Your email was successfully updated. You should receive an email with confirmation instructions in few moments."
622
+ msgstr ""
623
+
624
+ #: includes/class-freemius.php:22257
625
+ msgid "Please provide your full name."
626
+ msgstr ""
627
+
628
+ #: includes/class-freemius.php:22262
629
+ msgid "Your name was successfully updated."
630
+ msgstr ""
631
+
632
+ #: includes/class-freemius.php:22323
633
+ msgid "You have successfully updated your %s."
634
+ msgstr ""
635
+
636
+ #: includes/class-freemius.php:22382
637
+ msgid "Is this your client's site? %s if you wish to hide sensitive info like your email, license key, prices, billing address & invoices from the WP Admin."
638
+ msgstr ""
639
+
640
+ #: includes/class-freemius.php:22385
641
+ msgid "Click here"
642
+ msgstr ""
643
+
644
+ #: includes/class-freemius.php:22483
645
+ msgid "Just letting you know that the add-ons information of %s is being pulled from an external server."
646
+ msgstr ""
647
+
648
+ #: includes/class-freemius.php:22484
649
+ msgctxt "advance notice of something that will need attention."
650
+ msgid "Heads up"
651
+ msgstr ""
652
+
653
+ #: includes/class-freemius.php:23060
654
+ msgctxt "exclamation"
655
+ msgid "Hey"
656
+ msgstr ""
657
+
658
+ #: includes/class-freemius.php:23060
659
+ msgid "How do you like %s so far? Test all our %s premium features with a %d-day free trial."
660
+ msgstr ""
661
+
662
+ #: includes/class-freemius.php:23068
663
+ msgid "No commitment for %s days - cancel anytime!"
664
+ msgstr ""
665
+
666
+ #: includes/class-freemius.php:23069
667
+ msgid "No credit card required"
668
+ msgstr ""
669
+
670
+ #: includes/class-freemius.php:23076, templates/forms/trial-start.php:53
671
+ msgctxt "call to action"
672
+ msgid "Start free trial"
673
+ msgstr ""
674
+
675
+ #: includes/class-freemius.php:23153
676
+ msgid "Hey there, did you know that %s has an affiliate program? If you like the %s you can become our ambassador and earn some cash!"
677
+ msgstr ""
678
+
679
+ #: includes/class-freemius.php:23162
680
+ msgid "Learn more"
681
+ msgstr ""
682
+
683
+ #: includes/class-freemius.php:23348, templates/account.php:556, templates/account.php:706, templates/connect.php:179, templates/connect.php:456, templates/forms/license-activation.php:27, templates/account/partials/addon.php:321
684
+ msgid "Activate License"
685
+ msgstr ""
686
+
687
+ #: includes/class-freemius.php:23349, templates/account.php:650, templates/account.php:705, templates/account/partials/addon.php:322, templates/account/partials/site.php:271
688
+ msgid "Change License"
689
+ msgstr ""
690
+
691
+ #: includes/class-freemius.php:23462, templates/account/partials/site.php:169
692
+ msgid "Opt Out"
693
+ msgstr ""
694
+
695
+ #: includes/class-freemius.php:23464, includes/class-freemius.php:23470, templates/account/partials/site.php:49, templates/account/partials/site.php:169
696
+ msgid "Opt In"
697
+ msgstr ""
698
+
699
+ #: includes/class-freemius.php:23700
700
+ msgid " The paid version of %1$s is already installed. Please activate it to start benefiting the %2$s features. %3$s"
701
+ msgstr ""
702
+
703
+ #: includes/class-freemius.php:23708
704
+ msgid "Activate %s features"
705
+ msgstr ""
706
+
707
+ #: includes/class-freemius.php:23721
708
+ msgid "Please follow these steps to complete the upgrade"
709
+ msgstr ""
710
+
711
+ #: includes/class-freemius.php:23725
712
+ msgid "Download the latest %s version"
713
+ msgstr ""
714
+
715
+ #: includes/class-freemius.php:23729
716
+ msgid "Upload and activate the downloaded version"
717
+ msgstr ""
718
+
719
+ #: includes/class-freemius.php:23731
720
+ msgid "How to upload and activate?"
721
+ msgstr ""
722
+
723
+ #: includes/class-freemius.php:23865
724
+ msgid "%sClick here%s to choose the sites where you'd like to activate the license on."
725
+ msgstr ""
726
+
727
+ #: includes/class-freemius.php:24034
728
+ msgid "Auto installation only works for opted-in users."
729
+ msgstr ""
730
+
731
+ #: includes/class-freemius.php:24044, includes/class-freemius.php:24077, includes/class-fs-plugin-updater.php:1273, includes/class-fs-plugin-updater.php:1287
732
+ msgid "Invalid module ID."
733
+ msgstr ""
734
+
735
+ #: includes/class-freemius.php:24053, includes/class-fs-plugin-updater.php:1309
736
+ msgid "Premium version already active."
737
+ msgstr ""
738
+
739
+ #: includes/class-freemius.php:24060
740
+ msgid "You do not have a valid license to access the premium version."
741
+ msgstr ""
742
+
743
+ #: includes/class-freemius.php:24067
744
+ msgid "Plugin is a \"Serviceware\" which means it does not have a premium code version."
745
+ msgstr ""
746
+
747
+ #: includes/class-freemius.php:24085, includes/class-fs-plugin-updater.php:1308
748
+ msgid "Premium add-on version already installed."
749
+ msgstr ""
750
+
751
+ #: includes/class-freemius.php:24435
752
+ msgid "View paid features"
753
+ msgstr ""
754
+
755
+ #: includes/class-freemius.php:24757
756
+ msgid "Thank you so much for using %s and its add-ons!"
757
+ msgstr ""
758
+
759
+ #: includes/class-freemius.php:24758
760
+ msgid "Thank you so much for using %s!"
761
+ msgstr ""
762
+
763
+ #: includes/class-freemius.php:24764
764
+ msgid "You've already opted-in to our usage-tracking, which helps us keep improving the %s."
765
+ msgstr ""
766
+
767
+ #: includes/class-freemius.php:24768
768
+ msgid "Thank you so much for using our products!"
769
+ msgstr ""
770
+
771
+ #: includes/class-freemius.php:24769
772
+ msgid "You've already opted-in to our usage-tracking, which helps us keep improving them."
773
+ msgstr ""
774
+
775
+ #: includes/class-freemius.php:24788
776
+ msgid "%s and its add-ons"
777
+ msgstr ""
778
+
779
+ #: includes/class-freemius.php:24797
780
+ msgid "Products"
781
+ msgstr ""
782
+
783
+ #: includes/class-freemius.php:24804, templates/connect.php:280
784
+ msgid "Yes"
785
+ msgstr ""
786
+
787
+ #: includes/class-freemius.php:24805, templates/connect.php:281
788
+ msgid "send me security & feature updates, educational content and offers."
789
+ msgstr ""
790
+
791
+ #: includes/class-freemius.php:24806, templates/connect.php:286
792
+ msgid "No"
793
+ msgstr ""
794
+
795
+ #: includes/class-freemius.php:24808, templates/connect.php:288
796
+ msgid "do %sNOT%s send me security & feature updates, educational content and offers."
797
+ msgstr ""
798
+
799
+ #: includes/class-freemius.php:24818
800
+ msgid "Due to the new %sEU General Data Protection Regulation (GDPR)%s compliance requirements it is required that you provide your explicit consent, again, confirming that you are onboard :-)"
801
+ msgstr ""
802
+
803
+ #: includes/class-freemius.php:24820, templates/connect.php:295
804
+ msgid "Please let us know if you'd like us to contact you for security & feature updates, educational content, and occasional offers:"
805
+ msgstr ""
806
+
807
+ #: includes/class-freemius.php:25102
808
+ msgid "License key is empty."
809
+ msgstr ""
810
+
811
+ #: includes/class-fs-plugin-updater.php:206, templates/forms/premium-versions-upgrade-handler.php:57
812
+ msgid "Renew license"
813
+ msgstr ""
814
+
815
+ #: includes/class-fs-plugin-updater.php:211, templates/forms/premium-versions-upgrade-handler.php:58
816
+ msgid "Buy license"
817
+ msgstr ""
818
+
819
+ #: includes/class-fs-plugin-updater.php:327, includes/class-fs-plugin-updater.php:360
820
+ msgid "There is a %s of %s available."
821
+ msgstr ""
822
+
823
+ #: includes/class-fs-plugin-updater.php:329, includes/class-fs-plugin-updater.php:365
824
+ msgid "new Beta version"
825
+ msgstr ""
826
+
827
+ #: includes/class-fs-plugin-updater.php:330, includes/class-fs-plugin-updater.php:366
828
+ msgid "new version"
829
+ msgstr ""
830
+
831
+ #: includes/class-fs-plugin-updater.php:389
832
+ msgid "Important Upgrade Notice:"
833
+ msgstr ""
834
+
835
+ #: includes/class-fs-plugin-updater.php:1338
836
+ msgid "Installing plugin: %s"
837
+ msgstr ""
838
+
839
+ #: includes/class-fs-plugin-updater.php:1379
840
+ msgid "Unable to connect to the filesystem. Please confirm your credentials."
841
+ msgstr ""
842
+
843
+ #: includes/class-fs-plugin-updater.php:1561
844
+ msgid "The remote plugin package does not contain a folder with the desired slug and renaming did not work."
845
+ msgstr ""
846
+
847
+ #: includes/fs-plugin-info-dialog.php:541
848
+ msgid "Purchase More"
849
+ msgstr ""
850
+
851
+ #: includes/fs-plugin-info-dialog.php:542, templates/account/partials/addon.php:385
852
+ msgctxt "verb"
853
+ msgid "Purchase"
854
+ msgstr ""
855
+
856
+ #: includes/fs-plugin-info-dialog.php:546
857
+ msgid "Start my free %s"
858
+ msgstr ""
859
+
860
+ #: includes/fs-plugin-info-dialog.php:744
861
+ msgid "Install Free Version Update Now"
862
+ msgstr ""
863
+
864
+ #: includes/fs-plugin-info-dialog.php:745, templates/account.php:639
865
+ msgid "Install Update Now"
866
+ msgstr ""
867
+
868
+ #: includes/fs-plugin-info-dialog.php:754
869
+ msgid "Install Free Version Now"
870
+ msgstr ""
871
+
872
+ #: includes/fs-plugin-info-dialog.php:755, templates/add-ons.php:323, templates/auto-installation.php:111, templates/account/partials/addon.php:365, templates/account/partials/addon.php:418
873
+ msgid "Install Now"
874
+ msgstr ""
875
+
876
+ #: includes/fs-plugin-info-dialog.php:771
877
+ msgctxt "as download latest version"
878
+ msgid "Download Latest Free Version"
879
+ msgstr ""
880
+
881
+ #: includes/fs-plugin-info-dialog.php:772, templates/account.php:99, templates/add-ons.php:37, templates/account/partials/addon.php:25
882
+ msgctxt "as download latest version"
883
+ msgid "Download Latest"
884
+ msgstr ""
885
+
886
+ #: includes/fs-plugin-info-dialog.php:787, templates/add-ons.php:329, templates/account/partials/addon.php:356, templates/account/partials/addon.php:412
887
+ msgid "Activate this add-on"
888
+ msgstr ""
889
+
890
+ #: includes/fs-plugin-info-dialog.php:789, templates/connect.php:453
891
+ msgid "Activate Free Version"
892
+ msgstr ""
893
+
894
+ #: includes/fs-plugin-info-dialog.php:790, templates/account.php:123, templates/add-ons.php:330, templates/account/partials/addon.php:48
895
+ msgid "Activate"
896
+ msgstr ""
897
+
898
+ #: includes/fs-plugin-info-dialog.php:1002
899
+ msgctxt "Plugin installer section title"
900
+ msgid "Description"
901
+ msgstr ""
902
+
903
+ #: includes/fs-plugin-info-dialog.php:1003
904
+ msgctxt "Plugin installer section title"
905
+ msgid "Installation"
906
+ msgstr ""
907
+
908
+ #: includes/fs-plugin-info-dialog.php:1004
909
+ msgctxt "Plugin installer section title"
910
+ msgid "FAQ"
911
+ msgstr ""
912
+
913
+ #: includes/fs-plugin-info-dialog.php:1005, templates/plugin-info/description.php:55
914
+ msgid "Screenshots"
915
+ msgstr ""
916
+
917
+ #: includes/fs-plugin-info-dialog.php:1006
918
+ msgctxt "Plugin installer section title"
919
+ msgid "Changelog"
920
+ msgstr ""
921
+
922
+ #: includes/fs-plugin-info-dialog.php:1007
923
+ msgctxt "Plugin installer section title"
924
+ msgid "Reviews"
925
+ msgstr ""
926
+
927
+ #: includes/fs-plugin-info-dialog.php:1008
928
+ msgctxt "Plugin installer section title"
929
+ msgid "Other Notes"
930
+ msgstr ""
931
+
932
+ #: includes/fs-plugin-info-dialog.php:1023
933
+ msgctxt "Plugin installer section title"
934
+ msgid "Features & Pricing"
935
+ msgstr ""
936
+
937
+ #: includes/fs-plugin-info-dialog.php:1033
938
+ msgid "Plugin Install"
939
+ msgstr ""
940
+
941
+ #: includes/fs-plugin-info-dialog.php:1105
942
+ msgctxt "e.g. Professional Plan"
943
+ msgid "%s Plan"
944
+ msgstr ""
945
+
946
+ #: includes/fs-plugin-info-dialog.php:1131
947
+ msgctxt "e.g. the best product"
948
+ msgid "Best"
949
+ msgstr ""
950
+
951
+ #: includes/fs-plugin-info-dialog.php:1137, includes/fs-plugin-info-dialog.php:1157
952
+ msgctxt "as every month"
953
+ msgid "Monthly"
954
+ msgstr ""
955
+
956
+ #: includes/fs-plugin-info-dialog.php:1140
957
+ msgctxt "as once a year"
958
+ msgid "Annual"
959
+ msgstr ""
960
+
961
+ #: includes/fs-plugin-info-dialog.php:1143
962
+ msgid "Lifetime"
963
+ msgstr ""
964
+
965
+ #: includes/fs-plugin-info-dialog.php:1157, includes/fs-plugin-info-dialog.php:1159, includes/fs-plugin-info-dialog.php:1161
966
+ msgctxt "e.g. billed monthly"
967
+ msgid "Billed %s"
968
+ msgstr ""
969
+
970
+ #: includes/fs-plugin-info-dialog.php:1159
971
+ msgctxt "as once a year"
972
+ msgid "Annually"
973
+ msgstr ""
974
+
975
+ #: includes/fs-plugin-info-dialog.php:1161
976
+ msgctxt "as once a year"
977
+ msgid "Once"
978
+ msgstr ""
979
+
980
+ #: includes/fs-plugin-info-dialog.php:1167
981
+ msgid "Single Site License"
982
+ msgstr ""
983
+
984
+ #: includes/fs-plugin-info-dialog.php:1169
985
+ msgid "Unlimited Licenses"
986
+ msgstr ""
987
+
988
+ #: includes/fs-plugin-info-dialog.php:1171
989
+ msgid "Up to %s Sites"
990
+ msgstr ""
991
+
992
+ #: includes/fs-plugin-info-dialog.php:1181, templates/plugin-info/features.php:82
993
+ msgctxt "as monthly period"
994
+ msgid "mo"
995
+ msgstr ""
996
+
997
+ #: includes/fs-plugin-info-dialog.php:1188, templates/plugin-info/features.php:80
998
+ msgctxt "as annual period"
999
+ msgid "year"
1000
+ msgstr ""
1001
+
1002
+ #: includes/fs-plugin-info-dialog.php:1242
1003
+ msgctxt "noun"
1004
+ msgid "Price"
1005
+ msgstr ""
1006
+
1007
+ #: includes/fs-plugin-info-dialog.php:1290
1008
+ msgid "Save %s"
1009
+ msgstr ""
1010
+
1011
+ #: includes/fs-plugin-info-dialog.php:1300
1012
+ msgid "No commitment for %s - cancel anytime"
1013
+ msgstr ""
1014
+
1015
+ #: includes/fs-plugin-info-dialog.php:1303
1016
+ msgid "After your free %s, pay as little as %s"
1017
+ msgstr ""
1018
+
1019
+ #: includes/fs-plugin-info-dialog.php:1314
1020
+ msgid "Details"
1021
+ msgstr ""
1022
+
1023
+ #: includes/fs-plugin-info-dialog.php:1318, templates/account.php:110, templates/debug.php:201, templates/debug.php:238, templates/debug.php:455, templates/account/partials/addon.php:36
1024
+ msgctxt "product version"
1025
+ msgid "Version"
1026
+ msgstr ""
1027
+
1028
+ #: includes/fs-plugin-info-dialog.php:1325
1029
+ msgctxt "as the plugin author"
1030
+ msgid "Author"
1031
+ msgstr ""
1032
+
1033
+ #: includes/fs-plugin-info-dialog.php:1332
1034
+ msgid "Last Updated"
1035
+ msgstr ""
1036
+
1037
+ #: includes/fs-plugin-info-dialog.php:1337, templates/account.php:525
1038
+ msgctxt "x-ago"
1039
+ msgid "%s ago"
1040
+ msgstr ""
1041
+
1042
+ #: includes/fs-plugin-info-dialog.php:1346
1043
+ msgid "Requires WordPress Version"
1044
+ msgstr ""
1045
+
1046
+ #: includes/fs-plugin-info-dialog.php:1347
1047
+ msgid "%s or higher"
1048
+ msgstr ""
1049
+
1050
+ #: includes/fs-plugin-info-dialog.php:1354
1051
+ msgid "Compatible up to"
1052
+ msgstr ""
1053
+
1054
+ #: includes/fs-plugin-info-dialog.php:1362
1055
+ msgid "Downloaded"
1056
+ msgstr ""
1057
+
1058
+ #: includes/fs-plugin-info-dialog.php:1366
1059
+ msgid "%s time"
1060
+ msgstr ""
1061
+
1062
+ #: includes/fs-plugin-info-dialog.php:1368
1063
+ msgid "%s times"
1064
+ msgstr ""
1065
+
1066
+ #: includes/fs-plugin-info-dialog.php:1379
1067
+ msgid "WordPress.org Plugin Page"
1068
+ msgstr ""
1069
+
1070
+ #: includes/fs-plugin-info-dialog.php:1388
1071
+ msgid "Plugin Homepage"
1072
+ msgstr ""
1073
+
1074
+ #: includes/fs-plugin-info-dialog.php:1397, includes/fs-plugin-info-dialog.php:1481
1075
+ msgid "Donate to this plugin"
1076
+ msgstr ""
1077
+
1078
+ #: includes/fs-plugin-info-dialog.php:1404
1079
+ msgid "Average Rating"
1080
+ msgstr ""
1081
+
1082
+ #: includes/fs-plugin-info-dialog.php:1411
1083
+ msgid "based on %s"
1084
+ msgstr ""
1085
+
1086
+ #: includes/fs-plugin-info-dialog.php:1415
1087
+ msgid "%s rating"
1088
+ msgstr ""
1089
+
1090
+ #: includes/fs-plugin-info-dialog.php:1417
1091
+ msgid "%s ratings"
1092
+ msgstr ""
1093
+
1094
+ #: includes/fs-plugin-info-dialog.php:1432
1095
+ msgid "%s star"
1096
+ msgstr ""
1097
+
1098
+ #: includes/fs-plugin-info-dialog.php:1434
1099
+ msgid "%s stars"
1100
+ msgstr ""
1101
+
1102
+ #: includes/fs-plugin-info-dialog.php:1446
1103
+ msgid "Click to see reviews that provided a rating of %s"
1104
+ msgstr ""
1105
+
1106
+ #: includes/fs-plugin-info-dialog.php:1459
1107
+ msgid "Contributors"
1108
+ msgstr ""
1109
+
1110
+ #: includes/fs-plugin-info-dialog.php:1489, includes/fs-plugin-info-dialog.php:1491
1111
+ msgid "Warning"
1112
+ msgstr ""
1113
+
1114
+ #: includes/fs-plugin-info-dialog.php:1489
1115
+ msgid "This plugin has not been tested with your current version of WordPress."
1116
+ msgstr ""
1117
+
1118
+ #: includes/fs-plugin-info-dialog.php:1491
1119
+ msgid "This plugin has not been marked as compatible with your version of WordPress."
1120
+ msgstr ""
1121
+
1122
+ #: includes/fs-plugin-info-dialog.php:1510
1123
+ msgid "Paid add-on must be deployed to Freemius."
1124
+ msgstr ""
1125
+
1126
+ #: includes/fs-plugin-info-dialog.php:1511
1127
+ msgid "Add-on must be deployed to WordPress.org or Freemius."
1128
+ msgstr ""
1129
+
1130
+ #: includes/fs-plugin-info-dialog.php:1532
1131
+ msgid "Newer Version (%s) Installed"
1132
+ msgstr ""
1133
+
1134
+ #: includes/fs-plugin-info-dialog.php:1533
1135
+ msgid "Newer Free Version (%s) Installed"
1136
+ msgstr ""
1137
+
1138
+ #: includes/fs-plugin-info-dialog.php:1540
1139
+ msgid "Latest Version Installed"
1140
+ msgstr ""
1141
+
1142
+ #: includes/fs-plugin-info-dialog.php:1541
1143
+ msgid "Latest Free Version Installed"
1144
+ msgstr ""
1145
+
1146
+ #: templates/account.php:100, templates/forms/subscription-cancellation.php:96, templates/account/partials/addon.php:26, templates/account/partials/site.php:311
1147
+ msgid "Downgrading your plan"
1148
+ msgstr ""
1149
+
1150
+ #: templates/account.php:101, templates/forms/subscription-cancellation.php:97, templates/account/partials/addon.php:27, templates/account/partials/site.php:312
1151
+ msgid "Cancelling the subscription"
1152
+ msgstr ""
1153
+
1154
+ #. translators: %1$s: Either 'Downgrading your plan' or 'Cancelling the subscription'
1155
+ #: templates/account.php:103, templates/forms/subscription-cancellation.php:99, templates/account/partials/site.php:314
1156
+ msgid "%1$s will immediately stop all future recurring payments and your %2$s plan license will expire in %3$s."
1157
+ msgstr ""
1158
+
1159
+ #: templates/account.php:104, templates/forms/subscription-cancellation.php:100, templates/account/partials/addon.php:30, templates/account/partials/site.php:315
1160
+ msgid "Please note that we will not be able to grandfather outdated pricing for renewals/new subscriptions after a cancellation. If you choose to renew the subscription manually in the future, after a price increase, which typically occurs once a year, you will be charged the updated price."
1161
+ msgstr ""
1162
+
1163
+ #: templates/account.php:105, templates/forms/subscription-cancellation.php:106, templates/account/partials/addon.php:31
1164
+ msgid "Cancelling the trial will immediately block access to all premium features. Are you sure?"
1165
+ msgstr ""
1166
+
1167
+ #: templates/account.php:106, templates/forms/subscription-cancellation.php:101, templates/account/partials/addon.php:32, templates/account/partials/site.php:316
1168
+ msgid "You can still enjoy all %s features but you will not have access to %s security & feature updates, nor support."
1169
+ msgstr ""
1170
+
1171
+ #: templates/account.php:107, templates/forms/subscription-cancellation.php:102, templates/account/partials/addon.php:33, templates/account/partials/site.php:317
1172
+ msgid "Once your license expires you can still use the Free version but you will NOT have access to the %s features."
1173
+ msgstr ""
1174
+
1175
+ #. translators: %s: Plan title (e.g. "Professional")
1176
+ #: templates/account.php:109, templates/account/partials/activate-license-button.php:31, templates/account/partials/addon.php:35
1177
+ msgid "Activate %s Plan"
1178
+ msgstr ""
1179
+
1180
+ #. translators: %s: Time period (e.g. Auto renews in "2 months")
1181
+ #: templates/account.php:112, templates/account/partials/addon.php:38, templates/account/partials/site.php:291
1182
+ msgid "Auto renews in %s"
1183
+ msgstr ""
1184
+
1185
+ #. translators: %s: Time period (e.g. Expires in "2 months")
1186
+ #: templates/account.php:114, templates/account/partials/addon.php:40, templates/account/partials/site.php:293
1187
+ msgid "Expires in %s"
1188
+ msgstr ""
1189
+
1190
+ #: templates/account.php:115
1191
+ msgctxt "as synchronize license"
1192
+ msgid "Sync License"
1193
+ msgstr ""
1194
+
1195
+ #: templates/account.php:116, templates/account/partials/addon.php:41
1196
+ msgid "Cancel Trial"
1197
+ msgstr ""
1198
+
1199
+ #: templates/account.php:117, templates/account/partials/addon.php:42
1200
+ msgid "Change Plan"
1201
+ msgstr ""
1202
+
1203
+ #: templates/account.php:118, templates/account/partials/addon.php:43
1204
+ msgctxt "verb"
1205
+ msgid "Upgrade"
1206
+ msgstr ""
1207
+
1208
+ #: templates/account.php:120, templates/account/partials/addon.php:45, templates/account/partials/site.php:318
1209
+ msgctxt "verb"
1210
+ msgid "Downgrade"
1211
+ msgstr ""
1212
+
1213
+ #: templates/account.php:122, templates/add-ons.php:246, templates/plugin-info/features.php:72, templates/account/partials/addon.php:47, templates/account/partials/site.php:33
1214
+ msgid "Free"
1215
+ msgstr ""
1216
+
1217
+ #: templates/account.php:124, templates/debug.php:371, includes/customizer/class-fs-customizer-upsell-control.php:110, templates/account/partials/addon.php:49
1218
+ msgctxt "as product pricing plan"
1219
+ msgid "Plan"
1220
+ msgstr ""
1221
+
1222
+ #: templates/account.php:125
1223
+ msgid "Bundle Plan"
1224
+ msgstr ""
1225
+
1226
+ #: templates/account.php:248
1227
+ msgid "Free Trial"
1228
+ msgstr ""
1229
+
1230
+ #: templates/account.php:259
1231
+ msgid "Account Details"
1232
+ msgstr ""
1233
+
1234
+ #: templates/account.php:266, templates/forms/data-debug-mode.php:33
1235
+ msgid "Start Debug"
1236
+ msgstr ""
1237
+
1238
+ #: templates/account.php:268
1239
+ msgid "Stop Debug"
1240
+ msgstr ""
1241
+
1242
+ #: templates/account.php:275
1243
+ msgid "Billing & Invoices"
1244
+ msgstr ""
1245
+
1246
+ #: templates/account.php:286
1247
+ msgid "Deleting the account will automatically deactivate your %s plan license so you can use it on other sites. If you want to terminate the recurring payments as well, click the \"Cancel\" button, and first \"Downgrade\" your account. Are you sure you would like to continue with the deletion?"
1248
+ msgstr ""
1249
+
1250
+ #: templates/account.php:288
1251
+ msgid "Deletion is not temporary. Only delete if you no longer want to use this %s anymore. Are you sure you would like to continue with the deletion?"
1252
+ msgstr ""
1253
+
1254
+ #: templates/account.php:291
1255
+ msgid "Delete Account"
1256
+ msgstr ""
1257
+
1258
+ #: templates/account.php:303, templates/account/partials/addon.php:231, templates/account/partials/deactivate-license-button.php:35
1259
+ msgid "Deactivate License"
1260
+ msgstr ""
1261
+
1262
+ #: templates/account.php:326, templates/forms/subscription-cancellation.php:125
1263
+ msgid "Are you sure you want to proceed?"
1264
+ msgstr ""
1265
+
1266
+ #: templates/account.php:326, templates/account/partials/addon.php:255
1267
+ msgid "Cancel Subscription"
1268
+ msgstr ""
1269
+
1270
+ #: templates/account.php:355, templates/account/partials/addon.php:340
1271
+ msgctxt "as synchronize"
1272
+ msgid "Sync"
1273
+ msgstr ""
1274
+
1275
+ #: templates/account.php:370, templates/debug.php:505
1276
+ msgid "Name"
1277
+ msgstr ""
1278
+
1279
+ #: templates/account.php:376, templates/debug.php:506
1280
+ msgid "Email"
1281
+ msgstr ""
1282
+
1283
+ #: templates/account.php:383, templates/debug.php:369, templates/debug.php:555
1284
+ msgid "User ID"
1285
+ msgstr ""
1286
+
1287
+ #: templates/account.php:401, templates/account.php:719, templates/account.php:752, templates/debug.php:236, templates/debug.php:363, templates/debug.php:452, templates/debug.php:504, templates/debug.php:553, templates/debug.php:632, templates/account/payments.php:35, templates/debug/logger.php:21
1288
+ msgid "ID"
1289
+ msgstr ""
1290
+
1291
+ #: templates/account.php:408
1292
+ msgid "Site ID"
1293
+ msgstr ""
1294
+
1295
+ #: templates/account.php:411
1296
+ msgid "No ID"
1297
+ msgstr ""
1298
+
1299
+ #: templates/account.php:416, templates/debug.php:243, templates/debug.php:372, templates/debug.php:456, templates/debug.php:508, templates/account/partials/site.php:227
1300
+ msgid "Public Key"
1301
+ msgstr ""
1302
+
1303
+ #: templates/account.php:422, templates/debug.php:373, templates/debug.php:457, templates/debug.php:509, templates/account/partials/site.php:239
1304
+ msgid "Secret Key"
1305
+ msgstr ""
1306
+
1307
+ #: templates/account.php:425
1308
+ msgctxt "as secret encryption key missing"
1309
+ msgid "No Secret"
1310
+ msgstr ""
1311
+
1312
+ #: templates/account.php:452, templates/account/partials/site.php:120, templates/account/partials/site.php:122
1313
+ msgid "Trial"
1314
+ msgstr ""
1315
+
1316
+ #: templates/account.php:479, templates/debug.php:561, templates/account/partials/site.php:260
1317
+ msgid "License Key"
1318
+ msgstr ""
1319
+
1320
+ #: templates/account.php:510
1321
+ msgid "Join the Beta program"
1322
+ msgstr ""
1323
+
1324
+ #: templates/account.php:516
1325
+ msgid "not verified"
1326
+ msgstr ""
1327
+
1328
+ #: templates/account.php:525, templates/account/partials/addon.php:190
1329
+ msgid "Expired"
1330
+ msgstr ""
1331
+
1332
+ #: templates/account.php:585
1333
+ msgid "Premium version"
1334
+ msgstr ""
1335
+
1336
+ #: templates/account.php:587
1337
+ msgid "Free version"
1338
+ msgstr ""
1339
+
1340
+ #: templates/account.php:599
1341
+ msgid "Verify Email"
1342
+ msgstr ""
1343
+
1344
+ #: templates/account.php:613
1345
+ msgid "Download %s Version"
1346
+ msgstr ""
1347
+
1348
+ #: templates/account.php:629
1349
+ msgid "Download Paid Version"
1350
+ msgstr ""
1351
+
1352
+ #: templates/account.php:647, templates/account.php:890, templates/account/partials/site.php:248, templates/account/partials/site.php:270
1353
+ msgctxt "verb"
1354
+ msgid "Show"
1355
+ msgstr ""
1356
+
1357
+ #: templates/account.php:662
1358
+ msgid "What is your %s?"
1359
+ msgstr ""
1360
+
1361
+ #: templates/account.php:670, templates/account/billing.php:21
1362
+ msgctxt "verb"
1363
+ msgid "Edit"
1364
+ msgstr ""
1365
+
1366
+ #: templates/account.php:674, templates/forms/user-change.php:27
1367
+ msgid "Change User"
1368
+ msgstr ""
1369
+
1370
+ #: templates/account.php:698
1371
+ msgid "Sites"
1372
+ msgstr ""
1373
+
1374
+ #: templates/account.php:711
1375
+ msgid "Search by address"
1376
+ msgstr ""
1377
+
1378
+ #: templates/account.php:720, templates/debug.php:366
1379
+ msgid "Address"
1380
+ msgstr ""
1381
+
1382
+ #: templates/account.php:721
1383
+ msgid "License"
1384
+ msgstr ""
1385
+
1386
+ #: templates/account.php:722
1387
+ msgid "Plan"
1388
+ msgstr ""
1389
+
1390
+ #: templates/account.php:755
1391
+ msgctxt "as software license"
1392
+ msgid "License"
1393
+ msgstr ""
1394
+
1395
+ #: templates/account.php:884
1396
+ msgctxt "verb"
1397
+ msgid "Hide"
1398
+ msgstr ""
1399
+
1400
+ #: templates/account.php:906, templates/forms/data-debug-mode.php:31
1401
+ msgid "Processing"
1402
+ msgstr ""
1403
+
1404
+ #: templates/account.php:909
1405
+ msgid "Get updates for bleeding edge Beta versions of %s."
1406
+ msgstr ""
1407
+
1408
+ #: templates/account.php:967
1409
+ msgid "Cancelling %s"
1410
+ msgstr ""
1411
+
1412
+ #: templates/account.php:967, templates/account.php:984, templates/forms/subscription-cancellation.php:27, templates/forms/deactivation/form.php:133
1413
+ msgid "trial"
1414
+ msgstr ""
1415
+
1416
+ #: templates/account.php:982, templates/forms/deactivation/form.php:150
1417
+ msgid "Cancelling %s..."
1418
+ msgstr ""
1419
+
1420
+ #: templates/account.php:985, templates/forms/subscription-cancellation.php:28, templates/forms/deactivation/form.php:134
1421
+ msgid "subscription"
1422
+ msgstr ""
1423
+
1424
+ #: templates/account.php:999
1425
+ msgid "Deactivating your license will block all premium features, but will enable activating the license on another site. Are you sure you want to proceed?"
1426
+ msgstr ""
1427
+
1428
+ #: templates/account.php:1073
1429
+ msgid "Disabling white-label mode"
1430
+ msgstr ""
1431
+
1432
+ #: templates/account.php:1074
1433
+ msgid "Enabling white-label mode"
1434
+ msgstr ""
1435
+
1436
+ #: templates/add-ons.php:38
1437
+ msgid "View details"
1438
+ msgstr ""
1439
+
1440
+ #: templates/add-ons.php:48
1441
+ msgid "Add Ons for %s"
1442
+ msgstr ""
1443
+
1444
+ #: templates/add-ons.php:58
1445
+ msgid "We couldn't load the add-ons list. It's probably an issue on our side, please try to come back in few minutes."
1446
+ msgstr ""
1447
+
1448
+ #: templates/add-ons.php:229
1449
+ msgctxt "active add-on"
1450
+ msgid "Active"
1451
+ msgstr ""
1452
+
1453
+ #: templates/add-ons.php:230
1454
+ msgctxt "installed add-on"
1455
+ msgid "Installed"
1456
+ msgstr ""
1457
+
1458
+ #: templates/admin-notice.php:13, templates/forms/license-activation.php:220, templates/forms/resend-key.php:77
1459
+ msgctxt "as close a window"
1460
+ msgid "Dismiss"
1461
+ msgstr ""
1462
+
1463
+ #: templates/auto-installation.php:45
1464
+ msgid "%s sec"
1465
+ msgstr ""
1466
+
1467
+ #: templates/auto-installation.php:83
1468
+ msgid "Automatic Installation"
1469
+ msgstr ""
1470
+
1471
+ #: templates/auto-installation.php:93
1472
+ msgid "An automated download and installation of %s (paid version) from %s will start in %s. If you would like to do it manually - click the cancellation button now."
1473
+ msgstr ""
1474
+
1475
+ #: templates/auto-installation.php:104
1476
+ msgid "The installation process has started and may take a few minutes to complete. Please wait until it is done - do not refresh this page."
1477
+ msgstr ""
1478
+
1479
+ #: templates/auto-installation.php:109
1480
+ msgid "Cancel Installation"
1481
+ msgstr ""
1482
+
1483
+ #: templates/checkout.php:180
1484
+ msgid "Checkout"
1485
+ msgstr ""
1486
+
1487
+ #: templates/checkout.php:180
1488
+ msgid "PCI compliant"
1489
+ msgstr ""
1490
+
1491
+ #. translators: %s: name (e.g. Hey John,)
1492
+ #: templates/connect.php:112
1493
+ msgctxt "greeting"
1494
+ msgid "Hey %s,"
1495
+ msgstr ""
1496
+
1497
+ #: templates/connect.php:162
1498
+ msgid "Allow & Continue"
1499
+ msgstr ""
1500
+
1501
+ #: templates/connect.php:166
1502
+ msgid "Re-send activation email"
1503
+ msgstr ""
1504
+
1505
+ #: templates/connect.php:170
1506
+ msgid "Thanks %s!"
1507
+ msgstr ""
1508
+
1509
+ #: templates/connect.php:180, templates/forms/license-activation.php:46
1510
+ msgid "Agree & Activate License"
1511
+ msgstr ""
1512
+
1513
+ #: templates/connect.php:189
1514
+ msgid "Thanks for purchasing %s! To get started, please enter your license key:"
1515
+ msgstr ""
1516
+
1517
+ #: templates/connect.php:196
1518
+ msgid "Never miss an important update - opt in to our security & feature updates notifications, educational content, offers, and non-sensitive diagnostic tracking with %4$s."
1519
+ msgstr ""
1520
+
1521
+ #: templates/connect.php:197
1522
+ msgid "Never miss an important update - opt in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s."
1523
+ msgstr ""
1524
+
1525
+ #: templates/connect.php:203
1526
+ msgid "Never miss an important update - opt in to our security & feature updates notifications, educational content, offers, and non-sensitive diagnostic tracking with %4$s. If you skip this, that's okay! %1$s will still work just fine."
1527
+ msgstr ""
1528
+
1529
+ #: templates/connect.php:204
1530
+ msgid "Never miss an important update - opt in to our security & feature updates notifications, and non-sensitive diagnostic tracking with %4$s. If you skip this, that's okay! %1$s will still work just fine."
1531
+ msgstr ""
1532
+
1533
+ #: templates/connect.php:238
1534
+ msgid "We're excited to introduce the Freemius network-level integration."
1535
+ msgstr ""
1536
+
1537
+ #: templates/connect.php:241
1538
+ msgid "During the update process we detected %d site(s) that are still pending license activation."
1539
+ msgstr ""
1540
+
1541
+ #: templates/connect.php:243
1542
+ msgid "If you'd like to use the %s on those sites, please enter your license key below and click the activation button."
1543
+ msgstr ""
1544
+
1545
+ #: templates/connect.php:245
1546
+ msgid "%s's paid features"
1547
+ msgstr ""
1548
+
1549
+ #: templates/connect.php:250
1550
+ msgid "Alternatively, you can skip it for now and activate the license later, in your %s's network-level Account page."
1551
+ msgstr ""
1552
+
1553
+ #: templates/connect.php:252
1554
+ msgid "During the update process we detected %s site(s) in the network that are still pending your attention."
1555
+ msgstr ""
1556
+
1557
+ #: templates/connect.php:261, templates/forms/data-debug-mode.php:35, templates/forms/license-activation.php:49
1558
+ msgid "License key"
1559
+ msgstr ""
1560
+
1561
+ #: templates/connect.php:264, templates/forms/license-activation.php:22
1562
+ msgid "Can't find your license key?"
1563
+ msgstr ""
1564
+
1565
+ #: templates/connect.php:323, templates/connect.php:695, templates/forms/deactivation/retry-skip.php:20
1566
+ msgctxt "verb"
1567
+ msgid "Skip"
1568
+ msgstr ""
1569
+
1570
+ #: templates/connect.php:326
1571
+ msgid "Delegate to Site Admins"
1572
+ msgstr ""
1573
+
1574
+ #: templates/connect.php:326
1575
+ msgid "If you click it, this decision will be delegated to the sites administrators."
1576
+ msgstr ""
1577
+
1578
+ #: templates/connect.php:364
1579
+ msgid "Your Profile Overview"
1580
+ msgstr ""
1581
+
1582
+ #: templates/connect.php:365
1583
+ msgid "Name and email address"
1584
+ msgstr ""
1585
+
1586
+ #: templates/connect.php:372
1587
+ msgid "Your Site Overview"
1588
+ msgstr ""
1589
+
1590
+ #: templates/connect.php:373
1591
+ msgid "Site URL, WP version, PHP info"
1592
+ msgstr ""
1593
+
1594
+ #: templates/connect.php:379
1595
+ msgid "Admin Notices"
1596
+ msgstr ""
1597
+
1598
+ #: templates/connect.php:380, templates/connect.php:396
1599
+ msgid "Updates, announcements, marketing, no spam"
1600
+ msgstr ""
1601
+
1602
+ #: templates/connect.php:386
1603
+ msgid "Current %s Events"
1604
+ msgstr ""
1605
+
1606
+ #: templates/connect.php:387
1607
+ msgid "Activation, deactivation and uninstall"
1608
+ msgstr ""
1609
+
1610
+ #: templates/connect.php:395
1611
+ msgid "Newsletter"
1612
+ msgstr ""
1613
+
1614
+ #: templates/connect.php:403
1615
+ msgid "Plugins & Themes"
1616
+ msgstr ""
1617
+
1618
+ #: templates/connect.php:404
1619
+ msgid "Title, slug, version, and is active"
1620
+ msgstr ""
1621
+
1622
+ #: templates/connect.php:421, templates/forms/license-activation.php:41
1623
+ msgid "The %1$s will be periodically sending data to %2$s to check for security and feature updates, and verify the validity of your license."
1624
+ msgstr ""
1625
+
1626
+ #: templates/connect.php:426
1627
+ msgid "What permissions are being granted?"
1628
+ msgstr ""
1629
+
1630
+ #: templates/connect.php:452
1631
+ msgid "Don't have a license key?"
1632
+ msgstr ""
1633
+
1634
+ #: templates/connect.php:455
1635
+ msgid "Have a license key?"
1636
+ msgstr ""
1637
+
1638
+ #: templates/connect.php:463
1639
+ msgid "Privacy Policy"
1640
+ msgstr ""
1641
+
1642
+ #: templates/connect.php:465
1643
+ msgid "License Agreement"
1644
+ msgstr ""
1645
+
1646
+ #: templates/connect.php:465
1647
+ msgid "Terms of Service"
1648
+ msgstr ""
1649
+
1650
+ #: templates/connect.php:854
1651
+ msgctxt "as in the process of sending an email"
1652
+ msgid "Sending email"
1653
+ msgstr ""
1654
+
1655
+ #: templates/connect.php:855
1656
+ msgctxt "as activating plugin"
1657
+ msgid "Activating"
1658
+ msgstr ""
1659
+
1660
+ #: templates/contact.php:78
1661
+ msgid "Contact"
1662
+ msgstr ""
1663
+
1664
+ #: templates/debug.php:17
1665
+ msgctxt "as turned off"
1666
+ msgid "Off"
1667
+ msgstr ""
1668
+
1669
+ #: templates/debug.php:18
1670
+ msgctxt "as turned on"
1671
+ msgid "On"
1672
+ msgstr ""
1673
+
1674
+ #: templates/debug.php:20
1675
+ msgid "SDK"
1676
+ msgstr ""
1677
+
1678
+ #: templates/debug.php:24
1679
+ msgctxt "as code debugging"
1680
+ msgid "Debugging"
1681
+ msgstr ""
1682
+
1683
+ #: templates/debug.php:52, templates/debug.php:248, templates/debug.php:374, templates/debug.php:510
1684
+ msgid "Actions"
1685
+ msgstr ""
1686
+
1687
+ #: templates/debug.php:62
1688
+ msgid "Are you sure you want to delete all Freemius data?"
1689
+ msgstr ""
1690
+
1691
+ #: templates/debug.php:62
1692
+ msgid "Delete All Accounts"
1693
+ msgstr ""
1694
+
1695
+ #: templates/debug.php:69
1696
+ msgid "Clear API Cache"
1697
+ msgstr ""
1698
+
1699
+ #: templates/debug.php:77
1700
+ msgid "Clear Updates Transients"
1701
+ msgstr ""
1702
+
1703
+ #: templates/debug.php:84
1704
+ msgid "Sync Data From Server"
1705
+ msgstr ""
1706
+
1707
+ #: templates/debug.php:93
1708
+ msgid "Migrate Options to Network"
1709
+ msgstr ""
1710
+
1711
+ #: templates/debug.php:98
1712
+ msgid "Load DB Option"
1713
+ msgstr ""
1714
+
1715
+ #: templates/debug.php:101
1716
+ msgid "Set DB Option"
1717
+ msgstr ""
1718
+
1719
+ #: templates/debug.php:180
1720
+ msgid "Key"
1721
+ msgstr ""
1722
+
1723
+ #: templates/debug.php:181
1724
+ msgid "Value"
1725
+ msgstr ""
1726
+
1727
+ #: templates/debug.php:197
1728
+ msgctxt "as software development kit versions"
1729
+ msgid "SDK Versions"
1730
+ msgstr ""
1731
+
1732
+ #: templates/debug.php:202
1733
+ msgid "SDK Path"
1734
+ msgstr ""
1735
+
1736
+ #: templates/debug.php:203, templates/debug.php:242
1737
+ msgid "Module Path"
1738
+ msgstr ""
1739
+
1740
+ #: templates/debug.php:204
1741
+ msgid "Is Active"
1742
+ msgstr ""
1743
+
1744
+ #: templates/debug.php:232, templates/debug/plugins-themes-sync.php:35
1745
+ msgid "Plugins"
1746
+ msgstr ""
1747
+
1748
+ #: templates/debug.php:232, templates/debug/plugins-themes-sync.php:56
1749
+ msgid "Themes"
1750
+ msgstr ""
1751
+
1752
+ #: templates/debug.php:237, templates/debug.php:368, templates/debug.php:454, templates/debug/scheduled-crons.php:80
1753
+ msgid "Slug"
1754
+ msgstr ""
1755
+
1756
+ #: templates/debug.php:239, templates/debug.php:453
1757
+ msgid "Title"
1758
+ msgstr ""
1759
+
1760
+ #: templates/debug.php:240
1761
+ msgctxt "as application program interface"
1762
+ msgid "API"
1763
+ msgstr ""
1764
+
1765
+ #: templates/debug.php:241
1766
+ msgid "Freemius State"
1767
+ msgstr ""
1768
+
1769
+ #: templates/debug.php:245
1770
+ msgid "Network Blog"
1771
+ msgstr ""
1772
+
1773
+ #: templates/debug.php:246
1774
+ msgid "Network User"
1775
+ msgstr ""
1776
+
1777
+ #: templates/debug.php:283
1778
+ msgctxt "as connection was successful"
1779
+ msgid "Connected"
1780
+ msgstr ""
1781
+
1782
+ #: templates/debug.php:284
1783
+ msgctxt "as connection blocked"
1784
+ msgid "Blocked"
1785
+ msgstr ""
1786
+
1787
+ #: templates/debug.php:320
1788
+ msgid "Simulate Trial Promotion"
1789
+ msgstr ""
1790
+
1791
+ #: templates/debug.php:332
1792
+ msgid "Simulate Network Upgrade"
1793
+ msgstr ""
1794
+
1795
+ #: templates/debug.php:357
1796
+ msgid "%s Installs"
1797
+ msgstr ""
1798
+
1799
+ #: templates/debug.php:359
1800
+ msgctxt "like websites"
1801
+ msgid "Sites"
1802
+ msgstr ""
1803
+
1804
+ #: templates/debug.php:365, templates/account/partials/site.php:156
1805
+ msgid "Blog ID"
1806
+ msgstr ""
1807
+
1808
+ #: templates/debug.php:370
1809
+ msgid "License ID"
1810
+ msgstr ""
1811
+
1812
+ #: templates/debug.php:434, templates/debug.php:533, templates/account/partials/addon.php:435
1813
+ msgctxt "verb"
1814
+ msgid "Delete"
1815
+ msgstr ""
1816
+
1817
+ #: templates/debug.php:448
1818
+ msgid "Add Ons of module %s"
1819
+ msgstr ""
1820
+
1821
+ #: templates/debug.php:500
1822
+ msgid "Users"
1823
+ msgstr ""
1824
+
1825
+ #: templates/debug.php:507
1826
+ msgid "Verified"
1827
+ msgstr ""
1828
+
1829
+ #: templates/debug.php:549
1830
+ msgid "%s Licenses"
1831
+ msgstr ""
1832
+
1833
+ #: templates/debug.php:554
1834
+ msgid "Plugin ID"
1835
+ msgstr ""
1836
+
1837
+ #: templates/debug.php:556
1838
+ msgid "Plan ID"
1839
+ msgstr ""
1840
+
1841
+ #: templates/debug.php:557
1842
+ msgid "Quota"
1843
+ msgstr ""
1844
+
1845
+ #: templates/debug.php:558
1846
+ msgid "Activated"
1847
+ msgstr ""
1848
+
1849
+ #: templates/debug.php:559
1850
+ msgid "Blocking"
1851
+ msgstr ""
1852
+
1853
+ #: templates/debug.php:560, templates/debug.php:631, templates/debug/logger.php:22
1854
+ msgid "Type"
1855
+ msgstr ""
1856
+
1857
+ #: templates/debug.php:562
1858
+ msgctxt "as expiration date"
1859
+ msgid "Expiration"
1860
+ msgstr ""
1861
+
1862
+ #: templates/debug.php:590
1863
+ msgid "Debug Log"
1864
+ msgstr ""
1865
+
1866
+ #: templates/debug.php:594
1867
+ msgid "All Types"
1868
+ msgstr ""
1869
+
1870
+ #: templates/debug.php:601
1871
+ msgid "All Requests"
1872
+ msgstr ""
1873
+
1874
+ #: templates/debug.php:606, templates/debug.php:635, templates/debug/logger.php:25
1875
+ msgid "File"
1876
+ msgstr ""
1877
+
1878
+ #: templates/debug.php:607, templates/debug.php:633, templates/debug/logger.php:23
1879
+ msgid "Function"
1880
+ msgstr ""
1881
+
1882
+ #: templates/debug.php:608
1883
+ msgid "Process ID"
1884
+ msgstr ""
1885
+
1886
+ #: templates/debug.php:609
1887
+ msgid "Logger"
1888
+ msgstr ""
1889
+
1890
+ #: templates/debug.php:610, templates/debug.php:634, templates/debug/logger.php:24
1891
+ msgid "Message"
1892
+ msgstr ""
1893
+
1894
+ #: templates/debug.php:612
1895
+ msgid "Filter"
1896
+ msgstr ""
1897
+
1898
+ #: templates/debug.php:620
1899
+ msgid "Download"
1900
+ msgstr ""
1901
+
1902
+ #: templates/debug.php:636, templates/debug/logger.php:26
1903
+ msgid "Timestamp"
1904
+ msgstr ""
1905
+
1906
+ #: templates/secure-https-header.php:28
1907
+ msgid "Secure HTTPS %s page, running from an external domain"
1908
+ msgstr ""
1909
+
1910
+ #: includes/customizer/class-fs-customizer-support-section.php:55, templates/plugin-info/features.php:43
1911
+ msgid "Support"
1912
+ msgstr ""
1913
+
1914
+ #: includes/debug/class-fs-debug-bar-panel.php:48, templates/debug/api-calls.php:54, templates/debug/logger.php:62
1915
+ msgctxt "milliseconds"
1916
+ msgid "ms"
1917
+ msgstr ""
1918
+
1919
+ #: includes/debug/debug-bar-start.php:41
1920
+ msgid "Freemius API"
1921
+ msgstr ""
1922
+
1923
+ #: includes/debug/debug-bar-start.php:42
1924
+ msgid "Requests"
1925
+ msgstr ""
1926
+
1927
+ #: templates/account/billing.php:22
1928
+ msgctxt "verb"
1929
+ msgid "Update"
1930
+ msgstr ""
1931
+
1932
+ #: templates/account/billing.php:33
1933
+ msgid "Billing"
1934
+ msgstr ""
1935
+
1936
+ #: templates/account/billing.php:38, templates/account/billing.php:38
1937
+ msgid "Business name"
1938
+ msgstr ""
1939
+
1940
+ #: templates/account/billing.php:39, templates/account/billing.php:39
1941
+ msgid "Tax / VAT ID"
1942
+ msgstr ""
1943
+
1944
+ #: templates/account/billing.php:42, templates/account/billing.php:42, templates/account/billing.php:43, templates/account/billing.php:43
1945
+ msgid "Address Line %d"
1946
+ msgstr ""
1947
+
1948
+ #: templates/account/billing.php:46, templates/account/billing.php:46
1949
+ msgid "City"
1950
+ msgstr ""
1951
+
1952
+ #: templates/account/billing.php:46, templates/account/billing.php:46
1953
+ msgid "Town"
1954
+ msgstr ""
1955
+
1956
+ #: templates/account/billing.php:47, templates/account/billing.php:47
1957
+ msgid "ZIP / Postal Code"
1958
+ msgstr ""
1959
+
1960
+ #: templates/account/billing.php:302
1961
+ msgid "Country"
1962
+ msgstr ""
1963
+
1964
+ #: templates/account/billing.php:304
1965
+ msgid "Select Country"
1966
+ msgstr ""
1967
+
1968
+ #: templates/account/billing.php:311, templates/account/billing.php:312
1969
+ msgid "State"
1970
+ msgstr ""
1971
+
1972
+ #: templates/account/billing.php:311, templates/account/billing.php:312
1973
+ msgid "Province"
1974
+ msgstr ""
1975
+
1976
+ #: templates/account/payments.php:29
1977
+ msgid "Payments"
1978
+ msgstr ""
1979
+
1980
+ #: templates/account/payments.php:36
1981
+ msgid "Date"
1982
+ msgstr ""
1983
+
1984
+ #: templates/account/payments.php:37
1985
+ msgid "Amount"
1986
+ msgstr ""
1987
+
1988
+ #: templates/account/payments.php:38, templates/account/payments.php:50
1989
+ msgid "Invoice"
1990
+ msgstr ""
1991
+
1992
+ #: templates/debug/api-calls.php:56
1993
+ msgid "API"
1994
+ msgstr ""
1995
+
1996
+ #: templates/debug/api-calls.php:68
1997
+ msgid "Method"
1998
+ msgstr ""
1999
+
2000
+ #: templates/debug/api-calls.php:69
2001
+ msgid "Code"
2002
+ msgstr ""
2003
+
2004
+ #: templates/debug/api-calls.php:70
2005
+ msgid "Length"
2006
+ msgstr ""
2007
+
2008
+ #: templates/debug/api-calls.php:71
2009
+ msgctxt "as file/folder path"
2010
+ msgid "Path"
2011
+ msgstr ""
2012
+
2013
+ #: templates/debug/api-calls.php:73
2014
+ msgid "Body"
2015
+ msgstr ""
2016
+
2017
+ #: templates/debug/api-calls.php:75
2018
+ msgid "Result"
2019
+ msgstr ""
2020
+
2021
+ #: templates/debug/api-calls.php:76
2022
+ msgid "Start"
2023
+ msgstr ""
2024
+
2025
+ #: templates/debug/api-calls.php:77
2026
+ msgid "End"
2027
+ msgstr ""
2028
+
2029
+ #: templates/debug/logger.php:15
2030
+ msgid "Log"
2031
+ msgstr ""
2032
+
2033
+ #. translators: %s: time period (e.g. In "2 hours")
2034
+ #: templates/debug/plugins-themes-sync.php:18, templates/debug/scheduled-crons.php:91
2035
+ msgid "In %s"
2036
+ msgstr ""
2037
+
2038
+ #. translators: %s: time period (e.g. "2 hours" ago)
2039
+ #: templates/debug/plugins-themes-sync.php:20, templates/debug/scheduled-crons.php:93
2040
+ msgid "%s ago"
2041
+ msgstr ""
2042
+
2043
+ #: templates/debug/plugins-themes-sync.php:21, templates/debug/scheduled-crons.php:74
2044
+ msgctxt "seconds"
2045
+ msgid "sec"
2046
+ msgstr ""
2047
+
2048
+ #: templates/debug/plugins-themes-sync.php:23
2049
+ msgid "Plugins & Themes Sync"
2050
+ msgstr ""
2051
+
2052
+ #: templates/debug/plugins-themes-sync.php:28
2053
+ msgid "Total"
2054
+ msgstr ""
2055
+
2056
+ #: templates/debug/plugins-themes-sync.php:29, templates/debug/scheduled-crons.php:84
2057
+ msgid "Last"
2058
+ msgstr ""
2059
+
2060
+ #: templates/debug/scheduled-crons.php:76
2061
+ msgid "Scheduled Crons"
2062
+ msgstr ""
2063
+
2064
+ #: templates/debug/scheduled-crons.php:81
2065
+ msgid "Module"
2066
+ msgstr ""
2067
+
2068
+ #: templates/debug/scheduled-crons.php:82
2069
+ msgid "Module Type"
2070
+ msgstr ""
2071
+
2072
+ #: templates/debug/scheduled-crons.php:83
2073
+ msgid "Cron Type"
2074
+ msgstr ""
2075
+
2076
+ #: templates/debug/scheduled-crons.php:85
2077
+ msgid "Next"
2078
+ msgstr ""
2079
+
2080
+ #: templates/forms/affiliation.php:82
2081
+ msgid "Non-expiring"
2082
+ msgstr ""
2083
+
2084
+ #: templates/forms/affiliation.php:85
2085
+ msgid "Apply to become an affiliate"
2086
+ msgstr ""
2087
+
2088
+ #: templates/forms/affiliation.php:107
2089
+ msgid "Your affiliate application for %s has been accepted! Log in to your affiliate area at: %s."
2090
+ msgstr ""
2091
+
2092
+ #: templates/forms/affiliation.php:122
2093
+ msgid "Thank you for applying for our affiliate program, we'll review your details during the next 14 days and will get back to you with further information."
2094
+ msgstr ""
2095
+
2096
+ #: templates/forms/affiliation.php:125
2097
+ msgid "Your affiliation account was temporarily suspended."
2098
+ msgstr ""
2099
+
2100
+ #: templates/forms/affiliation.php:128
2101
+ msgid "Thank you for applying for our affiliate program, unfortunately, we've decided at this point to reject your application. Please try again in 30 days."
2102
+ msgstr ""
2103
+
2104
+ #: templates/forms/affiliation.php:131
2105
+ msgid "Due to violation of our affiliation terms, we decided to temporarily block your affiliation account. If you have any questions, please contact support."
2106
+ msgstr ""
2107
+
2108
+ #: templates/forms/affiliation.php:144
2109
+ msgid "Like the %s? Become our ambassador and earn cash ;-)"
2110
+ msgstr ""
2111
+
2112
+ #: templates/forms/affiliation.php:145
2113
+ msgid "Refer new customers to our %s and earn %s commission on each successful sale you refer!"
2114
+ msgstr ""
2115
+
2116
+ #: templates/forms/affiliation.php:148
2117
+ msgid "Program Summary"
2118
+ msgstr ""
2119
+
2120
+ #: templates/forms/affiliation.php:150
2121
+ msgid "%s commission when a customer purchases a new license."
2122
+ msgstr ""
2123
+
2124
+ #: templates/forms/affiliation.php:152
2125
+ msgid "Get commission for automated subscription renewals."
2126
+ msgstr ""
2127
+
2128
+ #: templates/forms/affiliation.php:155
2129
+ msgid "%s tracking cookie after the first visit to maximize earnings potential."
2130
+ msgstr ""
2131
+
2132
+ #: templates/forms/affiliation.php:158
2133
+ msgid "Unlimited commissions."
2134
+ msgstr ""
2135
+
2136
+ #: templates/forms/affiliation.php:160
2137
+ msgid "%s minimum payout amount."
2138
+ msgstr ""
2139
+
2140
+ #: templates/forms/affiliation.php:161
2141
+ msgid "Payouts are in USD and processed monthly via PayPal."
2142
+ msgstr ""
2143
+
2144
+ #: templates/forms/affiliation.php:162
2145
+ msgid "As we reserve 30 days for potential refunds, we only pay commissions that are older than 30 days."
2146
+ msgstr ""
2147
+
2148
+ #: templates/forms/affiliation.php:165
2149
+ msgid "Affiliate"
2150
+ msgstr ""
2151
+
2152
+ #: templates/forms/affiliation.php:168, templates/forms/resend-key.php:23
2153
+ msgid "Email address"
2154
+ msgstr ""
2155
+
2156
+ #: templates/forms/affiliation.php:172
2157
+ msgid "Full name"
2158
+ msgstr ""
2159
+
2160
+ #: templates/forms/affiliation.php:176
2161
+ msgid "PayPal account email address"
2162
+ msgstr ""
2163
+
2164
+ #: templates/forms/affiliation.php:180
2165
+ msgid "Where are you going to promote the %s?"
2166
+ msgstr ""
2167
+
2168
+ #: templates/forms/affiliation.php:182
2169
+ msgid "Enter the domain of your website or other websites from where you plan to promote the %s."
2170
+ msgstr ""
2171
+
2172
+ #: templates/forms/affiliation.php:184
2173
+ msgid "Add another domain"
2174
+ msgstr ""
2175
+
2176
+ #: templates/forms/affiliation.php:188
2177
+ msgid "Extra Domains"
2178
+ msgstr ""
2179
+
2180
+ #: templates/forms/affiliation.php:189
2181
+ msgid "Extra domains where you will be marketing the product from."
2182
+ msgstr ""
2183
+
2184
+ #: templates/forms/affiliation.php:199
2185
+ msgid "Promotion methods"
2186
+ msgstr ""
2187
+
2188
+ #: templates/forms/affiliation.php:202
2189
+ msgid "Social media (Facebook, Twitter, etc.)"
2190
+ msgstr ""
2191
+
2192
+ #: templates/forms/affiliation.php:206
2193
+ msgid "Mobile apps"
2194
+ msgstr ""
2195
+
2196
+ #: templates/forms/affiliation.php:210
2197
+ msgid "Website, email, and social media statistics (optional)"
2198
+ msgstr ""
2199
+
2200
+ #: templates/forms/affiliation.php:213
2201
+ msgid "Please feel free to provide any relevant website or social media statistics, e.g. monthly unique site visits, number of email subscribers, followers, etc. (we will keep this information confidential)."
2202
+ msgstr ""
2203
+
2204
+ #: templates/forms/affiliation.php:217
2205
+ msgid "How will you promote us?"
2206
+ msgstr ""
2207
+
2208
+ #: templates/forms/affiliation.php:220
2209
+ msgid "Please provide details on how you intend to promote %s (please be as specific as possible)."
2210
+ msgstr ""
2211
+
2212
+ #: templates/forms/affiliation.php:232, templates/forms/resend-key.php:22
2213
+ msgid "Cancel"
2214
+ msgstr ""
2215
+
2216
+ #: templates/forms/affiliation.php:234
2217
+ msgid "Become an affiliate"
2218
+ msgstr ""
2219
+
2220
+ #: templates/forms/data-debug-mode.php:25
2221
+ msgid "Please enter the license key to enable the debug mode:"
2222
+ msgstr ""
2223
+
2224
+ #: templates/forms/data-debug-mode.php:27
2225
+ msgid "To enter the debug mode, please enter the secret key of the license owner (UserID = %d), which you can find in your \"My Profile\" section of your User Dashboard:"
2226
+ msgstr ""
2227
+
2228
+ #: templates/forms/data-debug-mode.php:32
2229
+ msgid "Submit"
2230
+ msgstr ""
2231
+
2232
+ #: templates/forms/data-debug-mode.php:36
2233
+ msgid "User key"
2234
+ msgstr ""
2235
+
2236
+ #: templates/forms/license-activation.php:23
2237
+ msgid "Please enter the license key that you received in the email right after the purchase:"
2238
+ msgstr ""
2239
+
2240
+ #: templates/forms/license-activation.php:28
2241
+ msgid "Update License"
2242
+ msgstr ""
2243
+
2244
+ #: templates/forms/license-activation.php:181
2245
+ msgid "Associate with the license owner's account."
2246
+ msgstr ""
2247
+
2248
+ #: templates/forms/optout.php:30
2249
+ msgctxt "verb"
2250
+ msgid "Opt Out"
2251
+ msgstr ""
2252
+
2253
+ #: templates/forms/optout.php:31
2254
+ msgctxt "verb"
2255
+ msgid "Opt In"
2256
+ msgstr ""
2257
+
2258
+ #: templates/forms/optout.php:34
2259
+ msgid "Connectivity to the licensing engine was successfully re-established. Automatic security & feature updates are now available through the WP Admin Dashboard."
2260
+ msgstr ""
2261
+
2262
+ #: templates/forms/optout.php:36
2263
+ msgid "Warning: Opting out will block automatic updates"
2264
+ msgstr ""
2265
+
2266
+ #: templates/forms/optout.php:37
2267
+ msgid "Ongoing connectivity with the licensing engine is essential for receiving automatic security & feature updates of the paid product. To receive these updates, data like your license key, %1$s version, and WordPress version, is periodically sent to the server to check for updates. By opting out, you understand that your site won't receive automatic updates for %2$s from within the WP Admin Dashboard. This can put your site at risk, and we highly recommend to keep this connection active. If you do choose to opt-out, you'll need to check for %1$s updates and install them manually."
2268
+ msgstr ""
2269
+
2270
+ #: templates/forms/optout.php:39
2271
+ msgid "I'd like to keep automatic updates"
2272
+ msgstr ""
2273
+
2274
+ #: templates/forms/optout.php:44
2275
+ msgid "Usage tracking is done in the name of making %s better. Making a better user experience, prioritizing new features, and more good things. We'd really appreciate if you'll reconsider letting us continue with the tracking."
2276
+ msgstr ""
2277
+
2278
+ #: templates/forms/optout.php:45
2279
+ msgid "On second thought - I want to continue helping"
2280
+ msgstr ""
2281
+
2282
+ #: templates/forms/optout.php:49
2283
+ msgid "By clicking \"Opt Out\", we will no longer be sending any data from %s to %s."
2284
+ msgstr ""
2285
+
2286
+ #: templates/forms/optout.php:74
2287
+ msgid "Plugins & themes tracking"
2288
+ msgstr ""
2289
+
2290
+ #: templates/forms/optout.php:261
2291
+ msgid "Saved"
2292
+ msgstr ""
2293
+
2294
+ #: templates/forms/premium-versions-upgrade-handler.php:40
2295
+ msgid "There is a new version of %s available."
2296
+ msgstr ""
2297
+
2298
+ #: templates/forms/premium-versions-upgrade-handler.php:41
2299
+ msgid " %s to access version %s security & feature updates, and support."
2300
+ msgstr ""
2301
+
2302
+ #: templates/forms/premium-versions-upgrade-handler.php:54
2303
+ msgid "New Version Available"
2304
+ msgstr ""
2305
+
2306
+ #: templates/forms/premium-versions-upgrade-handler.php:75
2307
+ msgctxt "close a window"
2308
+ msgid "Dismiss"
2309
+ msgstr ""
2310
+
2311
+ #: templates/forms/resend-key.php:21
2312
+ msgid "Send License Key"
2313
+ msgstr ""
2314
+
2315
+ #: templates/forms/resend-key.php:57
2316
+ msgid "Enter the email address you've used for the upgrade below and we will resend you the license key."
2317
+ msgstr ""
2318
+
2319
+ #: templates/forms/subscription-cancellation.php:37
2320
+ msgid "Deactivating or uninstalling the %s will automatically disable the license, which you'll be able to use on another site."
2321
+ msgstr ""
2322
+
2323
+ #: templates/forms/subscription-cancellation.php:47
2324
+ msgid "In case you are NOT planning on using this %s on this site (or any other site) - would you like to cancel the %s as well?"
2325
+ msgstr ""
2326
+
2327
+ #: templates/forms/subscription-cancellation.php:52
2328
+ msgid "license"
2329
+ msgstr ""
2330
+
2331
+ #: templates/forms/subscription-cancellation.php:57
2332
+ msgid "Cancel %s - I no longer need any security & feature updates, nor support for %s because I'm not planning to use the %s on this, or any other site."
2333
+ msgstr ""
2334
+
2335
+ #: templates/forms/subscription-cancellation.php:68
2336
+ msgid "Don't cancel %s - I'm still interested in getting security & feature updates, as well as be able to contact support."
2337
+ msgstr ""
2338
+
2339
+ #: templates/forms/subscription-cancellation.php:103
2340
+ msgid "Once your license expires you will no longer be able to use the %s, unless you activate it again with a valid premium license."
2341
+ msgstr ""
2342
+
2343
+ #: templates/forms/subscription-cancellation.php:136
2344
+ msgid "Cancel %s?"
2345
+ msgstr ""
2346
+
2347
+ #: templates/forms/subscription-cancellation.php:143
2348
+ msgid "Proceed"
2349
+ msgstr ""
2350
+
2351
+ #: templates/forms/subscription-cancellation.php:191, templates/forms/deactivation/form.php:171
2352
+ msgid "Cancel %s & Proceed"
2353
+ msgstr ""
2354
+
2355
+ #: templates/forms/trial-start.php:22
2356
+ msgid "You are 1-click away from starting your %1$s-day free trial of the %2$s plan."
2357
+ msgstr ""
2358
+
2359
+ #: templates/forms/trial-start.php:28
2360
+ msgid "For compliance with the WordPress.org guidelines, before we start the trial we ask that you opt in with your user and non-sensitive site information, allowing the %s to periodically send data to %s to check for version updates and to validate your trial."
2361
+ msgstr ""
2362
+
2363
+ #: templates/forms/user-change.php:26
2364
+ msgid "By changing the user, you agree to transfer the account ownership to:"
2365
+ msgstr ""
2366
+
2367
+ #: templates/forms/user-change.php:28
2368
+ msgid "I Agree - Change User"
2369
+ msgstr ""
2370
+
2371
+ #: templates/forms/user-change.php:30
2372
+ msgid "Enter email address"
2373
+ msgstr ""
2374
+
2375
+ #: templates/forms/user-change.php:81
2376
+ msgctxt "close window"
2377
+ msgid "Dismiss"
2378
+ msgstr ""
2379
+
2380
+ #: templates/js/style-premium-theme.php:39
2381
+ msgid "Premium"
2382
+ msgstr ""
2383
+
2384
+ #: templates/js/style-premium-theme.php:42
2385
+ msgid "Beta"
2386
+ msgstr ""
2387
+
2388
+ #: templates/partials/network-activation.php:27
2389
+ msgid "Activate license on all sites in the network."
2390
+ msgstr ""
2391
+
2392
+ #: templates/partials/network-activation.php:28
2393
+ msgid "Apply on all sites in the network."
2394
+ msgstr ""
2395
+
2396
+ #: templates/partials/network-activation.php:31
2397
+ msgid "Activate license on all pending sites."
2398
+ msgstr ""
2399
+
2400
+ #: templates/partials/network-activation.php:32
2401
+ msgid "Apply on all pending sites."
2402
+ msgstr ""
2403
+
2404
+ #: templates/partials/network-activation.php:40, templates/partials/network-activation.php:74
2405
+ msgid "allow"
2406
+ msgstr ""
2407
+
2408
+ #: templates/partials/network-activation.php:43, templates/partials/network-activation.php:77
2409
+ msgid "delegate"
2410
+ msgstr ""
2411
+
2412
+ #: templates/partials/network-activation.php:47, templates/partials/network-activation.php:81
2413
+ msgid "skip"
2414
+ msgstr ""
2415
+
2416
+ #: templates/plugin-info/description.php:72, templates/plugin-info/screenshots.php:31
2417
+ msgid "Click to view full-size screenshot %d"
2418
+ msgstr ""
2419
+
2420
+ #: templates/plugin-info/features.php:56
2421
+ msgid "Unlimited Updates"
2422
+ msgstr ""
2423
+
2424
+ #: templates/account/partials/activate-license-button.php:46
2425
+ msgid "Localhost"
2426
+ msgstr ""
2427
+
2428
+ #: templates/account/partials/activate-license-button.php:50
2429
+ msgctxt "as 5 licenses left"
2430
+ msgid "%s left"
2431
+ msgstr ""
2432
+
2433
+ #: templates/account/partials/activate-license-button.php:51
2434
+ msgid "Last license"
2435
+ msgstr ""
2436
+
2437
+ #. translators: %1$s: Either 'Downgrading your plan' or 'Cancelling the subscription'
2438
+ #: templates/account/partials/addon.php:29
2439
+ msgid "%1$s will immediately stop all future recurring payments and your %s plan license will expire in %s."
2440
+ msgstr ""
2441
+
2442
+ #: templates/account/partials/addon.php:185
2443
+ msgid "Cancelled"
2444
+ msgstr ""
2445
+
2446
+ #: templates/account/partials/addon.php:195
2447
+ msgid "No expiration"
2448
+ msgstr ""
2449
+
2450
+ #: templates/account/partials/site.php:189
2451
+ msgid "Owner Name"
2452
+ msgstr ""
2453
+
2454
+ #: templates/account/partials/site.php:201
2455
+ msgid "Owner Email"
2456
+ msgstr ""
2457
+
2458
+ #: templates/account/partials/site.php:213
2459
+ msgid "Owner ID"
2460
+ msgstr ""
2461
+
2462
+ #: templates/account/partials/site.php:286
2463
+ msgid "Subscription"
2464
+ msgstr ""
2465
+
2466
+ #: templates/forms/deactivation/contact.php:19
2467
+ msgid "Sorry for the inconvenience and we are here to help if you give us a chance."
2468
+ msgstr ""
2469
+
2470
+ #: templates/forms/deactivation/contact.php:22
2471
+ msgid "Contact Support"
2472
+ msgstr ""
2473
+
2474
+ #: templates/forms/deactivation/form.php:64
2475
+ msgid "Anonymous feedback"
2476
+ msgstr ""
2477
+
2478
+ #: templates/forms/deactivation/form.php:70
2479
+ msgid "Deactivate"
2480
+ msgstr ""
2481
+
2482
+ #: templates/forms/deactivation/form.php:72
2483
+ msgid "Activate %s"
2484
+ msgstr ""
2485
+
2486
+ #: templates/forms/deactivation/form.php:87
2487
+ msgid "Quick Feedback"
2488
+ msgstr ""
2489
+
2490
+ #: templates/forms/deactivation/form.php:91
2491
+ msgid "If you have a moment, please let us know why you are %s"
2492
+ msgstr ""
2493
+
2494
+ #: templates/forms/deactivation/form.php:91
2495
+ msgid "deactivating"
2496
+ msgstr ""
2497
+
2498
+ #: templates/forms/deactivation/form.php:91
2499
+ msgid "switching"
2500
+ msgstr ""
2501
+
2502
+ #: templates/forms/deactivation/form.php:369
2503
+ msgid "Submit & %s"
2504
+ msgstr ""
2505
+
2506
+ #: templates/forms/deactivation/form.php:390
2507
+ msgid "Kindly tell us the reason so we can improve."
2508
+ msgstr ""
2509
+
2510
+ #: templates/forms/deactivation/form.php:515
2511
+ msgid "Yes - %s"
2512
+ msgstr ""
2513
+
2514
+ #: templates/forms/deactivation/form.php:522
2515
+ msgid "Skip & %s"
2516
+ msgstr ""
2517
+
2518
+ #: templates/forms/deactivation/retry-skip.php:21
2519
+ msgid "Click here to use the plugin anonymously"
2520
+ msgstr ""
2521
+
2522
+ #: templates/forms/deactivation/retry-skip.php:23
2523
+ msgid "You might have missed it, but you don't have to share any data and can just %s the opt-in."
2524
+ msgstr ""
freemius/start.php CHANGED
@@ -1,530 +1,530 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.3
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * Freemius SDK Version.
15
- *
16
- * @var string
17
- */
18
- $this_sdk_version = '2.4.0.1';
19
-
20
- #region SDK Selection Logic --------------------------------------------------------------------
21
-
22
- /**
23
- * Special logic added on 1.1.6 to make sure that every Freemius powered plugin
24
- * will ALWAYS be loaded with the newest SDK from the active Freemius powered plugins.
25
- *
26
- * Since Freemius SDK is backward compatible, this will make sure that all Freemius powered
27
- * plugins will run correctly.
28
- *
29
- * @since 1.1.6
30
- */
31
-
32
- global $fs_active_plugins;
33
-
34
- if ( ! function_exists( 'fs_find_caller_plugin_file' ) ) {
35
- // Require SDK essentials.
36
- require_once dirname( __FILE__ ) . '/includes/fs-essential-functions.php';
37
- }
38
-
39
- /**
40
- * This complex logic fixes symlink issues (e.g. with Vargant). The logic assumes
41
- * that if it's a file from an SDK running in a theme, the location of the SDK
42
- * is in the main theme's folder.
43
- *
44
- * @author Vova Feldman (@svovaf)
45
- * @since 1.2.2.6
46
- */
47
- $file_path = fs_normalize_path( __FILE__ );
48
- $fs_root_path = dirname( $file_path );
49
- /**
50
- * Get the themes directory where the active theme is located (not passing the stylesheet will make WordPress
51
- * assume that the themes directory is inside `wp-content`.
52
- *
53
- * @author Leo Fajardo (@leorw)
54
- * @since 2.2.3
55
- */
56
- $themes_directory = get_theme_root( get_stylesheet() );
57
- $themes_directory_name = basename( $themes_directory );
58
- $theme_candidate_basename = basename( dirname( $fs_root_path ) ) . '/' . basename( $fs_root_path );
59
-
60
- if ( $file_path == fs_normalize_path( realpath( trailingslashit( $themes_directory ) . $theme_candidate_basename . '/' . basename( $file_path ) ) )
61
- ) {
62
- $this_sdk_relative_path = '../' . $themes_directory_name . '/' . $theme_candidate_basename;
63
- $is_theme = true;
64
- } else {
65
- $this_sdk_relative_path = plugin_basename( $fs_root_path );
66
- $is_theme = false;
67
- }
68
-
69
- if ( ! isset( $fs_active_plugins ) ) {
70
- // Load all Freemius powered active plugins.
71
- $fs_active_plugins = get_option( 'fs_active_plugins', new stdClass() );
72
-
73
- if ( ! isset( $fs_active_plugins->plugins ) ) {
74
- $fs_active_plugins->plugins = array();
75
- }
76
- }
77
-
78
- if ( empty( $fs_active_plugins->abspath ) ) {
79
- /**
80
- * Store the WP install absolute path reference to identify environment change
81
- * while replicating the storage.
82
- *
83
- * @author Vova Feldman (@svovaf)
84
- * @since 1.2.1.7
85
- */
86
- $fs_active_plugins->abspath = ABSPATH;
87
- } else {
88
- if ( ABSPATH !== $fs_active_plugins->abspath ) {
89
- /**
90
- * WordPress path has changed, cleanup the SDK references cache.
91
- * This resolves issues triggered when spinning a staging environments
92
- * while replicating the database.
93
- *
94
- * @author Vova Feldman (@svovaf)
95
- * @since 1.2.1.7
96
- */
97
- $fs_active_plugins->abspath = ABSPATH;
98
- $fs_active_plugins->plugins = array();
99
- unset( $fs_active_plugins->newest );
100
- } else {
101
- /**
102
- * Make sure SDK references are still valid. This resolves
103
- * issues when users hard delete modules via FTP.
104
- *
105
- * @author Vova Feldman (@svovaf)
106
- * @since 1.2.1.7
107
- */
108
- $has_changes = false;
109
- foreach ( $fs_active_plugins->plugins as $sdk_path => $data ) {
110
- if ( ! file_exists( ( isset( $data->type ) && 'theme' === $data->type ? $themes_directory : WP_PLUGIN_DIR ) . '/' . $sdk_path ) ) {
111
- unset( $fs_active_plugins->plugins[ $sdk_path ] );
112
-
113
- if (
114
- ! empty( $fs_active_plugins->newest ) &&
115
- $sdk_path === $fs_active_plugins->newest->sdk_path
116
- ) {
117
- unset( $fs_active_plugins->newest );
118
- }
119
-
120
- $has_changes = true;
121
- }
122
- }
123
-
124
- if ( $has_changes ) {
125
- if ( empty( $fs_active_plugins->plugins ) ) {
126
- unset( $fs_active_plugins->newest );
127
- }
128
-
129
- update_option( 'fs_active_plugins', $fs_active_plugins );
130
- }
131
- }
132
- }
133
-
134
- if ( ! function_exists( 'fs_find_direct_caller_plugin_file' ) ) {
135
- require_once dirname( __FILE__ ) . '/includes/supplements/fs-essential-functions-1.1.7.1.php';
136
- }
137
-
138
- if ( ! function_exists( 'fs_get_plugins' ) ) {
139
- require_once dirname( __FILE__ ) . '/includes/supplements/fs-essential-functions-2.2.1.php';
140
- }
141
-
142
- // Update current SDK info based on the SDK path.
143
- if ( ! isset( $fs_active_plugins->plugins[ $this_sdk_relative_path ] ) ||
144
- $this_sdk_version != $fs_active_plugins->plugins[ $this_sdk_relative_path ]->version
145
- ) {
146
- if ( $is_theme ) {
147
- $plugin_path = basename( dirname( $this_sdk_relative_path ) );
148
- } else {
149
- $plugin_path = plugin_basename( fs_find_direct_caller_plugin_file( $file_path ) );
150
- }
151
-
152
- $fs_active_plugins->plugins[ $this_sdk_relative_path ] = (object) array(
153
- 'version' => $this_sdk_version,
154
- 'type' => ( $is_theme ? 'theme' : 'plugin' ),
155
- 'timestamp' => time(),
156
- 'plugin_path' => $plugin_path,
157
- );
158
- }
159
-
160
- $is_current_sdk_newest = isset( $fs_active_plugins->newest ) && ( $this_sdk_relative_path == $fs_active_plugins->newest->sdk_path );
161
-
162
- if ( ! isset( $fs_active_plugins->newest ) ) {
163
- /**
164
- * This will be executed only once, for the first time a Freemius powered plugin is activated.
165
- */
166
- fs_update_sdk_newest_version( $this_sdk_relative_path, $fs_active_plugins->plugins[ $this_sdk_relative_path ]->plugin_path );
167
-
168
- $is_current_sdk_newest = true;
169
- } else if ( version_compare( $fs_active_plugins->newest->version, $this_sdk_version, '<' ) ) {
170
- /**
171
- * Current SDK is newer than the newest stored SDK.
172
- */
173
- fs_update_sdk_newest_version( $this_sdk_relative_path, $fs_active_plugins->plugins[ $this_sdk_relative_path ]->plugin_path );
174
-
175
- if ( class_exists( 'Freemius' ) ) {
176
- // Older SDK version was already loaded.
177
-
178
- if ( ! $fs_active_plugins->newest->in_activation ) {
179
- // Re-order plugins to load this plugin first.
180
- fs_newest_sdk_plugin_first();
181
- }
182
-
183
- // Refresh page.
184
- fs_redirect( $_SERVER['REQUEST_URI'] );
185
- }
186
- } else {
187
- if ( ! function_exists( 'get_plugins' ) ) {
188
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
189
- }
190
-
191
- $fs_newest_sdk = $fs_active_plugins->newest;
192
- $fs_newest_sdk = $fs_active_plugins->plugins[ $fs_newest_sdk->sdk_path ];
193
-
194
- $is_newest_sdk_type_theme = ( isset( $fs_newest_sdk->type ) && 'theme' === $fs_newest_sdk->type );
195
-
196
- if ( ! $is_newest_sdk_type_theme ) {
197
- $is_newest_sdk_plugin_active = is_plugin_active( $fs_newest_sdk->plugin_path );
198
- } else {
199
- $current_theme = wp_get_theme();
200
- $is_newest_sdk_plugin_active = ( $current_theme->stylesheet === $fs_newest_sdk->plugin_path );
201
-
202
- $current_theme_parent = $current_theme->parent();
203
-
204
- /**
205
- * If the current theme is a child of the theme that has the newest SDK, this prevents a redirects loop
206
- * from happening by keeping the SDK info stored in the `fs_active_plugins` option.
207
- */
208
- if ( ! $is_newest_sdk_plugin_active && $current_theme_parent instanceof WP_Theme ) {
209
- $is_newest_sdk_plugin_active = ( $fs_newest_sdk->plugin_path === $current_theme_parent->stylesheet );
210
- }
211
- }
212
-
213
- if ( $is_current_sdk_newest &&
214
- ! $is_newest_sdk_plugin_active &&
215
- ! $fs_active_plugins->newest->in_activation
216
- ) {
217
- // If current SDK is the newest and the plugin is NOT active, it means
218
- // that the current plugin in activation mode.
219
- $fs_active_plugins->newest->in_activation = true;
220
- update_option( 'fs_active_plugins', $fs_active_plugins );
221
- }
222
-
223
- if ( ! $is_theme ) {
224
- $sdk_starter_path = fs_normalize_path( WP_PLUGIN_DIR . '/' . $this_sdk_relative_path . '/start.php' );
225
- } else {
226
- $sdk_starter_path = fs_normalize_path(
227
- $themes_directory
228
- . '/'
229
- . str_replace( "../{$themes_directory_name}/", '', $this_sdk_relative_path )
230
- . '/start.php' );
231
- }
232
-
233
- $is_newest_sdk_path_valid = ( $is_newest_sdk_plugin_active || $fs_active_plugins->newest->in_activation ) && file_exists( $sdk_starter_path );
234
-
235
- if ( ! $is_newest_sdk_path_valid && ! $is_current_sdk_newest ) {
236
- // Plugin with newest SDK is no longer active, or SDK was moved to a different location.
237
- unset( $fs_active_plugins->plugins[ $fs_active_plugins->newest->sdk_path ] );
238
- }
239
-
240
- if ( ! ( $is_newest_sdk_plugin_active || $fs_active_plugins->newest->in_activation ) ||
241
- ! $is_newest_sdk_path_valid ||
242
- // Is newest SDK downgraded.
243
- ( $this_sdk_relative_path == $fs_active_plugins->newest->sdk_path &&
244
- version_compare( $fs_active_plugins->newest->version, $this_sdk_version, '>' ) )
245
- ) {
246
- /**
247
- * Plugin with newest SDK is no longer active.
248
- * OR
249
- * The newest SDK was in the current plugin. BUT, seems like the version of
250
- * the SDK was downgraded to a lower SDK.
251
- */
252
- // Find the active plugin with the newest SDK version and update the newest reference.
253
- fs_fallback_to_newest_active_sdk();
254
- } else {
255
- if ( $is_newest_sdk_plugin_active &&
256
- $this_sdk_relative_path == $fs_active_plugins->newest->sdk_path &&
257
- ( $fs_active_plugins->newest->in_activation ||
258
- ( class_exists( 'Freemius' ) && ( ! defined( 'WP_FS__SDK_VERSION' ) || version_compare( WP_FS__SDK_VERSION, $this_sdk_version, '<' ) ) )
259
- )
260
-
261
- ) {
262
- if ( $fs_active_plugins->newest->in_activation && ! $is_newest_sdk_type_theme ) {
263
- // Plugin no more in activation.
264
- $fs_active_plugins->newest->in_activation = false;
265
- update_option( 'fs_active_plugins', $fs_active_plugins );
266
- }
267
-
268
- // Reorder plugins to load plugin with newest SDK first.
269
- if ( fs_newest_sdk_plugin_first() ) {
270
- // Refresh page after re-order to make sure activated plugin loads newest SDK.
271
- if ( class_exists( 'Freemius' ) ) {
272
- fs_redirect( $_SERVER['REQUEST_URI'] );
273
- }
274
- }
275
- }
276
- }
277
- }
278
-
279
- if ( class_exists( 'Freemius' ) ) {
280
- // SDK was already loaded.
281
- return;
282
- }
283
-
284
- if ( version_compare( $this_sdk_version, $fs_active_plugins->newest->version, '<' ) ) {
285
- $newest_sdk = $fs_active_plugins->plugins[ $fs_active_plugins->newest->sdk_path ];
286
-
287
- $plugins_or_theme_dir_path = ( ! isset( $newest_sdk->type ) || 'theme' !== $newest_sdk->type ) ?
288
- WP_PLUGIN_DIR :
289
- $themes_directory;
290
-
291
- $newest_sdk_starter = fs_normalize_path(
292
- $plugins_or_theme_dir_path
293
- . '/'
294
- . str_replace( "../{$themes_directory_name}/", '', $fs_active_plugins->newest->sdk_path )
295
- . '/start.php' );
296
-
297
- if ( file_exists( $newest_sdk_starter ) ) {
298
- // Reorder plugins to load plugin with newest SDK first.
299
- fs_newest_sdk_plugin_first();
300
-
301
- // There's a newer SDK version, load it instead of the current one!
302
- require_once $newest_sdk_starter;
303
-
304
- return;
305
- }
306
- }
307
-
308
- #endregion SDK Selection Logic --------------------------------------------------------------------
309
-
310
- #region Hooks & Filters Collection --------------------------------------------------------------------
311
-
312
- /**
313
- * Freemius hooks (actions & filters) tags structure:
314
- *
315
- * fs_{filter/action_name}_{plugin_slug}
316
- *
317
- * --------------------------------------------------------
318
- *
319
- * Usage with WordPress' add_action() / add_filter():
320
- *
321
- * add_action('fs_{filter/action_name}_{plugin_slug}', $callable);
322
- *
323
- * --------------------------------------------------------
324
- *
325
- * Usage with Freemius' instance add_action() / add_filter():
326
- *
327
- * // No need to add 'fs_' prefix nor '_{plugin_slug}' suffix.
328
- * my_freemius()->add_action('{action_name}', $callable);
329
- *
330
- * --------------------------------------------------------
331
- *
332
- * Freemius filters collection:
333
- *
334
- * fs_connect_url_{plugin_slug}
335
- * fs_trial_promotion_message_{plugin_slug}
336
- * fs_is_long_term_user_{plugin_slug}
337
- * fs_uninstall_reasons_{plugin_slug}
338
- * fs_is_plugin_update_{plugin_slug}
339
- * fs_api_domains_{plugin_slug}
340
- * fs_email_template_sections_{plugin_slug}
341
- * fs_support_forum_submenu_{plugin_slug}
342
- * fs_support_forum_url_{plugin_slug}
343
- * fs_connect_message_{plugin_slug}
344
- * fs_connect_message_on_update_{plugin_slug}
345
- * fs_uninstall_confirmation_message_{plugin_slug}
346
- * fs_pending_activation_message_{plugin_slug}
347
- * fs_is_submenu_visible_{plugin_slug}
348
- * fs_plugin_icon_{plugin_slug}
349
- * fs_show_trial_{plugin_slug}
350
- *
351
- * --------------------------------------------------------
352
- *
353
- * Freemius actions collection:
354
- *
355
- * fs_after_license_loaded_{plugin_slug}
356
- * fs_after_license_change_{plugin_slug}
357
- * fs_after_plans_sync_{plugin_slug}
358
- *
359
- * fs_after_account_details_{plugin_slug}
360
- * fs_after_account_user_sync_{plugin_slug}
361
- * fs_after_account_plan_sync_{plugin_slug}
362
- * fs_before_account_load_{plugin_slug}
363
- * fs_after_account_connection_{plugin_slug}
364
- * fs_account_property_edit_{plugin_slug}
365
- * fs_account_email_verified_{plugin_slug}
366
- * fs_account_page_load_before_departure_{plugin_slug}
367
- * fs_before_account_delete_{plugin_slug}
368
- * fs_after_account_delete_{plugin_slug}
369
- *
370
- * fs_sdk_version_update_{plugin_slug}
371
- * fs_plugin_version_update_{plugin_slug}
372
- *
373
- * fs_initiated_{plugin_slug}
374
- * fs_after_init_plugin_registered_{plugin_slug}
375
- * fs_after_init_plugin_anonymous_{plugin_slug}
376
- * fs_after_init_plugin_pending_activations_{plugin_slug}
377
- * fs_after_init_addon_registered_{plugin_slug}
378
- * fs_after_init_addon_anonymous_{plugin_slug}
379
- * fs_after_init_addon_pending_activations_{plugin_slug}
380
- *
381
- * fs_after_premium_version_activation_{plugin_slug}
382
- * fs_after_free_version_reactivation_{plugin_slug}
383
- *
384
- * fs_after_uninstall_{plugin_slug}
385
- * fs_before_admin_menu_init_{plugin_slug}
386
- */
387
-
388
- #endregion Hooks & Filters Collection --------------------------------------------------------------------
389
-
390
- if ( ! class_exists( 'Freemius' ) ) {
391
-
392
- if ( ! defined( 'WP_FS__SDK_VERSION' ) ) {
393
- define( 'WP_FS__SDK_VERSION', $this_sdk_version );
394
- }
395
-
396
- $plugins_or_theme_dir_path = fs_normalize_path( trailingslashit( $is_theme ?
397
- $themes_directory :
398
- WP_PLUGIN_DIR ) );
399
-
400
- if ( 0 === strpos( $file_path, $plugins_or_theme_dir_path ) ) {
401
- // No symlinks
402
- } else {
403
- /**
404
- * This logic finds the SDK symlink and set WP_FS__DIR to use it.
405
- *
406
- * @author Vova Feldman (@svovaf)
407
- * @since 1.2.2.5
408
- */
409
- $sdk_symlink = null;
410
-
411
- // Try to load SDK's symlink from cache.
412
- if ( isset( $fs_active_plugins->plugins[ $this_sdk_relative_path ] ) &&
413
- is_object( $fs_active_plugins->plugins[ $this_sdk_relative_path ] ) &&
414
- ! empty( $fs_active_plugins->plugins[ $this_sdk_relative_path ]->sdk_symlink )
415
- ) {
416
- $sdk_symlink = $fs_active_plugins->plugins[ $this_sdk_relative_path ]->sdk_symlink;
417
- if ( 0 === strpos( $sdk_symlink, $plugins_or_theme_dir_path ) ) {
418
- /**
419
- * Make the symlink path relative.
420
- *
421
- * @author Leo Fajardo (@leorw)
422
- */
423
- $sdk_symlink = substr( $sdk_symlink, strlen( $plugins_or_theme_dir_path ) );
424
-
425
- $fs_active_plugins->plugins[ $this_sdk_relative_path ]->sdk_symlink = $sdk_symlink;
426
- update_option( 'fs_active_plugins', $fs_active_plugins );
427
- }
428
-
429
- $realpath = realpath( $plugins_or_theme_dir_path . $sdk_symlink );
430
- if ( ! is_string( $realpath ) || ! file_exists( $realpath ) ) {
431
- $sdk_symlink = null;
432
- }
433
- }
434
-
435
- if ( empty( $sdk_symlink ) ) // Has symlinks, therefore, we need to configure WP_FS__DIR based on the symlink.
436
- {
437
- $partial_path_right = basename( $file_path );
438
- $partial_path_left = dirname( $file_path );
439
- $realpath = realpath( $plugins_or_theme_dir_path . $partial_path_right );
440
-
441
- while ( '/' !== $partial_path_left &&
442
- ( false === $realpath || $file_path !== fs_normalize_path( $realpath ) )
443
- ) {
444
- $partial_path_right = trailingslashit( basename( $partial_path_left ) ) . $partial_path_right;
445
- $partial_path_left_prev = $partial_path_left;
446
- $partial_path_left = dirname( $partial_path_left_prev );
447
-
448
- /**
449
- * Avoid infinite loop if for example `$partial_path_left_prev` is `C:/`, in this case,
450
- * `dirname( 'C:/' )` will return `C:/`.
451
- *
452
- * @author Leo Fajardo (@leorw)
453
- */
454
- if ( $partial_path_left === $partial_path_left_prev ) {
455
- $partial_path_left = '';
456
- break;
457
- }
458
-
459
- $realpath = realpath( $plugins_or_theme_dir_path . $partial_path_right );
460
- }
461
-
462
- if ( ! empty( $partial_path_left ) && '/' !== $partial_path_left ) {
463
- $sdk_symlink = fs_normalize_path( dirname( $partial_path_right ) );
464
-
465
- // Cache value.
466
- if ( isset( $fs_active_plugins->plugins[ $this_sdk_relative_path ] ) &&
467
- is_object( $fs_active_plugins->plugins[ $this_sdk_relative_path ] )
468
- ) {
469
- $fs_active_plugins->plugins[ $this_sdk_relative_path ]->sdk_symlink = $sdk_symlink;
470
- update_option( 'fs_active_plugins', $fs_active_plugins );
471
- }
472
- }
473
- }
474
-
475
- if ( ! empty( $sdk_symlink ) ) {
476
- // Set SDK dir to the symlink path.
477
- define( 'WP_FS__DIR', $plugins_or_theme_dir_path . $sdk_symlink );
478
- }
479
- }
480
-
481
- // Load SDK files.
482
- require_once dirname( __FILE__ ) . '/require.php';
483
-
484
- /**
485
- * Quick shortcut to get Freemius for specified plugin.
486
- * Used by various templates.
487
- *
488
- * @param number $module_id
489
- *
490
- * @return Freemius
491
- */
492
- function freemius( $module_id ) {
493
- return Freemius::instance( $module_id );
494
- }
495
-
496
- /**
497
- * @param string $slug
498
- * @param number $plugin_id
499
- * @param string $public_key
500
- * @param bool $is_live Is live or test plugin.
501
- * @param bool $is_premium Hints freemius if running the premium plugin or not.
502
- *
503
- * @return Freemius
504
- *
505
- * @deprecated Please use fs_dynamic_init().
506
- */
507
- function fs_init( $slug, $plugin_id, $public_key, $is_live = true, $is_premium = true ) {
508
- $fs = Freemius::instance( $plugin_id, $slug, true );
509
- $fs->init( $plugin_id, $public_key, $is_live, $is_premium );
510
-
511
- return $fs;
512
- }
513
-
514
- /**
515
- * @param array <string,string> $module Plugin or Theme details.
516
- *
517
- * @return Freemius
518
- * @throws Freemius_Exception
519
- */
520
- function fs_dynamic_init( $module ) {
521
- $fs = Freemius::instance( $module['id'], $module['slug'], true );
522
- $fs->dynamic_init( $module );
523
-
524
- return $fs;
525
- }
526
-
527
- function fs_dump_log() {
528
- FS_Logger::dump();
529
- }
530
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Freemius SDK Version.
15
+ *
16
+ * @var string
17
+ */
18
+ $this_sdk_version = '2.4.1';
19
+
20
+ #region SDK Selection Logic --------------------------------------------------------------------
21
+
22
+ /**
23
+ * Special logic added on 1.1.6 to make sure that every Freemius powered plugin
24
+ * will ALWAYS be loaded with the newest SDK from the active Freemius powered plugins.
25
+ *
26
+ * Since Freemius SDK is backward compatible, this will make sure that all Freemius powered
27
+ * plugins will run correctly.
28
+ *
29
+ * @since 1.1.6
30
+ */
31
+
32
+ global $fs_active_plugins;
33
+
34
+ if ( ! function_exists( 'fs_find_caller_plugin_file' ) ) {
35
+ // Require SDK essentials.
36
+ require_once dirname( __FILE__ ) . '/includes/fs-essential-functions.php';
37
+ }
38
+
39
+ /**
40
+ * This complex logic fixes symlink issues (e.g. with Vargant). The logic assumes
41
+ * that if it's a file from an SDK running in a theme, the location of the SDK
42
+ * is in the main theme's folder.
43
+ *
44
+ * @author Vova Feldman (@svovaf)
45
+ * @since 1.2.2.6
46
+ */
47
+ $file_path = fs_normalize_path( __FILE__ );
48
+ $fs_root_path = dirname( $file_path );
49
+ /**
50
+ * Get the themes directory where the active theme is located (not passing the stylesheet will make WordPress
51
+ * assume that the themes directory is inside `wp-content`.
52
+ *
53
+ * @author Leo Fajardo (@leorw)
54
+ * @since 2.2.3
55
+ */
56
+ $themes_directory = get_theme_root( get_stylesheet() );
57
+ $themes_directory_name = basename( $themes_directory );
58
+ $theme_candidate_basename = basename( dirname( $fs_root_path ) ) . '/' . basename( $fs_root_path );
59
+
60
+ if ( $file_path == fs_normalize_path( realpath( trailingslashit( $themes_directory ) . $theme_candidate_basename . '/' . basename( $file_path ) ) )
61
+ ) {
62
+ $this_sdk_relative_path = '../' . $themes_directory_name . '/' . $theme_candidate_basename;
63
+ $is_theme = true;
64
+ } else {
65
+ $this_sdk_relative_path = plugin_basename( $fs_root_path );
66
+ $is_theme = false;
67
+ }
68
+
69
+ if ( ! isset( $fs_active_plugins ) ) {
70
+ // Load all Freemius powered active plugins.
71
+ $fs_active_plugins = get_option( 'fs_active_plugins', new stdClass() );
72
+
73
+ if ( ! isset( $fs_active_plugins->plugins ) ) {
74
+ $fs_active_plugins->plugins = array();
75
+ }
76
+ }
77
+
78
+ if ( empty( $fs_active_plugins->abspath ) ) {
79
+ /**
80
+ * Store the WP install absolute path reference to identify environment change
81
+ * while replicating the storage.
82
+ *
83
+ * @author Vova Feldman (@svovaf)
84
+ * @since 1.2.1.7
85
+ */
86
+ $fs_active_plugins->abspath = ABSPATH;
87
+ } else {
88
+ if ( ABSPATH !== $fs_active_plugins->abspath ) {
89
+ /**
90
+ * WordPress path has changed, cleanup the SDK references cache.
91
+ * This resolves issues triggered when spinning a staging environments
92
+ * while replicating the database.
93
+ *
94
+ * @author Vova Feldman (@svovaf)
95
+ * @since 1.2.1.7
96
+ */
97
+ $fs_active_plugins->abspath = ABSPATH;
98
+ $fs_active_plugins->plugins = array();
99
+ unset( $fs_active_plugins->newest );
100
+ } else {
101
+ /**
102
+ * Make sure SDK references are still valid. This resolves
103
+ * issues when users hard delete modules via FTP.
104
+ *
105
+ * @author Vova Feldman (@svovaf)
106
+ * @since 1.2.1.7
107
+ */
108
+ $has_changes = false;
109
+ foreach ( $fs_active_plugins->plugins as $sdk_path => $data ) {
110
+ if ( ! file_exists( ( isset( $data->type ) && 'theme' === $data->type ? $themes_directory : WP_PLUGIN_DIR ) . '/' . $sdk_path ) ) {
111
+ unset( $fs_active_plugins->plugins[ $sdk_path ] );
112
+
113
+ if (
114
+ ! empty( $fs_active_plugins->newest ) &&
115
+ $sdk_path === $fs_active_plugins->newest->sdk_path
116
+ ) {
117
+ unset( $fs_active_plugins->newest );
118
+ }
119
+
120
+ $has_changes = true;
121
+ }
122
+ }
123
+
124
+ if ( $has_changes ) {
125
+ if ( empty( $fs_active_plugins->plugins ) ) {
126
+ unset( $fs_active_plugins->newest );
127
+ }
128
+
129
+ update_option( 'fs_active_plugins', $fs_active_plugins );
130
+ }
131
+ }
132
+ }
133
+
134
+ if ( ! function_exists( 'fs_find_direct_caller_plugin_file' ) ) {
135
+ require_once dirname( __FILE__ ) . '/includes/supplements/fs-essential-functions-1.1.7.1.php';
136
+ }
137
+
138
+ if ( ! function_exists( 'fs_get_plugins' ) ) {
139
+ require_once dirname( __FILE__ ) . '/includes/supplements/fs-essential-functions-2.2.1.php';
140
+ }
141
+
142
+ // Update current SDK info based on the SDK path.
143
+ if ( ! isset( $fs_active_plugins->plugins[ $this_sdk_relative_path ] ) ||
144
+ $this_sdk_version != $fs_active_plugins->plugins[ $this_sdk_relative_path ]->version
145
+ ) {
146
+ if ( $is_theme ) {
147
+ $plugin_path = basename( dirname( $this_sdk_relative_path ) );
148
+ } else {
149
+ $plugin_path = plugin_basename( fs_find_direct_caller_plugin_file( $file_path ) );
150
+ }
151
+
152
+ $fs_active_plugins->plugins[ $this_sdk_relative_path ] = (object) array(
153
+ 'version' => $this_sdk_version,
154
+ 'type' => ( $is_theme ? 'theme' : 'plugin' ),
155
+ 'timestamp' => time(),
156
+ 'plugin_path' => $plugin_path,
157
+ );
158
+ }
159
+
160
+ $is_current_sdk_newest = isset( $fs_active_plugins->newest ) && ( $this_sdk_relative_path == $fs_active_plugins->newest->sdk_path );
161
+
162
+ if ( ! isset( $fs_active_plugins->newest ) ) {
163
+ /**
164
+ * This will be executed only once, for the first time a Freemius powered plugin is activated.
165
+ */
166
+ fs_update_sdk_newest_version( $this_sdk_relative_path, $fs_active_plugins->plugins[ $this_sdk_relative_path ]->plugin_path );
167
+
168
+ $is_current_sdk_newest = true;
169
+ } else if ( version_compare( $fs_active_plugins->newest->version, $this_sdk_version, '<' ) ) {
170
+ /**
171
+ * Current SDK is newer than the newest stored SDK.
172
+ */
173
+ fs_update_sdk_newest_version( $this_sdk_relative_path, $fs_active_plugins->plugins[ $this_sdk_relative_path ]->plugin_path );
174
+
175
+ if ( class_exists( 'Freemius' ) ) {
176
+ // Older SDK version was already loaded.
177
+
178
+ if ( ! $fs_active_plugins->newest->in_activation ) {
179
+ // Re-order plugins to load this plugin first.
180
+ fs_newest_sdk_plugin_first();
181
+ }
182
+
183
+ // Refresh page.
184
+ fs_redirect( $_SERVER['REQUEST_URI'] );
185
+ }
186
+ } else {
187
+ if ( ! function_exists( 'get_plugins' ) ) {
188
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
189
+ }
190
+
191
+ $fs_newest_sdk = $fs_active_plugins->newest;
192
+ $fs_newest_sdk = $fs_active_plugins->plugins[ $fs_newest_sdk->sdk_path ];
193
+
194
+ $is_newest_sdk_type_theme = ( isset( $fs_newest_sdk->type ) && 'theme' === $fs_newest_sdk->type );
195
+
196
+ if ( ! $is_newest_sdk_type_theme ) {
197
+ $is_newest_sdk_plugin_active = is_plugin_active( $fs_newest_sdk->plugin_path );
198
+ } else {
199
+ $current_theme = wp_get_theme();
200
+ $is_newest_sdk_plugin_active = ( $current_theme->stylesheet === $fs_newest_sdk->plugin_path );
201
+
202
+ $current_theme_parent = $current_theme->parent();
203
+
204
+ /**
205
+ * If the current theme is a child of the theme that has the newest SDK, this prevents a redirects loop
206
+ * from happening by keeping the SDK info stored in the `fs_active_plugins` option.
207
+ */
208
+ if ( ! $is_newest_sdk_plugin_active && $current_theme_parent instanceof WP_Theme ) {
209
+ $is_newest_sdk_plugin_active = ( $fs_newest_sdk->plugin_path === $current_theme_parent->stylesheet );
210
+ }
211
+ }
212
+
213
+ if ( $is_current_sdk_newest &&
214
+ ! $is_newest_sdk_plugin_active &&
215
+ ! $fs_active_plugins->newest->in_activation
216
+ ) {
217
+ // If current SDK is the newest and the plugin is NOT active, it means
218
+ // that the current plugin in activation mode.
219
+ $fs_active_plugins->newest->in_activation = true;
220
+ update_option( 'fs_active_plugins', $fs_active_plugins );
221
+ }
222
+
223
+ if ( ! $is_theme ) {
224
+ $sdk_starter_path = fs_normalize_path( WP_PLUGIN_DIR . '/' . $this_sdk_relative_path . '/start.php' );
225
+ } else {
226
+ $sdk_starter_path = fs_normalize_path(
227
+ $themes_directory
228
+ . '/'
229
+ . str_replace( "../{$themes_directory_name}/", '', $this_sdk_relative_path )
230
+ . '/start.php' );
231
+ }
232
+
233
+ $is_newest_sdk_path_valid = ( $is_newest_sdk_plugin_active || $fs_active_plugins->newest->in_activation ) && file_exists( $sdk_starter_path );
234
+
235
+ if ( ! $is_newest_sdk_path_valid && ! $is_current_sdk_newest ) {
236
+ // Plugin with newest SDK is no longer active, or SDK was moved to a different location.
237
+ unset( $fs_active_plugins->plugins[ $fs_active_plugins->newest->sdk_path ] );
238
+ }
239
+
240
+ if ( ! ( $is_newest_sdk_plugin_active || $fs_active_plugins->newest->in_activation ) ||
241
+ ! $is_newest_sdk_path_valid ||
242
+ // Is newest SDK downgraded.
243
+ ( $this_sdk_relative_path == $fs_active_plugins->newest->sdk_path &&
244
+ version_compare( $fs_active_plugins->newest->version, $this_sdk_version, '>' ) )
245
+ ) {
246
+ /**
247
+ * Plugin with newest SDK is no longer active.
248
+ * OR
249
+ * The newest SDK was in the current plugin. BUT, seems like the version of
250
+ * the SDK was downgraded to a lower SDK.
251
+ */
252
+ // Find the active plugin with the newest SDK version and update the newest reference.
253
+ fs_fallback_to_newest_active_sdk();
254
+ } else {
255
+ if ( $is_newest_sdk_plugin_active &&
256
+ $this_sdk_relative_path == $fs_active_plugins->newest->sdk_path &&
257
+ ( $fs_active_plugins->newest->in_activation ||
258
+ ( class_exists( 'Freemius' ) && ( ! defined( 'WP_FS__SDK_VERSION' ) || version_compare( WP_FS__SDK_VERSION, $this_sdk_version, '<' ) ) )
259
+ )
260
+
261
+ ) {
262
+ if ( $fs_active_plugins->newest->in_activation && ! $is_newest_sdk_type_theme ) {
263
+ // Plugin no more in activation.
264
+ $fs_active_plugins->newest->in_activation = false;
265
+ update_option( 'fs_active_plugins', $fs_active_plugins );
266
+ }
267
+
268
+ // Reorder plugins to load plugin with newest SDK first.
269
+ if ( fs_newest_sdk_plugin_first() ) {
270
+ // Refresh page after re-order to make sure activated plugin loads newest SDK.
271
+ if ( class_exists( 'Freemius' ) ) {
272
+ fs_redirect( $_SERVER['REQUEST_URI'] );
273
+ }
274
+ }
275
+ }
276
+ }
277
+ }
278
+
279
+ if ( class_exists( 'Freemius' ) ) {
280
+ // SDK was already loaded.
281
+ return;
282
+ }
283
+
284
+ if ( version_compare( $this_sdk_version, $fs_active_plugins->newest->version, '<' ) ) {
285
+ $newest_sdk = $fs_active_plugins->plugins[ $fs_active_plugins->newest->sdk_path ];
286
+
287
+ $plugins_or_theme_dir_path = ( ! isset( $newest_sdk->type ) || 'theme' !== $newest_sdk->type ) ?
288
+ WP_PLUGIN_DIR :
289
+ $themes_directory;
290
+
291
+ $newest_sdk_starter = fs_normalize_path(
292
+ $plugins_or_theme_dir_path
293
+ . '/'
294
+ . str_replace( "../{$themes_directory_name}/", '', $fs_active_plugins->newest->sdk_path )
295
+ . '/start.php' );
296
+
297
+ if ( file_exists( $newest_sdk_starter ) ) {
298
+ // Reorder plugins to load plugin with newest SDK first.
299
+ fs_newest_sdk_plugin_first();
300
+
301
+ // There's a newer SDK version, load it instead of the current one!
302
+ require_once $newest_sdk_starter;
303
+
304
+ return;
305
+ }
306
+ }
307
+
308
+ #endregion SDK Selection Logic --------------------------------------------------------------------
309
+
310
+ #region Hooks & Filters Collection --------------------------------------------------------------------
311
+
312
+ /**
313
+ * Freemius hooks (actions & filters) tags structure:
314
+ *
315
+ * fs_{filter/action_name}_{plugin_slug}
316
+ *
317
+ * --------------------------------------------------------
318
+ *
319
+ * Usage with WordPress' add_action() / add_filter():
320
+ *
321
+ * add_action('fs_{filter/action_name}_{plugin_slug}', $callable);
322
+ *
323
+ * --------------------------------------------------------
324
+ *
325
+ * Usage with Freemius' instance add_action() / add_filter():
326
+ *
327
+ * // No need to add 'fs_' prefix nor '_{plugin_slug}' suffix.
328
+ * my_freemius()->add_action('{action_name}', $callable);
329
+ *
330
+ * --------------------------------------------------------
331
+ *
332
+ * Freemius filters collection:
333
+ *
334
+ * fs_connect_url_{plugin_slug}
335
+ * fs_trial_promotion_message_{plugin_slug}
336
+ * fs_is_long_term_user_{plugin_slug}
337
+ * fs_uninstall_reasons_{plugin_slug}
338
+ * fs_is_plugin_update_{plugin_slug}
339
+ * fs_api_domains_{plugin_slug}
340
+ * fs_email_template_sections_{plugin_slug}
341
+ * fs_support_forum_submenu_{plugin_slug}
342
+ * fs_support_forum_url_{plugin_slug}
343
+ * fs_connect_message_{plugin_slug}
344
+ * fs_connect_message_on_update_{plugin_slug}
345
+ * fs_uninstall_confirmation_message_{plugin_slug}
346
+ * fs_pending_activation_message_{plugin_slug}
347
+ * fs_is_submenu_visible_{plugin_slug}
348
+ * fs_plugin_icon_{plugin_slug}
349
+ * fs_show_trial_{plugin_slug}
350
+ *
351
+ * --------------------------------------------------------
352
+ *
353
+ * Freemius actions collection:
354
+ *
355
+ * fs_after_license_loaded_{plugin_slug}
356
+ * fs_after_license_change_{plugin_slug}
357
+ * fs_after_plans_sync_{plugin_slug}
358
+ *
359
+ * fs_after_account_details_{plugin_slug}
360
+ * fs_after_account_user_sync_{plugin_slug}
361
+ * fs_after_account_plan_sync_{plugin_slug}
362
+ * fs_before_account_load_{plugin_slug}
363
+ * fs_after_account_connection_{plugin_slug}
364
+ * fs_account_property_edit_{plugin_slug}
365
+ * fs_account_email_verified_{plugin_slug}
366
+ * fs_account_page_load_before_departure_{plugin_slug}
367
+ * fs_before_account_delete_{plugin_slug}
368
+ * fs_after_account_delete_{plugin_slug}
369
+ *
370
+ * fs_sdk_version_update_{plugin_slug}
371
+ * fs_plugin_version_update_{plugin_slug}
372
+ *
373
+ * fs_initiated_{plugin_slug}
374
+ * fs_after_init_plugin_registered_{plugin_slug}
375
+ * fs_after_init_plugin_anonymous_{plugin_slug}
376
+ * fs_after_init_plugin_pending_activations_{plugin_slug}
377
+ * fs_after_init_addon_registered_{plugin_slug}
378
+ * fs_after_init_addon_anonymous_{plugin_slug}
379
+ * fs_after_init_addon_pending_activations_{plugin_slug}
380
+ *
381
+ * fs_after_premium_version_activation_{plugin_slug}
382
+ * fs_after_free_version_reactivation_{plugin_slug}
383
+ *
384
+ * fs_after_uninstall_{plugin_slug}
385
+ * fs_before_admin_menu_init_{plugin_slug}
386
+ */
387
+
388
+ #endregion Hooks & Filters Collection --------------------------------------------------------------------
389
+
390
+ if ( ! class_exists( 'Freemius' ) ) {
391
+
392
+ if ( ! defined( 'WP_FS__SDK_VERSION' ) ) {
393
+ define( 'WP_FS__SDK_VERSION', $this_sdk_version );
394
+ }
395
+
396
+ $plugins_or_theme_dir_path = fs_normalize_path( trailingslashit( $is_theme ?
397
+ $themes_directory :
398
+ WP_PLUGIN_DIR ) );
399
+
400
+ if ( 0 === strpos( $file_path, $plugins_or_theme_dir_path ) ) {
401
+ // No symlinks
402
+ } else {
403
+ /**
404
+ * This logic finds the SDK symlink and set WP_FS__DIR to use it.
405
+ *
406
+ * @author Vova Feldman (@svovaf)
407
+ * @since 1.2.2.5
408
+ */
409
+ $sdk_symlink = null;
410
+
411
+ // Try to load SDK's symlink from cache.
412
+ if ( isset( $fs_active_plugins->plugins[ $this_sdk_relative_path ] ) &&
413
+ is_object( $fs_active_plugins->plugins[ $this_sdk_relative_path ] ) &&
414
+ ! empty( $fs_active_plugins->plugins[ $this_sdk_relative_path ]->sdk_symlink )
415
+ ) {
416
+ $sdk_symlink = $fs_active_plugins->plugins[ $this_sdk_relative_path ]->sdk_symlink;
417
+ if ( 0 === strpos( $sdk_symlink, $plugins_or_theme_dir_path ) ) {
418
+ /**
419
+ * Make the symlink path relative.
420
+ *
421
+ * @author Leo Fajardo (@leorw)
422
+ */
423
+ $sdk_symlink = substr( $sdk_symlink, strlen( $plugins_or_theme_dir_path ) );
424
+
425
+ $fs_active_plugins->plugins[ $this_sdk_relative_path ]->sdk_symlink = $sdk_symlink;
426
+ update_option( 'fs_active_plugins', $fs_active_plugins );
427
+ }
428
+
429
+ $realpath = realpath( $plugins_or_theme_dir_path . $sdk_symlink );
430
+ if ( ! is_string( $realpath ) || ! file_exists( $realpath ) ) {
431
+ $sdk_symlink = null;
432
+ }
433
+ }
434
+
435
+ if ( empty( $sdk_symlink ) ) // Has symlinks, therefore, we need to configure WP_FS__DIR based on the symlink.
436
+ {
437
+ $partial_path_right = basename( $file_path );
438
+ $partial_path_left = dirname( $file_path );
439
+ $realpath = realpath( $plugins_or_theme_dir_path . $partial_path_right );
440
+
441
+ while ( '/' !== $partial_path_left &&
442
+ ( false === $realpath || $file_path !== fs_normalize_path( $realpath ) )
443
+ ) {
444
+ $partial_path_right = trailingslashit( basename( $partial_path_left ) ) . $partial_path_right;
445
+ $partial_path_left_prev = $partial_path_left;
446
+ $partial_path_left = dirname( $partial_path_left_prev );
447
+
448
+ /**
449
+ * Avoid infinite loop if for example `$partial_path_left_prev` is `C:/`, in this case,
450
+ * `dirname( 'C:/' )` will return `C:/`.
451
+ *
452
+ * @author Leo Fajardo (@leorw)
453
+ */
454
+ if ( $partial_path_left === $partial_path_left_prev ) {
455
+ $partial_path_left = '';
456
+ break;
457
+ }
458
+
459
+ $realpath = realpath( $plugins_or_theme_dir_path . $partial_path_right );
460
+ }
461
+
462
+ if ( ! empty( $partial_path_left ) && '/' !== $partial_path_left ) {
463
+ $sdk_symlink = fs_normalize_path( dirname( $partial_path_right ) );
464
+
465
+ // Cache value.
466
+ if ( isset( $fs_active_plugins->plugins[ $this_sdk_relative_path ] ) &&
467
+ is_object( $fs_active_plugins->plugins[ $this_sdk_relative_path ] )
468
+ ) {
469
+ $fs_active_plugins->plugins[ $this_sdk_relative_path ]->sdk_symlink = $sdk_symlink;
470
+ update_option( 'fs_active_plugins', $fs_active_plugins );
471
+ }
472
+ }
473
+ }
474
+
475
+ if ( ! empty( $sdk_symlink ) ) {
476
+ // Set SDK dir to the symlink path.
477
+ define( 'WP_FS__DIR', $plugins_or_theme_dir_path . $sdk_symlink );
478
+ }
479
+ }
480
+
481
+ // Load SDK files.
482
+ require_once dirname( __FILE__ ) . '/require.php';
483
+
484
+ /**
485
+ * Quick shortcut to get Freemius for specified plugin.
486
+ * Used by various templates.
487
+ *
488
+ * @param number $module_id
489
+ *
490
+ * @return Freemius
491
+ */
492
+ function freemius( $module_id ) {
493
+ return Freemius::instance( $module_id );
494
+ }
495
+
496
+ /**
497
+ * @param string $slug
498
+ * @param number $plugin_id
499
+ * @param string $public_key
500
+ * @param bool $is_live Is live or test plugin.
501
+ * @param bool $is_premium Hints freemius if running the premium plugin or not.
502
+ *
503
+ * @return Freemius
504
+ *
505
+ * @deprecated Please use fs_dynamic_init().
506
+ */
507
+ function fs_init( $slug, $plugin_id, $public_key, $is_live = true, $is_premium = true ) {
508
+ $fs = Freemius::instance( $plugin_id, $slug, true );
509
+ $fs->init( $plugin_id, $public_key, $is_live, $is_premium );
510
+
511
+ return $fs;
512
+ }
513
+
514
+ /**
515
+ * @param array <string,string> $module Plugin or Theme details.
516
+ *
517
+ * @return Freemius
518
+ * @throws Freemius_Exception
519
+ */
520
+ function fs_dynamic_init( $module ) {
521
+ $fs = Freemius::instance( $module['id'], $module['slug'], true );
522
+ $fs->dynamic_init( $module );
523
+
524
+ return $fs;
525
+ }
526
+
527
+ function fs_dump_log() {
528
+ FS_Logger::dump();
529
+ }
530
  }
freemius/templates/account.php CHANGED
@@ -1056,6 +1056,29 @@
1056
  });
1057
  });
1058
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1059
  })(jQuery);
1060
  </script>
1061
  <?php
1056
  });
1057
  });
1058
 
1059
+ $( '.fs-toggle-whitelabel-mode' ).click( function () {
1060
+ var $toggleLink = $( this );
1061
+
1062
+ $.ajax( {
1063
+ url : ajaxurl,
1064
+ method: 'POST',
1065
+ data : {
1066
+ action : '<?php echo $fs->get_ajax_action( 'toggle_whitelabel_mode' ) ?>',
1067
+ security : '<?php echo $fs->get_ajax_security( 'toggle_whitelabel_mode' ) ?>',
1068
+ module_id: <?php echo $fs->get_id() ?>
1069
+ },
1070
+ beforeSend: function () {
1071
+ $toggleLink.parent().text( '<?php
1072
+ $is_whitelabeled ?
1073
+ fs_esc_html_echo_inline( 'Disabling white-label mode', 'disabling-whitelabel-mode' ) :
1074
+ fs_esc_html_echo_inline( 'Enabling white-label mode', 'enabling-whitelabel-mode' )
1075
+ ?>' + '...' );
1076
+ },
1077
+ complete: function () {
1078
+ location.reload();
1079
+ }
1080
+ } );
1081
+ });
1082
  })(jQuery);
1083
  </script>
1084
  <?php
freemius/templates/account/payments.php CHANGED
@@ -1,59 +1,59 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2016, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.2.0
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * @var array $VARS
15
- * @var Freemius $fs
16
- */
17
- $fs = freemius( $VARS['id'] );
18
-
19
- $slug = $fs->get_slug();
20
-
21
- $payments = $fs->_fetch_payments();
22
-
23
- $show_payments = ( is_array( $payments ) && 0 < count( $payments ) );
24
-
25
- if ( $show_payments ) :
26
- ?>
27
- <div class="postbox">
28
- <div id="fs_payments">
29
- <h3><span class="dashicons dashicons-paperclip"></span> <?php fs_esc_html_echo_inline( 'Payments', 'payments', $slug ) ?></h3>
30
-
31
- <div class="inside">
32
- <table class="widefat">
33
- <thead>
34
- <tr>
35
- <th><?php fs_esc_html_echo_inline( 'ID', 'id', $slug ) ?></th>
36
- <th><?php fs_esc_html_echo_inline( 'Date', 'date', $slug ) ?></th>
37
- <th><?php fs_esc_html_echo_inline( 'Amount', 'amount', $slug ) ?></th>
38
- <th><?php fs_esc_html_echo_inline( 'Invoice', 'invoice', $slug ) ?></th>
39
- </tr>
40
- </thead>
41
- <tbody>
42
- <?php $odd = true ?>
43
- <?php foreach ( $payments as $payment ) : ?>
44
- <tr<?php echo $odd ? ' class="alternate"' : '' ?>>
45
- <td><?php echo $payment->id ?></td>
46
- <td><?php echo date( 'M j, Y', strtotime( $payment->created ) ) ?></td>
47
- <td><?php echo $payment->formatted_gross() ?></td>
48
- <td><?php if (! $payment->is_migrated() ) : ?><a href="<?php echo $fs->_get_invoice_api_url( $payment->id ) ?>"
49
- class="button button-small"
50
- target="_blank" rel="noopener"><?php fs_esc_html_echo_inline( 'Invoice', 'invoice', $slug ) ?></a><?php endif ?></td>
51
- </tr>
52
- <?php $odd = ! $odd; endforeach ?>
53
- </tbody>
54
- </table>
55
- </div>
56
- </div>
57
- </div>
58
- <?php
59
  endif;
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2016, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.2.0
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * @var array $VARS
15
+ * @var Freemius $fs
16
+ */
17
+ $fs = freemius( $VARS['id'] );
18
+
19
+ $slug = $fs->get_slug();
20
+
21
+ $payments = $fs->_fetch_payments();
22
+
23
+ $show_payments = ( is_array( $payments ) && 0 < count( $payments ) );
24
+
25
+ if ( $show_payments ) :
26
+ ?>
27
+ <div class="postbox">
28
+ <div id="fs_payments">
29
+ <h3><span class="dashicons dashicons-paperclip"></span> <?php fs_esc_html_echo_inline( 'Payments', 'payments', $slug ) ?></h3>
30
+
31
+ <div class="inside">
32
+ <table class="widefat">
33
+ <thead>
34
+ <tr>
35
+ <th><?php fs_esc_html_echo_inline( 'ID', 'id', $slug ) ?></th>
36
+ <th><?php fs_esc_html_echo_inline( 'Date', 'date', $slug ) ?></th>
37
+ <th><?php fs_esc_html_echo_inline( 'Amount', 'amount', $slug ) ?></th>
38
+ <th><?php fs_esc_html_echo_inline( 'Invoice', 'invoice', $slug ) ?></th>
39
+ </tr>
40
+ </thead>
41
+ <tbody>
42
+ <?php $odd = true ?>
43
+ <?php foreach ( $payments as $payment ) : ?>
44
+ <tr<?php echo $odd ? ' class="alternate"' : '' ?>>
45
+ <td><?php echo $payment->id ?></td>
46
+ <td><?php echo date( 'M j, Y', strtotime( $payment->created ) ) ?></td>
47
+ <td><?php echo $payment->formatted_gross() ?></td>
48
+ <td><?php if (! $payment->is_migrated() ) : ?><a href="<?php echo $fs->_get_invoice_api_url( $payment->id ) ?>"
49
+ class="button button-small"
50
+ target="_blank" rel="noopener"><?php fs_esc_html_echo_inline( 'Invoice', 'invoice', $slug ) ?></a><?php endif ?></td>
51
+ </tr>
52
+ <?php $odd = ! $odd; endforeach ?>
53
+ </tbody>
54
+ </table>
55
+ </div>
56
+ </div>
57
+ </div>
58
+ <?php
59
  endif;
freemius/templates/auto-installation.php CHANGED
@@ -1,249 +1,249 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.2.1.5
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * @var array $VARS
15
- * @var Freemius $fs
16
- */
17
- $slug = $VARS['slug'];
18
- $plugin_id = $VARS['target_module_id'];
19
-
20
- $fs = freemius( $VARS['id'] );
21
-
22
- $action = $fs->is_tracking_allowed() ?
23
- 'stop_tracking' :
24
- 'allow_tracking';
25
-
26
- $title = $fs->get_plugin_title();
27
-
28
- if ( $plugin_id != $fs->get_id() ) {
29
- $addon = $fs->get_addon( $plugin_id );
30
-
31
- if ( is_object( $addon ) ) {
32
- $title = $addon->title . ' ' . fs_text_inline( 'Add-On', 'addon', $slug );
33
- }
34
- }
35
-
36
- $plugin_title = sprintf(
37
- '<strong>%s</strong>',
38
- esc_html( $title )
39
- );
40
-
41
- $sec_countdown = 30;
42
- $countdown_html = sprintf(
43
- esc_js(
44
- /* translators: %s: Number of seconds */
45
- fs_text_inline( '%s sec', 'x-sec', $slug )
46
- ),
47
- sprintf( '<span class="fs-countdown">%s</span>', $sec_countdown )
48
- );
49
-
50
- fs_enqueue_local_style( 'fs_dialog_boxes', '/admin/dialog-boxes.css' );
51
- fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
52
-
53
- $params = array();
54
- $loader_html = fs_get_template( 'ajax-loader.php', $params );
55
-
56
- // Pass unique auto installation URL if WP_Filesystem is needed.
57
- $install_url = $fs->_get_sync_license_url(
58
- $plugin_id,
59
- true,
60
- array( 'auto_install' => 'true' )
61
- );
62
-
63
-
64
- ob_start();
65
-
66
- $method = ''; // Leave blank so WP_Filesystem can populate it as necessary.
67
-
68
- $credentials = request_filesystem_credentials(
69
- esc_url_raw( $install_url ),
70
- $method,
71
- false,
72
- WP_PLUGIN_DIR,
73
- array()
74
- );
75
-
76
- $credentials_form = ob_get_clean();
77
-
78
- $require_credentials = ! empty( $credentials_form );
79
- ?>
80
- <div class="fs-modal fs-modal-auto-install">
81
- <div class="fs-modal-dialog">
82
- <div class="fs-modal-header">
83
- <h4><?php echo esc_js( fs_text_inline( 'Automatic Installation', 'auto-installation', $slug ) ) ?></h4>
84
- </div>
85
- <div class="fs-modal-body">
86
- <div class="fs-notice-error" style="display: none"><p></p></div>
87
- <?php if ( $require_credentials ) : ?>
88
- <div id="request-filesystem-credentials-dialog">
89
- <?php echo $credentials_form ?>
90
- </div>
91
- <?php else : ?>
92
- <p class="fs-installation-notice"><?php echo sprintf(
93
- fs_esc_html_inline( 'An automated download and installation of %s (paid version) from %s will start in %s. If you would like to do it manually - click the cancellation button now.', 'installing-in-n', $slug ),
94
- $plugin_title,
95
- sprintf(
96
- '<a href="%s" target="_blank" rel="noopener">%s</a>',
97
- 'https://freemius.com',
98
- 'freemius.com'
99
- ),
100
- $countdown_html
101
- ) ?></p>
102
- <?php endif ?>
103
- <p class="fs-installing"
104
- style="display: none"><?php echo sprintf( fs_esc_html_inline( 'The installation process has started and may take a few minutes to complete. Please wait until it is done - do not refresh this page.', 'installing-module-x', $slug ), $plugin_title ) ?></p>
105
- </div>
106
- <div class="fs-modal-footer">
107
- <?php echo $loader_html ?>
108
- <button
109
- class="button button-secondary button-cancel"><?php fs_esc_html_echo_inline( 'Cancel Installation', 'cancel-installation', $slug ) ?><?php if ( ! $require_credentials ) : ?> (<?php echo $countdown_html ?>)<?php endif ?></button>
110
- <button
111
- class="button button-primary"><?php fs_esc_html_echo_inline( 'Install Now', 'install-now', $slug ) ?></button>
112
- </div>
113
- </div>
114
- </div>'
115
-
116
- <script type="text/javascript">
117
- (function ($) {
118
- $(document).ready(function () {
119
- var $modal = $('.fs-modal-auto-install'),
120
- $body = $('body'),
121
- $countdown = $modal.find('.fs-countdown'),
122
- requireCredentials = <?php echo json_encode( $require_credentials ) ?>,
123
- $credentialsForm = $('#request-filesystem-credentials-dialog'),
124
- $errorNotice = $modal.find('.fs-notice-error'),
125
- installing = false;
126
-
127
- $modal.appendTo($body);
128
-
129
- var startAutoInstall = function () {
130
- if (installing)
131
- return;
132
-
133
- installing = true;
134
-
135
- // Start auto-install.
136
- $modal.addClass('fs-warn');
137
- if (requireCredentials) {
138
- $credentialsForm.hide();
139
- } else {
140
- $modal.find('.fs-installation-notice').hide();
141
- }
142
-
143
- $errorNotice.hide();
144
- $modal.find('.fs-installing').show();
145
- $modal.find('button').hide();
146
- $modal.find('.fs-ajax-loader').show();
147
-
148
- var data = {
149
- action : '<?php echo $fs->get_ajax_action( 'install_premium_version' ) ?>',
150
- security : '<?php echo $fs->get_ajax_security( 'install_premium_version' ) ?>',
151
- slug : '<?php echo $slug ?>',
152
- module_id : '<?php echo $fs->get_id() ?>',
153
- target_module_id: '<?php echo $plugin_id ?>'
154
- };
155
-
156
- if (requireCredentials) {
157
- // Add filesystem credentials.
158
- data.hostname = $('#hostname').val();
159
- data.username = $('#username').val();
160
- data.password = $('#password').val();
161
- data.connection_type = $('input[name="connection_type"]:checked').val();
162
- data.public_key = $('#public_key').val();
163
- data.private_key = $('#private_key').val();
164
- }
165
-
166
- $.ajax({
167
- url : ajaxurl,
168
- method : 'POST',
169
- data : data,
170
- success: function (resultObj) {
171
- var reloadAccount = false;
172
-
173
- if (resultObj.success) {
174
- // Reload account page to show new data.
175
- reloadAccount = true;
176
- } else {
177
- switch (resultObj.error.code) {
178
- case 'invalid_module_id':
179
- case 'premium_installed':
180
- reloadAccount = true;
181
- break;
182
- case 'invalid_license':
183
- case 'premium_version_missing':
184
- case 'unable_to_connect_to_filesystem':
185
- default:
186
- $modal.removeClass('fs-warn');
187
- $modal.find('.fs-installing').hide();
188
- $modal.find('.fs-ajax-loader').hide();
189
- $modal.find('.button-cancel').html(<?php fs_json_encode_echo_inline( 'Cancel Installation', 'cancel-installation', $slug ) ?>);
190
- $modal.find('button').show();
191
-
192
- $errorNotice.find('p').text(resultObj.error.message);
193
- $errorNotice.addClass('notice notice-alt notice-error').show();
194
- if (requireCredentials) {
195
- $credentialsForm.show();
196
- }
197
- break;
198
- }
199
- }
200
-
201
- if (reloadAccount) {
202
- window.location = '<?php echo $fs->get_account_url() ?>';
203
- }
204
-
205
- installing = false;
206
- }
207
- });
208
- };
209
-
210
- var clearCountdown = function () {
211
- clearInterval(countdownInterval);
212
- countdownInterval = null;
213
- };
214
-
215
- var cancelAutoInstall = function () {
216
- $modal.fadeOut(function () {
217
- $modal.remove();
218
- $body.removeClass('has-fs-modal');
219
- });
220
- };
221
-
222
- var countdown = <?php echo $sec_countdown ?>,
223
- countdownInterval = requireCredentials ? null : setInterval(function () {
224
- $countdown.html(--countdown);
225
- if (0 == countdown) {
226
- clearCountdown();
227
- startAutoInstall();
228
- }
229
- }, 1000);
230
-
231
- $modal.addClass('active');
232
- $body.addClass('has-fs-modal');
233
-
234
- $modal.find('.button-primary').click(function () {
235
- clearCountdown();
236
- startAutoInstall();
237
- });
238
-
239
- $modal.find('.button-cancel').click(function () {
240
- clearCountdown();
241
- cancelAutoInstall();
242
- });
243
-
244
- if (requireCredentials) {
245
-
246
- }
247
- });
248
- })(jQuery);
249
- </script>
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.2.1.5
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * @var array $VARS
15
+ * @var Freemius $fs
16
+ */
17
+ $slug = $VARS['slug'];
18
+ $plugin_id = $VARS['target_module_id'];
19
+
20
+ $fs = freemius( $VARS['id'] );
21
+
22
+ $action = $fs->is_tracking_allowed() ?
23
+ 'stop_tracking' :
24
+ 'allow_tracking';
25
+
26
+ $title = $fs->get_plugin_title();
27
+
28
+ if ( $plugin_id != $fs->get_id() ) {
29
+ $addon = $fs->get_addon( $plugin_id );
30
+
31
+ if ( is_object( $addon ) ) {
32
+ $title = $addon->title . ' ' . fs_text_inline( 'Add-On', 'addon', $slug );
33
+ }
34
+ }
35
+
36
+ $plugin_title = sprintf(
37
+ '<strong>%s</strong>',
38
+ esc_html( $title )
39
+ );
40
+
41
+ $sec_countdown = 30;
42
+ $countdown_html = sprintf(
43
+ esc_js(
44
+ /* translators: %s: Number of seconds */
45
+ fs_text_inline( '%s sec', 'x-sec', $slug )
46
+ ),
47
+ sprintf( '<span class="fs-countdown">%s</span>', $sec_countdown )
48
+ );
49
+
50
+ fs_enqueue_local_style( 'fs_dialog_boxes', '/admin/dialog-boxes.css' );
51
+ fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
52
+
53
+ $params = array();
54
+ $loader_html = fs_get_template( 'ajax-loader.php', $params );
55
+
56
+ // Pass unique auto installation URL if WP_Filesystem is needed.
57
+ $install_url = $fs->_get_sync_license_url(
58
+ $plugin_id,
59
+ true,
60
+ array( 'auto_install' => 'true' )
61
+ );
62
+
63
+
64
+ ob_start();
65
+
66
+ $method = ''; // Leave blank so WP_Filesystem can populate it as necessary.
67
+
68
+ $credentials = request_filesystem_credentials(
69
+ esc_url_raw( $install_url ),
70
+ $method,
71
+ false,
72
+ WP_PLUGIN_DIR,
73
+ array()
74
+ );
75
+
76
+ $credentials_form = ob_get_clean();
77
+
78
+ $require_credentials = ! empty( $credentials_form );
79
+ ?>
80
+ <div class="fs-modal fs-modal-auto-install">
81
+ <div class="fs-modal-dialog">
82
+ <div class="fs-modal-header">
83
+ <h4><?php echo esc_js( fs_text_inline( 'Automatic Installation', 'auto-installation', $slug ) ) ?></h4>
84
+ </div>
85
+ <div class="fs-modal-body">
86
+ <div class="fs-notice-error" style="display: none"><p></p></div>
87
+ <?php if ( $require_credentials ) : ?>
88
+ <div id="request-filesystem-credentials-dialog">
89
+ <?php echo $credentials_form ?>
90
+ </div>
91
+ <?php else : ?>
92
+ <p class="fs-installation-notice"><?php echo sprintf(
93
+ fs_esc_html_inline( 'An automated download and installation of %s (paid version) from %s will start in %s. If you would like to do it manually - click the cancellation button now.', 'installing-in-n', $slug ),
94
+ $plugin_title,
95
+ sprintf(
96
+ '<a href="%s" target="_blank" rel="noopener">%s</a>',
97
+ 'https://freemius.com',
98
+ 'freemius.com'
99
+ ),
100
+ $countdown_html
101
+ ) ?></p>
102
+ <?php endif ?>
103
+ <p class="fs-installing"
104
+ style="display: none"><?php echo sprintf( fs_esc_html_inline( 'The installation process has started and may take a few minutes to complete. Please wait until it is done - do not refresh this page.', 'installing-module-x', $slug ), $plugin_title ) ?></p>
105
+ </div>
106
+ <div class="fs-modal-footer">
107
+ <?php echo $loader_html ?>
108
+ <button
109
+ class="button button-secondary button-cancel"><?php fs_esc_html_echo_inline( 'Cancel Installation', 'cancel-installation', $slug ) ?><?php if ( ! $require_credentials ) : ?> (<?php echo $countdown_html ?>)<?php endif ?></button>
110
+ <button
111
+ class="button button-primary"><?php fs_esc_html_echo_inline( 'Install Now', 'install-now', $slug ) ?></button>
112
+ </div>
113
+ </div>
114
+ </div>'
115
+
116
+ <script type="text/javascript">
117
+ (function ($) {
118
+ $(document).ready(function () {
119
+ var $modal = $('.fs-modal-auto-install'),
120
+ $body = $('body'),
121
+ $countdown = $modal.find('.fs-countdown'),
122
+ requireCredentials = <?php echo json_encode( $require_credentials ) ?>,
123
+ $credentialsForm = $('#request-filesystem-credentials-dialog'),
124
+ $errorNotice = $modal.find('.fs-notice-error'),
125
+ installing = false;
126
+
127
+ $modal.appendTo($body);
128
+
129
+ var startAutoInstall = function () {
130
+ if (installing)
131
+ return;
132
+
133
+ installing = true;
134
+
135
+ // Start auto-install.
136
+ $modal.addClass('fs-warn');
137
+ if (requireCredentials) {
138
+ $credentialsForm.hide();
139
+ } else {
140
+ $modal.find('.fs-installation-notice').hide();
141
+ }
142
+
143
+ $errorNotice.hide();
144
+ $modal.find('.fs-installing').show();
145
+ $modal.find('button').hide();
146
+ $modal.find('.fs-ajax-loader').show();
147
+
148
+ var data = {
149
+ action : '<?php echo $fs->get_ajax_action( 'install_premium_version' ) ?>',
150
+ security : '<?php echo $fs->get_ajax_security( 'install_premium_version' ) ?>',
151
+ slug : '<?php echo $slug ?>',
152
+ module_id : '<?php echo $fs->get_id() ?>',
153
+ target_module_id: '<?php echo $plugin_id ?>'
154
+ };
155
+
156
+ if (requireCredentials) {
157
+ // Add filesystem credentials.
158
+ data.hostname = $('#hostname').val();
159
+ data.username = $('#username').val();
160
+ data.password = $('#password').val();
161
+ data.connection_type = $('input[name="connection_type"]:checked').val();
162
+ data.public_key = $('#public_key').val();
163
+ data.private_key = $('#private_key').val();
164
+ }
165
+
166
+ $.ajax({
167
+ url : ajaxurl,
168
+ method : 'POST',
169
+ data : data,
170
+ success: function (resultObj) {
171
+ var reloadAccount = false;
172
+
173
+ if (resultObj.success) {
174
+ // Reload account page to show new data.
175
+ reloadAccount = true;
176
+ } else {
177
+ switch (resultObj.error.code) {
178
+ case 'invalid_module_id':
179
+ case 'premium_installed':
180
+ reloadAccount = true;
181
+ break;
182
+ case 'invalid_license':
183
+ case 'premium_version_missing':
184
+ case 'unable_to_connect_to_filesystem':
185
+ default:
186
+ $modal.removeClass('fs-warn');
187
+ $modal.find('.fs-installing').hide();
188
+ $modal.find('.fs-ajax-loader').hide();
189
+ $modal.find('.button-cancel').html(<?php fs_json_encode_echo_inline( 'Cancel Installation', 'cancel-installation', $slug ) ?>);
190
+ $modal.find('button').show();
191
+
192
+ $errorNotice.find('p').text(resultObj.error.message);
193
+ $errorNotice.addClass('notice notice-alt notice-error').show();
194
+ if (requireCredentials) {
195
+ $credentialsForm.show();
196
+ }
197
+ break;
198
+ }
199
+ }
200
+
201
+ if (reloadAccount) {
202
+ window.location = '<?php echo $fs->get_account_url() ?>';
203
+ }
204
+
205
+ installing = false;
206
+ }
207
+ });
208
+ };
209
+
210
+ var clearCountdown = function () {
211
+ clearInterval(countdownInterval);
212
+ countdownInterval = null;
213
+ };
214
+
215
+ var cancelAutoInstall = function () {
216
+ $modal.fadeOut(function () {
217
+ $modal.remove();
218
+ $body.removeClass('has-fs-modal');
219
+ });
220
+ };
221
+
222
+ var countdown = <?php echo $sec_countdown ?>,
223
+ countdownInterval = requireCredentials ? null : setInterval(function () {
224
+ $countdown.html(--countdown);
225
+ if (0 == countdown) {
226
+ clearCountdown();
227
+ startAutoInstall();
228
+ }
229
+ }, 1000);
230
+
231
+ $modal.addClass('active');
232
+ $body.addClass('has-fs-modal');
233
+
234
+ $modal.find('.button-primary').click(function () {
235
+ clearCountdown();
236
+ startAutoInstall();
237
+ });
238
+
239
+ $modal.find('.button-cancel').click(function () {
240
+ clearCountdown();
241
+ cancelAutoInstall();
242
+ });
243
+
244
+ if (requireCredentials) {
245
+
246
+ }
247
+ });
248
+ })(jQuery);
249
+ </script>
freemius/templates/forms/affiliation.php CHANGED
@@ -1,507 +1,509 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.2.3
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * @var array $VARS
15
- * @var Freemius $fs
16
- */
17
- $fs = freemius( $VARS['id'] );
18
-
19
- $slug = $fs->get_slug();
20
-
21
- $user = $fs->get_user();
22
- $affiliate = $fs->get_affiliate();
23
- $affiliate_terms = $fs->get_affiliate_terms();
24
-
25
- $plugin_title = $fs->get_plugin_title();
26
- $module_type = $fs->is_plugin() ?
27
- WP_FS__MODULE_TYPE_PLUGIN :
28
- WP_FS__MODULE_TYPE_THEME;
29
-
30
- $commission = $affiliate_terms->get_formatted_commission();
31
-
32
- $readonly = false;
33
- $is_affiliate = is_object( $affiliate );
34
- $is_pending_affiliate = false;
35
- $email_address = ( is_object( $user ) ?
36
- $user->email :
37
- '' );
38
- $full_name = ( is_object( $user ) ?
39
- $user->get_name() :
40
- '' );
41
- $paypal_email_address = '';
42
- $domain = '';
43
- $extra_domains = array();
44
- $promotion_method_social_media = false;
45
- $promotion_method_mobile_apps = false;
46
- $statistics_information = false;
47
- $promotion_method_description = false;
48
- $members_dashboard_login_url = 'https://members.freemius.com/login/';
49
-
50
- $affiliate_application_data = $fs->get_affiliate_application_data();
51
-
52
- if ( $is_affiliate && $affiliate->is_pending() ) {
53
- $readonly = 'readonly';
54
- $is_pending_affiliate = true;
55
-
56
- $paypal_email_address = $affiliate->paypal_email;
57
- $domain = $affiliate->domain;
58
- $statistics_information = $affiliate_application_data['stats_description'];
59
- $promotion_method_description = $affiliate_application_data['promotion_method_description'];
60
-
61
- if ( ! empty( $affiliate_application_data['additional_domains'] ) ) {
62
- $extra_domains = $affiliate_application_data['additional_domains'];
63
- }
64
-
65
- if ( ! empty( $affiliate_application_data['promotion_methods'] ) ) {
66
- $promotion_methods = explode( ',', $affiliate_application_data['promotion_methods'] );
67
- $promotion_method_social_media = in_array( 'social_media', $promotion_methods );
68
- $promotion_method_mobile_apps = in_array( 'mobile_apps', $promotion_methods );
69
- }
70
- } else {
71
- $current_user = Freemius::_get_current_wp_user();
72
- $full_name = trim( $current_user->user_firstname . ' ' . $current_user->user_lastname );
73
- $email_address = $current_user->user_email;
74
- $domain = fs_strip_url_protocol( get_site_url() );
75
- }
76
-
77
- $affiliate_tracking = 30;
78
-
79
- if ( is_object( $affiliate_terms ) ) {
80
- $affiliate_tracking = ( ! is_null( $affiliate_terms->cookie_days ) ?
81
- ( $affiliate_terms->cookie_days . '-day' ) :
82
- fs_text_inline( 'Non-expiring', 'non-expiring', $slug ) );
83
- }
84
-
85
- $apply_to_become_affiliate_text = fs_text_inline( 'Apply to become an affiliate', 'apply-to-become-an-affiliate', $slug );
86
-
87
- $module_id = $fs->get_id();
88
- $affiliate_program_terms_url = "https://freemius.com/plugin/{$module_id}/{$slug}/legal/affiliate-program/";
89
- ?>
90
- <div id="fs_affiliation_content_wrapper" class="wrap">
91
- <form method="post" action="">
92
- <div id="poststuff">
93
- <div class="postbox">
94
- <div class="inside">
95
- <div id="messages">
96
- <div id="error_message" class="error" style="display: none">
97
- <p><strong></strong></p>
98
- </div>
99
- <div id="message" class="updated" style="display: none">
100
- <p><strong></strong></p>
101
- </div>
102
- <?php if ( $is_affiliate ) : ?>
103
- <?php if ( $affiliate->is_active() ) : ?>
104
- <div class="updated">
105
- <p><strong><?php
106
- echo sprintf(
107
- fs_esc_html_inline( "Your affiliate application for %s has been accepted! Log in to your affiliate area at: %s.", 'affiliate-application-accepted', $slug ),
108
- $plugin_title,
109
- sprintf(
110
- '<a href="%s" target="_blank" rel="noopener">%s</a>',
111
- $members_dashboard_login_url,
112
- $members_dashboard_login_url
113
- )
114
- );
115
- ?></strong></p>
116
- </div>
117
- <?php else : ?>
118
- <?php
119
- $message_text = '';
120
-
121
- if ( $is_pending_affiliate ) {
122
- $message_text = fs_text_inline( "Thank you for applying for our affiliate program, we'll review your details during the next 14 days and will get back to you with further information.", 'affiliate-application-thank-you', $slug );
123
- $message_container_class = 'updated';
124
- } else if ( $affiliate->is_suspended() ) {
125
- $message_text = fs_text_inline( 'Your affiliation account was temporarily suspended.', 'affiliate-account-suspended', $slug );
126
- $message_container_class = 'notice notice-warning';
127
- } else if ( $affiliate->is_rejected() ) {
128
- $message_text = fs_text_inline( "Thank you for applying for our affiliate program, unfortunately, we've decided at this point to reject your application. Please try again in 30 days.", 'affiliate-application-rejected', $slug );
129
- $message_container_class = 'error';
130
- } else if ( $affiliate->is_blocked() ) {
131
- $message_text = fs_text_inline( 'Due to violation of our affiliation terms, we decided to temporarily block your affiliation account. If you have any questions, please contact support.', 'affiliate-account-blocked', $slug );
132
- $message_container_class = 'error';
133
- }
134
- ?>
135
- <div class="<?php echo $message_container_class ?>">
136
- <p><strong><?php echo esc_html( $message_text ) ?></strong></p>
137
- </div>
138
- <?php endif ?>
139
- <?php endif ?>
140
- </div>
141
- <div class="entry-content">
142
- <?php if ( ! $is_affiliate ) : ?>
143
- <div id="application_messages_container">
144
- <p><?php echo esc_html( sprintf( fs_text_inline( 'Like the %s? Become our ambassador and earn cash ;-)', 'become-an-ambassador', $slug ), $module_type ) ) ?></p>
145
- <p><?php echo esc_html( sprintf( fs_text_inline( 'Refer new customers to our %s and earn %s commission on each successful sale you refer!', 'refer-new-customers', $slug ), $module_type, $commission ) ) ?></p>
146
- </div>
147
- <?php endif ?>
148
- <h3><?php fs_esc_html_echo_inline( 'Program Summary', 'program-summary', $slug ) ?></h3>
149
- <ul>
150
- <li><?php echo esc_html( sprintf( fs_text_inline( '%s commission when a customer purchases a new license.', 'commission-on-new-license-purchase', $slug ), $commission ) ) ?></li>
151
- <?php if ( is_object( $affiliate_terms ) && $affiliate_terms->has_renewals_commission() ) : ?>
152
- <li><?php echo esc_html( sprintf( fs_text_inline( 'Get commission for automated subscription renewals.', 'renewals-commission', $slug ) ) ) ?></li>
153
- <?php endif ?>
154
- <?php if ( is_object( $affiliate_terms ) && ( ! $affiliate_terms->is_session_cookie() ) ) : ?>
155
- <li><?php echo esc_html( sprintf( fs_text_inline( '%s tracking cookie after the first visit to maximize earnings potential.', 'affiliate-tracking', $slug ), $affiliate_tracking ) ) ?></li>
156
- <?php endif ?>
157
- <?php if ( is_object( $affiliate_terms ) && $affiliate_terms->has_lifetime_commission() ) : ?>
158
- <li><?php fs_esc_html_echo_inline( 'Unlimited commissions.', 'unlimited-commissions', $slug ) ?></li>
159
- <?php endif ?>
160
- <li><?php echo esc_html( sprintf( fs_text_inline( '%s minimum payout amount.', 'minimum-payout-amount', $slug ), '$100' ) ) ?></li>
161
- <li><?php fs_esc_html_echo_inline( 'Payouts are in USD and processed monthly via PayPal.', 'payouts-unit-and-processing', $slug ) ?></li>
162
- <li><?php fs_esc_html_echo_inline( 'As we reserve 30 days for potential refunds, we only pay commissions that are older than 30 days.', 'commission-payment', $slug ) ?></li>
163
- </ul>
164
- <div id="application_form_container" <?php echo ( $is_pending_affiliate ) ? '' : 'style="display: none"' ?>>
165
- <h3><?php fs_esc_html_echo_inline( 'Affiliate', 'affiliate', $slug ) ?></h3>
166
- <form>
167
- <div class="input-container input-container-text">
168
- <label class="input-label"><?php fs_esc_html_echo_inline( 'Email address', 'email-address', $slug ) ?></label>
169
- <input id="email_address" type="text" value="<?php echo esc_attr( $email_address ) ?>" class="regular-text" <?php echo ( $readonly || is_object( $user ) ) ? 'readonly' : '' ?>>
170
- </div>
171
- <div class="input-container input-container-text">
172
- <label class="input-label"><?php fs_esc_html_echo_inline( 'Full name', 'full-name', $slug ) ?></label>
173
- <input id="full_name" type="text" value="<?php echo esc_attr( $full_name ) ?>" class="regular-text" <?php echo $readonly ?>>
174
- </div>
175
- <div class="input-container input-container-text">
176
- <label class="input-label"><?php fs_esc_html_echo_inline( 'PayPal account email address', 'paypal-account-email-address', $slug ) ?></label>
177
- <input id="paypal_email" type="text" value="<?php echo esc_attr( $paypal_email_address ) ?>" class="regular-text" <?php echo $readonly ?>>
178
- </div>
179
- <div class="input-container input-container-text">
180
- <label class="input-label"><?php echo esc_html( sprintf( fs_text_inline( 'Where are you going to promote the %s?', 'domain-field-label', $slug ), $module_type ) ) ?></label>
181
- <input id="domain" type="text" value="<?php echo esc_attr( $domain ) ?>" class="domain regular-text" <?php echo $readonly ?>>
182
- <p class="description"><?php echo esc_html( sprintf( fs_text_inline( 'Enter the domain of your website or other websites from where you plan to promote the %s.', 'domain-field-desc', $slug ), $module_type ) ) ?></p>
183
- <?php if ( ! $is_affiliate ) : ?>
184
- <a id="add_domain" href="#" class="disabled">+ <?php fs_esc_html_echo_inline( 'Add another domain', 'add-another-domain', $slug ) ?>...</a>
185
- <?php endif ?>
186
- </div>
187
- <div id="extra_domains_container" class="input-container input-container-text" <?php echo $is_pending_affiliate ? '' : 'style="display: none"' ?>>
188
- <label class="input-label"><?php fs_esc_html_echo_inline( 'Extra Domains', 'extra-domain-fields-label', $slug ) ?></label>
189
- <p class="description"><?php fs_esc_html_echo_inline( 'Extra domains where you will be marketing the product from.', 'extra-domain-fields-desc', $slug ) ?></p>
190
- <?php if ( $is_pending_affiliate && ! empty( $extra_domains ) ) : ?>
191
- <?php foreach ( $extra_domains as $extra_domain ) : ?>
192
- <div class="extra-domain-input-container">
193
- <input type="text" value="<?php echo esc_attr( $extra_domain ) ?>" class="domain regular-text" <?php echo $readonly ?>>
194
- </div>
195
- <?php endforeach ?>
196
- <?php endif ?>
197
- </div>
198
- <div class="input-container">
199
- <label class="input-label"><?php fs_esc_html_echo_inline( 'Promotion methods', 'promotion-methods', $slug ) ?></label>
200
- <div>
201
- <input id="promotion_method_social_media" type="checkbox" <?php checked( $promotion_method_social_media ) ?> <?php disabled( $is_affiliate ) ?>/>
202
- <label for="promotion_method_social_media"><?php fs_esc_html_echo_inline( 'Social media (Facebook, Twitter, etc.)', 'social-media', $slug ) ?></label>
203
- </div>
204
- <div>
205
- <input id="promotion_method_mobile_apps" type="checkbox" <?php checked( $promotion_method_mobile_apps ) ?> <?php disabled( $is_affiliate ) ?>/>
206
- <label for="promotion_method_mobile_apps"><?php fs_esc_html_echo_inline( 'Mobile apps', 'mobile-apps', $slug ) ?></label>
207
- </div>
208
- </div>
209
- <div class="input-container input-container-text">
210
- <label class="input-label"><nobr><?php fs_esc_html_echo_inline( 'Website, email, and social media statistics (optional)', 'statistics-information-field-label', $slug ) ?></nobr></label>
211
- <textarea id="statistics_information" rows="5" <?php echo $readonly ?> class="regular-text"><?php echo $statistics_information ?></textarea>
212
- <?php if ( ! $is_affiliate ) : ?>
213
- <p class="description"><?php fs_esc_html_echo_inline( 'Please feel free to provide any relevant website or social media statistics, e.g. monthly unique site visits, number of email subscribers, followers, etc. (we will keep this information confidential).', 'statistics-information-field-desc', $slug ) ?></p>
214
- <?php endif ?>
215
- </div>
216
- <div class="input-container input-container-text">
217
- <label class="input-label"><?php fs_esc_html_echo_inline( 'How will you promote us?', 'promotion-method-desc-field-label', $slug ) ?></label>
218
- <textarea id="promotion_method_description" rows="5" <?php echo $readonly ?> class="regular-text"><?php echo $promotion_method_description ?></textarea>
219
- <?php if ( ! $is_affiliate ) : ?>
220
- <p class="description"><?php echo esc_html( sprintf( fs_text_inline( 'Please provide details on how you intend to promote %s (please be as specific as possible).', 'promotion-method-desc-field-desc', $slug ), $plugin_title ) ) ?></p>
221
- <?php endif ?>
222
- </div>
223
- <div>
224
- <input type="checkbox" id="legal_consent_checkbox">
225
- <label for="legal_consent_checkbox">I agree to the <a href="<?php echo $affiliate_program_terms_url ?>" target="_blank" rel="noopener">Referrer Program</a>'s terms & conditions.</label>
226
- </div>
227
- </form>
228
- </div>
229
- <?php if ( ! $is_affiliate ) : ?>
230
- <a id="cancel_button" href="#" class="button button-secondary button-cancel" style="display: none"><?php fs_esc_html_echo_inline( 'Cancel', 'cancel', $slug ) ?></a>
231
- <a id="submit_button" class="button button-primary disabled" href="#" style="display: none"><?php echo esc_html( $apply_to_become_affiliate_text ) ?></a>
232
- <a id="apply_button" class="button button-primary" href="#"><?php fs_esc_html_echo_inline( 'Become an affiliate', 'become-an-affiliate', $slug ) ?></a>
233
- <?php endif ?>
234
- </div>
235
- </div>
236
- </div>
237
- </div>
238
- </form>
239
- <script type="text/javascript">
240
- jQuery(function ($) {
241
- var
242
- $contentWrapper = $('#fs_affiliation_content_wrapper'),
243
- $socialMedia = $('#promotion_method_social_media'),
244
- $mobileApps = $('#promotion_method_mobile_apps'),
245
- $applyButton = $('#apply_button'),
246
- $submitButton = $('#submit_button'),
247
- $cancelButton = $('#cancel_button'),
248
- $applicationFormContainer = $('#application_form_container'),
249
- $errorMessageContainer = $('#error_message'),
250
- $domain = $('#domain'),
251
- $addDomain = $('#add_domain'),
252
- $extraDomainsContainer = $('#extra_domains_container'),
253
- $legalConsentCheckbox = $( '#legal_consent_checkbox' );
254
-
255
- $applyButton.click(function (evt) {
256
- evt.preventDefault();
257
-
258
- var $this = $(this);
259
- $this.hide();
260
-
261
- $applicationFormContainer.show();
262
- $cancelButton.show();
263
- $submitButton.show();
264
-
265
- $contentWrapper.find('input[type="text"]:first').focus();
266
- });
267
-
268
- $submitButton.click(function (evt) {
269
- evt.preventDefault();
270
-
271
- var $this = $(this);
272
-
273
- if ($this.hasClass('disabled')) {
274
- return;
275
- }
276
-
277
- $errorMessageContainer.hide();
278
-
279
- var
280
- $emailAddress = $('#email_address'),
281
- emailAddress = null,
282
- paypalEmailAddress = $('#paypal_email').val().trim();
283
-
284
- if (1 === $emailAddress.length) {
285
- emailAddress = $emailAddress.val().trim();
286
-
287
- if (0 === emailAddress.length) {
288
- showErrorMessage('<?php fs_esc_js_echo_inline( 'Email address is required.', 'email-address-is-required', $slug ) ?>');
289
- return;
290
- }
291
- }
292
-
293
- if (0 === paypalEmailAddress.length) {
294
- showErrorMessage('<?php fs_esc_js_echo_inline( 'PayPal email address is required.', 'paypal-email-address-is-required', $slug ) ?>');
295
- return;
296
- }
297
-
298
- var
299
- $extraDomains = $extraDomainsContainer.find('.domain'),
300
- domain = $domain.val().trim().toLowerCase(),
301
- extraDomains = [];
302
-
303
- if (0 === domain.length) {
304
- showErrorMessage('<?php fs_esc_js_echo_inline( 'Domain is required.', 'domain-is-required', $slug ) ?>');
305
- return;
306
- } else if ('freemius.com' === domain) {
307
- showErrorMessage('<?php fs_esc_js_echo_inline( 'Invalid domain', 'invalid-domain', $slug ) ?>' + ' [' + domain + '].');
308
- return;
309
- }
310
-
311
- if ($extraDomains.length > 0) {
312
- var hasError = false;
313
-
314
- $extraDomains.each(function () {
315
- var
316
- $this = $(this),
317
- extraDomain = $this.val().trim().toLowerCase();
318
- if (0 === extraDomain.length || extraDomain === domain) {
319
- return true;
320
- } else if ('freemius.com' === extraDomain) {
321
- showErrorMessage('<?php fs_esc_js_echo_inline( 'Invalid domain', 'invalid-domain', $slug ) ?>' + ' [' + extraDomain + '].');
322
- hasError = true;
323
- return false;
324
- }
325
-
326
- extraDomains.push(extraDomain);
327
- });
328
-
329
- if (hasError) {
330
- return;
331
- }
332
- }
333
-
334
- var
335
- promotionMethods = [],
336
- statisticsInformation = $('#statistics_information').val(),
337
- promotionMethodDescription = $('#promotion_method_description').val();
338
-
339
- if ($socialMedia.attr('checked')) {
340
- promotionMethods.push('social_media');
341
- }
342
-
343
- if ($mobileApps.attr('checked')) {
344
- promotionMethods.push('mobile_apps');
345
- }
346
-
347
- var affiliate = {
348
- full_name : $('#full_name').val().trim(),
349
- paypal_email : paypalEmailAddress,
350
- stats_description : statisticsInformation,
351
- promotion_method_description: promotionMethodDescription
352
- };
353
-
354
- if (null !== emailAddress) {
355
- affiliate.email = emailAddress;
356
- }
357
-
358
- affiliate.domain = domain;
359
- affiliate.additional_domains = extraDomains;
360
-
361
- if (promotionMethods.length > 0) {
362
- affiliate.promotion_methods = promotionMethods.join(',');
363
- }
364
-
365
- $.ajax({
366
- url : ajaxurl,
367
- method : 'POST',
368
- data : {
369
- action : '<?php echo $fs->get_ajax_action( 'submit_affiliate_application' ) ?>',
370
- security : '<?php echo $fs->get_ajax_security( 'submit_affiliate_application' ) ?>',
371
- module_id: '<?php echo $module_id ?>',
372
- affiliate: affiliate
373
- },
374
- beforeSend: function () {
375
- $cancelButton.addClass('disabled');
376
- $submitButton.addClass('disabled');
377
- $submitButton.text('<?php fs_esc_js_echo_inline( 'Submitting', 'submitting' ) ?>...');
378
- },
379
- success : function (result) {
380
- if (result.success) {
381
- location.reload();
382
- } else {
383
- if (result.error && result.error.length > 0) {
384
- showErrorMessage(result.error);
385
- }
386
-
387
- $cancelButton.removeClass('disabled');
388
- $submitButton.removeClass('disabled');
389
- $submitButton.text('<?php echo esc_js( $apply_to_become_affiliate_text ) ?>')
390
- }
391
- }
392
- });
393
- });
394
-
395
- $cancelButton.click(function (evt) {
396
- evt.preventDefault();
397
-
398
- var $this = $(this);
399
-
400
- if ($this.hasClass('disabled')) {
401
- return;
402
- }
403
-
404
- $applicationFormContainer.hide();
405
- $this.hide();
406
- $submitButton.hide();
407
-
408
- $applyButton.show();
409
-
410
- window.scrollTo(0, 0);
411
- });
412
-
413
- $domain.on('input propertychange', onDomainChange);
414
-
415
- $addDomain.click(function (evt) {
416
- evt.preventDefault();
417
-
418
- var
419
- $this = $(this),
420
- domain = $domain.val().trim();
421
-
422
- if ($this.hasClass('disabled') || 0 === domain.length) {
423
- return;
424
- }
425
-
426
- $domain.off('input propertychange');
427
- $this.addClass('disabled');
428
-
429
- var
430
- $extraDomainInputContainer = $('<div class="extra-domain-input-container"><input type="text" class="domain regular-text"/></div>'),
431
- $extraDomainInput = $extraDomainInputContainer.find('input'),
432
- $removeDomain = $('<a href="#" class="remove-domain"><i class="dashicons dashicons-no" title="<?php fs_esc_js_echo_inline( 'Remove', 'remove', $slug ) ?>"></i></a>');
433
-
434
- $extraDomainInputContainer.append($removeDomain);
435
-
436
- $extraDomainInput.on('input propertychange', onDomainChange);
437
-
438
- $removeDomain.click(function (evt) {
439
- evt.preventDefault();
440
-
441
- var
442
- $extraDomainInputs = $('.extra-domain-input-container .domain');
443
-
444
- if (1 === $extraDomainInputs.length)
445
- $extraDomainInputs.val('').focus();
446
- else
447
- $(this).parent().remove();
448
- });
449
-
450
- $extraDomainsContainer.show();
451
-
452
- $extraDomainInputContainer.appendTo($extraDomainsContainer);
453
- $extraDomainInput.focus();
454
-
455
- $this.appendTo($extraDomainsContainer);
456
- });
457
-
458
- /**
459
- * @author Leo Fajardo (@leorw)
460
- */
461
- function onDomainChange() {
462
- var
463
- domain = $(this).val().trim();
464
-
465
- if (domain.length > 0) {
466
- $addDomain.removeClass('disabled');
467
- } else {
468
- $addDomain.addClass('disabled');
469
- }
470
- }
471
-
472
- /**
473
- * @author Leo Fajardo (@leorw)
474
- *
475
- * @param {String} message
476
- */
477
- function showErrorMessage(message) {
478
- $errorMessageContainer.find('strong').text(message);
479
- $errorMessageContainer.show();
480
-
481
- window.scrollTo(0, 0);
482
- }
483
-
484
- /**
485
- * @author Xiaheng Chen (@xhchen)
486
- *
487
- * @since 2.4.0
488
- */
489
- $legalConsentCheckbox.click( function () {
490
- if ( $( this ).prop( 'checked' ) ) {
491
- $submitButton.removeClass( 'disabled' );
492
- } else {
493
- $submitButton.addClass( 'disabled' );
494
- }
495
- } );
496
- });
497
- </script>
498
- </div>
499
- <?php
500
- $params = array(
501
- 'page' => 'affiliation',
502
- 'module_id' => $module_id,
503
- 'module_slug' => $slug,
504
- 'module_version' => $fs->get_plugin_version(),
505
- );
506
- fs_require_template( 'powered-by.php', $params );
 
 
507
  ?>
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.2.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * @var array $VARS
15
+ * @var Freemius $fs
16
+ */
17
+ $fs = freemius( $VARS['id'] );
18
+
19
+ $slug = $fs->get_slug();
20
+
21
+ $user = $fs->get_user();
22
+ $affiliate = $fs->get_affiliate();
23
+ $affiliate_terms = $fs->get_affiliate_terms();
24
+
25
+ $plugin_title = $fs->get_plugin_title();
26
+ $module_type = $fs->is_plugin() ?
27
+ WP_FS__MODULE_TYPE_PLUGIN :
28
+ WP_FS__MODULE_TYPE_THEME;
29
+
30
+ $commission = $affiliate_terms->get_formatted_commission();
31
+
32
+ $readonly = false;
33
+ $is_affiliate = is_object( $affiliate );
34
+ $is_pending_affiliate = false;
35
+ $email_address = ( is_object( $user ) ?
36
+ $user->email :
37
+ '' );
38
+ $full_name = ( is_object( $user ) ?
39
+ $user->get_name() :
40
+ '' );
41
+ $paypal_email_address = '';
42
+ $domain = '';
43
+ $extra_domains = array();
44
+ $promotion_method_social_media = false;
45
+ $promotion_method_mobile_apps = false;
46
+ $statistics_information = false;
47
+ $promotion_method_description = false;
48
+ $members_dashboard_login_url = 'https://members.freemius.com/login/';
49
+
50
+ $affiliate_application_data = $fs->get_affiliate_application_data();
51
+
52
+ if ( $is_affiliate && $affiliate->is_pending() ) {
53
+ $readonly = 'readonly';
54
+ $is_pending_affiliate = true;
55
+
56
+ $paypal_email_address = $affiliate->paypal_email;
57
+ $domain = $affiliate->domain;
58
+ $statistics_information = $affiliate_application_data['stats_description'];
59
+ $promotion_method_description = $affiliate_application_data['promotion_method_description'];
60
+
61
+ if ( ! empty( $affiliate_application_data['additional_domains'] ) ) {
62
+ $extra_domains = $affiliate_application_data['additional_domains'];
63
+ }
64
+
65
+ if ( ! empty( $affiliate_application_data['promotion_methods'] ) ) {
66
+ $promotion_methods = explode( ',', $affiliate_application_data['promotion_methods'] );
67
+ $promotion_method_social_media = in_array( 'social_media', $promotion_methods );
68
+ $promotion_method_mobile_apps = in_array( 'mobile_apps', $promotion_methods );
69
+ }
70
+ } else {
71
+ $current_user = Freemius::_get_current_wp_user();
72
+ $full_name = trim( $current_user->user_firstname . ' ' . $current_user->user_lastname );
73
+ $email_address = $current_user->user_email;
74
+ $domain = fs_strip_url_protocol( get_site_url() );
75
+ }
76
+
77
+ $affiliate_tracking = 30;
78
+
79
+ if ( is_object( $affiliate_terms ) ) {
80
+ $affiliate_tracking = ( ! is_null( $affiliate_terms->cookie_days ) ?
81
+ ( $affiliate_terms->cookie_days . '-day' ) :
82
+ fs_text_inline( 'Non-expiring', 'non-expiring', $slug ) );
83
+ }
84
+
85
+ $apply_to_become_affiliate_text = fs_text_inline( 'Apply to become an affiliate', 'apply-to-become-an-affiliate', $slug );
86
+
87
+ $module_id = $fs->get_id();
88
+ $affiliate_program_terms_url = "https://freemius.com/plugin/{$module_id}/{$slug}/legal/affiliate-program/";
89
+ ?>
90
+ <div id="fs_affiliation_content_wrapper" class="wrap">
91
+ <form method="post" action="">
92
+ <div id="poststuff">
93
+ <div class="postbox">
94
+ <div class="inside">
95
+ <div id="messages">
96
+ <div id="error_message" class="error" style="display: none">
97
+ <p><strong></strong></p>
98
+ </div>
99
+ <div id="message" class="updated" style="display: none">
100
+ <p><strong></strong></p>
101
+ </div>
102
+ <?php if ( $is_affiliate ) : ?>
103
+ <?php if ( $affiliate->is_active() ) : ?>
104
+ <div class="updated">
105
+ <p><strong><?php
106
+ echo sprintf(
107
+ fs_esc_html_inline( "Your affiliate application for %s has been accepted! Log in to your affiliate area at: %s.", 'affiliate-application-accepted', $slug ),
108
+ $plugin_title,
109
+ sprintf(
110
+ '<a href="%s" target="_blank" rel="noopener">%s</a>',
111
+ $members_dashboard_login_url,
112
+ $members_dashboard_login_url
113
+ )
114
+ );
115
+ ?></strong></p>
116
+ </div>
117
+ <?php else : ?>
118
+ <?php
119
+ $message_text = '';
120
+
121
+ if ( $is_pending_affiliate ) {
122
+ $message_text = fs_text_inline( "Thank you for applying for our affiliate program, we'll review your details during the next 14 days and will get back to you with further information.", 'affiliate-application-thank-you', $slug );
123
+ $message_container_class = 'updated';
124
+ } else if ( $affiliate->is_suspended() ) {
125
+ $message_text = fs_text_inline( 'Your affiliation account was temporarily suspended.', 'affiliate-account-suspended', $slug );
126
+ $message_container_class = 'notice notice-warning';
127
+ } else if ( $affiliate->is_rejected() ) {
128
+ $message_text = fs_text_inline( "Thank you for applying for our affiliate program, unfortunately, we've decided at this point to reject your application. Please try again in 30 days.", 'affiliate-application-rejected', $slug );
129
+ $message_container_class = 'error';
130
+ } else if ( $affiliate->is_blocked() ) {
131
+ $message_text = fs_text_inline( 'Due to violation of our affiliation terms, we decided to temporarily block your affiliation account. If you have any questions, please contact support.', 'affiliate-account-blocked', $slug );
132
+ $message_container_class = 'error';
133
+ }
134
+ ?>
135
+ <div class="<?php echo $message_container_class ?>">
136
+ <p><strong><?php echo esc_html( $message_text ) ?></strong></p>
137
+ </div>
138
+ <?php endif ?>
139
+ <?php endif ?>
140
+ </div>
141
+ <div class="entry-content">
142
+ <?php if ( ! $is_affiliate ) : ?>
143
+ <div id="application_messages_container">
144
+ <p><?php echo esc_html( sprintf( fs_text_inline( 'Like the %s? Become our ambassador and earn cash ;-)', 'become-an-ambassador', $slug ), $module_type ) ) ?></p>
145
+ <p><?php echo esc_html( sprintf( fs_text_inline( 'Refer new customers to our %s and earn %s commission on each successful sale you refer!', 'refer-new-customers', $slug ), $module_type, $commission ) ) ?></p>
146
+ </div>
147
+ <?php endif ?>
148
+ <h3><?php fs_esc_html_echo_inline( 'Program Summary', 'program-summary', $slug ) ?></h3>
149
+ <ul>
150
+ <li><?php echo esc_html( sprintf( fs_text_inline( '%s commission when a customer purchases a new license.', 'commission-on-new-license-purchase', $slug ), $commission ) ) ?></li>
151
+ <?php if ( is_object( $affiliate_terms ) && $affiliate_terms->has_renewals_commission() ) : ?>
152
+ <li><?php echo esc_html( sprintf( fs_text_inline( 'Get commission for automated subscription renewals.', 'renewals-commission', $slug ) ) ) ?></li>
153
+ <?php endif ?>
154
+ <?php if ( is_object( $affiliate_terms ) && ( ! $affiliate_terms->is_session_cookie() ) ) : ?>
155
+ <li><?php echo esc_html( sprintf( fs_text_inline( '%s tracking cookie after the first visit to maximize earnings potential.', 'affiliate-tracking', $slug ), $affiliate_tracking ) ) ?></li>
156
+ <?php endif ?>
157
+ <?php if ( is_object( $affiliate_terms ) && $affiliate_terms->has_lifetime_commission() ) : ?>
158
+ <li><?php fs_esc_html_echo_inline( 'Unlimited commissions.', 'unlimited-commissions', $slug ) ?></li>
159
+ <?php endif ?>
160
+ <li><?php echo esc_html( sprintf( fs_text_inline( '%s minimum payout amount.', 'minimum-payout-amount', $slug ), '$100' ) ) ?></li>
161
+ <li><?php fs_esc_html_echo_inline( 'Payouts are in USD and processed monthly via PayPal.', 'payouts-unit-and-processing', $slug ) ?></li>
162
+ <li><?php fs_esc_html_echo_inline( 'As we reserve 30 days for potential refunds, we only pay commissions that are older than 30 days.', 'commission-payment', $slug ) ?></li>
163
+ </ul>
164
+ <div id="application_form_container" <?php echo ( $is_pending_affiliate ) ? '' : 'style="display: none"' ?>>
165
+ <h3><?php fs_esc_html_echo_inline( 'Affiliate', 'affiliate', $slug ) ?></h3>
166
+ <form>
167
+ <div class="input-container input-container-text">
168
+ <label class="input-label"><?php fs_esc_html_echo_inline( 'Email address', 'email-address', $slug ) ?></label>
169
+ <input id="email_address" type="text" value="<?php echo esc_attr( $email_address ) ?>" class="regular-text" <?php echo ( $readonly || is_object( $user ) ) ? 'readonly' : '' ?>>
170
+ </div>
171
+ <div class="input-container input-container-text">
172
+ <label class="input-label"><?php fs_esc_html_echo_inline( 'Full name', 'full-name', $slug ) ?></label>
173
+ <input id="full_name" type="text" value="<?php echo esc_attr( $full_name ) ?>" class="regular-text" <?php echo $readonly ?>>
174
+ </div>
175
+ <div class="input-container input-container-text">
176
+ <label class="input-label"><?php fs_esc_html_echo_inline( 'PayPal account email address', 'paypal-account-email-address', $slug ) ?></label>
177
+ <input id="paypal_email" type="text" value="<?php echo esc_attr( $paypal_email_address ) ?>" class="regular-text" <?php echo $readonly ?>>
178
+ </div>
179
+ <div class="input-container input-container-text">
180
+ <label class="input-label"><?php echo esc_html( sprintf( fs_text_inline( 'Where are you going to promote the %s?', 'domain-field-label', $slug ), $module_type ) ) ?></label>
181
+ <input id="domain" type="text" value="<?php echo esc_attr( $domain ) ?>" class="domain regular-text" <?php echo $readonly ?>>
182
+ <p class="description"><?php echo esc_html( sprintf( fs_text_inline( 'Enter the domain of your website or other websites from where you plan to promote the %s.', 'domain-field-desc', $slug ), $module_type ) ) ?></p>
183
+ <?php if ( ! $is_affiliate ) : ?>
184
+ <a id="add_domain" href="#" class="disabled">+ <?php fs_esc_html_echo_inline( 'Add another domain', 'add-another-domain', $slug ) ?>...</a>
185
+ <?php endif ?>
186
+ </div>
187
+ <div id="extra_domains_container" class="input-container input-container-text" <?php echo $is_pending_affiliate ? '' : 'style="display: none"' ?>>
188
+ <label class="input-label"><?php fs_esc_html_echo_inline( 'Extra Domains', 'extra-domain-fields-label', $slug ) ?></label>
189
+ <p class="description"><?php fs_esc_html_echo_inline( 'Extra domains where you will be marketing the product from.', 'extra-domain-fields-desc', $slug ) ?></p>
190
+ <?php if ( $is_pending_affiliate && ! empty( $extra_domains ) ) : ?>
191
+ <?php foreach ( $extra_domains as $extra_domain ) : ?>
192
+ <div class="extra-domain-input-container">
193
+ <input type="text" value="<?php echo esc_attr( $extra_domain ) ?>" class="domain regular-text" <?php echo $readonly ?>>
194
+ </div>
195
+ <?php endforeach ?>
196
+ <?php endif ?>
197
+ </div>
198
+ <div class="input-container">
199
+ <label class="input-label"><?php fs_esc_html_echo_inline( 'Promotion methods', 'promotion-methods', $slug ) ?></label>
200
+ <div>
201
+ <input id="promotion_method_social_media" type="checkbox" <?php checked( $promotion_method_social_media ) ?> <?php disabled( $is_affiliate ) ?>/>
202
+ <label for="promotion_method_social_media"><?php fs_esc_html_echo_inline( 'Social media (Facebook, Twitter, etc.)', 'social-media', $slug ) ?></label>
203
+ </div>
204
+ <div>
205
+ <input id="promotion_method_mobile_apps" type="checkbox" <?php checked( $promotion_method_mobile_apps ) ?> <?php disabled( $is_affiliate ) ?>/>
206
+ <label for="promotion_method_mobile_apps"><?php fs_esc_html_echo_inline( 'Mobile apps', 'mobile-apps', $slug ) ?></label>
207
+ </div>
208
+ </div>
209
+ <div class="input-container input-container-text">
210
+ <label class="input-label"><nobr><?php fs_esc_html_echo_inline( 'Website, email, and social media statistics (optional)', 'statistics-information-field-label', $slug ) ?></nobr></label>
211
+ <textarea id="statistics_information" rows="5" <?php echo $readonly ?> class="regular-text"><?php echo $statistics_information ?></textarea>
212
+ <?php if ( ! $is_affiliate ) : ?>
213
+ <p class="description"><?php fs_esc_html_echo_inline( 'Please feel free to provide any relevant website or social media statistics, e.g. monthly unique site visits, number of email subscribers, followers, etc. (we will keep this information confidential).', 'statistics-information-field-desc', $slug ) ?></p>
214
+ <?php endif ?>
215
+ </div>
216
+ <div class="input-container input-container-text">
217
+ <label class="input-label"><?php fs_esc_html_echo_inline( 'How will you promote us?', 'promotion-method-desc-field-label', $slug ) ?></label>
218
+ <textarea id="promotion_method_description" rows="5" <?php echo $readonly ?> class="regular-text"><?php echo $promotion_method_description ?></textarea>
219
+ <?php if ( ! $is_affiliate ) : ?>
220
+ <p class="description"><?php echo esc_html( sprintf( fs_text_inline( 'Please provide details on how you intend to promote %s (please be as specific as possible).', 'promotion-method-desc-field-desc', $slug ), $plugin_title ) ) ?></p>
221
+ <?php endif ?>
222
+ </div>
223
+ <?php if ( ! $is_affiliate ) : ?>
224
+ <div>
225
+ <input type="checkbox" id="legal_consent_checkbox">
226
+ <label for="legal_consent_checkbox">I agree to the <a href="<?php echo $affiliate_program_terms_url ?>" target="_blank" rel="noopener">Referrer Program</a>'s terms & conditions.</label>
227
+ </div>
228
+ <?php endif ?>
229
+ </form>
230
+ </div>
231
+ <?php if ( ! $is_affiliate ) : ?>
232
+ <a id="cancel_button" href="#" class="button button-secondary button-cancel" style="display: none"><?php fs_esc_html_echo_inline( 'Cancel', 'cancel', $slug ) ?></a>
233
+ <a id="submit_button" class="button button-primary disabled" href="#" style="display: none"><?php echo esc_html( $apply_to_become_affiliate_text ) ?></a>
234
+ <a id="apply_button" class="button button-primary" href="#"><?php fs_esc_html_echo_inline( 'Become an affiliate', 'become-an-affiliate', $slug ) ?></a>
235
+ <?php endif ?>
236
+ </div>
237
+ </div>
238
+ </div>
239
+ </div>
240
+ </form>
241
+ <script type="text/javascript">
242
+ jQuery(function ($) {
243
+ var
244
+ $contentWrapper = $('#fs_affiliation_content_wrapper'),
245
+ $socialMedia = $('#promotion_method_social_media'),
246
+ $mobileApps = $('#promotion_method_mobile_apps'),
247
+ $applyButton = $('#apply_button'),
248
+ $submitButton = $('#submit_button'),
249
+ $cancelButton = $('#cancel_button'),
250
+ $applicationFormContainer = $('#application_form_container'),
251
+ $errorMessageContainer = $('#error_message'),
252
+ $domain = $('#domain'),
253
+ $addDomain = $('#add_domain'),
254
+ $extraDomainsContainer = $('#extra_domains_container'),
255
+ $legalConsentCheckbox = $( '#legal_consent_checkbox' );
256
+
257
+ $applyButton.click(function (evt) {
258
+ evt.preventDefault();
259
+
260
+ var $this = $(this);
261
+ $this.hide();
262
+
263
+ $applicationFormContainer.show();
264
+ $cancelButton.show();
265
+ $submitButton.show();
266
+
267
+ $contentWrapper.find('input[type="text"]:first').focus();
268
+ });
269
+
270
+ $submitButton.click(function (evt) {
271
+ evt.preventDefault();
272
+
273
+ var $this = $(this);
274
+
275
+ if ($this.hasClass('disabled')) {
276
+ return;
277
+ }
278
+
279
+ $errorMessageContainer.hide();
280
+
281
+ var
282
+ $emailAddress = $('#email_address'),
283
+ emailAddress = null,
284
+ paypalEmailAddress = $('#paypal_email').val().trim();
285
+
286
+ if (1 === $emailAddress.length) {
287
+ emailAddress = $emailAddress.val().trim();
288
+
289
+ if (0 === emailAddress.length) {
290
+ showErrorMessage('<?php fs_esc_js_echo_inline( 'Email address is required.', 'email-address-is-required', $slug ) ?>');
291
+ return;
292
+ }
293
+ }
294
+
295
+ if (0 === paypalEmailAddress.length) {
296
+ showErrorMessage('<?php fs_esc_js_echo_inline( 'PayPal email address is required.', 'paypal-email-address-is-required', $slug ) ?>');
297
+ return;
298
+ }
299
+
300
+ var
301
+ $extraDomains = $extraDomainsContainer.find('.domain'),
302
+ domain = $domain.val().trim().toLowerCase(),
303
+ extraDomains = [];
304
+
305
+ if (0 === domain.length) {
306
+ showErrorMessage('<?php fs_esc_js_echo_inline( 'Domain is required.', 'domain-is-required', $slug ) ?>');
307
+ return;
308
+ } else if ('freemius.com' === domain) {
309
+ showErrorMessage('<?php fs_esc_js_echo_inline( 'Invalid domain', 'invalid-domain', $slug ) ?>' + ' [' + domain + '].');
310
+ return;
311
+ }
312
+
313
+ if ($extraDomains.length > 0) {
314
+ var hasError = false;
315
+
316
+ $extraDomains.each(function () {
317
+ var
318
+ $this = $(this),
319
+ extraDomain = $this.val().trim().toLowerCase();
320
+ if (0 === extraDomain.length || extraDomain === domain) {
321
+ return true;
322
+ } else if ('freemius.com' === extraDomain) {
323
+ showErrorMessage('<?php fs_esc_js_echo_inline( 'Invalid domain', 'invalid-domain', $slug ) ?>' + ' [' + extraDomain + '].');
324
+ hasError = true;
325
+ return false;
326
+ }
327
+
328
+ extraDomains.push(extraDomain);
329
+ });
330
+
331
+ if (hasError) {
332
+ return;
333
+ }
334
+ }
335
+
336
+ var
337
+ promotionMethods = [],
338
+ statisticsInformation = $('#statistics_information').val(),
339
+ promotionMethodDescription = $('#promotion_method_description').val();
340
+
341
+ if ($socialMedia.attr('checked')) {
342
+ promotionMethods.push('social_media');
343
+ }
344
+
345
+ if ($mobileApps.attr('checked')) {
346
+ promotionMethods.push('mobile_apps');
347
+ }
348
+
349
+ var affiliate = {
350
+ full_name : $('#full_name').val().trim(),
351
+ paypal_email : paypalEmailAddress,
352
+ stats_description : statisticsInformation,
353
+ promotion_method_description: promotionMethodDescription
354
+ };
355
+
356
+ if (null !== emailAddress) {
357
+ affiliate.email = emailAddress;
358
+ }
359
+
360
+ affiliate.domain = domain;
361
+ affiliate.additional_domains = extraDomains;
362
+
363
+ if (promotionMethods.length > 0) {
364
+ affiliate.promotion_methods = promotionMethods.join(',');
365
+ }
366
+
367
+ $.ajax({
368
+ url : ajaxurl,
369
+ method : 'POST',
370
+ data : {
371
+ action : '<?php echo $fs->get_ajax_action( 'submit_affiliate_application' ) ?>',
372
+ security : '<?php echo $fs->get_ajax_security( 'submit_affiliate_application' ) ?>',
373
+ module_id: '<?php echo $module_id ?>',
374
+ affiliate: affiliate
375
+ },
376
+ beforeSend: function () {
377
+ $cancelButton.addClass('disabled');
378
+ $submitButton.addClass('disabled');
379
+ $submitButton.text('<?php fs_esc_js_echo_inline( 'Submitting', 'submitting' ) ?>...');
380
+ },
381
+ success : function (result) {
382
+ if (result.success) {
383
+ location.reload();
384
+ } else {
385
+ if (result.error && result.error.length > 0) {
386
+ showErrorMessage(result.error);
387
+ }
388
+
389
+ $cancelButton.removeClass('disabled');
390
+ $submitButton.removeClass('disabled');
391
+ $submitButton.text('<?php echo esc_js( $apply_to_become_affiliate_text ) ?>')
392
+ }
393
+ }
394
+ });
395
+ });
396
+
397
+ $cancelButton.click(function (evt) {
398
+ evt.preventDefault();
399
+
400
+ var $this = $(this);
401
+
402
+ if ($this.hasClass('disabled')) {
403
+ return;
404
+ }
405
+
406
+ $applicationFormContainer.hide();
407
+ $this.hide();
408
+ $submitButton.hide();
409
+
410
+ $applyButton.show();
411
+
412
+ window.scrollTo(0, 0);
413
+ });
414
+
415
+ $domain.on('input propertychange', onDomainChange);
416
+
417
+ $addDomain.click(function (evt) {
418
+ evt.preventDefault();
419
+
420
+ var
421
+ $this = $(this),
422
+ domain = $domain.val().trim();
423
+
424
+ if ($this.hasClass('disabled') || 0 === domain.length) {
425
+ return;
426
+ }
427
+
428
+ $domain.off('input propertychange');
429
+ $this.addClass('disabled');
430
+
431
+ var
432
+ $extraDomainInputContainer = $('<div class="extra-domain-input-container"><input type="text" class="domain regular-text"/></div>'),
433
+ $extraDomainInput = $extraDomainInputContainer.find('input'),
434
+ $removeDomain = $('<a href="#" class="remove-domain"><i class="dashicons dashicons-no" title="<?php fs_esc_js_echo_inline( 'Remove', 'remove', $slug ) ?>"></i></a>');
435
+
436
+ $extraDomainInputContainer.append($removeDomain);
437
+
438
+ $extraDomainInput.on('input propertychange', onDomainChange);
439
+
440
+ $removeDomain.click(function (evt) {
441
+ evt.preventDefault();
442
+
443
+ var
444
+ $extraDomainInputs = $('.extra-domain-input-container .domain');
445
+
446
+ if (1 === $extraDomainInputs.length)
447
+ $extraDomainInputs.val('').focus();
448
+ else
449
+ $(this).parent().remove();
450
+ });
451
+
452
+ $extraDomainsContainer.show();
453
+
454
+ $extraDomainInputContainer.appendTo($extraDomainsContainer);
455
+ $extraDomainInput.focus();
456
+
457
+ $this.appendTo($extraDomainsContainer);
458
+ });
459
+
460
+ /**
461
+ * @author Leo Fajardo (@leorw)
462
+ */
463
+ function onDomainChange() {
464
+ var
465
+ domain = $(this).val().trim();
466
+
467
+ if (domain.length > 0) {
468
+ $addDomain.removeClass('disabled');
469
+ } else {
470
+ $addDomain.addClass('disabled');
471
+ }
472
+ }
473
+
474
+ /**
475
+ * @author Leo Fajardo (@leorw)
476
+ *
477
+ * @param {String} message
478
+ */
479
+ function showErrorMessage(message) {
480
+ $errorMessageContainer.find('strong').text(message);
481
+ $errorMessageContainer.show();
482
+
483
+ window.scrollTo(0, 0);
484
+ }
485
+
486
+ /**
487
+ * @author Xiaheng Chen (@xhchen)
488
+ *
489
+ * @since 2.4.0
490
+ */
491
+ $legalConsentCheckbox.click( function () {
492
+ if ( $( this ).prop( 'checked' ) ) {
493
+ $submitButton.removeClass( 'disabled' );
494
+ } else {
495
+ $submitButton.addClass( 'disabled' );
496
+ }
497
+ } );
498
+ });
499
+ </script>
500
+ </div>
501
+ <?php
502
+ $params = array(
503
+ 'page' => 'affiliation',
504
+ 'module_id' => $module_id,
505
+ 'module_slug' => $slug,
506
+ 'module_version' => $fs->get_plugin_version(),
507
+ );
508
+ fs_require_template( 'powered-by.php', $params );
509
  ?>
freemius/templates/forms/deactivation/form.php CHANGED
@@ -1,543 +1,543 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.1.2
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * @var array $VARS
15
- */
16
- $fs = freemius( $VARS['id'] );
17
- $slug = $fs->get_slug();
18
-
19
- $subscription_cancellation_dialog_box_template_params = $VARS['subscription_cancellation_dialog_box_template_params'];
20
- $show_deactivation_feedback_form = $VARS['show_deactivation_feedback_form'];
21
- $confirmation_message = $VARS['uninstall_confirmation_message'];
22
-
23
- $is_anonymous = ( ! $fs->is_registered() );
24
- $anonymous_feedback_checkbox_html = '';
25
-
26
- $reasons_list_items_html = '';
27
-
28
- if ( $show_deactivation_feedback_form ) {
29
- $reasons = $VARS['reasons'];
30
-
31
- foreach ( $reasons as $reason ) {
32
- $list_item_classes = 'reason' . ( ! empty( $reason['input_type'] ) ? ' has-input' : '' );
33
-
34
- if ( isset( $reason['internal_message'] ) && ! empty( $reason['internal_message'] ) ) {
35
- $list_item_classes .= ' has-internal-message';
36
- $reason_internal_message = $reason['internal_message'];
37
- } else {
38
- $reason_internal_message = '';
39
- }
40
-
41
- $reason_input_type = ( ! empty( $reason['input_type'] ) ? $reason['input_type'] : '' );
42
- $reason_input_placeholder = ( ! empty( $reason['input_placeholder'] ) ? $reason['input_placeholder'] : '' );
43
-
44
- $reason_list_item_html = <<< HTML
45
- <li class="{$list_item_classes}"
46
- data-input-type="{$reason_input_type}"
47
- data-input-placeholder="{$reason_input_placeholder}">
48
- <label>
49
- <span>
50
- <input type="radio" name="selected-reason" value="{$reason['id']}"/>
51
- </span>
52
- <span>{$reason['text']}</span>
53
- </label>
54
- <div class="internal-message">{$reason_internal_message}</div>
55
- </li>
56
- HTML;
57
-
58
- $reasons_list_items_html .= $reason_list_item_html;
59
- }
60
-
61
- if ( $is_anonymous ) {
62
- $anonymous_feedback_checkbox_html = sprintf(
63
- '<label class="anonymous-feedback-label"><input type="checkbox" class="anonymous-feedback-checkbox"> %s</label>',
64
- fs_esc_html_inline( 'Anonymous feedback', 'anonymous-feedback', $slug )
65
- );
66
- }
67
- }
68
-
69
- // Aliases.
70
- $deactivate_text = fs_text_inline( 'Deactivate', 'deactivate', $slug );
71
- $theme_text = fs_text_inline( 'Theme', 'theme', $slug );
72
- $activate_x_text = fs_text_inline( 'Activate %s', 'activate-x', $slug );
73
-
74
- fs_enqueue_local_style( 'fs_dialog_boxes', '/admin/dialog-boxes.css' );
75
-
76
- if ( ! empty( $subscription_cancellation_dialog_box_template_params ) ) {
77
- fs_require_template( 'forms/subscription-cancellation.php', $subscription_cancellation_dialog_box_template_params );
78
- }
79
- ?>
80
- <script type="text/javascript">
81
- (function ($) {
82
- var reasonsHtml = <?php echo json_encode( $reasons_list_items_html ) ?>,
83
- modalHtml =
84
- '<div class="fs-modal fs-modal-deactivation-feedback<?php echo empty( $confirmation_message ) ? ' no-confirmation-message' : ''; ?>">'
85
- + ' <div class="fs-modal-dialog">'
86
- + ' <div class="fs-modal-header">'
87
- + ' <h4><?php fs_esc_attr_echo_inline( 'Quick Feedback', 'quick-feedback' , $slug ) ?></h4>'
88
- + ' </div>'
89
- + ' <div class="fs-modal-body">'
90
- + ' <div class="fs-modal-panel" data-panel-id="confirm"><p><?php echo $confirmation_message; ?></p></div>'
91
- + ' <div class="fs-modal-panel active" data-panel-id="reasons"><h3><strong><?php echo esc_js( sprintf( fs_text_inline( 'If you have a moment, please let us know why you are %s', 'deactivation-share-reason' , $slug ), ( $fs->is_plugin() ? fs_text_inline( 'deactivating', 'deactivating', $slug ) : fs_text_inline( 'switching', 'switching', $slug ) ) ) ) ?>:</strong></h3><ul id="reasons-list">' + reasonsHtml + '</ul></div>'
92
- + ' </div>'
93
- + ' <div class="fs-modal-footer">'
94
- + ' <?php echo $anonymous_feedback_checkbox_html ?>'
95
- + ' <a href="#" class="button button-secondary button-deactivate"></a>'
96
- + ' <a href="#" class="button button-secondary button-close"><?php fs_esc_js_echo_inline( 'Cancel', 'cancel', $slug ) ?></a>'
97
- + ' </div>'
98
- + ' </div>'
99
- + '</div>',
100
- $modal = $(modalHtml),
101
- selectedReasonID = false,
102
- redirectLink = '',
103
- $anonymousFeedback = $modal.find( '.anonymous-feedback-label' ),
104
- isAnonymous = <?php echo ( $is_anonymous ? 'true' : 'false' ); ?>,
105
- otherReasonID = <?php echo Freemius::REASON_OTHER; ?>,
106
- dontShareDataReasonID = <?php echo Freemius::REASON_DONT_LIKE_TO_SHARE_MY_INFORMATION; ?>,
107
- deleteThemeUpdateData = <?php echo $fs->is_theme() && $fs->is_premium() && ! $fs->has_any_active_valid_license() ? 'true' : 'false' ?>,
108
- $subscriptionCancellationModal = $( '.fs-modal-subscription-cancellation-<?php echo $fs->get_id() ?>' ),
109
- showDeactivationFeedbackForm = <?php echo ( $show_deactivation_feedback_form ? 'true' : 'false' ) ?>,
110
- $body = $( 'body' );
111
-
112
- $modal.appendTo( $body );
113
-
114
- if ( 0 !== $subscriptionCancellationModal.length ) {
115
- $subscriptionCancellationModal.on( '<?php echo $fs->get_action_tag( 'subscription_cancellation_action' ) ?>', function( evt, cancelSubscription ) {
116
- var shouldDeactivateModule = ( $modal.hasClass( 'no-confirmation-message' ) && ! showDeactivationFeedbackForm );
117
-
118
- if ( false === cancelSubscription ) {
119
- if ( ! shouldDeactivateModule ) {
120
- showModal();
121
- }
122
-
123
- $subscriptionCancellationModal.trigger( 'closeModal' );
124
-
125
- if ( shouldDeactivateModule ) {
126
- deactivateModule();
127
- }
128
- } else {
129
- var $errorMessage = $subscriptionCancellationModal.find( '.notice-error' );
130
-
131
- <?php
132
- $subscription_cancellation_context = $fs->is_paid_trial() ?
133
- fs_text_inline( 'trial', 'trial', $slug ) :
134
- fs_text_inline( 'subscription', 'subscription', $slug );
135
- ?>
136
-
137
- $.ajax({
138
- url : ajaxurl,
139
- method : 'POST',
140
- data : {
141
- action : '<?php echo $fs->get_ajax_action( 'cancel_subscription_or_trial' ) ?>',
142
- security : '<?php echo $fs->get_ajax_security( 'cancel_subscription_or_trial' ) ?>',
143
- module_id: '<?php echo $fs->get_id() ?>'
144
- },
145
- beforeSend: function() {
146
- $errorMessage.hide();
147
-
148
- $subscriptionCancellationModal.find( '.fs-modal-footer .button' ).addClass( 'disabled' );
149
- $subscriptionCancellationModal.find( '.fs-modal-footer .button-primary' ).text( '<?php echo esc_js(
150
- sprintf( fs_text_inline( 'Cancelling %s...', 'cancelling-x' , $slug ), $subscription_cancellation_context )
151
- ) ?>' );
152
- },
153
- success: function( result ) {
154
- if ( result.success ) {
155
- $subscriptionCancellationModal.removeClass( 'has-subscription-actions' );
156
- $subscriptionCancellationModal.find( '.fs-modal-footer .button-primary' ).removeClass( 'warn' );
157
-
158
- $subscriptionCancellationModal.remove();
159
-
160
- if ( ! shouldDeactivateModule ) {
161
- showModal();
162
- } else {
163
- deactivateModule();
164
- }
165
- } else {
166
- $errorMessage.find( '> p' ).html( result.error );
167
- $errorMessage.show();
168
-
169
- $subscriptionCancellationModal.find( '.fs-modal-footer .button' ).removeClass( 'disabled' );
170
- $subscriptionCancellationModal.find( '.fs-modal-footer .button-primary' ).html( <?php echo json_encode( sprintf(
171
- fs_text_inline( 'Cancel %s & Proceed', 'cancel-x-and-proceed', $slug ),
172
- ucfirst( $subscription_cancellation_context )
173
- ) ) ?> );
174
- }
175
- }
176
- });
177
- }
178
- });
179
- }
180
-
181
- registerEventHandlers();
182
-
183
- function registerEventHandlers() {
184
- $body.on( 'click', '#the-list .deactivate > a', function ( evt ) {
185
- if ( 0 === $( this ).next( '[data-module-id=<?php echo $fs->get_id() ?>].fs-module-id' ).length ) {
186
- return true;
187
- }
188
-
189
- evt.preventDefault();
190
-
191
- redirectLink = $(this).attr('href');
192
-
193
- if ( 0 == $subscriptionCancellationModal.length ) {
194
- showModal();
195
- } else {
196
- $subscriptionCancellationModal.trigger( 'showModal' );
197
- }
198
- });
199
-
200
- <?php
201
- if ( ! $fs->is_plugin() ) {
202
- /**
203
- * For "theme" module type, the modal is shown when the current user clicks on
204
- * the "Activate" button of any other theme. The "Activate" button is actually
205
- * a link to the "Themes" page (/wp-admin/themes.php) containing query params
206
- * that tell WordPress to deactivate the current theme and activate a different theme.
207
- *
208
- * @author Leo Fajardo (@leorw)
209
- * @since 1.2.2
210
- *
211
- * @since 1.2.2.7 Don't trigger the deactivation feedback form if activating the premium version of the theme.
212
- */
213
- ?>
214
- $('body').on('click', '.theme-browser .theme:not([data-slug=<?php echo $fs->get_premium_slug() ?>]) .theme-actions .button.activate', function (evt) {
215
- evt.preventDefault();
216
-
217
- redirectLink = $(this).attr('href');
218
-
219
- if ( 0 != $subscriptionCancellationModal.length ) {
220
- $subscriptionCancellationModal.trigger( 'showModal' );
221
- } else {
222
- if ( $modal.hasClass( 'no-confirmation-message' ) && ! showDeactivationFeedbackForm ) {
223
- deactivateModule();
224
- } else {
225
- showModal();
226
- }
227
- }
228
- });
229
- <?php
230
- } ?>
231
-
232
- $modal.on('input propertychange', '.reason-input input', function () {
233
- if (!isOtherReasonSelected()) {
234
- return;
235
- }
236
-
237
- var reason = $(this).val().trim();
238
-
239
- /**
240
- * If reason is not empty, remove the error-message class of the message container
241
- * to change the message color back to default.
242
- */
243
- if (reason.length > 0) {
244
- $('.message').removeClass('error-message');
245
- enableDeactivateButton();
246
- }
247
- });
248
-
249
- $modal.on('blur', '.reason-input input', function () {
250
- var $userReason = $(this);
251
-
252
- setTimeout(function () {
253
- if (!isOtherReasonSelected()) {
254
- return;
255
- }
256
-
257
- /**
258
- * If reason is empty, add the error-message class to the message container
259
- * to change the message color to red.
260
- */
261
- if (0 === $userReason.val().trim().length) {
262
- $('.message').addClass('error-message');
263
- disableDeactivateButton();
264
- }
265
- }, 150);
266
- });
267
-
268
- $modal.on('click', '.fs-modal-footer .button', function (evt) {
269
- evt.preventDefault();
270
-
271
- if ($(this).hasClass('disabled')) {
272
- return;
273
- }
274
-
275
- var _parent = $(this).parents('.fs-modal:first');
276
- var _this = $(this);
277
-
278
- if (_this.hasClass('allow-deactivate')) {
279
- var $radio = $modal.find('input[type="radio"]:checked');
280
-
281
- if (0 === $radio.length) {
282
- if ( ! deleteThemeUpdateData ) {
283
- // If no selected reason, just deactivate the plugin.
284
- window.location.href = redirectLink;
285
- } else {
286
- $.ajax({
287
- url : ajaxurl,
288
- method : 'POST',
289
- data : {
290
- action : '<?php echo $fs->get_ajax_action( 'delete_theme_update_data' ) ?>',
291
- security : '<?php echo $fs->get_ajax_security( 'delete_theme_update_data' ) ?>',
292
- module_id: '<?php echo $fs->get_id() ?>'
293
- },
294
- beforeSend: function() {
295
- _parent.find( '.fs-modal-footer .button' ).addClass( 'disabled' );
296
- _parent.find( '.fs-modal-footer .button-secondary' ).text( 'Processing...' );
297
- },
298
- complete : function() {
299
- window.location.href = redirectLink;
300
- }
301
- });
302
- }
303
-
304
- return;
305
- }
306
-
307
- var $selected_reason = $radio.parents('li:first'),
308
- $input = $selected_reason.find('textarea, input[type="text"]'),
309
- userReason = ( 0 !== $input.length ) ? $input.val().trim() : '';
310
-
311
- if (isOtherReasonSelected() && ( '' === userReason )) {
312
- return;
313
- }
314
-
315
- $.ajax({
316
- url : ajaxurl,
317
- method : 'POST',
318
- data : {
319
- action : '<?php echo $fs->get_ajax_action( 'submit_uninstall_reason' ) ?>',
320
- security : '<?php echo $fs->get_ajax_security( 'submit_uninstall_reason' ) ?>',
321
- module_id : '<?php echo $fs->get_id() ?>',
322
- reason_id : $radio.val(),
323
- reason_info : userReason,
324
- is_anonymous: isAnonymousFeedback()
325
- },
326
- beforeSend: function () {
327
- _parent.find('.fs-modal-footer .button').addClass('disabled');
328
- _parent.find('.fs-modal-footer .button-secondary').text('Processing...');
329
- },
330
- complete : function () {
331
- // Do not show the dialog box, deactivate the plugin.
332
- window.location.href = redirectLink;
333
- }
334
- });
335
- } else if (_this.hasClass('button-deactivate')) {
336
- // Change the Deactivate button's text and show the reasons panel.
337
- _parent.find('.button-deactivate').addClass('allow-deactivate');
338
-
339
- if ( showDeactivationFeedbackForm ) {
340
- showPanel('reasons');
341
- } else {
342
- deactivateModule();
343
- }
344
- }
345
- });
346
-
347
- $modal.on('click', 'input[type="radio"]', function () {
348
- var $selectedReasonOption = $( this );
349
-
350
- // If the selection has not changed, do not proceed.
351
- if (selectedReasonID === $selectedReasonOption.val())
352
- return;
353
-
354
- selectedReasonID = $selectedReasonOption.val();
355
-
356
- if ( isAnonymous ) {
357
- if ( isReasonSelected( dontShareDataReasonID ) ) {
358
- $anonymousFeedback.hide();
359
- } else {
360
- $anonymousFeedback.show();
361
- }
362
- }
363
-
364
- var _parent = $(this).parents('li:first');
365
-
366
- $modal.find('.reason-input').remove();
367
- $modal.find( '.internal-message' ).hide();
368
- $modal.find('.button-deactivate').html('<?php echo esc_js( sprintf(
369
- fs_text_inline( 'Submit & %s', 'deactivation-modal-button-submit' , $slug ),
370
- $fs->is_plugin() ?
371
- $deactivate_text :
372
- sprintf( $activate_x_text, $theme_text )
373
- ) ) ?>');
374
-
375
- enableDeactivateButton();
376
-
377
- if ( _parent.hasClass( 'has-internal-message' ) ) {
378
- _parent.find( '.internal-message' ).show();
379
- }
380
-
381
- if (_parent.hasClass('has-input')) {
382
- var inputType = _parent.data('input-type'),
383
- inputPlaceholder = _parent.data('input-placeholder'),
384
- reasonInputHtml = '<div class="reason-input"><span class="message"></span>' + ( ( 'textfield' === inputType ) ? '<input type="text" maxlength="128" />' : '<textarea rows="5" maxlength="128"></textarea>' ) + '</div>';
385
-
386
- _parent.append($(reasonInputHtml));
387
- _parent.find('input, textarea').attr('placeholder', inputPlaceholder).focus();
388
-
389
- if (isOtherReasonSelected()) {
390
- showMessage('<?php echo esc_js( fs_text_inline( 'Kindly tell us the reason so we can improve.', 'ask-for-reason-message' , $slug ) ); ?>');
391
- disableDeactivateButton();
392
- }
393
- }
394
- });
395
-
396
- // If the user has clicked outside the window, cancel it.
397
- $modal.on('click', function (evt) {
398
- var $target = $(evt.target);
399
-
400
- // If the user has clicked anywhere in the modal dialog, just return.
401
- if ($target.hasClass('fs-modal-body') || $target.hasClass('fs-modal-footer')) {
402
- return;
403
- }
404
-
405
- // If the user has not clicked the close button and the clicked element is inside the modal dialog, just return.
406
- if (
407
- ! $target.hasClass( 'button-close' ) &&
408
- ( $target.parents( '.fs-modal-body' ).length > 0 || $target.parents( '.fs-modal-footer' ).length > 0 )
409
- ) {
410
- return;
411
- }
412
-
413
- closeModal();
414
-
415
- return false;
416
- });
417
- }
418
-
419
- function isAnonymousFeedback() {
420
- if ( ! isAnonymous ) {
421
- return false;
422
- }
423
-
424
- return ( isReasonSelected( dontShareDataReasonID ) || $anonymousFeedback.find( 'input' ).prop( 'checked' ) );
425
- }
426
-
427
- function isReasonSelected( reasonID ) {
428
- // Get the selected radio input element.
429
- var $selectedReasonOption = $modal.find('input[type="radio"]:checked');
430
-
431
- return ( reasonID == $selectedReasonOption.val() );
432
- }
433
-
434
- function isOtherReasonSelected() {
435
- return isReasonSelected( otherReasonID );
436
- }
437
-
438
- function showModal() {
439
- resetModal();
440
-
441
- // Display the dialog box.
442
- $modal.addClass('active');
443
-
444
- $('body').addClass('has-fs-modal');
445
- }
446
-
447
- function closeModal() {
448
- $modal.removeClass('active');
449
-
450
- $('body').removeClass('has-fs-modal');
451
- }
452
-
453
- function resetModal() {
454
- selectedReasonID = false;
455
-
456
- enableDeactivateButton();
457
-
458
- // Uncheck all radio buttons.
459
- $modal.find('input[type="radio"]').prop('checked', false);
460
-
461
- // Remove all input fields ( textfield, textarea ).
462
- $modal.find('.reason-input').remove();
463
-
464
- $modal.find('.message').hide();
465
-
466
- if ( isAnonymous ) {
467
- $anonymousFeedback.find( 'input' ).prop( 'checked', false );
468
-
469
- // Hide, since by default there is no selected reason.
470
- $anonymousFeedback.hide();
471
- }
472
-
473
- var $deactivateButton = $modal.find('.button-deactivate');
474
-
475
- /*
476
- * If the modal dialog has no confirmation message, that is, it has only one panel, then ensure
477
- * that clicking the deactivate button will actually deactivate the plugin.
478
- */
479
- if ( $modal.hasClass( 'no-confirmation-message' ) ) {
480
- $deactivateButton.addClass( 'allow-deactivate' );
481
-
482
- showPanel( 'reasons' );
483
- } else {
484
- $deactivateButton.removeClass( 'allow-deactivate' );
485
-
486
- showPanel( 'confirm' );
487
- }
488
- }
489
-
490
- function showMessage(message) {
491
- $modal.find('.message').text(message).show();
492
- }
493
-
494
- function enableDeactivateButton() {
495
- $modal.find('.button-deactivate').removeClass('disabled');
496
- }
497
-
498
- function disableDeactivateButton() {
499
- $modal.find('.button-deactivate').addClass('disabled');
500
- }
501
-
502
- function showPanel(panelType) {
503
- $modal.find( '.fs-modal-panel' ).removeClass( 'active' );
504
- $modal.find( '[data-panel-id="' + panelType + '"]' ).addClass( 'active' );
505
-
506
- updateButtonLabels();
507
- }
508
-
509
- function updateButtonLabels() {
510
- var $deactivateButton = $modal.find( '.button-deactivate' );
511
-
512
- // Reset the deactivate button's text.
513
- if ( 'confirm' === getCurrentPanel() ) {
514
- $deactivateButton.text( <?php echo json_encode( sprintf(
515
- fs_text_inline( 'Yes - %s', 'deactivation-modal-button-confirm', $slug ),
516
- $fs->is_plugin() ?
517
- $deactivate_text :
518
- sprintf( $activate_x_text, $theme_text )
519
- ) ) ?> );
520
- } else {
521
- $deactivateButton.html( <?php echo json_encode( sprintf(
522
- fs_text_inline('Skip & %s', 'skip-and-x', $slug ),
523
- $fs->is_plugin() ?
524
- $deactivate_text :
525
- sprintf( $activate_x_text, $theme_text )
526
- ) ) ?> );
527
- }
528
- }
529
-
530
- function getCurrentPanel() {
531
- return $modal.find('.fs-modal-panel.active').attr('data-panel-id');
532
- }
533
-
534
- /**
535
- * @author Leo Fajardo (@leorw)
536
- *
537
- * @since 2.3.0
538
- */
539
- function deactivateModule() {
540
- window.location.href = redirectLink;
541
- }
542
- })(jQuery);
543
- </script>
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.1.2
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * @var array $VARS
15
+ */
16
+ $fs = freemius( $VARS['id'] );
17
+ $slug = $fs->get_slug();
18
+
19
+ $subscription_cancellation_dialog_box_template_params = $VARS['subscription_cancellation_dialog_box_template_params'];
20
+ $show_deactivation_feedback_form = $VARS['show_deactivation_feedback_form'];
21
+ $confirmation_message = $VARS['uninstall_confirmation_message'];
22
+
23
+ $is_anonymous = ( ! $fs->is_registered() );
24
+ $anonymous_feedback_checkbox_html = '';
25
+
26
+ $reasons_list_items_html = '';
27
+
28
+ if ( $show_deactivation_feedback_form ) {
29
+ $reasons = $VARS['reasons'];
30
+
31
+ foreach ( $reasons as $reason ) {
32
+ $list_item_classes = 'reason' . ( ! empty( $reason['input_type'] ) ? ' has-input' : '' );
33
+
34
+ if ( isset( $reason['internal_message'] ) && ! empty( $reason['internal_message'] ) ) {
35
+ $list_item_classes .= ' has-internal-message';
36
+ $reason_internal_message = $reason['internal_message'];
37
+ } else {
38
+ $reason_internal_message = '';
39
+ }
40
+
41
+ $reason_input_type = ( ! empty( $reason['input_type'] ) ? $reason['input_type'] : '' );
42
+ $reason_input_placeholder = ( ! empty( $reason['input_placeholder'] ) ? $reason['input_placeholder'] : '' );
43
+
44
+ $reason_list_item_html = <<< HTML
45
+ <li class="{$list_item_classes}"
46
+ data-input-type="{$reason_input_type}"
47
+ data-input-placeholder="{$reason_input_placeholder}">
48
+ <label>
49
+ <span>
50
+ <input type="radio" name="selected-reason" value="{$reason['id']}"/>
51
+ </span>
52
+ <span>{$reason['text']}</span>
53
+ </label>
54
+ <div class="internal-message">{$reason_internal_message}</div>
55
+ </li>
56
+ HTML;
57
+
58
+ $reasons_list_items_html .= $reason_list_item_html;
59
+ }
60
+
61
+ if ( $is_anonymous ) {
62
+ $anonymous_feedback_checkbox_html = sprintf(
63
+ '<label class="anonymous-feedback-label"><input type="checkbox" class="anonymous-feedback-checkbox"> %s</label>',
64
+ fs_esc_html_inline( 'Anonymous feedback', 'anonymous-feedback', $slug )
65
+ );
66
+ }
67
+ }
68
+
69
+ // Aliases.
70
+ $deactivate_text = fs_text_inline( 'Deactivate', 'deactivate', $slug );
71
+ $theme_text = fs_text_inline( 'Theme', 'theme', $slug );
72
+ $activate_x_text = fs_text_inline( 'Activate %s', 'activate-x', $slug );
73
+
74
+ fs_enqueue_local_style( 'fs_dialog_boxes', '/admin/dialog-boxes.css' );
75
+
76
+ if ( ! empty( $subscription_cancellation_dialog_box_template_params ) ) {
77
+ fs_require_template( 'forms/subscription-cancellation.php', $subscription_cancellation_dialog_box_template_params );
78
+ }
79
+ ?>
80
+ <script type="text/javascript">
81
+ (function ($) {
82
+ var reasonsHtml = <?php echo json_encode( $reasons_list_items_html ) ?>,
83
+ modalHtml =
84
+ '<div class="fs-modal fs-modal-deactivation-feedback<?php echo empty( $confirmation_message ) ? ' no-confirmation-message' : ''; ?>">'
85
+ + ' <div class="fs-modal-dialog">'
86
+ + ' <div class="fs-modal-header">'
87
+ + ' <h4><?php fs_esc_attr_echo_inline( 'Quick Feedback', 'quick-feedback' , $slug ) ?></h4>'
88
+ + ' </div>'
89
+ + ' <div class="fs-modal-body">'
90
+ + ' <div class="fs-modal-panel" data-panel-id="confirm"><p><?php echo $confirmation_message; ?></p></div>'
91
+ + ' <div class="fs-modal-panel active" data-panel-id="reasons"><h3><strong><?php echo esc_js( sprintf( fs_text_inline( 'If you have a moment, please let us know why you are %s', 'deactivation-share-reason' , $slug ), ( $fs->is_plugin() ? fs_text_inline( 'deactivating', 'deactivating', $slug ) : fs_text_inline( 'switching', 'switching', $slug ) ) ) ) ?>:</strong></h3><ul id="reasons-list">' + reasonsHtml + '</ul></div>'
92
+ + ' </div>'
93
+ + ' <div class="fs-modal-footer">'
94
+ + ' <?php echo $anonymous_feedback_checkbox_html ?>'
95
+ + ' <a href="#" class="button button-secondary button-deactivate"></a>'
96
+ + ' <a href="#" class="button button-secondary button-close"><?php fs_esc_js_echo_inline( 'Cancel', 'cancel', $slug ) ?></a>'
97
+ + ' </div>'
98
+ + ' </div>'
99
+ + '</div>',
100
+ $modal = $(modalHtml),
101
+ selectedReasonID = false,
102
+ redirectLink = '',
103
+ $anonymousFeedback = $modal.find( '.anonymous-feedback-label' ),
104
+ isAnonymous = <?php echo ( $is_anonymous ? 'true' : 'false' ); ?>,
105
+ otherReasonID = <?php echo Freemius::REASON_OTHER; ?>,
106
+ dontShareDataReasonID = <?php echo Freemius::REASON_DONT_LIKE_TO_SHARE_MY_INFORMATION; ?>,
107
+ deleteThemeUpdateData = <?php echo $fs->is_theme() && $fs->is_premium() && ! $fs->has_any_active_valid_license() ? 'true' : 'false' ?>,
108
+ $subscriptionCancellationModal = $( '.fs-modal-subscription-cancellation-<?php echo $fs->get_id() ?>' ),
109
+ showDeactivationFeedbackForm = <?php echo ( $show_deactivation_feedback_form ? 'true' : 'false' ) ?>,
110
+ $body = $( 'body' );
111
+
112
+ $modal.appendTo( $body );
113
+
114
+ if ( 0 !== $subscriptionCancellationModal.length ) {
115
+ $subscriptionCancellationModal.on( '<?php echo $fs->get_action_tag( 'subscription_cancellation_action' ) ?>', function( evt, cancelSubscription ) {
116
+ var shouldDeactivateModule = ( $modal.hasClass( 'no-confirmation-message' ) && ! showDeactivationFeedbackForm );
117
+
118
+ if ( false === cancelSubscription ) {
119
+ if ( ! shouldDeactivateModule ) {
120
+ showModal();
121
+ }
122
+
123
+ $subscriptionCancellationModal.trigger( 'closeModal' );
124
+
125
+ if ( shouldDeactivateModule ) {
126
+ deactivateModule();
127
+ }
128
+ } else {
129
+ var $errorMessage = $subscriptionCancellationModal.find( '.notice-error' );
130
+
131
+ <?php
132
+ $subscription_cancellation_context = $fs->is_paid_trial() ?
133
+ fs_text_inline( 'trial', 'trial', $slug ) :
134
+ fs_text_inline( 'subscription', 'subscription', $slug );
135
+ ?>
136
+
137
+ $.ajax({
138
+ url : ajaxurl,
139
+ method : 'POST',
140
+ data : {
141
+ action : '<?php echo $fs->get_ajax_action( 'cancel_subscription_or_trial' ) ?>',
142
+ security : '<?php echo $fs->get_ajax_security( 'cancel_subscription_or_trial' ) ?>',
143
+ module_id: '<?php echo $fs->get_id() ?>'
144
+ },
145
+ beforeSend: function() {
146
+ $errorMessage.hide();
147
+
148
+ $subscriptionCancellationModal.find( '.fs-modal-footer .button' ).addClass( 'disabled' );
149
+ $subscriptionCancellationModal.find( '.fs-modal-footer .button-primary' ).text( '<?php echo esc_js(
150
+ sprintf( fs_text_inline( 'Cancelling %s...', 'cancelling-x' , $slug ), $subscription_cancellation_context )
151
+ ) ?>' );
152
+ },
153
+ success: function( result ) {
154
+ if ( result.success ) {
155
+ $subscriptionCancellationModal.removeClass( 'has-subscription-actions' );
156
+ $subscriptionCancellationModal.find( '.fs-modal-footer .button-primary' ).removeClass( 'warn' );
157
+
158
+ $subscriptionCancellationModal.remove();
159
+
160
+ if ( ! shouldDeactivateModule ) {
161
+ showModal();
162
+ } else {
163
+ deactivateModule();
164
+ }
165
+ } else {
166
+ $errorMessage.find( '> p' ).html( result.error );
167
+ $errorMessage.show();
168
+
169
+ $subscriptionCancellationModal.find( '.fs-modal-footer .button' ).removeClass( 'disabled' );
170
+ $subscriptionCancellationModal.find( '.fs-modal-footer .button-primary' ).html( <?php echo json_encode( sprintf(
171
+ fs_text_inline( 'Cancel %s & Proceed', 'cancel-x-and-proceed', $slug ),
172
+ ucfirst( $subscription_cancellation_context )
173
+ ) ) ?> );
174
+ }
175
+ }
176
+ });
177
+ }
178
+ });
179
+ }
180
+
181
+ registerEventHandlers();
182
+
183
+ function registerEventHandlers() {
184
+ $body.on( 'click', '#the-list .deactivate > a', function ( evt ) {
185
+ if ( 0 === $( this ).next( '[data-module-id=<?php echo $fs->get_id() ?>].fs-module-id' ).length ) {
186
+ return true;
187
+ }
188
+
189
+ evt.preventDefault();
190
+
191
+ redirectLink = $(this).attr('href');
192
+
193
+ if ( 0 == $subscriptionCancellationModal.length ) {
194
+ showModal();
195
+ } else {
196
+ $subscriptionCancellationModal.trigger( 'showModal' );
197
+ }
198
+ });
199
+
200
+ <?php
201
+ if ( ! $fs->is_plugin() ) {
202
+ /**
203
+ * For "theme" module type, the modal is shown when the current user clicks on
204
+ * the "Activate" button of any other theme. The "Activate" button is actually
205
+ * a link to the "Themes" page (/wp-admin/themes.php) containing query params
206
+ * that tell WordPress to deactivate the current theme and activate a different theme.
207
+ *
208
+ * @author Leo Fajardo (@leorw)
209
+ * @since 1.2.2
210
+ *
211
+ * @since 1.2.2.7 Don't trigger the deactivation feedback form if activating the premium version of the theme.
212
+ */
213
+ ?>
214
+ $('body').on('click', '.theme-browser .theme:not([data-slug=<?php echo $fs->get_premium_slug() ?>]) .theme-actions .button.activate', function (evt) {
215
+ evt.preventDefault();
216
+
217
+ redirectLink = $(this).attr('href');
218
+
219
+ if ( 0 != $subscriptionCancellationModal.length ) {
220
+ $subscriptionCancellationModal.trigger( 'showModal' );
221
+ } else {
222
+ if ( $modal.hasClass( 'no-confirmation-message' ) && ! showDeactivationFeedbackForm ) {
223
+ deactivateModule();
224
+ } else {
225
+ showModal();
226
+ }
227
+ }
228
+ });
229
+ <?php
230
+ } ?>
231
+
232
+ $modal.on('input propertychange', '.reason-input input', function () {
233
+ if (!isOtherReasonSelected()) {
234
+ return;
235
+ }
236
+
237
+ var reason = $(this).val().trim();
238
+
239
+ /**
240
+ * If reason is not empty, remove the error-message class of the message container
241
+ * to change the message color back to default.
242
+ */
243
+ if (reason.length > 0) {
244
+ $('.message').removeClass('error-message');
245
+ enableDeactivateButton();
246
+ }
247
+ });
248
+
249
+ $modal.on('blur', '.reason-input input', function () {
250
+ var $userReason = $(this);
251
+
252
+ setTimeout(function () {
253
+ if (!isOtherReasonSelected()) {
254
+ return;
255
+ }
256
+
257
+ /**
258
+ * If reason is empty, add the error-message class to the message container
259
+ * to change the message color to red.
260
+ */
261
+ if (0 === $userReason.val().trim().length) {
262
+ $('.message').addClass('error-message');
263
+ disableDeactivateButton();
264
+ }
265
+ }, 150);
266
+ });
267
+
268
+ $modal.on('click', '.fs-modal-footer .button', function (evt) {
269
+ evt.preventDefault();
270
+
271
+ if ($(this).hasClass('disabled')) {
272
+ return;
273
+ }
274
+
275
+ var _parent = $(this).parents('.fs-modal:first');
276
+ var _this = $(this);
277
+
278
+ if (_this.hasClass('allow-deactivate')) {
279
+ var $radio = $modal.find('input[type="radio"]:checked');
280
+
281
+ if (0 === $radio.length) {
282
+ if ( ! deleteThemeUpdateData ) {
283
+ // If no selected reason, just deactivate the plugin.
284
+ window.location.href = redirectLink;
285
+ } else {
286
+ $.ajax({
287
+ url : ajaxurl,
288
+ method : 'POST',
289
+ data : {
290
+ action : '<?php echo $fs->get_ajax_action( 'delete_theme_update_data' ) ?>',
291
+ security : '<?php echo $fs->get_ajax_security( 'delete_theme_update_data' ) ?>',
292
+ module_id: '<?php echo $fs->get_id() ?>'
293
+ },
294
+ beforeSend: function() {
295
+ _parent.find( '.fs-modal-footer .button' ).addClass( 'disabled' );
296
+ _parent.find( '.fs-modal-footer .button-secondary' ).text( 'Processing...' );
297
+ },
298
+ complete : function() {
299
+ window.location.href = redirectLink;
300
+ }
301
+ });
302
+ }
303
+
304
+ return;
305
+ }
306
+
307
+ var $selected_reason = $radio.parents('li:first'),
308
+ $input = $selected_reason.find('textarea, input[type="text"]'),
309
+ userReason = ( 0 !== $input.length ) ? $input.val().trim() : '';
310
+
311
+ if (isOtherReasonSelected() && ( '' === userReason )) {
312
+ return;
313
+ }
314
+
315
+ $.ajax({
316
+ url : ajaxurl,
317
+ method : 'POST',
318
+ data : {
319
+ action : '<?php echo $fs->get_ajax_action( 'submit_uninstall_reason' ) ?>',
320
+ security : '<?php echo $fs->get_ajax_security( 'submit_uninstall_reason' ) ?>',
321
+ module_id : '<?php echo $fs->get_id() ?>',
322
+ reason_id : $radio.val(),
323
+ reason_info : userReason,
324
+ is_anonymous: isAnonymousFeedback()
325
+ },
326
+ beforeSend: function () {
327
+ _parent.find('.fs-modal-footer .button').addClass('disabled');
328
+ _parent.find('.fs-modal-footer .button-secondary').text('Processing...');
329
+ },
330
+ complete : function () {
331
+ // Do not show the dialog box, deactivate the plugin.
332
+ window.location.href = redirectLink;
333
+ }
334
+ });
335
+ } else if (_this.hasClass('button-deactivate')) {
336
+ // Change the Deactivate button's text and show the reasons panel.
337
+ _parent.find('.button-deactivate').addClass('allow-deactivate');
338
+
339
+ if ( showDeactivationFeedbackForm ) {
340
+ showPanel('reasons');
341
+ } else {
342
+ deactivateModule();
343
+ }
344
+ }
345
+ });
346
+
347
+ $modal.on('click', 'input[type="radio"]', function () {
348
+ var $selectedReasonOption = $( this );
349
+
350
+ // If the selection has not changed, do not proceed.
351
+ if (selectedReasonID === $selectedReasonOption.val())
352
+ return;
353
+
354
+ selectedReasonID = $selectedReasonOption.val();
355
+
356
+ if ( isAnonymous ) {
357
+ if ( isReasonSelected( dontShareDataReasonID ) ) {
358
+ $anonymousFeedback.hide();
359
+ } else {
360
+ $anonymousFeedback.show();
361
+ }
362
+ }
363
+
364
+ var _parent = $(this).parents('li:first');
365
+
366
+ $modal.find('.reason-input').remove();
367
+ $modal.find( '.internal-message' ).hide();
368
+ $modal.find('.button-deactivate').html('<?php echo esc_js( sprintf(
369
+ fs_text_inline( 'Submit & %s', 'deactivation-modal-button-submit' , $slug ),
370
+ $fs->is_plugin() ?
371
+ $deactivate_text :
372
+ sprintf( $activate_x_text, $theme_text )
373
+ ) ) ?>');
374
+
375
+ enableDeactivateButton();
376
+
377
+ if ( _parent.hasClass( 'has-internal-message' ) ) {
378
+ _parent.find( '.internal-message' ).show();
379
+ }
380
+
381
+ if (_parent.hasClass('has-input')) {
382
+ var inputType = _parent.data('input-type'),
383
+ inputPlaceholder = _parent.data('input-placeholder'),
384
+ reasonInputHtml = '<div class="reason-input"><span class="message"></span>' + ( ( 'textfield' === inputType ) ? '<input type="text" maxlength="128" />' : '<textarea rows="5" maxlength="128"></textarea>' ) + '</div>';
385
+
386
+ _parent.append($(reasonInputHtml));
387
+ _parent.find('input, textarea').attr('placeholder', inputPlaceholder).focus();
388
+
389
+ if (isOtherReasonSelected()) {
390
+ showMessage('<?php echo esc_js( fs_text_inline( 'Kindly tell us the reason so we can improve.', 'ask-for-reason-message' , $slug ) ); ?>');
391
+ disableDeactivateButton();
392
+ }
393
+ }
394
+ });
395
+
396
+ // If the user has clicked outside the window, cancel it.
397
+ $modal.on('click', function (evt) {
398
+ var $target = $(evt.target);
399
+
400
+ // If the user has clicked anywhere in the modal dialog, just return.
401
+ if ($target.hasClass('fs-modal-body') || $target.hasClass('fs-modal-footer')) {
402
+ return;
403
+ }
404
+
405
+ // If the user has not clicked the close button and the clicked element is inside the modal dialog, just return.
406
+ if (
407
+ ! $target.hasClass( 'button-close' ) &&
408
+ ( $target.parents( '.fs-modal-body' ).length > 0 || $target.parents( '.fs-modal-footer' ).length > 0 )
409
+ ) {
410
+ return;
411
+ }
412
+
413
+ closeModal();
414
+
415
+ return false;
416
+ });
417
+ }
418
+
419
+ function isAnonymousFeedback() {
420
+ if ( ! isAnonymous ) {
421
+ return false;
422
+ }
423
+
424
+ return ( isReasonSelected( dontShareDataReasonID ) || $anonymousFeedback.find( 'input' ).prop( 'checked' ) );
425
+ }
426
+
427
+ function isReasonSelected( reasonID ) {
428
+ // Get the selected radio input element.
429
+ var $selectedReasonOption = $modal.find('input[type="radio"]:checked');
430
+
431
+ return ( reasonID == $selectedReasonOption.val() );
432
+ }
433
+
434
+ function isOtherReasonSelected() {
435
+ return isReasonSelected( otherReasonID );
436
+ }
437
+
438
+ function showModal() {
439
+ resetModal();
440
+
441
+ // Display the dialog box.
442
+ $modal.addClass('active');
443
+
444
+ $('body').addClass('has-fs-modal');
445
+ }
446
+
447
+ function closeModal() {
448
+ $modal.removeClass('active');
449
+
450
+ $('body').removeClass('has-fs-modal');
451
+ }
452
+
453
+ function resetModal() {
454
+ selectedReasonID = false;
455
+
456
+ enableDeactivateButton();
457
+
458
+ // Uncheck all radio buttons.
459
+ $modal.find('input[type="radio"]').prop('checked', false);
460
+
461
+ // Remove all input fields ( textfield, textarea ).
462
+ $modal.find('.reason-input').remove();
463
+
464
+ $modal.find('.message').hide();
465
+
466
+ if ( isAnonymous ) {
467
+ $anonymousFeedback.find( 'input' ).prop( 'checked', false );
468
+
469
+ // Hide, since by default there is no selected reason.
470
+ $anonymousFeedback.hide();
471
+ }
472
+
473
+ var $deactivateButton = $modal.find('.button-deactivate');
474
+
475
+ /*
476
+ * If the modal dialog has no confirmation message, that is, it has only one panel, then ensure
477
+ * that clicking the deactivate button will actually deactivate the plugin.
478
+ */
479
+ if ( $modal.hasClass( 'no-confirmation-message' ) ) {
480
+ $deactivateButton.addClass( 'allow-deactivate' );
481
+
482
+ showPanel( 'reasons' );
483
+ } else {
484
+ $deactivateButton.removeClass( 'allow-deactivate' );
485
+
486
+ showPanel( 'confirm' );
487
+ }
488
+ }
489
+
490
+ function showMessage(message) {
491
+ $modal.find('.message').text(message).show();
492
+ }
493
+
494
+ function enableDeactivateButton() {
495
+ $modal.find('.button-deactivate').removeClass('disabled');
496
+ }
497
+
498
+ function disableDeactivateButton() {
499
+ $modal.find('.button-deactivate').addClass('disabled');
500
+ }
501
+
502
+ function showPanel(panelType) {
503
+ $modal.find( '.fs-modal-panel' ).removeClass( 'active' );
504
+ $modal.find( '[data-panel-id="' + panelType + '"]' ).addClass( 'active' );
505
+
506
+ updateButtonLabels();
507
+ }
508
+
509
+ function updateButtonLabels() {
510
+ var $deactivateButton = $modal.find( '.button-deactivate' );
511
+
512
+ // Reset the deactivate button's text.
513
+ if ( 'confirm' === getCurrentPanel() ) {
514
+ $deactivateButton.text( <?php echo json_encode( sprintf(
515
+ fs_text_inline( 'Yes - %s', 'deactivation-modal-button-confirm', $slug ),
516
+ $fs->is_plugin() ?
517
+ $deactivate_text :
518
+ sprintf( $activate_x_text, $theme_text )
519
+ ) ) ?> );
520
+ } else {
521
+ $deactivateButton.html( <?php echo json_encode( sprintf(
522
+ fs_text_inline('Skip & %s', 'skip-and-x', $slug ),
523
+ $fs->is_plugin() ?
524
+ $deactivate_text :
525
+ sprintf( $activate_x_text, $theme_text )
526
+ ) ) ?> );
527
+ }
528
+ }
529
+
530
+ function getCurrentPanel() {
531
+ return $modal.find('.fs-modal-panel.active').attr('data-panel-id');
532
+ }
533
+
534
+ /**
535
+ * @author Leo Fajardo (@leorw)
536
+ *
537
+ * @since 2.3.0
538
+ */
539
+ function deactivateModule() {
540
+ window.location.href = redirectLink;
541
+ }
542
+ })(jQuery);
543
+ </script>
freemius/templates/forms/subscription-cancellation.php CHANGED
@@ -1,277 +1,277 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 2.2.1
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * @var array $VARS
15
- */
16
- $fs = freemius( $VARS['id'] );
17
- $slug = $fs->get_slug();
18
-
19
- /**
20
- * @var FS_Plugin_License $license
21
- */
22
- $license = $VARS['license'];
23
-
24
- $has_trial = $VARS['has_trial'];
25
-
26
- $subscription_cancellation_context = $has_trial ?
27
- fs_text_inline( 'trial', 'trial', $slug ) :
28
- fs_text_inline( 'subscription', 'subscription', $slug );
29
-
30
- $plan = $fs->get_plan();
31
- $module_label = $fs->get_module_label( true );
32
-
33
- if ( $VARS['is_license_deactivation'] ) {
34
- $subscription_cancellation_text = '';
35
- } else {
36
- $subscription_cancellation_text = sprintf(
37
- fs_text_inline(
38
- "Deactivating or uninstalling the %s will automatically disable the license, which you'll be able to use on another site.",
39
- 'deactivation-or-uninstall-message',
40
- $slug
41
- ),
42
- $module_label
43
- ) . ' ';
44
- }
45
-
46
- $subscription_cancellation_text .= sprintf(
47
- fs_text_inline(
48
- 'In case you are NOT planning on using this %s on this site (or any other site) - would you like to cancel the %s as well?',
49
- 'cancel-subscription-message',
50
- $slug
51
- ),
52
- ( $VARS['is_license_deactivation'] ? fs_text_inline( 'license', 'license', $slug ) : $module_label ),
53
- $subscription_cancellation_context
54
- );
55
-
56
- $cancel_subscription_action_label = sprintf(
57
- fs_esc_html_inline(
58
- "Cancel %s - I no longer need any security & feature updates, nor support for %s because I'm not planning to use the %s on this, or any other site.",
59
- 'cancel-x',
60
- $slug
61
- ),
62
- esc_html( $subscription_cancellation_context ),
63
- sprintf( '<strong>%s</strong>', esc_html( $fs->get_plugin_title() ) ),
64
- esc_html( $module_label )
65
- );
66
-
67
- $keep_subscription_active_action_label = esc_html( sprintf(
68
- fs_text_inline(
69
- "Don't cancel %s - I'm still interested in getting security & feature updates, as well as be able to contact support.",
70
- 'dont-cancel-x',
71
- $slug
72
- ),
73
- $subscription_cancellation_context
74
- ) );
75
-
76
- $subscription_cancellation_text = esc_html( $subscription_cancellation_text );
77
-
78
- $subscription_cancellation_html = <<< HTML
79
- <div class="notice notice-error inline"><p></p></div><p>{$subscription_cancellation_text}</p>
80
- <ul class="subscription-actions">
81
- <li>
82
- <label>
83
- <input type="radio" name="cancel-subscription" value="false"/>
84
- <span>{$keep_subscription_active_action_label}</span>
85
- </label>
86
- </li>
87
- <li>
88
- <label>
89
- <input type="radio" name="cancel-subscription" value="true"/>
90
- <span>{$cancel_subscription_action_label}</span>
91
- </label>
92
- </li>
93
- </ul>
94
- HTML;
95
-
96
- $downgrading_plan_text = fs_text_inline( 'Downgrading your plan', 'downgrading-plan', $slug );
97
- $cancelling_subscription_text = fs_text_inline( 'Cancelling the subscription', 'cancelling-subscription', $slug );
98
- /* translators: %1$s: Either 'Downgrading your plan' or 'Cancelling the subscription' */
99
- $downgrade_x_confirm_text = fs_text_inline( '%1$s will immediately stop all future recurring payments and your %2$s plan license will expire in %3$s.', 'downgrade-x-confirm', $slug );
100
- $prices_increase_text = fs_text_inline( 'Please note that we will not be able to grandfather outdated pricing for renewals/new subscriptions after a cancellation. If you choose to renew the subscription manually in the future, after a price increase, which typically occurs once a year, you will be charged the updated price.', 'pricing-increase-warning', $slug );
101
- $after_downgrade_non_blocking_text = fs_text_inline( 'You can still enjoy all %s features but you will not have access to %s security & feature updates, nor support.', 'after-downgrade-non-blocking', $slug );
102
- $after_downgrade_blocking_text = fs_text_inline( 'Once your license expires you can still use the Free version but you will NOT have access to the %s features.', 'after-downgrade-blocking', $slug );
103
- $after_downgrade_blocking_text_premium_only = fs_text_inline( 'Once your license expires you will no longer be able to use the %s, unless you activate it again with a valid premium license.', 'after-downgrade-blocking-premium-only', $slug );
104
-
105
- $subscription_cancellation_confirmation_message = $has_trial ?
106
- fs_text_inline( 'Cancelling the trial will immediately block access to all premium features. Are you sure?', 'cancel-trial-confirm', $slug ) :
107
- sprintf(
108
- '%s %s %s %s',
109
- sprintf(
110
- $downgrade_x_confirm_text,
111
- ($fs->is_only_premium() ? $cancelling_subscription_text : $downgrading_plan_text ),
112
- $plan->title,
113
- human_time_diff( time(), strtotime( $license->expiration ) )
114
- ),
115
- (
116
- $license->is_block_features ?
117
- (
118
- $fs->is_only_premium() ?
119
- sprintf( $after_downgrade_blocking_text_premium_only, $module_label ) :
120
- sprintf( $after_downgrade_blocking_text, $plan->title )
121
- ) :
122
- sprintf( $after_downgrade_non_blocking_text, $plan->title, $fs->get_module_label( true ) )
123
- ),
124
- $prices_increase_text,
125
- fs_esc_attr_inline( 'Are you sure you want to proceed?', 'proceed-confirmation', $slug )
126
- );
127
-
128
- fs_enqueue_local_style( 'fs_dialog_boxes', '/admin/dialog-boxes.css' );
129
- ?>
130
- <script type="text/javascript">
131
- (function( $ ) {
132
- var modalHtml =
133
- '<div class="fs-modal fs-modal-subscription-cancellation fs-modal-subscription-cancellation-<?php echo $fs->get_id() ?>">'
134
- + ' <div class="fs-modal-dialog">'
135
- + ' <div class="fs-modal-header">'
136
- + ' <h4><?php echo esc_html( sprintf( fs_text_inline( 'Cancel %s?', 'cancel-x', $slug ), ucfirst( $subscription_cancellation_context ) ) ) ?></h4>'
137
- + ' </div>'
138
- + ' <div class="fs-modal-body">'
139
- + ' <div class="fs-modal-panel active">' + <?php echo json_encode( $subscription_cancellation_html ) ?> + '<p class="fs-price-increase-warning" style="display: none;">' + <?php echo json_encode( $prices_increase_text ) ?> + '</p></div>'
140
- + ' </div>'
141
- + ' <div class="fs-modal-footer">'
142
- + ' <a href="#" class="button button-secondary button-close"><?php fs_esc_attr_echo( 'cancel', $slug ) ?></a>'
143
- + ' <a href="#" class="button button-primary button-deactivate disabled"><?php fs_esc_attr_echo_inline( 'Proceed', 'proceed', $slug ) ?></a>'
144
- + ' </div>'
145
- + ' </div>'
146
- + '</div>',
147
- $modal = $(modalHtml);
148
-
149
- $modal.appendTo($('body'));
150
-
151
- registerEventHandlers();
152
-
153
- function registerEventHandlers() {
154
- $modal.on( 'showModal', function() {
155
- showModal();
156
- });
157
-
158
- $modal.on( 'closeModal', function() {
159
- closeModal();
160
- });
161
-
162
- $modal.on('click', '.fs-modal-footer .button', function (evt) {
163
- evt.preventDefault();
164
-
165
- if ($(this).hasClass('disabled')) {
166
- return;
167
- }
168
-
169
- var _this = $(this),
170
- subscriptionCancellationActionEventName = <?php echo json_encode( $fs->get_action_tag( 'subscription_cancellation_action' ) ) ?>;
171
-
172
- if ( _this.hasClass( 'button-primary' ) ) {
173
- if ( 'true' !== $modal.find( 'input[name="cancel-subscription"]:checked' ).val() ) {
174
- $modal.trigger( subscriptionCancellationActionEventName, false );
175
- } else {
176
- if ( confirm( <?php echo json_encode( $subscription_cancellation_confirmation_message ) ?> ) ) {
177
- $modal.trigger( subscriptionCancellationActionEventName, true );
178
- }
179
- }
180
- }
181
- });
182
-
183
- $modal.on('click', 'input[type="radio"]', function () {
184
- var
185
- $selectedOption = $( this ),
186
- $primaryButton = $modal.find( '.button-primary' ),
187
- isSelected = ( 'true' === $selectedOption.val() );
188
-
189
- if ( isSelected ) {
190
- $primaryButton.html( <?php echo json_encode( sprintf(
191
- fs_text_inline( 'Cancel %s & Proceed', 'cancel-x-and-proceed', $slug ),
192
- ucfirst( $subscription_cancellation_context )
193
- ) ) ?> );
194
-
195
- $modal.find('.fs-price-increase-warning').show();
196
- } else {
197
- $primaryButton.html( <?php echo fs_json_encode_echo_inline( 'Proceed', 'proceed', $slug ) ?> );
198
- $modal.find('.fs-price-increase-warning').hide();
199
- }
200
-
201
- $primaryButton.toggleClass( 'warn', isSelected );
202
- $primaryButton.removeClass( 'disabled' );
203
- });
204
-
205
- // If the user has clicked outside the window, cancel it.
206
- $modal.on('click', function (evt) {
207
- var $target = $(evt.target);
208
-
209
- // If the user has clicked anywhere in the modal dialog, just return.
210
- if ($target.hasClass('fs-modal-body') || $target.hasClass('fs-modal-footer')) {
211
- return;
212
- }
213
-
214
- // If the user has not clicked the close button and the clicked element is inside the modal dialog, just return.
215
- if (
216
- ( ! $target.hasClass( 'button-close' ) ) &&
217
- ( $target.parents( '.fs-modal-body' ).length > 0 || $target.parents( '.fs-modal-footer' ).length > 0 )
218
- ) {
219
- return;
220
- }
221
-
222
- closeModal();
223
-
224
- return false;
225
- });
226
- }
227
-
228
- function showModal() {
229
- resetModal();
230
-
231
- // Display the dialog box.
232
- $modal.addClass('active');
233
-
234
- $('body').addClass('has-fs-modal');
235
- }
236
-
237
- function closeModal() {
238
- var activeModalsCount = $( '.fs-modal.active' ).length;
239
-
240
- $modal.removeClass('active');
241
-
242
- // If child modal, do not remove the "has-fs-modal" class of the <body> element to keep its scrollbars hidden.
243
- if ( activeModalsCount > 1 ) {
244
- return;
245
- }
246
-
247
- $('body').removeClass('has-fs-modal');
248
- }
249
-
250
- function resetModal() {
251
- updateButtonLabels();
252
-
253
- if ( 0 === $modal.find( '.subscription-actions' ).length ) {
254
- $modal.find('.button-deactivate').removeClass('disabled');
255
- } else {
256
- $modal.find('.button-deactivate').addClass('disabled');
257
- }
258
-
259
- $modal.find('.fs-price-increase-warning').hide();
260
-
261
- // Uncheck all radio buttons.
262
- $modal.find('input[type="radio"]').prop('checked', false);
263
-
264
- $modal.find('.message').hide();
265
- }
266
-
267
- function showMessage(message) {
268
- $modal.find('.message').text(message).show();
269
- }
270
-
271
- function updateButtonLabels() {
272
- $modal.find('.button-primary').text( <?php fs_json_encode_echo_inline( 'Proceed', 'proceed', $slug ) ?> );
273
-
274
- $modal.find('.button-secondary').text( <?php fs_json_encode_echo( 'cancel', $slug ) ?> );
275
- }
276
- })( jQuery );
277
  </script>
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 2.2.1
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * @var array $VARS
15
+ */
16
+ $fs = freemius( $VARS['id'] );
17
+ $slug = $fs->get_slug();
18
+
19
+ /**
20
+ * @var FS_Plugin_License $license
21
+ */
22
+ $license = $VARS['license'];
23
+
24
+ $has_trial = $VARS['has_trial'];
25
+
26
+ $subscription_cancellation_context = $has_trial ?
27
+ fs_text_inline( 'trial', 'trial', $slug ) :
28
+ fs_text_inline( 'subscription', 'subscription', $slug );
29
+
30
+ $plan = $fs->get_plan();
31
+ $module_label = $fs->get_module_label( true );
32
+
33
+ if ( $VARS['is_license_deactivation'] ) {
34
+ $subscription_cancellation_text = '';
35
+ } else {
36
+ $subscription_cancellation_text = sprintf(
37
+ fs_text_inline(
38
+ "Deactivating or uninstalling the %s will automatically disable the license, which you'll be able to use on another site.",
39
+ 'deactivation-or-uninstall-message',
40
+ $slug
41
+ ),
42
+ $module_label
43
+ ) . ' ';
44
+ }
45
+
46
+ $subscription_cancellation_text .= sprintf(
47
+ fs_text_inline(
48
+ 'In case you are NOT planning on using this %s on this site (or any other site) - would you like to cancel the %s as well?',
49
+ 'cancel-subscription-message',
50
+ $slug
51
+ ),
52
+ ( $VARS['is_license_deactivation'] ? fs_text_inline( 'license', 'license', $slug ) : $module_label ),
53
+ $subscription_cancellation_context
54
+ );
55
+
56
+ $cancel_subscription_action_label = sprintf(
57
+ fs_esc_html_inline(
58
+ "Cancel %s - I no longer need any security & feature updates, nor support for %s because I'm not planning to use the %s on this, or any other site.",
59
+ 'cancel-x',
60
+ $slug
61
+ ),
62
+ esc_html( $subscription_cancellation_context ),
63
+ sprintf( '<strong>%s</strong>', esc_html( $fs->get_plugin_title() ) ),
64
+ esc_html( $module_label )
65
+ );
66
+
67
+ $keep_subscription_active_action_label = esc_html( sprintf(
68
+ fs_text_inline(
69
+ "Don't cancel %s - I'm still interested in getting security & feature updates, as well as be able to contact support.",
70
+ 'dont-cancel-x',
71
+ $slug
72
+ ),
73
+ $subscription_cancellation_context
74
+ ) );
75
+
76
+ $subscription_cancellation_text = esc_html( $subscription_cancellation_text );
77
+
78
+ $subscription_cancellation_html = <<< HTML
79
+ <div class="notice notice-error inline"><p></p></div><p>{$subscription_cancellation_text}</p>
80
+ <ul class="subscription-actions">
81
+ <li>
82
+ <label>
83
+ <input type="radio" name="cancel-subscription" value="false"/>
84
+ <span>{$keep_subscription_active_action_label}</span>
85
+ </label>
86
+ </li>
87
+ <li>
88
+ <label>
89
+ <input type="radio" name="cancel-subscription" value="true"/>
90
+ <span>{$cancel_subscription_action_label}</span>
91
+ </label>
92
+ </li>
93
+ </ul>
94
+ HTML;
95
+
96
+ $downgrading_plan_text = fs_text_inline( 'Downgrading your plan', 'downgrading-plan', $slug );
97
+ $cancelling_subscription_text = fs_text_inline( 'Cancelling the subscription', 'cancelling-subscription', $slug );
98
+ /* translators: %1$s: Either 'Downgrading your plan' or 'Cancelling the subscription' */
99
+ $downgrade_x_confirm_text = fs_text_inline( '%1$s will immediately stop all future recurring payments and your %2$s plan license will expire in %3$s.', 'downgrade-x-confirm', $slug );
100
+ $prices_increase_text = fs_text_inline( 'Please note that we will not be able to grandfather outdated pricing for renewals/new subscriptions after a cancellation. If you choose to renew the subscription manually in the future, after a price increase, which typically occurs once a year, you will be charged the updated price.', 'pricing-increase-warning', $slug );
101
+ $after_downgrade_non_blocking_text = fs_text_inline( 'You can still enjoy all %s features but you will not have access to %s security & feature updates, nor support.', 'after-downgrade-non-blocking', $slug );
102
+ $after_downgrade_blocking_text = fs_text_inline( 'Once your license expires you can still use the Free version but you will NOT have access to the %s features.', 'after-downgrade-blocking', $slug );
103
+ $after_downgrade_blocking_text_premium_only = fs_text_inline( 'Once your license expires you will no longer be able to use the %s, unless you activate it again with a valid premium license.', 'after-downgrade-blocking-premium-only', $slug );
104
+
105
+ $subscription_cancellation_confirmation_message = $has_trial ?
106
+ fs_text_inline( 'Cancelling the trial will immediately block access to all premium features. Are you sure?', 'cancel-trial-confirm', $slug ) :
107
+ sprintf(
108
+ '%s %s %s %s',
109
+ sprintf(
110
+ $downgrade_x_confirm_text,
111
+ ($fs->is_only_premium() ? $cancelling_subscription_text : $downgrading_plan_text ),
112
+ $plan->title,
113
+ human_time_diff( time(), strtotime( $license->expiration ) )
114
+ ),
115
+ (
116
+ $license->is_block_features ?
117
+ (
118
+ $fs->is_only_premium() ?
119
+ sprintf( $after_downgrade_blocking_text_premium_only, $module_label ) :
120
+ sprintf( $after_downgrade_blocking_text, $plan->title )
121
+ ) :
122
+ sprintf( $after_downgrade_non_blocking_text, $plan->title, $fs->get_module_label( true ) )
123
+ ),
124
+ $prices_increase_text,
125
+ fs_esc_attr_inline( 'Are you sure you want to proceed?', 'proceed-confirmation', $slug )
126
+ );
127
+
128
+ fs_enqueue_local_style( 'fs_dialog_boxes', '/admin/dialog-boxes.css' );
129
+ ?>
130
+ <script type="text/javascript">
131
+ (function( $ ) {
132
+ var modalHtml =
133
+ '<div class="fs-modal fs-modal-subscription-cancellation fs-modal-subscription-cancellation-<?php echo $fs->get_id() ?>">'
134
+ + ' <div class="fs-modal-dialog">'
135
+ + ' <div class="fs-modal-header">'
136
+ + ' <h4><?php echo esc_html( sprintf( fs_text_inline( 'Cancel %s?', 'cancel-x', $slug ), ucfirst( $subscription_cancellation_context ) ) ) ?></h4>'
137
+ + ' </div>'
138
+ + ' <div class="fs-modal-body">'
139
+ + ' <div class="fs-modal-panel active">' + <?php echo json_encode( $subscription_cancellation_html ) ?> + '<p class="fs-price-increase-warning" style="display: none;">' + <?php echo json_encode( $prices_increase_text ) ?> + '</p></div>'
140
+ + ' </div>'
141
+ + ' <div class="fs-modal-footer">'
142
+ + ' <a href="#" class="button button-secondary button-close"><?php fs_esc_attr_echo( 'cancel', $slug ) ?></a>'
143
+ + ' <a href="#" class="button button-primary button-deactivate disabled"><?php fs_esc_attr_echo_inline( 'Proceed', 'proceed', $slug ) ?></a>'
144
+ + ' </div>'
145
+ + ' </div>'
146
+ + '</div>',
147
+ $modal = $(modalHtml);
148
+
149
+ $modal.appendTo($('body'));
150
+
151
+ registerEventHandlers();
152
+
153
+ function registerEventHandlers() {
154
+ $modal.on( 'showModal', function() {
155
+ showModal();
156
+ });
157
+
158
+ $modal.on( 'closeModal', function() {
159
+ closeModal();
160
+ });
161
+
162
+ $modal.on('click', '.fs-modal-footer .button', function (evt) {
163
+ evt.preventDefault();
164
+
165
+ if ($(this).hasClass('disabled')) {
166
+ return;
167
+ }
168
+
169
+ var _this = $(this),
170
+ subscriptionCancellationActionEventName = <?php echo json_encode( $fs->get_action_tag( 'subscription_cancellation_action' ) ) ?>;
171
+
172
+ if ( _this.hasClass( 'button-primary' ) ) {
173
+ if ( 'true' !== $modal.find( 'input[name="cancel-subscription"]:checked' ).val() ) {
174
+ $modal.trigger( subscriptionCancellationActionEventName, false );
175
+ } else {
176
+ if ( confirm( <?php echo json_encode( $subscription_cancellation_confirmation_message ) ?> ) ) {
177
+ $modal.trigger( subscriptionCancellationActionEventName, true );
178
+ }
179
+ }
180
+ }
181
+ });
182
+
183
+ $modal.on('click', 'input[type="radio"]', function () {
184
+ var
185
+ $selectedOption = $( this ),
186
+ $primaryButton = $modal.find( '.button-primary' ),
187
+ isSelected = ( 'true' === $selectedOption.val() );
188
+
189
+ if ( isSelected ) {
190
+ $primaryButton.html( <?php echo json_encode( sprintf(
191
+ fs_text_inline( 'Cancel %s & Proceed', 'cancel-x-and-proceed', $slug ),
192
+ ucfirst( $subscription_cancellation_context )
193
+ ) ) ?> );
194
+
195
+ $modal.find('.fs-price-increase-warning').show();
196
+ } else {
197
+ $primaryButton.html( <?php echo fs_json_encode_echo_inline( 'Proceed', 'proceed', $slug ) ?> );
198
+ $modal.find('.fs-price-increase-warning').hide();
199
+ }
200
+
201
+ $primaryButton.toggleClass( 'warn', isSelected );
202
+ $primaryButton.removeClass( 'disabled' );
203
+ });
204
+
205
+ // If the user has clicked outside the window, cancel it.
206
+ $modal.on('click', function (evt) {
207
+ var $target = $(evt.target);
208
+
209
+ // If the user has clicked anywhere in the modal dialog, just return.
210
+ if ($target.hasClass('fs-modal-body') || $target.hasClass('fs-modal-footer')) {
211
+ return;
212
+ }
213
+
214
+ // If the user has not clicked the close button and the clicked element is inside the modal dialog, just return.
215
+ if (
216
+ ( ! $target.hasClass( 'button-close' ) ) &&
217
+ ( $target.parents( '.fs-modal-body' ).length > 0 || $target.parents( '.fs-modal-footer' ).length > 0 )
218
+ ) {
219
+ return;
220
+ }
221
+
222
+ closeModal();
223
+
224
+ return false;
225
+ });
226
+ }
227
+
228
+ function showModal() {
229
+ resetModal();
230
+
231
+ // Display the dialog box.
232
+ $modal.addClass('active');
233
+
234
+ $('body').addClass('has-fs-modal');
235
+ }
236
+
237
+ function closeModal() {
238
+ var activeModalsCount = $( '.fs-modal.active' ).length;
239
+
240
+ $modal.removeClass('active');
241
+
242
+ // If child modal, do not remove the "has-fs-modal" class of the <body> element to keep its scrollbars hidden.
243
+ if ( activeModalsCount > 1 ) {
244
+ return;
245
+ }
246
+
247
+ $('body').removeClass('has-fs-modal');
248
+ }
249
+
250
+ function resetModal() {
251
+ updateButtonLabels();
252
+
253
+ if ( 0 === $modal.find( '.subscription-actions' ).length ) {
254
+ $modal.find('.button-deactivate').removeClass('disabled');
255
+ } else {
256
+ $modal.find('.button-deactivate').addClass('disabled');
257
+ }
258
+
259
+ $modal.find('.fs-price-increase-warning').hide();
260
+
261
+ // Uncheck all radio buttons.
262
+ $modal.find('input[type="radio"]').prop('checked', false);
263
+
264
+ $modal.find('.message').hide();
265
+ }
266
+
267
+ function showMessage(message) {
268
+ $modal.find('.message').text(message).show();
269
+ }
270
+
271
+ function updateButtonLabels() {
272
+ $modal.find('.button-primary').text( <?php fs_json_encode_echo_inline( 'Proceed', 'proceed', $slug ) ?> );
273
+
274
+ $modal.find('.button-secondary').text( <?php fs_json_encode_echo( 'cancel', $slug ) ?> );
275
+ }
276
+ })( jQuery );
277
  </script>
freemius/templates/forms/trial-start.php CHANGED
@@ -1,181 +1,181 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.2.0
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * @var array $VARS
15
- * @var Freemius $fs
16
- */
17
- $fs = freemius( $VARS['id'] );
18
- $slug = $fs->get_slug();
19
-
20
- $message_header = sprintf(
21
- /* translators: %1$s: Number of trial days; %2$s: Plan name; */
22
- fs_text_inline( 'You are 1-click away from starting your %1$s-day free trial of the %2$s plan.', 'start-trial-prompt-header', $slug ),
23
- '<span class="var-trial_period"></span>',
24
- '<span class="var-plan_title"></span>'
25
- );
26
- $message_content = sprintf(
27
- /* translators: %s: Link to freemius.com */
28
- fs_text_inline( 'For compliance with the WordPress.org guidelines, before we start the trial we ask that you opt in with your user and non-sensitive site information, allowing the %s to periodically send data to %s to check for version updates and to validate your trial.', 'start-trial-prompt-message', $slug ),
29
- $fs->get_module_type(),
30
- sprintf(
31
- '<a href="%s" target="_blank" rel="noopener">%s</a>',
32
- 'https://freemius.com',
33
- 'freemius.com'
34
- )
35
- );
36
-
37
- $modal_content_html = <<< HTML
38
- <div class="notice notice-error inline"><p></p></div>
39
- <h3>{$message_header}</h3>
40
- <p>{$message_content}</p>
41
- HTML;
42
-
43
- fs_enqueue_local_style( 'fs_dialog_boxes', '/admin/dialog-boxes.css' );
44
- ?>
45
- <script type="text/javascript">
46
- (function ($) {
47
- $(document).ready(function () {
48
- var modalContentHtml = <?php echo json_encode( $modal_content_html ); ?>,
49
- modalHtml =
50
- '<div class="fs-modal fs-modal-license-key-resend">'
51
- + ' <div class="fs-modal-dialog">'
52
- + ' <div class="fs-modal-header">'
53
- + ' <h4><?php echo esc_js( fs_text_x_inline( 'Start free trial', 'call to action', 'start-free-trial', $slug ) ) ?></h4>'
54
- + ' </div>'
55
- + ' <div class="fs-modal-body">' + modalContentHtml + '</div>'
56
- + ' <div class="fs-modal-footer">'
57
- + ' <button class="button button-secondary button-close">' + <?php fs_json_encode_echo_inline( 'Cancel', 'cancel', $slug ) ?> +'</button>'
58
- + ' <button class="button button-primary button-connect">' + <?php fs_json_encode_echo_inline( 'Approve & Start Trial', 'approve-start-trial', $slug ) ?> +'</button>'
59
- + ' </div>'
60
- + ' </div>'
61
- + '</div>',
62
- $modal = $( modalHtml ),
63
- trialData;
64
-
65
- $modal.appendTo($('body'));
66
-
67
- var $errorNotice = $modal.find('.notice-error');
68
-
69
- registerEventHandlers();
70
-
71
- function registerEventHandlers() {
72
- $modal.on('click', '.button-close', function () {
73
- closeModal();
74
- return false;
75
- });
76
-
77
- $modal.on('click', '.button-connect', function (evt) {
78
- evt.preventDefault();
79
-
80
- var $button = $(this);
81
-
82
- $.ajax({
83
- url : ajaxurl,
84
- method : 'POST',
85
- data : {
86
- action : '<?php echo $fs->get_ajax_action( 'start_trial' ) ?>',
87
- security : '<?php echo $fs->get_ajax_security( 'start_trial' ) ?>',
88
- module_id: '<?php echo $fs->get_id() ?>',
89
- trial : trialData
90
- },
91
- beforeSend: function () {
92
- // Disable all buttons during trial activation.
93
- $modal.find('.button').prop('disabled', true);
94
-
95
- $button.text(<?php fs_json_encode_echo_inline( 'Starting trial', 'starting-trial', $slug ) ?> + '...');
96
-
97
- setLoadingMode();
98
- },
99
- success : function (resultObj) {
100
- if (resultObj.success) {
101
- $button.text(<?php fs_json_encode_echo_inline( 'Please wait', 'please-wait', $slug ) ?> + '...');
102
-
103
- // Redirect to the "Account" page and sync the license.
104
- window.location.href = resultObj.data.next_page;
105
- } else {
106
- $button.text(<?php fs_json_encode_echo( 'approve-start-trial', $slug ) ?>);
107
-
108
- resetLoadingMode();
109
- showError(resultObj.error);
110
- }
111
- }
112
- });
113
- });
114
- }
115
-
116
- window.openTrialConfirmationModal = function showModal(data) {
117
- resetModal();
118
-
119
- // Display the dialog box.
120
- $modal.addClass('active');
121
-
122
- trialData = data;
123
-
124
- var $modalBody = $modal.find('.fs-modal-body'),
125
- $var;
126
-
127
- for (var key in data) {
128
- if (data.hasOwnProperty(key)) {
129
- $var = $modalBody.find('.var-' + key);
130
-
131
- if ($var.length > 0)
132
- $var.html(data[key]);
133
- }
134
- }
135
-
136
- $('body').addClass('has-fs-modal');
137
- };
138
-
139
- function closeModal() {
140
- $modal.removeClass('active');
141
-
142
- $('body').removeClass('has-fs-modal');
143
- }
144
-
145
- function resetModal() {
146
- hideError();
147
- }
148
-
149
- function hideError() {
150
- $errorNotice.hide();
151
- }
152
-
153
- function setLoadingMode() {
154
- $modal.find('.button')
155
- // Re-enable all buttons.
156
- .prop('disabled', trialData)
157
- // Stop loading cursor.
158
- .css({'cursor': 'wait'});
159
-
160
- // Stop loading cursor.
161
- $(document.body).css({'cursor': 'wait'});
162
- }
163
-
164
- function resetLoadingMode() {
165
- $modal.find('.button')
166
- // Re-enable all buttons.
167
- .prop('disabled', false)
168
- // Stop loading cursor.
169
- .css({'cursor': 'initial'});
170
-
171
- // Stop loading cursor.
172
- $(document.body).css({'cursor': 'initial'});
173
- }
174
-
175
- function showError(msg) {
176
- $errorNotice.find(' > p').html(msg);
177
- $errorNotice.show();
178
- }
179
- });
180
- })(jQuery);
181
- </script>
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.2.0
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * @var array $VARS
15
+ * @var Freemius $fs
16
+ */
17
+ $fs = freemius( $VARS['id'] );
18
+ $slug = $fs->get_slug();
19
+
20
+ $message_header = sprintf(
21
+ /* translators: %1$s: Number of trial days; %2$s: Plan name; */
22
+ fs_text_inline( 'You are 1-click away from starting your %1$s-day free trial of the %2$s plan.', 'start-trial-prompt-header', $slug ),
23
+ '<span class="var-trial_period"></span>',
24
+ '<span class="var-plan_title"></span>'
25
+ );
26
+ $message_content = sprintf(
27
+ /* translators: %s: Link to freemius.com */
28
+ fs_text_inline( 'For compliance with the WordPress.org guidelines, before we start the trial we ask that you opt in with your user and non-sensitive site information, allowing the %s to periodically send data to %s to check for version updates and to validate your trial.', 'start-trial-prompt-message', $slug ),
29
+ $fs->get_module_type(),
30
+ sprintf(
31
+ '<a href="%s" target="_blank" rel="noopener">%s</a>',
32
+ 'https://freemius.com',
33
+ 'freemius.com'
34
+ )
35
+ );
36
+
37
+ $modal_content_html = <<< HTML
38
+ <div class="notice notice-error inline"><p></p></div>
39
+ <h3>{$message_header}</h3>
40
+ <p>{$message_content}</p>
41
+ HTML;
42
+
43
+ fs_enqueue_local_style( 'fs_dialog_boxes', '/admin/dialog-boxes.css' );
44
+ ?>
45
+ <script type="text/javascript">
46
+ (function ($) {
47
+ $(document).ready(function () {
48
+ var modalContentHtml = <?php echo json_encode( $modal_content_html ); ?>,
49
+ modalHtml =
50
+ '<div class="fs-modal fs-modal-license-key-resend">'
51
+ + ' <div class="fs-modal-dialog">'
52
+ + ' <div class="fs-modal-header">'
53
+ + ' <h4><?php echo esc_js( fs_text_x_inline( 'Start free trial', 'call to action', 'start-free-trial', $slug ) ) ?></h4>'
54
+ + ' </div>'
55
+ + ' <div class="fs-modal-body">' + modalContentHtml + '</div>'
56
+ + ' <div class="fs-modal-footer">'
57
+ + ' <button class="button button-secondary button-close">' + <?php fs_json_encode_echo_inline( 'Cancel', 'cancel', $slug ) ?> +'</button>'
58
+ + ' <button class="button button-primary button-connect">' + <?php fs_json_encode_echo_inline( 'Approve & Start Trial', 'approve-start-trial', $slug ) ?> +'</button>'
59
+ + ' </div>'
60
+ + ' </div>'
61
+ + '</div>',
62
+ $modal = $( modalHtml ),
63
+ trialData;
64
+
65
+ $modal.appendTo($('body'));
66
+
67
+ var $errorNotice = $modal.find('.notice-error');
68
+
69
+ registerEventHandlers();
70
+
71
+ function registerEventHandlers() {
72
+ $modal.on('click', '.button-close', function () {
73
+ closeModal();
74
+ return false;
75
+ });
76
+
77
+ $modal.on('click', '.button-connect', function (evt) {
78
+ evt.preventDefault();
79
+
80
+ var $button = $(this);
81
+
82
+ $.ajax({
83
+ url : ajaxurl,
84
+ method : 'POST',
85
+ data : {
86
+ action : '<?php echo $fs->get_ajax_action( 'start_trial' ) ?>',
87
+ security : '<?php echo $fs->get_ajax_security( 'start_trial' ) ?>',
88
+ module_id: '<?php echo $fs->get_id() ?>',
89
+ trial : trialData
90
+ },
91
+ beforeSend: function () {
92
+ // Disable all buttons during trial activation.
93
+ $modal.find('.button').prop('disabled', true);
94
+
95
+ $button.text(<?php fs_json_encode_echo_inline( 'Starting trial', 'starting-trial', $slug ) ?> + '...');
96
+
97
+ setLoadingMode();
98
+ },
99
+ success : function (resultObj) {
100
+ if (resultObj.success) {
101
+ $button.text(<?php fs_json_encode_echo_inline( 'Please wait', 'please-wait', $slug ) ?> + '...');
102
+
103
+ // Redirect to the "Account" page and sync the license.
104
+ window.location.href = resultObj.data.next_page;
105
+ } else {
106
+ $button.text(<?php fs_json_encode_echo( 'approve-start-trial', $slug ) ?>);
107
+
108
+ resetLoadingMode();
109
+ showError(resultObj.error);
110
+ }
111
+ }
112
+ });
113
+ });
114
+ }
115
+
116
+ window.openTrialConfirmationModal = function showModal(data) {
117
+ resetModal();
118
+
119
+ // Display the dialog box.
120
+ $modal.addClass('active');
121
+
122
+ trialData = data;
123
+
124
+ var $modalBody = $modal.find('.fs-modal-body'),
125
+ $var;
126
+
127
+ for (var key in data) {
128
+ if (data.hasOwnProperty(key)) {
129
+ $var = $modalBody.find('.var-' + key);
130
+
131
+ if ($var.length > 0)
132
+ $var.html(data[key]);
133
+ }
134
+ }
135
+
136
+ $('body').addClass('has-fs-modal');
137
+ };
138
+
139
+ function closeModal() {
140
+ $modal.removeClass('active');
141
+
142
+ $('body').removeClass('has-fs-modal');
143
+ }
144
+
145
+ function resetModal() {
146
+ hideError();
147
+ }
148
+
149
+ function hideError() {
150
+ $errorNotice.hide();
151
+ }
152
+
153
+ function setLoadingMode() {
154
+ $modal.find('.button')
155
+ // Re-enable all buttons.
156
+ .prop('disabled', trialData)
157
+ // Stop loading cursor.
158
+ .css({'cursor': 'wait'});
159
+
160
+ // Stop loading cursor.
161
+ $(document.body).css({'cursor': 'wait'});
162
+ }
163
+
164
+ function resetLoadingMode() {
165
+ $modal.find('.button')
166
+ // Re-enable all buttons.
167
+ .prop('disabled', false)
168
+ // Stop loading cursor.
169
+ .css({'cursor': 'initial'});
170
+
171
+ // Stop loading cursor.
172
+ $(document.body).css({'cursor': 'initial'});
173
+ }
174
+
175
+ function showError(msg) {
176
+ $errorNotice.find(' > p').html(msg);
177
+ $errorNotice.show();
178
+ }
179
+ });
180
+ })(jQuery);
181
+ </script>
freemius/templates/partials/index.php CHANGED
@@ -1,2 +1,2 @@
1
- <?php
2
- //Silence is golden
1
+ <?php
2
+ //Silence is golden
freemius/templates/pricing.php CHANGED
@@ -1,209 +1,209 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.0.3
7
- */
8
-
9
- /**
10
- * Note for WordPress.org Theme/Plugin reviewer:
11
- * Freemius is an SDK for plugin and theme developers. Since the core
12
- * of the SDK is relevant both for plugins and themes, for obvious reasons,
13
- * we only develop and maintain one code base.
14
- *
15
- * This code (and page) will not run for wp.org themes (only plugins).
16
- *
17
- * In addition, this page loads an i-frame. We intentionally named it 'frame'
18
- * so it will pass the "Theme Check" that is looking for the string "i" . "frame".
19
- *
20
- * UPDATE:
21
- * After ongoing conversations with the WordPress.org TRT we received
22
- * an official approval for including i-frames in the theme's WP Admin setting's
23
- * page tab (the SDK will never add any i-frames on the sitefront). i-frames
24
- * were never against the guidelines, but we wanted to get the team's blessings
25
- * before we move forward. For the record, I got the final approval from
26
- * Ulrich Pogson (@grapplerulrich), a team lead at the TRT during WordCamp
27
- * Europe 2017 (June 16th, 2017).
28
- *
29
- * If you have any questions or need clarifications, please don't hesitate
30
- * pinging me on slack, my username is @svovaf.
31
- *
32
- * @author Vova Feldman (@svovaf)
33
- * @since 1.2.2
34
- */
35
-
36
- if ( ! defined( 'ABSPATH' ) ) {
37
- exit;
38
- }
39
-
40
- wp_enqueue_script( 'jquery' );
41
- wp_enqueue_script( 'json2' );
42
- fs_enqueue_local_script( 'postmessage', 'nojquery.ba-postmessage.min.js' );
43
- fs_enqueue_local_script( 'fs-postmessage', 'postmessage.js' );
44
- fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
45
-
46
- /**
47
- * @var array $VARS
48
- * @var Freemius $fs
49
- */
50
- $fs = freemius( $VARS['id'] );
51
- $slug = $fs->get_slug();
52
- $timestamp = time();
53
-
54
- $context_params = array(
55
- 'plugin_id' => $fs->get_id(),
56
- 'plugin_public_key' => $fs->get_public_key(),
57
- 'plugin_version' => $fs->get_plugin_version(),
58
- );
59
-
60
- $bundle_id = $fs->get_bundle_id();
61
- if ( ! is_null( $bundle_id ) ) {
62
- $context_params['bundle_id'] = $bundle_id;
63
- }
64
-
65
- // Get site context secure params.
66
- if ( $fs->is_registered() ) {
67
- $context_params = array_merge( $context_params, FS_Security::instance()->get_context_params(
68
- $fs->get_site(),
69
- $timestamp,
70
- 'upgrade'
71
- ) );
72
- } else {
73
- $context_params['home_url'] = home_url();
74
- }
75
-
76
- if ( $fs->is_payments_sandbox() ) // Append plugin secure token for sandbox mode authentication.)
77
- {
78
- $context_params['sandbox'] = FS_Security::instance()->get_secure_token(
79
- $fs->get_plugin(),
80
- $timestamp,
81
- 'checkout'
82
- );
83
- }
84
-
85
- $query_params = array_merge( $context_params, $_GET, array(
86
- 'next' => $fs->_get_sync_license_url( false, false ),
87
- 'plugin_version' => $fs->get_plugin_version(),
88
- // Billing cycle.
89
- 'billing_cycle' => fs_request_get( 'billing_cycle', WP_FS__PERIOD_ANNUALLY ),
90
- 'is_network_admin' => fs_is_network_admin() ? 'true' : 'false',
91
- 'currency' => $fs->apply_filters( 'default_currency', 'usd' ),
92
- ) );
93
-
94
- $use_external_pricing = $fs->should_use_external_pricing();
95
-
96
- if ( ! $use_external_pricing ) {
97
- $pricing_js_url = fs_asset_url( $fs->get_pricing_js_path() );
98
- wp_enqueue_script( 'freemius-pricing', $pricing_js_url );
99
- } else {
100
- if ( ! $fs->is_registered() ) {
101
- $template_data = array(
102
- 'id' => $fs->get_id(),
103
- );
104
- fs_require_template( 'forms/trial-start.php', $template_data);
105
- }
106
-
107
- $view_params = array(
108
- 'id' => $VARS['id'],
109
- 'page' => strtolower( $fs->get_text_x_inline( 'Pricing', 'noun', 'pricing' ) ),
110
- );
111
- fs_require_once_template('secure-https-header.php', $view_params);
112
- }
113
-
114
- $has_tabs = $fs->_add_tabs_before_content();
115
-
116
- if ( $has_tabs ) {
117
- $query_params['tabs'] = 'true';
118
- }
119
- ?>
120
- <div id="fs_pricing" class="wrap fs-section fs-full-size-wrapper">
121
- <?php if ( ! $use_external_pricing ) : ?>
122
- <div id="fs_pricing_wrapper" data-public-url="<?php echo trailingslashit( dirname( $pricing_js_url ) ) ?>"></div>
123
- <?php
124
- $pricing_config = array_merge( array(
125
- 'contact_url' => $fs->contact_url(),
126
- 'is_network_admin' => fs_is_network_admin(),
127
- 'is_production' => ( defined( 'WP_FS__IS_PRODUCTION_MODE' ) ? WP_FS__IS_PRODUCTION_MODE : null ),
128
- 'menu_slug' => $fs->get_menu_slug(),
129
- 'mode' => 'dashboard',
130
- 'fs_wp_endpoint_url' => WP_FS__ADDRESS,
131
- 'request_handler_url' => admin_url(
132
- 'admin-ajax.php?' . http_build_query( array(
133
- 'module_id' => $fs->get_id(),
134
- 'action' => $fs->get_ajax_action( 'pricing_ajax_action' ),
135
- 'security' => $fs->get_ajax_security( 'pricing_ajax_action' )
136
- ) )
137
- ),
138
- 'selector' => '#fs_pricing_wrapper',
139
- 'unique_affix' => $fs->get_unique_affix(),
140
- ), $query_params );
141
-
142
- wp_add_inline_script( 'freemius-pricing', 'Freemius.pricing.new( ' . json_encode( $pricing_config ) . ' )' );
143
- ?>
144
- <?php else : ?>
145
- <div id="fs_frame"></div>
146
- <form action="" method="POST">
147
- <input type="hidden" name="user_id"/>
148
- <input type="hidden" name="user_email"/>
149
- <input type="hidden" name="site_id"/>
150
- <input type="hidden" name="public_key"/>
151
- <input type="hidden" name="secret_key"/>
152
- <input type="hidden" name="action" value="account"/>
153
- </form>
154
-
155
- <script type="text/javascript">
156
- (function ($, undef) {
157
- $(function () {
158
- var
159
- // Keep track of the i-frame height.
160
- frame_height = 800,
161
- base_url = '<?php echo WP_FS__ADDRESS ?>',
162
- // Pass the parent page URL into the i-frame in a meaningful way (this URL could be
163
- // passed via query string or hard coded into the child page, it depends on your needs).
164
- src = base_url + '/pricing/?<?php echo http_build_query( $query_params ) ?>#' + encodeURIComponent(document.location.href),
165
-
166
- // Append the I-frame into the DOM.
167
- frame = $('<i' + 'frame " src="' + src + '" width="100%" height="' + frame_height + 'px" scrolling="no" frameborder="0" style="background: transparent; width: 1px; min-width: 100%;"><\/i' + 'frame>')
168
- .appendTo('#fs_frame');
169
-
170
- FS.PostMessage.init(base_url, [frame[0]]);
171
-
172
- FS.PostMessage.receive('height', function (data) {
173
- var h = data.height;
174
- if (!isNaN(h) && h > 0 && h != frame_height) {
175
- frame_height = h;
176
- frame.height(frame_height + 'px');
177
-
178
- FS.PostMessage.postScroll(frame[0]);
179
- }
180
- });
181
-
182
- FS.PostMessage.receive('get_dimensions', function (data) {
183
- FS.PostMessage.post('dimensions', {
184
- height : $(document.body).height(),
185
- scrollTop: $(document).scrollTop()
186
- }, frame[0]);
187
- });
188
-
189
- FS.PostMessage.receive('start_trial', function (data) {
190
- openTrialConfirmationModal(data);
191
- });
192
- });
193
- })(jQuery);
194
- </script>
195
- <?php endif ?>
196
- </div>
197
- <?php
198
- if ( $has_tabs ) {
199
- $fs->_add_tabs_after_content();
200
- }
201
-
202
- $params = array(
203
- 'page' => 'pricing',
204
- 'module_id' => $fs->get_id(),
205
- 'module_type' => $fs->get_module_type(),
206
- 'module_slug' => $slug,
207
- 'module_version' => $fs->get_plugin_version(),
208
- );
209
  fs_require_template( 'powered-by.php', $params );
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.0.3
7
+ */
8
+
9
+ /**
10
+ * Note for WordPress.org Theme/Plugin reviewer:
11
+ * Freemius is an SDK for plugin and theme developers. Since the core
12
+ * of the SDK is relevant both for plugins and themes, for obvious reasons,
13
+ * we only develop and maintain one code base.
14
+ *
15
+ * This code (and page) will not run for wp.org themes (only plugins).
16
+ *
17
+ * In addition, this page loads an i-frame. We intentionally named it 'frame'
18
+ * so it will pass the "Theme Check" that is looking for the string "i" . "frame".
19
+ *
20
+ * UPDATE:
21
+ * After ongoing conversations with the WordPress.org TRT we received
22
+ * an official approval for including i-frames in the theme's WP Admin setting's
23
+ * page tab (the SDK will never add any i-frames on the sitefront). i-frames
24
+ * were never against the guidelines, but we wanted to get the team's blessings
25
+ * before we move forward. For the record, I got the final approval from
26
+ * Ulrich Pogson (@grapplerulrich), a team lead at the TRT during WordCamp
27
+ * Europe 2017 (June 16th, 2017).
28
+ *
29
+ * If you have any questions or need clarifications, please don't hesitate
30
+ * pinging me on slack, my username is @svovaf.
31
+ *
32
+ * @author Vova Feldman (@svovaf)
33
+ * @since 1.2.2
34
+ */
35
+
36
+ if ( ! defined( 'ABSPATH' ) ) {
37
+ exit;
38
+ }
39
+
40
+ wp_enqueue_script( 'jquery' );
41
+ wp_enqueue_script( 'json2' );
42
+ fs_enqueue_local_script( 'postmessage', 'nojquery.ba-postmessage.min.js' );
43
+ fs_enqueue_local_script( 'fs-postmessage', 'postmessage.js' );
44
+ fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
45
+
46
+ /**
47
+ * @var array $VARS
48
+ * @var Freemius $fs
49
+ */
50
+ $fs = freemius( $VARS['id'] );
51
+ $slug = $fs->get_slug();
52
+ $timestamp = time();
53
+
54
+ $context_params = array(
55
+ 'plugin_id' => $fs->get_id(),
56
+ 'plugin_public_key' => $fs->get_public_key(),
57
+ 'plugin_version' => $fs->get_plugin_version(),
58
+ );
59
+
60
+ $bundle_id = $fs->get_bundle_id();
61
+ if ( ! is_null( $bundle_id ) ) {
62
+ $context_params['bundle_id'] = $bundle_id;
63
+ }
64
+
65
+ // Get site context secure params.
66
+ if ( $fs->is_registered() ) {
67
+ $context_params = array_merge( $context_params, FS_Security::instance()->get_context_params(
68
+ $fs->get_site(),
69
+ $timestamp,
70
+ 'upgrade'
71
+ ) );
72
+ } else {
73
+ $context_params['home_url'] = home_url();
74
+ }
75
+
76
+ if ( $fs->is_payments_sandbox() ) // Append plugin secure token for sandbox mode authentication.)
77
+ {
78
+ $context_params['sandbox'] = FS_Security::instance()->get_secure_token(
79
+ $fs->get_plugin(),
80
+ $timestamp,
81
+ 'checkout'
82
+ );
83
+ }
84
+
85
+ $query_params = array_merge( $context_params, $_GET, array(
86
+ 'next' => $fs->_get_sync_license_url( false, false ),
87
+ 'plugin_version' => $fs->get_plugin_version(),
88
+ // Billing cycle.
89
+ 'billing_cycle' => fs_request_get( 'billing_cycle', WP_FS__PERIOD_ANNUALLY ),
90
+ 'is_network_admin' => fs_is_network_admin() ? 'true' : 'false',
91
+ 'currency' => $fs->apply_filters( 'default_currency', 'usd' ),
92
+ ) );
93
+
94
+ $use_external_pricing = $fs->should_use_external_pricing();
95
+
96
+ if ( ! $use_external_pricing ) {
97
+ $pricing_js_url = fs_asset_url( $fs->get_pricing_js_path() );
98
+ wp_enqueue_script( 'freemius-pricing', $pricing_js_url );
99
+ } else {
100
+ if ( ! $fs->is_registered() ) {
101
+ $template_data = array(
102
+ 'id' => $fs->get_id(),
103
+ );
104
+ fs_require_template( 'forms/trial-start.php', $template_data);
105
+ }
106
+
107
+ $view_params = array(
108
+ 'id' => $VARS['id'],
109
+ 'page' => strtolower( $fs->get_text_x_inline( 'Pricing', 'noun', 'pricing' ) ),
110
+ );
111
+ fs_require_once_template('secure-https-header.php', $view_params);
112
+ }
113
+
114
+ $has_tabs = $fs->_add_tabs_before_content();
115
+
116
+ if ( $has_tabs ) {
117
+ $query_params['tabs'] = 'true';
118
+ }
119
+ ?>
120
+ <div id="fs_pricing" class="wrap fs-section fs-full-size-wrapper">
121
+ <?php if ( ! $use_external_pricing ) : ?>
122
+ <div id="fs_pricing_wrapper" data-public-url="<?php echo trailingslashit( dirname( $pricing_js_url ) ) ?>"></div>
123
+ <?php
124
+ $pricing_config = array_merge( array(
125
+ 'contact_url' => $fs->contact_url(),
126
+ 'is_network_admin' => fs_is_network_admin(),
127
+ 'is_production' => ( defined( 'WP_FS__IS_PRODUCTION_MODE' ) ? WP_FS__IS_PRODUCTION_MODE : null ),
128
+ 'menu_slug' => $fs->get_menu_slug(),
129
+ 'mode' => 'dashboard',
130
+ 'fs_wp_endpoint_url' => WP_FS__ADDRESS,
131
+ 'request_handler_url' => admin_url(
132
+ 'admin-ajax.php?' . http_build_query( array(
133
+ 'module_id' => $fs->get_id(),
134
+ 'action' => $fs->get_ajax_action( 'pricing_ajax_action' ),
135
+ 'security' => $fs->get_ajax_security( 'pricing_ajax_action' )
136
+ ) )
137
+ ),
138
+ 'selector' => '#fs_pricing_wrapper',
139
+ 'unique_affix' => $fs->get_unique_affix(),
140
+ ), $query_params );
141
+
142
+ wp_add_inline_script( 'freemius-pricing', 'Freemius.pricing.new( ' . json_encode( $pricing_config ) . ' )' );
143
+ ?>
144
+ <?php else : ?>
145
+ <div id="fs_frame"></div>
146
+ <form action="" method="POST">
147
+ <input type="hidden" name="user_id"/>
148
+ <input type="hidden" name="user_email"/>
149
+ <input type="hidden" name="site_id"/>
150
+ <input type="hidden" name="public_key"/>
151
+ <input type="hidden" name="secret_key"/>
152
+ <input type="hidden" name="action" value="account"/>
153
+ </form>
154
+
155
+ <script type="text/javascript">
156
+ (function ($, undef) {
157
+ $(function () {
158
+ var
159
+ // Keep track of the i-frame height.
160
+ frame_height = 800,
161
+ base_url = '<?php echo WP_FS__ADDRESS ?>',
162
+ // Pass the parent page URL into the i-frame in a meaningful way (this URL could be
163
+ // passed via query string or hard coded into the child page, it depends on your needs).
164
+ src = base_url + '/pricing/?<?php echo http_build_query( $query_params ) ?>#' + encodeURIComponent(document.location.href),
165
+
166
+ // Append the I-frame into the DOM.
167
+ frame = $('<i' + 'frame " src="' + src + '" width="100%" height="' + frame_height + 'px" scrolling="no" frameborder="0" style="background: transparent; width: 1px; min-width: 100%;"><\/i' + 'frame>')
168
+ .appendTo('#fs_frame');
169
+
170
+ FS.PostMessage.init(base_url, [frame[0]]);
171
+
172
+ FS.PostMessage.receive('height', function (data) {
173
+ var h = data.height;
174
+ if (!isNaN(h) && h > 0 && h != frame_height) {
175
+ frame_height = h;
176
+ frame.height(frame_height + 'px');
177
+
178
+ FS.PostMessage.postScroll(frame[0]);
179
+ }
180
+ });
181
+
182
+ FS.PostMessage.receive('get_dimensions', function (data) {
183
+ FS.PostMessage.post('dimensions', {
184
+ height : $(document.body).height(),
185
+ scrollTop: $(document).scrollTop()
186
+ }, frame[0]);
187
+ });
188
+
189
+ FS.PostMessage.receive('start_trial', function (data) {
190
+ openTrialConfirmationModal(data);
191
+ });
192
+ });
193
+ })(jQuery);
194
+ </script>
195
+ <?php endif ?>
196
+ </div>
197
+ <?php
198
+ if ( $has_tabs ) {
199
+ $fs->_add_tabs_after_content();
200
+ }
201
+
202
+ $params = array(
203
+ 'page' => 'pricing',
204
+ 'module_id' => $fs->get_id(),
205
+ 'module_type' => $fs->get_module_type(),
206
+ 'module_slug' => $slug,
207
+ 'module_version' => $fs->get_plugin_version(),
208
+ );
209
  fs_require_template( 'powered-by.php', $params );
freemius/templates/secure-https-header.php CHANGED
@@ -1,39 +1,39 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
- * @since 1.2.1.8
7
- *
8
- * @var array $VARS
9
- */
10
-
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- }
14
- ?>
15
- <div class="fs-secure-notice">
16
- <i class="dashicons dashicons-lock"></i>
17
- <span><?php
18
- if ( ! empty( $VARS['message'] ) ) {
19
- echo esc_html( $VARS['message'] );
20
- } else {
21
- /**
22
- * @var Freemius $fs
23
- */
24
- $fs = freemius( $VARS['id'] );
25
-
26
- echo esc_html( sprintf(
27
- /* translators: %s: Page name */
28
- $fs->get_text_inline( 'Secure HTTPS %s page, running from an external domain', 'secure-x-page-header' ),
29
- $VARS['page']
30
- ) ) .
31
- ' - ' .
32
- sprintf(
33
- '<a class="fs-security-proof" href="%s" target="_blank" rel="noopener">%s</a>',
34
- 'https://www.mcafeesecure.com/verify?host=' . WP_FS__ROOT_DOMAIN_PRODUCTION,
35
- 'Freemius Inc. [US]'
36
- );
37
- }
38
- ?></span>
39
  </div>
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6
+ * @since 1.2.1.8
7
+ *
8
+ * @var array $VARS
9
+ */
10
+
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ }
14
+ ?>
15
+ <div class="fs-secure-notice">
16
+ <i class="dashicons dashicons-lock"></i>
17
+ <span><?php
18
+ if ( ! empty( $VARS['message'] ) ) {
19
+ echo esc_html( $VARS['message'] );
20
+ } else {
21
+ /**
22
+ * @var Freemius $fs
23
+ */
24
+ $fs = freemius( $VARS['id'] );
25
+
26
+ echo esc_html( sprintf(
27
+ /* translators: %s: Page name */
28
+ $fs->get_text_inline( 'Secure HTTPS %s page, running from an external domain', 'secure-x-page-header' ),
29
+ $VARS['page']
30
+ ) ) .
31
+ ' - ' .
32
+ sprintf(
33
+ '<a class="fs-security-proof" href="%s" target="_blank" rel="noopener">%s</a>',
34
+ 'https://www.mcafeesecure.com/verify?host=' . WP_FS__ROOT_DOMAIN_PRODUCTION,
35
+ 'Freemius Inc. [US]'
36
+ );
37
+ }
38
+ ?></span>
39
  </div>
includes/WPThumb/wpthumb.php CHANGED
@@ -132,9 +132,11 @@ class WP_Thumb {
132
  return;
133
  }
134
 
 
 
135
  // If it's an uploaded file
136
- if ( strpos( $file_path, $upload_dir['baseurl'] ) !== false ) {
137
- $this->file_path = str_replace( $upload_dir['baseurl'], $upload_dir['basedir'], $file_path );
138
  } else {
139
  $this->file_path = str_replace( trailingslashit( home_url() ), self::get_home_path(), $file_path );
140
  }
@@ -321,7 +323,7 @@ class WP_Thumb {
321
  return '';
322
  }
323
 
324
- $original_filename = basename( $this->getFilePath() );
325
 
326
  // TODO use pathinfo
327
  $parts = explode( '.', $original_filename );
@@ -332,22 +334,22 @@ class WP_Thumb {
332
 
333
  $upload_dir = self::uploadDir();
334
 
335
- if ( strpos( $this->getFilePath(), $upload_dir['basedir'] ) === 0 ) :
336
 
337
- $subdir = dirname( str_replace( $upload_dir['basedir'], '', $this->getFilePath() ) );
338
  $new_dir = $upload_dir['basedir'] . '/cache' . trailingslashit( $subdir ) . $filename_nice;
339
 
340
- elseif ( strpos( $this->getFilePath(), WP_CONTENT_DIR ) === 0 ) :
341
 
342
- $subdir = dirname( str_replace( WP_CONTENT_DIR, '', $this->getFilePath() ) );
343
  $new_dir = $upload_dir['basedir'] . '/cache' . trailingslashit( $subdir ) . $filename_nice;
344
 
345
- elseif ( strpos( $this->getFilePath(), self::get_home_path() ) === 0 ) :
346
  $new_dir = $upload_dir['basedir'] . '/cache/local';
347
 
348
  else :
349
 
350
- $parts = parse_url( $this->getFilePath() );
351
 
352
  if ( ! empty( $parts['host'] ) )
353
  $new_dir = $upload_dir['basedir'] . '/cache/remote/' . sanitize_title( $parts['host'] );
@@ -604,7 +606,7 @@ class WP_Thumb {
604
  $upload_dir = self::uploadDir();
605
 
606
  if ( strpos( $path, $upload_dir['basedir'] ) !== false ) {
607
- return str_replace( $upload_dir['basedir'], $upload_dir['baseurl'], $path );
608
 
609
  } else {
610
  return str_replace( self::get_home_path(), trailingslashit( home_url() ), $path );
132
  return;
133
  }
134
 
135
+ $base_url = set_url_scheme( $upload_dir['baseurl'] );
136
+
137
  // If it's an uploaded file
138
+ if ( strpos( $file_path, $base_url ) !== false ) {
139
+ $this->file_path = str_replace( $base_url, $upload_dir['basedir'], $file_path );
140
  } else {
141
  $this->file_path = str_replace( trailingslashit( home_url() ), self::get_home_path(), $file_path );
142
  }
323
  return '';
324
  }
325
 
326
+ $original_filename = basename( $path );
327
 
328
  // TODO use pathinfo
329
  $parts = explode( '.', $original_filename );
334
 
335
  $upload_dir = self::uploadDir();
336
 
337
+ if ( strpos( $path, $upload_dir['basedir'] ) === 0 ) :
338
 
339
+ $subdir = dirname( str_replace( $upload_dir['basedir'], '', $path ) );
340
  $new_dir = $upload_dir['basedir'] . '/cache' . trailingslashit( $subdir ) . $filename_nice;
341
 
342
+ elseif ( strpos( $path, WP_CONTENT_DIR ) === 0 ) :
343
 
344
+ $subdir = dirname( str_replace( WP_CONTENT_DIR, '', $path ) );
345
  $new_dir = $upload_dir['basedir'] . '/cache' . trailingslashit( $subdir ) . $filename_nice;
346
 
347
+ elseif ( strpos( $path, self::get_home_path() ) === 0 ) :
348
  $new_dir = $upload_dir['basedir'] . '/cache/local';
349
 
350
  else :
351
 
352
+ $parts = parse_url( $path );
353
 
354
  if ( ! empty( $parts['host'] ) )
355
  $new_dir = $upload_dir['basedir'] . '/cache/remote/' . sanitize_title( $parts['host'] );
606
  $upload_dir = self::uploadDir();
607
 
608
  if ( strpos( $path, $upload_dir['basedir'] ) !== false ) {
609
+ return str_replace( $upload_dir['basedir'], set_url_scheme( $upload_dir['baseurl'] ), $path );
610
 
611
  } else {
612
  return str_replace( self::get_home_path(), trailingslashit( home_url() ), $path );
includes/admin/class-admin-notices.php CHANGED
@@ -10,9 +10,12 @@ if ( ! class_exists( 'FooGallery_Admin_Notices' ) ) {
10
  public function __construct() {
11
  add_action( 'admin_notices', array( $this, 'display_thumb_test_notice') );
12
  add_action( 'admin_notices', array( $this, 'display_rating_notice') );
13
- add_action( 'foogallery_thumbnail_generation_test', array( $this, 'save_test_results') );
14
 
 
15
  add_action( 'wp_ajax_foogallery_admin_rating_notice_dismiss', array( $this, 'admin_rating_notice_dismiss' ) );
 
 
 
16
  }
17
 
18
  function should_run_tests() {
@@ -160,6 +163,125 @@ if ( ! class_exists( 'FooGallery_Admin_Notices' ) ) {
160
  }
161
  }
162
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  }
164
 
165
  }
10
  public function __construct() {
11
  add_action( 'admin_notices', array( $this, 'display_thumb_test_notice') );
12
  add_action( 'admin_notices', array( $this, 'display_rating_notice') );
 
13
 
14
+ add_action( 'foogallery_thumbnail_generation_test', array( $this, 'save_test_results') );
15
  add_action( 'wp_ajax_foogallery_admin_rating_notice_dismiss', array( $this, 'admin_rating_notice_dismiss' ) );
16
+
17
+ add_action( 'admin_notices', array( $this, 'display_foobar_notice') );
18
+ add_action( 'wp_ajax_foogallery_admin_foobar_notice_dismiss', array( $this, 'admin_foobar_notice_dismiss' ) );
19
  }
20
 
21
  function should_run_tests() {
163
  }
164
  }
165
  }
166
+
167
+ function display_foobar_notice() {
168
+ if ( $this->should_display_foobar_notice() ) {
169
+
170
+ $install_foobar = wp_nonce_url(
171
+ add_query_arg(
172
+ array(
173
+ 'action' => 'install-plugin',
174
+ 'plugin' => 'foobar-notifications-lite'
175
+ ),
176
+ admin_url( 'update.php' )
177
+ ),
178
+ 'install-plugin_foobar-notifications-lite'
179
+ );
180
+ ?>
181
+ <script type="text/javascript">
182
+ (function ($) {
183
+ $(document).ready(function () {
184
+ $('.foogallery-foobar-notice.is-dismissible')
185
+ .on('click', '.notice-dismiss', function (e) {
186
+ e.preventDefault();
187
+ $.post(ajaxurl, {
188
+ action : 'foogallery_admin_foobar_notice_dismiss',
189
+ url : '<?php echo admin_url( 'admin-ajax.php' ); ?>',
190
+ _wpnonce: '<?php echo wp_create_nonce( 'foogallery_admin_foobar_notice_dismiss' ); ?>'
191
+ });
192
+ });
193
+ });
194
+ })(jQuery);
195
+ </script>
196
+ <style>
197
+ .foogallery-foobar-notice {
198
+ border-left-color: #ff4800;
199
+ }
200
+
201
+ .foogallery-foobar-notice .dashicons-megaphone {
202
+ color: #ff4800;
203
+ }
204
+ </style>
205
+ <div class="foogallery-foobar-notice notice notice-success is-dismissible">
206
+ <p>
207
+ <strong><span class="dashicons dashicons-megaphone"></span> Do you want to grow your business?</strong>
208
+ FooBar can help!
209
+ <br />
210
+ FooBar is a free plugin to help grow your business by showing sticky notification bars with call-to-actions. Add unlimited notifications to your site to increase visitor engagement and get your message across!
211
+ <br />
212
+ <br />
213
+ <a class="button button-primary button-large" target="_blank" href="<?php echo $install_foobar; ?>">Install FooBar</a>
214
+ <a class="button" target="_blank" href="https://wordpress.org/plugins/foobar-notifications-lite/">View Details</a>
215
+ </p>
216
+ </div>
217
+ <?php
218
+ }
219
+ }
220
+
221
+ function should_display_foobar_notice() {
222
+ //do not show the notice to people who have foobar installed and activated
223
+ if ( class_exists( 'FooPlugins\FooBar\Init' ) ) {
224
+ return false;
225
+ }
226
+
227
+ //do not show the notice to pro users
228
+ if ( foogallery_is_pro() ) {
229
+ return false;
230
+ }
231
+
232
+ //only show on foogallery pages
233
+ if ( function_exists( 'get_current_screen' ) ) {
234
+ $screen = get_current_screen();
235
+ if ( isset( $screen ) ) {
236
+ if ( $screen->post_type === FOOGALLERY_CPT_GALLERY ||
237
+ $screen->post_type === FOOGALLERY_CPT_ALBUM ||
238
+ $screen->id === FOOGALLERY_ADMIN_MENU_SETTINGS_SLUG ) {
239
+
240
+ //first try to get the saved option
241
+ $show_message = get_option( 'foogallery_admin_foobar_notice_dismiss', 0 );
242
+
243
+ if ( 'hide' === $show_message ) {
244
+ return false; //never show - user has dismissed
245
+ }
246
+
247
+ if ( 'show' === $show_message ) {
248
+ return true; //always show - user has created 5 or more galleries
249
+ }
250
+
251
+ if ( 0 === $show_message ) {
252
+ $oldest_gallery = get_posts( array(
253
+ 'post_type' => FOOGALLERY_CPT_GALLERY,
254
+ 'post_status' => array( 'publish', 'draft' ),
255
+ 'order_by' => 'publish_date',
256
+ 'order' => 'ASC',
257
+ 'numberposts' => 1
258
+ ) );
259
+
260
+ if ( is_array( $oldest_gallery ) ) {
261
+ $oldest_gallery = $oldest_gallery[0];
262
+
263
+ if( strtotime( $oldest_gallery->post_date ) < strtotime('-7 days') ) {
264
+ //The oldest gallery is older than 7 days - so show the admin notice
265
+ update_option( 'foogallery_admin_foobar_notice_dismiss', 'show' );
266
+ return true;
267
+ }
268
+ }
269
+ }
270
+ }
271
+ }
272
+ }
273
+
274
+ return false;
275
+ }
276
+
277
+ /**
278
+ * Dismiss the admin foobar notice forever
279
+ */
280
+ function admin_foobar_notice_dismiss() {
281
+ if ( check_admin_referer( 'foogallery_admin_foobar_notice_dismiss' ) ) {
282
+ update_option( 'foogallery_admin_foobar_notice_dismiss', 'hide', false );
283
+ }
284
+ }
285
  }
286
 
287
  }
includes/admin/class-gallery-metaboxes.php CHANGED
@@ -28,6 +28,11 @@ if ( ! class_exists( 'FooGallery_Admin_Gallery_MetaBoxes' ) ) {
28
 
29
  // Ajax call for clearing thumb cache for the gallery
30
  add_action( 'wp_ajax_foogallery_clear_gallery_thumb_cache', array( $this, 'ajax_clear_gallery_thumb_cache' ) );
 
 
 
 
 
31
  }
32
 
33
  public function add_meta_boxes_to_gallery( $post ) {
@@ -411,5 +416,40 @@ if ( ! class_exists( 'FooGallery_Admin_Gallery_MetaBoxes' ) ) {
411
 
412
  die();
413
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
414
  }
415
  }
28
 
29
  // Ajax call for clearing thumb cache for the gallery
30
  add_action( 'wp_ajax_foogallery_clear_gallery_thumb_cache', array( $this, 'ajax_clear_gallery_thumb_cache' ) );
31
+
32
+ add_filter( 'hidden_meta_boxes', array( $this, 'get_hidden_meta_boxes' ), 10, 3 );
33
+
34
+ add_filter( 'postbox_classes_foogallery_foogallery_items' , array( $this, 'ensure_metabox_not_closed' ) );
35
+ add_filter( 'postbox_classes_foogallery_foogallery_settings' , array( $this, 'ensure_metabox_not_closed' ) );
36
  }
37
 
38
  public function add_meta_boxes_to_gallery( $post ) {
416
 
417
  die();
418
  }
419
+
420
+ /**
421
+ * Returns a list of all hidden metaboxes
422
+ *
423
+ * @param string[] $hidden An array of IDs of hidden meta boxes.
424
+ * @param WP_Screen $screen WP_Screen object of the current screen.
425
+ * @param bool $use_defaults Whether to show the default meta boxes.
426
+ *
427
+ * @return mixed
428
+ */
429
+ function get_hidden_meta_boxes( $hidden, $screen, $use_defaults ) {
430
+ if ( isset( $screen ) && $screen->post_type === FOOGALLERY_CPT_GALLERY ) {
431
+
432
+ $ensure_not_hidden = array(
433
+ 'foogallery_items',
434
+ 'foogallery_settings'
435
+ );
436
+
437
+ foreach ( $ensure_not_hidden as $item ) {
438
+ $key = array_search( $item, $hidden );
439
+ if ( $key !== false ) {
440
+ unset( $hidden[$key] );
441
+ }
442
+ }
443
+ }
444
+
445
+ return $hidden;
446
+ }
447
+
448
+ function ensure_metabox_not_closed( $classes ) {
449
+ if ( is_array( $classes ) && in_array( 'closed', $classes ) ) {
450
+ $classes = array_diff( $classes, array( 'closed' ) );
451
+ }
452
+ return $classes;
453
+ }
454
  }
455
  }
includes/functions.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * FooGallery global functions
4
  *
@@ -8,13 +9,13 @@
8
  * @link https://github.com/fooplugins/foogallery
9
  * @copyright 2014 FooPlugins LLC
10
  */
11
-
12
  /**
13
  * Returns the name of the plugin. (Allows the name to be overridden from extensions or functions.php)
14
  * @return string
15
  */
16
- function foogallery_plugin_name() {
17
- return apply_filters( 'foogallery_plugin_name', 'FooGallery' );
 
18
  }
19
 
20
  /**
@@ -22,8 +23,9 @@ function foogallery_plugin_name() {
22
  *
23
  * @return array
24
  */
25
- function foogallery_gallery_templates() {
26
- return apply_filters( 'foogallery_gallery_templates', array() );
 
27
  }
28
 
29
  /**
@@ -32,14 +34,14 @@ function foogallery_gallery_templates() {
32
  *
33
  * @return bool|array
34
  */
35
- function foogallery_get_gallery_template( $slug ) {
36
- foreach ( foogallery_gallery_templates() as $template ) {
37
- if ( $slug == $template['slug'] ) {
38
- return $template;
39
- }
40
- }
41
-
42
- return false;
43
  }
44
 
45
  /**
@@ -47,8 +49,9 @@ function foogallery_get_gallery_template( $slug ) {
47
  *
48
  * @return FooGallery_Extensions_API
49
  */
50
- function foogallery_extensions_api() {
51
- return new FooGallery_Extensions_API();
 
52
  }
53
 
54
  /**
@@ -56,8 +59,9 @@ function foogallery_extensions_api() {
56
  *
57
  * @return string
58
  */
59
- function foogallery_default_gallery_template() {
60
- return foogallery_get_setting( 'gallery_template' );
 
61
  }
62
 
63
  /**
@@ -65,8 +69,9 @@ function foogallery_default_gallery_template() {
65
  *
66
  * @return bool
67
  */
68
- function foogallery_permalinks_enabled() {
69
- return foogallery_get_setting( 'gallery_permalinks_enabled' );
 
70
  }
71
 
72
  /**
@@ -74,8 +79,9 @@ function foogallery_permalinks_enabled() {
74
  *
75
  * @return string
76
  */
77
- function foogallery_permalink() {
78
- return foogallery_get_setting( 'gallery_permalink' );
 
79
  }
80
 
81
  /**
@@ -87,10 +93,10 @@ function foogallery_permalink() {
87
  *
88
  * @return mixed
89
  */
90
- function foogallery_get_setting( $key, $default = false ) {
91
- $foogallery = FooGallery_Plugin::get_instance();
92
-
93
- return $foogallery->options()->get( $key, foogallery_get_default( $key, $default ) );
94
  }
95
 
96
  /**
@@ -100,8 +106,9 @@ function foogallery_get_setting( $key, $default = false ) {
100
  *
101
  * @return string
102
  */
103
- function foogallery_build_gallery_shortcode( $gallery_id ) {
104
- return '[' . foogallery_gallery_shortcode_tag() . ' id="' . $gallery_id . '"]';
 
105
  }
106
 
107
  /**
@@ -109,8 +116,9 @@ function foogallery_build_gallery_shortcode( $gallery_id ) {
109
  *
110
  * @return string
111
  */
112
- function foogallery_gallery_shortcode_tag() {
113
- return apply_filters( 'foogallery_gallery_shortcode_tag', FOOGALLERY_CPT_GALLERY );
 
114
  }
115
 
116
  /**
@@ -122,24 +130,22 @@ function foogallery_gallery_shortcode_tag() {
122
  *
123
  * @return string Key value on success, false on failure.
124
  */
125
- function foogallery_get_default( $key, $default = false ) {
126
-
127
- $defaults = array(
128
- 'gallery_template' => 'default',
129
- 'gallery_permalinks_enabled' => false,
130
- 'gallery_permalink' => 'gallery',
131
- 'lightbox' => 'none',
132
- 'thumb_jpeg_quality' => '80',
133
- 'thumb_resize_animations' => true,
134
- 'gallery_sorting' => '',
135
- 'datasource' => 'media_library'
136
- );
137
-
138
- // A handy filter to override the defaults
139
- $defaults = apply_filters( 'foogallery_defaults', $defaults );
140
-
141
- // Return the key specified.
142
- return isset($defaults[ $key ]) ? $defaults[ $key ] : $default;
143
  }
144
 
145
  /**
@@ -147,8 +153,9 @@ function foogallery_get_default( $key, $default = false ) {
147
  *
148
  * @return string The Url to the FooGallery Add Gallery page in admin
149
  */
150
- function foogallery_admin_add_gallery_url() {
151
- return admin_url( 'post-new.php?post_type=' . FOOGALLERY_CPT_GALLERY );
 
152
  }
153
 
154
  /**
@@ -156,8 +163,11 @@ function foogallery_admin_add_gallery_url() {
156
  *
157
  * @return string The Url to the FooGallery help page in admin
158
  */
159
- function foogallery_admin_help_url() {
160
- return admin_url( add_query_arg( array( 'page' => FOOGALLERY_ADMIN_MENU_HELP_SLUG ), foogallery_admin_menu_parent_slug() ) );
 
 
 
161
  }
162
 
163
  /**
@@ -165,8 +175,11 @@ function foogallery_admin_help_url() {
165
  *
166
  * @return string The Url to the FooGallery settings page in admin
167
  */
168
- function foogallery_admin_settings_url() {
169
- return admin_url( add_query_arg( array( 'page' => FOOGALLERY_ADMIN_MENU_SETTINGS_SLUG ), foogallery_admin_menu_parent_slug() ) );
 
 
 
170
  }
171
 
172
  /**
@@ -174,8 +187,11 @@ function foogallery_admin_settings_url() {
174
  *
175
  * @return string The Url to the FooGallery extensions page in admin
176
  */
177
- function foogallery_admin_extensions_url() {
178
- return admin_url( add_query_arg( array( 'page' => FOOGALLERY_ADMIN_MENU_EXTENSIONS_SLUG ), foogallery_admin_menu_parent_slug() ) );
 
 
 
179
  }
180
 
181
  /**
@@ -183,8 +199,11 @@ function foogallery_admin_extensions_url() {
183
  *
184
  * @return string The Url to the FooGallery system info page in admin
185
  */
186
- function foogallery_admin_systeminfo_url() {
187
- return admin_url( add_query_arg( array( 'page' => FOOGALLERY_ADMIN_MENU_SYSTEMINFO_SLUG ), foogallery_admin_menu_parent_slug() ) );
 
 
 
188
  }
189
 
190
  /**
@@ -192,8 +211,11 @@ function foogallery_admin_systeminfo_url() {
192
  *
193
  * @return string The Url to the FooGallery pricing page in admin
194
  */
195
- function foogallery_admin_pricing_url() {
196
- return admin_url( add_query_arg( array( 'page' => FOOGALLERY_ADMIN_MENU_PRICING_SLUG ), foogallery_admin_menu_parent_slug() ) );
 
 
 
197
  }
198
 
199
  /**
@@ -201,8 +223,9 @@ function foogallery_admin_pricing_url() {
201
  *
202
  * @return string The Url to the FooGallery free trial page in admin
203
  */
204
- function foogallery_admin_freetrial_url() {
205
- return add_query_arg( 'trial', 'true', foogallery_admin_pricing_url() );
 
206
  }
207
 
208
  /**
@@ -212,36 +235,39 @@ function foogallery_admin_freetrial_url() {
212
  *
213
  * @return bool
214
  */
215
- function foogallery_gallery_template_setting( $key, $default = '' ) {
216
- global $current_foogallery;
217
- global $current_foogallery_arguments;
218
- global $current_foogallery_template;
219
-
220
- $settings_key = "{$current_foogallery_template}_{$key}";
221
-
222
- if ( $current_foogallery_arguments && array_key_exists( $key, $current_foogallery_arguments ) ) {
223
- //try to get the value from the arguments
224
- $value = $current_foogallery_arguments[ $key ];
225
-
226
- } else if ( !empty( $current_foogallery ) && $current_foogallery->settings && array_key_exists( $settings_key, $current_foogallery->settings ) ) {
227
- //then get the value out of the saved gallery settings
228
- $value = $current_foogallery->settings[ $settings_key ];
229
- } else {
230
- //otherwise set it to the default
231
- $value = $default;
232
- }
233
-
234
- $value = apply_filters( 'foogallery_gallery_template_setting-' . $key, $value );
235
-
236
- return $value;
 
 
237
  }
238
 
239
  /**
240
  * Get the admin menu parent slug
241
  * @return string
242
  */
243
- function foogallery_admin_menu_parent_slug() {
244
- return apply_filters( 'foogallery_admin_menu_parent_slug', FOOGALLERY_ADMIN_MENU_PARENT_SLUG );
 
245
  }
246
 
247
  /**
@@ -250,12 +276,13 @@ function foogallery_admin_menu_parent_slug() {
250
  *
251
  * @return string|void
252
  */
253
- function foogallery_build_admin_menu_url( $extra_args = array() ) {
254
- $url = admin_url( foogallery_admin_menu_parent_slug() );
255
- if ( ! empty( $extra_args ) ) {
256
- $url = add_query_arg( $extra_args, $url );
257
- }
258
- return $url;
 
259
  }
260
 
261
  /**
@@ -266,15 +293,21 @@ function foogallery_build_admin_menu_url( $extra_args = array() ) {
266
  * @param string $menu_slug
267
  * @param $function
268
  */
269
- function foogallery_add_submenu_page( $menu_title, $capability, $menu_slug, $function ) {
270
- add_submenu_page(
271
- foogallery_admin_menu_parent_slug(),
272
- $menu_title,
273
- $menu_title,
 
 
 
 
 
 
274
  apply_filters( 'foogallery_admin_menu_capability', $capability ),
275
- $menu_slug,
276
- $function
277
- );
278
  }
279
 
280
  /**
@@ -282,35 +315,29 @@ function foogallery_add_submenu_page( $menu_title, $capability, $menu_slug, $fun
282
  *
283
  * @return FooGallery[] array of FooGallery galleries
284
  */
285
- function foogallery_get_all_galleries( $excludes = false, $extra_args = false ) {
286
- $args = array(
287
- 'post_type' => FOOGALLERY_CPT_GALLERY,
288
- 'post_status' => array( 'publish', 'draft' ),
289
- 'cache_results' => false,
290
- 'nopaging' => true,
291
- );
292
-
293
- if ( is_array( $excludes ) ) {
294
- $args['post__not_in'] = $excludes;
295
- }
296
-
297
- if ( is_array( $extra_args ) ) {
298
- $args = array_merge( $args, $extra_args );
299
- }
300
-
301
- $gallery_posts = get_posts( $args );
302
-
303
- if ( empty( $gallery_posts ) ) {
304
- return array();
305
- }
306
-
307
- $galleries = array();
308
-
309
- foreach ( $gallery_posts as $post ) {
310
- $galleries[] = FooGallery::get( $post );
311
- }
312
-
313
- return $galleries;
314
  }
315
 
316
  /**
@@ -320,25 +347,26 @@ function foogallery_get_all_galleries( $excludes = false, $extra_args = false )
320
  *
321
  * @return array An array of all the foogallery shortcodes found in the content
322
  */
323
- function foogallery_extract_gallery_shortcodes( $content ) {
324
- $shortcodes = array();
325
-
326
- $regex_pattern = foogallery_gallery_shortcode_regex();
327
- if ( preg_match_all( '/' . $regex_pattern . '/s', $content, $matches ) ) {
328
- for ( $i = 0; $i < count( $matches[0] ); ++$i ) {
329
- $shortcode = $matches[0][$i];
330
- $args = $matches[3][$i];
331
- $attribure_string = str_replace( ' ', '&', trim( $args ) );
332
- $attribure_string = str_replace( '"', '', $attribure_string );
333
- $attributes = wp_parse_args( $attribure_string );
334
- if ( array_key_exists( 'id', $attributes ) ) {
335
- $id = intval( $attributes['id'] );
336
- $shortcodes[ $id ] = $shortcode;
337
- }
338
- }
339
- }
340
-
341
- return $shortcodes;
 
342
  }
343
 
344
  /**
@@ -346,38 +374,11 @@ function foogallery_extract_gallery_shortcodes( $content ) {
346
  *
347
  * @return string
348
  */
349
- function foogallery_gallery_shortcode_regex() {
350
- $tag = foogallery_gallery_shortcode_tag();
351
-
352
- return
353
- '\\[' // Opening bracket
354
- . '(\\[?)' // 1: Optional second opening bracket for escaping shortcodes: [[tag]]
355
- . "($tag)" // 2: Shortcode name
356
- . '(?![\\w-])' // Not followed by word character or hyphen
357
- . '(' // 3: Unroll the loop: Inside the opening shortcode tag
358
- . '[^\\]\\/]*' // Not a closing bracket or forward slash
359
- . '(?:'
360
- . '\\/(?!\\])' // A forward slash not followed by a closing bracket
361
- . '[^\\]\\/]*' // Not a closing bracket or forward slash
362
- . ')*?'
363
- . ')'
364
- . '(?:'
365
- . '(\\/)' // 4: Self closing tag ...
366
- . '\\]' // ... and closing bracket
367
- . '|'
368
- . '\\]' // Closing bracket
369
- . '(?:'
370
- . '(' // 5: Unroll the loop: Optionally, anything between the opening and closing shortcode tags
371
- . '[^\\[]*+' // Not an opening bracket
372
- . '(?:'
373
- . '\\[(?!\\/\\2\\])' // An opening bracket not followed by the closing shortcode tag
374
- . '[^\\[]*+' // Not an opening bracket
375
- . ')*+'
376
- . ')'
377
- . '\\[\\/\\2\\]' // Closing shortcode tag
378
- . ')?'
379
- . ')'
380
- . '(\\]?)'; // 6: Optional second closing bracket for escaping shortcodes: [[tag]]
381
  }
382
 
383
  /**
@@ -386,38 +387,35 @@ function foogallery_gallery_shortcode_regex() {
386
  *
387
  * @return string the classname based on the gallery and any extra attributes
388
  */
389
- function foogallery_build_class_attribute( $gallery ) {
390
-
391
- $classes[] = 'foogallery';
392
- $classes[] = 'foogallery-container';
393
- $classes[] = "foogallery-{$gallery->gallery_template}";
394
-
395
- $num_args = func_num_args();
396
-
397
- if ( $num_args > 1 ) {
398
- $arg_list = func_get_args();
399
- for ( $i = 1; $i < $num_args; $i++ ) {
400
- $classes[] = $arg_list[$i];
401
- }
402
- }
403
-
404
- $classes = apply_filters( 'foogallery_build_class_attribute', $classes, $gallery );
405
-
406
- //extract any classes from the gallery arguments
407
- global $current_foogallery_arguments;
408
- if ( isset( $current_foogallery_arguments ) && is_array( $current_foogallery_arguments ) ) {
409
- if ( array_key_exists( 'classname', $current_foogallery_arguments ) ) {
410
- $classes[] = $current_foogallery_arguments['classname'];
411
- }
412
-
413
- if ( array_key_exists( 'classes', $current_foogallery_arguments ) ) {
414
- $classes[] = $current_foogallery_arguments['classes'];
415
- }
416
- }
417
-
418
- $classes = array_filter( $classes, 'strlen' );
419
-
420
- return implode( ' ', $classes );
421
  }
422
 
423
  /**
@@ -426,10 +424,11 @@ function foogallery_build_class_attribute( $gallery ) {
426
  *
427
  * @return string the classname based on the gallery and any extra attributes
428
  */
429
- function foogallery_build_class_attribute_safe( $gallery ) {
430
- $args = func_get_args();
431
- $result = call_user_func_array("foogallery_build_class_attribute", $args);
432
- return esc_attr( $result );
 
433
  }
434
 
435
  /**
@@ -437,10 +436,11 @@ function foogallery_build_class_attribute_safe( $gallery ) {
437
  *
438
  * @param $gallery FooGallery
439
  */
440
- function foogallery_build_class_attribute_render_safe( $gallery ) {
441
- $args = func_get_args();
442
- $result = call_user_func_array("foogallery_build_class_attribute_safe", $args);
443
- echo $result;
 
444
  }
445
 
446
  /**
@@ -451,28 +451,28 @@ function foogallery_build_class_attribute_render_safe( $gallery ) {
451
  *
452
  * @return string
453
  */
454
- function foogallery_build_container_attributes_safe( $gallery, $attributes ) {
455
-
456
- //add the default gallery id
457
- $attributes['id'] = 'foogallery-gallery-' . $gallery->ID;
458
-
459
- //add the standard data-foogallery attribute so that the JS initializes correctly
460
  $attributes['data-foogallery'] = foogallery_build_container_data_options( $gallery, $attributes );
461
-
462
- //allow others to add their own attributes globally
463
- $attributes = apply_filters( 'foogallery_build_container_attributes', $attributes, $gallery );
464
-
465
- //allow others to add their own attributes for a specific gallery template
466
- $attributes = apply_filters( 'foogallery_build_container_attributes-' . $gallery->gallery_template, $attributes, $gallery );
467
-
468
- //clean up the attributes to make them safe for output
469
- $html = '';
470
- foreach( $attributes as $key=>$value) {
471
- $safe_value = esc_attr( $value );
472
- $html .= "{$key}=\"{$safe_value}\" ";
473
- }
474
-
475
- return apply_filters( 'foogallery_build_container_attributes_html', $html, $attributes, $gallery );
 
476
  }
477
 
478
  /**
@@ -483,16 +483,27 @@ function foogallery_build_container_attributes_safe( $gallery, $attributes ) {
483
  *
484
  * @return string
485
  */
486
- function foogallery_build_container_data_options( $gallery, $attributes ) {
487
- $options = apply_filters( 'foogallery_build_container_data_options', array(), $gallery, $attributes );
488
-
489
- $options = apply_filters( 'foogallery_build_container_data_options-'. $gallery->gallery_template, $options, $gallery, $attributes );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
490
 
491
- if ( defined( 'JSON_UNESCAPED_UNICODE' ) ) {
492
- return json_encode( $options, JSON_UNESCAPED_UNICODE );
493
- } else {
494
- return json_encode( $options );
495
- }
496
  }
497
 
498
  /**
@@ -501,69 +512,67 @@ function foogallery_build_container_data_options( $gallery, $attributes ) {
501
  * @param $gallery_id int The id of the foogallery you want to render
502
  * @param array $args
503
  */
504
- function foogallery_render_gallery( $gallery_id, $args = array()) {
505
- //create new instance of template engine
506
- $engine = new FooGallery_Template_Loader();
507
-
508
- $shortcode_args = wp_parse_args( $args, array(
509
- 'id' => $gallery_id
510
- ) );
511
-
512
- $engine->render_template( $shortcode_args );
513
  }
514
 
515
  /**
516
  * Returns the available sorting options that can be chosen for galleries and albums
517
  */
518
- function foogallery_sorting_options() {
519
- return apply_filters( 'foogallery_sorting_options', array(
520
- '' => __('Default', 'foogallery'),
521
- 'date_desc' => __('Date created - newest first', 'foogallery'),
522
- 'date_asc' => __('Date created - oldest first', 'foogallery'),
523
- 'modified_desc' => __('Date modified - most recent first', 'foogallery'),
524
- 'modified_asc' => __('Date modified - most recent last', 'foogallery'),
525
- 'title_asc' => __('Title - alphabetically', 'foogallery'),
526
- 'title_desc' => __('Title - reverse', 'foogallery'),
527
- 'rand' => __('Random', 'foogallery')
528
- ) );
529
- }
530
-
531
- function foogallery_sorting_get_posts_orderby_arg( $sorting_option ) {
532
- $orderby_arg = 'post__in';
533
-
534
- switch ( $sorting_option ) {
535
- case 'date_desc':
536
- case 'date_asc':
537
- $orderby_arg = 'date';
538
- break;
539
- case 'modified_desc':
540
- case 'modified_asc':
541
- $orderby_arg = 'modified';
542
- break;
543
- case 'title_asc':
544
- case 'title_desc':
545
- $orderby_arg = 'title';
546
- break;
547
- case 'rand':
548
- $orderby_arg = 'rand';
549
- break;
550
- }
551
-
552
- return apply_filters( 'foogallery_sorting_get_posts_orderby_arg', $orderby_arg, $sorting_option );
553
- }
554
-
555
- function foogallery_sorting_get_posts_order_arg( $sorting_option ) {
556
- $order_arg = 'DESC';
557
-
558
- switch ( $sorting_option ) {
559
- case 'date_asc':
560
- case 'modified_asc':
561
- case 'title_asc':
562
- $order_arg = 'ASC';
563
- break;
564
- }
565
-
566
- return apply_filters( 'foogallery_sorting_get_posts_order_arg', $order_arg, $sorting_option );
567
  }
568
 
569
  /**
@@ -571,7 +580,8 @@ function foogallery_sorting_get_posts_order_arg( $sorting_option ) {
571
  *
572
  * Activate the default templates extension when there are no gallery templates loaded
573
  */
574
- function foogallery_activate_default_templates_extension() {
 
575
  //no longer needed but left in case any 3rd party extensions call this function
576
  _deprecated_function( __FUNCTION__, '1.4.7' );
577
  }
@@ -585,14 +595,32 @@ function foogallery_activate_default_templates_extension() {
585
  * @param bool $ver
586
  * @param string $media
587
  */
588
- function foogallery_enqueue_style( $handle, $src, $deps = array(), $ver = false, $media = 'all' ) {
589
- $src = apply_filters( 'foogallery_enqueue_style_src', $src, $handle );
590
-
591
- wp_enqueue_style( $handle, $src, $deps, $ver, $media );
592
- do_action( 'foogallery_enqueue_style', $handle, $src, $deps, $ver, $media );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
593
  }
594
 
595
-
596
  /**
597
  * Returns all foogallery post objects that are attached to the post
598
  *
@@ -600,34 +628,35 @@ function foogallery_enqueue_style( $handle, $src, $deps = array(), $ver = false,
600
  *
601
  * @return array List of foogallery posts.
602
  */
603
- function foogallery_get_galleries_attached_to_post( $post_id ) {
604
- $gallery_ids = get_post_meta( $post_id, FOOGALLERY_META_POST_USAGE, false );
605
-
606
- if ( !empty( $gallery_ids ) ) {
607
- return get_posts( array(
608
- 'post_type' => array( FOOGALLERY_CPT_GALLERY, ),
609
- 'post_status' => array( 'draft', 'publish' ),
610
- 'posts_per_page' => -1,
611
- 'include' => $gallery_ids
612
- ) );
613
- }
614
-
615
- return array();
616
  }
617
 
618
  /**
619
  * Clears all css load optimization post meta
620
  */
621
- function foogallery_clear_all_css_load_optimizations() {
622
- delete_post_meta_by_key( FOOGALLERY_META_POST_USAGE_CSS );
 
623
  }
624
 
625
  /**
626
  * Performs a check to see if the plugin has been updated, and perform any housekeeping if necessary
627
  */
628
- function foogallery_perform_version_check() {
629
- $checker = new FooGallery_Version_Check();
630
- $checker->perform_check();
 
631
  }
632
 
633
  /**
@@ -635,15 +664,14 @@ function foogallery_perform_version_check() {
635
  *
636
  * @return int The quality value stored in settings
637
  */
638
- function foogallery_thumbnail_jpeg_quality() {
639
- $quality = intval( foogallery_get_setting( 'thumb_jpeg_quality' ) );
640
-
641
- //check if we get an invalid value for whatever reason and if so return a default of 80
642
- if ( $quality <= 0 ) {
643
- $quality = 80;
644
- }
645
-
646
- return $quality;
647
  }
648
 
649
  /**
@@ -651,14 +679,13 @@ function foogallery_thumbnail_jpeg_quality() {
651
  *
652
  * @return string
653
  */
654
- function foogallery_caption_title_source() {
655
- $source = foogallery_get_setting( 'caption_title_source', 'caption' );
656
-
657
- if ( empty( $source ) ) {
658
- $source = 'caption';
659
- }
660
-
661
- return $source;
662
  }
663
 
664
  /**
@@ -669,29 +696,30 @@ function foogallery_caption_title_source() {
669
  *
670
  * @return string
671
  */
672
- function foogallery_get_caption_title_for_attachment($attachment_post, $source = false) {
673
- if ( false === $source ) {
674
- $source = foogallery_gallery_template_setting( 'caption_title_source', false );
675
- if ( empty( $source ) || "none" === $source ) {
676
- $source = foogallery_caption_title_source();
677
- }
678
- }
679
-
680
- switch ( $source ) {
681
- case 'title':
682
- $caption = trim( $attachment_post->post_title );
683
- break;
684
- case 'desc':
685
- $caption = trim( $attachment_post->post_content );
686
- break;
687
- case 'alt':
688
- $caption = trim( get_post_meta( $attachment_post->ID, '_wp_attachment_image_alt', true ) );
689
- break;
690
- default:
691
- $caption = trim( $attachment_post->post_excerpt );
692
- }
693
-
694
- return apply_filters( 'foogallery_get_caption_title_for_attachment', $caption, $attachment_post );
 
695
  }
696
 
697
  /**
@@ -703,34 +731,44 @@ function foogallery_get_caption_title_for_attachment($attachment_post, $source =
703
  *
704
  * @return string
705
  */
706
- function foogallery_get_caption_by_source($attachment, $source, $caption_type) {
707
- if ( false === $source ) {
708
- $source = foogallery_gallery_template_setting( 'caption_' . $caption_type . '_source', false );
709
- if ( empty( $source ) || "none" === $source ) {
710
- if ( 'title' === $caption_type ) {
711
- $source = 'caption'; //bad legacy naming!
712
- } else {
713
- $source = $caption_type;
714
- }
715
- }
716
- }
717
-
718
- switch ( $source ) {
719
- case 'title':
720
- $caption = trim( $attachment->title );
721
- break;
722
- case 'desc':
723
- $caption = trim( $attachment->description );
724
- break;
725
- case 'alt':
726
- $caption = trim( $attachment->alt );
727
- break;
728
- case 'caption' :
729
- default:
730
- $caption = trim( $attachment->caption );
731
- }
732
-
733
- return apply_filters( 'foogallery_get_caption_by_source', $caption, $attachment, $source, $caption_type );
 
 
 
 
 
 
 
 
 
 
734
  }
735
 
736
  /**
@@ -738,14 +776,13 @@ function foogallery_get_caption_by_source($attachment, $source, $caption_type) {
738
  *
739
  * @return string
740
  */
741
- function foogallery_caption_desc_source() {
742
- $source = foogallery_get_setting( 'caption_desc_source', 'desc' );
743
-
744
- if ( empty( $source ) ) {
745
- $source = 'desc';
746
- }
747
-
748
- return $source;
749
  }
750
 
751
  /**
@@ -756,49 +793,52 @@ function foogallery_caption_desc_source() {
756
  *
757
  * @return string
758
  */
759
- function foogallery_get_caption_desc_for_attachment($attachment_post, $source = false) {
760
- if ( false === $source ) {
761
- $source = foogallery_gallery_template_setting( 'caption_desc_source', false );
762
- if ( empty( $source ) || "none" === $source ) {
763
- $source = foogallery_caption_desc_source();
764
- }
765
- }
766
-
767
- switch ( $source ) {
768
- case 'title':
769
- $caption = trim( $attachment_post->post_title );
770
- break;
771
- case 'caption':
772
- $caption = trim( $attachment_post->post_excerpt );
773
- break;
774
- case 'alt':
775
- $caption = trim( get_post_meta( $attachment_post->ID, '_wp_attachment_image_alt', true ) );
776
- break;
777
- default:
778
- $caption = trim( $attachment_post->post_content );
779
- }
780
-
781
- return apply_filters( 'foogallery_get_caption_desc_for_attachment', $caption, $attachment_post );
 
782
  }
783
 
784
  /**
785
  * Runs thumbnail tests and outputs results in a table format
786
  */
787
- function foogallery_output_thumbnail_generation_results() {
788
- $thumbs = new FooGallery_Thumbnails();
789
- try {
790
- $results = $thumbs->run_thumbnail_generation_tests();
 
 
791
  if ( $results['success'] ) {
792
- echo '<span style="color:#0c0">' . __('Thumbnail generation test ran successfully.', 'foogallery') . '</span>';
793
  } else {
794
- echo '<span style="color:#c00">' . __('Thumbnail generation test failed!', 'foogallery') . '</span>';
795
  var_dump( $results['error'] );
796
- var_dump( $results['file_info'] );
797
  }
798
- }
799
- catch (Exception $e) {
800
- echo 'Exception: ' . $e->getMessage();
801
- }
802
  }
803
 
804
  /**
@@ -806,7 +846,8 @@ function foogallery_output_thumbnail_generation_results() {
806
  *
807
  * @return string
808
  */
809
- function foogallery_test_thumb_url() {
 
810
  return apply_filters( 'foogallery_test_thumb_url', FOOGALLERY_URL . 'assets/logo.png' );
811
  }
812
 
@@ -815,17 +856,16 @@ function foogallery_test_thumb_url() {
815
  *
816
  * @return array
817
  */
818
- function foogallery_gallery_datasources() {
819
- $default_datasource = foogallery_default_datasource();
820
-
821
- $datasources[$default_datasource] = array(
822
- 'id' => $default_datasource,
823
- 'name' => __( 'Media Library', 'foogalery' ),
824
  'label' => __( 'From Media Library', 'foogallery' ),
825
- 'public' => false
826
  );
827
-
828
- return apply_filters( 'foogallery_gallery_datasources', $datasources );
829
  }
830
 
831
  /**
@@ -833,16 +873,18 @@ function foogallery_gallery_datasources() {
833
  *
834
  * @return string
835
  */
836
- function foogallery_default_datasource() {
837
- return foogallery_get_default( 'datasource', 'media_library' );
 
838
  }
839
 
840
  /**
841
  * Returns the src to the built-in image placeholder
842
  * @return string
843
  */
844
- function foogallery_image_placeholder_src() {
845
- return apply_filters( 'foogallery_image_placeholder_src', FOOGALLERY_URL . 'assets/image-placeholder.png' );
 
846
  }
847
 
848
  /**
@@ -852,22 +894,22 @@ function foogallery_image_placeholder_src() {
852
  *
853
  * @return string
854
  */
855
- function foogallery_image_placeholder_html( $args ) {
856
- if ( !isset( $args ) ) {
857
- $args = array(
858
- 'width' => 150,
859
- 'height' => 150
860
- );
861
- }
862
-
863
- $args['src'] = foogallery_image_placeholder_src();
864
- $args = array_map( 'esc_attr', $args );
865
- $html = '<img ';
866
- foreach ( $args as $name => $value ) {
867
- $html .= " $name=" . '"' . $value . '"';
868
- }
869
- $html .= ' />';
870
- return apply_filters( 'foogallery_image_placeholder_html', $html, $args );
871
  }
872
 
873
  /**
@@ -879,23 +921,26 @@ function foogallery_image_placeholder_html( $args ) {
879
  *
880
  * @return string
881
  */
882
- function foogallery_find_featured_attachment_thumbnail_html( $gallery, $args = null ){
883
- if ( !isset( $gallery ) || false === $gallery ) return '';
884
-
885
- if ( !isset( $args ) ) {
886
- $args = array(
887
- 'width' => 150,
888
- 'height' => 150
889
- );
890
- }
 
 
 
 
 
 
 
 
 
 
891
 
892
- $featuredAttachment = $gallery->featured_attachment();
893
- if ( $featuredAttachment ) {
894
- return $featuredAttachment->html_img( $args );
895
- } else {
896
- //if we have no featured attachment, then use the built-in image placeholder
897
- return foogallery_image_placeholder_html( $args );
898
- }
899
  }
900
 
901
  /**
@@ -907,75 +952,81 @@ function foogallery_find_featured_attachment_thumbnail_html( $gallery, $args = n
907
  *
908
  * @return string
909
  */
910
- function foogallery_find_featured_attachment_thumbnail_src( $gallery, $args = null ){
911
- if ( !isset( $gallery ) || false === $gallery ) return '';
912
-
913
- if ( !isset( $args ) ) {
914
- $args = array(
915
- 'width' => 150,
916
- 'height' => 150
917
- );
918
- }
 
 
 
 
 
 
 
 
 
 
919
 
920
- $featuredAttachment = $gallery->featured_attachment();
921
- if ( $featuredAttachment ) {
922
- return $featuredAttachment->html_img_src( $args );
923
- } else {
924
- //if we have no featured attachment, then use the built-in image placeholder
925
- return foogallery_image_placeholder_src();
926
- }
927
  }
928
 
929
  /**
930
  * Returns the available retina options that can be chosen
931
  */
932
- function foogallery_retina_options() {
 
933
  return apply_filters( 'foogallery_retina_options', array(
934
- '2x' => __('2x', 'foogallery'),
935
- '3x' => __('3x', 'foogallery'),
936
- '4x' => __('4x', 'foogallery')
937
  ) );
938
  }
939
 
940
  /**
941
  * Does a full uninstall of the plugin including all data and settings!
942
  */
943
- function foogallery_uninstall() {
944
-
945
- if ( !current_user_can( 'install_plugins' ) ) exit;
946
-
947
- //delete all gallery posts first
948
- global $wpdb;
949
- $query = "SELECT p.ID FROM {$wpdb->posts} AS p WHERE p.post_type IN (%s)";
950
- $gallery_post_ids = $wpdb->get_col( $wpdb->prepare( $query, FOOGALLERY_CPT_GALLERY ) );
951
-
952
- if ( !empty( $gallery_post_ids ) ) {
953
- $deleted = 0;
954
- foreach ( $gallery_post_ids as $post_id ) {
955
- $del = wp_delete_post( $post_id );
956
- if ( false !== $del ) {
957
- ++$deleted;
958
- }
959
- }
960
- }
961
-
962
- //delete all options
963
- if ( is_network_admin() ) {
964
- delete_site_option( FOOGALLERY_SLUG );
965
- } else {
966
- delete_option( FOOGALLERY_SLUG );
967
- }
968
- delete_option( FOOGALLERY_OPTION_VERSION );
969
- delete_option( FOOGALLERY_OPTION_THUMB_TEST );
970
- delete_option( FOOGALLERY_EXTENSIONS_SLUGS_OPTIONS_KEY );
971
- delete_option( FOOGALLERY_EXTENSIONS_LOADING_ERRORS );
972
- delete_option( FOOGALLERY_EXTENSIONS_LOADING_ERRORS_RESPONSE );
973
- delete_option( FOOGALLERY_EXTENSIONS_SLUGS_OPTIONS_KEY );
974
- delete_option( FOOGALLERY_EXTENSIONS_ACTIVATED_OPTIONS_KEY );
975
- delete_option( FOOGALLERY_EXTENSIONS_ERRORS_OPTIONS_KEY );
976
-
977
- //let any extensions clean up after themselves
978
- do_action( 'foogallery_uninstall' );
 
 
979
  }
980
 
981
  /**
@@ -985,17 +1036,18 @@ function foogallery_uninstall() {
985
  *
986
  * @return string
987
  */
988
- function foogallery_get_attachment_field_friendly_name( $field ) {
989
- switch ( $field ) {
990
- case 'title':
991
- return __( 'Attachment Title', 'foogallery' );
992
- case 'caption':
993
- return __( 'Attachment Caption', 'foogallery' );
994
- case 'desc':
995
- return __( 'Attachment Description', 'foogallery' );
996
- case 'alt':
997
- return __( 'Attachment Alt', 'foogallery' );
998
- }
 
999
  }
1000
 
1001
  /**
@@ -1004,27 +1056,22 @@ function foogallery_get_attachment_field_friendly_name( $field ) {
1004
  * @param $template mixed
1005
  * @return mixed
1006
  */
1007
- function foogallery_get_fields_for_template( $template ) {
1008
-
1009
  if ( is_string( $template ) ) {
1010
  $template = foogallery_get_gallery_template( $template );
1011
  }
1012
-
1013
  $fields = $template['fields'];
1014
-
1015
  // Allow for extensions to override fields for every gallery template.
1016
  // Also passes the $template along so you can inspect and conditionally alter fields based on the template properties
1017
  $fields = apply_filters( 'foogallery_override_gallery_template_fields', $fields, $template );
1018
-
1019
  // Allow for extensions to override fields for a specific gallery template.
1020
  // Also passes the $template along so you can inspect and conditionally alter fields based on the template properties
1021
  $fields = apply_filters( "foogallery_override_gallery_template_fields-{$template['slug']}", $fields, $template );
1022
-
1023
  foreach ( $fields as &$field ) {
1024
  //allow for the field to be altered by extensions. Also used by the build-in fields, e.g. lightbox
1025
  $field = apply_filters( 'foogallery_alter_gallery_template_field', $field, $template['slug'] );
1026
  }
1027
-
1028
  return $fields;
1029
  }
1030
 
@@ -1034,18 +1081,17 @@ function foogallery_get_fields_for_template( $template ) {
1034
  * @param $template_name
1035
  * @return array
1036
  */
1037
- function foogallery_build_default_settings_for_gallery_template( $template_name ) {
 
1038
  $fields = foogallery_get_fields_for_template( $template_name );
1039
  $settings = array();
1040
-
1041
  //loop through the fields and build up an array of keys and default values
1042
- foreach( $fields as $field ) {
1043
- $default = array_key_exists( 'default', $field ) ? $field['default'] : false;
1044
- if ( !empty( $default ) ) {
1045
  $settings["{$template_name}_{$field['id']}"] = $default;
1046
  }
1047
  }
1048
-
1049
  return $settings;
1050
  }
1051
 
@@ -1053,7 +1099,8 @@ function foogallery_build_default_settings_for_gallery_template( $template_name
1053
  * Returns the choices used for the thumb link field type
1054
  * @return array
1055
  */
1056
- function foogallery_gallery_template_field_thumb_link_choices() {
 
1057
  return apply_filters( 'foogallery_gallery_template_field_thumb_links', array(
1058
  'image' => __( 'Full Size Image', 'foogallery' ),
1059
  'page' => __( 'Image Attachment Page', 'foogallery' ),
@@ -1066,47 +1113,49 @@ function foogallery_gallery_template_field_thumb_link_choices() {
1066
  * Returns the choices used for the lightbox field type
1067
  * @return array
1068
  */
1069
- function foogallery_gallery_template_field_lightbox_choices() {
 
1070
  $lightboxes = apply_filters( 'foogallery_gallery_template_field_lightboxes', array() );
1071
  $lightboxes['none'] = __( 'None', 'foogallery' );
1072
  return $lightboxes;
1073
  }
1074
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1075
 
1076
- if ( !function_exists('wp_get_raw_referer') ) {
1077
- /**
1078
- * Retrieves unvalidated referer from '_wp_http_referer' or HTTP referer.
1079
- *
1080
- * Do not use for redirects, use {@see wp_get_referer()} instead.
1081
- *
1082
- * @since 1.4.9
1083
- * @return string|false Referer URL on success, false on failure.
1084
- */
1085
- function wp_get_raw_referer() {
1086
- if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {
1087
- return wp_unslash( $_REQUEST['_wp_http_referer'] );
1088
- } else if ( ! empty( $_SERVER['HTTP_REFERER'] ) ) {
1089
- return wp_unslash( $_SERVER['HTTP_REFERER'] );
1090
- }
1091
-
1092
- return false;
1093
- }
1094
  }
1095
-
1096
  /**
1097
  * Return the attachments for the currently displayed gallery
1098
  *
1099
  * @return array
1100
  */
1101
- function foogallery_current_gallery_attachments_for_rendering() {
1102
- global $current_foogallery;
1103
-
1104
  $attachments = apply_filters( 'foogallery_gallery_attachments_override_for_rendering', false, $current_foogallery );
1105
-
1106
- if ( $attachments !== false) {
1107
  return $attachments;
1108
  }
1109
-
1110
  //by default, return all attachments
1111
  return $current_foogallery->attachments();
1112
  }
@@ -1118,14 +1167,15 @@ function foogallery_current_gallery_attachments_for_rendering() {
1118
  *
1119
  * @return null or attachment ID
1120
  */
1121
- function foogallery_get_attachment_id_by_url($url) {
1122
- global $wpdb;
1123
- $query = "SELECT ID FROM {$wpdb->posts} WHERE guid=%s";
1124
- $attachment = $wpdb->get_col( $wpdb->prepare( $query, $url ) );
1125
- if ( count( $attachment ) > 0 ) {
1126
- return $attachment[0];
1127
- }
1128
- return null;
 
1129
  }
1130
 
1131
  /**
@@ -1136,13 +1186,18 @@ function foogallery_get_attachment_id_by_url($url) {
1136
  * @param string $text
1137
  * @return string
1138
  */
1139
- function foogallery_esc_attr( $text ) {
1140
- $safe_text = wp_check_invalid_utf8( $text );
1141
- $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES, false, true );
1142
- return $safe_text;
 
 
 
 
 
 
1143
  }
1144
 
1145
-
1146
  /**
1147
  * Create a FooGallery and return the ID
1148
  *
@@ -1151,231 +1206,237 @@ function foogallery_esc_attr( $text ) {
1151
  *
1152
  * @return int
1153
  */
1154
- function foogallery_create_gallery( $template, $attachment_ids ) {
1155
-
1156
- if ( empty( $template ) ) {
1157
- $template = foogallery_default_gallery_template();
1158
- }
1159
-
1160
- //create an empty foogallery
1161
- $foogallery_args = array(
1162
- 'post_title' => 'Demo Gallery',
1163
- 'post_type' => FOOGALLERY_CPT_GALLERY,
1164
- 'post_status' => 'publish',
1165
- );
1166
- $gallery_id = wp_insert_post( $foogallery_args );
1167
-
1168
- //set a gallery template
1169
- add_post_meta( $gallery_id, FOOGALLERY_META_TEMPLATE, $template, true );
1170
-
1171
- $settings = array();
1172
-
1173
- //set default settings if there are any, and also if the template is the same as the default
1174
- if ( foogallery_default_gallery_template() === $template ) {
1175
- $default_gallery_id = foogallery_get_setting( 'default_gallery_settings' );
1176
- if ( $default_gallery_id ) {
1177
- $settings = get_post_meta( $default_gallery_id, FOOGALLERY_META_SETTINGS, true );
1178
- add_post_meta( $gallery_id, FOOGALLERY_META_SETTINGS, $settings, true );
1179
- }
1180
- }
1181
-
1182
- if ( empty( $settings) ) {
1183
- switch ( $template ) {
1184
- case 'masonry':
1185
- $settings = array(
1186
- 'foogallery_items_view' => 'preview',
1187
- 'masonry_alignment' =>'fg-center',
1188
- 'masonry_border_size' =>'fg-border-thin',
1189
- 'masonry_caption_desc_source' =>'',
1190
- 'masonry_caption_title_source' =>'',
1191
- 'masonry_captions_limit_length' =>'',
1192
- 'masonry_custom_settings' =>'',
1193
- 'masonry_drop_shadow' =>'fg-shadow-outline',
1194
- 'masonry_filtering_type' =>'',
1195
- 'masonry_gutter_width' =>'10',
1196
- 'masonry_hover_effect_caption_visibility' =>'fg-captions-bottom',
1197
- 'masonry_hover_effect_color' =>'',
1198
- 'masonry_hover_effect_icon' =>'fg-hover-zoom',
1199
- 'masonry_hover_effect_preset' =>'fg-custom',
1200
- 'masonry_hover_effect_scale' =>'',
1201
- 'masonry_hover_effect_transition' =>'fg-hover-fade',
1202
- 'masonry_inner_shadow' =>'',
1203
- 'masonry_layout' =>'fixed',
1204
- 'masonry_lazyload' =>'',
1205
- 'masonry_lightbox' =>'foobox',
1206
- 'masonry_loaded_effect' =>'fg-loaded-fade-in',
1207
- 'masonry_loading_icon' =>'fg-loading-default',
1208
- 'masonry_paging_type' =>'',
1209
- 'masonry_rounded_corners' =>'',
1210
- 'masonry_state' =>'no',
1211
- 'masonry_theme' =>'fg-dark',
1212
- 'masonry_thumbnail_link' =>'image',
1213
- 'masonry_thumbnail_width' =>'250',
1214
- 'masonry_video_autoplay' =>'yes',
1215
- 'masonry_video_hover_icon' =>'fg-video-default',
1216
- 'masonry_video_size' =>'640x360',
1217
- 'masonry_video_sticky_icon' =>'',
1218
- );
1219
- }
1220
- }
1221
-
1222
- add_post_meta( $gallery_id, FOOGALLERY_META_SETTINGS, $settings, true );
1223
-
1224
- $attachments = explode( ',', $attachment_ids );
1225
- update_post_meta( $gallery_id, FOOGALLERY_META_ATTACHMENTS, $attachments );
1226
-
1227
- return $gallery_id;
 
 
 
 
 
 
 
 
 
 
 
1228
  }
1229
 
1230
-
1231
  /**
1232
  * Returns an array of marketing demos
1233
  * @return array
1234
  */
1235
- function foogallery_marketing_demos() {
1236
- $demos = array();
1237
-
1238
- $demos[] = array(
1239
- 'demo' => __('Responsive Image Gallery', 'foogallery'),
1240
- 'section' => __('Standard Gallery Demos', 'foogallery'),
1241
- 'href' => 'https://fooplugins.com/foogallery/wordpress-responsive-image-gallery/'
1242
- );
1243
- $demos[] = array(
1244
- 'demo' => __('Masonry Image Gallery', 'foogallery'),
1245
- 'section' => __('Standard Gallery Demos', 'foogallery'),
1246
- 'href' => 'https://fooplugins.com/foogallery/wordpress-masonry-gallery/'
1247
- );
1248
- $demos[] = array(
1249
- 'demo' => __('Justified Gallery', 'foogallery'),
1250
- 'section' => __('Standard Gallery Demos', 'foogallery'),
1251
- 'href' => 'https://fooplugins.com/foogallery/wordpress-justified-gallery/'
1252
- );
1253
- $demos[] = array(
1254
- 'demo' => __('Image Viewer Gallery', 'foogallery'),
1255
- 'section' => __('Standard Gallery Demos', 'foogallery'),
1256
- 'href' => 'https://fooplugins.com/foogallery/wordpress-image-viewer-gallery/'
1257
- );
1258
- $demos[] = array(
1259
- 'demo' => __('Simple Portfolio Gallery', 'foogallery'),
1260
- 'section' => __('Standard Gallery Demos', 'foogallery'),
1261
- 'href' => 'https://fooplugins.com/foogallery/wordpress-portfolio-gallery/'
1262
- );
1263
- $demos[] = array(
1264
- 'demo' => __('Single Thumbnail Gallery', 'foogallery'),
1265
- 'section' => __('Standard Gallery Demos', 'foogallery'),
1266
- 'href' => 'https://fooplugins.com/foogallery/wordpress-single-thumbnail-gallery/'
1267
- );
1268
-
1269
- $demos[] = array(
1270
- 'demo' => __('Grid PRO Gallery', 'foogallery'),
1271
- 'section' => __('PRO Gallery Demos', 'foogallery'),
1272
- 'href' => 'https://fooplugins.com/foogallery/wordpress-grid-gallery/'
1273
- );
1274
- $demos[] = array(
1275
- 'demo' => __('Polaroid PRO Gallery', 'foogallery'),
1276
- 'section' => __('PRO Gallery Demos', 'foogallery'),
1277
- 'href' => 'https://fooplugins.com/foogallery/wordpress-polaroid-gallery/'
1278
- );
1279
- $demos[] = array(
1280
- 'demo' => __('Slider PRO Gallery', 'foogallery'),
1281
- 'section' => __('PRO Gallery Demos', 'foogallery'),
1282
- 'href' => 'https://fooplugins.com/foogallery/wordpress-slider-gallery/'
1283
- );
1284
-
1285
- $demos[] = array(
1286
- 'demo' => __('Hover Presets Demo', 'foogallery'),
1287
- 'section' => __('PRO Features', 'foogallery'),
1288
- 'href' => 'https://fooplugins.com/foogallery/hover-presets/'
1289
- );
1290
- $demos[] = array(
1291
- 'demo' => __('Filtering Demos', 'foogallery'),
1292
- 'section' => __('PRO Features', 'foogallery'),
1293
- 'href' => 'https://fooplugins.com/foogallery/wordpress-filtered-gallery/'
1294
- );
1295
- $demos[] = array(
1296
- 'demo' => __('Pagination Types Demo', 'foogallery'),
1297
- 'section' => __('PRO Features', 'foogallery'),
1298
- 'href' => 'https://fooplugins.com/foogallery/gallery-pagination/'
1299
- );
1300
-
1301
- $demos[] = array(
1302
- 'demo' => __('Video Gallery Demos', 'foogallery'),
1303
- 'section' => __('PRO Features', 'foogallery'),
1304
- 'href' => 'https://fooplugins.com/foogallery/wordpress-video-gallery/'
1305
- );
1306
-
1307
- $demos[] = array(
1308
- 'demo' => __('Bulk Copy (admin)', 'foogallery'),
1309
- 'section' => __('PRO Features', 'foogallery'),
1310
- 'href' => 'https://fooplugins.com/bulk-copy-foogallery-pro/'
1311
- );
1312
-
1313
- $demos[] = array(
1314
- 'demo' => __('Albums', 'foogallery'),
1315
- 'section' => __('Album Demos', 'foogallery'),
1316
- 'href' => 'https://fooplugins.com/foogallery/wordpress-album-gallery/'
1317
- );
1318
-
1319
- return $demos;
1320
  }
1321
 
1322
-
1323
  /**
1324
  * Returns an array of the PRO features
1325
  * @return array
1326
  */
1327
- function foogallery_marketing_pro_features() {
1328
- $features[] = array(
1329
- 'feature' => __( 'Video Galleries', 'foogallery' ),
1330
- 'desc' => __( 'Create beautiful video galleries from YouTube, Vimeo, Facebook, Wistia and more!', 'foogallery' ),
1331
- 'demo' => 'https://fooplugins.com/foogallery/wordpress-video-gallery/'
1332
- );
1333
- $features[] = array(
1334
- 'feature' => __( 'Media Tags + Filtering', 'foogallery' ),
1335
- 'desc' => __( 'Assign tags to your media, which allows visitors to filter the galleries by tag.', 'foogallery' ),
1336
- 'demo' => 'https://fooplugins.com/foogallery/wordpress-filtered-gallery/'
1337
- );
1338
- $features[] = array(
1339
- 'feature' => __( 'More Gallery Templates', 'foogallery' ),
1340
- 'desc' => __( '3 more awesome gallery templates, including Slider, Grid and Polaroid.', 'foogallery' ),
1341
- 'demo' => 'https://fooplugins.com/foogallery/wordpress-slider-gallery/'
1342
- );
1343
- $features[] = array(
1344
- 'feature' => __( 'Preset Hover Effects', 'foogallery' ),
1345
- 'desc' => __( 'Choose from 11 beautifully designed preset hover effects.', 'foogallery' ),
1346
- 'demo' => 'https://fooplugins.com/foogallery/hover-presets/'
1347
- );
1348
- $features[] = array(
1349
- 'feature' => __( 'Advanced Pagination + Infinite Scroll', 'foogallery' ),
1350
- 'desc' => __( 'Choose from more paging types like numbered, load more or infinite scroll.', 'foogallery' ),
1351
- 'demo' => 'https://fooplugins.com/foogallery/gallery-pagination/'
1352
- );
1353
- $features[] = array(
1354
- 'feature' => __( 'Animated Loading Effects', 'foogallery' ),
1355
- 'desc' => __( 'Choose from 9 awesome animation effects to display as your galleries load.', 'foogallery' ),
1356
- 'demo' => 'https://fooplugins.com/foogallery/animated-loaded-effects/'
1357
- );
1358
- $features[] = array(
1359
- 'feature' => __( 'Bulk Copy Settings', 'foogallery' ),
1360
- 'desc' => __( 'Bulk copy your gallery settings to other galleries in a flash.', 'foogallery' ),
1361
- 'demo' => 'https://fooplugins.com/bulk-copy-foogallery-pro/'
1362
- );
1363
- return $features;
 
1364
  }
1365
 
1366
  /**
1367
  * Returns the allowed post types that galleries can be attached to
1368
  * @return array
1369
  */
1370
- function foogallery_allowed_post_types_for_usage() {
1371
- return apply_filters( 'foogallery_allowed_post_types_for_attachment', array( 'post', 'page' ) );
 
1372
  }
1373
 
1374
  /**
1375
  * Returns true if FooGallery is in debug mode
1376
  * @return bool
1377
  */
1378
- function foogallery_is_debug() {
 
1379
  return foogallery_get_setting( 'enable_debugging', false );
1380
  }
1381
 
@@ -1385,19 +1446,19 @@ function foogallery_is_debug() {
1385
  *
1386
  * @return FooGallery|null
1387
  */
1388
- function foogallery_admin_get_current_gallery( $post_gallery ) {
1389
- global $post;
1390
- global $current_foogallery_admin;
1391
-
1392
- if ( is_admin() && isset( $post ) ) {
1393
- if ( !isset( $current_foogallery_admin ) || $post_gallery->ID !== $post->ID ) {
1394
- $current_foogallery_admin = FooGallery::get( $post_gallery );
1395
- }
1396
-
1397
- return $current_foogallery_admin;
1398
- }
1399
-
1400
- return null;
1401
  }
1402
 
1403
  /**
@@ -1406,19 +1467,17 @@ function foogallery_admin_get_current_gallery( $post_gallery ) {
1406
  *
1407
  * @return array|int[]
1408
  */
1409
- function foogallery_rgb_to_color_array( $rgba ) {
1410
- if ( empty( $rgba ) ) {
1411
- return array(0,0,0);
1412
- }
1413
-
1414
- preg_match( '/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i', $rgba, $by_color );
1415
-
1416
- if ( count( $by_color ) >= 3 ) {
1417
- return array( $by_color[1], $by_color[2], $by_color[3] );
1418
- }
1419
-
1420
- //return black if there was a problem getting the color
1421
- return array(0,0,0);
1422
  }
1423
 
1424
  /**
@@ -1429,7 +1488,18 @@ function foogallery_rgb_to_color_array( $rgba ) {
1429
  * @param string $text
1430
  * @return string
1431
  */
1432
- function foogallery_sanitize_html( $text ) {
1433
- $safe_text = wp_kses_post( $text );
1434
- return $safe_text;
1435
- }
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
+
3
  /**
4
  * FooGallery global functions
5
  *
9
  * @link https://github.com/fooplugins/foogallery
10
  * @copyright 2014 FooPlugins LLC
11
  */
 
12
  /**
13
  * Returns the name of the plugin. (Allows the name to be overridden from extensions or functions.php)
14
  * @return string
15
  */
16
+ function foogallery_plugin_name()
17
+ {
18
+ return apply_filters( 'foogallery_plugin_name', 'FooGallery' );
19
  }
20
 
21
  /**
23
  *
24
  * @return array
25
  */
26
+ function foogallery_gallery_templates()
27
+ {
28
+ return apply_filters( 'foogallery_gallery_templates', array() );
29
  }
30
 
31
  /**
34
  *
35
  * @return bool|array
36
  */
37
+ function foogallery_get_gallery_template( $slug )
38
+ {
39
+ foreach ( foogallery_gallery_templates() as $template ) {
40
+ if ( $slug == $template['slug'] ) {
41
+ return $template;
42
+ }
43
+ }
44
+ return false;
45
  }
46
 
47
  /**
49
  *
50
  * @return FooGallery_Extensions_API
51
  */
52
+ function foogallery_extensions_api()
53
+ {
54
+ return new FooGallery_Extensions_API();
55
  }
56
 
57
  /**
59
  *
60
  * @return string
61
  */
62
+ function foogallery_default_gallery_template()
63
+ {
64
+ return foogallery_get_setting( 'gallery_template' );
65
  }
66
 
67
  /**
69
  *
70
  * @return bool
71
  */
72
+ function foogallery_permalinks_enabled()
73
+ {
74
+ return foogallery_get_setting( 'gallery_permalinks_enabled' );
75
  }
76
 
77
  /**
79
  *
80
  * @return string
81
  */
82
+ function foogallery_permalink()
83
+ {
84
+ return foogallery_get_setting( 'gallery_permalink' );
85
  }
86
 
87
  /**
93
  *
94
  * @return mixed
95
  */
96
+ function foogallery_get_setting( $key, $default = false )
97
+ {
98
+ $foogallery = FooGallery_Plugin::get_instance();
99
+ return $foogallery->options()->get( $key, foogallery_get_default( $key, $default ) );
100
  }
101
 
102
  /**
106
  *
107
  * @return string
108
  */
109
+ function foogallery_build_gallery_shortcode( $gallery_id )
110
+ {
111
+ return '[' . foogallery_gallery_shortcode_tag() . ' id="' . $gallery_id . '"]';
112
  }
113
 
114
  /**
116
  *
117
  * @return string
118
  */
119
+ function foogallery_gallery_shortcode_tag()
120
+ {
121
+ return apply_filters( 'foogallery_gallery_shortcode_tag', FOOGALLERY_CPT_GALLERY );
122
  }
123
 
124
  /**
130
  *
131
  * @return string Key value on success, false on failure.
132
  */
133
+ function foogallery_get_default( $key, $default = false )
134
+ {
135
+ $defaults = array(
136
+ 'gallery_template' => 'default',
137
+ 'gallery_permalinks_enabled' => false,
138
+ 'gallery_permalink' => 'gallery',
139
+ 'lightbox' => 'none',
140
+ 'thumb_jpeg_quality' => '80',
141
+ 'thumb_resize_animations' => true,
142
+ 'gallery_sorting' => '',
143
+ 'datasource' => 'media_library',
144
+ );
145
+ // A handy filter to override the defaults
146
+ $defaults = apply_filters( 'foogallery_defaults', $defaults );
147
+ // Return the key specified.
148
+ return ( isset( $defaults[$key] ) ? $defaults[$key] : $default );
 
 
149
  }
150
 
151
  /**
153
  *
154
  * @return string The Url to the FooGallery Add Gallery page in admin
155
  */
156
+ function foogallery_admin_add_gallery_url()
157
+ {
158
+ return admin_url( 'post-new.php?post_type=' . FOOGALLERY_CPT_GALLERY );
159
  }
160
 
161
  /**
163
  *
164
  * @return string The Url to the FooGallery help page in admin
165
  */
166
+ function foogallery_admin_help_url()
167
+ {
168
+ return admin_url( add_query_arg( array(
169
+ 'page' => FOOGALLERY_ADMIN_MENU_HELP_SLUG,
170
+ ), foogallery_admin_menu_parent_slug() ) );
171
  }
172
 
173
  /**
175
  *
176
  * @return string The Url to the FooGallery settings page in admin
177
  */
178
+ function foogallery_admin_settings_url()
179
+ {
180
+ return admin_url( add_query_arg( array(
181
+ 'page' => FOOGALLERY_ADMIN_MENU_SETTINGS_SLUG,
182
+ ), foogallery_admin_menu_parent_slug() ) );
183
  }
184
 
185
  /**
187
  *
188
  * @return string The Url to the FooGallery extensions page in admin
189
  */
190
+ function foogallery_admin_extensions_url()
191
+ {
192
+ return admin_url( add_query_arg( array(
193
+ 'page' => FOOGALLERY_ADMIN_MENU_EXTENSIONS_SLUG,
194
+ ), foogallery_admin_menu_parent_slug() ) );
195
  }
196
 
197
  /**
199
  *
200
  * @return string The Url to the FooGallery system info page in admin
201
  */
202
+ function foogallery_admin_systeminfo_url()
203
+ {
204
+ return admin_url( add_query_arg( array(
205
+ 'page' => FOOGALLERY_ADMIN_MENU_SYSTEMINFO_SLUG,
206
+ ), foogallery_admin_menu_parent_slug() ) );
207
  }
208
 
209
  /**
211
  *
212
  * @return string The Url to the FooGallery pricing page in admin
213
  */
214
+ function foogallery_admin_pricing_url()
215
+ {
216
+ return admin_url( add_query_arg( array(
217
+ 'page' => FOOGALLERY_ADMIN_MENU_PRICING_SLUG,
218
+ ), foogallery_admin_menu_parent_slug() ) );
219
  }
220
 
221
  /**
223
  *
224
  * @return string The Url to the FooGallery free trial page in admin
225
  */
226
+ function foogallery_admin_freetrial_url()
227
+ {
228
+ return add_query_arg( 'trial', 'true', foogallery_admin_pricing_url() );
229
  }
230
 
231
  /**
235
  *
236
  * @return bool
237
  */
238
+ function foogallery_gallery_template_setting( $key, $default = '' )
239
+ {
240
+ global $current_foogallery ;
241
+ global $current_foogallery_arguments ;
242
+ global $current_foogallery_template ;
243
+ $settings_key = "{$current_foogallery_template}_{$key}";
244
+
245
+ if ( $current_foogallery_arguments && array_key_exists( $key, $current_foogallery_arguments ) ) {
246
+ //try to get the value from the arguments
247
+ $value = $current_foogallery_arguments[$key];
248
+ } else {
249
+
250
+ if ( !empty($current_foogallery) && $current_foogallery->settings && array_key_exists( $settings_key, $current_foogallery->settings ) ) {
251
+ //then get the value out of the saved gallery settings
252
+ $value = $current_foogallery->settings[$settings_key];
253
+ } else {
254
+ //otherwise set it to the default
255
+ $value = $default;
256
+ }
257
+
258
+ }
259
+
260
+ $value = apply_filters( 'foogallery_gallery_template_setting-' . $key, $value );
261
+ return $value;
262
  }
263
 
264
  /**
265
  * Get the admin menu parent slug
266
  * @return string
267
  */
268
+ function foogallery_admin_menu_parent_slug()
269
+ {
270
+ return apply_filters( 'foogallery_admin_menu_parent_slug', FOOGALLERY_ADMIN_MENU_PARENT_SLUG );
271
  }
272
 
273
  /**
276
  *
277
  * @return string|void
278
  */
279
+ function foogallery_build_admin_menu_url( $extra_args = array() )
280
+ {
281
+ $url = admin_url( foogallery_admin_menu_parent_slug() );
282
+ if ( !empty($extra_args) ) {
283
+ $url = add_query_arg( $extra_args, $url );
284
+ }
285
+ return $url;
286
  }
287
 
288
  /**
293
  * @param string $menu_slug
294
  * @param $function
295
  */
296
+ function foogallery_add_submenu_page(
297
+ $menu_title,
298
+ $capability,
299
+ $menu_slug,
300
+ $function
301
+ )
302
+ {
303
+ add_submenu_page(
304
+ foogallery_admin_menu_parent_slug(),
305
+ $menu_title,
306
+ $menu_title,
307
  apply_filters( 'foogallery_admin_menu_capability', $capability ),
308
+ $menu_slug,
309
+ $function
310
+ );
311
  }
312
 
313
  /**
315
  *
316
  * @return FooGallery[] array of FooGallery galleries
317
  */
318
+ function foogallery_get_all_galleries( $excludes = false, $extra_args = false )
319
+ {
320
+ $args = array(
321
+ 'post_type' => FOOGALLERY_CPT_GALLERY,
322
+ 'post_status' => array( 'publish', 'draft' ),
323
+ 'cache_results' => false,
324
+ 'nopaging' => true,
325
+ );
326
+ if ( is_array( $excludes ) ) {
327
+ $args['post__not_in'] = $excludes;
328
+ }
329
+ if ( is_array( $extra_args ) ) {
330
+ $args = array_merge( $args, $extra_args );
331
+ }
332
+ $gallery_posts = get_posts( $args );
333
+ if ( empty($gallery_posts) ) {
334
+ return array();
335
+ }
336
+ $galleries = array();
337
+ foreach ( $gallery_posts as $post ) {
338
+ $galleries[] = FooGallery::get( $post );
339
+ }
340
+ return $galleries;
 
 
 
 
 
 
341
  }
342
 
343
  /**
347
  *
348
  * @return array An array of all the foogallery shortcodes found in the content
349
  */
350
+ function foogallery_extract_gallery_shortcodes( $content )
351
+ {
352
+ $shortcodes = array();
353
+ $regex_pattern = foogallery_gallery_shortcode_regex();
354
+ if ( preg_match_all( '/' . $regex_pattern . '/s', $content, $matches ) ) {
355
+ for ( $i = 0 ; $i < count( $matches[0] ) ; ++$i ) {
356
+ $shortcode = $matches[0][$i];
357
+ $args = $matches[3][$i];
358
+ $attribure_string = str_replace( ' ', '&', trim( $args ) );
359
+ $attribure_string = str_replace( '"', '', $attribure_string );
360
+ $attributes = wp_parse_args( $attribure_string );
361
+
362
+ if ( array_key_exists( 'id', $attributes ) ) {
363
+ $id = intval( $attributes['id'] );
364
+ $shortcodes[$id] = $shortcode;
365
+ }
366
+
367
+ }
368
+ }
369
+ return $shortcodes;
370
  }
371
 
372
  /**
374
  *
375
  * @return string
376
  */
377
+ function foogallery_gallery_shortcode_regex()
378
+ {
379
+ $tag = foogallery_gallery_shortcode_tag();
380
+ return '\\[' . '(\\[?)' . "({$tag})" . '(?![\\w-])' . '(' . '[^\\]\\/]*' . '(?:' . '\\/(?!\\])' . '[^\\]\\/]*' . ')*?' . ')' . '(?:' . '(\\/)' . '\\]' . '|' . '\\]' . '(?:' . '(' . '[^\\[]*+' . '(?:' . '\\[(?!\\/\\2\\])' . '[^\\[]*+' . ')*+' . ')' . '\\[\\/\\2\\]' . ')?' . ')' . '(\\]?)';
381
+ // 6: Optional second closing bracket for escaping shortcodes: [[tag]]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
382
  }
383
 
384
  /**
387
  *
388
  * @return string the classname based on the gallery and any extra attributes
389
  */
390
+ function foogallery_build_class_attribute( $gallery )
391
+ {
392
+ $classes[] = 'foogallery';
393
+ $classes[] = 'foogallery-container';
394
+ $classes[] = "foogallery-{$gallery->gallery_template}";
395
+ $num_args = func_num_args();
396
+
397
+ if ( $num_args > 1 ) {
398
+ $arg_list = func_get_args();
399
+ for ( $i = 1 ; $i < $num_args ; $i++ ) {
400
+ $classes[] = $arg_list[$i];
401
+ }
402
+ }
403
+
404
+ $classes = apply_filters( 'foogallery_build_class_attribute', $classes, $gallery );
405
+ //extract any classes from the gallery arguments
406
+ global $current_foogallery_arguments ;
407
+
408
+ if ( isset( $current_foogallery_arguments ) && is_array( $current_foogallery_arguments ) ) {
409
+ if ( array_key_exists( 'classname', $current_foogallery_arguments ) ) {
410
+ $classes[] = $current_foogallery_arguments['classname'];
411
+ }
412
+ if ( array_key_exists( 'classes', $current_foogallery_arguments ) ) {
413
+ $classes[] = $current_foogallery_arguments['classes'];
414
+ }
415
+ }
416
+
417
+ $classes = array_filter( $classes, 'strlen' );
418
+ return implode( ' ', $classes );
 
 
 
419
  }
420
 
421
  /**
424
  *
425
  * @return string the classname based on the gallery and any extra attributes
426
  */
427
+ function foogallery_build_class_attribute_safe( $gallery )
428
+ {
429
+ $args = func_get_args();
430
+ $result = call_user_func_array( "foogallery_build_class_attribute", $args );
431
+ return esc_attr( $result );
432
  }
433
 
434
  /**
436
  *
437
  * @param $gallery FooGallery
438
  */
439
+ function foogallery_build_class_attribute_render_safe( $gallery )
440
+ {
441
+ $args = func_get_args();
442
+ $result = call_user_func_array( "foogallery_build_class_attribute_safe", $args );
443
+ echo $result ;
444
  }
445
 
446
  /**
451
  *
452
  * @return string
453
  */
454
+ function foogallery_build_container_attributes_safe( $gallery, $attributes )
455
+ {
456
+ //add the default gallery id
457
+ $attributes['id'] = 'foogallery-gallery-' . $gallery->ID;
458
+ //add the standard data-foogallery attribute so that the JS initializes correctly
 
459
  $attributes['data-foogallery'] = foogallery_build_container_data_options( $gallery, $attributes );
460
+ //allow others to add their own attributes globally
461
+ $attributes = apply_filters( 'foogallery_build_container_attributes', $attributes, $gallery );
462
+ //allow others to add their own attributes for a specific gallery template
463
+ $attributes = apply_filters( 'foogallery_build_container_attributes-' . $gallery->gallery_template, $attributes, $gallery );
464
+ //clean up the attributes to make them safe for output
465
+ $html = '';
466
+ foreach ( $attributes as $key => $value ) {
467
+ $safe_value = esc_attr( $value );
468
+ $html .= "{$key}=\"{$safe_value}\" ";
469
+ }
470
+ return apply_filters(
471
+ 'foogallery_build_container_attributes_html',
472
+ $html,
473
+ $attributes,
474
+ $gallery
475
+ );
476
  }
477
 
478
  /**
483
  *
484
  * @return string
485
  */
486
+ function foogallery_build_container_data_options( $gallery, $attributes )
487
+ {
488
+ $options = apply_filters(
489
+ 'foogallery_build_container_data_options',
490
+ array(),
491
+ $gallery,
492
+ $attributes
493
+ );
494
+ $options = apply_filters(
495
+ 'foogallery_build_container_data_options-' . $gallery->gallery_template,
496
+ $options,
497
+ $gallery,
498
+ $attributes
499
+ );
500
+
501
+ if ( defined( 'JSON_UNESCAPED_UNICODE' ) ) {
502
+ return json_encode( $options, JSON_UNESCAPED_UNICODE );
503
+ } else {
504
+ return json_encode( $options );
505
+ }
506
 
 
 
 
 
 
507
  }
508
 
509
  /**
512
  * @param $gallery_id int The id of the foogallery you want to render
513
  * @param array $args
514
  */
515
+ function foogallery_render_gallery( $gallery_id, $args = array() )
516
+ {
517
+ //create new instance of template engine
518
+ $engine = new FooGallery_Template_Loader();
519
+ $shortcode_args = wp_parse_args( $args, array(
520
+ 'id' => $gallery_id,
521
+ ) );
522
+ $engine->render_template( $shortcode_args );
 
523
  }
524
 
525
  /**
526
  * Returns the available sorting options that can be chosen for galleries and albums
527
  */
528
+ function foogallery_sorting_options()
529
+ {
530
+ return apply_filters( 'foogallery_sorting_options', array(
531
+ '' => __( 'Default', 'foogallery' ),
532
+ 'date_desc' => __( 'Date created - newest first', 'foogallery' ),
533
+ 'date_asc' => __( 'Date created - oldest first', 'foogallery' ),
534
+ 'modified_desc' => __( 'Date modified - most recent first', 'foogallery' ),
535
+ 'modified_asc' => __( 'Date modified - most recent last', 'foogallery' ),
536
+ 'title_asc' => __( 'Title - alphabetically', 'foogallery' ),
537
+ 'title_desc' => __( 'Title - reverse', 'foogallery' ),
538
+ 'rand' => __( 'Random', 'foogallery' ),
539
+ ) );
540
+ }
541
+
542
+ function foogallery_sorting_get_posts_orderby_arg( $sorting_option )
543
+ {
544
+ $orderby_arg = 'post__in';
545
+ switch ( $sorting_option ) {
546
+ case 'date_desc':
547
+ case 'date_asc':
548
+ $orderby_arg = 'date';
549
+ break;
550
+ case 'modified_desc':
551
+ case 'modified_asc':
552
+ $orderby_arg = 'modified';
553
+ break;
554
+ case 'title_asc':
555
+ case 'title_desc':
556
+ $orderby_arg = 'title';
557
+ break;
558
+ case 'rand':
559
+ $orderby_arg = 'rand';
560
+ break;
561
+ }
562
+ return apply_filters( 'foogallery_sorting_get_posts_orderby_arg', $orderby_arg, $sorting_option );
563
+ }
564
+
565
+ function foogallery_sorting_get_posts_order_arg( $sorting_option )
566
+ {
567
+ $order_arg = 'DESC';
568
+ switch ( $sorting_option ) {
569
+ case 'date_asc':
570
+ case 'modified_asc':
571
+ case 'title_asc':
572
+ $order_arg = 'ASC';
573
+ break;
574
+ }
575
+ return apply_filters( 'foogallery_sorting_get_posts_order_arg', $order_arg, $sorting_option );
 
576
  }
577
 
578
  /**
580
  *
581
  * Activate the default templates extension when there are no gallery templates loaded
582
  */
583
+ function foogallery_activate_default_templates_extension()
584
+ {
585
  //no longer needed but left in case any 3rd party extensions call this function
586
  _deprecated_function( __FUNCTION__, '1.4.7' );
587
  }
595
  * @param bool $ver
596
  * @param string $media
597
  */
598
+ function foogallery_enqueue_style(
599
+ $handle,
600
+ $src,
601
+ $deps = array(),
602
+ $ver = false,
603
+ $media = 'all'
604
+ )
605
+ {
606
+ $src = apply_filters( 'foogallery_enqueue_style_src', $src, $handle );
607
+ wp_enqueue_style(
608
+ $handle,
609
+ $src,
610
+ $deps,
611
+ $ver,
612
+ $media
613
+ );
614
+ do_action(
615
+ 'foogallery_enqueue_style',
616
+ $handle,
617
+ $src,
618
+ $deps,
619
+ $ver,
620
+ $media
621
+ );
622
  }
623
 
 
624
  /**
625
  * Returns all foogallery post objects that are attached to the post
626
  *
628
  *
629
  * @return array List of foogallery posts.
630
  */
631
+ function foogallery_get_galleries_attached_to_post( $post_id )
632
+ {
633
+ $gallery_ids = get_post_meta( $post_id, FOOGALLERY_META_POST_USAGE, false );
634
+ if ( !empty($gallery_ids) ) {
635
+ return get_posts( array(
636
+ 'post_type' => array( FOOGALLERY_CPT_GALLERY ),
637
+ 'post_status' => array( 'draft', 'publish' ),
638
+ 'posts_per_page' => -1,
639
+ 'include' => $gallery_ids,
640
+ ) );
641
+ }
642
+ return array();
 
643
  }
644
 
645
  /**
646
  * Clears all css load optimization post meta
647
  */
648
+ function foogallery_clear_all_css_load_optimizations()
649
+ {
650
+ delete_post_meta_by_key( FOOGALLERY_META_POST_USAGE_CSS );
651
  }
652
 
653
  /**
654
  * Performs a check to see if the plugin has been updated, and perform any housekeeping if necessary
655
  */
656
+ function foogallery_perform_version_check()
657
+ {
658
+ $checker = new FooGallery_Version_Check();
659
+ $checker->perform_check();
660
  }
661
 
662
  /**
664
  *
665
  * @return int The quality value stored in settings
666
  */
667
+ function foogallery_thumbnail_jpeg_quality()
668
+ {
669
+ $quality = intval( foogallery_get_setting( 'thumb_jpeg_quality' ) );
670
+ //check if we get an invalid value for whatever reason and if so return a default of 80
671
+ if ( $quality <= 0 ) {
672
+ $quality = 80;
673
+ }
674
+ return $quality;
 
675
  }
676
 
677
  /**
679
  *
680
  * @return string
681
  */
682
+ function foogallery_caption_title_source()
683
+ {
684
+ $source = foogallery_get_setting( 'caption_title_source', 'caption' );
685
+ if ( empty($source) ) {
686
+ $source = 'caption';
687
+ }
688
+ return $source;
 
689
  }
690
 
691
  /**
696
  *
697
  * @return string
698
  */
699
+ function foogallery_get_caption_title_for_attachment( $attachment_post, $source = false )
700
+ {
701
+
702
+ if ( false === $source ) {
703
+ $source = foogallery_gallery_template_setting( 'caption_title_source', false );
704
+ if ( empty($source) || "none" === $source ) {
705
+ $source = foogallery_caption_title_source();
706
+ }
707
+ }
708
+
709
+ switch ( $source ) {
710
+ case 'title':
711
+ $caption = trim( $attachment_post->post_title );
712
+ break;
713
+ case 'desc':
714
+ $caption = trim( $attachment_post->post_content );
715
+ break;
716
+ case 'alt':
717
+ $caption = trim( get_post_meta( $attachment_post->ID, '_wp_attachment_image_alt', true ) );
718
+ break;
719
+ default:
720
+ $caption = trim( $attachment_post->post_excerpt );
721
+ }
722
+ return apply_filters( 'foogallery_get_caption_title_for_attachment', $caption, $attachment_post );
723
  }
724
 
725
  /**
731
  *
732
  * @return string
733
  */
734
+ function foogallery_get_caption_by_source( $attachment, $source, $caption_type )
735
+ {
736
+
737
+ if ( false === $source ) {
738
+ $source = foogallery_gallery_template_setting( 'caption_' . $caption_type . '_source', false );
739
+ if ( empty($source) || "none" === $source ) {
740
+
741
+ if ( 'title' === $caption_type ) {
742
+ $source = 'caption';
743
+ //bad legacy naming!
744
+ } else {
745
+ $source = $caption_type;
746
+ }
747
+
748
+ }
749
+ }
750
+
751
+ switch ( $source ) {
752
+ case 'title':
753
+ $caption = trim( $attachment->title );
754
+ break;
755
+ case 'desc':
756
+ $caption = trim( $attachment->description );
757
+ break;
758
+ case 'alt':
759
+ $caption = trim( $attachment->alt );
760
+ break;
761
+ case 'caption':
762
+ default:
763
+ $caption = trim( $attachment->caption );
764
+ }
765
+ return apply_filters(
766
+ 'foogallery_get_caption_by_source',
767
+ $caption,
768
+ $attachment,
769
+ $source,
770
+ $caption_type
771
+ );
772
  }
773
 
774
  /**
776
  *
777
  * @return string
778
  */
779
+ function foogallery_caption_desc_source()
780
+ {
781
+ $source = foogallery_get_setting( 'caption_desc_source', 'desc' );
782
+ if ( empty($source) ) {
783
+ $source = 'desc';
784
+ }
785
+ return $source;
 
786
  }
787
 
788
  /**
793
  *
794
  * @return string
795
  */
796
+ function foogallery_get_caption_desc_for_attachment( $attachment_post, $source = false )
797
+ {
798
+
799
+ if ( false === $source ) {
800
+ $source = foogallery_gallery_template_setting( 'caption_desc_source', false );
801
+ if ( empty($source) || "none" === $source ) {
802
+ $source = foogallery_caption_desc_source();
803
+ }
804
+ }
805
+
806
+ switch ( $source ) {
807
+ case 'title':
808
+ $caption = trim( $attachment_post->post_title );
809
+ break;
810
+ case 'caption':
811
+ $caption = trim( $attachment_post->post_excerpt );
812
+ break;
813
+ case 'alt':
814
+ $caption = trim( get_post_meta( $attachment_post->ID, '_wp_attachment_image_alt', true ) );
815
+ break;
816
+ default:
817
+ $caption = trim( $attachment_post->post_content );
818
+ }
819
+ return apply_filters( 'foogallery_get_caption_desc_for_attachment', $caption, $attachment_post );
820
  }
821
 
822
  /**
823
  * Runs thumbnail tests and outputs results in a table format
824
  */
825
+ function foogallery_output_thumbnail_generation_results()
826
+ {
827
+ $thumbs = new FooGallery_Thumbnails();
828
+ try {
829
+ $results = $thumbs->run_thumbnail_generation_tests();
830
+
831
  if ( $results['success'] ) {
832
+ echo '<span style="color:#0c0">' . __( 'Thumbnail generation test ran successfully.', 'foogallery' ) . '</span>' ;
833
  } else {
834
+ echo '<span style="color:#c00">' . __( 'Thumbnail generation test failed!', 'foogallery' ) . '</span>' ;
835
  var_dump( $results['error'] );
836
+ var_dump( $results['file_info'] );
837
  }
838
+
839
+ } catch ( Exception $e ) {
840
+ echo 'Exception: ' . $e->getMessage() ;
841
+ }
842
  }
843
 
844
  /**
846
  *
847
  * @return string
848
  */
849
+ function foogallery_test_thumb_url()
850
+ {
851
  return apply_filters( 'foogallery_test_thumb_url', FOOGALLERY_URL . 'assets/logo.png' );
852
  }
853
 
856
  *
857
  * @return array
858
  */
859
+ function foogallery_gallery_datasources()
860
+ {
861
+ $default_datasource = foogallery_default_datasource();
862
+ $datasources[$default_datasource] = array(
863
+ 'id' => $default_datasource,
864
+ 'name' => __( 'Media Library', 'foogalery' ),
865
  'label' => __( 'From Media Library', 'foogallery' ),
866
+ 'public' => false,
867
  );
868
+ return apply_filters( 'foogallery_gallery_datasources', $datasources );
 
869
  }
870
 
871
  /**
873
  *
874
  * @return string
875
  */
876
+ function foogallery_default_datasource()
877
+ {
878
+ return foogallery_get_default( 'datasource', 'media_library' );
879
  }
880
 
881
  /**
882
  * Returns the src to the built-in image placeholder
883
  * @return string
884
  */
885
+ function foogallery_image_placeholder_src()
886
+ {
887
+ return apply_filters( 'foogallery_image_placeholder_src', FOOGALLERY_URL . 'assets/image-placeholder.png' );
888
  }
889
 
890
  /**
894
  *
895
  * @return string
896
  */
897
+ function foogallery_image_placeholder_html( $args )
898
+ {
899
+ if ( !isset( $args ) ) {
900
+ $args = array(
901
+ 'width' => 150,
902
+ 'height' => 150,
903
+ );
904
+ }
905
+ $args['src'] = foogallery_image_placeholder_src();
906
+ $args = array_map( 'esc_attr', $args );
907
+ $html = '<img ';
908
+ foreach ( $args as $name => $value ) {
909
+ $html .= " {$name}=" . '"' . $value . '"';
910
+ }
911
+ $html .= ' />';
912
+ return apply_filters( 'foogallery_image_placeholder_html', $html, $args );
913
  }
914
 
915
  /**
921
  *
922
  * @return string
923
  */
924
+ function foogallery_find_featured_attachment_thumbnail_html( $gallery, $args = null )
925
+ {
926
+ if ( !isset( $gallery ) || false === $gallery ) {
927
+ return '';
928
+ }
929
+ if ( !isset( $args ) ) {
930
+ $args = array(
931
+ 'width' => 150,
932
+ 'height' => 150,
933
+ );
934
+ }
935
+ $featuredAttachment = $gallery->featured_attachment();
936
+
937
+ if ( $featuredAttachment ) {
938
+ return $featuredAttachment->html_img( $args );
939
+ } else {
940
+ //if we have no featured attachment, then use the built-in image placeholder
941
+ return foogallery_image_placeholder_html( $args );
942
+ }
943
 
 
 
 
 
 
 
 
944
  }
945
 
946
  /**
952
  *
953
  * @return string
954
  */
955
+ function foogallery_find_featured_attachment_thumbnail_src( $gallery, $args = null )
956
+ {
957
+ if ( !isset( $gallery ) || false === $gallery ) {
958
+ return '';
959
+ }
960
+ if ( !isset( $args ) ) {
961
+ $args = array(
962
+ 'width' => 150,
963
+ 'height' => 150,
964
+ );
965
+ }
966
+ $featuredAttachment = $gallery->featured_attachment();
967
+
968
+ if ( $featuredAttachment ) {
969
+ return $featuredAttachment->html_img_src( $args );
970
+ } else {
971
+ //if we have no featured attachment, then use the built-in image placeholder
972
+ return foogallery_image_placeholder_src();
973
+ }
974
 
 
 
 
 
 
 
 
975
  }
976
 
977
  /**
978
  * Returns the available retina options that can be chosen
979
  */
980
+ function foogallery_retina_options()
981
+ {
982
  return apply_filters( 'foogallery_retina_options', array(
983
+ '2x' => __( '2x', 'foogallery' ),
984
+ '3x' => __( '3x', 'foogallery' ),
985
+ '4x' => __( '4x', 'foogallery' ),
986
  ) );
987
  }
988
 
989
  /**
990
  * Does a full uninstall of the plugin including all data and settings!
991
  */
992
+ function foogallery_uninstall()
993
+ {
994
+ if ( !current_user_can( 'install_plugins' ) ) {
995
+ exit;
996
+ }
997
+ //delete all gallery posts first
998
+ global $wpdb ;
999
+ $query = "SELECT p.ID FROM {$wpdb->posts} AS p WHERE p.post_type IN (%s)";
1000
+ $gallery_post_ids = $wpdb->get_col( $wpdb->prepare( $query, FOOGALLERY_CPT_GALLERY ) );
1001
+
1002
+ if ( !empty($gallery_post_ids) ) {
1003
+ $deleted = 0;
1004
+ foreach ( $gallery_post_ids as $post_id ) {
1005
+ $del = wp_delete_post( $post_id );
1006
+ if ( false !== $del ) {
1007
+ ++$deleted;
1008
+ }
1009
+ }
1010
+ }
1011
+
1012
+ //delete all options
1013
+
1014
+ if ( is_network_admin() ) {
1015
+ delete_site_option( FOOGALLERY_SLUG );
1016
+ } else {
1017
+ delete_option( FOOGALLERY_SLUG );
1018
+ }
1019
+
1020
+ delete_option( FOOGALLERY_OPTION_VERSION );
1021
+ delete_option( FOOGALLERY_OPTION_THUMB_TEST );
1022
+ delete_option( FOOGALLERY_EXTENSIONS_SLUGS_OPTIONS_KEY );
1023
+ delete_option( FOOGALLERY_EXTENSIONS_LOADING_ERRORS );
1024
+ delete_option( FOOGALLERY_EXTENSIONS_LOADING_ERRORS_RESPONSE );
1025
+ delete_option( FOOGALLERY_EXTENSIONS_SLUGS_OPTIONS_KEY );
1026
+ delete_option( FOOGALLERY_EXTENSIONS_ACTIVATED_OPTIONS_KEY );
1027
+ delete_option( FOOGALLERY_EXTENSIONS_ERRORS_OPTIONS_KEY );
1028
+ //let any extensions clean up after themselves
1029
+ do_action( 'foogallery_uninstall' );
1030
  }
1031
 
1032
  /**
1036
  *
1037
  * @return string
1038
  */
1039
+ function foogallery_get_attachment_field_friendly_name( $field )
1040
+ {
1041
+ switch ( $field ) {
1042
+ case 'title':
1043
+ return __( 'Attachment Title', 'foogallery' );
1044
+ case 'caption':
1045
+ return __( 'Attachment Caption', 'foogallery' );
1046
+ case 'desc':
1047
+ return __( 'Attachment Description', 'foogallery' );
1048
+ case 'alt':
1049
+ return __( 'Attachment Alt', 'foogallery' );
1050
+ }
1051
  }
1052
 
1053
  /**
1056
  * @param $template mixed
1057
  * @return mixed
1058
  */
1059
+ function foogallery_get_fields_for_template( $template )
1060
+ {
1061
  if ( is_string( $template ) ) {
1062
  $template = foogallery_get_gallery_template( $template );
1063
  }
 
1064
  $fields = $template['fields'];
 
1065
  // Allow for extensions to override fields for every gallery template.
1066
  // Also passes the $template along so you can inspect and conditionally alter fields based on the template properties
1067
  $fields = apply_filters( 'foogallery_override_gallery_template_fields', $fields, $template );
 
1068
  // Allow for extensions to override fields for a specific gallery template.
1069
  // Also passes the $template along so you can inspect and conditionally alter fields based on the template properties
1070
  $fields = apply_filters( "foogallery_override_gallery_template_fields-{$template['slug']}", $fields, $template );
 
1071
  foreach ( $fields as &$field ) {
1072
  //allow for the field to be altered by extensions. Also used by the build-in fields, e.g. lightbox
1073
  $field = apply_filters( 'foogallery_alter_gallery_template_field', $field, $template['slug'] );
1074
  }
 
1075
  return $fields;
1076
  }
1077
 
1081
  * @param $template_name
1082
  * @return array
1083
  */
1084
+ function foogallery_build_default_settings_for_gallery_template( $template_name )
1085
+ {
1086
  $fields = foogallery_get_fields_for_template( $template_name );
1087
  $settings = array();
 
1088
  //loop through the fields and build up an array of keys and default values
1089
+ foreach ( $fields as $field ) {
1090
+ $default = ( array_key_exists( 'default', $field ) ? $field['default'] : false );
1091
+ if ( !empty($default) ) {
1092
  $settings["{$template_name}_{$field['id']}"] = $default;
1093
  }
1094
  }
 
1095
  return $settings;
1096
  }
1097
 
1099
  * Returns the choices used for the thumb link field type
1100
  * @return array
1101
  */
1102
+ function foogallery_gallery_template_field_thumb_link_choices()
1103
+ {
1104
  return apply_filters( 'foogallery_gallery_template_field_thumb_links', array(
1105
  'image' => __( 'Full Size Image', 'foogallery' ),
1106
  'page' => __( 'Image Attachment Page', 'foogallery' ),
1113
  * Returns the choices used for the lightbox field type
1114
  * @return array
1115
  */
1116
+ function foogallery_gallery_template_field_lightbox_choices()
1117
+ {
1118
  $lightboxes = apply_filters( 'foogallery_gallery_template_field_lightboxes', array() );
1119
  $lightboxes['none'] = __( 'None', 'foogallery' );
1120
  return $lightboxes;
1121
  }
1122
 
1123
+ if ( !function_exists( 'wp_get_raw_referer' ) ) {
1124
+ /**
1125
+ * Retrieves unvalidated referer from '_wp_http_referer' or HTTP referer.
1126
+ *
1127
+ * Do not use for redirects, use {@see wp_get_referer()} instead.
1128
+ *
1129
+ * @since 1.4.9
1130
+ * @return string|false Referer URL on success, false on failure.
1131
+ */
1132
+ function wp_get_raw_referer()
1133
+ {
1134
+
1135
+ if ( !empty($_REQUEST['_wp_http_referer']) ) {
1136
+ return wp_unslash( $_REQUEST['_wp_http_referer'] );
1137
+ } else {
1138
+ if ( !empty($_SERVER['HTTP_REFERER']) ) {
1139
+ return wp_unslash( $_SERVER['HTTP_REFERER'] );
1140
+ }
1141
+ }
1142
+
1143
+ return false;
1144
+ }
1145
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1146
  }
 
1147
  /**
1148
  * Return the attachments for the currently displayed gallery
1149
  *
1150
  * @return array
1151
  */
1152
+ function foogallery_current_gallery_attachments_for_rendering()
1153
+ {
1154
+ global $current_foogallery ;
1155
  $attachments = apply_filters( 'foogallery_gallery_attachments_override_for_rendering', false, $current_foogallery );
1156
+ if ( $attachments !== false ) {
 
1157
  return $attachments;
1158
  }
 
1159
  //by default, return all attachments
1160
  return $current_foogallery->attachments();
1161
  }
1167
  *
1168
  * @return null or attachment ID
1169
  */
1170
+ function foogallery_get_attachment_id_by_url( $url )
1171
+ {
1172
+ global $wpdb ;
1173
+ $query = "SELECT ID FROM {$wpdb->posts} WHERE guid=%s";
1174
+ $attachment = $wpdb->get_col( $wpdb->prepare( $query, $url ) );
1175
+ if ( count( $attachment ) > 0 ) {
1176
+ return $attachment[0];
1177
+ }
1178
+ return null;
1179
  }
1180
 
1181
  /**
1186
  * @param string $text
1187
  * @return string
1188
  */
1189
+ function foogallery_esc_attr( $text )
1190
+ {
1191
+ $safe_text = wp_check_invalid_utf8( $text );
1192
+ $safe_text = _wp_specialchars(
1193
+ $safe_text,
1194
+ ENT_QUOTES,
1195
+ false,
1196
+ true
1197
+ );
1198
+ return $safe_text;
1199
  }
1200
 
 
1201
  /**
1202
  * Create a FooGallery and return the ID
1203
  *
1206
  *
1207
  * @return int
1208
  */
1209
+ function foogallery_create_gallery( $template, $attachment_ids )
1210
+ {
1211
+ if ( empty($template) ) {
1212
+ $template = foogallery_default_gallery_template();
1213
+ }
1214
+ //create an empty foogallery
1215
+ $foogallery_args = array(
1216
+ 'post_title' => 'Demo Gallery',
1217
+ 'post_type' => FOOGALLERY_CPT_GALLERY,
1218
+ 'post_status' => 'publish',
1219
+ );
1220
+ $gallery_id = wp_insert_post( $foogallery_args );
1221
+ //set a gallery template
1222
+ add_post_meta(
1223
+ $gallery_id,
1224
+ FOOGALLERY_META_TEMPLATE,
1225
+ $template,
1226
+ true
1227
+ );
1228
+ $settings = array();
1229
+ //set default settings if there are any, and also if the template is the same as the default
1230
+
1231
+ if ( foogallery_default_gallery_template() === $template ) {
1232
+ $default_gallery_id = foogallery_get_setting( 'default_gallery_settings' );
1233
+
1234
+ if ( $default_gallery_id ) {
1235
+ $settings = get_post_meta( $default_gallery_id, FOOGALLERY_META_SETTINGS, true );
1236
+ add_post_meta(
1237
+ $gallery_id,
1238
+ FOOGALLERY_META_SETTINGS,
1239
+ $settings,
1240
+ true
1241
+ );
1242
+ }
1243
+
1244
+ }
1245
+
1246
+ if ( empty($settings) ) {
1247
+ switch ( $template ) {
1248
+ case 'masonry':
1249
+ $settings = array(
1250
+ 'foogallery_items_view' => 'preview',
1251
+ 'masonry_alignment' => 'fg-center',
1252
+ 'masonry_border_size' => 'fg-border-thin',
1253
+ 'masonry_caption_desc_source' => '',
1254
+ 'masonry_caption_title_source' => '',
1255
+ 'masonry_captions_limit_length' => '',
1256
+ 'masonry_custom_settings' => '',
1257
+ 'masonry_drop_shadow' => 'fg-shadow-outline',
1258
+ 'masonry_filtering_type' => '',
1259
+ 'masonry_gutter_width' => '10',
1260
+ 'masonry_hover_effect_caption_visibility' => 'fg-captions-bottom',
1261
+ 'masonry_hover_effect_color' => '',
1262
+ 'masonry_hover_effect_icon' => 'fg-hover-zoom',
1263
+ 'masonry_hover_effect_preset' => 'fg-custom',
1264
+ 'masonry_hover_effect_scale' => '',
1265
+ 'masonry_hover_effect_transition' => 'fg-hover-fade',
1266
+ 'masonry_inner_shadow' => '',
1267
+ 'masonry_layout' => 'fixed',
1268
+ 'masonry_lazyload' => '',
1269
+ 'masonry_lightbox' => 'foobox',
1270
+ 'masonry_loaded_effect' => 'fg-loaded-fade-in',
1271
+ 'masonry_loading_icon' => 'fg-loading-default',
1272
+ 'masonry_paging_type' => '',
1273
+ 'masonry_rounded_corners' => '',
1274
+ 'masonry_state' => 'no',
1275
+ 'masonry_theme' => 'fg-dark',
1276
+ 'masonry_thumbnail_link' => 'image',
1277
+ 'masonry_thumbnail_width' => '250',
1278
+ 'masonry_video_autoplay' => 'yes',
1279
+ 'masonry_video_hover_icon' => 'fg-video-default',
1280
+ 'masonry_video_size' => '640x360',
1281
+ 'masonry_video_sticky_icon' => '',
1282
+ );
1283
+ }
1284
+ }
1285
+ add_post_meta(
1286
+ $gallery_id,
1287
+ FOOGALLERY_META_SETTINGS,
1288
+ $settings,
1289
+ true
1290
+ );
1291
+ $attachments = explode( ',', $attachment_ids );
1292
+ update_post_meta( $gallery_id, FOOGALLERY_META_ATTACHMENTS, $attachments );
1293
+ return $gallery_id;
1294
  }
1295
 
 
1296
  /**
1297
  * Returns an array of marketing demos
1298
  * @return array
1299
  */
1300
+ function foogallery_marketing_demos()
1301
+ {
1302
+ $demos = array();
1303
+ $demos[] = array(
1304
+ 'demo' => __( 'Responsive Image Gallery', 'foogallery' ),
1305
+ 'section' => __( 'Standard Gallery Demos', 'foogallery' ),
1306
+ 'href' => 'https://fooplugins.com/foogallery/wordpress-responsive-image-gallery/',
1307
+ );
1308
+ $demos[] = array(
1309
+ 'demo' => __( 'Masonry Image Gallery', 'foogallery' ),
1310
+ 'section' => __( 'Standard Gallery Demos', 'foogallery' ),
1311
+ 'href' => 'https://fooplugins.com/foogallery/wordpress-masonry-gallery/',
1312
+ );
1313
+ $demos[] = array(
1314
+ 'demo' => __( 'Justified Gallery', 'foogallery' ),
1315
+ 'section' => __( 'Standard Gallery Demos', 'foogallery' ),
1316
+ 'href' => 'https://fooplugins.com/foogallery/wordpress-justified-gallery/',
1317
+ );
1318
+ $demos[] = array(
1319
+ 'demo' => __( 'Image Viewer Gallery', 'foogallery' ),
1320
+ 'section' => __( 'Standard Gallery Demos', 'foogallery' ),
1321
+ 'href' => 'https://fooplugins.com/foogallery/wordpress-image-viewer-gallery/',
1322
+ );
1323
+ $demos[] = array(
1324
+ 'demo' => __( 'Simple Portfolio Gallery', 'foogallery' ),
1325
+ 'section' => __( 'Standard Gallery Demos', 'foogallery' ),
1326
+ 'href' => 'https://fooplugins.com/foogallery/wordpress-portfolio-gallery/',
1327
+ );
1328
+ $demos[] = array(
1329
+ 'demo' => __( 'Single Thumbnail Gallery', 'foogallery' ),
1330
+ 'section' => __( 'Standard Gallery Demos', 'foogallery' ),
1331
+ 'href' => 'https://fooplugins.com/foogallery/wordpress-single-thumbnail-gallery/',
1332
+ );
1333
+ $demos[] = array(
1334
+ 'demo' => __( 'Grid PRO Gallery', 'foogallery' ),
1335
+ 'section' => __( 'PRO Gallery Demos', 'foogallery' ),
1336
+ 'href' => 'https://fooplugins.com/foogallery/wordpress-grid-gallery/',
1337
+ );
1338
+ $demos[] = array(
1339
+ 'demo' => __( 'Polaroid PRO Gallery', 'foogallery' ),
1340
+ 'section' => __( 'PRO Gallery Demos', 'foogallery' ),
1341
+ 'href' => 'https://fooplugins.com/foogallery/wordpress-polaroid-gallery/',
1342
+ );
1343
+ $demos[] = array(
1344
+ 'demo' => __( 'Slider PRO Gallery', 'foogallery' ),
1345
+ 'section' => __( 'PRO Gallery Demos', 'foogallery' ),
1346
+ 'href' => 'https://fooplugins.com/foogallery/wordpress-slider-gallery/',
1347
+ );
1348
+ $demos[] = array(
1349
+ 'demo' => __( 'Hover Presets Demo', 'foogallery' ),
1350
+ 'section' => __( 'PRO Features', 'foogallery' ),
1351
+ 'href' => 'https://fooplugins.com/foogallery/hover-presets/',
1352
+ );
1353
+ $demos[] = array(
1354
+ 'demo' => __( 'Filtering Demos', 'foogallery' ),
1355
+ 'section' => __( 'PRO Features', 'foogallery' ),
1356
+ 'href' => 'https://fooplugins.com/foogallery/wordpress-filtered-gallery/',
1357
+ );
1358
+ $demos[] = array(
1359
+ 'demo' => __( 'Pagination Types Demo', 'foogallery' ),
1360
+ 'section' => __( 'PRO Features', 'foogallery' ),
1361
+ 'href' => 'https://fooplugins.com/foogallery/gallery-pagination/',
1362
+ );
1363
+ $demos[] = array(
1364
+ 'demo' => __( 'Video Gallery Demos', 'foogallery' ),
1365
+ 'section' => __( 'PRO Features', 'foogallery' ),
1366
+ 'href' => 'https://fooplugins.com/foogallery/wordpress-video-gallery/',
1367
+ );
1368
+ $demos[] = array(
1369
+ 'demo' => __( 'Bulk Copy (admin)', 'foogallery' ),
1370
+ 'section' => __( 'PRO Features', 'foogallery' ),
1371
+ 'href' => 'https://fooplugins.com/bulk-copy-foogallery-pro/',
1372
+ );
1373
+ $demos[] = array(
1374
+ 'demo' => __( 'Albums', 'foogallery' ),
1375
+ 'section' => __( 'Album Demos', 'foogallery' ),
1376
+ 'href' => 'https://fooplugins.com/foogallery/wordpress-album-gallery/',
1377
+ );
1378
+ return $demos;
 
 
 
 
 
 
1379
  }
1380
 
 
1381
  /**
1382
  * Returns an array of the PRO features
1383
  * @return array
1384
  */
1385
+ function foogallery_marketing_pro_features()
1386
+ {
1387
+ $features[] = array(
1388
+ 'feature' => __( 'Video Galleries', 'foogallery' ),
1389
+ 'desc' => __( 'Create beautiful video galleries from YouTube, Vimeo, Facebook, Wistia and more!', 'foogallery' ),
1390
+ 'demo' => 'https://fooplugins.com/foogallery/wordpress-video-gallery/',
1391
+ );
1392
+ $features[] = array(
1393
+ 'feature' => __( 'Media Tags + Filtering', 'foogallery' ),
1394
+ 'desc' => __( 'Assign tags to your media, which allows visitors to filter the galleries by tag.', 'foogallery' ),
1395
+ 'demo' => 'https://fooplugins.com/foogallery/wordpress-filtered-gallery/',
1396
+ );
1397
+ $features[] = array(
1398
+ 'feature' => __( 'More Gallery Templates', 'foogallery' ),
1399
+ 'desc' => __( '3 more awesome gallery templates, including Slider, Grid and Polaroid.', 'foogallery' ),
1400
+ 'demo' => 'https://fooplugins.com/foogallery/wordpress-slider-gallery/',
1401
+ );
1402
+ $features[] = array(
1403
+ 'feature' => __( 'Preset Hover Effects', 'foogallery' ),
1404
+ 'desc' => __( 'Choose from 11 beautifully designed preset hover effects.', 'foogallery' ),
1405
+ 'demo' => 'https://fooplugins.com/foogallery/hover-presets/',
1406
+ );
1407
+ $features[] = array(
1408
+ 'feature' => __( 'Advanced Pagination + Infinite Scroll', 'foogallery' ),
1409
+ 'desc' => __( 'Choose from more paging types like numbered, load more or infinite scroll.', 'foogallery' ),
1410
+ 'demo' => 'https://fooplugins.com/foogallery/gallery-pagination/',
1411
+ );
1412
+ $features[] = array(
1413
+ 'feature' => __( 'Animated Loading Effects', 'foogallery' ),
1414
+ 'desc' => __( 'Choose from 9 awesome animation effects to display as your galleries load.', 'foogallery' ),
1415
+ 'demo' => 'https://fooplugins.com/foogallery/animated-loaded-effects/',
1416
+ );
1417
+ $features[] = array(
1418
+ 'feature' => __( 'Bulk Copy Settings', 'foogallery' ),
1419
+ 'desc' => __( 'Bulk copy your gallery settings to other galleries in a flash.', 'foogallery' ),
1420
+ 'demo' => 'https://fooplugins.com/bulk-copy-foogallery-pro/',
1421
+ );
1422
+ return $features;
1423
  }
1424
 
1425
  /**
1426
  * Returns the allowed post types that galleries can be attached to
1427
  * @return array
1428
  */
1429
+ function foogallery_allowed_post_types_for_usage()
1430
+ {
1431
+ return apply_filters( 'foogallery_allowed_post_types_for_attachment', array( 'post', 'page' ) );
1432
  }
1433
 
1434
  /**
1435
  * Returns true if FooGallery is in debug mode
1436
  * @return bool
1437
  */
1438
+ function foogallery_is_debug()
1439
+ {
1440
  return foogallery_get_setting( 'enable_debugging', false );
1441
  }
1442
 
1446
  *
1447
  * @return FooGallery|null
1448
  */
1449
+ function foogallery_admin_get_current_gallery( $post_gallery )
1450
+ {
1451
+ global $post ;
1452
+ global $current_foogallery_admin ;
1453
+
1454
+ if ( is_admin() && isset( $post ) ) {
1455
+ if ( !isset( $current_foogallery_admin ) || $post_gallery->ID !== $post->ID ) {
1456
+ $current_foogallery_admin = FooGallery::get( $post_gallery );
1457
+ }
1458
+ return $current_foogallery_admin;
1459
+ }
1460
+
1461
+ return null;
1462
  }
1463
 
1464
  /**
1467
  *
1468
  * @return array|int[]
1469
  */
1470
+ function foogallery_rgb_to_color_array( $rgba )
1471
+ {
1472
+ if ( empty($rgba) ) {
1473
+ return array( 0, 0, 0 );
1474
+ }
1475
+ preg_match( '/^rgba?[\\s+]?\\([\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?,[\\s+]?(\\d+)[\\s+]?/i', $rgba, $by_color );
1476
+ if ( count( $by_color ) >= 3 ) {
1477
+ return array( $by_color[1], $by_color[2], $by_color[3] );
1478
+ }
1479
+ //return black if there was a problem getting the color
1480
+ return array( 0, 0, 0 );
 
 
1481
  }
1482
 
1483
  /**
1488
  * @param string $text
1489
  * @return string
1490
  */
1491
+ function foogallery_sanitize_html( $text )
1492
+ {
1493
+ $safe_text = wp_kses_post( $text );
1494
+ return $safe_text;
1495
+ }
1496
+
1497
+ /**
1498
+ * Returns true if PRO is in use
1499
+ * @return bool
1500
+ */
1501
+ function foogallery_is_pro()
1502
+ {
1503
+ $pro = false;
1504
+ return $pro;
1505
+ }