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

Version Description

Download this release

Release Info

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

Code changes from version 1.5.0 to 1.5.1

includes/class-pum-options.php CHANGED
@@ -28,7 +28,7 @@ class PUM_Options {
28
  */
29
  public static function init() {
30
  // Set the prefix on init.
31
- static::$_data = static::get_all();
32
  }
33
 
34
  /**
@@ -39,12 +39,12 @@ class PUM_Options {
39
  * @return array settings
40
  */
41
  public static function get_all() {
42
- $settings = get_option( static:: $_prefix . 'settings', array() );
43
  if ( ! is_array( $settings ) ) {
44
  $settings = array();
45
  }
46
 
47
- return apply_filters( static:: $_prefix . 'get_options', $settings );
48
  }
49
 
50
  /**
@@ -58,9 +58,9 @@ class PUM_Options {
58
  * @return mixed
59
  */
60
  public static function get( $key = '', $default = false ) {
61
- $value = isset( static::$_data[ $key ] ) ? static::$_data[ $key ] : $default;
62
 
63
- return apply_filters( static::$_prefix . 'get_option', $value, $key, $default );
64
  }
65
 
66
  /**
@@ -85,24 +85,24 @@ class PUM_Options {
85
  }
86
 
87
  if ( empty( $value ) ) {
88
- $remove_option = static::delete( $key );
89
 
90
  return $remove_option;
91
  }
92
 
93
  // First let's grab the current settings
94
- $options = get_option( static:: $_prefix . 'settings' );
95
 
96
  // Let's let devs alter that value coming in
97
- $value = apply_filters( static::$_prefix . 'update_option', $value, $key );
98
 
99
  // Next let's try to update the value
100
  $options[ $key ] = $value;
101
- $did_update = update_option( static:: $_prefix . 'settings', $options );
102
 
103
  // If it updated, let's update the global variable
104
  if ( $did_update ) {
105
- static::$_data[ $key ] = $value;
106
 
107
  }
108
 
@@ -128,18 +128,18 @@ class PUM_Options {
128
  }
129
 
130
  // First let's grab the current settings
131
- $options = get_option( static:: $_prefix . 'settings' );
132
 
133
  // Next let's try to update the value
134
  if ( isset( $options[ $key ] ) ) {
135
  unset( $options[ $key ] );
136
  }
137
 
138
- $did_update = update_option( static:: $_prefix . 'settings', $options );
139
 
140
  // If it updated, let's update the global variable
141
  if ( $did_update ) {
142
- static::$_data = $options;
143
  }
144
 
145
  return $did_update;
28
  */
29
  public static function init() {
30
  // Set the prefix on init.
31
+ self::$_data = self::get_all();
32
  }
33
 
34
  /**
39
  * @return array settings
40
  */
41
  public static function get_all() {
42
+ $settings = get_option( self:: $_prefix . 'settings', array() );
43
  if ( ! is_array( $settings ) ) {
44
  $settings = array();
45
  }
46
 
47
+ return apply_filters( self:: $_prefix . 'get_options', $settings );
48
  }
49
 
50
  /**
58
  * @return mixed
59
  */
60
  public static function get( $key = '', $default = false ) {
61
+ $value = isset( self::$_data[ $key ] ) ? self::$_data[ $key ] : $default;
62
 
63
+ return apply_filters( self::$_prefix . 'get_option', $value, $key, $default );
64
  }
65
 
66
  /**
85
  }
86
 
87
  if ( empty( $value ) ) {
88
+ $remove_option = self::delete( $key );
89
 
90
  return $remove_option;
91
  }
92
 
93
  // First let's grab the current settings
94
+ $options = get_option( self:: $_prefix . 'settings' );
95
 
96
  // Let's let devs alter that value coming in
97
+ $value = apply_filters( self::$_prefix . 'update_option', $value, $key );
98
 
99
  // Next let's try to update the value
100
  $options[ $key ] = $value;
101
+ $did_update = update_option( self:: $_prefix . 'settings', $options );
102
 
103
  // If it updated, let's update the global variable
104
  if ( $did_update ) {
105
+ self::$_data[ $key ] = $value;
106
 
107
  }
108
 
128
  }
129
 
130
  // First let's grab the current settings
131
+ $options = get_option( self:: $_prefix . 'settings' );
132
 
133
  // Next let's try to update the value
134
  if ( isset( $options[ $key ] ) ) {
135
  unset( $options[ $key ] );
136
  }
137
 
138
+ $did_update = update_option( self:: $_prefix . 'settings', $options );
139
 
140
  // If it updated, let's update the global variable
141
  if ( $did_update ) {
142
+ self::$_data = $options;
143
  }
144
 
145
  return $did_update;
includes/class-pum.php CHANGED
@@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
7
 
8
  class PUM {
9
 
10
- const VER = '1.5.0';
11
 
12
  const DB_VER = 6;
13
 
7
 
8
  class PUM {
9
 
10
+ const VER = '1.5.1';
11
 
12
  const DB_VER = 6;
13
 
includes/modules/reviews.php CHANGED
@@ -16,7 +16,7 @@ class PUM_Modules_Reviews {
16
  *
17
  * @var string
18
  */
19
- public static $api_url = 'https://api.wppopupmaker.com/wp-json/pum/v1/review_action';
20
 
21
  /**
22
  *
16
  *
17
  * @var string
18
  */
19
+ public static $api_url = 'https://api.wppopupmaker.com/wp-json/pmapi/v1/review_action';
20
 
21
  /**
22
  *
includes/pum-sdk/freemius/assets/scss/_load.scss CHANGED
@@ -1,4 +1,4 @@
1
- @import 'mixins';
2
- @import "vars";
3
- @import "functions";
4
- @import "colors";
1
+ @import 'mixins';
2
+ @import "vars";
3
+ @import "functions";
4
+ @import "colors";
includes/pum-sdk/freemius/assets/scss/_start.scss CHANGED
@@ -1,4 +1,4 @@
1
- @import "vars";
2
- @import "colors";
3
- @import "mixins";
4
  @import "functions";
1
+ @import "vars";
2
+ @import "colors";
3
+ @import "mixins";
4
  @import "functions";
includes/pum-sdk/freemius/assets/scss/_vars.scss CHANGED
@@ -1,5 +1,5 @@
1
- $is_production: true;
2
-
3
- $img_common: if($is_production == true, '//img.freemius.com', 'http://img.freemius:8080');
4
-
5
  $layout_width: 960px;
1
+ $is_production: true;
2
+
3
+ $img_common: if($is_production == true, '//img.freemius.com', 'http://img.freemius:8080');
4
+
5
  $layout_width: 960px;
includes/pum-sdk/freemius/assets/scss/admin/connect.scss CHANGED
@@ -1,471 +1,471 @@
1
- @import "../start";
2
-
3
- $form_width: 480px;
4
-
5
- #fs_connect
6
- {
7
- width: $form_width;
8
- @include box-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));
9
- margin: 20px 0;
10
-
11
- @media screen and (max-width: ($form_width - 1)) {
12
- @include box-shadow(none);
13
- width: auto;
14
- margin: 0 0 0 -10px;
15
- }
16
-
17
- .fs-content
18
- {
19
- background: #fff;
20
- padding: 15px 20px;
21
-
22
- .fs-error {
23
- background: snow;
24
- color: $fs-logo-magenta-color;
25
- border: 1px solid $fs-logo-magenta-color;
26
- @include box-shadow(0 1px 1px 0 rgba(0,0,0,.1));
27
- text-align: center;
28
- padding: 5px;
29
- margin-bottom: 10px;
30
- }
31
-
32
- p
33
- {
34
- margin: 0;
35
- padding: 0;
36
- font-size: 1.2em;
37
- }
38
- }
39
-
40
- .fs-license-key-container {
41
- position: relative;
42
- width: 280px;
43
- margin: 10px auto 0 auto;
44
-
45
- input {
46
- width: 100%;
47
- }
48
-
49
- .dashicons {
50
- position: absolute;
51
- top: 5px;
52
- right: 5px;
53
- }
54
- }
55
-
56
- .fs-actions
57
- {
58
- padding: 10px 20px;
59
- background: #C0C7CA;
60
-
61
- .button
62
- {
63
- padding: 0 10px 1px;
64
- line-height: 35px;
65
- height: 37px;
66
- font-size: 16px;
67
- margin-bottom: 0;
68
-
69
- .dashicons
70
- {
71
- font-size: 37px;
72
- margin-left: -8px;
73
- margin-right: 12px;
74
- }
75
-
76
- &.button-primary
77
- {
78
- padding-right: 15px;
79
- padding-left: 15px;
80
-
81
- &:after
82
- {
83
- content: ' \279C';
84
- }
85
-
86
- &.fs-loading
87
- {
88
- &:after
89
- {
90
- content: '';
91
- }
92
- }
93
- }
94
-
95
- &.button-secondary
96
- {
97
- float: right;
98
- }
99
- }
100
-
101
- // .fs-skip
102
- // {
103
- // line-height: 38px;
104
- // vertical-align: middle;
105
- // text-decoration: none;
106
- // margin-left: 10px;
107
- // }
108
- }
109
-
110
- &.fs-anonymous-disabled
111
- {
112
- .fs-actions
113
- {
114
- .button.button-primary
115
- {
116
- width: 100%;
117
- }
118
- }
119
- }
120
-
121
- .fs-permissions
122
- {
123
- padding: 10px 20px;
124
- background: #FEFEFE;
125
- // background: #F1F1F1;
126
- @include transition(background 0.5s ease);
127
-
128
- .fs-license-sync-disclaimer {
129
- text-align: center;
130
- margin-top: 0;
131
- }
132
-
133
- .fs-trigger
134
- {
135
- font-size: 0.9em;
136
- text-decoration: none;
137
- text-align: center;
138
- display: block;
139
- }
140
-
141
- ul
142
- {
143
- height: 0;
144
- overflow: hidden;
145
- margin: 0;
146
-
147
- li
148
- {
149
- margin-bottom: 12px;
150
-
151
- &:last-child
152
- {
153
- margin-bottom: 0;
154
- }
155
-
156
- i.dashicons
157
- {
158
- float: left;
159
- font-size: 40px;
160
- width: 40px;
161
- height: 40px;
162
- }
163
-
164
- div
165
- {
166
- margin-left: 55px;
167
-
168
- span
169
- {
170
- font-weight: bold;
171
- text-transform: uppercase;
172
- color: #23282d;
173
- }
174
-
175
- p
176
- {
177
- margin: 2px 0 0 0;
178
- }
179
- }
180
- }
181
- }
182
-
183
- &.fs-open
184
- {
185
- background: #fff;
186
-
187
- ul
188
- {
189
- height: auto;
190
- margin: 20px 20px 10px 20px;
191
- }
192
- }
193
-
194
- @media screen and (max-width: ($form_width - 1)) {
195
- background: #fff;
196
-
197
- .fs-trigger
198
- {
199
- display: none;
200
- }
201
-
202
- ul
203
- {
204
- height: auto;
205
- margin: 20px;
206
- }
207
- }
208
- }
209
-
210
- .fs-freemium-licensing {
211
- padding: 8px;
212
- // background: #0085BA;
213
- background: #777;
214
- color: #fff;
215
-
216
- p {
217
- text-align: center;
218
- display: block;
219
- margin: 0;
220
- padding: 0;
221
- }
222
-
223
- a {
224
- color: #C2EEFF;
225
- text-decoration: underline;
226
- }
227
- }
228
-
229
- $icon_size: 80px;
230
- $wp_logo_padding: $icon_size / 10;
231
- $icons_top: 10px;
232
-
233
- .fs-visual
234
- {
235
- padding: 12px;
236
- line-height: 0;
237
- background: #fafafa;
238
- height: $icon_size;
239
- position: relative;
240
-
241
- .fs-site-icon
242
- {
243
- position: absolute;
244
- left: 20px;
245
- top: $icons_top;
246
- }
247
-
248
- .fs-connect-logo
249
- {
250
- position: absolute;
251
- right: 20px;
252
- top: $icons_top;
253
- }
254
-
255
- .fs-plugin-icon
256
- {
257
- position: absolute;
258
- top: $icons_top;
259
- left: 50%;
260
- margin-left: - ($icon_size / 2);
261
- }
262
-
263
- .fs-plugin-icon,
264
- .fs-site-icon,
265
- img,
266
- object
267
- {
268
- width: $icon_size;
269
- height: $icon_size;
270
- }
271
-
272
- .dashicons-wordpress
273
- {
274
- font-size: $icon_size - ($wp_logo_padding * 2);
275
- background: $wordpress_color;
276
- color: #fff;
277
- width: $icon_size - ($wp_logo_padding * 2);
278
- height: $icon_size - ($wp_logo_padding * 2);
279
- padding: $wp_logo_padding;
280
- }
281
-
282
- .dashicons-plus
283
- {
284
- position: absolute;
285
- top: 50%;
286
- font-size: 30px;
287
- margin-top: -10px;
288
- color: #bbb;
289
-
290
- &.fs-first
291
- {
292
- left: 28%;
293
- }
294
- &.fs-second
295
- {
296
- left: 65%;
297
- }
298
- }
299
-
300
- .fs-plugin-icon,
301
- .fs-connect-logo,
302
- .fs-site-icon
303
- {
304
- border: 1px solid #ccc;
305
- padding: 1px;
306
- background: #fff;
307
- }
308
- }
309
-
310
- .fs-terms
311
- {
312
- text-align: center;
313
- font-size: 0.85em;
314
- padding: 5px;
315
- background: rgba(0, 0, 0, 0.05);
316
-
317
- &, a
318
- {
319
- color: #999;
320
- }
321
-
322
- a
323
- {
324
- text-decoration: none;
325
- }
326
- }
327
- }
328
-
329
- .rtl
330
- {
331
- #fs_connect
332
- {
333
- .fs-actions
334
- {
335
- padding: 10px 20px;
336
- background: #C0C7CA;
337
-
338
- .button
339
- {
340
- .dashicons
341
- {
342
- font-size: 37px;
343
- margin-left: -8px;
344
- margin-right: 12px;
345
- }
346
-
347
- &.button-primary
348
- {
349
- &:after
350
- {
351
- content: ' \000bb';
352
- }
353
-
354
- &.fs-loading
355
- {
356
- &:after
357
- {
358
- content: '';
359
- }
360
- }
361
- }
362
-
363
- &.button-secondary
364
- {
365
- float: left;
366
- }
367
- }
368
- }
369
-
370
- .fs-permissions
371
- {
372
- ul
373
- {
374
- li
375
- {
376
- div
377
- {
378
- margin-right: 55px;
379
- margin-left: 0;
380
- }
381
-
382
- i.dashicons
383
- {
384
- float: right;
385
- }
386
-
387
- }
388
- }
389
- }
390
-
391
- .fs-visual
392
- {
393
- .fs-site-icon
394
- {
395
- right: 20px;
396
- left: auto;
397
- }
398
-
399
- .fs-connect-logo
400
- {
401
- right: auto;
402
- left: 20px;
403
- }
404
- }
405
- }
406
- }
407
-
408
- .wp-pointer-content
409
- {
410
- #fs_connect
411
- {
412
- margin: 0;
413
- @include box-shadow(none);
414
- }
415
- }
416
-
417
- .fs-opt-in-pointer
418
- {
419
- .wp-pointer-content
420
- {
421
- padding: 0;
422
- }
423
-
424
- &.wp-pointer-top
425
- {
426
- .wp-pointer-arrow
427
- {
428
- border-bottom-color: #dfdfdf;
429
- }
430
- .wp-pointer-arrow-inner
431
- {
432
- border-bottom-color: #fafafa;
433
- }
434
- }
435
-
436
- &.wp-pointer-bottom
437
- {
438
- .wp-pointer-arrow
439
- {
440
- border-top-color: #dfdfdf;
441
- }
442
- .wp-pointer-arrow-inner
443
- {
444
- border-top-color: #fafafa;
445
- }
446
- }
447
-
448
- &.wp-pointer-left
449
- {
450
- .wp-pointer-arrow
451
- {
452
- border-right-color: #dfdfdf;
453
- }
454
- .wp-pointer-arrow-inner
455
- {
456
- border-right-color: #fafafa;
457
- }
458
- }
459
-
460
- &.wp-pointer-right
461
- {
462
- .wp-pointer-arrow
463
- {
464
- border-left-color: #dfdfdf;
465
- }
466
- .wp-pointer-arrow-inner
467
- {
468
- border-left-color: #fafafa;
469
- }
470
- }
471
- }
1
+ @import "../start";
2
+
3
+ $form_width: 480px;
4
+
5
+ #fs_connect
6
+ {
7
+ width: $form_width;
8
+ @include box-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));
9
+ margin: 20px 0;
10
+
11
+ @media screen and (max-width: ($form_width - 1)) {
12
+ @include box-shadow(none);
13
+ width: auto;
14
+ margin: 0 0 0 -10px;
15
+ }
16
+
17
+ .fs-content
18
+ {
19
+ background: #fff;
20
+ padding: 15px 20px;
21
+
22
+ .fs-error {
23
+ background: snow;
24
+ color: $fs-logo-magenta-color;
25
+ border: 1px solid $fs-logo-magenta-color;
26
+ @include box-shadow(0 1px 1px 0 rgba(0,0,0,.1));
27
+ text-align: center;
28
+ padding: 5px;
29
+ margin-bottom: 10px;
30
+ }
31
+
32
+ p
33
+ {
34
+ margin: 0;
35
+ padding: 0;
36
+ font-size: 1.2em;
37
+ }
38
+ }
39
+
40
+ .fs-license-key-container {
41
+ position: relative;
42
+ width: 280px;
43
+ margin: 10px auto 0 auto;
44
+
45
+ input {
46
+ width: 100%;
47
+ }
48
+
49
+ .dashicons {
50
+ position: absolute;
51
+ top: 5px;
52
+ right: 5px;
53
+ }
54
+ }
55
+
56
+ .fs-actions
57
+ {
58
+ padding: 10px 20px;
59
+ background: #C0C7CA;
60
+
61
+ .button
62
+ {
63
+ padding: 0 10px 1px;
64
+ line-height: 35px;
65
+ height: 37px;
66
+ font-size: 16px;
67
+ margin-bottom: 0;
68
+
69
+ .dashicons
70
+ {
71
+ font-size: 37px;
72
+ margin-left: -8px;
73
+ margin-right: 12px;
74
+ }
75
+
76
+ &.button-primary
77
+ {
78
+ padding-right: 15px;
79
+ padding-left: 15px;
80
+
81
+ &:after
82
+ {
83
+ content: ' \279C';
84
+ }
85
+
86
+ &.fs-loading
87
+ {
88
+ &:after
89
+ {
90
+ content: '';
91
+ }
92
+ }
93
+ }
94
+
95
+ &.button-secondary
96
+ {
97
+ float: right;
98
+ }
99
+ }
100
+
101
+ // .fs-skip
102
+ // {
103
+ // line-height: 38px;
104
+ // vertical-align: middle;
105
+ // text-decoration: none;
106
+ // margin-left: 10px;
107
+ // }
108
+ }
109
+
110
+ &.fs-anonymous-disabled
111
+ {
112
+ .fs-actions
113
+ {
114
+ .button.button-primary
115
+ {
116
+ width: 100%;
117
+ }
118
+ }
119
+ }
120
+
121
+ .fs-permissions
122
+ {
123
+ padding: 10px 20px;
124
+ background: #FEFEFE;
125
+ // background: #F1F1F1;
126
+ @include transition(background 0.5s ease);
127
+
128
+ .fs-license-sync-disclaimer {
129
+ text-align: center;
130
+ margin-top: 0;
131
+ }
132
+
133
+ .fs-trigger
134
+ {
135
+ font-size: 0.9em;
136
+ text-decoration: none;
137
+ text-align: center;
138
+ display: block;
139
+ }
140
+
141
+ ul
142
+ {
143
+ height: 0;
144
+ overflow: hidden;
145
+ margin: 0;
146
+
147
+ li
148
+ {
149
+ margin-bottom: 12px;
150
+
151
+ &:last-child
152
+ {
153
+ margin-bottom: 0;
154
+ }
155
+
156
+ i.dashicons
157
+ {
158
+ float: left;
159
+ font-size: 40px;
160
+ width: 40px;
161
+ height: 40px;
162
+ }
163
+
164
+ div
165
+ {
166
+ margin-left: 55px;
167
+
168
+ span
169
+ {
170
+ font-weight: bold;
171
+ text-transform: uppercase;
172
+ color: #23282d;
173
+ }
174
+
175
+ p
176
+ {
177
+ margin: 2px 0 0 0;
178
+ }
179
+ }
180
+ }
181
+ }
182
+
183
+ &.fs-open
184
+ {
185
+ background: #fff;
186
+
187
+ ul
188
+ {
189
+ height: auto;
190
+ margin: 20px 20px 10px 20px;
191
+ }
192
+ }
193
+
194
+ @media screen and (max-width: ($form_width - 1)) {
195
+ background: #fff;
196
+
197
+ .fs-trigger
198
+ {
199
+ display: none;
200
+ }
201
+
202
+ ul
203
+ {
204
+ height: auto;
205
+ margin: 20px;
206
+ }
207
+ }
208
+ }
209
+
210
+ .fs-freemium-licensing {
211
+ padding: 8px;
212
+ // background: #0085BA;
213
+ background: #777;
214
+ color: #fff;
215
+
216
+ p {
217
+ text-align: center;
218
+ display: block;
219
+ margin: 0;
220
+ padding: 0;
221
+ }
222
+
223
+ a {
224
+ color: #C2EEFF;
225
+ text-decoration: underline;
226
+ }
227
+ }
228
+
229
+ $icon_size: 80px;
230
+ $wp_logo_padding: $icon_size / 10;
231
+ $icons_top: 10px;
232
+
233
+ .fs-visual
234
+ {
235
+ padding: 12px;
236
+ line-height: 0;
237
+ background: #fafafa;
238
+ height: $icon_size;
239
+ position: relative;
240
+
241
+ .fs-site-icon
242
+ {
243
+ position: absolute;
244
+ left: 20px;
245
+ top: $icons_top;
246
+ }
247
+
248
+ .fs-connect-logo
249
+ {
250
+ position: absolute;
251
+ right: 20px;
252
+ top: $icons_top;
253
+ }
254
+
255
+ .fs-plugin-icon
256
+ {
257
+ position: absolute;
258
+ top: $icons_top;
259
+ left: 50%;
260
+ margin-left: - ($icon_size / 2);
261
+ }
262
+
263
+ .fs-plugin-icon,
264
+ .fs-site-icon,
265
+ img,
266
+ object
267
+ {
268
+ width: $icon_size;
269
+ height: $icon_size;
270
+ }
271
+
272
+ .dashicons-wordpress
273
+ {
274
+ font-size: $icon_size - ($wp_logo_padding * 2);
275
+ background: $wordpress_color;
276
+ color: #fff;
277
+ width: $icon_size - ($wp_logo_padding * 2);
278
+ height: $icon_size - ($wp_logo_padding * 2);
279
+ padding: $wp_logo_padding;
280
+ }
281
+
282
+ .dashicons-plus
283
+ {
284
+ position: absolute;
285
+ top: 50%;
286
+ font-size: 30px;
287
+ margin-top: -10px;
288
+ color: #bbb;
289
+
290
+ &.fs-first
291
+ {
292
+ left: 28%;
293
+ }
294
+ &.fs-second
295
+ {
296
+ left: 65%;
297
+ }
298
+ }
299
+
300
+ .fs-plugin-icon,
301
+ .fs-connect-logo,
302
+ .fs-site-icon
303
+ {
304
+ border: 1px solid #ccc;
305
+ padding: 1px;
306
+ background: #fff;
307
+ }
308
+ }
309
+
310
+ .fs-terms
311
+ {
312
+ text-align: center;
313
+ font-size: 0.85em;
314
+ padding: 5px;
315
+ background: rgba(0, 0, 0, 0.05);
316
+
317
+ &, a
318
+ {
319
+ color: #999;
320
+ }
321
+
322
+ a
323
+ {
324
+ text-decoration: none;
325
+ }
326
+ }
327
+ }
328
+
329
+ .rtl
330
+ {
331
+ #fs_connect
332
+ {
333
+ .fs-actions
334
+ {
335
+ padding: 10px 20px;
336
+ background: #C0C7CA;
337
+
338
+ .button
339
+ {
340
+ .dashicons
341
+ {
342
+ font-size: 37px;
343
+ margin-left: -8px;
344
+ margin-right: 12px;
345
+ }
346
+
347
+ &.button-primary
348
+ {
349
+ &:after
350
+ {
351
+ content: ' \000bb';
352
+ }
353
+
354
+ &.fs-loading
355
+ {
356
+ &:after
357
+ {
358
+ content: '';
359
+ }
360
+ }
361
+ }
362
+
363
+ &.button-secondary
364
+ {
365
+ float: left;
366
+ }
367
+ }
368
+ }
369
+
370
+ .fs-permissions
371
+ {
372
+ ul
373
+ {
374
+ li
375
+ {
376
+ div
377
+ {
378
+ margin-right: 55px;
379
+ margin-left: 0;
380
+ }
381
+
382
+ i.dashicons
383
+ {
384
+ float: right;
385
+ }
386
+
387
+ }
388
+ }
389
+ }
390
+
391
+ .fs-visual
392
+ {
393
+ .fs-site-icon
394
+ {
395
+ right: 20px;
396
+ left: auto;
397
+ }
398
+
399
+ .fs-connect-logo
400
+ {
401
+ right: auto;
402
+ left: 20px;
403
+ }
404
+ }
405
+ }
406
+ }
407
+
408
+ .wp-pointer-content
409
+ {
410
+ #fs_connect
411
+ {
412
+ margin: 0;
413
+ @include box-shadow(none);
414
+ }
415
+ }
416
+
417
+ .fs-opt-in-pointer
418
+ {
419
+ .wp-pointer-content
420
+ {
421
+ padding: 0;
422
+ }
423
+
424
+ &.wp-pointer-top
425
+ {
426
+ .wp-pointer-arrow
427
+ {
428
+ border-bottom-color: #dfdfdf;
429
+ }
430
+ .wp-pointer-arrow-inner
431
+ {
432
+ border-bottom-color: #fafafa;
433
+ }
434
+ }
435
+
436
+ &.wp-pointer-bottom
437
+ {
438
+ .wp-pointer-arrow
439
+ {
440
+ border-top-color: #dfdfdf;
441
+ }
442
+ .wp-pointer-arrow-inner
443
+ {
444
+ border-top-color: #fafafa;
445
+ }
446
+ }
447
+
448
+ &.wp-pointer-left
449
+ {
450
+ .wp-pointer-arrow
451
+ {
452
+ border-right-color: #dfdfdf;
453
+ }
454
+ .wp-pointer-arrow-inner
455
+ {
456
+ border-right-color: #fafafa;
457
+ }
458
+ }
459
+
460
+ &.wp-pointer-right
461
+ {
462
+ .wp-pointer-arrow
463
+ {
464
+ border-left-color: #dfdfdf;
465
+ }
466
+ .wp-pointer-arrow-inner
467
+ {
468
+ border-left-color: #fafafa;
469
+ }
470
+ }
471
+ }
includes/pum-sdk/freemius/includes/i18n.php CHANGED
@@ -1,534 +1,534 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
- * @since 1.1.4
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * All strings can now be overridden.
15
- *
16
- * For example, if we want to override:
17
- * 'you-are-step-away' => 'You are just one step away - %s',
18
- *
19
- * We can use the filter:
20
- * fs_override_i18n( array(
21
- * 'opt-in-connect' => __( "Yes - I'm in!", '{your-text_domain}' ),
22
- * 'skip' => __( 'Not today', '{your-text_domain}' ),
23
- * ), '{plugin_slug}' );
24
- *
25
- * Or with the Freemius instance:
26
- *
27
- * my_freemius->override_i18n( array(
28
- * 'opt-in-connect' => __( "Yes - I'm in!", '{your-text_domain}' ),
29
- * 'skip' => __( 'Not today', '{your-text_domain}' ),
30
- * );
31
- */
32
- global $fs_text;
33
-
34
- $fs_text = array(
35
- 'account' => __( 'Account', 'freemius' ),
36
- 'addon' => __( 'Add On', 'freemius' ),
37
- 'contact-us' => __( 'Contact Us', 'freemius' ),
38
- 'contact-support' => __( 'Contact Support', 'freemius' ),
39
- 'change-ownership' => __( 'Change Ownership', 'freemius' ),
40
- 'support' => __( 'Support', 'freemius' ),
41
- 'support-forum' => __( 'Support Forum', 'freemius' ),
42
- 'add-ons' => __( 'Add Ons', 'freemius' ),
43
- 'upgrade' => _x( 'Upgrade', 'verb', 'freemius' ),
44
- 'awesome' => __( 'Awesome', 'freemius' ),
45
- 'pricing' => _x( 'Pricing', 'noun', 'freemius' ),
46
- 'price' => _x( 'Price', 'noun', 'freemius' ),
47
- 'unlimited-updates' => __( 'Unlimited Updates', 'freemius' ),
48
- 'downgrade' => _x( 'Downgrade', 'verb', 'freemius' ),
49
- 'cancel-trial' => __( 'Cancel Trial', 'freemius' ),
50
- 'free-trial' => __( 'Free Trial', 'freemius' ),
51
- 'start-free-x' => __( 'Start my free %s', 'freemius' ),
52
- 'no-commitment-x' => __( 'No commitment for %s - cancel anytime', 'freemius' ),
53
- 'after-x-pay-as-little-y' => __( 'After your free %s, pay as little as %s', 'freemius' ),
54
- 'details' => __( 'Details', 'freemius' ),
55
- 'account-details' => __( 'Account Details', 'freemius' ),
56
- 'delete' => _x( 'Delete', 'verb', 'freemius' ),
57
- 'show' => _x( 'Show', 'verb', 'freemius' ),
58
- 'hide' => _x( 'Hide', 'verb', 'freemius' ),
59
- 'edit' => _x( 'Edit', 'verb', 'freemius' ),
60
- 'update' => _x( 'Update', 'verb', 'freemius' ),
61
- 'date' => __( 'Date', 'freemius' ),
62
- 'amount' => __( 'Amount', 'freemius' ),
63
- 'invoice' => __( 'Invoice', 'freemius' ),
64
- 'billing' => __( 'Billing', 'freemius' ),
65
- 'payments' => __( 'Payments', 'freemius' ),
66
- 'delete-account' => __( 'Delete Account', 'freemius' ),
67
- 'dismiss' => _x( 'Dismiss', 'as close a window', 'freemius' ),
68
- 'plan' => _x( 'Plan', 'as product pricing plan', 'freemius' ),
69
- 'change-plan' => __( 'Change Plan', 'freemius' ),
70
- 'download-x-version' => _x( 'Download %s Version', 'as download professional version', 'freemius' ),
71
- 'download-x-version-now' => _x( 'Download %s version now', 'as download professional version now',
72
- 'freemius' ),
73
- 'download-latest' => _x( 'Download Latest', 'as download latest version', 'freemius' ),
74
- 'you-have-x-license' => _x( 'You have a %s license.', 'E.g. you have a professional license.',
75
- 'freemius' ),
76
- 'new' => __( 'New', 'freemius' ),
77
- 'free' => __( 'Free', 'freemius' ),
78
- 'trial' => _x( 'Trial', 'as trial plan', 'freemius' ),
79
- 'start-trial' => _x( 'Start Trial', 'as starting a trial plan', 'freemius' ),
80
- 'purchase' => _x( 'Purchase', 'verb', 'freemius' ),
81
- 'purchase-license' => __( 'Purchase License', 'freemius' ),
82
- 'buy' => _x( 'Buy', 'verb', 'freemius' ),
83
- 'buy-license' => __( 'Buy License', 'freemius' ),
84
- 'license-single-site' => __( 'Single Site License', 'freemius' ),
85
- 'license-unlimited' => __( 'Unlimited Licenses', 'freemius' ),
86
- 'license-x-sites' => __( 'Up to %s Sites', 'freemius' ),
87
- 'renew-license-now' => __( '%sRenew your license now%s to access version %s features and support.',
88
- 'freemius' ),
89
- 'ask-for-upgrade-email-address' => __( "Enter the email address you've used for the upgrade below and we will resend you the license key.",
90
- 'freemius' ),
91
- 'x-plan' => _x( '%s Plan', 'e.g. Professional Plan', 'freemius' ),
92
- 'you-are-step-away' => __( 'You are just one step away - %s', 'freemius' ),
93
- 'activate-x-now' => _x( 'Complete "%s" Activation Now',
94
- '%s - plugin name. As complete "Jetpack" activation now', 'freemius' ),
95
- 'few-plugin-tweaks' => __( 'We made a few tweaks to the plugin, %s', 'freemius' ),
96
- 'optin-x-now' => __( 'Opt-in to make "%s" Better!', 'freemius' ),
97
- 'error' => __( 'Error', 'freemius' ),
98
- 'failed-finding-main-path' => __( 'Freemius SDK couldn\'t find the plugin\'s main file. Please contact sdk@freemius.com with the current error.',
99
- 'freemius' ),
100
- #region Account
101
-
102
- 'expiration' => _x( 'Expiration', 'as expiration date', 'freemius' ),
103
- 'license' => _x( 'License', 'as software license', 'freemius' ),
104
- 'not-verified' => __( 'not verified', 'freemius' ),
105
- 'verify-email' => __( 'Verify Email', 'freemius' ),
106
- 'expires-in' => _x( 'Expires in %s', 'e.g. expires in 2 months', 'freemius' ),
107
- 'renews-in' => _x( 'Auto renews in %s', 'e.g. auto renews in 2 months', 'freemius' ),
108
- 'no-expiration' => __( 'No expiration', 'freemius' ),
109
- 'expired' => __( 'Expired', 'freemius' ),
110
- 'cancelled' => __( 'Cancelled', 'freemius' ),
111
- 'in-x' => _x( 'In %s', 'e.g. In 2 hours', 'freemius' ),
112
- 'x-ago' => _x( '%s ago', 'e.g. 2 min ago', 'freemius' ),
113
- 'version' => _x( 'Version', 'as plugin version', 'freemius' ),
114
- 'name' => __( 'Name', 'freemius' ),
115
- 'email' => __( 'Email', 'freemius' ),
116
- 'email-address' => __( 'Email address', 'freemius' ),
117
- 'verified' => __( 'Verified', 'freemius' ),
118
- 'plugin' => __( 'Plugin', 'freemius' ),
119
- 'plugins' => __( 'Plugins', 'freemius' ),
120
- 'themes' => __( 'Themes', 'freemius' ),
121
- 'path' => _x( 'Path', 'as file/folder path', 'freemius' ),
122
- 'title' => __( 'Title', 'freemius' ),
123
- 'free-version' => __( 'Free version', 'freemius' ),
124
- 'premium-version' => __( 'Premium version', 'freemius' ),
125
- 'slug' => _x( 'Slug', 'as WP plugin slug', 'freemius' ),
126
- 'id' => __( 'ID', 'freemius' ),
127
- 'users' => __( 'Users', 'freemius' ),
128
- 'plugin-installs' => __( 'Plugin Installs', 'freemius' ),
129
- 'sites' => _x( 'Sites', 'like websites', 'freemius' ),
130
- 'user-id' => __( 'User ID', 'freemius' ),
131
- 'site-id' => __( 'Site ID', 'freemius' ),
132
- 'public-key' => __( 'Public Key', 'freemius' ),
133
- 'secret-key' => __( 'Secret Key', 'freemius' ),
134
- 'no-secret' => _x( 'No Secret', 'as secret encryption key missing', 'freemius' ),
135
- 'no-id' => __( 'No ID', 'freemius' ),
136
- 'sync-license' => _x( 'Sync License', 'as synchronize license', 'freemius' ),
137
- 'sync' => _x( 'Sync', 'as synchronize', 'freemius' ),
138
- 'activate-license' => __( 'Activate License', 'freemius' ),
139
- 'activate-free-version' => __( 'Activate Free Version', 'freemius' ),
140
- 'activate-license-message' => __( 'Please enter the license key that you received in the email right after the purchase:',
141
- 'freemius' ),
142
- 'activating-license' => __( 'Activating license...', 'freemius' ),
143
- 'change-license' => __( 'Change License', 'freemius' ),
144
- 'update-license' => __( 'Update License', 'freemius' ),
145
- 'deactivate-license' => __( 'Deactivate License', 'freemius' ),
146
- 'activate' => __( 'Activate', 'freemius' ),
147
- 'deactivate' => __( 'Deactivate', 'freemius' ),
148
- 'skip-deactivate' => __( 'Skip & Deactivate', 'freemius' ),
149
- 'no-deactivate' => __( 'No - just deactivate', 'freemius' ),
150
- 'yes-do-your-thing' => __( 'Yes - do your thing', 'freemius' ),
151
- 'active' => _x( 'Active', 'active mode', 'freemius' ),
152
- 'is-active' => _x( 'Is Active', 'is active mode?', 'freemius' ),
153
- 'install-now' => __( 'Install Now', 'freemius' ),
154
- 'install-update-now' => __( 'Install Update Now', 'freemius' ),
155
- 'more-information-about-x' => __( 'More information about %s', 'freemius' ),
156
- 'localhost' => __( 'Localhost', 'freemius' ),
157
- 'activate-x-plan' => _x( 'Activate %s Plan', 'as activate Professional plan', 'freemius' ),
158
- 'x-left' => _x( '%s left', 'as 5 licenses left', 'freemius' ),
159
- 'last-license' => __( 'Last license', 'freemius' ),
160
- 'what-is-your-x' => __( 'What is your %s?', 'freemius' ),
161
- 'activate-this-addon' => __( 'Activate this add-on', 'freemius' ),
162
- 'deactivate-license-confirm' => __( 'Deactivating your license will block all premium features, but will enable you to activate the license on another site. Are you sure you want to proceed?',
163
- 'freemius' ),
164
- 'delete-account-x-confirm' => __( '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?',
165
- 'freemius' ),
166
- 'delete-account-confirm' => __( 'Deletion is not temporary. Only delete if you no longer want to use this plugin anymore. Are you sure you would like to continue with the deletion?',
167
- 'freemius' ),
168
- 'downgrade-x-confirm' => __( 'Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s.',
169
- 'freemius' ),
170
- 'cancel-trial-confirm' => __( 'Cancelling the trial will immediately block access to all premium features. Are you sure?',
171
- 'freemius' ),
172
- 'after-downgrade-non-blocking' => __( 'You can still enjoy all %s features but you will not have access to plugin updates and support.',
173
- 'freemius' ),
174
- 'after-downgrade-blocking' => __( 'Once your license expire you can still use the Free version but you will NOT have access to the %s features.',
175
- 'freemius' ),
176
- 'proceed-confirmation' => __( 'Are you sure you want to proceed?', 'freemius' ),
177
- #endregion Account
178
-
179
- 'add-ons-for-x' => __( 'Add Ons for %s', 'freemius' ),
180
- 'add-ons-missing' => __( 'We could\'nt load the add-ons list. It\'s probably an issue on our side, please try to come back in few minutes.',
181
- 'freemius' ),
182
- #region Plugin Deactivation
183
- 'anonymous-feedback' => __( 'Anonymous feedback', 'freemius' ),
184
- 'quick-feedback' => __( 'Quick feedback', 'freemius' ),
185
- 'deactivation-share-reason' => __( 'If you have a moment, please let us know why you are deactivating',
186
- 'freemius' ),
187
- 'deactivation-modal-button-confirm' => __( 'Yes - Deactivate', 'freemius' ),
188
- 'deactivation-modal-button-submit' => __( 'Submit & Deactivate', 'freemius' ),
189
- 'cancel' => __( 'Cancel', 'freemius' ),
190
- 'reason-no-longer-needed' => __( 'I no longer need the plugin', 'freemius' ),
191
- 'reason-found-a-better-plugin' => __( 'I found a better plugin', 'freemius' ),
192
- 'reason-needed-for-a-short-period' => __( 'I only needed the plugin for a short period', 'freemius' ),
193
- 'reason-broke-my-site' => __( 'The plugin broke my site', 'freemius' ),
194
- 'reason-suddenly-stopped-working' => __( 'The plugin suddenly stopped working', 'freemius' ),
195
- 'reason-cant-pay-anymore' => __( "I can't pay for it anymore", 'freemius' ),
196
- 'reason-temporary-deactivation' => __( "It's a temporary deactivation. I'm just debugging an issue.",
197
- 'freemius' ),
198
- 'reason-other' => _x( 'Other',
199
- 'the text of the "other" reason for deactivating the plugin that is shown in the modal box.', 'freemius' ),
200
- 'ask-for-reason-message' => __( 'Kindly tell us the reason so we can improve.', 'freemius' ),
201
- 'placeholder-plugin-name' => __( "What's the plugin's name?", 'freemius' ),
202
- 'placeholder-comfortable-price' => __( 'What price would you feel comfortable paying?', 'freemius' ),
203
- 'reason-couldnt-make-it-work' => __( "I couldn't understand how to make it work", 'freemius' ),
204
- 'reason-great-but-need-specific-feature' => __( "The plugin is great, but I need specific feature that you don't support",
205
- 'freemius' ),
206
- 'reason-not-working' => __( 'The plugin is not working', 'freemius' ),
207
- 'reason-not-what-i-was-looking-for' => __( "It's not what I was looking for", 'freemius' ),
208
- 'reason-didnt-work-as-expected' => __( "The plugin didn't work as expected", 'freemius' ),
209
- 'placeholder-feature' => __( 'What feature?', 'freemius' ),
210
- 'placeholder-share-what-didnt-work' => __( "Kindly share what didn't work so we can fix it for future users...",
211
- 'freemius' ),
212
- 'placeholder-what-youve-been-looking-for' => __( "What you've been looking for?", 'freemius' ),
213
- 'placeholder-what-did-you-expect' => __( "What did you expect?", 'freemius' ),
214
- 'reason-didnt-work' => __( "The plugin didn't work", 'freemius' ),
215
- 'reason-dont-like-to-share-my-information' => __( "I don't like to share my information with you", 'freemius' ),
216
- 'dont-have-to-share-any-data' => __( "You might have missed it, but you don't have to share any data and can just %s the opt-in.",
217
- 'freemius' ),
218
- #endregion Plugin Deactivation
219
-
220
- #region Connect
221
- 'hey-x' => _x( 'Hey %s,', 'greeting', 'freemius' ),
222
- 'thanks-x' => _x( 'Thanks %s!', 'a greeting. E.g. Thanks John!', 'freemius' ),
223
- 'connect-message' => __( 'Never miss an important update - opt-in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s.',
224
- 'freemius' ),
225
- 'connect-message_on-update' => __( 'Please help us improve %1$s! If you opt-in, some data about your usage of %1$s will be sent to %4$s. If you skip this, that\'s okay! %1$s will still work just fine.',
226
- 'freemius' ),
227
- 'pending-activation-message' => __( '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.', 'freemius' ),
228
- 'complete-the-install' => __( 'complete the install', 'freemius' ),
229
- 'start-the-trial' => __( 'start the trial', 'freemius' ),
230
- 'thanks-for-purchasing' => __( 'Thanks for purchasing %s! To get started, please enter your license key:',
231
- 'freemius' ),
232
- 'license-sync-disclaimer' => __( 'The plugin will be periodically sending data to %s to check for plugin updates and verify the validity of your license.',
233
- 'freemius' ),
234
- 'what-permissions' => __( 'What permissions are being granted?', 'freemius' ),
235
- 'permissions-profile' => __( 'Your Profile Overview', 'freemius' ),
236
- 'permissions-profile_desc' => __( 'Name and email address', 'freemius' ),
237
- 'permissions-site' => __( 'Your Site Overview', 'freemius' ),
238
- 'permissions-site_desc' => __( 'Site URL, WP version, PHP info, plugins & themes',
239
- 'freemius' ),
240
- 'permissions-events' => __( 'Current Plugin Events', 'freemius' ),
241
- 'permissions-events_desc' => __( 'Activation, deactivation and uninstall', 'freemius' ),
242
- 'permissions-plugins_themes' => __( 'Plugins & Themes', 'freemius' ),
243
- 'permissions-plugins_themes_desc' => __( 'Titles, versions and state.', 'freemius' ),
244
- 'permissions-admin-notices' => __( 'Admin Notices', 'freemius' ),
245
- 'permissions-newsletter' => __( 'Newsletter', 'freemius' ),
246
- 'permissions-newsletter_desc' => __( 'Updates, announcements, marketing, no spam', 'freemius' ),
247
- 'privacy-policy' => __( 'Privacy Policy', 'freemius' ),
248
- 'tos' => __( 'Terms of Service', 'freemius' ),
249
- 'activating' => _x( 'Activating', 'as activating plugin', 'freemius' ),
250
- 'sending-email' => _x( 'Sending email', 'as in the process of sending an email',
251
- 'freemius' ),
252
- 'opt-in-connect' => _x( 'Allow & Continue', 'button label', 'freemius' ),
253
- 'agree-activate-license' => _x( 'Agree & Activate License', 'button label', 'freemius' ),
254
- 'skip' => _x( 'Skip', 'verb', 'freemius' ),
255
- 'click-here-to-use-plugin-anonymously' => __( 'Click here to use the plugin anonymously', 'freemius' ),
256
- 'resend-activation-email' => __( 'Re-send activation email', 'freemius' ),
257
- 'license-key' => __( 'License key', 'freemius' ),
258
- 'send-license-key' => __( 'Send License Key', 'freemius' ),
259
- 'sending-license-key' => __( 'Sending license key', 'freemius' ),
260
- 'have-license-key' => __( 'Have a license key?', 'freemius' ),
261
- 'dont-have-license-key' => __( 'Don\'t have a license key?', 'freemius' ),
262
- 'cant-find-license-key' => __( "Can't find your license key?", 'freemius' ),
263
- 'email-not-found' => __( "We couldn't find your email address in the system, are you sure it's the right address?",
264
- 'freemius' ),
265
- 'no-active-licenses' => __( "We can't see any active licenses associated with that email address, are you sure it's the right address?",
266
- 'freemius' ),
267
- 'opt-in' => __( 'Opt In', 'freemius' ),
268
- 'opt-out' => __( 'Opt Out', 'freemius' ),
269
- 'opt-out-cancel' => __( 'On second thought - I want to continue helping',
270
- 'freemius' ),
271
- 'opting-out' => __( 'Opting out...', 'freemius' ),
272
- 'opting-in' => __( 'Opting in...', 'freemius' ),
273
- 'opt-out-message-appreciation' => __( 'We appreciate your help in making the %s better by letting us track some usage data.',
274
- 'freemius' ),
275
- 'opt-out-message-usage-tracking' => __( "Usage tracking is done in the name of making %s better. Making a better user experience, prioritizing new features, and more good things. We'd really appreciate if you'll reconsider letting us continue with the tracking.",
276
- 'freemius' ),
277
- 'opt-out-message-clicking-opt-out' => __( 'By clicking "Opt Out", we will no longer be sending any data from %s to %s.',
278
- 'freemius' ),
279
- #endregion Connect
280
-
281
- #region Screenshots
282
- 'screenshots' => __( 'Screenshots', 'freemius' ),
283
- 'view-full-size-x' => __( 'Click to view full-size screenshot %d', 'freemius' ),
284
- #endregion Screenshots
285
-
286
- #region Debug
287
- 'freemius-debug' => __( 'Freemius Debug', 'freemius' ),
288
- 'on' => _x( 'On', 'as turned on', 'freemius' ),
289
- 'off' => _x( 'Off', 'as turned off', 'freemius' ),
290
- 'debugging' => _x( 'Debugging', 'as code debugging', 'freemius' ),
291
- 'freemius-state' => __( 'Freemius State', 'freemius' ),
292
- 'connected' => _x( 'Connected', 'as connection was successful', 'freemius' ),
293
- 'blocked' => _x( 'Blocked', 'as connection blocked', 'freemius' ),
294
- 'api' => _x( 'API', 'as application program interface', 'freemius' ),
295
- 'sdk' => _x( 'SDK', 'as software development kit versions', 'freemius' ),
296
- 'sdk-versions' => _x( 'SDK Versions', 'as software development kit versions',
297
- 'freemius' ),
298
- 'plugin-path' => _x( 'Plugin Path', 'as plugin folder path', 'freemius' ),
299
- 'sdk-path' => _x( 'SDK Path', 'as sdk path', 'freemius' ),
300
- 'addons-of-x' => __( 'Add Ons of Plugin %s', 'freemius' ),
301
- 'delete-all-confirm' => __( 'Are you sure you want to delete all Freemius data?',
302
- 'freemius' ),
303
- 'actions' => __( 'Actions', 'freemius' ),
304
- 'delete-all-accounts' => __( 'Delete All Accounts', 'freemius' ),
305
- 'start-fresh' => __( 'Start Fresh', 'freemius' ),
306
- 'clear-api-cache' => __( 'Clear API Cache', 'freemius' ),
307
- 'sync-data-from-server' => __( 'Sync Data From Server', 'freemius' ),
308
- 'scheduled-crons' => __( 'Scheduled Crons', 'freemius' ),
309
- 'plugins-themes-sync' => __( 'Plugins & Themes Sync', 'freemius' ),
310
- #endregion Debug
311
-
312
- #region Expressions
313
- 'congrats' => _x( 'Congrats', 'as congratulations', 'freemius' ),
314
- 'oops' => _x( 'Oops', 'exclamation', 'freemius' ),
315
- 'yee-haw' => _x( 'Yee-haw', 'interjection expressing joy or exuberance',
316
- 'freemius' ),
317
- 'woot' => _x( 'W00t',
318
- '(especially in electronic communication) used to express elation, enthusiasm, or triumph.', 'freemius' ),
319
- 'right-on' => _x( 'Right on', 'a positive response', 'freemius' ),
320
- 'hmm' => _x( 'Hmm',
321
- 'something somebody says when they are thinking about what you have just said. ', 'freemius' ),
322
- 'ok' => __( 'O.K', 'freemius' ),
323
- 'hey' => _x( 'Hey', 'exclamation', 'freemius' ),
324
- 'heads-up' => _x( 'Heads up',
325
- 'advance notice of something that will need attention.', 'freemius' ),
326
- #endregion Expressions
327
-
328
- #region Admin Notices
329
- 'you-have-latest' => __( 'Seems like you got the latest release.', 'freemius' ),
330
- 'you-are-good' => __( 'You are all good!', 'freemius' ),
331
- 'user-exist-message' => __( 'Sorry, we could not complete the email update. Another user with the same email is already registered.',
332
- 'freemius' ),
333
- 'user-exist-message_ownership' => __( 'If you would like to give up the ownership of the plugin\'s account to %s click the Change Ownership button.',
334
- 'freemius' ),
335
- 'email-updated-message' => __( 'Your email was successfully updated. You should receive an email with confirmation instructions in few moments.',
336
- 'freemius' ),
337
- 'name-updated-message' => __( 'Your name was successfully updated.', 'freemius' ),
338
- 'x-updated' => __( 'You have successfully updated your %s.', 'freemius' ),
339
- 'name-update-failed-message' => __( 'Please provide your full name.', 'freemius' ),
340
- 'verification-email-sent-message' => __( 'Verification mail was just sent to %s. If you can\'t find it after 5 min, please check your spam box.',
341
- 'freemius' ),
342
- 'addons-info-external-message' => __( 'Just letting you know that the add-ons information of %s is being pulled from an external server.',
343
- 'freemius' ),
344
- 'no-cc-required' => __( 'No credit card required', 'freemius' ),
345
- 'premium-activated-message' => __( 'Premium plugin version was successfully activated.',
346
- 'freemius' ),
347
- 'successful-version-upgrade-message' => __( 'The upgrade of %s was successfully completed.', 'freemius' ),
348
- 'activation-with-plan-x-message' => __( 'Your account was successfully activated with the %s plan.',
349
- 'freemius' ),
350
- 'download-latest-x-version-now' => __( 'Download the latest %s version now', 'freemius' ),
351
- 'follow-steps-to-complete-upgrade' => __( 'Please follow these steps to complete the upgrade',
352
- 'freemius' ),
353
- 'download-latest-x-version' => __( 'Download the latest %s version', 'freemius' ),
354
- 'download-latest-version' => __( 'Download the latest version', 'freemius' ),
355
- 'deactivate-free-version' => __( 'Deactivate the free version', 'freemius' ),
356
- 'upload-and-activate' => __( 'Upload and activate the downloaded version', 'freemius' ),
357
- 'howto-upload-activate' => __( 'How to upload and activate?', 'freemius' ),
358
- 'addon-successfully-purchased-message' => _x( '%s Add-on was successfully purchased.',
359
- '%s - product name, e.g. Facebook add-on was successfully...', 'freemius' ),
360
- 'addon-successfully-upgraded-message' => __( 'Your %s Add-on plan was successfully upgraded.',
361
- 'freemius' ),
362
- 'email-verified-message' => __( 'Your email has been successfully verified - you are AWESOME!',
363
- 'freemius' ),
364
- 'plan-upgraded-message' => __( 'Your plan was successfully upgraded.', 'freemius' ),
365
- 'plan-changed-to-x-message' => __( 'Your plan was successfully changed to %s.', 'freemius' ),
366
- 'license-expired-blocking-message' => __( 'Your license has expired. You can still continue using the free plugin forever.',
367
- 'freemius' ),
368
- 'license-cancelled' => __( 'Your license has been cancelled. If you think it\'s a mistake, please contact support.',
369
- 'freemius' ),
370
- 'trial-started-message' => __( 'Your trial has been successfully started.', 'freemius' ),
371
- 'license-activated-message' => __( 'Your license was successfully activated.', 'freemius' ),
372
- 'no-active-license-message' => __( 'It looks like your site currently doesn\'t have an active license.',
373
- 'freemius' ),
374
- 'license-deactivation-message' => __( 'Your license was successfully deactivated, you are back to the %s plan.',
375
- 'freemius' ),
376
- 'license-deactivation-failed-message' => __( 'It looks like the license deactivation failed.',
377
- 'freemius' ),
378
- 'license-activation-failed-message' => __( 'It looks like the license could not be activated.',
379
- 'freemius' ),
380
- 'server-error-message' => __( 'Error received from the server:', 'freemius' ),
381
- 'trial-expired-message' => __( 'Your trial has expired. You can still continue using all our free features.',
382
- 'freemius' ),
383
- 'plan-x-downgraded-message' => __( 'Your plan was successfully downgraded. Your %s plan license will expire in %s.',
384
- 'freemius' ),
385
- 'plan-downgraded-failure-message' => __( 'Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes.',
386
- 'freemius' ),
387
- 'trial-cancel-no-trial-message' => __( 'It looks like you are not in trial mode anymore so there\'s nothing to cancel :)',
388
- 'freemius' ),
389
- 'trial-cancel-message' => __( 'Your %s free trial was successfully cancelled.',
390
- 'freemius' ),
391
- 'version-x-released' => _x( 'Version %s was released.', '%s - numeric version number',
392
- 'freemius' ),
393
- 'please-download-x' => __( 'Please download %s.', 'freemius' ),
394
- 'latest-x-version' => _x( 'the latest %s version here',
395
- '%s - plan name, as the latest professional version here', 'freemius' ),
396
- 'trial-x-promotion-message' => __( 'How do you like %s so far? Test all our %s premium features with a %d-day free trial.',
397
- 'freemius' ),
398
- 'start-free-trial' => _x( 'Start free trial', 'call to action', 'freemius' ),
399
- 'starting-trial' => __( 'Starting trial', 'freemius' ),
400
- 'please-wait' => __( 'Please wait', 'freemius' ),
401
- 'trial-cancel-failure-message' => __( 'Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes.',
402
- 'freemius' ),
403
- 'trial-utilized' => __( 'You already utilized a trial before.', 'freemius' ),
404
- 'in-trial-mode' => __( 'You are already running the plugin in a trial mode.',
405
- 'freemius' ),
406
- 'trial-plan-x-not-exist' => __( 'Plan %s do not exist, therefore, can\'t start a trial.',
407
- 'freemius' ),
408
- 'plan-x-no-trial' => __( 'Plan %s does not support a trial period.', 'freemius' ),
409
- 'no-trials' => __( 'None of the plugin\'s plans supports a trial period.',
410
- 'freemius' ),
411
- 'unexpected-api-error' => __( 'Unexpected API error. Please contact the plugin\'s author with the following error.',
412
- 'freemius' ),
413
- 'no-commitment-for-x-days' => __( 'No commitment for %s days - cancel anytime!', 'freemius' ),
414
- 'license-expired-non-blocking-message' => __( '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.',
415
- 'freemius' ),
416
- 'could-not-activate-x' => __( 'Couldn\'t activate %s.', 'freemius' ),
417
- 'contact-us-with-error-message' => __( 'Please contact us with the following message:', 'freemius' ),
418
- 'plan-did-not-change-message' => __( '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.',
419
- 'freemius' ),
420
- 'contact-us-here' => __( 'Please contact us here', 'freemius' ),
421
- 'plan-did-not-change-email-message' => __( 'I have upgraded my account but when I try to Sync the License, the plan remains %s.',
422
- 'freemius' ),
423
- #endregion Admin Notices
424
- #region Connectivity Issues
425
- 'connectivity-test-fails-message' => __( 'From unknown reason, the API connectivity test failed.',
426
- 'freemius' ),
427
- 'connectivity-test-maybe-temporary' => __( 'It\'s probably a temporary issue on our end. Just to be sure, with your permission, would it be o.k to run another connectivity test?',
428
- 'freemius' ),
429
- 'curl-missing-message' => __( 'We use PHP cURL library for the API calls, which is a very common library and usually installed out of the box. Unfortunately, cURL is not installed on your server.',
430
- 'freemius' ),
431
- 'cloudflare-blocks-connection-message' => __( 'From unknown reason, CloudFlare, the firewall we use, blocks the connection.',
432
- 'freemius' ),
433
- 'x-requires-access-to-api' => _x( '%s requires an access to our API.',
434
- 'as pluginX requires an access to our API', 'freemius' ),
435
- 'squid-blocks-connection-message' => __( 'It looks like your server is using Squid ACL (access control lists), which blocks the connection.',
436
- 'freemius' ),
437
- 'squid-no-clue-title' => __( 'I don\'t know what is Squid or ACL, help me!', 'freemius' ),
438
- 'squid-no-clue-desc' => __( '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.',
439
- 'freemius' ),
440
- 'sysadmin-title' => __( 'I\'m a system administrator', 'freemius' ),
441
- 'squid-sysadmin-desc' => __( 'Great, please whitelist the following domains: %s. Once you done, deactivate the plugin and activate it again.',
442
- 'freemius' ),
443
- 'curl-missing-no-clue-title' => __( 'I don\'t know what is cURL or how to install it, help me!',
444
- 'freemius' ),
445
- 'curl-missing-no-clue-desc' => __( '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.',
446
- 'freemius' ),
447
- 'curl-missing-sysadmin-desc' => __( 'Great, please install cURL and enable it in your php.ini file. To make sure it was successfully activated, use \'phpinfo()\'. Once activated, deactivate the plugin and reactivate it back again.',
448
- 'freemius' ),
449
- 'happy-to-resolve-issue-asap' => __( 'We are sure it\'s an issue on our side and more than happy to resolve it for you ASAP if you give us a chance.',
450
- 'freemius' ),
451
- 'contact-support-before-deactivation' => __( 'Sorry for the inconvenience and we are here to help if you give us a chance.',
452
- 'freemius' ),
453
- 'fix-issue-title' => __( 'Yes - I\'m giving you a chance to fix it', 'freemius' ),
454
- 'fix-issue-desc' => __( 'We will do our best to whitelist your server and resolve this issue ASAP. You will get a follow-up email to %s once we have an update.',
455
- 'freemius' ),
456
- 'install-previous-title' => __( 'Let\'s try your previous version', 'freemius' ),
457
- 'install-previous-desc' => __( 'Uninstall this version and install the previous one.',
458
- 'freemius' ),
459
- 'deactivate-plugin-title' => __( 'That\'s exhausting, please deactivate', 'freemius' ),
460
- 'deactivate-plugin-desc' => __( 'We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future.',
461
- 'freemius' ),
462
- 'fix-request-sent-message' => __( '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.',
463
- 'freemius' ),
464
- 'server-blocking-access' => _x( 'Your server is blocking the access to Freemius\' API, which is crucial for %1s synchronization. Please contact your host to whitelist %2s',
465
- '%1s - plugin title, %2s - API domain', 'freemius' ),
466
- 'wrong-authentication-param-message' => __( 'It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again.',
467
- 'freemius' ),
468
- #endregion Connectivity Issues
469
- #region Change Owner
470
- 'change-owner-request-sent-x' => __( '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.',
471
- 'freemius' ),
472
- 'change-owner-request_owner-confirmed' => __( 'Thanks for confirming the ownership change. An email was just sent to %s for final approval.',
473
- 'freemius' ),
474
- 'change-owner-request_candidate-confirmed' => __( '%s is the new owner of the account.', 'freemius' ),
475
- #endregion Change Owner
476
- 'addon-x-cannot-run-without-y' => _x( '%s cannot run without %s.',
477
- 'addonX cannot run without pluginY', 'freemius' ),
478
- 'addon-x-cannot-run-without-parent' => _x( '%s cannot run without the plugin.', 'addonX cannot run...',
479
- 'freemius' ),
480
- 'plugin-x-activation-message' => _x( '%s activation was successfully completed.',
481
- 'pluginX activation was successfully...', 'freemius' ),
482
- 'features-and-pricing' => _x( 'Features & Pricing', 'Plugin installer section title',
483
- 'freemius' ),
484
- 'free-addon-not-deployed' => __( 'Add-on must be deployed to WordPress.org or Freemius.',
485
- 'freemius' ),
486
- 'paid-addon-not-deployed' => __( 'Paid add-on must be deployed to Freemius.', 'freemius' ),
487
- #--------------------------------------------------------------------------------
488
- #region Add-On Licensing
489
- #--------------------------------------------------------------------------------
490
- 'addon-no-license-message' => __( '%s is a premium only add-on. You have to purchase a license first before activating the plugin.',
491
- 'freemius' ),
492
- 'addon-trial-cancelled-message' => __( '%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.',
493
- 'freemius' ),
494
- #endregion
495
- #--------------------------------------------------------------------------------
496
- #region Billing Cycles
497
- #--------------------------------------------------------------------------------
498
- 'monthly' => _x( 'Monthly', 'as every month', 'freemius' ),
499
- 'mo' => _x( 'mo', 'as monthly period', 'freemius' ),
500
- 'annual' => _x( 'Annual', 'as once a year', 'freemius' ),
501
- 'annually' => _x( 'Annually', 'as once a year', 'freemius' ),
502
- 'once' => _x( 'Once', 'as once a year', 'freemius' ),
503
- 'year' => _x( 'year', 'as annual period', 'freemius' ),
504
- 'lifetime' => __( 'Lifetime', 'freemius' ),
505
- 'best' => _x( 'Best', 'e.g. the best product', 'freemius' ),
506
- 'billed-x' => _x( 'Billed %s', 'e.g. billed monthly', 'freemius' ),
507
- 'save-x' => _x( 'Save %s', 'as a discount of $5 or 10%', 'freemius' ),
508
- #endregion Billing Cycles
509
- 'view-details' => __( 'View details', 'freemius' ),
510
- #--------------------------------------------------------------------------------
511
- #region Trial
512
- #--------------------------------------------------------------------------------
513
- 'approve-start-trial' => _x( 'Approve & Start Trial', 'button label', 'freemius' ),
514
- /* translators: %1$s: Number of trial days; %2$s: Plan name; */
515
- 'start-trial-prompt-header' => __( 'You are 1-click away from starting your %1$s-day free trial of the %2$s plan.', 'freemius' ),
516
- /* translators: %s: Link to freemius.com */
517
- 'start-trial-prompt-message' => __( '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 plugin to periodically send data to %s to check for version updates and to validate your trial.', 'freemius' ),
518
-
519
- #endregion
520
- #--------------------------------------------------------------------------------
521
- #region Billing Details
522
- #--------------------------------------------------------------------------------
523
- 'business-name' => __( 'Business name', 'freemius' ),
524
- 'tax-vat-id' => __( 'Tax / VAT ID', 'freemius' ),
525
- 'address-line-n' => __( 'Address Line %d', 'freemius' ),
526
- 'country' => __( 'Country', 'freemius' ),
527
- 'select-country' => __( 'Select Country', 'freemius' ),
528
- 'city' => __( 'City', 'freemius' ),
529
- 'town' => __( 'Town', 'freemius' ),
530
- 'state' => __( 'State', 'freemius' ),
531
- 'province' => __( 'Province', 'freemius' ),
532
- 'zip-postal-code' => __( 'ZIP / Postal Code', 'freemius' ),
533
- #endregion
534
- );
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
+ * @since 1.1.4
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * All strings can now be overridden.
15
+ *
16
+ * For example, if we want to override:
17
+ * 'you-are-step-away' => 'You are just one step away - %s',
18
+ *
19
+ * We can use the filter:
20
+ * fs_override_i18n( array(
21
+ * 'opt-in-connect' => __( "Yes - I'm in!", '{your-text_domain}' ),
22
+ * 'skip' => __( 'Not today', '{your-text_domain}' ),
23
+ * ), '{plugin_slug}' );
24
+ *
25
+ * Or with the Freemius instance:
26
+ *
27
+ * my_freemius->override_i18n( array(
28
+ * 'opt-in-connect' => __( "Yes - I'm in!", '{your-text_domain}' ),
29
+ * 'skip' => __( 'Not today', '{your-text_domain}' ),
30
+ * );
31
+ */
32
+ global $fs_text;
33
+
34
+ $fs_text = array(
35
+ 'account' => __( 'Account', 'freemius' ),
36
+ 'addon' => __( 'Add On', 'freemius' ),
37
+ 'contact-us' => __( 'Contact Us', 'freemius' ),
38
+ 'contact-support' => __( 'Contact Support', 'freemius' ),
39
+ 'change-ownership' => __( 'Change Ownership', 'freemius' ),
40
+ 'support' => __( 'Support', 'freemius' ),
41
+ 'support-forum' => __( 'Support Forum', 'freemius' ),
42
+ 'add-ons' => __( 'Add Ons', 'freemius' ),
43
+ 'upgrade' => _x( 'Upgrade', 'verb', 'freemius' ),
44
+ 'awesome' => __( 'Awesome', 'freemius' ),
45
+ 'pricing' => _x( 'Pricing', 'noun', 'freemius' ),
46
+ 'price' => _x( 'Price', 'noun', 'freemius' ),
47
+ 'unlimited-updates' => __( 'Unlimited Updates', 'freemius' ),
48
+ 'downgrade' => _x( 'Downgrade', 'verb', 'freemius' ),
49
+ 'cancel-trial' => __( 'Cancel Trial', 'freemius' ),
50
+ 'free-trial' => __( 'Free Trial', 'freemius' ),
51
+ 'start-free-x' => __( 'Start my free %s', 'freemius' ),
52
+ 'no-commitment-x' => __( 'No commitment for %s - cancel anytime', 'freemius' ),
53
+ 'after-x-pay-as-little-y' => __( 'After your free %s, pay as little as %s', 'freemius' ),
54
+ 'details' => __( 'Details', 'freemius' ),
55
+ 'account-details' => __( 'Account Details', 'freemius' ),
56
+ 'delete' => _x( 'Delete', 'verb', 'freemius' ),
57
+ 'show' => _x( 'Show', 'verb', 'freemius' ),
58
+ 'hide' => _x( 'Hide', 'verb', 'freemius' ),
59
+ 'edit' => _x( 'Edit', 'verb', 'freemius' ),
60
+ 'update' => _x( 'Update', 'verb', 'freemius' ),
61
+ 'date' => __( 'Date', 'freemius' ),
62
+ 'amount' => __( 'Amount', 'freemius' ),
63
+ 'invoice' => __( 'Invoice', 'freemius' ),
64
+ 'billing' => __( 'Billing', 'freemius' ),
65
+ 'payments' => __( 'Payments', 'freemius' ),
66
+ 'delete-account' => __( 'Delete Account', 'freemius' ),
67
+ 'dismiss' => _x( 'Dismiss', 'as close a window', 'freemius' ),
68
+ 'plan' => _x( 'Plan', 'as product pricing plan', 'freemius' ),
69
+ 'change-plan' => __( 'Change Plan', 'freemius' ),
70
+ 'download-x-version' => _x( 'Download %s Version', 'as download professional version', 'freemius' ),
71
+ 'download-x-version-now' => _x( 'Download %s version now', 'as download professional version now',
72
+ 'freemius' ),
73
+ 'download-latest' => _x( 'Download Latest', 'as download latest version', 'freemius' ),
74
+ 'you-have-x-license' => _x( 'You have a %s license.', 'E.g. you have a professional license.',
75
+ 'freemius' ),
76
+ 'new' => __( 'New', 'freemius' ),
77
+ 'free' => __( 'Free', 'freemius' ),
78
+ 'trial' => _x( 'Trial', 'as trial plan', 'freemius' ),
79
+ 'start-trial' => _x( 'Start Trial', 'as starting a trial plan', 'freemius' ),
80
+ 'purchase' => _x( 'Purchase', 'verb', 'freemius' ),
81
+ 'purchase-license' => __( 'Purchase License', 'freemius' ),
82
+ 'buy' => _x( 'Buy', 'verb', 'freemius' ),
83
+ 'buy-license' => __( 'Buy License', 'freemius' ),
84
+ 'license-single-site' => __( 'Single Site License', 'freemius' ),
85
+ 'license-unlimited' => __( 'Unlimited Licenses', 'freemius' ),
86
+ 'license-x-sites' => __( 'Up to %s Sites', 'freemius' ),
87
+ 'renew-license-now' => __( '%sRenew your license now%s to access version %s features and support.',
88
+ 'freemius' ),
89
+ 'ask-for-upgrade-email-address' => __( "Enter the email address you've used for the upgrade below and we will resend you the license key.",
90
+ 'freemius' ),
91
+ 'x-plan' => _x( '%s Plan', 'e.g. Professional Plan', 'freemius' ),
92
+ 'you-are-step-away' => __( 'You are just one step away - %s', 'freemius' ),
93
+ 'activate-x-now' => _x( 'Complete "%s" Activation Now',
94
+ '%s - plugin name. As complete "Jetpack" activation now', 'freemius' ),
95
+ 'few-plugin-tweaks' => __( 'We made a few tweaks to the plugin, %s', 'freemius' ),
96
+ 'optin-x-now' => __( 'Opt-in to make "%s" Better!', 'freemius' ),
97
+ 'error' => __( 'Error', 'freemius' ),
98
+ 'failed-finding-main-path' => __( 'Freemius SDK couldn\'t find the plugin\'s main file. Please contact sdk@freemius.com with the current error.',
99
+ 'freemius' ),
100
+ #region Account
101
+
102
+ 'expiration' => _x( 'Expiration', 'as expiration date', 'freemius' ),
103
+ 'license' => _x( 'License', 'as software license', 'freemius' ),
104
+ 'not-verified' => __( 'not verified', 'freemius' ),
105
+ 'verify-email' => __( 'Verify Email', 'freemius' ),
106
+ 'expires-in' => _x( 'Expires in %s', 'e.g. expires in 2 months', 'freemius' ),
107
+ 'renews-in' => _x( 'Auto renews in %s', 'e.g. auto renews in 2 months', 'freemius' ),
108
+ 'no-expiration' => __( 'No expiration', 'freemius' ),
109
+ 'expired' => __( 'Expired', 'freemius' ),
110
+ 'cancelled' => __( 'Cancelled', 'freemius' ),
111
+ 'in-x' => _x( 'In %s', 'e.g. In 2 hours', 'freemius' ),
112
+ 'x-ago' => _x( '%s ago', 'e.g. 2 min ago', 'freemius' ),
113
+ 'version' => _x( 'Version', 'as plugin version', 'freemius' ),
114
+ 'name' => __( 'Name', 'freemius' ),
115
+ 'email' => __( 'Email', 'freemius' ),
116
+ 'email-address' => __( 'Email address', 'freemius' ),
117
+ 'verified' => __( 'Verified', 'freemius' ),
118
+ 'plugin' => __( 'Plugin', 'freemius' ),
119
+ 'plugins' => __( 'Plugins', 'freemius' ),
120
+ 'themes' => __( 'Themes', 'freemius' ),
121
+ 'path' => _x( 'Path', 'as file/folder path', 'freemius' ),
122
+ 'title' => __( 'Title', 'freemius' ),
123
+ 'free-version' => __( 'Free version', 'freemius' ),
124
+ 'premium-version' => __( 'Premium version', 'freemius' ),
125
+ 'slug' => _x( 'Slug', 'as WP plugin slug', 'freemius' ),
126
+ 'id' => __( 'ID', 'freemius' ),
127
+ 'users' => __( 'Users', 'freemius' ),
128
+ 'plugin-installs' => __( 'Plugin Installs', 'freemius' ),
129
+ 'sites' => _x( 'Sites', 'like websites', 'freemius' ),
130
+ 'user-id' => __( 'User ID', 'freemius' ),
131
+ 'site-id' => __( 'Site ID', 'freemius' ),
132
+ 'public-key' => __( 'Public Key', 'freemius' ),
133
+ 'secret-key' => __( 'Secret Key', 'freemius' ),
134
+ 'no-secret' => _x( 'No Secret', 'as secret encryption key missing', 'freemius' ),
135
+ 'no-id' => __( 'No ID', 'freemius' ),
136
+ 'sync-license' => _x( 'Sync License', 'as synchronize license', 'freemius' ),
137
+ 'sync' => _x( 'Sync', 'as synchronize', 'freemius' ),
138
+ 'activate-license' => __( 'Activate License', 'freemius' ),
139
+ 'activate-free-version' => __( 'Activate Free Version', 'freemius' ),
140
+ 'activate-license-message' => __( 'Please enter the license key that you received in the email right after the purchase:',
141
+ 'freemius' ),
142
+ 'activating-license' => __( 'Activating license...', 'freemius' ),
143
+ 'change-license' => __( 'Change License', 'freemius' ),
144
+ 'update-license' => __( 'Update License', 'freemius' ),
145
+ 'deactivate-license' => __( 'Deactivate License', 'freemius' ),
146
+ 'activate' => __( 'Activate', 'freemius' ),
147
+ 'deactivate' => __( 'Deactivate', 'freemius' ),
148
+ 'skip-deactivate' => __( 'Skip & Deactivate', 'freemius' ),
149
+ 'no-deactivate' => __( 'No - just deactivate', 'freemius' ),
150
+ 'yes-do-your-thing' => __( 'Yes - do your thing', 'freemius' ),
151
+ 'active' => _x( 'Active', 'active mode', 'freemius' ),
152
+ 'is-active' => _x( 'Is Active', 'is active mode?', 'freemius' ),
153
+ 'install-now' => __( 'Install Now', 'freemius' ),
154
+ 'install-update-now' => __( 'Install Update Now', 'freemius' ),
155
+ 'more-information-about-x' => __( 'More information about %s', 'freemius' ),
156
+ 'localhost' => __( 'Localhost', 'freemius' ),
157
+ 'activate-x-plan' => _x( 'Activate %s Plan', 'as activate Professional plan', 'freemius' ),
158
+ 'x-left' => _x( '%s left', 'as 5 licenses left', 'freemius' ),
159
+ 'last-license' => __( 'Last license', 'freemius' ),
160
+ 'what-is-your-x' => __( 'What is your %s?', 'freemius' ),
161
+ 'activate-this-addon' => __( 'Activate this add-on', 'freemius' ),
162
+ 'deactivate-license-confirm' => __( 'Deactivating your license will block all premium features, but will enable you to activate the license on another site. Are you sure you want to proceed?',
163
+ 'freemius' ),
164
+ 'delete-account-x-confirm' => __( '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?',
165
+ 'freemius' ),
166
+ 'delete-account-confirm' => __( 'Deletion is not temporary. Only delete if you no longer want to use this plugin anymore. Are you sure you would like to continue with the deletion?',
167
+ 'freemius' ),
168
+ 'downgrade-x-confirm' => __( 'Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s.',
169
+ 'freemius' ),
170
+ 'cancel-trial-confirm' => __( 'Cancelling the trial will immediately block access to all premium features. Are you sure?',
171
+ 'freemius' ),
172
+ 'after-downgrade-non-blocking' => __( 'You can still enjoy all %s features but you will not have access to plugin updates and support.',
173
+ 'freemius' ),
174
+ 'after-downgrade-blocking' => __( 'Once your license expire you can still use the Free version but you will NOT have access to the %s features.',
175
+ 'freemius' ),
176
+ 'proceed-confirmation' => __( 'Are you sure you want to proceed?', 'freemius' ),
177
+ #endregion Account
178
+
179
+ 'add-ons-for-x' => __( 'Add Ons for %s', 'freemius' ),
180
+ 'add-ons-missing' => __( 'We could\'nt load the add-ons list. It\'s probably an issue on our side, please try to come back in few minutes.',
181
+ 'freemius' ),
182
+ #region Plugin Deactivation
183
+ 'anonymous-feedback' => __( 'Anonymous feedback', 'freemius' ),
184
+ 'quick-feedback' => __( 'Quick feedback', 'freemius' ),
185
+ 'deactivation-share-reason' => __( 'If you have a moment, please let us know why you are deactivating',
186
+ 'freemius' ),
187
+ 'deactivation-modal-button-confirm' => __( 'Yes - Deactivate', 'freemius' ),
188
+ 'deactivation-modal-button-submit' => __( 'Submit & Deactivate', 'freemius' ),
189
+ 'cancel' => __( 'Cancel', 'freemius' ),
190
+ 'reason-no-longer-needed' => __( 'I no longer need the plugin', 'freemius' ),
191
+ 'reason-found-a-better-plugin' => __( 'I found a better plugin', 'freemius' ),
192
+ 'reason-needed-for-a-short-period' => __( 'I only needed the plugin for a short period', 'freemius' ),
193
+ 'reason-broke-my-site' => __( 'The plugin broke my site', 'freemius' ),
194
+ 'reason-suddenly-stopped-working' => __( 'The plugin suddenly stopped working', 'freemius' ),
195
+ 'reason-cant-pay-anymore' => __( "I can't pay for it anymore", 'freemius' ),
196
+ 'reason-temporary-deactivation' => __( "It's a temporary deactivation. I'm just debugging an issue.",
197
+ 'freemius' ),
198
+ 'reason-other' => _x( 'Other',
199
+ 'the text of the "other" reason for deactivating the plugin that is shown in the modal box.', 'freemius' ),
200
+ 'ask-for-reason-message' => __( 'Kindly tell us the reason so we can improve.', 'freemius' ),
201
+ 'placeholder-plugin-name' => __( "What's the plugin's name?", 'freemius' ),
202
+ 'placeholder-comfortable-price' => __( 'What price would you feel comfortable paying?', 'freemius' ),
203
+ 'reason-couldnt-make-it-work' => __( "I couldn't understand how to make it work", 'freemius' ),
204
+ 'reason-great-but-need-specific-feature' => __( "The plugin is great, but I need specific feature that you don't support",
205
+ 'freemius' ),
206
+ 'reason-not-working' => __( 'The plugin is not working', 'freemius' ),
207
+ 'reason-not-what-i-was-looking-for' => __( "It's not what I was looking for", 'freemius' ),
208
+ 'reason-didnt-work-as-expected' => __( "The plugin didn't work as expected", 'freemius' ),
209
+ 'placeholder-feature' => __( 'What feature?', 'freemius' ),
210
+ 'placeholder-share-what-didnt-work' => __( "Kindly share what didn't work so we can fix it for future users...",
211
+ 'freemius' ),
212
+ 'placeholder-what-youve-been-looking-for' => __( "What you've been looking for?", 'freemius' ),
213
+ 'placeholder-what-did-you-expect' => __( "What did you expect?", 'freemius' ),
214
+ 'reason-didnt-work' => __( "The plugin didn't work", 'freemius' ),
215
+ 'reason-dont-like-to-share-my-information' => __( "I don't like to share my information with you", 'freemius' ),
216
+ 'dont-have-to-share-any-data' => __( "You might have missed it, but you don't have to share any data and can just %s the opt-in.",
217
+ 'freemius' ),
218
+ #endregion Plugin Deactivation
219
+
220
+ #region Connect
221
+ 'hey-x' => _x( 'Hey %s,', 'greeting', 'freemius' ),
222
+ 'thanks-x' => _x( 'Thanks %s!', 'a greeting. E.g. Thanks John!', 'freemius' ),
223
+ 'connect-message' => __( 'Never miss an important update - opt-in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s.',
224
+ 'freemius' ),
225
+ 'connect-message_on-update' => __( 'Please help us improve %1$s! If you opt-in, some data about your usage of %1$s will be sent to %4$s. If you skip this, that\'s okay! %1$s will still work just fine.',
226
+ 'freemius' ),
227
+ 'pending-activation-message' => __( '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.', 'freemius' ),
228
+ 'complete-the-install' => __( 'complete the install', 'freemius' ),
229
+ 'start-the-trial' => __( 'start the trial', 'freemius' ),
230
+ 'thanks-for-purchasing' => __( 'Thanks for purchasing %s! To get started, please enter your license key:',
231
+ 'freemius' ),
232
+ 'license-sync-disclaimer' => __( 'The plugin will be periodically sending data to %s to check for plugin updates and verify the validity of your license.',
233
+ 'freemius' ),
234
+ 'what-permissions' => __( 'What permissions are being granted?', 'freemius' ),
235
+ 'permissions-profile' => __( 'Your Profile Overview', 'freemius' ),
236
+ 'permissions-profile_desc' => __( 'Name and email address', 'freemius' ),
237
+ 'permissions-site' => __( 'Your Site Overview', 'freemius' ),
238
+ 'permissions-site_desc' => __( 'Site URL, WP version, PHP info, plugins & themes',
239
+ 'freemius' ),
240
+ 'permissions-events' => __( 'Current Plugin Events', 'freemius' ),
241
+ 'permissions-events_desc' => __( 'Activation, deactivation and uninstall', 'freemius' ),
242
+ 'permissions-plugins_themes' => __( 'Plugins & Themes', 'freemius' ),
243
+ 'permissions-plugins_themes_desc' => __( 'Titles, versions and state.', 'freemius' ),
244
+ 'permissions-admin-notices' => __( 'Admin Notices', 'freemius' ),
245
+ 'permissions-newsletter' => __( 'Newsletter', 'freemius' ),
246
+ 'permissions-newsletter_desc' => __( 'Updates, announcements, marketing, no spam', 'freemius' ),
247
+ 'privacy-policy' => __( 'Privacy Policy', 'freemius' ),
248
+ 'tos' => __( 'Terms of Service', 'freemius' ),
249
+ 'activating' => _x( 'Activating', 'as activating plugin', 'freemius' ),
250
+ 'sending-email' => _x( 'Sending email', 'as in the process of sending an email',
251
+ 'freemius' ),
252
+ 'opt-in-connect' => _x( 'Allow & Continue', 'button label', 'freemius' ),
253
+ 'agree-activate-license' => _x( 'Agree & Activate License', 'button label', 'freemius' ),
254
+ 'skip' => _x( 'Skip', 'verb', 'freemius' ),
255
+ 'click-here-to-use-plugin-anonymously' => __( 'Click here to use the plugin anonymously', 'freemius' ),
256
+ 'resend-activation-email' => __( 'Re-send activation email', 'freemius' ),
257
+ 'license-key' => __( 'License key', 'freemius' ),
258
+ 'send-license-key' => __( 'Send License Key', 'freemius' ),
259
+ 'sending-license-key' => __( 'Sending license key', 'freemius' ),
260
+ 'have-license-key' => __( 'Have a license key?', 'freemius' ),
261
+ 'dont-have-license-key' => __( 'Don\'t have a license key?', 'freemius' ),
262
+ 'cant-find-license-key' => __( "Can't find your license key?", 'freemius' ),
263
+ 'email-not-found' => __( "We couldn't find your email address in the system, are you sure it's the right address?",
264
+ 'freemius' ),
265
+ 'no-active-licenses' => __( "We can't see any active licenses associated with that email address, are you sure it's the right address?",
266
+ 'freemius' ),
267
+ 'opt-in' => __( 'Opt In', 'freemius' ),
268
+ 'opt-out' => __( 'Opt Out', 'freemius' ),
269
+ 'opt-out-cancel' => __( 'On second thought - I want to continue helping',
270
+ 'freemius' ),
271
+ 'opting-out' => __( 'Opting out...', 'freemius' ),
272
+ 'opting-in' => __( 'Opting in...', 'freemius' ),
273
+ 'opt-out-message-appreciation' => __( 'We appreciate your help in making the %s better by letting us track some usage data.',
274
+ 'freemius' ),
275
+ 'opt-out-message-usage-tracking' => __( "Usage tracking is done in the name of making %s better. Making a better user experience, prioritizing new features, and more good things. We'd really appreciate if you'll reconsider letting us continue with the tracking.",
276
+ 'freemius' ),
277
+ 'opt-out-message-clicking-opt-out' => __( 'By clicking "Opt Out", we will no longer be sending any data from %s to %s.',
278
+ 'freemius' ),
279
+ #endregion Connect
280
+
281
+ #region Screenshots
282
+ 'screenshots' => __( 'Screenshots', 'freemius' ),
283
+ 'view-full-size-x' => __( 'Click to view full-size screenshot %d', 'freemius' ),
284
+ #endregion Screenshots
285
+
286
+ #region Debug
287
+ 'freemius-debug' => __( 'Freemius Debug', 'freemius' ),
288
+ 'on' => _x( 'On', 'as turned on', 'freemius' ),
289
+ 'off' => _x( 'Off', 'as turned off', 'freemius' ),
290
+ 'debugging' => _x( 'Debugging', 'as code debugging', 'freemius' ),
291
+ 'freemius-state' => __( 'Freemius State', 'freemius' ),
292
+ 'connected' => _x( 'Connected', 'as connection was successful', 'freemius' ),
293
+ 'blocked' => _x( 'Blocked', 'as connection blocked', 'freemius' ),
294
+ 'api' => _x( 'API', 'as application program interface', 'freemius' ),
295
+ 'sdk' => _x( 'SDK', 'as software development kit versions', 'freemius' ),
296
+ 'sdk-versions' => _x( 'SDK Versions', 'as software development kit versions',
297
+ 'freemius' ),
298
+ 'plugin-path' => _x( 'Plugin Path', 'as plugin folder path', 'freemius' ),
299
+ 'sdk-path' => _x( 'SDK Path', 'as sdk path', 'freemius' ),
300
+ 'addons-of-x' => __( 'Add Ons of Plugin %s', 'freemius' ),
301
+ 'delete-all-confirm' => __( 'Are you sure you want to delete all Freemius data?',
302
+ 'freemius' ),
303
+ 'actions' => __( 'Actions', 'freemius' ),
304
+ 'delete-all-accounts' => __( 'Delete All Accounts', 'freemius' ),
305
+ 'start-fresh' => __( 'Start Fresh', 'freemius' ),
306
+ 'clear-api-cache' => __( 'Clear API Cache', 'freemius' ),
307
+ 'sync-data-from-server' => __( 'Sync Data From Server', 'freemius' ),
308
+ 'scheduled-crons' => __( 'Scheduled Crons', 'freemius' ),
309
+ 'plugins-themes-sync' => __( 'Plugins & Themes Sync', 'freemius' ),
310
+ #endregion Debug
311
+
312
+ #region Expressions
313
+ 'congrats' => _x( 'Congrats', 'as congratulations', 'freemius' ),
314
+ 'oops' => _x( 'Oops', 'exclamation', 'freemius' ),
315
+ 'yee-haw' => _x( 'Yee-haw', 'interjection expressing joy or exuberance',
316
+ 'freemius' ),
317
+ 'woot' => _x( 'W00t',
318
+ '(especially in electronic communication) used to express elation, enthusiasm, or triumph.', 'freemius' ),
319
+ 'right-on' => _x( 'Right on', 'a positive response', 'freemius' ),
320
+ 'hmm' => _x( 'Hmm',
321
+ 'something somebody says when they are thinking about what you have just said. ', 'freemius' ),
322
+ 'ok' => __( 'O.K', 'freemius' ),
323
+ 'hey' => _x( 'Hey', 'exclamation', 'freemius' ),
324
+ 'heads-up' => _x( 'Heads up',
325
+ 'advance notice of something that will need attention.', 'freemius' ),
326
+ #endregion Expressions
327
+
328
+ #region Admin Notices
329
+ 'you-have-latest' => __( 'Seems like you got the latest release.', 'freemius' ),
330
+ 'you-are-good' => __( 'You are all good!', 'freemius' ),
331
+ 'user-exist-message' => __( 'Sorry, we could not complete the email update. Another user with the same email is already registered.',
332
+ 'freemius' ),
333
+ 'user-exist-message_ownership' => __( 'If you would like to give up the ownership of the plugin\'s account to %s click the Change Ownership button.',
334
+ 'freemius' ),
335
+ 'email-updated-message' => __( 'Your email was successfully updated. You should receive an email with confirmation instructions in few moments.',
336
+ 'freemius' ),
337
+ 'name-updated-message' => __( 'Your name was successfully updated.', 'freemius' ),
338
+ 'x-updated' => __( 'You have successfully updated your %s.', 'freemius' ),
339
+ 'name-update-failed-message' => __( 'Please provide your full name.', 'freemius' ),
340
+ 'verification-email-sent-message' => __( 'Verification mail was just sent to %s. If you can\'t find it after 5 min, please check your spam box.',
341
+ 'freemius' ),
342
+ 'addons-info-external-message' => __( 'Just letting you know that the add-ons information of %s is being pulled from an external server.',
343
+ 'freemius' ),
344
+ 'no-cc-required' => __( 'No credit card required', 'freemius' ),
345
+ 'premium-activated-message' => __( 'Premium plugin version was successfully activated.',
346
+ 'freemius' ),
347
+ 'successful-version-upgrade-message' => __( 'The upgrade of %s was successfully completed.', 'freemius' ),
348
+ 'activation-with-plan-x-message' => __( 'Your account was successfully activated with the %s plan.',
349
+ 'freemius' ),
350
+ 'download-latest-x-version-now' => __( 'Download the latest %s version now', 'freemius' ),
351
+ 'follow-steps-to-complete-upgrade' => __( 'Please follow these steps to complete the upgrade',
352
+ 'freemius' ),
353
+ 'download-latest-x-version' => __( 'Download the latest %s version', 'freemius' ),
354
+ 'download-latest-version' => __( 'Download the latest version', 'freemius' ),
355
+ 'deactivate-free-version' => __( 'Deactivate the free version', 'freemius' ),
356
+ 'upload-and-activate' => __( 'Upload and activate the downloaded version', 'freemius' ),
357
+ 'howto-upload-activate' => __( 'How to upload and activate?', 'freemius' ),
358
+ 'addon-successfully-purchased-message' => _x( '%s Add-on was successfully purchased.',
359
+ '%s - product name, e.g. Facebook add-on was successfully...', 'freemius' ),
360
+ 'addon-successfully-upgraded-message' => __( 'Your %s Add-on plan was successfully upgraded.',
361
+ 'freemius' ),
362
+ 'email-verified-message' => __( 'Your email has been successfully verified - you are AWESOME!',
363
+ 'freemius' ),
364
+ 'plan-upgraded-message' => __( 'Your plan was successfully upgraded.', 'freemius' ),
365
+ 'plan-changed-to-x-message' => __( 'Your plan was successfully changed to %s.', 'freemius' ),
366
+ 'license-expired-blocking-message' => __( 'Your license has expired. You can still continue using the free plugin forever.',
367
+ 'freemius' ),
368
+ 'license-cancelled' => __( 'Your license has been cancelled. If you think it\'s a mistake, please contact support.',
369
+ 'freemius' ),
370
+ 'trial-started-message' => __( 'Your trial has been successfully started.', 'freemius' ),
371
+ 'license-activated-message' => __( 'Your license was successfully activated.', 'freemius' ),
372
+ 'no-active-license-message' => __( 'It looks like your site currently doesn\'t have an active license.',
373
+ 'freemius' ),
374
+ 'license-deactivation-message' => __( 'Your license was successfully deactivated, you are back to the %s plan.',
375
+ 'freemius' ),
376
+ 'license-deactivation-failed-message' => __( 'It looks like the license deactivation failed.',
377
+ 'freemius' ),
378
+ 'license-activation-failed-message' => __( 'It looks like the license could not be activated.',
379
+ 'freemius' ),
380
+ 'server-error-message' => __( 'Error received from the server:', 'freemius' ),
381
+ 'trial-expired-message' => __( 'Your trial has expired. You can still continue using all our free features.',
382
+ 'freemius' ),
383
+ 'plan-x-downgraded-message' => __( 'Your plan was successfully downgraded. Your %s plan license will expire in %s.',
384
+ 'freemius' ),
385
+ 'plan-downgraded-failure-message' => __( 'Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes.',
386
+ 'freemius' ),
387
+ 'trial-cancel-no-trial-message' => __( 'It looks like you are not in trial mode anymore so there\'s nothing to cancel :)',
388
+ 'freemius' ),
389
+ 'trial-cancel-message' => __( 'Your %s free trial was successfully cancelled.',
390
+ 'freemius' ),
391
+ 'version-x-released' => _x( 'Version %s was released.', '%s - numeric version number',
392
+ 'freemius' ),
393
+ 'please-download-x' => __( 'Please download %s.', 'freemius' ),
394
+ 'latest-x-version' => _x( 'the latest %s version here',
395
+ '%s - plan name, as the latest professional version here', 'freemius' ),
396
+ 'trial-x-promotion-message' => __( 'How do you like %s so far? Test all our %s premium features with a %d-day free trial.',
397
+ 'freemius' ),
398
+ 'start-free-trial' => _x( 'Start free trial', 'call to action', 'freemius' ),
399
+ 'starting-trial' => __( 'Starting trial', 'freemius' ),
400
+ 'please-wait' => __( 'Please wait', 'freemius' ),
401
+ 'trial-cancel-failure-message' => __( 'Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes.',
402
+ 'freemius' ),
403
+ 'trial-utilized' => __( 'You already utilized a trial before.', 'freemius' ),
404
+ 'in-trial-mode' => __( 'You are already running the plugin in a trial mode.',
405
+ 'freemius' ),
406
+ 'trial-plan-x-not-exist' => __( 'Plan %s do not exist, therefore, can\'t start a trial.',
407
+ 'freemius' ),
408
+ 'plan-x-no-trial' => __( 'Plan %s does not support a trial period.', 'freemius' ),
409
+ 'no-trials' => __( 'None of the plugin\'s plans supports a trial period.',
410
+ 'freemius' ),
411
+ 'unexpected-api-error' => __( 'Unexpected API error. Please contact the plugin\'s author with the following error.',
412
+ 'freemius' ),
413
+ 'no-commitment-for-x-days' => __( 'No commitment for %s days - cancel anytime!', 'freemius' ),
414
+ 'license-expired-non-blocking-message' => __( '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.',
415
+ 'freemius' ),
416
+ 'could-not-activate-x' => __( 'Couldn\'t activate %s.', 'freemius' ),
417
+ 'contact-us-with-error-message' => __( 'Please contact us with the following message:', 'freemius' ),
418
+ 'plan-did-not-change-message' => __( '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.',
419
+ 'freemius' ),
420
+ 'contact-us-here' => __( 'Please contact us here', 'freemius' ),
421
+ 'plan-did-not-change-email-message' => __( 'I have upgraded my account but when I try to Sync the License, the plan remains %s.',
422
+ 'freemius' ),
423
+ #endregion Admin Notices
424
+ #region Connectivity Issues
425
+ 'connectivity-test-fails-message' => __( 'From unknown reason, the API connectivity test failed.',
426
+ 'freemius' ),
427
+ 'connectivity-test-maybe-temporary' => __( 'It\'s probably a temporary issue on our end. Just to be sure, with your permission, would it be o.k to run another connectivity test?',
428
+ 'freemius' ),
429
+ 'curl-missing-message' => __( 'We use PHP cURL library for the API calls, which is a very common library and usually installed out of the box. Unfortunately, cURL is not installed on your server.',
430
+ 'freemius' ),
431
+ 'cloudflare-blocks-connection-message' => __( 'From unknown reason, CloudFlare, the firewall we use, blocks the connection.',
432
+ 'freemius' ),
433
+ 'x-requires-access-to-api' => _x( '%s requires an access to our API.',
434
+ 'as pluginX requires an access to our API', 'freemius' ),
435
+ 'squid-blocks-connection-message' => __( 'It looks like your server is using Squid ACL (access control lists), which blocks the connection.',
436
+ 'freemius' ),
437
+ 'squid-no-clue-title' => __( 'I don\'t know what is Squid or ACL, help me!', 'freemius' ),
438
+ 'squid-no-clue-desc' => __( '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.',
439
+ 'freemius' ),
440
+ 'sysadmin-title' => __( 'I\'m a system administrator', 'freemius' ),
441
+ 'squid-sysadmin-desc' => __( 'Great, please whitelist the following domains: %s. Once you done, deactivate the plugin and activate it again.',
442
+ 'freemius' ),
443
+ 'curl-missing-no-clue-title' => __( 'I don\'t know what is cURL or how to install it, help me!',
444
+ 'freemius' ),
445
+ 'curl-missing-no-clue-desc' => __( '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.',
446
+ 'freemius' ),
447
+ 'curl-missing-sysadmin-desc' => __( 'Great, please install cURL and enable it in your php.ini file. To make sure it was successfully activated, use \'phpinfo()\'. Once activated, deactivate the plugin and reactivate it back again.',
448
+ 'freemius' ),
449
+ 'happy-to-resolve-issue-asap' => __( 'We are sure it\'s an issue on our side and more than happy to resolve it for you ASAP if you give us a chance.',
450
+ 'freemius' ),
451
+ 'contact-support-before-deactivation' => __( 'Sorry for the inconvenience and we are here to help if you give us a chance.',
452
+ 'freemius' ),
453
+ 'fix-issue-title' => __( 'Yes - I\'m giving you a chance to fix it', 'freemius' ),
454
+ 'fix-issue-desc' => __( 'We will do our best to whitelist your server and resolve this issue ASAP. You will get a follow-up email to %s once we have an update.',
455
+ 'freemius' ),
456
+ 'install-previous-title' => __( 'Let\'s try your previous version', 'freemius' ),
457
+ 'install-previous-desc' => __( 'Uninstall this version and install the previous one.',
458
+ 'freemius' ),
459
+ 'deactivate-plugin-title' => __( 'That\'s exhausting, please deactivate', 'freemius' ),
460
+ 'deactivate-plugin-desc' => __( 'We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future.',
461
+ 'freemius' ),
462
+ 'fix-request-sent-message' => __( '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.',
463
+ 'freemius' ),
464
+ 'server-blocking-access' => _x( 'Your server is blocking the access to Freemius\' API, which is crucial for %1s synchronization. Please contact your host to whitelist %2s',
465
+ '%1s - plugin title, %2s - API domain', 'freemius' ),
466
+ 'wrong-authentication-param-message' => __( 'It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again.',
467
+ 'freemius' ),
468
+ #endregion Connectivity Issues
469
+ #region Change Owner
470
+ 'change-owner-request-sent-x' => __( '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.',
471
+ 'freemius' ),
472
+ 'change-owner-request_owner-confirmed' => __( 'Thanks for confirming the ownership change. An email was just sent to %s for final approval.',
473
+ 'freemius' ),
474
+ 'change-owner-request_candidate-confirmed' => __( '%s is the new owner of the account.', 'freemius' ),
475
+ #endregion Change Owner
476
+ 'addon-x-cannot-run-without-y' => _x( '%s cannot run without %s.',
477
+ 'addonX cannot run without pluginY', 'freemius' ),
478
+ 'addon-x-cannot-run-without-parent' => _x( '%s cannot run without the plugin.', 'addonX cannot run...',
479
+ 'freemius' ),
480
+ 'plugin-x-activation-message' => _x( '%s activation was successfully completed.',
481
+ 'pluginX activation was successfully...', 'freemius' ),
482
+ 'features-and-pricing' => _x( 'Features & Pricing', 'Plugin installer section title',
483
+ 'freemius' ),
484
+ 'free-addon-not-deployed' => __( 'Add-on must be deployed to WordPress.org or Freemius.',
485
+ 'freemius' ),
486
+ 'paid-addon-not-deployed' => __( 'Paid add-on must be deployed to Freemius.', 'freemius' ),
487
+ #--------------------------------------------------------------------------------
488
+ #region Add-On Licensing
489
+ #--------------------------------------------------------------------------------
490
+ 'addon-no-license-message' => __( '%s is a premium only add-on. You have to purchase a license first before activating the plugin.',
491
+ 'freemius' ),
492
+ 'addon-trial-cancelled-message' => __( '%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.',
493
+ 'freemius' ),
494
+ #endregion
495
+ #--------------------------------------------------------------------------------
496
+ #region Billing Cycles
497
+ #--------------------------------------------------------------------------------
498
+ 'monthly' => _x( 'Monthly', 'as every month', 'freemius' ),
499
+ 'mo' => _x( 'mo', 'as monthly period', 'freemius' ),
500
+ 'annual' => _x( 'Annual', 'as once a year', 'freemius' ),
501
+ 'annually' => _x( 'Annually', 'as once a year', 'freemius' ),
502
+ 'once' => _x( 'Once', 'as once a year', 'freemius' ),
503
+ 'year' => _x( 'year', 'as annual period', 'freemius' ),
504
+ 'lifetime' => __( 'Lifetime', 'freemius' ),
505
+ 'best' => _x( 'Best', 'e.g. the best product', 'freemius' ),
506
+ 'billed-x' => _x( 'Billed %s', 'e.g. billed monthly', 'freemius' ),
507
+ 'save-x' => _x( 'Save %s', 'as a discount of $5 or 10%', 'freemius' ),
508
+ #endregion Billing Cycles
509
+ 'view-details' => __( 'View details', 'freemius' ),
510
+ #--------------------------------------------------------------------------------
511
+ #region Trial
512
+ #--------------------------------------------------------------------------------
513
+ 'approve-start-trial' => _x( 'Approve & Start Trial', 'button label', 'freemius' ),
514
+ /* translators: %1$s: Number of trial days; %2$s: Plan name; */
515
+ 'start-trial-prompt-header' => __( 'You are 1-click away from starting your %1$s-day free trial of the %2$s plan.', 'freemius' ),
516
+ /* translators: %s: Link to freemius.com */
517
+ 'start-trial-prompt-message' => __( '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 plugin to periodically send data to %s to check for version updates and to validate your trial.', 'freemius' ),
518
+
519
+ #endregion
520
+ #--------------------------------------------------------------------------------
521
+ #region Billing Details
522
+ #--------------------------------------------------------------------------------
523
+ 'business-name' => __( 'Business name', 'freemius' ),
524
+ 'tax-vat-id' => __( 'Tax / VAT ID', 'freemius' ),
525
+ 'address-line-n' => __( 'Address Line %d', 'freemius' ),
526
+ 'country' => __( 'Country', 'freemius' ),
527
+ 'select-country' => __( 'Select Country', 'freemius' ),
528
+ 'city' => __( 'City', 'freemius' ),
529
+ 'town' => __( 'Town', 'freemius' ),
530
+ 'state' => __( 'State', 'freemius' ),
531
+ 'province' => __( 'Province', 'freemius' ),
532
+ 'zip-postal-code' => __( 'ZIP / Postal Code', 'freemius' ),
533
+ #endregion
534
+ );
includes/pum-sdk/freemius/includes/managers/class-fs-admin-notice-manager.php CHANGED
@@ -1,313 +1,313 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
- * @since 1.0.7
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- class FS_Admin_Notice_Manager {
14
- /**
15
- * @var string
16
- */
17
- protected $_slug;
18
- /**
19
- * @var string
20
- */
21
- protected $_title;
22
- /**
23
- * @var array[]
24
- */
25
- private $_admin_messages = array();
26
- /**
27
- * @var FS_Key_Value_Storage
28
- */
29
- private $_sticky_storage;
30
- /**
31
- * @var FS_Plugin_Manager[]
32
- */
33
- private static $_instances = array();
34
- /**
35
- * @var FS_Logger
36
- */
37
- protected $_logger;
38
-
39
- /**
40
- * @param string $slug
41
- * @param string $title
42
- *
43
- * @return FS_Admin_Notice_Manager
44
- */
45
- static function instance( $slug, $title = '' ) {
46
- if ( ! isset( self::$_instances[ $slug ] ) ) {
47
- self::$_instances[ $slug ] = new FS_Admin_Notice_Manager( $slug, $title );
48
- }
49
-
50
- return self::$_instances[ $slug ];
51
- }
52
-
53
- protected function __construct( $slug, $title = '' ) {
54
- $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $slug . '_data', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
55
-
56
- $this->_slug = $slug;
57
- $this->_title = ! empty( $title ) ? $title : '';
58
- $this->_sticky_storage = FS_Key_Value_Storage::instance( 'admin_notices', $this->_slug );
59
-
60
- if ( is_admin() ) {
61
- if ( 0 < count( $this->_sticky_storage ) ) {
62
- // If there are sticky notices for the current slug, add a callback
63
- // to the AJAX action that handles message dismiss.
64
- add_action( "wp_ajax_fs_dismiss_notice_action_{$slug}", array(
65
- &$this,
66
- 'dismiss_notice_ajax_callback'
67
- ) );
68
-
69
- foreach ( $this->_sticky_storage as $id => $msg ) {
70
- // Add admin notice.
71
- $this->add(
72
- $msg['message'],
73
- $msg['title'],
74
- $msg['type'],
75
- true,
76
- $msg['all'],
77
- $msg['id'],
78
- false
79
- );
80
- }
81
- }
82
- }
83
- }
84
-
85
- /**
86
- * Remove sticky message by ID.
87
- *
88
- * @author Vova Feldman (@svovaf)
89
- * @since 1.0.7
90
- *
91
- */
92
- function dismiss_notice_ajax_callback() {
93
- $this->_sticky_storage->remove( $_POST['message_id'] );
94
- wp_die();
95
- }
96
-
97
- /**
98
- * Rendered sticky message dismiss JavaScript.
99
- *
100
- * @author Vova Feldman (@svovaf)
101
- * @since 1.0.7
102
- */
103
- static function _add_sticky_dismiss_javascript() {
104
- $params = array();
105
- fs_require_once_template( 'sticky-admin-notice-js.php', $params );
106
- }
107
-
108
- private static $_added_sticky_javascript = false;
109
-
110
- /**
111
- * Hook to the admin_footer to add sticky message dismiss JavaScript handler.
112
- *
113
- * @author Vova Feldman (@svovaf)
114
- * @since 1.0.7
115
- */
116
- private static function has_sticky_messages() {
117
- if ( ! self::$_added_sticky_javascript ) {
118
- add_action( 'admin_footer', array( 'FS_Admin_Notice_Manager', '_add_sticky_dismiss_javascript' ) );
119
- }
120
- }
121
-
122
- /**
123
- * Handle admin_notices by printing the admin messages stacked in the queue.
124
- *
125
- * @author Vova Feldman (@svovaf)
126
- * @since 1.0.4
127
- *
128
- */
129
- function _admin_notices_hook() {
130
- $notice_type = 'admin_notices';
131
-
132
- if ( function_exists( 'current_user_can' ) &&
133
- ! current_user_can( 'manage_options' )
134
- ) {
135
- // Only show messages to admins.
136
- return;
137
- }
138
-
139
- if ( ! isset( $this->_admin_messages[ $notice_type ] ) || ! is_array( $this->_admin_messages[ $notice_type ] ) ) {
140
- return;
141
- }
142
-
143
- foreach ( $this->_admin_messages[ $notice_type ] as $id => $msg ) {
144
- fs_require_template( 'admin-notice.php', $msg );
145
-
146
- if ( $msg['sticky'] ) {
147
- self::has_sticky_messages();
148
- }
149
- }
150
- }
151
-
152
- /**
153
- * Handle all_admin_notices by printing the admin messages stacked in the queue.
154
- *
155
- * @author Vova Feldman (@svovaf)
156
- * @since 1.0.4
157
- *
158
- */
159
- function _all_admin_notices_hook() {
160
- $notice_type = 'all_admin_notices';
161
-
162
- if ( ! isset( $this->_admin_messages[ $notice_type ] ) || ! is_array( $this->_admin_messages[ $notice_type ] ) ) {
163
- return;
164
- }
165
-
166
- foreach ( $this->_admin_messages[ $notice_type ] as $id => $msg ) {
167
- fs_require_template( 'all-admin-notice.php', $msg );
168
- }
169
- }
170
-
171
- /**
172
- * Enqueue common stylesheet to style admin notice.
173
- *
174
- * @author Vova Feldman (@svovaf)
175
- * @since 1.0.7
176
- */
177
- function _enqueue_styles() {
178
- fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
179
- }
180
-
181
- /**
182
- * Add admin message to admin messages queue, and hook to admin_notices / all_admin_notices if not yet hooked.
183
- *
184
- * @author Vova Feldman (@svovaf)
185
- * @since 1.0.4
186
- *
187
- * @param string $message
188
- * @param string $title
189
- * @param string $type
190
- * @param bool $is_sticky
191
- * @param bool $all_admin
192
- * @param string $id Message ID
193
- * @param bool $store_if_sticky
194
- *
195
- * @uses add_action()
196
- */
197
- function add( $message, $title = '', $type = 'success', $is_sticky = false, $all_admin = false, $id = '', $store_if_sticky = true ) {
198
- $key = ( $all_admin ? 'all_admin_notices' : 'admin_notices' );
199
-
200
- if ( ! isset( $this->_admin_messages[ $key ] ) ) {
201
- $this->_admin_messages[ $key ] = array();
202
-
203
- add_action( $key, array( &$this, "_{$key}_hook" ) );
204
- add_action( 'admin_enqueue_scripts', array( &$this, '_enqueue_styles' ) );
205
-
206
- }
207
-
208
- if ( '' === $id ) {
209
- $id = md5( $title . ' ' . $message . ' ' . $type );
210
- }
211
-
212
- $message_object = array(
213
- 'message' => $message,
214
- 'title' => $title,
215
- 'type' => $type,
216
- 'sticky' => $is_sticky,
217
- 'id' => $id,
218
- 'all' => $all_admin,
219
- 'slug' => $this->_slug,
220
- 'plugin' => $this->_title,
221
- );
222
-
223
- if ( $is_sticky && $store_if_sticky ) {
224
- $this->_sticky_storage->{$id} = $message_object;
225
- }
226
-
227
- $this->_admin_messages[ $key ][ $id ] = $message_object;
228
- }
229
-
230
- /**
231
- * @author Vova Feldman (@svovaf)
232
- * @since 1.0.7
233
- *
234
- * @param string|string[] $ids
235
- */
236
- function remove_sticky( $ids ) {
237
- if ( ! is_array( $ids ) ) {
238
- $ids = array( $ids );
239
- }
240
-
241
- foreach ( $ids as $id ) {
242
- // Remove from sticky storage.
243
- $this->_sticky_storage->remove( $id );
244
-
245
- // Remove from current admin messages.
246
- if ( isset( $this->_admin_messages['all_admin_notices'] ) && isset( $this->_admin_messages['all_admin_notices'][ $id ] ) ) {
247
- unset( $this->_admin_messages['all_admin_notices'][ $id ] );
248
- }
249
- if ( isset( $this->_admin_messages['admin_notices'] ) && isset( $this->_admin_messages['admin_notices'][ $id ] ) ) {
250
- unset( $this->_admin_messages['admin_notices'][ $id ] );
251
- }
252
- }
253
- }
254
-
255
- /**
256
- * Check if sticky message exists by id.
257
- *
258
- * @author Vova Feldman (@svovaf)
259
- * @since 1.0.9
260
- *
261
- * @param $id
262
- *
263
- * @return bool
264
- */
265
- function has_sticky( $id ) {
266
- return isset( $this->_sticky_storage[ $id ] );
267
- }
268
-
269
- /**
270
- * Adds sticky admin notification.
271
- *
272
- * @author Vova Feldman (@svovaf)
273
- * @since 1.0.7
274
- *
275
- * @param string $message
276
- * @param string $id Message ID
277
- * @param string $title
278
- * @param string $type
279
- * @param bool $all_admin
280
- */
281
- function add_sticky( $message, $id, $title = '', $type = 'success', $all_admin = false ) {
282
- $message = fs_apply_filter( $this->_slug, "sticky_message_{$id}", $message );
283
- $title = fs_apply_filter( $this->_slug, "sticky_title_{$id}", $title );
284
-
285
- $this->add( $message, $title, $type, true, $all_admin, $id );
286
- }
287
-
288
- /**
289
- * Clear all sticky messages.
290
- *
291
- * @author Vova Feldman (@svovaf)
292
- * @since 1.0.8
293
- */
294
- function clear_all_sticky() {
295
- $this->_sticky_storage->clear_all();
296
- }
297
-
298
- /**
299
- * Add admin message to all admin messages queue, and hook to all_admin_notices if not yet hooked.
300
- *
301
- * @author Vova Feldman (@svovaf)
302
- * @since 1.0.4
303
- *
304
- * @param string $message
305
- * @param string $title
306
- * @param string $type
307
- * @param bool $is_sticky
308
- * @param string $id Message ID
309
- */
310
- function add_all( $message, $title = '', $type = 'success', $is_sticky = false, $id = '' ) {
311
- $this->add( $message, $title, $type, $is_sticky, true, $id );
312
- }
313
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
+ * @since 1.0.7
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Admin_Notice_Manager {
14
+ /**
15
+ * @var string
16
+ */
17
+ protected $_slug;
18
+ /**
19
+ * @var string
20
+ */
21
+ protected $_title;
22
+ /**
23
+ * @var array[]
24
+ */
25
+ private $_admin_messages = array();
26
+ /**
27
+ * @var FS_Key_Value_Storage
28
+ */
29
+ private $_sticky_storage;
30
+ /**
31
+ * @var FS_Plugin_Manager[]
32
+ */
33
+ private static $_instances = array();
34
+ /**
35
+ * @var FS_Logger
36
+ */
37
+ protected $_logger;
38
+
39
+ /**
40
+ * @param string $slug
41
+ * @param string $title
42
+ *
43
+ * @return FS_Admin_Notice_Manager
44
+ */
45
+ static function instance( $slug, $title = '' ) {
46
+ if ( ! isset( self::$_instances[ $slug ] ) ) {
47
+ self::$_instances[ $slug ] = new FS_Admin_Notice_Manager( $slug, $title );
48
+ }
49
+
50
+ return self::$_instances[ $slug ];
51
+ }
52
+
53
+ protected function __construct( $slug, $title = '' ) {
54
+ $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $slug . '_data', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
55
+
56
+ $this->_slug = $slug;
57
+ $this->_title = ! empty( $title ) ? $title : '';
58
+ $this->_sticky_storage = FS_Key_Value_Storage::instance( 'admin_notices', $this->_slug );
59
+
60
+ if ( is_admin() ) {
61
+ if ( 0 < count( $this->_sticky_storage ) ) {
62
+ // If there are sticky notices for the current slug, add a callback
63
+ // to the AJAX action that handles message dismiss.
64
+ add_action( "wp_ajax_fs_dismiss_notice_action_{$slug}", array(
65
+ &$this,
66
+ 'dismiss_notice_ajax_callback'
67
+ ) );
68
+
69
+ foreach ( $this->_sticky_storage as $id => $msg ) {
70
+ // Add admin notice.
71
+ $this->add(
72
+ $msg['message'],
73
+ $msg['title'],
74
+ $msg['type'],
75
+ true,
76
+ $msg['all'],
77
+ $msg['id'],
78
+ false
79
+ );
80
+ }
81
+ }
82
+ }
83
+ }
84
+
85
+ /**
86
+ * Remove sticky message by ID.
87
+ *
88
+ * @author Vova Feldman (@svovaf)
89
+ * @since 1.0.7
90
+ *
91
+ */
92
+ function dismiss_notice_ajax_callback() {
93
+ $this->_sticky_storage->remove( $_POST['message_id'] );
94
+ wp_die();
95
+ }
96
+
97
+ /**
98
+ * Rendered sticky message dismiss JavaScript.
99
+ *
100
+ * @author Vova Feldman (@svovaf)
101
+ * @since 1.0.7
102
+ */
103
+ static function _add_sticky_dismiss_javascript() {
104
+ $params = array();
105
+ fs_require_once_template( 'sticky-admin-notice-js.php', $params );
106
+ }
107
+
108
+ private static $_added_sticky_javascript = false;
109
+
110
+ /**
111
+ * Hook to the admin_footer to add sticky message dismiss JavaScript handler.
112
+ *
113
+ * @author Vova Feldman (@svovaf)
114
+ * @since 1.0.7
115
+ */
116
+ private static function has_sticky_messages() {
117
+ if ( ! self::$_added_sticky_javascript ) {
118
+ add_action( 'admin_footer', array( 'FS_Admin_Notice_Manager', '_add_sticky_dismiss_javascript' ) );
119
+ }
120
+ }
121
+
122
+ /**
123
+ * Handle admin_notices by printing the admin messages stacked in the queue.
124
+ *
125
+ * @author Vova Feldman (@svovaf)
126
+ * @since 1.0.4
127
+ *
128
+ */
129
+ function _admin_notices_hook() {
130
+ $notice_type = 'admin_notices';
131
+
132
+ if ( function_exists( 'current_user_can' ) &&
133
+ ! current_user_can( 'manage_options' )
134
+ ) {
135
+ // Only show messages to admins.
136
+ return;
137
+ }
138
+
139
+ if ( ! isset( $this->_admin_messages[ $notice_type ] ) || ! is_array( $this->_admin_messages[ $notice_type ] ) ) {
140
+ return;
141
+ }
142
+
143
+ foreach ( $this->_admin_messages[ $notice_type ] as $id => $msg ) {
144
+ fs_require_template( 'admin-notice.php', $msg );
145
+
146
+ if ( $msg['sticky'] ) {
147
+ self::has_sticky_messages();
148
+ }
149
+ }
150
+ }
151
+
152
+ /**
153
+ * Handle all_admin_notices by printing the admin messages stacked in the queue.
154
+ *
155
+ * @author Vova Feldman (@svovaf)
156
+ * @since 1.0.4
157
+ *
158
+ */
159
+ function _all_admin_notices_hook() {
160
+ $notice_type = 'all_admin_notices';
161
+
162
+ if ( ! isset( $this->_admin_messages[ $notice_type ] ) || ! is_array( $this->_admin_messages[ $notice_type ] ) ) {
163
+ return;
164
+ }
165
+
166
+ foreach ( $this->_admin_messages[ $notice_type ] as $id => $msg ) {
167
+ fs_require_template( 'all-admin-notice.php', $msg );
168
+ }
169
+ }
170
+
171
+ /**
172
+ * Enqueue common stylesheet to style admin notice.
173
+ *
174
+ * @author Vova Feldman (@svovaf)
175
+ * @since 1.0.7
176
+ */
177
+ function _enqueue_styles() {
178
+ fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
179
+ }
180
+
181
+ /**
182
+ * Add admin message to admin messages queue, and hook to admin_notices / all_admin_notices if not yet hooked.
183
+ *
184
+ * @author Vova Feldman (@svovaf)
185
+ * @since 1.0.4
186
+ *
187
+ * @param string $message
188
+ * @param string $title
189
+ * @param string $type
190
+ * @param bool $is_sticky
191
+ * @param bool $all_admin
192
+ * @param string $id Message ID
193
+ * @param bool $store_if_sticky
194
+ *
195
+ * @uses add_action()
196
+ */
197
+ function add( $message, $title = '', $type = 'success', $is_sticky = false, $all_admin = false, $id = '', $store_if_sticky = true ) {
198
+ $key = ( $all_admin ? 'all_admin_notices' : 'admin_notices' );
199
+
200
+ if ( ! isset( $this->_admin_messages[ $key ] ) ) {
201
+ $this->_admin_messages[ $key ] = array();
202
+
203
+ add_action( $key, array( &$this, "_{$key}_hook" ) );
204
+ add_action( 'admin_enqueue_scripts', array( &$this, '_enqueue_styles' ) );
205
+
206
+ }
207
+
208
+ if ( '' === $id ) {
209
+ $id = md5( $title . ' ' . $message . ' ' . $type );
210
+ }
211
+
212
+ $message_object = array(
213
+ 'message' => $message,
214
+ 'title' => $title,
215
+ 'type' => $type,
216
+ 'sticky' => $is_sticky,
217
+ 'id' => $id,
218
+ 'all' => $all_admin,
219
+ 'slug' => $this->_slug,
220
+ 'plugin' => $this->_title,
221
+ );
222
+
223
+ if ( $is_sticky && $store_if_sticky ) {
224
+ $this->_sticky_storage->{$id} = $message_object;
225
+ }
226
+
227
+ $this->_admin_messages[ $key ][ $id ] = $message_object;
228
+ }
229
+
230
+ /**
231
+ * @author Vova Feldman (@svovaf)
232
+ * @since 1.0.7
233
+ *
234
+ * @param string|string[] $ids
235
+ */
236
+ function remove_sticky( $ids ) {
237
+ if ( ! is_array( $ids ) ) {
238
+ $ids = array( $ids );
239
+ }
240
+
241
+ foreach ( $ids as $id ) {
242
+ // Remove from sticky storage.
243
+ $this->_sticky_storage->remove( $id );
244
+
245
+ // Remove from current admin messages.
246
+ if ( isset( $this->_admin_messages['all_admin_notices'] ) && isset( $this->_admin_messages['all_admin_notices'][ $id ] ) ) {
247
+ unset( $this->_admin_messages['all_admin_notices'][ $id ] );
248
+ }
249
+ if ( isset( $this->_admin_messages['admin_notices'] ) && isset( $this->_admin_messages['admin_notices'][ $id ] ) ) {
250
+ unset( $this->_admin_messages['admin_notices'][ $id ] );
251
+ }
252
+ }
253
+ }
254
+
255
+ /**
256
+ * Check if sticky message exists by id.
257
+ *
258
+ * @author Vova Feldman (@svovaf)
259
+ * @since 1.0.9
260
+ *
261
+ * @param $id
262
+ *
263
+ * @return bool
264
+ */
265
+ function has_sticky( $id ) {
266
+ return isset( $this->_sticky_storage[ $id ] );
267
+ }
268
+
269
+ /**
270
+ * Adds sticky admin notification.
271
+ *
272
+ * @author Vova Feldman (@svovaf)
273
+ * @since 1.0.7
274
+ *
275
+ * @param string $message
276
+ * @param string $id Message ID
277
+ * @param string $title
278
+ * @param string $type
279
+ * @param bool $all_admin
280
+ */
281
+ function add_sticky( $message, $id, $title = '', $type = 'success', $all_admin = false ) {
282
+ $message = fs_apply_filter( $this->_slug, "sticky_message_{$id}", $message );
283
+ $title = fs_apply_filter( $this->_slug, "sticky_title_{$id}", $title );
284
+
285
+ $this->add( $message, $title, $type, true, $all_admin, $id );
286
+ }
287
+
288
+ /**
289
+ * Clear all sticky messages.
290
+ *
291
+ * @author Vova Feldman (@svovaf)
292
+ * @since 1.0.8
293
+ */
294
+ function clear_all_sticky() {
295
+ $this->_sticky_storage->clear_all();
296
+ }
297
+
298
+ /**
299
+ * Add admin message to all admin messages queue, and hook to all_admin_notices if not yet hooked.
300
+ *
301
+ * @author Vova Feldman (@svovaf)
302
+ * @since 1.0.4
303
+ *
304
+ * @param string $message
305
+ * @param string $title
306
+ * @param string $type
307
+ * @param bool $is_sticky
308
+ * @param string $id Message ID
309
+ */
310
+ function add_all( $message, $title = '', $type = 'success', $is_sticky = false, $id = '' ) {
311
+ $this->add( $message, $title, $type, $is_sticky, true, $id );
312
+ }
313
  }
includes/pum-sdk/freemius/includes/sdk/Exceptions/ArgumentNotExistException.php CHANGED
@@ -1,9 +1,9 @@
1
- <?php
2
- if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
3
- exit;
4
- }
5
-
6
- if ( ! class_exists( 'Freemius_ArgumentNotExistException' ) ) {
7
- class Freemius_ArgumentNotExistException extends Freemius_InvalidArgumentException {
8
- }
9
  }
1
+ <?php
2
+ if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
3
+ exit;
4
+ }
5
+
6
+ if ( ! class_exists( 'Freemius_ArgumentNotExistException' ) ) {
7
+ class Freemius_ArgumentNotExistException extends Freemius_InvalidArgumentException {
8
+ }
9
  }
includes/pum-sdk/freemius/includes/sdk/Exceptions/EmptyArgumentException.php CHANGED
@@ -1,9 +1,9 @@
1
- <?php
2
- if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
3
- exit;
4
- }
5
-
6
- if ( ! class_exists( 'Freemius_EmptyArgumentException' ) ) {
7
- class Freemius_EmptyArgumentException extends Freemius_InvalidArgumentException {
8
- }
9
  }
