Meta Tag Manager - Version 2.0.1

Version Description

  • updated freemius SDK to prevent PHP notices
Download this release

Release Info

Developer netweblogic
Plugin Icon 128x128 Meta Tag Manager
Version 2.0.1
Comparing to
See all releases

Code changes from version 2.0 to 2.0.1

freemius/assets/css/admin/connect.css CHANGED
@@ -1 +1 @@
1
- #fs_connect{width:480px;-moz-box-shadow:0px 1px 2px rgba(0,0,0,0.3);-webkit-box-shadow:0px 1px 2px rgba(0,0,0,0.3);box-shadow:0px 1px 2px rgba(0,0,0,0.3);margin:20px 0}@media screen and (max-width: 479px){#fs_connect{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;width:auto;margin:0 0 0 -10px}}#fs_connect .fs-content{background:#fff;padding:15px 20px}#fs_connect .fs-content p{margin:0;padding:0;font-size:1.2em}#fs_connect .fs-actions{padding:10px 20px;background:#C0C7CA}#fs_connect .fs-actions .button{padding:0 10px 1px;line-height:35px;height:37px;font-size:16px;margin-bottom:0}#fs_connect .fs-actions .button .dashicons{font-size:37px;margin-left:-8px;margin-right:12px}#fs_connect .fs-actions .button.button-primary{padding-right:15px;padding-left:15px}#fs_connect .fs-actions .button.button-primary:after{content:' \279C'}#fs_connect .fs-actions .button.button-primary.fs-loading:after{content:''}#fs_connect .fs-actions .button.button-secondary{float:right}#fs_connect.fs-anonymous-disabled .fs-actions .button.button-primary{width:100%}#fs_connect .fs-permissions{padding:10px 20px;background:#FEFEFE;-moz-transition:background 0.5s ease;-o-transition:background 0.5s ease;-ms-transition:background 0.5s ease;-webkit-transition:background 0.5s ease;transition:background 0.5s ease}#fs_connect .fs-permissions .fs-trigger{font-size:0.9em;text-decoration:none;text-align:center;display:block}#fs_connect .fs-permissions ul{height:0;overflow:hidden;margin:0}#fs_connect .fs-permissions ul li{margin-bottom:12px}#fs_connect .fs-permissions ul li:last-child{margin-bottom:0}#fs_connect .fs-permissions ul li i.dashicons{float:left;font-size:40px;width:40px;height:40px}#fs_connect .fs-permissions ul li div{margin-left:55px}#fs_connect .fs-permissions ul li div span{font-weight:bold;text-transform:uppercase;color:#23282d}#fs_connect .fs-permissions ul li div p{margin:2px 0 0 0}#fs_connect .fs-permissions.fs-open{background:#fff}#fs_connect .fs-permissions.fs-open ul{height:auto;margin:20px 20px 10px 20px}@media screen and (max-width: 479px){#fs_connect .fs-permissions{background:#fff}#fs_connect .fs-permissions .fs-trigger{display:none}#fs_connect .fs-permissions ul{height:auto;margin:20px}}#fs_connect .fs-visual{padding:12px;line-height:0;background:#fafafa;height:80px;position:relative}#fs_connect .fs-visual .fs-site-icon{position:absolute;left:20px;top:10px}#fs_connect .fs-visual .fs-connect-logo{position:absolute;right:20px;top:10px}#fs_connect .fs-visual .fs-plugin-icon{position:absolute;top:10px;left:50%;margin-left:-40px}#fs_connect .fs-visual .fs-plugin-icon,#fs_connect .fs-visual .fs-site-icon,#fs_connect .fs-visual img,#fs_connect .fs-visual object{width:80px;height:80px}#fs_connect .fs-visual .dashicons-wordpress{font-size:64px;background:#01749a;color:#fff;width:64px;height:64px;padding:8px}#fs_connect .fs-visual .dashicons-plus{position:absolute;top:50%;font-size:30px;margin-top:-10px;color:#bbb}#fs_connect .fs-visual .dashicons-plus.fs-first{left:28%}#fs_connect .fs-visual .dashicons-plus.fs-second{left:65%}#fs_connect .fs-visual .fs-plugin-icon,#fs_connect .fs-visual .fs-connect-logo,#fs_connect .fs-visual .fs-site-icon{border:1px solid #ccc;padding:1px;background:#fff}#fs_connect .fs-terms{text-align:center;font-size:0.85em;padding:5px;background:rgba(0,0,0,0.05)}#fs_connect .fs-terms,#fs_connect .fs-terms a{color:#999}#fs_connect .fs-terms a{text-decoration:none}.rtl #fs_connect .fs-actions{padding:10px 20px;background:#C0C7CA}.rtl #fs_connect .fs-actions .button .dashicons{font-size:37px;margin-left:-8px;margin-right:12px}.rtl #fs_connect .fs-actions .button.button-primary:after{content:' \000bb'}.rtl #fs_connect .fs-actions .button.button-primary.fs-loading:after{content:''}.rtl #fs_connect .fs-actions .button.button-secondary{float:left}.rtl #fs_connect .fs-permissions ul li div{margin-right:55px;margin-left:0}.rtl #fs_connect .fs-permissions ul li i.dashicons{float:right}.rtl #fs_connect .fs-visual .fs-site-icon{right:20px;left:auto}.rtl #fs_connect .fs-visual .fs-connect-logo{right:auto;left:20px}.wp-pointer-content #fs_connect{margin:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.fs-opt-in-pointer .wp-pointer-content{padding:0}.fs-opt-in-pointer.wp-pointer-top .wp-pointer-arrow{border-bottom-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-top .wp-pointer-arrow-inner{border-bottom-color:#fafafa}.fs-opt-in-pointer.wp-pointer-bottom .wp-pointer-arrow{border-top-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-bottom .wp-pointer-arrow-inner{border-top-color:#fafafa}.fs-opt-in-pointer.wp-pointer-left .wp-pointer-arrow{border-right-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-left .wp-pointer-arrow-inner{border-right-color:#fafafa}.fs-opt-in-pointer.wp-pointer-right .wp-pointer-arrow{border-left-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-right .wp-pointer-arrow-inner{border-left-color:#fafafa}
1
+ #fs_connect{width:480px;-moz-box-shadow:0px 1px 2px rgba(0,0,0,0.3);-webkit-box-shadow:0px 1px 2px rgba(0,0,0,0.3);box-shadow:0px 1px 2px rgba(0,0,0,0.3);margin:20px 0}@media screen and (max-width: 479px){#fs_connect{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;width:auto;margin:0 0 0 -10px}}#fs_connect .fs-content{background:#fff;padding:15px 20px}#fs_connect .fs-content .fs-error{background:snow;color:#d3135a;border:1px solid #d3135a;-moz-box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);text-align:center;padding:5px;margin-bottom:10px}#fs_connect .fs-content p{margin:0;padding:0;font-size:1.2em}#fs_connect .fs-license-key-container{position:relative;width:280px;margin:10px auto 0 auto}#fs_connect .fs-license-key-container input{width:100%}#fs_connect .fs-license-key-container .dashicons{position:absolute;top:5px;right:5px}#fs_connect .fs-actions{padding:10px 20px;background:#C0C7CA}#fs_connect .fs-actions .button{padding:0 10px 1px;line-height:35px;height:37px;font-size:16px;margin-bottom:0}#fs_connect .fs-actions .button .dashicons{font-size:37px;margin-left:-8px;margin-right:12px}#fs_connect .fs-actions .button.button-primary{padding-right:15px;padding-left:15px}#fs_connect .fs-actions .button.button-primary:after{content:' \279C'}#fs_connect .fs-actions .button.button-primary.fs-loading:after{content:''}#fs_connect .fs-actions .button.button-secondary{float:right}#fs_connect.fs-anonymous-disabled .fs-actions .button.button-primary{width:100%}#fs_connect .fs-permissions{padding:10px 20px;background:#FEFEFE;-moz-transition:background 0.5s ease;-o-transition:background 0.5s ease;-ms-transition:background 0.5s ease;-webkit-transition:background 0.5s ease;transition:background 0.5s ease}#fs_connect .fs-permissions .fs-license-sync-disclaimer{text-align:center;margin-top:0}#fs_connect .fs-permissions .fs-trigger{font-size:0.9em;text-decoration:none;text-align:center;display:block}#fs_connect .fs-permissions ul{height:0;overflow:hidden;margin:0}#fs_connect .fs-permissions ul li{margin-bottom:12px}#fs_connect .fs-permissions ul li:last-child{margin-bottom:0}#fs_connect .fs-permissions ul li i.dashicons{float:left;font-size:40px;width:40px;height:40px}#fs_connect .fs-permissions ul li div{margin-left:55px}#fs_connect .fs-permissions ul li div span{font-weight:bold;text-transform:uppercase;color:#23282d}#fs_connect .fs-permissions ul li div p{margin:2px 0 0 0}#fs_connect .fs-permissions.fs-open{background:#fff}#fs_connect .fs-permissions.fs-open ul{height:auto;margin:20px 20px 10px 20px}@media screen and (max-width: 479px){#fs_connect .fs-permissions{background:#fff}#fs_connect .fs-permissions .fs-trigger{display:none}#fs_connect .fs-permissions ul{height:auto;margin:20px}}#fs_connect .fs-freemium-licensing{padding:8px;background:#777;color:#fff}#fs_connect .fs-freemium-licensing p{text-align:center;display:block;margin:0;padding:0}#fs_connect .fs-freemium-licensing a{color:#C2EEFF;text-decoration:underline}#fs_connect .fs-visual{padding:12px;line-height:0;background:#fafafa;height:80px;position:relative}#fs_connect .fs-visual .fs-site-icon{position:absolute;left:20px;top:10px}#fs_connect .fs-visual .fs-connect-logo{position:absolute;right:20px;top:10px}#fs_connect .fs-visual .fs-plugin-icon{position:absolute;top:10px;left:50%;margin-left:-40px}#fs_connect .fs-visual .fs-plugin-icon,#fs_connect .fs-visual .fs-site-icon,#fs_connect .fs-visual img,#fs_connect .fs-visual object{width:80px;height:80px}#fs_connect .fs-visual .dashicons-wordpress{font-size:64px;background:#01749a;color:#fff;width:64px;height:64px;padding:8px}#fs_connect .fs-visual .dashicons-plus{position:absolute;top:50%;font-size:30px;margin-top:-10px;color:#bbb}#fs_connect .fs-visual .dashicons-plus.fs-first{left:28%}#fs_connect .fs-visual .dashicons-plus.fs-second{left:65%}#fs_connect .fs-visual .fs-plugin-icon,#fs_connect .fs-visual .fs-connect-logo,#fs_connect .fs-visual .fs-site-icon{border:1px solid #ccc;padding:1px;background:#fff}#fs_connect .fs-terms{text-align:center;font-size:0.85em;padding:5px;background:rgba(0,0,0,0.05)}#fs_connect .fs-terms,#fs_connect .fs-terms a{color:#999}#fs_connect .fs-terms a{text-decoration:none}.rtl #fs_connect .fs-actions{padding:10px 20px;background:#C0C7CA}.rtl #fs_connect .fs-actions .button .dashicons{font-size:37px;margin-left:-8px;margin-right:12px}.rtl #fs_connect .fs-actions .button.button-primary:after{content:' \000bb'}.rtl #fs_connect .fs-actions .button.button-primary.fs-loading:after{content:''}.rtl #fs_connect .fs-actions .button.button-secondary{float:left}.rtl #fs_connect .fs-permissions ul li div{margin-right:55px;margin-left:0}.rtl #fs_connect .fs-permissions ul li i.dashicons{float:right}.rtl #fs_connect .fs-visual .fs-site-icon{right:20px;left:auto}.rtl #fs_connect .fs-visual .fs-connect-logo{right:auto;left:20px}.wp-pointer-content #fs_connect{margin:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.fs-opt-in-pointer .wp-pointer-content{padding:0}.fs-opt-in-pointer.wp-pointer-top .wp-pointer-arrow{border-bottom-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-top .wp-pointer-arrow-inner{border-bottom-color:#fafafa}.fs-opt-in-pointer.wp-pointer-bottom .wp-pointer-arrow{border-top-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-bottom .wp-pointer-arrow-inner{border-top-color:#fafafa}.fs-opt-in-pointer.wp-pointer-left .wp-pointer-arrow{border-right-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-left .wp-pointer-arrow-inner{border-right-color:#fafafa}.fs-opt-in-pointer.wp-pointer-right .wp-pointer-arrow{border-left-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-right .wp-pointer-arrow-inner{border-left-color:#fafafa}
freemius/assets/css/admin/license-activation.css ADDED
@@ -0,0 +1 @@
 
1
+ .fs-modal{position:fixed;overflow:auto;height:100%;width:100%;top:0;z-index:100000;display:none;background:rgba(0,0,0,0.6)}.fs-modal .fs-modal-dialog{background:transparent;position:absolute;left:50%;margin-left:-298px;padding-bottom:30px;top:-100%;z-index:100001;width:596px}@media (max-width: 650px){.fs-modal .fs-modal-dialog{margin-left:-50%;box-sizing:border-box;padding-left:10px;padding-right:10px;width:100%}.fs-modal .fs-modal-dialog .fs-modal-panel>h3>strong{font-size:1.3em}}.fs-modal.active{display:block}.fs-modal.active:before{display:block}.fs-modal.active .fs-modal-dialog{top:10%}.fs-modal .fs-modal-body,.fs-modal .fs-modal-footer{border:0;background:#fefefe;padding:20px}.fs-modal .fs-modal-body{border-bottom:0}.fs-modal .fs-modal-body input.license_key{width:100%}.fs-modal .fs-modal-body p{font-size:14px}.fs-modal .fs-modal-body h2{font-size:20px}.fs-modal .fs-modal-body>div{margin-top:10px}.fs-modal .fs-modal-body>div h2{font-weight:bold;font-size:20px;margin-top:0}.fs-modal .fs-modal-footer{border-top:#eeeeee solid 1px;text-align:right}.fs-modal .fs-modal-footer>.button{margin:0 7px}.fs-modal .fs-modal-footer>.button:first-child{margin:0}.fs-modal .fs-modal-panel:not(.active){display:none}body.has-fs-modal{overflow:hidden}
freemius/assets/scss/admin/connect.scss CHANGED
@@ -1,421 +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
- p
23
- {
24
- margin: 0;
25
- padding: 0;
26
- font-size: 1.2em;
27
- }
28
- }
29
-
30
- .fs-actions
31
- {
32
- padding: 10px 20px;
33
- background: #C0C7CA;
34
-
35
- .button
36
- {
37
- padding: 0 10px 1px;
38
- line-height: 35px;
39
- height: 37px;
40
- font-size: 16px;
41
- margin-bottom: 0;
42
-
43
- .dashicons
44
- {
45
- font-size: 37px;
46
- margin-left: -8px;
47
- margin-right: 12px;
48
- }
49
-
50
- &.button-primary
51
- {
52
- padding-right: 15px;
53
- padding-left: 15px;
54
-
55
- &:after
56
- {
57
- content: ' \279C';
58
- }
59
-
60
- &.fs-loading
61
- {
62
- &:after
63
- {
64
- content: '';
65
- }
66
- }
67
- }
68
-
69
- &.button-secondary
70
- {
71
- float: right;
72
- }
73
- }
74
-
75
- // .fs-skip
76
- // {
77
- // line-height: 38px;
78
- // vertical-align: middle;
79
- // text-decoration: none;
80
- // margin-left: 10px;
81
- // }
82
- }
83
-
84
- &.fs-anonymous-disabled
85
- {
86
- .fs-actions
87
- {
88
- .button.button-primary
89
- {
90
- width: 100%;
91
- }
92
- }
93
- }
94
-
95
- .fs-permissions
96
- {
97
- padding: 10px 20px;
98
- background: #FEFEFE;
99
- // background: #F1F1F1;
100
- @include transition(background 0.5s ease);
101
-
102
- .fs-trigger
103
- {
104
- font-size: 0.9em;
105
- text-decoration: none;
106
- text-align: center;
107
- display: block;
108
- }
109
-
110
- ul
111
- {
112
- height: 0;
113
- overflow: hidden;
114
- margin: 0;
115
-
116
- li
117
- {
118
- margin-bottom: 12px;
119
-
120
- &:last-child
121
- {
122
- margin-bottom: 0;
123
- }
124
-
125
- i.dashicons
126
- {
127
- float: left;
128
- font-size: 40px;
129
- width: 40px;
130
- height: 40px;
131
- }
132
-
133
- div
134
- {
135
- margin-left: 55px;
136
-
137
- span
138
- {
139
- font-weight: bold;
140
- text-transform: uppercase;
141
- color: #23282d;
142
- }
143
-
144
- p
145
- {
146
- margin: 2px 0 0 0;
147
- }
148
- }
149
- }
150
- }
151
-
152
- &.fs-open
153
- {
154
- background: #fff;
155
-
156
- ul
157
- {
158
- height: auto;
159
- margin: 20px 20px 10px 20px;
160
- }
161
- }
162
-
163
- @media screen and (max-width: ($form_width - 1)) {
164
- background: #fff;
165
-
166
- .fs-trigger
167
- {
168
- display: none;
169
- }
170
-
171
- ul
172
- {
173
- height: auto;
174
- margin: 20px;
175
- }
176
- }
177
- }
178
-
179
- $icon_size: 80px;
180
- $wp_logo_padding: $icon_size / 10;
181
- $icons_top: 10px;
182
-
183
- .fs-visual
184
- {
185
- padding: 12px;
186
- line-height: 0;
187
- background: #fafafa;
188
- height: $icon_size;
189
- position: relative;
190
-
191
- .fs-site-icon
192
- {
193
- position: absolute;
194
- left: 20px;
195
- top: $icons_top;
196
- }
197
-
198
- .fs-connect-logo
199
- {
200
- position: absolute;
201
- right: 20px;
202
- top: $icons_top;
203
- }
204
-
205
- .fs-plugin-icon
206
- {
207
- position: absolute;
208
- top: $icons_top;
209
- left: 50%;
210
- margin-left: - ($icon_size / 2);
211
- }
212
-
213
- .fs-plugin-icon,
214
- .fs-site-icon,
215
- img,
216
- object
217
- {
218
- width: $icon_size;
219
- height: $icon_size;
220
- }
221
-
222
- .dashicons-wordpress
223
- {
224
- font-size: $icon_size - ($wp_logo_padding * 2);
225
- background: $wordpress_color;
226
- color: #fff;
227
- width: $icon_size - ($wp_logo_padding * 2);
228
- height: $icon_size - ($wp_logo_padding * 2);
229
- padding: $wp_logo_padding;
230
- }
231
-
232
- .dashicons-plus
233
- {
234
- position: absolute;
235
- top: 50%;
236
- font-size: 30px;
237
- margin-top: -10px;
238
- color: #bbb;
239
-
240
- &.fs-first
241
- {
242
- left: 28%;
243
- }
244
- &.fs-second
245
- {
246
- left: 65%;
247
- }
248
- }
249
-
250
- .fs-plugin-icon,
251
- .fs-connect-logo,
252
- .fs-site-icon
253
- {
254
- border: 1px solid #ccc;
255
- padding: 1px;
256
- background: #fff;
257
- }
258
- }
259
-
260
- .fs-terms
261
- {
262
- text-align: center;
263
- font-size: 0.85em;
264
- padding: 5px;
265
- background: rgba(0, 0, 0, 0.05);
266
-
267
- &, a
268
- {
269
- color: #999;
270
- }
271
-
272
- a
273
- {
274
- text-decoration: none;
275
- }
276
- }
277
- }
278
-
279
- .rtl
280
- {
281
- #fs_connect
282
- {
283
- .fs-actions
284
- {
285
- padding: 10px 20px;
286
- background: #C0C7CA;
287
-
288
- .button
289
- {
290
- .dashicons
291
- {
292
- font-size: 37px;
293
- margin-left: -8px;
294
- margin-right: 12px;
295
- }
296
-
297
- &.button-primary
298
- {
299
- &:after
300
- {
301
- content: ' \000bb';
302
- }
303
-
304
- &.fs-loading
305
- {
306
- &:after
307
- {
308
- content: '';
309
- }
310
- }
311
- }
312
-
313
- &.button-secondary
314
- {
315
- float: left;
316
- }
317
- }
318
- }
319
-
320
- .fs-permissions
321
- {
322
- ul
323
- {
324
- li
325
- {
326
- div
327
- {
328
- margin-right: 55px;
329
- margin-left: 0;
330
- }
331
-
332
- i.dashicons
333
- {
334
- float: right;
335
- }
336
-
337
- }
338
- }
339
- }
340
-
341
- .fs-visual
342
- {
343
- .fs-site-icon
344
- {
345
- right: 20px;
346
- left: auto;
347
- }
348
-
349
- .fs-connect-logo
350
- {
351
- right: auto;
352
- left: 20px;
353
- }
354
- }
355
- }
356
- }
357
-
358
- .wp-pointer-content
359
- {
360
- #fs_connect
361
- {
362
- margin: 0;
363
- @include box-shadow(none);
364
- }
365
- }
366
-
367
- .fs-opt-in-pointer
368
- {
369
- .wp-pointer-content
370
- {
371
- padding: 0;
372
- }
373
-
374
- &.wp-pointer-top
375
- {
376
- .wp-pointer-arrow
377
- {
378
- border-bottom-color: #dfdfdf;
379
- }
380
- .wp-pointer-arrow-inner
381
- {
382
- border-bottom-color: #fafafa;
383
- }
384
- }
385
-
386
- &.wp-pointer-bottom
387
- {
388
- .wp-pointer-arrow
389
- {
390
- border-top-color: #dfdfdf;
391
- }
392
- .wp-pointer-arrow-inner
393
- {
394
- border-top-color: #fafafa;
395
- }
396
- }
397
-
398
- &.wp-pointer-left
399
- {
400
- .wp-pointer-arrow
401
- {
402
- border-right-color: #dfdfdf;
403
- }
404
- .wp-pointer-arrow-inner
405
- {
406
- border-right-color: #fafafa;
407
- }
408
- }
409
-
410
- &.wp-pointer-right
411
- {
412
- .wp-pointer-arrow
413
- {
414
- border-left-color: #dfdfdf;
415
- }
416
- .wp-pointer-arrow-inner
417
- {
418
- border-left-color: #fafafa;
419
- }
420
- }
421
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ }
freemius/assets/scss/admin/license-activation.scss ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .fs-modal {
2
+ position: fixed;
3
+ overflow: auto;
4
+ height: 100%;
5
+ width: 100%;
6
+ top: 0;
7
+ z-index: 100000;
8
+ display: none;
9
+ background: rgba(0, 0, 0, 0.6);
10
+
11
+ .fs-modal-dialog {
12
+ background: transparent;
13
+ position: absolute;
14
+ left: 50%;
15
+ margin-left: -298px;
16
+ padding-bottom: 30px;
17
+ top: -100%;
18
+ z-index: 100001;
19
+ width: 596px;
20
+
21
+ @media (max-width: 650px) {
22
+ margin-left: -50%;
23
+ box-sizing: border-box;
24
+ padding-left: 10px;
25
+ padding-right: 10px;
26
+ width: 100%;
27
+
28
+ .fs-modal-panel > h3 > strong {
29
+ font-size: 1.3em;
30
+ }
31
+ }
32
+ }
33
+
34
+ &.active {
35
+ display: block;
36
+
37
+ &:before {
38
+ display: block;
39
+ }
40
+
41
+ .fs-modal-dialog {
42
+ top: 10%;
43
+ }
44
+ }
45
+
46
+ .fs-modal-body,
47
+ .fs-modal-footer {
48
+ border: 0;
49
+ background: #fefefe;
50
+ padding: 20px;
51
+ }
52
+
53
+ .fs-modal-body {
54
+ border-bottom: 0;
55
+
56
+ input.license_key {
57
+ width: 100%;
58
+ }
59
+
60
+ p {
61
+ font-size: 14px;
62
+ }
63
+
64
+ h2 {
65
+ font-size: 20px;
66
+ }
67
+
68
+ > div {
69
+ margin-top: 10px;
70
+
71
+ h2 {
72
+ font-weight: bold;
73
+ font-size: 20px;
74
+ margin-top: 0;
75
+ }
76
+ }
77
+ }
78
+
79
+ .fs-modal-footer {
80
+ border-top: #eeeeee solid 1px;
81
+ text-align: right;
82
+
83
+ > .button {
84
+ margin: 0 7px;
85
+
86
+ &:first-child {
87
+ margin: 0;
88
+ }
89
+ }
90
+ }
91
+
92
+ .fs-modal-panel:not(.active) {
93
+ display: none;
94
+ }
95
+ }
96
+
97
+ body.has-fs-modal {
98
+ overflow: hidden;
99
+ }
freemius/includes/class-freemius-abstract.php CHANGED
@@ -109,6 +109,16 @@
109
  return ( $this->is_paying() || $this->is_trial() );
