Yasr – Yet Another Stars Rating - Version 2.4.7

Version Description

NEW FEATURE: book itemType now supports these values: * author * bookEdition * BookFormat * ISBN * numberOfPages NEW FEATURE: movie itemType now supports these values: * actor * director * Duration * dateCreated TWEAKED: added hooks yasr_vv_saved_text and yasr_mv_saved_text to filter text showed after a rating is saved TWEAKED: added hooks yasr_vv_txt_before and yasr_vv_text_after to filter text showed before or after the star ratings TWEAKED: code cleanup in setting page FIX: check cookie name to use hooks added in version 2.4.6 FIX: on fresh install, with php 7.4, a notice is returned

Download this release

Release Info

Developer Dudo
Plugin Icon 128x128 Yasr – Yet Another Stars Rating
Version 2.4.7
Comparing to
See all releases

Code changes from version 2.4.6 to 2.4.7

Files changed (70) hide show
  1. admin/classes/YasrSettings.php +0 -79
  2. admin/css/yasr-admin.css +8 -4
  3. admin/editor/YasrMetaboxSchemaFields.php +116 -16
  4. admin/editor/YasrOnSavePost.php +2 -1
  5. admin/editor/yasr-metabox-schema.php +7 -1
  6. admin/editor/yasr-metabox-top-right.php +1 -1
  7. admin/js/src/yasr-settings-page.js +3 -3
  8. admin/js/yasr-admin.js +1 -1
  9. admin/js/yasr-editor-screen.js +41 -1
  10. admin/settings/aspect_style/yasr-settings-functions-style.php +10 -13
  11. admin/settings/classes/YasrSettings.php +1023 -0
  12. admin/settings/yasr-stats-functions.php +1 -1
  13. admin/yasr-admin-init.php +12 -2
  14. changelog.txt +38 -1
  15. freemius/assets/css/admin/add-ons.css +1 -1
  16. freemius/includes/class-freemius.php +817 -188
  17. freemius/includes/class-fs-api.php +1 -1
  18. freemius/includes/class-fs-plugin-updater.php +11 -11
  19. freemius/includes/class-fs-storage.php +1 -0
  20. freemius/includes/customizer/class-fs-customizer-support-section.php +2 -2
  21. freemius/includes/entities/class-fs-payment.php +2 -2
  22. freemius/includes/entities/class-fs-plugin-license.php +7 -0
  23. freemius/includes/entities/class-fs-site.php +4 -1
  24. freemius/includes/fs-essential-functions.php +37 -20
  25. freemius/includes/fs-plugin-info-dialog.php +22 -15
  26. freemius/includes/managers/class-fs-admin-menu-manager.php +6 -1
  27. freemius/includes/managers/class-fs-admin-notice-manager.php +5 -5
  28. freemius/includes/sdk/FreemiusBase.php +1 -1
  29. freemius/includes/sdk/FreemiusWordPress.php +16 -12
  30. freemius/includes/supplements/fs-essential-functions-1.1.7.1.php +1 -1
  31. freemius/languages/freemius-da_DK.mo +0 -0
  32. freemius/languages/freemius-en.mo +0 -0
  33. freemius/languages/freemius-es_ES.mo +0 -0
  34. freemius/languages/freemius-fr_FR.mo +0 -0
  35. freemius/languages/freemius-he_IL.mo +0 -0
  36. freemius/languages/freemius-hu_HU.mo +0 -0
  37. freemius/languages/freemius-it_IT.mo +0 -0
  38. freemius/languages/freemius-ja.mo +0 -0
  39. freemius/languages/freemius-nl_NL.mo +0 -0
  40. freemius/languages/freemius-ru_RU.mo +0 -0
  41. freemius/languages/freemius-ta.mo +0 -0
  42. freemius/languages/freemius-zh_CN.mo +0 -0
  43. freemius/languages/freemius.pot +334 -334
  44. freemius/start.php +529 -521
  45. freemius/templates/account.php +61 -24
  46. freemius/templates/account/partials/addon.php +2 -2
  47. freemius/templates/account/payments.php +1 -1
  48. freemius/templates/add-ons.php +2 -2
  49. freemius/templates/auto-installation.php +1 -1
  50. freemius/templates/connect.php +12 -11
  51. freemius/templates/forms/affiliation.php +26 -5
  52. freemius/templates/forms/deactivation/form.php +18 -14
  53. freemius/templates/forms/license-activation.php +10 -8
  54. freemius/templates/forms/optout.php +17 -10
  55. freemius/templates/forms/subscription-cancellation.php +1 -1
  56. freemius/templates/forms/trial-start.php +1 -1
  57. freemius/templates/partials/index.php +2 -0
  58. freemius/templates/pricing.php +208 -176
  59. freemius/templates/secure-https-header.php +1 -1
  60. includes/classes/YasrPhpFieldsHelper.php +67 -8
  61. includes/css/yasr-table-light.css +1 -1
  62. includes/css/yasr.css +4 -0
  63. includes/shortcodes/classes/YasrOverallRating.php +0 -2
  64. includes/shortcodes/classes/YasrVisitorMultiSet.php +1 -1
  65. includes/shortcodes/classes/YasrVisitorVotes.php +83 -43
  66. includes/shortcodes/yasr-shortcode-ajax.php +14 -8
  67. includes/yasr-includes-init.php +58 -9
  68. public/classes/YasrRichSnippetAdditionalFields.php +63 -1
  69. readme.txt +37 -33
  70. yet-another-stars-rating.php +2 -2
admin/classes/YasrSettings.php DELETED
@@ -1,79 +0,0 @@
1
- <?php
2
-
3
- /*
4
-
5
- Copyright 2014 Dario Curvino (email : d.curvino@tiscali.it)
6
-
7
- This program is free software: you can redistribute it and/or modify
8
- it under the terms of the GNU General Public License as published by
9
- the Free Software Foundation, either version 2 of the License, or
10
- (at your option) any later version.
11
-
12
- This program is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with this program. If not, see <http://www.gnu.org/licenses/>
19
- */
20
-
21
- if (!defined('ABSPATH')) {
22
- exit('You\'re not allowed to see this page');
23
- } // Exit if accessed directly
24
-
25
- class YasrSettings {
26
-
27
- /**
28
- * @since 2.3.3
29
- *
30
- * @param $name
31
- * @param $class
32
- * @param $db_value
33
- * @param $id
34
- *
35
- * return void
36
- */
37
- public static function radioSelectSize($name, $class, $db_value=false, $id=false) {
38
- $array_size = array('small', 'medium', 'large');
39
-
40
- foreach($array_size as $size) {
41
- $id_string = $id . $size;
42
-
43
- //must be inside for each, or when loop arrive to last element
44
- //checked is defined
45
- $checked = '';
46
-
47
- //If db_value === false, there is no need to check for db value
48
- //so checked is the medium star (i.e. ranking page)
49
- if($db_value === false) {
50
- if($size === 'medium') {
51
- $checked = 'checked';
52
- }
53
- } else if ($db_value === $size) {
54
- $checked = 'checked';
55
- }
56
-
57
- echo sprintf( '<div class="yasr-option-div">
58
- <label for="%s">
59
- <input type="radio"
60
- name="%s"
61
- value="%s"
62
- class="%s"
63
- id="%s"
64
- %s
65
- >
66
- <img src="%syasr-stars-%s.png"
67
- class="yasr-img-option-size" alt=%s>
68
- <span class="yasr-text-options-size">
69
- %s
70
- </span>
71
- </label>
72
- </div>',
73
- $id_string, $name, $size, $class, $id_string, $checked, YASR_IMG_DIR, $size, $size,
74
- __( ucwords( $size ), 'yet-another-stars-rating' ) );
75
-
76
- } //end foreach
77
- }
78
-
79
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/css/yasr-admin.css CHANGED
@@ -97,23 +97,23 @@
97
  min-height: 50px;
98
  }
99
 
100
- .yasr-itemtype-row-container-label-input {
101
  margin-left: 10px;
102
  margin-right: 10px;
103
  margin-top: 10px;
104
  }
105
 
106
- .yasr-itemtype-row-container-label-input > label {
107
  display: inline-block;
108
  width: 130px;
109
  font-weight: bold;
110
  }
111
 
112
- .yasr-itemtype-row-container-label-input > textarea {
113
  height: 7em;
114
  }
115
 
116
- .yasr-itemtype-row-container-description {
117
  color: #928b8b;
118
  margin-top: 5px;
119
  margin-left: 10px;
@@ -302,6 +302,10 @@
302
  min-height: 560px;
303
  }
304
 
 
 
 
 
305
  .yasr-donatedivdx {
306
  float: right;
307
  clear: right;
97
  min-height: 50px;
98
  }
99
 
100
+ .yasr-element-row-container-label-input {
101
  margin-left: 10px;
102
  margin-right: 10px;
103
  margin-top: 10px;
104
  }
105
 
106
+ .yasr-element-row-container-label-input > label {
107
  display: inline-block;
108
  width: 130px;
109
  font-weight: bold;
110
  }
111
 
112
+ .yasr-element-row-container-label-input > textarea {
113
  height: 7em;
114
  }
115
 
116
+ .yasr-element-row-container-description {
117
  color: #928b8b;
118
  margin-top: 5px;
119
  margin-left: 10px;
302
  min-height: 560px;
303
  }
304
 
305
+ .yasr-settingsdiv hr{
306
+ border-top: 3px solid #ddd;
307
+ }
308
+
309
  .yasr-donatedivdx {
310
  float: right;
311
  clear: right;
admin/editor/YasrMetaboxSchemaFields.php CHANGED
@@ -34,7 +34,7 @@ class YasrMetaboxSchemaFields {
34
 
35
  public function __construct($saved_data) {
36
  $this->saved_data = $saved_data;
37
- new YasrPhpFieldsHelper('yasr-itemtype-row-container-label-input');
38
  }
39
 
40
  /**
@@ -44,7 +44,7 @@ class YasrMetaboxSchemaFields {
44
  ?>
45
  <!--product-->
46
  <div id="yasr-metabox-info-snippet-container-product"
47
- class="yasr-metabox-info-snippet-container-child" style="display: none">
48
  <?php
49
  $product_array = array(
50
  'brand' => array(
@@ -89,16 +89,16 @@ class YasrMetaboxSchemaFields {
89
  }
90
 
91
  /**
92
- * Generate fields for recipe localBuisness
93
  */
94
  public function localBuinsess() {
95
  ?>
96
  <div id="yasr-metabox-info-snippet-container-localbusiness"
97
- class="yasr-metabox-info-snippet-container-child" style="display: none">
98
 
99
  <?php
100
  $localbuisness_array = array(
101
- 'application' => array(
102
  'label' => 'Address',
103
  'name' => 'yasr_localbusiness_address',
104
  'description' => __('The physical location of the business. ', 'yet-another-stars-rating')
@@ -191,11 +191,11 @@ class YasrMetaboxSchemaFields {
191
 
192
  <!-- Recipe -->
193
  <div id="yasr-metabox-info-snippet-container-recipe"
194
- class="yasr-metabox-info-snippet-container-child" style="display: none">
195
 
196
  <?php $this->echoFields($recipe_array); ?>
197
 
198
- <div class="yasr-itemtype-row-container-description">
199
  <?php
200
  echo sprintf(
201
  __('More info %s here %s and %s here %s', 'yet-another-stars-rating'),
@@ -215,7 +215,7 @@ class YasrMetaboxSchemaFields {
215
  public function softwareApplication() {
216
  ?>
217
  <div id="yasr-metabox-info-snippet-container-software"
218
- class="yasr-metabox-info-snippet-container-child" style="display: none">
219
  <?php
220
  $software_array = array(
221
  'application' => array(
@@ -244,6 +244,106 @@ class YasrMetaboxSchemaFields {
244
  <?php
245
  }
246
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
247
  /**
248
  * Print the additional fields
249
  *
@@ -273,8 +373,8 @@ class YasrMetaboxSchemaFields {
273
  echo $string_input;
274
 
275
  if(isset($property['description'] ) && $property['description'] !== '') {
276
- echo '<div class="yasr-itemtype-row-container-description">'
277
- . $property['description'] .
278
  '</div>';
279
  }
280
 
@@ -299,23 +399,23 @@ class YasrMetaboxSchemaFields {
299
  <?php
300
  $offer_array = array(
301
  'price' => array(
302
- 'label' => 'Price',
303
  'name' => $price_name,
304
  ),
305
  'currency' => array(
306
- 'label' => 'Currency',
307
  'name' => $currency_name,
308
  ),
309
  'valid_until' => array(
310
- 'label' => 'Price Valid Until',
311
  'name' => $valid_until_name
312
  ),
313
  'availability' => array(
314
- 'label' => 'Availability',
315
  'name' => $availability_name
316
  ),
317
  'url' => array(
318
- 'label' => 'Url',
319
  'name' => $url_name,
320
  )
321
  );
@@ -340,7 +440,7 @@ class YasrMetaboxSchemaFields {
340
  }
341
  ?>
342
 
343
- <div class="yasr-itemtype-row-container-description">
344
  <?php
345
  echo sprintf(
346
  __('More info %s here %s', 'yet-another-stars-rating'),
34
 
35
  public function __construct($saved_data) {
36
  $this->saved_data = $saved_data;
37
+ new YasrPhpFieldsHelper('yasr-element-row-container-label-input');
38
  }
39
 
40
  /**
44
  ?>
45
  <!--product-->
46
  <div id="yasr-metabox-info-snippet-container-product"
47
+ class="yasr-metabox-info-snippet-container-child">
48
  <?php
49
  $product_array = array(
50
  'brand' => array(
89
  }
90
 
91
  /**
92
+ * Generate fields for localBuisness
93
  */
94
  public function localBuinsess() {
95
  ?>
96
  <div id="yasr-metabox-info-snippet-container-localbusiness"
97
+ class="yasr-metabox-info-snippet-container-child">
98
 
99
  <?php
100
  $localbuisness_array = array(
101
+ 'address' => array(
102
  'label' => 'Address',
103
  'name' => 'yasr_localbusiness_address',
104
  'description' => __('The physical location of the business. ', 'yet-another-stars-rating')
191
 
192
  <!-- Recipe -->
193
  <div id="yasr-metabox-info-snippet-container-recipe"
194
+ class="yasr-metabox-info-snippet-container-child">
195
 
196
  <?php $this->echoFields($recipe_array); ?>
197
 
198
+ <div class="yasr-element-row-container-description">
199
  <?php
200
  echo sprintf(
201
  __('More info %s here %s and %s here %s', 'yet-another-stars-rating'),
215
  public function softwareApplication() {
216
  ?>
217
  <div id="yasr-metabox-info-snippet-container-software"
218
+ class="yasr-metabox-info-snippet-container-child">
219
  <?php
220
  $software_array = array(
221
  'application' => array(
244
  <?php
245
  }
246
 
247
+ /**
248
+ * Generate fields for books
249
+ */
250
+ public function book() {
251
+ ?>
252
+ <div id="yasr-metabox-info-snippet-container-book"
253
+ class="yasr-metabox-info-snippet-container-child">
254
+
255
+ <?php
256
+ $book_array = array(
257
+ 'author' => array(
258
+ 'label' => 'author',
259
+ 'name' => 'yasr_book_author',
260
+ 'description' => __('The author of the book. ', 'yet-another-stars-rating')
261
+ ),
262
+ 'book_edition' => array(
263
+ 'label' => 'bookEdition',
264
+ 'name' => 'yasr_book_bookedition',
265
+ 'description' => __('The edition of the book. ', 'yet-another-stars-rating')
266
+ ),
267
+ 'book_format' => array(
268
+ 'type' => 'select',
269
+ 'options' => array('AudiobookFormat', 'EBook', 'GraphicNovel', 'Hardcover', 'Paperback'),
270
+ 'label' => 'bookFormat',
271
+ 'name' => 'yasr_book_bookformat',
272
+ 'description' => __('The format of the book. ', 'yet-another-stars-rating')
273
+ ),
274
+ 'isbn' => array(
275
+ 'label' => 'ISBN',
276
+ 'name' => 'yasr_book_isbn',
277
+ 'description' => sprintf(
278
+ __('The ISBN of the book. Google only supports ISBN-13. More info %s here %s',
279
+ 'yet-another-stars-rating'),
280
+ '<a href="https://developers.google.com/search/docs/data-types/book#isbn-and-other-supported-identifiers">','</a>'
281
+ )
282
+ ),
283
+ 'pages' => array(
284
+ 'label' => 'numberOfPages',
285
+ 'name' => 'yasr_book_number_of_pages',
286
+ 'description' => __('The number of pages in the book, must be a number.' ,'yet-another-stars-rating')
287
+ ),
288
+
289
+ );
290
+
291
+ $this->echoFields($book_array);
292
+ ?>
293
+ </div>
294
+ <?php
295
+ }
296
+
297
+
298
+ /**
299
+ * Generate fields for movie
300
+ */
301
+ public function movie() {
302
+ ?>
303
+ <div id="yasr-metabox-info-snippet-container-movie"
304
+ class="yasr-metabox-info-snippet-container-child">
305
+
306
+ <?php
307
+ $movie_array = array(
308
+ 'actor' => array (
309
+ 'type' => 'textarea',
310
+ 'label' => 'actor',
311
+ 'name' => 'yasr_movie_actor',
312
+ 'description' => sprintf(
313
+ __('Insert one or more actors %s. Use return %s to separate the actors.',
314
+ 'yet-another-stars-rating'),
315
+ '<br />', '<strong>(&#8629;)</strong>')
316
+ ),
317
+ 'director' => array (
318
+ 'type' => 'textarea',
319
+ 'label' => 'director',
320
+ 'name' => 'yasr_movie_director',
321
+ 'description' => sprintf(
322
+ __('Insert one or more director %s. Use return %s to separate the directors.',
323
+ 'yet-another-stars-rating'),
324
+ '<br />', '<strong>(&#8629;)</strong>')
325
+ ),
326
+ 'duration' => array (
327
+ 'label' => 'duration',
328
+ 'name' => 'yasr_movie_duration',
329
+ 'description' => __('The duration of the movie in ISO 8601 date format.',
330
+ 'yet-another-stars-rating')
331
+ ),
332
+ 'dateCreated' => array (
333
+ 'label' => 'dateCreated',
334
+ 'name' => 'yasr_movie_datecreated',
335
+ 'description' => __('The date on which the Movie was created.',
336
+ 'yet-another-stars-rating')
337
+ ),
338
+
339
+ );
340
+
341
+ $this->echoFields($movie_array);
342
+ ?>
343
+ </div>
344
+ <?php
345
+ }
346
+
347
  /**
348
  * Print the additional fields
349
  *
373
  echo $string_input;
374
 
375
  if(isset($property['description'] ) && $property['description'] !== '') {
376
+ echo '<div class="yasr-element-row-container-description">'
377
+ . $property['description'] .
378
  '</div>';
379
  }
380
 
399
  <?php
400
  $offer_array = array(
401
  'price' => array(
402
+ 'label' => 'price',
403
  'name' => $price_name,
404
  ),
405
  'currency' => array(
406
+ 'label' => 'currency',
407
  'name' => $currency_name,
408
  ),
409
  'valid_until' => array(
410
+ 'label' => 'priceValidUntil',
411
  'name' => $valid_until_name
412
  ),
413
  'availability' => array(
414
+ 'label' => 'availability',
415
  'name' => $availability_name
416
  ),
417
  'url' => array(
418
+ 'label' => 'url',
419
  'name' => $url_name,
420
  )
421
  );
440
  }
441
  ?>
442
 
443
+ <div class="yasr-element-row-container-description">
444
  <?php
445
  echo sprintf(
446
  __('More info %s here %s', 'yet-another-stars-rating'),
admin/editor/YasrOnSavePost.php CHANGED
@@ -171,7 +171,8 @@ class YasrOnSavePost {
171
 
172
  //if come from textarea, use sanitize_textarea_field, that preservers newlines
173
  if($item_type_name === 'yasr_recipe_recipeingredient'
174
- || $item_type_name === 'yasr_recipe_recipeinstructions') {
 
175
  $item_to_save = sanitize_textarea_field($_POST[$item_type_name]);
176
  } else {
177
  //use sanitize_text_field
171
 
172
  //if come from textarea, use sanitize_textarea_field, that preservers newlines
173
  if($item_type_name === 'yasr_recipe_recipeingredient'
174
+ || $item_type_name === 'yasr_recipe_recipeinstructions'
175
+ || 'yasr_movie_actor' || 'yasr_movie_director') {
176
  $item_to_save = sanitize_textarea_field($_POST[$item_type_name]);
177
  } else {
178
  //use sanitize_text_field
admin/editor/yasr-metabox-schema.php CHANGED
@@ -86,7 +86,7 @@ $itemType_obj = new YasrMetaboxSchemaFields($saved_data);
86
  value="<?php echo $saved_data['yasr_schema_title'] ?>"
87
  >
88
  </div>
89
- <div class="yasr-itemtype-row-container-description">
90
  <?php _e('Optional. If empty, post title will be used instead.', 'yet-another-stars-rating') ?>
91
  </div>
92
 
@@ -112,6 +112,12 @@ $itemType_obj = new YasrMetaboxSchemaFields($saved_data);
112
 
113
  //softweareApplication
114
  $itemType_obj->softwareApplication();
 
 
 
 
 
 
115
  ?>
116
 
117
  </div>
86
  value="<?php echo $saved_data['yasr_schema_title'] ?>"
87
  >
88
  </div>
89
+ <div class="yasr-element-row-container-description">
90
  <?php _e('Optional. If empty, post title will be used instead.', 'yet-another-stars-rating') ?>
91
  </div>
92
 
112
 
113
  //softweareApplication
114
  $itemType_obj->softwareApplication();
115
+
116
+ //Book
117
+ $itemType_obj->book();
118
+
119
+ //Movie
120
+ $itemType_obj->movie();
121
  ?>
122
 
123
  </div>
admin/editor/yasr-metabox-top-right.php CHANGED
@@ -59,7 +59,7 @@ wp_nonce_field('yasr_nonce_is_post_review_action', 'yasr_nonce_is_post_review');
59
  <div>
60
  <?php
61
  //Show this message if auto insert is off or if auto insert is not set to show overall rating (so if it is set to visitor rating)
62
- if( YASR_AUTO_INSERT_ENABLED == 0 || (YASR_AUTO_INSERT_ENABLED == 1 && YASR_AUTO_INSERT_WHAT === 'visitor_rating') ) {
63
  echo "<div>";
64
  _e ('Remember to insert this shortcode <strong>[yasr_overall_rating]</strong>
65
  where you want to display this rating',
59
  <div>
60
  <?php
61
  //Show this message if auto insert is off or if auto insert is not set to show overall rating (so if it is set to visitor rating)
62
+ if( YASR_AUTO_INSERT_ENABLED === 0 || (YASR_AUTO_INSERT_ENABLED === 1 && YASR_AUTO_INSERT_WHAT === 'visitor_rating') ) {
63
  echo "<div>";
64
  _e ('Remember to insert this shortcode <strong>[yasr_overall_rating]</strong>
65
  where you want to display this rating',
admin/js/src/yasr-settings-page.js CHANGED
@@ -45,13 +45,13 @@ document.addEventListener('DOMContentLoaded', function(event) {
45
 
46
  //for text before stars
47
  if (textBeforeStars === false) {
48
- jQuery('.yasr-general-options-text-before').prop('disabled', true);
49
  }
50
 
51
  jQuery('#yasr-general-options-text-before-stars-switch').change(function () {
52
  if (jQuery(this).is(':checked')) {
53
 
54
- jQuery('.yasr-general-options-text-before').prop('disabled', false);
55
  jQuery('#yasr-general-options-custom-text-before-overall').val('Our Score');
56
  jQuery('#yasr-general-options-custom-text-before-visitor').val('Click to rate this post!');
57
  jQuery('#yasr-general-options-custom-text-after-visitor').val('[Total: %total_count% Average: %average%]');
@@ -59,7 +59,7 @@ document.addEventListener('DOMContentLoaded', function(event) {
59
  jQuery('#yasr-general-options-custom-text-already-rated').val('You have already voted for this article');
60
 
61
  } else {
62
- jQuery('.yasr-general-options-text-before').prop('disabled', true);
63
  }
64
 
65
  });
45
 
46
  //for text before stars
47
  if (textBeforeStars === false) {
48
+ jQuery(".yasr-general-options-text-before").find(':input').prop('disabled', true);
49
  }
50
 
51
  jQuery('#yasr-general-options-text-before-stars-switch').change(function () {
52
  if (jQuery(this).is(':checked')) {
53
 
54
+ jQuery(".yasr-general-options-text-before").find(':input').prop('disabled', false);
55
  jQuery('#yasr-general-options-custom-text-before-overall').val('Our Score');
56
  jQuery('#yasr-general-options-custom-text-before-visitor').val('Click to rate this post!');
57
  jQuery('#yasr-general-options-custom-text-after-visitor').val('[Total: %total_count% Average: %average%]');
59
  jQuery('#yasr-general-options-custom-text-already-rated').val('You have already voted for this article');
60
 
61
  } else {
62
+ jQuery(".yasr-general-options-text-before").find(':input').prop('disabled', true);
63
  }
64
 
65
  });
admin/js/yasr-admin.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function r(o){if(t[o])return t[o].exports;var a=t[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(o,a,function(t){return e[t]}.bind(null,a));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){r(1),r(2),e.exports=r(3)},function(e,t){copyToClipboard=e=>{const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)},tippy(document.querySelectorAll(".yasr-copy-shortcode"),{content:"Copied! Insert into your post!",theme:"yasr",arrow:"true",arrowType:"round",trigger:"click"})},function(e,t){jQuery(document).ready((function(){jQuery(".yasr-log-pagenum").on("click",(function(){jQuery("#yasr-loader-log-metabox").show();var e={action:"yasr_change_log_page",pagenum:jQuery(this).val(),totalpages:jQuery("#yasr-log-total-pages").data("yasr-log-total-pages")};jQuery.post(ajaxurl,e,(function(e){jQuery("#yasr-loader-log-metabox").hide(),jQuery("#yasr-log-container").html(e)}))})),jQuery(document).ajaxComplete((function(e,t,r){var o=!0;"undefined"!==r.data&&(o=r.data.search("action=yasr_change_log_page")),-1!==o&&jQuery(".yasr-log-pagenum").on("click",(function(){jQuery("#yasr-loader-log-metabox").show();var e={action:"yasr_change_log_page",pagenum:jQuery(this).val(),totalpages:jQuery("#yasr-log-total-pages").data("yasr-log-total-pages")};jQuery.post(ajaxurl,e,(function(e){jQuery("#yasr-log-container").html(e)}))}))}))})),jQuery(document).ready((function(){jQuery(".yasr-user-log-page-num").on("click",(function(){jQuery("#yasr-loader-user-log-metabox").show();var e={action:"yasr_change_user_log_page",pagenum:jQuery(this).val(),totalpages:jQuery("#yasr-user-log-total-pages").data("yasr-log-total-pages")};jQuery.post(ajaxurl,e,(function(e){jQuery("#yasr-loader-log-metabox").hide(),jQuery("#yasr-user-log-container").html(e)}))})),jQuery(document).ajaxComplete((function(e,t,r){void 0!==r.data&&-1!==r.data.search("action=yasr_change_user_log_page")&&jQuery(".yasr-user-log-page-num").on("click",(function(){jQuery("#yasr-loader-user-log-metabox").show();var e={action:"yasr_change_user_log_page",pagenum:jQuery(this).val(),totalpages:jQuery("#yasr-user-log-total-pages").data("yasr-log-total-pages")};jQuery.post(ajaxurl,e,(function(e){jQuery("#yasr-user-log-container").html(e)}))}))}))}))},function(e,t){document.addEventListener("DOMContentLoaded",(function(e){if(void 0===document.getElementsByClassName("nav-tab-active")[0])return;let t=document.getElementsByClassName("nav-tab-active")[0].id;if("general_settings"===t){let e=document.getElementById("yasr_auto_insert_switch").checked,t=document.getElementById("yasr-general-options-stars-title-switch").checked,r=document.getElementById("yasr-general-options-text-before-stars-switch").checked;!1===e&&jQuery(".yasr-auto-insert-options-class").prop("disabled",!0),!1===t&&jQuery(".yasr-stars-title-options-class").prop("disabled",!0),jQuery("#yasr_auto_insert_switch").change((function(){jQuery(this).is(":checked")?jQuery(".yasr-auto-insert-options-class").prop("disabled",!1):jQuery(".yasr-auto-insert-options-class").prop("disabled",!0)})),jQuery("#yasr-general-options-stars-title-switch").change((function(){jQuery(this).is(":checked")?jQuery(".yasr-stars-title-options-class").prop("disabled",!1):jQuery(".yasr-stars-title-options-class").prop("disabled",!0)})),!1===r&&jQuery(".yasr-general-options-text-before").prop("disabled",!0),jQuery("#yasr-general-options-text-before-stars-switch").change((function(){jQuery(this).is(":checked")?(jQuery(".yasr-general-options-text-before").prop("disabled",!1),jQuery("#yasr-general-options-custom-text-before-overall").val("Our Score"),jQuery("#yasr-general-options-custom-text-before-visitor").val("Click to rate this post!"),jQuery("#yasr-general-options-custom-text-after-visitor").val("[Total: %total_count% Average: %average%]"),jQuery("#yasr-general-options-custom-text-must-sign-in").val("You must sign in to vote"),jQuery("#yasr-general-options-custom-text-already-rated").val("You have already voted for this article")):jQuery(".yasr-general-options-text-before").prop("disabled",!0)})),jQuery("#yasr-doc-custom-text-link").on("click",(function(){return jQuery("#yasr-doc-custom-text-div").toggle("slow"),!1})),jQuery("#yasr-stats-explained-link").on("click",(function(){return jQuery("#yasr-stats-explained").toggle("slow"),!1}))}if("manage_multi"===t){let e=document.getElementById("n-multiset").value;if(jQuery("#yasr-multi-set-doc-link").on("click",(function(){jQuery("#yasr-multi-set-doc-box").toggle("slow")})),jQuery("#yasr-multi-set-doc-link-hide").on("click",(function(){jQuery("#yasr-multi-set-doc-box").toggle("slow")})),1===e){var r=jQuery("#yasr-edit-form-number-elements").attr("value");r++,jQuery("#yasr-add-field-edit-multiset").on("click",(function(){if(r>9)return jQuery("#yasr-element-limit").show(),jQuery("#yasr-add-field-edit-multiset").hide(),!1;var e=jQuery(document.createElement("tr"));e.html('<td colspan="2">Element #'+r+' <input type="text" name="edit-multi-set-element-'+r+'" value="" ></td>'),e.appendTo("#yasr-table-form-edit-multi-set"),r++}))}e>1&&(jQuery("#yasr-button-select-set-edit-form").on("click",(function(){var e={action:"yasr_get_multi_set",set_id:jQuery("#yasr_select_edit_set").val()};return jQuery.post(ajaxurl,e,(function(e){jQuery("#yasr-multi-set-response").show(),jQuery("#yasr-multi-set-response").html(e)})),!1})),jQuery(document).ajaxComplete((function(){var e=jQuery("#yasr-edit-form-number-elements").attr("value");e++,jQuery("#yasr-add-field-edit-multiset").on("click",(function(){if(e>9)return jQuery("#yasr-element-limit").show(),jQuery("#yasr-add-field-edit-multiset").hide(),!1;var t=jQuery(document.createElement("tr"));t.html('<td colspan="2">Element #'+e+' <input type="text" name="edit-multi-set-element-'+e+'" value="" ></td>'),t.appendTo("#yasr-table-form-edit-multi-set"),e++}))})))}"style_options"===t&&(wp.codeEditor.initialize(document.getElementById("yasr_style_options_textarea"),yasr_cm_settings),jQuery("#yasr-color-scheme-preview-link").on("click",(function(){return jQuery("#yasr-color-scheme-preview").toggle("slow"),!1}))),"migration_tools"===t&&(jQuery("#yasr-import-ratemypost-submit").on("click",(function(){document.getElementById("yasr-import-ratemypost-answer").innerHTML='<img src="'+yasrCommonDataAdmin.loaderHtml+'"</img>';var e={action:"yasr_import_ratemypost",nonce:document.getElementById("yasr-import-rmp-nonce").value};jQuery.post(ajaxurl,e,(function(e){e=JSON.parse(e),document.getElementById("yasr-import-ratemypost-answer").innerHTML=e}))})),jQuery("#yasr-import-wppr-submit").on("click",(function(){document.getElementById("yasr-import-wppr-answer").innerHTML='<img src="'+yasrCommonDataAdmin.loaderHtml+'"</img>';var e={action:"yasr_import_wppr",nonce:document.getElementById("yasr-import-wppr-nonce").value};jQuery.post(ajaxurl,e,(function(e){document.getElementById("yasr-import-wppr-answer").innerHTML=e}))})),jQuery("#yasr-import-kksr-submit").on("click",(function(){document.getElementById("yasr-import-kksr-answer").innerHTML='<img src="'+yasrCommonDataAdmin.loaderHtml+'"</img>';var e={action:"yasr_import_kksr",nonce:document.getElementById("yasr-import-kksr-nonce").value};jQuery.post(ajaxurl,e,(function(e){document.getElementById("yasr-import-kksr-answer").innerHTML=e}))})),jQuery("#yasr-import-mr-submit").on("click",(function(){document.getElementById("yasr-import-mr-answer").innerHTML='<img src="'+yasrCommonDataAdmin.loaderHtml+'"</img>';var e={action:"yasr_import_mr",nonce:document.getElementById("yasr-import-mr-nonce").value};jQuery.post(ajaxurl,e,(function(e){document.getElementById("yasr-import-mr-answer").innerHTML=e}))})))}))}]);
1
+ !function(e){var t={};function r(o){if(t[o])return t[o].exports;var a=t[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(o,a,function(t){return e[t]}.bind(null,a));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){r(1),r(2),e.exports=r(3)},function(e,t){copyToClipboard=e=>{const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)},tippy(document.querySelectorAll(".yasr-copy-shortcode"),{content:"Copied! Insert into your post!",theme:"yasr",arrow:"true",arrowType:"round",trigger:"click"})},function(e,t){jQuery(document).ready((function(){jQuery(".yasr-log-pagenum").on("click",(function(){jQuery("#yasr-loader-log-metabox").show();var e={action:"yasr_change_log_page",pagenum:jQuery(this).val(),totalpages:jQuery("#yasr-log-total-pages").data("yasr-log-total-pages")};jQuery.post(ajaxurl,e,(function(e){jQuery("#yasr-loader-log-metabox").hide(),jQuery("#yasr-log-container").html(e)}))})),jQuery(document).ajaxComplete((function(e,t,r){var o=!0;"undefined"!==r.data&&(o=r.data.search("action=yasr_change_log_page")),-1!==o&&jQuery(".yasr-log-pagenum").on("click",(function(){jQuery("#yasr-loader-log-metabox").show();var e={action:"yasr_change_log_page",pagenum:jQuery(this).val(),totalpages:jQuery("#yasr-log-total-pages").data("yasr-log-total-pages")};jQuery.post(ajaxurl,e,(function(e){jQuery("#yasr-log-container").html(e)}))}))}))})),jQuery(document).ready((function(){jQuery(".yasr-user-log-page-num").on("click",(function(){jQuery("#yasr-loader-user-log-metabox").show();var e={action:"yasr_change_user_log_page",pagenum:jQuery(this).val(),totalpages:jQuery("#yasr-user-log-total-pages").data("yasr-log-total-pages")};jQuery.post(ajaxurl,e,(function(e){jQuery("#yasr-loader-log-metabox").hide(),jQuery("#yasr-user-log-container").html(e)}))})),jQuery(document).ajaxComplete((function(e,t,r){void 0!==r.data&&-1!==r.data.search("action=yasr_change_user_log_page")&&jQuery(".yasr-user-log-page-num").on("click",(function(){jQuery("#yasr-loader-user-log-metabox").show();var e={action:"yasr_change_user_log_page",pagenum:jQuery(this).val(),totalpages:jQuery("#yasr-user-log-total-pages").data("yasr-log-total-pages")};jQuery.post(ajaxurl,e,(function(e){jQuery("#yasr-user-log-container").html(e)}))}))}))}))},function(e,t){document.addEventListener("DOMContentLoaded",(function(e){if(void 0===document.getElementsByClassName("nav-tab-active")[0])return;let t=document.getElementsByClassName("nav-tab-active")[0].id;if("general_settings"===t){let e=document.getElementById("yasr_auto_insert_switch").checked,t=document.getElementById("yasr-general-options-stars-title-switch").checked,r=document.getElementById("yasr-general-options-text-before-stars-switch").checked;!1===e&&jQuery(".yasr-auto-insert-options-class").prop("disabled",!0),!1===t&&jQuery(".yasr-stars-title-options-class").prop("disabled",!0),jQuery("#yasr_auto_insert_switch").change((function(){jQuery(this).is(":checked")?jQuery(".yasr-auto-insert-options-class").prop("disabled",!1):jQuery(".yasr-auto-insert-options-class").prop("disabled",!0)})),jQuery("#yasr-general-options-stars-title-switch").change((function(){jQuery(this).is(":checked")?jQuery(".yasr-stars-title-options-class").prop("disabled",!1):jQuery(".yasr-stars-title-options-class").prop("disabled",!0)})),!1===r&&jQuery(".yasr-general-options-text-before").find(":input").prop("disabled",!0),jQuery("#yasr-general-options-text-before-stars-switch").change((function(){jQuery(this).is(":checked")?(jQuery(".yasr-general-options-text-before").find(":input").prop("disabled",!1),jQuery("#yasr-general-options-custom-text-before-overall").val("Our Score"),jQuery("#yasr-general-options-custom-text-before-visitor").val("Click to rate this post!"),jQuery("#yasr-general-options-custom-text-after-visitor").val("[Total: %total_count% Average: %average%]"),jQuery("#yasr-general-options-custom-text-must-sign-in").val("You must sign in to vote"),jQuery("#yasr-general-options-custom-text-already-rated").val("You have already voted for this article")):jQuery(".yasr-general-options-text-before").find(":input").prop("disabled",!0)})),jQuery("#yasr-doc-custom-text-link").on("click",(function(){return jQuery("#yasr-doc-custom-text-div").toggle("slow"),!1})),jQuery("#yasr-stats-explained-link").on("click",(function(){return jQuery("#yasr-stats-explained").toggle("slow"),!1}))}if("manage_multi"===t){let e=document.getElementById("n-multiset").value;if(jQuery("#yasr-multi-set-doc-link").on("click",(function(){jQuery("#yasr-multi-set-doc-box").toggle("slow")})),jQuery("#yasr-multi-set-doc-link-hide").on("click",(function(){jQuery("#yasr-multi-set-doc-box").toggle("slow")})),1===e){var r=jQuery("#yasr-edit-form-number-elements").attr("value");r++,jQuery("#yasr-add-field-edit-multiset").on("click",(function(){if(r>9)return jQuery("#yasr-element-limit").show(),jQuery("#yasr-add-field-edit-multiset").hide(),!1;var e=jQuery(document.createElement("tr"));e.html('<td colspan="2">Element #'+r+' <input type="text" name="edit-multi-set-element-'+r+'" value="" ></td>'),e.appendTo("#yasr-table-form-edit-multi-set"),r++}))}e>1&&(jQuery("#yasr-button-select-set-edit-form").on("click",(function(){var e={action:"yasr_get_multi_set",set_id:jQuery("#yasr_select_edit_set").val()};return jQuery.post(ajaxurl,e,(function(e){jQuery("#yasr-multi-set-response").show(),jQuery("#yasr-multi-set-response").html(e)})),!1})),jQuery(document).ajaxComplete((function(){var e=jQuery("#yasr-edit-form-number-elements").attr("value");e++,jQuery("#yasr-add-field-edit-multiset").on("click",(function(){if(e>9)return jQuery("#yasr-element-limit").show(),jQuery("#yasr-add-field-edit-multiset").hide(),!1;var t=jQuery(document.createElement("tr"));t.html('<td colspan="2">Element #'+e+' <input type="text" name="edit-multi-set-element-'+e+'" value="" ></td>'),t.appendTo("#yasr-table-form-edit-multi-set"),e++}))})))}"style_options"===t&&(wp.codeEditor.initialize(document.getElementById("yasr_style_options_textarea"),yasr_cm_settings),jQuery("#yasr-color-scheme-preview-link").on("click",(function(){return jQuery("#yasr-color-scheme-preview").toggle("slow"),!1}))),"migration_tools"===t&&(jQuery("#yasr-import-ratemypost-submit").on("click",(function(){document.getElementById("yasr-import-ratemypost-answer").innerHTML='<img src="'+yasrCommonDataAdmin.loaderHtml+'"</img>';var e={action:"yasr_import_ratemypost",nonce:document.getElementById("yasr-import-rmp-nonce").value};jQuery.post(ajaxurl,e,(function(e){e=JSON.parse(e),document.getElementById("yasr-import-ratemypost-answer").innerHTML=e}))})),jQuery("#yasr-import-wppr-submit").on("click",(function(){document.getElementById("yasr-import-wppr-answer").innerHTML='<img src="'+yasrCommonDataAdmin.loaderHtml+'"</img>';var e={action:"yasr_import_wppr",nonce:document.getElementById("yasr-import-wppr-nonce").value};jQuery.post(ajaxurl,e,(function(e){document.getElementById("yasr-import-wppr-answer").innerHTML=e}))})),jQuery("#yasr-import-kksr-submit").on("click",(function(){document.getElementById("yasr-import-kksr-answer").innerHTML='<img src="'+yasrCommonDataAdmin.loaderHtml+'"</img>';var e={action:"yasr_import_kksr",nonce:document.getElementById("yasr-import-kksr-nonce").value};jQuery.post(ajaxurl,e,(function(e){document.getElementById("yasr-import-kksr-answer").innerHTML=e}))})),jQuery("#yasr-import-mr-submit").on("click",(function(){document.getElementById("yasr-import-mr-answer").innerHTML='<img src="'+yasrCommonDataAdmin.loaderHtml+'"</img>';var e={action:"yasr_import_mr",nonce:document.getElementById("yasr-import-mr-nonce").value};jQuery.post(ajaxurl,e,(function(e){document.getElementById("yasr-import-mr-answer").innerHTML=e}))})))}))}]);
admin/js/yasr-editor-screen.js CHANGED
@@ -111,8 +111,9 @@ function yasrSwitchItemTypeDiv (itemType) {
111
  document.getElementById('yasr-metabox-info-snippet-container-localbusiness').style.display = 'none';
112
  document.getElementById('yasr-metabox-info-snippet-container-recipe').style.display = 'none';
113
  document.getElementById('yasr-metabox-info-snippet-container-software').style.display = 'none';
 
 
114
 
115
- //return;
116
  }
117
  else if(itemType === 'LocalBusiness') {
118
  //show main div
@@ -123,6 +124,9 @@ function yasrSwitchItemTypeDiv (itemType) {
123
  document.getElementById('yasr-metabox-info-snippet-container-product').style.display = 'none';
124
  document.getElementById('yasr-metabox-info-snippet-container-recipe').style.display = 'none';
125
  document.getElementById('yasr-metabox-info-snippet-container-software').style.display = 'none';
 
 
 
126
  }
127
  else if(itemType === 'Recipe') {
128
  //show main div
@@ -133,6 +137,8 @@ function yasrSwitchItemTypeDiv (itemType) {
133
  document.getElementById('yasr-metabox-info-snippet-container-localbusiness').style.display = 'none';
134
  document.getElementById('yasr-metabox-info-snippet-container-product').style.display = 'none';
135
  document.getElementById('yasr-metabox-info-snippet-container-software').style.display = 'none';
 
 
136
  }
137
  else if(itemType === 'SoftwareApplication') {
138
  //show main div
@@ -144,7 +150,41 @@ function yasrSwitchItemTypeDiv (itemType) {
144
  document.getElementById('yasr-metabox-info-snippet-container-recipe').style.display = 'none';
145
  document.getElementById('yasr-metabox-info-snippet-container-localbusiness').style.display = 'none';
146
  document.getElementById('yasr-metabox-info-snippet-container-product').style.display = 'none';
 
 
147
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  else {
149
  document.getElementById('yasr-metabox-info-snippet-container').style.display = 'none';
150
  }
111
  document.getElementById('yasr-metabox-info-snippet-container-localbusiness').style.display = 'none';
112
  document.getElementById('yasr-metabox-info-snippet-container-recipe').style.display = 'none';
113
  document.getElementById('yasr-metabox-info-snippet-container-software').style.display = 'none';
114
+ document.getElementById('yasr-metabox-info-snippet-container-book').style.display = 'none';
115
+ document.getElementById('yasr-metabox-info-snippet-container-movie').style.display = 'none';
116
 
 
117
  }
118
  else if(itemType === 'LocalBusiness') {
119
  //show main div
124
  document.getElementById('yasr-metabox-info-snippet-container-product').style.display = 'none';
125
  document.getElementById('yasr-metabox-info-snippet-container-recipe').style.display = 'none';
126
  document.getElementById('yasr-metabox-info-snippet-container-software').style.display = 'none';
127
+ document.getElementById('yasr-metabox-info-snippet-container-book').style.display = 'none';
128
+ document.getElementById('yasr-metabox-info-snippet-container-movie').style.display = 'none';
129
+
130
  }
131
  else if(itemType === 'Recipe') {
132
  //show main div
137
  document.getElementById('yasr-metabox-info-snippet-container-localbusiness').style.display = 'none';
138
  document.getElementById('yasr-metabox-info-snippet-container-product').style.display = 'none';
139
  document.getElementById('yasr-metabox-info-snippet-container-software').style.display = 'none';
140
+ document.getElementById('yasr-metabox-info-snippet-container-book').style.display = 'none';
141
+ document.getElementById('yasr-metabox-info-snippet-container-movie').style.display = 'none';
142
  }
143
  else if(itemType === 'SoftwareApplication') {
144
  //show main div
150
  document.getElementById('yasr-metabox-info-snippet-container-recipe').style.display = 'none';
151
  document.getElementById('yasr-metabox-info-snippet-container-localbusiness').style.display = 'none';
152
  document.getElementById('yasr-metabox-info-snippet-container-product').style.display = 'none';
153
+ document.getElementById('yasr-metabox-info-snippet-container-book').style.display = 'none';
154
+ document.getElementById('yasr-metabox-info-snippet-container-movie').style.display = 'none';
155
  }
156
+ else if(itemType === 'Book') {
157
+ //show main div
158
+ document.getElementById('yasr-metabox-info-snippet-container').style.display = '';
159
+ //show Book
160
+ document.getElementById('yasr-metabox-info-snippet-container-book').style.display = '';
161
+
162
+ //hide all childs
163
+ document.getElementById('yasr-metabox-info-snippet-container-recipe').style.display = 'none';
164
+ document.getElementById('yasr-metabox-info-snippet-container-localbusiness').style.display = 'none';
165
+ document.getElementById('yasr-metabox-info-snippet-container-product').style.display = 'none';
166
+ document.getElementById('yasr-metabox-info-snippet-container-software').style.display = 'none';
167
+ document.getElementById('yasr-metabox-info-snippet-container-movie').style.display = 'none';
168
+
169
+
170
+ }
171
+
172
+ else if(itemType === 'Movie') {
173
+ //show main div
174
+ document.getElementById('yasr-metabox-info-snippet-container').style.display = '';
175
+ //show Book
176
+ document.getElementById('yasr-metabox-info-snippet-container-movie').style.display = '';
177
+
178
+ //hide all childs
179
+ document.getElementById('yasr-metabox-info-snippet-container-recipe').style.display = 'none';
180
+ document.getElementById('yasr-metabox-info-snippet-container-localbusiness').style.display = 'none';
181
+ document.getElementById('yasr-metabox-info-snippet-container-product').style.display = 'none';
182
+ document.getElementById('yasr-metabox-info-snippet-container-software').style.display = 'none';
183
+ document.getElementById('yasr-metabox-info-snippet-container-book').style.display = 'none';
184
+
185
+
186
+ }
187
+
188
  else {
189
  document.getElementById('yasr-metabox-info-snippet-container').style.display = 'none';
190
  }
admin/settings/aspect_style/yasr-settings-functions-style.php CHANGED
@@ -79,21 +79,18 @@ function yasr_style_section_callback() {
79
 
80
 
81
  function yasr_color_scheme_multiset_callback($style_options) {
82
- ?>
83
-
84
- <input type='radio' name='yasr_style_options[scheme_color_multiset]' value='light'
85
- class='yasr-general-options-scheme-color' <?php if ($style_options['scheme_color_multiset'] === 'light') {
86
- echo " checked=\"checked\" ";
87
- } ?> />
88
- <?php _e('Light', 'yet-another-stars-rating') ?>
89
 
 
 
 
 
 
 
 
 
90
 
91
- <input type='radio' name='yasr_style_options[scheme_color_multiset]' value='dark'
92
- class='yasr-general-options-scheme-color' <?php if ($style_options['scheme_color_multiset'] === 'dark') {
93
- echo " checked=\"checked\" ";
94
- } ?> />
95
- <?php _e('Dark', 'yet-another-stars-rating') ?>
96
- <br/>
97
 
98
  <br/>
99
 
79
 
80
 
81
  function yasr_color_scheme_multiset_callback($style_options) {
 
 
 
 
 
 
 
82
 
83
+ $array_options = array (
84
+ 'light' => __('Light', 'yet-another-stars-rating-pro'),
85
+ 'dark' => __('Dark', 'yasr-yet-another-stars-rating')
86
+ );
87
+ $default = $style_options['scheme_color_multiset'];
88
+ $name = 'yasr_style_options[scheme_color_multiset]';
89
+ $class = 'yasr-general-options-scheme-color';
90
+ $id = 'yasr-style-options-color-scheme';
91
 
92
+ echo YasrPhpFieldsHelper::radio('', $class, $array_options, $name, $default, $id);
93
+ ?>
 
 
 
 
94
 
95
  <br/>
96
 
admin/settings/classes/YasrSettings.php ADDED
@@ -0,0 +1,1023 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+
5
+ Copyright 2014 Dario Curvino (email : d.curvino@tiscali.it)
6
+
7
+ This program is free software: you can redistribute it and/or modify
8
+ it under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation, either version 2 of the License, or
10
+ (at your option) any later version.
11
+
12
+ This program is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with this program. If not, see <http://www.gnu.org/licenses/>
19
+ */
20
+
21
+ if (!defined('ABSPATH')) {
22
+ exit('You\'re not allowed to see this page');
23
+ } // Exit if accessed directly
24
+
25
+
26
+ /**
27
+ * @since 2.4.7
28
+ *
29
+ * Setting screen
30
+ *
31
+ * Class YasrSettings
32
+ */
33
+ class YasrSettings {
34
+ /**
35
+ * Init Settings
36
+ */
37
+ public function init () {
38
+ add_action('admin_init', array($this, 'generalOptions')); //This is for general options
39
+
40
+ //include multiset functions
41
+ require(YASR_ABSOLUTE_PATH_ADMIN . '/settings/multiset/yasr-settings-functions-multiset.php');
42
+
43
+ //include style functions
44
+ require(YASR_ABSOLUTE_PATH_ADMIN . '/settings/aspect_style/yasr-settings-functions-style.php');
45
+
46
+ //load functions migration
47
+ require(YASR_ABSOLUTE_PATH_ADMIN . '/settings/migrations/yasr-settings-migration-functions.php');
48
+ }
49
+
50
+ /**
51
+ * Load general options
52
+ */
53
+ public function generalOptions() {
54
+ register_setting(
55
+ 'yasr_general_options_group', // A settings group name. Must exist prior to the register_setting call. This must match the group name in settings_fields()
56
+ 'yasr_general_options', //The name of an option to sanitize and save.
57
+ array($this, 'sanitize')
58
+ );
59
+
60
+ $option = get_option('yasr_general_options');
61
+
62
+ //This is to avoid undefined offset
63
+ if ($option && $option['auto_insert_enabled'] === 0) {
64
+ $option['auto_insert_what'] = 'visitor_rating';
65
+ $option['auto_insert_where'] = 'bottom';
66
+ $option['auto_insert_align'] = 'center';
67
+ $option['auto_insert_exclude_pages'] = 'yes';
68
+ $option['auto_insert_size'] = 'large';
69
+ $option['auto_insert_custom_post_only'] = 'no';
70
+ }
71
+
72
+ if ($option && $option['stars_title'] === 'no') {
73
+ $option['stars_title_what'] = 'visitor_rating';
74
+ $option['stars_title_exclude_pages'] = 'yes';
75
+ $option['stars_title_where'] = 'archive';
76
+ }
77
+
78
+ //This is to avoid undefined offset
79
+ if ($option && $option['text_before_stars'] === 0) {
80
+ $option['text_before_overall'] = __('Our Score', 'yet-another-stars-rating');
81
+ $option['text_before_visitor_rating'] = __('Click to rate this post!', 'yet-another-stars-rating');
82
+ $option['text_after_visitor_rating'] = sprintf(
83
+ __('[Total: %s Average: %s]', 'yet-another-stars-rating'),
84
+ '%total_count%', '%average%'
85
+ );
86
+ $option['custom_text_user_voted'] = __('You have already voted for this article', 'yet-another-stars-rating');
87
+ $option['custom_text_must_sign_in'] = __('You must sign in to vote', 'yet-another-stars-rating');
88
+ }
89
+
90
+ //Avoid undefined
91
+ if (!isset($option['publisher'])) {
92
+ $option['publisher'] = 'Organization';
93
+ }
94
+
95
+ if (!isset($option['publisher_name'])) {
96
+ $option['publisher_name'] = get_bloginfo('name');
97
+ }
98
+
99
+ if (!isset($option['publisher_logo'])) {
100
+ $option['publisher_logo'] = get_site_icon_url();
101
+ }
102
+
103
+ if(!isset($option['enable_ajax'])) {
104
+ $option['enable_ajax'] = 'no';
105
+ }
106
+
107
+ $description_auto_insert = sprintf(
108
+ __('Auto Insert Options %s
109
+ Automatically adds YASR in your posts or pages. %s
110
+ Disable this if you prefer to use shortcodes.',
111
+ 'yet-another-stars-rating'
112
+ ),
113
+ '<p>&nbsp;</p>', '<br />'
114
+ );
115
+
116
+ add_settings_section(
117
+ 'yasr_general_options_section_id',
118
+ __('General settings', 'yet-another-stars-rating'),
119
+ array($this, 'sectionCallback'),
120
+ 'yasr_general_settings_tab'
121
+ );
122
+
123
+ add_settings_field(
124
+ 'yasr_use_auto_insert_id',
125
+ $description_auto_insert,
126
+ array($this, 'autoInsert'),
127
+ 'yasr_general_settings_tab',
128
+ 'yasr_general_options_section_id',
129
+ $option
130
+ );
131
+
132
+ add_settings_field(
133
+ 'yasr_stars_title',
134
+ __('Enable stars next to the title?', 'yet-another-stars-rating'),
135
+ array($this, 'starsTitle'),
136
+ 'yasr_general_settings_tab',
137
+ 'yasr_general_options_section_id',
138
+ $option
139
+ );
140
+
141
+ add_settings_field(
142
+ 'yasr_custom_text',
143
+ __('Insert custom text to show before / after stars', 'yet-another-stars-rating'),
144
+ array($this, 'customText'),
145
+ 'yasr_general_settings_tab',
146
+ 'yasr_general_options_section_id',
147
+ $option
148
+ );
149
+
150
+ add_settings_field(
151
+ 'yasr_visitors_stats',
152
+ __('Do you want show stats for visitors votes?', 'yet-another-stars-rating'),
153
+ array($this, 'vvStats'),
154
+ 'yasr_general_settings_tab',
155
+ 'yasr_general_options_section_id',
156
+ $option
157
+ );
158
+
159
+ add_settings_field(
160
+ 'yasr_allow_only_logged_in_id',
161
+ __('Allow only logged in user to vote?', 'yet-another-stars-rating'),
162
+ array($this, 'loggedOnly'),
163
+ 'yasr_general_settings_tab',
164
+ 'yasr_general_options_section_id',
165
+ $option
166
+ );
167
+
168
+ add_settings_field(
169
+ 'yasr_show_overall_in_loop',
170
+ __('Show "Overall Rating" in Archive Page?', 'yet-another-stars-rating'),
171
+ array($this, 'OverallInLoop'),
172
+ 'yasr_general_settings_tab',
173
+ 'yasr_general_options_section_id',
174
+ $option
175
+ );
176
+
177
+ add_settings_field(
178
+ 'yasr_show_visitor_votes_in_loop',
179
+ __('Show "Visitor Votes" in Archive Page?', 'yet-another-stars-rating'),
180
+ array($this, 'vvInLoop'),
181
+ 'yasr_general_settings_tab',
182
+ 'yasr_general_options_section_id',
183
+ $option
184
+ );
185
+
186
+ add_settings_field(
187
+ 'yasr_choose_snippet_id',
188
+ __('Rich snippet options', 'yet-another-stars-rating'),
189
+ array($this, 'snippets' ),
190
+ 'yasr_general_settings_tab',
191
+ 'yasr_general_options_section_id',
192
+ $option
193
+ );
194
+
195
+ add_settings_field(
196
+ 'yasr_load_with_ajax',
197
+ __('Load results with AJAX', 'yet-another-stars-rating'),
198
+ array($this, 'loadWithAjax' ),
199
+ 'yasr_general_settings_tab',
200
+ 'yasr_general_options_section_id',
201
+ $option
202
+ );
203
+
204
+ add_settings_field(
205
+ 'yasr_enable_ip',
206
+ __('Do you want to save ip address?', 'yet-another-stars-rating'),
207
+ array($this, 'EnableIp'),
208
+ 'yasr_general_settings_tab',
209
+ 'yasr_general_options_section_id',
210
+ $option
211
+ );
212
+ }
213
+
214
+ /**
215
+ * @return void
216
+ */
217
+ public function sectionCallback() {
218
+ return;
219
+ }
220
+
221
+ /**
222
+ * Display options for Auto insert
223
+ *
224
+ * @param $option
225
+ */
226
+ public function autoInsert($option) {
227
+ ?>
228
+ <div>
229
+ <strong><?php _e('Use Auto Insert?', 'yet-another-stars-rating'); ?></strong>
230
+ <div class="yasr-onoffswitch-big">
231
+ <input type="checkbox" name="yasr_general_options[auto_insert_enabled]" class="yasr-onoffswitch-checkbox"
232
+ value="1" id="yasr_auto_insert_switch" <?php if ($option['auto_insert_enabled'] == 1) {
233
+ echo " checked='checked' ";
234
+ } ?> >
235
+ <label class="yasr-onoffswitch-label" for="yasr_auto_insert_switch">
236
+ <span class="yasr-onoffswitch-inner"></span>
237
+ <span class="yasr-onoffswitch-switch"></span>
238
+ </label>
239
+ </div>
240
+
241
+ <p>&nbsp;</p>
242
+
243
+ <div>
244
+ <?php
245
+ $option_title = __('What?', 'yet-another-stars-rating');
246
+ $array_options = array (
247
+ 'visitor_rating' => __('Visitor Votes', 'yet-another-stars-rating'),
248
+ 'overall_rating' => __('Overall Rating / Author Rating', 'yet-another-stars-rating'),
249
+ 'both' => __('Both', 'yet-another-stars-rating')
250
+ );
251
+ $default = $option['auto_insert_what'];
252
+ $name = 'yasr_general_options[auto_insert_what]';
253
+ $class = 'yasr-auto-insert-options-class';
254
+
255
+ echo YasrPhpFieldsHelper::radio( $option_title, $class, $array_options, $name, $default );
256
+ ?>
257
+ </div>
258
+
259
+ <p>&nbsp;</p>
260
+
261
+ <div>
262
+ <?php
263
+ $option_title = __('Where?', 'yet-another-stars-rating');
264
+ $array_options = array (
265
+ 'top' => __('Before the content', 'yet-another-stars-rating'),
266
+ 'bottom' => __('After the content', 'yet-another-stars-rating'),
267
+ );
268
+ $default = $option['auto_insert_where'];
269
+ $name = 'yasr_general_options[auto_insert_where]';
270
+ $class = 'yasr-auto-insert-options-class';
271
+
272
+ echo YasrPhpFieldsHelper::radio( $option_title, $class, $array_options, $name, $default );
273
+ ?>
274
+ </div>
275
+
276
+ <p>&nbsp;</p>
277
+
278
+ <div>
279
+ <?php
280
+ $option_title = __('Align', 'yet-another-stars-rating');
281
+ $array_options = array (
282
+ 'left' => __('Left', 'yet-another-stars-rating'),
283
+ 'center' => __('Center', 'yet-another-stars-rating'),
284
+ 'right' => __('Right', 'yet-another-stars-rating')
285
+ );
286
+ $default = $option['auto_insert_align'];
287
+ $name = 'yasr_general_options[auto_insert_align]';
288
+ $class = 'yasr-auto-insert-options-class';
289
+
290
+ echo YasrPhpFieldsHelper::radio($option_title, $class, $array_options, $name, $default);
291
+ ?>
292
+ </div>
293
+
294
+ <p>&nbsp;</p>
295
+
296
+ <div class="yasr-indented-answer">
297
+ <strong><?php _e('Size', 'yet-another-stars-rating'); ?></strong>
298
+ <?php
299
+ $name = 'yasr_general_options[auto_insert_size]';
300
+ $class = 'yasr-auto-insert-options-class';
301
+ $id = 'yasr-auto-insert-options-stars-size-';
302
+
303
+ YasrPhpFieldsHelper::radioSelectSize($name, $class, $option['auto_insert_size'], $id);
304
+ ?>
305
+ </div>
306
+
307
+ <p>&nbsp;</p>
308
+ <div>
309
+ <?php
310
+ $option_title = __('Exclude Pages?', 'yet-another-stars-rating');
311
+ $array_options = array (
312
+ 'yes' => __('Yes', 'yet-another-stars-rating'),
313
+ 'no' => __('No', 'yet-another-stars-rating'),
314
+ );
315
+ $default = $option['auto_insert_exclude_pages'];
316
+ $name = 'yasr_general_options[auto_insert_exclude_pages]';
317
+ $class = 'yasr-auto-insert-options-class';
318
+
319
+ echo YasrPhpFieldsHelper::radio( $option_title, $class, $array_options, $name, $default );
320
+ ?>
321
+ <p>&nbsp;</p>
322
+ </div>
323
+
324
+ <?php
325
+
326
+ $custom_post_types = YasrCustomPostTypes::getCustomPostTypes();
327
+
328
+ if ($custom_post_types) {
329
+
330
+ echo '<div>';
331
+
332
+ $option_title = __('Use only in custom post types?', 'yet-another-stars-rating');
333
+ $array_options = array (
334
+ 'yes' => __('Yes', 'yet-another-stars-rating'),
335
+ 'no' => __('No', 'yet-another-stars-rating'),
336
+ );
337
+ $default = $option['auto_insert_custom_post_only'];
338
+ $name = 'yasr_general_options[auto_insert_custom_post_only]';
339
+ $class = 'yasr-auto-insert-options-class';
340
+
341
+ echo YasrPhpFieldsHelper::radio( $option_title, $class, $array_options, $name, $default );
342
+
343
+ echo '</div>';
344
+ ?>
345
+ <p>
346
+
347
+ <div class="yasr-indented-answer">
348
+ <?php _e("You see this because you use custom post types.", 'yet-another-stars-rating'); ?>
349
+ <br/>
350
+ <?php _e("If you want to use auto insert only in custom post types, choose Yes", 'yet-another-stars-rating'); ?>
351
+ </div>
352
+ <p>&nbsp;</p>
353
+
354
+ <?php
355
+ }
356
+
357
+ else {
358
+ ?>
359
+ <input type="hidden" name="yasr_general_options[auto_insert_custom_post_only]" value="no">
360
+ <?php
361
+ }
362
+
363
+ submit_button(YASR_SAVE_All_SETTINGS_TEXT);
364
+ ?>
365
+
366
+ </div>
367
+
368
+ <hr />
369
+
370
+ <?php
371
+
372
+ } //End yasr_auto_insert_callback
373
+
374
+ /**
375
+ * Display options for stars near title
376
+ *
377
+ * @param $option
378
+ */
379
+ public function starsTitle($option) {
380
+ ?>
381
+ <div class="yasr-onoffswitch-big">
382
+ <input type="checkbox" name="yasr_general_options[stars_title]" class="yasr-onoffswitch-checkbox"
383
+ id="yasr-general-options-stars-title-switch" <?php if ($option['stars_title'] === 'yes') {
384
+ echo " checked='checked' ";
385
+ } ?> >
386
+ <label class="yasr-onoffswitch-label" for="yasr-general-options-stars-title-switch">
387
+ <span class="yasr-onoffswitch-inner"></span>
388
+ <span class="yasr-onoffswitch-switch"></span>
389
+ </label>
390
+ </div>
391
+
392
+ <br/>
393
+
394
+ <div>
395
+ <?php
396
+ $option_title = __('What?', 'yet-another-stars-rating');
397
+ $array_options = array (
398
+ 'visitor_rating' => __('Visitor Votes', 'yet-another-stars-rating'),
399
+ 'overall_rating' => __('Overall Rating / Author Rating', 'yet-another-stars-rating'),
400
+ );
401
+ $default = $option['stars_title_what'];
402
+ $name = 'yasr_general_options[stars_title_what]';
403
+ $class = 'yasr-stars-title-options-class';
404
+
405
+ echo YasrPhpFieldsHelper::radio( $option_title, $class, $array_options, $name, $default );
406
+ ?>
407
+ </div>
408
+
409
+ <br />
410
+
411
+ <div>
412
+ <?php
413
+ $option_title = __('Exclude Pages?', 'yet-another-stars-rating');
414
+ $array_options = array (
415
+ 'yes' => __('Yes', 'yet-another-stars-rating'),
416
+ 'no' => __('No', 'yet-another-stars-rating'),
417
+ );
418
+ $default = $option['stars_title_exclude_pages'];
419
+ $name = 'yasr_general_options[stars_title_exclude_pages]';
420
+ $class = 'yasr-stars-title-options-class';
421
+
422
+ echo YasrPhpFieldsHelper::radio( $option_title, $class, $array_options, $name, $default );
423
+ ?>
424
+ </div>
425
+
426
+ <p>&nbsp;</p>
427
+
428
+ <div>
429
+ <?php
430
+ $option_title = __('Where do you want show ratings?', 'yet-another-stars-rating');
431
+ $array_options = array (
432
+ 'archive' => __('Only on archive pages (categories, tags, etc.)', 'yet-another-stars-rating'),
433
+ 'single' => __('Only on single posts or pages', 'yet-another-stars-rating'),
434
+ 'both' => __('Both', 'yet-another-stars-rating'),
435
+ );
436
+ $default = $option['stars_title_where'];
437
+ $name = 'yasr_general_options[stars_title_where]';
438
+ $class = 'yasr-stars-title-options-class';
439
+
440
+ echo YasrPhpFieldsHelper::radio( $option_title, $class, $array_options, $name, $default );
441
+ ?>
442
+ </div>
443
+
444
+ <p>&nbsp;</p>
445
+ <hr />
446
+
447
+ <?php
448
+
449
+ }
450
+
451
+ public function customText($option) {
452
+ ?>
453
+ <div class="yasr-onoffswitch-big">
454
+ <input type="checkbox" name="yasr_general_options[text_before_stars]" class="yasr-onoffswitch-checkbox"
455
+ id="yasr-general-options-text-before-stars-switch" <?php if ($option['text_before_stars'] == 1) {
456
+ echo " checked='checked' ";
457
+ } ?> >
458
+ <label class="yasr-onoffswitch-label" for="yasr-general-options-text-before-stars-switch">
459
+ <span class="yasr-onoffswitch-inner"></span>
460
+ <span class="yasr-onoffswitch-switch"></span>
461
+ </label>
462
+ </div>
463
+
464
+ <br/> <br/>
465
+
466
+ <?php
467
+ $custom_text = array(
468
+ 'txt_before_overall' => array (
469
+ 'name' => 'text_before_overall',
470
+ 'description' => __('Custom text to display before Overall Rating', 'yet-another-stars-rating'),
471
+ 'id' => 'yasr-general-options-custom-text-before-overall',
472
+ 'class' => 'yasr-general-options-text-before'
473
+ ),
474
+ 'txt_before_vv' => array (
475
+ 'name' => 'text_before_visitor_rating',
476
+ 'description' => __('Custom text to display BEFORE Visitor Rating', 'yet-another-stars-rating'),
477
+ 'id' => 'yasr-general-options-custom-text-before-visitor',
478
+ 'class' => 'yasr-general-options-text-before'
479
+ ),
480
+ 'txt_after_vv' => array (
481
+ 'name' => 'text_after_visitor_rating',
482
+ 'description' => __('Custom text to display AFTER Visitor Rating', 'yet-another-stars-rating'),
483
+ 'id' => 'yasr-general-options-custom-text-after-visitor',
484
+ 'class' => 'yasr-general-options-text-before'
485
+ ),
486
+ 'txt_login_required' => array (
487
+ 'name' => 'custom_text_must_sign_in',
488
+ 'description' => __('Custom text to display when login is required to vote', 'yet-another-stars-rating'),
489
+ 'id' => 'yasr-general-options-custom-text-must-sign-in',
490
+ 'class' => 'yasr-general-options-text-before'
491
+ ),
492
+ 'txt_vv_rated' => array (
493
+ 'name' => 'custom_text_user_voted',
494
+ 'description' => __('Custom text to display when an user has already rated', 'yet-another-stars-rating'),
495
+ 'id' => 'yasr-general-options-custom-text-already-rated',
496
+ 'class' => 'yasr-general-options-text-before'
497
+ )
498
+ );
499
+
500
+ ?>
501
+ <div id="yasr-general-options-custom-text">
502
+ <?php
503
+ self::echoSettingFields($custom_text, $option);
504
+ ?>
505
+ </div>
506
+
507
+
508
+ <a href="#" id="yasr-doc-custom-text-link"><?php _e('Help', 'yet-another-stars-rating'); ?></a>
509
+
510
+ <div id="yasr-doc-custom-text-div" class="yasr-help-box-settings">
511
+ <?php
512
+ $string_custom_overall = sprintf(__('In the first field you can use %s pattern to show the overall rating (as text).',
513
+ 'yet-another-stars-rating'), '<strong>%overall_rating%</strong>');
514
+
515
+ $string_custom_visitor = sprintf(__('In the second and third fields you can use %s pattern to show the
516
+ total count, and %s pattern to show the average', 'yet-another-stars-rating'),
517
+ '<strong>%total_count%</strong>', '<strong>%average%</strong>');
518
+
519
+ echo $string_custom_overall;
520
+ echo '<br /><br/>';
521
+ echo $string_custom_visitor;
522
+ echo '<br /><br/>';
523
+
524
+ _e('You can use these html tags:', 'yet-another-stars-rating');
525
+ echo ' <strong>' . esc_html('<strong>, <p>') . '.</strong>';
526
+ ?>
527
+ </div>
528
+
529
+ <p>&nbsp;</p>
530
+
531
+ <?php
532
+ submit_button(YASR_SAVE_All_SETTINGS_TEXT);
533
+ echo '<hr />';
534
+
535
+ }
536
+
537
+ public function vvStats($option) {
538
+ ?>
539
+ <div class="yasr-onoffswitch-big">
540
+ <input type="checkbox" name="yasr_general_options[visitors_stats]" class="yasr-onoffswitch-checkbox"
541
+ id="yasr-general-options-visitors-stats-switch" <?php if ($option['visitors_stats'] === 'yes') {
542
+ echo " checked='checked' ";
543
+ } ?> >
544
+ <label class="yasr-onoffswitch-label" for="yasr-general-options-visitors-stats-switch">
545
+ <span class="yasr-onoffswitch-inner"></span>
546
+ <span class="yasr-onoffswitch-switch"></span>
547
+ </label>
548
+ </div>
549
+
550
+ <br/>
551
+
552
+ <?php
553
+ _e('Enable or disable the chart bar icon (and tooltip hover it) near the yasr_visitor_votes shortcode.');
554
+ ?>
555
+
556
+ <p>&nbsp;</p>
557
+
558
+ <a href="#" id="yasr-stats-explained-link"><?php _e("Example", 'yet-another-stars-rating') ?></a>
559
+
560
+ <div id="yasr-stats-explained" class="yasr-help-box-settings">
561
+ <?php
562
+ echo '<strong>';
563
+ _e('ENABLED:', 'yet-another-stars-rating');
564
+ echo "</strong>
565
+ <hr />
566
+ <img src=" . YASR_IMG_DIR . "yasr_settings_stats_enabled.png alt='yasr-stats-enabled'>";
567
+
568
+ echo '<br /><br /><strong>';
569
+ _e('DISABLED:', 'yet-another-stars-rating');
570
+ echo "</strong>
571
+ <hr />
572
+ <img src=" . YASR_IMG_DIR . "yasr_settings_stats_disabled.png alt='yasr-stats-disabled'>";
573
+ ?>
574
+ </div>
575
+
576
+ <p>&nbsp;</p>
577
+
578
+ <hr>
579
+
580
+ <?php
581
+
582
+ }
583
+
584
+ public function loggedOnly($option) {
585
+
586
+ $array_options = array(
587
+ 'logged_only' => __('Allow only logged-in users', 'yet-another-stars-rating' ),
588
+ 'allow_anonymous' => __('Allow everybody (logged in and anonymous)', 'yet-another-stars-rating' ),
589
+ );
590
+ $default = $option['allowed_user'];
591
+ $name = 'yasr_general_options[allowed_user]';
592
+ $class = 'yasr_auto_insert_loggedonly';
593
+
594
+ echo YasrPhpFieldsHelper::radio( false, $class, $array_options, $name, $default );
595
+ ?>
596
+
597
+ <br />
598
+ <div class="yasr-indented-answer">
599
+ <?php
600
+ _e(
601
+ 'Select who can rate your posts for yasr_visitor_votes and yasr_visitor_multiset shortcodes.',
602
+ 'yet-another-stars-rating')
603
+ ?>
604
+ </div>
605
+
606
+ <?php
607
+ submit_button(YASR_SAVE_All_SETTINGS_TEXT);
608
+ ?>
609
+
610
+ <hr>
611
+
612
+ <?php
613
+
614
+ } //End function
615
+
616
+ public function OverallInLoop($option) {
617
+ ?>
618
+
619
+ <div class="yasr-onoffswitch-big">
620
+ <input type="checkbox" name="yasr_general_options[show_overall_in_loop]" class="yasr-onoffswitch-checkbox"
621
+ id="yasr-show-overall-in-loop-switch" <?php if($option['show_overall_in_loop'] === 'enabled') {
622
+ echo " checked='checked' ";
623
+ } ?> >
624
+ <label class="yasr-onoffswitch-label" for="yasr-show-overall-in-loop-switch">
625
+ <span class="yasr-onoffswitch-inner"></span>
626
+ <span class="yasr-onoffswitch-switch"></span>
627
+ </label>
628
+ </div>
629
+
630
+ <br/>
631
+
632
+ <?php _e('"Overall Rating" will be also shown in archive page (categories, tags, etc.)',
633
+ 'yet-another-stars-rating') ?>
634
+
635
+ <p>&nbsp;</p>
636
+
637
+ <?php
638
+
639
+ }
640
+
641
+ public function vvInLoop($option) {
642
+
643
+ ?>
644
+
645
+ <div class="yasr-onoffswitch-big">
646
+ <input type="checkbox" name="yasr_general_options[show_visitor_votes_in_loop]" class="yasr-onoffswitch-checkbox"
647
+ id="yasr-show-visitor-votes-in-loop-switch" <?php if ($option['show_visitor_votes_in_loop'] === 'enabled') {
648
+ echo " checked='checked' ";
649
+ } ?> >
650
+ <label class="yasr-onoffswitch-label" for="yasr-show-visitor-votes-in-loop-switch">
651
+ <span class="yasr-onoffswitch-inner"></span>
652
+ <span class="yasr-onoffswitch-switch"></span>
653
+ </label>
654
+ </div>
655
+
656
+ <br/>
657
+
658
+ <?php _e('If you enable this, "Visitor Votes" will be showed not only in the single article or page, but also
659
+ in pages like Home Page, category pages or archives.',
660
+ 'yet-another-stars-rating') ?>
661
+
662
+ <p>&nbsp;</p>
663
+
664
+ <hr>
665
+
666
+ <?php
667
+
668
+ }
669
+
670
+ public function snippets($option) {
671
+
672
+ $publisher_name = $option['publisher_name'];
673
+ $publisher_logo = $option['publisher_logo'];
674
+
675
+ ?>
676
+
677
+ <strong>
678
+ <?php _e('Select default itemType for all post or pages', 'yet-another-stars-rating'); ?>
679
+ </strong>
680
+
681
+ <div class="yasr-indented-answer" id="yasr-choose-snippet-type">
682
+ <?php
683
+ $review_types = json_decode(YASR_SUPPORTED_SCHEMA_TYPES);
684
+ sort($review_types);
685
+ ?>
686
+ <label for="yasr-choose-reviews-types-list">
687
+ <select name="yasr_general_options[snippet_itemtype]" id="yasr-choose-reviews-types-list">
688
+ <?php
689
+ foreach ($review_types as $type) {
690
+ $type = trim($type);
691
+ $type_option = $type;
692
+ //to keep compatibility with version <2.2.3
693
+ if($type === 'Place') {
694
+ $type_option='LocalBusiness';
695
+ }
696
+ //to keep compatibility with version <2.2.3
697
+ if($type === 'Other') {
698
+ $type_option='BlogPosting';
699
+ }
700
+
701
+ if ($option['snippet_itemtype'] === $type) {
702
+ echo "<option value=\"$type\" selected>$type_option</option>";
703
+ } else {
704
+ echo "<option value=\"$type\">$type_option</option>";
705
+ }
706
+ }
707
+ ?>
708
+ </select>
709
+ </label>
710
+
711
+ <br/> <br/>
712
+
713
+ <?php
714
+ $option_title = __(' Choose whether the site represents an organization or a person.', 'yet-another-stars-rating');
715
+ $array_options = array (
716
+ 'Organization' => 'Organization',
717
+ 'Person' => 'Person'
718
+ );
719
+ $default = $option['publisher'];
720
+ $name = 'yasr_general_options[publisher]';
721
+ $id = 'yasr-general-options-publisher';
722
+
723
+ echo YasrPhpFieldsHelper::radio( $option_title, '', $array_options, $name, $default, $id );
724
+ ?>
725
+
726
+ <br/>
727
+
728
+ <label for="yasr-general-options-publisher-name">
729
+ <input type='text' name='yasr_general_options[publisher_name]'
730
+ id="yasr-general-options-publisher-name"
731
+ class="yasr-additional-info-inputs" <?php printf('value="%s"', $publisher_name); ?>
732
+ maxlength="180"/>
733
+ <?php _e('Publisher name (e.g. Google)', 'yet-another-stars-rating') ?>
734
+ </label>
735
+
736
+ <br/> <br/>
737
+
738
+ <label for="yasr-general-options-publisher-logo"></label>
739
+ <input type='text' name='yasr_general_options[publisher_logo]'
740
+ id="yasr-general-options-publisher-logo"
741
+ class="yasr-blogPosting-additional-info-inputs"
742
+ <?php printf('value="%s"', $publisher_logo); ?>
743
+ maxlength="300"/>
744
+ <?php _e('Image Url (if empty siteicon will be used instead)', 'yet-another-stars-rating') ?>
745
+
746
+ <div class="yasr-help-box-settings" id="yasr-blogPosting-additional-info" style="display:block">
747
+ <?php _e('You can always change itemType in the single post or page.', 'yet-another-stars-rating');
748
+
749
+ echo "<br />";
750
+
751
+ echo(sprintf(
752
+ __('Please keep in mind that since September, 16, 2019 blogPosting itemType will
753
+ no show stars in SERP anymore. %sHere%s the announcement by Google.',
754
+ 'yet-another-stars-rating'),
755
+ '<a href="https://webmasters.googleblog.com/2019/09/making-review-rich-results-more-helpful.html">',
756
+ '</a>')
757
+ );
758
+
759
+ echo "<br />";
760
+ echo (sprintf(
761
+ __('Also, %sread Google guidelines%s', 'yet-another-stars-rating'),
762
+ '<a href="https://developers.google.com/search/docs/data-types/review-snippet#guidelines">',
763
+ '</a>')
764
+ );
765
+
766
+ ?>
767
+
768
+ </div>
769
+
770
+ <p>&nbsp;</p>
771
+
772
+ <?php
773
+ submit_button(YASR_SAVE_All_SETTINGS_TEXT);
774
+ ?>
775
+
776
+ </div>
777
+
778
+ <hr />
779
+
780
+ <p>&nbsp;</p>
781
+
782
+ <?php
783
+
784
+ } //End function yasr_choose_snippet_callback
785
+
786
+ public function loadWithAjax($option) {
787
+ ?>
788
+
789
+ <div class="yasr-onoffswitch-big">
790
+ <input type="checkbox" name="yasr_general_options[enable_ajax]" class="yasr-onoffswitch-checkbox"
791
+ id="yasr-general-options-enable-ajax-switch" <?php if ($option['enable_ajax'] === 'yes') {
792
+ echo " checked='checked' ";
793
+ } ?> >
794
+ <label class="yasr-onoffswitch-label" for="yasr-general-options-enable-ajax-switch">
795
+ <span class="yasr-onoffswitch-inner"></span>
796
+ <span class="yasr-onoffswitch-switch"></span>
797
+ </label>
798
+ </div>
799
+
800
+ <br/>
801
+
802
+ <?php
803
+ _e('This should be enabled if you\'re using caching plugins.
804
+ Not required for yasr_overall_rating and yasr_multiset.',
805
+ 'yet-another-stars-rating'
806
+ );
807
+ ?>
808
+
809
+ <br/><p>&nbsp;</p>
810
+
811
+ <hr>
812
+
813
+ <?php
814
+
815
+ } //End function
816
+
817
+ public function EnableIp($option) {
818
+ ?>
819
+ <div class="yasr-onoffswitch-big">
820
+ <input type="checkbox" name="yasr_general_options[enable_ip]" class="yasr-onoffswitch-checkbox"
821
+ id="yasr-general-options-enable-ip-switch" <?php if ($option['enable_ip'] === 'yes') {
822
+ echo " checked='checked' ";
823
+ } ?> >
824
+ <label class="yasr-onoffswitch-label" for="yasr-general-options-enable-ip-switch">
825
+ <span class="yasr-onoffswitch-inner"></span>
826
+ <span class="yasr-onoffswitch-switch"></span>
827
+ </label>
828
+ </div>
829
+
830
+ <br/>
831
+
832
+ <?php
833
+ $string = sprintf(
834
+ __('Please note that to comply with the %s EU law, you %s MUST %s warn your users that you\'re storing their ip. %s
835
+ If in doubt, leave no.',
836
+ 'yet-another-stars-rating'
837
+ ),
838
+ '<a href="https://en.wikipedia.org/wiki/General_Data_Protection_Regulation">GDPR</a>',
839
+ '<strong>', '</strong>', '<br />'
840
+ );
841
+ echo $string;
842
+ ?>
843
+ <p></p>
844
+ <?php
845
+
846
+ } //End function
847
+
848
+ public function sanitize($option) {
849
+
850
+ //Array to return
851
+ $output = array();
852
+
853
+ $tidy_installed = false;
854
+
855
+ if (extension_loaded('tidy')) {
856
+ $tidy_release_date = strtotime(tidy_get_release());
857
+ $tidy_working_release_date = strtotime('2017/11/25');
858
+
859
+ if ($tidy_release_date >= $tidy_working_release_date) {
860
+ $tidy_installed = true;
861
+ }
862
+ }
863
+
864
+ // Loop through each of the incoming options
865
+ foreach ($option as $key => $value) {
866
+ // Check to see if the current option has a value. If so, process it.
867
+ if (isset($option[$key])) {
868
+
869
+ //Tags are not allowed for any fields
870
+ $allowed_tags = '';
871
+
872
+ //except these ones
873
+ if ($key === 'text_before_overall' || $key === 'text_before_visitor_rating' ||
874
+ $key === 'text_after_visitor_rating' || $key === 'custom_text_must_sign_in' ||
875
+ $key === 'custom_text_user_voted') {
876
+
877
+ $allowed_tags = '<strong><p>';
878
+
879
+ // handle quoted strings and allow some tags
880
+ $output[$key] = strip_tags(stripslashes($option[$key]), $allowed_tags);
881
+
882
+ //if tidy extension is enabled, fix errors in html
883
+ if ($tidy_installed === true) {
884
+ $tidy = new Tidy();
885
+ $output[$key] = $tidy->repairString($output[$key], array('show-body-only' => true));
886
+ }
887
+
888
+ }
889
+ else {
890
+ // handle quoted strings and allow no tags
891
+ $output[$key] = strip_tags(stripslashes($option[$key]), $allowed_tags);
892
+ }
893
+
894
+ //Always use esc_html
895
+ $output[$key] = esc_html($output[$key]);
896
+
897
+ if ($key === 'publisher_logo') {
898
+ //if is not a valid url get_site_icon_url instead
899
+ if (filter_var($value, FILTER_VALIDATE_URL) === false) {
900
+ $output[$key] = get_site_icon_url();
901
+ }
902
+ }
903
+
904
+ } // end if
905
+
906
+ } // end foreach
907
+
908
+
909
+ /** The following steps are needed to avoid undefined index if a setting is saved to "no" **/
910
+
911
+ //if in array doesn't exists [auto_insert_enabled] key, create it and set to 0
912
+ if (!array_key_exists('auto_insert_enabled', $output)) {
913
+ $output['auto_insert_enabled'] = 0;
914
+ }
915
+ //if exists value must be 1
916
+ else {
917
+ $output['auto_insert_enabled'] = 1;
918
+ }
919
+
920
+ //if in array doesn't exists [stars title] key, create it and set to 'no'
921
+ if (!array_key_exists('stars_title', $output)) {
922
+ $output['stars_title'] = 'no';
923
+ }
924
+ //if exists value must be 1
925
+ else {
926
+ $output['stars_title'] = 'yes';
927
+ }
928
+
929
+ //Same as above but for [show_overall_in_loop] key
930
+ if (!array_key_exists('show_overall_in_loop', $output)) {
931
+ $output['show_overall_in_loop'] = 'disabled';
932
+ }
933
+ //if exists must be string 'enabled'
934
+ else {
935
+ $output['show_overall_in_loop'] = 'enabled';
936
+ }
937
+
938
+ //Same as above but for [show_visitor_votes_in_loop] key
939
+ if (!array_key_exists('show_visitor_votes_in_loop', $output)) {
940
+ $output['show_visitor_votes_in_loop'] = 'disabled';
941
+ }
942
+ //if exists must be string 'enabled'
943
+ else {
944
+ $output['show_visitor_votes_in_loop'] = 'enabled';
945
+ }
946
+
947
+ //Same as above but for text_before_stars key
948
+ if (!array_key_exists('text_before_stars', $output)) {
949
+ $output['text_before_stars'] = 0;
950
+ }
951
+ //if exists must be 1
952
+ else {
953
+ $output['text_before_stars'] = 1;
954
+ }
955
+
956
+ //Same as above but for visitors_stats key
957
+ if (!array_key_exists('visitors_stats', $output)) {
958
+ $output['visitors_stats'] = 'no';
959
+ }
960
+ //if exists must be string 'yes'
961
+ else {
962
+ $output['visitors_stats'] = 'yes';
963
+ }
964
+
965
+ //Same as above but for enable_ip key
966
+ if (!array_key_exists('enable_ip', $output)) {
967
+ $output['enable_ip'] = 'no';
968
+ }
969
+ //if exists must be string 'yes'
970
+ else {
971
+ $output['enable_ip'] = 'yes';
972
+ }
973
+
974
+ //Same as above but for enable_ip key
975
+ if (!array_key_exists('enable_ajax', $output)) {
976
+ $output['enable_ajax'] = 'no';
977
+ }
978
+ //if exists must be string 'yes'
979
+ else {
980
+ $output['enable_ajax'] = 'yes';
981
+ }
982
+
983
+ return $output;
984
+
985
+ }
986
+
987
+ public static function echoSettingFields($elementsType_array, $option) {
988
+ $string_input = false;
989
+
990
+ foreach($elementsType_array as $property) {
991
+
992
+ //concatenate yasr_general_options with property name
993
+ $element_name = 'yasr_general_options[' . $property['name'] . ']';
994
+
995
+ if(isset($property['type'])) {
996
+ if($property['type'] === 'select') {
997
+ $string_input = YasrPhpFieldsHelper::select(
998
+ '', $property['label'], $property['options'], $property['name'], '', esc_attr($option[$property['name']])
999
+ );
1000
+ } elseif($property['type'] === 'textarea') {
1001
+ $string_input = YasrPhpFieldsHelper::textArea('', '', $property['name'], '', '',
1002
+ $option[$property['name']]);
1003
+ }
1004
+ } //to use text, there is no need to set the type element
1005
+ else {
1006
+ $string_input = YasrPhpFieldsHelper::text(
1007
+ $property['class'], '', $element_name, $property['id'], '', esc_attr($option[$property['name']])
1008
+ );
1009
+ }
1010
+
1011
+ echo $string_input;
1012
+
1013
+ if(isset($property['description']) && $property['description'] !== '') {
1014
+ echo '<div class="yasr-element-row-container-description">'
1015
+ . $property['description'] .
1016
+ '</div>';
1017
+ }
1018
+
1019
+ }
1020
+ }
1021
+
1022
+
1023
+ }
admin/settings/yasr-stats-functions.php CHANGED
@@ -94,7 +94,7 @@ class YASR_Stats_Log_List_Table extends YASR_WP_List_Table {
94
 
95
  $data = $wpdb->get_results($query, ARRAY_A);
96
 
97
- usort($data, array( &$this, 'sort_data' ));
98
 
99
  $perPage = 25;
100
  $currentPage = $this->get_pagenum();
94
 
95
  $data = $wpdb->get_results($query, ARRAY_A);
96
 
97
+ usort($data, array( $this, 'sort_data' ));
98
 
99
  $perPage = 25;
100
  $currentPage = $this->get_pagenum();
admin/yasr-admin-init.php CHANGED
@@ -38,7 +38,6 @@ require YASR_ABSOLUTE_PATH_ADMIN . '/yasr-admin-actions-ajax.php';
38
  require YASR_ABSOLUTE_PATH_ADMIN . '/yasr-admin-filters.php';
39
  require YASR_ABSOLUTE_PATH_ADMIN . '/class-wp-list-table.php';
40
  require YASR_ABSOLUTE_PATH_ADMIN . '/settings/yasr-settings-functions-misc.php';
41
- require YASR_ABSOLUTE_PATH_ADMIN . '/settings/yasr-settings-functions.php';
42
  require YASR_ABSOLUTE_PATH_ADMIN . '/editor/yasr-editor-functions.php';
43
  require YASR_ABSOLUTE_PATH_ADMIN . '/editor/YasrOnSavePost.php';
44
 
@@ -61,7 +60,18 @@ function yasr_autoload_admin_classes($class) {
61
  if (file_exists($file_name)) {
62
  require($file_name);
63
  }
 
 
 
 
 
 
 
 
64
  }
65
 
66
  //AutoLoad Yasr Shortcode Classes, only when a object is created
67
- spl_autoload_register('yasr_autoload_admin_classes');
 
 
 
38
  require YASR_ABSOLUTE_PATH_ADMIN . '/yasr-admin-filters.php';
39
  require YASR_ABSOLUTE_PATH_ADMIN . '/class-wp-list-table.php';
40
  require YASR_ABSOLUTE_PATH_ADMIN . '/settings/yasr-settings-functions-misc.php';
 
41
  require YASR_ABSOLUTE_PATH_ADMIN . '/editor/yasr-editor-functions.php';
42
  require YASR_ABSOLUTE_PATH_ADMIN . '/editor/YasrOnSavePost.php';
43
 
60
  if (file_exists($file_name)) {
61
  require($file_name);
62
  }
63
+
64
+ $file_name_settings = YASR_ABSOLUTE_PATH_ADMIN . '/settings/classes/' . $class . '.php';
65
+
66
+ // check if file exists, just to be sure
67
+ if (file_exists($file_name_settings)) {
68
+ require($file_name_settings);
69
+ }
70
+
71
  }
72
 
73
  //AutoLoad Yasr Shortcode Classes, only when a object is created
74
+ spl_autoload_register('yasr_autoload_admin_classes');
75
+
76
+ $yasr_settings = new YasrSettings();
77
+ $yasr_settings->init();
changelog.txt CHANGED
@@ -1,3 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  = 2.3.3 =
2
  * FIXED: "Load results with AJAX" option works with all post types, not only the "posts" one
3
  * FIXED: CSS fix in settings pages
@@ -129,7 +167,6 @@ using MultiSets. If everything works, it is possible to remove the table _yasr_m
129
  More info here [here](https://yetanotherstarsrating.com/yasr-rich-snippets/)
130
  * FIXED: warning that in some rare circumstances may appear in yasr_schema function
131
 
132
-
133
  = 2.0.7 =
134
  * TWEAKED: changed a define to support php version <7
135
 
1
+ = 2.3.9 =
2
+ * FIXED: yasr_visitor_votes readonly didn't show up if load results with ajax is enabled
3
+ * FIXED: missing fragment error if gutenber used
4
+ * FIXED: empty tooltip on yasr_visitor_votes
5
+ [//]: # fs_premium_only_begin
6
+ * PRO ONLY: FIXED: comment list now shows stars
7
+ [//]: # fs_premium_only_end
8
+
9
+ = 2.3.8 =
10
+ * TWEAKED: Using GET instead of POST when getting rest response
11
+
12
+ = 2.3.7 =
13
+ * FIXED: Minor changes
14
+
15
+ = 2.3.6 =
16
+ * FIXED: visitor multiset doesn't allow user to vote in some circumstances
17
+ * TWEAKED : minor changes in ajax call for yasr_visitor_votes
18
+
19
+ = 2.3.5 =
20
+ * IMPROVED: is now possible to select between "Organization" or "Person" in "Rich snippet options".
21
+ You may need to save again "Publisher name" and "Image Url"
22
+ * IMPROVED: code cleanup
23
+ [//]: # fs_premium_only_begin
24
+ * PRO ONLY: IMPROVED: custom rankings now support up to 99 rows
25
+ [//]: # fs_premium_only_end
26
+
27
+ = 2.3.4 =
28
+ * IMPROVED: added Software Application itemType
29
+ * IMPROVED: added Organization itemType
30
+ * IMPORVED: added reviewBody and description properties
31
+ * FIXED: "Your ratings" widget in admin dashboard
32
+ [//]: # fs_premium_only_begin
33
+ * PRO ONLY: FIXED: Switch in guteneberg panel to enable/disable reviews in comment
34
+ [//]: # fs_premium_only_end
35
+
36
+ = 2.3.1 =
37
+ * Code refactor, according to boilerplate standards
38
+
39
  = 2.3.3 =
40
  * FIXED: "Load results with AJAX" option works with all post types, not only the "posts" one
41
  * FIXED: CSS fix in settings pages
167
  More info here [here](https://yetanotherstarsrating.com/yasr-rich-snippets/)
168
  * FIXED: warning that in some rare circumstances may appear in yasr_schema function
169
 
 
170
  = 2.0.7 =
171
  * TWEAKED: changed a define to support php version <7
172
 
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 .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/includes/class-freemius.php CHANGED
@@ -351,6 +351,14 @@
351
  */
352
  private $is_whitelabeled;
353
 
 
 
 
 
 
 
 
 
354
  #region Uninstall Reasons IDs
355
 
356
  const REASON_NO_LONGER_NEEDED = 1;
@@ -369,6 +377,14 @@
369
  const REASON_DIDNT_WORK_AS_EXPECTED = 14;
370
  const REASON_TEMPORARY_DEACTIVATION = 15;
371
 
 
 
 
 
 
 
 
 
372
  #endregion
373
 
374
  /* Ctor
@@ -816,7 +832,11 @@
816
  return false;
817
  }
818
 
819
- if ( ! $is_tabs_visibility_check && $this->show_settings_with_tabs() ) {
 
 
 
 
820
  /**
821
  * wp.org themes are limited to a single submenu item, and
822
  * sub-submenu items are most likely not allowed (never verified).
@@ -1457,7 +1477,10 @@
1457
  if ( $this->is_plugin() &&
1458
  ! isset( $this->_storage->is_plugin_new_install )
1459
  ) {
1460
- $this->_storage->is_plugin_new_install = false;
 
 
 
1461
  }
1462
  }
1463
 
@@ -1480,6 +1503,13 @@
1480
  -1 < settings.url.indexOf('admin-ajax.php') &&
1481
  ! ( settings.url.indexOf( '<?php echo $admin_param ?>' ) > 0 )
1482
  ) {
 
 
 
 
 
 
 
1483
  if (settings.url.indexOf('?') > 0) {
1484
  settings.url += '&';
1485
  } else {
@@ -1487,7 +1517,6 @@
1487
  }
1488
 
1489
  settings.url += '<?php echo $admin_param ?>=true';
1490
-
1491
  }
1492
  });
1493
  })(jQuery);
@@ -1505,7 +1534,7 @@
1505
  ?>
1506
  <script type="text/javascript">
1507
  (function ($) {
1508
- $('.fs-submenu-item.wp-support-forum').parent().attr('target', '_blank');
1509
  })(jQuery);
1510
  </script>
1511
  <?php
@@ -1519,7 +1548,7 @@
1519
  $this->_logger->entrance();
1520
 
1521
  if ( is_admin() ) {
1522
- add_action( 'admin_init', array( &$this, '_hook_action_links_and_register_account_hooks' ) );
1523
 
1524
  if ( $this->is_plugin() ) {
1525
  if ( self::is_plugin_install_page() && true !== fs_request_get_bool( 'fs_allow_updater_and_dialog' ) ) {
@@ -1550,17 +1579,17 @@
1550
  */
1551
  register_activation_hook(
1552
  $plugin_dir . $this->_free_plugin_basename,
1553
- array( &$this, '_activate_plugin_event_hook' )
1554
  );
1555
 
1556
  register_activation_hook(
1557
  $plugin_dir . $this->premium_plugin_basename(),
1558
- array( &$this, '_activate_plugin_event_hook' )
1559
  );
1560
  } else {
1561
- add_action( 'after_switch_theme', array( &$this, '_activate_theme_event_hook' ), 10, 2 );
1562
 
1563
- add_action( 'admin_footer', array( &$this, '_style_premium_theme' ) );
1564
  }
1565
 
1566
  /**
@@ -1583,7 +1612,7 @@
1583
  $this->is_activation_mode( false ) &&
1584
  0 == did_action( 'plugins_loaded' )
1585
  ) {
1586
- add_action( 'plugins_loaded', array( &$this, '_plugins_loaded' ) );
1587
  } else {
1588
  // If was activated before, then it was already loaded before.
1589
  $this->_plugins_loaded();
@@ -1592,15 +1621,16 @@
1592
 
1593
  if ( ! self::is_ajax() ) {
1594
  if ( ! $this->is_addon() ) {
1595
- add_action( 'init', array( &$this, '_add_default_submenu_items' ), WP_FS__LOWEST_PRIORITY );
1596
  }
1597
  }
1598
 
1599
  if ( $this->_storage->handle_gdpr_admin_notice ) {
1600
- add_action( 'init', array( &$this, '_maybe_show_gdpr_admin_notice' ) );
1601
  }
1602
 
1603
- add_action( 'init', array( &$this, '_maybe_add_gdpr_optin_ajax_handler') );
 
1604
  }
1605
 
1606
  if ( $this->is_plugin() ) {
@@ -1608,18 +1638,18 @@
1608
  add_action( 'wpmu_new_blog', array( $this, '_after_new_blog_callback' ), 10, 6 );
1609
  }
1610
 
1611
- register_deactivation_hook( $this->_plugin_main_file_path, array( &$this, '_deactivate_plugin_hook' ) );
1612
  }
1613
 
1614
  if ( is_multisite() ) {
1615
- add_action( 'deactivate_blog', array( &$this, '_after_site_deactivated_callback' ) );
1616
- add_action( 'archive_blog', array( &$this, '_after_site_deactivated_callback' ) );
1617
- add_action( 'make_spam_blog', array( &$this, '_after_site_deactivated_callback' ) );
1618
- add_action( 'deleted_blog', array( &$this, '_after_site_deleted_callback' ), 10, 2 );
1619
 
1620
- add_action( 'activate_blog', array( &$this, '_after_site_reactivated_callback' ) );
1621
- add_action( 'unarchive_blog', array( &$this, '_after_site_reactivated_callback' ) );
1622
- add_action( 'make_ham_blog', array( &$this, '_after_site_reactivated_callback' ) );
1623
  }
1624
 
1625
  if ( $this->is_theme() &&
@@ -1627,50 +1657,50 @@
1627
  $this->apply_filters( 'show_customizer_upsell', true )
1628
  ) {
1629
  // Register customizer upsell.
1630
- add_action( 'customize_register', array( &$this, '_customizer_register' ) );
1631
  }
1632
 
1633
- add_action( 'admin_init', array( &$this, '_redirect_on_clicked_menu_link' ), WP_FS__LOWEST_PRIORITY );
1634
 
1635
- if ( $this->is_theme() ) {
1636
- add_action( 'admin_init', array( &$this, '_add_tracking_links' ) );
1637
  }
1638
 
1639
- add_action( 'admin_init', array( &$this, '_add_license_activation' ) );
1640
- add_action( 'admin_init', array( &$this, '_add_premium_version_upgrade_selection' ) );
1641
- add_action( 'admin_init', array( &$this, '_add_beta_mode_update_handler' ) );
1642
- add_action( 'admin_init', array( &$this, '_add_user_change_option' ) );
1643
 
1644
- $this->add_ajax_action( 'update_billing', array( &$this, '_update_billing_ajax_action' ) );
1645
- $this->add_ajax_action( 'start_trial', array( &$this, '_start_trial_ajax_action' ) );
1646
- $this->add_ajax_action( 'set_data_debug_mode', array( &$this, '_set_data_debug_mode' ) );
1647
 
1648
  if ( $this->_is_network_active && fs_is_network_admin() ) {
1649
- $this->add_ajax_action( 'network_activate', array( &$this, '_network_activate_ajax_action' ) );
1650
  }
1651
 
1652
  $this->add_ajax_action( 'install_premium_version', array(
1653
- &$this,
1654
  '_install_premium_version_ajax_action'
1655
  ) );
1656
 
1657
- $this->add_ajax_action( 'submit_affiliate_application', array( &$this, '_submit_affiliate_application' ) );
1658
 
1659
- $this->add_action( 'after_plans_sync', array( &$this, '_check_for_trial_plans' ) );
1660
 
1661
- $this->add_action( 'sdk_version_update', array( &$this, '_sdk_version_update' ), WP_FS__DEFAULT_PRIORITY, 2 );
1662
 
1663
  $this->add_action(
1664
  'plugin_version_update',
1665
- array( &$this, '_after_version_update' ),
1666
  WP_FS__DEFAULT_PRIORITY,
1667
  2
1668
  );
1669
- $this->add_filter( 'after_code_type_change', array( &$this, '_after_code_type_change' ) );
1670
 
1671
- add_action( 'admin_init', array( &$this, '_add_trial_notice' ) );
1672
- add_action( 'admin_init', array( &$this, '_add_affiliate_program_notice' ) );
1673
- add_action( 'admin_enqueue_scripts', array( &$this, '_enqueue_common_css' ) );
1674
 
1675
  /**
1676
  * Handle request to reset anonymous mode for `get_reconnect_url()`.
@@ -1681,7 +1711,7 @@
1681
  if ( fs_request_is_action( 'reset_anonymous_mode' ) &&
1682
  $this->get_unique_affix() === fs_request_get( 'fs_unique_affix' )
1683
  ) {
1684
- add_action( 'admin_init', array( &$this, 'connect_again' ) );
1685
  }
1686
  }
1687
 
@@ -1699,7 +1729,7 @@
1699
  ) {
1700
  $this->add_ajax_action(
1701
  'delete_theme_update_data',
1702
- array( &$this, '_delete_theme_update_data_action' )
1703
  );
1704
  }
1705
 
@@ -1712,16 +1742,16 @@
1712
  * @since 1.2.2.7
1713
  */
1714
  if ( ! $this->_cache->has_valid( 'tabs' ) ) {
1715
- add_action( 'admin_footer', array( &$this, '_tabs_capture' ) );
1716
  // Add license activation AJAX callback.
1717
- $this->add_ajax_action( 'store_tabs', array( &$this, '_store_tabs_ajax_action' ) );
1718
 
1719
- add_action( 'admin_enqueue_scripts', array( &$this, '_store_tabs_styles' ), 9999999 );
1720
  }
1721
 
1722
  add_action(
1723
  'admin_footer',
1724
- array( &$this, '_add_freemius_tabs' ),
1725
  /**
1726
  * The tabs JS code must be executed after the tabs capture logic (_tabs_capture()).
1727
  * That's why the priority is 11 while the tabs capture logic is added
@@ -1737,7 +1767,7 @@
1737
  if ( ! $this->is_addon() || $this->is_only_premium() ) {
1738
  add_action(
1739
  ( $this->_is_network_active && fs_is_network_admin() ? 'network_' : '' ) . 'admin_menu',
1740
- array( &$this, '_prepare_admin_menu' ),
1741
  WP_FS__LOWEST_PRIORITY
1742
  );
1743
  }
@@ -2006,6 +2036,10 @@
2006
  * @since 2.0.0
2007
  */
2008
  function _hook_action_links_and_register_account_hooks() {
 
 
 
 
2009
  $this->_add_tracking_links();
2010
 
2011
  if ( self::is_plugins_page() && $this->is_plugin() ) {
@@ -2032,19 +2066,19 @@
2032
  */
2033
  $this->add_ajax_action(
2034
  'submit_uninstall_reason',
2035
- array( &$this, '_submit_uninstall_reason_action' )
2036
  );
2037
 
2038
  $this->add_ajax_action(
2039
  'cancel_subscription_or_trial',
2040
- array( &$this, 'cancel_subscription_or_trial_ajax_action' )
2041
  );
2042
 
2043
  if ( ! $this->is_addon() || $this->is_parent_plugin_installed() ) {
2044
  if ( ( $this->is_plugin() && self::is_plugins_page() ) ||
2045
  ( $this->is_theme() && self::is_themes_page() )
2046
  ) {
2047
- add_action( 'admin_footer', array( &$this, '_add_deactivation_feedback_dialog_box' ) );
2048
  }
2049
  }
2050
  }
@@ -2186,6 +2220,12 @@
2186
  );
2187
 
2188
  $store_option = true;
 
 
 
 
 
 
2189
  }
2190
 
2191
  if ( empty( $id_slug_type_path_map[ $module_id ]['path'] ) ||
@@ -4259,7 +4299,7 @@
4259
  )
4260
  ),
4261
  sprintf(
4262
- '<a href="%s" target="_blank"><b>%s</b></a> - %s',
4263
  sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ),
4264
  $install_previous_title,
4265
  $install_previous_desc
@@ -4366,7 +4406,7 @@
4366
  )
4367
  ),
4368
  sprintf(
4369
- '<a href="%s" target="_blank"><b>%s</b></a> - %s',
4370
  sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ),
4371
  $install_previous_title,
4372
  $install_previous_desc
@@ -4754,12 +4794,12 @@
4754
 
4755
  $ajax_action_suffix = $this->_slug . ( $this->is_theme() ? ':theme' : '' );
4756
  add_action( "wp_ajax_fs_resolve_firewall_issues_{$ajax_action_suffix}", array(
4757
- &$this,
4758
  '_email_about_firewall_issue'
4759
  ) );
4760
 
4761
  add_action( "wp_ajax_fs_retry_connectivity_test_{$ajax_action_suffix}", array(
4762
- &$this,
4763
  '_retry_connectivity_test'
4764
  ) );
4765
 
@@ -4770,12 +4810,12 @@
4770
  * @since 2.0.0
4771
  */
4772
  /*$this->add_ajax_action( 'resolve_firewall_issues', array(
4773
- &$this,
4774
  '_email_about_firewall_issue'
4775
  ) );
4776
 
4777
  $this->add_ajax_action( 'retry_connectivity_test', array(
4778
- &$this,
4779
  '_retry_connectivity_test'
4780
  ) );*/
4781
  }
@@ -4887,10 +4927,12 @@
4887
  } else {
4888
  $is_network_admin = fs_is_network_admin();
4889
 
4890
- if (
 
 
 
4891
  $this->_parent->is_registered() &&
4892
  ! $this->is_registered() &&
4893
- $this->has_free_plan() &&
4894
  /**
4895
  * If not registered for add-on and the following conditions for the add-on are met, activate add-on account.
4896
  * * Network active and in network admin - network activate add-on account.
@@ -4904,16 +4946,40 @@
4904
  */
4905
  ( $this->is_network_active() || ! $is_network_admin )
4906
  ) {
4907
- // If parent plugin activated, automatically install add-on for the user.
4908
- $this->_activate_addon_account(
4909
- $this->_parent,
4910
- ( $this->is_network_active() && $is_network_admin ) ?
4911
- true :
4912
- get_current_blog_id()
4913
- );
4914
- } else if ( ! $this->_parent->is_registered() && $this->is_registered() ) {
4915
- // If add-on activated and parent not, automatically install parent for the user.
4916
- $this->activate_parent_account( $this->_parent );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4917
  }
4918
 
4919
  // @todo This should be only executed on activation. It should be migrated to register_activation_hook() together with other activation related logic.
@@ -4929,7 +4995,7 @@
4929
  }
4930
  }
4931
 
4932
- add_action( 'admin_init', array( &$this, '_admin_init_action' ) );
4933
 
4934
  // if ( $this->is_registered() ||
4935
  // $this->is_anonymous() ||
@@ -5415,7 +5481,10 @@
5415
  * @return bool
5416
  */
5417
  function is_extensions_tracking_allowed() {
5418
- return (true === $this->_storage->get( 'is_extensions_tracking_allowed', true ) );
 
 
 
5419
  }
5420
 
5421
  /**
@@ -5601,6 +5670,7 @@
5601
  $this->_anonymous_mode = $this->get_bool_option( $plugin_info, 'anonymous_mode', false );
5602
  }
5603
  $this->_permissions = $this->get_option( $plugin_info, 'permissions', array() );
 
5604
 
5605
  if ( ! empty( $plugin_info['trial'] ) ) {
5606
  $this->_trial_days = $this->get_numeric_option(
@@ -5737,7 +5807,7 @@
5737
  if ( ! $this->is_addon() ) {
5738
  add_action(
5739
  is_admin() ? 'admin_init' : 'init',
5740
- array( &$this, '_plugin_code_type_changed' )
5741
  );
5742
  }
5743
 
@@ -6773,7 +6843,7 @@
6773
  function _sync_cron() {
6774
  $this->_logger->entrance();
6775
 
6776
- $this->execute_cron( 'sync', array( &$this, '_sync_cron_method' ) );
6777
  }
6778
 
6779
  /**
@@ -6866,7 +6936,7 @@
6866
  * @since 1.1.7.3
6867
  */
6868
  private function hook_callback_to_sync_cron() {
6869
- $this->add_action( 'data_sync', array( &$this, '_sync_cron' ) );
6870
  }
6871
 
6872
  /**
@@ -6978,7 +7048,7 @@
6978
  * @since 1.1.7.3
6979
  */
6980
  private function hook_callback_to_install_sync() {
6981
- $this->add_action( 'install_sync', array( &$this, '_run_sync_install' ) );
6982
  }
6983
 
6984
  /**
@@ -7001,7 +7071,7 @@
7001
  public function _run_sync_install() {
7002
  $this->_logger->entrance();
7003
 
7004
- $this->execute_cron( 'sync', array( &$this, '_sync_install_cron_method' ) );
7005
  }
7006
 
7007
  /**
@@ -7078,6 +7148,8 @@
7078
  * @since 1.0.7
7079
  */
7080
  function _admin_init_action() {
 
 
7081
  /**
7082
  * Automatically redirect to connect/activation page after plugin activation.
7083
  *
@@ -7090,12 +7162,16 @@
7090
  /**
7091
  * Don't redirect if activating multiple plugins at once (bulk activation).
7092
  */
7093
- } else {
7094
  $this->_redirect_on_activation_hook();
7095
  return;
7096
  }
7097
  }
7098
 
 
 
 
 
7099
  if ( fs_request_is_action( $this->get_unique_affix() . '_skip_activation' ) ) {
7100
  check_admin_referer( $this->get_unique_affix() . '_skip_activation' );
7101
 
@@ -7126,7 +7202,7 @@
7126
  )
7127
  ) {
7128
  if ( ! $this->is_pending_activation() ) {
7129
- if ( ! $this->_menu->is_activation_page( $this->show_opt_in_on_themes_page() ) ) {
7130
  /**
7131
  * If a user visits any other admin page before activating the premium-only theme with a valid
7132
  * license, reactivate the previous theme.
@@ -7769,8 +7845,17 @@
7769
  $this->_storage->is_plugin_new_install = empty( $this->_storage->plugin_last_version );
7770
  }
7771
 
 
 
 
 
 
 
 
 
 
7772
  if ( ! $this->_anonymous_mode &&
7773
- $this->has_api_connectivity( WP_FS__DEV_MODE ) &&
7774
  ! $this->_isAutoInstall
7775
  ) {
7776
  // Store hint that the plugin was just activated to enable auto-redirection to settings.
@@ -7803,11 +7888,20 @@
7803
  return;
7804
  }
7805
 
7806
- $license = $this->get_addon_active_parent_license();
7807
  if ( ! is_object( $license ) ) {
7808
  return;
7809
  }
7810
 
 
 
 
 
 
 
 
 
 
7811
  if ( ! $this->is_registered() ) {
7812
  // Opt in with a license key.
7813
  $this->opt_in(
@@ -7830,7 +7924,6 @@
7830
  }
7831
  }
7832
 
7833
-
7834
  /**
7835
  * @author Leo Fajardo (@leorw)
7836
  * @since 2.3.0
@@ -7846,12 +7939,21 @@
7846
 
7847
  $license = ( ! is_null( $license ) ) ?
7848
  $license :
7849
- $this->get_addon_active_parent_license();
7850
 
7851
  if ( ! is_object( $license ) ) {
7852
  return;
7853
  }
7854
 
 
 
 
 
 
 
 
 
 
7855
  if ( ! $this->is_network_registered() ) {
7856
  $sites = $this->get_sites_for_network_level_optin();
7857
 
@@ -7915,16 +8017,217 @@
7915
  }
7916
 
7917
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7918
  * @author Leo Fajardo (@leorw)
7919
  * @since 2.3.0
7920
  *
 
 
 
7921
  * @return FS_Plugin_License
7922
  */
7923
- private function get_addon_active_parent_license() {
7924
  $parent_licenses_endpoint = "/plugins/{$this->get_id()}/parent_licenses.json?filter=activatable";
7925
- $parent_instance = $this->get_parent_instance();
7926
 
7927
- $foreign_licenses = $parent_instance->get_foreign_licenses_info(
 
 
 
 
 
 
 
 
 
 
7928
  self::get_all_licenses( $this->get_parent_id() )
7929
  );
7930
 
@@ -7938,7 +8241,7 @@
7938
  $parent_licenses_endpoint = add_query_arg( $foreign_licenses, $parent_licenses_endpoint );
7939
  }
7940
 
7941
- $result = $parent_instance->get_current_or_network_user_api_scope()->get( $parent_licenses_endpoint, true );
7942
 
7943
  if (
7944
  ! $this->is_api_result_object( $result, 'licenses' ) ||
@@ -7948,9 +8251,24 @@
7948
  return null;
7949
  }
7950
 
7951
- $license = new FS_Plugin_License( $result->licenses[ 0 ] );
7952
 
7953
- return $license;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7954
  }
7955
 
7956
  /**
@@ -9499,7 +9817,7 @@
9499
 
9500
  register_activation_hook(
9501
  $plugin_dir . $basename,
9502
- array( &$this, '_activate_plugin_event_hook' )
9503
  );
9504
  }
9505
 
@@ -10108,6 +10426,10 @@
10108
 
10109
  $class_name = '';
10110
 
 
 
 
 
10111
  switch ( $option_name ) {
10112
  case 'plugins':
10113
  case 'themes':
@@ -10392,6 +10714,18 @@
10392
  return ( is_object( $this->_site ) && $this->_site->is_tracking_allowed() );
10393
  }
10394
 
 
 
 
 
 
 
 
 
 
 
 
 
10395
  /**
10396
  * @author Vova Feldman (@svovaf)
10397
  * @since 1.0.4
@@ -12675,6 +13009,10 @@
12675
  * @since 1.2.0
12676
  */
12677
  function _add_license_activation() {
 
 
 
 
12678
  if ( ! $this->is_user_admin() ) {
12679
  // Only admins can activate a license.
12680
  return;
@@ -12716,10 +13054,10 @@
12716
  }
12717
 
12718
  // Add license activation AJAX callback.
12719
- $this->add_ajax_action( 'activate_license', array( &$this, '_activate_license_ajax_action' ) );
12720
 
12721
  // Add resend license AJAX callback.
12722
- $this->add_ajax_action( 'resend_license_key', array( &$this, '_resend_license_key_ajax_action' ) );
12723
  }
12724
 
12725
  /**
@@ -12733,13 +13071,15 @@
12733
  return;
12734
  }
12735
 
12736
- if ( empty( $this->get_installs_ids_with_foreign_licenses() ) ) {
 
 
12737
  // Handle user change only when the parent product or one of its add-ons is activated with a foreign license.
12738
  return;
12739
  }
12740
 
12741
  // Add user change AJAX handler.
12742
- $this->add_ajax_action( 'change_user', array( &$this, '_user_change_ajax_action' ) );
12743
  }
12744
 
12745
  /**
@@ -12803,7 +13143,7 @@
12803
  return;
12804
  }
12805
 
12806
- $this->add_ajax_action( 'set_beta_mode', array( &$this, '_set_beta_mode_ajax_handler' ) );
12807
  }
12808
 
12809
  /**
@@ -12869,11 +13209,13 @@
12869
  exit;
12870
  }
12871
 
 
 
 
 
12872
  $result = $this->activate_license(
12873
  $license_key,
12874
- fs_is_network_admin() ?
12875
- fs_request_get( 'sites', array(), 'post' ) :
12876
- array(),
12877
  fs_request_get_bool( 'is_marketing_allowed', null ),
12878
  fs_request_get( 'blog_id', null ),
12879
  fs_request_get( 'module_id', null, 'post' ),
@@ -12881,6 +13223,16 @@
12881
  fs_request_get_bool( 'is_extensions_tracking_allowed', true )
12882
  );
12883
 
 
 
 
 
 
 
 
 
 
 
12884
  echo json_encode( $result );
12885
 
12886
  exit;
@@ -12967,6 +13319,46 @@
12967
  }
12968
 
12969
  /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12970
  * A helper method to activate migrated licenses. If the product is network activated and integrated, the method will network activate the license.
12971
  *
12972
  * @author Vova Feldman (@svovaf)
@@ -12975,6 +13367,8 @@
12975
  * @param string $license_key
12976
  * @param null|bool $is_marketing_allowed
12977
  * @param null|number $plugin_id
 
 
12978
  *
12979
  * @return array {
12980
  * @var bool $success
@@ -12987,17 +13381,19 @@
12987
  function activate_migrated_license(
12988
  $license_key,
12989
  $is_marketing_allowed = null,
12990
- $plugin_id = null
 
 
12991
  ) {
12992
  $this->_logger->entrance();
12993
 
12994
  $result = $this->activate_license(
12995
  $license_key,
12996
- $this->is_network_active() ?
12997
  $this->get_sites_for_network_level_optin() :
12998
- array(),
12999
  $is_marketing_allowed,
13000
- null,
13001
  $plugin_id
13002
  );
13003
 
@@ -13007,6 +13403,32 @@
13007
  return $result;
13008
  }
13009
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13010
  /**
13011
  * The implementation of this method was previously in `_activate_license_ajax_action()`.
13012
  *
@@ -13039,7 +13461,12 @@
13039
 
13040
  $license_key = trim( $license_key );
13041
 
13042
- if ( ! fs_is_network_admin() ) {
 
 
 
 
 
13043
  // If the license activation is executed outside the context of a network admin, ignore the sites collection.
13044
  $sites = array();
13045
  }
@@ -13068,8 +13495,17 @@
13068
  $user = $fs->get_current_or_network_user();
13069
  }
13070
 
 
 
 
 
 
 
 
 
 
13071
  if ( is_object( $user ) ) {
13072
- if ( fs_is_network_admin() && ! $has_valid_blog_id ) {
13073
  // If no specific blog ID was provided, activate the license for all sites in the network.
13074
  $blog_2_install_map = array();
13075
  $site_ids = array();
@@ -13108,16 +13544,6 @@
13108
  }
13109
  }
13110
  } else {
13111
- if ( $has_valid_blog_id ) {
13112
- /**
13113
- * If a specific blog ID was provided, activate the license only for the install that is
13114
- * associated with the given blog ID.
13115
- *
13116
- * @author Leo Fajardo (@leorw)
13117
- */
13118
- $fs->switch_to_blog( $blog_id );
13119
- }
13120
-
13121
  if ( $fs->is_registered() ) {
13122
  $params = array(
13123
  'license_key' => $fs->apply_filters( 'license_key', $license_key )
@@ -13172,13 +13598,19 @@
13172
  if ( empty( $error ) ) {
13173
  $fs->network_upgrade_mode_completed();
13174
 
 
 
 
 
 
 
13175
  $fs->_sync_license( true, $has_valid_blog_id );
13176
 
13177
  $this->maybe_sync_install_user();
13178
 
13179
  $next_page = $fs->is_addon() ?
13180
  $fs->get_parent_instance()->get_account_url() :
13181
- $fs->get_account_url();
13182
  }
13183
  } else {
13184
  $next_page = $fs->opt_in(
@@ -13196,7 +13628,7 @@
13196
  if ( isset( $next_page->error ) ) {
13197
  $error = $next_page->error;
13198
  } else {
13199
- if ( fs_is_network_admin() ) {
13200
  /**
13201
  * Get the list of sites that were just opted-in (and license activated).
13202
  * This is an optimization for the next part below saving some DB queries.
@@ -14627,9 +15059,18 @@
14627
  if ( function_exists( 'get_sites' ) ) {
14628
  // For WP 4.6 and above.
14629
  return get_sites( $args );
14630
- } else if ( function_exists( 'wp_get_sites' ) ) {
14631
  // For WP 3.7 to WP 4.5.
14632
- return wp_get_sites( $args );
 
 
 
 
 
 
 
 
 
14633
  } else {
14634
  // For WP 3.6 and below.
14635
  return get_blog_list( 0, 'all' );
@@ -14806,7 +15247,7 @@
14806
  * @return bool Since 2.3.1 returns if a switch was made.
14807
  */
14808
  function switch_to_blog( $blog_id, FS_Site $install = null ) {
14809
- if ( $blog_id == $this->_context_is_network_or_blog_id ) {
14810
  return false;
14811
  }
14812
 
@@ -16193,6 +16634,8 @@
16193
  'http' => 402
16194
  );
16195
 
 
 
16196
  return $result;
16197
  }
16198
 
@@ -17039,10 +17482,15 @@
17039
  * @author Vova Feldman (@svovaf)
17040
  * @since 1.0.6
17041
  *
17042
- * @param Freemius $parent_fs
17043
- * @param bool|int|null $network_level_or_blog_id True for network level opt-in and integer for opt-in for specified blog in the network.
 
17044
  */
17045
- private function _activate_addon_account( Freemius $parent_fs, $network_level_or_blog_id = null ) {
 
 
 
 
17046
  if ( $this->is_registered() ) {
17047
  // Already activated.
17048
  return;
@@ -17081,6 +17529,10 @@
17081
  }
17082
  }
17083
 
 
 
 
 
17084
  // Activate add-on with parent plugin credentials.
17085
  $result = $parent_fs->get_api_site_scope()->call(
17086
  "/addons/{$this->_plugin->id}/installs.json",
@@ -17089,16 +17541,25 @@
17089
  );
17090
 
17091
  if ( ! $this->is_api_result_object( $result, 'installs' ) ) {
17092
- $error_message = FS_Api::is_api_error_object( $result ) ?
17093
- $result->error->message :
17094
- $this->get_text_inline( 'An unknown error has occurred.', 'unknown-error' );
 
 
 
 
 
 
 
 
17095
 
17096
- $this->_admin_notices->add(
17097
- sprintf( $this->get_text_inline( 'Couldn\'t activate %s.', 'could-not-activate-x' ), $this->get_plugin_name() ) . ' ' .
17098
- $this->get_text_inline( 'Please contact us with the following message:', 'contact-us-with-error-message' ) . ' ' . '<b>' . $error_message . '</b>',
17099
- $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...',
17100
- 'error'
17101
- );
 
17102
 
17103
  return;
17104
  }
@@ -17131,21 +17592,29 @@
17131
 
17132
  if ( ! fs_is_network_admin() ) {
17133
  // Try to activate premium license.
17134
- $this->_activate_license( true );
17135
- } else {
17136
- $license_id = fs_request_get( 'license_id' );
17137
 
17138
- if ( is_object( $this->_site ) &&
17139
- FS_Plugin_License::is_valid_id( $license_id ) &&
17140
- $license_id == $this->_site->license_id
17141
- ) {
17142
- // License is already activated.
17143
- return;
17144
  }
 
 
 
 
 
17145
 
17146
- $premium_license = FS_Plugin_License::is_valid_id( $license_id ) ?
17147
- $this->_get_license_by_id( $license_id ) :
17148
- $this->_get_available_premium_license();
 
 
 
 
 
 
 
 
 
17149
 
17150
  if ( is_object( $premium_license ) ) {
17151
  $this->maybe_network_activate_addon_license( $premium_license );
@@ -17382,11 +17851,11 @@
17382
  * Handle theme opt-in when the opt-in form shows as a dialog box in the themes page.
17383
  */
17384
  if ( fs_request_is_action( $this->get_unique_affix() . '_activate_existing' ) ) {
17385
- add_action( 'load-themes.php', array( &$this, '_install_with_current_user' ) );
17386
  } else if ( fs_request_is_action( $this->get_unique_affix() . '_activate_new' ) ||
17387
  fs_request_get_bool( 'pending_activation' )
17388
  ) {
17389
- add_action( 'load-themes.php', array( &$this, '_install_with_new_user' ) );
17390
  }
17391
  }
17392
  } else {
@@ -17448,7 +17917,7 @@
17448
  $this->get_plugin_name(),
17449
  'manage_options',
17450
  $this->_slug,
17451
- array( &$this, '_connect_page_render' )
17452
  );
17453
  } else if ( $this->_menu->is_top_level() ) {
17454
  if ( $this->_menu->is_override_exact() ) {
@@ -17458,7 +17927,7 @@
17458
  }
17459
  }
17460
 
17461
- $hook = $this->_menu->override_menu_item( array( &$this, '_connect_page_render' ) );
17462
 
17463
  if ( false === $hook ) {
17464
  // Create new menu item just for the opt-in.
@@ -17467,7 +17936,7 @@
17467
  $this->get_plugin_name(),
17468
  'manage_options',
17469
  $this->_menu->get_slug(),
17470
- array( &$this, '_connect_page_render' )
17471
  );
17472
  }
17473
  } else {
@@ -17484,7 +17953,7 @@
17484
  $hook = $this->_menu->override_submenu_action(
17485
  $parent_slug,
17486
  $this->_menu->get_raw_slug(),
17487
- array( &$this, '_connect_page_render' )
17488
  );
17489
 
17490
  if ( false !== $hook ) {
@@ -17707,7 +18176,7 @@
17707
  // Add affiliation page.
17708
  $this->add_submenu_item(
17709
  $this->get_text_inline( 'Affiliation', 'affiliation' ),
17710
- array( &$this, '_affiliation_page_render' ),
17711
  $this->get_plugin_name() . ' &ndash; ' . $this->get_text_inline( 'Affiliation', 'affiliation' ),
17712
  'manage_options',
17713
  'affiliation',
@@ -17737,11 +18206,11 @@
17737
  // Add user account page.
17738
  $this->add_submenu_item(
17739
  $this->get_text_inline( 'Account', 'account' ),
17740
- array( &$this, '_account_page_render' ),
17741
  $this->get_plugin_name() . ' &ndash; ' . $this->get_text_inline( 'Account', 'account' ),
17742
  'manage_options',
17743
  'account',
17744
- array( &$this, '_account_page_load' ),
17745
  WP_FS__DEFAULT_PRIORITY,
17746
  ( $add_submenu_items && $show_account )
17747
  );
@@ -17753,7 +18222,7 @@
17753
  // Add contact page.
17754
  $this->add_submenu_item(
17755
  $this->get_text_inline( 'Contact Us', 'contact-us' ),
17756
- array( &$this, '_contact_page_render' ),
17757
  $this->get_plugin_name() . ' &ndash; ' . $this->get_text_inline( 'Contact Us', 'contact-us' ),
17758
  'manage_options',
17759
  'contact',
@@ -17766,11 +18235,11 @@
17766
  if ( $this->has_addons() ) {
17767
  $this->add_submenu_item(
17768
  $this->get_text_inline( 'Add-Ons', 'add-ons' ),
17769
- array( &$this, '_addons_page_render' ),
17770
  $this->get_plugin_name() . ' &ndash; ' . $this->get_text_inline( 'Add-Ons', 'add-ons' ),
17771
  'manage_options',
17772
  'addons',
17773
- array( &$this, '_addons_page_load' ),
17774
  WP_FS__LOWEST_PRIORITY - 1,
17775
  $this->is_submenu_item_visible( 'addons' )
17776
  );
@@ -17802,7 +18271,7 @@
17802
  // Add upgrade/pricing page.
17803
  $this->add_submenu_item(
17804
  $pricing_cta_text . '&nbsp;&nbsp;' . ( is_rtl() ? $this->get_text_x_inline( '&#x2190;', 'ASCII arrow left icon', 'symbol_arrow-left' ) : $this->get_text_x_inline( '&#x27a4;', 'ASCII arrow right icon', 'symbol_arrow-right' ) ),
17805
- array( &$this, '_pricing_page_render' ),
17806
  $this->get_plugin_name() . ' &ndash; ' . $this->get_text_x_inline( 'Pricing', 'noun', 'pricing' ),
17807
  'manage_options',
17808
  'pricing',
@@ -19443,9 +19912,11 @@
19443
  *
19444
  * @author Vova Feldman (@svovaf)
19445
  * @since 1.2.1
 
 
19446
  */
19447
- function has_active_valid_license() {
19448
- return self::is_active_valid_license( $this->_license );
19449
  }
19450
 
19451
  /**
@@ -19537,15 +20008,16 @@
19537
  * @since 2.1.3
19538
  *
19539
  * @param FS_Plugin_License $license
 
19540
  *
19541
  * @return bool
19542
  */
19543
- private static function is_active_valid_license( $license ) {
19544
  return (
19545
  is_object( $license ) &&
19546
  FS_Plugin_License::is_valid_id( $license->id ) &&
19547
  $license->is_active() &&
19548
- $license->is_valid()
19549
  );
19550
  }
19551
 
@@ -19599,6 +20071,22 @@
19599
  );
19600
  }
19601
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19602
  /**
19603
  * Check if user is a trial or have feature enabled license.
19604
  *
@@ -19986,7 +20474,7 @@
19986
  if ( ! fs_request_get_bool( 'auto_install' ) ) {
19987
  // Open the license activation dialog box on the account page.
19988
  add_action( 'admin_footer', array(
19989
- &$this,
19990
  '_open_license_activation_dialog_box'
19991
  ) );
19992
  }
@@ -20914,7 +21402,7 @@
20914
  */
20915
  private function get_latest_download_link( $label, $plugin_id = false ) {
20916
  return sprintf(
20917
- '<a target="_blank" href="%s">%s</a>',
20918
  $this->_get_latest_download_local_url( $plugin_id ),
20919
  $label
20920
  );
@@ -20985,7 +21473,7 @@
20985
  $this->get_text_inline( 'Version %s was released.', 'version-x-released' ) . ' ' . $this->get_text_inline( 'Please download %s.', 'please-download-x' ),
20986
  $update->version,
20987
  sprintf(
20988
- '<a href="%s" target="_blank">%s</a>',
20989
  $this->get_account_url( 'download_latest' ),
20990
  sprintf(
20991
  /* translators: %s: plan name (e.g. latest "Professional" version) */
@@ -21472,7 +21960,7 @@
21472
  $this->get_plugin_title(),
21473
  fs_strip_url_protocol( get_site_url( $blog_id ) ),
21474
  sprintf(
21475
- '<a href="%s" target="_blank">%s</a>',
21476
  'https://freemius.com',
21477
  'freemius.com'
21478
  )
@@ -21571,6 +22059,18 @@
21571
 
21572
  if ( is_object( $fs ) ) {
21573
  $fs->_activate_license();
 
 
 
 
 
 
 
 
 
 
 
 
21574
  }
21575
 
21576
  return;
@@ -21929,6 +22429,86 @@
21929
  }
21930
  }
21931
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21932
  #----------------------------------------------------------------------------------
21933
  #region Contact Us
21934
  #----------------------------------------------------------------------------------
@@ -22157,6 +22737,43 @@
22157
  $this->get_api_plugin_scope();
22158
  }
22159
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22160
  /**
22161
  * Show trial promotional notice (if any trial exist).
22162
  *
@@ -22242,7 +22859,7 @@
22242
 
22243
  // Check if trial message is already shown.
22244
  if ( $this->is_in_trial_promotion() ) {
22245
- add_action( 'admin_footer', array( &$this, '_fix_start_trial_menu_item_url' ) );
22246
 
22247
  $this->_menu->add_counter_to_menu_item( 1, 'fs-trial' );
22248
 
@@ -22476,7 +23093,7 @@
22476
  function _show_theme_activation_optin_dialog() {
22477
  fs_enqueue_local_style( 'fs_connect', '/admin/connect.css' );
22478
 
22479
- add_action( 'admin_footer', array( &$this, '_add_fs_theme_activation_dialog' ) );
22480
  }
22481
 
22482
  /**
@@ -22514,11 +23131,11 @@
22514
 
22515
  // Add action link to settings page.
22516
  add_filter( 'plugin_action_links_' . $this->_plugin_basename, array(
22517
- &$this,
22518
  '_modify_plugin_action_links_hook'
22519
  ), WP_FS__DEFAULT_PRIORITY, 2 );
22520
  add_filter( 'network_admin_plugin_action_links_' . $this->_plugin_basename, array(
22521
- &$this,
22522
  '_modify_plugin_action_links_hook'
22523
  ), WP_FS__DEFAULT_PRIORITY, 2 );
22524
  }
@@ -22625,7 +23242,7 @@
22625
 
22626
  if ( ! self::is_ajax() ) {
22627
  // Inject license activation dialog UI and client side code.
22628
- add_action( 'admin_footer', array( &$this, '_add_license_activation_dialog_box' ) );
22629
  }
22630
 
22631
  $link_text = $this->is_free_plan() ?
@@ -22649,7 +23266,7 @@
22649
  $this->_logger->entrance();
22650
 
22651
  if ( ! self::is_ajax() ) {
22652
- add_action( 'admin_footer', array( &$this, '_add_premium_version_upgrade_selection_dialog_box' ) );
22653
  }
22654
  }
22655
 
@@ -22710,27 +23327,31 @@
22710
  return;
22711
  }
22712
 
22713
- if ( $this->is_registered() && $this->is_tracking_allowed() ) {
22714
- if ( ! $this->is_enable_anonymous() ) {
22715
- // If opted in and tracking is allowed, don't allow to opt out if anonymous mode is disabled.
22716
- return;
22717
- }
 
 
 
22718
 
22719
- if ( ! $this->is_free_plan() ) {
22720
- // Don't allow to opt out if running in paid plan.
 
22721
  return;
22722
  }
22723
  }
22724
 
22725
- if ( $this->add_ajax_action( 'stop_tracking', array( &$this, '_stop_tracking_callback' ) ) ) {
22726
  return;
22727
  }
22728
 
22729
- if ( $this->add_ajax_action( 'allow_tracking', array( &$this, '_allow_tracking_callback' ) ) ) {
22730
  return;
22731
  }
22732
 
22733
- if ( $this->add_ajax_action( 'update_tracking_permission', array( &$this, '_update_tracking_permission_callback' ) ) ) {
22734
  return;
22735
  }
22736
 
@@ -22759,7 +23380,7 @@
22759
  $url = $this->get_activation_url( $params );
22760
  }
22761
 
22762
- add_action( 'admin_footer', array( &$this, '_add_optout_dialog' ) );
22763
 
22764
  if ( ! empty( $link_text_id ) && $this->is_plugin() && self::is_plugins_page() ) {
22765
  $this->add_plugin_action_link(
@@ -22797,7 +23418,7 @@
22797
  if ( ! empty( $this->_dynamically_added_top_level_page_hook_name ) ) {
22798
  if ( $this->is_network_registered() ) {
22799
  $page = 'account';
22800
- } else if ( $this->is_network_anonymous() ) {
22801
  $this->maybe_set_slug_and_network_menu_exists_flag();
22802
  }
22803
  }
@@ -22875,7 +23496,7 @@
22875
 
22876
  foreach ( $this->_action_links as $new_links ) {
22877
  foreach ( $new_links as $link ) {
22878
- $before_deactivate[ $link['key'] ] = '<a href="' . $link['href'] . '"' . ( $link['external'] ? ' target="_blank"' : '' ) . '>' . $link['label'] . '</a>';
22879
  }
22880
  }
22881
 
@@ -22995,7 +23616,7 @@
22995
  '';
22996
 
22997
  return sprintf(
22998
- ' %s: <ol><li>%s.</li>%s<li>%s (<a href="%s" target="_blank">%s</a>).</li></ol>',
22999
  $this->get_text_inline( 'Please follow these steps to complete the upgrade', 'follow-steps-to-complete-upgrade' ),
23000
  ( empty( $activate_license_string ) ? '' : $activate_license_string . '</li><li>' ) .
23001
  $this->get_latest_download_link( sprintf(
@@ -23248,6 +23869,14 @@
23248
  */
23249
  function set_plugin_upgrade_complete() {
23250
  $this->_storage->plugin_upgrade_mode = false;
 
 
 
 
 
 
 
 
23251
  }
23252
 
23253
  #endregion
@@ -24350,7 +24979,7 @@
24350
  * @since 2.1.0
24351
  */
24352
  function _maybe_add_gdpr_optin_ajax_handler() {
24353
- $this->add_ajax_action( 'fetch_is_marketing_required_flag_value', array( &$this, '_fetch_is_marketing_required_flag_value_ajax_action' ) );
24354
 
24355
  if ( FS_GDPR_Manager::instance()->is_opt_in_notice_shown() ) {
24356
  $this->add_gdpr_optin_ajax_handler_and_style();
@@ -24435,10 +25064,10 @@
24435
  */
24436
  private function add_gdpr_optin_ajax_handler_and_style() {
24437
  // Add GDPR action AJAX callback.
24438
- $this->add_ajax_action( 'gdpr_optin_action', array( &$this, '_gdpr_optin_ajax_action' ) );
24439
 
24440
- add_action( 'admin_footer', array( &$this, '_add_gdpr_optin_js' ) );
24441
- add_action( 'admin_enqueue_scripts', array( &$this, 'enqueue_gdpr_optin_notice_style' ) );
24442
  }
24443
 
24444
  /**
351
  */
352
  private $is_whitelabeled;
353
 
354
+ /**
355
+ * @author Leo Fajardo (@leorw)
356
+ * @since 2.4.0
357
+ *
358
+ * @var bool
359
+ */
360
+ private $_is_bundle_license_auto_activation_enabled = false;
361
+
362
  #region Uninstall Reasons IDs
363
 
364
  const REASON_NO_LONGER_NEEDED = 1;
377
  const REASON_DIDNT_WORK_AS_EXPECTED = 14;
378
  const REASON_TEMPORARY_DEACTIVATION = 15;
379
 
380
+ /**
381
+ * @author Leo Fajardo (@leorw)
382
+ * @since 2.3.1
383
+ *
384
+ * @var boolean|null
385
+ */
386
+ private $_use_external_pricing = null;
387
+
388
  #endregion
389
 
390
  /* Ctor
832
  return false;
833
  }
834
 
835
+ if (
836
+ ! $is_tabs_visibility_check &&
837
+ $this->is_org_repo_compliant() &&
838
+ $this->show_settings_with_tabs()
839
+ ) {
840
  /**
841
  * wp.org themes are limited to a single submenu item, and
842
  * sub-submenu items are most likely not allowed (never verified).
1477
  if ( $this->is_plugin() &&
1478
  ! isset( $this->_storage->is_plugin_new_install )
1479
  ) {
1480
+ $this->_storage->is_plugin_new_install = (
1481
+ ! is_plugin_active( $this->_plugin_basename ) &&
1482
+ empty( $this->_storage->plugin_last_version )
1483
+ );
1484
  }
1485
  }
1486
 
1503
  -1 < settings.url.indexOf('admin-ajax.php') &&
1504
  ! ( settings.url.indexOf( '<?php echo $admin_param ?>' ) > 0 )
1505
  ) {
1506
+ if (
1507
+ 'string' === typeof settings.data &&
1508
+ settings.data.indexOf( 'action=heartbeat' ) > 0
1509
+ ) {
1510
+ return;
1511
+ }
1512
+
1513
  if (settings.url.indexOf('?') > 0) {
1514
  settings.url += '&';
1515
  } else {
1517
  }
1518
 
1519
  settings.url += '<?php echo $admin_param ?>=true';
 
1520
  }
1521
  });
1522
  })(jQuery);
1534
  ?>
1535
  <script type="text/javascript">
1536
  (function ($) {
1537
+ $('.fs-submenu-item.wp-support-forum').parent().attr( { target: '_blank', rel: 'noopener noreferrer' } );
1538
  })(jQuery);
1539
  </script>
1540
  <?php
1548
  $this->_logger->entrance();
1549
 
1550
  if ( is_admin() ) {
1551
+ add_action( 'admin_init', array( $this, '_hook_action_links_and_register_account_hooks' ) );
1552
 
1553
  if ( $this->is_plugin() ) {
1554
  if ( self::is_plugin_install_page() && true !== fs_request_get_bool( 'fs_allow_updater_and_dialog' ) ) {
1579
  */
1580
  register_activation_hook(
1581
  $plugin_dir . $this->_free_plugin_basename,
1582
+ array( $this, '_activate_plugin_event_hook' )
1583
  );
1584
 
1585
  register_activation_hook(
1586
  $plugin_dir . $this->premium_plugin_basename(),
1587
+ array( $this, '_activate_plugin_event_hook' )
1588
  );
1589
  } else {
1590
+ add_action( 'after_switch_theme', array( $this, '_activate_theme_event_hook' ), 10, 2 );
1591
 
1592
+ add_action( 'admin_footer', array( $this, '_style_premium_theme' ) );
1593
  }
1594
 
1595
  /**
1612
  $this->is_activation_mode( false ) &&
1613
  0 == did_action( 'plugins_loaded' )
1614
  ) {
1615
+ add_action( 'plugins_loaded', array( $this, '_plugins_loaded' ) );
1616
  } else {
1617
  // If was activated before, then it was already loaded before.
1618
  $this->_plugins_loaded();
1621
 
1622
  if ( ! self::is_ajax() ) {
1623
  if ( ! $this->is_addon() ) {
1624
+ add_action( 'init', array( $this, '_add_default_submenu_items' ), WP_FS__LOWEST_PRIORITY );
1625
  }
1626
  }
1627
 
1628
  if ( $this->_storage->handle_gdpr_admin_notice ) {
1629
+ add_action( 'init', array( $this, '_maybe_show_gdpr_admin_notice' ) );
1630
  }
1631
 
1632
+ add_action( 'init', array( $this, '_maybe_add_gdpr_optin_ajax_handler') );
1633
+ add_action( 'init', array( $this, '_maybe_add_pricing_ajax_handler' ) );
1634
  }
1635
 
1636
  if ( $this->is_plugin() ) {
1638
  add_action( 'wpmu_new_blog', array( $this, '_after_new_blog_callback' ), 10, 6 );
1639
  }
1640
 
1641
+ register_deactivation_hook( $this->_plugin_main_file_path, array( $this, '_deactivate_plugin_hook' ) );
1642
  }
1643
 
1644
  if ( is_multisite() ) {
1645
+ add_action( 'deactivate_blog', array( $this, '_after_site_deactivated_callback' ) );
1646
+ add_action( 'archive_blog', array( $this, '_after_site_deactivated_callback' ) );
1647
+ add_action( 'make_spam_blog', array( $this, '_after_site_deactivated_callback' ) );
1648
+ add_action( 'deleted_blog', array( $this, '_after_site_deleted_callback' ), 10, 2 );
1649
 
1650
+ add_action( 'activate_blog', array( $this, '_after_site_reactivated_callback' ) );
1651
+ add_action( 'unarchive_blog', array( $this, '_after_site_reactivated_callback' ) );
1652
+ add_action( 'make_ham_blog', array( $this, '_after_site_reactivated_callback' ) );
1653
  }
1654
 
1655
  if ( $this->is_theme() &&
1657
  $this->apply_filters( 'show_customizer_upsell', true )
1658
  ) {
1659
  // Register customizer upsell.
1660
+ add_action( 'customize_register', array( $this, '_customizer_register' ) );
1661
  }
1662
 
1663
+ add_action( 'admin_init', array( $this, '_redirect_on_clicked_menu_link' ), WP_FS__LOWEST_PRIORITY );
1664
 
1665
+ if ( $this->is_theme() && ! $this->is_migration() ) {
1666
+ add_action( 'admin_init', array( $this, '_add_tracking_links' ) );
1667
  }
1668
 
1669
+ add_action( 'admin_init', array( $this, '_add_license_activation' ) );
1670
+ add_action( 'admin_init', array( $this, '_add_premium_version_upgrade_selection' ) );
1671
+ add_action( 'admin_init', array( $this, '_add_beta_mode_update_handler' ) );
1672
+ add_action( 'admin_init', array( $this, '_add_user_change_option' ) );
1673
 
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' ) );
1680
  }
1681
 
1682
  $this->add_ajax_action( 'install_premium_version', array(
1683
+ $this,
1684
  '_install_premium_version_ajax_action'
1685
  ) );
1686
 
1687
+ $this->add_ajax_action( 'submit_affiliate_application', array( $this, '_submit_affiliate_application' ) );
1688
 
1689
+ $this->add_action( 'after_plans_sync', array( $this, '_check_for_trial_plans' ) );
1690
 
1691
+ $this->add_action( 'sdk_version_update', array( $this, '_sdk_version_update' ), WP_FS__DEFAULT_PRIORITY, 2 );
1692
 
1693
  $this->add_action(
1694
  'plugin_version_update',
1695
+ array( $this, '_after_version_update' ),
1696
  WP_FS__DEFAULT_PRIORITY,
1697
  2
1698
  );
1699
+ $this->add_filter( 'after_code_type_change', array( $this, '_after_code_type_change' ) );
1700
 
1701
+ add_action( 'admin_init', array( $this, '_add_trial_notice' ) );
1702
+ add_action( 'admin_init', array( $this, '_add_affiliate_program_notice' ) );
1703
+ add_action( 'admin_enqueue_scripts', array( $this, '_enqueue_common_css' ) );
1704
 
1705
  /**
1706
  * Handle request to reset anonymous mode for `get_reconnect_url()`.
1711
  if ( fs_request_is_action( 'reset_anonymous_mode' ) &&
1712
  $this->get_unique_affix() === fs_request_get( 'fs_unique_affix' )
1713
  ) {
1714
+ add_action( 'admin_init', array( $this, 'connect_again' ) );
1715
  }
1716
  }
1717
 
1729
  ) {
1730
  $this->add_ajax_action(
1731
  'delete_theme_update_data',
1732
+ array( $this, '_delete_theme_update_data_action' )
1733
  );
1734
  }
1735
 
1742
  * @since 1.2.2.7
1743
  */
1744
  if ( ! $this->_cache->has_valid( 'tabs' ) ) {
1745
+ add_action( 'admin_footer', array( $this, '_tabs_capture' ) );
1746
  // Add license activation AJAX callback.
1747
+ $this->add_ajax_action( 'store_tabs', array( $this, '_store_tabs_ajax_action' ) );
1748
 
1749
+ add_action( 'admin_enqueue_scripts', array( $this, '_store_tabs_styles' ), 9999999 );
1750
  }
1751
 
1752
  add_action(
1753
  'admin_footer',
1754
+ array( $this, '_add_freemius_tabs' ),
1755
  /**
1756
  * The tabs JS code must be executed after the tabs capture logic (_tabs_capture()).
1757
  * That's why the priority is 11 while the tabs capture logic is added
1767
  if ( ! $this->is_addon() || $this->is_only_premium() ) {
1768
  add_action(
1769
  ( $this->_is_network_active && fs_is_network_admin() ? 'network_' : '' ) . 'admin_menu',
1770
+ array( $this, '_prepare_admin_menu' ),
1771
  WP_FS__LOWEST_PRIORITY
1772
  );
1773
  }
2036
  * @since 2.0.0
2037
  */
2038
  function _hook_action_links_and_register_account_hooks() {
2039
+ if ( $this->is_migration() ) {
2040
+ return;
2041
+ }
2042
+
2043
  $this->_add_tracking_links();
2044
 
2045
  if ( self::is_plugins_page() && $this->is_plugin() ) {
2066
  */
2067
  $this->add_ajax_action(
2068
  'submit_uninstall_reason',
2069
+ array( $this, '_submit_uninstall_reason_action' )
2070
  );
2071
 
2072
  $this->add_ajax_action(
2073
  'cancel_subscription_or_trial',
2074
+ array( $this, 'cancel_subscription_or_trial_ajax_action' )
2075
  );
2076
 
2077
  if ( ! $this->is_addon() || $this->is_parent_plugin_installed() ) {
2078
  if ( ( $this->is_plugin() && self::is_plugins_page() ) ||
2079
  ( $this->is_theme() && self::is_themes_page() )
2080
  ) {
2081
+ add_action( 'admin_footer', array( $this, '_add_deactivation_feedback_dialog_box' ) );
2082
  }
2083
  }
2084
  }
2220
  );
2221
 
2222
  $store_option = true;
2223
+ } else if (
2224
+ isset( $id_slug_type_path_map[ $module_id ]['slug'] ) &&
2225
+ $slug !== $id_slug_type_path_map[ $module_id ]['slug']
2226
+ ) {
2227
+ $id_slug_type_path_map[ $module_id ]['slug'] = $slug;
2228
+ $store_option = true;
2229
  }
2230
 
2231
  if ( empty( $id_slug_type_path_map[ $module_id ]['path'] ) ||
4299
  )
4300
  ),
4301
  sprintf(
4302
+ '<a href="%s" target="_blank" rel="noopener noreferrer"><b>%s</b></a> - %s',
4303
  sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ),
4304
  $install_previous_title,
4305
  $install_previous_desc
4406
  )
4407
  ),
4408
  sprintf(
4409
+ '<a href="%s" target="_blank" rel="noopener noreferrer"><b>%s</b></a> - %s',
4410
  sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ),
4411
  $install_previous_title,
4412
  $install_previous_desc
4794
 
4795
  $ajax_action_suffix = $this->_slug . ( $this->is_theme() ? ':theme' : '' );
4796
  add_action( "wp_ajax_fs_resolve_firewall_issues_{$ajax_action_suffix}", array(
4797
+ $this,
4798
  '_email_about_firewall_issue'
4799
  ) );
4800
 
4801
  add_action( "wp_ajax_fs_retry_connectivity_test_{$ajax_action_suffix}", array(
4802
+ $this,
4803
  '_retry_connectivity_test'
4804
  ) );
4805
 
4810
  * @since 2.0.0
4811
  */
4812
  /*$this->add_ajax_action( 'resolve_firewall_issues', array(
4813
+ $this,
4814
  '_email_about_firewall_issue'
4815
  ) );
4816
 
4817
  $this->add_ajax_action( 'retry_connectivity_test', array(
4818
+ $this,
4819
  '_retry_connectivity_test'
4820
  ) );*/
4821
  }
4927
  } else {
4928
  $is_network_admin = fs_is_network_admin();
4929
 
4930
+ if ( ! $this->_parent->is_registered() && $this->is_registered() ) {
4931
+ // If add-on activated and parent not, automatically install parent for the user.
4932
+ $this->activate_parent_account( $this->_parent );
4933
+ } else if (
4934
  $this->_parent->is_registered() &&
4935
  ! $this->is_registered() &&
 
4936
  /**
4937
  * If not registered for add-on and the following conditions for the add-on are met, activate add-on account.
4938
  * * Network active and in network admin - network activate add-on account.
4946
  */
4947
  ( $this->is_network_active() || ! $is_network_admin )
4948
  ) {
4949
+ $premium_license = null;
4950
+
4951
+ if (
4952
+ ! $this->has_free_plan() &&
4953
+ $this->is_bundle_license_auto_activation_enabled() &&
4954
+ $this->_parent->is_activated_with_bundle_license()
4955
+ ) {
4956
+ /**
4957
+ * If the add-on has no free plan, try to activate the account only when there's a bundle license.
4958
+ *
4959
+ * @author Leo Fajardo (@leorw)
4960
+ * @since 2.4.0
4961
+ */
4962
+ $bundle_license = $this->get_active_parent_license( $this->_parent->_get_license()->secret_key, false );
4963
+
4964
+ if (
4965
+ is_object( $bundle_license ) &&
4966
+ ! empty( $bundle_license->products ) &&
4967
+ in_array( $this->get_id(), $bundle_license->products )
4968
+ ) {
4969
+ $premium_license = $bundle_license;
4970
+ }
4971
+ }
4972
+
4973
+ if ( $this->has_free_plan() || is_object( $premium_license) ) {
4974
+ // If parent plugin activated, automatically install add-on for the user.
4975
+ $this->_activate_addon_account(
4976
+ $this->_parent,
4977
+ ( $this->is_network_active() && $is_network_admin ) ?
4978
+ true :
4979
+ get_current_blog_id(),
4980
+ $premium_license
4981
+ );
4982
+ }
4983
  }
4984
 
4985
  // @todo This should be only executed on activation. It should be migrated to register_activation_hook() together with other activation related logic.
4995
  }
4996
  }
4997
 
4998
+ add_action( 'admin_init', array( $this, '_admin_init_action' ) );
4999
 
5000
  // if ( $this->is_registered() ||
5001
  // $this->is_anonymous() ||
5481
  * @return bool
5482
  */
5483
  function is_extensions_tracking_allowed() {
5484
+ return ( true === $this->apply_filters(
5485
+ 'is_extensions_tracking_allowed',
5486
+ $this->_storage->get( 'is_extensions_tracking_allowed', true )
5487
+ ) );
5488
  }
5489
 
5490
  /**
5670
  $this->_anonymous_mode = $this->get_bool_option( $plugin_info, 'anonymous_mode', false );
5671
  }
5672
  $this->_permissions = $this->get_option( $plugin_info, 'permissions', array() );
5673
+ $this->_is_bundle_license_auto_activation_enabled = $this->get_option( $plugin_info, 'bundle_license_auto_activation', false );
5674
 
5675
  if ( ! empty( $plugin_info['trial'] ) ) {
5676
  $this->_trial_days = $this->get_numeric_option(
5807
  if ( ! $this->is_addon() ) {
5808
  add_action(
5809
  is_admin() ? 'admin_init' : 'init',
5810
+ array( $this, '_plugin_code_type_changed' )
5811
  );
5812
  }
5813
 
6843
  function _sync_cron() {
6844
  $this->_logger->entrance();
6845
 
6846
+ $this->execute_cron( 'sync', array( $this, '_sync_cron_method' ) );
6847
  }
6848
 
6849
  /**
6936
  * @since 1.1.7.3
6937
  */
6938
  private function hook_callback_to_sync_cron() {
6939
+ $this->add_action( 'data_sync', array( $this, '_sync_cron' ) );
6940
  }
6941
 
6942
  /**
7048
  * @since 1.1.7.3
7049
  */
7050
  private function hook_callback_to_install_sync() {
7051
+ $this->add_action( 'install_sync', array( $this, '_run_sync_install' ) );
7052
  }
7053
 
7054
  /**
7071
  public function _run_sync_install() {
7072
  $this->_logger->entrance();
7073
 
7074
+ $this->execute_cron( 'sync', array( $this, '_sync_install_cron_method' ) );
7075
  }
7076
 
7077
  /**
7148
  * @since 1.0.7
7149
  */
7150
  function _admin_init_action() {
7151
+ $is_migration = $this->is_migration();
7152
+
7153
  /**
7154
  * Automatically redirect to connect/activation page after plugin activation.
7155
  *
7162
  /**
7163
  * Don't redirect if activating multiple plugins at once (bulk activation).
7164
  */
7165
+ } else if ( ! $is_migration ) {
7166
  $this->_redirect_on_activation_hook();
7167
  return;
7168
  }
7169
  }
7170
 
7171
+ if ( $is_migration ) {
7172
+ return;
7173
+ }
7174
+
7175
  if ( fs_request_is_action( $this->get_unique_affix() . '_skip_activation' ) ) {
7176
  check_admin_referer( $this->get_unique_affix() . '_skip_activation' );
7177
 
7202
  )
7203
  ) {
7204
  if ( ! $this->is_pending_activation() ) {
7205
+ if ( ! $this->is_activation_page() ) {
7206
  /**
7207
  * If a user visits any other admin page before activating the premium-only theme with a valid
7208
  * license, reactivate the previous theme.
7845
  $this->_storage->is_plugin_new_install = empty( $this->_storage->plugin_last_version );
7846
  }
7847
 
7848
+ /**
7849
+ * Also flush when activating the premium version so that even if Freemius was off before, the API
7850
+ * connectivity test can be run again.
7851
+ *
7852
+ * @author Leo Fajardo (@leorw)
7853
+ * @since 2.2.3.1
7854
+ */
7855
+ $has_api_connectivity = $this->has_api_connectivity( WP_FS__DEV_MODE || $is_premium_version_activation );
7856
+
7857
  if ( ! $this->_anonymous_mode &&
7858
+ $has_api_connectivity &&
7859
  ! $this->_isAutoInstall
7860
  ) {
7861
  // Store hint that the plugin was just activated to enable auto-redirection to settings.
7888
  return;
7889
  }
7890
 
7891
+ $license = $this->get_active_parent_license();
7892
  if ( ! is_object( $license ) ) {
7893
  return;
7894
  }
7895
 
7896
+ if (
7897
+ $this->is_bundle_license_auto_activation_enabled() &&
7898
+ ! empty( $license->products )
7899
+ ) {
7900
+ $this->activate_bundle_license( $license );
7901
+
7902
+ return;
7903
+ }
7904
+
7905
  if ( ! $this->is_registered() ) {
7906
  // Opt in with a license key.
7907
  $this->opt_in(
7924
  }
7925
  }
7926
 
 
7927
  /**
7928
  * @author Leo Fajardo (@leorw)
7929
  * @since 2.3.0
7939
 
7940
  $license = ( ! is_null( $license ) ) ?
7941
  $license :
7942
+ $this->get_active_parent_license();
7943
 
7944
  if ( ! is_object( $license ) ) {
7945
  return;
7946
  }
7947
 
7948
+ if (
7949
+ $this->is_bundle_license_auto_activation_enabled() &&
7950
+ ! empty( $license->products )
7951
+ ) {
7952
+ $this->activate_bundle_license( $license );
7953
+
7954
+ return;
7955
+ }
7956
+
7957
  if ( ! $this->is_network_registered() ) {
7958
  $sites = $this->get_sites_for_network_level_optin();
7959
 
8017
  }
8018
 
8019
  /**
8020
+ * Tries to activate a bundle license for all supported products if the current product is activated with a bundle license. This is called after activating an available license (not via the license activation dialog but by clicking on a license activation button) for a product via its "Account" page.
8021
+ *
8022
+ * @author Leo Fajardo (@leorw)
8023
+ * @since 2.4.0
8024
+ *
8025
+ * @param FS_Plugin_License $license
8026
+ * @param array $sites
8027
+ * @param int $blog_id
8028
+ */
8029
+ private function maybe_activate_bundle_license( FS_Plugin_License $license = null, $sites = array(), $blog_id = 0 ) {
8030
+ if ( ! is_object( $license ) && $this->has_active_valid_license() ) {
8031
+ $license = $this->_license;
8032
+ }
8033
+
8034
+ if ( ! is_object( $license ) ) {
8035
+ return;
8036
+ }
8037
+
8038
+ $parent_license = ( ! empty( $license->products ) ) ?
8039
+ $license :
8040
+ $this->get_active_parent_license( $license->secret_key );
8041
+
8042
+ if ( is_object( $parent_license ) ) {
8043
+ $this->activate_bundle_license( $parent_license, $sites, $blog_id );
8044
+ }
8045
+ }
8046
+
8047
+ /**
8048
+ * Try to activate a bundle license for all the bundle products installed on the site.
8049
+ * (1) If a child product install already has a license, the bundle license won't be activated.
8050
+ * (2) On multi-site networks, if the attempt to activate the bundle license is triggered from the network admin, the bundle license activation will only work for non-delegated sites and only if none of them is associated with a license. Even if one of the sites has the product installed with a license key, skip the bundle license activation for the product.
8051
+ * (3) On multi-site networks, if the attempt to activate the bundle license is triggered from a site-level admin, only activate the license if the product is site-level activated or delegated, and the product installation is not yet associated with a license.
8052
+ *
8053
+ * @author Leo Fajardo (@leorw)
8054
+ * @since 2.4.0
8055
+ *
8056
+ * @param FS_Plugin_License $license
8057
+ * @param array $sites
8058
+ * @param int $current_blog_id
8059
+ */
8060
+ private function activate_bundle_license( $license, $sites = array(), $current_blog_id = 0 ) {
8061
+ $is_network_admin = fs_is_network_admin();
8062
+
8063
+ $installs_by_blog_map = array();
8064
+ $site_info_by_blog_map = array();
8065
+
8066
+ /**
8067
+ * Try to activate the license for all supported products.
8068
+ *
8069
+ * @author Leo Fajardo
8070
+ */
8071
+ foreach ( $license->products as $product_id ) {
8072
+ $fs = self::get_instance_by_id( $product_id );
8073
+
8074
+ if ( ! is_object( $fs ) ) {
8075
+ continue;
8076
+ }
8077
+
8078
+ if ( ! $fs->has_paid_plan() ) {
8079
+ continue;
8080
+ }
8081
+
8082
+ if (
8083
+ ! $fs->is_addon() &&
8084
+ ! FS_Plan_Manager::instance()->has_paid_plan( $fs->_plans )
8085
+ ) {
8086
+ /**
8087
+ * The parent product can be free-only but can have its `has_paid_plan` flag set to `true` when
8088
+ * there is a context bundle.
8089
+ */
8090
+ continue;
8091
+ }
8092
+
8093
+ if ( $current_blog_id > 0 ) {
8094
+ $fs->switch_to_blog( $current_blog_id );
8095
+ }
8096
+
8097
+ if ( $fs->has_active_valid_license() ) {
8098
+ continue;
8099
+ }
8100
+
8101
+ if ( ! $is_network_admin || $current_blog_id > 0 ) {
8102
+ if ( $fs->is_network_active() && ! $fs->is_delegated_connection( $current_blog_id ) ) {
8103
+ // Do not try to activate the license in the site level if the product is network active and the connection was not delegated.
8104
+ continue;
8105
+ }
8106
+ } else {
8107
+ if ( ! $fs->is_network_active() ) {
8108
+ // Do not try to activate the license in the network level if the product is not network active.
8109
+ continue;
8110
+ }
8111
+
8112
+ if ( $fs->is_network_delegated_connection() ) {
8113
+ // Do not try to activate the license in the network level if the activation has been delegated to site admins.
8114
+ continue;
8115
+ }
8116
+
8117
+ $has_install_with_license = false;
8118
+
8119
+ // Collection of sites that have an install entity that is not activated with a license or non-delegated sites that have no install entity, or both types of site.
8120
+ $filtered_sites = array();
8121
+
8122
+ if ( empty( $sites ) ) {
8123
+ $all_sites = self::get_sites();
8124
+
8125
+ foreach ( $all_sites as $site ) {
8126
+ $sites[] = array( 'blog_id' => self::get_site_blog_id( $site ) );
8127
+ }
8128
+ } else {
8129
+ // Populate the map here to avoid calling `$fs->get_site_info( $site );` in the other `for` loop below.
8130
+ foreach ( $sites as $site ) {
8131
+ if ( ! isset( $site['blog_id'] ) || ! is_numeric( $site['blog_id'] ) ) {
8132
+ continue;
8133
+ }
8134
+
8135
+ $site_info_by_blog_map[ $site['blog_id'] ] = $site;
8136
+ }
8137
+ }
8138
+
8139
+ foreach ( $sites as $site ) {
8140
+ if ( ! isset( $site['blog_id'] ) || ! is_numeric( $site['blog_id'] ) ) {
8141
+ continue;
8142
+ }
8143
+
8144
+ $blog_id = $site['blog_id'];
8145
+
8146
+ if ( ! isset( $installs_by_blog_map[ $blog_id ] ) ) {
8147
+ $installs_by_blog_map[ $blog_id ] = self::get_all_sites( $fs->get_module_type(), $blog_id );
8148
+ }
8149
+
8150
+ $installs = $installs_by_blog_map[ $blog_id ];
8151
+ $install = null;
8152
+
8153
+ if ( isset( $installs[ $fs->get_slug() ] ) ) {
8154
+ $install = $installs[ $fs->get_slug() ];
8155
+
8156
+ if (
8157
+ is_object( $install ) &&
8158
+ (
8159
+ ! FS_Site::is_valid_id( $install->id ) ||
8160
+ ! FS_User::is_valid_id( $install->user_id ) ||
8161
+ ! FS_Plugin_Plan::is_valid_id( $install->plan_id )
8162
+ )
8163
+ ) {
8164
+ $install = null;
8165
+ }
8166
+ }
8167
+
8168
+ if (
8169
+ is_object( $install ) &&
8170
+ FS_Plugin_License::is_valid_id( $install->license_id )
8171
+ ) {
8172
+ $has_install_with_license = true;
8173
+ break;
8174
+ }
8175
+
8176
+ if ( $fs->is_site_delegated_connection( $blog_id ) ) {
8177
+ // Site activation delegated, don't activate bundle license on the site in the network admin.
8178
+ continue;
8179
+ }
8180
+
8181
+ if ( ! isset( $site_info_by_blog_map[ $blog_id ] ) ) {
8182
+ $site_info_by_blog_map[ $blog_id ] = $fs->get_site_info( $site );
8183
+ }
8184
+
8185
+ $filtered_sites[] = $site_info_by_blog_map[ $blog_id ];
8186
+ }
8187
+
8188
+ if ( $has_install_with_license || empty( $filtered_sites ) ) {
8189
+ // Do not try to activate the license at the network level if there's any install with a license or there's no site to activate the license on.
8190
+ continue;
8191
+ }
8192
+
8193
+ $sites = $filtered_sites;
8194
+ }
8195
+
8196
+ $fs->activate_migrated_license(
8197
+ $license->secret_key,
8198
+ null,
8199
+ null,
8200
+ $sites,
8201
+ ( $current_blog_id > 0 ? $current_blog_id : null )
8202
+ );
8203
+ }
8204
+ }
8205
+
8206
+ /**
8207
+ * Returns a parent license that can be activated for the context product.
8208
+ *
8209
  * @author Leo Fajardo (@leorw)
8210
  * @since 2.3.0
8211
  *
8212
+ * @param string|null $license_key
8213
+ * @param bool $flush
8214
+ *
8215
  * @return FS_Plugin_License
8216
  */
8217
+ function get_active_parent_license( $license_key = null, $flush = true ) {
8218
  $parent_licenses_endpoint = "/plugins/{$this->get_id()}/parent_licenses.json?filter=activatable";
 
8219
 
8220
+ $fs = $this;
8221
+
8222
+ if ( $this->is_addon() ) {
8223
+ $parent_instance = $this->get_parent_instance();
8224
+
8225
+ if ( is_object( $parent_instance ) && $parent_instance->is_registered() ) {
8226
+ $fs = $parent_instance;
8227
+ }
8228
+ }
8229
+
8230
+ $foreign_licenses = $fs->get_foreign_licenses_info(
8231
  self::get_all_licenses( $this->get_parent_id() )
8232
  );
8233
 
8241
  $parent_licenses_endpoint = add_query_arg( $foreign_licenses, $parent_licenses_endpoint );
8242
  }
8243
 
8244
+ $result = $fs->get_current_or_network_user_api_scope()->get( $parent_licenses_endpoint, $flush );
8245
 
8246
  if (
8247
  ! $this->is_api_result_object( $result, 'licenses' ) ||
8251
  return null;
8252
  }
8253
 
8254
+ $parent_license = null;
8255
 
8256
+ if ( empty( $license_key ) ) {
8257
+ $parent_license = $result->licenses[0];
8258
+ } else {
8259
+ foreach ( $result->licenses as $license ) {
8260
+ if ( $license_key === $license->secret_key ) {
8261
+ $parent_license = $license;
8262
+ break;
8263
+ }
8264
+ }
8265
+ }
8266
+
8267
+ if ( ! is_null( $parent_license ) ) {
8268
+ $parent_license = new FS_Plugin_License( $parent_license );
8269
+ }
8270
+
8271
+ return $parent_license;
8272
  }
8273
 
8274
  /**
9817
 
9818
  register_activation_hook(
9819
  $plugin_dir . $basename,
9820
+ array( $this, '_activate_plugin_event_hook' )
9821
  );
9822
  }
9823
 
10426
 
10427
  $class_name = '';
10428
 
10429
+ if ( fs_starts_with( $option_name, WP_FS__MODULE_TYPE_THEME . '_' ) ) {
10430
+ $option_name = str_replace( WP_FS__MODULE_TYPE_THEME . '_', '', $option_name );
10431
+ }
10432
+
10433
  switch ( $option_name ) {
10434
  case 'plugins':
10435
  case 'themes':
10714
  return ( is_object( $this->_site ) && $this->_site->is_tracking_allowed() );
10715
  }
10716
 
10717
+ /**
10718
+ * @author Leo Fajardo (@leorw)
10719
+ * @since 2.4.0
10720
+ *
10721
+ * @return bool
10722
+ */
10723
+ function is_bundle_license_auto_activation_enabled() {
10724
+ return $this->is_addon() ?
10725
+ ( is_object( $this->_parent ) && $this->_parent->is_bundle_license_auto_activation_enabled() ) :
10726
+ $this->_is_bundle_license_auto_activation_enabled;
10727
+ }
10728
+
10729
  /**
10730
  * @author Vova Feldman (@svovaf)
10731
  * @since 1.0.4
13009
  * @since 1.2.0
13010
  */
13011
  function _add_license_activation() {
13012
+ if ( $this->is_migration() ) {
13013
+ return;
13014
+ }
13015
+
13016
  if ( ! $this->is_user_admin() ) {
13017
  // Only admins can activate a license.
13018
  return;
13054
  }
13055
 
13056
  // Add license activation AJAX callback.
13057
+ $this->add_ajax_action( 'activate_license', array( $this, '_activate_license_ajax_action' ) );
13058
 
13059
  // Add resend license AJAX callback.
13060
+ $this->add_ajax_action( 'resend_license_key', array( $this, '_resend_license_key_ajax_action' ) );
13061
  }
13062
 
13063
  /**
13071
  return;
13072
  }
13073
 
13074
+ $installs_ids_with_foreign_licenses = $this->get_installs_ids_with_foreign_licenses();
13075
+
13076
+ if ( empty( $installs_ids_with_foreign_licenses ) ) {
13077
  // Handle user change only when the parent product or one of its add-ons is activated with a foreign license.
13078
  return;
13079
  }
13080
 
13081
  // Add user change AJAX handler.
13082
+ $this->add_ajax_action( 'change_user', array( $this, '_user_change_ajax_action' ) );
13083
  }
13084
 
13085
  /**
13143
  return;
13144
  }
13145
 
13146
+ $this->add_ajax_action( 'set_beta_mode', array( $this, '_set_beta_mode_ajax_handler' ) );
13147
  }
13148
 
13149
  /**
13209
  exit;
13210
  }
13211
 
13212
+ $sites = fs_is_network_admin() ?
13213
+ fs_request_get( 'sites', array(), 'post' ) :
13214
+ array();
13215
+
13216
  $result = $this->activate_license(
13217
  $license_key,
13218
+ $sites,
 
 
13219
  fs_request_get_bool( 'is_marketing_allowed', null ),
13220
  fs_request_get( 'blog_id', null ),
13221
  fs_request_get( 'module_id', null, 'post' ),
13223
  fs_request_get_bool( 'is_extensions_tracking_allowed', true )
13224
  );
13225
 
13226
+ if (
13227
+ $result['success'] &&
13228
+ $this->is_bundle_license_auto_activation_enabled()
13229
+ ) {
13230
+ $license = new FS_Plugin_License();
13231
+ $license->secret_key = $license_key;
13232
+
13233
+ $this->maybe_activate_bundle_license( $license, $sites );
13234
+ }
13235
+
13236
  echo json_encode( $result );
13237
 
13238
  exit;
13319
  }
13320
 
13321
  /**
13322
+ * @author Leo Fajardo (@leorw)
13323
+ * @since 2.3.2.14
13324
+ */
13325
+ function starting_migration() {
13326
+ if ( ! empty( $this->_storage->license_migration ) ) {
13327
+ // Do not overwrite the data if already set.
13328
+ return;
13329
+ }
13330
+
13331
+ $this->_storage->license_migration = array(
13332
+ 'is_migrating' => true,
13333
+ 'start_timestamp' => time()
13334
+ );
13335
+ }
13336
+
13337
+ /**
13338
+ * @author Leo Fajardo (@leorw)
13339
+ * @since 2.3.2.14
13340
+ */
13341
+ function is_migration() {
13342
+ if ( $this->is_addon() ) {
13343
+ return $this->get_parent_instance()->is_migration();
13344
+ }
13345
+
13346
+ if ( empty( $this->_storage->license_migration ) ) {
13347
+ return false;
13348
+ }
13349
+
13350
+ if ( ! $this->_storage->license_migration['is_migrating'] ) {
13351
+ return false;
13352
+ }
13353
+
13354
+ return (
13355
+ // Return `true` if the migration is within 5 minutes from the starting time.
13356
+ ( time() - $this->_storage->license_migration['start_timestamp'] ) <= WP_FS__TIME_5_MIN_IN_SEC
13357
+ );
13358
+ }
13359
+
13360
+ /**
13361
+ *
13362
  * A helper method to activate migrated licenses. If the product is network activated and integrated, the method will network activate the license.
13363
  *
13364
  * @author Vova Feldman (@svovaf)
13367
  * @param string $license_key
13368
  * @param null|bool $is_marketing_allowed
13369
  * @param null|number $plugin_id
13370
+ * @param array $sites
13371
+ * @param int $blog_id
13372
  *
13373
  * @return array {
13374
  * @var bool $success
13381
  function activate_migrated_license(
13382
  $license_key,
13383
  $is_marketing_allowed = null,
13384
+ $plugin_id = null,
13385
+ $sites = array(),
13386
+ $blog_id = null
13387
  ) {
13388
  $this->_logger->entrance();
13389
 
13390
  $result = $this->activate_license(
13391
  $license_key,
13392
+ ( empty( $sites ) && is_null( $blog_id ) && $this->is_network_active() ) ?
13393
  $this->get_sites_for_network_level_optin() :
13394
+ $sites,
13395
  $is_marketing_allowed,
13396
+ $blog_id,
13397
  $plugin_id
13398
  );
13399
 
13403
  return $result;
13404
  }
13405
 
13406
+ /**
13407
+ * @author Leo Fajardo (@leorw)
13408
+ * @since 2.3.1
13409
+ *
13410
+ * @return string
13411
+ */
13412
+ function get_pricing_js_path() {
13413
+ return $this->apply_filters( 'freemius_pricing_js_path', WP_FS__DIR_INCLUDES . '/freemius-pricing/freemius-pricing.js' );
13414
+ }
13415
+
13416
+ /**
13417
+ * @author Leo Fajardo (@leorw)
13418
+ * @since 2.3.1
13419
+ *
13420
+ * @return bool
13421
+ */
13422
+ function should_use_external_pricing() {
13423
+ if ( is_null( $this->_use_external_pricing ) ) {
13424
+ $pricing_js_path = $this->get_pricing_js_path();
13425
+
13426
+ $this->_use_external_pricing = ( empty( $pricing_js_path ) || ! file_exists( $pricing_js_path ) );
13427
+ }
13428
+
13429
+ return $this->_use_external_pricing;
13430
+ }
13431
+
13432
  /**
13433
  * The implementation of this method was previously in `_activate_license_ajax_action()`.
13434
  *
13461
 
13462
  $license_key = trim( $license_key );
13463
 
13464
+ $is_network_activation_or_migration = (
13465
+ fs_is_network_admin() ||
13466
+ ( ! empty( $sites ) && $this->is_migration() )
13467
+ );
13468
+
13469
+ if ( ! $is_network_activation_or_migration ) {
13470
  // If the license activation is executed outside the context of a network admin, ignore the sites collection.
13471
  $sites = array();
13472
  }
13495
  $user = $fs->get_current_or_network_user();
13496
  }
13497
 
13498
+ if ( $has_valid_blog_id ) {
13499
+ /**
13500
+ * If a specific blog ID was provided, activate the license only on the specific blog that is associated with the given blog ID.
13501
+ *
13502
+ * @author Leo Fajardo (@leorw)
13503
+ */
13504
+ $fs->switch_to_blog( $blog_id );
13505
+ }
13506
+
13507
  if ( is_object( $user ) ) {
13508
+ if ( $is_network_activation_or_migration && ! $has_valid_blog_id ) {
13509
  // If no specific blog ID was provided, activate the license for all sites in the network.
13510
  $blog_2_install_map = array();
13511
  $site_ids = array();
13544
  }
13545
  }
13546
  } else {
 
 
 
 
 
 
 
 
 
 
13547
  if ( $fs->is_registered() ) {
13548
  $params = array(
13549
  'license_key' => $fs->apply_filters( 'license_key', $license_key )
13598
  if ( empty( $error ) ) {
13599
  $fs->network_upgrade_mode_completed();
13600
 
13601
+ $fs->_user = $user;
13602
+
13603
+ if ( fs_is_network_admin() && ! $has_valid_blog_id ) {
13604
+ $fs->_site = $fs->get_network_install();
13605
+ }
13606
+
13607
  $fs->_sync_license( true, $has_valid_blog_id );
13608
 
13609
  $this->maybe_sync_install_user();
13610
 
13611
  $next_page = $fs->is_addon() ?
13612
  $fs->get_parent_instance()->get_account_url() :
13613
+ $fs->get_after_activation_url( 'after_connect_url' );
13614
  }
13615
  } else {
13616
  $next_page = $fs->opt_in(
13628
  if ( isset( $next_page->error ) ) {
13629
  $error = $next_page->error;
13630
  } else {
13631
+ if ( $is_network_activation_or_migration ) {
13632
  /**
13633
  * Get the list of sites that were just opted-in (and license activated).
13634
  * This is an optimization for the next part below saving some DB queries.
15059
  if ( function_exists( 'get_sites' ) ) {
15060
  // For WP 4.6 and above.
15061
  return get_sites( $args );
15062
+ } else if ( function_exists( 'wp_' . 'get_sites' ) ) {
15063
  // For WP 3.7 to WP 4.5.
15064
+ /**
15065
+ * This is a hack suggested previously proposed by the TRT. Our SDK is compliant with older WP versions and we'd like to keep it that way.
15066
+ *
15067
+ * @todo Remove this hack once this false-positive error is removed from the Theme Sniffer.
15068
+ *
15069
+ * @since 2.3.3
15070
+ * @author Vova Feldman (@svovaf)
15071
+ */
15072
+ $fn = 'wp_' . 'get_sites';
15073
+ return $fn( $args );
15074
  } else {
15075
  // For WP 3.6 and below.
15076
  return get_blog_list( 0, 'all' );
15247
  * @return bool Since 2.3.1 returns if a switch was made.
15248
  */
15249
  function switch_to_blog( $blog_id, FS_Site $install = null ) {
15250
+ if ( ! is_numeric( $blog_id ) || $blog_id == $this->_context_is_network_or_blog_id ) {
15251
  return false;
15252
  }
15253
 
16634
  'http' => 402
16635
  );
16636
 
16637
+ $this->maybe_modify_api_curl_error_message( $result );
16638
+
16639
  return $result;
16640
  }
16641
 
17482
  * @author Vova Feldman (@svovaf)
17483
  * @since 1.0.6
17484
  *
17485
+ * @param Freemius $parent_fs
17486
+ * @param bool|int|null $network_level_or_blog_id True for network level opt-in and integer for opt-in for specified blog in the network.
17487
+ * @param FS_Plugin_License $bundle_license Since 2.4.0. If provided, this license will be activated for the add-on.
17488
  */
17489
+ private function _activate_addon_account(
17490
+ Freemius $parent_fs,
17491
+ $network_level_or_blog_id = null,
17492
+ FS_Plugin_License $bundle_license = null
17493
+ ) {
17494
  if ( $this->is_registered() ) {
17495
  // Already activated.
17496
  return;
17529
  }
17530
  }
17531
 
17532
+ if ( is_object( $bundle_license ) ) {
17533
+ $params['license_key'] = $bundle_license->secret_key;
17534
+ }
17535
+
17536
  // Activate add-on with parent plugin credentials.
17537
  $result = $parent_fs->get_api_site_scope()->call(
17538
  "/addons/{$this->_plugin->id}/installs.json",
17541
  );
17542
 
17543
  if ( ! $this->is_api_result_object( $result, 'installs' ) ) {
17544
+ if ( is_object( $bundle_license ) ) {
17545
+ /**
17546
+ * When a license object is provided, it's an attempt by the SDK to activate a bundle license and not a user-initiated action, therefore, do not show any admin notice to avoid confusion (e.g.: the notice will show up just above the opt-in link). If the license activation fails, the admin will see an opt-in link instead.
17547
+ *
17548
+ * @author Leo Fajardo (@leorw)
17549
+ * @since 2.4.0
17550
+ */
17551
+ } else {
17552
+ $error_message = FS_Api::is_api_error_object( $result ) ?
17553
+ $result->error->message :
17554
+ $this->get_text_inline( 'An unknown error has occurred.', 'unknown-error' );
17555
 
17556
+ $this->_admin_notices->add(
17557
+ sprintf( $this->get_text_inline( 'Couldn\'t activate %s.', 'could-not-activate-x' ), $this->get_plugin_name() ) . ' ' .
17558
+ $this->get_text_inline( 'Please contact us with the following message:', 'contact-us-with-error-message' ) . ' ' . '<b>' . $error_message . '</b>',
17559
+ $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...',
17560
+ 'error'
17561
+ );
17562
+ }
17563
 
17564
  return;
17565
  }
17592
 
17593
  if ( ! fs_is_network_admin() ) {
17594
  // Try to activate premium license.
17595
+ $this->_activate_license( true, $bundle_license );
 
 
17596
 
17597
+ if ( is_object( $bundle_license ) ) {
17598
+ $this->maybe_activate_bundle_license( $bundle_license );
 
 
 
 
17599
  }
17600
+ } else {
17601
+ if ( is_object( $bundle_license ) ) {
17602
+ $premium_license = $bundle_license;
17603
+ } else {
17604
+ $license_id = fs_request_get( 'license_id' );
17605
 
17606
+ if ( is_object( $this->_site ) &&
17607
+ FS_Plugin_License::is_valid_id( $license_id ) &&
17608
+ $license_id == $this->_site->license_id
17609
+ ) {
17610
+ // License is already activated.
17611
+ return;
17612
+ }
17613
+
17614
+ $premium_license = FS_Plugin_License::is_valid_id( $license_id ) ?
17615
+ $this->_get_license_by_id( $license_id ) :
17616
+ $this->_get_available_premium_license();
17617
+ }
17618
 
17619
  if ( is_object( $premium_license ) ) {
17620
  $this->maybe_network_activate_addon_license( $premium_license );
17851
  * Handle theme opt-in when the opt-in form shows as a dialog box in the themes page.
17852
  */
17853
  if ( fs_request_is_action( $this->get_unique_affix() . '_activate_existing' ) ) {
17854
+ add_action( 'load-themes.php', array( $this, '_install_with_current_user' ) );
17855
  } else if ( fs_request_is_action( $this->get_unique_affix() . '_activate_new' ) ||
17856
  fs_request_get_bool( 'pending_activation' )
17857
  ) {
17858
+ add_action( 'load-themes.php', array( $this, '_install_with_new_user' ) );
17859
  }
17860
  }
17861
  } else {
17917
  $this->get_plugin_name(),
17918
  'manage_options',
17919
  $this->_slug,
17920
+ array( $this, '_connect_page_render' )
17921
  );
17922
  } else if ( $this->_menu->is_top_level() ) {
17923
  if ( $this->_menu->is_override_exact() ) {
17927
  }
17928
  }
17929
 
17930
+ $hook = $this->_menu->override_menu_item( array( $this, '_connect_page_render' ) );
17931
 
17932
  if ( false === $hook ) {
17933
  // Create new menu item just for the opt-in.
17936
  $this->get_plugin_name(),
17937
  'manage_options',
17938
  $this->_menu->get_slug(),
17939
+ array( $this, '_connect_page_render' )
17940
  );
17941
  }
17942
  } else {
17953
  $hook = $this->_menu->override_submenu_action(
17954
  $parent_slug,
17955
  $this->_menu->get_raw_slug(),
17956
+ array( $this, '_connect_page_render' )
17957
  );
17958
 
17959
  if ( false !== $hook ) {
18176
  // Add affiliation page.
18177
  $this->add_submenu_item(
18178
  $this->get_text_inline( 'Affiliation', 'affiliation' ),
18179
+ array( $this, '_affiliation_page_render' ),
18180
  $this->get_plugin_name() . ' &ndash; ' . $this->get_text_inline( 'Affiliation', 'affiliation' ),
18181
  'manage_options',
18182
  'affiliation',
18206
  // Add user account page.
18207
  $this->add_submenu_item(
18208
  $this->get_text_inline( 'Account', 'account' ),
18209
+ array( $this, '_account_page_render' ),
18210
  $this->get_plugin_name() . ' &ndash; ' . $this->get_text_inline( 'Account', 'account' ),
18211
  'manage_options',
18212
  'account',
18213
+ array( $this, '_account_page_load' ),
18214
  WP_FS__DEFAULT_PRIORITY,
18215
  ( $add_submenu_items && $show_account )
18216
  );
18222
  // Add contact page.
18223
  $this->add_submenu_item(
18224
  $this->get_text_inline( 'Contact Us', 'contact-us' ),
18225
+ array( $this, '_contact_page_render' ),
18226
  $this->get_plugin_name() . ' &ndash; ' . $this->get_text_inline( 'Contact Us', 'contact-us' ),
18227
  'manage_options',
18228
  'contact',
18235
  if ( $this->has_addons() ) {
18236
  $this->add_submenu_item(
18237
  $this->get_text_inline( 'Add-Ons', 'add-ons' ),
18238
+ array( $this, '_addons_page_render' ),
18239
  $this->get_plugin_name() . ' &ndash; ' . $this->get_text_inline( 'Add-Ons', 'add-ons' ),
18240
  'manage_options',
18241
  'addons',
18242
+ array( $this, '_addons_page_load' ),
18243
  WP_FS__LOWEST_PRIORITY - 1,
18244
  $this->is_submenu_item_visible( 'addons' )
18245
  );
18271
  // Add upgrade/pricing page.
18272
  $this->add_submenu_item(
18273
  $pricing_cta_text . '&nbsp;&nbsp;' . ( is_rtl() ? $this->get_text_x_inline( '&#x2190;', 'ASCII arrow left icon', 'symbol_arrow-left' ) : $this->get_text_x_inline( '&#x27a4;', 'ASCII arrow right icon', 'symbol_arrow-right' ) ),
18274
+ array( $this, '_pricing_page_render' ),
18275
  $this->get_plugin_name() . ' &ndash; ' . $this->get_text_x_inline( 'Pricing', 'noun', 'pricing' ),
18276
  'manage_options',
18277
  'pricing',
19912
  *
19913
  * @author Vova Feldman (@svovaf)
19914
  * @since 1.2.1
19915
+ *
19916
+ * @param bool $check_expiration
19917
  */
19918
+ function has_active_valid_license( $check_expiration = true ) {
19919
+ return self::is_active_valid_license( $this->_license, $check_expiration );
19920
  }
19921
 
19922
  /**
20008
  * @since 2.1.3
20009
  *
20010
  * @param FS_Plugin_License $license
20011
+ * @param bool $check_expiration
20012
  *
20013
  * @return bool
20014
  */
20015
+ private static function is_active_valid_license( $license, $check_expiration = true ) {
20016
  return (
20017
  is_object( $license ) &&
20018
  FS_Plugin_License::is_valid_id( $license->id ) &&
20019
  $license->is_active() &&
20020
+ ( ! $check_expiration || $license->is_valid() )
20021
  );
20022
  }
20023
 
20071
  );
20072
  }
20073
 
20074
+ /**
20075
+ * Checks if the product is activated with a bundle license.
20076
+ *
20077
+ * @author Leo Fajardo (@leorw)
20078
+ * @since 2.4.0
20079
+ *
20080
+ * @return bool
20081
+ */
20082
+ function is_activated_with_bundle_license() {
20083
+ if ( ! $this->has_features_enabled_license() ) {
20084
+ return false;
20085
+ }
20086
+
20087
+ return FS_Plugin_License::is_valid_id( $this->_license->parent_license_id );
20088
+ }
20089
+
20090
  /**
20091
  * Check if user is a trial or have feature enabled license.
20092
  *
20474
  if ( ! fs_request_get_bool( 'auto_install' ) ) {
20475
  // Open the license activation dialog box on the account page.
20476
  add_action( 'admin_footer', array(
20477
+ $this,
20478
  '_open_license_activation_dialog_box'
20479
  ) );
20480
  }
21402
  */
21403
  private function get_latest_download_link( $label, $plugin_id = false ) {
21404
  return sprintf(
21405
+ '<a target="_blank" rel="noopener" href="%s">%s</a>',
21406
  $this->_get_latest_download_local_url( $plugin_id ),
21407
  $label
21408
  );
21473
  $this->get_text_inline( 'Version %s was released.', 'version-x-released' ) . ' ' . $this->get_text_inline( 'Please download %s.', 'please-download-x' ),
21474
  $update->version,
21475
  sprintf(
21476
+ '<a href="%s" target="_blank" rel="noopener">%s</a>',
21477
  $this->get_account_url( 'download_latest' ),
21478
  sprintf(
21479
  /* translators: %s: plan name (e.g. latest "Professional" version) */
21960
  $this->get_plugin_title(),
21961
  fs_strip_url_protocol( get_site_url( $blog_id ) ),
21962
  sprintf(
21963
+ '<a href="%s" target="_blank" rel="noopener">%s</a>',
21964
  'https://freemius.com',
21965
  'freemius.com'
21966
  )
22059
 
22060
  if ( is_object( $fs ) ) {
22061
  $fs->_activate_license();
22062
+
22063
+ /**
22064
+ * Remove the product ID from `$_REQUEST` so that the syncing of the license for the other products will work properly.
22065
+ *
22066
+ * @author Leo Fajardo (@leorw)
22067
+ * @since 2.4.0
22068
+ */
22069
+ unset( $_REQUEST['plugin_id'] );
22070
+
22071
+ if ( $this->is_bundle_license_auto_activation_enabled() ) {
22072
+ $fs->maybe_activate_bundle_license( null, array(), is_numeric( $blog_id ) ? $blog_id : 0 );
22073
+ }
22074
  }
22075
 
22076
  return;
22429
  }
22430
  }
22431
 
22432
+ /**
22433
+ * @author Leo Fajardo (@leorw)
22434
+ * @since 2.3.1
22435
+ */
22436
+ function _maybe_add_pricing_ajax_handler() {
22437
+ if ( ! $this->should_use_external_pricing() ) {
22438
+ $this->add_ajax_action( 'pricing_ajax_action', array( $this, '_fs_pricing_ajax_action_handler' ) );
22439
+ }
22440
+ }
22441
+
22442
+ /**
22443
+ * @author Leo Fajardo (@leorw)
22444
+ * @since 2.3.1
22445
+ */
22446
+ function _fs_pricing_ajax_action_handler() {
22447
+ $this->check_ajax_referer( 'pricing_ajax_action' );
22448
+
22449
+ $result = null;
22450
+ $pricing_action = fs_request_get( 'pricing_action' );
22451
+
22452
+ switch ( $pricing_action ) {
22453
+ case 'fetch_pricing_data':
22454
+ $params = array(
22455
+ 'is_enriched' => true,
22456
+ 'trial' => fs_request_get_bool( 'trial' ),
22457
+ 'sandbox' => fs_request_get( 'sandbox' ),
22458
+ 's_ctx_type' => fs_request_get( 's_ctx_type' ),
22459
+ 's_ctx_id' => fs_request_get( 's_ctx_id' ),
22460
+ 's_ctx_ts' => fs_request_get( 's_ctx_ts' ),
22461
+ 's_ctx_secure' => fs_request_get( 's_ctx_secure' ),
22462
+ );
22463
+
22464
+ $bundle_id = $this->get_bundle_id();
22465
+ $bundle_public_key = $this->get_bundle_public_key();
22466
+
22467
+ $has_bundle_context = ( FS_Plugin::is_valid_id( $bundle_id ) && ! empty( $bundle_public_key ) );
22468
+
22469
+ if ( ! $has_bundle_context ) {
22470
+ $api = $this->get_api_plugin_scope();
22471
+ } else {
22472
+ $api = FS_Api::instance(
22473
+ $bundle_id,
22474
+ 'plugin',
22475
+ $bundle_id,
22476
+ $bundle_public_key,
22477
+ ! $this->is_live(),
22478
+ false,
22479
+ $this->get_sdk_version()
22480
+ );
22481
+
22482
+ $params['plugin_id'] = $this->get_id();
22483
+ $params['plugin_public_key'] = $this->get_public_key();
22484
+ }
22485
+
22486
+ $result = $api->get( 'pricing.json?' . http_build_query( $params ) );
22487
+ break;
22488
+ case 'start_trial':
22489
+ $result = $this->opt_in(
22490
+ false,
22491
+ false,
22492
+ false,
22493
+ false,
22494
+ false,
22495
+ fs_request_get( 'plan_id' )
22496
+ );
22497
+ }
22498
+
22499
+ if ( is_object( $result ) && $this->is_api_error( $result ) ) {
22500
+ $this->_logger->api_error( $result );
22501
+
22502
+ self::shoot_ajax_failure(
22503
+ isset( $result->error ) ?
22504
+ ( is_string( $result->error ) ? $result->error : $result->error->message ) :
22505
+ var_export( $result, true )
22506
+ );
22507
+ }
22508
+
22509
+ $this->shoot_ajax_success( $result );
22510
+ }
22511
+
22512
  #----------------------------------------------------------------------------------
22513
  #region Contact Us
22514
  #----------------------------------------------------------------------------------
22737
  $this->get_api_plugin_scope();
22738
  }
22739
 
22740
+ /**
22741
+ * @author Leo Fajardo (@leorw)
22742
+ * @since 2.2.3.1
22743
+ *
22744
+ * @param object $result
22745
+ */
22746
+ private function maybe_modify_api_curl_error_message( $result ) {
22747
+ if (
22748
+ 'cUrlMissing' !== $result->error->type &&
22749
+ ( 'CurlException' !== $result->error->type || CURLE_COULDNT_CONNECT != $result->error->code ) &&
22750
+ ( 'HttpRequestFailed' !== $result->error->type || false === strpos( $result->error->message, 'cURL error ' . CURLE_COULDNT_CONNECT ) )
22751
+ ) {
22752
+ return;
22753
+ }
22754
+
22755
+ $result->error->message = $this->esc_html_inline( 'We use PHP cURL library for the API calls, which is a very common library and usually installed and activated out of the box. Unfortunately, cURL is not activated (or disabled) on your server.', 'curl-missing-message' ) .
22756
+ ' ' .
22757
+ $this->esc_html_inline(
22758
+ sprintf(
22759
+ 'Please contact your hosting provider and ask them to whitelist %s for external connection.',
22760
+ implode(
22761
+ ', ',
22762
+ $this->apply_filters( 'api_domains', array(
22763
+ 'api.freemius.com',
22764
+ 'wp.freemius.com'
22765
+ ) )
22766
+ )
22767
+ ),
22768
+ 'connectivity-whitelist'
22769
+ ) .
22770
+ ' ' .
22771
+ sprintf(
22772
+ $this->esc_html_inline( 'Once you are done, deactivate the %s and activate it again.', 'connectivity-reactivate-module' ),
22773
+ $this->get_module_type()
22774
+ );
22775
+ }
22776
+
22777
  /**
22778
  * Show trial promotional notice (if any trial exist).
22779
  *
22859
 
22860
  // Check if trial message is already shown.
22861
  if ( $this->is_in_trial_promotion() ) {
22862
+ add_action( 'admin_footer', array( $this, '_fix_start_trial_menu_item_url' ) );
22863
 
22864
  $this->_menu->add_counter_to_menu_item( 1, 'fs-trial' );
22865
 
23093
  function _show_theme_activation_optin_dialog() {
23094
  fs_enqueue_local_style( 'fs_connect', '/admin/connect.css' );
23095
 
23096
+ add_action( 'admin_footer', array( $this, '_add_fs_theme_activation_dialog' ) );
23097
  }
23098
 
23099
  /**
23131
 
23132
  // Add action link to settings page.
23133
  add_filter( 'plugin_action_links_' . $this->_plugin_basename, array(
23134
+ $this,
23135
  '_modify_plugin_action_links_hook'
23136
  ), WP_FS__DEFAULT_PRIORITY, 2 );
23137
  add_filter( 'network_admin_plugin_action_links_' . $this->_plugin_basename, array(
23138
+ $this,
23139
  '_modify_plugin_action_links_hook'
23140
  ), WP_FS__DEFAULT_PRIORITY, 2 );
23141
  }
23242
 
23243
  if ( ! self::is_ajax() ) {
23244
  // Inject license activation dialog UI and client side code.
23245
+ add_action( 'admin_footer', array( $this, '_add_license_activation_dialog_box' ) );
23246
  }
23247
 
23248
  $link_text = $this->is_free_plan() ?
23266
  $this->_logger->entrance();
23267
 
23268
  if ( ! self::is_ajax() ) {
23269
+ add_action( 'admin_footer', array( $this, '_add_premium_version_upgrade_selection_dialog_box' ) );
23270
  }
23271
  }
23272
 
23327
  return;
23328
  }
23329
 
23330
+ if (
23331
+ $this->is_activation_mode() &&
23332
+ $this->is_premium() &&
23333
+ ! $this->is_registered()
23334
+ ) {
23335
+ // If not yet registered and running the premium code base, a license activation link will already be shown.
23336
+ return;
23337
+ }
23338
 
23339
+ if ( $this->is_registered() && $this->is_tracking_allowed() ) {
23340
+ if ( ! $this->is_premium() && ! $this->is_enable_anonymous() ) {
23341
+ // If opted in and tracking is allowed, don't allow to opt out if not premium and anonymous mode is disabled.
23342
  return;
23343
  }
23344
  }
23345
 
23346
+ if ( $this->add_ajax_action( 'stop_tracking', array( $this, '_stop_tracking_callback' ) ) ) {
23347
  return;
23348
  }
23349
 
23350
+ if ( $this->add_ajax_action( 'allow_tracking', array( $this, '_allow_tracking_callback' ) ) ) {
23351
  return;
23352
  }
23353
 
23354
+ if ( $this->add_ajax_action( 'update_tracking_permission', array( $this, '_update_tracking_permission_callback' ) ) ) {
23355
  return;
23356
  }
23357
 
23380
  $url = $this->get_activation_url( $params );
23381
  }
23382
 
23383
+ add_action( 'admin_footer', array( $this, '_add_optout_dialog' ) );
23384
 
23385
  if ( ! empty( $link_text_id ) && $this->is_plugin() && self::is_plugins_page() ) {
23386
  $this->add_plugin_action_link(
23418
  if ( ! empty( $this->_dynamically_added_top_level_page_hook_name ) ) {
23419
  if ( $this->is_network_registered() ) {
23420
  $page = 'account';
23421
+ } else if ( $this->is_pending_activation() || $this->is_network_anonymous() ) {
23422
  $this->maybe_set_slug_and_network_menu_exists_flag();
23423
  }
23424
  }
23496
 
23497
  foreach ( $this->_action_links as $new_links ) {
23498
  foreach ( $new_links as $link ) {
23499
+ $before_deactivate[ $link['key'] ] = '<a href="' . $link['href'] . '"' . ( $link['external'] ? ' target="_blank" rel="noopener"' : '' ) . '>' . $link['label'] . '</a>';
23500
  }
23501
  }
23502
 
23616
  '';
23617
 
23618
  return sprintf(
23619
+ ' %s: <ol><li>%s.</li>%s<li>%s (<a href="%s" target="_blank" rel="noopener">%s</a>).</li></ol>',
23620
  $this->get_text_inline( 'Please follow these steps to complete the upgrade', 'follow-steps-to-complete-upgrade' ),
23621
  ( empty( $activate_license_string ) ? '' : $activate_license_string . '</li><li>' ) .
23622
  $this->get_latest_download_link( sprintf(
23869
  */
23870
  function set_plugin_upgrade_complete() {
23871
  $this->_storage->plugin_upgrade_mode = false;
23872
+
23873
+ $license_migration = ! empty( $this->_storage->license_migration ) ?
23874
+ $this->_storage->license_migration :
23875
+ array();
23876
+
23877
+ $license_migration['is_migrating'] = false;
23878
+
23879
+ $this->_storage->license_migration = $license_migration;
23880
  }
23881
 
23882
  #endregion
24979
  * @since 2.1.0
24980
  */
24981
  function _maybe_add_gdpr_optin_ajax_handler() {
24982
+ $this->add_ajax_action( 'fetch_is_marketing_required_flag_value', array( $this, '_fetch_is_marketing_required_flag_value_ajax_action' ) );
24983
 
24984
  if ( FS_GDPR_Manager::instance()->is_opt_in_notice_shown() ) {
24985
  $this->add_gdpr_optin_ajax_handler_and_style();
25064
  */
25065
  private function add_gdpr_optin_ajax_handler_and_style() {
25066
  // Add GDPR action AJAX callback.
25067
+ $this->add_ajax_action( 'gdpr_optin_action', array( $this, '_gdpr_optin_ajax_action' ) );
25068
 
25069
+ add_action( 'admin_footer', array( $this, '_add_gdpr_optin_js' ) );
25070
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_gdpr_optin_notice_style' ) );
25071
  }
25072
 
25073
  /**
freemius/includes/class-fs-api.php CHANGED
@@ -287,7 +287,7 @@
287
  $this->_logger->warn( 'Fallback to cached API result: ' . var_export( $cached_result, true ) );
288
  }
289
  } else {
290
- if ( is_object( $result ) && 404 == $result->error->http ) {
291
  /**
292
  * If the response code is 404, cache the result for half of the `$expiration`.
293
  *
287
  $this->_logger->warn( 'Fallback to cached API result: ' . var_export( $cached_result, true ) );
288
  }
289
  } else {
290
+ if ( is_object( $result ) && isset( $result->error->http ) && 404 == $result->error->http ) {
291
  /**
292
  * If the response code is 404, cache the result for half of the `$expiration`.
293
  *
freemius/includes/class-fs-plugin-updater.php CHANGED
@@ -80,7 +80,7 @@
80
  */
81
  private function filters() {
82
  // Override request for plugin information
83
- add_filter( 'plugins_api', array( &$this, 'plugins_api_filter' ), 10, 3 );
84
 
85
  $this->add_transient_filters();
86
 
@@ -94,16 +94,16 @@
94
  */
95
  // WP 2.9+
96
  add_action( "after_plugin_row_{$this->_fs->get_plugin_basename()}", array(
97
- &$this,
98
  'catch_plugin_update_row'
99
  ), 9 );
100
  add_action( "after_plugin_row_{$this->_fs->get_plugin_basename()}", array(
101
- &$this,
102
  'edit_and_echo_plugin_update_row'
103
  ), 11, 2 );
104
 
105
  if ( ! $this->_fs->has_any_active_valid_license() ) {
106
- add_action( 'admin_head', array( &$this, 'catch_plugin_information_dialog_contents' ) );
107
  }
108
 
109
  if ( ! WP_FS__IS_PRODUCTION_MODE ) {
@@ -115,14 +115,14 @@
115
 
116
  if ( $this->_fs->is_premium() ) {
117
  if ( ! $this->is_correct_folder_name() ) {
118
- add_filter( 'upgrader_post_install', array( &$this, '_maybe_update_folder_name' ), 10, 3 );
119
  }
120
 
121
  add_filter( 'upgrader_pre_install', array( 'FS_Plugin_Updater', '_store_basename_for_source_adjustment' ), 1, 2 );
122
  add_filter( 'upgrader_source_selection', array( 'FS_Plugin_Updater', '_maybe_adjust_source_dir' ), 1, 3 );
123
 
124
  if ( ! $this->_fs->has_any_active_valid_license() ) {
125
- add_filter( 'wp_prepare_themes_for_js', array( &$this, 'change_theme_update_info_html' ), 10, 1 );
126
  }
127
  }
128
  }
@@ -139,7 +139,7 @@
139
  return;
140
  }
141
 
142
- add_action( 'admin_footer', array( &$this, 'edit_and_echo_plugin_information_dialog_contents' ), 0, 1 );
143
 
144
  ob_start();
145
  }
@@ -247,12 +247,12 @@
247
  }
248
 
249
  add_filter( 'pre_set_site_transient_update_plugins', array(
250
- &$this,
251
  'pre_set_site_transient_update_plugins_filter'
252
  ) );
253
 
254
  add_filter( 'pre_set_site_transient_update_themes', array(
255
- &$this,
256
  'pre_set_site_transient_update_plugins_filter'
257
  ) );
258
  }
@@ -263,12 +263,12 @@
263
  */
264
  private function remove_transient_filters() {
265
  remove_filter( 'pre_set_site_transient_update_plugins', array(
266
- &$this,
267
  'pre_set_site_transient_update_plugins_filter'
268
  ) );
269
 
270
  remove_filter( 'pre_set_site_transient_update_themes', array(
271
- &$this,
272
  'pre_set_site_transient_update_plugins_filter'
273
  ) );
274
  }
80
  */
81
  private function filters() {
82
  // Override request for plugin information
83
+ add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
84
 
85
  $this->add_transient_filters();
86
 
94
  */
95
  // WP 2.9+
96
  add_action( "after_plugin_row_{$this->_fs->get_plugin_basename()}", array(
97
+ $this,
98
  'catch_plugin_update_row'
99
  ), 9 );
100
  add_action( "after_plugin_row_{$this->_fs->get_plugin_basename()}", array(
101
+ $this,
102
  'edit_and_echo_plugin_update_row'
103
  ), 11, 2 );
104
 
105
  if ( ! $this->_fs->has_any_active_valid_license() ) {
106
+ add_action( 'admin_head', array( $this, 'catch_plugin_information_dialog_contents' ) );
107
  }
108
 
109
  if ( ! WP_FS__IS_PRODUCTION_MODE ) {
115
 
116
  if ( $this->_fs->is_premium() ) {
117
  if ( ! $this->is_correct_folder_name() ) {
118
+ add_filter( 'upgrader_post_install', array( $this, '_maybe_update_folder_name' ), 10, 3 );
119
  }
120
 
121
  add_filter( 'upgrader_pre_install', array( 'FS_Plugin_Updater', '_store_basename_for_source_adjustment' ), 1, 2 );
122
  add_filter( 'upgrader_source_selection', array( 'FS_Plugin_Updater', '_maybe_adjust_source_dir' ), 1, 3 );
123
 
124
  if ( ! $this->_fs->has_any_active_valid_license() ) {
125
+ add_filter( 'wp_prepare_themes_for_js', array( $this, 'change_theme_update_info_html' ), 10, 1 );
126
  }
127
  }
128
  }
139
  return;
140
  }
141
 
142
+ add_action( 'admin_footer', array( $this, 'edit_and_echo_plugin_information_dialog_contents' ), 0, 1 );
143
 
144
  ob_start();
145
  }
247
  }
248
 
249
  add_filter( 'pre_set_site_transient_update_plugins', array(
250
+ $this,
251
  'pre_set_site_transient_update_plugins_filter'
252
  ) );
253
 
254
  add_filter( 'pre_set_site_transient_update_themes', array(
255
+ $this,
256
  'pre_set_site_transient_update_plugins_filter'
257
  ) );
258
  }
263
  */
264
  private function remove_transient_filters() {
265
  remove_filter( 'pre_set_site_transient_update_plugins', array(
266
+ $this,
267
  'pre_set_site_transient_update_plugins_filter'
268
  ) );
269
 
270
  remove_filter( 'pre_set_site_transient_update_themes', array(
271
+ $this,
272
  'pre_set_site_transient_update_plugins_filter'
273
  ) );
274
  }
freemius/includes/class-fs-storage.php CHANGED
@@ -371,6 +371,7 @@
371
  * sites in the network.
372
  */
373
  'is_network_activation' => 0,
 
374
 
375
  // When network activated, then network level.
376
  'install_timestamp' => 1,
371
  * sites in the network.
372
  */
373
  'is_network_activation' => 0,
374
+ 'license_migration' => 0,
375
 
376
  // When network activated, then network level.
377
  'install_timestamp' => 1,
freemius/includes/customizer/class-fs-customizer-support-section.php CHANGED
@@ -87,10 +87,10 @@
87
  <div class="button-group">
88
  <# } #>
89
  <# if ( data.contact ) { #>
90
- <a class="button" href="{{ data.contact.url }}" target="_blank">{{ data.contact.label }} </a>
91
  <# } #>
92
  <# if ( data.support ) { #>
93
- <a class="button" href="{{ data.support.url }}" target="_blank">{{ data.support.label }} </a>
94
  <# } #>
95
  <# if ( data.contact && data.support ) { #>
96
  </div>
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>
freemius/includes/entities/class-fs-payment.php CHANGED
@@ -158,8 +158,8 @@
158
  // Lazy load.
159
  self::$CURRENCY_2_SYMBOL = array(
160
  self::CURRENCY_USD => '$',
161
- self::CURRENCY_GBP => '£',
162
- self::CURRENCY_EUR => '',
163
  );
164
  }
165
 
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
 
freemius/includes/entities/class-fs-plugin-license.php CHANGED
@@ -50,6 +50,13 @@
50
  * @var number
51
  */
52
  public $parent_license_id;
 
 
 
 
 
 
 
53
  /**
54
  * @var number
55
  */
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
  */
freemius/includes/entities/class-fs-site.php CHANGED
@@ -171,6 +171,7 @@
171
  // WPEngine staging.
172
  fs_ends_with( $subdomain, '.staging.wpengine.com' ) ||
173
  fs_ends_with( $subdomain, '.dev.wpengine.com' ) ||
 
174
  // Pantheon
175
  ( fs_ends_with( $subdomain, 'pantheonsite.io' ) &&
176
  ( fs_starts_with( $subdomain, 'test-' ) || fs_starts_with( $subdomain, 'dev-' ) ) ) ||
@@ -179,7 +180,9 @@
179
  // Kinsta
180
  ( fs_starts_with( $subdomain, 'staging-' ) && ( fs_ends_with( $subdomain, '.kinsta.com' ) || fs_ends_with( $subdomain, '.kinsta.cloud' ) ) ) ||
181
  // DesktopServer
182
- fs_ends_with( $subdomain, '.dev.cc' )
 
 
183
  );
184
  }
185
 
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-' ) ) ) ||
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
 
freemius/includes/fs-essential-functions.php CHANGED
@@ -380,45 +380,62 @@
380
  global $fs_active_plugins;
381
 
382
  /**
383
- * @todo Multi-site network activated plugin are always loaded prior to site plugins so if there's a a plugin activated in the network mode that has an older version of the SDK of another plugin which is site activated that has new SDK version, the fs-essential-functions.php will be loaded from the older SDK. Same thing about MU plugins (loaded even before network activated plugins).
384
  *
385
  * @link https://github.com/Freemius/wordpress-sdk/issues/26
386
  */
387
 
388
  $newest_sdk_plugin_path = $fs_active_plugins->newest->plugin_path;
389
 
390
- $active_plugins = get_option( 'active_plugins', array() );
391
- $newest_sdk_plugin_key = array_search( $newest_sdk_plugin_path, $active_plugins );
392
- if ( 0 === $newest_sdk_plugin_key ) {
393
- // if it's 0 it's the first plugin already, no need to continue
394
- return false;
395
- } else if ( is_numeric( $newest_sdk_plugin_key ) ) {
396
- // Remove plugin from its current position.
397
- array_splice( $active_plugins, $newest_sdk_plugin_key, 1 );
398
 
399
- // Set it to be included first.
400
- array_unshift( $active_plugins, $newest_sdk_plugin_path );
401
 
402
- update_option( 'active_plugins', $active_plugins );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
403
 
404
  return true;
405
- } else if ( is_multisite() && false === $newest_sdk_plugin_key ) {
 
 
406
  // Plugin is network active.
407
  $network_active_plugins = get_site_option( 'active_sitewide_plugins', array() );
408
 
409
- if (isset($network_active_plugins[$newest_sdk_plugin_path])) {
410
- reset($network_active_plugins);
411
- if ( $newest_sdk_plugin_path === key($network_active_plugins) ) {
412
  // Plugin is already activated first on the network level.
413
  return false;
414
- } else if ( is_numeric( $newest_sdk_plugin_key ) ) {
415
- $time = $network_active_plugins[$newest_sdk_plugin_path];
416
 
417
  // Remove plugin from its current position.
418
- unset($network_active_plugins[$newest_sdk_plugin_path]);
419
 
420
  // Set it to be included first.
421
- $network_active_plugins = array($newest_sdk_plugin_path => $time) + $network_active_plugins;
422
 
423
  update_site_option( 'active_sitewide_plugins', $network_active_plugins );
424
 
380
  global $fs_active_plugins;
381
 
382
  /**
383
+ * @todo Multi-site network activated plugin are always loaded prior to site plugins so if there's a plugin activated in the network mode that has an older version of the SDK of another plugin which is site activated that has new SDK version, the fs-essential-functions.php will be loaded from the older SDK. Same thing about MU plugins (loaded even before network activated plugins).
384
  *
385
  * @link https://github.com/Freemius/wordpress-sdk/issues/26
386
  */
387
 
388
  $newest_sdk_plugin_path = $fs_active_plugins->newest->plugin_path;
389
 
390
+ $active_plugins = get_option( 'active_plugins', array() );
391
+ $updated_active_plugins = array( $newest_sdk_plugin_path );
 
 
 
 
 
 
392
 
393
+ $plugin_found = false;
394
+ $is_first_path = true;
395
 
396
+ foreach ( $active_plugins as $key => $plugin_path ) {
397
+ if ( $plugin_path === $newest_sdk_plugin_path ) {
398
+ if ( $is_first_path ) {
399
+ // if it's the first plugin already, no need to continue
400
+ return false;
401
+ }
402
+
403
+ $plugin_found = true;
404
+
405
+ // Skip the plugin (it is already added as the 1st item of $updated_active_plugins).
406
+ continue;
407
+ }
408
+
409
+ $updated_active_plugins[] = $plugin_path;
410
+
411
+ if ( $is_first_path ) {
412
+ $is_first_path = false;
413
+ }
414
+ }
415
+
416
+ if ( $plugin_found ) {
417
+ update_option( 'active_plugins', $updated_active_plugins );
418
 
419
  return true;
420
+ }
421
+
422
+ if ( is_multisite() ) {
423
  // Plugin is network active.
424
  $network_active_plugins = get_site_option( 'active_sitewide_plugins', array() );
425
 
426
+ if ( isset( $network_active_plugins[ $newest_sdk_plugin_path ] ) ) {
427
+ reset( $network_active_plugins );
428
+ if ( $newest_sdk_plugin_path === key( $network_active_plugins ) ) {
429
  // Plugin is already activated first on the network level.
430
  return false;
431
+ } else {
432
+ $time = $network_active_plugins[ $newest_sdk_plugin_path ];
433
 
434
  // Remove plugin from its current position.
435
+ unset( $network_active_plugins[ $newest_sdk_plugin_path ] );
436
 
437
  // Set it to be included first.
438
+ $network_active_plugins = array( $newest_sdk_plugin_path => $time ) + $network_active_plugins;
439
 
440
  update_site_option( 'active_sitewide_plugins', $network_active_plugins );
441
 
freemius/includes/fs-plugin-info-dialog.php CHANGED
@@ -63,12 +63,12 @@
63
  remove_all_actions( 'install_plugins_pre_plugin-information' );
64
 
65
  // Override action with custom plugins function for add-ons.
66
- add_action( 'install_plugins_pre_plugin-information', array( &$this, 'install_plugin_information' ) );
67
 
68
  // Override request for plugin information for Add-ons.
69
  add_filter(
70
  'fs_plugins_api',
71
- array( &$this, '_get_addon_info_filter' ),
72
  WP_FS__DEFAULT_PRIORITY, 3 );
73
  }
74
 
@@ -880,9 +880,11 @@
880
  $classes[] = 'disabled';
881
  }
882
 
 
 
883
  return sprintf(
884
  '<a %s class="button %s">%s</a>',
885
- empty( $href ) ? '' : 'href="' . $href . '" target="' . $target . '"',
886
  implode( ' ', $classes ),
887
  $label
888
  );
@@ -1367,6 +1369,7 @@
1367
  if ( ! empty( $api->slug ) && true == $api->is_wp_org_compliant ) {
1368
  ?>
1369
  <li><a target="_blank"
 
1370
  href="https://wordpress.org/plugins/<?php echo $api->slug; ?>/"><?php fs_esc_html_echo_inline( 'WordPress.org Plugin Page', 'wp-org-plugin-page', $api->slug ) ?>
1371
  &#187;</a>
1372
  </li>
@@ -1375,6 +1378,7 @@
1375
  if ( ! empty( $api->homepage ) ) {
1376
  ?>
1377
  <li><a target="_blank"
 
1378
  href="<?php echo esc_url( $api->homepage ); ?>"><?php fs_esc_html_echo_inline( 'Plugin Homepage', 'plugin-homepage', $api->slug ) ?>
1379
  &#187;</a>
1380
  </li>
@@ -1383,6 +1387,7 @@
1383
  if ( ! empty( $api->donate_link ) && empty( $api->contributors ) ) {
1384
  ?>
1385
  <li><a target="_blank"
 
1386
  href="<?php echo esc_url( $api->donate_link ); ?>"><?php fs_esc_html_echo_inline( 'Donate to this plugin', 'donate-to-plugin', $api->slug ) ?>
1387
  &#187;</a>
1388
  </li>
@@ -1426,18 +1431,19 @@
1426
  );
1427
  ?>
1428
  <div class="counter-container">
1429
- <span class="counter-label"><a
1430
- href="https://wordpress.org/support/view/plugin-reviews/<?php echo $api->slug; ?>?filter=<?php echo $key; ?>"
1431
- target="_blank"
1432
- title="<?php echo esc_attr( sprintf(
1433
- /* translators: %s: # of stars (e.g. 5 stars) */
1434
- fs_text_inline( 'Click to see reviews that provided a rating of %s', 'click-to-reviews', $api->slug ),
1435
- $stars_label
1436
- ) ) ?>"><?php echo $stars_label ?></a></span>
 
1437
  <span class="counter-back">
1438
- <span class="counter-bar" style="width: <?php echo absint(92 * $_rating); ?>px;"></span>
1439
- </span>
1440
- <span class="counter-count"><?php echo number_format_i18n( $ratecount ); ?></span>
1441
  </div>
1442
  <?php
1443
  }
@@ -1458,13 +1464,14 @@
1458
  if ( empty( $contrib_profile ) ) {
1459
  echo "<li><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&amp;s=36' width='18' height='18' />{$contrib_username}</li>";
1460
  } else {
1461
- echo "<li><a href='{$contrib_profile}' target='_blank'><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&amp;s=36' width='18' height='18' />{$contrib_username}</a></li>";
1462
  }
1463
  }
1464
  ?>
1465
  </ul>
1466
  <?php if ( ! empty( $api->donate_link ) ) { ?>
1467
  <a target="_blank"
 
1468
  href="<?php echo esc_url( $api->donate_link ); ?>"><?php fs_echo_inline( 'Donate to this plugin', 'donate-to-plugin', $api->slug ) ?>
1469
  &#187;</a>
1470
  <?php } ?>
63
  remove_all_actions( 'install_plugins_pre_plugin-information' );
64
 
65
  // Override action with custom plugins function for add-ons.
66
+ add_action( 'install_plugins_pre_plugin-information', array( $this, 'install_plugin_information' ) );
67
 
68
  // Override request for plugin information for Add-ons.
69
  add_filter(
70
  'fs_plugins_api',
71
+ array( $this, '_get_addon_info_filter' ),
72
  WP_FS__DEFAULT_PRIORITY, 3 );
73
  }
74
 
880
  $classes[] = 'disabled';
881
  }
882
 
883
+ $rel = ( '_blank' === $target ) ? ' rel="noopener noreferrer"' : '';
884
+
885
  return sprintf(
886
  '<a %s class="button %s">%s</a>',
887
+ empty( $href ) ? '' : 'href="' . $href . '" target="' . $target . '"' . $rel,
888
  implode( ' ', $classes ),
889
  $label
890
  );
1369
  if ( ! empty( $api->slug ) && true == $api->is_wp_org_compliant ) {
1370
  ?>
1371
  <li><a target="_blank"
1372
+ rel="noopener noreferrer"
1373
  href="https://wordpress.org/plugins/<?php echo $api->slug; ?>/"><?php fs_esc_html_echo_inline( 'WordPress.org Plugin Page', 'wp-org-plugin-page', $api->slug ) ?>
1374
  &#187;</a>
1375
  </li>
1378
  if ( ! empty( $api->homepage ) ) {
1379
  ?>
1380
  <li><a target="_blank"
1381
+ rel="noopener noreferrer"
1382
  href="<?php echo esc_url( $api->homepage ); ?>"><?php fs_esc_html_echo_inline( 'Plugin Homepage', 'plugin-homepage', $api->slug ) ?>
1383
  &#187;</a>
1384
  </li>
1387
  if ( ! empty( $api->donate_link ) && empty( $api->contributors ) ) {
1388
  ?>
1389
  <li><a target="_blank"
1390
+ rel="noopener noreferrer"
1391
  href="<?php echo esc_url( $api->donate_link ); ?>"><?php fs_esc_html_echo_inline( 'Donate to this plugin', 'donate-to-plugin', $api->slug ) ?>
1392
  &#187;</a>
1393
  </li>
1431
  );
1432
  ?>
1433
  <div class="counter-container">
1434
+ <span class="counter-label"><a
1435
+ href="https://wordpress.org/support/view/plugin-reviews/<?php echo $api->slug; ?>?filter=<?php echo $key; ?>"
1436
+ target="_blank"
1437
+ rel="noopener noreferrer"
1438
+ title="<?php echo esc_attr( sprintf(
1439
+ /* translators: %s: # of stars (e.g. 5 stars) */
1440
+ fs_text_inline( 'Click to see reviews that provided a rating of %s', 'click-to-reviews', $api->slug ),
1441
+ $stars_label
1442
+ ) ) ?>"><?php echo $stars_label ?></a></span>
1443
  <span class="counter-back">
1444
+ <span class="counter-bar" style="width: <?php echo absint(92 * $_rating); ?>px;"></span>
1445
+ </span>
1446
+ <span class="counter-count"><?php echo number_format_i18n( $ratecount ); ?></span>
1447
  </div>
1448
  <?php
1449
  }
1464
  if ( empty( $contrib_profile ) ) {
1465
  echo "<li><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&amp;s=36' width='18' height='18' />{$contrib_username}</li>";
1466
  } else {
1467
+ echo "<li><a href='{$contrib_profile}' target='_blank' rel='noopener noreferrer'><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&amp;s=36' width='18' height='18' />{$contrib_username}</a></li>";
1468
  }
1469
  }
1470
  ?>
1471
  </ul>
1472
  <?php if ( ! empty( $api->donate_link ) ) { ?>
1473
  <a target="_blank"
1474
+ rel="noopener noreferrer"
1475
  href="<?php echo esc_url( $api->donate_link ); ?>"><?php fs_echo_inline( 'Donate to this plugin', 'donate-to-plugin', $api->slug ) ?>
1476
  &#187;</a>
1477
  <?php } ?>
freemius/includes/managers/class-fs-admin-menu-manager.php CHANGED
@@ -703,7 +703,12 @@
703
  $menu['parent_slug'] :
704
  'admin.php';
705
 
706
- return admin_url( $parent_slug . '?page=' . $menu['menu'][2] );
 
 
 
 
 
707
  }
708
 
709
  /**
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
  /**
freemius/includes/managers/class-fs-admin-notice-manager.php CHANGED
@@ -145,7 +145,7 @@
145
  // If there are sticky notices for the current slug, add a callback
146
  // to the AJAX action that handles message dismiss.
147
  add_action( "wp_ajax_fs_dismiss_notice_action_{$ajax_action_suffix}", array(
148
- &$this,
149
  'dismiss_notice_ajax_callback'
150
  ) );
151
 
@@ -352,13 +352,13 @@
352
 
353
  if ( empty( $this->_notices ) ) {
354
  if ( ! $is_network_and_blog_admins ) {
355
- add_action( $notices_type, array( &$this, "_admin_notices_hook" ) );
356
  } else {
357
- add_action( 'network_admin_notices', array( &$this, "_admin_notices_hook" ) );
358
- add_action( 'admin_notices', array( &$this, "_admin_notices_hook" ) );
359
  }
360
 
361
- add_action( 'admin_enqueue_scripts', array( &$this, '_enqueue_styles' ) );
362
  }
363
 
364
  if ( '' === $id ) {
145
  // If there are sticky notices for the current slug, add a callback
146
  // to the AJAX action that handles message dismiss.
147
  add_action( "wp_ajax_fs_dismiss_notice_action_{$ajax_action_suffix}", array(
148
+ $this,
149
  'dismiss_notice_ajax_callback'
150
  ) );
151
 
352
 
353
  if ( empty( $this->_notices ) ) {
354
  if ( ! $is_network_and_blog_admins ) {
355
+ add_action( $notices_type, array( $this, "_admin_notices_hook" ) );
356
  } else {
357
+ add_action( 'network_admin_notices', array( $this, "_admin_notices_hook" ) );
358
+ add_action( 'admin_notices', array( $this, "_admin_notices_hook" ) );
359
  }
360
 
361
+ add_action( 'admin_enqueue_scripts', array( $this, '_enqueue_styles' ) );
362
  }
363
 
364
  if ( '' === $id ) {
freemius/includes/sdk/FreemiusBase.php CHANGED
@@ -137,7 +137,7 @@
137
  } catch ( Exception $e ) {
138
  // Map to error object.
139
  $result = (object) array(
140
- 'error' => array(
141
  'type' => 'Unknown',
142
  'message' => $e->getMessage() . ' (' . $e->getFile() . ': ' . $e->getLine() . ')',
143
  'code' => 'unknown',
137
  } catch ( Exception $e ) {
138
  // Map to error object.
139
  $result = (object) array(
140
+ 'error' => (object) array(
141
  'type' => 'Unknown',
142
  'message' => $e->getMessage() . ' (' . $e->getFile() . ': ' . $e->getLine() . ')',
143
  'code' => 'unknown',
freemius/includes/sdk/FreemiusWordPress.php CHANGED
@@ -228,10 +228,13 @@
228
  $now = ( time() - self::$_clock_diff );
229
  $date = date( 'r', $now );
230
 
231
- if ( in_array( $pMethod, array( 'POST', 'PUT' ) ) && ! empty( $pPostParams ) ) {
232
- $content_md5 = md5( $pPostParams );
233
- $content_type = 'application/json';
234
- }
 
 
 
235
 
236
  $string_to_sign = implode( $eol, array(
237
  $pMethod,
@@ -380,10 +383,11 @@
380
  }
381
 
382
  if ( in_array( $pMethod, array( 'POST', 'PUT' ) ) ) {
383
- if ( is_array( $pParams ) && 0 < count( $pParams ) ) {
384
- $pWPRemoteArgs['headers']['Content-type'] = 'application/json';
385
- $pWPRemoteArgs['body'] = json_encode( $pParams );
386
- }
 
387
  }
388
 
389
  $request_url = self::GetUrl( $pCanonizedPath, $pIsSandbox );
@@ -509,7 +513,7 @@
509
  $pParams,
510
  $pWPRemoteArgs,
511
  $this->_isSandbox,
512
- $sign_request ? array( &$this, 'SignRequest' ) : null
513
  );
514
  }
515
 
@@ -570,7 +574,7 @@
570
  } catch ( Exception $e ) {
571
  // Map to error object.
572
  $result = (object) array(
573
- 'error' => array(
574
  'type' => 'Unknown',
575
  'message' => $e->getMessage() . ' (' . $e->getFile() . ': ' . $e->getLine() . ')',
576
  'code' => 'unknown',
@@ -649,7 +653,7 @@
649
  $message = ( 1 < count( $parts ) ) ? $parts[1] : $message;
650
 
651
  $e = new Freemius_Exception( array(
652
- 'error' => array(
653
  'code' => $code,
654
  'message' => $message,
655
  'type' => 'CurlException',
@@ -657,7 +661,7 @@
657
  ) );
658
  } else {
659
  $e = new Freemius_Exception( array(
660
- 'error' => array(
661
  'code' => $pError->get_error_code(),
662
  'message' => $pError->get_error_message(),
663
  'type' => 'WPRemoteException',
228
  $now = ( time() - self::$_clock_diff );
229
  $date = date( 'r', $now );
230
 
231
+ if ( in_array( $pMethod, array( 'POST', 'PUT' ) ) ) {
232
+ $content_type = 'application/json';
233
+
234
+ if ( ! empty( $pPostParams ) ) {
235
+ $content_md5 = md5( $pPostParams );
236
+ }
237
+ }
238
 
239
  $string_to_sign = implode( $eol, array(
240
  $pMethod,
383
  }
384
 
385
  if ( in_array( $pMethod, array( 'POST', 'PUT' ) ) ) {
386
+ $pWPRemoteArgs['headers']['Content-type'] = 'application/json';
387
+
388
+ if ( is_array( $pParams ) && 0 < count( $pParams ) ) {
389
+ $pWPRemoteArgs['body'] = json_encode( $pParams );
390
+ }
391
  }
392
 
393
  $request_url = self::GetUrl( $pCanonizedPath, $pIsSandbox );
513
  $pParams,
514
  $pWPRemoteArgs,
515
  $this->_isSandbox,
516
+ $sign_request ? array( $this, 'SignRequest' ) : null
517
  );
518
  }
519
 
574
  } catch ( Exception $e ) {
575
  // Map to error object.
576
  $result = (object) array(
577
+ 'error' => (object) array(
578
  'type' => 'Unknown',
579
  'message' => $e->getMessage() . ' (' . $e->getFile() . ': ' . $e->getLine() . ')',
580
  'code' => 'unknown',
653
  $message = ( 1 < count( $parts ) ) ? $parts[1] : $message;
654
 
655
  $e = new Freemius_Exception( array(
656
+ 'error' => (object) array(
657
  'code' => $code,
658
  'message' => $message,
659
  'type' => 'CurlException',
661
  ) );
662
  } else {
663
  $e = new Freemius_Exception( array(
664
+ 'error' => (object) array(
665
  'code' => $pError->get_error_code(),
666
  'message' => $pError->get_error_message(),
667
  'type' => 'WPRemoteException',
freemius/includes/supplements/fs-essential-functions-1.1.7.1.php CHANGED
@@ -32,7 +32,7 @@
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
  }
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
  }
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 ADDED
Binary file
freemius/languages/freemius.pot CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2019 freemius
2
  # This file is distributed under the same license as the freemius package.
3
  msgid ""
4
  msgstr ""
@@ -16,771 +16,771 @@ msgstr ""
16
  "X-Poedit-SourceCharset: UTF-8\n"
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
 
19
- #: includes/class-freemius.php:1881, templates/account.php:873
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:1888
24
  msgid "Would you like to proceed with the update?"
25
  msgstr ""
26
 
27
- #: includes/class-freemius.php:2096
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:2098
32
  msgid "Error"
33
  msgstr ""
34
 
35
- #: includes/class-freemius.php:2492
36
  msgid "I found a better %s"
37
  msgstr ""
38
 
39
- #: includes/class-freemius.php:2494
40
  msgid "What's the %s's name?"
41
  msgstr ""
42
 
43
- #: includes/class-freemius.php:2500
44
  msgid "It's a temporary %s. I'm just debugging an issue."
45
  msgstr ""
46
 
47
- #: includes/class-freemius.php:2502
48
  msgid "Deactivation"
49
  msgstr ""
50
 
51
- #: includes/class-freemius.php:2503
52
  msgid "Theme Switch"
53
  msgstr ""
54
 
55
- #: includes/class-freemius.php:2512, templates/forms/resend-key.php:24, templates/forms/user-change.php:29
56
  msgid "Other"
57
  msgstr ""
58
 
59
- #: includes/class-freemius.php:2520
60
  msgid "I no longer need the %s"
61
  msgstr ""
62
 
63
- #: includes/class-freemius.php:2527
64
  msgid "I only needed the %s for a short period"
65
  msgstr ""
66
 
67
- #: includes/class-freemius.php:2533
68
  msgid "The %s broke my site"
69
  msgstr ""
70
 
71
- #: includes/class-freemius.php:2540
72
  msgid "The %s suddenly stopped working"
73
  msgstr ""
74
 
75
- #: includes/class-freemius.php:2550
76
  msgid "I can't pay for it anymore"
77
  msgstr ""
78
 
79
- #: includes/class-freemius.php:2552
80
  msgid "What price would you feel comfortable paying?"
81
  msgstr ""
82
 
83
- #: includes/class-freemius.php:2558
84
  msgid "I don't like to share my information with you"
85
  msgstr ""
86
 
87
- #: includes/class-freemius.php:2579
88
  msgid "The %s didn't work"
89
  msgstr ""
90
 
91
- #: includes/class-freemius.php:2589
92
  msgid "I couldn't understand how to make it work"
93
  msgstr ""
94
 
95
- #: includes/class-freemius.php:2597
96
  msgid "The %s is great, but I need specific feature that you don't support"
97
  msgstr ""
98
 
99
- #: includes/class-freemius.php:2599
100
  msgid "What feature?"
101
  msgstr ""
102
 
103
- #: includes/class-freemius.php:2603
104
  msgid "The %s is not working"
105
  msgstr ""
106
 
107
- #: includes/class-freemius.php:2605
108
  msgid "Kindly share what didn't work so we can fix it for future users..."
109
  msgstr ""
110
 
111
- #: includes/class-freemius.php:2609
112
  msgid "It's not what I was looking for"
113
  msgstr ""
114
 
115
- #: includes/class-freemius.php:2611
116
  msgid "What you've been looking for?"
117
  msgstr ""
118
 
119
- #: includes/class-freemius.php:2615
120
  msgid "The %s didn't work as expected"
121
  msgstr ""
122
 
123
- #: includes/class-freemius.php:2617
124
  msgid "What did you expect?"
125
  msgstr ""
126
 
127
- #: includes/class-freemius.php:3472, templates/debug.php:20
128
  msgid "Freemius Debug"
129
  msgstr ""
130
 
131
- #: includes/class-freemius.php:4224
132
  msgid "I don't know what is cURL or how to install it, help me!"
133
  msgstr ""
134
 
135
- #: includes/class-freemius.php:4226
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:4233
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:4338
144
  msgid "Yes - do your thing"
145
  msgstr ""
146
 
147
- #: includes/class-freemius.php:4343
148
  msgid "No - just deactivate"
149
  msgstr ""
150
 
151
- #: includes/class-freemius.php:4388, includes/class-freemius.php:4882, includes/class-freemius.php:6111, includes/class-freemius.php:12933, includes/class-freemius.php:13571, includes/class-freemius.php:17006, includes/class-freemius.php:17094, includes/class-freemius.php:17260, includes/class-freemius.php:19492, includes/class-freemius.php:19833, includes/class-freemius.php:19843, includes/class-freemius.php:20507, includes/class-freemius.php:21413, includes/class-freemius.php:21546, includes/class-freemius.php:21690, templates/add-ons.php:57
152
  msgctxt "exclamation"
153
  msgid "Oops"
154
  msgstr ""
155
 
156
- #: includes/class-freemius.php:4457
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:4879
161
  msgctxt "addonX cannot run without pluginY"
162
  msgid "%s cannot run without %s."
163
  msgstr ""
164
 
165
- #: includes/class-freemius.php:4880
166
  msgctxt "addonX cannot run..."
167
  msgid "%s cannot run without the plugin."
168
  msgstr ""
169
 
170
- #: includes/class-freemius.php:5053, includes/class-freemius.php:5078, includes/class-freemius.php:20578
171
  msgid "Unexpected API error. Please contact the %s's author with the following error."
172
  msgstr ""
173
 
174
- #: includes/class-freemius.php:5777
175
  msgid "Premium %s version was successfully activated."
176
  msgstr ""
177
 
178
- #: includes/class-freemius.php:5789, includes/class-freemius.php:7682
179
  msgctxt "Used to express elation, enthusiasm, or triumph (especially in electronic communication)."
180
  msgid "W00t"
181
  msgstr ""
182
 
183
- #: includes/class-freemius.php:5804
184
  msgid "You have a %s license."
185
  msgstr ""
186
 
187
- #: includes/class-freemius.php:5808, includes/class-freemius.php:16405, includes/class-freemius.php:16416, includes/class-freemius.php:19744, includes/class-freemius.php:20094, includes/class-freemius.php:20163, includes/class-freemius.php:20328
188
  msgctxt "interjection expressing joy or exuberance"
189
  msgid "Yee-haw"
190
  msgstr ""
191
 
192
- #: includes/class-freemius.php:6094
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:6098
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:6107, 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:6108
205
  msgid "Purchase License"
206
  msgstr ""
207
 
208
- #: includes/class-freemius.php:7047, 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:7051
213
  msgid "start the trial"
214
  msgstr ""
215
 
216
- #: includes/class-freemius.php:7052, templates/connect.php:175
217
  msgid "complete the install"
218
  msgstr ""
219
 
220
- #: includes/class-freemius.php:7164
221
  msgid "You are just one step away - %s"
222
  msgstr ""
223
 
224
- #: includes/class-freemius.php:7167
225
  msgctxt "%s - plugin name. As complete \"PluginX\" activation now"
226
  msgid "Complete \"%s\" Activation Now"
227
  msgstr ""
228
 
229
- #: includes/class-freemius.php:7245
230
  msgid "We made a few tweaks to the %s, %s"
231
  msgstr ""
232
 
233
- #: includes/class-freemius.php:7249
234
  msgid "Opt in to make \"%s\" better!"
235
  msgstr ""
236
 
237
- #: includes/class-freemius.php:7681
238
  msgid "The upgrade of %s was successfully completed."
239
  msgstr ""
240
 
241
- #: includes/class-freemius.php:9908, 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:9910, templates/account.php:343, templates/account.php:351, templates/debug.php:358, templates/debug.php:549
246
  msgid "Plugin"
247
  msgstr ""
248
 
249
- #: includes/class-freemius.php:9911, templates/account.php:344, templates/account.php:352, 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:12843
254
  msgid "An unknown error has occurred while trying to set the user's beta mode."
255
  msgstr ""
256
 
257
- #: includes/class-freemius.php:12904
258
  msgid "Invalid new user ID or email address."
259
  msgstr ""
260
 
261
- #: includes/class-freemius.php:12934, includes/class-freemius.php:21645
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:12935, includes/class-freemius.php:21646
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:12942, includes/class-freemius.php:21653
270
  msgid "Change Ownership"
271
  msgstr ""
272
 
273
- #: includes/class-freemius.php:13438
274
  msgid "Invalid site details collection."
275
  msgstr ""
276
 
277
- #: includes/class-freemius.php:13558
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:13560
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:13834
286
  msgid "Account is pending activation."
287
  msgstr ""
288
 
289
- #: includes/class-freemius.php:13946, templates/forms/premium-versions-upgrade-handler.php:47
290
  msgid "Buy a license now"
291
  msgstr ""
292
 
293
- #: includes/class-freemius.php:13958, templates/forms/premium-versions-upgrade-handler.php:46
294
  msgid "Renew your license now"
295
  msgstr ""
296
 
297
- #: includes/class-freemius.php:13962
298
  msgid "%s to access version %s security & feature updates, and support."
299
  msgstr ""
300
 
301
- #: includes/class-freemius.php:16387
302
  msgid "%s activation was successfully completed."
303
  msgstr ""
304
 
305
- #: includes/class-freemius.php:16401
306
  msgid "Your account was successfully activated with the %s plan."
307
  msgstr ""
308
 
309
- #: includes/class-freemius.php:16412, includes/class-freemius.php:20159
310
  msgid "Your trial has been successfully started."
311
  msgstr ""
312
 
313
- #: includes/class-freemius.php:17004, includes/class-freemius.php:17092, includes/class-freemius.php:17258
314
  msgid "Couldn't activate %s."
315
  msgstr ""
316
 
317
- #: includes/class-freemius.php:17005, includes/class-freemius.php:17093, includes/class-freemius.php:17259
318
  msgid "Please contact us with the following message:"
319
  msgstr ""
320
 
321
- #: includes/class-freemius.php:17089, templates/forms/data-debug-mode.php:162
322
  msgid "An unknown error has occurred."
323
  msgstr ""
324
 
325
- #: includes/class-freemius.php:17616, includes/class-freemius.php:22589
326
  msgid "Upgrade"
327
  msgstr ""
328
 
329
- #: includes/class-freemius.php:17622
330
  msgid "Start Trial"
331
  msgstr ""
332
 
333
- #: includes/class-freemius.php:17624
334
  msgid "Pricing"
335
  msgstr ""
336
 
337
- #: includes/class-freemius.php:17704, includes/class-freemius.php:17706
338
  msgid "Affiliation"
339
  msgstr ""
340
 
341
- #: includes/class-freemius.php:17734, includes/class-freemius.php:17736, templates/account.php:191, templates/debug.php:324
342
  msgid "Account"
343
  msgstr ""
344
 
345
- #: includes/class-freemius.php:17750, includes/class-freemius.php:17752, includes/customizer/class-fs-customizer-support-section.php:60
346
  msgid "Contact Us"
347
  msgstr ""
348
 
349
- #: includes/class-freemius.php:17763, includes/class-freemius.php:17765, includes/class-freemius.php:22603, templates/account.php:119, templates/account/partials/addon.php:44
350
  msgid "Add-Ons"
351
  msgstr ""
352
 
353
- #: includes/class-freemius.php:17799
354
  msgctxt "ASCII arrow left icon"
355
  msgid "&#x2190;"
356
  msgstr ""
357
 
358
- #: includes/class-freemius.php:17799
359
  msgctxt "ASCII arrow right icon"
360
  msgid "&#x27a4;"
361
  msgstr ""
362
 
363
- #: includes/class-freemius.php:17801, templates/pricing.php:103
364
  msgctxt "noun"
365
  msgid "Pricing"
366
  msgstr ""
367
 
368
- #: includes/class-freemius.php:18014, includes/customizer/class-fs-customizer-support-section.php:67
369
  msgid "Support Forum"
370
  msgstr ""
371
 
372
- #: includes/class-freemius.php:18988
373
  msgid "Your email has been successfully verified - you are AWESOME!"
374
  msgstr ""
375
 
376
- #: includes/class-freemius.php:18989
377
  msgctxt "a positive response"
378
  msgid "Right on"
379
  msgstr ""
380
 
381
- #: includes/class-freemius.php:19493
382
  msgid "seems like the key you entered doesn't match our records."
383
  msgstr ""
384
 
385
- #: includes/class-freemius.php:19517
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:19735
390
  msgid "Your %s Add-on plan was successfully upgraded."
391
  msgstr ""
392
 
393
- #: includes/class-freemius.php:19737
394
  msgid "%s Add-on was successfully purchased."
395
  msgstr ""
396
 
397
- #: includes/class-freemius.php:19740
398
  msgid "Download the latest version"
399
  msgstr ""
400
 
401
- #: includes/class-freemius.php:19826
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:19832, includes/class-freemius.php:19842, includes/class-freemius.php:20287, includes/class-freemius.php:20376
406
  msgid "Error received from the server:"
407
  msgstr ""
408
 
409
- #: includes/class-freemius.php:19842
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:20056, includes/class-freemius.php:20292, includes/class-freemius.php:20347, includes/class-freemius.php:20454
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:20069
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:20070, 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:20075
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:20079, includes/class-freemius.php:20138
432
  msgid "Please contact us here"
433
  msgstr ""
434
 
435
- #: includes/class-freemius.php:20090
436
  msgid "Your plan was successfully activated."
437
  msgstr ""
438
 
439
- #: includes/class-freemius.php:20091
440
  msgid "Your plan was successfully upgraded."
441
  msgstr ""
442
 
443
- #: includes/class-freemius.php:20108
444
  msgid "Your plan was successfully changed to %s."
445
  msgstr ""
446
 
447
- #: includes/class-freemius.php:20124
448
  msgid "Your license has expired. You can still continue using the free %s forever."
449
  msgstr ""
450
 
451
- #: includes/class-freemius.php:20126
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:20134
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:20147
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:20173
464
  msgid "Your free trial has expired. You can still continue using all our free features."
465
  msgstr ""
466
 
467
- #: includes/class-freemius.php:20175
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:20283
472
  msgid "It looks like the license could not be activated."
473
  msgstr ""
474
 
475
- #: includes/class-freemius.php:20325
476
  msgid "Your license was successfully activated."
477
  msgstr ""
478
 
479
- #: includes/class-freemius.php:20351
480
  msgid "It looks like your site currently doesn't have an active license."
481
  msgstr ""
482
 
483
- #: includes/class-freemius.php:20375
484
  msgid "It looks like the license deactivation failed."
485
  msgstr ""
486
 
487
- #: includes/class-freemius.php:20404
488
  msgid "Your %s license was successfully deactivated."
489
  msgstr ""
490
 
491
- #: includes/class-freemius.php:20405
492
  msgid "Your license was successfully deactivated, you are back to the %s plan."
493
  msgstr ""
494
 
495
- #: includes/class-freemius.php:20408
496
  msgid "O.K"
497
  msgstr ""
498
 
499
- #: includes/class-freemius.php:20461
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:20470
504
  msgid "Your subscription was successfully cancelled. Your %s plan license will expire in %s."
505
  msgstr ""
506
 
507
- #: includes/class-freemius.php:20512
508
  msgid "You are already running the %s in a trial mode."
509
  msgstr ""
510
 
511
- #: includes/class-freemius.php:20523
512
  msgid "You already utilized a trial before."
513
  msgstr ""
514
 
515
- #: includes/class-freemius.php:20537
516
  msgid "Plan %s do not exist, therefore, can't start a trial."
517
  msgstr ""
518
 
519
- #: includes/class-freemius.php:20548
520
  msgid "Plan %s does not support a trial period."
521
  msgstr ""
522
 
523
- #: includes/class-freemius.php:20559
524
  msgid "None of the %s's plans supports a trial period."
525
  msgstr ""
526
 
527
- #: includes/class-freemius.php:20609
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:20645
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:20664
536
  msgid "Your %s free trial was successfully cancelled."
537
  msgstr ""
538
 
539
- #: includes/class-freemius.php:20980
540
  msgid "Version %s was released."
541
  msgstr ""
542
 
543
- #: includes/class-freemius.php:20980
544
  msgid "Please download %s."
545
  msgstr ""
546
 
547
- #: includes/class-freemius.php:20987
548
  msgid "the latest %s version here"
549
  msgstr ""
550
 
551
- #: includes/class-freemius.php:20992
552
  msgid "New"
553
  msgstr ""
554
 
555
- #: includes/class-freemius.php:20997
556
  msgid "Seems like you got the latest release."
557
  msgstr ""
558
 
559
- #: includes/class-freemius.php:20998
560
  msgid "You are all good!"
561
  msgstr ""
562
 
563
- #: includes/class-freemius.php:21301
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:21441
568
  msgid "Site successfully opted in."
569
  msgstr ""
570
 
571
- #: includes/class-freemius.php:21442, includes/class-freemius.php:22299
572
  msgid "Awesome"
573
  msgstr ""
574
 
575
- #: includes/class-freemius.php:21458, 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:21459
580
  msgid "Thank you!"
581
  msgstr ""
582
 
583
- #: includes/class-freemius.php:21466
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:21612
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:21618
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:21623
596
  msgid "%s is the new owner of the account."
597
  msgstr ""
598
 
599
- #: includes/class-freemius.php:21625
600
  msgctxt "as congratulations"
601
  msgid "Congrats"
602
  msgstr ""
603
 
604
- #: includes/class-freemius.php:21661
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:21673
609
  msgid "Please provide your full name."
610
  msgstr ""
611
 
612
- #: includes/class-freemius.php:21678
613
  msgid "Your name was successfully updated."
614
  msgstr ""
615
 
616
- #: includes/class-freemius.php:21739
617
  msgid "You have successfully updated your %s."
618
  msgstr ""
619
 
620
- #: includes/class-freemius.php:21879
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:21880
625
  msgctxt "advance notice of something that will need attention."
626
  msgid "Heads up"
627
  msgstr ""
628
 
629
- #: includes/class-freemius.php:22339
630
  msgctxt "exclamation"
631
  msgid "Hey"
632
  msgstr ""
633
 
634
- #: includes/class-freemius.php:22339
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:22347
639
  msgid "No commitment for %s days - cancel anytime!"
640
  msgstr ""
641
 
642
- #: includes/class-freemius.php:22348
643
  msgid "No credit card required"
644
  msgstr ""
645
 
646
- #: includes/class-freemius.php:22355, templates/forms/trial-start.php:53
647
  msgctxt "call to action"
648
  msgid "Start free trial"
649
  msgstr ""
650
 
651
- #: includes/class-freemius.php:22432
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:22441
656
  msgid "Learn more"
657
  msgstr ""
658
 
659
- #: includes/class-freemius.php:22627, templates/account.php:507, templates/account.php:657, 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:22628, templates/account.php:601, templates/account.php:656, templates/account/partials/addon.php:322, templates/account/partials/site.php:271
664
  msgid "Change License"
665
  msgstr ""
666
 
667
- #: includes/class-freemius.php:22737, templates/account/partials/site.php:169
668
  msgid "Opt Out"
669
  msgstr ""
670
 
671
- #: includes/class-freemius.php:22739, includes/class-freemius.php:22745, templates/account/partials/site.php:49, templates/account/partials/site.php:169
672
  msgid "Opt In"
673
  msgstr ""
674
 
675
- #: includes/class-freemius.php:22973
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:22981
680
  msgid "Activate %s features"
681
  msgstr ""
682
 
683
- #: includes/class-freemius.php:22994
684
  msgid "Please follow these steps to complete the upgrade"
685
  msgstr ""
686
 
687
- #: includes/class-freemius.php:22998
688
  msgid "Download the latest %s version"
689
  msgstr ""
690
 
691
- #: includes/class-freemius.php:23002
692
  msgid "Upload and activate the downloaded version"
693
  msgstr ""
694
 
695
- #: includes/class-freemius.php:23004
696
  msgid "How to upload and activate?"
697
  msgstr ""
698
 
699
- #: includes/class-freemius.php:23138
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:23299
704
  msgid "Auto installation only works for opted-in users."
705
  msgstr ""
706
 
707
- #: includes/class-freemius.php:23309, includes/class-freemius.php:23342, 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:23318, includes/class-fs-plugin-updater.php:1254
712
  msgid "Premium version already active."
713
  msgstr ""
714
 
715
- #: includes/class-freemius.php:23325
716
  msgid "You do not have a valid license to access the premium version."
717
  msgstr ""
718
 
719
- #: includes/class-freemius.php:23332
720
  msgid "Plugin is a \"Serviceware\" which means it does not have a premium code version."
721
  msgstr ""
722
 
723
- #: includes/class-freemius.php:23350, includes/class-fs-plugin-updater.php:1253
724
  msgid "Premium add-on version already installed."
725
  msgstr ""
726
 
727
- #: includes/class-freemius.php:23700
728
  msgid "View paid features"
729
  msgstr ""
730
 
731
- #: includes/class-freemius.php:24022
732
  msgid "Thank you so much for using %s and its add-ons!"
733
  msgstr ""
734
 
735
- #: includes/class-freemius.php:24023
736
  msgid "Thank you so much for using %s!"
737
  msgstr ""
738
 
739
- #: includes/class-freemius.php:24029
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:24033
744
  msgid "Thank you so much for using our products!"
745
  msgstr ""
746
 
747
- #: includes/class-freemius.php:24034
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:24053
752
  msgid "%s and its add-ons"
753
  msgstr ""
754
 
755
- #: includes/class-freemius.php:24062
756
  msgid "Products"
757
  msgstr ""
758
 
759
- #: includes/class-freemius.php:24069, templates/connect.php:280
760
  msgid "Yes"
761
  msgstr ""
762
 
763
- #: includes/class-freemius.php:24070, templates/connect.php:281
764
  msgid "send me security & feature updates, educational content and offers."
765
  msgstr ""
766
 
767
- #: includes/class-freemius.php:24071, templates/connect.php:286
768
  msgid "No"
769
  msgstr ""
770
 
771
- #: includes/class-freemius.php:24073, 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:24083
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:24085, 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:24367
784
  msgid "License key is empty."
785
  msgstr ""
786
 
@@ -837,7 +837,7 @@ msgstr ""
837
  msgid "Install Free Version Update Now"
838
  msgstr ""
839
 
840
- #: includes/fs-plugin-info-dialog.php:739, templates/account.php:590
841
  msgid "Install Update Now"
842
  msgstr ""
843
 
@@ -871,251 +871,251 @@ msgstr ""
871
  msgid "Activate"
872
  msgstr ""
873
 
874
- #: includes/fs-plugin-info-dialog.php:994
875
  msgctxt "Plugin installer section title"
876
  msgid "Description"
877
  msgstr ""
878
 
879
- #: includes/fs-plugin-info-dialog.php:995
880
  msgctxt "Plugin installer section title"
881
  msgid "Installation"
882
  msgstr ""
883
 
884
- #: includes/fs-plugin-info-dialog.php:996
885
  msgctxt "Plugin installer section title"
886
  msgid "FAQ"
887
  msgstr ""
888
 
889
- #: includes/fs-plugin-info-dialog.php:997, templates/plugin-info/description.php:55
890
  msgid "Screenshots"
891
  msgstr ""
892
 
893
- #: includes/fs-plugin-info-dialog.php:998
894
  msgctxt "Plugin installer section title"
895
  msgid "Changelog"
896
  msgstr ""
897
 
898
- #: includes/fs-plugin-info-dialog.php:999
899
  msgctxt "Plugin installer section title"
900
  msgid "Reviews"
901
  msgstr ""
902
 
903
- #: includes/fs-plugin-info-dialog.php:1000
904
  msgctxt "Plugin installer section title"
905
  msgid "Other Notes"
906
  msgstr ""
907
 
908
- #: includes/fs-plugin-info-dialog.php:1015
909
  msgctxt "Plugin installer section title"
910
  msgid "Features & Pricing"
911
  msgstr ""
912
 
913
- #: includes/fs-plugin-info-dialog.php:1025
914
  msgid "Plugin Install"
915
  msgstr ""
916
 
917
- #: includes/fs-plugin-info-dialog.php:1097
918
  msgctxt "e.g. Professional Plan"
919
  msgid "%s Plan"
920
  msgstr ""
921
 
922
- #: includes/fs-plugin-info-dialog.php:1123
923
  msgctxt "e.g. the best product"
924
  msgid "Best"
925
  msgstr ""
926
 
927
- #: includes/fs-plugin-info-dialog.php:1129, includes/fs-plugin-info-dialog.php:1149
928
  msgctxt "as every month"
929
  msgid "Monthly"
930
  msgstr ""
931
 
932
- #: includes/fs-plugin-info-dialog.php:1132
933
  msgctxt "as once a year"
934
  msgid "Annual"
935
  msgstr ""
936
 
937
- #: includes/fs-plugin-info-dialog.php:1135
938
  msgid "Lifetime"
939
  msgstr ""
940
 
941
- #: includes/fs-plugin-info-dialog.php:1149, includes/fs-plugin-info-dialog.php:1151, includes/fs-plugin-info-dialog.php:1153
942
  msgctxt "e.g. billed monthly"
943
  msgid "Billed %s"
944
  msgstr ""
945
 
946
- #: includes/fs-plugin-info-dialog.php:1151
947
  msgctxt "as once a year"
948
  msgid "Annually"
949
  msgstr ""
950
 
951
- #: includes/fs-plugin-info-dialog.php:1153
952
  msgctxt "as once a year"
953
  msgid "Once"
954
  msgstr ""
955
 
956
- #: includes/fs-plugin-info-dialog.php:1159
957
  msgid "Single Site License"
958
  msgstr ""
959
 
960
- #: includes/fs-plugin-info-dialog.php:1161
961
  msgid "Unlimited Licenses"
962
  msgstr ""
963
 
964
- #: includes/fs-plugin-info-dialog.php:1163
965
  msgid "Up to %s Sites"
966
  msgstr ""
967
 
968
- #: includes/fs-plugin-info-dialog.php:1173, templates/plugin-info/features.php:82
969
  msgctxt "as monthly period"
970
  msgid "mo"
971
  msgstr ""
972
 
973
- #: includes/fs-plugin-info-dialog.php:1180, templates/plugin-info/features.php:80
974
  msgctxt "as annual period"
975
  msgid "year"
976
  msgstr ""
977
 
978
- #: includes/fs-plugin-info-dialog.php:1234
979
  msgctxt "noun"
980
  msgid "Price"
981
  msgstr ""
982
 
983
- #: includes/fs-plugin-info-dialog.php:1282
984
  msgid "Save %s"
985
  msgstr ""
986
 
987
- #: includes/fs-plugin-info-dialog.php:1292
988
  msgid "No commitment for %s - cancel anytime"
989
  msgstr ""
990
 
991
- #: includes/fs-plugin-info-dialog.php:1295
992
  msgid "After your free %s, pay as little as %s"
993
  msgstr ""
994
 
995
- #: includes/fs-plugin-info-dialog.php:1306
996
  msgid "Details"
997
  msgstr ""
998
 
999
- #: includes/fs-plugin-info-dialog.php:1310, 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:1317
1005
  msgctxt "as the plugin author"
1006
  msgid "Author"
1007
  msgstr ""
1008
 
1009
- #: includes/fs-plugin-info-dialog.php:1324
1010
  msgid "Last Updated"
1011
  msgstr ""
1012
 
1013
- #: includes/fs-plugin-info-dialog.php:1329, templates/account.php:476
1014
  msgctxt "x-ago"
1015
  msgid "%s ago"
1016
  msgstr ""
1017
 
1018
- #: includes/fs-plugin-info-dialog.php:1338
1019
  msgid "Requires WordPress Version"
1020
  msgstr ""
1021
 
1022
- #: includes/fs-plugin-info-dialog.php:1339
1023
  msgid "%s or higher"
1024
  msgstr ""
1025
 
1026
- #: includes/fs-plugin-info-dialog.php:1346
1027
  msgid "Compatible up to"
1028
  msgstr ""
1029
 
1030
- #: includes/fs-plugin-info-dialog.php:1354
1031
  msgid "Downloaded"
1032
  msgstr ""
1033
 
1034
- #: includes/fs-plugin-info-dialog.php:1358
1035
  msgid "%s time"
1036
  msgstr ""
1037
 
1038
- #: includes/fs-plugin-info-dialog.php:1360
1039
  msgid "%s times"
1040
  msgstr ""
1041
 
1042
- #: includes/fs-plugin-info-dialog.php:1370
1043
  msgid "WordPress.org Plugin Page"
1044
  msgstr ""
1045
 
1046
- #: includes/fs-plugin-info-dialog.php:1378
1047
  msgid "Plugin Homepage"
1048
  msgstr ""
1049
 
1050
- #: includes/fs-plugin-info-dialog.php:1386, includes/fs-plugin-info-dialog.php:1468
1051
  msgid "Donate to this plugin"
1052
  msgstr ""
1053
 
1054
- #: includes/fs-plugin-info-dialog.php:1393
1055
  msgid "Average Rating"
1056
  msgstr ""
1057
 
1058
- #: includes/fs-plugin-info-dialog.php:1400
1059
  msgid "based on %s"
1060
  msgstr ""
1061
 
1062
- #: includes/fs-plugin-info-dialog.php:1404
1063
  msgid "%s rating"
1064
  msgstr ""
1065
 
1066
- #: includes/fs-plugin-info-dialog.php:1406
1067
  msgid "%s ratings"
1068
  msgstr ""
1069
 
1070
- #: includes/fs-plugin-info-dialog.php:1421
1071
  msgid "%s star"
1072
  msgstr ""
1073
 
1074
- #: includes/fs-plugin-info-dialog.php:1423
1075
  msgid "%s stars"
1076
  msgstr ""
1077
 
1078
- #: includes/fs-plugin-info-dialog.php:1434
1079
  msgid "Click to see reviews that provided a rating of %s"
1080
  msgstr ""
1081
 
1082
- #: includes/fs-plugin-info-dialog.php:1447
1083
  msgid "Contributors"
1084
  msgstr ""
1085
 
1086
- #: includes/fs-plugin-info-dialog.php:1476, includes/fs-plugin-info-dialog.php:1478
1087
  msgid "Warning"
1088
  msgstr ""
1089
 
1090
- #: includes/fs-plugin-info-dialog.php:1476
1091
  msgid "This plugin has not been tested with your current version of WordPress."
1092
  msgstr ""
1093
 
1094
- #: includes/fs-plugin-info-dialog.php:1478
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:1497
1099
  msgid "Paid add-on must be deployed to Freemius."
1100
  msgstr ""
1101
 
1102
- #: includes/fs-plugin-info-dialog.php:1498
1103
  msgid "Add-on must be deployed to WordPress.org or Freemius."
1104
  msgstr ""
1105
 
1106
- #: includes/fs-plugin-info-dialog.php:1519
1107
  msgid "Newer Version (%s) Installed"
1108
  msgstr ""
1109
 
1110
- #: includes/fs-plugin-info-dialog.php:1520
1111
  msgid "Newer Free Version (%s) Installed"
1112
  msgstr ""
1113
 
1114
- #: includes/fs-plugin-info-dialog.php:1527
1115
  msgid "Latest Version Installed"
1116
  msgstr ""
1117
 
1118
- #: includes/fs-plugin-info-dialog.php:1528
1119
  msgid "Latest Free Version Installed"
1120
  msgstr ""
1121
 
@@ -1199,205 +1199,205 @@ msgstr ""
1199
  msgid "Bundle Plan"
1200
  msgstr ""
1201
 
1202
- #: templates/account.php:199
1203
  msgid "Free Trial"
1204
  msgstr ""
1205
 
1206
- #: templates/account.php:210
1207
  msgid "Account Details"
1208
  msgstr ""
1209
 
1210
- #: templates/account.php:217, templates/forms/data-debug-mode.php:33
1211
  msgid "Start Debug"
1212
  msgstr ""
1213
 
1214
- #: templates/account.php:219
1215
  msgid "Stop Debug"
1216
  msgstr ""
1217
 
1218
- #: templates/account.php:226
1219
  msgid "Billing & Invoices"
1220
  msgstr ""
1221
 
1222
- #: templates/account.php:237
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:239
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:242
1231
  msgid "Delete Account"
1232
  msgstr ""
1233
 
1234
- #: templates/account.php:254, 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:277, templates/forms/subscription-cancellation.php:125
1239
  msgid "Are you sure you want to proceed?"
1240
  msgstr ""
1241
 
1242
- #: templates/account.php:277, templates/account/partials/addon.php:255
1243
  msgid "Cancel Subscription"
1244
  msgstr ""
1245
 
1246
- #: templates/account.php:306, templates/account/partials/addon.php:340
1247
  msgctxt "as synchronize"
1248
  msgid "Sync"
1249
  msgstr ""
1250
 
1251
- #: templates/account.php:321, templates/debug.php:505
1252
  msgid "Name"
1253
  msgstr ""
1254
 
1255
- #: templates/account.php:327, templates/debug.php:506
1256
  msgid "Email"
1257
  msgstr ""
1258
 
1259
- #: templates/account.php:334, templates/debug.php:369, templates/debug.php:555
1260
  msgid "User ID"
1261
  msgstr ""
1262
 
1263
- #: templates/account.php:352, templates/account.php:670, templates/account.php:715, 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:359
1268
  msgid "Site ID"
1269
  msgstr ""
1270
 
1271
- #: templates/account.php:362
1272
  msgid "No ID"
1273
  msgstr ""
1274
 
1275
- #: templates/account.php:367, 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:373, 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:376
1284
  msgctxt "as secret encryption key missing"
1285
  msgid "No Secret"
1286
  msgstr ""
1287
 
1288
- #: templates/account.php:403, templates/account/partials/site.php:120, templates/account/partials/site.php:122
1289
  msgid "Trial"
1290
  msgstr ""
1291
 
1292
- #: templates/account.php:430, templates/debug.php:561, templates/account/partials/site.php:260
1293
  msgid "License Key"
1294
  msgstr ""
1295
 
1296
- #: templates/account.php:461
1297
  msgid "Join the Beta program"
1298
  msgstr ""
1299
 
1300
- #: templates/account.php:467
1301
  msgid "not verified"
1302
  msgstr ""
1303
 
1304
- #: templates/account.php:476, templates/account/partials/addon.php:190
1305
  msgid "Expired"
1306
  msgstr ""
1307
 
1308
- #: templates/account.php:536
1309
  msgid "Premium version"
1310
  msgstr ""
1311
 
1312
- #: templates/account.php:538
1313
  msgid "Free version"
1314
  msgstr ""
1315
 
1316
- #: templates/account.php:550
1317
  msgid "Verify Email"
1318
  msgstr ""
1319
 
1320
- #: templates/account.php:564
1321
  msgid "Download %s Version"
1322
  msgstr ""
1323
 
1324
- #: templates/account.php:580
1325
  msgid "Download Paid Version"
1326
  msgstr ""
1327
 
1328
- #: templates/account.php:598, templates/account.php:853, 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:613
1334
  msgid "What is your %s?"
1335
  msgstr ""
1336
 
1337
- #: templates/account.php:621, templates/account/billing.php:21
1338
  msgctxt "verb"
1339
  msgid "Edit"
1340
  msgstr ""
1341
 
1342
- #: templates/account.php:625, templates/forms/user-change.php:27
1343
  msgid "Change User"
1344
  msgstr ""
1345
 
1346
- #: templates/account.php:649
1347
  msgid "Sites"
1348
  msgstr ""
1349
 
1350
- #: templates/account.php:662
1351
  msgid "Search by address"
1352
  msgstr ""
1353
 
1354
- #: templates/account.php:671, templates/debug.php:366
1355
  msgid "Address"
1356
  msgstr ""
1357
 
1358
- #: templates/account.php:672
1359
  msgid "License"
1360
  msgstr ""
1361
 
1362
- #: templates/account.php:673
1363
  msgid "Plan"
1364
  msgstr ""
1365
 
1366
- #: templates/account.php:718
1367
  msgctxt "as software license"
1368
  msgid "License"
1369
  msgstr ""
1370
 
1371
- #: templates/account.php:847
1372
  msgctxt "verb"
1373
  msgid "Hide"
1374
  msgstr ""
1375
 
1376
- #: templates/account.php:869, templates/forms/data-debug-mode.php:31
1377
  msgid "Processing"
1378
  msgstr ""
1379
 
1380
- #: templates/account.php:872
1381
  msgid "Get updates for bleeding edge Beta versions of %s."
1382
  msgstr ""
1383
 
1384
- #: templates/account.php:930
1385
  msgid "Cancelling %s"
1386
  msgstr ""
1387
 
1388
- #: templates/account.php:930, templates/account.php:947, templates/forms/subscription-cancellation.php:27, templates/forms/deactivation/form.php:133
1389
  msgid "trial"
1390
  msgstr ""
1391
 
1392
- #: templates/account.php:945, templates/forms/deactivation/form.php:150
1393
  msgid "Cancelling %s..."
1394
  msgstr ""
1395
 
1396
- #: templates/account.php:948, templates/forms/subscription-cancellation.php:28, templates/forms/deactivation/form.php:134
1397
  msgid "subscription"
1398
  msgstr ""
1399
 
1400
- #: templates/account.php:962
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
 
@@ -2053,135 +2053,135 @@ msgstr ""
2053
  msgid "Apply to become an affiliate"
2054
  msgstr ""
2055
 
2056
- #: templates/forms/affiliation.php:104
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:119
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:122
2065
  msgid "Your affiliation account was temporarily suspended."
2066
  msgstr ""
2067
 
2068
- #: templates/forms/affiliation.php:125
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:128
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:141
2077
  msgid "Like the %s? Become our ambassador and earn cash ;-)"
2078
  msgstr ""
2079
 
2080
- #: templates/forms/affiliation.php:142
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:145
2085
  msgid "Program Summary"
2086
  msgstr ""
2087
 
2088
- #: templates/forms/affiliation.php:147
2089
  msgid "%s commission when a customer purchases a new license."
2090
  msgstr ""
2091
 
2092
- #: templates/forms/affiliation.php:149
2093
  msgid "Get commission for automated subscription renewals."
2094
  msgstr ""
2095
 
2096
- #: templates/forms/affiliation.php:152
2097
  msgid "%s tracking cookie after the first visit to maximize earnings potential."
2098
  msgstr ""
2099
 
2100
- #: templates/forms/affiliation.php:155
2101
  msgid "Unlimited commissions."
2102
  msgstr ""
2103
 
2104
- #: templates/forms/affiliation.php:157
2105
  msgid "%s minimum payout amount."
2106
  msgstr ""
2107
 
2108
- #: templates/forms/affiliation.php:158
2109
  msgid "Payouts are in USD and processed monthly via PayPal."
2110
  msgstr ""
2111
 
2112
- #: templates/forms/affiliation.php:159
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:162
2117
  msgid "Affiliate"
2118
  msgstr ""
2119
 
2120
- #: templates/forms/affiliation.php:165, templates/forms/resend-key.php:23
2121
  msgid "Email address"
2122
  msgstr ""
2123
 
2124
- #: templates/forms/affiliation.php:169
2125
  msgid "Full name"
2126
  msgstr ""
2127
 
2128
- #: templates/forms/affiliation.php:173
2129
  msgid "PayPal account email address"
2130
  msgstr ""
2131
 
2132
- #: templates/forms/affiliation.php:177
2133
  msgid "Where are you going to promote the %s?"
2134
  msgstr ""
2135
 
2136
- #: templates/forms/affiliation.php:179
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:181
2141
  msgid "Add another domain"
2142
  msgstr ""
2143
 
2144
- #: templates/forms/affiliation.php:185
2145
  msgid "Extra Domains"
2146
  msgstr ""
2147
 
2148
- #: templates/forms/affiliation.php:186
2149
  msgid "Extra domains where you will be marketing the product from."
2150
  msgstr ""
2151
 
2152
- #: templates/forms/affiliation.php:196
2153
  msgid "Promotion methods"
2154
  msgstr ""
2155
 
2156
- #: templates/forms/affiliation.php:199
2157
  msgid "Social media (Facebook, Twitter, etc.)"
2158
  msgstr ""
2159
 
2160
- #: templates/forms/affiliation.php:203
2161
  msgid "Mobile apps"
2162
  msgstr ""
2163
 
2164
- #: templates/forms/affiliation.php:207
2165
  msgid "Website, email, and social media statistics (optional)"
2166
  msgstr ""
2167
 
2168
- #: templates/forms/affiliation.php:210
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:214
2173
  msgid "How will you promote us?"
2174
  msgstr ""
2175
 
2176
- #: templates/forms/affiliation.php:217
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:223, templates/forms/resend-key.php:22
2181
  msgid "Cancel"
2182
  msgstr ""
2183
 
2184
- #: templates/forms/affiliation.php:225
2185
  msgid "Become an affiliate"
2186
  msgstr ""
2187
 
@@ -2255,7 +2255,7 @@ msgstr ""
2255
  msgid "Plugins & themes tracking"
2256
  msgstr ""
2257
 
2258
- #: templates/forms/optout.php:256
2259
  msgid "Saved"
2260
  msgstr ""
2261
 
@@ -2467,19 +2467,19 @@ msgstr ""
2467
  msgid "switching"
2468
  msgstr ""
2469
 
2470
- #: templates/forms/deactivation/form.php:365
2471
  msgid "Submit & %s"
2472
  msgstr ""
2473
 
2474
- #: templates/forms/deactivation/form.php:386
2475
  msgid "Kindly tell us the reason so we can improve."
2476
  msgstr ""
2477
 
2478
- #: templates/forms/deactivation/form.php:511
2479
  msgid "Yes - %s"
2480
  msgstr ""
2481
 
2482
- #: templates/forms/deactivation/form.php:518
2483
  msgid "Skip & %s"
2484
  msgstr ""
2485
 
1
+ # Copyright (C) 2020 freemius
2
  # This file is distributed under the same license as the freemius package.
3
  msgid ""
4
  msgstr ""
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
 
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
 
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
 
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
 
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
 
2255
  msgid "Plugins & themes tracking"
2256
  msgstr ""
2257
 
2258
+ #: templates/forms/optout.php:261
2259
  msgid "Saved"
2260
  msgstr ""
2261
 
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
 
freemius/start.php CHANGED
@@ -1,522 +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.3.2';
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
- $has_changes = true;
113
- }
114
- }
115
-
116
- if ( $has_changes ) {
117
- if ( empty( $fs_active_plugins->plugins ) ) {
118
- unset( $fs_active_plugins->newest );
119
- }
120
-
121
- update_option( 'fs_active_plugins', $fs_active_plugins );
122
- }
123
- }
124
- }
125
-
126
- if ( ! function_exists( 'fs_find_direct_caller_plugin_file' ) ) {
127
- require_once dirname( __FILE__ ) . '/includes/supplements/fs-essential-functions-1.1.7.1.php';
128
- }
129
-
130
- if ( ! function_exists( 'fs_get_plugins' ) ) {
131
- require_once dirname( __FILE__ ) . '/includes/supplements/fs-essential-functions-2.2.1.php';
132
- }
133
-
134
- // Update current SDK info based on the SDK path.
135
- if ( ! isset( $fs_active_plugins->plugins[ $this_sdk_relative_path ] ) ||
136
- $this_sdk_version != $fs_active_plugins->plugins[ $this_sdk_relative_path ]->version
137
- ) {
138
- if ( $is_theme ) {
139
- $plugin_path = basename( dirname( $this_sdk_relative_path ) );
140
- } else {
141
- $plugin_path = plugin_basename( fs_find_direct_caller_plugin_file( $file_path ) );
142
- }
143
-
144
- $fs_active_plugins->plugins[ $this_sdk_relative_path ] = (object) array(
145
- 'version' => $this_sdk_version,
146
- 'type' => ( $is_theme ? 'theme' : 'plugin' ),
147
- 'timestamp' => time(),
148
- 'plugin_path' => $plugin_path,
149
- );
150
- }
151
-
152
- $is_current_sdk_newest = isset( $fs_active_plugins->newest ) && ( $this_sdk_relative_path == $fs_active_plugins->newest->sdk_path );
153
-
154
- if ( ! isset( $fs_active_plugins->newest ) ) {
155
- /**
156
- * This will be executed only once, for the first time a Freemius powered plugin is activated.
157
- */
158
- fs_update_sdk_newest_version( $this_sdk_relative_path, $fs_active_plugins->plugins[ $this_sdk_relative_path ]->plugin_path );
159
-
160
- $is_current_sdk_newest = true;
161
- } else if ( version_compare( $fs_active_plugins->newest->version, $this_sdk_version, '<' ) ) {
162
- /**
163
- * Current SDK is newer than the newest stored SDK.
164
- */
165
- fs_update_sdk_newest_version( $this_sdk_relative_path, $fs_active_plugins->plugins[ $this_sdk_relative_path ]->plugin_path );
166
-
167
- if ( class_exists( 'Freemius' ) ) {
168
- // Older SDK version was already loaded.
169
-
170
- if ( ! $fs_active_plugins->newest->in_activation ) {
171
- // Re-order plugins to load this plugin first.
172
- fs_newest_sdk_plugin_first();
173
- }
174
-
175
- // Refresh page.
176
- fs_redirect( $_SERVER['REQUEST_URI'] );
177
- }
178
- } else {
179
- if ( ! function_exists( 'get_plugins' ) ) {
180
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
181
- }
182
-
183
- $fs_newest_sdk = $fs_active_plugins->newest;
184
- $fs_newest_sdk = $fs_active_plugins->plugins[ $fs_newest_sdk->sdk_path ];
185
-
186
- $is_newest_sdk_type_theme = ( isset( $fs_newest_sdk->type ) && 'theme' === $fs_newest_sdk->type );
187
-
188
- if ( ! $is_newest_sdk_type_theme ) {
189
- $is_newest_sdk_plugin_active = is_plugin_active( $fs_newest_sdk->plugin_path );
190
- } else {
191
- $current_theme = wp_get_theme();
192
- $is_newest_sdk_plugin_active = ( $current_theme->stylesheet === $fs_newest_sdk->plugin_path );
193
-
194
- $current_theme_parent = $current_theme->parent();
195
-
196
- /**
197
- * If the current theme is a child of the theme that has the newest SDK, this prevents a redirects loop
198
- * from happening by keeping the SDK info stored in the `fs_active_plugins` option.
199
- */
200
- if ( ! $is_newest_sdk_plugin_active && $current_theme_parent instanceof WP_Theme ) {
201
- $is_newest_sdk_plugin_active = ( $fs_newest_sdk->plugin_path === $current_theme_parent->stylesheet );
202
- }
203
- }
204
-
205
- if ( $is_current_sdk_newest &&
206
- ! $is_newest_sdk_plugin_active &&
207
- ! $fs_active_plugins->newest->in_activation
208
- ) {
209
- // If current SDK is the newest and the plugin is NOT active, it means
210
- // that the current plugin in activation mode.
211
- $fs_active_plugins->newest->in_activation = true;
212
- update_option( 'fs_active_plugins', $fs_active_plugins );
213
- }
214
-
215
- if ( ! $is_theme ) {
216
- $sdk_starter_path = fs_normalize_path( WP_PLUGIN_DIR . '/' . $this_sdk_relative_path . '/start.php' );
217
- } else {
218
- $sdk_starter_path = fs_normalize_path(
219
- $themes_directory
220
- . '/'
221
- . str_replace( "../{$themes_directory_name}/", '', $this_sdk_relative_path )
222
- . '/start.php' );
223
- }
224
-
225
- $is_newest_sdk_path_valid = ( $is_newest_sdk_plugin_active || $fs_active_plugins->newest->in_activation ) && file_exists( $sdk_starter_path );
226
-
227
- if ( ! $is_newest_sdk_path_valid && ! $is_current_sdk_newest ) {
228
- // Plugin with newest SDK is no longer active, or SDK was moved to a different location.
229
- unset( $fs_active_plugins->plugins[ $fs_active_plugins->newest->sdk_path ] );
230
- }
231
-
232
- if ( ! ( $is_newest_sdk_plugin_active || $fs_active_plugins->newest->in_activation ) ||
233
- ! $is_newest_sdk_path_valid ||
234
- // Is newest SDK downgraded.
235
- ( $this_sdk_relative_path == $fs_active_plugins->newest->sdk_path &&
236
- version_compare( $fs_active_plugins->newest->version, $this_sdk_version, '>' ) )
237
- ) {
238
- /**
239
- * Plugin with newest SDK is no longer active.
240
- * OR
241
- * The newest SDK was in the current plugin. BUT, seems like the version of
242
- * the SDK was downgraded to a lower SDK.
243
- */
244
- // Find the active plugin with the newest SDK version and update the newest reference.
245
- fs_fallback_to_newest_active_sdk();
246
- } else {
247
- if ( $is_newest_sdk_plugin_active &&
248
- $this_sdk_relative_path == $fs_active_plugins->newest->sdk_path &&
249
- ( $fs_active_plugins->newest->in_activation ||
250
- ( class_exists( 'Freemius' ) && ( ! defined( 'WP_FS__SDK_VERSION' ) || version_compare( WP_FS__SDK_VERSION, $this_sdk_version, '<' ) ) )
251
- )
252
-
253
- ) {
254
- if ( $fs_active_plugins->newest->in_activation && ! $is_newest_sdk_type_theme ) {
255
- // Plugin no more in activation.
256
- $fs_active_plugins->newest->in_activation = false;
257
- update_option( 'fs_active_plugins', $fs_active_plugins );
258
- }
259
-
260
- // Reorder plugins to load plugin with newest SDK first.
261
- if ( fs_newest_sdk_plugin_first() ) {
262
- // Refresh page after re-order to make sure activated plugin loads newest SDK.
263
- if ( class_exists( 'Freemius' ) ) {
264
- fs_redirect( $_SERVER['REQUEST_URI'] );
265
- }
266
- }
267
- }
268
- }
269
- }
270
-
271
- if ( class_exists( 'Freemius' ) ) {
272
- // SDK was already loaded.
273
- return;
274
- }
275
-
276
- if ( version_compare( $this_sdk_version, $fs_active_plugins->newest->version, '<' ) ) {
277
- $newest_sdk = $fs_active_plugins->plugins[ $fs_active_plugins->newest->sdk_path ];
278
-
279
- $plugins_or_theme_dir_path = ( ! isset( $newest_sdk->type ) || 'theme' !== $newest_sdk->type ) ?
280
- WP_PLUGIN_DIR :
281
- $themes_directory;
282
-
283
- $newest_sdk_starter = fs_normalize_path(
284
- $plugins_or_theme_dir_path
285
- . '/'
286
- . str_replace( "../{$themes_directory_name}/", '', $fs_active_plugins->newest->sdk_path )
287
- . '/start.php' );
288
-
289
- if ( file_exists( $newest_sdk_starter ) ) {
290
- // Reorder plugins to load plugin with newest SDK first.
291
- fs_newest_sdk_plugin_first();
292
-
293
- // There's a newer SDK version, load it instead of the current one!
294
- require_once $newest_sdk_starter;
295
-
296
- return;
297
- }
298
- }
299
-
300
- #endregion SDK Selection Logic --------------------------------------------------------------------
301
-
302
- #region Hooks & Filters Collection --------------------------------------------------------------------
303
-
304
- /**
305
- * Freemius hooks (actions & filters) tags structure:
306
- *
307
- * fs_{filter/action_name}_{plugin_slug}
308
- *
309
- * --------------------------------------------------------
310
- *
311
- * Usage with WordPress' add_action() / add_filter():
312
- *
313
- * add_action('fs_{filter/action_name}_{plugin_slug}', $callable);
314
- *
315
- * --------------------------------------------------------
316
- *
317
- * Usage with Freemius' instance add_action() / add_filter():
318
- *
319
- * // No need to add 'fs_' prefix nor '_{plugin_slug}' suffix.
320
- * my_freemius()->add_action('{action_name}', $callable);
321
- *
322
- * --------------------------------------------------------
323
- *
324
- * Freemius filters collection:
325
- *
326
- * fs_connect_url_{plugin_slug}
327
- * fs_trial_promotion_message_{plugin_slug}
328
- * fs_is_long_term_user_{plugin_slug}
329
- * fs_uninstall_reasons_{plugin_slug}
330
- * fs_is_plugin_update_{plugin_slug}
331
- * fs_api_domains_{plugin_slug}
332
- * fs_email_template_sections_{plugin_slug}
333
- * fs_support_forum_submenu_{plugin_slug}
334
- * fs_support_forum_url_{plugin_slug}
335
- * fs_connect_message_{plugin_slug}
336
- * fs_connect_message_on_update_{plugin_slug}
337
- * fs_uninstall_confirmation_message_{plugin_slug}
338
- * fs_pending_activation_message_{plugin_slug}
339
- * fs_is_submenu_visible_{plugin_slug}
340
- * fs_plugin_icon_{plugin_slug}
341
- * fs_show_trial_{plugin_slug}
342
- *
343
- * --------------------------------------------------------
344
- *
345
- * Freemius actions collection:
346
- *
347
- * fs_after_license_loaded_{plugin_slug}
348
- * fs_after_license_change_{plugin_slug}
349
- * fs_after_plans_sync_{plugin_slug}
350
- *
351
- * fs_after_account_details_{plugin_slug}
352
- * fs_after_account_user_sync_{plugin_slug}
353
- * fs_after_account_plan_sync_{plugin_slug}
354
- * fs_before_account_load_{plugin_slug}
355
- * fs_after_account_connection_{plugin_slug}
356
- * fs_account_property_edit_{plugin_slug}
357
- * fs_account_email_verified_{plugin_slug}
358
- * fs_account_page_load_before_departure_{plugin_slug}
359
- * fs_before_account_delete_{plugin_slug}
360
- * fs_after_account_delete_{plugin_slug}
361
- *
362
- * fs_sdk_version_update_{plugin_slug}
363
- * fs_plugin_version_update_{plugin_slug}
364
- *
365
- * fs_initiated_{plugin_slug}
366
- * fs_after_init_plugin_registered_{plugin_slug}
367
- * fs_after_init_plugin_anonymous_{plugin_slug}
368
- * fs_after_init_plugin_pending_activations_{plugin_slug}
369
- * fs_after_init_addon_registered_{plugin_slug}
370
- * fs_after_init_addon_anonymous_{plugin_slug}
371
- * fs_after_init_addon_pending_activations_{plugin_slug}
372
- *
373
- * fs_after_premium_version_activation_{plugin_slug}
374
- * fs_after_free_version_reactivation_{plugin_slug}
375
- *
376
- * fs_after_uninstall_{plugin_slug}
377
- * fs_before_admin_menu_init_{plugin_slug}
378
- */
379
-
380
- #endregion Hooks & Filters Collection --------------------------------------------------------------------
381
-
382
- if ( ! class_exists( 'Freemius' ) ) {
383
-
384
- if ( ! defined( 'WP_FS__SDK_VERSION' ) ) {
385
- define( 'WP_FS__SDK_VERSION', $this_sdk_version );
386
- }
387
-
388
- $plugins_or_theme_dir_path = fs_normalize_path( trailingslashit( $is_theme ?
389
- $themes_directory :
390
- WP_PLUGIN_DIR ) );
391
-
392
- if ( 0 === strpos( $file_path, $plugins_or_theme_dir_path ) ) {
393
- // No symlinks
394
- } else {
395
- /**
396
- * This logic finds the SDK symlink and set WP_FS__DIR to use it.
397
- *
398
- * @author Vova Feldman (@svovaf)
399
- * @since 1.2.2.5
400
- */
401
- $sdk_symlink = null;
402
-
403
- // Try to load SDK's symlink from cache.
404
- if ( isset( $fs_active_plugins->plugins[ $this_sdk_relative_path ] ) &&
405
- is_object( $fs_active_plugins->plugins[ $this_sdk_relative_path ] ) &&
406
- ! empty( $fs_active_plugins->plugins[ $this_sdk_relative_path ]->sdk_symlink )
407
- ) {
408
- $sdk_symlink = $fs_active_plugins->plugins[ $this_sdk_relative_path ]->sdk_symlink;
409
- if ( 0 === strpos( $sdk_symlink, $plugins_or_theme_dir_path ) ) {
410
- /**
411
- * Make the symlink path relative.
412
- *
413
- * @author Leo Fajardo (@leorw)
414
- */
415
- $sdk_symlink = substr( $sdk_symlink, strlen( $plugins_or_theme_dir_path ) );
416
-
417
- $fs_active_plugins->plugins[ $this_sdk_relative_path ]->sdk_symlink = $sdk_symlink;
418
- update_option( 'fs_active_plugins', $fs_active_plugins );
419
- }
420
-
421
- $realpath = realpath( $plugins_or_theme_dir_path . $sdk_symlink );
422
- if ( ! is_string( $realpath ) || ! file_exists( $realpath ) ) {
423
- $sdk_symlink = null;
424
- }
425
- }
426
-
427
- if ( empty( $sdk_symlink ) ) // Has symlinks, therefore, we need to configure WP_FS__DIR based on the symlink.
428
- {
429
- $partial_path_right = basename( $file_path );
430
- $partial_path_left = dirname( $file_path );
431
- $realpath = realpath( $plugins_or_theme_dir_path . $partial_path_right );
432
-
433
- while ( '/' !== $partial_path_left &&
434
- ( false === $realpath || $file_path !== fs_normalize_path( $realpath ) )
435
- ) {
436
- $partial_path_right = trailingslashit( basename( $partial_path_left ) ) . $partial_path_right;
437
- $partial_path_left_prev = $partial_path_left;
438
- $partial_path_left = dirname( $partial_path_left_prev );
439
-
440
- /**
441
- * Avoid infinite loop if for example `$partial_path_left_prev` is `C:/`, in this case,
442
- * `dirname( 'C:/' )` will return `C:/`.
443
- *
444
- * @author Leo Fajardo (@leorw)
445
- */
446
- if ( $partial_path_left === $partial_path_left_prev ) {
447
- $partial_path_left = '';
448
- break;
449
- }
450
-
451
- $realpath = realpath( $plugins_or_theme_dir_path . $partial_path_right );
452
- }
453
-
454
- if ( ! empty( $partial_path_left ) && '/' !== $partial_path_left ) {
455
- $sdk_symlink = fs_normalize_path( dirname( $partial_path_right ) );
456
-
457
- // Cache value.
458
- if ( isset( $fs_active_plugins->plugins[ $this_sdk_relative_path ] ) &&
459
- is_object( $fs_active_plugins->plugins[ $this_sdk_relative_path ] )
460
- ) {
461
- $fs_active_plugins->plugins[ $this_sdk_relative_path ]->sdk_symlink = $sdk_symlink;
462
- update_option( 'fs_active_plugins', $fs_active_plugins );
463
- }
464
- }
465
- }
466
-
467
- if ( ! empty( $sdk_symlink ) ) {
468
- // Set SDK dir to the symlink path.
469
- define( 'WP_FS__DIR', $plugins_or_theme_dir_path . $sdk_symlink );
470
- }
471
- }
472
-
473
- // Load SDK files.
474
- require_once dirname( __FILE__ ) . '/require.php';
475
-
476
- /**
477
- * Quick shortcut to get Freemius for specified plugin.
478
- * Used by various templates.
479
- *
480
- * @param number $module_id
481
- *
482
- * @return Freemius
483
- */
484
- function freemius( $module_id ) {
485
- return Freemius::instance( $module_id );
486
- }
487
-
488
- /**
489
- * @param string $slug
490
- * @param number $plugin_id
491
- * @param string $public_key
492
- * @param bool $is_live Is live or test plugin.
493
- * @param bool $is_premium Hints freemius if running the premium plugin or not.
494
- *
495
- * @return Freemius
496
- *
497
- * @deprecated Please use fs_dynamic_init().
498
- */
499
- function fs_init( $slug, $plugin_id, $public_key, $is_live = true, $is_premium = true ) {
500
- $fs = Freemius::instance( $plugin_id, $slug, true );
501
- $fs->init( $plugin_id, $public_key, $is_live, $is_premium );
502
-
503
- return $fs;
504
- }
505
-
506
- /**
507
- * @param array <string,string> $module Plugin or Theme details.
508
- *
509
- * @return Freemius
510
- * @throws Freemius_Exception
511
- */
512
- function fs_dynamic_init( $module ) {
513
- $fs = Freemius::instance( $module['id'], $module['slug'], true );
514
- $fs->dynamic_init( $module );
515
-
516
- return $fs;
517
- }
518
-
519
- function fs_dump_log() {
520
- FS_Logger::dump();
521
- }
 
 
 
 
 
 
 
 
522
  }
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
  }
freemius/templates/account.php CHANGED
@@ -163,19 +163,28 @@
163
  }
164
  }
165
 
166
- $is_child_license = ( is_object( $license ) && FS_Plugin_License::is_valid_id( $license->parent_license_id ) );
167
- $bundle_subscription = null;
 
 
 
 
 
 
 
 
 
168
 
169
  if (
170
  $show_plan_row &&
171
  is_object( $license ) &&
172
- FS_Plugin_License::is_valid_id( $license->parent_license_id )
173
  ) {
174
- $bundle_subscription = $fs->_get_subscription( $license->parent_license_id );
 
 
175
  }
176
 
177
- $is_active_bundle_subscription = ( is_object( $bundle_subscription ) && $bundle_subscription->is_active() );
178
-
179
  $fs_blog_id = ( is_multisite() && ! is_network_admin() ) ?
180
  get_current_blog_id() :
181
  0;
@@ -183,6 +192,46 @@
183
  $active_plugins_directories_map = Freemius::get_active_plugins_directories_map( $fs_blog_id );
184
 
185
  $is_premium = $fs->is_premium();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  ?>
187
  <div class="wrap fs-section">
188
  <?php if ( ! $has_tabs && ! $fs->apply_filters( 'hide_account_tabs', false ) ) : ?>
@@ -392,7 +441,7 @@
392
  );
393
  }
394
 
395
- if ( $has_paid_plan ) {
396
  if ( $fs->is_trial() ) {
397
  if ( $show_plan_row ) {
398
  $profile[] = array(
@@ -407,18 +456,18 @@
407
  if ( $show_plan_row ) {
408
  $profile[] = array(
409
  'id' => 'plan',
410
- 'title' => ( $is_child_license ? ucfirst( $fs->get_module_type() ) . ' ' : '' ) . $plan_text,
411
  'value' => strtoupper( is_string( $plan->name ) ?
412
  $plan->title :
413
  strtoupper( $free_text )
414
  )
415
  );
416
 
417
- if ( $is_child_license ) {
418
  $profile[] = array(
419
  'id' => 'bundle_plan',
420
  'title' => $bundle_plan_text,
421
- 'value' => strtoupper( $license->parent_plan_title )
422
  );
423
  }
424
  }
@@ -525,7 +574,7 @@
525
  <?php endif ?>
526
  <?php elseif ( 'bundle_plan' === $p['id'] ) : ?>
527
  <?php if ( is_object( $bundle_subscription ) ) : ?>
528
- <?php if ( $is_active_bundle_subscription && ! $license->is_first_payment_pending() ) : ?>
529
  <label class="fs-tag fs-success"><?php echo esc_html( sprintf( $renews_in_text, human_time_diff( time(), strtotime( $bundle_subscription->next_payment ) ) ) ) ?></label>
530
  <?php endif ?>
531
  <?php endif ?>
@@ -555,7 +604,7 @@
555
  <div class="button-group">
556
  <?php if ( $is_paying || $fs->is_trial() ) : ?>
557
  <?php if ( ! $fs->is_allowed_to_install() ) : ?>
558
- <a target="_blank" class="button button-primary"
559
  href="<?php echo $fs->_get_latest_download_local_url() ?>"><?php
560
  $download_version_text_suffix = ( is_object( $update ) ? ' [' . $update->version . ']' : '' );
561
 
@@ -691,18 +740,6 @@
691
  </div>
692
  </div>
693
  <?php endif ?>
694
-
695
- <?php
696
- $account_addons = $fs->get_updated_account_addons();
697
-
698
- $installed_addons = $fs->get_installed_addons();
699
- $installed_addons_ids = array();
700
- foreach ( $installed_addons as $fs_addon ) {
701
- $installed_addons_ids[] = $fs_addon->get_id();
702
- }
703
-
704
- $addons_to_show = array_unique( array_merge( $installed_addons_ids, $account_addons ) );
705
- ?>
706
  <?php if ( 0 < count( $addons_to_show ) ) : ?>
707
  <!-- Add-Ons -->
708
  <div class="postbox">
163
  }
164
  }
165
 
166
+ $has_bundle_license = false;
167
+
168
+ if ( is_object( $license ) &&
169
+ FS_Plugin_License::is_valid_id( $license->parent_license_id )
170
+ ) {
171
+ // Context license has a parent license, therefore, the account has a bundle license.
172
+ $has_bundle_license = true;
173
+ }
174
+
175
+ $bundle_subscription = null;
176
+ $is_bundle_first_payment_pending = false;
177
 
178
  if (
179
  $show_plan_row &&
180
  is_object( $license ) &&
181
+ $has_bundle_license
182
  ) {
183
+ $bundle_plan_title = strtoupper( $license->parent_plan_title );
184
+ $bundle_subscription = $fs->_get_subscription( $license->parent_license_id );
185
+ $is_bundle_first_payment_pending = $license->is_first_payment_pending();
186
  }
187
 
 
 
188
  $fs_blog_id = ( is_multisite() && ! is_network_admin() ) ?
189
  get_current_blog_id() :
190
  0;
192
  $active_plugins_directories_map = Freemius::get_active_plugins_directories_map( $fs_blog_id );
193
 
194
  $is_premium = $fs->is_premium();
195
+
196
+ $account_addons = $fs->get_updated_account_addons();
197
+ $installed_addons = $fs->get_installed_addons();
198
+ $installed_addons_ids = array();
199
+
200
+ /**
201
+ * Store the installed add-ons' IDs into a collection which will be used in determining the add-ons to show on the "Account" page, and at the same time try to find an add-on that is activated with a bundle license if the core product is not.
202
+ *
203
+ * @author Leo Fajardo
204
+ *
205
+ * @since 2.4.0
206
+ */
207
+ foreach ( $installed_addons as $fs_addon ) {
208
+ $installed_addons_ids[] = $fs_addon->get_id();
209
+
210
+ if ( $has_bundle_license ) {
211
+ // We already have the context bundle license details, skip.
212
+ continue;
213
+ }
214
+
215
+ if (
216
+ $show_plan_row &&
217
+ $fs_addon->has_active_valid_license()
218
+ ) {
219
+ $addon_license = $fs_addon->_get_license();
220
+
221
+ if ( FS_Plugin_License::is_valid_id( $addon_license->parent_license_id ) ) {
222
+ // Add-on's license is associated with a parent/bundle license.
223
+ $has_bundle_license = true;
224
+
225
+ $bundle_plan_title = strtoupper( $addon_license->parent_plan_title );
226
+ $bundle_subscription = $fs_addon->_get_subscription( $addon_license->parent_license_id );
227
+ $is_bundle_first_payment_pending = $addon_license->is_first_payment_pending();
228
+ }
229
+ }
230
+ }
231
+
232
+ $addons_to_show = array_unique( array_merge( $installed_addons_ids, $account_addons ) );
233
+
234
+ $is_active_bundle_subscription = ( is_object( $bundle_subscription ) && $bundle_subscription->is_active() );
235
  ?>
236
  <div class="wrap fs-section">
237
  <?php if ( ! $has_tabs && ! $fs->apply_filters( 'hide_account_tabs', false ) ) : ?>
441
  );
442
  }
443
 
444
+ if ( $has_paid_plan || $has_bundle_license ) {
445
  if ( $fs->is_trial() ) {
446
  if ( $show_plan_row ) {
447
  $profile[] = array(
456
  if ( $show_plan_row ) {
457
  $profile[] = array(
458
  'id' => 'plan',
459
+ 'title' => ( $has_bundle_license ? ucfirst( $fs->get_module_type() ) . ' ' : '' ) . $plan_text,
460
  'value' => strtoupper( is_string( $plan->name ) ?
461
  $plan->title :
462
  strtoupper( $free_text )
463
  )
464
  );
465
 
466
+ if ( $has_bundle_license ) {
467
  $profile[] = array(
468
  'id' => 'bundle_plan',
469
  'title' => $bundle_plan_text,
470
+ 'value' => $bundle_plan_title
471
  );
472
  }
473
  }
574
  <?php endif ?>
575
  <?php elseif ( 'bundle_plan' === $p['id'] ) : ?>
576
  <?php if ( is_object( $bundle_subscription ) ) : ?>
577
+ <?php if ( $is_active_bundle_subscription && ! $is_bundle_first_payment_pending ) : ?>
578
  <label class="fs-tag fs-success"><?php echo esc_html( sprintf( $renews_in_text, human_time_diff( time(), strtotime( $bundle_subscription->next_payment ) ) ) ) ?></label>
579
  <?php endif ?>
580
  <?php endif ?>
604
  <div class="button-group">
605
  <?php if ( $is_paying || $fs->is_trial() ) : ?>
606
  <?php if ( ! $fs->is_allowed_to_install() ) : ?>
607
+ <a target="_blank" rel="noopener" class="button button-primary"
608
  href="<?php echo $fs->_get_latest_download_local_url() ?>"><?php
609
  $download_version_text_suffix = ( is_object( $update ) ? ' [' . $update->version . ']' : '' );
610
 
740
  </div>
741
  </div>
742
  <?php endif ?>
 
 
 
 
 
 
 
 
 
 
 
 
743
  <?php if ( 0 < count( $addons_to_show ) ) : ?>
744
  <!-- Add-Ons -->
745
  <div class="postbox">
freemius/templates/account/partials/addon.php CHANGED
@@ -366,7 +366,7 @@
366
  );
367
  } else {
368
  $buttons[] = sprintf(
369
- '<a target="_blank" class="button button-primary edit" href="%s">%s</a>',
370
  $fs->_get_latest_download_local_url( $addon_id ),
371
  esc_html( $download_latest_text )
372
  );
@@ -417,7 +417,7 @@
417
  <a class="button button-primary"
418
  href="<?php echo wp_nonce_url( self_admin_url( 'update.php?' . ( ( isset( $addon_info['has_paid_plan'] ) && $addon_info['has_paid_plan'] ) ? 'fs_allow_updater_and_dialog=true&' : '' ) . 'action=install-plugin&plugin=' . $addon_info['slug'] ), 'install-plugin_' . $addon_info['slug'] ) ?>"><?php fs_esc_html_echo_inline( 'Install Now', 'install-now', $slug ) ?></a>
419
  <?php else : ?>
420
- <a target="_blank" class="button button-primary"
421
  href="<?php echo $fs->_get_latest_download_local_url( $addon_id ) ?>"><?php echo esc_html( $download_latest_text ) ?></a>
422
  <?php endif ?>
423
  <?php endif ?>
366
  );
367
  } else {
368
  $buttons[] = sprintf(
369
+ '<a target="_blank" rel="noopener" class="button button-primary edit" href="%s">%s</a>',
370
  $fs->_get_latest_download_local_url( $addon_id ),
371
  esc_html( $download_latest_text )
372
  );
417
  <a class="button button-primary"
418
  href="<?php echo wp_nonce_url( self_admin_url( 'update.php?' . ( ( isset( $addon_info['has_paid_plan'] ) && $addon_info['has_paid_plan'] ) ? 'fs_allow_updater_and_dialog=true&' : '' ) . 'action=install-plugin&plugin=' . $addon_info['slug'] ), 'install-plugin_' . $addon_info['slug'] ) ?>"><?php fs_esc_html_echo_inline( 'Install Now', 'install-now', $slug ) ?></a>
419
  <?php else : ?>
420
+ <a target="_blank" rel="noopener" class="button button-primary"
421
  href="<?php echo $fs->_get_latest_download_local_url( $addon_id ) ?>"><?php echo esc_html( $download_latest_text ) ?></a>
422
  <?php endif ?>
423
  <?php endif ?>
freemius/templates/account/payments.php CHANGED
@@ -47,7 +47,7 @@
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"><?php fs_esc_html_echo_inline( 'Invoice', 'invoice', $slug ) ?></a><?php endif ?></td>
51
  </tr>
52
  <?php $odd = ! $odd; endforeach ?>
53
  </tbody>
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>
freemius/templates/add-ons.php CHANGED
@@ -332,11 +332,11 @@
332
  }
333
  ?>
334
  <?php else : ?>
335
- <a target="_blank" class="button button-primary" href="<?php echo $latest_download_local_url ?>"><?php echo esc_html( $download_latest_text ) ?></a>
336
  <?php endif ?>
337
  <div class="button button-primary fs-dropdown-arrow-button"><span class="fs-dropdown-arrow"></span><ul class="fs-dropdown-list" style="display: none">
338
  <?php if ( $is_allowed_to_install && ! empty( $latest_download_local_url ) ) : ?>
339
- <li><a target="_blank" href="<?php echo $latest_download_local_url ?>"><?php echo esc_html( $download_latest_text ) ?></a></li>
340
  <?php endif ?>
341
  <li><?php
342
  echo sprintf(
332
  }
333
  ?>
334
  <?php else : ?>
335
+ <a target="_blank" rel="noopener" class="button button-primary" href="<?php echo $latest_download_local_url ?>"><?php echo esc_html( $download_latest_text ) ?></a>
336
  <?php endif ?>
337
  <div class="button button-primary fs-dropdown-arrow-button"><span class="fs-dropdown-arrow"></span><ul class="fs-dropdown-list" style="display: none">
338
  <?php if ( $is_allowed_to_install && ! empty( $latest_download_local_url ) ) : ?>
339
+ <li><a target="_blank" rel="noopener" href="<?php echo $latest_download_local_url ?>"><?php echo esc_html( $download_latest_text ) ?></a></li>
340
  <?php endif ?>
341
  <li><?php
342
  echo sprintf(
freemius/templates/auto-installation.php CHANGED
@@ -93,7 +93,7 @@
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">%s</a>',
97
  'https://freemius.com',
98
  'freemius.com'
99
  ),
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
  ),
freemius/templates/connect.php CHANGED
@@ -54,7 +54,7 @@
54
  ) );
55
  }
56
 
57
- $freemius_link = '<a href="' . $freemius_site_url . '" target="_blank" tabindex="1">freemius.com</a>';
58
 
59
  $error = fs_request_get( 'error' );
60
 
@@ -222,13 +222,13 @@
222
  esc_html( $default_optin_message ),
223
  '<b>' . esc_html( $fs->get_plugin_name() ) . '</b>',
224
  '<b>' . $current_user->user_login . '</b>',
225
- '<a href="' . $site_url . '" target="_blank">' . $site_url . '</a>',
226
  $freemius_link
227
  ),
228
  $first_name,
229
  $fs->get_plugin_name(),
230
  $current_user->user_login,
231
- '<a href="' . $site_url . '" target="_blank">' . $site_url . '</a>',
232
  $freemius_link,
233
  $is_gdpr_required
234
  );
@@ -399,11 +399,12 @@
399
  }
400
 
401
  $permissions['extensions'] = array(
402
- 'icon-class' => 'dashicons dashicons-menu',
403
- 'label' => $fs->get_text_inline( 'Plugins & Themes', 'permissions-extensions' ),
404
- 'desc' => $fs->get_text_inline( 'Title, slug, version, and is active', 'permissions-extensions_desc' ),
405
- 'priority' => 25,
406
- 'optional' => true,
 
407
  );
408
 
409
  // Allow filtering of the permissions list.
@@ -429,7 +430,7 @@
429
  class="fs-permission fs-<?php echo esc_attr( $id ); ?>">
430
  <i class="<?php echo esc_attr( $permission['icon-class'] ); ?>"></i>
431
  <?php if ( isset( $permission['optional'] ) && true === $permission['optional'] ) : ?>
432
- <div class="fs-switch fs-small fs-round fs-on">
433
  <div class="fs-toggle"></div>
434
  </div>
435
  <?php endif ?>
@@ -458,10 +459,10 @@
458
  </div>
459
  <?php endif ?>
460
  <div class="fs-terms">
461
- <a href="https://freemius.com/privacy/" target="_blank"
462
  tabindex="1"><?php fs_esc_html_echo_inline( 'Privacy Policy', 'privacy-policy', $slug ) ?></a>
463
  &nbsp;&nbsp;-&nbsp;&nbsp;
464
- <a href="<?php echo $require_license_key ? $freemius_plugin_terms_url : $freemius_usage_tracking_url ?>" target="_blank" tabindex="1"><?php $require_license_key ? fs_echo_inline( 'License Agreement', 'license-agreement', $slug ) : fs_echo_inline( 'Terms of Service', 'tos', $slug ) ?></a>
465
  </div>
466
  </div>
467
  <?php
54
  ) );
55
  }
56
 
57
+ $freemius_link = '<a href="' . $freemius_site_url . '" target="_blank" rel="noopener" tabindex="1">freemius.com</a>';
58
 
59
  $error = fs_request_get( 'error' );
60
 
222
  esc_html( $default_optin_message ),
223
  '<b>' . esc_html( $fs->get_plugin_name() ) . '</b>',
224
  '<b>' . $current_user->user_login . '</b>',
225
+ '<a href="' . $site_url . '" target="_blank" rel="noopener noreferrer">' . $site_url . '</a>',
226
  $freemius_link
227
  ),
228
  $first_name,
229
  $fs->get_plugin_name(),
230
  $current_user->user_login,
231
+ '<a href="' . $site_url . '" target="_blank" rel="noopener noreferrer">' . $site_url . '</a>',
232
  $freemius_link,
233
  $is_gdpr_required
234
  );
399
  }
400
 
401
  $permissions['extensions'] = array(
402
+ 'icon-class' => 'dashicons dashicons-menu',
403
+ 'label' => $fs->get_text_inline( 'Plugins & Themes', 'permissions-extensions' ),
404
+ 'desc' => $fs->get_text_inline( 'Title, slug, version, and is active', 'permissions-extensions_desc' ),
405
+ 'priority' => 25,
406
+ 'optional' => true,
407
+ 'default' => $fs->apply_filters( 'permission_extensions_default', true )
408
  );
409
 
410
  // Allow filtering of the permissions list.
430
  class="fs-permission fs-<?php echo esc_attr( $id ); ?>">
431
  <i class="<?php echo esc_attr( $permission['icon-class'] ); ?>"></i>
432
  <?php if ( isset( $permission['optional'] ) && true === $permission['optional'] ) : ?>
433
+ <div class="fs-switch fs-small fs-round fs-<?php echo (! isset( $permission['default'] ) || true === $permission['default'] ) ? 'on' : 'off' ?>">
434
  <div class="fs-toggle"></div>
435
  </div>
436
  <?php endif ?>
459
  </div>
460
  <?php endif ?>
461
  <div class="fs-terms">
462
+ <a href="https://freemius.com/privacy/" target="_blank" rel="noopener"
463
  tabindex="1"><?php fs_esc_html_echo_inline( 'Privacy Policy', 'privacy-policy', $slug ) ?></a>
464
  &nbsp;&nbsp;-&nbsp;&nbsp;
465
+ <a href="<?php echo $require_license_key ? $freemius_plugin_terms_url : $freemius_usage_tracking_url ?>" target="_blank" rel="noopener" tabindex="1"><?php $require_license_key ? fs_echo_inline( 'License Agreement', 'license-agreement', $slug ) : fs_echo_inline( 'Terms of Service', 'tos', $slug ) ?></a>
466
  </div>
467
  </div>
468
  <?php
freemius/templates/forms/affiliation.php CHANGED
@@ -83,6 +83,9 @@
83
  }
84
 
85
  $apply_to_become_affiliate_text = fs_text_inline( 'Apply to become an affiliate', 'apply-to-become-an-affiliate', $slug );
 
 
 
86
  ?>
87
  <div id="fs_affiliation_content_wrapper" class="wrap">
88
  <form method="post" action="">
@@ -104,7 +107,7 @@
104
  fs_esc_html_inline( "Your affiliate application for %s has been accepted! Log in to your affiliate area at: %s.", 'affiliate-application-accepted', $slug ),
105
  $plugin_title,
106
  sprintf(
107
- '<a href="%s" target="_blank">%s</a>',
108
  $members_dashboard_login_url,
109
  $members_dashboard_login_url
110
  )
@@ -217,11 +220,15 @@
217
  <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>
218
  <?php endif ?>
219
  </div>
 
 
 
 
220
  </form>
221
  </div>
222
  <?php if ( ! $is_affiliate ) : ?>
223
  <a id="cancel_button" href="#" class="button button-secondary button-cancel" style="display: none"><?php fs_esc_html_echo_inline( 'Cancel', 'cancel', $slug ) ?></a>
224
- <a id="submit_button" class="button button-primary" href="#" style="display: none"><?php echo esc_html( $apply_to_become_affiliate_text ) ?></a>
225
  <a id="apply_button" class="button button-primary" href="#"><?php fs_esc_html_echo_inline( 'Become an affiliate', 'become-an-affiliate', $slug ) ?></a>
226
  <?php endif ?>
227
  </div>
@@ -242,7 +249,8 @@
242
  $errorMessageContainer = $('#error_message'),
243
  $domain = $('#domain'),
244
  $addDomain = $('#add_domain'),
245
- $extraDomainsContainer = $('#extra_domains_container');
 
246
 
247
  $applyButton.click(function (evt) {
248
  evt.preventDefault();
@@ -360,7 +368,7 @@
360
  data : {
361
  action : '<?php echo $fs->get_ajax_action( 'submit_affiliate_application' ) ?>',
362
  security : '<?php echo $fs->get_ajax_security( 'submit_affiliate_application' ) ?>',
363
- module_id: '<?php echo $fs->get_id() ?>',
364
  affiliate: affiliate
365
  },
366
  beforeSend: function () {
@@ -472,13 +480,26 @@
472
 
473
  window.scrollTo(0, 0);
474
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
475
  });
476
  </script>
477
  </div>
478
  <?php
479
  $params = array(
480
  'page' => 'affiliation',
481
- 'module_id' => $fs->get_id(),
482
  'module_slug' => $slug,
483
  'module_version' => $fs->get_plugin_version(),
484
  );
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="">
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
  )
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>
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();
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 () {
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
  );
freemius/templates/forms/deactivation/form.php CHANGED
@@ -79,8 +79,8 @@ HTML;
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">'
@@ -97,19 +97,19 @@ HTML;
97
  + ' </div>'
98
  + ' </div>'
99
  + '</div>',
100
- $modal = $(modalHtml),
101
- $deactivateLink = $('#the-list .deactivate > [data-module-id=<?php echo $fs->get_id() ?>].fs-module-id').prev(),
102
- selectedReasonID = false,
103
- redirectLink = '',
104
- $anonymousFeedback = $modal.find( '.anonymous-feedback-label' ),
105
- isAnonymous = <?php echo ( $is_anonymous ? 'true' : 'false' ); ?>,
106
- otherReasonID = <?php echo Freemius::REASON_OTHER; ?>,
107
- dontShareDataReasonID = <?php echo Freemius::REASON_DONT_LIKE_TO_SHARE_MY_INFORMATION; ?>,
108
- deleteThemeUpdateData = <?php echo $fs->is_theme() && $fs->is_premium() && ! $fs->has_any_active_valid_license() ? 'true' : 'false' ?>,
109
  $subscriptionCancellationModal = $( '.fs-modal-subscription-cancellation-<?php echo $fs->get_id() ?>' ),
110
- showDeactivationFeedbackForm = <?php echo ( $show_deactivation_feedback_form ? 'true' : 'false' ) ?>;
 
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 ) {
@@ -181,7 +181,11 @@ HTML;
181
  registerEventHandlers();
182
 
183
  function registerEventHandlers() {
184
- $deactivateLink.click(function (evt) {
 
 
 
 
185
  evt.preventDefault();
186
 
187
  redirectLink = $(this).attr('href');
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">'
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 ) {
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');
freemius/templates/forms/license-activation.php CHANGED
@@ -35,7 +35,7 @@
35
  // Insights platform information.
36
  $fs->get_usage_tracking_terms_url();
37
 
38
- $freemius_link = '<a href="' . $freemius_site_url . '" target="_blank" tabindex="0">freemius.com</a>';
39
 
40
  $message_below_input_field = sprintf(
41
  fs_text_inline( '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.', 'license-sync-disclaimer', $slug ),
@@ -229,16 +229,16 @@ HTML;
229
  + ' </div>'
230
  + '</div>',
231
  $modal = $(modalHtml),
232
- $activateLicenseLink = $('span.activate-license.<?php echo $unique_affix ?> a, .activate-license-trigger.<?php echo $unique_affix ?>'),
233
  $activateLicenseButton = $modal.find('.button-activate-license'),
234
  $licenseKeyInput = $modal.find( 'input.fs-license-key' ),
235
  $licenseActivationMessage = $modal.find( '.license-activation-message' ),
236
  isNetworkActivation = <?php echo $is_network_activation ? 'true' : 'false' ?>,
237
  isUserChangeSupported = <?php echo $is_user_change_supported ? 'true' : 'false' ?>,
238
  isSingleSiteActivation = false,
239
- $ownershipChangeOptionContainer = $modal.find( '.ownership-change-option-container' );
 
240
 
241
- $modal.appendTo($('body'));
242
 
243
  var
244
  $licensesDropdown = $modal.find( '.fs-licenses' ),
@@ -459,7 +459,7 @@ HTML;
459
  });
460
  }
461
 
462
- $activateLicenseLink.click(function (evt) {
463
  evt.preventDefault();
464
 
465
  showModal( evt );
@@ -635,7 +635,7 @@ HTML;
635
 
636
  registerEventHandlers();
637
 
638
- $('body').trigger('licenseActivationLoaded');
639
 
640
  /**
641
  * @author Leo Fajardo (@leorw)
@@ -800,7 +800,7 @@ HTML;
800
 
801
  // Display the dialog box.
802
  $modal.addClass('active');
803
- $('body').addClass('has-fs-modal');
804
 
805
  var
806
  $singleInstallDetails = $( evt.target ).parents( 'tr.fs-install-details' ),
@@ -812,7 +812,9 @@ HTML;
812
  $singleInstallDetails.prev().data( 'blog-id' ) :
813
  null;
814
 
 
815
  $multisiteOptionsContainer.toggle( isNetworkActivation && ! isSingleSiteActivation );
 
816
 
817
  if ( hasLicenseTypes ) {
818
  $licenseTypes.attr( 'checked', false );
@@ -832,7 +834,7 @@ HTML;
832
 
833
  function closeModal() {
834
  $modal.removeClass('active');
835
- $('body').removeClass('has-fs-modal');
836
  }
837
 
838
  function resetActivateLicenseButton() {
35
  // Insights platform information.
36
  $fs->get_usage_tracking_terms_url();
37
 
38
+ $freemius_link = '<a href="' . $freemius_site_url . '" target="_blank" rel="noopener" tabindex="0">freemius.com</a>';
39
 
40
  $message_below_input_field = sprintf(
41
  fs_text_inline( '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.', 'license-sync-disclaimer', $slug ),
229
  + ' </div>'
230
  + '</div>',
231
  $modal = $(modalHtml),
 
232
  $activateLicenseButton = $modal.find('.button-activate-license'),
233
  $licenseKeyInput = $modal.find( 'input.fs-license-key' ),
234
  $licenseActivationMessage = $modal.find( '.license-activation-message' ),
235
  isNetworkActivation = <?php echo $is_network_activation ? 'true' : 'false' ?>,
236
  isUserChangeSupported = <?php echo $is_user_change_supported ? 'true' : 'false' ?>,
237
  isSingleSiteActivation = false,
238
+ $ownershipChangeOptionContainer = $modal.find( '.ownership-change-option-container' ),
239
+ $body = $( 'body' );
240
 
241
+ $modal.appendTo( $body );
242
 
243
  var
244
  $licensesDropdown = $modal.find( '.fs-licenses' ),
459
  });
460
  }
461
 
462
+ $body.on( 'click', 'span.activate-license.<?php echo $unique_affix ?> a, .activate-license-trigger.<?php echo $unique_affix ?>', function (evt) {
463
  evt.preventDefault();
464
 
465
  showModal( evt );
635
 
636
  registerEventHandlers();
637
 
638
+ $body.trigger('licenseActivationLoaded');
639
 
640
  /**
641
  * @author Leo Fajardo (@leorw)
800
 
801
  // Display the dialog box.
802
  $modal.addClass('active');
803
+ $body.addClass('has-fs-modal');
804
 
805
  var
806
  $singleInstallDetails = $( evt.target ).parents( 'tr.fs-install-details' ),
812
  $singleInstallDetails.prev().data( 'blog-id' ) :
813
  null;
814
 
815
+ <?php if ( $fs->apply_filters( 'enable_per_site_activation', true ) ) : ?>
816
  $multisiteOptionsContainer.toggle( isNetworkActivation && ! isSingleSiteActivation );
817
+ <?php endif ?>
818
 
819
  if ( hasLicenseTypes ) {
820
  $licenseTypes.attr( 'checked', false );
834
 
835
  function closeModal() {
836
  $modal.removeClass('active');
837
+ $body.removeClass('has-fs-modal');
838
  }
839
 
840
  function resetActivateLicenseButton() {
freemius/templates/forms/optout.php CHANGED
@@ -49,7 +49,7 @@
49
  fs_text_inline( 'By clicking "Opt Out", we will no longer be sending any data from %s to %s.', 'opt-out-message-clicking-opt-out', $slug ),
50
  $plugin_title,
51
  sprintf(
52
- '<a href="%s" target="_blank">%s</a>',
53
  'https://freemius.com',
54
  'freemius.com'
55
  )
@@ -98,20 +98,21 @@
98
  $modal = $(modalHtml),
99
  $adminNotice = $( <?php echo json_encode( $admin_notice_html ) ?> ),
100
  action = '<?php echo $action ?>',
101
- $actionLink = $( 'span.opt-in-or-opt-out.<?php echo $slug ?> a' ),
102
  $optOutButton = $modal.find( '.button-opt-out' ),
103
  $optOutErrorMessage = $modal.find( '.opt-out-error-message' ),
104
  $extensionsTracking = $modal.find( '.fs-permission-extensions' ),
 
105
  moduleID = '<?php echo $fs->get_id() ?>';
106
 
107
- $actionLink.attr( 'data-action', action );
108
- $modal.appendTo( $( 'body' ) );
109
 
110
  function registerActionLinkClick() {
111
- $actionLink.click(function( evt ) {
112
  evt.preventDefault();
113
 
114
- if ( 'stop_tracking' == $actionLink.attr( 'data-action' ) ) {
115
  showModal();
116
  } else {
117
  optIn();
@@ -151,12 +152,12 @@
151
 
152
  // Display the dialog box.
153
  $modal.addClass( 'active' );
154
- $( 'body' ).addClass( 'has-fs-modal' );
155
  }
156
 
157
  function closeModal() {
158
  $modal.removeClass( 'active' );
159
- $( 'body' ).removeClass( 'has-fs-modal' );
160
  }
161
 
162
  function resetOptOutButton() {
@@ -178,6 +179,8 @@
178
  }
179
 
180
  function sendRequest() {
 
 
181
  $.ajax({
182
  url: ajaxurl,
183
  method: 'POST',
@@ -216,7 +219,7 @@
216
  }
217
  }
218
 
219
- $actionLink.attr( 'data-action', action );
220
  } else {
221
  showError( resultObj.error );
222
  resetOptOutButton();
@@ -315,7 +318,11 @@
315
  '<?php echo ( $fs->is_registered() ? '' : esc_js( $reconnect_url ) ) ?>' :
316
  '');
317
 
318
- $actionLink = $('<a id="fs_theme_opt_in_out" href="' + encodeURI(href) + '" class="button" data-action="' + action + '">' + label + '</a>');
 
 
 
 
319
 
320
  $('.theme-wrap .theme-actions .active-theme').append($actionLink);
321
 
49
  fs_text_inline( 'By clicking "Opt Out", we will no longer be sending any data from %s to %s.', 'opt-out-message-clicking-opt-out', $slug ),
50
  $plugin_title,
51
  sprintf(
52
+ '<a href="%s" target="_blank" rel="noopener">%s</a>',
53
  'https://freemius.com',
54
  'freemius.com'
55
  )
98
  $modal = $(modalHtml),
99
  $adminNotice = $( <?php echo json_encode( $admin_notice_html ) ?> ),
100
  action = '<?php echo $action ?>',
101
+ actionLinkSelector = 'span.opt-in-or-opt-out.<?php echo $slug ?> a',
102
  $optOutButton = $modal.find( '.button-opt-out' ),
103
  $optOutErrorMessage = $modal.find( '.opt-out-error-message' ),
104
  $extensionsTracking = $modal.find( '.fs-permission-extensions' ),
105
+ $body = $( 'body' ),
106
  moduleID = '<?php echo $fs->get_id() ?>';
107
 
108
+ $modal.data( 'action', action );
109
+ $modal.appendTo( $body );
110
 
111
  function registerActionLinkClick() {
112
+ $body.on( 'click', actionLinkSelector, function( evt ) {
113
  evt.preventDefault();
114
 
115
+ if ( 'stop_tracking' == $modal.data( 'action' ) ) {
116
  showModal();
117
  } else {
118
  optIn();
152
 
153
  // Display the dialog box.
154
  $modal.addClass( 'active' );
155
+ $body.addClass( 'has-fs-modal' );
156
  }
157
 
158
  function closeModal() {
159
  $modal.removeClass( 'active' );
160
+ $body.removeClass( 'has-fs-modal' );
161
  }
162
 
163
  function resetOptOutButton() {
179
  }
180
 
181
  function sendRequest() {
182
+ var $actionLink = $( actionLinkSelector );
183
+
184
  $.ajax({
185
  url: ajaxurl,
186
  method: 'POST',
219
  }
220
  }
221
 
222
+ $modal.data( 'action', action );
223
  } else {
224
  showError( resultObj.error );
225
  resetOptOutButton();
318
  '<?php echo ( $fs->is_registered() ? '' : esc_js( $reconnect_url ) ) ?>' :
319
  '');
320
 
321
+ var $actionLink = $('<a id="fs_theme_opt_in_out" href="' + encodeURI(href) + '" class="button">' + label + '</a>');
322
+
323
+ actionLinkSelector = '#fs_theme_opt_in_out';
324
+
325
+ $modal.data( 'action', action );
326
 
327
  $('.theme-wrap .theme-actions .active-theme').append($actionLink);
328
 
freemius/templates/forms/subscription-cancellation.php CHANGED
@@ -133,7 +133,7 @@ fs_enqueue_local_style( 'fs_dialog_boxes', '/admin/dialog-boxes.css' );
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_attr( 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>'
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>'
freemius/templates/forms/trial-start.php CHANGED
@@ -28,7 +28,7 @@
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">%s</a>',
32
  'https://freemius.com',
33
  'freemius.com'
34
  )
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
  )
freemius/templates/partials/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ //Silence is golden
freemius/templates/pricing.php CHANGED
@@ -1,177 +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
- if ( ! $fs->is_registered() ) {
95
- $template_data = array(
96
- 'id' => $fs->get_id(),
97
- );
98
- fs_require_template( 'forms/trial-start.php', $template_data);
99
- }
100
-
101
- $view_params = array(
102
- 'id' => $VARS['id'],
103
- 'page' => strtolower( $fs->get_text_x_inline( 'Pricing', 'noun', 'pricing' ) ),
104
- );
105
- fs_require_once_template('secure-https-header.php', $view_params);
106
-
107
- $has_tabs = $fs->_add_tabs_before_content();
108
-
109
- if ( $has_tabs ) {
110
- $query_params['tabs'] = 'true';
111
- }
112
- ?>
113
- <div id="fs_pricing" class="wrap fs-section fs-full-size-wrapper">
114
- <div id="fs_frame"></div>
115
- <form action="" method="POST">
116
- <input type="hidden" name="user_id"/>
117
- <input type="hidden" name="user_email"/>
118
- <input type="hidden" name="site_id"/>
119
- <input type="hidden" name="public_key"/>
120
- <input type="hidden" name="secret_key"/>
121
- <input type="hidden" name="action" value="account"/>
122
- </form>
123
-
124
- <script type="text/javascript">
125
- (function ($, undef) {
126
- $(function () {
127
- var
128
- // Keep track of the i-frame height.
129
- frame_height = 800,
130
- base_url = '<?php echo WP_FS__ADDRESS ?>',
131
- // Pass the parent page URL into the i-frame in a meaningful way (this URL could be
132
- // passed via query string or hard coded into the child page, it depends on your needs).
133
- src = base_url + '/pricing/?<?php echo http_build_query( $query_params ) ?>#' + encodeURIComponent(document.location.href),
134
-
135
- // Append the I-frame into the DOM.
136
- 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>')
137
- .appendTo('#fs_frame');
138
-
139
- FS.PostMessage.init(base_url, [frame[0]]);
140
-
141
- FS.PostMessage.receive('height', function (data) {
142
- var h = data.height;
143
- if (!isNaN(h) && h > 0 && h != frame_height) {
144
- frame_height = h;
145
- frame.height(frame_height + 'px');
146
-
147
- FS.PostMessage.postScroll(frame[0]);
148
- }
149
- });
150
-
151
- FS.PostMessage.receive('get_dimensions', function (data) {
152
- FS.PostMessage.post('dimensions', {
153
- height : $(document.body).height(),
154
- scrollTop: $(document).scrollTop()
155
- }, frame[0]);
156
- });
157
-
158
- FS.PostMessage.receive('start_trial', function (data) {
159
- openTrialConfirmationModal(data);
160
- });
161
- });
162
- })(jQuery);
163
- </script>
164
- </div>
165
- <?php
166
- if ( $has_tabs ) {
167
- $fs->_add_tabs_after_content();
168
- }
169
-
170
- $params = array(
171
- 'page' => 'pricing',
172
- 'module_id' => $fs->get_id(),
173
- 'module_type' => $fs->get_module_type(),
174
- 'module_slug' => $slug,
175
- 'module_version' => $fs->get_plugin_version(),
176
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  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
@@ -30,7 +30,7 @@
30
  ) ) .
31
  ' - ' .
32
  sprintf(
33
- '<a class="fs-security-proof" href="%s" target="_blank">%s</a>',
34
  'https://www.mcafeesecure.com/verify?host=' . WP_FS__ROOT_DOMAIN_PRODUCTION,
35
  'Freemius Inc. [US]'
36
  );
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
  );
includes/classes/YasrPhpFieldsHelper.php CHANGED
@@ -8,6 +8,7 @@
8
  * <input type="text">
9
  * <select>
10
  * <textarea>
 
11
  *
12
  * Class YasrPhpFieldsHelper
13
  */
@@ -27,13 +28,17 @@ class YasrPhpFieldsHelper {
27
  }
28
 
29
  /**
 
30
  * @param bool|string $title
31
  * @param bool|string $class
32
  * @param array $options
33
  * @param bool|string $name
34
  * @param bool|string|int $default_value
35
  * @param bool|string $id
 
 
36
  */
 
37
  public static function radio($title=false, $class=false, $options=[], $name=false, $default_value=false, $id=false) {
38
 
39
  $attribute = self::escape_attributes($class, $title, $name, $id, $default_value, false );
@@ -69,14 +74,15 @@ class YasrPhpFieldsHelper {
69
  $value = '';
70
  }
71
 
72
- $radio_fields .= sprintf( '<div>
 
73
  <label for="%s">
74
  <input type="radio"
75
- name="%s"
76
- value="%s"
77
- class="%s"
78
- id="%s"
79
- %s
80
  >
81
  %s
82
  </label>
@@ -194,7 +200,7 @@ class YasrPhpFieldsHelper {
194
  }
195
  }
196
 
197
- //Use the $this->field_class attribute if $class is false or empty
198
  if(!$class && self::$field_class) {
199
  $class = self::$field_class;
200
  }
@@ -237,4 +243,57 @@ class YasrPhpFieldsHelper {
237
  return $cleaned_array;
238
  }
239
 
240
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  * <input type="text">
9
  * <select>
10
  * <textarea>
11
+ * <input type="radio">
12
  *
13
  * Class YasrPhpFieldsHelper
14
  */
28
  }
29
 
30
  /**
31
+ *
32
  * @param bool|string $title
33
  * @param bool|string $class
34
  * @param array $options
35
  * @param bool|string $name
36
  * @param bool|string|int $default_value
37
  * @param bool|string $id
38
+ *
39
+ * @return string
40
  */
41
+
42
  public static function radio($title=false, $class=false, $options=[], $name=false, $default_value=false, $id=false) {
43
 
44
  $attribute = self::escape_attributes($class, $title, $name, $id, $default_value, false );
74
  $value = '';
75
  }
76
 
77
+ $radio_fields .= sprintf(
78
+ '<div>
79
  <label for="%s">
80
  <input type="radio"
81
+ name="%s"
82
+ value="%s"
83
+ class="%s"
84
+ id="%s"
85
+ %s
86
  >
87
  %s
88
  </label>
200
  }
201
  }
202
 
203
+ //Use the self::field_class attribute if $class is false or empty
204
  if(!$class && self::$field_class) {
205
  $class = self::$field_class;
206
  }
243
  return $cleaned_array;
244
  }
245
 
246
+ /**
247
+ * @param $name
248
+ * @param $class
249
+ * @param $db_value
250
+ * @param $id
251
+ *
252
+ * return void
253
+ *
254
+ *@since 2.3.3
255
+ *
256
+ */
257
+ public static function radioSelectSize($name, $class, $db_value = false, $id = false) {
258
+ $array_size = array( 'small', 'medium', 'large' );
259
+
260
+ foreach($array_size as $size) {
261
+ $id_string = $id . $size;
262
+
263
+ //must be inside for each, or when loop arrive to last element
264
+ //checked is defined
265
+ $checked = '';
266
+
267
+ //If db_value === false, there is no need to check for db value
268
+ //so checked is the medium star (i.e. ranking page)
269
+ if($db_value === false) {
270
+ if($size === 'medium') {
271
+ $checked = 'checked';
272
+ }
273
+ } else if($db_value === $size) {
274
+ $checked = 'checked';
275
+ }
276
+
277
+ echo sprintf('<div class="yasr-option-div">
278
+ <label for="%s">
279
+ <input type="radio"
280
+ name="%s"
281
+ value="%s"
282
+ class="%s"
283
+ id="%s"
284
+ %s
285
+ >
286
+ <img src="%syasr-stars-%s.png"
287
+ class="yasr-img-option-size" alt=%s>
288
+ <span class="yasr-text-options-size">
289
+ %s
290
+ </span>
291
+ </label>
292
+ </div>',
293
+ $id_string, $name, $size, $class, $id_string, $checked, YASR_IMG_DIR, $size, $size,
294
+ __(ucwords($size), 'yet-another-stars-rating'));
295
+
296
+ } //end foreach
297
+ }
298
+
299
+ }
includes/css/yasr-table-light.css CHANGED
@@ -41,7 +41,7 @@
41
  .yasr-table-chart tr:nth-child(odd) {
42
  background: #FFFFec;
43
  }
44
- /* Define the background color for all the EVEN background rows */
45
  .yasr-table-chart tr:nth-child(even) {
46
  background: #FFFFFF;
47
  }
41
  .yasr-table-chart tr:nth-child(odd) {
42
  background: #FFFFec;
43
  }
44
+ /* Define the background color for all the EVEN background rows */
45
  .yasr-table-chart tr:nth-child(even) {
46
  background: #FFFFFF;
47
  }
includes/css/yasr.css CHANGED
@@ -70,6 +70,10 @@
70
  display: inline-block;
71
  }
72
 
 
 
 
 
73
  .yasr-total-average-text {
74
  display: inline-block;
75
  }
70
  display: inline-block;
71
  }
72
 
73
+ .yasr-visitor-votes-after-stars {
74
+ display: inline;
75
+ }
76
+
77
  .yasr-total-average-text {
78
  display: inline-block;
79
  }
includes/shortcodes/classes/YasrOverallRating.php CHANGED
@@ -115,7 +115,6 @@ class YasrOverallRating extends YasrShortcode {
115
  */
116
  protected function customTextBefore() {
117
  if (YASR_TEXT_BEFORE_STARS === 1 && YASR_TEXT_BEFORE_OVERALL !== '') {
118
-
119
  //Get overall Rating
120
  $this->overall_rating = YasrDatabaseRatings::getOverallRating();
121
 
@@ -125,7 +124,6 @@ class YasrOverallRating extends YasrShortcode {
125
  </div>";
126
 
127
  return $shortcode_html;
128
-
129
  }
130
 
131
  }
115
  */
116
  protected function customTextBefore() {
117
  if (YASR_TEXT_BEFORE_STARS === 1 && YASR_TEXT_BEFORE_OVERALL !== '') {
 
118
  //Get overall Rating
119
  $this->overall_rating = YasrDatabaseRatings::getOverallRating();
120
 
124
  </div>";
125
 
126
  return $shortcode_html;
 
127
  }
128
 
129
  }
includes/shortcodes/classes/YasrVisitorMultiSet.php CHANGED
@@ -104,7 +104,7 @@ class YasrVisitorMultiSet extends YasrMultiSet {
104
  }
105
 
106
  public function checkCookie() {
107
- $yasr_cookiename = 'yasr_multi_visitor_cookie';
108
 
109
  //Check cookie and if voting is allowed only to logged in users
110
  if (isset($_COOKIE[$yasr_cookiename])) {
104
  }
105
 
106
  public function checkCookie() {
107
+ $yasr_cookiename = apply_filters('yasr_mv_cookie', 'yasr_multi_visitor_cookie');
108
 
109
  //Check cookie and if voting is allowed only to logged in users
110
  if (isset($_COOKIE[$yasr_cookiename])) {
includes/shortcodes/classes/YasrVisitorVotes.php CHANGED
@@ -31,6 +31,14 @@ class YasrVisitorVotes extends YasrShortcode {
31
  protected $unique_id;
32
  protected $ajax_nonce_visitor;
33
  protected $span_text_after_stars;
 
 
 
 
 
 
 
 
34
 
35
  public function __construct($atts, $shortcode_name) {
36
  parent::__construct($atts, $shortcode_name);
@@ -121,8 +129,8 @@ class YasrVisitorVotes extends YasrShortcode {
121
  * @return int |bool
122
  */
123
  public static function checkCookie ($post_id = false) {
124
- //name of cookie to check
125
- $yasr_cookiename = 'yasr_visitor_vote_cookie';
126
 
127
  $cookie_value = false;
128
 
@@ -185,7 +193,7 @@ class YasrVisitorVotes extends YasrShortcode {
185
  //If user has already rated
186
  if ($vote_if_user_already_rated) {
187
  $span_bottom_line_content = "<span class='yasr-already-voted-text'>";
188
- if (YASR_TEXT_BEFORE_STARS === 1 && YASR_CUSTOM_TEXT_USER_VOTED != '') {
189
  $span_bottom_line_content .= YASR_CUSTOM_TEXT_USER_VOTED;
190
  } else {
191
  $span_bottom_line_content .=
@@ -197,7 +205,7 @@ class YasrVisitorVotes extends YasrShortcode {
197
 
198
  elseif ($stars_enabled === 'false_already_voted') {
199
  $span_bottom_line_content = "<span class='yasr-already-voted-text'>";
200
- if (YASR_TEXT_BEFORE_STARS === 1 && YASR_CUSTOM_TEXT_USER_VOTED != '') {
201
  $span_bottom_line_content .= YASR_CUSTOM_TEXT_USER_VOTED;
202
  } else {
203
  $span_bottom_line_content .=
@@ -250,12 +258,33 @@ class YasrVisitorVotes extends YasrShortcode {
250
  $average_rating = 0;
251
  }
252
 
253
- $this->span_text_after_stars = "<span class='yasr-total-average-container'
254
- id='yasr-total-average-text-". $this->unique_id ."'>";
255
 
256
- $number_of_votes_container = '<span id="yasr-vv-votes-number-container-'. $this->unique_id .'">';
257
- $average_rating_container = '<span id="yasr-vv-average-container-'. $this->unique_id .'">';
258
- $closing_span = '</span>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
 
260
  if (YASR_TEXT_BEFORE_STARS === 1 && YASR_TEXT_BEFORE_VISITOR_RATING !== '') {
261
  $text_before_star = str_replace(
@@ -264,19 +293,48 @@ class YasrVisitorVotes extends YasrShortcode {
264
  '%average%'
265
  ),
266
  array(
267
- $number_of_votes_container . $number_of_votes . $closing_span,
268
- $average_rating_container . $average_rating . $closing_span
269
- ),
270
  YASR_TEXT_BEFORE_VISITOR_RATING
271
  );
272
 
273
  $class_text_before = 'yasr-custom-text-vv-before yasr-custom-text-vv-before-'.$this->post_id;
274
 
275
- $this->shortcode_html .= '<div class="'.$class_text_before.'">'
276
- . $text_before_star .
277
- '</div>';
 
278
  }
279
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
280
  if (YASR_TEXT_BEFORE_STARS === 1 && YASR_TEXT_AFTER_VISITOR_RATING !== '') {
281
  $text_after_star = str_replace(
282
  array(
@@ -284,37 +342,19 @@ class YasrVisitorVotes extends YasrShortcode {
284
  '%average%'
285
  ),
286
  array(
287
- $number_of_votes_container . $number_of_votes . $closing_span,
288
- $average_rating_container . $average_rating . $closing_span
289
  ),
290
  YASR_TEXT_AFTER_VISITOR_RATING
291
  );
292
 
293
- $this->span_text_after_stars .= $text_after_star;
294
- }
295
-
296
- //If no customization, default value that has only span after
297
- else {
298
- $this->span_text_after_stars .= '['
299
- . __('Total:', 'yet-another-stars-rating')
300
- . '&nbsp;'
301
- . $number_of_votes_container
302
- . $number_of_votes
303
- . $closing_span
304
- . '&nbsp; &nbsp;'
305
- . __('Average:', 'yet-another-stars-rating')
306
- . '&nbsp;'
307
- . $average_rating_container
308
- . $average_rating
309
- . $closing_span
310
- . '/5]';
311
  }
312
 
313
- $this->span_text_after_stars .= '</span>';
314
-
315
- return;
316
  }
317
-
 
318
  /**
319
  * This function will return the html code for the dashicons
320
  *
@@ -368,8 +408,8 @@ class YasrVisitorVotes extends YasrShortcode {
368
  * @return string
369
  */
370
  protected function returnYasrVisitorVotes ($cookie_value, $post_id) {
371
- $span_container_after_stars = "<span id='yasr-visitor-votes-container-after-stars-$this->unique_id'
372
- class='yasr-visitor-votes-after-stars-class'>";
373
 
374
  $this->shortcode_html .= $span_container_after_stars;
375
  $this->shortcode_html .= $this->visitorStats();
@@ -377,8 +417,8 @@ class YasrVisitorVotes extends YasrShortcode {
377
  if(YASR_ENABLE_AJAX !== 'yes') {
378
  $this->shortcode_html .= self::showTextBelowStars($cookie_value, $post_id);
379
  }
380
- $this->shortcode_html .= '</span>'; //Close yasr-visitor-votes-after-stars and yasr_visitor_votes
381
- $this->shortcode_html .= '</div>'; //close all
382
  $this->shortcode_html .= '<!--End Yasr Visitor Votes Shortcode-->';
383
 
384
  return $this->shortcode_html;
31
  protected $unique_id;
32
  protected $ajax_nonce_visitor;
33
  protected $span_text_after_stars;
34
+ /**
35
+ * @var string
36
+ */
37
+ private $number_of_votes_container;
38
+ /**
39
+ * @var string
40
+ */
41
+ private $average_rating_container;
42
 
43
  public function __construct($atts, $shortcode_name) {
44
  parent::__construct($atts, $shortcode_name);
129
  * @return int |bool
130
  */
131
  public static function checkCookie ($post_id = false) {
132
+
133
+ $yasr_cookiename = apply_filters('yasr_vv_cookie', 'yasr_visitor_vote_cookie');
134
 
135
  $cookie_value = false;
136
 
193
  //If user has already rated
194
  if ($vote_if_user_already_rated) {
195
  $span_bottom_line_content = "<span class='yasr-already-voted-text'>";
196
+ if (YASR_TEXT_BEFORE_STARS === 1 && YASR_CUSTOM_TEXT_USER_VOTED !== '') {
197
  $span_bottom_line_content .= YASR_CUSTOM_TEXT_USER_VOTED;
198
  } else {
199
  $span_bottom_line_content .=
205
 
206
  elseif ($stars_enabled === 'false_already_voted') {
207
  $span_bottom_line_content = "<span class='yasr-already-voted-text'>";
208
+ if (YASR_TEXT_BEFORE_STARS === 1 && YASR_CUSTOM_TEXT_USER_VOTED !== '') {
209
  $span_bottom_line_content .= YASR_CUSTOM_TEXT_USER_VOTED;
210
  } else {
211
  $span_bottom_line_content .=
258
  $average_rating = 0;
259
  }
260
 
261
+ $this->span_text_after_stars = '<span class="yasr-total-average-container"
262
+ id="yasr-total-average-text-'. $this->unique_id .'">';
263
 
264
+ $this->number_of_votes_container = '<span id="yasr-vv-votes-number-container-'. $this->unique_id .'">';
265
+ $this->average_rating_container = '<span id="yasr-vv-average-container-'. $this->unique_id .'">';
266
+
267
+ $this->textBeforeStars($number_of_votes, $average_rating);
268
+ $this->textAfterStars($number_of_votes, $average_rating);
269
+
270
+
271
+ $this->span_text_after_stars .= '</span>';
272
+
273
+ }
274
+
275
+ /**
276
+ * @since 2.4.7
277
+ *
278
+ * Adds to $this->shortcode_html the text before the stars
279
+ *
280
+ * @param $number_of_votes
281
+ * @param $average_rating
282
+ *
283
+ * @return void
284
+ */
285
+ protected function textBeforeStars($number_of_votes, $average_rating) {
286
+ //default value
287
+ $shortcode_html = false;
288
 
289
  if (YASR_TEXT_BEFORE_STARS === 1 && YASR_TEXT_BEFORE_VISITOR_RATING !== '') {
290
  $text_before_star = str_replace(
293
  '%average%'
294
  ),
295
  array(
296
+ $this->number_of_votes_container . $number_of_votes . '</span>',
297
+ $this->average_rating_container . $average_rating . '</span>'
298
+ ),
299
  YASR_TEXT_BEFORE_VISITOR_RATING
300
  );
301
 
302
  $class_text_before = 'yasr-custom-text-vv-before yasr-custom-text-vv-before-'.$this->post_id;
303
 
304
+ $shortcode_html = '<div class="'.$class_text_before.'">'
305
+ . $text_before_star .
306
+ '</div>';
307
+
308
  }
309
 
310
+ //if filters doesn't exists, put $shortcode_html inside $this->shortcode_html
311
+ $this->shortcode_html .= apply_filters('yasr_vv_txt_before', $shortcode_html);
312
+ }
313
+
314
+
315
+ /**
316
+ * * @since 2.4.7
317
+ *
318
+ * Adds to $this->span_text_after_stars the text after the stars
319
+ *
320
+ * @param $number_of_votes
321
+ * @param $average_rating
322
+ */
323
+ protected function textAfterStars ($number_of_votes, $average_rating) {
324
+ $span_text_after_stars = '['
325
+ . __('Total:', 'yet-another-stars-rating')
326
+ . '&nbsp;'
327
+ . $this->number_of_votes_container
328
+ . $number_of_votes
329
+ . '</span>'
330
+ . '&nbsp; &nbsp;'
331
+ . __('Average:', 'yet-another-stars-rating')
332
+ . '&nbsp;'
333
+ . $this->average_rating_container
334
+ . $average_rating
335
+ . '</span>'
336
+ . '/5]';
337
+
338
  if (YASR_TEXT_BEFORE_STARS === 1 && YASR_TEXT_AFTER_VISITOR_RATING !== '') {
339
  $text_after_star = str_replace(
340
  array(
342
  '%average%'
343
  ),
344
  array(
345
+ $this->number_of_votes_container . $number_of_votes . '</span>',
346
+ $this->average_rating_container . $average_rating . '</span>',
347
  ),
348
  YASR_TEXT_AFTER_VISITOR_RATING
349
  );
350
 
351
+ $span_text_after_stars = $text_after_star;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
352
  }
353
 
354
+ $this->span_text_after_stars .= apply_filters('yasr_vv_txt_after', $span_text_after_stars);
 
 
355
  }
356
+
357
+
358
  /**
359
  * This function will return the html code for the dashicons
360
  *
408
  * @return string
409
  */
410
  protected function returnYasrVisitorVotes ($cookie_value, $post_id) {
411
+ $span_container_after_stars = "<div id='yasr-visitor-votes-container-after-stars-$this->unique_id'
412
+ class='yasr-visitor-votes-after-stars'>";
413
 
414
  $this->shortcode_html .= $span_container_after_stars;
415
  $this->shortcode_html .= $this->visitorStats();
417
  if(YASR_ENABLE_AJAX !== 'yes') {
418
  $this->shortcode_html .= self::showTextBelowStars($cookie_value, $post_id);
419
  }
420
+ $this->shortcode_html .= '</div>'; //Close yasr-visitor-votes-after-stars
421
+ $this->shortcode_html .= '</div></div>'; //close all
422
  $this->shortcode_html .= '<!--End Yasr Visitor Votes Shortcode-->';
423
 
424
  return $this->shortcode_html;
includes/shortcodes/yasr-shortcode-ajax.php CHANGED
@@ -122,7 +122,7 @@ function yasr_insert_visitor_votes_callback() {
122
  }
123
 
124
  if ($result_update_log || $result_insert_log) {
125
- $row_exists = YasrDatabaseRatings::getVisitorVotes($post_id);
126
 
127
  $user_votes_sum = $row_exists['sum_votes'];
128
  $number_of_votes = $row_exists['number_of_votes'];
@@ -139,14 +139,17 @@ function yasr_insert_visitor_votes_callback() {
139
  $total_rating = ($user_votes_sum / $number_of_votes);
140
  $medium_rating = round($total_rating, 1);
141
 
 
 
 
142
  $html_to_return = '<span class="yasr-total-average-text"> ['
143
- . __('Total:', 'yet-another-stars-rating') .
144
- " $number_of_votes &nbsp; &nbsp;"
145
- . __('Average:', 'yet-another-stars-rating') .
146
- " $medium_rating/5 ]
147
- </span>";
148
  $html_to_return .= '<span class="yasr-small-block-bold" id="yasr-vote-saved">'
149
- . __('Vote Saved', 'yet-another-stars-rating') .
150
  '</span>';
151
 
152
  echo json_encode($html_to_return);
@@ -304,7 +307,10 @@ function yasr_visitor_multiset_field_vote_callback() {
304
 
305
  yasr_setcookie($cookiename, $data_to_save);
306
 
307
- _e('Rating saved!', 'yet-another-stars-rating');
 
 
 
308
 
309
  } else {
310
  _e('Rating not saved. Please Try again', 'yet-another-stars-rating');
122
  }
123
 
124
  if ($result_update_log || $result_insert_log) {
125
+ $row_exists = YasrDatabaseRatings::getVisitorVotes($post_id);
126
 
127
  $user_votes_sum = $row_exists['sum_votes'];
128
  $number_of_votes = $row_exists['number_of_votes'];
139
  $total_rating = ($user_votes_sum / $number_of_votes);
140
  $medium_rating = round($total_rating, 1);
141
 
142
+ $rating_saved_text = __('Rating Saved', 'yet-another-stars-rating');
143
+ $rating_saved_text = apply_filters('yasr_vv_saved_text', $rating_saved_text);
144
+
145
  $html_to_return = '<span class="yasr-total-average-text"> ['
146
+ . __('Total:', 'yet-another-stars-rating') .
147
+ " $number_of_votes &nbsp; &nbsp;"
148
+ . __('Average:', 'yet-another-stars-rating') .
149
+ " $medium_rating/5 ]
150
+ </span>";
151
  $html_to_return .= '<span class="yasr-small-block-bold" id="yasr-vote-saved">'
152
+ . $rating_saved_text .
153
  '</span>';
154
 
155
  echo json_encode($html_to_return);
307
 
308
  yasr_setcookie($cookiename, $data_to_save);
309
 
310
+ $rating_saved_text = __('Rating Saved', 'yet-another-stars-rating');
311
+ $rating_saved_text = apply_filters('yasr_mv_saved_text', $rating_saved_text);
312
+
313
+ echo $rating_saved_text;
314
 
315
  } else {
316
  _e('Rating not saved. Please Try again', 'yet-another-stars-rating');
includes/yasr-includes-init.php CHANGED
@@ -65,7 +65,11 @@ $yasr_stored_options = get_option('yasr_general_options');
65
 
66
  global $yasr_stored_options;
67
 
68
- define('YASR_AUTO_INSERT_ENABLED', (int)$yasr_stored_options['auto_insert_enabled']);
 
 
 
 
69
 
70
  if (YASR_AUTO_INSERT_ENABLED === 1) {
71
  define('YASR_AUTO_INSERT_WHAT', $yasr_stored_options['auto_insert_what']);
@@ -83,7 +87,11 @@ if (YASR_AUTO_INSERT_ENABLED === 1) {
83
  define('YASR_AUTO_INSERT_CUSTOM_POST_ONLY', null);
84
  }
85
 
86
- define('YASR_STARS_TITLE', $yasr_stored_options['stars_title']);
 
 
 
 
87
 
88
  if (YASR_STARS_TITLE === 'yes') {
89
  define('YASR_STARS_TITLE_WHAT', $yasr_stored_options['stars_title_what']);
@@ -95,10 +103,23 @@ if (YASR_STARS_TITLE === 'yes') {
95
  define('YASR_STARS_TITLE_WHERE', null);
96
  }
97
 
 
 
 
 
 
98
 
99
- define('YASR_SHOW_OVERALL_IN_LOOP', $yasr_stored_options['show_overall_in_loop']);
100
- define('YASR_SHOW_VISITOR_VOTES_IN_LOOP', $yasr_stored_options['show_visitor_votes_in_loop']);
101
- define('YASR_TEXT_BEFORE_STARS', (int)$yasr_stored_options['text_before_stars']);
 
 
 
 
 
 
 
 
102
 
103
  if (YASR_TEXT_BEFORE_STARS === 1) {
104
  define(
@@ -123,10 +144,29 @@ if (YASR_TEXT_BEFORE_STARS === 1) {
123
  );
124
  }
125
 
126
- define('YASR_VISITORS_STATS', $yasr_stored_options['visitors_stats']);
127
- define('YASR_ALLOWED_USER', $yasr_stored_options['allowed_user']);
128
- define('YASR_ENABLE_IP', $yasr_stored_options['enable_ip']);
129
- define('YASR_ITEMTYPE', $yasr_stored_options['snippet_itemtype']);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
 
131
  if (isset($yasr_stored_options['publisher'])) {
132
  define('YASR_PUBLISHER_TYPE', $yasr_stored_options['publisher']);
@@ -233,6 +273,15 @@ $supported_schema_types = json_encode(
233
  $array_item_type_info = json_encode(
234
  array(
235
  'yasr_schema_title',
 
 
 
 
 
 
 
 
 
236
  'yasr_product_brand',
237
  'yasr_product_sku',
238
  'yasr_product_global_identifier_select',
65
 
66
  global $yasr_stored_options;
67
 
68
+ if(isset($yasr_stored_options['stars_title'])) {
69
+ define('YASR_AUTO_INSERT_ENABLED', (int)$yasr_stored_options['auto_insert_enabled']);
70
+ } else {
71
+ define('YASR_AUTO_INSERT_ENABLED', null);
72
+ }
73
 
74
  if (YASR_AUTO_INSERT_ENABLED === 1) {
75
  define('YASR_AUTO_INSERT_WHAT', $yasr_stored_options['auto_insert_what']);
87
  define('YASR_AUTO_INSERT_CUSTOM_POST_ONLY', null);
88
  }
89
 
90
+ if(isset($yasr_stored_options['stars_title'])) {
91
+ define('YASR_STARS_TITLE', $yasr_stored_options['stars_title']);
92
+ } else {
93
+ define('YASR_STARS_TITLE', null);
94
+ }
95
 
96
  if (YASR_STARS_TITLE === 'yes') {
97
  define('YASR_STARS_TITLE_WHAT', $yasr_stored_options['stars_title_what']);
103
  define('YASR_STARS_TITLE_WHERE', null);
104
  }
105
 
106
+ if(isset($yasr_stored_options['show_overall_in_loop'])) {
107
+ define('YASR_SHOW_OVERALL_IN_LOOP', $yasr_stored_options['show_overall_in_loop']);
108
+ } else {
109
+ define('YASR_SHOW_OVERALL_IN_LOOP', null);
110
+ }
111
 
112
+ if(isset($yasr_stored_options['show_visitor_votes_in_loop'])) {
113
+ define('YASR_SHOW_VISITOR_VOTES_IN_LOOP', $yasr_stored_options['show_visitor_votes_in_loop']);
114
+ } else {
115
+ define('YASR_SHOW_VISITOR_VOTES_IN_LOOP', null);
116
+ }
117
+
118
+ if(isset($yasr_stored_options['text_before_stars'])) {
119
+ define('YASR_TEXT_BEFORE_STARS', (int)$yasr_stored_options['text_before_stars']);
120
+ } else {
121
+ define('YASR_TEXT_BEFORE_STARS', null);
122
+ }
123
 
124
  if (YASR_TEXT_BEFORE_STARS === 1) {
125
  define(
144
  );
145
  }
146
 
147
+ if(isset($yasr_stored_options['visitors_stats'])) {
148
+ define('YASR_VISITORS_STATS', $yasr_stored_options['visitors_stats']);
149
+ } else {
150
+ define('YASR_VISITORS_STATS', false);
151
+ }
152
+
153
+ if(isset($yasr_stored_options['allowed_user'])) {
154
+ define('YASR_ALLOWED_USER', $yasr_stored_options['allowed_user']);
155
+ } else {
156
+ define('YASR_ALLOWED_USER', false);
157
+ }
158
+
159
+ if(isset($yasr_stored_options['enable_ip'])) {
160
+ define('YASR_ENABLE_IP', $yasr_stored_options['enable_ip']);
161
+ } else {
162
+ define('YASR_ENABLE_IP', false);
163
+ }
164
+
165
+ if(isset($yasr_stored_options['snippet_itemtype'])) {
166
+ define('YASR_ITEMTYPE', $yasr_stored_options['snippet_itemtype']);
167
+ } else {
168
+ define('YASR_ITEMTYPE', false);
169
+ }
170
 
171
  if (isset($yasr_stored_options['publisher'])) {
172
  define('YASR_PUBLISHER_TYPE', $yasr_stored_options['publisher']);
273
  $array_item_type_info = json_encode(
274
  array(
275
  'yasr_schema_title',
276
+ 'yasr_book_author',
277
+ 'yasr_book_bookedition',
278
+ 'yasr_book_bookformat',
279
+ 'yasr_book_isbn',
280
+ 'yasr_book_number_of_pages',
281
+ 'yasr_movie_actor',
282
+ 'yasr_movie_director',
283
+ 'yasr_movie_duration',
284
+ 'yasr_movie_datecreated',
285
  'yasr_product_brand',
286
  'yasr_product_sku',
287
  'yasr_product_global_identifier_select',
public/classes/YasrRichSnippetAdditionalFields.php CHANGED
@@ -32,7 +32,7 @@ class YasrRichSnippetAdditionalFields {
32
  //avoid undefined
33
  $more_rich_snippet = array();
34
 
35
- //get the select itemTyper
36
  $review_choosen = yasr_get_itemType();
37
 
38
  if($review_choosen === 'Product') {
@@ -49,6 +49,14 @@ class YasrRichSnippetAdditionalFields {
49
  $more_rich_snippet = $this->softwareApplication($saved_data);
50
  }
51
 
 
 
 
 
 
 
 
 
52
  return array_merge($rich_snippet, $more_rich_snippet);
53
 
54
  }
@@ -152,6 +160,60 @@ class YasrRichSnippetAdditionalFields {
152
  return $rich_snippet;
153
  }
154
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  private function saved_data() {
156
  $saved_data = get_post_meta(get_the_ID(), 'yasr_schema_additional_fields', true);
157
  //avoid undefined
32
  //avoid undefined
33
  $more_rich_snippet = array();
34
 
35
+ //get the select itemType
36
  $review_choosen = yasr_get_itemType();
37
 
38
  if($review_choosen === 'Product') {
49
  $more_rich_snippet = $this->softwareApplication($saved_data);
50
  }
51
 
52
+ if($review_choosen === 'Book') {
53
+ $more_rich_snippet = $this->book($saved_data);
54
+ }
55
+
56
+ if($review_choosen === 'Movie') {
57
+ $more_rich_snippet = $this->movie($saved_data);
58
+ }
59
+
60
  return array_merge($rich_snippet, $more_rich_snippet);
61
 
62
  }
160
  return $rich_snippet;
161
  }
162
 
163
+ private function book($saved_data) {
164
+
165
+ if(!empty($saved_data['yasr_book_author'])) {
166
+ $rich_snippet['author'] = array(
167
+ '@type' => 'Person',
168
+ 'name' => $saved_data['yasr_book_author'],
169
+ );
170
+ }
171
+
172
+ $rich_snippet['bookEdition'] = $saved_data['yasr_book_bookedition'];
173
+ $rich_snippet['bookFormat'] = $saved_data['yasr_book_bookformat'];
174
+ $rich_snippet['isbn'] = $saved_data['yasr_book_isbn'];
175
+ $rich_snippet['numberOfPages'] = $saved_data['yasr_book_number_of_pages'];
176
+
177
+ return $rich_snippet;
178
+ }
179
+
180
+ private function movie($saved_data) {
181
+
182
+ $actors_array_clean = array();
183
+ $director_array_clean = array();
184
+
185
+ if(!empty($saved_data['yasr_movie_actor'])) {
186
+ $actors_array = explode(PHP_EOL, $saved_data['yasr_movie_actor']);
187
+ $i=0;
188
+ foreach ($actors_array as $actor) {
189
+ $actors_array_clean[$i]['@type'] = "Person";
190
+ $actors_array_clean[$i]['name'] = $actor;
191
+
192
+ $i++;
193
+ }
194
+ }
195
+
196
+ $rich_snippet['actor'] = $actors_array_clean;
197
+
198
+ if(!empty($saved_data['yasr_movie_director'])) {
199
+ $director_array = explode(PHP_EOL, $saved_data['yasr_movie_director']);
200
+ $i=0;
201
+ foreach ($director_array as $director) {
202
+ $director_array_clean[$i]['@type'] = "Person";
203
+ $director_array_clean[$i]['name'] = $director;
204
+
205
+ $i++;
206
+ }
207
+ }
208
+
209
+ $rich_snippet['director'] = $director_array_clean;
210
+
211
+ $rich_snippet['duration'] = $saved_data['yasr_movie_duration'];
212
+ $rich_snippet['dateCreated'] = $saved_data['yasr_movie_datecreated'];
213
+
214
+ return $rich_snippet;
215
+ }
216
+
217
  private function saved_data() {
218
  $saved_data = get_post_meta(get_the_ID(), 'yasr_schema_additional_fields', true);
219
  //avoid undefined
readme.txt CHANGED
@@ -5,7 +5,7 @@ Requires at least: 4.9.0
5
  Contributors: Dudo
6
  Tested up to: 5.5.2
7
  Requires PHP: 5.3
8
- Stable tag: 2.4.6
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
  Boost the way people interact with your site with an easy WordPress stars rating system! With schema.org rich snippets YASR will improve your SEO
@@ -42,7 +42,7 @@ A tab will appear in the settings if one of these plugin is detected.
42
  YASR supports the following schema.org itemtypes:
43
 
44
  BlogPosting ✝,
45
- Book,
46
  Course,
47
  CreativeWorkSeason,
48
  CreativeWorkSeries,
@@ -51,7 +51,7 @@ Event,
51
  Game,
52
  LocalBusiness ‡,
53
  MediaObject,
54
- Movie,
55
  MusicPlaylist,
56
  MusicRecording,
57
  Organization,
@@ -62,11 +62,24 @@ SoftwareApplication
62
  ✝ BlogPosting itemtype will not show stars in search result.
63
  More info [here](https://wordpress.org/plugins/yet-another-stars-rating/faq/)
64
 
 
 
 
 
 
 
 
65
  ‡ LocalBusiness supports the following properties
66
  * Address
67
  * PriceRange
68
  * Telephone
69
 
 
 
 
 
 
 
70
  § Products supports the following properties
71
  * Brand
72
  * Sku
@@ -168,12 +181,29 @@ If doesn't, you should work on your seo reputation.
168
 
169
  The full changelog can be found in the plugin's directory. Recent entries:
170
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  = 2.4.6 =
172
  NEW OPTION: Is now possible to exclude pages when stars next the title are enabled
173
  TWEAKED: changed classname from yasr-container-custom-text-and-visitor-rating to yasr-custom-text-vv-before
174
  TWEAKED: span 'yasr-custom-text-before-visitor-rating' removed
175
  TWEAKED: added hooks yasr_vv_cookie and yasr_mv_cookie to filter cookies name
176
- TWEAKED: minor changes
177
 
178
  = 2.4.5 =
179
  FIXED: %overall_rating% pattern didn't work for custom text
@@ -181,10 +211,12 @@ FIXED: fixed link in yasr_most_or_highest_rated_posts
181
  FIXED: warning in yasr-settings-functions-multiset.php
182
  TWEAKED: minor changes
183
 
 
184
  = 2.4.4 =
185
  * TWEAKED: added yasr_auto_insert_exclude_cpt hook
186
  * TWEAKED: code cleanup
187
 
 
188
  = 2.4.3 =
189
  * NEW FEATURE: is now possible to show ratings next to the title
190
  * FIXED: guten blocks returns error if post_id parameter was set
@@ -196,6 +228,7 @@ TWEAKED: minor changes
196
  = 2.4.1 =
197
  * FIXED: minor fix if more yasr_visitor_votes with different differents post_id are used in the same page
198
 
 
199
  = 2.4.0 =
200
  * NEW FEATURE: is now possible to customize the itemType Name: if empty, post title will be used instead-
201
  * TWEAKED: Custom text to show when an user has already voted now shows up even for logged in users
@@ -203,34 +236,5 @@ TWEAKED: minor changes
203
  * TWEAKED: admin .js files are now bundled into a single one
204
  * TWEAKED: support for IE11 (will be dropped in 12 months)
205
 
206
- = 2.3.9 =
207
- * FIXED: yasr_visitor_votes readonly didn't show up if load results with ajax is enabled
208
- * FIXED: missing fragment error if gutenber used
209
- * FIXED: empty tooltip on yasr_visitor_votes
210
-
211
- = 2.3.8 =
212
- * TWEAKED: Using GET instead of POST when getting rest response
213
-
214
- = 2.3.7 =
215
- * FIXED: Minor changes
216
-
217
- = 2.3.6 =
218
- * FIXED: visitor multiset doesn't allow user to vote in some circumstances
219
- * TWEAKED : minor changes in ajax call for yasr_visitor_votes
220
-
221
- = 2.3.5 =
222
- * IMPROVED: is now possible to select between "Organization" or "Person" in "Rich snippet options".
223
- You may need to save again "Publisher name" and "Image Url"
224
- * IMPROVED: code cleanup
225
-
226
- = 2.3.4 =
227
- * IMPROVED: added Software Application itemType
228
- * IMPROVED: added Organization itemType
229
- * IMPORVED: added reviewBody and description properties
230
- * FIXED: "Your ratings" widget in admin dashboard
231
-
232
- = 2.3.1 =
233
- * Code refactor, according to boilerplate standards
234
-
235
  = Additional Info =
236
  See credits.txt file
5
  Contributors: Dudo
6
  Tested up to: 5.5.2
7
  Requires PHP: 5.3
8
+ Stable tag: 2.4.7
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
  Boost the way people interact with your site with an easy WordPress stars rating system! With schema.org rich snippets YASR will improve your SEO
42
  YASR supports the following schema.org itemtypes:
43
 
44
  BlogPosting ✝,
45
+ Book ¶,
46
  Course,
47
  CreativeWorkSeason,
48
  CreativeWorkSeries,
51
  Game,
52
  LocalBusiness ‡,
53
  MediaObject,
54
+ Movie Δ,
55
  MusicPlaylist,
56
  MusicRecording,
57
  Organization,
62
  ✝ BlogPosting itemtype will not show stars in search result.
63
  More info [here](https://wordpress.org/plugins/yet-another-stars-rating/faq/)
64
 
65
+ ¶ Book supports the following properties
66
+ * author
67
+ * bookEdition
68
+ * BookFormat
69
+ * ISBN
70
+ * numberOfPages
71
+
72
  ‡ LocalBusiness supports the following properties
73
  * Address
74
  * PriceRange
75
  * Telephone
76
 
77
+ Δ Movie supports the following properties
78
+ * actor
79
+ * director
80
+ * Duration
81
+ * dateCreated
82
+
83
  § Products supports the following properties
84
  * Brand
85
  * Sku
181
 
182
  The full changelog can be found in the plugin's directory. Recent entries:
183
 
184
+ = 2.4.7 =
185
+ NEW FEATURE: book itemType now supports these values:
186
+ * author
187
+ * bookEdition
188
+ * BookFormat
189
+ * ISBN
190
+ * numberOfPages
191
+ NEW FEATURE: movie itemType now supports these values:
192
+ * actor
193
+ * director
194
+ * Duration
195
+ * dateCreated
196
+ TWEAKED: added hooks yasr_vv_saved_text and yasr_mv_saved_text to filter text showed after a rating is saved
197
+ TWEAKED: added hooks yasr_vv_txt_before and yasr_vv_text_after to filter text showed before or after the star ratings
198
+ TWEAKED: code cleanup in setting page
199
+ FIX: check cookie name to use hooks added in version 2.4.6
200
+ FIX: on fresh install, with php 7.4, a notice is returned
201
+
202
  = 2.4.6 =
203
  NEW OPTION: Is now possible to exclude pages when stars next the title are enabled
204
  TWEAKED: changed classname from yasr-container-custom-text-and-visitor-rating to yasr-custom-text-vv-before
205
  TWEAKED: span 'yasr-custom-text-before-visitor-rating' removed
206
  TWEAKED: added hooks yasr_vv_cookie and yasr_mv_cookie to filter cookies name
 
207
 
208
  = 2.4.5 =
209
  FIXED: %overall_rating% pattern didn't work for custom text
211
  FIXED: warning in yasr-settings-functions-multiset.php
212
  TWEAKED: minor changes
213
 
214
+
215
  = 2.4.4 =
216
  * TWEAKED: added yasr_auto_insert_exclude_cpt hook
217
  * TWEAKED: code cleanup
218
 
219
+
220
  = 2.4.3 =
221
  * NEW FEATURE: is now possible to show ratings next to the title
222
  * FIXED: guten blocks returns error if post_id parameter was set
228
  = 2.4.1 =
229
  * FIXED: minor fix if more yasr_visitor_votes with different differents post_id are used in the same page
230
 
231
+
232
  = 2.4.0 =
233
  * NEW FEATURE: is now possible to customize the itemType Name: if empty, post title will be used instead-
234
  * TWEAKED: Custom text to show when an user has already voted now shows up even for logged in users
236
  * TWEAKED: admin .js files are now bundled into a single one
237
  * TWEAKED: support for IE11 (will be dropped in 12 months)
238
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  = Additional Info =
240
  See credits.txt file
yet-another-stars-rating.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Yet Another Stars Rating
5
  * Plugin URI: http://wordpress.org/plugins/yet-another-stars-rating/
6
  * Description: Boost the way people interact with your site with an easy WordPress stars rating system! With schema.org rich snippets YASR will improve your SEO
7
- * Version: 2.4.6
8
  * Author: Dario Curvino
9
  * Author URI: https://dariocurvino.it/
10
  * Text Domain: yet-another-stars-rating
@@ -76,7 +76,7 @@ if ( !function_exists( 'yasr_fs' ) ) {
76
  yasr_fs();
77
  // Signal that SDK was initiated.
78
  do_action( 'yasr_fs_loaded' );
79
- define( 'YASR_VERSION_NUM', '2.4.6' );
80
  //Plugin absolute path
81
  //e.g. /var/www/html/plugin_development/wp-content/plugins/yet-another-stars-rating
82
  define( 'YASR_ABSOLUTE_PATH', __DIR__ );
4
  * Plugin Name: Yet Another Stars Rating
5
  * Plugin URI: http://wordpress.org/plugins/yet-another-stars-rating/
6
  * Description: Boost the way people interact with your site with an easy WordPress stars rating system! With schema.org rich snippets YASR will improve your SEO
7
+ * Version: 2.4.7
8
  * Author: Dario Curvino
9
  * Author URI: https://dariocurvino.it/
10
  * Text Domain: yet-another-stars-rating
76
  yasr_fs();
77
  // Signal that SDK was initiated.
78
  do_action( 'yasr_fs_loaded' );
79
+ define( 'YASR_VERSION_NUM', '2.4.7' );
80
  //Plugin absolute path
81
  //e.g. /var/www/html/plugin_development/wp-content/plugins/yet-another-stars-rating
82
  define( 'YASR_ABSOLUTE_PATH', __DIR__ );