1
+ <?php
2
+ if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
3
+ exit;
4
+ }
5
+
6
+ if ( ! class_exists( 'Freemius_EmptyArgumentException' ) ) {
7
+ class Freemius_EmptyArgumentException extends Freemius_InvalidArgumentException {
8
+ }
9
  }
includes/pum-sdk/freemius/includes/sdk/Exceptions/Exception.php CHANGED
@@ -1,74 +1,74 @@
1
- <?php
2
- if ( ! class_exists( 'Freemius_Exception' ) ) {
3
- /**
4
- * Thrown when an API call returns an exception.
5
- *
6
- */
7
- class Freemius_Exception extends Exception {
8
- protected $_result;
9
- protected $_type;
10
- protected $_code;
11
-
12
- /**
13
- * Make a new API Exception with the given result.
14
- *
15
- * @param array $result The result from the API server.
16
- */
17
- public function __construct( $result ) {
18
- $this->_result = $result;
19
-
20
- $code = 0;
21
- $message = 'Unknown error, please check GetResult().';
22
- $type = '';
23
-
24
- if ( isset( $result['error'] ) && is_array( $result['error'] ) ) {
25
- if ( isset( $result['error']['code'] ) ) {
26
- $code = $result['error']['code'];
27
- }
28
- if ( isset( $result['error']['message'] ) ) {
29
- $message = $result['error']['message'];
30
- }
31
- if ( isset( $result['error']['type'] ) ) {
32
- $type = $result['error']['type'];
33
- }
34
- }
35
-
36
- $this->_type = $type;
37
- $this->_code = $code;
38
-
39
- parent::__construct( $message, is_numeric( $code ) ? $code : 0 );
40
- }
41
-
42
- /**
43
- * Return the associated result object returned by the API server.
44
- *
45
- * @return array The result from the API server
46
- */
47
- public function getResult() {
48
- return $this->_result;
49
- }
50
-
51
- public function getStringCode() {
52
- return $this->_code;
53
- }
54
-
55
- public function getType() {
56
- return $this->_type;
57
- }
58
-
59
- /**
60
- * To make debugging easier.
61
- *
62
- * @return string The string representation of the error
63
- */
64
- public function __toString() {
65
- $str = $this->getType() . ': ';
66
-
67
- if ( $this->code != 0 ) {
68
- $str .= $this->getStringCode() . ': ';
69
- }
70
-
71
- return $str . $this->getMessage();
72
- }
73
- }
74
  }