110
  }
111
 
 
 
 
 
 
 
 
 
 
 
112
  #region Premium Only ------------------------------------------------------------------
113
 
114
  /**
@@ -201,6 +211,20 @@
201
  return $this->is_paying__premium_only();
202
  }
203
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  #endregion Premium Only ------------------------------------------------------------------
205
 
206
  #region Trial ------------------------------------------------------------------
@@ -295,6 +319,32 @@
295
  */
296
  abstract function has_free_plan();
297
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298
  #endregion Plans ------------------------------------------------------------------
299
 
300
  /**
109
  return ( $this->is_paying() || $this->is_trial() );
110
  }
111
 
112
+ /**
113
+ * Check if user in a trial or have feature enabled license.
114
+ *
115
+ * @author Vova Feldman (@svovaf)
116
+ * @since 1.1.7
117
+ *
118
+ * @return bool
119
+ */
120
+ abstract function can_use_premium_code();
121
+
122
  #region Premium Only ------------------------------------------------------------------
123
 
124
  /**
211
  return $this->is_paying__premium_only();
212
  }
213
 
214
+ /**
215
+ * Check if user in a trial or have feature enabled license.
216
+ *
217
+ * All code wrapped in this statement will be only included in the premium code.
218
+ *
219
+ * @author Vova Feldman (@svovaf)
220
+ * @since 1.1.9
221
+ *
222
+ * @return bool
223
+ */
224
+ function can_use_premium_code__premium_only() {
225
+ return $this->is_premium() && $this->can_use_premium_code();
226
+ }
227
+
228
  #endregion Premium Only ------------------------------------------------------------------
229
 
230
  #region Trial ------------------------------------------------------------------
319
  */
320
  abstract function has_free_plan();
321
 
322
+ /**
323
+ * Check if plugin is premium only (no free plans).
324
+ *
325
+ * NOTE: is__premium_only() is very different method, don't get confused.
326
+ *
327
+ * @author Vova Feldman (@svovaf)
328
+ * @since 1.1.9
329
+ *
330
+ * @return bool
331
+ */
332
+ abstract function is_only_premium();
333
+
334
+ /**
335
+ * Checks if it's a freemium plugin.
336
+ *
337
+ * @author Vova Feldman (@svovaf)
338
+ * @since 1.1.9
339
+ *
340
+ * @return bool
341
+ */
342
+ function is_freemium() {
343
+ return ! $this->is_only_premium() &&
344
+ $this->has_paid_plan() &&
345
+ $this->has_free_plan();
346
+ }
347
+
348
  #endregion Plans ------------------------------------------------------------------
349
 
350
  /**
freemius/includes/class-freemius.php CHANGED
@@ -102,6 +102,12 @@
102
  */
103
  private $_anonymous_mode;
104
 
 
 
 
 
 
 
105
  /**
106
  * @since 1.0.8
107
  * @var bool Hints the SDK if the plugin has any paid plans.
@@ -146,7 +152,7 @@
146
  /**
147
  * @since 1.0.4
148
  *
149
- * @var FS_Plugin
150
  */
151
  private $_parent_plugin = false;
152
  /**
@@ -363,6 +369,54 @@
363
  }
364
  }
365
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
366
  /**
367
  * @author Vova Feldman (@svovaf)
368
  * @since 1.0.9
@@ -375,6 +429,21 @@
375
  '_activate_plugin_event_hook'
376
  ) );
377
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
378
  // Hook to plugin uninstall.
379
  register_uninstall_hook( $this->_plugin_main_file_path, array( 'Freemius', '_uninstall_plugin_hook' ) );
380
 
@@ -808,13 +877,15 @@
808
  * @author Vova Feldman (@svovaf)
809
  * @since 1.0.7
810
  *
 
 
811
  * @return bool
812
  */
813
- function is_activation_mode() {
814
  return (
815
- $this->is_on() &&
816
  ! $this->is_registered() &&
817
- ( ! $this->enable_anonymous() ||
818
  ( ! $this->is_anonymous() && ! $this->is_pending_activation() ) )
819
  );
820
  }
@@ -1267,7 +1338,7 @@
1267
  private function turn_on() {
1268
  $this->_logger->entrance();
1269
 
1270
- if ($this->is_on() || ! isset( $this->_storage->connectivity_test['is_active'] ) ) {
1271
  return false;
1272
  }
1273
 
@@ -1971,7 +2042,10 @@
1971
  // @todo This should be only executed on activation. It should be migrated to register_activation_hook() together with other activation related logic.
1972
  if ( $this->is_premium() ) {
1973
  // Remove add-on download admin-notice.
1974
- $this->_parent->_admin_notices->remove_sticky( 'addon_plan_upgraded_' . $this->_slug );
 
 
 
1975
  }
1976
 
1977
  $this->deactivate_premium_only_addon_without_license();
@@ -2036,6 +2110,18 @@
2036
  $this->do_action( 'after_init_addon_pending_activations' );
2037
  }
2038
  }
 
 
 
 
 
 
 
 
 
 
 
 
2039
  }
2040
 
2041
  /**
@@ -2057,6 +2143,14 @@
2057
  $parent_id = $this->get_numeric_option( $plugin_info, 'parent_id', null );
2058
  $parent_name = $this->get_option( $plugin_info, 'parent_name', null );
2059
 
 
 
 
 
 
 
 
 
2060
  if ( isset( $plugin_info['parent'] ) ) {
2061
  $parent_id = $this->get_numeric_option( $plugin_info['parent'], 'id', null );
2062
  // $parent_slug = $this->get_option( $plugin_info['parent'], 'slug', null );
@@ -2110,9 +2204,16 @@
2110
  $this->_has_addons = $this->get_bool_option( $plugin_info, 'has_addons', false );
2111
  $this->_has_paid_plans = $this->get_bool_option( $plugin_info, 'has_paid_plans', true );
2112
  $this->_is_org_compliant = $this->get_bool_option( $plugin_info, 'is_org_compliant', true );
2113
- $this->_enable_anonymous = $this->get_bool_option( $plugin_info, 'enable_anonymous', true );
2114
- $this->_anonymous_mode = $this->get_bool_option( $plugin_info, 'anonymous_mode', false );
2115
- $this->_permissions = $this->get_option( $plugin_info, 'permissions', array() );
 
 
 
 
 
 
 
2116
  }
2117
 
2118
  /**
@@ -2143,6 +2244,19 @@
2143
  * @return bool
2144
  */
2145
  private function should_stop_execution() {
 
 
 
 
 
 
 
 
 
 
 
 
 
2146
  if ( $this->is_activation_mode() ) {
2147
  if ( ! is_admin() ) {
2148
  /**
@@ -2419,28 +2533,51 @@
2419
  ! $this->has_features_enabled_license() &&
2420
  ! $this->_has_premium_license()
2421
  ) {
2422
- deactivate_plugins( array( $this->_plugin_basename ), true );
 
 
 
 
 
 
 
 
 
 
 
2423
 
2424
- $this->_parent->_admin_notices->add_sticky(
2425
- sprintf(
2426
- __fs( ( $is_after_trial_cancel ?
2427
- 'addon-trial-cancelled-message' :
2428
- 'addon-no-license-message' ),
2429
- $this->_parent->_slug
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2430
  ),
2431
- '<b>' . $this->_plugin->title . '</b>'
2432
- ) . ' ' . sprintf(
2433
- '<a href="%s" aria-label="%s" class="button button-primary" style="margin-left: 10px; vertical-align: middle;">%s &nbsp;&#10140;</a>',
2434
- $this->_parent->addon_url( $this->_slug ),
2435
- esc_attr( sprintf( __fs( 'more-information-about-x', $this->_parent->_slug ), $this->_plugin->title ) ),
2436
- __fs( 'purchase-license', $this->_parent->_slug )
2437
- ),
2438
- 'no_addon_license',
2439
- ( $is_after_trial_cancel ? '' : __fs( 'oops', $this->_parent->_slug ) . '...' ),
2440
- ( $is_after_trial_cancel ? 'success' : 'error' )
2441
- );
2442
 
2443
- return true;
 
2444
  }
2445
 
2446
  return false;
@@ -2920,7 +3057,7 @@
2920
  if ( ! $this->is_addon() && ! $this->is_registered() && ! $this->is_anonymous() ) {
2921
  if ( ! $this->is_pending_activation() ) {
2922
  if ( ! $this->_menu->is_activation_page() ) {
2923
- if ( $this->is_plugin_new_install() ) {
2924
  // Show notice for new plugin installations.
2925
  $this->_admin_notices->add(
2926
  sprintf(
@@ -3220,6 +3357,16 @@
3220
  // Store hint that the plugin was just activated to enable auto-redirection to settings.
3221
  add_option( "fs_{$this->_slug}_activated", true );
3222
  }
 
 
 
 
 
 
 
 
 
 
3223
  }
3224
 
3225
  /**
@@ -4942,7 +5089,55 @@
4942
  * @return bool
4943
  */
4944
  function has_free_plan() {
4945
- return FS_Plan_Manager::instance()->has_free_plan( $this->_plans );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4946
  }
4947
 
4948
  #region URL Generators
@@ -5086,15 +5281,41 @@
5086
  /**
5087
  * Check if plugin can work in anonymous mode.
5088
  *
5089
- * @author Vova Feldman (@svovaf)
5090
- * @since 1.0.9
5091
  *
5092
  * @return bool
 
 
5093
  */
5094
  function enable_anonymous() {
5095
  return $this->_enable_anonymous;
5096
  }
5097
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5098
  /**
5099
  * Check if feature supported with current site's plan.
5100
  *
@@ -5600,10 +5821,11 @@
5600
  * @param string|bool $email
5601
  * @param string|bool $first
5602
  * @param string|bool $last
 
5603
  *
5604
  * @return bool Is successful opt-in (or set to pending).
5605
  */
5606
- function opt_in( $email = false, $first = false, $last = false ) {
5607
  $this->_logger->entrance();
5608
 
5609
  if ( false === $email ) {
@@ -5629,7 +5851,12 @@
5629
  $user_info['user_lastname'] = $last;
5630
  }
5631
 
5632
- $params = $this->get_opt_in_params( $user_info );
 
 
 
 
 
5633
  $params['format'] = 'json';
5634
 
5635
  $url = WP_FS__ADDRESS . '/action/service/user/install/';
@@ -5786,6 +6013,14 @@
5786
 
5787
  }
5788
  } else {
 
 
 
 
 
 
 
 
5789
  // Reload the page with the keys.
5790
  if ( $redirect && fs_redirect( $this->get_after_activation_url( 'after_connect_url' ) ) ) {
5791
  exit();
@@ -5930,13 +6165,25 @@
5930
  // We have to set the user before getting user scope API handler.
5931
  $this->_user = $user;
5932
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5933
  // Install the plugin.
5934
  $install = $this->get_api_user_scope()->call(
5935
  "/plugins/{$this->get_id()}/installs.json",
5936
  'post',
5937
- $this->get_install_data_for_api( array(
5938
- 'uid' => $this->get_anonymous_id(),
5939
- ), false, false )
5940
  );
5941
 
5942
  if ( isset( $install->error ) ) {
@@ -6041,11 +6288,11 @@
6041
  // return;
6042
  // }
6043
 
6044
- if ( ! $this->has_api_connectivity() && ! $this->enable_anonymous() ) {
6045
  $this->_menu->remove_menu_item();
6046
  } else {
6047
- $this->add_submenu_items();
6048
  $this->add_menu_action();
 
6049
  }
6050
  }
6051
 
@@ -6330,7 +6577,13 @@
6330
  private function order_sub_submenu_items() {
6331
  global $submenu;
6332
 
6333
- $top_level_menu = &$submenu[ $this->_menu->get_top_level_menu_slug() ];
 
 
 
 
 
 
6334
 
6335
  $all_submenu_items_after = array();
6336
 
@@ -7413,9 +7666,19 @@
7413
  $is_free = $this->is_free_plan();
7414
 
7415
  // Make sure license exist and not expired.
7416
- $new_license = is_null( $site->license_id ) ? null : $this->_get_license_by_id( $site->license_id );
 
 
7417
 
7418
- if ( $is_free && ( ( ! is_object( $new_license ) || $new_license->is_expired() ) ) ) {
 
 
 
 
 
 
 
 
7419
  // The license is expired, so ignore upgrade method.
7420
  } else {
7421
  // License changed.
@@ -7471,10 +7734,9 @@
7471
  ),
7472
  __fs( 'contact-us-here', $this->_slug )
7473
  ),
7474
- '<i>' . $plan->title . ( $this->is_trial() ? ' ' . __fs( 'trial', $this->_slug ) : '' ) . '</i>'
7475
  ),
7476
- __fs( 'hmm', $this->_slug ) . '...',
7477
- 'error'
7478
  );
7479
  }
7480
  break;
@@ -7523,6 +7785,19 @@
7523
  );
7524
  $this->_admin_notices->remove_sticky( 'plan_upgraded' );
7525
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
7526
  case 'expired':
7527
  $this->_admin_notices->add_sticky(
7528
  sprintf( __fs( 'license-expired-non-blocking-message', $this->_slug ), $this->_site->plan->title ),
@@ -7592,6 +7867,21 @@
7592
  return;
7593
  }
7594
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7595
  $api = $this->get_api_site_scope();
7596
  $license = $api->call( "/licenses/{$premium_license->id}.json", 'put' );
7597
 
@@ -7762,7 +8052,7 @@
7762
  *
7763
  * @return bool If trial was successfully started.
7764
  */
7765
- function start_trial($plan_name = false) {
7766
  $this->_logger->entrance();
7767
 
7768
  if ( $this->is_trial() ) {
@@ -9132,6 +9422,26 @@
9132
  }
9133
  }
9134
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9135
  /**
9136
  * Get the URL of the page that should be loaded right after the plugin activation.
9137
  *
102
  */
103
  private $_anonymous_mode;
104
 
105
+ /**
106
+ * @since 1.1.9
107
+ * @var bool Hints the SDK if plugin have any free plans.
108
+ */
109
+ private $_is_premium_only;
110
+
111
  /**
112
  * @since 1.0.8
113
  * @var bool Hints the SDK if the plugin has any paid plans.
152
  /**
153
  * @since 1.0.4
154
  *
155
+ * @var FS_Plugin|false
156
  */
157
  private $_parent_plugin = false;
158
  /**
369
  }
370
  }
371
 
372
+ /**
373
+ * This action is connected to the 'plugins_loaded' hook and helps to determine
374
+ * if this is a new plugin installation or a plugin update.
375
+ *
376
+ * There are 3 different use-cases:
377
+ * 1) New plugin installation right with Freemius:
378
+ * 1.1 _activate_plugin_event_hook() will be executed first
379
+ * 1.2 Since $this->_storage->is_plugin_new_install is not set,
380
+ * and $this->_storage->plugin_last_version is not set,
381
+ * $this->_storage->is_plugin_new_install will be set to TRUE.
382
+ * 1.3 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install will
383
+ * be already set to TRUE.
384
+ *
385
+ * 2) Plugin update, didn't have Freemius before, and now have the SDK:
386
+ * 2.1 _activate_plugin_event_hook() will not be executed, because
387
+ * the activation hook do NOT fires on updates since WP 3.1.
388
+ * 2.2 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install will
389
+ * be empty, therefore, it will be set to FALSE.
390
+ *
391
+ * 3) Plugin update, had Freemius in prev version as well:
392
+ * 3.1 _version_updates_handler() will be executed 1st, since FS was installed
393
+ * before, $this->_storage->plugin_last_version will NOT be empty,
394
+ * therefore, $this->_storage->is_plugin_new_install will be set to FALSE.
395
+ * 3.2 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install is
396
+ * already set, therefore, it will not be modified.
397
+ *
398
+ * Use-case #3 is backward compatible, #3.1 will be executed since 1.0.9.
399
+ *
400
+ * NOTE:
401
+ * The only fallback of this mechanism is if an admin updates a plugin based on use-case #2,
402
+ * and then, the next immediate PageView is the plugin's main settings page, it will not
403
+ * show the opt-in right away. The reason it will happen is because Freemius execution
404
+ * will be turned off till the plugin is fully loaded at least once
405
+ * (till $this->_storage->was_plugin_loaded is TRUE).
406
+ *
407
+ * @author Vova Feldman (@svovaf)
408
+ * @since 1.1.9
409
+ *
410
+ */
411
+ function _plugins_loaded() {
412
+ // Update flag that plugin was loaded with Freemius at least once.
413
+ $this->_storage->was_plugin_loaded = true;
414
+
415
+ if ( ! isset( $this->_storage->is_plugin_new_install ) ) {
416
+ $this->_storage->is_plugin_new_install = false;
417
+ }
418
+ }
419
+
420
  /**
421
  * @author Vova Feldman (@svovaf)
422
  * @since 1.0.9
429
  '_activate_plugin_event_hook'
430
  ) );
431
 
432
+ /**
433
+ * Part of the mechanism to identify new plugin install vs. plugin update.
434
+ *
435
+ * @author Vova Feldman (@svovaf)
436
+ * @since 1.1.9
437
+ */
438
+ if ( empty( $this->_storage->was_plugin_loaded ) ) {
439
+ if ( $this->is_activation_mode( false ) ) {
440
+ add_action( 'plugins_loaded', array( &$this, '_plugins_loaded' ) );
441
+ } else {
442
+ // If was activated before, then it was already loaded before.
443
+ $this->_plugins_loaded();
444
+ }
445
+ }
446
+
447
  // Hook to plugin uninstall.
448
  register_uninstall_hook( $this->_plugin_main_file_path, array( 'Freemius', '_uninstall_plugin_hook' ) );
449
 
877
  * @author Vova Feldman (@svovaf)
878
  * @since 1.0.7
879
  *
880
+ * @param bool $and_on
881
+ *
882
  * @return bool
883
  */
884
+ function is_activation_mode( $and_on = true ) {
885
  return (
886
+ ( $this->is_on() || ! $and_on ) &&
887
  ! $this->is_registered() &&
888
+ ( ! $this->is_enable_anonymous() ||
889
  ( ! $this->is_anonymous() && ! $this->is_pending_activation() ) )
890
  );
891
  }
1338
  private function turn_on() {
1339
  $this->_logger->entrance();
1340
 
1341
+ if ( $this->is_on() || ! isset( $this->_storage->connectivity_test['is_active'] ) ) {
1342
  return false;
1343
  }
1344
 
2042
  // @todo This should be only executed on activation. It should be migrated to register_activation_hook() together with other activation related logic.
2043
  if ( $this->is_premium() ) {
2044
  // Remove add-on download admin-notice.
2045
+ $this->_parent->_admin_notices->remove_sticky( array(
2046
+ 'addon_plan_upgraded_' . $this->_slug,
2047
+ 'no_addon_license_' . $this->_slug,
2048
+ ) );
2049
  }
2050
 
2051
  $this->deactivate_premium_only_addon_without_license();
2110
  $this->do_action( 'after_init_addon_pending_activations' );
2111
  }
2112
  }
2113
+
2114
+ // Add license activation link and AJAX request handler.
2115
+ if ( $this->has_paid_plan() ) {
2116
+ $this->_add_license_action_link();
2117
+
2118
+ global $pagenow;
2119
+ if ( 'plugins.php' === $pagenow ) {
2120
+ add_action( 'admin_footer', array( &$this, '_add_license_activation_dialog_box' ) );
2121
+ }
2122
+
2123
+ add_action( 'wp_ajax_activate-license', array( &$this, '_activate_license_ajax_action' ) );
2124
+ }
2125
  }
2126
 
2127
  /**
2143
  $parent_id = $this->get_numeric_option( $plugin_info, 'parent_id', null );
2144
  $parent_name = $this->get_option( $plugin_info, 'parent_name', null );
2145
 
2146
+ /**
2147
+ * @author Vova Feldman (@svovaf)
2148
+ * @since 1.1.9 Try to pull secret key from external config.
2149
+ */
2150
+ if ( is_null( $secret_key ) && defined( "WP_FS__{$this->_slug}_SECRET_KEY" ) ) {
2151
+ $secret_key = constant( "WP_FS__{$this->_slug}_SECRET_KEY" );
2152
+ }
2153
+
2154
  if ( isset( $plugin_info['parent'] ) ) {
2155
  $parent_id = $this->get_numeric_option( $plugin_info['parent'], 'id', null );
2156
  // $parent_slug = $this->get_option( $plugin_info['parent'], 'slug', null );
2204
  $this->_has_addons = $this->get_bool_option( $plugin_info, 'has_addons', false );
2205
  $this->_has_paid_plans = $this->get_bool_option( $plugin_info, 'has_paid_plans', true );
2206
  $this->_is_org_compliant = $this->get_bool_option( $plugin_info, 'is_org_compliant', true );
2207
+ $this->_is_premium_only = $this->get_bool_option( $plugin_info, 'is_premium_only', false );
2208
+ if ( $this->_is_premium_only ) {
2209
+ // If premium only plugin, disable anonymous mode.
2210
+ $this->_enable_anonymous = false;
2211
+ $this->_anonymous_mode = false;
2212
+ } else {
2213
+ $this->_enable_anonymous = $this->get_bool_option( $plugin_info, 'enable_anonymous', true );
2214
+ $this->_anonymous_mode = $this->get_bool_option( $plugin_info, 'anonymous_mode', false );
2215
+ }
2216
+ $this->_permissions = $this->get_option( $plugin_info, 'permissions', array() );
2217
  }
2218
 
2219
  /**
2244
  * @return bool
2245
  */