1
+ <?php
2
+ if ( ! class_exists( 'Freemius_Exception' ) ) {
3
+ /**
4
+ * Thrown when an API call returns an exception.
5
+ *
6
+ */
7
+ class Freemius_Exception extends Exception {
8
+ protected $_result;
9
+ protected $_type;
10
+ protected $_code;
11
+
12
+ /**
13
+ * Make a new API Exception with the given result.
14
+ *
15
+ * @param array $result The result from the API server.
16
+ */
17
+ public function __construct( $result ) {
18
+ $this->_result = $result;
19
+
20
+ $code = 0;
21
+ $message = 'Unknown error, please check GetResult().';
22
+ $type = '';
23
+
24
+ if ( isset( $result['error'] ) && is_array( $result['error'] ) ) {
25
+ if ( isset( $result['error']['code'] ) ) {
26
+ $code = $result['error']['code'];
27
+ }
28
+ if ( isset( $result['error']['message'] ) ) {
29
+ $message = $result['error']['message'];
30
+ }
31
+ if ( isset( $result['error']['type'] ) ) {
32
+ $type = $result['error']['type'];
33
+ }
34
+ }
35
+
36
+ $this->_type = $type;
37
+ $this->_code = $code;
38
+
39
+ parent::__construct( $message, is_numeric( $code ) ? $code : 0 );
40
+ }
41
+
42
+ /**
43
+ * Return the associated result object returned by the API server.
44
+ *
45
+ * @return array The result from the API server
46
+ */
47
+ public function getResult() {
48
+ return $this->_result;
49
+ }
50
+
51
+ public function getStringCode() {
52
+ return $this->_code;
53
+ }
54
+
55
+ public function getType() {
56
+ return $this->_type;
57
+ }
58
+
59
+ /**
60
+ * To make debugging easier.
61
+ *
62
+ * @return string The string representation of the error
63
+ */
64
+ public function __toString() {
65
+ $str = $this->getType() . ': ';
66
+
67
+ if ( $this->code != 0 ) {
68
+ $str .= $this->getStringCode() . ': ';
69
+ }
70
+
71
+ return $str . $this->getMessage();
72
+ }
73
+ }
74
  }
includes/pum-sdk/freemius/includes/sdk/Exceptions/InvalidArgumentException.php CHANGED
@@ -1,8 +1,8 @@
1
- <?php
2
- if ( ! class_exists( 'Freemius_Exception' ) ) {
3
- exit;
4
- }
5
-
6
- if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
7
- class Freemius_InvalidArgumentException extends Freemius_Exception { }
8
  }
1
+ <?php
2
+ if ( ! class_exists( 'Freemius_Exception' ) ) {
3
+ exit;
4
+ }
5
+
6
+ if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
7
+ class Freemius_InvalidArgumentException extends Freemius_Exception { }
8
  }
includes/pum-sdk/freemius/includes/sdk/Exceptions/OAuthException.php CHANGED
@@ -1,12 +1,12 @@
1
- <?php
2
- if ( ! class_exists( 'Freemius_Exception' ) ) {
3
- exit;
4
- }
5
-
6
- if ( ! class_exists( 'Freemius_OAuthException' ) ) {
7
- class Freemius_OAuthException extends Freemius_Exception {
8
- public function __construct( $pResult ) {
9
- parent::__construct( $pResult );
10
- }
11
- }
12
  }
1
+ <?php
2
+ if ( ! class_exists( 'Freemius_Exception' ) ) {
3
+ exit;
4
+ }
5
+
6
+ if ( ! class_exists( 'Freemius_OAuthException' ) ) {
7
+ class Freemius_OAuthException extends Freemius_Exception {
8
+ public function __construct( $pResult ) {
9
+ parent::__construct( $pResult );
10
+ }
11
+ }
12
  }