2246
  private function should_stop_execution() {
2247
+ if ( empty( $this->_storage->was_plugin_loaded ) ) {
2248
+ /**
2249
+ * Don't execute Freemius until plugin was fully loaded at least once,
2250
+ * to give the opportunity for the activation hook to run before pinging
2251
+ * the API for connectivity test. This logic is relevant for the
2252
+ * identification of new plugin install vs. plugin update.
2253
+ *
2254
+ * @author Vova Feldman (@svovaf)
2255
+ * @since 1.1.9
2256
+ */
2257
+ return true;
2258
+ }
2259
+
2260
  if ( $this->is_activation_mode() ) {
2261
  if ( ! is_admin() ) {
2262
  /**
2533
  ! $this->has_features_enabled_license() &&
2534
  ! $this->_has_premium_license()
2535
  ) {
2536
+ // IF wrapper is turned off because activation_timestamp is currently only stored for plugins (not addons).
2537
+ // if (empty($this->_storage->activation_timestamp) ||
2538
+ // (WP_FS__SCRIPT_START_TIME - $this->_storage->activation_timestamp) > 30
2539
+ // ) {
2540
+ /**
2541
+ * @todo When it's first fail, there's no reason to try and re-sync because the licenses were just synced after initial activation.
2542
+ *
2543
+ * Retry syncing the user add-on licenses.
2544
+ */
2545
+ // Sync licenses.
2546
+ $this->_sync_licenses();
2547
+ // }
2548
 
2549
+ // Try to activate premium license.
2550
+ $this->_activate_license( true );
2551
+
2552
+ if ( ! $this->has_free_plan() &&
2553
+ ! $this->has_features_enabled_license() &&
2554
+ ! $this->_has_premium_license()
2555
+ ) {
2556
+ // @todo Check if deactivate plugins also call the deactivation hook.
2557
+
2558
+ deactivate_plugins( array( $this->_plugin_basename ), true );
2559
+
2560
+ $this->_parent->_admin_notices->add_sticky(
2561
+ sprintf(
2562
+ __fs( ( $is_after_trial_cancel ?
2563
+ 'addon-trial-cancelled-message' :
2564
+ 'addon-no-license-message' ),
2565
+ $this->_parent->_slug
2566
+ ),
2567
+ '<b>' . $this->_plugin->title . '</b>'
2568
+ ) . ' ' . sprintf(
2569
+ '<a href="%s" aria-label="%s" class="button button-primary" style="margin-left: 10px; vertical-align: middle;">%s &nbsp;&#10140;</a>',
2570
+ $this->_parent->addon_url( $this->_slug ),
2571
+ esc_attr( sprintf( __fs( 'more-information-about-x', $this->_parent->_slug ), $this->_plugin->title ) ),
2572
+ __fs( 'purchase-license', $this->_parent->_slug )
2573
  ),
2574
+ 'no_addon_license_' . $this->_slug,
2575
+ ( $is_after_trial_cancel ? '' : __fs( 'oops', $this->_parent->_slug ) . '...' ),
2576
+ ( $is_after_trial_cancel ? 'success' : 'error' )
2577
+ );
 
 
 
 
 
 
 
2578
 
2579
+ return true;
2580
+ }
2581
  }
2582
 
2583
  return false;
3057
  if ( ! $this->is_addon() && ! $this->is_registered() && ! $this->is_anonymous() ) {
3058
  if ( ! $this->is_pending_activation() ) {
3059
  if ( ! $this->_menu->is_activation_page() ) {
3060
+ if ( $this->is_plugin_new_install() || $this->is_only_premium() ) {
3061
  // Show notice for new plugin installations.
3062
  $this->_admin_notices->add(
3063
  sprintf(
3357
  // Store hint that the plugin was just activated to enable auto-redirection to settings.
3358
  add_option( "fs_{$this->_slug}_activated", true );
3359
  }
3360
+
3361
+ /**
3362
+ * Activation hook is executed after the plugin's main file is loaded, therefore,
3363
+ * after the plugin was loaded. The logic is located at activate_plugin()
3364
+ * ./wp-admin/includes/plugin.php.
3365
+ *
3366
+ * @author Vova Feldman (@svovaf)
3367
+ * @since 1.1.9
3368
+ */
3369
+ $this->_storage->was_plugin_loaded = true;
3370
  }
3371
 
3372
  /**
5089
  * @return bool
5090
  */
5091
  function has_free_plan() {
5092
+ return ! $this->is_only_premium() && FS_Plan_Manager::instance()->has_free_plan( $this->_plans );
5093
+ }
5094
+
5095
+ /**
5096
+ * Displays a license activation dialog box when the user clicks on the "Activate License"
5097
+ * or "Change License" link on the plugins
5098
+ * page.
5099
+ *
5100
+ * @author Leo Fajardo (@leorw)
5101
+ * @since 1.1.9
5102
+ */
5103
+ function _add_license_activation_dialog_box() {
5104
+ fs_enqueue_local_style( 'fs_license_action', '/admin/license-activation.css' );
5105
+
5106
+ $vars = array(
5107
+ 'slug' => $this->_slug
5108
+ );
5109
+
5110
+ fs_require_template( 'license-activation-modal.php', $vars );
5111
+ }
5112
+
5113
+ /**
5114
+ * @author Leo Fajardo (@leorw)
5115
+ * @since 1.1.9
5116
+ */
5117
+ function _activate_license_ajax_action() {
5118
+ if ( ! isset( $_POST['license-key'] ) ) {
5119
+ exit;
5120
+ }
5121
+
5122
+ $license_key = trim( $_POST['license-key'] );
5123
+ if ( empty( $license_key ) ) {
5124
+ exit;
5125
+ }
5126
+
5127
+ if ( $this->is_registered() ) {
5128
+ $api = $this->get_api_site_scope();
5129
+ $api->call( '/', 'put',
5130
+ array(
5131
+ 'license_key' => $license_key
5132
+ )
5133
+ );
5134
+ } else {
5135
+ $this->opt_in( false, false, false, $license_key );
5136
+ }
5137
+
5138
+ // Print '1' for successful operation.
5139
+ echo 1;
5140
+ exit;
5141
  }
5142
 
5143
  #region URL Generators
5281
  /**
5282
  * Check if plugin can work in anonymous mode.
5283
  *
5284
+ * @author Vova Feldman (@svovaf)
5285
+ * @since 1.0.9
5286
  *
5287
  * @return bool
5288
+ *
5289
+ * @deprecated Please use is_enable_anonymous() instead
5290
  */
5291
  function enable_anonymous() {
5292
  return $this->_enable_anonymous;
5293
  }
5294
 
5295
+ /**
5296
+ * Check if plugin can work in anonymous mode.
5297
+ *
5298
+ * @author Vova Feldman (@svovaf)
5299
+ * @since 1.1.9
5300
+ *
5301
+ * @return bool
5302
+ */
5303
+ function is_enable_anonymous() {
5304
+ return $this->_enable_anonymous;
5305
+ }
5306
+
5307
+ /**
5308
+ * Check if plugin is premium only (no free plans).
5309
+ *
5310
+ * @author Vova Feldman (@svovaf)
5311
+ * @since 1.1.9
5312
+ *
5313
+ * @return bool
5314
+ */
5315
+ function is_only_premium() {
5316
+ return $this->_is_premium_only;
5317
+ }
5318
+
5319
  /**
5320
  * Check if feature supported with current site's plan.
5321
  *
5821
  * @param string|bool $email
5822
  * @param string|bool $first
5823
  * @param string|bool $last
5824
+ * @param string|bool $license_key
5825
  *
5826
  * @return bool Is successful opt-in (or set to pending).
5827
  */
5828
+ function opt_in( $email = false, $first = false, $last = false, $license_secret_key = false ) {
5829
  $this->_logger->entrance();
5830
 
5831
  if ( false === $email ) {
5851
  $user_info['user_lastname'] = $last;
5852
  }
5853
 
5854
+ $params = $this->get_opt_in_params( $user_info );
5855
+
5856
+ if ( is_string( $license_secret_key ) ) {
5857
+ $params['license_secret_key'] = $license_secret_key;
5858
+ }
5859
+
5860
  $params['format'] = 'json';
5861
 
5862
  $url = WP_FS__ADDRESS . '/action/service/user/install/';
6013
 
6014
  }
6015
  } else {
6016
+ /**
6017
+ * @author Vova Feldman (@svovaf)
6018
+ * @since 1.1.9 If site installed with a valid license, sync license.
6019
+ */
6020
+ if ( $this->is_paying() ) {
6021
+ $this->_sync_plugin_license( true );
6022
+ }
6023
+
6024
  // Reload the page with the keys.
6025
  if ( $redirect && fs_redirect( $this->get_after_activation_url( 'after_connect_url' ) ) ) {
6026
  exit();
6165
  // We have to set the user before getting user scope API handler.
6166
  $this->_user = $user;
6167
 
6168
+ $extra_install_params = array(
6169
+ 'uid' => $this->get_anonymous_id(),
6170
+ );
6171
+
6172
+ /**
6173
+ * @author Vova Feldman (@svovaf)
6174
+ * @since 1.1.9 Add license key if given.
6175
+ */
6176
+ $license_key = fs_request_get( 'license_secret_key' );
6177
+
6178
+ if ( ! empty( $license_key ) ) {
6179
+ $extra_install_params['license_secret_key'] = $license_key;
6180
+ }
6181
+
6182
  // Install the plugin.
6183
  $install = $this->get_api_user_scope()->call(
6184
  "/plugins/{$this->get_id()}/installs.json",
6185
  'post',
6186
+ $this->get_install_data_for_api( $extra_install_params, false, false )
 
 
6187
  );
6188
 
6189
  if ( isset( $install->error ) ) {
6288
  // return;
6289
  // }
6290
 
6291
+ if ( ! $this->has_api_connectivity() && ! $this->is_enable_anonymous() ) {
6292
  $this->_menu->remove_menu_item();
6293
  } else {
 
6294
  $this->add_menu_action();
6295
+ $this->add_submenu_items();
6296
  }
6297
  }
6298
 
6577
  private function order_sub_submenu_items() {
6578
  global $submenu;
6579
 
6580
+ $menu_slug = $this->_menu->get_top_level_menu_slug();
6581
+
6582
+ if ( empty( $submenu[ $menu_slug ] ) ) {
6583
+ return;
6584
+ }
6585
+
6586
+ $top_level_menu = &$submenu[ $menu_slug ];
6587
 
6588
  $all_submenu_items_after = array();
6589
 
7666
  $is_free = $this->is_free_plan();
7667
 
7668
  // Make sure license exist and not expired.
7669
+ $new_license = is_null( $site->license_id ) ?
7670
+ null :
7671
+ $this->_get_license_by_id( $site->license_id );
7672
 
7673
+ if ( $is_free && is_null( $new_license ) && $this->has_license() && $this->_license->is_cancelled ) {
7674
+ // License cancelled.
7675
+ $this->_site = $site;
7676
+ $this->_update_site_license( $new_license );
7677
+ $this->_store_licenses();
7678
+ $this->_enrich_site_plan( true );
7679
+
7680
+ $plan_change = 'cancelled';
7681
+ } else if ( $is_free && ( ( ! is_object( $new_license ) || $new_license->is_expired() ) ) ) {
7682
  // The license is expired, so ignore upgrade method.
7683
  } else {
7684
  // License changed.
7734
  ),
7735
  __fs( 'contact-us-here', $this->_slug )
7736
  ),
7737
+ '<i><b>' . $plan->title . ( $this->is_trial() ? ' ' . __fs( 'trial', $this->_slug ) : '' ) . '</b></i>'
7738
  ),
7739
+ __fs( 'hmm', $this->_slug ) . '...'
 
7740
  );
7741
  }
7742
  break;
7785
  );
7786
  $this->_admin_notices->remove_sticky( 'plan_upgraded' );
7787
  break;
7788
+ case 'cancelled':
7789
+ $this->_admin_notices->add(
7790
+ __fs( 'license-cancelled', $this->_slug ) . ' ' .
7791
+ sprintf(
7792
+ '<a href="%s">%s</a>',
7793
+ $this->contact_url( 'bug' ),
7794
+ __fs( 'contact-us-here', $this->_slug )
7795
+ ),
7796
+ __fs( 'hmm', $this->_slug ) . '...',
7797
+ 'error'
7798
+ );
7799
+ $this->_admin_notices->remove_sticky( 'plan_upgraded' );
7800
+ break;
7801
  case 'expired':
7802
  $this->_admin_notices->add_sticky(
7803
  sprintf( __fs( 'license-expired-non-blocking-message', $this->_slug ), $this->_site->plan->title ),
7867
  return;
7868
  }
7869
 
7870
+ /**
7871
+ * If the premium license is already associated with the install, just
7872
+ * update the license reference (activation is not required).
7873
+ *
7874
+ * @since 1.1.9
7875
+ */
7876
+ if ( $premium_license->id == $this->_site->license_id ) {
7877
+ // License is already activated.
7878
+ $this->_update_site_license( $premium_license );
7879
+ $this->_enrich_site_plan( false );
7880
+ $this->_store_account();
7881
+
7882
+ return;
7883
+ }
7884
+
7885
  $api = $this->get_api_site_scope();
7886
  $license = $api->call( "/licenses/{$premium_license->id}.json", 'put' );
7887
 
8052
  *
8053
  * @return bool If trial was successfully started.
8054
  */
8055
+ function start_trial( $plan_name = false ) {
8056
  $this->_logger->entrance();
8057
 
8058
  if ( $this->is_trial() ) {
9422
  }
9423
  }
9424
 
9425
+ /**
9426
+ * Adds "Activate License" or "Change License" link to the main Plugins page link actions collection.
9427
+ *
9428
+ * @author Leo Fajardo (@leorw)
9429
+ * @since 1.1.9
9430
+ */
9431
+ function _add_license_action_link() {
9432
+ $this->_logger->entrance();
9433
+
9434
+ $link_text = __fs( $this->is_free_plan() ? 'activate-license' : 'change-license', $this->_slug );
9435
+
9436
+ $this->add_plugin_action_link(
9437
+ $link_text,
9438
+ '#',
9439
+ false,
9440
+ 11,
9441
+ ( 'activate-license ' . $this->_slug )
9442
+ );
9443
+ }
9444
+
9445
  /**
9446
  * Get the URL of the page that should be loaded right after the plugin activation.
9447
  *
freemius/includes/fs-core-functions.php CHANGED
@@ -107,7 +107,19 @@
107
  }
108
 
109
  function fs_request_get_bool( $key, $def = false ) {
110
- return ( isset( $_REQUEST[ $key ] ) && ( 1 == $_REQUEST[ $key ] || 'true' === strtolower( $_REQUEST[ $key ] ) ) ) ? true : $def;
 
 
 
 
 
 
 
 
 
 
 
 
111
  }
112
 
113
  function fs_request_is_post() {
107
  }
108
 
109
  function fs_request_get_bool( $key, $def = false ) {
110
+ if ( ! isset( $_REQUEST[ $key ] ) ) {
111
+ return $def;
112
+ }
113
+
114
+ if ( 1 == $_REQUEST[ $key ] || 'true' === strtolower( $_REQUEST[ $key ] ) ) {
115
+ return true;
116
+ }
117
+
118
+ if ( 0 == $_REQUEST[ $key ] || 'false' === strtolower( $_REQUEST[ $key ] ) ) {
119
+ return false;
120
+ }
121
+
122
+ return $def;
123
  }
124
 
125
  function fs_request_is_post() {
freemius/includes/i18n.php CHANGED
@@ -1,352 +1,365 @@
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
- 'change-ownership' => __( 'Change Ownership', 'freemius' ),
39
- 'support' => __( 'Support', 'freemius' ),
40
- 'support-forum' => __( 'Support Forum', 'freemius' ),
41
- 'add-ons' => __( 'Add Ons', 'freemius' ),
42
- 'upgrade' => _x( 'Upgrade', 'verb', 'freemius' ),
43
- 'awesome' => __( 'Awesome', 'freemius' ),
44
- 'pricing' => _x( 'Pricing', 'noun', 'freemius' ),
45
- 'price' => _x( 'Price', 'noun', 'freemius' ),
46
- 'unlimited-updates' => __( 'Unlimited Updates', 'freemius' ),
47
- 'downgrade' => _x( 'Downgrade', 'verb', 'freemius' ),
48
- 'cancel-trial' => __( 'Cancel Trial', 'freemius' ),
49
- 'free-trial' => __( 'Free Trial', 'freemius' ),
50
- 'start-free-x' => __( 'Start my free %s', 'freemius' ),
51
- 'no-commitment-x' => __( 'No commitment for %s - cancel anytime', 'freemius' ),
52
- 'after-x-pay-as-little-y' => __( 'After your free %s, pay as little as %s', 'freemius' ),
53
- 'details' => __( 'Details', 'freemius' ),
54
- 'account-details' => __( 'Account Details', 'freemius' ),
55
- 'delete' => _x( 'Delete', 'verb', 'freemius' ),
56
- 'delete-account' => __( 'Delete Account', 'freemius' ),
57
- 'dismiss' => _x( 'Dismiss', 'as close a window', 'freemius' ),
58
- 'plan' => _x( 'Plan', 'as product pricing plan', 'freemius' ),
59
- 'change-plan' => __( 'Change Plan', 'freemius' ),
60
- 'download-x-version' => _x( 'Download %s Version', 'as download professional version', 'freemius' ),
61
- 'download-x-version-now' => _x( 'Download %s version now', 'as download professional version now', 'freemius' ),
62
- 'download-latest' => _x( 'Download Latest', 'as download latest version', 'freemius' ),
63
- 'you-have-x-license' => _x( 'You have a %s license.', 'E.g. you have a professional license.', 'freemius' ),
64
- 'new' => __( 'New', 'freemius' ),
65
- 'free' => __( 'Free', 'freemius' ),
66
- 'trial' => _x( 'Trial', 'as trial plan', 'freemius' ),
67
- 'purchase' => _x( 'Purchase', 'verb', 'freemius' ),
68
- 'purchase-license' => __( 'Purchase License', 'freemius' ),
69
- 'buy' => _x( 'Buy', 'verb', 'freemius' ),
70
- 'buy-license' => __( 'Buy License', 'freemius' ),
71
- 'license-single-site' => __( 'Single Site License', 'freemius' ),
72
- 'license-unlimited' => __( 'Unlimited Licenses', 'freemius' ),
73
- 'license-x-sites' => __( 'Up to %s Sites', 'freemius' ),
74
- 'renew-license-now' => __( '%sRenew your license now%s to access version %s features and support.', 'freemius' ),
75
- 'x-plan' => _x( '%s Plan', 'e.g. Professional Plan', 'freemius' ),
76
- 'you-are-step-away' => __( 'You are just one step away - %s', 'freemius' ),
77
- 'activate-x-now' => _x( 'Complete "%s" Activation Now', '%s - plugin name. As complete "Jetpack" activation now', 'freemius' ),
78
- 'few-plugin-tweaks' => __( 'We made a few tweaks to the plugin, %s', 'freemius' ),
79
- 'optin-x-now' => __( 'Opt-in to make "%s" Better!', 'freemius' ),
80
- 'error' => __( 'Error', 'freemius' ),
81
- 'failed-finding-main-path' => __( 'Freemius SDK couldn\'t find the plugin\'s main file. Please contact sdk@freemius.com with the current error.', 'freemius' ),
82
- #region Account
83
-
84
- 'expiration' => _x( 'Expiration', 'as expiration date', 'freemius' ),
85
- 'license' => _x( 'License', 'as software license', 'freemius' ),
86
- 'not-verified' => __( 'not verified', 'freemius' ),
87
- 'verify-email' => __( 'Verify Email', 'freemius' ),
88
- 'expires-in' => _x( 'Expires in %s', 'e.g. expires in 2 months', 'freemius' ),
89
- 'renews-in' => _x( 'Auto renews in %s', 'e.g. auto renews in 2 months', 'freemius' ),
90
- 'no-expiration' => __( 'No expiration', 'freemius' ),
91
- 'expired' => __( 'Expired', 'freemius' ),
92
- 'cancelled' => __( 'Cancelled', 'freemius' ),
93
- 'in-x' => _x( 'In %s', 'e.g. In 2 hours', 'freemius' ),
94
- 'x-ago' => _x( '%s ago', 'e.g. 2 min ago', 'freemius' ),
95
- 'version' => _x( 'Version', 'as plugin version', 'freemius' ),
96
- 'name' => __( 'Name', 'freemius' ),
97
- 'email' => __( 'Email', 'freemius' ),
98
- 'verified' => __( 'Verified', 'freemius' ),
99
- 'plugin' => __( 'Plugin', 'freemius' ),
100
- 'plugins' => __( 'Plugins', 'freemius' ),
101
- 'themes' => __( 'Themes', 'freemius' ),
102
- 'path' => _x( 'Path', 'as file/folder path', 'freemius' ),
103
- 'title' => __( 'Title', 'freemius' ),
104
- 'free-version' => __( 'Free version', 'freemius' ),
105
- 'premium-version' => __( 'Premium version', 'freemius' ),
106
- 'slug' => _x( 'Slug', 'as WP plugin slug', 'freemius' ),
107
- 'id' => __( 'ID', 'freemius' ),
108
- 'users' => __( 'Users', 'freemius' ),
109
- 'plugin-installs' => __( 'Plugin Installs', 'freemius' ),
110
- 'sites' => _x( 'Sites', 'like websites', 'freemius' ),
111
- 'user-id' => __( 'User ID', 'freemius' ),
112
- 'site-id' => __( 'Site ID', 'freemius' ),
113
- 'public-key' => __( 'Public Key', 'freemius' ),
114
- 'secret-key' => __( 'Secret Key', 'freemius' ),
115
- 'no-secret' => _x( 'No Secret', 'as secret encryption key missing', 'freemius' ),
116
- 'no-id' => __( 'No ID', 'freemius' ),
117
- 'sync-license' => _x( 'Sync License', 'as synchronize license', 'freemius' ),
118
- 'sync' => _x( 'Sync', 'as synchronize', 'freemius' ),
119
- 'deactivate-license' => __( 'Deactivate License', 'freemius' ),
120
- 'activate' => __( 'Activate', 'freemius' ),
121
- 'deactivate' => __( 'Deactivate', 'freemius' ),
122
- 'skip-deactivate' => __( 'Skip & Deactivate', 'freemius' ),
123
- 'no-deactivate' => __( 'No - just deactivate', 'freemius' ),
124
- 'yes-do-your-thing' => __( 'Yes - do your thing', 'freemius' ),
125
- 'active' => _x( 'Active', 'active mode', 'freemius' ),
126
- 'is-active' => _x( 'Is Active', 'is active mode?', 'freemius' ),
127
- 'install-now' => __( 'Install Now', 'freemius' ),
128
- 'install-update-now' => __( 'Install Update Now', 'freemius' ),
129
- 'more-information-about-x' => __( 'More information about %s', 'freemius' ),
130
- 'localhost' => __( 'Localhost', 'freemius' ),
131
- 'activate-x-plan' => _x( 'Activate %s Plan', 'as activate Professional plan', 'freemius' ),
132
- 'x-left' => _x( '%s left', 'as 5 licenses left', 'freemius' ),
133
- 'last-license' => __( 'Last license', 'freemius' ),
134
- 'what-is-your-x' => __( 'What is your %s?', 'freemius' ),
135
- 'activate-this-addon' => __( 'Activate this add-on', 'freemius' ),
136
- '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?', 'freemius' ),
137
- '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?', 'freemius' ),
138
- '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?', 'freemius' ),
139
- 'downgrade-x-confirm' => __( 'Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s.', 'freemius' ),
140
- 'cancel-trial-confirm' => __( 'Cancelling the trial will immediately block access to all premium features. Are you sure?', 'freemius' ),
141
- 'after-downgrade-non-blocking' => __( 'You can still enjoy all %s features but you will not have access to plugin updates and support.', 'freemius' ),
142
- 'after-downgrade-blocking' => __( 'Once your license expire you can still use the Free version but you will NOT have access to the %s features.', 'freemius' ),
143
- 'proceed-confirmation' => __( 'Are you sure you want to proceed?', 'freemius' ),
144
- #endregion Account
145
-
146
- 'add-ons-for-x' => __( 'Add Ons for %s', 'freemius' ),
147
- '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.', 'freemius' ),
148
- #region Plugin Deactivation
149
- 'deactivation-share-reason' => __( 'If you have a moment, please let us know why you are deactivating', 'freemius' ),
150
- 'deactivation-modal-button-confirm' => __( 'Yes - Deactivate', 'freemius' ),
151
- 'deactivation-modal-button-submit' => __( 'Submit & Deactivate', 'freemius' ),
152
- 'deactivation-modal-button-cancel' => _x( 'Cancel', 'the text of the cancel button of the plugin deactivation dialog box.', 'freemius' ),
153
- 'reason-no-longer-needed' => __( 'I no longer need the plugin', 'freemius' ),
154
- 'reason-found-a-better-plugin' => __( 'I found a better plugin', 'freemius' ),
155
- 'reason-needed-for-a-short-period' => __( 'I only needed the plugin for a short period', 'freemius' ),
156
- 'reason-broke-my-site' => __( 'The plugin broke my site', 'freemius' ),
157
- 'reason-suddenly-stopped-working' => __( 'The plugin suddenly stopped working', 'freemius' ),
158
- 'reason-cant-pay-anymore' => __( "I can't pay for it anymore", 'freemius' ),
159
- 'reason-temporary-deactivation' => __( "It's a temporary deactivation. I'm just debugging an issue.", 'freemius' ),
160
- 'reason-other' => _x( 'Other', 'the text of the "other" reason for deactivating the plugin that is shown in the modal box.', 'freemius' ),
161
- 'ask-for-reason-message' => __( 'Kindly tell us the reason so we can improve.', 'freemius' ),
162
- 'placeholder-plugin-name' => __( "What's the plugin's name?", 'freemius' ),
163
- 'placeholder-comfortable-price' => __( 'What price would you feel comfortable paying?', 'freemius' ),
164
- 'reason-couldnt-make-it-work' => __( "I couldn't understand how to make it work", 'freemius' ),
165
- 'reason-great-but-need-specific-feature' => __( "The plugin is great, but I need specific feature that you don't support", 'freemius' ),
166
- 'reason-not-working' => __( 'The plugin is not working', 'freemius' ),
167
- 'reason-not-what-i-was-looking-for' => __( "It's not what I was looking for", 'freemius' ),
168
- 'reason-didnt-work-as-expected' => __( "The plugin didn't work as expected", 'freemius' ),
169
- 'placeholder-feature' => __( 'What feature?', 'freemius' ),
170
- 'placeholder-share-what-didnt-work' => __( "Kindly share what didn't work so we can fix it for future users...", 'freemius' ),
171
- 'placeholder-what-youve-been-looking-for' => __( "What you've been looking for?", 'freemius' ),
172
- 'placeholder-what-did-you-expect' => __( "What did you expect?", 'freemius' ),
173
- 'reason-didnt-work' => __( "The plugin didn't work", 'freemius' ),
174
- 'reason-dont-like-to-share-my-information' => __( "I don't like to share my information with you", 'freemius' ),
175
- #endregion Plugin Deactivation
176
-
177
- #region Connect
178
- 'hey-x' => _x( 'Hey %s,', 'greeting', 'freemius' ),
179
- 'thanks-x' => _x( 'Thanks %s!', 'a greeting. E.g. Thanks John!', 'freemius' ),
180
- 'connect-message' => __( 'In order to enjoy all our features and functionality, %s needs to connect your user, %s at %s, to %s', 'freemius' ),
181
- 'connect-message_on-update' => __( 'Please help us improve %2$s! If you opt-in, some data about your usage of %2$s will be sent to %5$s. If you skip this, that\'s okay! %2$s will still work just fine.', 'freemius' ),
182
- '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 complete the install.', 'freemius' ),
183
- 'what-permissions' => __( 'What permissions are being granted?', 'freemius' ),
184
- 'permissions-profile' => __( 'Your Profile Overview', 'freemius' ),
185
- 'permissions-profile_desc' => __( 'Name and email address', 'freemius' ),
186
- 'permissions-site' => __( 'Your Site Overview', 'freemius' ),
187
- 'permissions-site_desc' => __( 'Site URL, WP version, PHP info, plugins & themes', 'freemius' ),
188
- 'permissions-events' => __( 'Current Plugin Events', 'freemius' ),
189
- 'permissions-events_desc' => __( 'Activation, deactivation and uninstall', 'freemius' ),
190
- 'permissions-plugins_themes' => __( 'Plugins & Themes', 'freemius' ),
191
- 'permissions-plugins_themes_desc' => __( 'Titles, versions and state.', 'freemius' ),
192
- 'permissions-newsletter' => __( 'Newsletter', 'freemius' ),
193
- 'permissions-newsletter_desc' => __( 'Updates, announcements, marketing, no spam', 'freemius' ),
194
- 'privacy-policy' => __( 'Privacy Policy', 'freemius' ),
195
- 'tos' => __( 'Terms of Service', 'freemius' ),
196
- 'activating' => _x( 'Activating', 'as activating plugin', 'freemius' ),
197
- 'sending-email' => _x( 'Sending email', 'as in the process of sending an email', 'freemius' ),
198
- 'opt-in-connect' => _x( 'Allow & Continue', 'button label', 'freemius' ),
199
- 'skip' => _x( 'Skip', 'verb', 'freemius' ),
200
- 'resend-activation-email' => __( 'Re-send activation email', 'freemius' ),
201
- #endregion Connect
202
-
203
- #region Screenshots
204
- 'screenshots' => __( 'Screenshots', 'freemius' ),
205
- 'view-full-size-x' => __( 'Click to view full-size screenshot %d', 'freemius' ),
206
- #endregion Screenshots
207
-
208
- #region Debug
209
- 'freemius-debug' => __( 'Freemius Debug', 'freemius' ),
210
- 'on' => _x( 'On', 'as turned on', 'freemius' ),
211
- 'off' => _x( 'Off', 'as turned off', 'freemius' ),
212
- 'debugging' => _x( 'Debugging', 'as code debugging', 'freemius' ),
213
- 'freemius-state' => __( 'Freemius State', 'freemius' ),
214
- 'connected' => _x( 'Connected', 'as connection was successful', 'freemius' ),
215
- 'blocked' => _x( 'Blocked', 'as connection blocked', 'freemius' ),
216
- 'api' => _x( 'API', 'as application program interface', 'freemius' ),
217
- 'sdk' => _x( 'SDK', 'as software development kit versions', 'freemius' ),
218
- 'sdk-versions' => _x( 'SDK Versions', 'as software development kit versions', 'freemius' ),
219
- 'plugin-path' => _x( 'Plugin Path', 'as plugin folder path', 'freemius' ),
220
- 'sdk-path' => _x( 'SDK Path', 'as sdk path', 'freemius' ),
221
- 'addons-of-x' => __( 'Add Ons of Plugin %s', 'freemius' ),
222
- 'delete-all-confirm' => __( 'Are you sure you want to delete all Freemius data?', 'freemius' ),
223
- 'actions' => __( 'Actions', 'freemius' ),
224
- 'delete-all-accounts' => __( 'Delete All Accounts', 'freemius' ),
225
- 'start-fresh' => __( 'Start Fresh', 'freemius' ),
226
- 'clear-api-cache' => __( 'Clear API Cache', 'freemius' ),
227
- 'sync-data-from-server' => __( 'Sync Data From Server', 'freemius' ),
228
- 'scheduled-crons' => __( 'Scheduled Crons', 'freemius' ),
229
- 'plugins-themes-sync' => __( 'Plugins & Themes Sync', 'freemius' ),
230
- #endregion Debug
231
-
232
- #region Expressions
233
- 'congrats' => _x( 'Congrats', 'as congratulations', 'freemius' ),
234
- 'oops' => _x( 'Oops', 'exclamation', 'freemius' ),
235
- 'yee-haw' => _x( 'Yee-haw', 'interjection expressing joy or exuberance', 'freemius' ),
236
- 'woot' => _x( 'W00t', '(especially in electronic communication) used to express elation, enthusiasm, or triumph.', 'freemius' ),
237
- 'right-on' => _x( 'Right on', 'a positive response', 'freemius' ),
238
- 'hmm' => _x( 'Hmm', 'something somebody says when they are thinking about what you have just said. ', 'freemius' ),
239
- 'ok' => __( 'O.K', 'freemius' ),
240
- 'hey' => _x( 'Hey', 'exclamation', 'freemius' ),
241
- 'heads-up' => _x( 'Heads up', 'advance notice of something that will need attention.', 'freemius' ),
242
- #endregion Expressions
243
-
244
- #region Admin Notices
245
- 'you-have-latest' => __( 'Seems like you got the latest release.', 'freemius' ),
246
- 'you-are-good' => __( 'You are all good!', 'freemius' ),
247
- 'user-exist-message' => __( 'Sorry, we could not complete the email update. Another user with the same email is already registered.', 'freemius' ),
248
- '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.', 'freemius' ),
249
- 'email-updated-message' => __( 'Your email was successfully updated. You should receive an email with confirmation instructions in few moments.', 'freemius' ),
250
- 'name-updated-message' => __( 'Your name was successfully updated.', 'freemius' ),
251
- 'x-updated' => __( 'You have successfully updated your %s.', 'freemius' ),
252
- 'name-update-failed-message' => __( 'Please provide your full name.', 'freemius' ),
253
- '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.', 'freemius' ),
254
- 'addons-info-external-message' => __( 'Just letting you know that the add-ons information of %s is being pulled from an external server.', 'freemius' ),
255
- 'no-cc-required' => __( 'No credit card required', 'freemius' ),
256
- 'premium-activated-message' => __( 'Premium plugin version was successfully activated.', 'freemius' ),
257
- 'successful-version-upgrade-message' => __( 'The upgrade of %s was successfully completed.', 'freemius' ),
258
- 'activation-with-plan-x-message' => __( 'Your account was successfully activated with the %s plan.', 'freemius' ),
259
- 'download-latest-x-version' => __( 'Download the latest %s version now', 'freemius' ),
260
- 'download-latest-version' => __( 'Download the latest version now', 'freemius' ),
261
- 'addon-successfully-purchased-message' => _x( '%s Add-on was successfully purchased.', '%s - product name, e.g. Facebook add-on was successfully...', 'freemius' ),
262
- 'addon-successfully-upgraded-message' => __( 'Your %s Add-on plan was successfully upgraded.', 'freemius' ),
263
- 'email-verified-message' => __( 'Your email has been successfully verified - you are AWESOME!', 'freemius' ),
264
- 'plan-upgraded-message' => __( 'Your plan was successfully upgraded.', 'freemius' ),
265
- 'plan-changed-to-x-message' => __( 'Your plan was successfully changed to %s.', 'freemius' ),
266
- 'license-expired-blocking-message' => __( 'Your license has expired. You can still continue using the free plugin forever.', 'freemius' ),
267
- 'trial-started-message' => __( 'Your trial has been successfully started.', 'freemius' ),
268
- 'license-activated-message' => __( 'Your license was successfully activated.', 'freemius' ),
269
- 'no-active-license-message' => __( 'It looks like your site currently doesn\'t have an active license.', 'freemius' ),
270
- 'license-deactivation-message' => __( 'Your license was successfully deactivated, you are back to the %s plan.', 'freemius' ),
271
- 'license-deactivation-failed-message' => __( 'It looks like the license deactivation failed.', 'freemius' ),
272
- 'license-activation-failed-message' => __( 'It looks like the license could not be activated.', 'freemius' ),
273
- 'server-error-message' => __( 'Error received from the server:', 'freemius' ),
274
- 'trial-expired-message' => __( 'Your trial has expired. You can still continue using all our free features.', 'freemius' ),
275
- 'plan-x-downgraded-message' => __( 'Your plan was successfully downgraded. Your %s plan license will expire in %s.', 'freemius' ),
276
- 'plan-downgraded-failure-message' => __( 'Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes.', 'freemius' ),
277
- 'trial-cancel-no-trial-message' => __( 'It looks like you are not in trial mode anymore so there\'s nothing to cancel :)', 'freemius' ),
278
- 'trial-cancel-message' => __( 'Your %s free trial was successfully cancelled.', 'freemius' ),
279
- 'version-x-released' => _x( 'Version %s was released.', '%s - numeric version number', 'freemius' ),
280
- 'please-download-x' => __( 'Please download %s.', 'freemius' ),
281
- 'latest-x-version' => _x( 'the latest %s version here', '%s - plan name, as the latest professional version here', 'freemius' ),
282
- 'trial-x-promotion-message' => __( 'How do you like %s so far? Test all our %s premium features with a %d-day free trial.', 'freemius' ),
283
- 'start-free-trial' => _x( 'Start free trial', 'call to action', 'freemius' ),
284
- 'trial-cancel-failure-message' => __( 'Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes.', 'freemius' ),
285
- 'trial-utilized' => __( 'You already utilized a trial before.', 'freemius' ),
286
- 'in-trial-mode' => __( 'You are already running the plugin in a trial mode.', 'freemius' ),
287
- 'trial-plan-x-not-exist' => __( 'Plan %s do not exist, therefore, can\'t start a trial.', 'freemius' ),
288
- 'plan-x-no-trial' => __( 'Plan %s does not support a trial period.', 'freemius' ),
289
- 'no-trials' => __( 'None of the plugin\'s plans supports a trial period.', 'freemius' ),
290
- 'unexpected-api-error' => __( 'Unexpected API error. Please contact the plugin\'s author with the following error.', 'freemius' ),
291
- 'no-commitment-for-x-days' => __( 'No commitment for %s days - cancel anytime!', 'freemius' ),
292
- '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.', 'freemius' ),
293
- 'could-not-activate-x' => __( 'Couldn\'t activate %s.', 'freemius' ),
294
- 'contact-us-with-error-message' => __( 'Please contact us with the following message:', 'freemius' ),
295
- '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.', 'freemius' ),
296
- 'contact-us-here' => __( 'Please contact us here', 'freemius' ),
297
- 'plan-did-not-change-email-message' => __( 'I have upgraded my account but when I try to Sync the License, the plan remains %s.', 'freemius' ),
298
- #endregion Admin Notices
299
- #region Connectivity Issues
300
- 'connectivity-test-fails-message' => __( 'From unknown reason, the API connectivity test failed.', 'freemius' ),
301
- '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?', 'freemius' ),
302
- '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.', 'freemius' ),
303
- 'cloudflare-blocks-connection-message' => __( 'From unknown reason, CloudFlare, the firewall we use, blocks the connection.', 'freemius' ),
304
- 'x-requires-access-to-api' => _x( '%s requires an access to our API.', 'as pluginX requires an access to our API', 'freemius' ),
305
- 'squid-blocks-connection-message' => __( 'It looks like your server is using Squid ACL (access control lists), which blocks the connection.', 'freemius' ),
306
- 'squid-no-clue-title' => __( 'I don\'t know what is Squid or ACL, help me!', 'freemius' ),
307
- '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.', 'freemius' ),
308
- 'sysadmin-title' => __( 'I\'m a system administrator', 'freemius' ),
309
- 'squid-sysadmin-desc' => __( 'Great, please whitelist the following domains: %s. Once you done, deactivate the plugin and activate it again.', 'freemius' ),
310
- 'curl-missing-no-clue-title' => __( 'I don\'t know what is cURL or how to install it, help me!', 'freemius' ),
311
- '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.', 'freemius' ),
312
- '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.', 'freemius' ),
313
- '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.', 'freemius' ),
314
- 'fix-issue-title' => __( 'Yes - I\'m giving you a chance to fix it', 'freemius' ),
315
- '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.', 'freemius' ),
316
- 'install-previous-title' => __( 'Let\'s try your previous version', 'freemius' ),
317
- 'install-previous-desc' => __( 'Uninstall this version and install the previous one.', 'freemius' ),
318
- 'deactivate-plugin-title' => __( 'That\'s exhausting, please deactivate', 'freemius' ),
319
- 'deactivate-plugin-desc' => __( 'We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future.', 'freemius' ),
320
- '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.', 'freemius' ),
321
- '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', '%1s - plugin title, %2s - API domain', 'freemius' ),
322
- '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.', 'freemius' ),
323
- #endregion Connectivity Issues
324
- #region Change Owner
325
- '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.', 'freemius' ),
326
- 'change-owner-request_owner-confirmed' => __( 'Thanks for confirming the ownership change. An email was just sent to %s for final approval.', 'freemius' ),
327
- 'change-owner-request_candidate-confirmed' => __( '%s is the new owner of the account.', 'freemius' ),
328
- #endregion Change Owner
329
- 'addon-x-cannot-run-without-y' => _x( '%s cannot run without %s.', 'addonX cannot run without pluginY', 'freemius' ),
330
- 'addon-x-cannot-run-without-parent' => _x( '%s cannot run without the plugin.', 'addonX cannot run...', 'freemius' ),
331
- 'plugin-x-activation-message' => _x( '%s activation was successfully completed.', 'pluginX activation was successfully...', 'freemius' ),
332
- 'features-and-pricing' => _x( 'Features & Pricing', 'Plugin installer section title', 'freemius' ),
333
- 'free-addon-not-deployed' => __( 'Add-on must be deployed to WordPress.org or Freemius.', 'freemius' ),
334
- 'paid-addon-not-deployed' => __( 'Paid add-on must be deployed to Freemius.', 'freemius' ),
335
- #region Add-On Licensing
336
- 'addon-no-license-message' => __( '%s is a premium only add-on. You have to purchase a license first before activating the plugin.', 'freemius' ),
337
- '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.', 'freemius' ),
338
- #endregion Add-On Licensing
339
- #region Billing Cycles
340
- 'monthly' => _x( 'Monthly', 'as every month', 'freemius' ),
341
- 'mo' => _x( 'mo', 'as monthly period', 'freemius' ),
342
- 'annual' => _x( 'Annual', 'as once a year', 'freemius' ),
343
- 'annually' => _x( 'Annually', 'as once a year', 'freemius' ),
344
- 'once' => _x( 'Once', 'as once a year', 'freemius' ),
345
- 'year' => _x( 'year', 'as annual period', 'freemius' ),
346
- 'lifetime' => __( 'Lifetime', 'freemius' ),
347
- 'best' => _x( 'Best', 'e.g. the best product', 'freemius' ),
348
- 'billed-x' => _x( 'Billed %s', 'e.g. billed monthly', 'freemius' ),
349
- 'save-x' => _x( 'Save %s', 'as a discount of $5 or 10%', 'freemius' ),
350
- #endregion Billing Cycles
351
- 'view-details' => __( 'View details', 'freemius' ),
352
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ 'change-ownership' => __( 'Change Ownership', 'freemius' ),
39
+ 'support' => __( 'Support', 'freemius' ),
40
+ 'support-forum' => __( 'Support Forum', 'freemius' ),
41
+ 'add-ons' => __( 'Add Ons', 'freemius' ),
42
+ 'upgrade' => _x( 'Upgrade', 'verb', 'freemius' ),
43
+ 'awesome' => __( 'Awesome', 'freemius' ),
44
+ 'pricing' => _x( 'Pricing', 'noun', 'freemius' ),
45
+ 'price' => _x( 'Price', 'noun', 'freemius' ),
46
+ 'unlimited-updates' => __( 'Unlimited Updates', 'freemius' ),
47
+ 'downgrade' => _x( 'Downgrade', 'verb', 'freemius' ),
48
+ 'cancel-trial' => __( 'Cancel Trial', 'freemius' ),
49
+ 'free-trial' => __( 'Free Trial', 'freemius' ),
50
+ 'start-free-x' => __( 'Start my free %s', 'freemius' ),
51
+ 'no-commitment-x' => __( 'No commitment for %s - cancel anytime', 'freemius' ),
52
+ 'after-x-pay-as-little-y' => __( 'After your free %s, pay as little as %s', 'freemius' ),
53
+ 'details' => __( 'Details', 'freemius' ),
54
+ 'account-details' => __( 'Account Details', 'freemius' ),
55
+ 'delete' => _x( 'Delete', 'verb', 'freemius' ),
56
+ 'delete-account' => __( 'Delete Account', 'freemius' ),
57
+ 'dismiss' => _x( 'Dismiss', 'as close a window', 'freemius' ),
58
+ 'plan' => _x( 'Plan', 'as product pricing plan', 'freemius' ),
59
+ 'change-plan' => __( 'Change Plan', 'freemius' ),
60
+ 'download-x-version' => _x( 'Download %s Version', 'as download professional version', 'freemius' ),
61
+ 'download-x-version-now' => _x( 'Download %s version now', 'as download professional version now', 'freemius' ),
62
+ 'download-latest' => _x( 'Download Latest', 'as download latest version', 'freemius' ),
63
+ 'you-have-x-license' => _x( 'You have a %s license.', 'E.g. you have a professional license.', 'freemius' ),
64
+ 'new' => __( 'New', 'freemius' ),
65
+ 'free' => __( 'Free', 'freemius' ),
66
+ 'trial' => _x( 'Trial', 'as trial plan', 'freemius' ),
67
+ 'purchase' => _x( 'Purchase', 'verb', 'freemius' ),
68
+ 'purchase-license' => __( 'Purchase License', 'freemius' ),
69
+ 'buy' => _x( 'Buy', 'verb', 'freemius' ),
70
+ 'buy-license' => __( 'Buy License', 'freemius' ),
71
+ 'license-single-site' => __( 'Single Site License', 'freemius' ),
72
+ 'license-unlimited' => __( 'Unlimited Licenses', 'freemius' ),
73
+ 'license-x-sites' => __( 'Up to %s Sites', 'freemius' ),
74
+ 'renew-license-now' => __( '%sRenew your license now%s to access version %s features and support.', 'freemius' ),
75
+ 'x-plan' => _x( '%s Plan', 'e.g. Professional Plan', 'freemius' ),
76
+ 'you-are-step-away' => __( 'You are just one step away - %s', 'freemius' ),
77
+ 'activate-x-now' => _x( 'Complete "%s" Activation Now', '%s - plugin name. As complete "Jetpack" activation now', 'freemius' ),
78
+ 'few-plugin-tweaks' => __( 'We made a few tweaks to the plugin, %s', 'freemius' ),
79
+ 'optin-x-now' => __( 'Opt-in to make "%s" Better!', 'freemius' ),
80
+ 'error' => __( 'Error', 'freemius' ),
81
+ 'failed-finding-main-path' => __( 'Freemius SDK couldn\'t find the plugin\'s main file. Please contact sdk@freemius.com with the current error.', 'freemius' ),
82
+ #region Account
83
+
84
+ 'expiration' => _x( 'Expiration', 'as expiration date', 'freemius' ),
85
+ 'license' => _x( 'License', 'as software license', 'freemius' ),
86
+ 'not-verified' => __( 'not verified', 'freemius' ),
87
+ 'verify-email' => __( 'Verify Email', 'freemius' ),
88
+ 'expires-in' => _x( 'Expires in %s', 'e.g. expires in 2 months', 'freemius' ),
89
+ 'renews-in' => _x( 'Auto renews in %s', 'e.g. auto renews in 2 months', 'freemius' ),
90
+ 'no-expiration' => __( 'No expiration', 'freemius' ),
91
+ 'expired' => __( 'Expired', 'freemius' ),
92
+ 'cancelled' => __( 'Cancelled', 'freemius' ),
93
+ 'in-x' => _x( 'In %s', 'e.g. In 2 hours', 'freemius' ),
94
+ 'x-ago' => _x( '%s ago', 'e.g. 2 min ago', 'freemius' ),
95
+ 'version' => _x( 'Version', 'as plugin version', 'freemius' ),
96
+ 'name' => __( 'Name', 'freemius' ),
97
+ 'email' => __( 'Email', 'freemius' ),
98
+ 'verified' => __( 'Verified', 'freemius' ),
99
+ 'plugin' => __( 'Plugin', 'freemius' ),
100
+ 'plugins' => __( 'Plugins', 'freemius' ),
101
+ 'themes' => __( 'Themes', 'freemius' ),
102
+ 'path' => _x( 'Path', 'as file/folder path', 'freemius' ),
103
+ 'title' => __( 'Title', 'freemius' ),
104
+ 'free-version' => __( 'Free version', 'freemius' ),
105
+ 'premium-version' => __( 'Premium version', 'freemius' ),
106
+ 'slug' => _x( 'Slug', 'as WP plugin slug', 'freemius' ),
107
+ 'id' => __( 'ID', 'freemius' ),
108
+ 'users' => __( 'Users', 'freemius' ),
109
+ 'plugin-installs' => __( 'Plugin Installs', 'freemius' ),
110
+ 'sites' => _x( 'Sites', 'like websites', 'freemius' ),
111
+ 'user-id' => __( 'User ID', 'freemius' ),
112
+ 'site-id' => __( 'Site ID', 'freemius' ),
113
+ 'public-key' => __( 'Public Key', 'freemius' ),
114
+ 'secret-key' => __( 'Secret Key', 'freemius' ),
115
+ 'no-secret' => _x( 'No Secret', 'as secret encryption key missing', 'freemius' ),
116
+ 'no-id' => __( 'No ID', 'freemius' ),
117
+ 'sync-license' => _x( 'Sync License', 'as synchronize license', 'freemius' ),
118
+ 'sync' => _x( 'Sync', 'as synchronize', 'freemius' ),
119
+ 'activate-license' => __( 'Activate License', 'freemius' ),
120
+ 'activate-free-version' => __( 'Activate Free Version', 'freemius' ),
121
+ 'activate-license-message' => __( 'Please enter the license key that you received in the email right after the purchase:', 'freemius' ),
122
+ 'activating-license' => __( 'Activating license...', 'freemius' ),
123
+ 'change-license' => __( 'Change License', 'freemius' ),
124
+ 'update-license' => __( 'Update License', 'freemius' ),
125
+ 'deactivate-license' => __( 'Deactivate License', 'freemius' ),
126
+ 'activate' => __( 'Activate', 'freemius' ),
127
+ 'deactivate' => __( 'Deactivate', 'freemius' ),
128
+ 'skip-deactivate' => __( 'Skip & Deactivate', 'freemius' ),
129
+ 'no-deactivate' => __( 'No - just deactivate', 'freemius' ),
130
+ 'yes-do-your-thing' => __( 'Yes - do your thing', 'freemius' ),
131
+ 'active' => _x( 'Active', 'active mode', 'freemius' ),
132
+ 'is-active' => _x( 'Is Active', 'is active mode?', 'freemius' ),
133
+ 'install-now' => __( 'Install Now', 'freemius' ),
134
+ 'install-update-now' => __( 'Install Update Now', 'freemius' ),
135
+ 'more-information-about-x' => __( 'More information about %s', 'freemius' ),
136
+ 'localhost' => __( 'Localhost', 'freemius' ),
137
+ 'activate-x-plan' => _x( 'Activate %s Plan', 'as activate Professional plan', 'freemius' ),
138
+ 'x-left' => _x( '%s left', 'as 5 licenses left', 'freemius' ),
139
+ 'last-license' => __( 'Last license', 'freemius' ),
140
+ 'what-is-your-x' => __( 'What is your %s?', 'freemius' ),
141
+ 'activate-this-addon' => __( 'Activate this add-on', 'freemius' ),
142
+ '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?', 'freemius' ),
143
+ '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?', 'freemius' ),
144
+ '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?', 'freemius' ),
145
+ 'downgrade-x-confirm' => __( 'Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s.', 'freemius' ),
146
+ 'cancel-trial-confirm' => __( 'Cancelling the trial will immediately block access to all premium features. Are you sure?', 'freemius' ),
147
+ 'after-downgrade-non-blocking' => __( 'You can still enjoy all %s features but you will not have access to plugin updates and support.', 'freemius' ),
148
+ 'after-downgrade-blocking' => __( 'Once your license expire you can still use the Free version but you will NOT have access to the %s features.', 'freemius' ),
149
+ 'proceed-confirmation' => __( 'Are you sure you want to proceed?', 'freemius' ),
150
+ #endregion Account
151
+
152
+ 'add-ons-for-x' => __( 'Add Ons for %s', 'freemius' ),
153
+ '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.', 'freemius' ),
154
+ #region Plugin Deactivation
155
+ 'deactivation-share-reason' => __( 'If you have a moment, please let us know why you are deactivating', 'freemius' ),
156
+ 'deactivation-modal-button-confirm' => __( 'Yes - Deactivate', 'freemius' ),
157
+ 'deactivation-modal-button-submit' => __( 'Submit & Deactivate', 'freemius' ),
158
+ 'deactivation-modal-button-cancel' => _x( 'Cancel', 'the text of the cancel button of the plugin deactivation dialog box.', 'freemius' ),
159
+ 'reason-no-longer-needed' => __( 'I no longer need the plugin', 'freemius' ),
160
+ 'reason-found-a-better-plugin' => __( 'I found a better plugin', 'freemius' ),
161
+ 'reason-needed-for-a-short-period' => __( 'I only needed the plugin for a short period', 'freemius' ),
162
+ 'reason-broke-my-site' => __( 'The plugin broke my site', 'freemius' ),
163
+ 'reason-suddenly-stopped-working' => __( 'The plugin suddenly stopped working', 'freemius' ),
164
+ 'reason-cant-pay-anymore' => __( "I can't pay for it anymore", 'freemius' ),
165
+ 'reason-temporary-deactivation' => __( "It's a temporary deactivation. I'm just debugging an issue.", 'freemius' ),
166
+ 'reason-other' => _x( 'Other', 'the text of the "other" reason for deactivating the plugin that is shown in the modal box.', 'freemius' ),
167
+ 'ask-for-reason-message' => __( 'Kindly tell us the reason so we can improve.', 'freemius' ),
168
+ 'placeholder-plugin-name' => __( "What's the plugin's name?", 'freemius' ),
169
+ 'placeholder-comfortable-price' => __( 'What price would you feel comfortable paying?', 'freemius' ),
170
+ 'reason-couldnt-make-it-work' => __( "I couldn't understand how to make it work", 'freemius' ),
171
+ 'reason-great-but-need-specific-feature' => __( "The plugin is great, but I need specific feature that you don't support", 'freemius' ),
172
+ 'reason-not-working' => __( 'The plugin is not working', 'freemius' ),
173
+ 'reason-not-what-i-was-looking-for' => __( "It's not what I was looking for", 'freemius' ),
174
+ 'reason-didnt-work-as-expected' => __( "The plugin didn't work as expected", 'freemius' ),
175
+ 'placeholder-feature' => __( 'What feature?', 'freemius' ),
176
+ 'placeholder-share-what-didnt-work' => __( "Kindly share what didn't work so we can fix it for future users...", 'freemius' ),
177
+ 'placeholder-what-youve-been-looking-for' => __( "What you've been looking for?", 'freemius' ),
178
+ 'placeholder-what-did-you-expect' => __( "What did you expect?", 'freemius' ),
179
+ 'reason-didnt-work' => __( "The plugin didn't work", 'freemius' ),
180
+ 'reason-dont-like-to-share-my-information' => __( "I don't like to share my information with you", 'freemius' ),
181
+ #endregion Plugin Deactivation
182
+
183
+ #region Connect
184
+ 'hey-x' => _x( 'Hey %s,', 'greeting', 'freemius' ),
185
+ 'thanks-x' => _x( 'Thanks %s!', 'a greeting. E.g. Thanks John!', 'freemius' ),
186
+ 'connect-message' => __( 'In order to enjoy all our features and functionality, %s needs to connect your user, %s at %s, to %s', 'freemius' ),
187
+ 'connect-message_on-update' => __( 'Please help us improve %2$s! If you opt-in, some data about your usage of %2$s will be sent to %5$s. If you skip this, that\'s okay! %2$s will still work just fine.', 'freemius' ),
188
+ '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 complete the install.', 'freemius' ),
189
+ 'thanks-for-purchasing' => __( 'Thanks for purchasing %s! To get started, please enter your license key:', 'freemius' ),
190
+ 'license-sync-disclaimer' => __( 'The plugin will be periodically sending data to %s to check for plugin updates and verify the validity of your license.', 'freemius' ),
191
+ 'what-permissions' => __( 'What permissions are being granted?', 'freemius' ),
192
+ 'permissions-profile' => __( 'Your Profile Overview', 'freemius' ),
193
+ 'permissions-profile_desc' => __( 'Name and email address', 'freemius' ),
194
+ 'permissions-site' => __( 'Your Site Overview', 'freemius' ),
195
+ 'permissions-site_desc' => __( 'Site URL, WP version, PHP info, plugins & themes', 'freemius' ),
196
+ 'permissions-events' => __( 'Current Plugin Events', 'freemius' ),
197
+ 'permissions-events_desc' => __( 'Activation, deactivation and uninstall', 'freemius' ),
198
+ 'permissions-plugins_themes' => __( 'Plugins & Themes', 'freemius' ),
199
+ 'permissions-plugins_themes_desc' => __( 'Titles, versions and state.', 'freemius' ),
200
+ 'permissions-newsletter' => __( 'Newsletter', 'freemius' ),
201
+ 'permissions-newsletter_desc' => __( 'Updates, announcements, marketing, no spam', 'freemius' ),
202
+ 'privacy-policy' => __( 'Privacy Policy', 'freemius' ),
203
+ 'tos' => __( 'Terms of Service', 'freemius' ),
204
+ 'activating' => _x( 'Activating', 'as activating plugin', 'freemius' ),
205
+ 'sending-email' => _x( 'Sending email', 'as in the process of sending an email', 'freemius' ),
206
+ 'opt-in-connect' => _x( 'Allow & Continue', 'button label', 'freemius' ),
207
+ 'agree-activate-license' => _x( 'Agree & Activate License', 'button label', 'freemius' ),
208
+ 'skip' => _x( 'Skip', 'verb', 'freemius' ),
209
+ 'resend-activation-email' => __( 'Re-send activation email', 'freemius' ),
210
+ 'license-key' => __( 'License key', 'freemius' ),
211
+ 'have-license-key' => __( 'Have a license key?', 'freemius' ),
212
+ 'dont-have-license-key' => __( 'Don\'t have a license key?', 'freemius' ),
213
+ #endregion Connect
214
+
215
+ #region Screenshots
216
+ 'screenshots' => __( 'Screenshots', 'freemius' ),
217
+ 'view-full-size-x' => __( 'Click to view full-size screenshot %d', 'freemius' ),
218
+ #endregion Screenshots
219
+
220
+ #region Debug
221
+ 'freemius-debug' => __( 'Freemius Debug', 'freemius' ),
222
+ 'on' => _x( 'On', 'as turned on', 'freemius' ),
223
+ 'off' => _x( 'Off', 'as turned off', 'freemius' ),
224
+ 'debugging' => _x( 'Debugging', 'as code debugging', 'freemius' ),
225
+ 'freemius-state' => __( 'Freemius State', 'freemius' ),
226
+ 'connected' => _x( 'Connected', 'as connection was successful', 'freemius' ),
227
+ 'blocked' => _x( 'Blocked', 'as connection blocked', 'freemius' ),
228
+ 'api' => _x( 'API', 'as application program interface', 'freemius' ),
229
+ 'sdk' => _x( 'SDK', 'as software development kit versions', 'freemius' ),
230
+ 'sdk-versions' => _x( 'SDK Versions', 'as software development kit versions', 'freemius' ),
231
+ 'plugin-path' => _x( 'Plugin Path', 'as plugin folder path', 'freemius' ),
232
+ 'sdk-path' => _x( 'SDK Path', 'as sdk path', 'freemius' ),
233
+ 'addons-of-x' => __( 'Add Ons of Plugin %s', 'freemius' ),
234
+ 'delete-all-confirm' => __( 'Are you sure you want to delete all Freemius data?', 'freemius' ),
235
+ 'actions' => __( 'Actions', 'freemius' ),
236
+ 'delete-all-accounts' => __( 'Delete All Accounts', 'freemius' ),
237
+ 'start-fresh' => __( 'Start Fresh', 'freemius' ),
238
+ 'clear-api-cache' => __( 'Clear API Cache', 'freemius' ),
239
+ 'sync-data-from-server' => __( 'Sync Data From Server', 'freemius' ),
240
+ 'scheduled-crons' => __( 'Scheduled Crons', 'freemius' ),
241
+ 'plugins-themes-sync' => __( 'Plugins & Themes Sync', 'freemius' ),
242
+ #endregion Debug
243
+
244
+ #region Expressions
245
+ 'congrats' => _x( 'Congrats', 'as congratulations', 'freemius' ),
246
+ 'oops' => _x( 'Oops', 'exclamation', 'freemius' ),
247
+ 'yee-haw' => _x( 'Yee-haw', 'interjection expressing joy or exuberance', 'freemius' ),
248
+ 'woot' => _x( 'W00t', '(especially in electronic communication) used to express elation, enthusiasm, or triumph.', 'freemius' ),
249
+ 'right-on' => _x( 'Right on', 'a positive response', 'freemius' ),
250
+ 'hmm' => _x( 'Hmm', 'something somebody says when they are thinking about what you have just said. ', 'freemius' ),
251
+ 'ok' => __( 'O.K', 'freemius' ),
252
+ 'hey' => _x( 'Hey', 'exclamation', 'freemius' ),
253
+ 'heads-up' => _x( 'Heads up', 'advance notice of something that will need attention.', 'freemius' ),
254
+ #endregion Expressions
255
+
256
+ #region Admin Notices
257
+ 'you-have-latest' => __( 'Seems like you got the latest release.', 'freemius' ),
258
+ 'you-are-good' => __( 'You are all good!', 'freemius' ),
259
+ 'user-exist-message' => __( 'Sorry, we could not complete the email update. Another user with the same email is already registered.', 'freemius' ),
260
+ '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.', 'freemius' ),
261
+ 'email-updated-message' => __( 'Your email was successfully updated. You should receive an email with confirmation instructions in few moments.', 'freemius' ),
262
+ 'name-updated-message' => __( 'Your name was successfully updated.', 'freemius' ),
263
+ 'x-updated' => __( 'You have successfully updated your %s.', 'freemius' ),
264
+ 'name-update-failed-message' => __( 'Please provide your full name.', 'freemius' ),
265
+ '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.', 'freemius' ),
266
+ 'addons-info-external-message' => __( 'Just letting you know that the add-ons information of %s is being pulled from an external server.', 'freemius' ),
267
+ 'no-cc-required' => __( 'No credit card required', 'freemius' ),
268
+ 'premium-activated-message' => __( 'Premium plugin version was successfully activated.', 'freemius' ),
269
+ 'successful-version-upgrade-message' => __( 'The upgrade of %s was successfully completed.', 'freemius' ),
270
+ 'activation-with-plan-x-message' => __( 'Your account was successfully activated with the %s plan.', 'freemius' ),
271
+ 'download-latest-x-version' => __( 'Download the latest %s version now', 'freemius' ),
272
+ 'download-latest-version' => __( 'Download the latest version now', 'freemius' ),
273
+ 'addon-successfully-purchased-message' => _x( '%s Add-on was successfully purchased.', '%s - product name, e.g. Facebook add-on was successfully...', 'freemius' ),
274
+ 'addon-successfully-upgraded-message' => __( 'Your %s Add-on plan was successfully upgraded.', 'freemius' ),
275
+ 'email-verified-message' => __( 'Your email has been successfully verified - you are AWESOME!', 'freemius' ),
276
+ 'plan-upgraded-message' => __( 'Your plan was successfully upgraded.', 'freemius' ),
277
+ 'plan-changed-to-x-message' => __( 'Your plan was successfully changed to %s.', 'freemius' ),
278
+ 'license-expired-blocking-message' => __( 'Your license has expired. You can still continue using the free plugin forever.', 'freemius' ),
279
+ 'license-cancelled' => __( 'Your license has been cancelled. If you think it\'s a mistake, please contact support.', 'freemius' ),
280
+ 'trial-started-message' => __( 'Your trial has been successfully started.', 'freemius' ),
281
+ 'license-activated-message' => __( 'Your license was successfully activated.', 'freemius' ),
282
+ 'no-active-license-message' => __( 'It looks like your site currently doesn\'t have an active license.', 'freemius' ),
283
+ 'license-deactivation-message' => __( 'Your license was successfully deactivated, you are back to the %s plan.', 'freemius' ),
284
+ 'license-deactivation-failed-message' => __( 'It looks like the license deactivation failed.', 'freemius' ),
285
+ 'license-activation-failed-message' => __( 'It looks like the license could not be activated.', 'freemius' ),
286
+ 'server-error-message' => __( 'Error received from the server:', 'freemius' ),
287
+ 'trial-expired-message' => __( 'Your trial has expired. You can still continue using all our free features.', 'freemius' ),
288
+ 'plan-x-downgraded-message' => __( 'Your plan was successfully downgraded. Your %s plan license will expire in %s.', 'freemius' ),
289
+ 'plan-downgraded-failure-message' => __( 'Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes.', 'freemius' ),
290
+ 'trial-cancel-no-trial-message' => __( 'It looks like you are not in trial mode anymore so there\'s nothing to cancel :)', 'freemius' ),
291
+ 'trial-cancel-message' => __( 'Your %s free trial was successfully cancelled.', 'freemius' ),
292
+ 'version-x-released' => _x( 'Version %s was released.', '%s - numeric version number', 'freemius' ),
293
+ 'please-download-x' => __( 'Please download %s.', 'freemius' ),
294
+ 'latest-x-version' => _x( 'the latest %s version here', '%s - plan name, as the latest professional version here', 'freemius' ),
295
+ 'trial-x-promotion-message' => __( 'How do you like %s so far? Test all our %s premium features with a %d-day free trial.', 'freemius' ),
296
+ 'start-free-trial' => _x( 'Start free trial', 'call to action', 'freemius' ),
297
+ 'trial-cancel-failure-message' => __( 'Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes.', 'freemius' ),
298
+ 'trial-utilized' => __( 'You already utilized a trial before.', 'freemius' ),
299
+ 'in-trial-mode' => __( 'You are already running the plugin in a trial mode.', 'freemius' ),
300
+ 'trial-plan-x-not-exist' => __( 'Plan %s do not exist, therefore, can\'t start a trial.', 'freemius' ),
301
+ 'plan-x-no-trial' => __( 'Plan %s does not support a trial period.', 'freemius' ),
302
+ 'no-trials' => __( 'None of the plugin\'s plans supports a trial period.', 'freemius' ),
303
+ 'unexpected-api-error' => __( 'Unexpected API error. Please contact the plugin\'s author with the following error.', 'freemius' ),
304
+ 'no-commitment-for-x-days' => __( 'No commitment for %s days - cancel anytime!', 'freemius' ),
305
+ '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.', 'freemius' ),
306
+ 'could-not-activate-x' => __( 'Couldn\'t activate %s.', 'freemius' ),
307
+ 'contact-us-with-error-message' => __( 'Please contact us with the following message:', 'freemius' ),
308
+ '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.', 'freemius' ),
309
+ 'contact-us-here' => __( 'Please contact us here', 'freemius' ),
310
+ 'plan-did-not-change-email-message' => __( 'I have upgraded my account but when I try to Sync the License, the plan remains %s.', 'freemius' ),
311
+ #endregion Admin Notices
312
+ #region Connectivity Issues
313
+ 'connectivity-test-fails-message' => __( 'From unknown reason, the API connectivity test failed.', 'freemius' ),
314
+ '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?', 'freemius' ),
315
+ '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.', 'freemius' ),
316
+ 'cloudflare-blocks-connection-message' => __( 'From unknown reason, CloudFlare, the firewall we use, blocks the connection.', 'freemius' ),
317
+ 'x-requires-access-to-api' => _x( '%s requires an access to our API.', 'as pluginX requires an access to our API', 'freemius' ),
318
+ 'squid-blocks-connection-message' => __( 'It looks like your server is using Squid ACL (access control lists), which blocks the connection.', 'freemius' ),
319
+ 'squid-no-clue-title' => __( 'I don\'t know what is Squid or ACL, help me!', 'freemius' ),
320
+ '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.', 'freemius' ),
321
+ 'sysadmin-title' => __( 'I\'m a system administrator', 'freemius' ),
322
+ 'squid-sysadmin-desc' => __( 'Great, please whitelist the following domains: %s. Once you done, deactivate the plugin and activate it again.', 'freemius' ),
323
+ 'curl-missing-no-clue-title' => __( 'I don\'t know what is cURL or how to install it, help me!', 'freemius' ),
324
+ '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.', 'freemius' ),
325
+ '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.', 'freemius' ),
326
+ '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.', 'freemius' ),
327
+ 'fix-issue-title' => __( 'Yes - I\'m giving you a chance to fix it', 'freemius' ),
328
+ '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.', 'freemius' ),
329
+ 'install-previous-title' => __( 'Let\'s try your previous version', 'freemius' ),
330
+ 'install-previous-desc' => __( 'Uninstall this version and install the previous one.', 'freemius' ),
331
+ 'deactivate-plugin-title' => __( 'That\'s exhausting, please deactivate', 'freemius' ),
332
+ 'deactivate-plugin-desc' => __( 'We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future.', 'freemius' ),
333
+ '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.', 'freemius' ),
334
+ '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', '%1s - plugin title, %2s - API domain', 'freemius' ),
335
+ '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.', 'freemius' ),
336
+ #endregion Connectivity Issues
337
+ #region Change Owner
338
+ '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.', 'freemius' ),
339
+ 'change-owner-request_owner-confirmed' => __( 'Thanks for confirming the ownership change. An email was just sent to %s for final approval.', 'freemius' ),
340
+ 'change-owner-request_candidate-confirmed' => __( '%s is the new owner of the account.', 'freemius' ),
341
+ #endregion Change Owner
342
+ 'addon-x-cannot-run-without-y' => _x( '%s cannot run without %s.', 'addonX cannot run without pluginY', 'freemius' ),
343
+ 'addon-x-cannot-run-without-parent' => _x( '%s cannot run without the plugin.', 'addonX cannot run...', 'freemius' ),
344
+ 'plugin-x-activation-message' => _x( '%s activation was successfully completed.', 'pluginX activation was successfully...', 'freemius' ),
345
+ 'features-and-pricing' => _x( 'Features & Pricing', 'Plugin installer section title', 'freemius' ),
346
+ 'free-addon-not-deployed' => __( 'Add-on must be deployed to WordPress.org or Freemius.', 'freemius' ),
347
+ 'paid-addon-not-deployed' => __( 'Paid add-on must be deployed to Freemius.', 'freemius' ),
348
+ #region Add-On Licensing
349
+ 'addon-no-license-message' => __( '%s is a premium only add-on. You have to purchase a license first before activating the plugin.', 'freemius' ),
350
+ '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.', 'freemius' ),
351
+ #endregion Add-On Licensing
352
+ #region Billing Cycles
353
+ 'monthly' => _x( 'Monthly', 'as every month', 'freemius' ),
354
+ 'mo' => _x( 'mo', 'as monthly period', 'freemius' ),
355
+ 'annual' => _x( 'Annual', 'as once a year', 'freemius' ),
356
+ 'annually' => _x( 'Annually', 'as once a year', 'freemius' ),
357
+ 'once' => _x( 'Once', 'as once a year', 'freemius' ),
358
+ 'year' => _x( 'year', 'as annual period', 'freemius' ),
359
+ 'lifetime' => __( 'Lifetime', 'freemius' ),
360
+ 'best' => _x( 'Best', 'e.g. the best product', 'freemius' ),
361
+ 'billed-x' => _x( 'Billed %s', 'e.g. billed monthly', 'freemius' ),
362
+ 'save-x' => _x( 'Save %s', 'as a discount of $5 or 10%', 'freemius' ),
363
+ #endregion Billing Cycles
364
+ 'view-details' => __( 'View details', 'freemius' ),
365
+ );
freemius/includes/managers/class-fs-admin-menu-manager.php CHANGED
@@ -110,7 +110,7 @@
110
  }
111
 
112
  private function get_bool_option( &$options, $key, $default = false ) {
113
- return isset( $options[ $key ] ) &&is_bool( $options[ $key ] ) ? $options[ $key ] : $default;
114
  }
115
 
116
  #endregion Helpers
@@ -527,6 +527,9 @@
527
  } else {
528
  global $menu;
529
 
 
 
 
530
  // Create new top-level menu action.
531
  $hookname = add_menu_page(
532
  $found_menu['menu'][3],
@@ -537,9 +540,6 @@
537
  $found_menu['menu'][6],
538
  $found_menu['position']
539
  );
540
-
541
- // Remove original CPT menu.
542
- unset( $menu[ $found_menu['position'] ] );
543
  }
544
 
545
  return $hookname;
110
  }
111
 
112
  private function get_bool_option( &$options, $key, $default = false ) {
113
+ return isset( $options[ $key ] ) && is_bool( $options[ $key ] ) ? $options[ $key ] : $default;
114
  }
115
 
116
  #endregion Helpers
527
  } else {
528
  global $menu;
529
 
530
+ // Remove original CPT menu.
531
+ unset( $menu[ $found_menu['position'] ] );
532
+
533
  // Create new top-level menu action.
534
  $hookname = add_menu_page(
535
  $found_menu['menu'][3],
540
  $found_menu['menu'][6],
541
  $found_menu['position']
542
  );
 
 
 
543
  }
544
 
545
  return $hookname;
freemius/includes/managers/class-fs-admin-notice-manager.php CHANGED
@@ -1,310 +1,310 @@
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_{$slug}_dismiss_notice_action", 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 $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
- $this->add( $message, $title, $type, true, $all_admin, $id );
283
- }
284
-
285
- /**
286
- * Clear all sticky messages.
287
- *
288
- * @author Vova Feldman (@svovaf)
289
- * @since 1.0.8
290
- */
291
- function clear_all_sticky() {
292
- $this->_sticky_storage->clear_all();
293
- }
294
-
295
- /**
296
- * Add admin message to all admin messages queue, and hook to all_admin_notices if not yet hooked.
297
- *
298
- * @author Vova Feldman (@svovaf)
299
- * @since 1.0.4
300
- *
301
- * @param string $message
302
- * @param string $title
303
- * @param string $type
304
- * @param bool $is_sticky
305
- * @param string $id Message ID
306
- */
307
- function add_all( $message, $title = '', $type = 'success', $is_sticky = false, $id = '' ) {
308
- $this->add( $message, $title, $type, $is_sticky, true, $id );
309
- }
310
  }
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_{$slug}_dismiss_notice_action", 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
+ $this->add( $message, $title, $type, true, $all_admin, $id );
283
+ }
284
+
285
+ /**
286
+ * Clear all sticky messages.
287
+ *
288
+ * @author Vova Feldman (@svovaf)
289
+ * @since 1.0.8
290
+ */
291
+ function clear_all_sticky() {
292
+ $this->_sticky_storage->clear_all();
293
+ }
294
+
295
+ /**
296
+ * Add admin message to all admin messages queue, and hook to all_admin_notices if not yet hooked.
297
+ *
298
+ * @author Vova Feldman (@svovaf)
299
+ * @since 1.0.4
300
+ *
301
+ * @param string $message
302
+ * @param string $title
303
+ * @param string $type
304
+ * @param bool $is_sticky
305
+ * @param string $id Message ID
306
+ */
307
+ function add_all( $message, $title = '', $type = 'success', $is_sticky = false, $id = '' ) {
308
+ $this->add( $message, $title, $type, $is_sticky, true, $id );
309
+ }
310
  }