includes/pum-sdk/freemius/includes/sdk/Freemius.php CHANGED
@@ -1,583 +1,583 @@
1
- <?php
2
- /**
3
- * Copyright 2014 Freemius, Inc.
4
- *
5
- * Licensed under the GPL v2 (the "License"); you may
6
- * not use this file except in compliance with the License. You may obtain
7
- * a copy of the License at
8
- *
9
- * http://choosealicense.com/licenses/gpl-v2/
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations
15
- * under the License.
16
- */
17
-
18
- require_once( dirname( __FILE__ ) . '/FreemiusBase.php' );
19
-
20
- if ( ! defined( 'FS_SDK__USER_AGENT' ) ) {
21
- define( 'FS_SDK__USER_AGENT', 'fs-php-' . Freemius_Api_Base::VERSION );
22
- }
23
-
24
- if ( ! defined( 'FS_SDK__SIMULATE_NO_CURL' ) ) {
25
- define( 'FS_SDK__SIMULATE_NO_CURL', false );
26
- }
27
-
28
- if ( ! defined( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE' ) ) {
29
- define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', false );
30
- }
31
-
32
- if ( ! defined( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL' ) ) {
33
- define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', false );
34
- }
35
-
36
- if ( ! defined( 'FS_SDK__HAS_CURL' ) ) {
37
- define( 'FS_SDK__HAS_CURL', ! FS_SDK__SIMULATE_NO_CURL && function_exists( 'curl_version' ) );
38
- }
39
-
40
- if ( ! FS_SDK__HAS_CURL ) {
41
- $curl_version = array( 'version' => '7.0.0' );
42
- } else {
43
- $curl_version = curl_version();
44
- }
45
-
46
- if ( ! defined( 'FS_API__PROTOCOL' ) ) {
47
- define( 'FS_API__PROTOCOL', version_compare( $curl_version['version'], '7.37', '>=' ) ? 'https' : 'http' );
48
- }
49
-
50
- if ( ! defined( 'FS_API__LOGGER_ON' ) ) {
51
- define( 'FS_API__LOGGER_ON', false );
52
- }
53
-
54
- if ( ! defined( 'FS_API__ADDRESS' ) ) {
55
- define( 'FS_API__ADDRESS', '://api.freemius.com' );
56
- }
57
- if ( ! defined( 'FS_API__SANDBOX_ADDRESS' ) ) {
58
- define( 'FS_API__SANDBOX_ADDRESS', '://sandbox-api.freemius.com' );
59
- }
60
-
61
- if ( class_exists( 'Freemius_Api' ) ) {
62
- return;
63
- }
64
-
65
- class Freemius_Api extends Freemius_Api_Base {
66
- private static $_logger = array();
67
-
68
- /**
69
- * @param string $pScope 'app', 'developer', 'user' or 'install'.
70
- * @param number $pID Element's id.
71
- * @param string $pPublic Public key.
72
- * @param string|bool $pSecret Element's secret key.
73
- * @param bool $pSandbox Whether or not to run API in sandbox mode.
74
- */
75
- public function __construct( $pScope, $pID, $pPublic, $pSecret = false, $pSandbox = false ) {
76
- // If secret key not provided, use public key encryption.
77
- if ( is_bool( $pSecret ) ) {
78
- $pSecret = $pPublic;
79
- }
80
-
81
- parent::Init( $pScope, $pID, $pPublic, $pSecret, $pSandbox );
82
- }
83
-
84
- public static function GetUrl( $pCanonizedPath = '', $pIsSandbox = false ) {
85
- $address = ( $pIsSandbox ? FS_API__SANDBOX_ADDRESS : FS_API__ADDRESS );
86
-
87
- if ( ':' === $address[0] ) {
88
- $address = self::$_protocol . $address;
89
- }
90
-
91
- return $address . $pCanonizedPath;
92
- }
93
-
94
- #region Servers Clock Diff ------------------------------------------------------
95
-
96
- /**
97
- * @var int Clock diff in seconds between current server to API server.
98
- */
99
- private static $_clock_diff = 0;
100
-
101
- /**
102
- * Set clock diff for all API calls.
103
- *
104
- * @since 1.0.3
105
- *
106
- * @param $pSeconds
107
- */
108
- public static function SetClockDiff( $pSeconds ) {
109
- self::$_clock_diff = $pSeconds;
110
- }
111
-
112
- /**
113
- * Find clock diff between current server to API server.
114
- *
115
- * @since 1.0.2
116
- * @return int Clock diff in seconds.
117
- */
118
- public static function FindClockDiff() {
119
- $time = time();
120
- $pong = self::Ping();
121
-
122
- return ( $time - strtotime( $pong->timestamp ) );
123
- }
124
-
125
- #endregion Servers Clock Diff ------------------------------------------------------
126
-
127
- /**
128
- * @var string http or https
129
- */
130
- private static $_protocol = FS_API__PROTOCOL;
131
-
132
- /**
133
- * Set API connection protocol.
134
- *
135
- * @since 1.0.4
136
- */
137
- public static function SetHttp() {
138
- self::$_protocol = 'http';
139
- }
140
-
141
- /**
142
- * @since 1.0.4
143
- *
144
- * @return bool
145
- */
146
- public static function IsHttps() {
147
- return ( 'https' === self::$_protocol );
148
- }
149
-
150
- /**
151
- * Sign request with the following HTTP headers:
152
- * Content-MD5: MD5(HTTP Request body)
153
- * Date: Current date (i.e Sat, 14 Feb 2015 20:24:46 +0000)
154
- * Authorization: FS {scope_entity_id}:{scope_entity_public_key}:base64encode(sha256(string_to_sign,
155
- * {scope_entity_secret_key}))
156
- *
157
- * @param string $pResourceUrl
158
- * @param array $pCurlOptions
159
- *
160
- * @return array
161
- */
162
- function SignRequest( $pResourceUrl, $pCurlOptions ) {
163
- $eol = "\n";
164
- $content_md5 = '';
165
- $now = ( time() - self::$_clock_diff );
166
- $date = date( 'r', $now );
167
- $content_type = '';
168
-
169
- if ( isset( $pCurlOptions[ CURLOPT_POST ] ) && 0 < $pCurlOptions[ CURLOPT_POST ] ) {
170
- $content_md5 = md5( $pCurlOptions[ CURLOPT_POSTFIELDS ] );
171
- $pCurlOptions[ CURLOPT_HTTPHEADER ][] = 'Content-MD5: ' . $content_md5;
172
- $content_type = 'application/json';
173
- }
174
-
175
- $pCurlOptions[ CURLOPT_HTTPHEADER ][] = 'Date: ' . $date;
176
-
177
- $string_to_sign = implode( $eol, array(
178
- $pCurlOptions[ CURLOPT_CUSTOMREQUEST ],
179
- $content_md5,
180
- $content_type,
181
- $date,
182
- $pResourceUrl
183
- ) );
184
-
185
- // If secret and public keys are identical, it means that
186
- // the signature uses public key hash encoding.
187
- $auth_type = ( $this->_secret !== $this->_public ) ? 'FS' : 'FSP';
188
-
189
- // Add authorization header.
190
- $pCurlOptions[ CURLOPT_HTTPHEADER ][] = 'Authorization: ' .
191
- $auth_type . ' ' .
192
- $this->_id . ':' .
193
- $this->_public . ':' .
194
- self::Base64UrlEncode(
195
- hash_hmac( 'sha256', $string_to_sign, $this->_secret )
196
- );
197
-
198
- return $pCurlOptions;
199
- }
200
-
201
- /**
202
- * Get API request URL signed via query string.
203
- *
204
- * @param string $pPath
205
- *
206
- * @throws Freemius_Exception
207
- *
208
- * @return string
209
- */
210
- function GetSignedUrl( $pPath ) {
211
- $resource = explode( '?', $this->CanonizePath( $pPath ) );
212
- $pResourceUrl = $resource[0];
213
-
214
- $eol = "\n";
215
- $content_md5 = '';
216
- $content_type = '';
217
- $now = ( time() - self::$_clock_diff );
218
- $date = date( 'r', $now );
219
-
220
- $string_to_sign = implode( $eol, array(
221
- 'GET',
222
- $content_md5,
223
- $content_type,
224
- $date,
225
- $pResourceUrl
226
- ) );
227
-
228
- // If secret and public keys are identical, it means that
229
- // the signature uses public key hash encoding.
230
- $auth_type = ( $this->_secret !== $this->_public ) ? 'FS' : 'FSP';
231
-
232
- return Freemius_Api::GetUrl(
233
- $pResourceUrl . '?' .
234
- ( 1 < count( $resource ) && ! empty( $resource[1] ) ? $resource[1] . '&' : '' ) .
235
- http_build_query( array(
236
- 'auth_date' => $date,
237
- 'authorization' => $auth_type . ' ' . $this->_id . ':' .
238
- $this->_public . ':' .
239
- self::Base64UrlEncode( hash_hmac(
240
- 'sha256', $string_to_sign, $this->_secret
241
- ) )
242
- ) ), $this->_isSandbox );
243
- }
244
-
245
- /**
246
- * @param resource $pCurlHandler
247
- * @param array $pCurlOptions
248
- *
249
- * @return mixed
250
- */
251
- private static function ExecuteRequest( &$pCurlHandler, &$pCurlOptions ) {
252
- $start = microtime( true );
253
-
254
- $result = curl_exec( $pCurlHandler );
255
-
256
- if ( FS_API__LOGGER_ON ) {
257
- $end = microtime( true );
258
-
259
- $has_body = ( isset( $pCurlOptions[ CURLOPT_POST ] ) && 0 < $pCurlOptions[ CURLOPT_POST ] );
260
-
261
- self::$_logger[] = array(
262
- 'id' => count( self::$_logger ),
263
- 'start' => $start,
264
- 'end' => $end,
265
- 'total' => ( $end - $start ),
266
- 'method' => $pCurlOptions[ CURLOPT_CUSTOMREQUEST ],
267
- 'path' => $pCurlOptions[ CURLOPT_URL ],
268
- 'body' => $has_body ? $pCurlOptions[ CURLOPT_POSTFIELDS ] : null,
269
- 'result' => $result,
270
- 'code' => curl_getinfo( $pCurlHandler, CURLINFO_HTTP_CODE ),
271
- 'backtrace' => debug_backtrace(),
272
- );
273
- }
274
-
275
- return $result;
276
- }
277
-
278
- /**
279
- * @return array
280
- */
281
- static function GetLogger() {
282
- return self::$_logger;
283
- }
284
-
285
- /**
286
- * @param string $pCanonizedPath
287
- * @param string $pMethod
288
- * @param array $pParams
289
- * @param null|resource $pCurlHandler
290
- * @param bool $pIsSandbox
291
- * @param null|callable $pBeforeExecutionFunction
292
- *
293
- * @return object[]|object|null
294
- *
295
- * @throws \Freemius_Exception
296
- */
297
- private static function MakeStaticRequest(
298
- $pCanonizedPath,
299
- $pMethod = 'GET',
300
- $pParams = array(),
301
- $pCurlHandler = null,
302
- $pIsSandbox = false,
303
- $pBeforeExecutionFunction = null
304
- ) {
305
- if ( ! FS_SDK__HAS_CURL ) {
306
- self::ThrowNoCurlException();
307
- }
308
-
309
- // Connectivity errors simulation.
310
- if ( FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE ) {
311
- self::ThrowCloudFlareDDoSException();
312
- } else if ( FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL ) {
313
- self::ThrowSquidAclException();
314
- }
315
-
316
- if ( ! $pCurlHandler ) {
317
- $pCurlHandler = curl_init();
318
- }
319
-
320
- $opts = array(
321
- CURLOPT_CONNECTTIMEOUT => 10,
322
- CURLOPT_RETURNTRANSFER => true,
323
- CURLOPT_TIMEOUT => 60,
324
- CURLOPT_USERAGENT => FS_SDK__USER_AGENT,
325
- CURLOPT_HTTPHEADER => array(),
326
- );
327
-
328
- if ( 'POST' === $pMethod || 'PUT' === $pMethod ) {
329
- if ( is_array( $pParams ) && 0 < count( $pParams ) ) {
330
- $opts[ CURLOPT_HTTPHEADER ][] = 'Content-Type: application/json';
331
- $opts[ CURLOPT_POST ] = count( $pParams );
332
- $opts[ CURLOPT_POSTFIELDS ] = json_encode( $pParams );
333
- }
334
-
335
- $opts[ CURLOPT_RETURNTRANSFER ] = true;
336
- }
337
-
338
- $request_url = self::GetUrl( $pCanonizedPath, $pIsSandbox );
339
-
340
- $opts[ CURLOPT_URL ] = $request_url;
341
- $opts[ CURLOPT_CUSTOMREQUEST ] = $pMethod;
342
-
343
- $resource = explode( '?', $pCanonizedPath );
344
-
345
- // disable the 'Expect: 100-continue' behaviour. This causes CURL to wait
346
- // for 2 seconds if the server does not support this header.
347
- $opts[ CURLOPT_HTTPHEADER ][] = 'Expect:';
348
-
349
- if ( 'https' === substr( strtolower( $request_url ), 0, 5 ) ) {
350
- $opts[ CURLOPT_SSL_VERIFYHOST ] = false;
351
- $opts[ CURLOPT_SSL_VERIFYPEER ] = false;
352
- }
353
-
354
- if ( false !== $pBeforeExecutionFunction &&
355
- is_callable( $pBeforeExecutionFunction )
356
- ) {
357
- $opts = call_user_func( $pBeforeExecutionFunction, $resource[0], $opts );
358
- }
359
-
360
- curl_setopt_array( $pCurlHandler, $opts );
361
- $result = self::ExecuteRequest( $pCurlHandler, $opts );
362
-
363
- /*if (curl_errno($ch) == 60) // CURLE_SSL_CACERT
364
- {
365
- self::errorLog('Invalid or no certificate authority found, using bundled information');
366
- curl_setopt($ch, CURLOPT_CAINFO,
367
- dirname(__FILE__) . '/fb_ca_chain_bundle.crt');
368
- $result = curl_exec($ch);
369
- }*/
370
-
371
- // With dual stacked DNS responses, it's possible for a server to
372
- // have IPv6 enabled but not have IPv6 connectivity. If this is
373
- // the case, curl will try IPv4 first and if that fails, then it will
374
- // fall back to IPv6 and the error EHOSTUNREACH is returned by the
375
- // operating system.
376
- if ( false === $result && empty( $opts[ CURLOPT_IPRESOLVE ] ) ) {
377
- $matches = array();
378
- $regex = '/Failed to connect to ([^:].*): Network is unreachable/';
379
- if ( preg_match( $regex, curl_error( $pCurlHandler ), $matches ) ) {
380
- if ( strlen( @inet_pton( $matches[1] ) ) === 16 ) {
381
- // self::errorLog('Invalid IPv6 configuration on server, Please disable or get native IPv6 on your server.');
382
- $opts[ CURLOPT_IPRESOLVE ] = CURL_IPRESOLVE_V4;
383
- curl_setopt( $pCurlHandler, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );
384
- $result = self::ExecuteRequest( $pCurlHandler, $opts );
385
- }
386
- }
387
- }
388
-
389
- if ( $result === false ) {
390
- self::ThrowCurlException( $pCurlHandler );
391
- }
392
-
393
- curl_close( $pCurlHandler );
394
-
395
- if ( empty( $result ) ) {
396
- return null;
397
- }
398
-
399
- $decoded = json_decode( $result );
400
-
401
- if ( is_null( $decoded ) ) {
402
- if ( preg_match( '/Please turn JavaScript on/i', $result ) &&
403
- preg_match( '/text\/javascript/', $result )
404
- ) {
405
- self::ThrowCloudFlareDDoSException( $result );
406
- } else if ( preg_match( '/Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect./', $result ) &&
407
- preg_match( '/squid/', $result )
408
- ) {
409
- self::ThrowSquidAclException( $result );
410
- } else {
411
- $decoded = (object) array(
412
- 'error' => (object) array(
413
- 'type' => 'Unknown',
414
- 'message' => $result,
415
- 'code' => 'unknown',
416
- 'http' => 402
417
- )
418
- );
419
- }
420
- }
421
-
422
- return $decoded;
423
- }
424
-
425
-
426
- /**
427
- * Makes an HTTP request. This method can be overridden by subclasses if
428
- * developers want to do fancier things or use something other than curl to
429
- * make the request.
430
- *
431
- * @param string $pCanonizedPath The URL to make the request to
432
- * @param string $pMethod HTTP method
433
- * @param array $pParams The parameters to use for the POST body
434
- * @param null|resource $pCurlHandler Initialized curl handle
435
- *
436
- * @return object[]|object|null
437
- *
438
- * @throws Freemius_Exception
439
- */
440
- public function MakeRequest(
441
- $pCanonizedPath,
442
- $pMethod = 'GET',
443
- $pParams = array(),
444
- $pCurlHandler = null
445
- ) {
446
- $resource = explode( '?', $pCanonizedPath );
447
-
448
- // Only sign request if not ping.json connectivity test.
449
- $sign_request = ( '/v1/ping.json' !== strtolower( substr( $resource[0], - strlen( '/v1/ping.json' ) ) ) );
450
-
451
- return self::MakeStaticRequest(
452
- $pCanonizedPath,
453
- $pMethod,
454
- $pParams,
455
- $pCurlHandler,
456
- $this->_isSandbox,
457
- $sign_request ? array( &$this, 'SignRequest' ) : null
458
- );
459
- }
460
-
461
- #region Connectivity Test ------------------------------------------------------
462
-
463
- /**
464
- * If successful connectivity to the API endpoint using ping.json endpoint.
465
- *
466
- * - OR -
467
- *
468
- * Validate if ping result object is valid.
469
- *
470
- * @param mixed $pPong
471
- *
472
- * @return bool
473
- */
474
- public static function Test( $pPong = null ) {
475
- $pong = is_null( $pPong ) ?
476
- self::Ping() :
477
- $pPong;
478
-
479
- return (
480
- is_object( $pong ) &&
481
- isset( $pong->api ) &&
482
- 'pong' === $pong->api
483
- );
484
- }
485
-
486
- /**
487
- * Ping API to test connectivity.
488
- *
489
- * @return object
490
- */
491
- public static function Ping() {
492
- try {
493
- $result = self::MakeStaticRequest( '/v' . FS_API__VERSION . '/ping.json' );
494
- } catch ( Freemius_Exception $e ) {
495
- // Map to error object.
496
- $result = (object) $e->getResult();
497
- } catch ( Exception $e ) {
498
- // Map to error object.
499
- $result = (object) array(
500
- 'error' => array(
501
- 'type' => 'Unknown',
502
- 'message' => $e->getMessage() . ' (' . $e->getFile() . ': ' . $e->getLine() . ')',
503
- 'code' => 'unknown',
504
- 'http' => 402
505
- )
506
- );
507
- }
508
-
509
- return $result;
510
- }
511
-
512
- #endregion Connectivity Test ------------------------------------------------------
513
-
514
- #region Connectivity Exceptions ------------------------------------------------------
515
-
516
- /**
517
- * @param resource $pCurlHandler
518
- *
519
- * @throws Freemius_Exception
520
- */
521
- private static function ThrowCurlException( $pCurlHandler ) {
522
- $e = new Freemius_Exception( array(
523
- 'error' => array(
524
- 'code' => curl_errno( $pCurlHandler ),
525
- 'message' => curl_error( $pCurlHandler ),
526
- 'type' => 'CurlException',
527
- ),
528
- ) );
529
-
530
- curl_close( $pCurlHandler );
531
- throw $e;
532
- }
533
-
534
- /**
535
- * @param string $pResult
536
- *
537
- * @throws Freemius_Exception
538
- */
539
- private static function ThrowNoCurlException( $pResult = '' ) {
540
- throw new Freemius_Exception( array(
541
- 'error' => (object) array(
542
- 'type' => 'cUrlMissing',
543
- 'message' => $pResult,
544
- 'code' => 'curl_missing',
545
- 'http' => 402
546
- )
547
- ) );
548
- }
549
-
550
- /**
551
- * @param string $pResult
552
- *
553
- * @throws Freemius_Exception
554
- */
555
- private static function ThrowCloudFlareDDoSException( $pResult = '' ) {
556
- throw new Freemius_Exception( array(
557
- 'error' => (object) array(
558
- 'type' => 'CloudFlareDDoSProtection',
559
- 'message' => $pResult,
560
- 'code' => 'cloudflare_ddos_protection',
561
- 'http' => 402
562
- )
563
- ) );
564
- }
565
-
566
- /**
567
- * @param string $pResult
568
- *
569
- * @throws Freemius_Exception
570
- */
571
- private static function ThrowSquidAclException( $pResult = '' ) {
572
- throw new Freemius_Exception( array(
573
- 'error' => (object) array(
574
- 'type' => 'SquidCacheBlock',
575
- 'message' => $pResult,
576
- 'code' => 'squid_cache_block',
577
- 'http' => 402
578
- )
579
- ) );
580
- }
581
-
582
- #endregion Connectivity Exceptions ------------------------------------------------------
583
  }
1
+ <?php
2
+ /**
3
+ * Copyright 2014 Freemius, Inc.
4
+ *
5
+ * Licensed under the GPL v2 (the "License"); you may
6
+ * not use this file except in compliance with the License. You may obtain
7
+ * a copy of the License at
8
+ *
9
+ * http://choosealicense.com/licenses/gpl-v2/
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations
15
+ * under the License.
16
+ */
17
+
18
+ require_once( dirname( __FILE__ ) . '/FreemiusBase.php' );
19
+
20
+ if ( ! defined( 'FS_SDK__USER_AGENT' ) ) {
21
+ define( 'FS_SDK__USER_AGENT', 'fs-php-' . Freemius_Api_Base::VERSION );
22
+ }
23
+
24
+ if ( ! defined( 'FS_SDK__SIMULATE_NO_CURL' ) ) {
25
+ define( 'FS_SDK__SIMULATE_NO_CURL', false );
26
+ }
27
+
28
+ if ( ! defined( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE' ) ) {
29
+ define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', false );
30
+ }
31
+
32
+ if ( ! defined( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL' ) ) {
33
+ define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', false );
34
+ }
35
+
36
+ if ( ! defined( 'FS_SDK__HAS_CURL' ) ) {
37
+ define( 'FS_SDK__HAS_CURL', ! FS_SDK__SIMULATE_NO_CURL && function_exists( 'curl_version' ) );
38
+ }
39
+
40
+ if ( ! FS_SDK__HAS_CURL ) {
41
+ $curl_version = array( 'version' => '7.0.0' );
42
+ } else {
43
+ $curl_version = curl_version();
44
+ }
45
+
46
+ if ( ! defined( 'FS_API__PROTOCOL' ) ) {
47
+ define( 'FS_API__PROTOCOL', version_compare( $curl_version['version'], '7.37', '>=' ) ? 'https' : 'http' );
48
+ }
49
+
50
+ if ( ! defined( 'FS_API__LOGGER_ON' ) ) {
51
+ define( 'FS_API__LOGGER_ON', false );
52
+ }
53
+
54
+ if ( ! defined( 'FS_API__ADDRESS' ) ) {
55
+ define( 'FS_API__ADDRESS', '://api.freemius.com' );
56
+ }
57
+ if ( ! defined( 'FS_API__SANDBOX_ADDRESS' ) ) {
58
+ define( 'FS_API__SANDBOX_ADDRESS', '://sandbox-api.freemius.com' );
59
+ }
60
+
61
+ if ( class_exists( 'Freemius_Api' ) ) {
62
+ return;
63
+ }
64
+
65
+ class Freemius_Api extends Freemius_Api_Base {
66
+ private static $_logger = array();
67
+
68
+ /**
69
+ * @param string $pScope 'app', 'developer', 'user' or 'install'.
70
+ * @param number $pID Element's id.
71
+ * @param string $pPublic Public key.
72
+ * @param string|bool $pSecret Element's secret key.
73
+ * @param bool $pSandbox Whether or not to run API in sandbox mode.
74
+ */
75
+ public function __construct( $pScope, $pID, $pPublic, $pSecret = false, $pSandbox = false ) {
76
+ // If secret key not provided, use public key encryption.
77
+ if ( is_bool( $pSecret ) ) {
78
+ $pSecret = $pPublic;
79
+ }
80
+
81
+ parent::Init( $pScope, $pID, $pPublic, $pSecret, $pSandbox );
82
+ }
83
+
84
+ public static function GetUrl( $pCanonizedPath = '', $pIsSandbox = false ) {
85
+ $address = ( $pIsSandbox ? FS_API__SANDBOX_ADDRESS : FS_API__ADDRESS );
86
+
87
+ if ( ':' === $address[0] ) {
88
+ $address = self::$_protocol . $address;
89
+ }
90
+
91
+ return $address . $pCanonizedPath;
92
+ }
93
+
94
+ #region Servers Clock Diff ------------------------------------------------------
95
+
96
+ /**
97
+ * @var int Clock diff in seconds between current server to API server.
98
+ */
99
+ private static $_clock_diff = 0;
100
+
101
+ /**
102
+ * Set clock diff for all API calls.
103
+ *
104
+ * @since 1.0.3
105
+ *
106
+ * @param $pSeconds
107
+ */
108
+ public static function SetClockDiff( $pSeconds ) {
109
+ self::$_clock_diff = $pSeconds;
110
+ }
111
+
112
+ /**
113
+ * Find clock diff between current server to API server.
114
+ *
115
+ * @since 1.0.2
116
+ * @return int Clock diff in seconds.
117
+ */
118
+ public static function FindClockDiff() {
119
+ $time = time();
120
+ $pong = self::Ping();
121
+
122
+ return ( $time - strtotime( $pong->timestamp ) );
123
+ }
124
+
125
+ #endregion Servers Clock Diff ------------------------------------------------------
126
+
127
+ /**
128
+ * @var string http or https
129
+ */
130
+ private static $_protocol = FS_API__PROTOCOL;
131
+
132
+ /**
133
+ * Set API connection protocol.
134
+ *
135
+ * @since 1.0.4
136
+ */
137
+ public static function SetHttp() {
138
+ self::$_protocol = 'http';
139
+ }
140
+
141
+ /**
142
+ * @since 1.0.4
143
+ *
144
+ * @return bool
145
+ */
146
+ public static function IsHttps() {
147
+ return ( 'https' === self::$_protocol );
148
+ }
149
+
150
+ /**
151
+ * Sign request with the following HTTP headers:
152
+ * Content-MD5: MD5(HTTP Request body)
153
+ * Date: Current date (i.e Sat, 14 Feb 2015 20:24:46 +0000)
154
+ * Authorization: FS {scope_entity_id}:{scope_entity_public_key}:base64encode(sha256(string_to_sign,
155
+ * {scope_entity_secret_key}))
156
+ *
157
+ * @param string $pResourceUrl
158
+ * @param array $pCurlOptions
159
+ *
160
+ * @return array
161
+ */
162
+ function SignRequest( $pResourceUrl, $pCurlOptions ) {
163
+ $eol = "\n";
164
+ $content_md5 = '';
165
+ $now = ( time() - self::$_clock_diff );
166
+ $date = date( 'r', $now );
167
+ $content_type = '';
168
+
169
+ if ( isset( $pCurlOptions[ CURLOPT_POST ] ) && 0 < $pCurlOptions[ CURLOPT_POST ] ) {
170
+ $content_md5 = md5( $pCurlOptions[ CURLOPT_POSTFIELDS ] );
171
+ $pCurlOptions[ CURLOPT_HTTPHEADER ][] = 'Content-MD5: ' . $content_md5;
172
+ $content_type = 'application/json';
173
+ }
174
+
175
+ $pCurlOptions[ CURLOPT_HTTPHEADER ][] = 'Date: ' . $date;
176
+
177
+ $string_to_sign = implode( $eol, array(
178
+ $pCurlOptions[ CURLOPT_CUSTOMREQUEST ],
179
+ $content_md5,
180
+ $content_type,
181
+ $date,
182
+ $pResourceUrl
183
+ ) );
184
+
185
+ // If secret and public keys are identical, it means that
186
+ // the signature uses public key hash encoding.
187
+ $auth_type = ( $this->_secret !== $this->_public ) ? 'FS' : 'FSP';
188
+
189
+ // Add authorization header.
190
+ $pCurlOptions[ CURLOPT_HTTPHEADER ][] = 'Authorization: ' .
191
+ $auth_type . ' ' .
192
+ $this->_id . ':' .
193
+ $this->_public . ':' .
194
+ self::Base64UrlEncode(
195
+ hash_hmac( 'sha256', $string_to_sign, $this->_secret )
196
+ );
197
+
198
+ return $pCurlOptions;
199
+ }
200
+
201
+ /**
202
+ * Get API request URL signed via query string.
203
+ *
204
+ * @param string $pPath
205
+ *
206
+ * @throws Freemius_Exception
207
+ *
208
+ * @return string
209
+ */
210
+ function GetSignedUrl( $pPath ) {
211
+ $resource = explode( '?', $this->CanonizePath( $pPath ) );
212
+ $pResourceUrl = $resource[0];
213
+
214
+ $eol = "\n";
215
+ $content_md5 = '';
216
+ $content_type = '';
217
+ $now = ( time() - self::$_clock_diff );
218
+ $date = date( 'r', $now );
219
+
220
+ $string_to_sign = implode( $eol, array(
221
+ 'GET',
222
+ $content_md5,
223
+ $content_type,
224
+ $date,
225
+ $pResourceUrl
226
+ ) );
227
+
228
+ // If secret and public keys are identical, it means that
229
+ // the signature uses public key hash encoding.
230
+ $auth_type = ( $this->_secret !== $this->_public ) ? 'FS' : 'FSP';
231
+
232
+ return Freemius_Api::GetUrl(
233
+ $pResourceUrl . '?' .
234
+ ( 1 < count( $resource ) && ! empty( $resource[1] ) ? $resource[1] . '&' : '' ) .
235
+ http_build_query( array(
236
+ 'auth_date' => $date,
237
+ 'authorization' => $auth_type . ' ' . $this->_id . ':' .
238
+ $this->_public . ':' .
239
+ self::Base64UrlEncode( hash_hmac(
240
+ 'sha256', $string_to_sign, $this->_secret
241
+ ) )
242
+ ) ), $this->_isSandbox );
243
+ }
244
+
245
+ /**
246
+ * @param resource $pCurlHandler
247
+ * @param array $pCurlOptions
248
+ *
249
+ * @return mixed
250
+ */
251
+ private static function ExecuteRequest( &$pCurlHandler, &$pCurlOptions ) {
252
+ $start = microtime( true );
253
+
254
+ $result = curl_exec( $pCurlHandler );
255
+
256
+ if ( FS_API__LOGGER_ON ) {
257
+ $end = microtime( true );
258
+
259
+ $has_body = ( isset( $pCurlOptions[ CURLOPT_POST ] ) && 0 < $pCurlOptions[ CURLOPT_POST ] );
260
+
261
+ self::$_logger[] = array(
262
+ 'id' => count( self::$_logger ),
263
+ 'start' => $start,
264
+ 'end' => $end,
265
+ 'total' => ( $end - $start ),
266
+ 'method' => $pCurlOptions[ CURLOPT_CUSTOMREQUEST ],
267
+ 'path' => $pCurlOptions[ CURLOPT_URL ],
268
+ 'body' => $has_body ? $pCurlOptions[ CURLOPT_POSTFIELDS ] : null,
269
+ 'result' => $result,
270
+ 'code' => curl_getinfo( $pCurlHandler, CURLINFO_HTTP_CODE ),
271
+ 'backtrace' => debug_backtrace(),
272
+ );
273
+ }
274
+
275
+ return $result;
276
+ }
277
+
278
+ /**
279
+ * @return array
280
+ */
281
+ static function GetLogger() {
282
+ return self::$_logger;
283
+ }
284
+
285
+ /**
286
+ * @param string $pCanonizedPath
287
+ * @param string $pMethod
288
+ * @param array $pParams
289
+ * @param null|resource $pCurlHandler
290
+ * @param bool $pIsSandbox
291
+ * @param null|callable $pBeforeExecutionFunction
292
+ *
293
+ * @return object[]|object|null
294
+ *
295
+ * @throws \Freemius_Exception
296
+ */
297
+ private static function MakeStaticRequest(
298
+ $pCanonizedPath,
299
+ $pMethod = 'GET',
300
+ $pParams = array(),
301
+ $pCurlHandler = null,
302
+ $pIsSandbox = false,
303
+ $pBeforeExecutionFunction = null
304
+ ) {
305
+ if ( ! FS_SDK__HAS_CURL ) {
306
+ self::ThrowNoCurlException();
307
+ }
308
+
309
+ // Connectivity errors simulation.
310
+ if ( FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE ) {
311
+ self::ThrowCloudFlareDDoSException();
312
+ } else if ( FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL ) {
313
+ self::ThrowSquidAclException();
314
+ }
315
+
316
+ if ( ! $pCurlHandler ) {
317
+ $pCurlHandler = curl_init();
318
+ }
319
+
320
+ $opts = array(
321
+ CURLOPT_CONNECTTIMEOUT => 10,
322
+ CURLOPT_RETURNTRANSFER => true,
323
+ CURLOPT_TIMEOUT => 60,
324
+ CURLOPT_USERAGENT => FS_SDK__USER_AGENT,
325
+ CURLOPT_HTTPHEADER => array(),
326
+ );
327
+
328
+ if ( 'POST' === $pMethod || 'PUT' === $pMethod ) {
329
+ if ( is_array( $pParams ) && 0 < count( $pParams ) ) {
330
+ $opts[ CURLOPT_HTTPHEADER ][] = 'Content-Type: application/json';
331
+ $opts[ CURLOPT_POST ] = count( $pParams );
332
+ $opts[ CURLOPT_POSTFIELDS ] = json_encode( $pParams );
333
+ }
334
+
335
+ $opts[ CURLOPT_RETURNTRANSFER ] = true;
336
+ }
337
+
338
+ $request_url = self::GetUrl( $pCanonizedPath, $pIsSandbox );
339
+
340
+ $opts[ CURLOPT_URL ] = $request_url;
341
+ $opts[ CURLOPT_CUSTOMREQUEST ] = $pMethod;
342
+
343
+ $resource = explode( '?', $pCanonizedPath );
344
+
345
+ // disable the 'Expect: 100-continue' behaviour. This causes CURL to wait
346
+ // for 2 seconds if the server does not support this header.
347
+ $opts[ CURLOPT_HTTPHEADER ][] = 'Expect:';
348
+
349
+ if ( 'https' === substr( strtolower( $request_url ), 0, 5 ) ) {
350
+ $opts[ CURLOPT_SSL_VERIFYHOST ] = false;
351
+ $opts[ CURLOPT_SSL_VERIFYPEER ] = false;
352
+ }
353
+
354
+ if ( false !== $pBeforeExecutionFunction &&
355
+ is_callable( $pBeforeExecutionFunction )
356
+ ) {
357
+ $opts = call_user_func( $pBeforeExecutionFunction, $resource[0], $opts );
358
+ }
359
+
360
+ curl_setopt_array( $pCurlHandler, $opts );
361
+ $result = self::ExecuteRequest( $pCurlHandler, $opts );
362
+
363
+ /*if (curl_errno($ch) == 60) // CURLE_SSL_CACERT
364
+ {
365
+ self::errorLog('Invalid or no certificate authority found, using bundled information');
366
+ curl_setopt($ch, CURLOPT_CAINFO,
367
+ dirname(__FILE__) . '/fb_ca_chain_bundle.crt');
368
+ $result = curl_exec($ch);
369
+ }*/
370
+
371
+ // With dual stacked DNS responses, it's possible for a server to
372
+ // have IPv6 enabled but not have IPv6 connectivity. If this is
373
+ // the case, curl will try IPv4 first and if that fails, then it will
374
+ // fall back to IPv6 and the error EHOSTUNREACH is returned by the
375
+ // operating system.
376
+ if ( false === $result && empty( $opts[ CURLOPT_IPRESOLVE ] ) ) {
377
+ $matches = array();
378
+ $regex = '/Failed to connect to ([^:].*): Network is unreachable/';
379
+ if ( preg_match( $regex, curl_error( $pCurlHandler ), $matches ) ) {
380
+ if ( strlen( @inet_pton( $matches[1] ) ) === 16 ) {
381
+ // self::errorLog('Invalid IPv6 configuration on server, Please disable or get native IPv6 on your server.');
382
+ $opts[ CURLOPT_IPRESOLVE ] = CURL_IPRESOLVE_V4;
383
+ curl_setopt( $pCurlHandler, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );
384
+ $result = self::ExecuteRequest( $pCurlHandler, $opts );
385
+ }
386
+ }
387
+ }
388
+
389
+ if ( $result === false ) {
390
+ self::ThrowCurlException( $pCurlHandler );
391
+ }
392
+
393
+ curl_close( $pCurlHandler );
394
+
395
+ if ( empty( $result ) ) {
396
+ return null;
397
+ }
398
+
399
+ $decoded = json_decode( $result );
400
+
401
+ if ( is_null( $decoded ) ) {
402
+ if ( preg_match( '/Please turn JavaScript on/i', $result ) &&
403
+ preg_match( '/text\/javascript/', $result )
404
+ ) {
405
+ self::ThrowCloudFlareDDoSException( $result );
406
+ } else if ( preg_match( '/Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect./', $result ) &&
407
+ preg_match( '/squid/', $result )
408
+ ) {
409
+ self::ThrowSquidAclException( $result );
410
+ } else {
411
+ $decoded = (object) array(
412
+ 'error' => (object) array(
413
+ 'type' => 'Unknown',
414
+ 'message' => $result,
415
+ 'code' => 'unknown',
416
+ 'http' => 402
417
+ )
418
+ );
419
+ }
420
+ }
421
+
422
+ return $decoded;
423
+ }
424
+
425
+
426
+ /**
427
+ * Makes an HTTP request. This method can be overridden by subclasses if
428
+ * developers want to do fancier things or use something other than curl to
429
+ * make the request.
430
+ *
431
+ * @param string $pCanonizedPath The URL to make the request to
432
+ * @param string $pMethod HTTP method
433
+ * @param array $pParams The parameters to use for the POST body
434
+ * @param null|resource $pCurlHandler Initialized curl handle
435
+ *
436
+ * @return object[]|object|null
437
+ *
438
+ * @throws Freemius_Exception
439
+ */
440
+ public function MakeRequest(
441
+ $pCanonizedPath,
442
+ $pMethod = 'GET',
443
+ $pParams = array(),
444
+ $pCurlHandler = null
445
+ ) {
446
+ $resource = explode( '?', $pCanonizedPath );
447
+
448
+ // Only sign request if not ping.json connectivity test.
449
+ $sign_request = ( '/v1/ping.json' !== strtolower( substr( $resource[0], - strlen( '/v1/ping.json' ) ) ) );
450
+
451
+ return self::MakeStaticRequest(
452
+ $pCanonizedPath,
453
+ $pMethod,
454
+ $pParams,
455
+ $pCurlHandler,
456
+ $this->_isSandbox,
457
+ $sign_request ? array( &$this, 'SignRequest' ) : null
458
+ );
459
+ }
460
+
461
+ #region Connectivity Test ------------------------------------------------------
462
+
463
+ /**
464
+ * If successful connectivity to the API endpoint using ping.json endpoint.
465
+ *
466
+ * - OR -
467
+ *
468
+ * Validate if ping result object is valid.
469
+ *
470
+ * @param mixed $pPong
471
+ *
472
+ * @return bool
473
+ */
474
+ public static function Test( $pPong = null ) {
475
+ $pong = is_null( $pPong ) ?
476
+ self::Ping() :
477
+ $pPong;
478
+
479
+ return (
480
+ is_object( $pong ) &&
481
+ isset( $pong->api ) &&
482
+ 'pong' === $pong->api
483
+ );
484
+ }
485
+
486
+ /**
487
+ * Ping API to test connectivity.
488
+ *
489
+ * @return object
490
+ */
491
+ public static function Ping() {
492
+ try {
493
+ $result = self::MakeStaticRequest( '/v' . FS_API__VERSION . '/ping.json' );
494
+ } catch ( Freemius_Exception $e ) {
495
+ // Map to error object.
496
+ $result = (object) $e->getResult();
497
+ } catch ( Exception $e ) {
498
+ // Map to error object.
499
+ $result = (object) array(
500
+ 'error' => array(
501
+ 'type' => 'Unknown',
502
+ 'message' => $e->getMessage() . ' (' . $e->getFile() . ': ' . $e->getLine() . ')',
503
+ 'code' => 'unknown',
504
+ 'http' => 402
505
+ )
506
+ );
507
+ }
508
+
509
+ return $result;
510
+ }
511
+
512
+ #endregion Connectivity Test ------------------------------------------------------
513
+
514
+ #region Connectivity Exceptions ------------------------------------------------------
515
+
516
+ /**
517
+ * @param resource $pCurlHandler
518
+ *
519
+ * @throws Freemius_Exception
520
+ */
521
+ private static function ThrowCurlException( $pCurlHandler ) {
522
+ $e = new Freemius_Exception( array(
523
+ 'error' => array(
524
+ 'code' => curl_errno( $pCurlHandler ),
525
+ 'message' => curl_error( $pCurlHandler ),
526
+ 'type' => 'CurlException',
527
+ ),
528
+ ) );
529
+
530
+ curl_close( $pCurlHandler );
531
+ throw $e;
532
+ }
533
+
534
+ /**
535
+ * @param string $pResult
536
+ *
537
+ * @throws Freemius_Exception
538
+ */
539
+ private static function ThrowNoCurlException( $pResult = '' ) {
540
+ throw new Freemius_Exception( array(
541
+ 'error' => (object) array(
542
+ 'type' => 'cUrlMissing',
543
+ 'message' => $pResult,
544
+ 'code' => 'curl_missing',
545
+ 'http' => 402
546
+ )
547
+ ) );
548
+ }
549
+
550
+ /**
551
+ * @param string $pResult
552
+ *
553
+ * @throws Freemius_Exception
554
+ */
555
+ private static function ThrowCloudFlareDDoSException( $pResult = '' ) {
556
+ throw new Freemius_Exception( array(
557
+ 'error' => (object) array(
558
+ 'type' => 'CloudFlareDDoSProtection',
559
+ 'message' => $pResult,
560
+ 'code' => 'cloudflare_ddos_protection',
561
+ 'http' => 402
562
+ )
563
+ ) );
564
+ }
565
+
566
+ /**
567
+ * @param string $pResult
568
+ *
569
+ * @throws Freemius_Exception
570
+ */
571
+ private static function ThrowSquidAclException( $pResult = '' ) {
572
+ throw new Freemius_Exception( array(
573
+ 'error' => (object) array(
574
+ 'type' => 'SquidCacheBlock',
575
+ 'message' => $pResult,
576
+ 'code' => 'squid_cache_block',
577
+ 'http' => 402
578
+ )
579
+ ) );
580
+ }
581
+
582
+ #endregion Connectivity Exceptions ------------------------------------------------------
583
  }
includes/pum-sdk/freemius/includes/sdk/FreemiusBase.php CHANGED
@@ -1,188 +1,188 @@
1
- <?php
2
- /**
3
- * Copyright 2014 Freemius, Inc.
4
- *
5
- * Licensed under the GPL v2 (the "License"); you may
6
- * not use this file except in compliance with the License. You may obtain
7
- * a copy of the License at
8
- *
9
- * http://choosealicense.com/licenses/gpl-v2/
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations
15
- * under the License.
16
- */
17
-
18
- if ( ! defined( 'FS_API__VERSION' ) ) {
19
- define( 'FS_API__VERSION', '1' );
20
- }
21
- if ( ! defined( 'FS_SDK__PATH' ) ) {
22
- define( 'FS_SDK__PATH', dirname( __FILE__ ) );
23
- }
24
- if ( ! defined( 'FS_SDK__EXCEPTIONS_PATH' ) ) {
25
- define( 'FS_SDK__EXCEPTIONS_PATH', FS_SDK__PATH . '/Exceptions/' );
26
- }
27
-
28
- if ( ! function_exists( 'json_decode' ) ) {
29
- throw new Exception( 'Freemius needs the JSON PHP extension.' );
30
- }
31
-
32
- // Include all exception files.
33
- $exceptions = array(
34
- 'Exception',
35
- 'InvalidArgumentException',
36
- 'ArgumentNotExistException',
37
- 'EmptyArgumentException',
38
- 'OAuthException'
39
- );
40
-
41
- foreach ( $exceptions as $e ) {
42
- require_once FS_SDK__EXCEPTIONS_PATH . $e . '.php';
43
- }
44
-
45
- if ( class_exists( 'Freemius_Api_Base' ) ) {
46
- return;
47
- }
48
-
49
- abstract class Freemius_Api_Base {
50
- const VERSION = '1.0.4';
51
- const FORMAT = 'json';
52
-
53
- protected $_id;
54
- protected $_public;
55
- protected $_secret;
56
- protected $_scope;
57
- protected $_isSandbox;
58
-
59
- /**
60
- * @param string $pScope 'app', 'developer', 'plugin', 'user' or 'install'.
61
- * @param number $pID Element's id.
62
- * @param string $pPublic Public key.
63
- * @param string $pSecret Element's secret key.
64
- * @param bool $pIsSandbox Whether or not to run API in sandbox mode.
65
- */
66
- public function Init( $pScope, $pID, $pPublic, $pSecret, $pIsSandbox = false ) {
67
- $this->_id = $pID;
68
- $this->_public = $pPublic;
69
- $this->_secret = $pSecret;
70
- $this->_scope = $pScope;
71
- $this->_isSandbox = $pIsSandbox;
72
- }
73
-
74
- public function IsSandbox() {
75
- return $this->_isSandbox;
76
- }
77
-
78
- function CanonizePath( $pPath ) {
79
- $pPath = trim( $pPath, '/' );
80
- $query_pos = strpos( $pPath, '?' );
81
- $query = '';
82
-
83
- if ( false !== $query_pos ) {
84
- $query = substr( $pPath, $query_pos );
85
- $pPath = substr( $pPath, 0, $query_pos );
86
- }
87
-
88
- // Trim '.json' suffix.
89
- $format_length = strlen( '.' . self::FORMAT );
90
- $start = $format_length * ( - 1 ); //negative
91
- if ( substr( strtolower( $pPath ), $start ) === ( '.' . self::FORMAT ) ) {
92
- $pPath = substr( $pPath, 0, strlen( $pPath ) - $format_length );
93
- }
94
-
95
- switch ( $this->_scope ) {
96
- case 'app':
97
- $base = '/apps/' . $this->_id;
98
- break;
99
- case 'developer':
100
- $base = '/developers/' . $this->_id;
101
- break;
102
- case 'user':
103
- $base = '/users/' . $this->_id;
104
- break;
105
- case 'plugin':
106
- $base = '/plugins/' . $this->_id;
107
- break;
108
- case 'install':
109
- $base = '/installs/' . $this->_id;
110
- break;
111
- default:
112
- throw new Freemius_Exception( 'Scope not implemented.' );
113
- }
114
-
115
- return '/v' . FS_API__VERSION . $base .
116
- ( ! empty( $pPath ) ? '/' : '' ) . $pPath .
117
- ( ( false === strpos( $pPath, '.' ) ) ? '.' . self::FORMAT : '' ) . $query;
118
- }
119
-
120
- abstract function MakeRequest( $pCanonizedPath, $pMethod = 'GET', $pParams = array() );
121
-
122
- /**
123
- * @param string $pPath
124
- * @param string $pMethod
125
- * @param array $pParams
126
- *
127
- * @return object[]|object|null
128
- */
129
- private function _Api( $pPath, $pMethod = 'GET', $pParams = array() ) {
130
- $pMethod = strtoupper( $pMethod );
131
-
132
- try {
133
- $result = $this->MakeRequest( $pPath, $pMethod, $pParams );
134
- } catch ( Freemius_Exception $e ) {
135
- // Map to error object.
136
- $result = (object) $e->getResult();
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',
144
- 'http' => 402
145
- )
146
- );
147
- }
148
-
149
- return $result;
150
- }
151
-
152
- public function Api( $pPath, $pMethod = 'GET', $pParams = array() ) {
153
- return $this->_Api( $this->CanonizePath( $pPath ), $pMethod, $pParams );
154
- }
155
-
156
- /**
157
- * Base64 encoding that does not need to be urlencode()ed.
158
- * Exactly the same as base64_encode except it uses
159
- * - instead of +
160
- * _ instead of /
161
- * No padded =
162
- *
163
- * @param string $input base64UrlEncoded string
164
- *
165
- * @return string
166
- */
167
- protected static function Base64UrlDecode( $input ) {
168
- return base64_decode( strtr( $input, '-_', '+/' ) );
169
- }
170
-
171
- /**
172
- * Base64 encoding that does not need to be urlencode()ed.
173
- * Exactly the same as base64_encode except it uses
174
- * - instead of +
175
- * _ instead of /
176
- *
177
- * @param string $input string
178
- *
179
- * @return string base64Url encoded string
180
- */
181
- protected static function Base64UrlEncode( $input ) {
182
- $str = strtr( base64_encode( $input ), '+/', '-_' );
183
- $str = str_replace( '=', '', $str );
184
-
185
- return $str;
186
- }
187
-
188
- }
1
+ <?php
2
+ /**
3
+ * Copyright 2014 Freemius, Inc.
4
+ *
5
+ * Licensed under the GPL v2 (the "License"); you may
6
+ * not use this file except in compliance with the License. You may obtain
7
+ * a copy of the License at
8
+ *
9
+ * http://choosealicense.com/licenses/gpl-v2/
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations
15
+ * under the License.
16
+ */
17
+
18
+ if ( ! defined( 'FS_API__VERSION' ) ) {
19
+ define( 'FS_API__VERSION', '1' );
20
+ }
21
+ if ( ! defined( 'FS_SDK__PATH' ) ) {
22
+ define( 'FS_SDK__PATH', dirname( __FILE__ ) );
23
+ }
24
+ if ( ! defined( 'FS_SDK__EXCEPTIONS_PATH' ) ) {
25
+ define( 'FS_SDK__EXCEPTIONS_PATH', FS_SDK__PATH . '/Exceptions/' );
26
+ }
27
+
28
+ if ( ! function_exists( 'json_decode' ) ) {
29
+ throw new Exception( 'Freemius needs the JSON PHP extension.' );
30
+ }
31
+
32
+ // Include all exception files.
33
+ $exceptions = array(
34
+ 'Exception',
35
+ 'InvalidArgumentException',
36
+ 'ArgumentNotExistException',
37
+ 'EmptyArgumentException',
38
+ 'OAuthException'
39
+ );
40
+
41
+ foreach ( $exceptions as $e ) {
42
+ require_once FS_SDK__EXCEPTIONS_PATH . $e . '.php';
43
+ }
44
+
45
+ if ( class_exists( 'Freemius_Api_Base' ) ) {
46
+ return;
47
+ }
48
+
49
+ abstract class Freemius_Api_Base {
50
+ const VERSION = '1.0.4';
51
+ const FORMAT = 'json';
52
+
53
+ protected $_id;
54
+ protected $_public;
55
+ protected $_secret;
56
+ protected $_scope;
57
+ protected $_isSandbox;
58
+
59
+ /**
60
+ * @param string $pScope 'app', 'developer', 'plugin', 'user' or 'install'.
61
+ * @param number $pID Element's id.
62
+ * @param string $pPublic Public key.
63
+ * @param string $pSecret Element's secret key.
64
+ * @param bool $pIsSandbox Whether or not to run API in sandbox mode.
65
+ */
66
+ public function Init( $pScope, $pID, $pPublic, $pSecret, $pIsSandbox = false ) {
67
+ $this->_id = $pID;
68
+ $this->_public = $pPublic;
69
+ $this->_secret = $pSecret;
70
+ $this->_scope = $pScope;
71
+ $this->_isSandbox = $pIsSandbox;
72
+ }
73
+
74
+ public function IsSandbox() {
75
+ return $this->_isSandbox;
76
+ }
77
+
78
+ function CanonizePath( $pPath ) {
79
+ $pPath = trim( $pPath, '/' );
80
+ $query_pos = strpos( $pPath, '?' );
81
+ $query = '';
82
+
83
+ if ( false !== $query_pos ) {
84
+ $query = substr( $pPath, $query_pos );
85
+ $pPath = substr( $pPath, 0, $query_pos );
86
+ }
87
+
88
+ // Trim '.json' suffix.
89
+ $format_length = strlen( '.' . self::FORMAT );
90
+ $start = $format_length * ( - 1 ); //negative
91
+ if ( substr( strtolower( $pPath ), $start ) === ( '.' . self::FORMAT ) ) {
92
+ $pPath = substr( $pPath, 0, strlen( $pPath ) - $format_length );
93
+ }
94
+
95
+ switch ( $this->_scope ) {
96
+ case 'app':
97
+ $base = '/apps/' . $this->_id;
98
+ break;
99
+ case 'developer':
100
+ $base = '/developers/' . $this->_id;
101
+ break;
102
+ case 'user':
103
+ $base = '/users/' . $this->_id;
104
+ break;
105
+ case 'plugin':
106
+ $base = '/plugins/' . $this->_id;
107
+ break;
108
+ case 'install':
109
+ $base = '/installs/' . $this->_id;
110
+ break;
111
+ default:
112
+ throw new Freemius_Exception( 'Scope not implemented.' );
113
+ }
114
+
115
+ return '/v' . FS_API__VERSION . $base .
116
+ ( ! empty( $pPath ) ? '/' : '' ) . $pPath .
117
+ ( ( false === strpos( $pPath, '.' ) ) ? '.' . self::FORMAT : '' ) . $query;
118
+ }
119
+
120
+ abstract function MakeRequest( $pCanonizedPath, $pMethod = 'GET', $pParams = array() );
121
+
122
+ /**
123
+ * @param string $pPath
124
+ * @param string $pMethod
125
+ * @param array $pParams
126
+ *
127
+ * @return object[]|object|null
128
+ */
129
+ private function _Api( $pPath, $pMethod = 'GET', $pParams = array() ) {
130
+ $pMethod = strtoupper( $pMethod );
131
+
132
+ try {
133
+ $result = $this->MakeRequest( $pPath, $pMethod, $pParams );
134
+ } catch ( Freemius_Exception $e ) {
135
+ // Map to error object.
136
+ $result = (object) $e->getResult();
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',
144
+ 'http' => 402
145
+ )
146
+ );
147
+ }
148
+
149
+ return $result;
150
+ }
151
+
152
+ public function Api( $pPath, $pMethod = 'GET', $pParams = array() ) {
153
+ return $this->_Api( $this->CanonizePath( $pPath ), $pMethod, $pParams );
154
+ }
155
+
156
+ /**
157
+ * Base64 encoding that does not need to be urlencode()ed.
158
+ * Exactly the same as base64_encode except it uses
159
+ * - instead of +
160
+ * _ instead of /
161
+ * No padded =
162
+ *
163
+ * @param string $input base64UrlEncoded string
164
+ *
165
+ * @return string
166
+ */
167
+ protected static function Base64UrlDecode( $input ) {
168
+ return base64_decode( strtr( $input, '-_', '+/' ) );
169
+ }
170
+
171
+ /**
172
+ * Base64 encoding that does not need to be urlencode()ed.
173
+ * Exactly the same as base64_encode except it uses
174
+ * - instead of +
175
+ * _ instead of /
176
+ *
177
+ * @param string $input string
178
+ *
179
+ * @return string base64Url encoded string
180
+ */
181
+ protected static function Base64UrlEncode( $input ) {
182
+ $str = strtr( base64_encode( $input ), '+/', '-_' );
183
+ $str = str_replace( '=', '', $str );
184
+
185
+ return $str;
186
+ }
187
+
188
+ }
includes/pum-sdk/freemius/start.php CHANGED
@@ -1,308 +1,308 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
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 = '1.2.1.5';
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
- $this_sdk_relative_path = plugin_basename( dirname( __FILE__ ) );
35
-
36
- if ( ! isset( $fs_active_plugins ) ) {
37
- // Require SDK essentials.
38
- require_once dirname( __FILE__ ) . '/includes/fs-essential-functions.php';
39
-
40
- // Load all Freemius powered active plugins.
41
- $fs_active_plugins = get_option( 'fs_active_plugins', new stdClass() );
42
-
43
- if ( ! isset( $fs_active_plugins->plugins ) ) {
44
- $fs_active_plugins->plugins = array();
45
- }
46
- }
47
-
48
- if ( ! function_exists( 'fs_find_direct_caller_plugin_file' ) ) {
49
- require_once dirname( __FILE__ ) . '/includes/supplements/fs-essential-functions-1.1.7.1.php';
50
- }
51
-
52
- // Update current SDK info based on the SDK path.
53
- if ( ! isset( $fs_active_plugins->plugins[ $this_sdk_relative_path ] ) ||
54
- $this_sdk_version != $fs_active_plugins->plugins[ $this_sdk_relative_path ]->version
55
- ) {
56
- $fs_active_plugins->plugins[ $this_sdk_relative_path ] = (object) array(
57
- 'version' => $this_sdk_version,
58
- 'timestamp' => time(),
59
- 'plugin_path' => plugin_basename( fs_find_direct_caller_plugin_file( __FILE__ ) ),
60
- );
61
- }
62
-
63
- $is_current_sdk_newest = isset( $fs_active_plugins->newest ) && ( $this_sdk_relative_path == $fs_active_plugins->newest->sdk_path );
64
-
65
- if ( ! isset( $fs_active_plugins->newest ) ) {
66
- /**
67
- * This will be executed only once, for the first time a Freemius powered plugin is activated.
68
- */
69
- fs_update_sdk_newest_version( $this_sdk_relative_path, $fs_active_plugins->plugins[ $this_sdk_relative_path ]->plugin_path );
70
-
71
- $is_current_sdk_newest = true;
72
- } else if ( version_compare( $fs_active_plugins->newest->version, $this_sdk_version, '<' ) ) {
73
- /**
74
- * Current SDK is newer than the newest stored SDK.
75
- */
76
- fs_update_sdk_newest_version( $this_sdk_relative_path, $fs_active_plugins->plugins[ $this_sdk_relative_path ]->plugin_path );
77
-
78
- if ( class_exists( 'Freemius' ) ) {
79
- // Older SDK version was already loaded.
80
-
81
- if ( ! $fs_active_plugins->newest->in_activation ) {
82
- // Re-order plugins to load this plugin first.
83
- fs_newest_sdk_plugin_first();
84
- }
85
-
86
- // Refresh page.
87
- fs_redirect( $_SERVER['REQUEST_URI'] );
88
- }
89
- } else {
90
- if ( ! function_exists( 'get_plugins' ) ) {
91
- require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
92
- }
93
-
94
- $is_newest_sdk_plugin_activate = is_plugin_active( $fs_active_plugins->newest->plugin_path );
95
-
96
- if ( $is_current_sdk_newest &&
97
- ! $is_newest_sdk_plugin_activate &&
98
- ! $fs_active_plugins->newest->in_activation
99
- ) {
100
- // If current SDK is the newest and the plugin is NOT active, it means
101
- // that the current plugin in activation mode.
102
- $fs_active_plugins->newest->in_activation = true;
103
- update_option( 'fs_active_plugins', $fs_active_plugins );
104
- }
105
-
106
- $is_newest_sdk_path_valid = ( $is_newest_sdk_plugin_activate || $fs_active_plugins->newest->in_activation ) && file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $this_sdk_relative_path . '/start.php' ) );
107
-
108
- if ( ! $is_newest_sdk_path_valid && ! $is_current_sdk_newest ) {
109
- // Plugin with newest SDK is no longer active, or SDK was moved to a different location.
110
- unset( $fs_active_plugins->plugins[ $fs_active_plugins->newest->sdk_path ] );
111
- }
112
-
113
- if ( ! ( $is_newest_sdk_plugin_activate || $fs_active_plugins->newest->in_activation ) ||
114
- ! $is_newest_sdk_path_valid ||
115
- // Is newest SDK downgraded.
116
- ( $this_sdk_relative_path == $fs_active_plugins->newest->sdk_path &&
117
- version_compare( $fs_active_plugins->newest->version, $this_sdk_version, '>' ) )
118
- ) {
119
- /**
120
- * Plugin with newest SDK is no longer active.
121
- * OR
122
- * The newest SDK was in the current plugin. BUT, seems like the version of
123
- * the SDK was downgraded to a lower SDK.
124
- */
125
- // Find the active plugin with the newest SDK version and update the newest reference.
126
- fs_fallback_to_newest_active_sdk();
127
- } else {
128
- if ( $is_newest_sdk_plugin_activate &&
129
- $this_sdk_relative_path == $fs_active_plugins->newest->sdk_path &&
130
- ( $fs_active_plugins->newest->in_activation ||
131
- ( class_exists( 'Freemius' ) && ( ! defined( 'WP_FS__SDK_VERSION' ) || version_compare( WP_FS__SDK_VERSION, $this_sdk_version, '<' ) ) )
132
- )
133
-
134
- ) {
135
- if ( $fs_active_plugins->newest->in_activation ) {
136
- // Plugin no more in activation.
137
- $fs_active_plugins->newest->in_activation = false;
138
- update_option( 'fs_active_plugins', $fs_active_plugins );
139
- }
140
-
141
- // Reorder plugins to load plugin with newest SDK first.
142
- if ( fs_newest_sdk_plugin_first() ) {
143
- // Refresh page after re-order to make sure activated plugin loads newest SDK.
144
- if ( class_exists( 'Freemius' ) ) {
145
- fs_redirect( $_SERVER['REQUEST_URI'] );
146
- }
147
- }
148
- }
149
- }
150
- }
151
-
152
- if ( class_exists( 'Freemius' ) ) {
153
- // SDK was already loaded.
154
- return;
155
- }
156
-
157
- if ( version_compare( $this_sdk_version, $fs_active_plugins->newest->version, '<' ) ) {
158
- $newest_sdk_starter = fs_normalize_path( WP_PLUGIN_DIR . '/' . $fs_active_plugins->newest->sdk_path . '/start.php' );
159
-
160
- if ( file_exists( $newest_sdk_starter ) ) {
161
- // Reorder plugins to load plugin with newest SDK first.
162
- fs_newest_sdk_plugin_first();
163
-
164
- // There's a newer SDK version, load it instead of the current one!
165
- require_once $newest_sdk_starter;
166
-
167
- return;
168
- }
169
- }
170
-
171
- #endregion SDK Selection Logic --------------------------------------------------------------------
172
-
173
- #region Hooks & Filters Collection --------------------------------------------------------------------
174
-
175
- /**
176
- * Freemius hooks (actions & filters) tags structure:
177
- *
178
- * fs_{filter/action_name}_{plugin_slug}
179
- *
180
- * --------------------------------------------------------
181
- *
182
- * Usage with WordPress' add_action() / add_filter():
183
- *
184
- * add_action('fs_{filter/action_name}_{plugin_slug}', $callable);
185
- *
186
- * --------------------------------------------------------
187
- *
188
- * Usage with Freemius' instance add_action() / add_filter():
189
- *
190
- * // No need to add 'fs_' prefix nor '_{plugin_slug}' suffix.
191
- * my_freemius()->add_action('{action_name}', $callable);
192
- *
193
- * --------------------------------------------------------
194
- *
195
- * Freemius filters collection:
196
- *
197
- * fs_connect_url_{plugin_slug}
198
- * fs_trial_promotion_message_{plugin_slug}
199
- * fs_is_long_term_user_{plugin_slug}
200
- * fs_uninstall_reasons_{plugin_slug}
201
- * fs_is_plugin_update_{plugin_slug}
202
- * fs_api_domains_{plugin_slug}
203
- * fs_email_template_sections_{plugin_slug}
204
- * fs_support_forum_submenu_{plugin_slug}
205
- * fs_support_forum_url_{plugin_slug}
206
- * fs_connect_message_{plugin_slug}
207
- * fs_connect_message_on_update_{plugin_slug}
208
- * fs_uninstall_confirmation_message_{plugin_slug}
209
- * fs_pending_activation_message_{plugin_slug}
210
- * fs_is_submenu_visible_{plugin_slug}
211
- * fs_plugin_icon_{plugin_slug}
212
- * fs_show_trial_{plugin_slug}
213
- *
214
- * --------------------------------------------------------
215
- *
216
- * Freemius actions collection:
217
- *
218
- * fs_after_license_loaded_{plugin_slug}
219
- * fs_after_license_change_{plugin_slug}
220
- * fs_after_plans_sync_{plugin_slug}
221
- *
222
- * fs_after_account_details_{plugin_slug}
223
- * fs_after_account_user_sync_{plugin_slug}
224
- * fs_after_account_plan_sync_{plugin_slug}
225
- * fs_before_account_load_{plugin_slug}
226
- * fs_after_account_connection_{plugin_slug}
227
- * fs_account_property_edit_{plugin_slug}
228
- * fs_account_email_verified_{plugin_slug}
229
- * fs_account_page_load_before_departure_{plugin_slug}
230
- * fs_before_account_delete_{plugin_slug}
231
- * fs_after_account_delete_{plugin_slug}
232
- *
233
- * fs_sdk_version_update_{plugin_slug}
234
- * fs_plugin_version_update_{plugin_slug}
235
- *
236
- * fs_initiated_{plugin_slug}
237
- * fs_after_init_plugin_registered_{plugin_slug}
238
- * fs_after_init_plugin_anonymous_{plugin_slug}
239
- * fs_after_init_plugin_pending_activations_{plugin_slug}
240
- * fs_after_init_addon_registered_{plugin_slug}
241
- * fs_after_init_addon_anonymous_{plugin_slug}
242
- * fs_after_init_addon_pending_activations_{plugin_slug}
243
- *
244
- * fs_after_premium_version_activation_{plugin_slug}
245
- * fs_after_free_version_reactivation_{plugin_slug}
246
- *
247
- * fs_after_uninstall_{plugin_slug}
248
- * fs_before_admin_menu_init_{plugin_slug}
249
- */
250
-
251
- #endregion Hooks & Filters Collection --------------------------------------------------------------------
252
-
253
- if ( ! class_exists( 'Freemius' ) ) {
254
-
255
- if ( ! defined( 'WP_FS__SDK_VERSION' ) ) {
256
- define( 'WP_FS__SDK_VERSION', $this_sdk_version );
257
- }
258
-
259
- // Load SDK files.
260
- require_once dirname( __FILE__ ) . '/require.php';
261
-
262
- /**
263
- * Quick shortcut to get Freemius for specified plugin.
264
- * Used by various templates.
265
- *
266
- * @param string $slug
267
- *
268
- * @return Freemius
269
- */
270
- function freemius( $slug ) {
271
- return Freemius::instance( $slug );
272
- }
273
-
274
- /**
275
- * @param string $slug
276
- * @param number $plugin_id
277
- * @param string $public_key
278
- * @param bool $is_live Is live or test plugin.
279
- * @param bool $is_premium Hints freemius if running the premium plugin or not.
280
- *
281
- * @return Freemius
282
- *
283
- * @deprecated Please use fs_dynamic_init().
284
- */
285
- function fs_init( $slug, $plugin_id, $public_key, $is_live = true, $is_premium = true ) {
286
- $fs = Freemius::instance( $slug, true );
287
- $fs->init( $plugin_id, $public_key, $is_live, $is_premium );
288
-
289
- return $fs;
290
- }
291
-
292
- /**
293
- * @param array<string,string> $module Plugin or Theme details.
294
- *
295
- * @return Freemius
296
- * @throws Freemius_Exception
297
- */
298
- function fs_dynamic_init( $module ) {
299
- $fs = Freemius::instance( $module['slug'], true );
300
- $fs->dynamic_init( $module );
301
-
302
- return $fs;
303
- }
304
-
305
- function fs_dump_log() {
306
- FS_Logger::dump();
307
- }
308
  }
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
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 = '1.2.1.5';
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
+ $this_sdk_relative_path = plugin_basename( dirname( __FILE__ ) );
35
+
36
+ if ( ! isset( $fs_active_plugins ) ) {
37
+ // Require SDK essentials.
38
+ require_once dirname( __FILE__ ) . '/includes/fs-essential-functions.php';
39
+
40
+ // Load all Freemius powered active plugins.
41
+ $fs_active_plugins = get_option( 'fs_active_plugins', new stdClass() );
42
+
43
+ if ( ! isset( $fs_active_plugins->plugins ) ) {
44
+ $fs_active_plugins->plugins = array();
45
+ }
46
+ }
47
+
48
+ if ( ! function_exists( 'fs_find_direct_caller_plugin_file' ) ) {
49
+ require_once dirname( __FILE__ ) . '/includes/supplements/fs-essential-functions-1.1.7.1.php';
50
+ }
51
+
52
+ // Update current SDK info based on the SDK path.
53
+ if ( ! isset( $fs_active_plugins->plugins[ $this_sdk_relative_path ] ) ||
54
+ $this_sdk_version != $fs_active_plugins->plugins[ $this_sdk_relative_path ]->version
55
+ ) {
56
+ $fs_active_plugins->plugins[ $this_sdk_relative_path ] = (object) array(
57
+ 'version' => $this_sdk_version,
58
+ 'timestamp' => time(),
59
+ 'plugin_path' => plugin_basename( fs_find_direct_caller_plugin_file( __FILE__ ) ),
60
+ );
61
+ }
62
+
63
+ $is_current_sdk_newest = isset( $fs_active_plugins->newest ) && ( $this_sdk_relative_path == $fs_active_plugins->newest->sdk_path );
64
+
65
+ if ( ! isset( $fs_active_plugins->newest ) ) {
66
+ /**
67
+ * This will be executed only once, for the first time a Freemius powered plugin is activated.
68
+ */
69
+ fs_update_sdk_newest_version( $this_sdk_relative_path, $fs_active_plugins->plugins[ $this_sdk_relative_path ]->plugin_path );
70
+
71
+ $is_current_sdk_newest = true;
72
+ } else if ( version_compare( $fs_active_plugins->newest->version, $this_sdk_version, '<' ) ) {
73
+ /**
74
+ * Current SDK is newer than the newest stored SDK.
75
+ */
76
+ fs_update_sdk_newest_version( $this_sdk_relative_path, $fs_active_plugins->plugins[ $this_sdk_relative_path ]->plugin_path );
77
+
78
+ if ( class_exists( 'Freemius' ) ) {
79
+ // Older SDK version was already loaded.
80
+
81
+ if ( ! $fs_active_plugins->newest->in_activation ) {
82
+ // Re-order plugins to load this plugin first.
83
+ fs_newest_sdk_plugin_first();
84
+ }
85
+
86
+ // Refresh page.
87
+ fs_redirect( $_SERVER['REQUEST_URI'] );
88
+ }
89
+ } else {
90
+ if ( ! function_exists( 'get_plugins' ) ) {
91
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
92
+ }
93
+
94
+ $is_newest_sdk_plugin_activate = is_plugin_active( $fs_active_plugins->newest->plugin_path );
95
+
96
+ if ( $is_current_sdk_newest &&
97
+ ! $is_newest_sdk_plugin_activate &&
98
+ ! $fs_active_plugins->newest->in_activation
99
+ ) {
100
+ // If current SDK is the newest and the plugin is NOT active, it means
101
+ // that the current plugin in activation mode.
102
+ $fs_active_plugins->newest->in_activation = true;
103
+ update_option( 'fs_active_plugins', $fs_active_plugins );
104
+ }
105
+
106
+ $is_newest_sdk_path_valid = ( $is_newest_sdk_plugin_activate || $fs_active_plugins->newest->in_activation ) && file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $this_sdk_relative_path . '/start.php' ) );
107
+
108
+ if ( ! $is_newest_sdk_path_valid && ! $is_current_sdk_newest ) {
109
+ // Plugin with newest SDK is no longer active, or SDK was moved to a different location.
110
+ unset( $fs_active_plugins->plugins[ $fs_active_plugins->newest->sdk_path ] );
111
+ }
112
+
113
+ if ( ! ( $is_newest_sdk_plugin_activate || $fs_active_plugins->newest->in_activation ) ||
114
+ ! $is_newest_sdk_path_valid ||
115
+ // Is newest SDK downgraded.
116
+ ( $this_sdk_relative_path == $fs_active_plugins->newest->sdk_path &&
117
+ version_compare( $fs_active_plugins->newest->version, $this_sdk_version, '>' ) )
118
+ ) {
119
+ /**
120
+ * Plugin with newest SDK is no longer active.
121
+ * OR
122
+ * The newest SDK was in the current plugin. BUT, seems like the version of
123
+ * the SDK was downgraded to a lower SDK.
124
+ */
125
+ // Find the active plugin with the newest SDK version and update the newest reference.
126
+ fs_fallback_to_newest_active_sdk();
127
+ } else {
128
+ if ( $is_newest_sdk_plugin_activate &&
129
+ $this_sdk_relative_path == $fs_active_plugins->newest->sdk_path &&
130
+ ( $fs_active_plugins->newest->in_activation ||
131
+ ( class_exists( 'Freemius' ) && ( ! defined( 'WP_FS__SDK_VERSION' ) || version_compare( WP_FS__SDK_VERSION, $this_sdk_version, '<' ) ) )
132
+ )
133
+
134
+ ) {
135
+ if ( $fs_active_plugins->newest->in_activation ) {
136
+ // Plugin no more in activation.
137
+ $fs_active_plugins->newest->in_activation = false;
138
+ update_option( 'fs_active_plugins', $fs_active_plugins );
139
+ }
140
+
141
+ // Reorder plugins to load plugin with newest SDK first.
142
+ if ( fs_newest_sdk_plugin_first() ) {
143
+ // Refresh page after re-order to make sure activated plugin loads newest SDK.
144
+ if ( class_exists( 'Freemius' ) ) {
145
+ fs_redirect( $_SERVER['REQUEST_URI'] );
146
+ }
147
+ }
148
+ }
149
+ }
150
+ }
151
+
152
+ if ( class_exists( 'Freemius' ) ) {
153
+ // SDK was already loaded.
154
+ return;
155
+ }
156
+
157
+ if ( version_compare( $this_sdk_version, $fs_active_plugins->newest->version, '<' ) ) {
158
+ $newest_sdk_starter = fs_normalize_path( WP_PLUGIN_DIR . '/' . $fs_active_plugins->newest->sdk_path . '/start.php' );
159
+
160
+ if ( file_exists( $newest_sdk_starter ) ) {
161
+ // Reorder plugins to load plugin with newest SDK first.
162
+ fs_newest_sdk_plugin_first();
163
+
164
+ // There's a newer SDK version, load it instead of the current one!
165
+ require_once $newest_sdk_starter;
166
+
167
+ return;
168
+ }
169
+ }
170
+
171
+ #endregion SDK Selection Logic --------------------------------------------------------------------
172
+
173
+ #region Hooks & Filters Collection --------------------------------------------------------------------
174
+
175
+ /**
176
+ * Freemius hooks (actions & filters) tags structure:
177
+ *
178
+ * fs_{filter/action_name}_{plugin_slug}
179
+ *
180
+ * --------------------------------------------------------
181
+ *
182
+ * Usage with WordPress' add_action() / add_filter():
183
+ *
184
+ * add_action('fs_{filter/action_name}_{plugin_slug}', $callable);
185
+ *
186
+ * --------------------------------------------------------
187
+ *
188
+ * Usage with Freemius' instance add_action() / add_filter():
189
+ *
190
+ * // No need to add 'fs_' prefix nor '_{plugin_slug}' suffix.
191
+ * my_freemius()->add_action('{action_name}', $callable);
192
+ *
193
+ * --------------------------------------------------------
194
+ *
195
+ * Freemius filters collection:
196
+ *
197
+ * fs_connect_url_{plugin_slug}
198
+ * fs_trial_promotion_message_{plugin_slug}
199
+ * fs_is_long_term_user_{plugin_slug}
200
+ * fs_uninstall_reasons_{plugin_slug}
201
+ * fs_is_plugin_update_{plugin_slug}
202
+ * fs_api_domains_{plugin_slug}
203
+ * fs_email_template_sections_{plugin_slug}
204
+ * fs_support_forum_submenu_{plugin_slug}
205
+ * fs_support_forum_url_{plugin_slug}
206
+ * fs_connect_message_{plugin_slug}
207
+ * fs_connect_message_on_update_{plugin_slug}
208
+ * fs_uninstall_confirmation_message_{plugin_slug}
209
+ * fs_pending_activation_message_{plugin_slug}
210
+ * fs_is_submenu_visible_{plugin_slug}
211
+ * fs_plugin_icon_{plugin_slug}
212
+ * fs_show_trial_{plugin_slug}
213
+ *
214
+ * --------------------------------------------------------
215
+ *
216
+ * Freemius actions collection:
217
+ *
218
+ * fs_after_license_loaded_{plugin_slug}
219
+ * fs_after_license_change_{plugin_slug}
220
+ * fs_after_plans_sync_{plugin_slug}
221
+ *
222
+ * fs_after_account_details_{plugin_slug}
223
+ * fs_after_account_user_sync_{plugin_slug}
224
+ * fs_after_account_plan_sync_{plugin_slug}
225
+ * fs_before_account_load_{plugin_slug}
226
+ * fs_after_account_connection_{plugin_slug}
227
+ * fs_account_property_edit_{plugin_slug}
228
+ * fs_account_email_verified_{plugin_slug}
229
+ * fs_account_page_load_before_departure_{plugin_slug}
230
+ * fs_before_account_delete_{plugin_slug}
231
+ * fs_after_account_delete_{plugin_slug}
232
+ *
233
+ * fs_sdk_version_update_{plugin_slug}
234
+ * fs_plugin_version_update_{plugin_slug}
235
+ *
236
+ * fs_initiated_{plugin_slug}
237
+ * fs_after_init_plugin_registered_{plugin_slug}
238
+ * fs_after_init_plugin_anonymous_{plugin_slug}
239
+ * fs_after_init_plugin_pending_activations_{plugin_slug}
240
+ * fs_after_init_addon_registered_{plugin_slug}
241
+ * fs_after_init_addon_anonymous_{plugin_slug}
242
+ * fs_after_init_addon_pending_activations_{plugin_slug}
243
+ *
244
+ * fs_after_premium_version_activation_{plugin_slug}
245
+ * fs_after_free_version_reactivation_{plugin_slug}
246
+ *
247
+ * fs_after_uninstall_{plugin_slug}
248
+ * fs_before_admin_menu_init_{plugin_slug}
249
+ */
250
+
251
+ #endregion Hooks & Filters Collection --------------------------------------------------------------------
252
+
253
+ if ( ! class_exists( 'Freemius' ) ) {
254
+
255
+ if ( ! defined( 'WP_FS__SDK_VERSION' ) ) {
256
+ define( 'WP_FS__SDK_VERSION', $this_sdk_version );
257
+ }
258
+
259
+ // Load SDK files.
260
+ require_once dirname( __FILE__ ) . '/require.php';
261
+
262
+ /**
263
+ * Quick shortcut to get Freemius for specified plugin.
264
+ * Used by various templates.
265
+ *
266
+ * @param string $slug
267
+ *
268
+ * @return Freemius
269
+ */
270
+ function freemius( $slug ) {
271
+ return Freemius::instance( $slug );
272
+ }
273
+
274
+ /**
275
+ * @param string $slug
276
+ * @param number $plugin_id
277
+ * @param string $public_key
278
+ * @param bool $is_live Is live or test plugin.
279
+ * @param bool $is_premium Hints freemius if running the premium plugin or not.
280
+ *
281
+ * @return Freemius
282
+ *
283
+ * @deprecated Please use fs_dynamic_init().
284
+ */
285
+ function fs_init( $slug, $plugin_id, $public_key, $is_live = true, $is_premium = true ) {
286
+ $fs = Freemius::instance( $slug, true );
287
+ $fs->init( $plugin_id, $public_key, $is_live, $is_premium );
288
+
289
+ return $fs;
290
+ }
291
+
292
+ /**
293
+ * @param array<string,string> $module Plugin or Theme details.
294
+ *
295
+ * @return Freemius
296
+ * @throws Freemius_Exception
297
+ */
298
+ function fs_dynamic_init( $module ) {
299
+ $fs = Freemius::instance( $module['slug'], true );
300
+ $fs->dynamic_init( $module );
301
+
302
+ return $fs;
303
+ }
304
+
305
+ function fs_dump_log() {
306
+ FS_Logger::dump();
307
+ }
308
  }
includes/pum-sdk/freemius/templates/connect.php CHANGED
@@ -1,405 +1,405 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
- * @since 1.0.7
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * @var array $VARS
15
- */
16
- $slug = $VARS['slug'];
17
- $fs = freemius( $slug );
18
- $is_pending_activation = $fs->is_pending_activation();
19
- $is_premium_only = $fs->is_only_premium();
20
- $has_paid_plans = $fs->has_paid_plan();
21
- $is_premium_code = $fs->is_premium();
22
- $is_freemium = $fs->is_freemium();
23
-
24
- $fs->_enqueue_connect_essentials();
25
-
26
- $current_user = Freemius::_get_current_wp_user();
27
-
28
- $first_name = $current_user->user_firstname;
29
- if ( empty( $first_name ) ) {
30
- $first_name = $current_user->nickname;
31
- }
32
-
33
- $site_url = get_site_url();
34
- $protocol_pos = strpos( $site_url, '://' );
35
- if ( false !== $protocol_pos ) {
36
- $site_url = substr( $site_url, $protocol_pos + 3 );
37
- }
38
-
39
- $freemius_site_url = $fs->has_paid_plan() ?
40
- 'https://freemius.com/wordpress/' :
41
- // Insights platform information.
42
- 'https://freemius.com/wordpress/usage-tracking/';
43
-
44
- $freemius_site_url .= '?' . http_build_query( array(
45
- 'id' => $fs->get_id(),
46
- 'slug' => $slug,
47
- ) );
48
-
49
- $freemius_link = '<a href="' . $freemius_site_url . '" target="_blank" tabindex="1">freemius.com</a>';
50
-
51
- $error = fs_request_get( 'error' );
52
-
53
- $require_license_key = $is_premium_only ||
54
- ( $is_freemium && $is_premium_code && fs_request_get_bool( 'require_license', true ) );
55
-
56
- if ( $is_pending_activation ) {
57
- $require_license_key = false;
58
- }
59
-
60
- if ( $require_license_key ) {
61
- $fs->_add_license_activation_dialog_box();
62
- }
63
-
64
- $fs_user = Freemius::_get_user_by_email( $current_user->user_email );
65
- $activate_with_current_user = is_object( $fs_user ) && ! $is_pending_activation;
66
- ?>
67
- <div id="fs_connect"
68
- class="wrap<?php if ( ! $fs->is_enable_anonymous() || $is_pending_activation || $require_license_key ) {
69
- echo ' fs-anonymous-disabled';
70
- } ?>">
71
- <div class="fs-visual">
72
- <b class="fs-site-icon"><i class="dashicons dashicons-wordpress"></i></b>
73
- <i class="dashicons dashicons-plus fs-first"></i>
74
- <?php
75
- $vars = array( 'slug' => $slug );
76
- fs_require_once_template( 'plugin-icon.php', $vars );
77
- ?>
78
- <i class="dashicons dashicons-plus fs-second"></i>
79
- <img class="fs-connect-logo" width="80" height="80" src="//img.freemius.com/connect-logo.png"/>
80
- </div>
81
- <div class="fs-content">
82
- <?php if ( ! empty( $error ) ) : ?>
83
- <p class="fs-error"><?php echo $error ?></p>
84
- <?php endif ?>
85
- <p><?php
86
- $button_label = 'opt-in-connect';
87
-
88
- if ( $is_pending_activation ) {
89
- $button_label = 'resend-activation-email';
90
-
91
- echo $fs->apply_filters( 'pending_activation_message', sprintf(
92
- __fs( 'thanks-x', $slug ) . '<br>' .
93
- __fs( 'pending-activation-message', $slug ),
94
- $first_name,
95
- '<b>' . $fs->get_plugin_name() . '</b>',
96
- '<b>' . $current_user->user_email . '</b>',
97
- __fs( 'complete-the-install', $slug )
98
- ) );
99
- } else if ( $require_license_key ) {
100
- $button_label = 'agree-activate-license';
101
-
102
- echo $fs->apply_filters( 'connect-message_on-premium',
103
- sprintf( __fs( 'hey-x', $slug ), $first_name ) . '<br>' .
104
- sprintf( __fs( 'thanks-for-purchasing', $slug ), '<b>' . $fs->get_plugin_name() . '</b>' ),
105
- $first_name,
106
- $fs->get_plugin_name()
107
- );
108
- } else {
109
- $filter = 'connect_message';
110
- $default_optin_message = 'connect-message';
111
-
112
- if ( $fs->is_plugin_update() ) {
113
- // If Freemius was added on a plugin update, set different
114
- // opt-in message.
115
- $default_optin_message = 'connect-message_on-update';
116
-
117
- // If user customized the opt-in message on update, use
118
- // that message. Otherwise, fallback to regular opt-in
119
- // custom message if exist.
120
- if ( $fs->has_filter( 'connect_message_on_update' ) ) {
121
- $filter = 'connect_message_on_update';
122
- }
123
- }
124
-
125
- echo $fs->apply_filters( $filter,
126
- sprintf( __fs( 'hey-x', $slug ), $first_name ) . '<br>' .
127
- sprintf(
128
- __fs( $default_optin_message, $slug ),
129
- '<b>' . $fs->get_plugin_name() . '</b>',
130
- '<b>' . $current_user->user_login . '</b>',
131
- '<a href="' . $site_url . '" target="_blank">' . $site_url . '</a>',
132
- $freemius_link
133
- ),
134
- $first_name,
135
- $fs->get_plugin_name(),
136
- $current_user->user_login,
137
- '<a href="' . $site_url . '" target="_blank">' . $site_url . '</a>',
138
- $freemius_link
139
- );
140
- }
141
- ?></p>
142
- <?php if ( $require_license_key ) : ?>
143
- <div class="fs-license-key-container">
144
- <input id="fs_license_key" name="fs_key" type="text" required maxlength="32"
145
- placeholder="<?php _efs( 'license-key', $slug ) ?>" tabindex="1"/>
146
- <i class="dashicons dashicons-admin-network"></i>
147
- <a class="show-license-resend-modal show-license-resend-modal-<?php echo $slug; ?>"
148
- href="#"><?php _efs( 'cant-find-license-key' ); ?></a>
149
- </div>
150
- <?php endif ?>
151
- </div>
152
- <div class="fs-actions">
153
- <?php if ( $fs->is_enable_anonymous() && ! $is_pending_activation && ! $require_license_key ) : ?>
154
- <a href="<?php echo fs_nonce_url( $fs->_get_admin_page_url( '', array( 'fs_action' => $slug . '_skip_activation' ) ), $slug . '_skip_activation' ) ?>"
155
- class="button button-secondary" tabindex="2"><?php _efs( 'skip', $slug ) ?></a>
156
- <?php endif ?>
157
-
158
- <?php if ( $activate_with_current_user ) : ?>
159
- <form action="" method="POST">
160
- <input type="hidden" name="fs_action" value="<?php echo $slug ?>_activate_existing">
161
- <?php wp_nonce_field( 'activate_existing_' . $fs->get_public_key() ) ?>
162
- <button class="button button-primary" tabindex="1"
163
- type="submit"<?php if ( $require_license_key ) {
164
- echo ' disabled="disabled"';
165
- } ?>><?php _efs( $button_label, $slug ) ?></button>
166
- </form>
167
- <?php else : ?>
168
- <form method="post" action="<?php echo WP_FS__ADDRESS ?>/action/service/user/install/">
169
- <?php $params = $fs->get_opt_in_params() ?>
170
- <?php foreach ( $params as $name => $value ) : ?>
171
- <input type="hidden" name="<?php echo $name ?>" value="<?php echo esc_attr( $value ) ?>">
172
- <?php endforeach ?>
173
- <button class="button button-primary" tabindex="1"
174
- type="submit"<?php if ( $require_license_key ) {
175
- echo ' disabled="disabled"';
176
- } ?>><?php _efs( $button_label, $slug ) ?></button>
177
- </form>
178
- <?php endif ?>
179
- </div><?php
180
-
181
- // Set core permission list items.
182
- $permissions = array(
183
- 'profile' => array(
184
- 'icon-class' => 'dashicons dashicons-admin-users',
185
- 'label' => __fs( 'permissions-profile' ),
186
- 'desc' => __fs( 'permissions-profile_desc' ),
187
- 'priority' => 5,
188
- ),
189
- 'site' => array(
190
- 'icon-class' => 'dashicons dashicons-admin-settings',
191
- 'label' => __fs( 'permissions-site' ),
192
- 'desc' => __fs( 'permissions-site_desc' ),
193
- 'priority' => 10,
194
- ),
195
- 'notices' => array(
196
- 'icon-class' => 'dashicons dashicons-testimonial',
197
- 'label' => __fs( 'permissions-admin-notices' ),
198
- 'desc' => __fs( 'permissions-newsletter_desc' ),
199
- 'priority' => 13,
200
- ),
201
- 'events' => array(
202
- 'icon-class' => 'dashicons dashicons-admin-plugins',
203
- 'label' => __fs( 'permissions-events' ),
204
- 'desc' => __fs( 'permissions-events_desc' ),
205
- 'priority' => 20,
206
- ),
207
- // 'plugins_themes' => array(
208
- // 'icon-class' => 'dashicons dashicons-admin-settings',
209
- // 'label' => __fs( 'permissions-plugins_themes' ),
210
- // 'desc' => __fs( 'permissions-plugins_themes_desc' ),
211
- // 'priority' => 30,
212
- // ),
213
- );
214
-
215
- // Add newsletter permissions if enabled.
216
- if ( $fs->is_permission_requested( 'newsletter' ) ) {
217
- $permissions['newsletter'] = array(
218
- 'icon-class' => 'dashicons dashicons-email-alt',
219
- 'label' => __fs( 'permissions-newsletter' ),
220
- 'desc' => __fs( 'permissions-newsletter_desc' ),
221
- 'priority' => 15,
222
- );
223
- }
224
-
225
- // Allow filtering of the permissions list.
226
- $permissions = $fs->apply_filters( 'permission_list', $permissions );
227
-
228
- // Sort by priority.
229
- uasort( $permissions, 'fs_sort_by_priority' );
230
-
231
- if ( ! empty( $permissions ) ) : ?>
232
- <div class="fs-permissions">
233
- <?php if ( $require_license_key ) : ?>
234
- <p class="fs-license-sync-disclaimer"><?php printf( __fs( 'license-sync-disclaimer', $slug ), $freemius_link ) ?></p>
235
- <?php endif ?>
236
- <a class="fs-trigger" href="#" tabindex="1"><?php _efs( 'what-permissions', $slug ) ?></a>
237
- <ul><?php
238
- foreach ( $permissions as $id => $permission ) : ?>
239
- <li id="fs-permission-<?php echo esc_attr( $id ); ?>"
240
- class="fs-permission fs-<?php echo esc_attr( $id ); ?>">
241
- <i class="<?php echo esc_attr( $permission['icon-class'] ); ?>"></i>
242
-
243
- <div>
244
- <span><?php echo esc_html( $permission['label'] ); ?></span>
245
-
246
- <p><?php echo esc_html( $permission['desc'] ); ?></p>
247
- </div>
248
- </li>
249
- <?php endforeach; ?>
250
- </ul>
251
- </div>
252
- <?php endif ?>
253
- <?php if ( $is_premium_code && $is_freemium ) : ?>
254
- <div class="fs-freemium-licensing">
255
- <p>
256
- <?php if ( $require_license_key ) : ?>
257
- <?php _efs( 'dont-have-license-key', $slug ) ?>
258
- <a data-require-license="false" tabindex="1"><?php _efs( 'activate-free-version', $slug ) ?></a>
259
- <?php else : ?>
260
- <?php _efs( 'have-license-key', $slug ) ?>
261
- <a data-require-license="true" tabindex="1"><?php _efs( 'activate-license', $slug ) ?></a>
262
- <?php endif ?>
263
- </p>
264
- </div>
265
- <?php endif ?>
266
- <div class="fs-terms">
267
- <a href="https://freemius.com/privacy/" target="_blank"
268
- tabindex="1"><?php _efs( 'privacy-policy', $slug ) ?></a>
269
- &nbsp;&nbsp;-&nbsp;&nbsp;
270
- <a href="https://freemius.com/terms/" target="_blank" tabindex="1"><?php _efs( 'tos', $slug ) ?></a>
271
- </div>
272
- </div>
273
- <script type="text/javascript">
274
- (function ($) {
275
- var $primaryCta = $('.fs-actions .button.button-primary'),
276
- $form = $('.fs-actions form'),
277
- requireLicenseKey = <?php echo $require_license_key ? 'true' : 'false' ?>,
278
- hasContextUser = <?php echo $activate_with_current_user ? 'true' : 'false' ?>,
279
- $licenseSecret,
280
- $licenseKeyInput = $('#fs_license_key');
281
-
282
- $('.fs-actions .button').on('click', function () {
283
- // Set loading mode.
284
- $(document.body).css({'cursor': 'wait'});
285
-
286
- var $this = $(this);
287
- $this.css({'cursor': 'wait'});
288
-
289
- setTimeout(function () {
290
- $this.attr('disabled', 'disabled');
291
- }, 200);
292
- });
293
-
294
- $form.on('submit', function () {
295
- /**
296
- * @author Vova Feldman (@svovaf)
297
- * @since 1.1.9
298
- */
299
- if (requireLicenseKey) {
300
- if (!hasContextUser) {
301
- $('.fs-error').remove();
302
-
303
- /**
304
- * Use the AJAX opt-in when license key is required to potentially
305
- * process the after install failure hook.
306
- *
307
- * @author Vova Feldman (@svovaf)
308
- * @since 1.2.1.5
309
- */
310
- $.ajax({
311
- url : ajaxurl,
312
- method : 'POST',
313
- data : {
314
- action : 'fs_activate_license_<?php echo $slug ?>',
315
- slug : '<?php echo $slug ?>',
316
- license_key: $licenseKeyInput.val()
317
- },
318
- success: function (result) {
319
- var resultObj = $.parseJSON(result);
320
- if (resultObj.success) {
321
- // Redirect to the "Account" page and sync the license.
322
- window.location.href = resultObj.next_page;
323
- } else {
324
- // Show error.
325
- $('.fs-content').prepend('<p class="fs-error">' + resultObj.error + '</p>');
326
-
327
- // Reset loading mode.
328
- $primaryCta.removeClass('fs-loading').css({'cursor': 'auto'});
329
- $primaryCta.html(<?php echo json_encode(__fs( $button_label, $slug )) ?>);
330
- $primaryCta.prop('disabled', false);
331
- $(document.body).css({'cursor': 'auto'});
332
- }
333
- }
334
- });
335
-
336
- return false;
337
- }
338
- else {
339
- if (null == $licenseSecret) {
340
- $licenseSecret = $('<input type="hidden" name="license_secret_key" value="" />');
341
- $form.append($licenseSecret);
342
- }
343
-
344
- // Update secret key if premium only plugin.
345
- $licenseSecret.val($licenseKeyInput.val());
346
- }
347
- }
348
-
349
- return true;
350
- });
351
-
352
- $primaryCta.on('click', function () {
353
- $(this).addClass('fs-loading');
354
- $(this).html(<?php echo json_encode(__fs( $is_pending_activation ? 'sending-email' : 'activating' , $slug )) ?> +'...');
355
- });
356
-
357
- $('.fs-permissions .fs-trigger').on('click', function () {
358
- $('.fs-permissions').toggleClass('fs-open');
359
- });
360
-
361
- if (requireLicenseKey) {
362
- /**
363
- * Submit license key on enter.
364
- *
365
- * @author Vova Feldman (@svovaf)
366
- * @since 1.1.9
367
- */
368
- $licenseKeyInput.keypress(function (e) {
369
- if (e.which == 13) {
370
- if ('' !== $(this).val()) {
371
- $primaryCta.click();
372
- return false;
373
- }
374
- }
375
- });
376
-
377
- /**
378
- * Disable activation button when empty license key.
379
- *
380
- * @author Vova Feldman (@svovaf)
381
- * @since 1.1.9
382
- */
383
- $licenseKeyInput.on('keyup paste delete cut', function () {
384
- setTimeout(function () {
385
- if ('' === $licenseKeyInput.val()) {
386
- $primaryCta.attr('disabled', 'disabled');
387
- } else {
388
- $primaryCta.prop('disabled', false);
389
- }
390
- }, 100);
391
- }).focus();
392
- }
393
-
394
- /**
395
- * Set license mode trigger URL.
396
- *
397
- * @author Vova Feldman (@svovaf)
398
- * @since 1.1.9
399
- */
400
- var $connectLicenseModeTrigger = $('#fs_connect .fs-freemium-licensing a');
401
- if ($connectLicenseModeTrigger.length > 0) {
402
- $connectLicenseModeTrigger.attr('href', window.location.href + '&require_license=' + $connectLicenseModeTrigger.attr('data-require-license'))
403
- }
404
- })(jQuery);
405
  </script>
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
+ * @since 1.0.7
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * @var array $VARS
15
+ */
16
+ $slug = $VARS['slug'];
17
+ $fs = freemius( $slug );
18
+ $is_pending_activation = $fs->is_pending_activation();
19
+ $is_premium_only = $fs->is_only_premium();
20
+ $has_paid_plans = $fs->has_paid_plan();
21
+ $is_premium_code = $fs->is_premium();
22
+ $is_freemium = $fs->is_freemium();
23
+
24
+ $fs->_enqueue_connect_essentials();
25
+
26
+ $current_user = Freemius::_get_current_wp_user();
27
+
28
+ $first_name = $current_user->user_firstname;
29
+ if ( empty( $first_name ) ) {
30
+ $first_name = $current_user->nickname;
31
+ }
32
+
33
+ $site_url = get_site_url();
34
+ $protocol_pos = strpos( $site_url, '://' );
35
+ if ( false !== $protocol_pos ) {
36
+ $site_url = substr( $site_url, $protocol_pos + 3 );
37
+ }
38
+
39
+ $freemius_site_url = $fs->has_paid_plan() ?
40
+ 'https://freemius.com/wordpress/' :
41
+ // Insights platform information.
42
+ 'https://freemius.com/wordpress/usage-tracking/';
43
+
44
+ $freemius_site_url .= '?' . http_build_query( array(
45
+ 'id' => $fs->get_id(),
46
+ 'slug' => $slug,
47
+ ) );
48
+
49
+ $freemius_link = '<a href="' . $freemius_site_url . '" target="_blank" tabindex="1">freemius.com</a>';
50
+
51
+ $error = fs_request_get( 'error' );
52
+
53
+ $require_license_key = $is_premium_only ||
54
+ ( $is_freemium && $is_premium_code && fs_request_get_bool( 'require_license', true ) );
55
+
56
+ if ( $is_pending_activation ) {
57
+ $require_license_key = false;
58
+ }
59
+
60
+ if ( $require_license_key ) {
61
+ $fs->_add_license_activation_dialog_box();
62
+ }
63
+
64
+ $fs_user = Freemius::_get_user_by_email( $current_user->user_email );
65
+ $activate_with_current_user = is_object( $fs_user ) && ! $is_pending_activation;
66
+ ?>
67
+ <div id="fs_connect"
68
+ class="wrap<?php if ( ! $fs->is_enable_anonymous() || $is_pending_activation || $require_license_key ) {
69
+ echo ' fs-anonymous-disabled';
70
+ } ?>">
71
+ <div class="fs-visual">
72
+ <b class="fs-site-icon"><i class="dashicons dashicons-wordpress"></i></b>
73
+ <i class="dashicons dashicons-plus fs-first"></i>
74
+ <?php
75
+ $vars = array( 'slug' => $slug );
76
+ fs_require_once_template( 'plugin-icon.php', $vars );
77
+ ?>
78
+ <i class="dashicons dashicons-plus fs-second"></i>
79
+ <img class="fs-connect-logo" width="80" height="80" src="//img.freemius.com/connect-logo.png"/>
80
+ </div>
81
+ <div class="fs-content">
82
+ <?php if ( ! empty( $error ) ) : ?>
83
+ <p class="fs-error"><?php echo $error ?></p>
84
+ <?php endif ?>
85
+ <p><?php
86
+ $button_label = 'opt-in-connect';
87
+
88
+ if ( $is_pending_activation ) {
89
+ $button_label = 'resend-activation-email';
90
+
91
+ echo $fs->apply_filters( 'pending_activation_message', sprintf(
92
+ __fs( 'thanks-x', $slug ) . '<br>' .
93
+ __fs( 'pending-activation-message', $slug ),
94
+ $first_name,
95
+ '<b>' . $fs->get_plugin_name() . '</b>',
96
+ '<b>' . $current_user->user_email . '</b>',
97
+ __fs( 'complete-the-install', $slug )
98
+ ) );
99
+ } else if ( $require_license_key ) {
100
+ $button_label = 'agree-activate-license';
101
+
102
+ echo $fs->apply_filters( 'connect-message_on-premium',
103
+ sprintf( __fs( 'hey-x', $slug ), $first_name ) . '<br>' .
104
+ sprintf( __fs( 'thanks-for-purchasing', $slug ), '<b>' . $fs->get_plugin_name() . '</b>' ),
105
+ $first_name,
106
+ $fs->get_plugin_name()
107
+ );
108
+ } else {
109
+ $filter = 'connect_message';
110
+ $default_optin_message = 'connect-message';
111
+
112
+ if ( $fs->is_plugin_update() ) {
113
+ // If Freemius was added on a plugin update, set different
114
+ // opt-in message.
115
+ $default_optin_message = 'connect-message_on-update';
116
+
117
+ // If user customized the opt-in message on update, use
118
+ // that message. Otherwise, fallback to regular opt-in
119
+ // custom message if exist.
120
+ if ( $fs->has_filter( 'connect_message_on_update' ) ) {
121
+ $filter = 'connect_message_on_update';
122
+ }
123
+ }
124
+
125
+ echo $fs->apply_filters( $filter,
126
+ sprintf( __fs( 'hey-x', $slug ), $first_name ) . '<br>' .
127
+ sprintf(
128
+ __fs( $default_optin_message, $slug ),
129
+ '<b>' . $fs->get_plugin_name() . '</b>',
130
+ '<b>' . $current_user->user_login . '</b>',
131
+ '<a href="' . $site_url . '" target="_blank">' . $site_url . '</a>',
132
+ $freemius_link
133
+ ),
134
+ $first_name,
135
+ $fs->get_plugin_name(),
136
+ $current_user->user_login,
137
+ '<a href="' . $site_url . '" target="_blank">' . $site_url . '</a>',
138
+ $freemius_link
139
+ );
140
+ }
141
+ ?></p>
142
+ <?php if ( $require_license_key ) : ?>
143
+ <div class="fs-license-key-container">
144
+ <input id="fs_license_key" name="fs_key" type="text" required maxlength="32"
145
+ placeholder="<?php _efs( 'license-key', $slug ) ?>" tabindex="1"/>
146
+ <i class="dashicons dashicons-admin-network"></i>
147
+ <a class="show-license-resend-modal show-license-resend-modal-<?php echo $slug; ?>"
148
+ href="#"><?php _efs( 'cant-find-license-key' ); ?></a>
149
+ </div>
150
+ <?php endif ?>
151
+ </div>
152
+ <div class="fs-actions">
153
+ <?php if ( $fs->is_enable_anonymous() && ! $is_pending_activation && ! $require_license_key ) : ?>
154
+ <a href="<?php echo fs_nonce_url( $fs->_get_admin_page_url( '', array( 'fs_action' => $slug . '_skip_activation' ) ), $slug . '_skip_activation' ) ?>"
155
+ class="button button-secondary" tabindex="2"><?php _efs( 'skip', $slug ) ?></a>
156
+ <?php endif ?>
157
+
158
+ <?php if ( $activate_with_current_user ) : ?>
159
+ <form action="" method="POST">
160
+ <input type="hidden" name="fs_action" value="<?php echo $slug ?>_activate_existing">
161
+ <?php wp_nonce_field( 'activate_existing_' . $fs->get_public_key() ) ?>
162
+ <button class="button button-primary" tabindex="1"
163
+ type="submit"<?php if ( $require_license_key ) {
164
+ echo ' disabled="disabled"';
165
+ } ?>><?php _efs( $button_label, $slug ) ?></button>
166
+ </form>
167
+ <?php else : ?>
168
+ <form method="post" action="<?php echo WP_FS__ADDRESS ?>/action/service/user/install/">
169
+ <?php $params = $fs->get_opt_in_params() ?>
170
+ <?php foreach ( $params as $name => $value ) : ?>
171
+ <input type="hidden" name="<?php echo $name ?>" value="<?php echo esc_attr( $value ) ?>">
172
+ <?php endforeach ?>
173
+ <button class="button button-primary" tabindex="1"
174
+ type="submit"<?php if ( $require_license_key ) {
175
+ echo ' disabled="disabled"';
176
+ } ?>><?php _efs( $button_label, $slug ) ?></button>
177
+ </form>
178
+ <?php endif ?>
179
+ </div><?php
180
+
181
+ // Set core permission list items.
182
+ $permissions = array(
183
+ 'profile' => array(
184
+ 'icon-class' => 'dashicons dashicons-admin-users',
185
+ 'label' => __fs( 'permissions-profile' ),
186
+ 'desc' => __fs( 'permissions-profile_desc' ),
187
+ 'priority' => 5,
188
+ ),
189
+ 'site' => array(
190
+ 'icon-class' => 'dashicons dashicons-admin-settings',
191
+ 'label' => __fs( 'permissions-site' ),
192
+ 'desc' => __fs( 'permissions-site_desc' ),
193
+ 'priority' => 10,
194
+ ),
195
+ 'notices' => array(
196
+ 'icon-class' => 'dashicons dashicons-testimonial',
197
+ 'label' => __fs( 'permissions-admin-notices' ),
198
+ 'desc' => __fs( 'permissions-newsletter_desc' ),
199
+ 'priority' => 13,
200
+ ),
201
+ 'events' => array(
202
+ 'icon-class' => 'dashicons dashicons-admin-plugins',
203
+ 'label' => __fs( 'permissions-events' ),
204
+ 'desc' => __fs( 'permissions-events_desc' ),
205
+ 'priority' => 20,
206
+ ),
207
+ // 'plugins_themes' => array(
208
+ // 'icon-class' => 'dashicons dashicons-admin-settings',
209
+ // 'label' => __fs( 'permissions-plugins_themes' ),
210
+ // 'desc' => __fs( 'permissions-plugins_themes_desc' ),
211
+ // 'priority' => 30,
212
+ // ),
213
+ );
214
+
215
+ // Add newsletter permissions if enabled.
216
+ if ( $fs->is_permission_requested( 'newsletter' ) ) {
217
+ $permissions['newsletter'] = array(
218
+ 'icon-class' => 'dashicons dashicons-email-alt',
219
+ 'label' => __fs( 'permissions-newsletter' ),
220
+ 'desc' => __fs( 'permissions-newsletter_desc' ),
221
+ 'priority' => 15,
222
+ );
223
+ }
224
+
225
+ // Allow filtering of the permissions list.
226
+ $permissions = $fs->apply_filters( 'permission_list', $permissions );
227
+
228
+ // Sort by priority.
229
+ uasort( $permissions, 'fs_sort_by_priority' );
230
+
231
+ if ( ! empty( $permissions ) ) : ?>
232
+ <div class="fs-permissions">
233
+ <?php if ( $require_license_key ) : ?>
234
+ <p class="fs-license-sync-disclaimer"><?php printf( __fs( 'license-sync-disclaimer', $slug ), $freemius_link ) ?></p>
235
+ <?php endif ?>
236
+ <a class="fs-trigger" href="#" tabindex="1"><?php _efs( 'what-permissions', $slug ) ?></a>
237
+ <ul><?php
238
+ foreach ( $permissions as $id => $permission ) : ?>
239
+ <li id="fs-permission-<?php echo esc_attr( $id ); ?>"
240
+ class="fs-permission fs-<?php echo esc_attr( $id ); ?>">
241
+ <i class="<?php echo esc_attr( $permission['icon-class'] ); ?>"></i>
242
+
243
+ <div>
244
+ <span><?php echo esc_html( $permission['label'] ); ?></span>
245
+
246
+ <p><?php echo esc_html( $permission['desc'] ); ?></p>
247
+ </div>
248
+ </li>
249
+ <?php endforeach; ?>
250
+ </ul>
251
+ </div>
252
+ <?php endif ?>
253
+ <?php if ( $is_premium_code && $is_freemium ) : ?>
254
+ <div class="fs-freemium-licensing">
255
+ <p>
256
+ <?php if ( $require_license_key ) : ?>
257
+ <?php _efs( 'dont-have-license-key', $slug ) ?>
258
+ <a data-require-license="false" tabindex="1"><?php _efs( 'activate-free-version', $slug ) ?></a>
259
+ <?php else : ?>
260
+ <?php _efs( 'have-license-key', $slug ) ?>
261
+ <a data-require-license="true" tabindex="1"><?php _efs( 'activate-license', $slug ) ?></a>
262
+ <?php endif ?>
263
+ </p>
264
+ </div>
265
+ <?php endif ?>
266
+ <div class="fs-terms">
267
+ <a href="https://freemius.com/privacy/" target="_blank"
268
+ tabindex="1"><?php _efs( 'privacy-policy', $slug ) ?></a>
269
+ &nbsp;&nbsp;-&nbsp;&nbsp;
270
+ <a href="https://freemius.com/terms/" target="_blank" tabindex="1"><?php _efs( 'tos', $slug ) ?></a>
271
+ </div>
272
+ </div>
273
+ <script type="text/javascript">
274
+ (function ($) {
275
+ var $primaryCta = $('.fs-actions .button.button-primary'),
276
+ $form = $('.fs-actions form'),
277
+ requireLicenseKey = <?php echo $require_license_key ? 'true' : 'false' ?>,
278
+ hasContextUser = <?php echo $activate_with_current_user ? 'true' : 'false' ?>,
279
+ $licenseSecret,
280
+ $licenseKeyInput = $('#fs_license_key');
281
+
282
+ $('.fs-actions .button').on('click', function () {
283
+ // Set loading mode.
284
+ $(document.body).css({'cursor': 'wait'});
285
+
286
+ var $this = $(this);
287
+ $this.css({'cursor': 'wait'});
288
+
289
+ setTimeout(function () {
290
+ $this.attr('disabled', 'disabled');
291
+ }, 200);
292
+ });
293
+
294
+ $form.on('submit', function () {
295
+ /**
296
+ * @author Vova Feldman (@svovaf)
297
+ * @since 1.1.9
298
+ */
299
+ if (requireLicenseKey) {
300
+ if (!hasContextUser) {
301
+ $('.fs-error').remove();
302
+
303
+ /**
304
+ * Use the AJAX opt-in when license key is required to potentially
305
+ * process the after install failure hook.
306
+ *
307
+ * @author Vova Feldman (@svovaf)
308
+ * @since 1.2.1.5
309
+ */
310
+ $.ajax({
311
+ url : ajaxurl,
312
+ method : 'POST',
313
+ data : {
314
+ action : 'fs_activate_license_<?php echo $slug ?>',
315
+ slug : '<?php echo $slug ?>',
316
+ license_key: $licenseKeyInput.val()
317
+ },
318
+ success: function (result) {
319
+ var resultObj = $.parseJSON(result);
320
+ if (resultObj.success) {
321
+ // Redirect to the "Account" page and sync the license.
322
+ window.location.href = resultObj.next_page;
323
+ } else {
324
+ // Show error.
325
+ $('.fs-content').prepend('<p class="fs-error">' + resultObj.error + '</p>');
326
+
327
+ // Reset loading mode.
328
+ $primaryCta.removeClass('fs-loading').css({'cursor': 'auto'});
329
+ $primaryCta.html(<?php echo json_encode(__fs( $button_label, $slug )) ?>);
330
+ $primaryCta.prop('disabled', false);
331
+ $(document.body).css({'cursor': 'auto'});
332
+ }
333
+ }
334
+ });
335
+
336
+ return false;
337
+ }
338
+ else {
339
+ if (null == $licenseSecret) {
340
+ $licenseSecret = $('<input type="hidden" name="license_secret_key" value="" />');
341
+ $form.append($licenseSecret);
342
+ }
343
+
344
+ // Update secret key if premium only plugin.
345
+ $licenseSecret.val($licenseKeyInput.val());
346
+ }
347
+ }
348
+
349
+ return true;
350
+ });
351
+
352
+ $primaryCta.on('click', function () {
353
+ $(this).addClass('fs-loading');
354
+ $(this).html(<?php echo json_encode(__fs( $is_pending_activation ? 'sending-email' : 'activating' , $slug )) ?> +'...');
355
+ });
356
+
357
+ $('.fs-permissions .fs-trigger').on('click', function () {
358
+ $('.fs-permissions').toggleClass('fs-open');
359
+ });
360
+
361
+ if (requireLicenseKey) {
362
+ /**
363
+ * Submit license key on enter.
364
+ *
365
+ * @author Vova Feldman (@svovaf)
366
+ * @since 1.1.9
367
+ */
368
+ $licenseKeyInput.keypress(function (e) {
369
+ if (e.which == 13) {
370
+ if ('' !== $(this).val()) {
371
+ $primaryCta.click();
372
+ return false;
373
+ }
374
+ }
375
+ });
376
+
377
+ /**
378
+ * Disable activation button when empty license key.
379
+ *
380
+ * @author Vova Feldman (@svovaf)
381
+ * @since 1.1.9
382
+ */
383
+ $licenseKeyInput.on('keyup paste delete cut', function () {
384
+ setTimeout(function () {
385
+ if ('' === $licenseKeyInput.val()) {
386
+ $primaryCta.attr('disabled', 'disabled');
387
+ } else {
388
+ $primaryCta.prop('disabled', false);
389
+ }
390
+ }, 100);
391
+ }).focus();
392
+ }
393
+
394
+ /**
395
+ * Set license mode trigger URL.
396
+ *
397
+ * @author Vova Feldman (@svovaf)
398
+ * @since 1.1.9
399
+ */
400
+ var $connectLicenseModeTrigger = $('#fs_connect .fs-freemium-licensing a');
401
+ if ($connectLicenseModeTrigger.length > 0) {
402
+ $connectLicenseModeTrigger.attr('href', window.location.href + '&require_license=' + $connectLicenseModeTrigger.attr('data-require-license'))
403
+ }
404
+ })(jQuery);
405
  </script>