freemius/includes/sdk/Freemius.php CHANGED
@@ -328,7 +328,9 @@
328
  $opts[ CURLOPT_RETURNTRANSFER ] = true;
329
  }
330
 
331
- $opts[ CURLOPT_URL ] = Freemius_Api::GetUrl( $pCanonizedPath, $pIsSandbox );
 
 
332
  $opts[ CURLOPT_CUSTOMREQUEST ] = $pMethod;
333
 
334
  $resource = explode( '?', $pCanonizedPath );
@@ -337,7 +339,7 @@
337
  // for 2 seconds if the server does not support this header.
338
  $opts[ CURLOPT_HTTPHEADER ][] = 'Expect:';
339
 
340
- if ( 'https' === substr( strtolower( $pCanonizedPath ), 0, 5 ) ) {
341
  $opts[ CURLOPT_SSL_VERIFYHOST ] = false;
342
  $opts[ CURLOPT_SSL_VERIFYPEER ] = false;
343
  }
328
  $opts[ CURLOPT_RETURNTRANSFER ] = true;
329
  }
330
 
331
+ $request_url = Freemius_Api::GetUrl( $pCanonizedPath, $pIsSandbox );
332
+
333
+ $opts[ CURLOPT_URL ] = $request_url;
334
  $opts[ CURLOPT_CUSTOMREQUEST ] = $pMethod;