popup-maker.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: https://wppopupmaker.com/?utm_capmaign=PluginInfo&utm_source=plugin-header&utm_medium=plugin-uri
5
  * Description: Easily create & style popups with any content. Theme editor to quickly style your popups. Add forms, social media boxes, videos & more.
6
  * Author: WP Popup Maker
7
- * Version: 1.5.0
8
  * Author URI: https://wppopupmaker.com/?utm_capmaign=PluginInfo&utm_source=plugin-header&utm_medium=author-uri
9
  * Text Domain: popup-maker
10
  *
@@ -147,7 +147,7 @@ if ( ! class_exists( 'Popup_Maker' ) ) :
147
  }
148
 
149
  if ( ! defined( 'POPMAKE_VERSION' ) ) {
150
- define( 'POPMAKE_VERSION', '1.5.0-beta1' );
151
  }
152
 
153
  if ( ! defined( 'POPMAKE_DB_VERSION' ) ) {
4
  * Plugin URI: https://wppopupmaker.com/?utm_capmaign=PluginInfo&utm_source=plugin-header&utm_medium=plugin-uri
5
  * Description: Easily create & style popups with any content. Theme editor to quickly style your popups. Add forms, social media boxes, videos & more.
6
  * Author: WP Popup Maker
7
+ * Version: 1.5.1
8
  * Author URI: https://wppopupmaker.com/?utm_capmaign=PluginInfo&utm_source=plugin-header&utm_medium=author-uri
9
  * Text Domain: popup-maker
10
  *
147
  }
148
 
149
  if ( ! defined( 'POPMAKE_VERSION' ) ) {
150
+ define( 'POPMAKE_VERSION', '1.5.1' );
151
  }
152
 
153
  if ( ! defined( 'POPMAKE_DB_VERSION' ) ) {
readme.txt CHANGED
@@ -6,7 +6,7 @@ Donate link:
6
  Tags: responsive popup, promotion, popover, pop-up, pop over, marketing, lightbox, advertising, conversion, modal, popup, popups
7
  Requires at least: 3.6
8
  Tested up to: 4.7.2
9
- Stable tag: 1.5.0
10
  License: GNU Version 3 or Any Later Version
11
 
12
  Create any popup imaginable! Customize your popups from head-to-toe and give your site more utility, usability, and conversions.
@@ -87,6 +87,9 @@ There are several common causes for this which include:
87
 
88
  == Changelog ==
89
 
 
 
 
90
  = v1.5.0 - 03/08/2017
91
  * Feature: Position popups based on the click trigger. Tooltips & Popovers are now possible.
92
  * Feature: Added new conditions for targeting children & grandchildren / ancestors of selected content.
6
  Tags: responsive popup, promotion, popover, pop-up, pop over, marketing, lightbox, advertising, conversion, modal, popup, popups
7
  Requires at least: 3.6
8
  Tested up to: 4.7.2
9
+ Stable tag: 1.5.1
10
  License: GNU Version 3 or Any Later Version
11
 
12
  Create any popup imaginable! Customize your popups from head-to-toe and give your site more utility, usability, and conversions.
87
 
88
  == Changelog ==
89
 
90
+ = v1.5.1 - 03/09/2017
91
+ * Fix: PHP 5.2 Compatibility issue.
92
+
93
  = v1.5.0 - 03/08/2017
94
  * Feature: Position popups based on the click trigger. Tooltips & Popovers are now possible.
95
  * Feature: Added new conditions for targeting children & grandchildren / ancestors of selected content.