335
 
336
  $resource = explode( '?', $pCanonizedPath );
339
  // for 2 seconds if the server does not support this header.
340
  $opts[ CURLOPT_HTTPHEADER ][] = 'Expect:';
341
 
342
+ if ( 'https' === substr( strtolower( $request_url ), 0, 5 ) ) {
343
  $opts[ CURLOPT_SSL_VERIFYHOST ] = false;
344
  $opts[ CURLOPT_SSL_VERIFYPEER ] = false;
345
  }
freemius/includes/sdk/FreemiusBase.php CHANGED
@@ -33,7 +33,7 @@
33
  );
34
 
35
  foreach ( $exceptions as $e ) {
36
- require FS_SDK__EXCEPTIONS_PATH . $e . '.php';
37
  }
38
 
39
  abstract class Freemius_Api_Base {
33
  );
34
 
35
  foreach ( $exceptions as $e ) {
36
+ require_once FS_SDK__EXCEPTIONS_PATH . $e . '.php';
37
  }
38
 
39
  abstract class Freemius_Api_Base {
freemius/start.php CHANGED
@@ -1,341 +1,342 @@
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.1.8.1';
19
-
20
- #region SDK Selection Logic --------------------------------------------------------------------
21
-
22
- /**
23
- * Special logic added on 1.1.6 to make sure that every Freemius powered plugin
24
- * will ALWAYS be loaded with the newest SDK from the active Freemius powered plugins.
25
- *
26
- * Since Freemius SDK is backward compatible, this will make sure that all Freemius powered
27
- * plugins will run correctly.
28
- *
29
- * @since 1.1.6
30
- */
31
-
32
- global $fs_active_plugins;
33
-
34
- $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
- if ( fs_redirect( $_SERVER['REQUEST_URI'] ) ) {
88
- exit();
89
- }
90
- }
91
- } else {
92
- if ( ! function_exists( 'get_plugins' ) ) {
93
- require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
94
- }
95
-
96
- $is_newest_sdk_plugin_activate = is_plugin_active( $fs_active_plugins->newest->plugin_path );
97
-
98
- if ( $is_current_sdk_newest &&
99
- ! $is_newest_sdk_plugin_activate &&
100
- ! $fs_active_plugins->newest->in_activation
101
- ) {
102
- // If current SDK is the newest and the plugin is NOT active, it means
103
- // that the current plugin in activation mode.
104
- $fs_active_plugins->newest->in_activation = true;
105
- update_option( 'fs_active_plugins', $fs_active_plugins );
106
- }
107
-
108
- $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' ) );
109
-
110
- if ( ! $is_newest_sdk_path_valid && ! $is_current_sdk_newest ) {
111
- // Plugin with newest SDK is no longer active, or SDK was moved to a different location.
112
- unset( $fs_active_plugins->plugins[ $fs_active_plugins->newest->sdk_path ] );
113
- }
114
-
115
- if ( ! ( $is_newest_sdk_plugin_activate || $fs_active_plugins->newest->in_activation ) ||
116
- ! $is_newest_sdk_path_valid ||
117
- // Is newest SDK downgraded.
118
- ( $this_sdk_relative_path == $fs_active_plugins->newest->sdk_path &&
119
- version_compare( $fs_active_plugins->newest->version, $this_sdk_version, '>' ) )
120
- ) {
121
- /**
122
- * Plugin with newest SDK is no longer active.
123
- * OR
124
- * The newest SDK was in the current plugin. BUT, seems like the version of
125
- * the SDK was downgraded to a lower SDK.
126
- */
127
- // Find the active plugin with the newest SDK version and update the newest reference.
128
- fs_fallback_to_newest_active_sdk();
129
- } else {
130
- if ( $is_newest_sdk_plugin_activate &&
131
- $this_sdk_relative_path == $fs_active_plugins->newest->sdk_path &&
132
- ( $fs_active_plugins->newest->in_activation ||
133
- ( class_exists( 'Freemius' ) && ( ! defined( 'WP_FS__SDK_VERSION' ) || version_compare( WP_FS__SDK_VERSION, $this_sdk_version, '<' ) ) )
134
- )
135
-
136
- ) {
137
- if ( $fs_active_plugins->newest->in_activation ) {
138
- // Plugin no more in activation.
139
- $fs_active_plugins->newest->in_activation = false;
140
- update_option( 'fs_active_plugins', $fs_active_plugins );
141
- }
142
-
143
- // Reorder plugins to load plugin with newest SDK first.
144
- if ( fs_newest_sdk_plugin_first() ) {
145
- // Refresh page after re-order to make sure activated plugin loads newest SDK.
146
- if ( class_exists( 'Freemius' ) ) {
147
- if ( fs_redirect( $_SERVER['REQUEST_URI'] ) ) {
148
- exit();
149
- }
150
- }
151
- }
152
- }
153
- }
154
- }
155
-
156
- if ( class_exists( 'Freemius' ) ) {
157
- // SDK was already loaded.
158
- return;
159
- }
160
-
161
- if ( version_compare( $this_sdk_version, $fs_active_plugins->newest->version, '<' ) ) {
162
- $newest_sdk_starter = fs_normalize_path( WP_PLUGIN_DIR . '/' . $fs_active_plugins->newest->sdk_path . '/start.php' );
163
-
164
- if ( file_exists( $newest_sdk_starter ) ) {
165
- // Reorder plugins to load plugin with newest SDK first.
166
- fs_newest_sdk_plugin_first();
167
-
168
- // There's a newer SDK version, load it instead of the current one!
169
- require_once $newest_sdk_starter;
170
-
171
- return;
172
- }
173
- }
174
-
175
- #endregion SDK Selection Logic --------------------------------------------------------------------
176
-
177
- #region Hooks & Filters Collection --------------------------------------------------------------------
178
-
179
- /**
180
- * Freemius hooks (actions & filters) tags structure:
181
- *
182
- * fs_{filter/action_name}_{plugin_slug}
183
- *
184
- * --------------------------------------------------------
185
- *
186
- * Usage with WordPress' add_action() / add_filter():
187
- *
188
- * add_action('fs_{filter/action_name}_{plugin_slug}', $callable);
189
- *
190
- * --------------------------------------------------------
191
- *
192
- * Usage with Freemius' instance add_action() / add_filter():
193
- *
194
- * // No need to add 'fs_' prefix nor '_{plugin_slug}' suffix.
195
- * my_freemius()->add_action('{action_name}', $callable);
196
- *
197
- * --------------------------------------------------------
198
- *
199
- * Freemius filters collection:
200
- *
201
- * fs_connect_url_{plugin_slug}
202
- * fs_trial_promotion_message_{plugin_slug}
203
- * fs_is_long_term_user_{plugin_slug}
204
- * fs_uninstall_reasons_{plugin_slug}
205
- * fs_is_plugin_update_{plugin_slug}
206
- * fs_api_domains_{plugin_slug}
207
- * fs_email_template_sections_{plugin_slug}
208
- * fs_support_forum_submenu_{plugin_slug}
209
- * fs_support_forum_url_{plugin_slug}
210
- * fs_connect_message_{plugin_slug}
211
- * fs_connect_message_on_update_{plugin_slug}
212
- * fs_uninstall_confirmation_message_{plugin_slug}
213
- * fs_pending_activation_message_{plugin_slug}
214
- * fs_is_submenu_visible_{plugin_slug}
215
- * fs_plugin_icon_{plugin_slug}
216
- * fs_show_trial_{plugin_slug}
217
- *
218
- * --------------------------------------------------------
219
- *
220
- * Freemius actions collection:
221
- *
222
- * fs_after_license_loaded_{plugin_slug}
223
- * fs_after_license_change_{plugin_slug}
224
- * fs_after_plans_sync_{plugin_slug}
225
- *
226
- * fs_after_account_details_{plugin_slug}
227
- * fs_after_account_user_sync_{plugin_slug}
228
- * fs_after_account_plan_sync_{plugin_slug}
229
- * fs_before_account_load_{plugin_slug}
230
- * fs_after_account_connection_{plugin_slug}
231
- * fs_account_property_edit_{plugin_slug}
232
- * fs_account_email_verified_{plugin_slug}
233
- * fs_account_page_load_before_departure_{plugin_slug}
234
- * fs_before_account_delete_{plugin_slug}
235
- * fs_after_account_delete_{plugin_slug}
236
- *
237
- * fs_sdk_version_update_{plugin_slug}
238
- * fs_plugin_version_update_{plugin_slug}
239
- *
240
- * fs_initiated_{plugin_slug}
241
- * fs_after_init_plugin_registered_{plugin_slug}
242
- * fs_after_init_plugin_anonymous_{plugin_slug}
243
- * fs_after_init_plugin_pending_activations_{plugin_slug}
244
- * fs_after_init_addon_registered_{plugin_slug}
245
- * fs_after_init_addon_anonymous_{plugin_slug}
246
- * fs_after_init_addon_pending_activations_{plugin_slug}
247
- *
248
- * fs_after_premium_version_activation_{plugin_slug}
249
- * fs_after_free_version_reactivation_{plugin_slug}
250
- *
251
- * fs_after_uninstall_{plugin_slug}
252
- * fs_before_admin_menu_init_{plugin_slug}
253
- */
254
-
255
- #endregion Hooks & Filters Collection --------------------------------------------------------------------
256
-
257
- if ( ! class_exists( 'Freemius' ) ) {
258
-
259
- if ( ! defined( 'WP_FS__SDK_VERSION' ) ) {
260
- define( 'WP_FS__SDK_VERSION', $this_sdk_version );
261
- }
262
-
263
- // Configuration should be loaded first.
264
- require_once dirname( __FILE__ ) . '/config.php';
265
-
266
- // Logger must be loaded before any other.
267
- require_once WP_FS__DIR_INCLUDES . '/class-fs-logger.php';
268
- require_once WP_FS__DIR_INCLUDES . '/debug/debug-bar-start.php';
269
-
270
- require_once WP_FS__DIR_INCLUDES . '/fs-core-functions.php';
271
- // require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-abstract-manager.php';
272
- require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-option-manager.php';
273
- require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-cache-manager.php';
274
- require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-admin-notice-manager.php';
275
- require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-admin-menu-manager.php';
276
- require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-key-value-storage.php';
277
- require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-license-manager.php';
278
- require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-plan-manager.php';
279
- require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-plugin-manager.php';
280
- require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-entity.php';
281
- require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-scope-entity.php';
282
- require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-user.php';
283
- require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-site.php';
284
- require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-plugin.php';
285
- require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-plugin-info.php';
286
- require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-plugin-tag.php';
287
- require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-plugin-plan.php';
288
- require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-pricing.php';
289
- require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-plugin-license.php';
290
- require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-subscription.php';
291
- require_once WP_FS__DIR_INCLUDES . '/class-fs-api.php';
292
- require_once WP_FS__DIR_INCLUDES . '/class-fs-plugin-updater.php';
293
- require_once WP_FS__DIR_INCLUDES . '/class-fs-security.php';
294
- require_once WP_FS__DIR_INCLUDES . '/class-freemius-abstract.php';
295
- require_once WP_FS__DIR_INCLUDES . '/class-freemius.php';
296
-
297
- /**
298
- * Quick shortcut to get Freemius for specified plugin.
299
- * Used by various templates.
300
- *
301
- * @param string $slug
302
- *
303
- * @return Freemius
304
- */
305
- function freemius( $slug ) {
306
- return Freemius::instance( $slug );
307
- }
308
-
309
- /**
310
- * @param string $slug
311
- * @param number $plugin_id
312
- * @param string $public_key
313
- * @param bool $is_live Is live or test plugin.
314
- * @param bool $is_premium Hints freemius if running the premium plugin or not.
315
- *
316
- * @return Freemius
317
- */
318
- function fs_init( $slug, $plugin_id, $public_key, $is_live = true, $is_premium = true ) {
319
- $fs = Freemius::instance( $slug );
320
- $fs->init( $plugin_id, $public_key, $is_live, $is_premium );
321
-
322
- return $fs;
323
- }
324
-
325
- /**
326
- * @param array [string]string $plugin
327
- *
328
- * @return Freemius
329
- * @throws Freemius_Exception
330
- */
331
- function fs_dynamic_init( $plugin ) {
332
- $fs = Freemius::instance( $plugin['slug'] );
333
- $fs->dynamic_init( $plugin );
334
-
335
- return $fs;
336
- }
337
-
338
- function fs_dump_log() {
339
- FS_Logger::dump();
340
- }
 
341
  }
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.1.9';
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
+ if ( fs_redirect( $_SERVER['REQUEST_URI'] ) ) {
88
+ exit();
89
+ }
90
+ }
91
+ } else {
92
+ if ( ! function_exists( 'get_plugins' ) ) {
93
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
94
+ }
95
+
96
+ $is_newest_sdk_plugin_activate = is_plugin_active( $fs_active_plugins->newest->plugin_path );
97
+
98
+ if ( $is_current_sdk_newest &&
99
+ ! $is_newest_sdk_plugin_activate &&
100
+ ! $fs_active_plugins->newest->in_activation
101
+ ) {
102
+ // If current SDK is the newest and the plugin is NOT active, it means
103
+ // that the current plugin in activation mode.
104
+ $fs_active_plugins->newest->in_activation = true;
105
+ update_option( 'fs_active_plugins', $fs_active_plugins );
106
+ }
107
+
108
+ $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' ) );
109
+
110
+ if ( ! $is_newest_sdk_path_valid && ! $is_current_sdk_newest ) {
111
+ // Plugin with newest SDK is no longer active, or SDK was moved to a different location.
112
+ unset( $fs_active_plugins->plugins[ $fs_active_plugins->newest->sdk_path ] );
113
+ }
114
+
115
+ if ( ! ( $is_newest_sdk_plugin_activate || $fs_active_plugins->newest->in_activation ) ||
116
+ ! $is_newest_sdk_path_valid ||
117
+ // Is newest SDK downgraded.
118
+ ( $this_sdk_relative_path == $fs_active_plugins->newest->sdk_path &&
119
+ version_compare( $fs_active_plugins->newest->version, $this_sdk_version, '>' ) )
120
+ ) {
121
+ /**
122
+ * Plugin with newest SDK is no longer active.
123
+ * OR
124
+ * The newest SDK was in the current plugin. BUT, seems like the version of
125
+ * the SDK was downgraded to a lower SDK.
126
+ */
127
+ // Find the active plugin with the newest SDK version and update the newest reference.
128
+ fs_fallback_to_newest_active_sdk();
129
+ } else {
130
+ if ( $is_newest_sdk_plugin_activate &&
131
+ $this_sdk_relative_path == $fs_active_plugins->newest->sdk_path &&
132
+ ( $fs_active_plugins->newest->in_activation ||
133
+ ( class_exists( 'Freemius' ) && ( ! defined( 'WP_FS__SDK_VERSION' ) || version_compare( WP_FS__SDK_VERSION, $this_sdk_version, '<' ) ) )
134
+ )
135
+
136
+ ) {
137
+ if ( $fs_active_plugins->newest->in_activation ) {
138
+ // Plugin no more in activation.
139
+ $fs_active_plugins->newest->in_activation = false;
140
+ update_option( 'fs_active_plugins', $fs_active_plugins );
141
+ }
142
+
143
+ // Reorder plugins to load plugin with newest SDK first.
144
+ if ( fs_newest_sdk_plugin_first() ) {
145
+ // Refresh page after re-order to make sure activated plugin loads newest SDK.
146
+ if ( class_exists( 'Freemius' ) ) {
147
+ if ( fs_redirect( $_SERVER['REQUEST_URI'] ) ) {
148
+ exit();
149
+ }
150
+ }
151
+ }
152
+ }
153
+ }
154
+ }
155
+
156
+ if ( class_exists( 'Freemius' ) ) {
157
+ // SDK was already loaded.
158
+ return;
159
+ }
160
+
161
+ if ( version_compare( $this_sdk_version, $fs_active_plugins->newest->version, '<' ) ) {
162
+ $newest_sdk_starter = fs_normalize_path( WP_PLUGIN_DIR . '/' . $fs_active_plugins->newest->sdk_path . '/start.php' );
163
+
164
+ if ( file_exists( $newest_sdk_starter ) ) {
165
+ // Reorder plugins to load plugin with newest SDK first.
166
+ fs_newest_sdk_plugin_first();
167
+
168
+ // There's a newer SDK version, load it instead of the current one!
169
+ require_once $newest_sdk_starter;
170
+
171
+ return;
172
+ }
173
+ }
174
+
175
+ #endregion SDK Selection Logic --------------------------------------------------------------------
176
+
177
+ #region Hooks & Filters Collection --------------------------------------------------------------------
178
+
179
+ /**
180
+ * Freemius hooks (actions & filters) tags structure:
181
+ *
182
+ * fs_{filter/action_name}_{plugin_slug}
183
+ *
184
+ * --------------------------------------------------------
185
+ *
186
+ * Usage with WordPress' add_action() / add_filter():
187
+ *
188
+ * add_action('fs_{filter/action_name}_{plugin_slug}', $callable);
189
+ *
190
+ * --------------------------------------------------------
191
+ *
192
+ * Usage with Freemius' instance add_action() / add_filter():
193
+ *
194
+ * // No need to add 'fs_' prefix nor '_{plugin_slug}' suffix.
195
+ * my_freemius()->add_action('{action_name}', $callable);
196
+ *
197
+ * --------------------------------------------------------
198
+ *
199
+ * Freemius filters collection:
200
+ *
201
+ * fs_connect_url_{plugin_slug}
202
+ * fs_trial_promotion_message_{plugin_slug}
203
+ * fs_is_long_term_user_{plugin_slug}
204
+ * fs_uninstall_reasons_{plugin_slug}
205
+ * fs_is_plugin_update_{plugin_slug}
206
+ * fs_api_domains_{plugin_slug}
207
+ * fs_email_template_sections_{plugin_slug}
208
+ * fs_support_forum_submenu_{plugin_slug}
209
+ * fs_support_forum_url_{plugin_slug}
210
+ * fs_connect_message_{plugin_slug}
211
+ * fs_connect_message_on_update_{plugin_slug}
212
+ * fs_uninstall_confirmation_message_{plugin_slug}
213
+ * fs_pending_activation_message_{plugin_slug}
214
+ * fs_is_submenu_visible_{plugin_slug}
215
+ * fs_plugin_icon_{plugin_slug}
216
+ * fs_show_trial_{plugin_slug}
217
+ *
218
+ * --------------------------------------------------------
219
+ *
220
+ * Freemius actions collection:
221
+ *
222
+ * fs_after_license_loaded_{plugin_slug}
223
+ * fs_after_license_change_{plugin_slug}
224
+ * fs_after_plans_sync_{plugin_slug}
225
+ *
226
+ * fs_after_account_details_{plugin_slug}
227
+ * fs_after_account_user_sync_{plugin_slug}
228
+ * fs_after_account_plan_sync_{plugin_slug}
229
+ * fs_before_account_load_{plugin_slug}
230
+ * fs_after_account_connection_{plugin_slug}
231
+ * fs_account_property_edit_{plugin_slug}
232
+ * fs_account_email_verified_{plugin_slug}
233
+ * fs_account_page_load_before_departure_{plugin_slug}
234
+ * fs_before_account_delete_{plugin_slug}
235
+ * fs_after_account_delete_{plugin_slug}
236
+ *
237
+ * fs_sdk_version_update_{plugin_slug}
238
+ * fs_plugin_version_update_{plugin_slug}
239
+ *
240
+ * fs_initiated_{plugin_slug}
241
+ * fs_after_init_plugin_registered_{plugin_slug}
242
+ * fs_after_init_plugin_anonymous_{plugin_slug}
243
+ * fs_after_init_plugin_pending_activations_{plugin_slug}
244
+ * fs_after_init_addon_registered_{plugin_slug}
245
+ * fs_after_init_addon_anonymous_{plugin_slug}
246
+ * fs_after_init_addon_pending_activations_{plugin_slug}
247
+ *
248
+ * fs_after_premium_version_activation_{plugin_slug}
249
+ * fs_after_free_version_reactivation_{plugin_slug}
250
+ *
251
+ * fs_after_uninstall_{plugin_slug}
252
+ * fs_before_admin_menu_init_{plugin_slug}
253
+ */
254
+
255
+ #endregion Hooks & Filters Collection --------------------------------------------------------------------
256
+
257
+ if ( ! class_exists( 'Freemius' ) ) {
258
+
259
+ if ( ! defined( 'WP_FS__SDK_VERSION' ) ) {
260
+ define( 'WP_FS__SDK_VERSION', $this_sdk_version );
261
+ }
262
+
263
+ // Configuration should be loaded first.
264
+ require_once dirname( __FILE__ ) . '/config.php';
265
+
266
+ // Logger must be loaded before any other.
267
+ require_once WP_FS__DIR_INCLUDES . '/class-fs-logger.php';
268
+ require_once WP_FS__DIR_INCLUDES . '/debug/debug-bar-start.php';
269
+
270
+ require_once WP_FS__DIR_INCLUDES . '/fs-core-functions.php';
271
+ // require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-abstract-manager.php';
272
+ require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-option-manager.php';
273
+ require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-cache-manager.php';
274
+ require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-admin-notice-manager.php';
275
+ require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-admin-menu-manager.php';
276
+ require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-key-value-storage.php';
277
+ require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-license-manager.php';
278
+ require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-plan-manager.php';
279
+ require_once WP_FS__DIR_INCLUDES . '/managers/class-fs-plugin-manager.php';
280
+ require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-entity.php';
281
+ require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-scope-entity.php';
282
+ require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-user.php';
283
+ require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-site.php';
284
+ require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-plugin.php';
285
+ require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-plugin-info.php';
286
+ require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-plugin-tag.php';
287
+ require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-plugin-plan.php';
288
+ require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-pricing.php';
289
+ require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-plugin-license.php';
290
+ require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-subscription.php';
291
+ require_once WP_FS__DIR_INCLUDES . '/class-fs-api.php';
292
+ require_once WP_FS__DIR_INCLUDES . '/class-fs-plugin-updater.php';
293
+ require_once WP_FS__DIR_INCLUDES . '/class-fs-security.php';
294
+ require_once WP_FS__DIR_INCLUDES . '/class-freemius-abstract.php';
295
+ require_once WP_FS__DIR_INCLUDES . '/sdk/Exceptions/Exception.php';
296
+ require_once WP_FS__DIR_INCLUDES . '/class-freemius.php';
297
+
298
+ /**
299
+ * Quick shortcut to get Freemius for specified plugin.
300
+ * Used by various templates.
301
+ *
302
+ * @param string $slug
303
+ *
304
+ * @return Freemius
305
+ */
306
+ function freemius( $slug ) {
307
+ return Freemius::instance( $slug );
308
+ }
309
+
310
+ /**
311
+ * @param string $slug
312
+ * @param number $plugin_id
313
+ * @param string $public_key
314
+ * @param bool $is_live Is live or test plugin.
315
+ * @param bool $is_premium Hints freemius if running the premium plugin or not.
316
+ *
317
+ * @return Freemius
318
+ */
319
+ function fs_init( $slug, $plugin_id, $public_key, $is_live = true, $is_premium = true ) {
320
+ $fs = Freemius::instance( $slug );
321
+ $fs->init( $plugin_id, $public_key, $is_live, $is_premium );
322
+
323
+ return $fs;
324
+ }
325
+
326
+ /**
327
+ * @param array [string]string $plugin
328
+ *
329
+ * @return Freemius
330
+ * @throws Freemius_Exception
331
+ */
332
+ function fs_dynamic_init( $plugin ) {
333
+ $fs = Freemius::instance( $plugin['slug'] );
334
+ $fs->dynamic_init( $plugin );
335
+
336
+ return $fs;
337
+ }
338
+
339
+ function fs_dump_log() {
340
+ FS_Logger::dump();
341
+ }
342
  }
freemius/templates/connect.php CHANGED
@@ -1,200 +1,333 @@
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
- $slug = $VARS['slug'];
14
- $fs = freemius( $slug );
15
- $is_pending_activation = $fs->is_pending_activation();
16
-
17
- $fs->_enqueue_connect_essentials();
18
-
19
- $current_user = Freemius::_get_current_wp_user();
20
-
21
- $first_name = $current_user->user_firstname;
22
- if ( empty( $first_name ) ) {
23
- $first_name = $current_user->nickname;
24
- }
25
-
26
- $site_url = get_site_url();
27
- $protocol_pos = strpos( $site_url, '://' );
28
- if ( false !== $protocol_pos ) {
29
- $site_url = substr( $site_url, $protocol_pos + 3 );
30
- }
31
-
32
- $freemius_site_url = $fs->has_paid_plan() ?
33
- 'https://freemius.com/wordpress/' :
34
- // Insights platform information.
35
- 'https://freemius.com/wordpress/usage-tracking/';
36
- ?>
37
- <div id="fs_connect" class="wrap<?php if ( ! $fs->enable_anonymous() || $is_pending_activation ) {
38
- echo ' fs-anonymous-disabled';
39
- } ?>">
40
- <div class="fs-visual">
41
- <b class="fs-site-icon"><i class="dashicons dashicons-wordpress"></i></b>
42
- <i class="dashicons dashicons-plus fs-first"></i>
43
- <?php
44
- $vars = array( 'slug' => $slug );
45
- fs_require_once_template( 'plugin-icon.php', $vars );
46
- ?>
47
- <i class="dashicons dashicons-plus fs-second"></i>
48
- <img class="fs-connect-logo" width="80" height="80" src="//img.freemius.com/connect-logo.png"/>
49
- </div>
50
- <div class="fs-content">
51
- <p><?php
52
- if ( $is_pending_activation ) {
53
- echo $fs->apply_filters( 'pending_activation_message', sprintf(
54
- __fs( 'thanks-x', $slug ) . '<br>' .
55
- __fs( 'pending-activation-message', $slug ),
56
- $first_name,
57
- '<b>' . $fs->get_plugin_name() . '</b>',
58
- '<b>' . $current_user->user_email . '</b>'
59
- ) );
60
- } else {
61
- $filter = 'connect_message';
62
- $default_optin_message = 'connect-message';
63
-
64
- if ( $fs->is_plugin_update() ) {
65
- // If Freemius was added on a plugin update, set different
66
- // opt-in message.
67
- $default_optin_message = 'connect-message_on-update';
68
-
69
- // If user customized the opt-in message on update, use
70
- // that message. Otherwise, fallback to regular opt-in
71
- // custom message if exist.
72
- if ( $fs->has_filter( 'connect_message_on_update' ) ) {
73
- $filter = 'connect_message_on_update';
74
- }
75
- }
76
-
77
- echo $fs->apply_filters( $filter,
78
- sprintf(
79
- __fs( 'hey-x', $slug ) . '<br>' .
80
- __fs( $default_optin_message, $slug ),
81
- $first_name,
82
- '<b>' . $fs->get_plugin_name() . '</b>',
83
- '<b>' . $current_user->user_login . '</b>',
84
- '<a href="' . $site_url . '" target="_blank">' . $site_url . '</a>',
85
- '<a href="' . $freemius_site_url . '" target="_blank">freemius.com</a>'
86
- ),
87
- $first_name,
88
- $fs->get_plugin_name(),
89
- $current_user->user_login,
90
- '<a href="' . $site_url . '" target="_blank">' . $site_url . '</a>',
91
- '<a href="' . $freemius_site_url . '" target="_blank">freemius.com</a>'
92
- );
93
- }
94
- ?></p>
95
- </div>
96
- <div class="fs-actions">
97
- <?php if ( $fs->enable_anonymous() && ! $is_pending_activation ) : ?>
98
- <a href="<?php echo wp_nonce_url( $fs->_get_admin_page_url( '', array( 'fs_action' => $slug . '_skip_activation' ) ), $slug . '_skip_activation' ) ?>"
99
- class="button button-secondary" tabindex="2"><?php _efs( 'skip', $slug ) ?></a>
100
- <?php endif ?>
101
-
102
- <?php $fs_user = Freemius::_get_user_by_email( $current_user->user_email ) ?>
103
- <?php if ( is_object( $fs_user ) && ! $is_pending_activation ) : ?>
104
- <form action="" method="POST">
105
- <input type="hidden" name="fs_action" value="<?php echo $slug ?>_activate_existing">
106
- <?php wp_nonce_field( 'activate_existing_' . $fs->get_public_key() ) ?>
107
- <button class="button button-primary" tabindex="1"
108
- type="submit"><?php _efs( 'opt-in-connect', $slug ) ?></button>
109
- </form>
110
- <?php else : ?>
111
- <form method="post" action="<?php echo WP_FS__ADDRESS ?>/action/service/user/install/">
112
- <?php $params = $fs->get_opt_in_params() ?>
113
- <?php foreach ( $params as $name => $value ) : ?>
114
- <input type="hidden" name="<?php echo $name ?>" value="<?php echo esc_attr( $value ) ?>">
115
- <?php endforeach ?>
116
- <button class="button button-primary" tabindex="1"
117
- type="submit"><?php _efs( $is_pending_activation ? 'resend-activation-email' : 'opt-in-connect', $slug ) ?></button>
118
- </form>
119
- <?php endif ?>
120
- </div><?php
121
-
122
- // Set core permission list items.
123
- $permissions = array(
124
- 'profile' => array(
125
- 'icon-class' => 'dashicons dashicons-admin-users',
126
- 'label' => __fs( 'permissions-profile' ),
127
- 'desc' => __fs( 'permissions-profile_desc' ),
128
- 'priority' => 5,
129
- ),
130
- 'site' => array(
131
- 'icon-class' => 'dashicons dashicons-admin-settings',
132
- 'label' => __fs( 'permissions-site' ),
133
- 'desc' => __fs( 'permissions-site_desc' ),
134
- 'priority' => 10,
135
- ),
136
- 'events' => array(
137
- 'icon-class' => 'dashicons dashicons-admin-plugins',
138
- 'label' => __fs( 'permissions-events' ),
139
- 'desc' => __fs( 'permissions-events_desc' ),
140
- 'priority' => 20,
141
- ),
142
- );
143
-
144
- // Add newsletter permissions if enabled.
145
- if ( $fs->is_permission_requested( 'newsletter' ) ) {
146
- $permissions['newsletter'] = array(
147
- 'icon-class' => 'dashicons dashicons-email-alt',
148
- 'label' => __fs( 'permissions-newsletter' ),
149
- 'desc' => __fs( 'permissions-newsletter_desc' ),
150
- 'priority' => 15,
151
- );
152
- }
153
-
154
- // Allow filtering of the permissions list.
155
- $permissions = $fs->apply_filters( 'permission_list', $permissions );
156
-
157
- // Sort by priority.
158
- uasort( $permissions, 'fs_sort_by_priority' );
159
-
160
- if ( ! empty( $permissions ) ) : ?>
161
- <div class="fs-permissions">
162
- <a class="fs-trigger" href="#"><?php _efs( 'what-permissions', $slug ) ?></a>
163
- <ul><?php
164
- foreach ( $permissions as $id => $permission ) : ?>
165
- <li id="fs-permission-<?php esc_attr_e( $id ); ?>"
166
- class="fs-permission fs-<?php esc_attr_e( $id ); ?>">
167
- <i class="<?php esc_attr_e( $permission['icon-class'] ); ?>"></i>
168
-
169
- <div>
170
- <span><?php esc_html_e( $permission['label'] ); ?></span>
171
-
172
- <p><?php esc_html_e( $permission['desc'] ); ?></p>
173
- </div>
174
- </li>
175
- <?php endforeach; ?>
176
- </ul>
177
- </div>
178
- <?php endif; ?>
179
-
180
- <div class="fs-terms">
181
- <a href="https://freemius.com/privacy/" target="_blank"><?php _efs( 'privacy-policy', $slug ) ?></a>
182
- &nbsp;&nbsp;-&nbsp;&nbsp;
183
- <a href="https://freemius.com/terms/" target="_blank"><?php _efs( 'tos', $slug ) ?></a>
184
- </div>
185
- </div>
186
- <script type="text/javascript">
187
- (function ($) {
188
- $('.button').on('click', function () {
189
- // Set loading mode.
190
- $(document.body).css({'cursor': 'wait'});
191
- });
192
- $('.button.button-primary').on('click', function () {
193
- $(this).addClass('fs-loading');
194
- $(this).html('<?php _efs( $is_pending_activation ? 'sending-email' : 'activating' , $slug ) ?>...').css({'cursor': 'wait'});
195
- });
196
- $('.fs-permissions .fs-trigger').on('click', function () {
197
- $('.fs-permissions').toggleClass('fs-open');
198
- });
199
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
  </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
+ $slug = $VARS['slug'];
14
+ $fs = freemius( $slug );
15
+ $is_pending_activation = $fs->is_pending_activation();
16
+ $is_premium_only = $fs->is_only_premium();
17
+ $has_paid_plans = $fs->has_paid_plan();
18
+ $is_premium_code = $fs->is_premium();
19
+ $is_freemium = $fs->is_freemium();
20
+
21
+ $fs->_enqueue_connect_essentials();
22
+
23
+ $current_user = Freemius::_get_current_wp_user();
24
+
25
+ $first_name = $current_user->user_firstname;
26
+ if ( empty( $first_name ) ) {
27
+ $first_name = $current_user->nickname;
28
+ }
29
+
30
+ $site_url = get_site_url();
31
+ $protocol_pos = strpos( $site_url, '://' );
32
+ if ( false !== $protocol_pos ) {
33
+ $site_url = substr( $site_url, $protocol_pos + 3 );
34
+ }
35
+
36
+ $freemius_site_url = $fs->has_paid_plan() ?
37
+ 'https://freemius.com/wordpress/' :
38
+ // Insights platform information.
39
+ 'https://freemius.com/wordpress/usage-tracking/';
40
+
41
+ $freemius_site_url .= '?' . http_build_query( array(
42
+ 'plugin_id' => $fs->get_id(),
43
+ ) );
44
+
45
+ $freemius_link = '<a href="' . $freemius_site_url . '" target="_blank" tabindex="1">freemius.com</a>';
46
+
47
+ $error = fs_request_get( 'error' );
48
+
49
+ $require_license_key = $is_premium_only ||
50
+ ( $is_freemium && $is_premium_code && fs_request_get_bool( 'require_license', true ) );
51
+ ?>
52
+ <div id="fs_connect"
53
+ class="wrap<?php if ( ! $fs->is_enable_anonymous() || $is_pending_activation || $require_license_key ) {
54
+ echo ' fs-anonymous-disabled';
55
+ } ?>">
56
+ <div class="fs-visual">
57
+ <b class="fs-site-icon"><i class="dashicons dashicons-wordpress"></i></b>
58
+ <i class="dashicons dashicons-plus fs-first"></i>
59
+ <?php
60
+ $vars = array( 'slug' => $slug );
61
+ fs_require_once_template( 'plugin-icon.php', $vars );
62
+ ?>
63
+ <i class="dashicons dashicons-plus fs-second"></i>
64
+ <img class="fs-connect-logo" width="80" height="80" src="//img.freemius.com/connect-logo.png"/>
65
+ </div>
66
+ <div class="fs-content">
67
+ <?php if ( ! empty( $error ) ) : ?>
68
+ <p class="fs-error"><?php echo $error ?></p>
69
+ <?php endif ?>
70
+ <p><?php
71
+ $button_label = 'opt-in-connect';
72
+
73
+ if ( $is_pending_activation ) {
74
+ $button_label = 'resend-activation-email';
75
+
76
+ echo $fs->apply_filters( 'pending_activation_message', sprintf(
77
+ __fs( 'thanks-x', $slug ) . '<br>' .
78
+ __fs( 'pending-activation-message', $slug ),
79
+ $first_name,
80
+ '<b>' . $fs->get_plugin_name() . '</b>',
81
+ '<b>' . $current_user->user_email . '</b>'
82
+ ) );
83
+ } else if ( $require_license_key ) {
84
+ $button_label = 'agree-activate-license';
85
+
86
+ echo $fs->apply_filters( 'connect-message_on-premium',
87
+ sprintf( __fs( 'hey-x', $slug ), $first_name ) . '<br>' .
88
+ sprintf( __fs( 'thanks-for-purchasing', $slug ), '<b>' . $fs->get_plugin_name() . '</b>' ),
89
+ $first_name,
90
+ $fs->get_plugin_name()
91
+ );
92
+ } else {
93
+ $filter = 'connect_message';
94
+ $default_optin_message = 'connect-message';
95
+
96
+ if ( $fs->is_plugin_update() ) {
97
+ // If Freemius was added on a plugin update, set different
98
+ // opt-in message.
99
+ $default_optin_message = 'connect-message_on-update';
100
+
101
+ // If user customized the opt-in message on update, use
102
+ // that message. Otherwise, fallback to regular opt-in
103
+ // custom message if exist.
104
+ if ( $fs->has_filter( 'connect_message_on_update' ) ) {
105
+ $filter = 'connect_message_on_update';
106
+ }
107
+ }
108
+
109
+ echo $fs->apply_filters( $filter,
110
+ sprintf(
111
+ __fs( 'hey-x', $slug ) . '<br>' .
112
+ __fs( $default_optin_message, $slug ),
113
+ $first_name,
114
+ '<b>' . $fs->get_plugin_name() . '</b>',
115
+ '<b>' . $current_user->user_login . '</b>',
116
+ '<a href="' . $site_url . '" target="_blank">' . $site_url . '</a>',
117
+ $freemius_link
118
+ ),
119
+ $first_name,
120
+ $fs->get_plugin_name(),
121
+ $current_user->user_login,
122
+ '<a href="' . $site_url . '" target="_blank">' . $site_url . '</a>',
123
+ $freemius_link
124
+ );
125
+ }
126
+ ?></p>
127
+ <?php if ( $require_license_key ) : ?>
128
+ <div class="fs-license-key-container">
129
+ <input id="fs_license_key" name="fs_key" type="text" required maxlength="32"
130
+ placeholder="<?php _efs( 'license-key', $slug ) ?>" tabindex="1"/>
131
+ <i class="dashicons dashicons-admin-network"></i>
132
+ </div>
133
+ <?php endif ?>
134
+ </div>
135
+ <div class="fs-actions">
136
+ <?php if ( $fs->is_enable_anonymous() && ! $is_pending_activation && ! $require_license_key ) : ?>
137
+ <a href="<?php echo wp_nonce_url( $fs->_get_admin_page_url( '', array( 'fs_action' => $slug . '_skip_activation' ) ), $slug . '_skip_activation' ) ?>"
138
+ class="button button-secondary" tabindex="2"><?php _efs( 'skip', $slug ) ?></a>
139
+ <?php endif ?>
140
+
141
+ <?php $fs_user = Freemius::_get_user_by_email( $current_user->user_email ) ?>
142
+ <?php if ( is_object( $fs_user ) && ! $is_pending_activation ) : ?>
143
+ <form action="" method="POST">
144
+ <input type="hidden" name="fs_action" value="<?php echo $slug ?>_activate_existing">
145
+ <?php wp_nonce_field( 'activate_existing_' . $fs->get_public_key() ) ?>
146
+ <button class="button button-primary" tabindex="1"
147
+ type="submit"<?php if ( $require_license_key ) {
148
+ echo ' disabled="disabled"';
149
+ } ?>><?php _efs( $button_label, $slug ) ?></button>
150
+ </form>
151
+ <?php else : ?>
152
+ <form method="post" action="<?php echo WP_FS__ADDRESS ?>/action/service/user/install/">
153
+ <?php $params = $fs->get_opt_in_params() ?>
154
+ <?php foreach ( $params as $name => $value ) : ?>
155
+ <input type="hidden" name="<?php echo $name ?>" value="<?php echo esc_attr( $value ) ?>">
156
+ <?php endforeach ?>
157
+ <button class="button button-primary" tabindex="1"
158
+ type="submit"<?php if ( $require_license_key ) {
159
+ echo ' disabled="disabled"';
160
+ } ?>><?php _efs( $button_label, $slug ) ?></button>
161
+ </form>
162
+ <?php endif ?>
163
+ </div><?php
164
+
165
+ // Set core permission list items.
166
+ $permissions = array(
167
+ 'profile' => array(
168
+ 'icon-class' => 'dashicons dashicons-admin-users',
169
+ 'label' => __fs( 'permissions-profile' ),
170
+ 'desc' => __fs( 'permissions-profile_desc' ),
171
+ 'priority' => 5,
172
+ ),
173
+ 'site' => array(
174
+ 'icon-class' => 'dashicons dashicons-admin-settings',
175
+ 'label' => __fs( 'permissions-site' ),
176
+ 'desc' => __fs( 'permissions-site_desc' ),
177
+ 'priority' => 10,
178
+ ),
179
+ 'events' => array(
180
+ 'icon-class' => 'dashicons dashicons-admin-plugins',
181
+ 'label' => __fs( 'permissions-events' ),
182
+ 'desc' => __fs( 'permissions-events_desc' ),
183
+ 'priority' => 20,
184
+ ),
185
+ // 'plugins_themes' => array(
186
+ // 'icon-class' => 'dashicons dashicons-admin-settings',
187
+ // 'label' => __fs( 'permissions-plugins_themes' ),
188
+ // 'desc' => __fs( 'permissions-plugins_themes_desc' ),
189
+ // 'priority' => 30,
190
+ // ),
191
+ );
192
+
193
+ // Add newsletter permissions if enabled.
194
+ if ( $fs->is_permission_requested( 'newsletter' ) ) {
195
+ $permissions['newsletter'] = array(
196
+ 'icon-class' => 'dashicons dashicons-email-alt',
197
+ 'label' => __fs( 'permissions-newsletter' ),
198
+ 'desc' => __fs( 'permissions-newsletter_desc' ),
199
+ 'priority' => 15,
200
+ );
201
+ }
202
+
203
+ // Allow filtering of the permissions list.
204
+ $permissions = $fs->apply_filters( 'permission_list', $permissions );
205
+
206
+ // Sort by priority.
207
+ uasort( $permissions, 'fs_sort_by_priority' );
208
+
209
+ if ( ! empty( $permissions ) ) : ?>
210
+ <div class="fs-permissions">
211
+ <?php if ( $require_license_key ) : ?>
212
+ <p class="fs-license-sync-disclaimer"><?php printf( __fs( 'license-sync-disclaimer', $slug ), $freemius_link ) ?></p>
213
+ <?php endif ?>
214
+ <a class="fs-trigger" href="#" tabindex="1"><?php _efs( 'what-permissions', $slug ) ?></a>
215
+ <ul><?php
216
+ foreach ( $permissions as $id => $permission ) : ?>
217
+ <li id="fs-permission-<?php esc_attr_e( $id ); ?>"
218
+ class="fs-permission fs-<?php esc_attr_e( $id ); ?>">
219
+ <i class="<?php esc_attr_e( $permission['icon-class'] ); ?>"></i>
220
+
221
+ <div>
222
+ <span><?php esc_html_e( $permission['label'] ); ?></span>
223
+
224
+ <p><?php esc_html_e( $permission['desc'] ); ?></p>
225
+ </div>
226
+ </li>
227
+ <?php endforeach; ?>
228
+ </ul>
229
+ </div>
230
+ <?php endif ?>
231
+ <?php if ( $is_premium_code && $is_freemium ) : ?>
232
+ <div class="fs-freemium-licensing">
233
+ <p>
234
+ <?php if ( $require_license_key ) : ?>
235
+ <?php _efs( 'dont-have-license-key', $slug ) ?>
236
+ <a data-require-license="false" tabindex="1"><?php _efs( 'activate-free-version', $slug ) ?></a>
237
+ <?php else : ?>
238
+ <?php _efs( 'have-license-key', $slug ) ?>
239
+ <a data-require-license="true" tabindex="1"><?php _efs( 'activate-license', $slug ) ?></a>
240
+ <?php endif ?>
241
+ </p>
242
+ </div>
243
+ <?php endif ?>
244
+ <div class="fs-terms">
245
+ <a href="https://freemius.com/privacy/" target="_blank"
246
+ tabindex="1"><?php _efs( 'privacy-policy', $slug ) ?></a>
247
+ &nbsp;&nbsp;-&nbsp;&nbsp;
248
+ <a href="https://freemius.com/terms/" target="_blank" tabindex="1"><?php _efs( 'tos', $slug ) ?></a>
249
+ </div>
250
+ </div>
251
+ <script type="text/javascript">
252
+ (function ($) {
253
+ var $primaryCta = $('.fs-actions .button.button-primary'),
254
+ $form = $('.fs-actions form'),
255
+ requireLicenseKey = <?php echo $require_license_key ? 'true' : 'false' ?>,
256
+ $licenseSecret,
257
+ $licenseKeyInput = $('#fs_license_key');
258
+
259
+ $('.fs-actions .button').on('click', function () {
260
+ // Set loading mode.
261
+ $(document.body).css({'cursor': 'wait'});
262
+ });
263
+
264
+ $form.on('submit', function () {
265
+ /**
266
+ * @author Vova Feldman (@svovaf)
267
+ * @since 1.1.9
268
+ */
269
+ if (requireLicenseKey) {
270
+ if (null == $licenseSecret) {
271
+ $licenseSecret = $('<input type="hidden" name="license_secret_key" value="" />');
272
+ $form.append($licenseSecret);
273
+ }
274
+
275
+ // Update secret key if premium only plugin.
276
+ $licenseSecret.val($licenseKeyInput.val());
277
+ }
278
+
279
+ return true;
280
+ });
281
+
282
+ $primaryCta.on('click', function () {
283
+ $(this).addClass('fs-loading');
284
+ $(this).html('<?php _efs( $is_pending_activation ? 'sending-email' : 'activating' , $slug ) ?>...').css({'cursor': 'wait'});
285
+ });
286
+
287
+ $('.fs-permissions .fs-trigger').on('click', function () {
288
+ $('.fs-permissions').toggleClass('fs-open');
289
+ });
290
+
291
+ if (requireLicenseKey) {
292
+ /**
293
+ * Submit license key on enter.
294
+ *
295
+ * @author Vova Feldman (@svovaf)
296
+ * @since 1.1.9
297
+ */
298
+ $licenseKeyInput.keypress(function (e) {
299
+ if (e.which == 13) {
300
+ if ('' !== $(this).val()) {
301
+ $primaryCta.click();
302
+ return false;
303
+ }
304
+ }
305
+ });
306
+
307
+ /**
308
+ * Disable activation button when empty license key.
309
+ *
310
+ * @author Vova Feldman (@svovaf)
311
+ * @since 1.1.9
312
+ */
313
+ $licenseKeyInput.on('keyup', function () {
314
+ if ('' === $(this).val()) {
315
+ $primaryCta.attr('disabled', 'disabled');
316
+ } else {
317
+ $primaryCta.prop('disabled', false);
318
+ }
319
+ }).focus();
320
+ }
321
+
322
+ /**
323
+ * Set license mode trigger URL.
324
+ *
325
+ * @author Vova Feldman (@svovaf)
326
+ * @since 1.1.9
327
+ */
328
+ var $connectLicenseModeTrigger = $('#fs_connect .fs-freemium-licensing a');
329
+ if ($connectLicenseModeTrigger.length > 0) {
330
+ $connectLicenseModeTrigger.attr('href', window.location.href + '&require_license=' + $connectLicenseModeTrigger.attr('data-require-license'))
331
+ }
332
+ })(jQuery);
333
  </script>
freemius/templates/license-activation-modal.php ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.9
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ $slug = $VARS['slug'];
14
+ $fs = freemius( $slug );
15
+
16
+ $message_above_input_field = __fs( 'activate-license-message', $slug );
17
+ $message_below_input_field = '';
18
+
19
+ if ( $fs->is_registered() ) {
20
+ $activate_button_text = __fs( $fs->is_free_plan() ? 'activate-license' : 'update-license', $slug );
21
+ } else {
22
+ $freemius_site_url = $fs->has_paid_plan() ?
23
+ 'https://freemius.com/wordpress/' :
24
+ // Insights platform information.
25
+ 'https://freemius.com/wordpress/usage-tracking/';
26
+
27
+ $freemius_link = '<a href="' . $freemius_site_url . '" target="_blank">freemius.com</a>';
28
+
29
+ $message_below_input_field = sprintf( __fs( 'license-sync-disclaimer', $slug ), $freemius_link );
30
+
31
+ $activate_button_text = __fs( 'agree-activate-license', $slug );
32
+ }
33
+
34
+ $license_key_text = __fs( 'license-key' , $slug );
35
+
36
+ $modal_content_html = <<< HTML
37
+ <p>{$message_above_input_field}</p>
38
+ <input class="license_key" type="text" placeholder="{$license_key_text}" />
39
+ <p>{$message_below_input_field}</p>
40
+ HTML;
41
+ ?>
42
+ <script type="text/javascript">
43
+ (function( $ ) {
44
+ $( document ).ready(function() {
45
+ var modalContentHtml = <?php echo json_encode($modal_content_html); ?>,
46
+ modalHtml =
47
+ '<div class="fs-modal">'
48
+ + ' <div class="fs-modal-dialog">'
49
+ + ' <div class="fs-modal-body">'
50
+ + ' <div class="fs-modal-panel active">' + modalContentHtml + '</div>'
51
+ + ' </div>'
52
+ + ' <div class="fs-modal-footer">'
53
+ + ' <a href="#" class="button button-secondary button-close"><?php _efs('deactivation-modal-button-cancel', $slug); ?></a>'
54
+ + ' <a href="#" class="button button-primary button-activate-license"><?php echo $activate_button_text; ?></a>'
55
+ + ' </div>'
56
+ + ' </div>'
57
+ + '</div>',
58
+ $modal = $(modalHtml),
59
+ $activateLicenseLink = $('span.activate-license.<?php echo $VARS['slug']; ?>').find('a');
60
+
61
+ $modal.appendTo($('body'));
62
+
63
+ registerEventHandlers();
64
+
65
+ function registerEventHandlers() {
66
+ $activateLicenseLink.click(function (evt) {
67
+ evt.preventDefault();
68
+
69
+ showModal();
70
+ });
71
+
72
+ $modal.on('input propertychange', 'input.license_key', function () {
73
+
74
+ var licenseKey = $(this).val().trim();
75
+
76
+ /**
77
+ * If license key is not empty, enable the license activation button.
78
+ */
79
+ if (licenseKey.length > 0) {
80
+ enableActivateLicenseButton();
81
+ }
82
+ });
83
+
84
+ $modal.on('blur', 'input.license_key', function () {
85
+ var licenseKey = $(this).val().trim();
86
+
87
+ /**
88
+ * If license key is empty, disable the license activation button.
89
+ */
90
+ if (0 === licenseKey.length) {
91
+ disableActivateLicenseButton();
92
+ }
93
+ });
94
+
95
+ $modal.on('click', '.button', function (evt) {
96
+ evt.preventDefault();
97
+
98
+ if ($(this).hasClass('disabled')) {
99
+ return;
100
+ }
101
+
102
+ var
103
+ activateButton = $('.button-activate-license'),
104
+ licenseKey = $('input.license_key').val().trim();
105
+
106
+ activateButton.addClass('disabled');
107
+
108
+ if (0 === licenseKey.length) {
109
+ return;
110
+ }
111
+
112
+ $.ajax({
113
+ url: ajaxurl,
114
+ method: 'POST',
115
+ data: {
116
+ 'action': 'activate-license',
117
+ 'license-key': licenseKey
118
+ },
119
+ beforeSend: function () {
120
+ activateButton.text('<?php _efs('activating-license', $slug); ?>');
121
+ },
122
+ complete: function () {
123
+ closeModal();
124
+ }
125
+ });
126
+ });
127
+
128
+ // If the user has clicked outside the window, close the modal.
129
+ $modal.on('click', function (evt) {
130
+ var $target = $(evt.target);
131
+
132
+ // If the user has clicked anywhere in the modal dialog, just return.
133
+ if ($target.hasClass('fs-modal-body') || $target.hasClass('fs-modal-footer')) {
134
+ return;
135
+ }
136
+
137
+ // If the user has not clicked the close button and the clicked element is inside the modal dialog, just return.
138
+ if (( !$target.hasClass('button-close') ) && ( $target.parents('.fs-modal-body').length > 0 || $target.parents('.fs-modal-footer').length > 0 )) {
139
+ return;
140
+ }
141
+
142
+ closeModal();
143
+ });
144
+ }
145
+
146
+ function showModal() {
147
+ resetModal();
148
+
149
+ // Display the dialog box.
150
+ $modal.addClass('active');
151
+ $('body').addClass('has-fs-modal');
152
+
153
+ $('input.license_key').focus();
154
+ }
155
+
156
+ function closeModal() {
157
+ $modal.removeClass('active');
158
+ $('body').removeClass('has-fs-modal');
159
+ }
160
+
161
+ function resetModal() {
162
+ $('input.license_key').val('');
163
+
164
+ enableActivateLicenseButton();
165
+ $modal.find('.button-activate-license').text('<?php echo $activate_button_text; ?>');
166
+ }
167
+
168
+ function enableActivateLicenseButton() {
169
+ $modal.find('.button-activate-license').removeClass('disabled');
170
+ }
171
+
172
+ function disableActivateLicenseButton() {
173
+ $modal.find('.button-activate-license').addClass('disabled');
174
+ }
175
+ });
176
+ })( jQuery );
177
+ </script>
freemius/templates/plugin-icon.php CHANGED
@@ -89,5 +89,5 @@
89
  $relative_url = fs_img_url( substr( $icons[0], strlen( $icon_dir ) ), $icon_dir );
90
  ?>
91
  <div class="fs-plugin-icon">
92
- <img src="<?php echo $relative_url ?>"/>
93
  </div>
89
  $relative_url = fs_img_url( substr( $icons[0], strlen( $icon_dir ) ), $icon_dir );
90
  ?>
91
  <div class="fs-plugin-icon">
92
+ <img src="<?php echo $relative_url ?>" width="80" height="80" />
93
  </div>
meta-tag-manager.php CHANGED
@@ -4,8 +4,8 @@ Plugin Name: Meta Tag Manager
4
  Plugin URI: https://wordpress.org/plugins/meta-tag-manager/
5
  Description: A simple plugin to manage meta tags that appear on aread of your site or individual posts. This can be used for verifiying google, yahoo, and more.
6
  Author: Marcus Sykes
7
- Version: 2.0
8
- Author URI: http://msyk.es/
9
  Text Domain: meta-tag-manager
10
  */
11
  /*
4
  Plugin URI: https://wordpress.org/plugins/meta-tag-manager/
5
  Description: A simple plugin to manage meta tags that appear on aread of your site or individual posts. This can be used for verifiying google, yahoo, and more.
6
  Author: Marcus Sykes
7
+ Version: 2.0.1
8
+ Author URI: http://msyk.es/?utm_source=meta-tag-manager&utm_medium=plugin-header&utm_campaign=plugins
9
  Text Domain: meta-tag-manager
10
  */
11
  /*
mtm-admin-settings.php CHANGED
@@ -77,13 +77,13 @@ if (is_admin () and !empty($_REQUEST['mtm_nonce']) && wp_verify_nonce($_REQUEST[
77
  </h2>
78
  <div class="inside">
79
  <p>
80
- <?php echo sprintf(esc_html__('This plugin was developed by %s.', 'meta-tag-manager'), '<a href="http://msyk.es">Marcus Sykes</a>'); ?>
81
  </p>
82
  <p style="color:green; font-weight:bold;">
83
  <?php
84
  echo sprintf(esc_html__('Please leave us a %s review on %s to show your support and help us keep making this plugin better!','meta-tag-manager'),
85
- '<a href="http://wordpress.org/support/view/plugin-reviews/meta-tag-manager?filter=5">★★★★★</a>',
86
- '<a href="https://wordpress.org/plugins/meta-tag-manager/">WordPress.org</a>'
87
  );
88
  ?>
89
  </p>
@@ -101,7 +101,7 @@ if (is_admin () and !empty($_REQUEST['mtm_nonce']) && wp_verify_nonce($_REQUEST[
101
  <div class="inside">
102
  <p>
103
  <?php echo sprintf(esc_html__('Please visit our %s if you have any questions.', 'meta-tag-manager'),
104
- '<a href="http://wordpress.org/support/plugin/meta-tag-manager/">'.esc_html__('Support Forum','meta-tag-manager').'</a>'); ?>
105
  </p>
106
  </div>
107
  </div>
77
  </h2>
78
  <div class="inside">
79
  <p>
80
+ <?php echo sprintf(esc_html__('This plugin was developed by %s.', 'meta-tag-manager'), '<a href="http://msyk.es/?utm_source=meta-tag-manager&utm_medium=settings&utm_campaign=plugins" target="_blank">Marcus Sykes</a>'); ?>
81
  </p>
82
  <p style="color:green; font-weight:bold;">
83
  <?php
84
  echo sprintf(esc_html__('Please leave us a %s review on %s to show your support and help us keep making this plugin better!','meta-tag-manager'),
85
+ '<a href="http://wordpress.org/support/view/plugin-reviews/meta-tag-manager?filter=5" target="_blank">★★★★★</a>',
86
+ '<a href="https://wordpress.org/plugins/meta-tag-manager/" target="_blank">WordPress.org</a>'
87
  );
88
  ?>
89
  </p>
101
  <div class="inside">
102
  <p>
103
  <?php echo sprintf(esc_html__('Please visit our %s if you have any questions.', 'meta-tag-manager'),
104
+ '<a href="http://wordpress.org/support/plugin/meta-tag-manager/" target="_blank">'.esc_html__('Support Forum','meta-tag-manager').'</a>'); ?>
105
  </p>
106
  </div>
107
  </div>
mtm-encodings.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if( !defined('ABSPATH') ) exit;
3
+
4
+ $encodings = apply_filters('mtm_charset_encodings', array(
5
+ 'Recommended' => array( 'UTF-8' ),
6
+ 'Legacy single-byte encodings' => array(
7
+ 'IBM866', 'ISO-8859-2', 'ISO-8859-3', 'ISO-8859-4', 'ISO-8859-5', 'ISO-8859-6', 'ISO-8859-7', 'ISO-8859-8', 'ISO-8859-8-I', 'ISO-8859-10', 'ISO-8859-13',
8
+ 'ISO-8859-14', 'ISO-8859-15', 'ISO-8859-16', 'KOI8-R', 'KOI8-U', 'macintosh', 'windows-874', 'windows-1250', 'windows-1251', 'windows-1252', 'windows-1253',
9
+ 'windows-1254', 'windows-1255', 'windows-1256', 'windows-1257', 'windows-1258', 'x-mac-cyrillic'
10
+ ),
11
+ 'Legacy multi-byte Chinese (simplified) encodings' => array( 'GBK', 'gb18030' ),
12
+ 'Legacy multi-byte Chinese (traditional) encodings' => array( 'Big5' ),
13
+ 'Legacy multi-byte Japanese encodings' => array( 'EUC-JP', 'ISO-2022-JP', 'Shift_JIS', ),
14
+ 'Legacy multi-byte Korean encodings' => array( 'EUC-KR' ),
15
+ 'Legacy miscellaneous encodings' => array( 'replacement', 'UTF-16BE', 'UTF-16LE', 'x-user-defined' )
16
+ ));
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: netweblogic, freemius
3
  Tags: google, SEO, yahoo, tags, webmaster tools, meta, meta tags, ogp, open graph, twitter cards
4
  Text Domain: meta-tag-manager
5
  Requires at least: 2.5
6
- Tested up to: 4.5.2
7
- Stable tag: 2.0
8
 
9
  Easily add and manage custom meta tags to various parts of your site or on individual posts, such as Yahoo and Google verification tags.
10
 
@@ -12,7 +12,7 @@ Easily add and manage custom meta tags to various parts of your site or on indiv
12
 
13
  <blockquote>Meta Tag Manager 2.0 is a complete rewrite with many improvments on the first versions. Whilst there are many improvements, this first rewrite isn't a great departure from the original plugin, although it adds some fundemental improvements.
14
 
15
- We have plenty of ideas of what to add to the plugin, we'd love to hear your suggestions too, please let us know on our <a href="https://wordpress.org/support/plugin/meta-tag-manager">support forums</a>.<br/><br/></blockquote>
16
 
17
  Meta Tags Manager is a simple, lightweight plugin which allows you to add custom meta tags to your site. Features include:
18
 
@@ -45,6 +45,8 @@ Please visit our <a href="https://wordpress.org/support/plugin/meta-tag-manager"
45
  3. If enabled you can add meta tags to a specific post in it's own meta box
46
 
47
  == Changelog ==
 
 
48
 
49
  = 2.0 =
50
  * complete rewrite of plugin using up-to-date WP best practices
3
  Tags: google, SEO, yahoo, tags, webmaster tools, meta, meta tags, ogp, open graph, twitter cards
4
  Text Domain: meta-tag-manager
5
  Requires at least: 2.5
6
+ Tested up to: 4.6
7
+ Stable tag: 2.0.1
8
 
9
  Easily add and manage custom meta tags to various parts of your site or on individual posts, such as Yahoo and Google verification tags.
10
 
12
 
13
  <blockquote>Meta Tag Manager 2.0 is a complete rewrite with many improvments on the first versions. Whilst there are many improvements, this first rewrite isn't a great departure from the original plugin, although it adds some fundemental improvements.
14
 
15
+ We have plenty of ideas of what to add to the plugin, we'd love to hear your suggestions too, please let us know on our <a href="https://wordpress.org/support/plugin/meta-tag-manager">support forums</a>.</blockquote>
16
 
17
  Meta Tags Manager is a simple, lightweight plugin which allows you to add custom meta tags to your site. Features include:
18
 
45
  3. If enabled you can add meta tags to a specific post in it's own meta box
46
 
47
  == Changelog ==
48
+ = 2.0.1 =
49
+ * updated freemius SDK to prevent PHP notices
50
 
51
  = 2.0 =
52
  * complete rewrite of plugin using up-to-date WP best practices