WP Mail Bank: WordPress SMTP Plugin & Email Logs - Version 3.0.13

Version Description

  • TWEAK: Freemius Code Removed
  • TWEAK: Wizard Page Added
  • TWEAK: Support Forum Link Added
Download this release

Release Info

Developer contact-banker
Plugin Icon 128x128 WP Mail Bank: WordPress SMTP Plugin & Email Logs
Version 3.0.13
Comparing to
See all releases

Code changes from version 3.0.12 to 3.0.13

Files changed (100) hide show
  1. assets/admin/layout/css/premium-edition.css +1 -1
  2. assets/global/img/wizard-icon.png +0 -0
  3. assets/global/plugins/custom/js/bootstrap-hover-dropdown.js +0 -1
  4. freemius/LICENSE.txt +0 -340
  5. freemius/README.md +0 -253
  6. freemius/assets/css/admin/account.css +0 -1
  7. freemius/assets/css/admin/add-ons.css +0 -2
  8. freemius/assets/css/admin/checkout.css +0 -1
  9. freemius/assets/css/admin/common.css +0 -2
  10. freemius/assets/css/admin/connect.css +0 -1
  11. freemius/assets/css/admin/deactivation-feedback.css +0 -1
  12. freemius/assets/css/admin/debug.css +0 -1
  13. freemius/assets/css/admin/dialog-boxes.css +0 -2
  14. freemius/assets/css/admin/license-activation.css +0 -1
  15. freemius/assets/css/common.css +0 -1
  16. freemius/assets/img/gallery-bank.png +0 -0
  17. freemius/assets/img/plugin-icon.png +0 -0
  18. freemius/assets/index.php +0 -3
  19. freemius/assets/js/nojquery.ba-postmessage.js +0 -140
  20. freemius/assets/js/nojquery.ba-postmessage.min.js +0 -12
  21. freemius/assets/js/postmessage.js +0 -134
  22. freemius/assets/scss/_colors.scss +0 -65
  23. freemius/assets/scss/_functions.scss +0 -0
  24. freemius/assets/scss/_load.scss +0 -4
  25. freemius/assets/scss/_mixins.scss +0 -283
  26. freemius/assets/scss/_start.scss +0 -4
  27. freemius/assets/scss/_vars.scss +0 -6
  28. freemius/assets/scss/admin/_ajax-loader.scss +0 -49
  29. freemius/assets/scss/admin/_auto-install.scss +0 -33
  30. freemius/assets/scss/admin/_deactivation-feedback.scss +0 -55
  31. freemius/assets/scss/admin/_license-activation.scss +0 -7
  32. freemius/assets/scss/admin/_license-key-resend.scss +0 -68
  33. freemius/assets/scss/admin/_modal-common.scss +0 -186
  34. freemius/assets/scss/admin/account.scss +0 -250
  35. freemius/assets/scss/admin/add-ons.scss +0 -449
  36. freemius/assets/scss/admin/checkout.scss +0 -5
  37. freemius/assets/scss/admin/common.scss +0 -173
  38. freemius/assets/scss/admin/connect.scss +0 -471
  39. freemius/assets/scss/admin/debug.scss +0 -135
  40. freemius/assets/scss/admin/dialog-boxes.scss +0 -7
  41. freemius/config.php +0 -325
  42. freemius/includes/class-freemius-abstract.php +0 -540
  43. freemius/includes/class-freemius.php +0 -11373
  44. freemius/includes/class-fs-api.php +0 -523
  45. freemius/includes/class-fs-logger.php +0 -629
  46. freemius/includes/class-fs-plugin-updater.php +0 -656
  47. freemius/includes/class-fs-security.php +0 -78
  48. freemius/includes/debug/class-fs-debug-bar-panel.php +0 -59
  49. freemius/includes/debug/debug-bar-start.php +0 -48
  50. freemius/includes/debug/index.php +0 -3
  51. freemius/includes/entities/class-fs-billing.php +0 -87
  52. freemius/includes/entities/class-fs-entity.php +0 -139
  53. freemius/includes/entities/class-fs-payment.php +0 -86
  54. freemius/includes/entities/class-fs-plugin-info.php +0 -30
  55. freemius/includes/entities/class-fs-plugin-license.php +0 -207
  56. freemius/includes/entities/class-fs-plugin-plan.php +0 -135
  57. freemius/includes/entities/class-fs-plugin-tag.php +0 -20
  58. freemius/includes/entities/class-fs-plugin.php +0 -87
  59. freemius/includes/entities/class-fs-pricing.php +0 -125
  60. freemius/includes/entities/class-fs-scope-entity.php +0 -26
  61. freemius/includes/entities/class-fs-site.php +0 -141
  62. freemius/includes/entities/class-fs-subscription.php +0 -115
  63. freemius/includes/entities/class-fs-user.php +0 -53
  64. freemius/includes/entities/index.php +0 -3
  65. freemius/includes/fs-core-functions.php +0 -553
  66. freemius/includes/fs-essential-functions.php +0 -443
  67. freemius/includes/fs-plugin-info-dialog.php +0 -938
  68. freemius/includes/i18n.php +0 -518
  69. freemius/includes/index.php +0 -3
  70. freemius/includes/l10n.php +0 -235
  71. freemius/includes/managers/class-fs-admin-menu-manager.php +0 -700
  72. freemius/includes/managers/class-fs-admin-notice-manager.php +0 -289
  73. freemius/includes/managers/class-fs-cache-manager.php +0 -222
  74. freemius/includes/managers/class-fs-key-value-storage.php +0 -298
  75. freemius/includes/managers/class-fs-license-manager.php +0 -100
  76. freemius/includes/managers/class-fs-option-manager.php +0 -283
  77. freemius/includes/managers/class-fs-plan-manager.php +0 -154
  78. freemius/includes/managers/class-fs-plugin-manager.php +0 -140
  79. freemius/includes/managers/index.php +0 -3
  80. freemius/includes/sdk/Exceptions/ArgumentNotExistException.php +0 -10
  81. freemius/includes/sdk/Exceptions/EmptyArgumentException.php +0 -10
  82. freemius/includes/sdk/Exceptions/Exception.php +0 -69
  83. freemius/includes/sdk/Exceptions/InvalidArgumentException.php +0 -10
  84. freemius/includes/sdk/Exceptions/OAuthException.php +0 -12
  85. freemius/includes/sdk/Exceptions/index.php +0 -3
  86. freemius/includes/sdk/Freemius.php +0 -586
  87. freemius/includes/sdk/FreemiusBase.php +0 -176
  88. freemius/includes/sdk/LICENSE.txt +0 -340
  89. freemius/includes/sdk/index.php +0 -3
  90. freemius/includes/supplements/fs-essential-functions-1.1.7.1.php +0 -45
  91. freemius/includes/supplements/index.php +0 -3
  92. freemius/index.php +0 -3
  93. freemius/languages/freemius-da_DK.mo +0 -0
  94. freemius/languages/freemius-da_DK.po +0 -1790
  95. freemius/languages/freemius-en.mo +0 -0
  96. freemius/languages/freemius-en.po +0 -1788
  97. freemius/languages/freemius-he.mo +0 -0
  98. freemius/languages/freemius-he.po +0 -1791
  99. freemius/languages/freemius-it_IT.mo +0 -0
  100. freemius/languages/freemius-it_IT.po +0 -1642
assets/admin/layout/css/premium-edition.css CHANGED
@@ -2266,4 +2266,4 @@ span[class*="gw-go-btn-icon"][class*="gw-go-btn-icon-large"] {
2266
  #go-pricing-table-862 .gw-go-col-wrap {
2267
  width: 100%;
2268
  }
2269
- }
2266
  #go-pricing-table-862 .gw-go-col-wrap {
2267
  width: 100%;
2268
  }
2269
+ }
assets/global/img/wizard-icon.png ADDED
Binary file
assets/global/plugins/custom/js/bootstrap-hover-dropdown.js DELETED
@@ -1 +0,0 @@
1
- !function(e, n){var o = e(); e.fn.dropdownHover = function(t){return "ontouchstart" in document?this:(o = o.add(this.parent()), this.each(function(){var i, r = e(this), s = r.parent(), d = {delay:500, instantlyCloseOthers:!0}, a = {delay:e(this).data("delay"), instantlyCloseOthers:e(this).data("close-others")}, h = "show.bs.dropdown", u = "hide.bs.dropdown", l = e.extend(!0, {}, d, t, a); s.hover(function(e){return s.hasClass("open") || r.is(e.target)?(o.find(":focus").blur(), l.instantlyCloseOthers === !0 && o.removeClass("open"), n.clearTimeout(i), s.addClass("open"), void r.trigger(h)):!0}, function(){i = n.setTimeout(function(){s.removeClass("open"), r.trigger(u)}, l.delay)}), r.hover(function(){o.find(":focus").blur(), l.instantlyCloseOthers === !0 && o.removeClass("open"), n.clearTimeout(i), s.addClass("open"), r.trigger(h)}), s.find(".dropdown-submenu").each(function(){var o, t = e(this); t.hover(function(){n.clearTimeout(o), t.children(".dropdown-menu").show(), t.siblings().children(".dropdown-menu").hide()}, function(){var e = t.children(".dropdown-menu"); o = n.setTimeout(function(){e.hide()}, l.delay)})})}))}, e(document).ready(function(){e('[data-hover="dropdown"]').not(".hover-initialized").each(function(){e(this).dropdownHover(), e(this).addClass("hover-initialized")})})}(jQuery, this)
 
freemius/LICENSE.txt DELETED
@@ -1,340 +0,0 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 2, June 1991
3
-
4
- Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
5
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
- Everyone is permitted to copy and distribute verbatim copies
7
- of this license document, but changing it is not allowed.
8
-
9
- Preamble
10
-
11
- The licenses for most software are designed to take away your
12
- freedom to share and change it. By contrast, the GNU General Public
13
- License is intended to guarantee your freedom to share and change free
14
- software--to make sure the software is free for all its users. This
15
- General Public License applies to most of the Free Software
16
- Foundation's software and to any other program whose authors commit to
17
- using it. (Some other Free Software Foundation software is covered by
18
- the GNU Lesser General Public License instead.) You can apply it to
19
- your programs, too.
20
-
21
- When we speak of free software, we are referring to freedom, not
22
- price. Our General Public Licenses are designed to make sure that you
23
- have the freedom to distribute copies of free software (and charge for
24
- this service if you wish), that you receive source code or can get it
25
- if you want it, that you can change the software or use pieces of it
26
- in new free programs; and that you know you can do these things.
27
-
28
- To protect your rights, we need to make restrictions that forbid
29
- anyone to deny you these rights or to ask you to surrender the rights.
30
- These restrictions translate to certain responsibilities for you if you
31
- distribute copies of the software, or if you modify it.
32
-
33
- For example, if you distribute copies of such a program, whether
34
- gratis or for a fee, you must give the recipients all the rights that
35
- you have. You must make sure that they, too, receive or can get the
36
- source code. And you must show them these terms so they know their
37
- rights.
38
-
39
- We protect your rights with two steps: (1) copyright the software, and
40
- (2) offer you this license which gives you legal permission to copy,
41
- distribute and/or modify the software.
42
-
43
- Also, for each author's protection and ours, we want to make certain
44
- that everyone understands that there is no warranty for this free
45
- software. If the software is modified by someone else and passed on, we
46
- want its recipients to know that what they have is not the original, so
47
- that any problems introduced by others will not reflect on the original
48
- authors' reputations.
49
-
50
- Finally, any free program is threatened constantly by software
51
- patents. We wish to avoid the danger that redistributors of a free
52
- program will individually obtain patent licenses, in effect making the
53
- program proprietary. To prevent this, we have made it clear that any
54
- patent must be licensed for everyone's free use or not licensed at all.
55
-
56
- The precise terms and conditions for copying, distribution and
57
- modification follow.
58
-
59
- GNU GENERAL PUBLIC LICENSE
60
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
-
62
- 0. This License applies to any program or other work which contains
63
- a notice placed by the copyright holder saying it may be distributed
64
- under the terms of this General Public License. The "Program", below,
65
- refers to any such program or work, and a "work based on the Program"
66
- means either the Program or any derivative work under copyright law:
67
- that is to say, a work containing the Program or a portion of it,
68
- either verbatim or with modifications and/or translated into another
69
- language. (Hereinafter, translation is included without limitation in
70
- the term "modification".) Each licensee is addressed as "you".
71
-
72
- Activities other than copying, distribution and modification are not
73
- covered by this License; they are outside its scope. The act of
74
- running the Program is not restricted, and the output from the Program
75
- is covered only if its contents constitute a work based on the
76
- Program (independent of having been made by running the Program).
77
- Whether that is true depends on what the Program does.
78
-
79
- 1. You may copy and distribute verbatim copies of the Program's
80
- source code as you receive it, in any medium, provided that you
81
- conspicuously and appropriately publish on each copy an appropriate
82
- copyright notice and disclaimer of warranty; keep intact all the
83
- notices that refer to this License and to the absence of any warranty;
84
- and give any other recipients of the Program a copy of this License
85
- along with the Program.
86
-
87
- You may charge a fee for the physical act of transferring a copy, and
88
- you may at your option offer warranty protection in exchange for a fee.
89
-
90
- 2. You may modify your copy or copies of the Program or any portion
91
- of it, thus forming a work based on the Program, and copy and
92
- distribute such modifications or work under the terms of Section 1
93
- above, provided that you also meet all of these conditions:
94
-
95
- a) You must cause the modified files to carry prominent notices
96
- stating that you changed the files and the date of any change.
97
-
98
- b) You must cause any work that you distribute or publish, that in
99
- whole or in part contains or is derived from the Program or any
100
- part thereof, to be licensed as a whole at no charge to all third
101
- parties under the terms of this License.
102
-
103
- c) If the modified program normally reads commands interactively
104
- when run, you must cause it, when started running for such
105
- interactive use in the most ordinary way, to print or display an
106
- announcement including an appropriate copyright notice and a
107
- notice that there is no warranty (or else, saying that you provide
108
- a warranty) and that users may redistribute the program under
109
- these conditions, and telling the user how to view a copy of this
110
- License. (Exception: if the Program itself is interactive but
111
- does not normally print such an announcement, your work based on
112
- the Program is not required to print an announcement.)
113
-
114
- These requirements apply to the modified work as a whole. If
115
- identifiable sections of that work are not derived from the Program,
116
- and can be reasonably considered independent and separate works in
117
- themselves, then this License, and its terms, do not apply to those
118
- sections when you distribute them as separate works. But when you
119
- distribute the same sections as part of a whole which is a work based
120
- on the Program, the distribution of the whole must be on the terms of
121
- this License, whose permissions for other licensees extend to the
122
- entire whole, and thus to each and every part regardless of who wrote it.
123
-
124
- Thus, it is not the intent of this section to claim rights or contest
125
- your rights to work written entirely by you; rather, the intent is to
126
- exercise the right to control the distribution of derivative or
127
- collective works based on the Program.
128
-
129
- In addition, mere aggregation of another work not based on the Program
130
- with the Program (or with a work based on the Program) on a volume of
131
- a storage or distribution medium does not bring the other work under
132
- the scope of this License.
133
-
134
- 3. You may copy and distribute the Program (or a work based on it,
135
- under Section 2) in object code or executable form under the terms of
136
- Sections 1 and 2 above provided that you also do one of the following:
137
-
138
- a) Accompany it with the complete corresponding machine-readable
139
- source code, which must be distributed under the terms of Sections
140
- 1 and 2 above on a medium customarily used for software interchange; or,
141
-
142
- b) Accompany it with a written offer, valid for at least three
143
- years, to give any third party, for a charge no more than your
144
- cost of physically performing source distribution, a complete
145
- machine-readable copy of the corresponding source code, to be
146
- distributed under the terms of Sections 1 and 2 above on a medium
147
- customarily used for software interchange; or,
148
-
149
- c) Accompany it with the information you received as to the offer
150
- to distribute corresponding source code. (This alternative is
151
- allowed only for noncommercial distribution and only if you
152
- received the program in object code or executable form with such
153
- an offer, in accord with Subsection b above.)
154
-
155
- The source code for a work means the preferred form of the work for
156
- making modifications to it. For an executable work, complete source
157
- code means all the source code for all modules it contains, plus any
158
- associated interface definition files, plus the scripts used to
159
- control compilation and installation of the executable. However, as a
160
- special exception, the source code distributed need not include
161
- anything that is normally distributed (in either source or binary
162
- form) with the major components (compiler, kernel, and so on) of the
163
- operating system on which the executable runs, unless that component
164
- itself accompanies the executable.
165
-
166
- If distribution of executable or object code is made by offering
167
- access to copy from a designated place, then offering equivalent
168
- access to copy the source code from the same place counts as
169
- distribution of the source code, even though third parties are not
170
- compelled to copy the source along with the object code.
171
-
172
- 4. You may not copy, modify, sublicense, or distribute the Program
173
- except as expressly provided under this License. Any attempt
174
- otherwise to copy, modify, sublicense or distribute the Program is
175
- void, and will automatically terminate your rights under this License.
176
- However, parties who have received copies, or rights, from you under
177
- this License will not have their licenses terminated so long as such
178
- parties remain in full compliance.
179
-
180
- 5. You are not required to accept this License, since you have not
181
- signed it. However, nothing else grants you permission to modify or
182
- distribute the Program or its derivative works. These actions are
183
- prohibited by law if you do not accept this License. Therefore, by
184
- modifying or distributing the Program (or any work based on the
185
- Program), you indicate your acceptance of this License to do so, and
186
- all its terms and conditions for copying, distributing or modifying
187
- the Program or works based on it.
188
-
189
- 6. Each time you redistribute the Program (or any work based on the
190
- Program), the recipient automatically receives a license from the
191
- original licensor to copy, distribute or modify the Program subject to
192
- these terms and conditions. You may not impose any further
193
- restrictions on the recipients' exercise of the rights granted herein.
194
- You are not responsible for enforcing compliance by third parties to
195
- this License.
196
-
197
- 7. If, as a consequence of a court judgment or allegation of patent
198
- infringement or for any other reason (not limited to patent issues),
199
- conditions are imposed on you (whether by court order, agreement or
200
- otherwise) that contradict the conditions of this License, they do not
201
- excuse you from the conditions of this License. If you cannot
202
- distribute so as to satisfy simultaneously your obligations under this
203
- License and any other pertinent obligations, then as a consequence you
204
- may not distribute the Program at all. For example, if a patent
205
- license would not permit royalty-free redistribution of the Program by
206
- all those who receive copies directly or indirectly through you, then
207
- the only way you could satisfy both it and this License would be to
208
- refrain entirely from distribution of the Program.
209
-
210
- If any portion of this section is held invalid or unenforceable under
211
- any particular circumstance, the balance of the section is intended to
212
- apply and the section as a whole is intended to apply in other
213
- circumstances.
214
-
215
- It is not the purpose of this section to induce you to infringe any
216
- patents or other property right claims or to contest validity of any
217
- such claims; this section has the sole purpose of protecting the
218
- integrity of the free software distribution system, which is
219
- implemented by public license practices. Many people have made
220
- generous contributions to the wide range of software distributed
221
- through that system in reliance on consistent application of that
222
- system; it is up to the author/donor to decide if he or she is willing
223
- to distribute software through any other system and a licensee cannot
224
- impose that choice.
225
-
226
- This section is intended to make thoroughly clear what is believed to
227
- be a consequence of the rest of this License.
228
-
229
- 8. If the distribution and/or use of the Program is restricted in
230
- certain countries either by patents or by copyrighted interfaces, the
231
- original copyright holder who places the Program under this License
232
- may add an explicit geographical distribution limitation excluding
233
- those countries, so that distribution is permitted only in or among
234
- countries not thus excluded. In such case, this License incorporates
235
- the limitation as if written in the body of this License.
236
-
237
- 9. The Free Software Foundation may publish revised and/or new versions
238
- of the General Public License from time to time. Such new versions will
239
- be similar in spirit to the present version, but may differ in detail to
240
- address new problems or concerns.
241
-
242
- Each version is given a distinguishing version number. If the Program
243
- specifies a version number of this License which applies to it and "any
244
- later version", you have the option of following the terms and conditions
245
- either of that version or of any later version published by the Free
246
- Software Foundation. If the Program does not specify a version number of
247
- this License, you may choose any version ever published by the Free Software
248
- Foundation.
249
-
250
- 10. If you wish to incorporate parts of the Program into other free
251
- programs whose distribution conditions are different, write to the author
252
- to ask for permission. For software which is copyrighted by the Free
253
- Software Foundation, write to the Free Software Foundation; we sometimes
254
- make exceptions for this. Our decision will be guided by the two goals
255
- of preserving the free status of all derivatives of our free software and
256
- of promoting the sharing and reuse of software generally.
257
-
258
- NO WARRANTY
259
-
260
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
- FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
- OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
- PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
- OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
- TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
- PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
- REPAIR OR CORRECTION.
269
-
270
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
- REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
- INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
- OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
- TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
- YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
- PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
- POSSIBILITY OF SUCH DAMAGES.
279
-
280
- END OF TERMS AND CONDITIONS
281
-
282
- How to Apply These Terms to Your New Programs
283
-
284
- If you develop a new program, and you want it to be of the greatest
285
- possible use to the public, the best way to achieve this is to make it
286
- free software which everyone can redistribute and change under these terms.
287
-
288
- To do so, attach the following notices to the program. It is safest
289
- to attach them to the start of each source file to most effectively
290
- convey the exclusion of warranty; and each file should have at least
291
- the "copyright" line and a pointer to where the full notice is found.
292
-
293
- {description}
294
- Copyright (C) {year} {fullname}
295
-
296
- This program is free software; you can redistribute it and/or modify
297
- it under the terms of the GNU General Public License as published by
298
- the Free Software Foundation; either version 2 of the License, or
299
- (at your option) any later version.
300
-
301
- This program is distributed in the hope that it will be useful,
302
- but WITHOUT ANY WARRANTY; without even the implied warranty of
303
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
- GNU General Public License for more details.
305
-
306
- You should have received a copy of the GNU General Public License along
307
- with this program; if not, write to the Free Software Foundation, Inc.,
308
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
-
310
- Also add information on how to contact you by electronic and paper mail.
311
-
312
- If the program is interactive, make it output a short notice like this
313
- when it starts in an interactive mode:
314
-
315
- Gnomovision version 69, Copyright (C) year name of author
316
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
- This is free software, and you are welcome to redistribute it
318
- under certain conditions; type `show c' for details.
319
-
320
- The hypothetical commands `show w' and `show c' should show the appropriate
321
- parts of the General Public License. Of course, the commands you use may
322
- be called something other than `show w' and `show c'; they could even be
323
- mouse-clicks or menu items--whatever suits your program.
324
-
325
- You should also get your employer (if you work as a programmer) or your
326
- school, if any, to sign a "copyright disclaimer" for the program, if
327
- necessary. Here is a sample; alter the names:
328
-
329
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
-
332
- {signature of Ty Coon}, 1 April 1989
333
- Ty Coon, President of Vice
334
-
335
- This General Public License does not permit incorporating your program into
336
- proprietary programs. If your program is a subroutine library, you may
337
- consider it more useful to permit linking proprietary applications with the
338
- library. If this is what you want to do, use the GNU Lesser General
339
- Public License instead of this License.
340
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/README.md DELETED
@@ -1,253 +0,0 @@
1
- Freemius WordPress SDK
2
- ======================
3
-
4
- [Monetization](https://freemius.com/wordpress/), [analytics](https://freemius.com/wordpress/insights/), and marketing automation platform for plugin & theme developers. Freemius empower developers to create prosperous subscription based businesses.
5
-
6
- You can see some of the WordPress.org plugins & themes that are utilizing the power of Freemius here:
7
-
8
- https://includewp.com/freemius/#focus
9
-
10
- If you are a WordPress plugin or theme developer and you are interested to monetize with Freemius you can [sign-up here for free](https://dashboard.freemius.com/register/):
11
-
12
- https://dashboard.freemius.com/register/
13
-
14
- **Below you'll find the integration instructions for our WordPress SDK.**
15
-
16
- ## Code Documentation
17
-
18
- You can find the SDK's PHP-Doc documentation here:
19
- https://codedoc.pub/freemius/wordpress-sdk/master/
20
-
21
- ## Initializing the SDK
22
-
23
- Copy the code below and paste it into the top of your main plugin's PHP file, right after the plugin's header comment:
24
-
25
- ```php
26
- <?php
27
- // Create a helper function for easy SDK access.
28
- function my_prefix_fs() {
29
- global $my_prefix_fs;
30
- if ( ! isset( $my_prefix_fs ) ) {
31
- // Include Freemius SDK.
32
- require_once dirname(__FILE__) . '/freemius/start.php';
33
-
34
- $my_prefix_fs = fs_dynamic_init( array(
35
- 'id' => '1234',
36
- 'slug' => 'my-plugin-slug',
37
- 'menu_slug' => 'my_menu_slug', // You can also use __FILE__
38
- 'public_key' => 'pk_MY_PUBLIC_KEY',
39
- 'is_live' => true,
40
- 'is_premium' => true,
41
- 'has_addons' => false,
42
- 'has_paid_plans' => false,
43
- // Set the SDK to work in a sandbox mode (for development & testing).
44
- // IMPORTANT: MAKE SURE TO REMOVE SECRET KEY BEFORE DEPLOYMENT.
45
- 'secret_key' => 'sk_MY_SECRET_KEY',
46
- ) );
47
- }
48
-
49
- return $my_prefix_fs;
50
- }
51
-
52
- // Init Freemius.
53
- my_prefix_fs();
54
- ?>
55
- ```
56
-
57
- - **1234** - Replace with your plugin's ID.
58
- - **pk_MY_PUBLIC_KEY** - Replace with your plugin's public key.
59
- - **sk_MY_SECRET_KEY** - Replace with your plugin's secret key.
60
- - **my-plugin-slug** - Replace with your plugin's WordPress.org slug.
61
- - **my_menu_slug** - Replace with your admin dashboard settings menu slug.
62
-
63
-
64
- ## Usage example
65
-
66
- You can call the SDK by using the shortcode function:
67
-
68
- ```php
69
- <?php my_prefix_fs()->get_upgrade_url(); ?>
70
- ```
71
-
72
- Or when calling Freemius multiple times in a scope, it's recommended to use it with the global variable:
73
-
74
- ```php
75
- <?php
76
- global $my_prefix_fs;
77
- $my_prefix_fs->get_account_url();
78
- ?>
79
- ```
80
-
81
- ## Adding license based logic examples
82
-
83
- Add marketing content to encourage your users to upgrade for your paid version:
84
-
85
- ```php
86
- <?php
87
- if ( my_prefix_fs()->is_not_paying() ) {
88
- echo '<section><h1>' . esc_html__('Awesome Premium Features', 'my-plugin-slug') . '</h1>';
89
- echo '<a href="' . my_prefix_fs()->get_upgrade_url() . '">' .
90
- esc_html__('Upgrade Now!', 'my-plugin-slug') .
91
- '</a>';
92
- echo '</section>';
93
- }
94
- ?>
95
- ```
96
-
97
- Add logic which will only be available in your premium plugin version:
98
-
99
- ```php
100
- <?php
101
- // This "if" block will be auto removed from the Free version.
102
- if ( my_prefix_fs()->is__premium_only() ) {
103
-
104
- // ... premium only logic ...
105
-
106
- }
107
- ?>
108
- ```
109
-
110
- To add a function which will only be available in your premium plugin version, simply add __premium_only as the suffix of the function name. Just make sure that all lines that call that method directly or by hooks, are also wrapped in premium only logic:
111
-
112
- ```php
113
- <?php
114
- class My_Plugin {
115
- function init() {
116
- ...
117
-
118
- // This "if" block will be auto removed from the free version.
119
- if ( my_prefix_fs()->is__premium_only() ) {
120
- // Init premium version.
121
- $this->admin_init__premium_only();
122
-
123
- add_action( 'admin_init', array( &$this, 'admin_init_hook__premium_only' );
124
- }
125
-
126
- ...
127
- }
128
-
129
- // This method will be only included in the premium version.
130
- function admin_init__premium_only() {
131
- ...
132
- }
133
-
134
- // This method will be only included in the premium version.
135
- function admin_init_hook__premium_only() {
136
- ...
137
- }
138
- }
139
- ?>
140
- ```
141
-
142
- Add logic which will only be executed for customers in your 'professional' plan:
143
-
144
- ```php
145
- <?php
146
- if ( my_prefix_fs()->is_plan('professional', true) ) {
147
- // .. logic related to Professional plan only ...
148
- }
149
- ?>
150
- ```
151
-
152
- Add logic which will only be executed for customers in your 'professional' plan or higher plans:
153
-
154
- ```php
155
- <?php
156
- if ( my_prefix_fs()->is_plan('professional') ) {
157
- // ... logic related to Professional plan and higher plans ...
158
- }
159
- ?>
160
- ```
161
-
162
- Add logic which will only be available in your premium plugin version AND will only be executed for customers in your 'professional' plan (and higher plans):
163
-
164
- ```php
165
- <?php
166
- // This "if" block will be auto removed from the Free version.
167
- if ( my_prefix_fs()->is_plan__premium_only('professional') ) {
168
- // ... logic related to Professional plan and higher plans ...
169
- }
170
- ?>
171
- ```
172
-
173
- Add logic only for users in trial:
174
-
175
- ```php
176
- <?php
177
- if ( my_prefix_fs()->is_trial() ) {
178
- // ... logic for users in trial ...
179
- }
180
- ?>
181
- ```
182
-
183
- Add logic for specified paid plan:
184
-
185
- ```php
186
- <?php
187
- // This "if" block will be auto removed from the Free version.
188
- if ( my_prefix_fs()->is__premium_only() ) {
189
- if ( my_prefix_fs()->is_plan( 'professional', true ) ) {
190
-
191
- // ... logic related to Professional plan only ...
192
-
193
- } else if ( my_prefix_fs()->is_plan( 'business' ) ) {
194
-
195
- // ... logic related to Business plan and higher plans ...
196
-
197
- }
198
- }
199
- ?>
200
- ```
201
-
202
- ## Excluding files and folders from the free plugin version
203
- There are two ways to exclude files from your free version.
204
-
205
- 1. Add `__premium_only` just before the file extension. For example, functions__premium_only.php will be only included in the premium plugin version. This works for all type of files, not only PHP.
206
- 2. Add `@fs_premium_only` a sepcial meta tag to the plugin's main PHP file header. Example:
207
- ```php
208
- <?php
209
- /**
210
- * Plugin Name: My Very Awesome Plugin
211
- * Plugin URI: http://my-awesome-plugin.com
212
- * Description: Create and manage Awesomeness right in WordPress.
213
- * Version: 1.0.0
214
- * Author: Awesomattic
215
- * Author URI: http://my-awesome-plugin.com/me/
216
- * License: GPLv2
217
- * Text Domain: myplugin
218
- * Domain Path: /langs
219
- *
220
- * @fs_premium_only /lib/functions.php, /premium-files/
221
- */
222
-
223
- if ( ! defined( 'ABSPATH' ) ) {
224
- exit;
225
- }
226
-
227
- // ... my code ...
228
- ?>
229
- ```
230
- The file `/lib/functions.php` and the directory `/premium-files/` will be removed from the free plugin version.
231
-
232
- # WordPress.org Compliance
233
- Based on [WordPress.org Guidelines](https://wordpress.org/plugins/about/guidelines/) you are not allowed to submit a plugin that has premium code in it:
234
- > All code hosted by WordPress.org servers must be free and fully-functional. If you want to sell advanced features for a plugin (such as a "pro" version), then you must sell and serve that code from your own site, we will not host it on our servers.
235
-
236
- Therefore, if you want to deploy your free plugin's version to WordPress.org, make sure you wrap all your premium code with `if ( my_prefix_fs()->{{ method }}__premium_only() )` or the other methods provided to exclude premium features & files from the free version.
237
-
238
- ## Deployment
239
- Zip your plugin's root folder and upload it in the Deployment section in the *Freemius Developer's Dashboard*.
240
- The plugin will be scanned and processed by a custom developed *PHP Processor* which will auto-generate two versions of your plugin:
241
-
242
- 1. **Premium version**: Identical to your uploaded version, including all code (except your `secret_key`). Will be enabled for download ONLY for your paying or in trial customers.
243
- 2. **Free version**: The code stripped from all your paid features (based on the logic added wrapped in `{ method }__premium_only()`).
244
-
245
- The free version is the one that you should give your users to download. Therefore, download the free generated version and upload to your site. Or, if your plugin was WordPress.org complaint and you made sure to exclude all your premium code with the different provided techniques, you can deploy the downloaded free version to the .org repo.
246
-
247
- ## Reporting Bugs
248
- Email dev [at] freemius [dot] com
249
-
250
- ## FAQ
251
-
252
- ## Copyright
253
- Freemius, Inc.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/assets/css/admin/account.css DELETED
@@ -1 +0,0 @@
1
- #fs_account .postbox,#fs_account .widefat{max-width:700px}#fs_account h3{font-size:1.3em;padding:12px 15px;margin:0 0 12px 0;line-height:1.4;border-bottom:1px solid #F1F1F1}#fs_account i.dashicons{font-size:1.2em;height:1.2em;width:1.2em}#fs_account .button i.dashicons{vertical-align:middle}#fs_account .fs-header-actions{position:absolute;top:17px;right:15px;font-size:0.9em}#fs_account .fs-header-actions ul{margin:0}#fs_account .fs-header-actions li{float:left}#fs_account .fs-header-actions li form{display:inline-block}#fs_account .fs-header-actions li a{text-decoration:none}#fs_account_details .button-group{float:right}.rtl #fs_account .fs-header-actions{left:15px;right:auto}.fs-key-value-table{width:100%}.fs-key-value-table form{display:inline-block}.fs-key-value-table tr td:first-child{text-align:right}.fs-key-value-table tr td:first-child nobr{font-weight:bold}.fs-key-value-table tr td:first-child form{display:block}.fs-key-value-table tr td.fs-right{text-align:right}.fs-key-value-table tr.fs-odd{background:#ebebeb}.fs-key-value-table td,.fs-key-value-table th{padding:10px}.fs-key-value-table code{line-height:28px}.fs-key-value-table var,.fs-key-value-table code,.fs-key-value-table input[type="text"]{color:#0073AA;font-size:16px;background:none}.fs-key-value-table input[type="text"]{width:100%;font-weight:bold}label.fs-tag{background:#ffba00;color:#fff;display:inline-block;border-radius:3px;padding:5px;font-size:11px;line-height:11px;vertical-align:baseline}label.fs-tag.fs-warn{background:#ffba00}label.fs-tag.fs-success{background:#46b450}label.fs-tag.fs-error{background:#dc3232}#fs_addons h3{border:none;margin-bottom:0;padding:4px 5px}#fs_addons td{vertical-align:middle}#fs_addons thead{white-space:nowrap}#fs_addons td:first-child,#fs_addons th:first-child{text-align:left;font-weight:bold}#fs_addons td:last-child,#fs_addons th:last-child{text-align:right}#fs_addons th{font-weight:bold}#fs_billing_address{width:100%}#fs_billing_address tr td{width:50%;padding:5px}#fs_billing_address tr:first-of-type td{padding-top:0}#fs_billing_address span{font-weight:bold}#fs_billing_address input,#fs_billing_address select{display:block;width:100%;margin-top:5px}#fs_billing_address input::-moz-placeholder,#fs_billing_address select::-moz-placeholder{color:transparent;opacity:1}#fs_billing_address input:-ms-input-placeholder,#fs_billing_address select:-ms-input-placeholder{color:transparent}#fs_billing_address input::-webkit-input-placeholder,#fs_billing_address select::-webkit-input-placeholder{color:transparent}#fs_billing_address input.fs-read-mode,#fs_billing_address select.fs-read-mode{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode td span{display:none}#fs_billing_address.fs-read-mode input,#fs_billing_address.fs-read-mode select{border-color:transparent;color:#777;border-bottom:1px dashed #ccc;padding-left:0;background:none}#fs_billing_address.fs-read-mode input::-moz-placeholder,#fs_billing_address.fs-read-mode select::-moz-placeholder{color:#ccc;opacity:1}#fs_billing_address.fs-read-mode input:-ms-input-placeholder,#fs_billing_address.fs-read-mode select:-ms-input-placeholder{color:#ccc}#fs_billing_address.fs-read-mode input::-webkit-input-placeholder,#fs_billing_address.fs-read-mode select::-webkit-input-placeholder{color:#ccc}#fs_billing_address button{display:block;width:100%}
 
freemius/assets/css/admin/add-ons.css DELETED
@@ -1,2 +0,0 @@
1
- #fs_addons .fs-cards-list{list-style:none}#fs_addons .fs-cards-list .fs-card{float:left;height:152px;width:310px;padding:0;margin:0 0 30px 30px;font-size:14px;list-style:none;border:1px solid #ddd;cursor:pointer;position:relative}#fs_addons .fs-cards-list .fs-card .fs-overlay{position:absolute;left:0;right:0;bottom:0;top:0;z-index:9}#fs_addons .fs-cards-list .fs-card .fs-inner{background-color:#fff;overflow:hidden;height:100%;position:relative}#fs_addons .fs-cards-list .fs-card .fs-inner ul{-moz-transition:all,0.15s;-o-transition:all,0.15s;-ms-transition:all,0.15s;-webkit-transition:all,0.15s;transition:all,0.15s;left:0;right:0;top:0;position:absolute}#fs_addons .fs-cards-list .fs-card .fs-inner li{list-style:none;line-height:18px;padding:0 15px;width:100%;display:block;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-card-banner{padding:0;margin:0;line-height:0;display:block;height:100px;background-repeat:repeat-x;background-size:100% 100%;-moz-transition:all,0.15s;-o-transition:all,0.15s;-ms-transition:all,0.15s;-webkit-transition:all,0.15s;transition:all,0.15s}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-title{margin:10px 0 0 0;height:18px;overflow:hidden;color:#000;white-space:nowrap;text-overflow:ellipsis;font-weight:bold}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-offer{font-size:0.9em}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-description{background-color:#f9f9f9;padding:10px 15px 100px 15px;border-top:1px solid #eee;margin:0 0 10px 0;color:#777}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-tag{position:absolute;top:10px;right:0px;background:greenyellow;display:block;padding:2px 10px;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.3);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.3);box-shadow:1px 1px 1px rgba(0,0,0,0.3);text-transform:uppercase;font-size:0.9em;font-weight:bold}#fs_addons .fs-cards-list .fs-card .fs-inner .fs-cta .button{position:absolute;top:112px;right:10px}@media screen and (min-width: 960px){#fs_addons .fs-cards-list .fs-card:hover .fs-overlay{border:2px solid #29abe1;margin-left:-1px;margin-top:-1px}#fs_addons .fs-cards-list .fs-card:hover .fs-inner ul{top:-100px}#fs_addons .fs-cards-list .fs-card:hover .fs-inner .fs-title,#fs_addons .fs-cards-list .fs-card:hover .fs-inner .fs-offer{color:#29abe1}}
2
- #TB_window,#TB_window iframe{width:772px !important}#plugin-information #section-description h2,#plugin-information #section-description h3,#plugin-information #section-description p,#plugin-information #section-description b,#plugin-information #section-description i,#plugin-information #section-description blockquote,#plugin-information #section-description li,#plugin-information #section-description ul,#plugin-information #section-description ol{clear:none}#plugin-information #section-description .fs-selling-points{padding-bottom:10px;border-bottom:1px solid #ddd}#plugin-information #section-description .fs-selling-points ul{margin:0}#plugin-information #section-description .fs-selling-points ul li{padding:0;list-style:none outside none}#plugin-information #section-description .fs-selling-points ul li i.dashicons{color:#71ae00;font-size:3em;vertical-align:middle;line-height:30px;float:left;margin:0 0 0 -15px}#plugin-information #section-description .fs-selling-points ul li h3{margin:1em 30px !important}#plugin-information #section-description .fs-screenshots:after{content:"";display:table;clear:both}#plugin-information #section-description .fs-screenshots ul{list-style:none;margin:0}#plugin-information #section-description .fs-screenshots ul li{width:225px;height:225px;float:left;margin-bottom:20px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}#plugin-information #section-description .fs-screenshots ul li a{display:block;width:100%;height:100%;border:1px solid;-moz-box-shadow:1px 1px 1px rgba(0,0,0,0.2);-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.2);box-shadow:1px 1px 1px rgba(0,0,0,0.2);background-size:cover}#plugin-information #section-description .fs-screenshots ul li.odd{margin-right:20px}#plugin-information .plugin-information-pricing{margin:-16px;border-bottom:1px solid #ddd}#plugin-information .plugin-information-pricing .fs-plan h3{margin-top:0;padding:20px;font-size:16px}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper{border-bottom:1px solid #ddd}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab{cursor:pointer;position:relative;padding:0 10px;font-size:0.9em}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab label{text-transform:uppercase;color:green;background:greenyellow;position:absolute;left:-1px;right:-1px;bottom:100%;border:1px solid darkgreen;padding:2px;text-align:center;font-size:0.9em;line-height:1em}#plugin-information .plugin-information-pricing .fs-plan .nav-tab-wrapper .nav-tab.nav-tab-active{cursor:default;background:#fffeec;border-bottom-color:#fffeec}#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle h3{background:#fffeec;margin:0;padding-bottom:0;color:#0073aa}#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle .nav-tab-wrapper,#plugin-information .plugin-information-pricing .fs-plan.fs-single-cycle .fs-billing-frequency{display:none}#plugin-information .plugin-information-pricing .fs-plan .fs-pricing-body{background:#fffeec;padding:20px}#plugin-information .plugin-information-pricing .fs-plan .button{width:100%;text-align:center;font-weight:bold;text-transform:uppercase;font-size:1.1em}#plugin-information .plugin-information-pricing .fs-plan label{white-space:nowrap}#plugin-information .plugin-information-pricing .fs-plan var{font-style:normal}#plugin-information .plugin-information-pricing .fs-plan .fs-billing-frequency,#plugin-information .plugin-information-pricing .fs-plan .fs-annual-discount{text-align:center;display:block;font-weight:bold;margin-bottom:10px;text-transform:uppercase;background:#F3F3F3;padding:2px;border:1px solid #ccc}#plugin-information .plugin-information-pricing .fs-plan .fs-annual-discount{text-transform:none;color:green;background:greenyellow}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms{font-size:0.9em}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms i{float:left;margin:0 0 0 -15px}#plugin-information .plugin-information-pricing .fs-plan ul.fs-trial-terms li{margin:10px 0 0 0}#plugin-information #section-features .fs-features{margin:-20px -26px}#plugin-information #section-features table{width:100%;border-spacing:0;border-collapse:separate}#plugin-information #section-features table thead th{padding:10px 0}#plugin-information #section-features table thead .fs-price{color:#71ae00;font-weight:normal;display:block;text-align:center}#plugin-information #section-features table tbody td{border-top:1px solid #ccc;padding:10px 0;text-align:center;width:100px;color:#71ae00}#plugin-information #section-features table tbody td:first-child{text-align:left;width:auto;color:inherit;padding-left:26px}#plugin-information #section-features table tbody tr.fs-odd td{background:#fefefe}#plugin-information #section-features .dashicons-yes{width:30px;height:30px;font-size:30px}@media screen and (max-width: 961px){#fs_addons .fs-cards-list .fs-card{height:265px}}
 
 
freemius/assets/css/admin/checkout.css DELETED
@@ -1 +0,0 @@
1
- @media screen and (max-width: 782px){#wpbody-content{padding-bottom:0 !important}}
 
freemius/assets/css/admin/common.css DELETED
@@ -1,2 +0,0 @@
1
- #iframe{line-height:0;font-size:0}.fs-full-size-wrapper{margin:0 0 -65px -20px}@media (max-width: 782px){.fs-full-size-wrapper{margin:0 0 -65px -10px}}
2
- .fs-notice{position:relative}.fs-notice.fs-has-title{margin-bottom:30px !important}.fs-notice.success{color:green}.fs-notice.promotion{border-color:#00a0d2 !important;background-color:#f2fcff !important}.fs-notice .fs-notice-body{margin:.5em 0;padding:2px}.fs-notice .fs-close{cursor:pointer;color:#aaa;float:right}.fs-notice .fs-close:hover{color:#666}.fs-notice .fs-close>*{margin-top:7px;display:inline-block}.fs-notice label.fs-plugin-title{background:rgba(0,0,0,0.3);color:#fff;padding:2px 10px;position:absolute;top:100%;bottom:auto;right:auto;-moz-border-radius:0 0 3px 3px;-webkit-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;left:10px;font-size:12px;font-weight:bold;cursor:auto}.rtl .fs-notice .fs-close{float:left}.fs-secure-notice{position:fixed;top:32px;left:160px;right:0;background:#ebfdeb;padding:10px 20px;color:green;z-index:9999;box-shadow:0px 2px 2px rgba(6,113,6,0.3);opacity:0.95;filter:alpha(opacity=95)}.fs-secure-notice:hover{opacity:1;filter:alpha(opacity=100)}@media screen and (max-width: 960px){.fs-secure-notice{left:36px}}@media screen and (max-width: 500px){#fs_promo_tab{display:none}}@media screen and (max-width: 782px){.fs-secure-notice{left:0;top:46px;text-align:center}}span.fs-submenu-item.fs-sub:before{content:'\21B3';padding:0 5px}.rtl span.fs-submenu-item.fs-sub:before{content:'\21B2'}.fs-submenu-item.pricing.upgrade-mode{color:greenyellow}.fs-submenu-item.pricing.trial-mode{color:#83e2ff}#adminmenu .update-plugins.fs-trial{background-color:#00b9eb}
 
 
freemius/assets/css/admin/connect.css DELETED
@@ -1 +0,0 @@
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/deactivation-feedback.css DELETED
@@ -1 +0,0 @@
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 .fs-modal-dialog li.reason{margin-bottom:10px}.fs-modal .fs-modal-dialog li.reason .reason-input,.fs-modal .fs-modal-dialog li.reason .internal-message{margin-left:29px}.fs-modal .fs-modal-dialog li.reason label{display:table}.fs-modal .fs-modal-dialog li.reason label>span{display:table-cell;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 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}.fs-modal .reason-input,.fs-modal .internal-message{margin:3px 0 3px 22px}.fs-modal .reason-input input,.fs-modal .reason-input textarea,.fs-modal .internal-message input,.fs-modal .internal-message textarea{width:100%}.fs-modal li.reason.has-internal-message .internal-message{border:1px solid #ccc;padding:7px;display:none}body.has-fs-modal{overflow:hidden}#the-list .deactivate>.fs-slug{display:none}
 
freemius/assets/css/admin/debug.css DELETED
@@ -1 +0,0 @@
1
- .switch{position:relative;display:inline-block;font-size:1.6em;font-weight:bold;color:#ccc;text-shadow:0px 1px 1px rgba(255,255,255,0.8);height:18px;padding:6px 6px 5px 6px;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);border-radius:4px;background:#ececec;box-shadow:0px 0px 4px rgba(0,0,0,0.1),inset 0px 1px 3px 0px rgba(0,0,0,0.1);cursor:pointer}.switch span{display:inline-block;width:35px;text-transform:uppercase}.switch span.on{color:#6bc406}.switch .toggle{position:absolute;top:1px;width:37px;height:25px;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.3);border-radius:4px;background:#fff;background:-moz-linear-gradient(top, #ececec 0%, #fff 100%);background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #ececec), color-stop(100%, #fff));background:-webkit-linear-gradient(top, #ececec 0%, #fff 100%);background:-o-linear-gradient(top, #ececec 0%, #fff 100%);background:-ms-linear-gradient(top, #ececec 0%, #fff 100%);background:linear-gradient(top, #ececec 0%, #fff 100%);box-shadow:inset 0px 1px 0px 0px rgba(255,255,255,0.5);z-index:999;-moz-transition:all 0.15s ease-in-out;-o-transition:all 0.15s ease-in-out;-ms-transition:all 0.15s ease-in-out;-webkit-transition:all 0.15s ease-in-out;transition:all 0.15s ease-in-out}.switch.on .toggle{left:2%}.switch.off .toggle{left:54%}.switch.round{padding:0px 20px;border-radius:40px}.switch.round .toggle{border-radius:40px;width:14px;height:14px}.switch.round.on .toggle{left:3%;background:#6bc406}.switch.round.off .toggle{left:58%}.switch-label{font-size:20px;line-height:31px;margin:0 5px}#fs_log_book table{font-family:Consolas,Monaco,monospace;font-size:12px}#fs_log_book table th{color:#ccc}#fs_log_book table tr{background:#232525}#fs_log_book table tr.alternate{background:#2b2b2b}#fs_log_book table tr td.fs-col--logger{color:#5a7435}#fs_log_book table tr td.fs-col--type{color:#ffc861}#fs_log_book table tr td.fs-col--function{color:#a7b7b1;font-weight:bold}#fs_log_book table tr td.fs-col--message,#fs_log_book table tr td.fs-col--message a{color:#9a73ac !important}#fs_log_book table tr td.fs-col--file{color:#d07922}#fs_log_book table tr td.fs-col--timestamp{color:#6596be}
 
freemius/assets/css/admin/dialog-boxes.css DELETED
@@ -1,2 +0,0 @@
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-success .fs-modal-header{border-bottom-color:#46b450}.fs-modal.fs-success .fs-modal-body{background-color:#f7fff7}.fs-modal.fs-warn .fs-modal-header{border-bottom-color:#ffb900}.fs-modal.fs-warn .fs-modal-body{background-color:#fff8e5}.fs-modal.fs-error .fs-modal-header{border-bottom-color:#dc3232}.fs-modal.fs-error .fs-modal-body{background-color:#ffeaea}.fs-modal .fs-modal-body,.fs-modal .fs-modal-footer{border:0;background:#fefefe;padding:20px}.fs-modal .fs-modal-header{border-bottom:#eeeeee solid 1px;background:#fbfbfb;padding:15px 20px;position:relative;margin-bottom:-10px}.fs-modal .fs-modal-header h4{margin:0;padding:0;text-transform:uppercase;font-size:1.2em;font-weight:bold;color:#cacaca;text-shadow:1px 1px 1px #fff;letter-spacing:0.6px;-webkit-font-smoothing:antialiased}.fs-modal .fs-modal-header .fs-close{position:absolute;right:10px;top:12px;cursor:pointer;color:#bbb;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;padding:3px;-moz-transition:all 0.2s ease-in-out;-o-transition:all 0.2s ease-in-out;-ms-transition:all 0.2s ease-in-out;-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}.fs-modal .fs-modal-header .fs-close:hover{color:#fff;background:#aaa}.fs-modal .fs-modal-body{border-bottom:0}.fs-modal .fs-modal-body p{font-size:14px}.fs-modal .fs-modal-body h2{font-size:20px;line-height:1.5em}.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>.notice.inline{margin:0;display:none}.fs-modal .fs-modal-panel:not(.active){display:none}.rtl .fs-modal .fs-modal-header .fs-close{right:auto;left:20px}body.has-fs-modal{overflow:hidden}.fs-modal.fs-modal-deactivation-feedback .reason-input,.fs-modal.fs-modal-deactivation-feedback .internal-message{margin:3px 0 3px 22px}.fs-modal.fs-modal-deactivation-feedback .reason-input input,.fs-modal.fs-modal-deactivation-feedback .reason-input textarea,.fs-modal.fs-modal-deactivation-feedback .internal-message input,.fs-modal.fs-modal-deactivation-feedback .internal-message textarea{width:100%}.fs-modal.fs-modal-deactivation-feedback li.reason.has-internal-message .internal-message{border:1px solid #ccc;padding:7px;display:none}@media (max-width: 650px){.fs-modal.fs-modal-deactivation-feedback li.reason li.reason{margin-bottom:10px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .reason-input,.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .internal-message{margin-left:29px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label{display:table}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label>span{display:table-cell;font-size:1.3em}}.fs-modal.fs-modal-deactivation-feedback .anonymous-feedback-label{float:left}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel{margin-top:0 !important}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel h3{margin-top:0;line-height:1.5em}#the-list .deactivate>.fs-slug{display:none}.fs-modal.fs-modal-license-activation .fs-modal-body input.license_key{width:100%}.fs-modal.fs-modal-license-key-resend .email-address-container{overflow:hidden;padding-right:2px}.fs-modal.fs-modal-license-key-resend.fs-freemium input.email-address{width:300px}.fs-modal.fs-modal-license-key-resend.fs-freemium label{display:block;margin-bottom:10px}.fs-modal.fs-modal-license-key-resend.fs-premium input.email-address{width:100%}.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{float:right;margin-left:7px}@media (max-width: 650px){.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{margin-top:2px}}
2
- .rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .input-container>.email-address-container{padding-left:2px;padding-right:0}.rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .button-container{float:left;margin-right:7px;margin-left:0}a.show-license-resend-modal{margin-top:4px;display:inline-block}.fs-ajax-loader{position:relative;width:170px;height:20px;margin:auto}.fs-ajax-loader .fs-ajax-loader-bar{position:absolute;top:0;background-color:#0074a3;width:20px;height:20px;-webkit-animation-name:bounce_ajaxLoader;-moz-animation-name:bounce_ajaxLoader;-ms-animation-name:bounce_ajaxLoader;-o-animation-name:bounce_ajaxLoader;animation-name:bounce_ajaxLoader;-webkit-animation-duration:1.5s;-moz-animation-duration:1.5s;-ms-animation-duration:1.5s;-o-animation-duration:1.5s;animation-duration:1.5s;animation-iteration-count:infinite;-o-animation-iteration-count:infinite;-ms-animation-iteration-count:infinite;-webkit-animation-iteration-count:infinite;-moz-animation-iteration-count:infinite;-webkit-animation-direction:normal;-moz-animation-direction:normal;-ms-animation-direction:normal;-o-animation-direction:normal;animation-direction:normal;-moz-transform:0.3;-o-transform:0.3;-ms-transform:0.3;-webkit-transform:0.3;transform:0.3}.fs-ajax-loader .fs-ajax-loader-bar-1{left:0px;animation-delay:0.6s;-o-animation-delay:0.6s;-ms-animation-delay:0.6s;-webkit-animation-delay:0.6s;-moz-animation-delay:0.6s}.fs-ajax-loader .fs-ajax-loader-bar-2{left:19px;animation-delay:0.75s;-o-animation-delay:0.75s;-ms-animation-delay:0.75s;-webkit-animation-delay:0.75s;-moz-animation-delay:0.75s}.fs-ajax-loader .fs-ajax-loader-bar-3{left:38px;animation-delay:0.9s;-o-animation-delay:0.9s;-ms-animation-delay:0.9s;-webkit-animation-delay:0.9s;-moz-animation-delay:0.9s}.fs-ajax-loader .fs-ajax-loader-bar-4{left:57px;animation-delay:1.05s;-o-animation-delay:1.05s;-ms-animation-delay:1.05s;-webkit-animation-delay:1.05s;-moz-animation-delay:1.05s}.fs-ajax-loader .fs-ajax-loader-bar-5{left:76px;animation-delay:1.2s;-o-animation-delay:1.2s;-ms-animation-delay:1.2s;-webkit-animation-delay:1.2s;-moz-animation-delay:1.2s}.fs-ajax-loader .fs-ajax-loader-bar-6{left:95px;animation-delay:1.35s;-o-animation-delay:1.35s;-ms-animation-delay:1.35s;-webkit-animation-delay:1.35s;-moz-animation-delay:1.35s}.fs-ajax-loader .fs-ajax-loader-bar-7{left:114px;animation-delay:1.5s;-o-animation-delay:1.5s;-ms-animation-delay:1.5s;-webkit-animation-delay:1.5s;-moz-animation-delay:1.5s}.fs-ajax-loader .fs-ajax-loader-bar-8{left:133px;animation-delay:1.65s;-o-animation-delay:1.65s;-ms-animation-delay:1.65s;-webkit-animation-delay:1.65s;-moz-animation-delay:1.65s}@-moz-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-ms-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-o-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-webkit-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}.fs-modal-auto-install #request-filesystem-credentials-form h2,.fs-modal-auto-install #request-filesystem-credentials-form .request-filesystem-credentials-action-buttons{display:none}.fs-modal-auto-install #request-filesystem-credentials-form input[type=password],.fs-modal-auto-install #request-filesystem-credentials-form input[type=email],.fs-modal-auto-install #request-filesystem-credentials-form input[type=text]{-webkit-appearance:none;padding:10px 10px 5px 10px;width:300px;max-width:100%}.fs-modal-auto-install #request-filesystem-credentials-form>div,.fs-modal-auto-install #request-filesystem-credentials-form label,.fs-modal-auto-install #request-filesystem-credentials-form fieldset{width:300px;max-width:100%;margin:0 auto;display:block}
 
 
freemius/assets/css/admin/license-activation.css DELETED
@@ -1 +0,0 @@
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 .license-activation-message{margin:0;display:none}.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/css/common.css DELETED
@@ -1 +0,0 @@
1
- .fs-notice.success{color:green;font-weight:700}
 
freemius/assets/img/gallery-bank.png DELETED
Binary file
freemius/assets/img/plugin-icon.png DELETED
Binary file
freemius/assets/index.php DELETED
@@ -1,3 +0,0 @@
1
- <?php
2
- // Silence is golden.
3
- // Hide file structure from users on unprotected servers.
 
 
 
freemius/assets/js/nojquery.ba-postmessage.js DELETED
@@ -1,140 +0,0 @@
1
- /*!
2
- * jQuery postMessage - v0.5 - 9/11/2009
3
- * http://benalman.com/projects/jquery-postmessage-plugin/
4
- *
5
- * Copyright (c) 2009 "Cowboy" Ben Alman
6
- * Dual licensed under the MIT and GPL licenses.
7
- * http://benalman.com/about/license/
8
- *
9
- * Non-jQuery fork by Jeff Lee
10
- *
11
- * This fork consists of the following changes:
12
- * 1. Basic code cleanup and restructuring, for legibility.
13
- * 2. The `postMessage` and `receiveMessage` functions can be bound arbitrarily,
14
- * in terms of both function names and object scope. Scope is specified by
15
- * the the "this" context of NoJQueryPostMessageMixin();
16
- * 3. I've removed the check for Opera 9.64, which used `$.browser`. There were
17
- * at least three different GitHub users requesting the removal of this
18
- * "Opera sniff" on the original project's Issues page, so I figured this
19
- * would be a relatively safe change.
20
- * 4. `postMessage` no longer uses `$.param` to serialize messages that are not
21
- * strings. I actually prefer this structure anyway. `receiveMessage` does
22
- * not implement a corresponding deserialization step, and as such it seems
23
- * cleaner and more symmetric to leave both data serialization and
24
- * deserialization to the client.
25
- * 5. The use of `$.isFunction` is replaced by a functionally-identical check.
26
- * 6. The `$:nomunge` YUI option is no longer necessary.
27
- */
28
-
29
- function NoJQueryPostMessageMixin(postBinding, receiveBinding) {
30
-
31
- var setMessageCallback, unsetMessageCallback, currentMsgCallback,
32
- intervalId, lastHash, cacheBust = 1;
33
-
34
- if (window.postMessage) {
35
-
36
- if (window.addEventListener) {
37
- setMessageCallback = function (callback) {
38
- window.addEventListener('message', callback, false);
39
- }
40
-
41
- unsetMessageCallback = function (callback) {
42
- window.removeEventListener('message', callback, false);
43
- }
44
- } else {
45
- setMessageCallback = function (callback) {
46
- window.attachEvent('onmessage', callback);
47
- }
48
-
49
- unsetMessageCallback = function (callback) {
50
- window.detachEvent('onmessage', callback);
51
- }
52
- }
53
-
54
- this[postBinding] = function (message, targetUrl, target) {
55
- if (!targetUrl) {
56
- return;
57
- }
58
-
59
- // The browser supports window.postMessage, so call it with a targetOrigin
60
- // set appropriately, based on the targetUrl parameter.
61
- target.postMessage(message, targetUrl.replace(/([^:]+:\/\/[^\/]+).*/, '$1'));
62
- }
63
-
64
- // Since the browser supports window.postMessage, the callback will be
65
- // bound to the actual event associated with window.postMessage.
66
- this[receiveBinding] = function (callback, sourceOrigin, delay) {
67
- // Unbind an existing callback if it exists.
68
- if (currentMsgCallback) {
69
- unsetMessageCallback(currentMsgCallback);
70
- currentMsgCallback = null;
71
- }
72
-
73
- if (!callback) {
74
- return false;
75
- }
76
-
77
- // Bind the callback. A reference to the callback is stored for ease of
78
- // unbinding.
79
- currentMsgCallback = setMessageCallback(function (e) {
80
- switch (Object.prototype.toString.call(sourceOrigin)) {
81
- case '[object String]':
82
- if (sourceOrigin !== e.origin) {
83
- return false;
84
- }
85
- break;
86
- case '[object Function]':
87
- if (sourceOrigin(e.origin)) {
88
- return false;
89
- }
90
- break;
91
- }
92
-
93
- callback(e);
94
- });
95
- };
96
-
97
- } else {
98
-
99
- this[postBinding] = function (message, targetUrl, target) {
100
- if (!targetUrl) {
101
- return;
102
- }
103
-
104
- // The browser does not support window.postMessage, so set the location
105
- // of the target to targetUrl#message. A bit ugly, but it works! A cache
106
- // bust parameter is added to ensure that repeat messages trigger the
107
- // callback.
108
- target.location = targetUrl.replace(/#.*$/, '') + '#' + (+new Date) + (cacheBust++) + '&' + message;
109
- }
110
-
111
- // Since the browser sucks, a polling loop will be started, and the
112
- // callback will be called whenever the location.hash changes.
113
- this[receiveBinding] = function (callback, sourceOrigin, delay) {
114
- if (intervalId) {
115
- clearInterval(intervalId);
116
- intervalId = null;
117
- }
118
-
119
- if (callback) {
120
- delay = typeof sourceOrigin === 'number'
121
- ? sourceOrigin
122
- : typeof delay === 'number'
123
- ? delay
124
- : 100;
125
-
126
- intervalId = setInterval(function () {
127
- var hash = document.location.hash,
128
- re = /^#?\d+&/;
129
- if (hash !== lastHash && re.test(hash)) {
130
- lastHash = hash;
131
- callback({data: hash.replace(re, '')});
132
- }
133
- }, delay);
134
- }
135
- };
136
-
137
- }
138
-
139
- return this;
140
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/assets/js/nojquery.ba-postmessage.min.js DELETED
@@ -1,12 +0,0 @@
1
- /*
2
- * nojquery-postmessage by Jeff Lee
3
- * a non-jQuery fork of:
4
- *
5
- * jQuery postMessage - v0.5 - 9/11/2009
6
- * http://benalman.com/projects/jquery-postmessage-plugin/
7
- *
8
- * Copyright (c) 2009 "Cowboy" Ben Alman
9
- * Dual licensed under the MIT and GPL licenses.
10
- * http://benalman.com/about/license/
11
- */
12
- function NoJQueryPostMessageMixin(g, a){var b, h, e, d, f, c = 1; if (window.postMessage){if (window.addEventListener){b = function(i){window.addEventListener("message", i, false)}; h = function(i){window.removeEventListener("message", i, false)}} else{b = function(i){window.attachEvent("onmessage", i)}; h = function(i){window.detachEvent("onmessage", i)}}this[g] = function(i, k, j){if (!k){return}j.postMessage(i, k.replace(/([^:]+:\/\/[^\/]+).*/, "$1"))}; this[a] = function(k, j, i){if (e){h(e); e = null}if (!k){return false}e = b(function(l){switch (Object.prototype.toString.call(j)){case"[object String]":if (j !== l.origin){return false}break; case"[object Function]":if (j(l.origin)){return false}break}k(l)})}} else{this[g] = function(i, k, j){if (!k){return}j.location = k.replace(/#.*$/, "") + "#" + ( + new Date) + (c++) + "&" + i}; this[a] = function(k, j, i){if (d){clearInterval(d); d = null}if (k){i = typeof j === "number"?j:typeof i === "number"?i:100; d = setInterval(function(){var m = document.location.hash, l = /^#?\d+&/; if (m !== f && l.test(m)){f = m; k({data:m.replace(l, "")})}}, i)}}}return this};
 
 
 
 
 
 
 
 
 
 
 
 
freemius/assets/js/postmessage.js DELETED
@@ -1,134 +0,0 @@
1
- (function ($, undef) {
2
- var global = this;
3
-
4
- // Namespace.
5
- global.FS = global.FS || {};
6
-
7
- global.FS.PostMessage = function ()
8
- {
9
- var
10
- _is_child = false,
11
- _postman = new NoJQueryPostMessageMixin('postMessage', 'receiveMessage'),
12
- _callbacks = {},
13
- _base_url,
14
- _parent_url = decodeURIComponent(document.location.hash.replace(/^#/, '')),
15
- _parent_subdomain = _parent_url.substring(0, _parent_url.indexOf('/', ('https://' === _parent_url.substring(0, ('https://').length)) ? 8 : 7)),
16
- _init = function () {
17
- _postman.receiveMessage(function (e) {
18
- var data = JSON.parse(e.data);
19
-
20
- if (_callbacks[data.type]) {
21
- for (var i = 0; i < _callbacks[data.type].length; i++) {
22
- // Execute type callbacks.
23
- _callbacks[data.type][i](data.data);
24
- }
25
- }
26
- }, _base_url);
27
- },
28
- _hasParent = ('' !== _parent_url),
29
- $window = $(window),
30
- $html = $('html');
31
-
32
- return {
33
- init: function (url, iframes)
34
- {
35
- _base_url = url;
36
- _init();
37
-
38
- // Automatically receive forward messages.
39
- FS.PostMessage.receiveOnce('forward', function (data) {
40
- window.location = data.url;
41
- });
42
-
43
- iframes = iframes || [];
44
-
45
- if (iframes.length > 0) {
46
- $window.on('scroll', function () {
47
- for (var i = 0; i < iframes.length; i++) {
48
- FS.PostMessage.postScroll(iframes[i]);
49
- }
50
- });
51
- }
52
- },
53
- init_child: function ()
54
- {
55
- this.init(_parent_subdomain);
56
-
57
- _is_child = true;
58
-
59
- // Post height of a child right after window is loaded.
60
- $(window).bind('load', function () {
61
- FS.PostMessage.postHeight();
62
-
63
- // Post message that window was loaded.
64
- FS.PostMessage.post('loaded');
65
- });
66
- },
67
- hasParent: function ()
68
- {
69
- return _hasParent;
70
- },
71
- postHeight: function (diff, wrapper) {
72
- diff = diff || 0;
73
- wrapper = wrapper || '#wrap_section';
74
- this.post('height', {
75
- height: diff + $(wrapper).outerHeight(true)
76
- });
77
- },
78
- postScroll: function (iframe) {
79
- this.post('scroll', {
80
- top: $window.scrollTop(),
81
- height: ($window.height() - parseFloat($html.css('paddingTop')) - parseFloat($html.css('marginTop')))
82
- }, iframe);
83
- },
84
- post: function (type, data, iframe)
85
- {
86
- console.debug('PostMessage.post', type);
87
-
88
- if (iframe)
89
- {
90
- // Post to iframe.
91
- _postman.postMessage(JSON.stringify({
92
- type: type,
93
- data: data
94
- }), iframe.src, iframe.contentWindow);
95
- } else {
96
- // Post to parent.
97
- _postman.postMessage(JSON.stringify({
98
- type: type,
99
- data: data
100
- }), _parent_url, window.parent);
101
- }
102
- },
103
- receive: function (type, callback)
104
- {
105
- console.debug('PostMessage.receive', type);
106
-
107
- if (undef === _callbacks[type])
108
- _callbacks[type] = [];
109
-
110
- _callbacks[type].push(callback);
111
- },
112
- receiveOnce: function (type, callback)
113
- {
114
- if (this.is_set(type))
115
- return;
116
-
117
- this.receive(type, callback);
118
- },
119
- // Check if any callbacks assigned to a specified message type.
120
- is_set: function (type)
121
- {
122
- return (undef != _callbacks[type]);
123
- },
124
- parent_url: function ()
125
- {
126
- return _parent_url;
127
- },
128
- parent_subdomain: function ()
129
- {
130
- return _parent_subdomain;
131
- }
132
- };
133
- }();
134
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/assets/scss/_colors.scss DELETED
@@ -1,65 +0,0 @@
1
- $menu-hover-color: #333;
2
- $darkest-color: #000;
3
- $fms-live-color: #71ae00;
4
- $fms-test-color: #f7941d;
5
- $fms-link-color: #29abe1;
6
- $fms-link-hover-color: darken(#29abe1, 10%);
7
- $body-bkg: #111;
8
- $special-color: #d3135a;
9
- $body-color: #f1f1f1;
10
- $fms-white: #f1f1f1;
11
- $container-bkg: #222;
12
- $container-bkg-odd: #262626;
13
- $container-border-color: #333;
14
- $table-head-bkg: #333;
15
- $table-head-color: #999;
16
- $info-color: #999;
17
- $error-color: #ff0000;
18
-
19
- $fs-logo-blue-color: #29abe1;
20
- $fs-logo-green-color: #71ae00;
21
- $fs-logo-magenta-color: #d3135a;
22
-
23
- // WordPress colors.
24
- $page-header-bkg: #333;
25
- $page-header-color: $fms-white;
26
- $text-dark-color: #333;
27
- $text-light-color: #666;
28
- $text-lightest-color: #999;
29
-
30
- // Notices.
31
- $wp-notice-success-color: #f7fff7;
32
- $wp-notice-success-dark-color: #46b450;
33
- $wp-notice-error-color: #ffeaea;
34
- $wp-notice-error-dark-color: #dc3232;
35
- $wp-notice-warn-color: #fff8e5;
36
- $wp-notice-warn-dark-color: #ffb900;
37
- $fs-notice-promotion-border-color: #00a0d2;
38
- $fs-notice-promotion-bkg: #f2fcff;
39
-
40
- // WP Buttons.
41
- $button-primary-bkg: #6bc406;
42
- $button-primary-color: $fms-white;
43
- $button-secondary-bkg: #333;
44
- $button-secondary-color: $fms-white;
45
- $featured-color: #6bc406;
46
- $wp-selected-color: #0074a3;
47
-
48
- $wordpress_color: #01749A;
49
- $blogger_color: #ff8100;
50
- $wix_color: #fac102;
51
- $shopify_color: #80d100;
52
- $addthis_color: #fe6d4e;
53
- $tumblr_color: #34506b;
54
- $zepo_color: #00baf2;
55
- $jquery_color: #000919;
56
- $javascript_color: #00baf2;
57
- $squarespace_color: #000;
58
-
59
- $blog_color: #ff6600;
60
- $facebook_color: #3b5998;
61
- $twitter_color: #4099ff;
62
- $linkedin_color: #4875b4;
63
- $youtube_color: #ff3333;
64
- $gplus_color: #c63d2d;
65
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/assets/scss/_functions.scss DELETED
File without changes
freemius/assets/scss/_load.scss DELETED
@@ -1,4 +0,0 @@
1
- @import 'mixins';
2
- @import "vars";
3
- @import "functions";
4
- @import "colors";
 
 
 
 
freemius/assets/scss/_mixins.scss DELETED
@@ -1,283 +0,0 @@
1
- // ---- CSS3 SASS MIXINS ----
2
- // https://github.com/madr/css3-sass-mixins
3
- //
4
- // Copyright (C) 2011 by Anders Ytterström
5
- //
6
- // Permission is hereby granted, free of charge, to any person obtaining a copy
7
- // of this software and associated documentation files (the "Software"), to deal
8
- // in the Software without restriction, including without limitation the rights
9
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- // copies of the Software, and to permit persons to whom the Software is
11
- // furnished to do so, subject to the following conditions:
12
- //
13
- // The above copyright notice and this permission notice shall be included in
14
- // all copies or substantial portions of the Software.
15
- //
16
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- // THE SOFTWARE.
23
- //
24
-
25
- // ---- LEGACY IE SUPPORT USING FILTERS ----
26
- // Should IE filters be used or not?
27
- // PROS: gradients, drop shadows etc will be handled by css.
28
- // CONS: will harm the site performance badly,
29
- // especially on sites with heavy rendering and scripting.
30
- $useIEFilters: 0;
31
- // might be 0 or 1. disabled by default.
32
- // ---- /LEGACY IE SUPPORT USING FILTERS ----
33
-
34
-
35
- @mixin background-size ($value) {
36
- -webkit-background-size: $value;
37
- background-size: $value;
38
- }
39
-
40
- @mixin border-image ($path, $offsets, $repeats) {
41
- -moz-border-image: $path $offsets $repeats;
42
- -o-border-image: $path $offsets $repeats;
43
- -webkit-border-image: $path $offsets $repeats;
44
- border-image: $path $offsets $repeats;
45
- }
46
-
47
- @mixin border-radius ($values...) {
48
- -moz-border-radius: $values;
49
- -webkit-border-radius: $values;
50
- border-radius: $values;
51
- /*-moz-background-clip: padding;
52
- -webkit-background-clip: padding-box;
53
- background-clip: padding-box;*/
54
- }
55
-
56
- @mixin box-shadow ($values...) {
57
- -moz-box-shadow: $values;
58
- -webkit-box-shadow: $values;
59
- box-shadow: $values;
60
- }
61
-
62
- //@mixin box-shadow ($x, $y, $offset, $hex, $ie: $useIEFilters, $inset: null, $spread:null) {
63
- // -moz-box-shadow: $x $y $offset $spread $hex $inset;
64
- // -webkit-box-shadow: $x $y $offset $spread $hex $inset;
65
- // box-shadow: $x $y $offset $spread $hex $inset;
66
- //
67
- // @if $ie == 1 {
68
- // $iecolor: '#' + red($hex) + green($hex) + blue($hex);
69
- // filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=#{$x}, OffY=#{$y}, Color='#{$iecolor}');
70
- // -ms-filter: quote(progid:DXImageTransform.Microsoft.dropshadow(OffX=#{$x}, OffY=#{$y}, Color='#{$iecolor}'));
71
- // }
72
- //}
73
-
74
- @mixin box-sizing($value) {
75
- -moz-box-sizing: $value;
76
- -webkit-box-sizing: $value;
77
- box-sizing: $value;
78
- }
79
-
80
- // requires sass 3.2
81
- @mixin keyframes($name){
82
- @-moz-keyframes #{$name} { @content; }
83
- @-ms-keyframes #{$name} { @content; }
84
- @-o-keyframes #{$name} { @content; }
85
- @-webkit-keyframes #{$name} { @content; }
86
- @keyframes #{$name} { @content; }
87
- }
88
-
89
- @mixin linear-gradient($from, $to, $ie: $useIEFilters) {
90
- @if $ie != 1 { background-color: $to; }
91
-
92
- background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, $from),color-stop(1, $to));
93
- background-image: -webkit-linear-gradient(top, $from, $to);
94
- background-image: -moz-linear-gradient(top, $from, $to);
95
- background-image: -ms-linear-gradient(top, $from, $to);
96
- background-image: -o-linear-gradient(top, $from, $to);
97
- background-image: linear-gradient(top, bottom, $from, $to);
98
-
99
- @if $ie == 1 {
100
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$from}', endColorstr='#{$to}');
101
- }
102
- }
103
-
104
- @mixin horizontal-gradient($startColor: #555, $endColor: #333, $ie: $useIEFilters) {
105
- @if $ie != 1 { background-color: $endColor; }
106
-
107
- background-color: $endColor;
108
- background-image: -webkit-gradient(linear, 0 0, 100% 0, from($startColor), to($endColor)); // Safari 4+, Chrome 2+
109
- background-image: -webkit-linear-gradient(left, $startColor, $endColor); // Safari 5.1+, Chrome 10+
110
- background-image: -moz-linear-gradient(left, $startColor, $endColor); // FF 3.6+
111
- background-image: -o-linear-gradient(left, $startColor, $endColor); // Opera 11.10
112
- background-image: linear-gradient(to right, $startColor, $endColor); // Standard, IE10
113
- background-repeat: repeat-x;
114
- @if $ie == 1 {
115
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$startColor}', endColorstr='#{$endColor}', GradientType=1);
116
- }
117
- }
118
-
119
- @mixin radial-gradient($from, $to, $ie: $useIEFilters) {
120
- @if $ie != 1 { background-color: $to; }
121
-
122
- background: -moz-radial-gradient(center, circle cover, $from 0%, $to 100%);
123
- background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, $from), color-stop(100%, $to));
124
- background: -webkit-radial-gradient(center, circle cover, $from 0%, $to 100%);
125
- background: -o-radial-gradient(center, circle cover, $from 0%, $to 100%);
126
- background: -ms-radial-gradient(center, circle cover, $from 0%, $to 100%);
127
- background: radial-gradient(center, circle cover, $from 0%, $to 100%);
128
- background-color: $from;
129
-
130
- @if $ie == 1 {
131
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$from}', endColorstr='#{$to}', GradientType=1); /* IE6-9 fallback on horizontal gradient */
132
- }
133
- }
134
-
135
- /*@mixin rgba-bg ($hex, $alpha, $ie: $useIEFilters) {
136
- @if $ie == 1 {
137
- background-color: none;
138
- $hexopac: ie-hex-str(rgba($hex, $alpha));
139
- filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#{$hexopac}',EndColorStr='#{$hexopac}}');
140
- -ms-filter: quote(progid:DXImageTransform.Microsoft.gradient(startColorStr='#{$hexopac}',EndColorStr='#{$hexopac}'));
141
- }
142
- @else {
143
- background-color: $hex;
144
- background-color: rgba($hex, $alpha);
145
- }
146
- }*/
147
-
148
- @mixin perspective($perspective) {
149
- -moz-perspective: $perspective;
150
- -ms-perspective: $perspective;
151
- -webkit-perspective: $perspective;
152
- perspective: $perspective;
153
- -moz-transform-style: preserve-3d;
154
- -ms-transform-style: preserve-3d;
155
- -webkit-transform-style: preserve-3d;
156
- transform-style: preserve-3d;
157
- }
158
-
159
- @mixin transform ($transforms) {
160
- -moz-transform: $transforms;
161
- -o-transform: $transforms;
162
- -ms-transform: $transforms;
163
- -webkit-transform: $transforms;
164
- transform: $transforms;
165
- }
166
-
167
- @mixin matrix ($a, $b, $c, $d, $e, $f) {
168
- -moz-transform: matrix($a, $b, $c, $d, #{$e}px, #{$f}px);
169
- -o-transform: matrix($a, $b, $c, $d, $e, $f);
170
- -ms-transform: matrix($a, $b, $c, $d, $e, $f);
171
- -webkit-transform: matrix($a, $b, $c, $d, $e, $f);
172
- transform: matrix($a, $b, $c, $d, $e, $f);
173
- }
174
-
175
- @mixin rotate ($deg) {
176
- @include transform(rotate(#{$deg}deg));
177
- }
178
-
179
- @mixin scale ($size) {
180
- @include transform(scale(#{$size}));
181
- }
182
-
183
- @mixin translate ($x, $y) {
184
- @include transform(translate($x, $y));
185
- }
186
-
187
- @mixin transition ($value...) {
188
- -moz-transition: $value;
189
- -o-transition: $value;
190
- -ms-transition: $value;
191
- -webkit-transition: $value;
192
- transition: $value;
193
- }
194
-
195
- @mixin animation($str) {
196
- -webkit-animation: #{$str};
197
- -moz-animation: #{$str};
198
- -ms-animation: #{$str};
199
- -o-animation: #{$str};
200
- animation: #{$str};
201
- }
202
-
203
- @mixin animation-name($str) {
204
- -webkit-animation-name: #{$str};
205
- -moz-animation-name: #{$str};
206
- -ms-animation-name: #{$str};
207
- -o-animation-name: #{$str};
208
- animation-name: #{$str};
209
- }
210
-
211
- @mixin animation-duration($str) {
212
- -webkit-animation-duration: #{$str};
213
- -moz-animation-duration: #{$str};
214
- -ms-animation-duration: #{$str};
215
- -o-animation-duration: #{$str};
216
- animation-duration: #{$str};
217
- }
218
-
219
- @mixin animation-direction($str) {
220
- -webkit-animation-direction: #{$str};
221
- -moz-animation-direction: #{$str};
222
- -ms-animation-direction: #{$str};
223
- -o-animation-direction: #{$str};
224
- animation-direction: #{$str};
225
- }
226
-
227
- @mixin animation-delay($str) {
228
- animation-delay:#{$str};
229
- -o-animation-delay:#{$str};
230
- -ms-animation-delay:#{$str};
231
- -webkit-animation-delay:#{$str};
232
- -moz-animation-delay:#{$str};
233
- }
234
-
235
- @mixin animation-iteration-count($str) {
236
- animation-iteration-count:#{$str};
237
- -o-animation-iteration-count:#{$str};
238
- -ms-animation-iteration-count:#{$str};
239
- -webkit-animation-iteration-count:#{$str};
240
- -moz-animation-iteration-count:#{$str};
241
- }
242
-
243
- @mixin animation-timing-function($str) {
244
- -webkit-animation-timing-function: #{$str};
245
- -moz-animation-timing-function: #{$str};
246
- -ms-animation-timing-function: #{$str};
247
- -o-animation-timing-function: #{$str};
248
- animation-timing-function: #{$str};
249
- }
250
-
251
- // ==== /CSS3 SASS MIXINS ====
252
-
253
- @mixin opacity($opacity) {
254
- opacity: $opacity;
255
- $opacity-ie: $opacity * 100;
256
- filter: alpha(opacity=$opacity-ie); //IE8
257
- }
258
-
259
- @mixin size($width, $height: $width)
260
- {
261
- width: $width;
262
- height: $height;
263
- }
264
-
265
- @mixin clearfix
266
- {
267
- &:after {
268
- content: "";
269
- display: table;
270
- clear: both;
271
- }
272
- }
273
-
274
- // Placeholder text
275
- @mixin placeholder($color: $input-color-placeholder) {
276
- // Firefox
277
- &::-moz-placeholder {
278
- color: $color;
279
- opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
280
- }
281
- &:-ms-input-placeholder { color: $color; } // Internet Explorer 10+
282
- &::-webkit-input-placeholder { color: $color; } // Safari and Chrome
283
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/assets/scss/_start.scss DELETED
@@ -1,4 +0,0 @@
1
- @import "vars";
2
- @import "colors";
3
- @import "mixins";
4
- @import "functions";
 
 
 
 
freemius/assets/scss/_vars.scss DELETED
@@ -1,6 +0,0 @@
1
- $is_production: true;
2
-
3
- $img_common: if($is_production == true, '//img.freemius.com', 'http://img.freemius:8080');
4
-
5
- $layout_width: 960px;
6
- $admin_mobile_max_width: 782px;
 
 
 
 
 
 
freemius/assets/scss/admin/_ajax-loader.scss DELETED
@@ -1,49 +0,0 @@
1
- $color: $wp-selected-color;
2
- $bkg-color: #fff;
3
- $size: 20;
4
-
5
- .fs-ajax-loader
6
- {
7
- position: relative;
8
- width: #{8*$size + 10}px;
9
- height: #{$size}px;
10
- margin: auto;
11
-
12
- .fs-ajax-loader-bar
13
- {
14
- position: absolute;
15
- top: 0;
16
- background-color: $color;
17
- width: #{$size}px;
18
- height: #{$size}px;
19
- @include animation-name(bounce_ajaxLoader);
20
- @include animation-duration(1.5s);
21
- @include animation-iteration-count(infinite);
22
- @include animation-direction(normal);
23
- @include transform(.3);
24
- }
25
-
26
- @for $i from 0 through 7
27
- {
28
- .fs-ajax-loader-bar-#{$i + 1}
29
- {
30
- left: #{$i*($size - 1)}px;
31
- @include animation-delay(#{0.6 + $i*0.15}s);
32
- }
33
- }
34
- }
35
-
36
- @include keyframes(bounce_ajaxLoader)
37
- {
38
- 0%
39
- {
40
- @include transform(scale(1));
41
- background-color: $color;
42
- }
43
-
44
- 100%
45
- {
46
- @include transform(scale(.3));
47
- background-color: $bkg-color;
48
- }
49
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/assets/scss/admin/_auto-install.scss DELETED
@@ -1,33 +0,0 @@
1
- .fs-modal-auto-install
2
- {
3
- $max-width: 300px;
4
-
5
- #request-filesystem-credentials-form
6
- {
7
- h2,
8
- .request-filesystem-credentials-action-buttons
9
- {
10
- display: none;
11
- }
12
-
13
- input[type=password],
14
- input[type=email],
15
- input[type=text]
16
- {
17
- -webkit-appearance: none;
18
- padding: 10px 10px 5px 10px;
19
- width: $max-width;
20
- max-width: 100%;
21
- }
22
-
23
- > div,
24
- label,
25
- fieldset
26
- {
27
- width: $max-width;
28
- max-width: 100%;
29
- margin: 0 auto;
30
- display: block;
31
- }
32
- }
33
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/assets/scss/admin/_deactivation-feedback.scss DELETED
@@ -1,55 +0,0 @@
1
- @import "../colors";
2
-
3
- .fs-modal.fs-modal-deactivation-feedback {
4
- .reason-input, .internal-message {
5
- margin: 3px 0 3px 22px;
6
-
7
- input, textarea {
8
- width: 100%;
9
- }
10
- }
11
-
12
- li.reason {
13
- &.has-internal-message .internal-message {
14
- border: 1px solid lighten($darkest-color, 80%);
15
- padding: 7px;
16
- display: none;
17
- }
18
-
19
- @media (max-width: 650px) {
20
- li.reason {
21
- margin-bottom: 10px;
22
-
23
- .reason-input, .internal-message {
24
- margin-left: 29px;
25
- }
26
-
27
- label {
28
- display: table;
29
-
30
- > span {
31
- display: table-cell;
32
- font-size: 1.3em;
33
- }
34
- }
35
- }
36
- }
37
- }
38
-
39
- .anonymous-feedback-label {
40
- float: left;
41
- }
42
-
43
- .fs-modal-panel {
44
- margin-top: 0 !important;
45
-
46
- h3 {
47
- margin-top: 0;
48
- line-height: 1.5em;
49
- }
50
- }
51
- }
52
-
53
- #the-list .deactivate > .fs-slug {
54
- display: none;
55
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/assets/scss/admin/_license-activation.scss DELETED
@@ -1,7 +0,0 @@
1
- .fs-modal.fs-modal-license-activation {
2
- .fs-modal-body {
3
- input.license_key {
4
- width: 100%;
5
- }
6
- }
7
- }
 
 
 
 
 
 
 
freemius/assets/scss/admin/_license-key-resend.scss DELETED
@@ -1,68 +0,0 @@
1
- .fs-modal.fs-modal-license-key-resend
2
- {
3
- .email-address-container
4
- {
5
- overflow: hidden;
6
- padding-right: 2px;
7
- }
8
-
9
- &.fs-freemium
10
- {
11
- input.email-address
12
- {
13
- width: 300px;
14
- }
15
-
16
- label
17
- {
18
- display: block;
19
- margin-bottom: 10px;
20
- }
21
- }
22
-
23
- &.fs-premium
24
- {
25
- input.email-address
26
- {
27
- width: 100%;
28
- }
29
-
30
- .button-container
31
- {
32
- float: right;
33
- margin-left: 7px;
34
-
35
- @media (max-width: 650px) {
36
- margin-top: 2px;
37
- }
38
- }
39
- }
40
- }
41
-
42
- .rtl
43
- {
44
- .fs-modal.fs-modal-license-key-resend
45
- {
46
- .fs-modal-body
47
- {
48
- .input-container > .email-address-container
49
- {
50
- padding-left: 2px;
51
- padding-right: 0;
52
- }
53
-
54
- .button-container
55
- {
56
- float: left;
57
- margin-right: 7px;
58
- margin-left: 0;
59
- }
60
- }
61
- }
62
- }
63
-
64
- a.show-license-resend-modal
65
- {
66
- margin-top: 4px;
67
- display: inline-block;
68
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/assets/scss/admin/_modal-common.scss DELETED
@@ -1,186 +0,0 @@
1
- @import "../colors";
2
- @import "../mixins";
3
-
4
- .fs-modal {
5
- position: fixed;
6
- overflow: auto;
7
- height: 100%;
8
- width: 100%;
9
- top: 0;
10
- z-index: 100000;
11
- display: none;
12
- background: rgba(0, 0, 0, 0.6);
13
-
14
- .fs-modal-dialog {
15
- background: transparent;
16
- position: absolute;
17
- left: 50%;
18
- margin-left: -298px;
19
- padding-bottom: 30px;
20
- top: -100%;
21
- z-index: 100001;
22
- width: 596px;
23
-
24
- @media (max-width: 650px) {
25
- margin-left: -50%;
26
- box-sizing: border-box;
27
- padding-left: 10px;
28
- padding-right: 10px;
29
- width: 100%;
30
-
31
- .fs-modal-panel > h3 > strong {
32
- font-size: 1.3em;
33
- }
34
- }
35
- }
36
-
37
- &.active {
38
- display: block;
39
-
40
- &:before {
41
- display: block;
42
- }
43
-
44
- .fs-modal-dialog {
45
- top: 10%;
46
- }
47
- }
48
-
49
- &.fs-success {
50
- .fs-modal-header {
51
- border-bottom-color: $wp-notice-success-dark-color;
52
- }
53
-
54
- .fs-modal-body {
55
- background-color: $wp-notice-success-color;
56
- }
57
- }
58
-
59
- &.fs-warn {
60
- .fs-modal-header {
61
- border-bottom-color: $wp-notice-warn-dark-color;
62
- }
63
-
64
- .fs-modal-body {
65
- background-color: $wp-notice-warn-color;
66
- }
67
- }
68
-
69
- &.fs-error {
70
- .fs-modal-header {
71
- border-bottom-color: $wp-notice-error-dark-color;
72
- }
73
-
74
- .fs-modal-body {
75
- background-color: $wp-notice-error-color;
76
- }
77
- }
78
-
79
-
80
- .fs-modal-body,
81
- .fs-modal-footer {
82
- border: 0;
83
- background: #fefefe;
84
- padding: 20px;
85
- }
86
-
87
- .fs-modal-header {
88
- border-bottom: #eeeeee solid 1px;
89
- background: #fbfbfb;
90
- padding: 15px 20px;
91
- position: relative;
92
- margin-bottom: -10px;
93
- // z-index: 2;
94
-
95
- h4 {
96
- margin: 0;
97
- padding: 0;
98
- text-transform: uppercase;
99
- font-size: 1.2em;
100
- font-weight: bold;
101
- color: #cacaca;
102
- text-shadow: 1px 1px 1px #fff;
103
- letter-spacing: 0.6px;
104
- -webkit-font-smoothing: antialiased;
105
- }
106
-
107
- .fs-close {
108
- position: absolute;
109
- right: 10px;
110
- top: 12px;
111
- cursor: pointer;
112
- color: #bbb;
113
- @include border-radius(20px);
114
- padding: 3px;
115
- @include transition(all 0.2s ease-in-out);
116
-
117
- &:hover {
118
- color: #fff;
119
- background: #aaa;
120
- }
121
- }
122
- }
123
-
124
- .fs-modal-body {
125
- border-bottom: 0;
126
-
127
- p {
128
- font-size: 14px;
129
- }
130
-
131
- h2 {
132
- font-size: 20px;
133
- line-height: 1.5em;
134
- }
135
-
136
- > div {
137
- margin-top: 10px;
138
-
139
- h2 {
140
- font-weight: bold;
141
- font-size: 20px;
142
- margin-top: 0;
143
- }
144
- }
145
- }
146
-
147
- .fs-modal-footer {
148
- border-top: #eeeeee solid 1px;
149
- text-align: right;
150
-
151
- > .button {
152
- margin: 0 7px;
153
-
154
- &:first-child {
155
- margin: 0;
156
- }
157
- }
158
- }
159
-
160
- .fs-modal-panel {
161
- > .notice.inline {
162
- margin: 0;
163
- display: none;
164
- }
165
-
166
- &:not(.active) {
167
- display: none;
168
- }
169
- }
170
- }
171
-
172
- .rtl
173
- {
174
- .fs-modal {
175
- .fs-modal-header {
176
- .fs-close {
177
- right: auto;
178
- left: 20px;
179
- }
180
- }
181
- }
182
- }
183
-
184
- body.has-fs-modal {
185
- overflow: hidden;
186
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/assets/scss/admin/account.scss DELETED
@@ -1,250 +0,0 @@
1
- @import "../start";
2
-
3
- #fs_account
4
- {
5
- .postbox,
6
- .widefat
7
- {
8
- max-width: 700px;
9
- }
10
-
11
- h3
12
- {
13
- font-size: 1.3em;
14
- padding: 12px 15px;
15
- margin: 0 0 12px 0;
16
- line-height: 1.4;
17
- border-bottom: 1px solid #F1F1F1;
18
- }
19
-
20
- i.dashicons
21
- {
22
- font-size: 1.2em;
23
- height: 1.2em;
24
- width: 1.2em;
25
- }
26
-
27
- .button
28
- {
29
- i.dashicons
30
- {
31
- vertical-align: middle;
32
- }
33
- }
34
-
35
- .fs-header-actions
36
- {
37
- position: absolute;
38
- top: 17px;
39
- right: 15px;
40
- font-size: 0.9em;
41
-
42
- ul
43
- {
44
- margin: 0;
45
- }
46
-
47
- li
48
- {
49
- form
50
- {
51
- display: inline-block;
52
- }
53
-
54
- float: left;
55
- a
56
- {
57
- text-decoration: none;
58
- }
59
- }
60
- }
61
- }
62
-
63
- #fs_account_details .button-group {
64
- float: right;
65
- }
66
-
67
- .rtl #fs_account .fs-header-actions
68
- {
69
- left: 15px;
70
- right: auto;
71
- }
72
-
73
- .fs-key-value-table
74
- {
75
- width: 100%;
76
-
77
- form
78
- {
79
- display: inline-block;
80
- }
81
-
82
- tr
83
- {
84
- td:first-child
85
- {
86
- nobr
87
- {
88
- font-weight: bold;
89
- }
90
-
91
- text-align: right;
92
-
93
- form
94
- {
95
- display: block;
96
- }
97
- }
98
-
99
- td.fs-right
100
- {
101
- text-align: right;
102
- }
103
-
104
- &.fs-odd
105
- {
106
- background: #ebebeb;
107
- }
108
- }
109
-
110
- td, th
111
- {
112
- padding: 10px;
113
- }
114
-
115
- code {
116
- line-height: 28px;
117
- }
118
-
119
- var, code, input[type="text"]
120
- {
121
- color: #0073AA;
122
- font-size: 16px;
123
- background: none;
124
- }
125
-
126
- input[type="text"] {
127
- width: 100%;
128
- font-weight: bold;
129
- }
130
- }
131
-
132
- label.fs-tag
133
- {
134
- background: #ffba00;
135
- color: #fff;
136
- display: inline-block;
137
- border-radius: 3px;
138
- padding: 5px;
139
- font-size: 11px;
140
- line-height: 11px;
141
- vertical-align: baseline;
142
-
143
- &.fs-warn
144
- {
145
- background: #ffba00;
146
- }
147
- &.fs-success
148
- {
149
- background: #46b450;
150
- }
151
- &.fs-error
152
- {
153
- background: #dc3232;
154
- }
155
- }
156
-
157
- #fs_addons
158
- {
159
- h3
160
- {
161
- border: none;
162
- margin-bottom: 0;
163
- padding: 4px 5px;
164
- }
165
-
166
- td
167
- {
168
- vertical-align: middle;
169
- }
170
-
171
- thead {
172
- white-space: nowrap;
173
- }
174
-
175
- td:first-child,
176
- th:first-child
177
- {
178
- text-align: left;
179
- font-weight: bold;
180
- }
181
- td:last-child,
182
- th:last-child
183
- {
184
- text-align: right;
185
- }
186
- th
187
- {
188
- font-weight: bold;
189
- }
190
- }
191
-
192
- #fs_billing_address {
193
- width: 100%;
194
-
195
- tr {
196
- td {
197
- width: 50%;
198
- padding: 5px;
199
- }
200
-
201
- &:first-of-type {
202
- td {
203
- padding-top: 0;
204
- }
205
- }
206
- }
207
-
208
- @mixin read-mode {
209
- border-color: transparent;
210
- color: #777;
211
- border-bottom: 1px dashed #ccc;
212
- padding-left: 0;
213
- background: none;
214
- }
215
-
216
- span {
217
- font-weight: bold;
218
- }
219
-
220
- input, select {
221
- @include placeholder(transparent);
222
-
223
- display: block;
224
- width: 100%;
225
- margin-top: 5px;
226
-
227
- &.fs-read-mode {
228
- @include read-mode();
229
- }
230
- }
231
-
232
-
233
- &.fs-read-mode {
234
- td span {
235
- display: none;
236
- }
237
-
238
- input, select
239
- {
240
- @include read-mode();
241
- @include placeholder(#ccc);
242
- }
243
- }
244
-
245
-
246
- button {
247
- display: block;
248
- width: 100%;
249
- }
250
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/assets/scss/admin/add-ons.scss DELETED
@@ -1,449 +0,0 @@
1
- @import "../start";
2
-
3
- #fs_addons
4
- {
5
- .fs-cards-list
6
- {
7
- list-style: none;
8
-
9
- .fs-card
10
- {
11
- float: left;
12
- // height: 185px; // With reviews/ratings
13
- height: 152px;
14
- width: 310px;
15
- padding: 0;
16
- margin: 0 0 30px 30px;
17
- font-size: 14px;
18
- list-style: none;
19
- border: 1px solid #ddd;
20
- cursor: pointer;
21
- position: relative;
22
-
23
- .fs-overlay
24
- {
25
- position: absolute;
26
- left: 0;
27
- right: 0;
28
- bottom: 0;
29
- top: 0;
30
- z-index: 9;
31
- }
32
-
33
- .fs-inner
34
- {
35
- background-color: #fff;
36
- overflow: hidden;
37
- height: 100%;
38
- position: relative;
39
-
40
- ul
41
- {
42
- @include transition(all, 0.15s);
43
- left: 0;
44
- right: 0;
45
- top: 0;
46
- position: absolute;
47
- }
48
-
49
- li
50
- {
51
- list-style: none;
52
- line-height: 18px;
53
- padding: 0 15px;
54
- width: 100%;
55
- display: block;
56
- @include box-sizing(border-box);
57
- }
58
-
59
- .fs-card-banner
60
- {
61
- padding: 0;
62
- margin: 0;
63
- line-height: 0;
64
- display: block;
65
- height: 100px;
66
- background-repeat: repeat-x;
67
- background-size: 100% 100%;
68
- @include transition(all, 0.15s);
69
- }
70
-
71
- .fs-title
72
- {
73
- margin: 10px 0 0 0;
74
- height: 18px;
75
- overflow: hidden;
76
- color: #000;
77
- white-space: nowrap;
78
- text-overflow: ellipsis;
79
- font-weight: bold;
80
- }
81
-
82
- .fs-offer
83
- {
84
- font-size: 0.9em;
85
- }
86
-
87
- .fs-description
88
- {
89
- background-color: #f9f9f9;
90
- padding: 10px 15px 100px 15px;
91
- border-top: 1px solid #eee;
92
- margin: 0 0 10px 0;
93
- color: #777;
94
- }
95
-
96
- .fs-tag
97
- {
98
- position: absolute;
99
- top: 10px;
100
- right: 0px;
101
- background: greenyellow;
102
- display: block;
103
- padding: 2px 10px;
104
- @include box-shadow(1px 1px 1px rgba(0,0,0,0.3));
105
- text-transform: uppercase;
106
- font-size: 0.9em;
107
- font-weight: bold;
108
- }
109
-
110
- .fs-cta
111
- {
112
- .button
113
- {
114
- position: absolute;
115
- top: 112px;
116
- right: 10px;
117
- }
118
- }
119
- }
120
-
121
- @media screen and (min-width: 960px) {
122
- &:hover
123
- {
124
- .fs-overlay
125
- {
126
- border: 2px solid $fms-link-color;
127
- margin-left: -1px;
128
- margin-top: -1px;
129
- }
130
-
131
- .fs-inner
132
- {
133
- ul
134
- {
135
- top: -100px;
136
- }
137
-
138
- .fs-card-banner
139
- {
140
- // background-position: 50% -100px;
141
- }
142
-
143
- .fs-title,
144
- .fs-offer
145
- {
146
- color: $fms-link-color;
147
- }
148
- }
149
- }
150
- }
151
- }
152
- }
153
- }
154
-
155
- #TB_window
156
- {
157
- &, iframe
158
- {
159
- width: 772px !important;
160
- }
161
- }
162
-
163
- #plugin-information
164
- {
165
- #section-description
166
- {
167
- h2, h3, p, b, i, blockquote, li, ul, ol
168
- {
169
- clear: none;
170
- }
171
-
172
- .fs-selling-points
173
- {
174
- padding-bottom: 10px;
175
- border-bottom: 1px solid #ddd;
176
-
177
- ul
178
- {
179
- margin: 0;
180
-
181
- li
182
- {
183
- padding: 0;
184
- list-style: none outside none;
185
-
186
- i.dashicons
187
- {
188
- color: $fs-logo-green-color;
189
- font-size: 3em;
190
- vertical-align: middle;
191
- line-height: 30px;
192
- float: left;
193
- margin: 0 0 0 -15px;
194
- }
195
-
196
- h3
197
- {
198
- margin: 1em 30px !important;
199
- }
200
- }
201
- }
202
- }
203
-
204
- .fs-screenshots
205
- {
206
- @include clearfix();
207
- ul
208
- {
209
- list-style: none;
210
- margin: 0;
211
-
212
- li
213
- {
214
- width: 225px;
215
- height: 225px;
216
- float: left;
217
- margin-bottom: 20px;
218
- @include box-sizing(content-box);
219
-
220
- a
221
- {
222
- display: block;
223
- width: 100%;
224
- height: 100%;
225
- border: 1px solid;
226
- @include box-shadow(1px 1px 1px rgba(0, 0, 0, 0.2));
227
- background-size: cover;
228
- }
229
-
230
- &.odd
231
- {
232
- margin-right: 20px;
233
- }
234
- }
235
- }
236
- }
237
- }
238
-
239
- .plugin-information-pricing
240
- {
241
- $pricing_color: #FFFEEC;
242
- $borders_color: #DDD;
243
- margin: -16px;
244
- // padding: 20px;
245
- border-bottom: 1px solid $borders_color;
246
-
247
- .fs-plan
248
- {
249
-
250
- h3
251
- {
252
- margin-top: 0;
253
- padding: 20px;
254
- font-size: 16px;
255
- }
256
-
257
- .nav-tab-wrapper
258
- {
259
- border-bottom: 1px solid $borders_color;
260
-
261
- .nav-tab
262
- {
263
- cursor: pointer;
264
- position: relative;
265
- padding: 0 10px;
266
- font-size: 0.9em;
267
-
268
- label
269
- {
270
- text-transform: uppercase;
271
- color: green;
272
- background: greenyellow;
273
- position: absolute;
274
- left: -1px;
275
- right: -1px;
276
- bottom: 100%;
277
- border: 1px solid darkgreen;
278
- padding: 2px;
279
- text-align: center;
280
- font-size: 0.9em;
281
- line-height: 1em;
282
- }
283
-
284
- &.nav-tab-active
285
- {
286
- cursor: default;
287
- background: $pricing_color;
288
- border-bottom-color: $pricing_color;
289
- }
290
- }
291
- }
292
-
293
- &.fs-single-cycle
294
- {
295
- h3
296
- {
297
- background: $pricing_color;
298
- margin: 0;
299
- padding-bottom: 0;
300
- color: #0073aa;
301
- }
302
-
303
- .nav-tab-wrapper,
304
- .fs-billing-frequency
305
- {
306
- display: none;
307
- }
308
- }
309
-
310
- .fs-pricing-body
311
- {
312
- background: $pricing_color;
313
- padding: 20px;
314
- }
315
-
316
- .button
317
- {
318
- width: 100%;
319
- text-align: center;
320
- font-weight: bold;
321
- text-transform: uppercase;
322
- font-size: 1.1em;
323
- }
324
-
325
- label
326
- {
327
- white-space: nowrap;
328
- }
329
-
330
- var {
331
- font-style: normal;
332
- }
333
-
334
- .fs-billing-frequency,
335
- .fs-annual-discount
336
- {
337
- text-align: center;
338
- display: block;
339
- font-weight: bold;
340
- margin-bottom: 10px;
341
- text-transform: uppercase;
342
- background: #F3F3F3;
343
- padding: 2px;
344
- border: 1px solid #ccc;
345
- }
346
-
347
- .fs-annual-discount
348
- {
349
- text-transform: none;
350
- color: green;
351
- background: greenyellow;
352
- }
353
-
354
- ul.fs-trial-terms
355
- {
356
- font-size: 0.9em;
357
-
358
- i
359
- {
360
- float: left;
361
- margin: 0 0 0 -15px;
362
- }
363
-
364
- li
365
- {
366
- margin: 10px 0 0 0;
367
- }
368
- }
369
- }
370
- }
371
-
372
- #section-features
373
- {
374
- .fs-features
375
- {
376
- margin: -20px -26px;
377
- }
378
-
379
- table
380
- {
381
- width: 100%;
382
- border-spacing: 0;
383
- border-collapse: separate;
384
-
385
- thead
386
- {
387
- th
388
- {
389
- padding: 10px 0;
390
- }
391
-
392
- .fs-price
393
- {
394
- color: $fs-logo-green-color;
395
- font-weight: normal;
396
- display: block;
397
- text-align: center;
398
- }
399
- }
400
-
401
- tbody
402
- {
403
- td
404
- {
405
- border-top: 1px solid #ccc;
406
- padding: 10px 0;
407
- text-align: center;
408
- width: 100px;
409
- color: $fs-logo-green-color;
410
-
411
- &:first-child
412
- {
413
- text-align: left;
414
- width: auto;
415
- color: inherit;
416
- padding-left: 26px;
417
- }
418
- }
419
- tr.fs-odd
420
- {
421
- td
422
- {
423
- background: #fefefe;
424
- }
425
- }
426
- }
427
- }
428
-
429
- .dashicons-yes
430
- {
431
- width: 30px;
432
- height: 30px;
433
- font-size: 30px;
434
- }
435
- }
436
- }
437
-
438
- @media screen and (max-width: 961px) {
439
- #fs_addons
440
- {
441
- .fs-cards-list
442
- {
443
- .fs-card
444
- {
445
- height: 265px;
446
- }
447
- }
448
- }
449
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/assets/scss/admin/checkout.scss DELETED
@@ -1,5 +0,0 @@
1
- @media screen and (max-width: 782px) {
2
- #wpbody-content {
3
- padding-bottom: 0 !important;
4
- }
5
- }
 
 
 
 
 
freemius/assets/scss/admin/common.scss DELETED
@@ -1,173 +0,0 @@
1
- @import "../start";
2
-
3
- #iframe {
4
- line-height: 0;
5
- font-size: 0;
6
- }
7
-
8
- .fs-full-size-wrapper {
9
- margin: 0 0 -65px -20px;
10
-
11
- @media (max-width: $admin_mobile_max_width) {
12
- margin: 0 0 -65px -10px;
13
- }
14
- }
15
-
16
- .fs-notice
17
- {
18
- position: relative;
19
-
20
- &.fs-has-title
21
- {
22
- margin-bottom: 30px !important;
23
- }
24
-
25
- &.success
26
- {
27
- color: green;
28
- // font-weight: normal;
29
- }
30
-
31
- &.promotion
32
- {
33
- border-color: $fs-notice-promotion-border-color !important;
34
- background-color: $fs-notice-promotion-bkg !important;
35
- }
36
-
37
- .fs-notice-body
38
- {
39
- margin: .5em 0;
40
- padding: 2px;
41
- }
42
-
43
- .fs-close
44
- {
45
- // position: absolute;
46
- // top: 2px;
47
- // bottom: 2px;
48
- // right: 2px;
49
- // min-width: 100px;
50
- // text-align: center;
51
- // padding-right: 2px;
52
- cursor: pointer;
53
- color: #aaa;
54
- float: right;
55
-
56
- &:hover
57
- {
58
- color: #666;
59
- // background: #A9A9A9;
60
- }
61
-
62
- > *
63
- {
64
- margin-top: 7px;
65
- display: inline-block;
66
- }
67
- }
68
-
69
- label.fs-plugin-title
70
- {
71
- background: rgba(0, 0, 0, 0.3);
72
- color: #fff;
73
- padding: 2px 10px;
74
- position: absolute;
75
- top: 100%;
76
- bottom: auto;
77
- right: auto;
78
- @include border-radius(0 0 3px 3px);
79
- left: 10px;
80
- font-size: 12px;
81
- font-weight: bold;
82
- cursor: auto;
83
- }
84
- }
85
-
86
- .rtl .fs-notice
87
- {
88
- .fs-close
89
- {
90
- // left: 2px;
91
- // right: auto;
92
- // padding-right: 0;
93
- // padding-left: 2px;
94
- float: left;
95
- }
96
- }
97
-
98
- .fs-secure-notice
99
- {
100
- position: fixed;
101
- top: 32px;
102
- left: 160px;
103
- right: 0;
104
- background: rgb(235, 253, 235);
105
- padding: 10px 20px;
106
- color: green;
107
- z-index: 9999;
108
- box-shadow: 0px 2px 2px rgba(6, 113, 6, 0.3);
109
- @include opacity(0.95);
110
-
111
- &:hover
112
- {
113
- @include opacity(1);
114
- }
115
- }
116
-
117
- @media screen and (max-width: 960px) {
118
- .fs-secure-notice
119
- {
120
- left: 36px;
121
- }
122
- }
123
-
124
- @media screen and (max-width:500px) {
125
- #fs_promo_tab {
126
- display: none;
127
- }
128
- }
129
-
130
- @media screen and (max-width: 782px) {
131
- .fs-secure-notice
132
- {
133
- left: 0;
134
- top: 46px;
135
- text-align: center;
136
- }
137
- }
138
-
139
- span.fs-submenu-item.fs-sub:before
140
- {
141
- // Add small arrow.
142
- content: '\21B3';
143
- padding: 0 5px;
144
- }
145
-
146
- .rtl
147
- {
148
- span.fs-submenu-item.fs-sub:before
149
- {
150
- // Add small RTL arrow.
151
- content: '\21B2';
152
- }
153
- }
154
-
155
- .fs-submenu-item
156
- {
157
- &.pricing
158
- {
159
- &.upgrade-mode
160
- {
161
- color: greenyellow;
162
- }
163
-
164
- &.trial-mode
165
- {
166
- color: #83e2ff;
167
- }
168
- }
169
- }
170
-
171
- #adminmenu .update-plugins.fs-trial {
172
- background-color: #00b9eb;
173
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/assets/scss/admin/connect.scss DELETED
@@ -1,471 +0,0 @@
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/debug.scss DELETED
@@ -1,135 +0,0 @@
1
- @import "../start";
2
-
3
- .switch
4
- {
5
- position: relative;
6
- display: inline-block;
7
- font-size: 1.6em;
8
- font-weight: bold;
9
- color: #ccc;
10
- text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.8);
11
- height: 18px;
12
- padding: 6px 6px 5px 6px;
13
- border: 1px solid #ccc;
14
- border: 1px solid rgba(0, 0, 0, 0.2);
15
- border-radius: 4px;
16
- background: #ececec;
17
- box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.1), inset 0px 1px 3px 0px rgba(0, 0, 0, 0.1);
18
- cursor: pointer;
19
-
20
- span
21
- {
22
- display: inline-block; width: 35px;
23
- text-transform: uppercase;
24
-
25
- &.on
26
- {
27
- color: $button-primary-bkg;
28
- }
29
- }
30
-
31
- .toggle
32
- {
33
- position: absolute;
34
- top: 1px;
35
- width: 37px;
36
- height: 25px;
37
- border: 1px solid #ccc;
38
- border: 1px solid rgba(0, 0, 0, 0.3);
39
- border-radius: 4px;
40
- background: #fff;
41
- background: -moz-linear-gradient(top, #ececec 0%, #fff 100%);
42
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ececec), color-stop(100%, #fff));
43
- background: -webkit-linear-gradient(top, #ececec 0%, #fff 100%);
44
- background: -o-linear-gradient(top, #ececec 0%, #fff 100%);
45
- background: -ms-linear-gradient(top, #ececec 0%, #fff 100%);
46
- background: linear-gradient(top, #ececec 0%, #fff 100%);
47
- box-shadow: inset 0px 1px 0px 0px rgba(255, 255, 255, 0.5);
48
- z-index: 999;
49
- @include transition(all 0.15s ease-in-out);
50
- }
51
-
52
- &.on .toggle
53
- {
54
- left: 2%;
55
- }
56
- &.off .toggle
57
- {
58
- left: 54%;
59
- }
60
-
61
- /* Round switch */
62
- &.round
63
- {
64
- padding: 0px 20px;
65
- border-radius: 40px;
66
-
67
- .toggle
68
- {
69
- border-radius: 40px;
70
- width: 14px;
71
- height: 14px;
72
- }
73
-
74
- &.on .toggle
75
- {
76
- left: 3%;
77
- background: $button-primary-bkg;
78
- }
79
- &.off .toggle
80
- {
81
- left: 58%;
82
- }
83
- }
84
- }
85
-
86
- .switch-label
87
- {
88
- font-size: 20px;
89
- line-height: 31px;
90
- margin: 0 5px;
91
- }
92
-
93
- #fs_log_book {
94
- table {
95
- font-family: Consolas,Monaco,monospace;
96
- font-size: 12px;
97
-
98
- th {
99
- color: #ccc;
100
- }
101
-
102
- tr {
103
- background: #232525;
104
-
105
- &.alternate {
106
- background: #2b2b2b;
107
- }
108
-
109
- td {
110
- &.fs-col--logger {
111
- color: #5a7435;
112
- }
113
- &.fs-col--type {
114
- color: #ffc861;
115
- }
116
- &.fs-col--function {
117
- color: #a7b7b1;
118
- font-weight: bold;
119
- }
120
- &.fs-col--message {
121
- &, a
122
- {
123
- color: #9a73ac !important;
124
- }
125
- }
126
- &.fs-col--file {
127
- color: #d07922;
128
- }
129
- &.fs-col--timestamp {
130
- color: #6596be;
131
- }
132
- }
133
- }
134
- }
135
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/assets/scss/admin/dialog-boxes.scss DELETED
@@ -1,7 +0,0 @@
1
- @import "../start";
2
- @import "modal-common";
3
- @import "deactivation-feedback";
4
- @import "license-activation";
5
- @import "license-key-resend";
6
- @import "ajax-loader";
7
- @import "auto-install";
 
 
 
 
 
 
 
freemius/config.php DELETED
@@ -1,325 +0,0 @@
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.4
7
- */
8
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
-
12
- if (!defined('WP_FS__SLUG')) {
13
- define('WP_FS__SLUG', 'freemius');
14
- }
15
- if (!defined('WP_FS__DEV_MODE')) {
16
- define('WP_FS__DEV_MODE', false);
17
- }
18
-
19
- #--------------------------------------------------------------------------------
20
- #region API Connectivity Issues Simulation
21
- #--------------------------------------------------------------------------------
22
-
23
- if (!defined('WP_FS__SIMULATE_NO_API_CONNECTIVITY')) {
24
- define('WP_FS__SIMULATE_NO_API_CONNECTIVITY', false);
25
- }
26
- if (!defined('WP_FS__SIMULATE_NO_CURL')) {
27
- define('WP_FS__SIMULATE_NO_CURL', false);
28
- }
29
- if (!defined('WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE')) {
30
- define('WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', false);
31
- }
32
- if (!defined('WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL')) {
33
- define('WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', false);
34
- }
35
- if (WP_FS__SIMULATE_NO_CURL) {
36
- define('FS_SDK__SIMULATE_NO_CURL', true);
37
- }
38
- if (WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE) {
39
- define('FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', true);
40
- }
41
- if (WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL) {
42
- define('FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', true);
43
- }
44
-
45
- #endregion
46
-
47
- if (!defined('WP_FS__SIMULATE_FREEMIUS_OFF')) {
48
- define('WP_FS__SIMULATE_FREEMIUS_OFF', false);
49
- }
50
-
51
- if (!defined('WP_FS__PING_API_ON_IP_OR_HOST_CHANGES')) {
52
- /**
53
- * @since 1.1.7.3
54
- * @author Vova Feldman (@svovaf)
55
- *
56
- * I'm not sure if shared servers periodically change IP, or the subdomain of the
57
- * admin dashboard. Also, I've seen sites that have strange loop of switching
58
- * between domains on a daily basis. Therefore, to eliminate the risk of
59
- * multiple unwanted connectivity test pings, temporary ignore domain or
60
- * server IP changes.
61
- */
62
- define('WP_FS__PING_API_ON_IP_OR_HOST_CHANGES', false);
63
- }
64
-
65
- /**
66
- * If your dev environment supports custom public network IP setup
67
- * like VVV, please update WP_FS__LOCALHOST_IP with your public IP
68
- * and uncomment it during dev.
69
- */
70
- if (!defined('WP_FS__LOCALHOST_IP')) {
71
- // VVV default public network IP.
72
- define('WP_FS__VVV_DEFAULT_PUBLIC_IP', '192.168.50.4');
73
-
74
- // define( 'WP_FS__LOCALHOST_IP', WP_FS__VVV_DEFAULT_PUBLIC_IP );
75
- }
76
-
77
- /**
78
- * If true and running with secret key, the opt-in process
79
- * will skip the email activation process which is invoked
80
- * when the email of the context user already exist in Freemius
81
- * database (as a security precaution, to prevent sharing user
82
- * secret with unauthorized entity).
83
- *
84
- * IMPORTANT:
85
- * AS A SECURITY PRECAUTION, WE VALIDATE THE TIMESTAMP OF THE OPT-IN REQUEST.
86
- * THEREFORE, MAKE SURE THAT WHEN USING THIS PARAMETER,YOUR TESTING ENVIRONMENT'S
87
- * CLOCK IS SYNCED.
88
- */
89
- if (!defined('WP_FS__SKIP_EMAIL_ACTIVATION')) {
90
- define('WP_FS__SKIP_EMAIL_ACTIVATION', false);
91
- }
92
-
93
-
94
- #--------------------------------------------------------------------------------
95
- #region Directories
96
- #--------------------------------------------------------------------------------
97
-
98
- if (!defined('WP_FS__DIR')) {
99
- define('WP_FS__DIR', dirname(__FILE__));
100
- }
101
- if (!defined('WP_FS__DIR_INCLUDES')) {
102
- define('WP_FS__DIR_INCLUDES', WP_FS__DIR . '/includes');
103
- }
104
- if (!defined('WP_FS__DIR_TEMPLATES')) {
105
- define('WP_FS__DIR_TEMPLATES', WP_FS__DIR . '/templates');
106
- }
107
- if (!defined('WP_FS__DIR_ASSETS')) {
108
- define('WP_FS__DIR_ASSETS', WP_FS__DIR . '/assets');
109
- }
110
- if (!defined('WP_FS__DIR_CSS')) {
111
- define('WP_FS__DIR_CSS', WP_FS__DIR_ASSETS . '/css');
112
- }
113
- if (!defined('WP_FS__DIR_JS')) {
114
- define('WP_FS__DIR_JS', WP_FS__DIR_ASSETS . '/js');
115
- }
116
- if (!defined('WP_FS__DIR_IMG')) {
117
- define('WP_FS__DIR_IMG', WP_FS__DIR_ASSETS . '/img');
118
- }
119
- if (!defined('WP_FS__DIR_SDK')) {
120
- define('WP_FS__DIR_SDK', WP_FS__DIR_INCLUDES . '/sdk');
121
- }
122
-
123
- #endregion
124
-
125
- /**
126
- * Domain / URL / Address
127
- */
128
- define('WP_FS__DOMAIN_PRODUCTION', 'wp.freemius.com');
129
- define('WP_FS__ADDRESS_PRODUCTION', 'https://' . WP_FS__DOMAIN_PRODUCTION);
130
-
131
- if (!defined('WP_FS__DOMAIN_LOCALHOST')) {
132
- define('WP_FS__DOMAIN_LOCALHOST', 'wp.freemius');
133
- }
134
- if (!defined('WP_FS__ADDRESS_LOCALHOST')) {
135
- define('WP_FS__ADDRESS_LOCALHOST', 'http://' . WP_FS__DOMAIN_LOCALHOST . ':8080');
136
- }
137
-
138
- if (!defined('WP_FS__TESTING_DOMAIN')) {
139
- define('WP_FS__TESTING_DOMAIN', 'fswp');
140
- }
141
-
142
- #--------------------------------------------------------------------------------
143
- #region HTTP
144
- #--------------------------------------------------------------------------------
145
-
146
- if (!defined('WP_FS__IS_HTTP_REQUEST')) {
147
- define('WP_FS__IS_HTTP_REQUEST', isset($_SERVER['HTTP_HOST']));
148
- }
149
-
150
- if (!defined('WP_FS__IS_HTTPS')) {
151
- define('WP_FS__IS_HTTPS', ( WP_FS__IS_HTTP_REQUEST &&
152
- // Checks if CloudFlare's HTTPS (Flexible SSL support).
153
- isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&
154
- 'https' === strtolower($_SERVER['HTTP_X_FORWARDED_PROTO'])
155
- ) ||
156
- // Check if HTTPS request.
157
- ( isset($_SERVER['HTTPS']) && 'on' == $_SERVER['HTTPS'] ) ||
158
- ( isset($_SERVER['SERVER_PORT']) && 443 == $_SERVER['SERVER_PORT'] )
159
- );
160
- }
161
-
162
- if (!defined('WP_FS__IS_POST_REQUEST')) {
163
- define('WP_FS__IS_POST_REQUEST', ( WP_FS__IS_HTTP_REQUEST &&
164
- strtoupper($_SERVER['REQUEST_METHOD']) == 'POST'));
165
- }
166
-
167
- if (!defined('WP_FS__REMOTE_ADDR')) {
168
- define('WP_FS__REMOTE_ADDR', fs_get_ip());
169
- }
170
-
171
- if (!defined('WP_FS__IS_LOCALHOST')) {
172
- if (defined('WP_FS__LOCALHOST_IP')) {
173
- define('WP_FS__IS_LOCALHOST', ( WP_FS__LOCALHOST_IP === WP_FS__REMOTE_ADDR));
174
- } else {
175
- define('WP_FS__IS_LOCALHOST', WP_FS__IS_HTTP_REQUEST &&
176
- is_string(WP_FS__REMOTE_ADDR) &&
177
- ( substr(WP_FS__REMOTE_ADDR, 0, 4) === '127.' ||
178
- WP_FS__REMOTE_ADDR === '::1' )
179
- );
180
- }
181
- }
182
-
183
- if (!defined('WP_FS__IS_LOCALHOST_FOR_SERVER')) {
184
- define('WP_FS__IS_LOCALHOST_FOR_SERVER', (!WP_FS__IS_HTTP_REQUEST ||
185
- false !== strpos($_SERVER['HTTP_HOST'], 'localhost')));
186
- }
187
-
188
- #endregion
189
-
190
- if (!defined('WP_FS__IS_PRODUCTION_MODE')) {
191
- // By default, run with Freemius production servers.
192
- define('WP_FS__IS_PRODUCTION_MODE', true);
193
- }
194
-
195
- if (!defined('WP_FS__ADDRESS')) {
196
- define('WP_FS__ADDRESS', ( WP_FS__IS_PRODUCTION_MODE ? WP_FS__ADDRESS_PRODUCTION : WP_FS__ADDRESS_LOCALHOST));
197
- }
198
-
199
-
200
- #--------------------------------------------------------------------------------
201
- #region API
202
- #--------------------------------------------------------------------------------
203
-
204
- if (!defined('WP_FS__API_ADDRESS_LOCALHOST')) {
205
- define('WP_FS__API_ADDRESS_LOCALHOST', 'http://api.freemius:8080');
206
- }
207
- if (!defined('WP_FS__API_SANDBOX_ADDRESS_LOCALHOST')) {
208
- define('WP_FS__API_SANDBOX_ADDRESS_LOCALHOST', 'http://sandbox-api.freemius:8080');
209
- }
210
-
211
- // Set API address for local testing.
212
- if (!WP_FS__IS_PRODUCTION_MODE) {
213
- if (!defined('FS_API__ADDRESS')) {
214
- define('FS_API__ADDRESS', WP_FS__API_ADDRESS_LOCALHOST);
215
- }
216
- if (!defined('FS_API__SANDBOX_ADDRESS')) {
217
- define('FS_API__SANDBOX_ADDRESS', WP_FS__API_SANDBOX_ADDRESS_LOCALHOST);
218
- }
219
- }
220
-
221
- #endregion
222
- #--------------------------------------------------------------------------------
223
- #region Checkout
224
- #--------------------------------------------------------------------------------
225
-
226
- if (!defined('FS_CHECKOUT__ADDRESS_PRODUCTION')) {
227
- define('FS_CHECKOUT__ADDRESS_PRODUCTION', 'https://checkout.freemius.com');
228
- }
229
-
230
- if (!defined('FS_CHECKOUT__ADDRESS_LOCALHOST')) {
231
- define('FS_CHECKOUT__ADDRESS_LOCALHOST', 'http://checkout.freemius:8080');
232
- }
233
-
234
- if (!defined('FS_CHECKOUT__ADDRESS')) {
235
- define('FS_CHECKOUT__ADDRESS', ( WP_FS__IS_PRODUCTION_MODE ? FS_CHECKOUT__ADDRESS_PRODUCTION : FS_CHECKOUT__ADDRESS_LOCALHOST));
236
- }
237
-
238
- #endregion
239
-
240
- define('WP_FS___OPTION_PREFIX', 'fs' . ( WP_FS__IS_PRODUCTION_MODE ? '' : '_dbg' ) . '_');
241
-
242
- if (!defined('WP_FS__ACCOUNTS_OPTION_NAME')) {
243
- define('WP_FS__ACCOUNTS_OPTION_NAME', WP_FS___OPTION_PREFIX . 'accounts');
244
- }
245
- if (!defined('WP_FS__API_CACHE_OPTION_NAME')) {
246
- define('WP_FS__API_CACHE_OPTION_NAME', WP_FS___OPTION_PREFIX . 'api_cache');
247
- }
248
- define('WP_FS__OPTIONS_OPTION_NAME', WP_FS___OPTION_PREFIX . 'options');
249
-
250
- /**
251
- * Module types
252
- *
253
- * @since 1.2.2
254
- */
255
- define('WP_FS__MODULE_TYPE_PLUGIN', 'plugin');
256
- define('WP_FS__MODULE_TYPE_THEME', 'theme');
257
-
258
- /**
259
- * Billing Frequencies
260
- */
261
- define('WP_FS__PERIOD_ANNUALLY', 'annual');
262
- define('WP_FS__PERIOD_MONTHLY', 'monthly');
263
- define('WP_FS__PERIOD_LIFETIME', 'lifetime');
264
-
265
- /**
266
- * Plans
267
- */
268
- define('WP_FS__PLAN_DEFAULT_PAID', false);
269
- define('WP_FS__PLAN_FREE', 'free');
270
- define('WP_FS__PLAN_TRIAL', 'trial');
271
-
272
- /**
273
- * Times in seconds
274
- */
275
- if (!defined('WP_FS__TIME_5_MIN_IN_SEC')) {
276
- define('WP_FS__TIME_5_MIN_IN_SEC', 300);
277
- }
278
- if (!defined('WP_FS__TIME_10_MIN_IN_SEC')) {
279
- define('WP_FS__TIME_10_MIN_IN_SEC', 600);
280
- }
281
- // define( 'WP_FS__TIME_15_MIN_IN_SEC', 900 );
282
- if (!defined('WP_FS__TIME_24_HOURS_IN_SEC')) {
283
- define('WP_FS__TIME_24_HOURS_IN_SEC', 86400);
284
- }
285
-
286
- #--------------------------------------------------------------------------------
287
- #region Debugging
288
- #--------------------------------------------------------------------------------
289
-
290
- if (!defined('WP_FS__DEBUG_SDK')) {
291
- $debug_mode = get_option('fs_debug_mode', null);
292
-
293
- if ($debug_mode === null) {
294
- $debug_mode = false;
295
- add_option('fs_debug_mode', $debug_mode);
296
- }
297
-
298
- define('WP_FS__DEBUG_SDK', is_numeric($debug_mode) ? ( 0 < $debug_mode ) : WP_FS__DEV_MODE );
299
- }
300
-
301
- if (!defined('WP_FS__ECHO_DEBUG_SDK')) {
302
- define('WP_FS__ECHO_DEBUG_SDK', WP_FS__DEV_MODE && !empty($_GET['fs_dbg_echo']));
303
- }
304
- if (!defined('WP_FS__LOG_DATETIME_FORMAT')) {
305
- define('WP_FS__LOG_DATETIME_FORMAT', 'Y-m-d H:i:s');
306
- }
307
- if (!defined('FS_API__LOGGER_ON')) {
308
- define('FS_API__LOGGER_ON', WP_FS__DEBUG_SDK);
309
- }
310
-
311
- if (WP_FS__ECHO_DEBUG_SDK) {
312
- error_reporting(E_ALL);
313
- }
314
-
315
- #endregion
316
-
317
- if (!defined('WP_FS__SCRIPT_START_TIME')) {
318
- define('WP_FS__SCRIPT_START_TIME', time());
319
- }
320
- if (!defined('WP_FS__DEFAULT_PRIORITY')) {
321
- define('WP_FS__DEFAULT_PRIORITY', 10);
322
- }
323
- if (!defined('WP_FS__LOWEST_PRIORITY')) {
324
- define('WP_FS__LOWEST_PRIORITY', 999999999);
325
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/class-freemius-abstract.php DELETED
@@ -1,540 +0,0 @@
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
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- /**
12
- * - Each instance of Freemius class represents a single plugin
13
- * install by a single user (the installer of the plugin).
14
- *
15
- * - Each website can only have one install of the same plugin.
16
- *
17
- * - Install entity is only created after a user connects his account with Freemius.
18
- *
19
- * Class Freemius_Abstract
20
- */
21
- abstract class Freemius_Abstract {
22
- #----------------------------------------------------------------------------------
23
- #region Identity
24
- #----------------------------------------------------------------------------------
25
- /**
26
- * Check if user has connected his account (opted-in).
27
- *
28
- * Note:
29
- * If the user opted-in and opted-out on a later stage,
30
- * this will still return true. If you want to check if the
31
- * user is currently opted-in, use:
32
- * `$fs->is_registered() && $fs->is_tracking_allowed()`
33
- *
34
- * @since 1.0.1
35
- * @return bool
36
- */
37
- abstract function is_registered();
38
- /**
39
- * Check if the user skipped connecting the account with Freemius.
40
- *
41
- * @since 1.0.7
42
- *
43
- * @return bool
44
- */
45
- abstract function is_anonymous();
46
- /**
47
- * Check if the user currently in activation mode.
48
- *
49
- * @since 1.0.7
50
- *
51
- * @return bool
52
- */
53
- abstract function is_activation_mode();
54
-
55
- #endregion
56
- #----------------------------------------------------------------------------------
57
- #region Usage Tracking
58
- #----------------------------------------------------------------------------------
59
- /**
60
- * Returns TRUE if the user opted-in and didn't disconnect (opt-out).
61
- *
62
- * @author Leo Fajardo (@leorw)
63
- * @since 1.2.1.5
64
- *
65
- * @return bool
66
- */
67
- abstract function is_tracking_allowed();
68
- /**
69
- * Returns TRUE if the user never opted-in or manually opted-out.
70
- *
71
- * @author Vova Feldman (@svovaf)
72
- * @since 1.2.1.5
73
- *
74
- * @return bool
75
- */
76
- function is_tracking_prohibited() {
77
- return !$this->is_registered() || !$this->is_tracking_allowed();
78
- }
79
- /**
80
- * Opt-out from usage tracking.
81
- *
82
- * Note: This will not delete the account information but will stop all tracking.
83
- *
84
- * Returns:
85
- * 1. FALSE - If the user never opted-in.
86
- * 2. TRUE - If successfully opted-out.
87
- * 3. object - API Result on failure.
88
- *
89
- * @author Leo Fajardo (@leorw)
90
- * @since 1.2.1.5
91
- *
92
- * @return bool|object
93
- */
94
- abstract function stop_tracking();
95
- /**
96
- * Opt-in back into usage tracking.
97
- *
98
- * Note: This will only work if the user opted-in previously.
99
- *
100
- * Returns:
101
- * 1. FALSE - If the user never opted-in.
102
- * 2. TRUE - If successfully opted-in back to usage tracking.
103
- * 3. object - API result on failure.
104
- *
105
- * @author Leo Fajardo (@leorw)
106
- * @since 1.2.1.5
107
- *
108
- * @return bool|object
109
- */
110
- abstract function allow_tracking();
111
-
112
- #endregion
113
- #----------------------------------------------------------------------------------
114
- #region Module Type
115
- #----------------------------------------------------------------------------------
116
- /**
117
- * Checks if the plugin's type is "plugin". The other type is "theme".
118
- *
119
- * @author Leo Fajardo (@leorw)
120
- * @since 1.2.2
121
- *
122
- * @return bool
123
- */
124
- abstract function is_plugin();
125
- /**
126
- * Checks if the module type is "theme". The other type is "plugin".
127
- *
128
- * @author Leo Fajardo (@leorw)
129
- * @since 1.2.2
130
- *
131
- * @return bool
132
- */
133
- function is_theme() {
134
- return (!$this->is_plugin() );
135
- }
136
- #endregion
137
- #----------------------------------------------------------------------------------
138
- #region Permissions
139
- #----------------------------------------------------------------------------------
140
- /**
141
- * Check if plugin must be WordPress.org compliant.
142
- *
143
- * @since 1.0.7
144
- *
145
- * @return bool
146
- */
147
- abstract function is_org_repo_compliant();
148
- /**
149
- * Check if plugin is allowed to install executable files.
150
- *
151
- * @author Vova Feldman (@svovaf)
152
- * @since 1.0.5
153
- *
154
- * @return bool
155
- */
156
- function is_allowed_to_install() {
157
- return ( $this->is_premium() || !$this->is_org_repo_compliant() );
158
- }
159
- #endregion
160
- /**
161
- * Check if user in trial or in free plan (not paying).
162
- *
163
- * @author Vova Feldman (@svovaf)
164
- * @since 1.0.4
165
- *
166
- * @return bool
167
- */
168
- function is_not_paying() {
169
- return ( $this->is_trial() || $this->is_free_plan() );
170
- }
171
- /**
172
- * Check if the user has an activated and valid paid license on current plugin's install.
173
- *
174
- * @since 1.0.9
175
- *
176
- * @return bool
177
- */
178
- abstract function is_paying();
179
- /**
180
- * Check if the user is paying or in trial.
181
- *
182
- * @since 1.0.9
183
- *
184
- * @return bool
185
- */
186
- function is_paying_or_trial() {
187
- return ( $this->is_paying() || $this->is_trial() );
188
- }
189
- /**
190
- * Check if user in a trial or have feature enabled license.
191
- *
192
- * @author Vova Feldman (@svovaf)
193
- * @since 1.1.7
194
- *
195
- * @return bool
196
- */
197
- abstract function can_use_premium_code();
198
-
199
- #----------------------------------------------------------------------------------
200
- #region Premium Only
201
- #----------------------------------------------------------------------------------
202
-
203
- /**
204
- * All logic wrapped in methods with "__premium_only()" suffix will be only
205
- * included in the premium code.
206
- *
207
- * Example:
208
- * if ( freemius()->is__premium_only() ) {
209
- * ...
210
- * }
211
- */
212
- /**
213
- * Returns true when running premium plugin code.
214
- *
215
- * @since 1.0.9
216
- *
217
- * @return bool
218
- */
219
- function is__premium_only() {
220
- return $this->is_premium();
221
- }
222
- /**
223
- * Check if the user has an activated and valid paid license on current plugin's install.
224
- *
225
- * @since 1.0.9
226
- *
227
- * @return bool
228
- *
229
- */
230
- function is_paying__premium_only() {
231
- return ( $this->is__premium_only() && $this->is_paying() );
232
- }
233
- /**
234
- * All code wrapped in this statement will be only included in the premium code.
235
- *
236
- * @since 1.0.9
237
- *
238
- * @param string $plan Plan name.
239
- * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
240
- *
241
- * @return bool
242
- */
243
- function is_plan__premium_only($plan, $exact = false) {
244
- return ( $this->is_premium() && $this->is_plan($plan, $exact) );
245
- }
246
- /**
247
- * Check if plan matches active license' plan or active trial license' plan.
248
- *
249
- * All code wrapped in this statement will be only included in the premium code.
250
- *
251
- * @since 1.0.9
252
- *
253
- * @param string $plan Plan name.
254
- * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
255
- *
256
- * @return bool
257
- */
258
- function is_plan_or_trial__premium_only($plan, $exact = false) {
259
- return ( $this->is_premium() && $this->is_plan_or_trial($plan, $exact) );
260
- }
261
- /**
262
- * Check if the user is paying or in trial.
263
- *
264
- * All code wrapped in this statement will be only included in the premium code.
265
- *
266
- * @since 1.0.9
267
- *
268
- * @return bool
269
- */
270
- function is_paying_or_trial__premium_only() {
271
- return $this->is_premium() && $this->is_paying_or_trial();
272
- }
273
- /**
274
- * Check if the user has an activated and valid paid license on current plugin's install.
275
- *
276
- * @since 1.0.4
277
- *
278
- * @return bool
279
- *
280
- * @deprecated Method name is confusing since it's not clear from the name the code will be removed.
281
- * @using Alias to is_paying__premium_only()
282
- */
283
- function is_paying__fs__() {
284
- return $this->is_paying__premium_only();
285
- }
286
- /**
287
- * Check if user in a trial or have feature enabled license.
288
- *
289
- * All code wrapped in this statement will be only included in the premium code.
290
- *
291
- * @author Vova Feldman (@svovaf)
292
- * @since 1.1.9
293
- *
294
- * @return bool
295
- */
296
- function can_use_premium_code__premium_only() {
297
- return $this->is_premium() && $this->can_use_premium_code();
298
- }
299
- #endregion
300
- #----------------------------------------------------------------------------------
301
- #region Trial
302
- #----------------------------------------------------------------------------------
303
- /**
304
- * Check if the user in a trial.
305
- *
306
- * @since 1.0.3
307
- *
308
- * @return bool
309
- */
310
- abstract function is_trial();
311
- /**
312
- * Check if trial already utilized.
313
- *
314
- * @since 1.0.9
315
- *
316
- * @return bool
317
- */
318
- abstract function is_trial_utilized();
319
-
320
- #endregion
321
- #----------------------------------------------------------------------------------
322
- #region Plans
323
- #----------------------------------------------------------------------------------
324
- /**
325
- * Check if plugin using the free plan.
326
- *
327
- * @since 1.0.4
328
- *
329
- * @return bool
330
- */
331
- abstract function is_free_plan();
332
- /**
333
- * @since 1.0.2
334
- *
335
- * @param string $plan Plan name.
336
- * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
337
- *
338
- * @return bool
339
- */
340
- abstract function is_plan($plan, $exact = false);
341
- /**
342
- * Check if plan based on trial. If not in trial mode, should return false.
343
- *
344
- * @since 1.0.9
345
- *
346
- * @param string $plan Plan name.
347
- * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
348
- *
349
- * @return bool
350
- */
351
- abstract function is_trial_plan($plan, $exact = false);
352
- /**
353
- * Check if plan matches active license' plan or active trial license' plan.
354
- *
355
- * @since 1.0.9
356
- *
357
- * @param string $plan Plan name.
358
- * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
359
- *
360
- * @return bool
361
- */
362
- function is_plan_or_trial($plan, $exact = false) {
363
- return $this->is_plan($plan, $exact) ||
364
- $this->is_trial_plan($plan, $exact);
365
- }
366
- /**
367
- * Check if plugin has any paid plans.
368
- *
369
- * @author Vova Feldman (@svovaf)
370
- * @since 1.0.7
371
- *
372
- * @return bool
373
- */
374
- abstract function has_paid_plan();
375
- /**
376
- * Check if plugin has any free plan, or is it premium only.
377
- *
378
- * Note: If no plans configured, assume plugin is free.
379
- *
380
- * @author Vova Feldman (@svovaf)
381
- * @since 1.0.7
382
- *
383
- * @return bool
384
- */
385
- abstract function has_free_plan();
386
- /**
387
- * Check if plugin is premium only (no free plans).
388
- *
389
- * NOTE: is__premium_only() is very different method, don't get confused.
390
- *
391
- * @author Vova Feldman (@svovaf)
392
- * @since 1.1.9
393
- *
394
- * @return bool
395
- */
396
- abstract function is_only_premium();
397
- /**
398
- * Check if module has a premium code version.
399
- *
400
- * Serviceware module might be freemium without any
401
- * premium code version, where the paid features
402
- * are all part of the service.
403
- *
404
- * @author Vova Feldman (@svovaf)
405
- * @since 1.2.1.6
406
- *
407
- * @return bool
408
- */
409
- abstract function has_premium_version();
410
- /**
411
- * Check if module has any release on Freemius,
412
- * or all plugin's code is on WordPress.org (Serviceware).
413
- *
414
- * @return bool
415
- */
416
- function has_release_on_freemius() {
417
- return !$this->is_org_repo_compliant() ||
418
- $this->has_premium_version();
419
- }
420
- /**
421
- * Checks if it's a freemium plugin.
422
- *
423
- * @author Vova Feldman (@svovaf)
424
- * @since 1.1.9
425
- *
426
- * @return bool
427
- */
428
- function is_freemium() {
429
- return $this->has_paid_plan() &&
430
- $this->has_free_plan();
431
- }
432
- /**
433
- * Check if module has only one plan.
434
- *
435
- * @author Vova Feldman (@svovaf)
436
- * @since 1.2.1.7
437
- *
438
- * @return bool
439
- */
440
- abstract function is_single_plan();
441
-
442
- #endregion
443
- /**
444
- * Check if running payments in sandbox mode.
445
- *
446
- * @since 1.0.4
447
- *
448
- * @return bool
449
- */
450
- abstract function is_payments_sandbox();
451
- /**
452
- * Check if running test vs. live plugin.
453
- *
454
- * @since 1.0.5
455
- *
456
- * @return bool
457
- */
458
- abstract function is_live();
459
- /**
460
- * Check if running premium plugin code.
461
- *
462
- * @since 1.0.5
463
- *
464
- * @return bool
465
- */
466
- abstract function is_premium();
467
- /**
468
- * Get upgrade URL.
469
- *
470
- * @author Vova Feldman (@svovaf)
471
- * @since 1.0.2
472
- *
473
- * @param string $period Billing cycle.
474
- *
475
- * @return string
476
- */
477
- abstract function get_upgrade_url($period = WP_FS__PERIOD_ANNUALLY);
478
- /**
479
- * Check if Freemius was first added in a plugin update.
480
- *
481
- * @author Vova Feldman (@svovaf)
482
- * @since 1.1.5
483
- *
484
- * @return bool
485
- */
486
- function is_plugin_update() {
487
- return !$this->is_plugin_new_install();
488
- }
489
- /**
490
- * Check if Freemius was part of the plugin when the user installed it first.
491
- *
492
- * @author Vova Feldman (@svovaf)
493
- * @since 1.1.5
494
- *
495
- * @return bool
496
- */
497
- abstract function is_plugin_new_install();
498
-
499
- #----------------------------------------------------------------------------------
500
- #region Marketing
501
- #----------------------------------------------------------------------------------
502
- /**
503
- * Check if current user purchased any other plugins before.
504
- *
505
- * @author Vova Feldman (@svovaf)
506
- * @since 1.0.9
507
- *
508
- * @return bool
509
- */
510
- abstract function has_purchased_before();
511
- /**
512
- * Check if current user classified as an agency.
513
- *
514
- * @author Vova Feldman (@svovaf)
515
- * @since 1.0.9
516
- *
517
- * @return bool
518
- */
519
- abstract function is_agency();
520
- /**
521
- * Check if current user classified as a developer.
522
- *
523
- * @author Vova Feldman (@svovaf)
524
- * @since 1.0.9
525
- *
526
- * @return bool
527
- */
528
- abstract function is_developer();
529
- /**
530
- * Check if current user classified as a business.
531
- *
532
- * @author Vova Feldman (@svovaf)
533
- * @since 1.0.9
534
- *
535
- * @return bool
536
- */
537
- abstract function is_business();
538
-
539
- #endregion
540
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/class-freemius.php DELETED
@@ -1,11373 +0,0 @@
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
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- // "final class"
12
- class Freemius extends Freemius_Abstract {
13
- /**
14
- * SDK Version
15
- *
16
- * @var string
17
- */
18
- public $version = WP_FS__SDK_VERSION;
19
-
20
- #region Plugin Info
21
- /**
22
- * @since 1.0.1
23
- *
24
- * @var string
25
- */
26
- private $_slug;
27
- /**
28
- * @since 1.0.0
29
- *
30
- * @var string
31
- */
32
- private $_plugin_basename;
33
- /**
34
- * @since 1.0.0
35
- *
36
- * @var string
37
- */
38
- private $_free_plugin_basename;
39
- /**
40
- * @since 1.0.0
41
- *
42
- * @var string
43
- */
44
- private $_plugin_dir_path;
45
- /**
46
- * @since 1.0.0
47
- *
48
- * @var string
49
- */
50
- private $_plugin_dir_name;
51
- /**
52
- * @since 1.0.0
53
- *
54
- * @var string
55
- */
56
- private $_plugin_main_file_path;
57
- /**
58
- * @var string[]
59
- */
60
- private $_plugin_data;
61
- /**
62
- * @since 1.0.9
63
- *
64
- * @var string
65
- */
66
- private $_plugin_name;
67
-
68
- #endregion Plugin Info
69
- /**
70
- * @since 1.0.9
71
- *
72
- * @var bool If false, don't turn Freemius on.
73
- */
74
- private $_is_on;
75
- /**
76
- * @since 1.1.3
77
- *
78
- * @var bool If false, don't turn Freemius on.
79
- */
80
- private $_is_anonymous;
81
- /**
82
- * @since 1.0.9
83
- * @var bool If false, issues with connectivity to Freemius API.
84
- */
85
- private $_has_api_connection;
86
- /**
87
- * @since 1.0.9
88
- * @var bool Hints the SDK if plugin can support anonymous mode (if skip connect is visible).
89
- */
90
- private $_enable_anonymous;
91
- /**
92
- * @since 1.1.7.5
93
- * @var bool Hints the SDK if plugin should run in anonymous mode (only adds feedback form).
94
- */
95
- private $_anonymous_mode;
96
- /**
97
- * @since 1.1.9
98
- * @var bool Hints the SDK if plugin have any free plans.
99
- */
100
- private $_is_premium_only;
101
- /**
102
- * @since 1.2.1.6
103
- * @var bool Hints the SDK if plugin have premium code version at all.
104
- */
105
- private $_has_premium_version;
106
- /**
107
- * @since 1.2.1.6
108
- * @var bool Hints the SDK if plugin should ignore pending mode by simulating a skip.
109
- */
110
- private $_ignore_pending_mode;
111
- /**
112
- * @since 1.0.8
113
- * @var bool Hints the SDK if the plugin has any paid plans.
114
- */
115
- private $_has_paid_plans;
116
- /**
117
- * @since 1.2.1.5
118
- * @var int Hints the SDK if the plugin offers a trial period. If negative, no trial, if zero - has a trial but
119
- * without a specified period, if positive - the number of trial days.
120
- */
121
- private $_trial_days = - 1;
122
- /**
123
- * @since 1.2.1.5
124
- * @var bool Hints the SDK if the trial requires a payment method or not.
125
- */
126
- private $_is_trial_require_payment = false;
127
- /**
128
- * @since 1.0.7
129
- * @var bool Hints the SDK if the plugin is WordPress.org compliant.
130
- */
131
- private $_is_org_compliant;
132
- /**
133
- * @since 1.0.7
134
- * @var bool Hints the SDK if the plugin is has add-ons.
135
- */
136
- private $_has_addons;
137
- /**
138
- * @since 1.1.6
139
- * @var string[]bool.
140
- */
141
- private $_permissions;
142
- /**
143
- * @var FS_Key_Value_Storage
144
- */
145
- private $_storage;
146
- /**
147
- * @since 1.0.0
148
- *
149
- * @var FS_Logger
150
- */
151
- private $_logger;
152
- /**
153
- * @since 1.0.4
154
- *
155
- * @var FS_Plugin
156
- */
157
- private $_plugin = false;
158
- /**
159
- * @since 1.0.4
160
- *
161
- * @var FS_Plugin|false
162
- */
163
- private $_parent_plugin = false;
164
- /**
165
- * @since 1.1.1
166
- *
167
- * @var Freemius
168
- */
169
- private $_parent = false;
170
- /**
171
- * @since 1.0.1
172
- *
173
- * @var FS_User
174
- */
175
- private $_user = false;
176
- /**
177
- * @since 1.0.1
178
- *
179
- * @var FS_Site
180
- */
181
- private $_site = false;
182
- /**
183
- * @since 1.0.1
184
- *
185
- * @var FS_Plugin_License
186
- */
187
- private $_license;
188
- /**
189
- * @since 1.0.2
190
- *
191
- * @var FS_Plugin_Plan[]
192
- */
193
- private $_plans = false;
194
- /**
195
- * @var FS_Plugin_License[]
196
- * @since 1.0.5
197
- */
198
- private $_licenses = false;
199
- /**
200
- * @since 1.0.1
201
- *
202
- * @var FS_Admin_Menu_Manager
203
- */
204
- private $_menu;
205
- /**
206
- * @var FS_Admin_Notice_Manager
207
- */
208
- private $_admin_notices;
209
- /**
210
- * @since 1.1.6
211
- *
212
- * @var FS_Admin_Notice_Manager
213
- */
214
- private static $_global_admin_notices;
215
- /**
216
- * @var FS_Logger
217
- * @since 1.0.0
218
- */
219
- private static $_static_logger;
220
- /**
221
- * @var FS_Option_Manager
222
- * @since 1.0.2
223
- */
224
- private static $_accounts;
225
- /**
226
- * @var Freemius[]
227
- */
228
- private static $_instances = array();
229
- #region Uninstall Reasons IDs
230
- const REASON_NO_LONGER_NEEDED = 1;
231
- const REASON_FOUND_A_BETTER_PLUGIN = 2;
232
- const REASON_NEEDED_FOR_A_SHORT_PERIOD = 3;
233
- const REASON_BROKE_MY_SITE = 4;
234
- const REASON_SUDDENLY_STOPPED_WORKING = 5;
235
- const REASON_CANT_PAY_ANYMORE = 6;
236
- const REASON_OTHER = 7;
237
- const REASON_DIDNT_WORK = 8;
238
- const REASON_DONT_LIKE_TO_SHARE_MY_INFORMATION = 9;
239
- const REASON_COULDNT_MAKE_IT_WORK = 10;
240
- const REASON_GREAT_BUT_NEED_SPECIFIC_FEATURE = 11;
241
- const REASON_NOT_WORKING = 12;
242
- const REASON_NOT_WHAT_I_WAS_LOOKING_FOR = 13;
243
- const REASON_DIDNT_WORK_AS_EXPECTED = 14;
244
- const REASON_TEMPORARY_DEACTIVATION = 15;
245
- #endregion
246
-
247
- /* Ctor
248
- ------------------------------------------------------------------------------------------------------------------ */
249
- /**
250
- * Main singleton instance.
251
- *
252
- * @author Vova Feldman (@svovaf)
253
- * @since 1.0.0
254
- *
255
- * @param string $slug
256
- * @param bool $is_init Since 1.2.1 Is initiation sequence.
257
- */
258
- private function __construct($slug, $is_init = false) {
259
- $this->_slug = $slug;
260
-
261
- $this->_logger = FS_Logger::get_logger(WP_FS__SLUG . '_' . $slug, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK);
262
-
263
- $this->_storage = FS_Key_Value_Storage::instance('plugin_data', $this->_slug);
264
-
265
- $this->_plugin_main_file_path = $this->_find_caller_plugin_file($is_init);
266
- $this->_plugin_dir_path = plugin_dir_path($this->_plugin_main_file_path);
267
- $this->_plugin_basename = plugin_basename($this->_plugin_main_file_path);
268
- $this->_free_plugin_basename = str_replace('-premium/', '/', $this->_plugin_basename);
269
-
270
- $base_name_split = explode('/', $this->_plugin_basename);
271
- $this->_plugin_dir_name = $base_name_split[0];
272
-
273
- if ($this->_logger->is_on()) {
274
- $this->_logger->info('plugin_main_file_path = ' . $this->_plugin_main_file_path);
275
- $this->_logger->info('plugin_dir_path = ' . $this->_plugin_dir_path);
276
- $this->_logger->info('plugin_basename = ' . $this->_plugin_basename);
277
- $this->_logger->info('free_plugin_basename = ' . $this->_free_plugin_basename);
278
- $this->_logger->info('plugin_dir_name = ' . $this->_plugin_dir_name);
279
- }
280
-
281
- // Remember link between file to slug.
282
- $this->store_file_slug_map();
283
-
284
- // Store plugin's initial install timestamp.
285
- if (!isset($this->_storage->install_timestamp)) {
286
- $this->_storage->install_timestamp = WP_FS__SCRIPT_START_TIME;
287
- }
288
-
289
- $this->_plugin = FS_Plugin_Manager::instance($this->_slug)->get();
290
-
291
- $this->_admin_notices = FS_Admin_Notice_Manager::instance(
292
- $slug, is_object($this->_plugin) ? $this->_plugin->title : ''
293
- );
294
-
295
- if ('true' === fs_request_get('fs_clear_api_cache') ||
296
- 'true' === fs_request_is_action('restart_freemius')
297
- ) {
298
- FS_Api::clear_cache();
299
- }
300
-
301
- $this->_register_hooks();
302
-
303
- $this->_load_account();
304
-
305
- $this->_version_updates_handler();
306
- }
307
- /**
308
- * Checks whether this plugin or theme has settings menu.
309
- *
310
- * @author Leo Fajardo (@leorw)
311
- * @since 1.2.2
312
- *
313
- * @return bool
314
- */
315
- function has_settings_menu() {
316
- /**
317
- * At the moment the wp.org require to show the opt-in in
318
- * the themes page. Therefore, if the theme is .org compliant,
319
- * treat it as if it doesn't have a menu item.
320
- */
321
- if ($this->is_theme() && $this->is_org_repo_compliant()) {
322
- return false;
323
- }
324
-
325
- return $this->_menu->has_menu();
326
- }
327
- /**
328
- * Checks whether this a submenu item is visible.
329
- *
330
- * @author Vova Feldman (@svovaf)
331
- * @since 1.2.2.6
332
- *
333
- * @param string $slug
334
- *
335
- * @return bool
336
- */
337
- function is_submenu_item_visible($slug) {
338
- if (!$this->has_settings_menu()) {
339
- return false;
340
- }
341
-
342
- return $this->_menu->is_submenu_item_visible($slug);
343
- }
344
- /**
345
- * @author Vova Feldman (@svovaf)
346
- * @since 1.0.9
347
- */
348
- private function _version_updates_handler() {
349
- if (!isset($this->_storage->sdk_version) || $this->_storage->sdk_version != $this->version) {
350
- // Freemius version upgrade mode.
351
- $this->_storage->sdk_last_version = $this->_storage->sdk_version;
352
- $this->_storage->sdk_version = $this->version;
353
-
354
- if (empty($this->_storage->sdk_last_version) ||
355
- version_compare($this->_storage->sdk_last_version, $this->version, '<')
356
- ) {
357
- $this->_storage->sdk_upgrade_mode = true;
358
- $this->_storage->sdk_downgrade_mode = false;
359
- } else {
360
- $this->_storage->sdk_downgrade_mode = true;
361
- $this->_storage->sdk_upgrade_mode = false;
362
- }
363
-
364
- $this->do_action('sdk_version_update', $this->_storage->sdk_last_version, $this->version);
365
- }
366
-
367
- $plugin_version = $this->get_plugin_version();
368
- if (!isset($this->_storage->plugin_version) || $this->_storage->plugin_version != $plugin_version) {
369
- // Plugin version upgrade mode.
370
- $this->_storage->plugin_last_version = $this->_storage->plugin_version;
371
- $this->_storage->plugin_version = $plugin_version;
372
-
373
- if (empty($this->_storage->plugin_last_version) ||
374
- version_compare($this->_storage->plugin_last_version, $plugin_version, '<')
375
- ) {
376
- $this->_storage->plugin_upgrade_mode = true;
377
- $this->_storage->plugin_downgrade_mode = false;
378
- } else {
379
- $this->_storage->plugin_downgrade_mode = true;
380
- $this->_storage->plugin_upgrade_mode = false;
381
- }
382
-
383
- if (!empty($this->_storage->plugin_last_version)) {
384
- // Different version of the plugin was installed before, therefore it's an update.
385
- $this->_storage->is_plugin_new_install = false;
386
- }
387
-
388
- $this->do_action('plugin_version_update', $this->_storage->plugin_last_version, $plugin_version);
389
- }
390
- }
391
- /**
392
- * @author Vova Feldman (@svovaf)
393
- * @since 1.1.5
394
- *
395
- * @param string $sdk_prev_version
396
- * @param string $sdk_version
397
- */
398
- function _data_migration($sdk_prev_version, $sdk_version) {
399
- /**
400
- * @since 1.1.7.3 Fixed unwanted connectivity test cleanup.
401
- */
402
- if (empty($sdk_prev_version)) {
403
- return;
404
- }
405
-
406
- if (version_compare($sdk_prev_version, '1.1.5', '<') &&
407
- version_compare($sdk_version, '1.1.5', '>=')
408
- ) {
409
- // On version 1.1.5 merged connectivity and is_on data.
410
- if (isset($this->_storage->connectivity_test)) {
411
- if (!isset($this->_storage->is_on)) {
412
- unset($this->_storage->connectivity_test);
413
- } else {
414
- $connectivity_data = $this->_storage->connectivity_test;
415
- $connectivity_data['is_active'] = $this->_storage->is_on['is_active'];
416
- $connectivity_data['timestamp'] = $this->_storage->is_on['timestamp'];
417
-
418
- // Override.
419
- $this->_storage->connectivity_test = $connectivity_data;
420
-
421
- // Remove previous structure.
422
- unset($this->_storage->is_on);
423
- }
424
- }
425
- }
426
- }
427
- /**
428
- * This action is connected to the 'plugins_loaded' hook and helps to determine
429
- * if this is a new plugin installation or a plugin update.
430
- *
431
- * There are 3 different use-cases:
432
- * 1) New plugin installation right with Freemius:
433
- * 1.1 _activate_plugin_event_hook() will be executed first
434
- * 1.2 Since $this->_storage->is_plugin_new_install is not set,
435
- * and $this->_storage->plugin_last_version is not set,
436
- * $this->_storage->is_plugin_new_install will be set to TRUE.
437
- * 1.3 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install will
438
- * be already set to TRUE.
439
- *
440
- * 2) Plugin update, didn't have Freemius before, and now have the SDK:
441
- * 2.1 _activate_plugin_event_hook() will not be executed, because
442
- * the activation hook do NOT fires on updates since WP 3.1.
443
- * 2.2 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install will
444
- * be empty, therefore, it will be set to FALSE.
445
- *
446
- * 3) Plugin update, had Freemius in prev version as well:
447
- * 3.1 _version_updates_handler() will be executed 1st, since FS was installed
448
- * before, $this->_storage->plugin_last_version will NOT be empty,
449
- * therefore, $this->_storage->is_plugin_new_install will be set to FALSE.
450
- * 3.2 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install is
451
- * already set, therefore, it will not be modified.
452
- *
453
- * Use-case #3 is backward compatible, #3.1 will be executed since 1.0.9.
454
- *
455
- * NOTE:
456
- * The only fallback of this mechanism is if an admin updates a plugin based on use-case #2,
457
- * and then, the next immediate PageView is the plugin's main settings page, it will not
458
- * show the opt-in right away. The reason it will happen is because Freemius execution
459
- * will be turned off till the plugin is fully loaded at least once
460
- * (till $this->_storage->was_plugin_loaded is TRUE).
461
- *
462
- * @author Vova Feldman (@svovaf)
463
- * @since 1.1.9
464
- *
465
- */
466
- function _plugins_loaded() {
467
- // Update flag that plugin was loaded with Freemius at least once.
468
- $this->_storage->was_plugin_loaded = true;
469
-
470
- if (!isset($this->_storage->is_plugin_new_install)) {
471
- $this->_storage->is_plugin_new_install = false;
472
- }
473
- }
474
- /**
475
- * @author Vova Feldman (@svovaf)
476
- * @since 1.0.9
477
- */
478
- private function _register_hooks() {
479
- $this->_logger->entrance();
480
-
481
- if (is_admin()) {
482
- $plugin_dir = dirname($this->_plugin_dir_path) . '/';
483
-
484
- /**
485
- * @since 1.2.2
486
- *
487
- * Hook to both free and premium version activations to support
488
- * auto deactivation on the other version activation.
489
- */
490
- register_activation_hook(
491
- $plugin_dir . $this->_free_plugin_basename, array(&$this, '_activate_plugin_event_hook')
492
- );
493
- register_activation_hook(
494
- $plugin_dir . $this->premium_plugin_basename(), array(&$this, '_activate_plugin_event_hook')
495
- );
496
-
497
- /**
498
- * Part of the mechanism to identify new plugin install vs. plugin update.
499
- *
500
- * @author Vova Feldman (@svovaf)
501
- * @since 1.1.9
502
- */
503
- if (empty($this->_storage->was_plugin_loaded)) {
504
- if ($this->is_activation_mode(false)) {
505
- add_action('plugins_loaded', array(&$this, '_plugins_loaded'));
506
- } else {
507
- // If was activated before, then it was already loaded before.
508
- $this->_plugins_loaded();
509
- }
510
- }
511
-
512
- if (!self::is_ajax()) {
513
- if (!$this->is_addon()) {
514
- add_action('init', array(&$this, '_add_default_submenu_items'), WP_FS__LOWEST_PRIORITY);
515
- add_action('admin_menu', array(&$this, '_prepare_admin_menu'), WP_FS__LOWEST_PRIORITY);
516
- }
517
- }
518
- }
519
-
520
- register_deactivation_hook($this->_plugin_main_file_path, array(&$this, '_deactivate_plugin_hook'));
521
-
522
- add_action('init', array(&$this, '_redirect_on_clicked_menu_link'), WP_FS__LOWEST_PRIORITY);
523
-
524
- add_action('admin_init', array(&$this, '_add_tracking_links'));
525
- add_action('admin_init', array(&$this, '_add_license_activation'));
526
- $this->add_ajax_action('update_billing', array(&$this, '_update_billing_ajax_action'));
527
- $this->add_ajax_action('start_trial', array(&$this, '_start_trial_ajax_action'));
528
-
529
- $this->add_ajax_action('install_premium_version', array(
530
- &$this,
531
- '_install_premium_version_ajax_action'
532
- ));
533
-
534
- $this->add_action('after_plans_sync', array(&$this, '_check_for_trial_plans'));
535
-
536
- $this->add_action('sdk_version_update', array(&$this, '_data_migration'), WP_FS__DEFAULT_PRIORITY, 2);
537
-
538
- add_action('admin_init', array(&$this, '_add_trial_notice'));
539
- add_action('admin_init', array(&$this, '_enqueue_common_css'));
540
-
541
- /**
542
- * Handle request to reset anonymous mode for `get_reconnect_url()`.
543
- *
544
- * @author Vova Feldman (@svovaf)
545
- * @since 1.2.1.5
546
- */
547
- if (fs_request_is_action('reset_anonymous_mode') &&
548
- $this->_slug === fs_request_get('fs_slug')
549
- ) {
550
- add_action('admin_init', array(&$this, 'connect_again'));
551
- }
552
- }
553
- /**
554
- * Keeping the uninstall hook registered for free or premium plugin version may result to a fatal error that
555
- * could happen when a user tries to uninstall either version while one of them is still active. Uninstalling a
556
- * plugin will trigger inclusion of the free or premium version and if one of them is active during the
557
- * uninstallation, a fatal error may occur in case the plugin's class or functions are already defined.
558
- *
559
- * @author Leo Fajardo (leorw)
560
- *
561
- * @since 1.2.0
562
- */
563
- private function unregister_uninstall_hook() {
564
- $uninstallable_plugins = (array) get_option('uninstall_plugins');
565
- unset($uninstallable_plugins[$this->_free_plugin_basename]);
566
- unset($uninstallable_plugins[$this->premium_plugin_basename()]);
567
-
568
- update_option('uninstall_plugins', $uninstallable_plugins);
569
- }
570
- /**
571
- * @since 1.2.0 Invalidate module's main file cache, otherwise, FS_Plugin_Updater will not fetch updates.
572
- */
573
- private function clear_module_main_file_cache() {
574
- if (!isset($this->_storage->plugin_main_file) ||
575
- empty($this->_storage->plugin_main_file->path)
576
- ) {
577
- return;
578
- }
579
-
580
- $plugin_main_file = clone $this->_storage->plugin_main_file;
581
-
582
- // Store cached path (2nd layer cache).
583
- $plugin_main_file->prev_path = $plugin_main_file->path;
584
-
585
- // Clear cached path.
586
- unset($plugin_main_file->path);
587
-
588
- $this->_storage->plugin_main_file = $plugin_main_file;
589
- }
590
- /**
591
- * @author Vova Feldman (@svovaf)
592
- * @since 1.0.9
593
- */
594
- private function _register_account_hooks() {
595
- if (!is_admin()) {
596
- return;
597
- }
598
-
599
- /**
600
- * Always show the deactivation feedback form since we added
601
- * automatic free version deactivation upon premium code activation.
602
- *
603
- * @since 1.2.1.6
604
- */
605
- $this->add_ajax_action(
606
- 'submit_uninstall_reason', array(&$this, '_submit_uninstall_reason_action')
607
- );
608
-
609
- if ($this->is_plugins_page()) {
610
- add_action('admin_footer', array(&$this, '_add_deactivation_feedback_dialog_box'));
611
- }
612
-
613
- if (!$this->is_addon()) {
614
- if ($this->is_registered()) {
615
- $this->add_filter('after_code_type_change', array(&$this, '_after_code_type_change'));
616
- }
617
- }
618
- }
619
- /**
620
- * Leverage backtrace to find caller plugin file path.
621
- *
622
- * @author Vova Feldman (@svovaf)
623
- * @since 1.0.6
624
- *
625
- * @param bool $is_init Is initiation sequence.
626
- *
627
- * @return string
628
- *
629
- * @uses fs_find_caller_plugin_file
630
- */
631
- private function _find_caller_plugin_file($is_init = false) {
632
- // Try to load the cached value of the file path.
633
- if (isset($this->_storage->plugin_main_file)) {
634
- $plugin_main_file = $this->_storage->plugin_main_file;
635
- if (isset($plugin_main_file->path) && file_exists($plugin_main_file->path)) {
636
- return $plugin_main_file->path;
637
- }
638
- }
639
-
640
- /**
641
- * @since 1.2.1
642
- *
643
- * `clear_module_main_file_cache()` is clearing the plugin's cached path on
644
- * deactivation. Therefore, if any plugin/theme was initiating `Freemius`
645
- * with that plugin's slug, it was overriding the empty plugin path with a wrong path.
646
- *
647
- * So, we've added a special mechanism with a 2nd layer of cache that uses `prev_path`
648
- * when the class instantiator isn't the module.
649
- */
650
- if (!$is_init) {
651
- // Fetch prev path cache.
652
- if (isset($this->_storage->plugin_main_file) &&
653
- isset($this->_storage->plugin_main_file->prev_path)
654
- ) {
655
- if (file_exists($this->_storage->plugin_main_file->prev_path)) {
656
- return $this->_storage->plugin_main_file->prev_path;
657
- }
658
- }
659
-
660
- wp_die(
661
- $this->get_text('failed-finding-main-path') .
662
- " Module: {$this->_slug}; SDK: " . WP_FS__SDK_VERSION . ";", $this->get_text('error'), array('back_link' => true)
663
- );
664
- }
665
-
666
- /**
667
- * @since 1.2.1
668
- *
669
- * Only the original instantiator that calls dynamic_init can modify the module's path.
670
- */
671
- // Find caller module.
672
- $file_and_type = $this->get_caller_main_file_and_type();
673
- $plugin_file = $file_and_type->path;
674
-
675
- $this->_storage->plugin_main_file = (object) array(
676
- 'path' => fs_normalize_path($plugin_file),
677
- );
678
-
679
- return $plugin_file;
680
- }
681
- /**
682
- * Identifies the caller path.
683
- *
684
- * @todo (Vova) When merging this branch with the theme's one, use the theme's one instead of this one.
685
- *
686
- * @author Leo Fajardo (@leorw)
687
- * @since 1.2.2
688
- *
689
- * @author Vova Feldman (@svovaf)
690
- * @since 1.2.2.3 Find the earliest module in the call stack that calls to the SDK. This fix is for cases
691
- * when add-ons are relying on loading the SDK from the parent module, and also allows themes
692
- * including the SDK an internal file instead of directly from functions.php.
693
- * @since 1.2.1.7 Knows how to handle cases when an add-on includes the parent module logic.
694
- */
695
- private function get_caller_main_file_and_type() {
696
- self::require_plugin_essentials();
697
-
698
- $all_plugins = get_plugins();
699
- $all_plugins_paths = array();
700
-
701
- // Get active plugin's main files real full names (might be symlinks).
702
- foreach ($all_plugins as $relative_path => &$data) {
703
- if (false === strpos(fs_normalize_path($relative_path), '/')) {
704
- /**
705
- * Ignore plugins that don't have a folder (e.g. Hello Dolly) since they
706
- * can't really include the SDK.
707
- *
708
- * @author Vova Feldman
709
- * @since 1.2.1.7
710
- */
711
- continue;
712
- }
713
-
714
- $all_plugins_paths[] = fs_normalize_path(realpath(WP_PLUGIN_DIR . '/' . $relative_path));
715
- }
716
-
717
- $caller_file_candidate = false;
718
- $caller_map = array();
719
- $module_type = WP_FS__MODULE_TYPE_PLUGIN;
720
-
721
- for ($i = 1, $bt = debug_backtrace(), $len = count($bt); $i < $len; $i ++) {
722
- if (empty($bt[$i]['file'])) {
723
- continue;
724
- }
725
-
726
- if ($i > 1 && !empty($bt[$i - 1]['file']) && $bt[$i]['file'] === $bt[$i - 1]['file']) {
727
- // If file same as the prev file in the stack, skip it.
728
- continue;
729
- }
730
-
731
- if (!empty($bt[$i]['function']) && in_array($bt[$i]['function'], array(
732
- 'do_action',
733
- 'apply_filter',
734
- 'require_once',
735
- 'require',
736
- 'include_once',
737
- 'include'
738
- ))
739
- ) {
740
- // Ignore call stack hooks and files inclusion.
741
- continue;
742
- }
743
-
744
- $caller_file_path = fs_normalize_path($bt[$i]['file']);
745
- $caller_file_hash = md5($caller_file_path);
746
-
747
- if (!isset($caller_map[$caller_file_hash])) {
748
- foreach ($all_plugins_paths as $plugin_path) {
749
- if (false !== strpos($caller_file_path, fs_normalize_path(dirname($plugin_path) . '/'))) {
750
- $caller_map[$caller_file_hash] = fs_normalize_path($plugin_path);
751
- break;
752
- }
753
- }
754
- }
755
-
756
- if (isset($caller_map[$caller_file_hash])) {
757
- $module_type = WP_FS__MODULE_TYPE_PLUGIN;
758
- $caller_file_candidate = $caller_map[$caller_file_hash];
759
- }
760
- }
761
-
762
- if (empty($caller_file_candidate)) {
763
- // Throw an error to the developer in case of some edge case dev environment.
764
- wp_die($this->get_text('failed-finding-main-path'), $this->get_text('error'), array('back_link' => true));
765
- }
766
-
767
- return (object) array(
768
- 'module_type' => $module_type,
769
- 'path' => $caller_file_candidate
770
- );
771
- }
772
- #----------------------------------------------------------------------------------
773
- #region Deactivation Feedback Form
774
- #----------------------------------------------------------------------------------
775
- /**
776
- * Displays a confirmation and feedback dialog box when the user clicks on the "Deactivate" link on the plugins
777
- * page.
778
- *
779
- * @author Vova Feldman (@svovaf)
780
- * @author Leo Fajardo (@leorw)
781
- * @since 1.1.2
782
- */
783
- function _add_deactivation_feedback_dialog_box() {
784
- /* Check the type of user:
785
- * 1. Long-term (long-term)
786
- * 2. Non-registered and non-anonymous short-term (non-registered-and-non-anonymous-short-term).
787
- * 3. Short-term (short-term)
788
- */
789
- $is_long_term_user = true;
790
-
791
- // Check if the site is at least 2 days old.
792
- $time_installed = $this->_storage->install_timestamp;
793
-
794
- // Difference in seconds.
795
- $date_diff = time() - $time_installed;
796
-
797
- // Convert seconds to days.
798
- $date_diff_days = floor($date_diff / ( 60 * 60 * 24 ));
799
-
800
- if ($date_diff_days < 2) {
801
- $is_long_term_user = false;
802
- }
803
-
804
- $is_long_term_user = $this->apply_filters('is_long_term_user', $is_long_term_user);
805
-
806
- if ($is_long_term_user) {
807
- $user_type = 'long-term';
808
- } else {
809
- if (!$this->is_registered() && !$this->is_anonymous()) {
810
- $user_type = 'non-registered-and-non-anonymous-short-term';
811
- } else {
812
- $user_type = 'short-term';
813
- }
814
- }
815
-
816
- $uninstall_reasons = $this->_get_uninstall_reasons($user_type);
817
-
818
- // Load the HTML template for the deactivation feedback dialog box.
819
- $vars = array(
820
- 'reasons' => $uninstall_reasons,
821
- 'slug' => $this->_slug
822
- );
823
-
824
- /**
825
- * @todo Deactivation form core functions should be loaded only once! Otherwise, when there are multiple Freemius powered plugins the same code is loaded multiple times. The only thing that should be loaded differently is the various deactivation reasons object based on the state of the plugin.
826
- */
827
- fs_require_template('forms/deactivation/form.php', $vars);
828
- }
829
- /**
830
- * @author Leo Fajardo (leorw)
831
- * @since 1.1.2
832
- *
833
- * @param string $user_type
834
- *
835
- * @return array The uninstall reasons for the specified user type.
836
- */
837
- function _get_uninstall_reasons($user_type = 'long-term') {
838
- $internal_message_template_var = array(
839
- 'slug' => $this->_slug
840
- );
841
-
842
- if ($this->is_registered() && false !== $this->get_plan() && $this->get_plan()->has_technical_support()) {
843
- $contact_support_template = fs_get_template('forms/deactivation/contact.php', $internal_message_template_var);
844
- } else {
845
- $contact_support_template = '';
846
- }
847
-
848
- $reason_found_better_plugin = array(
849
- 'id' => self::REASON_FOUND_A_BETTER_PLUGIN,
850
- 'text' => $this->get_text('reason-found-a-better-plugin'),
851
- 'input_type' => 'textfield',
852
- 'input_placeholder' => $this->get_text('placeholder-plugin-name')
853
- );
854
-
855
- $reason_temporary_deactivation = array(
856
- 'id' => self::REASON_TEMPORARY_DEACTIVATION,
857
- 'text' => $this->get_text('reason-temporary-deactivation'),
858
- 'input_type' => '',
859
- 'input_placeholder' => ''
860
- );
861
-
862
- $reason_other = array(
863
- 'id' => self::REASON_OTHER,
864
- 'text' => $this->get_text('reason-other'),
865
- 'input_type' => 'textfield',
866
- 'input_placeholder' => ''
867
- );
868
-
869
- $long_term_user_reasons = array(
870
- array(
871
- 'id' => self::REASON_NO_LONGER_NEEDED,
872
- 'text' => $this->get_text('reason-no-longer-needed'),
873
- 'input_type' => '',
874
- 'input_placeholder' => ''
875
- ),
876
- $reason_found_better_plugin,
877
- array(
878
- 'id' => self::REASON_NEEDED_FOR_A_SHORT_PERIOD,
879
- 'text' => $this->get_text('reason-needed-for-a-short-period'),
880
- 'input_type' => '',
881
- 'input_placeholder' => ''
882
- ),
883
- array(
884
- 'id' => self::REASON_BROKE_MY_SITE,
885
- 'text' => $this->get_text('reason-broke-my-site'),
886
- 'input_type' => '',
887
- 'input_placeholder' => '',
888
- 'internal_message' => $contact_support_template
889
- ),
890
- array(
891
- 'id' => self::REASON_SUDDENLY_STOPPED_WORKING,
892
- 'text' => $this->get_text('reason-suddenly-stopped-working'),
893
- 'input_type' => '',
894
- 'input_placeholder' => '',
895
- 'internal_message' => $contact_support_template
896
- )
897
- );
898
-
899
- if ($this->is_paying()) {
900
- $long_term_user_reasons[] = array(
901
- 'id' => self::REASON_CANT_PAY_ANYMORE,
902
- 'text' => $this->get_text('reason-cant-pay-anymore'),
903
- 'input_type' => 'textfield',
904
- 'input_placeholder' => $this->get_text('placeholder-comfortable-price')
905
- );
906
- }
907
-
908
- $reason_dont_share_info = array(
909
- 'id' => self::REASON_DONT_LIKE_TO_SHARE_MY_INFORMATION,
910
- 'text' => $this->get_text('reason-dont-like-to-share-my-information'),
911
- 'input_type' => '',
912
- 'input_placeholder' => ''
913
- );
914
-
915
- /**
916
- * If the current user has selected the "don't share data" reason in the deactivation feedback modal, inform the
917
- * user by showing additional message that he doesn't have to share data and can just choose to skip the opt-in
918
- * (the Skip button is included in the message to show). This message will only be shown if anonymous mode is
919
- * enabled and the user's account is currently not in pending activation state (similar to the way the Skip
920
- * button in the opt-in form is shown/hidden).
921
- */
922
- if ($this->is_enable_anonymous() && !$this->is_pending_activation()) {
923
- $reason_dont_share_info['internal_message'] = fs_get_template('forms/deactivation/retry-skip.php', $internal_message_template_var);
924
- }
925
-
926
- $uninstall_reasons = array(
927
- 'long-term' => $long_term_user_reasons,
928
- 'non-registered-and-non-anonymous-short-term' => array(
929
- array(
930
- 'id' => self::REASON_DIDNT_WORK,
931
- 'text' => $this->get_text('reason-didnt-work'),
932
- 'input_type' => '',
933
- 'input_placeholder' => ''
934
- ),
935
- $reason_dont_share_info,
936
- $reason_found_better_plugin
937
- ),
938
- 'short-term' => array(
939
- array(
940
- 'id' => self::REASON_COULDNT_MAKE_IT_WORK,
941
- 'text' => $this->get_text('reason-couldnt-make-it-work'),
942
- 'input_type' => '',
943
- 'input_placeholder' => '',
944
- 'internal_message' => $contact_support_template
945
- ),
946
- $reason_found_better_plugin,
947
- array(
948
- 'id' => self::REASON_GREAT_BUT_NEED_SPECIFIC_FEATURE,
949
- 'text' => $this->get_text('reason-great-but-need-specific-feature'),
950
- 'input_type' => 'textarea',
951
- 'input_placeholder' => $this->get_text('placeholder-feature')
952
- ),
953
- array(
954
- 'id' => self::REASON_NOT_WORKING,
955
- 'text' => $this->get_text('reason-not-working'),
956
- 'input_type' => 'textarea',
957
- 'input_placeholder' => $this->get_text('placeholder-share-what-didnt-work')
958
- ),
959
- array(
960
- 'id' => self::REASON_NOT_WHAT_I_WAS_LOOKING_FOR,
961
- 'text' => $this->get_text('reason-not-what-i-was-looking-for'),
962
- 'input_type' => 'textarea',
963
- 'input_placeholder' => $this->get_text('placeholder-what-youve-been-looking-for')
964
- ),
965
- array(
966
- 'id' => self::REASON_DIDNT_WORK_AS_EXPECTED,
967
- 'text' => $this->get_text('reason-didnt-work-as-expected'),
968
- 'input_type' => 'textarea',
969
- 'input_placeholder' => $this->get_text('placeholder-what-did-you-expect')
970
- )
971
- )
972
- );
973
-
974
- // Randomize the reasons for the current user type.
975
- shuffle($uninstall_reasons[$user_type]);
976
-
977
- // Keep the following reasons as the last items in the list.
978
- $uninstall_reasons[$user_type][] = $reason_temporary_deactivation;
979
- $uninstall_reasons[$user_type][] = $reason_other;
980
-
981
- $uninstall_reasons = $this->apply_filters('uninstall_reasons', $uninstall_reasons);
982
-
983
- return $uninstall_reasons[$user_type];
984
- }
985
- /**
986
- * Called after the user has submitted his reason for deactivating the plugin.
987
- *
988
- * @author Leo Fajardo (@leorw)
989
- * @since 1.1.2
990
- */
991
- function _submit_uninstall_reason_action() {
992
- $this->_logger->entrance();
993
-
994
- $this->check_ajax_referer('submit_uninstall_reason');
995
-
996
- $reason_id = fs_request_get('reason_id');
997
-
998
- // Check if the given reason ID is an unsigned integer.
999
- if (!ctype_digit($reason_id)) {
1000
- exit;
1001
- }
1002
-
1003
- $reason_info = trim(fs_request_get('reason_info', ''));
1004
- if (!empty($reason_info)) {
1005
- $reason_info = substr($reason_info, 0, 128);
1006
- }
1007
-
1008
- $reason = (object) array(
1009
- 'id' => $reason_id,
1010
- 'info' => $reason_info,
1011
- 'is_anonymous' => fs_request_get_bool('is_anonymous')
1012
- );
1013
-
1014
- $this->_storage->store('uninstall_reason', $reason);
1015
-
1016
- // Print '1' for successful operation.
1017
- echo 1;
1018
- exit;
1019
- }
1020
- #endregion
1021
- #----------------------------------------------------------------------------------
1022
- #region Instance
1023
- #----------------------------------------------------------------------------------
1024
- /**
1025
- * Main singleton instance.
1026
- *
1027
- * @author Vova Feldman (@svovaf)
1028
- * @since 1.0.0
1029
- *
1030
- * @param string $slug
1031
- * @param bool $is_init Is initiation sequence.
1032
- *
1033
- * @return Freemius|false
1034
- */
1035
- static function instance($slug, $is_init = false) {
1036
- if (empty($slug)) {
1037
- return false;
1038
- }
1039
-
1040
- $slug = strtolower($slug);
1041
-
1042
- if (!isset(self::$_instances[$slug])) {
1043
- if (0 === count(self::$_instances)) {
1044
- self::_load_required_static();
1045
- }
1046
-
1047
- self::$_instances[$slug] = new Freemius($slug, $is_init);
1048
- }
1049
-
1050
- return self::$_instances[$slug];
1051
- }
1052
- /**
1053
- * @author Vova Feldman (@svovaf)
1054
- * @since 1.0.6
1055
- *
1056
- * @param string|number $slug_or_id
1057
- *
1058
- * @return bool
1059
- */
1060
- private static function has_instance($slug_or_id) {
1061
- return !is_numeric($slug_or_id) ?
1062
- isset(self::$_instances[strtolower($slug_or_id)]) :
1063
- ( false !== self::get_instance_by_id($slug_or_id) );
1064
- }
1065
- /**
1066
- * @author Vova Feldman (@svovaf)
1067
- * @since 1.0.6
1068
- *
1069
- * @param number $id
1070
- *
1071
- * @return false|Freemius
1072
- */
1073
- static function get_instance_by_id($id) {
1074
- foreach (self::$_instances as $slug => $instance) {
1075
- if ($id == $instance->get_id()) {
1076
- return $instance;
1077
- }
1078
- }
1079
-
1080
- return false;
1081
- }
1082
- /**
1083
- *
1084
- * @author Vova Feldman (@svovaf)
1085
- * @since 1.0.1
1086
- *
1087
- * @param $plugin_file
1088
- *
1089
- * @return false|Freemius
1090
- */
1091
- static function get_instance_by_file($plugin_file) {
1092
- $slug = self::find_slug_by_basename($plugin_file);
1093
-
1094
- return ( false !== $slug ) ?
1095
- self::instance($slug) :
1096
- false;
1097
- }
1098
- /**
1099
- * @author Vova Feldman (@svovaf)
1100
- * @since 1.0.6
1101
- *
1102
- * @return false|Freemius
1103
- */
1104
- function get_parent_instance() {
1105
- return self::get_instance_by_id($this->_plugin->parent_plugin_id);
1106
- }
1107
- /**
1108
- * @author Vova Feldman (@svovaf)
1109
- * @since 1.0.6
1110
- *
1111
- * @param string|number $slug_or_id
1112
- *
1113
- * @return bool|Freemius
1114
- */
1115
- function get_addon_instance($slug_or_id) {
1116
- return !is_numeric($slug_or_id) ?
1117
- self::instance(strtolower($slug_or_id)) :
1118
- self::get_instance_by_id($slug_or_id);
1119
- }
1120
- #endregion ------------------------------------------------------------------
1121
- /**
1122
- * @author Vova Feldman (@svovaf)
1123
- * @since 1.0.6
1124
- *
1125
- * @return bool
1126
- */
1127
- function is_parent_plugin_installed() {
1128
- return self::has_instance($this->_plugin->parent_plugin_id);
1129
- }
1130
- /**
1131
- * Check if add-on parent plugin in activation mode.
1132
- *
1133
- * @author Vova Feldman (@svovaf)
1134
- * @since 1.0.7
1135
- *
1136
- * @return bool
1137
- */
1138
- function is_parent_in_activation() {
1139
- $parent_fs = $this->get_parent_instance();
1140
- if (!is_object($parent_fs)) {
1141
- return false;
1142
- }
1143
-
1144
- return ( $parent_fs->is_activation_mode() );
1145
- }
1146
- /**
1147
- * Is plugin in activation mode.
1148
- *
1149
- * @author Vova Feldman (@svovaf)
1150
- * @since 1.0.7
1151
- *
1152
- * @param bool $and_on
1153
- *
1154
- * @return bool
1155
- */
1156
- function is_activation_mode($and_on = true) {
1157
- return (
1158
- ( $this->is_on() || !$and_on ) &&
1159
- !$this->is_registered() &&
1160
- (!$this->is_enable_anonymous() ||
1161
- (!$this->is_anonymous() && !$this->is_pending_activation() ) )
1162
- );
1163
- }
1164
- /**
1165
- * Check if current page is the opt-in/pending-activation page.
1166
- *
1167
- * @author Vova Feldman (@svovaf)
1168
- * @since 1.2.1.7
1169
- *
1170
- * @return bool
1171
- */
1172
- function is_activation_page() {
1173
- if ($this->_menu->is_main_settings_page()) {
1174
- return true;
1175
- }
1176
-
1177
- if (!$this->is_activation_mode()) {
1178
- return false;
1179
- }
1180
-
1181
- // Check if current page is matching the activation page.
1182
- return $this->is_matching_url($_SERVER['REQUEST_URI'], $this->get_activation_url());
1183
- }
1184
- /**
1185
- * Check if URL path's are matching and that all querystring
1186
- * arguments of the $sub_url exist in the $url with the same values.
1187
- *
1188
- * WARNING:
1189
- * 1. This method doesn't check if the sub/domain are matching.
1190
- * 2. Ignore case sensitivity.
1191
- *
1192
- * @author Vova Feldman (@svovaf)
1193
- * @since 1.2.1.7
1194
- *
1195
- * @param string $url
1196
- * @param string $sub_url
1197
- *
1198
- * @return bool
1199
- */
1200
- private function is_matching_url($url, $sub_url) {
1201
- $url = strtolower($url);
1202
- $sub_url = strtolower($sub_url);
1203
-
1204
- if (parse_url($sub_url, PHP_URL_PATH) !== parse_url($url, PHP_URL_PATH)) {
1205
- // Different path - DO NOT OVERRIDE PAGE.
1206
- return false;
1207
- }
1208
-
1209
- $url_params = array();
1210
- parse_str(parse_url($url, PHP_URL_QUERY), $url_params);
1211
-
1212
- $sub_url_params = array();
1213
- parse_str(parse_url($sub_url, PHP_URL_QUERY), $sub_url_params);
1214
-
1215
- foreach ($sub_url_params as $key => $val) {
1216
- if (!isset($url_params[$key]) || $val != $url_params[$key]) {
1217
- // Not matching query string - DO NOT OVERRIDE PAGE.
1218
- return false;
1219
- }
1220
- }
1221
-
1222
- return true;
1223
- }
1224
- /**
1225
- * Get collection of all active plugins.
1226
- *
1227
- * @author Vova Feldman (@svovaf)
1228
- * @since 1.0.9
1229
- *
1230
- * @return array[string]array
1231
- */
1232
- private static function get_active_plugins() {
1233
- self::require_plugin_essentials();
1234
-
1235
- $active_plugin = array();
1236
- $all_plugins = get_plugins();
1237
- $active_plugins_basenames = get_option('active_plugins');
1238
-
1239
- foreach ($active_plugins_basenames as $plugin_basename) {
1240
- $active_plugin[$plugin_basename] = $all_plugins[$plugin_basename];
1241
- }
1242
-
1243
- return $active_plugin;
1244
- }
1245
- /**
1246
- * Get collection of all plugins.
1247
- *
1248
- * @author Vova Feldman (@svovaf)
1249
- * @since 1.1.8
1250
- *
1251
- * @return array Key is the plugin file path and the value is an array of the plugin data.
1252
- */
1253
- private static function get_all_plugins() {
1254
- self::require_plugin_essentials();
1255
-
1256
- $all_plugins = get_plugins();
1257
- $active_plugins_basenames = get_option('active_plugins');
1258
-
1259
- foreach ($all_plugins as $basename => &$data) {
1260
- // By default set to inactive (next foreach update the active plugins).
1261
- $data['is_active'] = false;
1262
- // Enrich with plugin slug.
1263
- $data['slug'] = self::get_plugin_slug($basename);
1264
- }
1265
-
1266
- // Flag active plugins.
1267
- foreach ($active_plugins_basenames as $basename) {
1268
- if (isset($all_plugins[$basename])) {
1269
- $all_plugins[$basename]['is_active'] = true;
1270
- }
1271
- }
1272
-
1273
- return $all_plugins;
1274
- }
1275
- /**
1276
- * Cached result of get_site_transient( 'update_plugins' )
1277
- *
1278
- * @author Vova Feldman (@svovaf)
1279
- * @since 1.1.8
1280
- *
1281
- * @var object
1282
- */
1283
- private static $_plugins_info;
1284
- /**
1285
- * Helper function to get specified plugin's slug.
1286
- *
1287
- * @author Vova Feldman (@svovaf)
1288
- * @since 1.1.8
1289
- *
1290
- * @param $basename
1291
- *
1292
- * @return string
1293
- */
1294
- private static function get_plugin_slug($basename) {
1295
- if (!isset(self::$_plugins_info)) {
1296
- self::$_plugins_info = get_site_transient('update_plugins');
1297
- }
1298
-
1299
- $slug = '';
1300
-
1301
- if (is_object(self::$_plugins_info)) {
1302
- if (isset(self::$_plugins_info->no_update) &&
1303
- isset(self::$_plugins_info->no_update[$basename]) &&
1304
- !empty(self::$_plugins_info->no_update[$basename]->slug)
1305
- ) {
1306
- $slug = self::$_plugins_info->no_update[$basename]->slug;
1307
- } else if (isset(self::$_plugins_info->response) &&
1308
- isset(self::$_plugins_info->response[$basename]) &&
1309
- !empty(self::$_plugins_info->response[$basename]->slug)
1310
- ) {
1311
- $slug = self::$_plugins_info->response[$basename]->slug;
1312
- }
1313
- }
1314
-
1315
- if (empty($slug)) {
1316
- // Try to find slug from FS data.
1317
- $slug = self::find_slug_by_basename($basename);
1318
- }
1319
-
1320
- if (empty($slug)) {
1321
- // Fallback to plugin's folder name.
1322
- $slug = dirname($basename);
1323
- }
1324
-
1325
- return $slug;
1326
- }
1327
- private static $_statics_loaded = false;
1328
- /**
1329
- * Load static resources.
1330
- *
1331
- * @author Vova Feldman (@svovaf)
1332
- * @since 1.0.1
1333
- */
1334
- private static function _load_required_static() {
1335
- if (self::$_statics_loaded) {
1336
- return;
1337
- }
1338
-
1339
- self::$_static_logger = FS_Logger::get_logger(WP_FS__SLUG, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK);
1340
-
1341
- self::$_static_logger->entrance();
1342
-
1343
- self::$_accounts = FS_Option_Manager::get_manager(WP_FS__ACCOUNTS_OPTION_NAME, true);
1344
-
1345
- self::$_global_admin_notices = FS_Admin_Notice_Manager::instance('global');
1346
-
1347
- // Configure which Freemius powered plugins should be auto updated.
1348
- // add_filter( 'auto_update_plugin', '_include_plugins_in_auto_update', 10, 2 );
1349
-
1350
- add_action('admin_menu', array('Freemius', '_add_debug_section'));
1351
-
1352
- add_action("wp_ajax_fs_toggle_debug_mode", array('Freemius', '_toggle_debug_mode'));
1353
-
1354
- self::add_ajax_action_static('get_debug_log', array('Freemius', '_get_debug_log'));
1355
-
1356
- self::add_ajax_action_static('get_db_option', array('Freemius', '_get_db_option'));
1357
-
1358
- self::add_ajax_action_static('set_db_option', array('Freemius', '_set_db_option'));
1359
-
1360
- add_action('plugins_loaded', array('Freemius', '_load_textdomain'), 1);
1361
-
1362
- self::$_statics_loaded = true;
1363
- }
1364
- #----------------------------------------------------------------------------------
1365
- #region Localization
1366
- #----------------------------------------------------------------------------------
1367
- /**
1368
- * Load framework's text domain.
1369
- *
1370
- * @author Vova Feldman (@svovaf)
1371
- * @since 1.2.1
1372
- */
1373
- static function _load_textdomain() {
1374
- if (!is_admin()) {
1375
- return;
1376
- }
1377
-
1378
- global $fs_active_plugins;
1379
-
1380
- // Works both for plugins and themes.
1381
- load_plugin_textdomain(
1382
- 'freemius', false, $fs_active_plugins->newest->sdk_path . '/languages/'
1383
- );
1384
- }
1385
- #endregion
1386
- #----------------------------------------------------------------------------------
1387
- #region Debugging
1388
- #----------------------------------------------------------------------------------
1389
- /**
1390
- * @author Vova Feldman (@svovaf)
1391
- * @since 1.0.8
1392
- */
1393
- static function _add_debug_section() {
1394
- if (!current_user_can('activate_plugins')) {
1395
- return;
1396
- }
1397
-
1398
- self::$_static_logger->entrance();
1399
-
1400
- $title = sprintf('%s [v.%s]', fs_text('freemius-debug'), WP_FS__SDK_VERSION);
1401
-
1402
- $hook = null;
1403
-
1404
- if (WP_FS__DEV_MODE) {
1405
- // Add top-level debug menu item.
1406
- $hook = FS_Admin_Menu_Manager::add_page(
1407
- $title, $title, 'manage_options', 'freemius', array('Freemius', '_debug_page_render')
1408
- );
1409
- } else {
1410
- if ('freemius' === fs_request_get('page')) {
1411
- // Add hidden debug page.
1412
- $hook = FS_Admin_Menu_Manager::add_subpage(
1413
- null, $title, $title, 'manage_options', 'freemius', array('Freemius', '_debug_page_render')
1414
- );
1415
- }
1416
- }
1417
-
1418
- if (!empty($hook)) {
1419
- add_action("load-$hook", array('Freemius', '_debug_page_actions'));
1420
- }
1421
- }
1422
- /**
1423
- * @author Vova Feldman (@svovaf)
1424
- * @since 1.1.7.3
1425
- */
1426
- static function _toggle_debug_mode() {
1427
- $is_on = fs_request_get('is_on', false, 'post');
1428
-
1429
- if (fs_request_is_post() && in_array($is_on, array(0, 1))) {
1430
- update_option('fs_debug_mode', $is_on);
1431
-
1432
- // Turn on/off storage logging.
1433
- FS_Logger::_set_storage_logging(( 1 == $is_on));
1434
- }
1435
-
1436
- exit;
1437
- }
1438
- /**
1439
- * @author Vova Feldman (@svovaf)
1440
- * @since 1.2.1.6
1441
- */
1442
- static function _get_debug_log() {
1443
- $logs = FS_Logger::load_db_logs(
1444
- fs_request_get('filters', false, 'post'), !empty($_POST['limit']) && is_numeric($_POST['limit']) ? $_POST['limit'] : 200, !empty($_POST['offset']) && is_numeric($_POST['offset']) ? $_POST['offset'] : 0
1445
- );
1446
-
1447
- self::shoot_ajax_success($logs);
1448
- }
1449
- /**
1450
- * @author Vova Feldman (@svovaf)
1451
- * @since 1.2.1.7
1452
- */
1453
- static function _get_db_option() {
1454
- $option_name = fs_request_get('option_name');
1455
-
1456
- $value = get_option($option_name);
1457
-
1458
- $result = array(
1459
- 'name' => $option_name,
1460
- );
1461
-
1462
- if (false !== $value) {
1463
- if (!is_string($value)) {
1464
- $value = json_encode($value);
1465
- }
1466
-
1467
- $result['value'] = $value;
1468
- }
1469
-
1470
- self::shoot_ajax_success($result);
1471
- }
1472
- /**
1473
- * @author Vova Feldman (@svovaf)
1474
- * @since 1.2.1.7
1475
- */
1476
- static function _set_db_option() {
1477
- $option_name = fs_request_get('option_name');
1478
- $option_value = fs_request_get('option_value');
1479
-
1480
- if (!empty($option_value)) {
1481
- update_option($option_name, $option_value);
1482
- }
1483
-
1484
- self::shoot_ajax_success();
1485
- }
1486
- /**
1487
- * @author Vova Feldman (@svovaf)
1488
- * @since 1.0.8
1489
- */
1490
- static function _debug_page_actions() {
1491
- self::_clean_admin_content_section();
1492
-
1493
- if (fs_request_is_action('restart_freemius')) {
1494
- check_admin_referer('restart_freemius');
1495
-
1496
- // Clear accounts data.
1497
- self::$_accounts->clear(true);
1498
-
1499
- // Clear SDK reference cache.
1500
- delete_option('fs_active_plugins');
1501
- } else if (fs_request_is_action('simulate_trial')) {
1502
- check_admin_referer('simulate_trial');
1503
-
1504
- $slug = fs_request_get('slug');
1505
-
1506
- $fs = freemius($slug);
1507
-
1508
- // Update SDK install to at least 24 hours before.
1509
- $fs->_storage->install_timestamp = ( time() - WP_FS__TIME_24_HOURS_IN_SEC );
1510
- // Unset the trial shown timestamp.
1511
- unset($fs->_storage->trial_promotion_shown);
1512
- } else if (fs_request_is_action('download_logs')) {
1513
- check_admin_referer('download_logs');
1514
-
1515
- $download_url = FS_Logger::download_db_logs(
1516
- fs_request_get('filters', false, 'post')
1517
- );
1518
-
1519
- if (false === $download_url) {
1520
- wp_die('Oops... there was an error while generating the logs download file. Please try again and if it doesn\'t work contact support@freemius.com.');
1521
- }
1522
-
1523
- fs_redirect($download_url);
1524
- }
1525
- }
1526
- /**
1527
- * @author Vova Feldman (@svovaf)
1528
- * @since 1.0.8
1529
- */
1530
- static function _debug_page_render() {
1531
- self::$_static_logger->entrance();
1532
-
1533
- $vars = array(
1534
- 'sites' => self::get_all_sites(),
1535
- 'users' => self::get_all_users(),
1536
- 'addons' => self::get_all_addons(),
1537
- 'account_addons' => self::get_all_account_addons(),
1538
- 'licenses' => self::get_all_licenses(),
1539
- );
1540
-
1541
- fs_enqueue_local_style('fs_debug', '/admin/debug.css');
1542
- fs_require_once_template('debug.php', $vars);
1543
- }
1544
- #endregion
1545
- #----------------------------------------------------------------------------------
1546
- #region Connectivity Issues
1547
- #----------------------------------------------------------------------------------
1548
- /**
1549
- * Check if Freemius should be turned on for the current plugin install.
1550
- *
1551
- * Note:
1552
- * $this->_is_on is updated in has_api_connectivity()
1553
- *
1554
- * @author Vova Feldman (@svovaf)
1555
- * @since 1.0.9
1556
- *
1557
- * @return bool
1558
- */
1559
- function is_on() {
1560
- self::$_static_logger->entrance();
1561
-
1562
- if (isset($this->_is_on)) {
1563
- return $this->_is_on;
1564
- }
1565
-
1566
- // If already installed or pending then sure it's on :)
1567
- if ($this->is_registered() || $this->is_pending_activation()) {
1568
- $this->_is_on = true;
1569
-
1570
- return true;
1571
- }
1572
-
1573
- return false;
1574
- }
1575
- /**
1576
- * @author Vova Feldman (@svovaf)
1577
- * @since 1.1.7.3
1578
- *
1579
- * @param bool $flush_if_no_connectivity
1580
- *
1581
- * @return bool
1582
- */
1583
- private function should_run_connectivity_test($flush_if_no_connectivity = false) {
1584
- if (!isset($this->_storage->connectivity_test)) {
1585
- // Connectivity test was never executed, or cache was cleared.
1586
- return true;
1587
- }
1588
-
1589
- if (WP_FS__PING_API_ON_IP_OR_HOST_CHANGES) {
1590
- if (WP_FS__IS_HTTP_REQUEST) {
1591
- if ($_SERVER['HTTP_HOST'] != $this->_storage->connectivity_test['host']) {
1592
- // Domain changed.
1593
- return true;
1594
- }
1595
-
1596
- if (WP_FS__REMOTE_ADDR != $this->_storage->connectivity_test['server_ip']) {
1597
- // Server IP changed.
1598
- return true;
1599
- }
1600
- }
1601
- }
1602
-
1603
- if ($this->_storage->connectivity_test['is_connected'] &&
1604
- $this->_storage->connectivity_test['is_active']
1605
- ) {
1606
- // API connected and Freemius is active - no need to run connectivity check.
1607
- return false;
1608
- }
1609
-
1610
- if ($flush_if_no_connectivity) {
1611
- /**
1612
- * If explicitly asked to flush when no connectivity - do it only
1613
- * if at least 10 sec passed from the last API connectivity test.
1614
- */
1615
- return ( isset($this->_storage->connectivity_test['timestamp']) &&
1616
- ( WP_FS__SCRIPT_START_TIME - $this->_storage->connectivity_test['timestamp'] ) > 10 );
1617
- }
1618
-
1619
- /**
1620
- * @since 1.1.7 Don't check for connectivity on plugin downgrade.
1621
- */
1622
- $version = $this->get_plugin_version();
1623
- if (version_compare($version, $this->_storage->connectivity_test['version'], '>')) {
1624
- // If it's a plugin version upgrade and Freemius is off or no connectivity, run connectivity test.
1625
- return true;
1626
- }
1627
-
1628
- return false;
1629
- }
1630
- /**
1631
- * @author Vova Feldman (@svovaf)
1632
- * @since 1.1.7.4
1633
- *
1634
- * @return object|false
1635
- */
1636
- private function ping() {
1637
- if (WP_FS__SIMULATE_NO_API_CONNECTIVITY) {
1638
- return false;
1639
- }
1640
-
1641
- $version = $this->get_plugin_version();
1642
-
1643
- $is_update = $this->apply_filters('is_plugin_update', $this->is_plugin_update());
1644
-
1645
- return $this->get_api_plugin_scope()->ping(
1646
- $this->get_anonymous_id(), array(
1647
- 'is_update' => json_encode($is_update),
1648
- 'version' => $version,
1649
- 'sdk' => $this->version,
1650
- 'is_admin' => json_encode(is_admin()),
1651
- 'is_ajax' => json_encode(self::is_ajax()),
1652
- 'is_cron' => json_encode($this->is_cron()),
1653
- 'is_http' => json_encode(WP_FS__IS_HTTP_REQUEST),
1654
- )
1655
- );
1656
- }
1657
- /**
1658
- * Check if there's any connectivity issue to Freemius API.
1659
- *
1660
- * @author Vova Feldman (@svovaf)
1661
- * @since 1.0.9
1662
- *
1663
- * @param bool $flush_if_no_connectivity
1664
- *
1665
- * @return bool
1666
- */
1667
- function has_api_connectivity($flush_if_no_connectivity = false) {
1668
- $this->_logger->entrance();
1669
-
1670
- if (isset($this->_has_api_connection) && ( $this->_has_api_connection || !$flush_if_no_connectivity )) {
1671
- return $this->_has_api_connection;
1672
- }
1673
-
1674
- if (WP_FS__SIMULATE_NO_API_CONNECTIVITY &&
1675
- isset($this->_storage->connectivity_test) &&
1676
- true === $this->_storage->connectivity_test['is_connected']
1677
- ) {
1678
- unset($this->_storage->connectivity_test);
1679
- }
1680
-
1681
- if (!$this->should_run_connectivity_test($flush_if_no_connectivity)) {
1682
- $this->_has_api_connection = $this->_storage->connectivity_test['is_connected'];
1683
- /**
1684
- * @since 1.1.6 During dev mode, if there's connectivity - turn Freemius on regardless the configuration.
1685
- *
1686
- * @since 1.2.1.5 If the user running the premium version then ignore the 'is_active' flag and turn Freemius on to enable license key activation.
1687
- */
1688
- $this->_is_on = $this->_storage->connectivity_test['is_active'] ||
1689
- $this->is_premium() ||
1690
- ( WP_FS__DEV_MODE && $this->_has_api_connection && !WP_FS__SIMULATE_FREEMIUS_OFF );
1691
-
1692
- return $this->_has_api_connection;
1693
- }
1694
-
1695
- $pong = $this->ping();
1696
- $is_connected = $this->get_api_plugin_scope()->is_valid_ping($pong);
1697
-
1698
- if (!$is_connected) {
1699
- // API failure.
1700
- $this->_add_connectivity_issue_message($pong);
1701
- }
1702
-
1703
- $this->store_connectivity_info($pong, $is_connected);
1704
-
1705
- return $this->_has_api_connection;
1706
- }
1707
- /**
1708
- * @author Vova Feldman (@svovaf)
1709
- * @since 1.1.7.4
1710
- *
1711
- * @param object $pong
1712
- * @param bool $is_connected
1713
- */
1714
- private function store_connectivity_info($pong, $is_connected) {
1715
- $this->_logger->entrance();
1716
-
1717
- $version = $this->get_plugin_version();
1718
-
1719
- if (!$is_connected || WP_FS__SIMULATE_FREEMIUS_OFF) {
1720
- $is_active = false;
1721
- } else {
1722
- $is_active = ( isset($pong->is_active) && true == $pong->is_active );
1723
- }
1724
-
1725
- $is_active = $this->apply_filters(
1726
- 'is_on', $is_active, $this->is_plugin_update(), $version
1727
- );
1728
-
1729
- $this->_storage->connectivity_test = array(
1730
- 'is_connected' => $is_connected,
1731
- 'host' => $_SERVER['HTTP_HOST'],
1732
- 'server_ip' => WP_FS__REMOTE_ADDR,
1733
- 'is_active' => $is_active,
1734
- 'timestamp' => WP_FS__SCRIPT_START_TIME,
1735
- // Last version with connectivity attempt.
1736
- 'version' => $version,
1737
- );
1738
-
1739
- $this->_has_api_connection = $is_connected;
1740
- $this->_is_on = $is_active || ( WP_FS__DEV_MODE && $is_connected && !WP_FS__SIMULATE_FREEMIUS_OFF );
1741
- }
1742
- /**
1743
- * Force turning Freemius on.
1744
- *
1745
- * @author Vova Feldman (@svovaf)
1746
- * @since 1.1.8.1
1747
- *
1748
- * @return bool TRUE if successfully turned on.
1749
- */
1750
- private function turn_on() {
1751
- $this->_logger->entrance();
1752
-
1753
- if ($this->is_on() || !isset($this->_storage->connectivity_test['is_active'])) {
1754
- return false;
1755
- }
1756
-
1757
- $updated_connectivity = $this->_storage->connectivity_test;
1758
- $updated_connectivity['is_active'] = true;
1759
- $updated_connectivity['timestamp'] = WP_FS__SCRIPT_START_TIME;
1760
- $this->_storage->connectivity_test = $updated_connectivity;
1761
-
1762
- $this->_is_on = true;
1763
-
1764
- return true;
1765
- }
1766
- /**
1767
- * Anonymous and unique site identifier (Hash).
1768
- *
1769
- * @author Vova Feldman (@svovaf)
1770
- * @since 1.1.0
1771
- *
1772
- * @return string
1773
- */
1774
- function get_anonymous_id() {
1775
- $unique_id = self::$_accounts->get_option('unique_id');
1776
-
1777
- if (empty($unique_id) || !is_string($unique_id)) {
1778
- $key = get_site_url();
1779
-
1780
- // If localhost, assign microtime instead of domain.
1781
- if (WP_FS__IS_LOCALHOST ||
1782
- false !== strpos($key, 'localhost') ||
1783
- false === strpos($key, '.')
1784
- ) {
1785
- $key = microtime();
1786
- }
1787
-
1788
- $unique_id = md5($key);
1789
-
1790
- self::$_accounts->set_option('unique_id', $unique_id, true);
1791
- }
1792
-
1793
- $this->_logger->departure($unique_id);
1794
-
1795
- return $unique_id;
1796
- }
1797
- /**
1798
- * @author Vova Feldman (@svovaf)
1799
- * @since 1.1.7.4
1800
- *
1801
- * @return \WP_User
1802
- */
1803
- static function _get_current_wp_user() {
1804
- self::require_pluggable_essentials();
1805
-
1806
- return wp_get_current_user();
1807
- }
1808
- /**
1809
- * Generate API connectivity issue message.
1810
- *
1811
- * @author Vova Feldman (@svovaf)
1812
- * @since 1.0.9
1813
- *
1814
- * @param mixed $api_result
1815
- * @param bool $is_first_failure
1816
- */
1817
- function _add_connectivity_issue_message($api_result, $is_first_failure = true) {
1818
- if (!$this->is_premium() && $this->_enable_anonymous) {
1819
- // Don't add message if it's the free version and can run anonymously.
1820
- return;
1821
- }
1822
-
1823
- if (!function_exists('wp_nonce_url')) {
1824
- require_once ABSPATH . 'wp-includes/functions.php';
1825
- }
1826
-
1827
- $current_user = self::_get_current_wp_user();
1828
- // $admin_email = get_option( 'admin_email' );
1829
- $admin_email = $current_user->user_email;
1830
-
1831
- $message = false;
1832
- if (is_object($api_result) &&
1833
- isset($api_result->error) &&
1834
- isset($api_result->error->code)
1835
- ) {
1836
- switch ($api_result->error->code) {
1837
- case 'curl_missing':
1838
- $missing_methods = '';
1839
- if (is_array($api_result->missing_methods) &&
1840
- !empty($api_result->missing_methods)
1841
- ) {
1842
- foreach ($api_result->missing_methods as $m) {
1843
- if ('curl_version' === $m) {
1844
- continue;
1845
- }
1846
-
1847
- if (!empty($missing_methods)) {
1848
- $missing_methods .= ', ';
1849
- }
1850
-
1851
- $missing_methods .= sprintf('<code>%s</code>', $m);
1852
- }
1853
-
1854
- if (!empty($missing_methods)) {
1855
- $missing_methods = sprintf(
1856
- '<br><br><b>%s</b> %s', $this->get_text('curl-disabled-methods'), $missing_methods
1857
- );
1858
- }
1859
- }
1860
-
1861
- $message = sprintf(
1862
- $this->get_text('x-requires-access-to-api') . ' ' .
1863
- $this->get_text('curl-missing-message') . ' ' .
1864
- $missing_methods .
1865
- ' %s', '<b>' . $this->get_plugin_name() . '</b>', sprintf(
1866
- '<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>', sprintf(
1867
- '<a class="fs-resolve" data-type="curl" href="#"><b>%s</b></a>%s', $this->get_text('curl-missing-no-clue-title'), ' - ' . sprintf(
1868
- $this->get_text('curl-missing-no-clue-desc'), '<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
1869
- )
1870
- ), sprintf(
1871
- '<b>%s</b> - %s', $this->get_text('sysadmin-title'), $this->get_text('curl-missing-sysadmin-desc')
1872
- ), sprintf(
1873
- '<a href="%s"><b>%s</b></a>%s', wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $this->_plugin_basename . '&amp;plugin_status=' . 'all' . '&amp;paged=' . '1' . '&amp;s=' . '', 'deactivate-plugin_' . $this->_plugin_basename), $this->get_text('deactivate-plugin-title'), ' - ' . $this->get_text('deactivate-plugin-desc')
1874
- )
1875
- )
1876
- );
1877
- break;
1878
- case 'cloudflare_ddos_protection':
1879
- $message = sprintf(
1880
- $this->get_text('x-requires-access-to-api') . ' ' .
1881
- $this->get_text('cloudflare-blocks-connection-message') . ' ' .
1882
- $this->get_text('happy-to-resolve-issue-asap') .
1883
- ' %s', '<b>' . $this->get_plugin_name() . '</b>', sprintf(
1884
- '<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>', sprintf(
1885
- '<a class="fs-resolve" data-type="cloudflare" href="#"><b>%s</b></a>%s', $this->get_text('fix-issue-title'), ' - ' . sprintf(
1886
- $this->get_text('fix-issue-desc'), '<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
1887
- )
1888
- ), sprintf(
1889
- '<a href="%s" target="_blank"><b>%s</b></a>%s', sprintf('https://wordpress.org/plugins/%s/download/', $this->_slug), $this->get_text('install-previous-title'), ' - ' . $this->get_text('install-previous-desc')
1890
- ), sprintf(
1891
- '<a href="%s"><b>%s</b></a>%s', wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $this->_plugin_basename . '&amp;plugin_status=' . 'all' . '&amp;paged=' . '1' . '&amp;s=' . '', 'deactivate-plugin_' . $this->_plugin_basename), $this->get_text('deactivate-plugin-title'), ' - ' . $this->get_text('deactivate-plugin-desc')
1892
- )
1893
- )
1894
- );
1895
- break;
1896
- case 'squid_cache_block':
1897
- $message = sprintf(
1898
- $this->get_text('x-requires-access-to-api') . ' ' .
1899
- $this->get_text('squid-blocks-connection-message') .
1900
- ' %s', '<b>' . $this->get_plugin_name() . '</b>', sprintf(
1901
- '<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>', sprintf(
1902
- '<a class="fs-resolve" data-type="squid" href="#"><b>%s</b></a>%s', $this->get_text('squid-no-clue-title'), ' - ' . sprintf(
1903
- $this->get_text('squid-no-clue-desc'), '<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
1904
- )
1905
- ), sprintf(
1906
- '<b>%s</b> - %s', $this->get_text('sysadmin-title'), sprintf(
1907
- $this->get_text('squid-sysadmin-desc'),
1908
- // We use a filter since the plugin might require additional API connectivity.
1909
- '<b>' . implode(', ', $this->apply_filters('api_domains', array('api.freemius.com'))) . '</b>')
1910
- ), sprintf(
1911
- '<a href="%s"><b>%s</b></a>%s', wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $this->_plugin_basename . '&amp;plugin_status=' . 'all' . '&amp;paged=' . '1' . '&amp;s=' . '', 'deactivate-plugin_' . $this->_plugin_basename), $this->get_text('deactivate-plugin-title'), ' - ' . $this->get_text('deactivate-plugin-desc')
1912
- )
1913
- )
1914
- );
1915
- break;
1916
- // default:
1917
- // $message = $this->get_text( 'connectivity-test-fails-message' );
1918
- // break;
1919
- }
1920
- }
1921
-
1922
- $message_id = 'failed_connect_api';
1923
- $type = 'error';
1924
-
1925
- if (false === $message) {
1926
- if ($is_first_failure) {
1927
- // First attempt failed.
1928
- $message = sprintf(
1929
- $this->get_text('x-requires-access-to-api') . ' ' .
1930
- $this->get_text('connectivity-test-fails-message') . ' ' .
1931
- $this->get_text('connectivity-test-maybe-temporary') . '<br><br>' .
1932
- '%s', '<b>' . $this->get_plugin_name() . '</b>', sprintf(
1933
- '<div id="fs_firewall_issue_options">%s %s</div>', sprintf(
1934
- '<a class="button button-primary fs-resolve" data-type="retry_ping" href="#">%s</a>', $this->get_text('yes-do-your-thing')
1935
- ), sprintf(
1936
- '<a href="%s" class="button">%s</a>', wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $this->_plugin_basename . '&amp;plugin_status=' . 'all' . '&amp;paged=' . '1' . '&amp;s=' . '', 'deactivate-plugin_' . $this->_plugin_basename), $this->get_text('no-deactivate')
1937
- )
1938
- )
1939
- );
1940
-
1941
- $message_id = 'failed_connect_api_first';
1942
- $type = 'promotion';
1943
- } else {
1944
- // Second connectivity attempt failed.
1945
- $message = sprintf(
1946
- $this->get_text('x-requires-access-to-api') . ' ' .
1947
- $this->get_text('connectivity-test-fails-message') . ' ' .
1948
- $this->get_text('happy-to-resolve-issue-asap') .
1949
- ' %s', '<b>' . $this->get_plugin_name() . '</b>', sprintf(
1950
- '<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>', sprintf(
1951
- '<a class="fs-resolve" data-type="general" href="#"><b>%s</b></a>%s', $this->get_text('fix-issue-title'), ' - ' . sprintf(
1952
- $this->get_text('fix-issue-desc'), '<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
1953
- )
1954
- ), sprintf(
1955
- '<a href="%s" target="_blank"><b>%s</b></a>%s', sprintf('https://wordpress.org/plugins/%s/download/', $this->_slug), $this->get_text('install-previous-title'), ' - ' . $this->get_text('install-previous-desc')
1956
- ), sprintf(
1957
- '<a href="%s"><b>%s</b></a>%s', wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $this->_plugin_basename . '&amp;plugin_status=' . 'all' . '&amp;paged=' . '1' . '&amp;s=' . '', 'deactivate-plugin_' . $this->_plugin_basename), $this->get_text('deactivate-plugin-title'), ' - ' . $this->get_text('deactivate-plugin-desc')
1958
- )
1959
- )
1960
- );
1961
- }
1962
- }
1963
-
1964
- $this->_admin_notices->add_sticky(
1965
- $message, $message_id, $this->get_text('oops') . '...', $type
1966
- );
1967
- }
1968
- /**
1969
- * Handle user request to resolve connectivity issue.
1970
- * This method will send an email to Freemius API technical staff for resolution.
1971
- * The email will contain server's info and installed plugins (might be caching issue).
1972
- *
1973
- * @author Vova Feldman (@svovaf)
1974
- * @since 1.0.9
1975
- */
1976
- function _email_about_firewall_issue() {
1977
- $this->_admin_notices->remove_sticky('failed_connect_api');
1978
-
1979
- $pong = $this->ping();
1980
-
1981
- $is_connected = $this->get_api_plugin_scope()->is_valid_ping($pong);
1982
-
1983
- if ($is_connected) {
1984
- $this->store_connectivity_info($pong, $is_connected);
1985
-
1986
- echo $this->get_after_plugin_activation_redirect_url();
1987
- exit;
1988
- }
1989
-
1990
- $current_user = self::_get_current_wp_user();
1991
- $admin_email = $current_user->user_email;
1992
-
1993
- $error_type = fs_request_get('error_type', 'general');
1994
-
1995
- switch ($error_type) {
1996
- case 'squid':
1997
- $title = 'Squid ACL Blocking Issue';
1998
- break;
1999
- case 'cloudflare':
2000
- $title = 'CloudFlare Blocking Issue';
2001
- break;
2002
- default:
2003
- $title = 'API Connectivity Issue';
2004
- break;
2005
- }
2006
-
2007
- $custom_email_sections = array();
2008
-
2009
- // Add 'API Error' custom email section.
2010
- $custom_email_sections['api_error'] = array(
2011
- 'title' => 'API Error',
2012
- 'rows' => array(
2013
- 'ping' => array(
2014
- 'API Error',
2015
- is_string($pong) ? htmlentities($pong) : json_encode($pong)
2016
- ),
2017
- )
2018
- );
2019
-
2020
- // Send email with technical details to resolve API connectivity issues.
2021
- $this->send_email(
2022
- 'api@freemius.com', // recipient
2023
- $title . ' [' . $this->get_plugin_name() . ']', // subject
2024
- $custom_email_sections, array("Reply-To: $admin_email <$admin_email>") // headers
2025
- );
2026
-
2027
- $this->_admin_notices->add_sticky(
2028
- sprintf(
2029
- $this->get_text('fix-request-sent-message'), '<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
2030
- ), 'server_details_sent'
2031
- );
2032
-
2033
- // Action was taken, tell that API connectivity troubleshooting should be off now.
2034
-
2035
- echo "1";
2036
- exit;
2037
- }
2038
- /**
2039
- * Handle connectivity test retry approved by the user.
2040
- *
2041
- * @author Vova Feldman (@svovaf)
2042
- * @since 1.1.7.4
2043
- */
2044
- function _retry_connectivity_test() {
2045
- $this->_admin_notices->remove_sticky('failed_connect_api_first');
2046
-
2047
- $pong = $this->ping();
2048
-
2049
- $is_connected = $this->get_api_plugin_scope()->is_valid_ping($pong);
2050
-
2051
- if ($is_connected) {
2052
- $this->store_connectivity_info($pong, $is_connected);
2053
-
2054
- echo $this->get_after_plugin_activation_redirect_url();
2055
- } else {
2056
- // Add connectivity issue message after 2nd failed attempt.
2057
- $this->_add_connectivity_issue_message($pong, false);
2058
-
2059
- echo "1";
2060
- }
2061
-
2062
- exit;
2063
- }
2064
- static function _add_firewall_issues_javascript() {
2065
- $params = array();
2066
- fs_require_once_template('firewall-issues-js.php', $params);
2067
- }
2068
- #endregion
2069
- #----------------------------------------------------------------------------------
2070
- #region Email
2071
- #----------------------------------------------------------------------------------
2072
- /**
2073
- * Generates and sends an HTML email with customizable sections.
2074
- *
2075
- * @author Leo Fajardo (@leorw)
2076
- * @since 1.1.2
2077
- *
2078
- * @param string $to_address
2079
- * @param string $subject
2080
- * @param array $sections
2081
- * @param array $headers
2082
- *
2083
- * @return bool Whether the email contents were sent successfully.
2084
- */
2085
- private function send_email(
2086
- $to_address, $subject, $sections = array(), $headers = array()
2087
- ) {
2088
- $default_sections = $this->get_email_sections();
2089
-
2090
- // Insert new sections or replace the default email sections.
2091
- if (is_array($sections) && !empty($sections)) {
2092
- foreach ($sections as $section_id => $custom_section) {
2093
- if (!isset($default_sections[$section_id])) {
2094
- // If the section does not exist, add it.
2095
- $default_sections[$section_id] = $custom_section;
2096
- } else {
2097
- // If the section already exists, override it.
2098
- $current_section = $default_sections[$section_id];
2099
-
2100
- // Replace the current section's title if a custom section title exists.
2101
- if (isset($custom_section['title'])) {
2102
- $current_section['title'] = $custom_section['title'];
2103
- }
2104
-
2105
- // Insert new rows under the current section or replace the default rows.
2106
- if (isset($custom_section['rows']) && is_array($custom_section['rows']) && !empty($custom_section['rows'])) {
2107
- foreach ($custom_section['rows'] as $row_id => $row) {
2108
- $current_section['rows'][$row_id] = $row;
2109
- }
2110
- }
2111
-
2112
- $default_sections[$section_id] = $current_section;
2113
- }
2114
- }
2115
- }
2116
-
2117
- $vars = array('sections' => $default_sections);
2118
- $message = fs_get_template('email.php', $vars);
2119
-
2120
- // Set the type of email to HTML.
2121
- $headers[] = 'Content-type: text/html; charset=UTF-8';
2122
-
2123
- $header_string = implode("\r\n", $headers);
2124
-
2125
- return wp_mail(
2126
- $to_address, $subject, $message, $header_string
2127
- );
2128
- }
2129
- /**
2130
- * Generates the data for the sections of the email content.
2131
- *
2132
- * @author Leo Fajardo (@leorw)
2133
- * @since 1.1.2
2134
- *
2135
- * @return array
2136
- */
2137
- private function get_email_sections() {
2138
- // Retrieve the current user's information so that we can get the user's email, first name, and last name below.
2139
- $current_user = self::_get_current_wp_user();
2140
-
2141
- // Retrieve the cURL version information so that we can get the version number below.
2142
- $curl_version_information = curl_version();
2143
-
2144
- $active_plugin = self::get_active_plugins();
2145
-
2146
- // Generate the list of active plugins separated by new line.
2147
- $active_plugin_string = '';
2148
- foreach ($active_plugin as $plugin) {
2149
- $active_plugin_string .= sprintf(
2150
- '<a href="%s">%s</a> [v%s]<br>', $plugin['PluginURI'], $plugin['Name'], $plugin['Version']
2151
- );
2152
- }
2153
-
2154
- $server_ip = WP_FS__REMOTE_ADDR;
2155
-
2156
- // Add PHP info for deeper investigation.
2157
- ob_start();
2158
- phpinfo();
2159
- $php_info = ob_get_clean();
2160
-
2161
- $api_domain = substr(FS_API__ADDRESS, strpos(FS_API__ADDRESS, ':') + 3);
2162
-
2163
- // Generate the default email sections.
2164
- $sections = array(
2165
- 'sdk' => array(
2166
- 'title' => 'SDK',
2167
- 'rows' => array(
2168
- 'fs_version' => array('FS Version', $this->version),
2169
- 'curl_version' => array('cURL Version', $curl_version_information['version'])
2170
- )
2171
- ),
2172
- 'plugin' => array(
2173
- 'title' => 'Plugin',
2174
- 'rows' => array(
2175
- 'name' => array('Name', $this->get_plugin_name()),
2176
- 'version' => array('Version', $this->get_plugin_version())
2177
- )
2178
- ),
2179
- 'api' => array(
2180
- 'title' => 'API Subdomain',
2181
- 'rows' => array(
2182
- 'dns' => array('DNS_CNAME', var_export(@dns_get_record($api_domain, DNS_CNAME), true)),
2183
- 'ip' => array('IP', @gethostbyname($api_domain)),
2184
- ),
2185
- ),
2186
- 'site' => array(
2187
- 'title' => 'Site',
2188
- 'rows' => array(
2189
- 'unique_id' => array('Unique ID', $this->get_anonymous_id()),
2190
- 'address' => array('Address', site_url()),
2191
- 'host' => array(
2192
- 'HTTP_HOST',
2193
- (!empty($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '' )
2194
- ),
2195
- 'hosting' => array(
2196
- 'Hosting Company' => fs_request_has('hosting_company') ?
2197
- fs_request_get('hosting_company') :
2198
- 'Unknown',
2199
- ),
2200
- 'server_addr' => array(
2201
- 'SERVER_ADDR',
2202
- '<a href="http://www.projecthoneypot.org/ip_' . $server_ip . '">' . $server_ip . '</a>'
2203
- )
2204
- )
2205
- ),
2206
- 'user' => array(
2207
- 'title' => 'User',
2208
- 'rows' => array(
2209
- 'email' => array('Email', $current_user->user_email),
2210
- 'first' => array('First', $current_user->user_firstname),
2211
- 'last' => array('Last', $current_user->user_lastname)
2212
- )
2213
- ),
2214
- 'plugins' => array(
2215
- 'title' => 'Plugins',
2216
- 'rows' => array(
2217
- 'active_plugins' => array('Active Plugins', $active_plugin_string)
2218
- )
2219
- ),
2220
- 'php_info' => array(
2221
- 'title' => 'PHP Info',
2222
- 'rows' => array(
2223
- 'info' => array($php_info)
2224
- ),
2225
- )
2226
- );
2227
-
2228
- // Allow the sections to be modified by other code.
2229
- $sections = $this->apply_filters('email_template_sections', $sections);
2230
-
2231
- return $sections;
2232
- }
2233
- #endregion
2234
- #----------------------------------------------------------------------------------
2235
- #region Initialization
2236
- #----------------------------------------------------------------------------------
2237
- /**
2238
- * Init plugin's Freemius instance.
2239
- *
2240
- * @author Vova Feldman (@svovaf)
2241
- * @since 1.0.1
2242
- *
2243
- * @param number $id
2244
- * @param string $public_key
2245
- * @param bool $is_live
2246
- * @param bool $is_premium
2247
- */
2248
- function init($id, $public_key, $is_live = true, $is_premium = true) {
2249
- $this->_logger->entrance();
2250
-
2251
- $this->dynamic_init(array(
2252
- 'id' => $id,
2253
- 'public_key' => $public_key,
2254
- 'is_live' => $is_live,
2255
- 'is_premium' => $is_premium,
2256
- ));
2257
- }
2258
- /**
2259
- * Dynamic initiator, originally created to support initiation
2260
- * with parent_id for add-ons.
2261
- *
2262
- * @author Vova Feldman (@svovaf)
2263
- * @since 1.0.6
2264
- *
2265
- * @param array $plugin_info
2266
- *
2267
- * @throws Freemius_Exception
2268
- */
2269
- function dynamic_init(array $plugin_info) {
2270
- $this->_logger->entrance();
2271
-
2272
- $this->parse_settings($plugin_info);
2273
-
2274
- if ($this->should_stop_execution()) {
2275
- return;
2276
- }
2277
-
2278
- if (!$this->is_registered()) {
2279
- if ($this->is_anonymous()) {
2280
- // If user skipped, no need to test connectivity.
2281
- $this->_has_api_connection = true;
2282
- $this->_is_on = true;
2283
- } else {
2284
- if (!$this->has_api_connectivity()) {
2285
- if ($this->_admin_notices->has_sticky('failed_connect_api_first') ||
2286
- $this->_admin_notices->has_sticky('failed_connect_api')
2287
- ) {
2288
- if (!$this->_enable_anonymous || $this->is_premium()) {
2289
- // If anonymous mode is disabled, add firewall admin-notice message.
2290
- add_action('admin_footer', array('Freemius', '_add_firewall_issues_javascript'));
2291
-
2292
- $this->add_ajax_action('resolve_firewall_issues', array(
2293
- &$this,
2294
- '_email_about_firewall_issue'
2295
- ));
2296
-
2297
- $this->add_ajax_action('retry_connectivity_test', array(
2298
- &$this,
2299
- '_retry_connectivity_test'
2300
- ));
2301
- }
2302
- }
2303
-
2304
- return;
2305
- } else {
2306
- $this->_admin_notices->remove_sticky(array(
2307
- 'failed_connect_api_first',
2308
- 'failed_connect_api',
2309
- ));
2310
-
2311
- if ($this->_anonymous_mode) {
2312
- // Simulate anonymous mode.
2313
- $this->_is_anonymous = true;
2314
- }
2315
- }
2316
- }
2317
-
2318
- // Check if Freemius is on for the current plugin.
2319
- // This MUST be executed after all the plugin variables has been loaded.
2320
- if (!$this->is_on()) {
2321
- return;
2322
- }
2323
- }
2324
-
2325
- if ($this->has_api_connectivity()) {
2326
- if ($this->is_cron()) {
2327
- $this->hook_callback_to_sync_cron();
2328
- } else if ($this->is_user_in_admin()) {
2329
- /**
2330
- * Schedule daily data sync cron if:
2331
- *
2332
- * 1. User opted-in (for tracking).
2333
- * 2. If skipped, but later upgraded (opted-in via upgrade).
2334
- *
2335
- * @author Vova Feldman (@svovaf)
2336
- * @since 1.1.7.3
2337
- *
2338
- */
2339
- if ($this->is_registered()) {
2340
- if (!$this->is_sync_cron_on() && $this->is_tracking_allowed()) {
2341
- $this->schedule_sync_cron();
2342
- }
2343
- }
2344
-
2345
- /**
2346
- * Check if requested for manual blocking background sync.
2347
- */
2348
- if (fs_request_has('background_sync')) {
2349
- $this->run_manual_sync();
2350
- }
2351
- }
2352
- }
2353
-
2354
- if ($this->is_registered()) {
2355
- $this->hook_callback_to_install_sync();
2356
- }
2357
-
2358
- if ($this->is_addon()) {
2359
- if ($this->is_parent_plugin_installed()) {
2360
- // Link to parent FS.
2361
- $this->_parent = self::get_instance_by_id($this->_plugin->parent_plugin_id);
2362
-
2363
- // Get parent plugin reference.
2364
- $this->_parent_plugin = $this->_parent->get_plugin();
2365
- }
2366
- }
2367
-
2368
- if ($this->is_user_in_admin()) {
2369
- if ($this->is_plugins_page()) {
2370
- $this->hook_plugin_action_links();
2371
- }
2372
-
2373
- if ($this->is_addon()) {
2374
- if (!$this->is_parent_plugin_installed()) {
2375
- $parent_name = $this->get_option($plugin_info, 'parent_name', null);
2376
-
2377
- if (isset($plugin_info['parent'])) {
2378
- $parent_name = $this->get_option($plugin_info['parent'], 'name', null);
2379
- }
2380
-
2381
- $this->_admin_notices->add(
2382
- (!empty($parent_name) ?
2383
- sprintf($this->get_text('addon-x-cannot-run-without-y'), $this->get_plugin_name(), $parent_name) :
2384
- sprintf($this->get_text('addon-x-cannot-run-without-parent'), $this->get_plugin_name())
2385
- ), $this->get_text('oops') . '...', 'error'
2386
- );
2387
-
2388
- return;
2389
- } else {
2390
- if ($this->_parent->is_registered() && !$this->is_registered()) {
2391
- // If parent plugin activated, automatically install add-on for the user.
2392
- $this->_activate_addon_account($this->_parent);
2393
- }
2394
-
2395
- // @todo This should be only executed on activation. It should be migrated to register_activation_hook() together with other activation related logic.
2396
- if ($this->is_premium()) {
2397
- // Remove add-on download admin-notice.
2398
- $this->_parent->_admin_notices->remove_sticky(array(
2399
- 'addon_plan_upgraded_' . $this->_slug,
2400
- 'no_addon_license_' . $this->_slug,
2401
- ));
2402
- }
2403
-
2404
- $this->deactivate_premium_only_addon_without_license();
2405
- }
2406
- } else {
2407
- if ($this->has_addons() &&
2408
- 'plugin-information' === fs_request_get('tab', false) &&
2409
- $this->get_id() == fs_request_get('parent_plugin_id', false)
2410
- ) {
2411
- require_once WP_FS__DIR_INCLUDES . '/fs-plugin-info-dialog.php';
2412
-
2413
- new FS_Plugin_Info_Dialog($this);
2414
- }
2415
- }
2416
-
2417
- add_action('admin_init', array(&$this, '_admin_init_action'));
2418
-
2419
- // if ( $this->is_registered() ||
2420
- // $this->is_anonymous() ||
2421
- // $this->is_pending_activation()
2422
- // ) {
2423
- // $this->_init_admin();
2424
- // }
2425
- }
2426
-
2427
- /**
2428
- * Should be called outside `$this->is_user_in_admin()` scope
2429
- * because the updater has some logic that needs to be executed
2430
- * during AJAX calls.
2431
- *
2432
- * Currently we need to hook to the `http_request_host_is_external` filter.
2433
- * In the future, there might be additional logic added.
2434
- *
2435
- * @author Vova Feldman
2436
- * @since 1.2.1.6
2437
- */
2438
- if ($this->is_premium() && $this->has_release_on_freemius()) {
2439
- new FS_Plugin_Updater($this);
2440
- }
2441
-
2442
- $this->do_action('initiated');
2443
-
2444
- if ($this->_storage->prev_is_premium !== $this->_plugin->is_premium) {
2445
- if (isset($this->_storage->prev_is_premium)) {
2446
- $this->apply_filters(
2447
- 'after_code_type_change',
2448
- // New code type.
2449
- $this->_plugin->is_premium
2450
- );
2451
- } else {
2452
- // Set for code type for the first time.
2453
- $this->_storage->prev_is_premium = $this->_plugin->is_premium;
2454
- }
2455
- }
2456
-
2457
- if (!$this->is_addon()) {
2458
- if ($this->is_registered()) {
2459
- // Fix for upgrade from versions < 1.0.9.
2460
- if (!isset($this->_storage->activation_timestamp)) {
2461
- $this->_storage->activation_timestamp = WP_FS__SCRIPT_START_TIME;
2462
- }
2463
-
2464
- $this->do_action('after_init_plugin_registered');
2465
- } else if ($this->is_anonymous()) {
2466
- $this->do_action('after_init_plugin_anonymous');
2467
- } else if ($this->is_pending_activation()) {
2468
- $this->do_action('after_init_plugin_pending_activations');
2469
- }
2470
- } else {
2471
- if ($this->is_registered()) {
2472
- $this->do_action('after_init_addon_registered');
2473
- } else if ($this->is_anonymous()) {
2474
- $this->do_action('after_init_addon_anonymous');
2475
- } else if ($this->is_pending_activation()) {
2476
- $this->do_action('after_init_addon_pending_activations');
2477
- }
2478
- }
2479
- }
2480
- /**
2481
- * @author Leo Fajardo (@leorw)
2482
- *
2483
- * @since 1.2.1.5
2484
- */
2485
- function _stop_tracking_callback() {
2486
- $this->_logger->entrance();
2487
-
2488
- $this->check_ajax_referer('stop_tracking');
2489
-
2490
- $result = $this->stop_tracking();
2491
-
2492
- if (true === $result) {
2493
- self::shoot_ajax_success();
2494
- }
2495
-
2496
- $this->_logger->api_error($result);
2497
-
2498
- self::shoot_ajax_failure(
2499
- $this->get_text('unexpected-api-error') .
2500
- ( $this->is_api_error($result) && isset($result->error) ?
2501
- $result->error->message :
2502
- var_export($result, true) )
2503
- );
2504
- }
2505
- /**
2506
- * @author Leo Fajardo (@leorw)
2507
- * @since 1.2.1.5
2508
- */
2509
- function _allow_tracking_callback() {
2510
- $this->_logger->entrance();
2511
-
2512
- $this->check_ajax_referer('allow_tracking');
2513
-
2514
- $result = $this->allow_tracking();
2515
-
2516
- if (true === $result) {
2517
- self::shoot_ajax_success();
2518
- }
2519
-
2520
- $this->_logger->api_error($result);
2521
-
2522
- self::shoot_ajax_failure(
2523
- $this->get_text('unexpected-api-error') .
2524
- ( $this->is_api_error($result) && isset($result->error) ?
2525
- $result->error->message :
2526
- var_export($result, true) )
2527
- );
2528
- }
2529
- /**
2530
- * Opt-out from usage tracking.
2531
- *
2532
- * Note: This will not delete the account information but will stop all tracking.
2533
- *
2534
- * Returns:
2535
- * 1. FALSE - If the user never opted-in.
2536
- * 2. TRUE - If successfully opted-out.
2537
- * 3. object - API result on failure.
2538
- *
2539
- * @author Leo Fajardo (@leorw)
2540
- * @since 1.2.1.5
2541
- *
2542
- * @return bool|object
2543
- */
2544
- function stop_tracking() {
2545
- $this->_logger->entrance();
2546
-
2547
- if (!$this->is_registered()) {
2548
- // User never opted-in.
2549
- return false;
2550
- }
2551
-
2552
- if ($this->is_tracking_prohibited()) {
2553
- // Already disconnected.
2554
- return true;
2555
- }
2556
-
2557
- // Send update to FS.
2558
- $result = $this->get_api_site_scope()->call('/?fields=is_disconnected', 'put', array(
2559
- 'is_disconnected' => true
2560
- ));
2561
-
2562
- if (!$this->is_api_result_entity($result) ||
2563
- !isset($result->is_disconnected) ||
2564
- !$result->is_disconnected
2565
- ) {
2566
- $this->_logger->api_error($result);
2567
-
2568
- return $result;
2569
- }
2570
-
2571
- $this->_site->is_disconnected = $result->is_disconnected;
2572
- $this->_store_site();
2573
-
2574
- $this->clear_sync_cron();
2575
-
2576
- // Successfully disconnected.
2577
- return true;
2578
- }
2579
- /**
2580
- * Opt-in back into usage tracking.
2581
- *
2582
- * Note: This will only work if the user opted-in previously.
2583
- *
2584
- * Returns:
2585
- * 1. FALSE - If the user never opted-in.
2586
- * 2. TRUE - If successfully opted-in back to usage tracking.
2587
- * 3. object - API result on failure.
2588
- *
2589
- * @author Leo Fajardo (@leorw)
2590
- * @since 1.2.1.5
2591
- *
2592
- * @return bool|object
2593
- */
2594
- function allow_tracking() {
2595
- $this->_logger->entrance();
2596
-
2597
- if (!$this->is_registered()) {
2598
- // User never opted-in.
2599
- return false;
2600
- }
2601
-
2602
- if ($this->is_tracking_allowed()) {
2603
- // Tracking already allowed.
2604
- return true;
2605
- }
2606
-
2607
- $result = $this->get_api_site_scope()->call('/?is_disconnected', 'put', array(
2608
- 'is_disconnected' => false
2609
- ));
2610
-
2611
- if (!$this->is_api_result_entity($result) ||
2612
- !isset($result->is_disconnected) ||
2613
- $result->is_disconnected
2614
- ) {
2615
- $this->_logger->api_error($result);
2616
-
2617
- return $result;
2618
- }
2619
-
2620
- $this->_site->is_disconnected = $result->is_disconnected;
2621
- $this->_store_site();
2622
-
2623
- $this->schedule_sync_cron();
2624
-
2625
- // Successfully reconnected.
2626
- return true;
2627
- }
2628
- /**
2629
- * If user opted-in and later disabled usage-tracking,
2630
- * re-allow tracking for licensing and updates.
2631
- *
2632
- * @author Leo Fajardo (@leorw)
2633
- *
2634
- * @since 1.2.1.5
2635
- */
2636
- private function reconnect_locally() {
2637
- $this->_logger->entrance();
2638
-
2639
- if ($this->is_tracking_prohibited() &&
2640
- $this->is_registered()
2641
- ) {
2642
- $this->_site->is_disconnected = false;
2643
- $this->_store_site();
2644
- }
2645
- }
2646
- /**
2647
- * Parse plugin's settings (as defined by the plugin dev).
2648
- *
2649
- * @author Vova Feldman (@svovaf)
2650
- * @since 1.1.7.3
2651
- *
2652
- * @param array $plugin_info
2653
- *
2654
- * @throws \Freemius_Exception
2655
- */
2656
- private function parse_settings(&$plugin_info) {
2657
- $this->_logger->entrance();
2658
-
2659
- $id = $this->get_numeric_option($plugin_info, 'id', false);
2660
- $public_key = $this->get_option($plugin_info, 'public_key', false);
2661
- $secret_key = $this->get_option($plugin_info, 'secret_key', null);
2662
- $parent_id = $this->get_numeric_option($plugin_info, 'parent_id', null);
2663
- $parent_name = $this->get_option($plugin_info, 'parent_name', null);
2664
-
2665
- /**
2666
- * @author Vova Feldman (@svovaf)
2667
- * @since 1.1.9 Try to pull secret key from external config.
2668
- */
2669
- if (is_null($secret_key) && defined("WP_FS__{$this->_slug}_SECRET_KEY")) {
2670
- $secret_key = constant("WP_FS__{$this->_slug}_SECRET_KEY");
2671
- }
2672
-
2673
- if (isset($plugin_info['parent'])) {
2674
- $parent_id = $this->get_numeric_option($plugin_info['parent'], 'id', null);
2675
- // $parent_slug = $this->get_option( $plugin_info['parent'], 'slug', null );
2676
- // $parent_public_key = $this->get_option( $plugin_info['parent'], 'public_key', null );
2677
- // $parent_name = $this->get_option( $plugin_info['parent'], 'name', null );
2678
- }
2679
-
2680
- if (false === $id) {
2681
- throw new Freemius_Exception('Plugin id parameter is not set.');
2682
- }
2683
- if (false === $public_key) {
2684
- throw new Freemius_Exception('Plugin public_key parameter is not set.');
2685
- }
2686
-
2687
- $plugin = ( $this->_plugin instanceof FS_Plugin ) ?
2688
- $this->_plugin :
2689
- new FS_Plugin();
2690
-
2691
- $plugin->update(array(
2692
- 'id' => $id,
2693
- 'public_key' => $public_key,
2694
- 'slug' => $this->_slug,
2695
- 'parent_plugin_id' => $parent_id,
2696
- 'version' => $this->get_plugin_version(),
2697
- 'title' => $this->get_plugin_name(),
2698
- 'file' => $this->_plugin_basename,
2699
- 'is_premium' => $this->get_bool_option($plugin_info, 'is_premium', true),
2700
- 'is_live' => $this->get_bool_option($plugin_info, 'is_live', true),
2701
- // 'secret_key' => $secret_key,
2702
- ));
2703
-
2704
- if ($plugin->is_updated()) {
2705
- // Update plugin details.
2706
- $this->_plugin = FS_Plugin_Manager::instance($this->_slug)->store($plugin);
2707
- }
2708
- // Set the secret key after storing the plugin, we don't want to store the key in the storage.
2709
- $this->_plugin->secret_key = $secret_key;
2710
-
2711
- if (!isset($plugin_info['menu'])) {
2712
- $plugin_info['menu'] = array();
2713
-
2714
- if (!empty($this->_storage->sdk_last_version) &&
2715
- version_compare($this->_storage->sdk_last_version, '1.1.2', '<=')
2716
- ) {
2717
- // Backward compatibility to 1.1.2
2718
- $plugin_info['menu']['slug'] = isset($plugin_info['menu_slug']) ?
2719
- $plugin_info['menu_slug'] :
2720
- $this->_slug;
2721
- }
2722
- }
2723
-
2724
- $this->_menu = FS_Admin_Menu_Manager::instance($this->_slug);
2725
- $this->_menu->init($plugin_info['menu'], $this->is_addon());
2726
-
2727
- $this->_has_addons = $this->get_bool_option($plugin_info, 'has_addons', false);
2728
- $this->_has_paid_plans = $this->get_bool_option($plugin_info, 'has_paid_plans', true);
2729
- $this->_has_premium_version = $this->get_bool_option($plugin_info, 'has_premium_version', $this->_has_paid_plans);
2730
- $this->_ignore_pending_mode = $this->get_bool_option($plugin_info, 'ignore_pending_mode', false);
2731
- $this->_is_org_compliant = $this->get_bool_option($plugin_info, 'is_org_compliant', true);
2732
- $this->_is_premium_only = $this->get_bool_option($plugin_info, 'is_premium_only', false);
2733
- if ($this->_is_premium_only) {
2734
- // If premium only plugin, disable anonymous mode.
2735
- $this->_enable_anonymous = false;
2736
- $this->_anonymous_mode = false;
2737
- } else {
2738
- $this->_enable_anonymous = $this->get_bool_option($plugin_info, 'enable_anonymous', true);
2739
- $this->_anonymous_mode = $this->get_bool_option($plugin_info, 'anonymous_mode', false);
2740
- }
2741
- $this->_permissions = $this->get_option($plugin_info, 'permissions', array());
2742
-
2743
- if (!empty($plugin_info['trial'])) {
2744
- $this->_trial_days = $this->get_numeric_option(
2745
- $plugin_info['trial'], 'days',
2746
- // Default to 0 - trial without days specification.
2747
- 0
2748
- );
2749
-
2750
- $this->_is_trial_require_payment = $this->get_bool_option($plugin_info['trial'], 'is_require_payment', false);
2751
- }
2752
- }
2753
- /**
2754
- * @param string[] $options
2755
- * @param string $key
2756
- * @param mixed $default
2757
- *
2758
- * @return bool
2759
- */
2760
- private function get_option(&$options, $key, $default = false) {
2761
- return !empty($options[$key]) ? $options[$key] : $default;
2762
- }
2763
- private function get_bool_option(&$options, $key, $default = false) {
2764
- return isset($options[$key]) && is_bool($options[$key]) ? $options[$key] : $default;
2765
- }
2766
- private function get_numeric_option(&$options, $key, $default = false) {
2767
- return isset($options[$key]) && is_numeric($options[$key]) ? $options[$key] : $default;
2768
- }
2769
- /**
2770
- * Gate keeper.
2771
- *
2772
- * @author Vova Feldman (@svovaf)
2773
- * @since 1.1.7.3
2774
- *
2775
- * @return bool
2776
- */
2777
- private function should_stop_execution() {
2778
- if (empty($this->_storage->was_plugin_loaded)) {
2779
- /**
2780
- * Don't execute Freemius until plugin was fully loaded at least once,
2781
- * to give the opportunity for the activation hook to run before pinging
2782
- * the API for connectivity test. This logic is relevant for the
2783
- * identification of new plugin install vs. plugin update.
2784
- *
2785
- * @author Vova Feldman (@svovaf)
2786
- * @since 1.1.9
2787
- */
2788
- return true;
2789
- }
2790
-
2791
- if ($this->is_activation_mode()) {
2792
- if (!is_admin()) {
2793
- /**
2794
- * If in activation mode, don't execute Freemius outside of the
2795
- * admin dashboard.
2796
- *
2797
- * @author Vova Feldman (@svovaf)
2798
- * @since 1.1.7.3
2799
- */
2800
- return true;
2801
- }
2802
-
2803
- if (!WP_FS__IS_HTTP_REQUEST) {
2804
- /**
2805
- * If in activation and executed without HTTP context (e.g. CLI, Cronjob),
2806
- * then don't start Freemius.
2807
- *
2808
- * @author Vova Feldman (@svovaf)
2809
- * @since 1.1.6.3
2810
- *
2811
- * @link https://wordpress.org/support/topic/errors-in-the-freemius-class-when-running-in-wordpress-in-cli
2812
- */
2813
- return true;
2814
- }
2815
-
2816
- if ($this->is_cron()) {
2817
- /**
2818
- * If in activation mode, don't execute Freemius during wp crons
2819
- * (wp crons have HTTP context - called as HTTP request).
2820
- *
2821
- * @author Vova Feldman (@svovaf)
2822
- * @since 1.1.7.3
2823
- */
2824
- return true;
2825
- }
2826
-
2827
- if (self::is_ajax() &&
2828
- !$this->_admin_notices->has_sticky('failed_connect_api_first') &&
2829
- !$this->_admin_notices->has_sticky('failed_connect_api')
2830
- ) {
2831
- /**
2832
- * During activation, if running in AJAX mode, unless there's a sticky
2833
- * connectivity issue notice, don't run Freemius.
2834
- *
2835
- * @author Vova Feldman (@svovaf)
2836
- * @since 1.1.7.3
2837
- */
2838
- return true;
2839
- }
2840
- }
2841
-
2842
- return false;
2843
- }
2844
- /**
2845
- * Triggered after code type has changed.
2846
- *
2847
- * @author Vova Feldman (@svovaf)
2848
- * @since 1.1.9.1
2849
- */
2850
- function _after_code_type_change() {
2851
- $this->_logger->entrance();
2852
-
2853
- add_action(is_admin() ? 'admin_init' : 'init', array(
2854
- &$this,
2855
- '_plugin_code_type_changed'
2856
- ));
2857
- }
2858
- /**
2859
- * Handles plugin's code type change (free <--> premium).
2860
- *
2861
- * @author Vova Feldman (@svovaf)
2862
- * @since 1.0.9
2863
- */
2864
- function _plugin_code_type_changed() {
2865
- $this->_logger->entrance();
2866
-
2867
- if ($this->is_premium()) {
2868
- $this->reconnect_locally();
2869
-
2870
- // Activated premium code.
2871
- $this->do_action('after_premium_version_activation');
2872
-
2873
- // Remove all sticky messages related to download of the premium version.
2874
- $this->_admin_notices->remove_sticky(array(
2875
- 'trial_started',
2876
- 'plan_upgraded',
2877
- 'plan_changed',
2878
- 'license_activated',
2879
- ));
2880
-
2881
- $this->_admin_notices->add_sticky(
2882
- $this->get_text('premium-activated-message'), 'premium_activated', $this->get_text('woot') . '!'
2883
- );
2884
- } else {
2885
- // Remove sticky message related to premium code activation.
2886
- $this->_admin_notices->remove_sticky('premium_activated');
2887
-
2888
- // Activated free code (after had the premium before).
2889
- $this->do_action('after_free_version_reactivation');
2890
-
2891
- if ($this->is_paying() && !$this->is_premium()) {
2892
- $this->_admin_notices->add_sticky(
2893
- sprintf(
2894
- $this->get_text('you-have-x-license'), $this->_site->plan->title
2895
- ) . $this->get_complete_upgrade_instructions(), 'plan_upgraded', $this->get_text('yee-haw') . '!'
2896
- );
2897
- }
2898
- }
2899
-
2900
- // Schedule code type changes event.
2901
- $this->schedule_install_sync();
2902
-
2903
- /**
2904
- * Unregister the uninstall hook for the other version of the plugin (with different code type) to avoid
2905
- * triggering a fatal error when uninstalling that plugin. For example, after deactivating the "free" version
2906
- * of a specific plugin, its uninstall hook should be unregistered after the "premium" version has been
2907
- * activated. If we don't do that, a fatal error will occur when we try to uninstall the "free" version since
2908
- * the main file of the "free" version will be loaded first before calling the hooked callback. Since the
2909
- * free and premium versions are almost identical (same class or have same functions), a fatal error like
2910
- * "Cannot redeclare class MyClass" or "Cannot redeclare my_function()" will occur.
2911
- */
2912
- $this->unregister_uninstall_hook();
2913
-
2914
- $this->clear_module_main_file_cache();
2915
-
2916
- // Update is_premium of latest version.
2917
- $this->_storage->prev_is_premium = $this->_plugin->is_premium;
2918
- }
2919
- #endregion
2920
- #----------------------------------------------------------------------------------
2921
- #region Add-ons
2922
- #----------------------------------------------------------------------------------
2923
- /**
2924
- * Check if add-on installed and activated on site.
2925
- *
2926
- * @author Vova Feldman (@svovaf)
2927
- * @since 1.0.6
2928
- *
2929
- * @param string|number $slug_or_id
2930
- * @param bool|null $is_premium Since 1.2.1.7 can check for specified add-on version.
2931
- *
2932
- * @return bool
2933
- */
2934
- function is_addon_activated($slug_or_id, $is_premium = null) {
2935
- $this->_logger->entrance();
2936
-
2937
- $is_activated = self::has_instance($slug_or_id);
2938
-
2939
- if (!$is_activated) {
2940
- return false;
2941
- }
2942
-
2943
- if (is_bool($is_premium)) {
2944
- // Check if the specified code version is activate.
2945
- $addon = $this->get_addon_instance($slug_or_id);
2946
- $is_activated = ( $is_premium === $addon->is_premium() );
2947
- }
2948
-
2949
- return $is_activated;
2950
- }
2951
- /**
2952
- * Check if add-on was connected to install
2953
- *
2954
- * @author Vova Feldman (@svovaf)
2955
- * @since 1.1.7
2956
- *
2957
- * @param string $slug
2958
- *
2959
- * @return bool
2960
- */
2961
- function is_addon_connected($slug) {
2962
- $this->_logger->entrance();
2963
-
2964
- $sites = self::get_all_sites();
2965
-
2966
- if (!isset($sites[$slug])) {
2967
- return false;
2968
- }
2969
-
2970
- $site = $sites[$slug];
2971
-
2972
- $plugin = FS_Plugin_Manager::instance($slug)->get();
2973
-
2974
- if ($plugin->parent_plugin_id != $this->_plugin->id) {
2975
- // The given slug do NOT belong to any of the plugin's add-ons.
2976
- return false;
2977
- }
2978
-
2979
- return ( is_object($site) &&
2980
- is_numeric($site->id) &&
2981
- is_numeric($site->user_id) &&
2982
- is_object($site->plan)
2983
- );
2984
- }
2985
- /**
2986
- * Determines if add-on installed.
2987
- *
2988
- * NOTE: This is a heuristic and only works if the folder/file named as the slug.
2989
- *
2990
- * @author Vova Feldman (@svovaf)
2991
- * @since 1.0.6
2992
- *
2993
- * @param string $slug
2994
- *
2995
- * @return bool
2996
- */
2997
- function is_addon_installed($slug) {
2998
- $this->_logger->entrance();
2999
-
3000
- return file_exists(fs_normalize_path(WP_PLUGIN_DIR . '/' . $this->get_addon_basename($slug)));
3001
- }
3002
- /**
3003
- * Get add-on basename.
3004
- *
3005
- * @author Vova Feldman (@svovaf)
3006
- * @since 1.0.6
3007
- *
3008
- * @param string $slug
3009
- *
3010
- * @return string
3011
- */
3012
- function get_addon_basename($slug) {
3013
- if ($this->is_addon_activated($slug)) {
3014
- self::instance($slug)->get_plugin_basename();
3015
- }
3016
-
3017
- $premium_basename = "{$slug}-premium/{$slug}.php";
3018
-
3019
- if (file_exists(fs_normalize_path(WP_PLUGIN_DIR . '/' . $premium_basename))) {
3020
- return $premium_basename;
3021
- }
3022
-
3023
- $free_basename = "{$slug}/{$slug}.php";
3024
-
3025
- return $free_basename;
3026
- }
3027
- /**
3028
- * Get installed add-ons instances.
3029
- *
3030
- * @author Vova Feldman (@svovaf)
3031
- * @since 1.0.6
3032
- *
3033
- * @return Freemius[]
3034
- */
3035
- function get_installed_addons() {
3036
- $installed_addons = array();
3037
- foreach (self::$_instances as $slug => $instance) {
3038
- if ($instance->is_addon() && is_object($instance->_parent_plugin)) {
3039
- if ($this->_plugin->id == $instance->_parent_plugin->id) {
3040
- $installed_addons[] = $instance;
3041
- }
3042
- }
3043
- }
3044
-
3045
- return $installed_addons;
3046
- }
3047
- /**
3048
- * Check if any add-ons of the plugin are installed.
3049
- *
3050
- * @author Leo Fajardo (@leorw)
3051
- * @since 1.1.1
3052
- *
3053
- * @return bool
3054
- */
3055
- function has_installed_addons() {
3056
- if (!$this->has_addons()) {
3057
- return false;
3058
- }
3059
-
3060
- foreach (self::$_instances as $slug => $instance) {
3061
- if ($instance->is_addon() && is_object($instance->_parent_plugin)) {
3062
- if ($this->_plugin->id == $instance->_parent_plugin->id) {
3063
- return true;
3064
- }
3065
- }
3066
- }
3067
-
3068
- return false;
3069
- }
3070
- /**
3071
- * Tell Freemius that the current plugin is an add-on.
3072
- *
3073
- * @author Vova Feldman (@svovaf)
3074
- * @since 1.0.6
3075
- *
3076
- * @param number $parent_plugin_id The parent plugin ID
3077
- */
3078
- function init_addon($parent_plugin_id) {
3079
- $this->_plugin->parent_plugin_id = $parent_plugin_id;
3080
- }
3081
- /**
3082
- * @author Vova Feldman (@svovaf)
3083
- * @since 1.0.6
3084
- *
3085
- * @return bool
3086
- */
3087
- function is_addon() {
3088
- return isset($this->_plugin->parent_plugin_id) && is_numeric($this->_plugin->parent_plugin_id);
3089
- }
3090
- /**
3091
- * Deactivate add-on if it's premium only and the user does't have a valid license.
3092
- *
3093
- * @param bool $is_after_trial_cancel
3094
- *
3095
- * @return bool If add-on was deactivated.
3096
- */
3097
- private function deactivate_premium_only_addon_without_license($is_after_trial_cancel = false) {
3098
- if (!$this->has_free_plan() &&
3099
- !$this->has_features_enabled_license() &&
3100
- !$this->_has_premium_license()
3101
- ) {
3102
- // IF wrapper is turned off because activation_timestamp is currently only stored for plugins (not addons).
3103
- // if (empty($this->_storage->activation_timestamp) ||
3104
- // (WP_FS__SCRIPT_START_TIME - $this->_storage->activation_timestamp) > 30
3105
- // ) {
3106
- /**
3107
- * @todo When it's first fail, there's no reason to try and re-sync because the licenses were just synced after initial activation.
3108
- *
3109
- * Retry syncing the user add-on licenses.
3110
- */
3111
- // Sync licenses.
3112
- $this->_sync_licenses();
3113
- // }
3114
- // Try to activate premium license.
3115
- $this->_activate_license(true);
3116
-
3117
- if (!$this->has_free_plan() &&
3118
- !$this->has_features_enabled_license() &&
3119
- !$this->_has_premium_license()
3120
- ) {
3121
- // @todo Check if deactivate plugins also call the deactivation hook.
3122
-
3123
- deactivate_plugins(array($this->_plugin_basename), true);
3124
-
3125
- $this->_parent->_admin_notices->add_sticky(
3126
- sprintf(
3127
- $this->_parent->get_text($is_after_trial_cancel ?
3128
- 'addon-trial-cancelled-message' :
3129
- 'addon-no-license-message'
3130
- ), '<b>' . $this->_plugin->title . '</b>'
3131
- ) . ' ' . sprintf(
3132
- '<a href="%s" aria-label="%s" class="button button-primary" style="margin-left: 10px; vertical-align: middle;">%s &nbsp;&#10140;</a>', $this->_parent->addon_url($this->_slug), esc_attr(sprintf($this->_parent->get_text('more-information-about-x'), $this->_plugin->title)), $this->_parent->get_text('purchase-license')
3133
- ), 'no_addon_license_' . $this->_slug, ( $is_after_trial_cancel ? '' : $this->_parent->get_text('oops') . '...'), ( $is_after_trial_cancel ? 'success' : 'error')
3134
- );
3135
-
3136
- return true;
3137
- }
3138
- }
3139
-
3140
- return false;
3141
- }
3142
- #endregion
3143
- #----------------------------------------------------------------------------------
3144
- #region Sandbox
3145
- #----------------------------------------------------------------------------------
3146
- /**
3147
- * Set Freemius into sandbox mode for debugging.
3148
- *
3149
- * @author Vova Feldman (@svovaf)
3150
- * @since 1.0.4
3151
- *
3152
- * @param string $secret_key
3153
- */
3154
- function init_sandbox($secret_key) {
3155
- $this->_plugin->secret_key = $secret_key;
3156
-
3157
- // Update plugin details.
3158
- FS_Plugin_Manager::instance($this->_slug)->update($this->_plugin, true);
3159
- }
3160
- /**
3161
- * Check if running payments in sandbox mode.
3162
- *
3163
- * @author Vova Feldman (@svovaf)
3164
- * @since 1.0.4
3165
- *
3166
- * @return bool
3167
- */
3168
- function is_payments_sandbox() {
3169
- return (!$this->is_live() ) || isset($this->_plugin->secret_key);
3170
- }
3171
- #endregion
3172
- /**
3173
- * Check if running test vs. live plugin.
3174
- *
3175
- * @author Vova Feldman (@svovaf)
3176
- * @since 1.0.5
3177
- *
3178
- * @return bool
3179
- */
3180
- function is_live() {
3181
- return $this->_plugin->is_live;
3182
- }
3183
- /**
3184
- * Check if the user skipped connecting the account with Freemius.
3185
- *
3186
- * @author Vova Feldman (@svovaf)
3187
- * @since 1.0.7
3188
- *
3189
- * @return bool
3190
- */
3191
- function is_anonymous() {
3192
- if (!isset($this->_is_anonymous)) {
3193
- if (!isset($this->_storage->is_anonymous)) {
3194
- // Not skipped.
3195
- $this->_is_anonymous = false;
3196
- } else if (is_bool($this->_storage->is_anonymous)) {
3197
- // For back compatibility, since the variable was boolean before.
3198
- $this->_is_anonymous = $this->_storage->is_anonymous;
3199
-
3200
- // Upgrade stored data format to 1.1.3 format.
3201
- $this->set_anonymous_mode($this->_storage->is_anonymous);
3202
- } else {
3203
- // Version 1.1.3 and later.
3204
- $this->_is_anonymous = $this->_storage->is_anonymous['is'];
3205
- }
3206
- }
3207
-
3208
- return $this->_is_anonymous;
3209
- }
3210
- /**
3211
- * Check if user connected his account and install pending email activation.
3212
- *
3213
- * @author Vova Feldman (@svovaf)
3214
- * @since 1.0.7
3215
- *
3216
- * @return bool
3217
- */
3218
- function is_pending_activation() {
3219
- return $this->_storage->get('is_pending_activation', false);
3220
- }
3221
- /**
3222
- * Check if plugin must be WordPress.org compliant.
3223
- *
3224
- * @since 1.0.7
3225
- *
3226
- * @return bool
3227
- */
3228
- function is_org_repo_compliant() {
3229
- return $this->_is_org_compliant;
3230
- }
3231
- #----------------------------------------------------------------------------------
3232
- #region Daily Sync Cron
3233
- #----------------------------------------------------------------------------------
3234
- /**
3235
- * @author Vova Feldman (@svovaf)
3236
- * @since 1.1.7.3
3237
- */
3238
- private function run_manual_sync() {
3239
- $this->require_pluggable_essentials();
3240
-
3241
- if (!$this->is_user_admin()) {
3242
- return;
3243
- }
3244
-
3245
- // Run manual sync.
3246
- $this->_sync_cron();
3247
-
3248
- // Reschedule next cron to run 24 hours from now (performance optimization).
3249
- $this->clear_sync_cron();
3250
-
3251
- $this->schedule_sync_cron(time() + WP_FS__TIME_24_HOURS_IN_SEC, false);
3252
- }
3253
- /**
3254
- * Data sync cron job. Replaces the background sync non blocking HTTP request
3255
- * that doesn't halt page loading.
3256
- *
3257
- * @author Vova Feldman (@svovaf)
3258
- * @since 1.1.7.3
3259
- */
3260
- function _sync_cron() {
3261
- $this->_logger->entrance();
3262
-
3263
- // Store the last time data sync was executed.
3264
- $this->_storage->sync_timestamp = time();
3265
-
3266
- // Check if API is temporary down.
3267
- if (FS_Api::is_temporary_down()) {
3268
- return;
3269
- }
3270
-
3271
- // @todo Add logic that identifies API latency, and reschedule the next background sync randomly between 8-16 hours.
3272
-
3273
- if ($this->is_registered()) {
3274
- if ($this->has_paid_plan()) {
3275
- // Initiate background plan sync.
3276
- $this->_sync_license(true);
3277
-
3278
- if ($this->is_paying()) {
3279
- // Check for premium plugin updates.
3280
- $this->check_updates(true);
3281
- }
3282
- } else {
3283
- // Sync install (only if something changed locally).
3284
- $this->sync_install();
3285
- }
3286
- }
3287
-
3288
- $this->do_action('after_sync_cron');
3289
- }
3290
- /**
3291
- * Check if sync was executed in the last $period of seconds.
3292
- *
3293
- * @author Vova Feldman (@svovaf)
3294
- * @since 1.1.7.3
3295
- *
3296
- * @param int $period In seconds
3297
- *
3298
- * @return bool
3299
- */
3300
- private function is_sync_executed($period = WP_FS__TIME_24_HOURS_IN_SEC) {
3301
- if (!isset($this->_storage->sync_timestamp)) {
3302
- return false;
3303
- }
3304
-
3305
- return ( $this->_storage->sync_timestamp > ( WP_FS__SCRIPT_START_TIME - $period ) );
3306
- }
3307
- /**
3308
- * @author Vova Feldman (@svovaf)
3309
- * @since 1.1.7.3
3310
- *
3311
- * @return bool
3312
- */
3313
- private function is_sync_cron_on() {
3314
- /**
3315
- * @var object $sync_cron_data
3316
- */
3317
- $sync_cron_data = $this->_storage->get('sync_cron', null);
3318
-
3319
- return (!is_null($sync_cron_data) && true === $sync_cron_data->on );
3320
- }
3321
- /**
3322
- * @author Vova Feldman (@svovaf)
3323
- * @since 1.1.7.3
3324
- *
3325
- * @param int $start_at Defaults to now.
3326
- * @param bool $randomize_start If true, schedule first job randomly during the next 12 hours. Otherwise,
3327
- * schedule job to start right away.
3328
- */
3329
- private function schedule_sync_cron($start_at = WP_FS__SCRIPT_START_TIME, $randomize_start = true) {
3330
- $this->_logger->entrance();
3331
-
3332
- if ($randomize_start) {
3333
- // Schedule first sync with a random 12 hour time range from now.
3334
- $start_at += rand(0, ( WP_FS__TIME_24_HOURS_IN_SEC / 2));
3335
- }
3336
-
3337
- // Schedule daily WP cron.
3338
- wp_schedule_event(
3339
- $start_at, 'daily', $this->get_action_tag('data_sync')
3340
- );
3341
-
3342
- $this->_storage->store('sync_cron', (object) array(
3343
- 'version' => $this->get_plugin_version(),
3344
- 'sdk_version' => $this->version,
3345
- 'timestamp' => WP_FS__SCRIPT_START_TIME,
3346
- 'on' => true,
3347
- ));
3348
- }
3349
- /**
3350
- * Add the actual sync function to the cron job hook.
3351
- *
3352
- * @author Vova Feldman (@svovaf)
3353
- * @since 1.1.7.3
3354
- */
3355
- private function hook_callback_to_sync_cron() {
3356
- $this->add_action('data_sync', array(&$this, '_sync_cron'));
3357
- }
3358
- /**
3359
- * @author Vova Feldman (@svovaf)
3360
- * @since 1.1.7.3
3361
- */
3362
- private function clear_sync_cron() {
3363
- $this->_logger->entrance();
3364
-
3365
- if (!$this->is_sync_cron_on()) {
3366
- return;
3367
- }
3368
-
3369
- $this->_storage->remove('sync_cron');
3370
-
3371
- wp_clear_scheduled_hook($this->get_action_tag('data_sync'));
3372
- }
3373
- /**
3374
- * Unix timestamp for next sync cron execution or false if not scheduled.
3375
- *
3376
- * @author Vova Feldman (@svovaf)
3377
- * @since 1.1.7.3
3378
- *
3379
- * @return int|false
3380
- */
3381
- function next_sync_cron() {
3382
- $this->_logger->entrance();
3383
-
3384
- if (!$this->is_sync_cron_on()) {
3385
- return false;
3386
- }
3387
-
3388
- return wp_next_scheduled($this->get_action_tag('data_sync'));
3389
- }
3390
- /**
3391
- * Unix timestamp for previous sync cron execution or false if never executed.
3392
- *
3393
- * @author Vova Feldman (@svovaf)
3394
- * @since 1.1.7.3
3395
- *
3396
- * @return int|false
3397
- */
3398
- function last_sync_cron() {
3399
- $this->_logger->entrance();
3400
-
3401
- return $this->_storage->get('sync_timestamp');
3402
- }
3403
- #endregion Daily Sync Cron ------------------------------------------------------------------
3404
- #----------------------------------------------------------------------------------
3405
- #region Async Install Sync
3406
- #----------------------------------------------------------------------------------
3407
- /**
3408
- * @author Vova Feldman (@svovaf)
3409
- * @since 1.1.7.3
3410
- *
3411
- * @return bool
3412
- */
3413
- private function is_install_sync_scheduled() {
3414
- /**
3415
- * @var object $cron_data
3416
- */
3417
- $cron_data = $this->_storage->get('install_sync_cron', null);
3418
-
3419
- return (!is_null($cron_data) && true === $cron_data->on );
3420
- }
3421
- /**
3422
- * Instead of running blocking install sync event, execute non blocking scheduled wp-cron.
3423
- *
3424
- * @author Vova Feldman (@svovaf)
3425
- * @since 1.1.7.3
3426
- */
3427
- private function schedule_install_sync() {
3428
- $this->_logger->entrance();
3429
-
3430
- $this->clear_install_sync_cron();
3431
-
3432
- // Schedule immediate install sync.
3433
- wp_schedule_single_event(
3434
- WP_FS__SCRIPT_START_TIME, $this->get_action_tag('install_sync')
3435
- );
3436
-
3437
- $this->_storage->store('install_sync_cron', (object) array(
3438
- 'version' => $this->get_plugin_version(),
3439
- 'sdk_version' => $this->version,
3440
- 'timestamp' => WP_FS__SCRIPT_START_TIME,
3441
- 'on' => true,
3442
- ));
3443
- }
3444
- /**
3445
- * Unix timestamp for previous install sync cron execution or false if never executed.
3446
- *
3447
- * @todo There's some very strange bug that $this->_storage->install_sync_timestamp value is not being
3448
- * updated. But for sure the sync event is working.
3449
- *
3450
- * @author Vova Feldman (@svovaf)
3451
- * @since 1.1.7.3
3452
- *
3453
- * @return int|false
3454
- */
3455
- function last_install_sync() {
3456
- $this->_logger->entrance();
3457
-
3458
- return $this->_storage->get('install_sync_timestamp');
3459
- }
3460
- /**
3461
- * Unix timestamp for next install sync cron execution or false if not scheduled.
3462
- *
3463
- * @author Vova Feldman (@svovaf)
3464
- * @since 1.1.7.3
3465
- *
3466
- * @return int|false
3467
- */
3468
- function next_install_sync() {
3469
- $this->_logger->entrance();
3470
-
3471
- if (!$this->is_install_sync_scheduled()) {
3472
- return false;
3473
- }
3474
-
3475
- return wp_next_scheduled($this->get_action_tag('install_sync'));
3476
- }
3477
- /**
3478
- * Add the actual install sync function to the cron job hook.
3479
- *
3480
- * @author Vova Feldman (@svovaf)
3481
- * @since 1.1.7.3
3482
- */
3483
- private function hook_callback_to_install_sync() {
3484
- $this->add_action('install_sync', array(&$this, '_run_sync_install'));
3485
- }
3486
- /**
3487
- * @author Vova Feldman (@svovaf)
3488
- * @since 1.1.7.3
3489
- */
3490
- private function clear_install_sync_cron() {
3491
- $this->_logger->entrance();
3492
-
3493
- if (!$this->is_install_sync_scheduled()) {
3494
- return;
3495
- }
3496
-
3497
- $this->_storage->remove('install_sync_cron');
3498
-
3499
- wp_clear_scheduled_hook($this->get_action_tag('install_sync'));
3500
- }
3501
- /**
3502
- * @author Vova Feldman (@svovaf)
3503
- * @since 1.1.7.3
3504
- */
3505
- public function _run_sync_install() {
3506
- $this->_logger->entrance();
3507
-
3508
- // Update last install sync timestamp.
3509
- $this->_storage->install_sync_timestamp = time();
3510
-
3511
- $this->sync_install(array(), true);
3512
- }
3513
- #endregion Async Install Sync ------------------------------------------------------------------
3514
- /**
3515
- * Show a notice that activation is currently pending.
3516
- *
3517
- * @author Vova Feldman (@svovaf)
3518
- * @since 1.0.7
3519
- *
3520
- * @param bool|string $email
3521
- * @param bool $is_pending_trial Since 1.2.1.5
3522
- */
3523
- function _add_pending_activation_notice($email = false, $is_pending_trial = false) {
3524
- if (!is_string($email)) {
3525
- $current_user = self::_get_current_wp_user();
3526
- $email = $current_user->user_email;
3527
- }
3528
-
3529
- $this->_admin_notices->add_sticky(
3530
- sprintf(
3531
- $this->get_text('pending-activation-message'), '<b>' . $this->get_plugin_name() . '</b>', '<b>' . $email . '</b>', $this->get_text($is_pending_trial ? 'start-the-trial' : 'complete-the-install' )
3532
- ), 'activation_pending', 'Thanks!'
3533
- );
3534
- }
3535
- /**
3536
- * Check if currently in plugin activation.
3537
- *
3538
- * @author Vova Feldman (@svovaf)
3539
- * @since 1.1.4
3540
- *
3541
- * @return bool
3542
- */
3543
- function is_plugin_activation() {
3544
- return get_option("fs_{$this->_slug}_activated", false);
3545
- }
3546
- /**
3547
- *
3548
- * NOTE: admin_menu action executed before admin_init.
3549
- *
3550
- * @author Vova Feldman (@svovaf)
3551
- * @since 1.0.7
3552
- */
3553
- function _admin_init_action() {
3554
- /**
3555
- * Automatically redirect to connect/activation page after plugin activation.
3556
- *
3557
- * @since 1.1.7 Do NOT redirect to opt-in when running in network admin mode.
3558
- */
3559
- if ($this->is_plugin_activation()) {
3560
- delete_option("fs_{$this->_slug}_activated");
3561
-
3562
- if (!function_exists('is_network_admin') || !is_network_admin()) {
3563
- $this->_redirect_on_activation_hook();
3564
-
3565
- return;
3566
- }
3567
- }
3568
-
3569
- if (fs_request_is_action($this->_slug . '_skip_activation')) {
3570
- check_admin_referer($this->_slug . '_skip_activation');
3571
-
3572
- $this->skip_connection();
3573
-
3574
- fs_redirect($this->get_after_activation_url('after_skip_url'));
3575
- }
3576
-
3577
- if (!$this->is_addon() && !$this->is_registered() && !$this->is_anonymous()) {
3578
- if (!$this->is_pending_activation()) {
3579
- if (!$this->_menu->is_main_settings_page()) {
3580
- if ($this->is_plugin_new_install() || $this->is_only_premium()) {
3581
- // Show notice for new plugin installations.
3582
- $this->_admin_notices->add(
3583
- sprintf(
3584
- $this->get_text('you-are-step-away'), sprintf('<b><a href="%s">%s</a></b>', $this->get_activation_url(), sprintf($this->get_text('activate-x-now'), $this->get_plugin_name())
3585
- )
3586
- ), '', 'update-nag'
3587
- );
3588
- } else {
3589
- if (!isset($this->_storage->sticky_optin_added)) {
3590
- $this->_storage->sticky_optin_added = true;
3591
-
3592
- // Show notice for new plugin installations.
3593
- $this->_admin_notices->add_sticky(
3594
- sprintf(
3595
- $this->get_text('few-plugin-tweaks'), sprintf('<b><a href="%s">%s</a></b>', $this->get_activation_url(), sprintf($this->get_text('optin-x-now'), $this->get_plugin_name())
3596
- )
3597
- ), 'connect_account', '', 'update-nag'
3598
- );
3599
- }
3600
-
3601
- if ($this->has_filter('optin_pointer_element')) {
3602
- // Don't show admin nag if plugin update.
3603
- wp_enqueue_script('wp-pointer');
3604
- wp_enqueue_style('wp-pointer');
3605
-
3606
- $this->_enqueue_connect_essentials();
3607
-
3608
- add_action('admin_print_footer_scripts', array(
3609
- $this,
3610
- '_add_connect_pointer_script'
3611
- ));
3612
- }
3613
- }
3614
- }
3615
- }
3616
- }
3617
-
3618
- $this->_add_upgrade_action_link();
3619
- }
3620
- /**
3621
- * Enqueue connect requires scripts and styles.
3622
- *
3623
- * @author Vova Feldman (@svovaf)
3624
- * @since 1.1.4
3625
- */
3626
- function _enqueue_connect_essentials() {
3627
- wp_enqueue_script('jquery');
3628
- wp_enqueue_script('json2');
3629
-
3630
- fs_enqueue_local_script('postmessage', 'nojquery.ba-postmessage.min.js');
3631
- fs_enqueue_local_script('fs-postmessage', 'postmessage.js');
3632
-
3633
- fs_enqueue_local_style('fs_connect', '/admin/connect.css');
3634
- }
3635
- /**
3636
- * Add connect / opt-in pointer.
3637
- *
3638
- * @author Vova Feldman (@svovaf)
3639
- * @since 1.1.4
3640
- */
3641
- function _add_connect_pointer_script() {
3642
- $vars = array('slug' => $this->_slug);
3643
- $pointer_content = fs_get_template('connect.php', $vars);
3644
- ?>
3645
- <script type="text/javascript">// <![CDATA[
3646
- jQuery(document).ready(function ($) {
3647
- if ('undefined' !== typeof (jQuery().pointer)) {
3648
-
3649
- var element = <?php echo $this->apply_filters('optin_pointer_element', '$("#non_existing_element");') ?>;
3650
-
3651
- if (element.length > 0) {
3652
- var optin = $(element).pointer($.extend(true, {}, {
3653
- content: <?php echo json_encode($pointer_content) ?>,
3654
- position: {
3655
- edge: 'left',
3656
- align: 'center'
3657
- },
3658
- buttons: function () {
3659
- // Don't show pointer buttons.
3660
- return '';
3661
- },
3662
- pointerWidth: 482
3663
- }, <?php echo $this->apply_filters('optin_pointer_options_json', '{}') ?>));
3664
-
3665
- <?php echo $this->apply_filters('optin_pointer_execute', "
3666
-
3667
- optin.pointer('open');
3668
-
3669
- // Tag the opt-in pointer with custom class.
3670
- $('.wp-pointer #fs_connect')
3671
- .parents('.wp-pointer.wp-pointer-top')
3672
- .addClass('fs-opt-in-pointer');
3673
-
3674
- ", 'element', 'optin') ?>
3675
- }
3676
- }
3677
- });
3678
- // ]]></script>
3679
- <?php
3680
- }
3681
- /**
3682
- * Return current page's URL.
3683
- *
3684
- * @author Vova Feldman (@svovaf)
3685
- * @since 1.0.7
3686
- *
3687
- * @return string
3688
- */
3689
- function current_page_url() {
3690
- $url = 'http';
3691
-
3692
- if (isset($_SERVER["HTTPS"])) {
3693
- if ($_SERVER["HTTPS"] == "on") {
3694
- $url .= "s";
3695
- }
3696
- }
3697
- $url .= "://";
3698
- if ($_SERVER["SERVER_PORT"] != "80") {
3699
- $url .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
3700
- } else {
3701
- $url .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
3702
- }
3703
-
3704
- return esc_url($url);
3705
- }
3706
- /**
3707
- * Check if the current page is the plugin's main admin settings page.
3708
- *
3709
- * @author Vova Feldman (@svovaf)
3710
- * @since 1.0.7
3711
- *
3712
- * @return bool
3713
- */
3714
- function _is_plugin_page() {
3715
- return fs_is_plugin_page($this->_menu->get_raw_slug()) ||
3716
- fs_is_plugin_page($this->_slug);
3717
- }
3718
- /* Events
3719
- ------------------------------------------------------------------------------------------------------------------ */
3720
- /**
3721
- * Delete site install from Database.
3722
- *
3723
- * @author Vova Feldman (@svovaf)
3724
- * @since 1.0.1
3725
- *
3726
- * @param bool $store
3727
- */
3728
- function _delete_site($store = true) {
3729
- $sites = self::get_all_sites();
3730
-
3731
- if (isset($sites[$this->_slug])) {
3732
- unset($sites[$this->_slug]);
3733
- }
3734
-
3735
- self::$_accounts->set_option('sites', $sites, $store);
3736
- }
3737
- /**
3738
- * Delete plugin's plans information.
3739
- *
3740
- * @param bool $store Flush to Database if true.
3741
- *
3742
- * @author Vova Feldman (@svovaf)
3743
- * @since 1.0.9
3744
- */
3745
- private function _delete_plans($store = true) {
3746
- $this->_logger->entrance();
3747
-
3748
- $plans = self::get_all_plans();
3749
-
3750
- unset($plans[$this->_slug]);
3751
-
3752
- self::$_accounts->set_option('plans', $plans, $store);
3753
- }
3754
- /**
3755
- * Delete all plugin licenses.
3756
- *
3757
- * @author Vova Feldman (@svovaf)
3758
- * @since 1.0.9
3759
- *
3760
- * @param bool $store
3761
- * @param string|bool $plugin_slug
3762
- */
3763
- private function _delete_licenses($store = true, $plugin_slug = false) {
3764
- $this->_logger->entrance();
3765
-
3766
- $all_licenses = self::get_all_licenses();
3767
-
3768
- if (!is_string($plugin_slug)) {
3769
- $plugin_slug = $this->_slug;
3770
- }
3771
-
3772
- unset($all_licenses[$plugin_slug]);
3773
-
3774
- self::$_accounts->set_option('licenses', $all_licenses, $store);
3775
- }
3776
- /**
3777
- * Check if Freemius was added on new plugin installation.
3778
- *
3779
- * @author Vova Feldman (@svovaf)
3780
- * @since 1.1.5
3781
- *
3782
- * @return bool
3783
- */
3784
- function is_plugin_new_install() {
3785
- return isset($this->_storage->is_plugin_new_install) &&
3786
- $this->_storage->is_plugin_new_install;
3787
- }
3788
- /**
3789
- * Check if it's the first plugin release that is running Freemius.
3790
- *
3791
- * @author Vova Feldman (@svovaf)
3792
- * @since 1.2.1.5
3793
- *
3794
- * @return bool
3795
- */
3796
- function is_first_freemius_powered_version() {
3797
- return empty($this->_storage->plugin_last_version);
3798
- }
3799
- /**
3800
- * Plugin activated hook.
3801
- *
3802
- * @author Vova Feldman (@svovaf)
3803
- * @since 1.0.1
3804
- *
3805
- * @uses FS_Api
3806
- */
3807
- function _activate_plugin_event_hook() {
3808
- $this->_logger->entrance('slug = ' . $this->_slug);
3809
-
3810
- if (!$this->is_user_admin()) {
3811
- return;
3812
- }
3813
-
3814
- $this->unregister_uninstall_hook();
3815
-
3816
- // Clear API cache on activation.
3817
- FS_Api::clear_cache();
3818
-
3819
- if ($this->is_registered()) {
3820
- $is_premium_version_activation = ( current_filter() !== ( 'activate_' . $this->_free_plugin_basename ) );
3821
-
3822
- if ($is_premium_version_activation) {
3823
- $this->reconnect_locally();
3824
- }
3825
-
3826
- $this->_logger->info('Activating ' . ( $is_premium_version_activation ? 'premium' : 'free' ) . ' plugin version.');
3827
-
3828
- // Schedule re-activation event and sync.
3829
- // $this->sync_install( array(), true );
3830
- $this->schedule_install_sync();
3831
-
3832
- // 1. If running in the activation of the FREE module, get the basename of the PREMIUM.
3833
- // 2. If running in the activation of the PREMIUM module, get the basename of the FREE.
3834
- $other_version_basename = $is_premium_version_activation ?
3835
- $this->_free_plugin_basename :
3836
- $this->premium_plugin_basename();
3837
-
3838
- /**
3839
- * If the other module version is activate, deactivate it.
3840
- *
3841
- * @author Leo Fajardo (@leorw)
3842
- * @since 1.2.2
3843
- */
3844
- if (is_plugin_active($other_version_basename)) {
3845
- deactivate_plugins($other_version_basename);
3846
- }
3847
-
3848
- // If activating the premium module version, add an admin notice to congratulate for an upgrade completion.
3849
- if ($is_premium_version_activation) {
3850
- $this->_admin_notices->add(
3851
- sprintf($this->get_text('successful-version-upgrade-message'), sprintf('<b>%s</b>', $this->_plugin->title)), $this->get_text('woot') . '!'
3852
- );
3853
- }
3854
- } else if ($this->is_anonymous()) {
3855
- /**
3856
- * Reset "skipped" click cache on the following:
3857
- * 1. Development mode.
3858
- * 2. If the user skipped the exact same version before.
3859
- *
3860
- * @todo 3. If explicitly asked to retry after every activation.
3861
- */
3862
- if (WP_FS__DEV_MODE ||
3863
- $this->get_plugin_version() == $this->_storage->is_anonymous['version']
3864
- ) {
3865
- $this->reset_anonymous_mode();
3866
- }
3867
- }
3868
-
3869
- if (!isset($this->_storage->is_plugin_new_install)) {
3870
- /**
3871
- * If no previous version of plugin's version exist, it means that it's either
3872
- * the first time that the plugin installed on the site, or the plugin was installed
3873
- * before but didn't have Freemius integrated.
3874
- *
3875
- * Since register_activation_hook() do NOT fires on updates since 3.1, and only fires
3876
- * on manual activation via the dashboard, is_plugin_activation() is TRUE
3877
- * only after immediate activation.
3878
- *
3879
- * @since 1.1.4
3880
- * @link https://make.wordpress.org/core/2010/10/27/plugin-activation-hooks-no-longer-fire-for-updates/
3881
- */
3882
- $this->_storage->is_plugin_new_install = empty($this->_storage->plugin_last_version);
3883
- }
3884
-
3885
- if (!$this->_anonymous_mode &&
3886
- $this->has_api_connectivity(WP_FS__DEV_MODE) &&
3887
- !$this->_isAutoInstall
3888
- ) {
3889
- // Store hint that the plugin was just activated to enable auto-redirection to settings.
3890
- add_option("fs_{$this->_slug}_activated", true);
3891
- }
3892
-
3893
- /**
3894
- * Activation hook is executed after the plugin's main file is loaded, therefore,
3895
- * after the plugin was loaded. The logic is located at activate_plugin()
3896
- * ./wp-admin/includes/plugin.php.
3897
- *
3898
- * @author Vova Feldman (@svovaf)
3899
- * @since 1.1.9
3900
- */
3901
- $this->_storage->was_plugin_loaded = true;
3902
- }
3903
- /**
3904
- * Delete account.
3905
- *
3906
- * @author Vova Feldman (@svovaf)
3907
- * @since 1.0.3
3908
- *
3909
- * @param bool $check_user Enforce checking if user have plugins activation privileges.
3910
- */
3911
- function delete_account_event($check_user = true) {
3912
- $this->_logger->entrance('slug = ' . $this->_slug);
3913
-
3914
- if ($check_user && !$this->is_user_admin()) {
3915
- return;
3916
- }
3917
-
3918
- $this->do_action('before_account_delete');
3919
-
3920
- // Clear all admin notices.
3921
- $this->_admin_notices->clear_all_sticky();
3922
-
3923
- $this->_delete_site(false);
3924
-
3925
- $this->_delete_plans(false);
3926
-
3927
- $this->_delete_licenses(false);
3928
-
3929
- // Delete add-ons related to plugin's account.
3930
- $this->_delete_account_addons(false);
3931
-
3932
- // @todo Delete plans and licenses of add-ons.
3933
-
3934
- self::$_accounts->store();
3935
-
3936
- /**
3937
- * IMPORTANT:
3938
- * Clear crons must be executed before clearing all storage.
3939
- * Otherwise, the cron will not be cleared.
3940
- */
3941
- $this->clear_sync_cron();
3942
- $this->clear_install_sync_cron();
3943
-
3944
- // Clear all storage data.
3945
- $this->_storage->clear_all(true, array(
3946
- 'connectivity_test',
3947
- 'is_on',
3948
- ));
3949
-
3950
- // Send delete event.
3951
- $this->get_api_site_scope()->call('/', 'delete');
3952
-
3953
- $this->do_action('after_account_delete');
3954
- }
3955
- /**
3956
- * Plugin deactivation hook.
3957
- *
3958
- * @author Vova Feldman (@svovaf)
3959
- * @since 1.0.1
3960
- */
3961
- function _deactivate_plugin_hook() {
3962
- $this->_logger->entrance('slug = ' . $this->_slug);
3963
-
3964
- if (!current_user_can('activate_plugins')) {
3965
- return;
3966
- }
3967
-
3968
- $this->_admin_notices->clear_all_sticky();
3969
- if (isset($this->_storage->sticky_optin_added)) {
3970
- unset($this->_storage->sticky_optin_added);
3971
- }
3972
-
3973
- if (!isset($this->_storage->is_plugin_new_install)) {
3974
- // Remember that plugin was already installed.
3975
- $this->_storage->is_plugin_new_install = false;
3976
- }
3977
-
3978
- // Hook to plugin uninstall.
3979
- register_uninstall_hook($this->_plugin_main_file_path, array('Freemius', '_uninstall_plugin_hook'));
3980
-
3981
- $this->clear_module_main_file_cache();
3982
- $this->clear_sync_cron();
3983
- $this->clear_install_sync_cron();
3984
-
3985
- if ($this->is_registered()) {
3986
- // Send deactivation event.
3987
- $this->sync_install(array(
3988
- 'is_active' => false,
3989
- ));
3990
- } else {
3991
- if (!$this->has_api_connectivity()) {
3992
- // Reset connectivity test cache.
3993
- unset($this->_storage->connectivity_test);
3994
- }
3995
- }
3996
-
3997
- // Clear API cache on deactivation.
3998
- FS_Api::clear_cache();
3999
-
4000
- $this->remove_sdk_reference();
4001
- }
4002
- /**
4003
- * @author Vova Feldman (@svovaf)
4004
- * @since 1.1.6
4005
- */
4006
- private function remove_sdk_reference() {
4007
- global $fs_active_plugins;
4008
-
4009
- foreach ($fs_active_plugins->plugins as $sdk_path => &$data) {
4010
- if ($this->_plugin_basename == $data->plugin_path) {
4011
- unset($fs_active_plugins->plugins[$sdk_path]);
4012
- break;
4013
- }
4014
- }
4015
-
4016
- fs_fallback_to_newest_active_sdk();
4017
- }
4018
- /**
4019
- * @author Vova Feldman (@svovaf)
4020
- * @since 1.1.3
4021
- *
4022
- * @param bool $is_anonymous
4023
- */
4024
- private function set_anonymous_mode($is_anonymous = true) {
4025
- // Store information regarding skip to try and opt-in the user
4026
- // again in the future.
4027
- $this->_storage->is_anonymous = array(
4028
- 'is' => $is_anonymous,
4029
- 'timestamp' => WP_FS__SCRIPT_START_TIME,
4030
- 'version' => $this->get_plugin_version(),
4031
- );
4032
-
4033
- // Update anonymous mode cache.
4034
- $this->_is_anonymous = $is_anonymous;
4035
- }
4036
- /**
4037
- * @author Vova Feldman (@svovaf)
4038
- * @since 1.1.3
4039
- */
4040
- private function reset_anonymous_mode() {
4041
- unset($this->_storage->is_anonymous);
4042
- }
4043
- /**
4044
- * Clears the anonymous mode and redirects to the opt-in screen.
4045
- *
4046
- * @author Vova Feldman (@svovaf)
4047
- * @since 1.1.7
4048
- */
4049
- function connect_again() {
4050
- if (!$this->is_anonymous()) {
4051
- return;
4052
- }
4053
-
4054
- $this->reset_anonymous_mode();
4055
-
4056
- fs_redirect($this->get_activation_url());
4057
- }
4058
- /**
4059
- * Skip account connect, and set anonymous mode.
4060
- *
4061
- * @author Vova Feldman (@svovaf)
4062
- * @since 1.1.1
4063
- */
4064
- private function skip_connection() {
4065
- $this->_logger->entrance();
4066
-
4067
- $this->_admin_notices->remove_sticky('connect_account');
4068
-
4069
- $this->set_anonymous_mode();
4070
-
4071
- // Send anonymous skip event.
4072
- // No user identified info nor any tracking will be sent after the user skips the opt-in.
4073
- $this->get_api_plugin_scope()->call('skip.json', 'put', array(
4074
- 'uid' => $this->get_anonymous_id(),
4075
- ));
4076
- }
4077
- /**
4078
- * Plugin version update hook.
4079
- *
4080
- * @author Vova Feldman (@svovaf)
4081
- * @since 1.0.4
4082
- */
4083
- private function update_plugin_version_event() {
4084
- $this->_logger->entrance();
4085
-
4086
- if (!$this->is_registered()) {
4087
- return;
4088
- }
4089
-
4090
- $this->schedule_install_sync();
4091
- // $this->sync_install( array(), true );
4092
- }
4093
- /**
4094
- * Return a list of modified plugins since the last sync.
4095
- *
4096
- * Note:
4097
- * There's no point to store a plugins counter since even if the number of
4098
- * plugins didn't change, we still need to check if the versions are all the
4099
- * same and the activity state is similar.
4100
- *
4101
- * @author Vova Feldman (@svovaf)
4102
- * @since 1.1.8
4103
- *
4104
- * @return array|false
4105
- */
4106
- private function get_plugins_data_for_api() {
4107
- // Alias.
4108
- $option_name = 'all_plugins';
4109
-
4110
- $all_cached_plugins = self::$_accounts->get_option($option_name);
4111
-
4112
- if (!is_object($all_cached_plugins)) {
4113
- $all_cached_plugins = (object) array(
4114
- 'timestamp' => '',
4115
- 'md5' => '',
4116
- 'plugins' => array(),
4117
- );
4118
- }
4119
-
4120
- $time = time();
4121
-
4122
- if (!empty($all_cached_plugins->timestamp) &&
4123
- ( $time - $all_cached_plugins->timestamp ) < WP_FS__TIME_5_MIN_IN_SEC
4124
- ) {
4125
- // Don't send plugin updates if last update was in the past 5 min.
4126
- return false;
4127
- }
4128
-
4129
- // Write timestamp to lock the logic.
4130
- $all_cached_plugins->timestamp = $time;
4131
- self::$_accounts->set_option($option_name, $all_cached_plugins, true);
4132
-
4133
- // Reload options from DB.
4134
- self::$_accounts->load(true);
4135
- $all_cached_plugins = self::$_accounts->get_option($option_name);
4136
-
4137
- if ($time != $all_cached_plugins->timestamp) {
4138
- // If timestamp is different, then another thread captured the lock.
4139
- return false;
4140
- }
4141
-
4142
- // Check if there's a change in plugins.
4143
- $all_plugins = self::get_all_plugins();
4144
-
4145
- // Check if plugins changed.
4146
- ksort($all_plugins);
4147
-
4148
- $plugins_signature = '';
4149
- foreach ($all_plugins as $basename => $data) {
4150
- $plugins_signature .= $data['slug'] . ',' .
4151
- $data['Version'] . ',' .
4152
- ( $data['is_active'] ? '1' : '0' ) . ';';
4153
- }
4154
-
4155
- // Check if plugins status changed (version or active/inactive).
4156
- $plugins_changed = ( $all_cached_plugins->md5 !== md5($plugins_signature) );
4157
-
4158
- $plugins_update_data = array();
4159
-
4160
- if ($plugins_changed) {
4161
- // Change in plugins, report changes.
4162
- // Update existing plugins info.
4163
- foreach ($all_cached_plugins->plugins as $basename => $data) {
4164
- if (!isset($all_plugins[$basename])) {
4165
- // Plugin uninstalled.
4166
- $uninstalled_plugin_data = $data;
4167
- $uninstalled_plugin_data['is_active'] = false;
4168
- $uninstalled_plugin_data['is_uninstalled'] = true;
4169
- $plugins_update_data[] = $uninstalled_plugin_data;
4170
-
4171
- unset($all_plugins[$basename]);
4172
- unset($all_cached_plugins->plugins[$basename]);
4173
- } else if ($data['is_active'] !== $all_plugins[$basename]['is_active'] ||
4174
- $data['version'] !== $all_plugins[$basename]['Version']
4175
- ) {
4176
- // Plugin activated or deactivated, or version changed.
4177
- $all_cached_plugins->plugins[$basename]['is_active'] = $all_plugins[$basename]['is_active'];
4178
- $all_cached_plugins->plugins[$basename]['version'] = $all_plugins[$basename]['Version'];
4179
-
4180
- $plugins_update_data[] = $all_cached_plugins->plugins[$basename];
4181
- }
4182
- }
4183
-
4184
- // Find new plugins that weren't yet seen before.
4185
- foreach ($all_plugins as $basename => $data) {
4186
- if (!isset($all_cached_plugins->plugins[$basename])) {
4187
- // New plugin.
4188
- $new_plugin = array(
4189
- 'slug' => $data['slug'],
4190
- 'version' => $data['Version'],
4191
- 'title' => $data['Name'],
4192
- 'is_active' => $data['is_active'],
4193
- 'is_uninstalled' => false,
4194
- );
4195
-
4196
- $plugins_update_data[] = $new_plugin;
4197
- $all_cached_plugins->plugins[$basename] = $new_plugin;
4198
- }
4199
- }
4200
-
4201
- $all_cached_plugins->md5 = md5($plugins_signature);
4202
- $all_cached_plugins->timestamp = $time;
4203
- self::$_accounts->set_option($option_name, $all_cached_plugins, true);
4204
- }
4205
-
4206
- return $plugins_update_data;
4207
- }
4208
- /**
4209
- * Return a list of modified themes since the last sync.
4210
- *
4211
- * Note:
4212
- * There's no point to store a themes counter since even if the number of
4213
- * themes didn't change, we still need to check if the versions are all the
4214
- * same and the activity state is similar.
4215
- *
4216
- * @author Vova Feldman (@svovaf)
4217
- * @since 1.1.8
4218
- *
4219
- * @return array|false
4220
- */
4221
- private function get_themes_data_for_api() {
4222
- // Alias.
4223
- $option_name = 'all_themes';
4224
-
4225
- $all_cached_themes = self::$_accounts->get_option($option_name);
4226
-
4227
- if (!is_object($all_cached_themes)) {
4228
- $all_cached_themes = (object) array(
4229
- 'timestamp' => '',
4230
- 'md5' => '',
4231
- 'themes' => array(),
4232
- );
4233
- }
4234
-
4235
- $time = time();
4236
-
4237
- if (!empty($all_cached_themes->timestamp) &&
4238
- ( $time - $all_cached_themes->timestamp ) < WP_FS__TIME_5_MIN_IN_SEC
4239
- ) {
4240
- // Don't send theme updates if last update was in the past 5 min.
4241
- return false;
4242
- }
4243
-
4244
- // Write timestamp to lock the logic.
4245
- $all_cached_themes->timestamp = $time;
4246
- self::$_accounts->set_option($option_name, $all_cached_themes, true);
4247
-
4248
- // Reload options from DB.
4249
- self::$_accounts->load(true);
4250
- $all_cached_themes = self::$_accounts->get_option($option_name);
4251
-
4252
- if ($time != $all_cached_themes->timestamp) {
4253
- // If timestamp is different, then another thread captured the lock.
4254
- return false;
4255
- }
4256
-
4257
- // Get active theme.
4258
- $active_theme = wp_get_theme();
4259
- $active_theme_stylesheet = $active_theme->get_stylesheet();
4260
-
4261
- // Check if there's a change in themes.
4262
- $all_themes = wp_get_themes();
4263
-
4264
- // Check if themes changed.
4265
- ksort($all_themes);
4266
-
4267
- $themes_signature = '';
4268
- foreach ($all_themes as $slug => $data) {
4269
- $is_active = ( $slug === $active_theme_stylesheet );
4270
- $themes_signature .= $slug . ',' .
4271
- $data->version . ',' .
4272
- ( $is_active ? '1' : '0' ) . ';';
4273
- }
4274
-
4275
- // Check if themes status changed (version or active/inactive).
4276
- $themes_changed = ( $all_cached_themes->md5 !== md5($themes_signature) );
4277
-
4278
- $themes_update_data = array();
4279
-
4280
- if ($themes_changed) {
4281
- // Change in themes, report changes.
4282
- // Update existing themes info.
4283
- foreach ($all_cached_themes->themes as $slug => $data) {
4284
- $is_active = ( $slug === $active_theme_stylesheet );
4285
-
4286
- if (!isset($all_themes[$slug])) {
4287
- // Plugin uninstalled.
4288
- $uninstalled_theme_data = $data;
4289
- $uninstalled_theme_data['is_active'] = false;
4290
- $uninstalled_theme_data['is_uninstalled'] = true;
4291
- $themes_update_data[] = $uninstalled_theme_data;
4292
-
4293
- unset($all_themes[$slug]);
4294
- unset($all_cached_themes->themes[$slug]);
4295
- } else if ($data['is_active'] !== $is_active ||
4296
- $data['version'] !== $all_themes[$slug]->version
4297
- ) {
4298
- // Plugin activated or deactivated, or version changed.
4299
-
4300
- $all_cached_themes->themes[$slug]['is_active'] = $is_active;
4301
- $all_cached_themes->themes[$slug]['version'] = $all_themes[$slug]->version;
4302
-
4303
- $themes_update_data[] = $all_cached_themes->themes[$slug];
4304
- }
4305
- }
4306
-
4307
- // Find new themes that weren't yet seen before.
4308
- foreach ($all_themes as $slug => $data) {
4309
- if (!isset($all_cached_themes->themes[$slug])) {
4310
- $is_active = ( $slug === $active_theme_stylesheet );
4311
-
4312
- // New plugin.
4313
- $new_plugin = array(
4314
- 'slug' => $slug,
4315
- 'version' => $data->version,
4316
- 'title' => $data->name,
4317
- 'is_active' => $is_active,
4318
- 'is_uninstalled' => false,
4319
- );
4320
-
4321
- $themes_update_data[] = $new_plugin;
4322
- $all_cached_themes->themes[$slug] = $new_plugin;
4323
- }
4324
- }
4325
-
4326
- $all_cached_themes->md5 = md5($themes_signature);
4327
- $all_cached_themes->timestamp = time();
4328
- self::$_accounts->set_option($option_name, $all_cached_themes, true);
4329
- }
4330
-
4331
- return $themes_update_data;
4332
- }
4333
- /**
4334
- * Update install details.
4335
- *
4336
- * @author Vova Feldman (@svovaf)
4337
- * @since 1.1.2
4338
- *
4339
- * @param string[] string $override
4340
- * @param bool $include_plugins Since 1.1.8 by default include plugin changes.
4341
- * @param bool $include_themes Since 1.1.8 by default include plugin changes.
4342
- *
4343
- * @return array
4344
- */
4345
- private function get_install_data_for_api(
4346
- array $override, $include_plugins = true, $include_themes = true
4347
- ) {
4348
- /**
4349
- * @since 1.1.8 Also send plugin updates.
4350
- */
4351
- if ($include_plugins && !isset($override['plugins'])) {
4352
- $plugins = $this->get_plugins_data_for_api();
4353
- if (!empty($plugins)) {
4354
- $override['plugins'] = $plugins;
4355
- }
4356
- }
4357
- /**
4358
- * @since 1.1.8 Also send themes updates.
4359
- */
4360
- if ($include_themes && !isset($override['themes'])) {
4361
- $themes = $this->get_themes_data_for_api();
4362
- if (!empty($themes)) {
4363
- $override['themes'] = $themes;
4364
- }
4365
- }
4366
-
4367
- return array_merge(array(
4368
- 'version' => $this->get_plugin_version(),
4369
- 'is_premium' => $this->is_premium(),
4370
- 'language' => get_bloginfo('language'),
4371
- 'charset' => get_bloginfo('charset'),
4372
- 'platform_version' => get_bloginfo('version'),
4373
- 'sdk_version' => $this->version,
4374
- 'programming_language_version' => phpversion(),
4375
- 'title' => get_bloginfo('name'),
4376
- 'url' => get_site_url(),
4377
- // Special params.
4378
- 'is_active' => true,
4379
- 'is_disconnected' => $this->is_tracking_prohibited(),
4380
- 'is_uninstalled' => false,
4381
- ), $override);
4382
- }
4383
- /**
4384
- * Update install only if changed.
4385
- *
4386
- * @author Vova Feldman (@svovaf)
4387
- * @since 1.0.9
4388
- *
4389
- * @param string[] string $override
4390
- * @param bool $flush
4391
- *
4392
- * @return false|object|string
4393
- */
4394
- private function send_install_update($override = array(), $flush = false) {
4395
- $this->_logger->entrance();
4396
-
4397
- $check_properties = $this->get_install_data_for_api($override);
4398
-
4399
- if ($flush) {
4400
- $params = $check_properties;
4401
- } else {
4402
- $params = array();
4403
- $special = array();
4404
- $special_override = false;
4405
-
4406
- foreach ($check_properties as $p => $v) {
4407
- if (property_exists($this->_site, $p)) {
4408
- if (( is_bool($this->_site->{$p}) || !empty($this->_site->{$p}) ) &&
4409
- $this->_site->{$p} != $v
4410
- ) {
4411
- $this->_site->{$p} = $v;
4412
- $params[$p] = $v;
4413
- }
4414
- } else {
4415
- $special[$p] = $v;
4416
-
4417
- if (isset($override[$p]) ||
4418
- 'plugins' === $p ||
4419
- 'themes' === $p
4420
- ) {
4421
- $special_override = true;
4422
- }
4423
- }
4424
- }
4425
-
4426
- if ($special_override || 0 < count($params)) {
4427
- // Add special params only if has at least one
4428
- // standard param, or if explicitly requested to
4429
- // override a special param or a param which is not exist
4430
- // in the install object.
4431
- $params = array_merge($params, $special);
4432
- }
4433
- }
4434
-
4435
- if (0 < count($params)) {
4436
- // Update last install sync timestamp.
4437
- $this->_storage->install_sync_timestamp = time();
4438
-
4439
- $params['uid'] = $this->get_anonymous_id();
4440
-
4441
- // Send updated values to FS.
4442
- $site = $this->get_api_site_scope()->call('/', 'put', $params);
4443
-
4444
- if ($this->is_api_result_entity($site)) {
4445
- // I successfully sent install update, clear scheduled sync if exist.
4446
- $this->clear_install_sync_cron();
4447
- }
4448
-
4449
- return $site;
4450
- }
4451
-
4452
- return false;
4453
- }
4454
- /**
4455
- * Update install only if changed.
4456
- *
4457
- * @author Vova Feldman (@svovaf)
4458
- * @since 1.0.9
4459
- *
4460
- * @param string[] string $override
4461
- * @param bool $flush
4462
- */
4463
- private function sync_install($override = array(), $flush = false) {
4464
- $this->_logger->entrance();
4465
-
4466
- $site = $this->send_install_update($override, $flush);
4467
-
4468
- if (false === $site) {
4469
- // No sync required.
4470
- return;
4471
- }
4472
-
4473
- if (!$this->is_api_result_entity($site)) {
4474
- // Failed to sync, don't update locally.
4475
- return;
4476
- }
4477
-
4478
- $plan = $this->get_plan();
4479
- $this->_site = new FS_Site($site);
4480
- $this->_site->plan = $plan;
4481
-
4482
- $this->_store_site(true);
4483
- }
4484
- /**
4485
- * Track install's custom event.
4486
- *
4487
- * IMPORTANT:
4488
- * Custom event tracking is currently only supported for specific clients.
4489
- * If you are not one of them, please don't use this method. If you will,
4490
- * the API will simply ignore your request based on the plugin ID.
4491
- *
4492
- * Need custom tracking for your plugin or theme?
4493
- * If you are interested in custom event tracking please contact yo@freemius.com
4494
- * for further details.
4495
- *
4496
- * @author Vova Feldman (@svovaf)
4497
- * @since 1.2.1
4498
- *
4499
- * @param string $name Event name.
4500
- * @param array $properties Associative key/value array with primitive values only
4501
- * @param bool $process_at A valid future date-time in the following format Y-m-d H:i:s.
4502
- * @param bool $once If true, event will be tracked only once. IMPORTANT: Still trigger the API call.
4503
- *
4504
- * @return object|false Event data or FALSE on failure.
4505
- *
4506
- * @throws \Freemius_InvalidArgumentException
4507
- */
4508
- public function track_event($name, $properties = array(), $process_at = false, $once = false) {
4509
- $this->_logger->entrance(http_build_query(array('name' => $name, 'once' => $once)));
4510
-
4511
- if (!$this->is_registered()) {
4512
- return false;
4513
- }
4514
-
4515
- $event = array('type' => $name);
4516
-
4517
- if (is_numeric($process_at) && $process_at > time()) {
4518
- $event['process_at'] = $process_at;
4519
- }
4520
-
4521
- if ($once) {
4522
- $event['once'] = true;
4523
- }
4524
-
4525
- if (!empty($properties)) {
4526
- // Verify associative array values are primitive.
4527
- foreach ($properties as $k => $v) {
4528
- if (!is_scalar($v)) {
4529
- throw new Freemius_InvalidArgumentException('The $properties argument must be an associative key/value array with primitive values only.');
4530
- }
4531
- }
4532
-
4533
- $event['properties'] = $properties;
4534
- }
4535
-
4536
- $result = $this->get_api_site_scope()->call('events.json', 'post', $event);
4537
-
4538
- return $this->is_api_error($result) ?
4539
- false :
4540
- $result;
4541
- }
4542
- /**
4543
- * Track install's custom event only once, but it still triggers the API call.
4544
- *
4545
- * IMPORTANT:
4546
- * Custom event tracking is currently only supported for specific clients.
4547
- * If you are not one of them, please don't use this method. If you will,
4548
- * the API will simply ignore your request based on the plugin ID.
4549
- *
4550
- * Need custom tracking for your plugin or theme?
4551
- * If you are interested in custom event tracking please contact yo@freemius.com
4552
- * for further details.
4553
- *
4554
- * @author Vova Feldman (@svovaf)
4555
- * @since 1.2.1
4556
- *
4557
- * @param string $name Event name.
4558
- * @param array $properties Associative key/value array with primitive values only
4559
- * @param bool $process_at A valid future date-time in the following format Y-m-d H:i:s.
4560
- *
4561
- * @return object|false Event data or FALSE on failure.
4562
- *
4563
- * @throws \Freemius_InvalidArgumentException
4564
- *
4565
- * @user Freemius::track_event()
4566
- */
4567
- public function track_event_once($name, $properties = array(), $process_at = false) {
4568
- return $this->track_event($name, $properties, $process_at, true);
4569
- }
4570
- /**
4571
- * Plugin uninstall hook.
4572
- *
4573
- * @author Vova Feldman (@svovaf)
4574
- * @since 1.0.1
4575
- *
4576
- * @param bool $check_user Enforce checking if user have plugins activation privileges.
4577
- */
4578
- function _uninstall_plugin_event($check_user = true) {
4579
- $this->_logger->entrance('slug = ' . $this->_slug);
4580
-
4581
- if ($check_user && !current_user_can('activate_plugins')) {
4582
- return;
4583
- }
4584
-
4585
- $params = array();
4586
- $uninstall_reason = null;
4587
- if (isset($this->_storage->uninstall_reason)) {
4588
- $uninstall_reason = $this->_storage->uninstall_reason;
4589
- $params['reason_id'] = $uninstall_reason->id;
4590
- $params['reason_info'] = $uninstall_reason->info;
4591
- }
4592
-
4593
- if (!$this->is_registered()) {
4594
- // Send anonymous uninstall event only if user submitted a feedback.
4595
- if (isset($uninstall_reason)) {
4596
- if (isset($uninstall_reason->is_anonymous) && !$uninstall_reason->is_anonymous) {
4597
- $this->opt_in(false, false, false, false, true);
4598
- } else {
4599
- $params['uid'] = $this->get_anonymous_id();
4600
- $this->get_api_plugin_scope()->call('uninstall.json', 'put', $params);
4601
- }
4602
- }
4603
- } else {
4604
- // Send uninstall event.
4605
- $this->send_install_update(array_merge($params, array(
4606
- 'is_active' => false,
4607
- 'is_uninstalled' => true,
4608
- )));
4609
- }
4610
-
4611
- // @todo Decide if we want to delete plugin information from db.
4612
- }
4613
- /**
4614
- * @author Vova Feldman (@svovaf)
4615
- * @since 1.1.1
4616
- *
4617
- * @return string
4618
- */
4619
- function premium_plugin_basename() {
4620
- return "{$this->_slug}-premium/" . basename($this->_free_plugin_basename);
4621
- }
4622
- /**
4623
- * Uninstall plugin hook. Called only when connected his account with Freemius for active sites tracking.
4624
- *
4625
- * @author Vova Feldman (@svovaf)
4626
- * @since 1.0.2
4627
- */
4628
- public static function _uninstall_plugin_hook() {
4629
- self::_load_required_static();
4630
-
4631
- self::$_static_logger->entrance();
4632
-
4633
- if (!current_user_can('activate_plugins')) {
4634
- return;
4635
- }
4636
-
4637
- $plugin_file = substr(current_filter(), strlen('uninstall_'));
4638
-
4639
- self::$_static_logger->info('plugin = ' . $plugin_file);
4640
-
4641
- define('WP_FS__UNINSTALL_MODE', true);
4642
-
4643
- $fs = self::get_instance_by_file($plugin_file);
4644
-
4645
- if (is_object($fs)) {
4646
- self::require_plugin_essentials();
4647
-
4648
- if (is_plugin_active($fs->_free_plugin_basename) ||
4649
- is_plugin_active($fs->premium_plugin_basename())
4650
- ) {
4651
- // Deleting Free or Premium plugin version while the other version still installed.
4652
- return;
4653
- }
4654
-
4655
- $fs->_uninstall_plugin_event();
4656
-
4657
- $fs->do_action('after_uninstall');
4658
- }
4659
- }
4660
- #----------------------------------------------------------------------------------
4661
- #region Plugin Information
4662
- #----------------------------------------------------------------------------------
4663
- /**
4664
- * Load WordPress core plugin.php essential module.
4665
- *
4666
- * @author Vova Feldman (@svovaf)
4667
- * @since 1.1.1
4668
- */
4669
- private static function require_plugin_essentials() {
4670
- if (!function_exists('get_plugins')) {
4671
- self::$_static_logger->log('Including wp-admin/includes/plugin.php...');
4672
-
4673
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
4674
- }
4675
- }
4676
- /**
4677
- * Load WordPress core pluggable.php module.
4678
- *
4679
- * @author Vova Feldman (@svovaf)
4680
- * @since 1.1.2
4681
- */
4682
- private static function require_pluggable_essentials() {
4683
- if (!function_exists('wp_get_current_user')) {
4684
- require_once ABSPATH . 'wp-includes/pluggable.php';
4685
- }
4686
- }
4687
- /**
4688
- * Return plugin data.
4689
- *
4690
- * @author Vova Feldman (@svovaf)
4691
- * @since 1.0.1
4692
- *
4693
- * @return array
4694
- */
4695
- function get_plugin_data() {
4696
- if (!isset($this->_plugin_data)) {
4697
- self::require_plugin_essentials();
4698
-
4699
- /**
4700
- * @author Vova Feldman (@svovaf)
4701
- * @since 1.2.0 When using get_plugin_data() do NOT translate plugin data.
4702
- *
4703
- * @link https://github.com/Freemius/wordpress-sdk/issues/77
4704
- */
4705
- $this->_plugin_data = get_plugin_data(
4706
- $this->_plugin_main_file_path, false, false
4707
- );
4708
- }
4709
-
4710
- return $this->_plugin_data;
4711
- }
4712
- /**
4713
- * @author Vova Feldman (@svovaf)
4714
- * @since 1.0.1
4715
- *
4716
- * @return string Plugin slug.
4717
- */
4718
- function get_slug() {
4719
- return $this->_slug;
4720
- }
4721
- /**
4722
- * @author Vova Feldman (@svovaf)
4723
- * @since 1.2.1.7
4724
- *
4725
- * @return string Plugin slug.
4726
- */
4727
- function get_target_folder_name() {
4728
- return $this->_slug . ( $this->can_use_premium_code() ? '-premium' : '' );
4729
- }
4730
- /**
4731
- * @author Vova Feldman (@svovaf)
4732
- * @since 1.0.1
4733
- *
4734
- * @return number Plugin ID.
4735
- */
4736
- function get_id() {
4737
- return $this->_plugin->id;
4738
- }
4739
- /**
4740
- * @author Vova Feldman (@svovaf)
4741
- * @since 1.2.1.5
4742
- *
4743
- * @return string Freemius SDK version
4744
- */
4745
- function get_sdk_version() {
4746
- return $this->version;
4747
- }
4748
- /**
4749
- * @author Vova Feldman (@svovaf)
4750
- * @since 1.2.1.5
4751
- *
4752
- * @return number Parent plugin ID (if parent exist).
4753
- */
4754
- function get_parent_id() {
4755
- return $this->is_addon() ?
4756
- $this->get_parent_instance()->get_id() :
4757
- $this->_plugin->id;
4758
- }
4759
- /**
4760
- * @author Vova Feldman (@svovaf)
4761
- * @since 1.0.1
4762
- *
4763
- * @return string Plugin public key.
4764
- */
4765
- function get_public_key() {
4766
- return $this->_plugin->public_key;
4767
- }
4768
- /**
4769
- * Will be available only on sandbox mode.
4770
- *
4771
- * @author Vova Feldman (@svovaf)
4772
- * @since 1.0.4
4773
- *
4774
- * @return mixed Plugin secret key.
4775
- */
4776
- function get_secret_key() {
4777
- return $this->_plugin->secret_key;
4778
- }
4779
- /**
4780
- * @author Vova Feldman (@svovaf)
4781
- * @since 1.1.1
4782
- *
4783
- * @return bool
4784
- */
4785
- function has_secret_key() {
4786
- return !empty($this->_plugin->secret_key);
4787
- }
4788
- /**
4789
- * @author Vova Feldman (@svovaf)
4790
- * @since 1.0.9
4791
- *
4792
- * @return string
4793
- */
4794
- function get_plugin_name() {
4795
- $this->_logger->entrance();
4796
-
4797
- if (!isset($this->_plugin_name)) {
4798
- $plugin_data = $this->get_plugin_data();
4799
-
4800
- // Get name.
4801
- $this->_plugin_name = $plugin_data['Name'];
4802
-
4803
- // Check if plugin name contains [Premium] suffix and remove it.
4804
- $suffix = '[premium]';
4805
- $suffix_len = strlen($suffix);
4806
-
4807
- if (strlen($plugin_data['Name']) > $suffix_len &&
4808
- $suffix === substr(strtolower($plugin_data['Name']), - $suffix_len)
4809
- ) {
4810
- $this->_plugin_name = substr($plugin_data['Name'], 0, - $suffix_len);
4811
- }
4812
-
4813
- $this->_logger->departure('Name = ' . $this->_plugin_name);
4814
- }
4815
-
4816
- return $this->_plugin_name;
4817
- }
4818
- /**
4819
- * @author Vova Feldman (@svovaf)
4820
- * @since 1.0.0
4821
- *
4822
- * @return string
4823
- */
4824
- function get_plugin_version() {
4825
- $this->_logger->entrance();
4826
-
4827
- $plugin_data = $this->get_plugin_data();
4828
-
4829
- $this->_logger->departure('Version = ' . $plugin_data['Version']);
4830
-
4831
- return $this->apply_filters('plugin_version', $plugin_data['Version']);
4832
- }
4833
- /**
4834
- * @author Vova Feldman (@svovaf)
4835
- * @since 1.2.1.7
4836
- *
4837
- * @return string
4838
- */
4839
- function get_plugin_title() {
4840
- $this->_logger->entrance();
4841
-
4842
- $title = $this->_plugin->title;
4843
-
4844
- return $this->apply_filters('plugin_title', $title);
4845
- }
4846
- /**
4847
- * @author Vova Feldman (@svovaf)
4848
- * @since 1.0.4
4849
- *
4850
- * @return string
4851
- */
4852
- function get_plugin_basename() {
4853
- return $this->_plugin_basename;
4854
- }
4855
- function get_plugin_folder_name() {
4856
- $this->_logger->entrance();
4857
-
4858
- $plugin_folder = $this->_plugin_basename;
4859
-
4860
- while ('.' !== dirname($plugin_folder)) {
4861
- $plugin_folder = dirname($plugin_folder);
4862
- }
4863
-
4864
- $this->_logger->departure('Folder Name = ' . $plugin_folder);
4865
-
4866
- return $plugin_folder;
4867
- }
4868
- #endregion ------------------------------------------------------------------
4869
-
4870
- /* Account
4871
- ------------------------------------------------------------------------------------------------------------------ */
4872
- /**
4873
- * Find plugin's slug by plugin's basename.
4874
- *
4875
- * @author Vova Feldman (@svovaf)
4876
- * @since 1.0.9
4877
- *
4878
- * @param string $plugin_base_name
4879
- *
4880
- * @return false|string
4881
- */
4882
- private static function find_slug_by_basename($plugin_base_name) {
4883
- $file_slug_map = self::$_accounts->get_option('file_slug_map', array());
4884
-
4885
- if (!array($file_slug_map) || !isset($file_slug_map[$plugin_base_name])) {
4886
- return false;
4887
- }
4888
-
4889
- return $file_slug_map[$plugin_base_name];
4890
- }
4891
- /**
4892
- * Store the map between the plugin's basename to the slug.
4893
- *
4894
- * @author Vova Feldman (@svovaf)
4895
- * @since 1.0.9
4896
- */
4897
- private function store_file_slug_map() {
4898
- $file_slug_map = self::$_accounts->get_option('file_slug_map', array());
4899
-
4900
- if (!array($file_slug_map)) {
4901
- $file_slug_map = array();
4902
- }
4903
-
4904
- if (!isset($file_slug_map[$this->_plugin_basename]) ||
4905
- $file_slug_map[$this->_plugin_basename] !== $this->_slug
4906
- ) {
4907
- $file_slug_map[$this->_plugin_basename] = $this->_slug;
4908
- self::$_accounts->set_option('file_slug_map', $file_slug_map, true);
4909
- }
4910
- }
4911
- /**
4912
- * @return FS_User[]
4913
- */
4914
- static function get_all_users() {
4915
- $users = self::$_accounts->get_option('users', array());
4916
-
4917
- if (!is_array($users)) {
4918
- $users = array();
4919
- }
4920
-
4921
- return $users;
4922
- }
4923
- /**
4924
- * @return FS_Site[]
4925
- */
4926
- private static function get_all_sites() {
4927
- $sites = self::$_accounts->get_option('sites', array());
4928
-
4929
- if (!is_array($sites)) {
4930
- $sites = array();
4931
- }
4932
-
4933
- return $sites;
4934
- }
4935
- /**
4936
- * @author Vova Feldman (@svovaf)
4937
- * @since 1.0.6
4938
- *
4939
- * @return FS_Plugin_License[]
4940
- */
4941
- private static function get_all_licenses() {
4942
- $licenses = self::$_accounts->get_option('licenses', array());
4943
-
4944
- if (!is_array($licenses)) {
4945
- $licenses = array();
4946
- }
4947
-
4948
- return $licenses;
4949
- }
4950
- /**
4951
- * @return FS_Plugin_Plan[]
4952
- */
4953
- private static function get_all_plans() {
4954
- $plans = self::$_accounts->get_option('plans', array());
4955
-
4956
- if (!is_array($plans)) {
4957
- $plans = array();
4958
- }
4959
-
4960
- return $plans;
4961
- }
4962
- /**
4963
- * @author Vova Feldman (@svovaf)
4964
- * @since 1.0.4
4965
- *
4966
- * @return FS_Plugin_Tag[]
4967
- */
4968
- private static function get_all_updates() {
4969
- $updates = self::$_accounts->get_option('updates', array());
4970
-
4971
- if (!is_array($updates)) {
4972
- $updates = array();
4973
- }
4974
-
4975
- return $updates;
4976
- }
4977
- /**
4978
- * @author Vova Feldman (@svovaf)
4979
- * @since 1.0.6
4980
- *
4981
- * @return array<number,FS_Plugin[]>|false
4982
- */
4983
- private static function get_all_addons() {
4984
- $addons = self::$_accounts->get_option('addons', array());
4985
-
4986
- if (!is_array($addons)) {
4987
- $addons = array();
4988
- }
4989
-
4990
- return $addons;
4991
- }
4992
- /**
4993
- * @author Vova Feldman (@svovaf)
4994
- * @since 1.0.6
4995
- *
4996
- * @return FS_Plugin[]|false
4997
- */
4998
- private static function get_all_account_addons() {
4999
- $addons = self::$_accounts->get_option('account_addons', array());
5000
-
5001
- if (!is_array($addons)) {
5002
- $addons = array();
5003
- }
5004
-
5005
- return $addons;
5006
- }
5007
- /**
5008
- * Check if user has connected his account (opted-in).
5009
- *
5010
- * Note:
5011
- * If the user opted-in and opted-out on a later stage,
5012
- * this will still return true. If you want to check if the
5013
- * user is currently opted-in, use:
5014
- * `$fs->is_registered() && $fs->is_tracking_allowed()`
5015
- *
5016
- * @author Vova Feldman (@svovaf)
5017
- * @since 1.0.1
5018
- * @return bool
5019
- */
5020
- function is_registered() {
5021
- return is_object($this->_user);
5022
- }
5023
- /**
5024
- * Returns TRUE if the user opted-in and didn't disconnect (opt-out).
5025
- *
5026
- * @author Leo Fajardo (@leorw)
5027
- * @since 1.2.1.5
5028
- *
5029
- * @return bool
5030
- */
5031
- function is_tracking_allowed() {
5032
- return ( is_object($this->_site) && true !== $this->_site->is_disconnected );
5033
- }
5034
- /**
5035
- * @author Vova Feldman (@svovaf)
5036
- * @since 1.0.4
5037
- *
5038
- * @return FS_Plugin
5039
- */
5040
- function get_plugin() {
5041
- return $this->_plugin;
5042
- }
5043
- /**
5044
- * @author Vova Feldman (@svovaf)
5045
- * @since 1.0.3
5046
- *
5047
- * @return FS_User
5048
- */
5049
- function get_user() {
5050
- return $this->_user;
5051
- }
5052
- /**
5053
- * @author Vova Feldman (@svovaf)
5054
- * @since 1.0.3
5055
- *
5056
- * @return FS_Site
5057
- */
5058
- function get_site() {
5059
- return $this->_site;
5060
- }
5061
- /**
5062
- * Get plugin add-ons.
5063
- *
5064
- * @author Vova Feldman (@svovaf)
5065
- * @since 1.0.6
5066
- *
5067
- * @since 1.1.7.3 If not yet loaded, fetch data from the API.
5068
- *
5069
- * @param bool $flush
5070
- *
5071
- * @return FS_Plugin[]|false
5072
- */
5073
- function get_addons($flush = false) {
5074
- $this->_logger->entrance();
5075
-
5076
- if (!$this->_has_addons) {
5077
- return false;
5078
- }
5079
-
5080
- $addons = $this->sync_addons($flush);
5081
-
5082
- return (!is_array($addons) || empty($addons) ) ?
5083
- false :
5084
- $addons;
5085
- }
5086
- /**
5087
- * @author Vova Feldman (@svovaf)
5088
- * @since 1.0.6
5089
- *
5090
- * @return FS_Plugin[]|false
5091
- */
5092
- function get_account_addons() {
5093
- $this->_logger->entrance();
5094
-
5095
- $addons = self::get_all_account_addons();
5096
-
5097
- if (!is_array($addons) ||
5098
- !isset($addons[$this->_plugin->id]) ||
5099
- !is_array($addons[$this->_plugin->id]) ||
5100
- 0 === count($addons[$this->_plugin->id])
5101
- ) {
5102
- return false;
5103
- }
5104
-
5105
- return $addons[$this->_plugin->id];
5106
- }
5107
- /**
5108
- * Check if user has any
5109
- *
5110
- * @author Vova Feldman (@svovaf)
5111
- * @since 1.1.6
5112
- *
5113
- * @return bool
5114
- */
5115
- function has_account_addons() {
5116
- $addons = $this->get_account_addons();
5117
-
5118
- return is_array($addons) && ( 0 < count($addons) );
5119
- }
5120
- /**
5121
- * Get add-on by ID (from local data).
5122
- *
5123
- * @author Vova Feldman (@svovaf)
5124
- * @since 1.0.6
5125
- *
5126
- * @param number $id
5127
- *
5128
- * @return FS_Plugin|false
5129
- */
5130
- function get_addon($id) {
5131
- $this->_logger->entrance();
5132
-
5133
- $addons = $this->get_addons();
5134
-
5135
- if (is_array($addons)) {
5136
- foreach ($addons as $addon) {
5137
- if ($id == $addon->id) {
5138
- return $addon;
5139
- }
5140
- }
5141
- }
5142
-
5143
- return false;
5144
- }
5145
- /**
5146
- * Get add-on by slug (from local data).
5147
- *
5148
- * @author Vova Feldman (@svovaf)
5149
- * @since 1.0.6
5150
- *
5151
- * @param string $slug
5152
- *
5153
- * @param bool $flush
5154
- *
5155
- * @return FS_Plugin|false
5156
- */
5157
- function get_addon_by_slug($slug, $flush = false) {
5158
- $this->_logger->entrance();
5159
-
5160
- $addons = $this->get_addons($flush);
5161
-
5162
- if (is_array($addons)) {
5163
- foreach ($addons as $addon) {
5164
- if ($slug === $addon->slug) {
5165
- return $addon;
5166
- }
5167
- }
5168
- }
5169
-
5170
- return false;
5171
- }
5172
- #----------------------------------------------------------------------------------
5173
- #region Plans & Licensing
5174
- #----------------------------------------------------------------------------------
5175
- /**
5176
- * Check if running premium plugin code.
5177
- *
5178
- * @author Vova Feldman (@svovaf)
5179
- * @since 1.0.5
5180
- *
5181
- * @return bool
5182
- */
5183
- function is_premium() {
5184
- return $this->_plugin->is_premium;
5185
- }
5186
- /**
5187
- * Get site's plan ID.
5188
- *
5189
- * @author Vova Feldman (@svovaf)
5190
- * @since 1.0.2
5191
- *
5192
- * @return number
5193
- */
5194
- function get_plan_id() {
5195
- return $this->_site->plan->id;
5196
- }
5197
- /**
5198
- * Get site's plan title.
5199
- *
5200
- * @author Vova Feldman (@svovaf)
5201
- * @since 1.0.2
5202
- *
5203
- * @return string
5204
- */
5205
- function get_plan_title() {
5206
- return $this->_site->plan->title;
5207
- }
5208
- /**
5209
- * @author Vova Feldman (@svovaf)
5210
- * @since 1.0.9
5211
- *
5212
- * @return FS_Plugin_Plan|false
5213
- */
5214
- function get_plan() {
5215
- return is_object($this->_site->plan) ?
5216
- $this->_site->plan :
5217
- false;
5218
- }
5219
- /**
5220
- * @author Vova Feldman (@svovaf)
5221
- * @since 1.0.3
5222
- *
5223
- * @return bool
5224
- */
5225
- function is_trial() {
5226
- $this->_logger->entrance();
5227
-
5228
- if (!$this->is_registered()) {
5229
- return false;
5230
- }
5231
-
5232
- return $this->_site->is_trial();
5233
- }
5234
- /**
5235
- * Check if currently in a trial with payment method (credit card or paypal).
5236
- *
5237
- * @author Vova Feldman (@svovaf)
5238
- * @since 1.1.7
5239
- *
5240
- * @return bool
5241
- */
5242
- function is_paid_trial() {
5243
- $this->_logger->entrance();
5244
-
5245
- if (!$this->is_trial()) {
5246
- return false;
5247
- }
5248
-
5249
- return $this->has_active_valid_license() && ( $this->_site->trial_plan_id == $this->_license->plan_id );
5250
- }
5251
- /**
5252
- * Check if trial already utilized.
5253
- *
5254
- * @since 1.0.9
5255
- *
5256
- * @return bool
5257
- */
5258
- function is_trial_utilized() {
5259
- $this->_logger->entrance();
5260
-
5261
- if (!$this->is_registered()) {
5262
- return false;
5263
- }
5264
-
5265
- return $this->_site->is_trial_utilized();
5266
- }
5267
- /**
5268
- * Get trial plan information (if in trial).
5269
- *
5270
- * @author Vova Feldman (@svovaf)
5271
- * @since 1.0.9
5272
- *
5273
- * @return bool|FS_Plugin_Plan
5274
- */
5275
- function get_trial_plan() {
5276
- $this->_logger->entrance();
5277
-
5278
- if (!$this->is_trial()) {
5279
- return false;
5280
- }
5281
-
5282
- return $this->_storage->trial_plan;
5283
- }
5284
- /**
5285
- * Check if the user has an activate, non-expired license on current plugin's install.
5286
- *
5287
- * @since 1.0.9
5288
- *
5289
- * @return bool
5290
- */
5291
- function is_paying() {
5292
- $this->_logger->entrance();
5293
-
5294
- if (!$this->is_registered()) {
5295
- return false;
5296
- }
5297
-
5298
- if (!$this->has_paid_plan()) {
5299
- return false;
5300
- }
5301
-
5302
- return (
5303
- !$this->is_trial() &&
5304
- 'free' !== $this->_site->plan->name &&
5305
- $this->has_active_valid_license()
5306
- );
5307
- }
5308
- /**
5309
- * @author Vova Feldman (@svovaf)
5310
- * @since 1.0.4
5311
- *
5312
- * @return bool
5313
- */
5314
- function is_free_plan() {
5315
- if (!$this->is_registered()) {
5316
- return true;
5317
- }
5318
-
5319
- if (!$this->has_paid_plan()) {
5320
- return true;
5321
- }
5322
-
5323
- return (
5324
- 'free' === $this->_site->plan->name ||
5325
- !$this->has_features_enabled_license()
5326
- );
5327
- }
5328
- /**
5329
- * @author Vova Feldman (@svovaf)
5330
- * @since 1.0.5
5331
- *
5332
- * @return bool
5333
- */
5334
- function _has_premium_license() {
5335
- $this->_logger->entrance();
5336
-
5337
- $premium_license = $this->_get_available_premium_license();
5338
-
5339
- return ( false !== $premium_license );
5340
- }
5341
- /**
5342
- * Check if user has any licenses associated with the plugin (including expired or blocking).
5343
- *
5344
- * @author Vova Feldman (@svovaf)
5345
- * @since 1.1.7.3
5346
- *
5347
- * @return bool
5348
- */
5349
- private function has_any_license() {
5350
- return is_array($this->_licenses) && ( 0 < count($this->_licenses) );
5351
- }
5352
- /**
5353
- * @author Vova Feldman (@svovaf)
5354
- * @since 1.0.5
5355
- *
5356
- * @return FS_Plugin_License|false
5357
- */
5358
- function _get_available_premium_license() {
5359
- $this->_logger->entrance();
5360
-
5361
- if (!$this->has_paid_plan()) {
5362
- return false;
5363
- }
5364
-
5365
- if (is_array($this->_licenses)) {
5366
- foreach ($this->_licenses as $license) {
5367
- if (!$license->is_utilized() && $license->is_features_enabled()) {
5368
- return $license;
5369
- }
5370
- }
5371
- }
5372
-
5373
- return false;
5374
- }
5375
- /**
5376
- * Sync local plugin plans with remote server.
5377
- *
5378
- * @author Vova Feldman (@svovaf)
5379
- * @since 1.0.5
5380
- *
5381
- * @return FS_Plugin_Plan[]|object
5382
- */
5383
- function _sync_plans() {
5384
- $plans = $this->_fetch_plugin_plans();
5385
-
5386
- if ($this->is_array_instanceof($plans, 'FS_Plugin_Plan')) {
5387
- $this->_plans = $plans;
5388
- $this->_store_plans();
5389
- }
5390
-
5391
- $this->do_action('after_plans_sync', $plans);
5392
-
5393
- return $this->_plans;
5394
- }
5395
- /**
5396
- * @author Vova Feldman (@svovaf)
5397
- * @since 1.0.5
5398
- *
5399
- * @param number $id
5400
- *
5401
- * @return FS_Plugin_Plan|false
5402
- */
5403
- function _get_plan_by_id($id) {
5404
- $this->_logger->entrance();
5405
-
5406
- if (!is_array($this->_plans) || 0 === count($this->_plans)) {
5407
- $this->_sync_plans();
5408
- }
5409
-
5410
- foreach ($this->_plans as $plan) {
5411
- if ($id == $plan->id) {
5412
- return $plan;
5413
- }
5414
- }
5415
-
5416
- return false;
5417
- }
5418
- /**
5419
- * @author Vova Feldman (@svovaf)
5420
- * @since 1.1.8.1
5421
- *
5422
- * @param string $name
5423
- *
5424
- * @return FS_Plugin_Plan|false
5425
- */
5426
- private function get_plan_by_name($name) {
5427
- $this->_logger->entrance();
5428
-
5429
- if (!is_array($this->_plans) || 0 === count($this->_plans)) {
5430
- $this->_sync_plans();
5431
- }
5432
-
5433
- foreach ($this->_plans as $plan) {
5434
- if ($name == $plan->name) {
5435
- return $plan;
5436
- }
5437
- }
5438
-
5439
- return false;
5440
- }
5441
- /**
5442
- * Sync local plugin plans with remote server.
5443
- *
5444
- * @author Vova Feldman (@svovaf)
5445
- * @since 1.0.6
5446
- *
5447
- * @param number|bool $site_license_id
5448
- *
5449
- * @return FS_Plugin_License[]|object
5450
- */
5451
- function _sync_licenses($site_license_id = false) {
5452
- $licenses = $this->_fetch_licenses(false, $site_license_id);
5453
-
5454
- if ($this->is_array_instanceof($licenses, 'FS_Plugin_License')) {
5455
- $this->_licenses = $licenses;
5456
- $this->_store_licenses();
5457
- }
5458
-
5459
- // Update current license.
5460
- if (is_object($this->_license)) {
5461
- $this->_license = $this->_get_license_by_id($this->_license->id);
5462
- }
5463
-
5464
- return $this->_licenses;
5465
- }
5466
- /**
5467
- * @author Vova Feldman (@svovaf)
5468
- * @since 1.0.5
5469
- *
5470
- * @param number $id
5471
- *
5472
- * @return FS_Plugin_License|false
5473
- */
5474
- function _get_license_by_id($id) {
5475
- $this->_logger->entrance();
5476
-
5477
- if (!is_numeric($id)) {
5478
- return false;
5479
- }
5480
-
5481
- if (!$this->has_any_license()) {
5482
- $this->_sync_licenses();
5483
- }
5484
-
5485
- foreach ($this->_licenses as $license) {
5486
- if ($id == $license->id) {
5487
- return $license;
5488
- }
5489
- }
5490
-
5491
- return false;
5492
- }
5493
- /**
5494
- * Sync site's license with user licenses.
5495
- *
5496
- * @author Vova Feldman (@svovaf)
5497
- * @since 1.0.6
5498
- *
5499
- * @param FS_Plugin_License|null $new_license
5500
- */
5501
- function _update_site_license($new_license) {
5502
- $this->_logger->entrance();
5503
-
5504
- $this->_license = $new_license;
5505
-
5506
- if (!is_object($new_license)) {
5507
- $this->_site->license_id = null;
5508
- $this->_sync_site_subscription(null);
5509
-
5510
- return;
5511
- }
5512
-
5513
- $this->_site->license_id = $this->_license->id;
5514
-
5515
- if (!is_array($this->_licenses)) {
5516
- $this->_licenses = array();
5517
- }
5518
-
5519
- $is_license_found = false;
5520
- for ($i = 0, $len = count($this->_licenses); $i < $len; $i ++) {
5521
- if ($new_license->id == $this->_licenses[$i]->id) {
5522
- $this->_licenses[$i] = $new_license;
5523
-
5524
- $is_license_found = true;
5525
- break;
5526
- }
5527
- }
5528
-
5529
- // If new license just append.
5530
- if (!$is_license_found) {
5531
- $this->_licenses[] = $new_license;
5532
- }
5533
-
5534
- $this->_sync_site_subscription($new_license);
5535
- }
5536
- /**
5537
- * Sync site's subscription.
5538
- *
5539
- * @author Vova Feldman (@svovaf)
5540
- * @since 1.0.9
5541
- *
5542
- * @param FS_Plugin_License|null $license
5543
- *
5544
- * @return bool|\FS_Subscription
5545
- */
5546
- private function _sync_site_subscription($license) {
5547
- if (!is_object($license)) {
5548
- unset($this->_storage->subscription);
5549
-
5550
- return false;
5551
- }
5552
-
5553
- // Load subscription details if not lifetime.
5554
- $subscription = $license->is_lifetime() ?
5555
- false :
5556
- $this->_fetch_site_license_subscription();
5557
-
5558
- if (is_object($subscription) && !isset($subscription->error)) {
5559
- $this->_storage->subscription = $subscription;
5560
- } else {
5561
- unset($this->_storage->subscription);
5562
- }
5563
-
5564
- return $subscription;
5565
- }
5566
- /**
5567
- * @author Vova Feldman (@svovaf)
5568
- * @since 1.0.6
5569
- *
5570
- * @return bool|\FS_Plugin_License
5571
- */
5572
- function _get_license() {
5573
- return $this->_license;
5574
- }
5575
- /**
5576
- * @return bool|\FS_Subscription
5577
- */
5578
- function _get_subscription() {
5579
- return isset($this->_storage->subscription) ?
5580
- $this->_storage->subscription :
5581
- false;
5582
- }
5583
- /**
5584
- * @author Vova Feldman (@svovaf)
5585
- * @since 1.0.2
5586
- *
5587
- * @param string $plan Plan name
5588
- * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
5589
- *
5590
- * @return bool
5591
- */
5592
- function is_plan($plan, $exact = false) {
5593
- $this->_logger->entrance();
5594
-
5595
- if (!$this->is_registered()) {
5596
- return false;
5597
- }
5598
-
5599
- $plan = strtolower($plan);
5600
-
5601
- if ($this->_site->plan->name === $plan) { // Exact plan.
5602
- return true;
5603
- } else if ($exact) { // Required exact, but plans are different.
5604
- return false;
5605
- }
5606
-
5607
- $current_plan_order = - 1;
5608
- $required_plan_order = - 1;
5609
- for ($i = 0, $len = count($this->_plans); $i < $len; $i ++) {
5610
- if ($plan === $this->_plans[$i]->name) {
5611
- $required_plan_order = $i;
5612
- } else if ($this->_site->plan->name === $this->_plans[$i]->name) {
5613
- $current_plan_order = $i;
5614
- }
5615
- }
5616
-
5617
- return ( $current_plan_order > $required_plan_order );
5618
- }
5619
- /**
5620
- * Check if module has only one plan.
5621
- *
5622
- * @author Vova Feldman (@svovaf)
5623
- * @since 1.2.1.7
5624
- *
5625
- * @return bool
5626
- */
5627
- function is_single_plan() {
5628
- $this->_logger->entrance();
5629
-
5630
- if (!$this->is_registered() ||
5631
- !is_array($this->_plans) ||
5632
- 0 === count($this->_plans)
5633
- ) {
5634
- return true;
5635
- }
5636
-
5637
- return ( 1 === count($this->_plans) );
5638
- }
5639
- /**
5640
- * Check if plan based on trial. If not in trial mode, should return false.
5641
- *
5642
- * @since 1.0.9
5643
- *
5644
- * @param string $plan Plan name
5645
- * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
5646
- *
5647
- * @return bool
5648
- */
5649
- function is_trial_plan($plan, $exact = false) {
5650
- $this->_logger->entrance();
5651
-
5652
- if (!$this->is_registered()) {
5653
- return false;
5654
- }
5655
-
5656
- if (!$this->is_trial()) {
5657
- return false;
5658
- }
5659
-
5660
- if (!isset($this->_storage->trial_plan)) {
5661
- // Store trial plan information.
5662
- $this->_enrich_site_trial_plan(true);
5663
- }
5664
-
5665
- if ($this->_storage->trial_plan->name === $plan) { // Exact plan.
5666
- return true;
5667
- } else if ($exact) { // Required exact, but plans are different.
5668
- return false;
5669
- }
5670
-
5671
- $current_plan_order = - 1;
5672
- $required_plan_order = - 1;
5673
- for ($i = 0, $len = count($this->_plans); $i < $len; $i ++) {
5674
- if ($plan === $this->_plans[$i]->name) {
5675
- $required_plan_order = $i;
5676
- } else if ($this->_storage->trial_plan->name === $this->_plans[$i]->name) {
5677
- $current_plan_order = $i;
5678
- }
5679
- }
5680
-
5681
- return ( $current_plan_order > $required_plan_order );
5682
- }
5683
- /**
5684
- * Check if plugin has any paid plans.
5685
- *
5686
- * @author Vova Feldman (@svovaf)
5687
- * @since 1.0.7
5688
- *
5689
- * @return bool
5690
- */
5691
- function has_paid_plan() {
5692
- return $this->_has_paid_plans ||
5693
- FS_Plan_Manager::instance()->has_paid_plan($this->_plans);
5694
- }
5695
- /**
5696
- * Check if plugin has any plan with a trail.
5697
- *
5698
- * @author Vova Feldman (@svovaf)
5699
- * @since 1.0.9
5700
- *
5701
- * @return bool
5702
- */
5703
- function has_trial_plan() {
5704
- if (!$this->is_registered()) {
5705
- /**
5706
- * @author Vova Feldman(@svovaf)
5707
- * @since 1.2.1.5
5708
- *
5709
- * Allow setting a trial from the SDK without calling the API.
5710
- * But, if the user did opt-in, continue using the real data from the API.
5711
- */
5712
- if ($this->_trial_days >= 0) {
5713
- return true;
5714
- }
5715
-
5716
- return false;
5717
- }
5718
-
5719
- return $this->_storage->get('has_trial_plan', false);
5720
- }
5721
- /**
5722
- * Check if plugin has any free plan, or is it premium only.
5723
- *
5724
- * Note: If no plans configured, assume plugin is free.
5725
- *
5726
- * @author Vova Feldman (@svovaf)
5727
- * @since 1.0.7
5728
- *
5729
- * @return bool
5730
- */
5731
- function has_free_plan() {
5732
- return !$this->is_only_premium();
5733
- }
5734
- /**
5735
- * Displays a license activation dialog box when the user clicks on the "Activate License"
5736
- * or "Change License" link on the plugins
5737
- * page.
5738
- *
5739
- * @author Leo Fajardo (@leorw)
5740
- * @since 1.1.9
5741
- */
5742
- function _add_license_activation_dialog_box() {
5743
- $vars = array(
5744
- 'slug' => $this->_slug,
5745
- );
5746
-
5747
- fs_require_template('forms/license-activation.php', $vars);
5748
- fs_require_template('forms/resend-key.php', $vars);
5749
- }
5750
- /**
5751
- * Displays the opt-out dialog box when the user clicks on the "Opt Out" link on the "Plugins"
5752
- * page.
5753
- *
5754
- * @author Leo Fajardo (@leorw)
5755
- * @since 1.2.1.5
5756
- */
5757
- function _add_optout_dialog() {
5758
- $vars = array(
5759
- 'slug' => $this->_slug,
5760
- );
5761
-
5762
- fs_require_template('forms/optout.php', $vars);
5763
- }
5764
- /**
5765
- * Prepare page to include all required UI and logic for the license activation dialog.
5766
- *
5767
- * @author Vova Feldman (@svovaf)
5768
- * @since 1.2.0
5769
- */
5770
- function _add_license_activation() {
5771
- if (!$this->is_user_admin()) {
5772
- // Only admins can activate a license.
5773
- return;
5774
- }
5775
-
5776
- if (!$this->has_paid_plan()) {
5777
- // Module doesn't have any paid plans.
5778
- return;
5779
- }
5780
-
5781
- if (!$this->is_premium()) {
5782
- // Only add license activation logic to the premium version.
5783
- return;
5784
- }
5785
-
5786
- // Add license activation link and AJAX request handler.
5787
- if ($this->is_plugins_page()) {
5788
- /**
5789
- * @since 1.2.0 Add license action link only on plugins page.
5790
- */
5791
- $this->_add_license_action_link();
5792
- }
5793
-
5794
- // Add license activation AJAX callback.
5795
- $this->add_ajax_action('activate_license', array(&$this, '_activate_license_ajax_action'));
5796
-
5797
- // Add resend license AJAX callback.
5798
- $this->add_ajax_action('resend_license_key', array(&$this, '_resend_license_key_ajax_action'));
5799
- }
5800
- /**
5801
- * @author Leo Fajardo (@leorw)
5802
- * @since 1.1.9
5803
- */
5804
- function _activate_license_ajax_action() {
5805
- $this->_logger->entrance();
5806
-
5807
- $this->check_ajax_referer('activate_license');
5808
-
5809
- $license_key = trim(fs_request_get('license_key'));
5810
-
5811
- if (empty($license_key)) {
5812
- exit;
5813
- }
5814
-
5815
- $slug = fs_request_get('slug', '', 'post');
5816
- $fs = ( $slug === $this->_slug ) ?
5817
- $this :
5818
- $this->get_addon_instance($slug);
5819
-
5820
- $error = false;
5821
- $next_page = false;
5822
-
5823
- if ($fs->is_registered()) {
5824
- $api = $fs->get_api_site_scope();
5825
- $install = $api->call('/', 'put', array(
5826
- 'license_key' => $fs->apply_filters('license_key', $license_key)
5827
- ));
5828
-
5829
- if (isset($install->error)) {
5830
- $error = $install->error->message;
5831
- } else {
5832
- $parent_fs = $fs->is_addon() ?
5833
- $fs->get_parent_instance() :
5834
- $fs;
5835
-
5836
- $next_page = $parent_fs->_get_sync_license_url($fs->get_id(), true);
5837
-
5838
- $fs->reconnect_locally();
5839
- }
5840
- } else {
5841
- $next_page = $fs->opt_in(false, false, false, $license_key);
5842
-
5843
- if (isset($next_page->error)) {
5844
- $error = $next_page->error;
5845
- }
5846
- }
5847
-
5848
- $result = array(
5849
- 'success' => ( false === $error )
5850
- );
5851
-
5852
- if (false !== $error) {
5853
- $result['error'] = $error;
5854
- } else {
5855
- $result['next_page'] = $next_page;
5856
- }
5857
-
5858
- echo json_encode($result);
5859
-
5860
- exit;
5861
- }
5862
- /**
5863
- * Billing update AJAX callback.
5864
- *
5865
- * @author Vova Feldman (@svovaf)
5866
- * @since 1.2.1.5
5867
- */
5868
- function _update_billing_ajax_action() {
5869
- $this->_logger->entrance();
5870
-
5871
- $this->check_ajax_referer('update_billing');
5872
-
5873
- if (!$this->is_user_admin()) {
5874
- // Only for admins.
5875
- self::shoot_ajax_failure();
5876
- }
5877
-
5878
- $billing = fs_request_get('billing');
5879
-
5880
- $api = $this->get_api_user_scope();
5881
- $result = $api->call('/billing.json', 'put', array_merge($billing, array(
5882
- 'plugin_id' => $this->get_parent_id(),
5883
- )));
5884
-
5885
- if (!$this->is_api_result_entity($result)) {
5886
- self::shoot_ajax_failure();
5887
- }
5888
-
5889
- // Purge cached billing.
5890
- $this->get_api_user_scope()->purge_cache('billing.json');
5891
-
5892
- self::shoot_ajax_success();
5893
- }
5894
- /**
5895
- * Trial start for anonymous users (AJAX callback).
5896
- *
5897
- * @author Vova Feldman (@svovaf)
5898
- * @since 1.2.1.5
5899
- */
5900
- function _start_trial_ajax_action() {
5901
- $this->_logger->entrance();
5902
-
5903
- $this->check_ajax_referer('start_trial');
5904
-
5905
- if (!$this->is_user_admin()) {
5906
- // Only for admins.
5907
- self::shoot_ajax_failure();
5908
- }
5909
-
5910
- $trial_data = fs_request_get('trial');
5911
-
5912
- $next_page = $this->opt_in(
5913
- false, false, false, false, false, $trial_data['plan_id']
5914
- );
5915
-
5916
- if (is_object($next_page) && $this->is_api_error($next_page)) {
5917
- self::shoot_ajax_failure(
5918
- isset($next_page->error) ?
5919
- $next_page->error->message :
5920
- var_export($next_page, true)
5921
- );
5922
- }
5923
-
5924
- self::shoot_ajax_success(array(
5925
- 'next_page' => $next_page,
5926
- ));
5927
- }
5928
- /**
5929
- * @author Leo Fajardo (@leorw)
5930
- * @since 1.2.0
5931
- */
5932
- function _resend_license_key_ajax_action() {
5933
- $this->_logger->entrance();
5934
-
5935
- $this->check_ajax_referer('resend_license_key');
5936
-
5937
- $email_address = sanitize_email(trim(fs_request_get('email', '', 'post')));
5938
-
5939
- if (empty($email_address)) {
5940
- exit;
5941
- }
5942
-
5943
- $error = false;
5944
-
5945
- $api = $this->get_api_plugin_scope();
5946
- $result = $api->call('/licenses/resend.json', 'post', array(
5947
- 'email' => $email_address,
5948
- 'url' => home_url(),
5949
- )
5950
- );
5951
-
5952
- if (is_object($result) && isset($result->error)) {
5953
- $error = $result->error;
5954
-
5955
- if (in_array($error->code, array('invalid_email', 'no_user'))) {
5956
- $error = $this->get_text('email-not-found');
5957
- } else if ('no_license' === $error->code) {
5958
- $error = $this->get_text('no-active-licenses');
5959
- } else {
5960
- $error = $error->message;
5961
- }
5962
- }
5963
-
5964
- $licenses = array(
5965
- 'success' => ( false === $error )
5966
- );
5967
-
5968
- if (false !== $error) {
5969
- $licenses['error'] = sprintf('%s... %s', $this->get_text('oops'), strtolower($error));
5970
- }
5971
-
5972
- echo json_encode($licenses);
5973
-
5974
- exit;
5975
- }
5976
- /**
5977
- * Helper method to check if user in the plugins page.
5978
- *
5979
- * @author Vova Feldman (@svovaf)
5980
- * @since 1.2.1.5
5981
- *
5982
- * @return bool
5983
- */
5984
- function is_plugins_page() {
5985
- global $pagenow;
5986
-
5987
- return ( 'plugins.php' === $pagenow );
5988
- }
5989
- /**
5990
- * Helper method to check if user in the themes page.
5991
- *
5992
- * @author Vova Feldman (@svovaf)
5993
- * @since 1.2.2.6
5994
- *
5995
- * @return bool
5996
- */
5997
- function is_themes_page() {
5998
- global $pagenow;
5999
-
6000
- return ( 'themes.php' === $pagenow );
6001
- }
6002
- #----------------------------------------------------------------------------------
6003
- #region URL Generators
6004
- #----------------------------------------------------------------------------------
6005
- /**
6006
- * Alias to pricing_url().
6007
- *
6008
- * @author Vova Feldman (@svovaf)
6009
- * @since 1.0.2
6010
- *
6011
- * @uses pricing_url()
6012
- *
6013
- * @param string $period Billing cycle
6014
- * @param bool $is_trial
6015
- *
6016
- * @return string
6017
- */
6018
- function get_upgrade_url($period = WP_FS__PERIOD_ANNUALLY, $is_trial = false) {
6019
- return $this->pricing_url($period, $is_trial);
6020
- }
6021
- /**
6022
- * @author Vova Feldman (@svovaf)
6023
- * @since 1.0.9
6024
- *
6025
- * @uses get_upgrade_url()
6026
- *
6027
- * @return string
6028
- */
6029
- function get_trial_url() {
6030
- return $this->get_upgrade_url(WP_FS__PERIOD_ANNUALLY, true);
6031
- }
6032
- /**
6033
- * Plugin's pricing URL.
6034
- *
6035
- * @author Vova Feldman (@svovaf)
6036
- * @since 1.0.4
6037
- *
6038
- * @param string $billing_cycle Billing cycle
6039
- *
6040
- * @param bool $is_trial
6041
- *
6042
- * @return string
6043
- */
6044
- function pricing_url($billing_cycle = WP_FS__PERIOD_ANNUALLY, $is_trial = false) {
6045
- $this->_logger->entrance();
6046
-
6047
- $params = array(
6048
- 'billing_cycle' => $billing_cycle
6049
- );
6050
-
6051
- if ($is_trial) {
6052
- $params['trial'] = 'true';
6053
- }
6054
-
6055
- return $this->_get_admin_page_url('pricing', $params);
6056
- }
6057
- /**
6058
- * Checkout page URL.
6059
- *
6060
- * @author Vova Feldman (@svovaf)
6061
- * @since 1.0.6
6062
- *
6063
- * @param string $billing_cycle Billing cycle
6064
- * @param bool $is_trial
6065
- * @param array $extra (optional) Extra parameters, override other query params.
6066
- *
6067
- * @return string
6068
- */
6069
- function checkout_url(
6070
- $billing_cycle = WP_FS__PERIOD_ANNUALLY, $is_trial = false, $extra = array()
6071
- ) {
6072
- $this->_logger->entrance();
6073
-
6074
- $params = array(
6075
- 'checkout' => 'true',
6076
- 'billing_cycle' => $billing_cycle,
6077
- );
6078
-
6079
- if ($is_trial) {
6080
- $params['trial'] = 'true';
6081
- }
6082
-
6083
- /**
6084
- * Params in extra override other params.
6085
- */
6086
- $params = array_merge($params, $extra);
6087
-
6088
- return $this->_get_admin_page_url('pricing', $params);
6089
- }
6090
- /**
6091
- * Add-on checkout URL.
6092
- *
6093
- * @author Vova Feldman (@svovaf)
6094
- * @since 1.1.7
6095
- *
6096
- * @param number $addon_id
6097
- * @param number $pricing_id
6098
- * @param string $billing_cycle
6099
- * @param bool $is_trial
6100
- *
6101
- * @return string
6102
- */
6103
- function addon_checkout_url(
6104
- $addon_id, $pricing_id, $billing_cycle = WP_FS__PERIOD_ANNUALLY, $is_trial = false
6105
- ) {
6106
- return $this->checkout_url($billing_cycle, $is_trial, array(
6107
- 'plugin_id' => $addon_id,
6108
- 'pricing_id' => $pricing_id,
6109
- ));
6110
- }
6111
- #endregion
6112
- #endregion ------------------------------------------------------------------
6113
- /**
6114
- * Check if plugin has any add-ons.
6115
- *
6116
- * @author Vova Feldman (@svovaf)
6117
- * @since 1.0.5
6118
- *
6119
- * @since 1.1.7.3 Base logic only on the parameter provided by the developer in the init function.
6120
- *
6121
- * @return bool
6122
- */
6123
- function has_addons() {
6124
- $this->_logger->entrance();
6125
-
6126
- return $this->_has_addons;
6127
- }
6128
- /**
6129
- * Check if plugin can work in anonymous mode.
6130
- *
6131
- * @author Vova Feldman (@svovaf)
6132
- * @since 1.0.9
6133
- *
6134
- * @return bool
6135
- *
6136
- * @deprecated Please use is_enable_anonymous() instead
6137
- */
6138
- function enable_anonymous() {
6139
- return $this->_enable_anonymous;
6140
- }
6141
- /**
6142
- * Check if plugin can work in anonymous mode.
6143
- *
6144
- * @author Vova Feldman (@svovaf)
6145
- * @since 1.1.9
6146
- *
6147
- * @return bool
6148
- */
6149
- function is_enable_anonymous() {
6150
- return $this->_enable_anonymous;
6151
- }
6152
- /**
6153
- * Check if plugin is premium only (no free plans).
6154
- *
6155
- * @author Vova Feldman (@svovaf)
6156
- * @since 1.1.9
6157
- *
6158
- * @return bool
6159
- */
6160
- function is_only_premium() {
6161
- return $this->_is_premium_only;
6162
- }
6163
- /**
6164
- * Checks if the plugin's type is "plugin". The other type is "theme".
6165
- *
6166
- * @author Leo Fajardo (@leorw)
6167
- * @since 1.2.2
6168
- *
6169
- * @return bool
6170
- */
6171
- function is_plugin() {
6172
- return true;
6173
- }
6174
- /**
6175
- * Check if module has a premium code version.
6176
- *
6177
- * Serviceware module might be freemium without any
6178
- * premium code version, where the paid features
6179
- * are all part of the service.
6180
- *
6181
- * @author Vova Feldman (@svovaf)
6182
- * @since 1.2.1.6
6183
- *
6184
- * @return bool
6185
- */
6186
- function has_premium_version() {
6187
- return $this->_has_premium_version;
6188
- }
6189
- /**
6190
- * Check if feature supported with current site's plan.
6191
- *
6192
- * @author Vova Feldman (@svovaf)
6193
- * @since 1.0.1
6194
- *
6195
- * @todo IMPLEMENT
6196
- *
6197
- * @param number $feature_id
6198
- *
6199
- * @throws Exception
6200
- */
6201
- function is_feature_supported($feature_id) {
6202
- throw new Exception('not implemented');
6203
- }
6204
- /**
6205
- * @author Vova Feldman (@svovaf)
6206
- * @since 1.0.1
6207
- *
6208
- * @return bool Is running in SSL/HTTPS
6209
- */
6210
- function is_ssl() {
6211
- return WP_FS__IS_HTTPS;
6212
- }
6213
- /**
6214
- * @author Vova Feldman (@svovaf)
6215
- * @since 1.0.9
6216
- *
6217
- * @return bool Is running in AJAX call.
6218
- *
6219
- * @link http://wordpress.stackexchange.com/questions/70676/how-to-check-if-i-am-in-admin-ajax
6220
- */
6221
- static function is_ajax() {
6222
- return ( defined('DOING_AJAX') && DOING_AJAX );
6223
- }
6224
- /**
6225
- * Check if it's an AJAX call targeted for the current module.
6226
- *
6227
- * @author Vova Feldman (@svovaf)
6228
- * @since 1.2.0
6229
- *
6230
- * @param array|string $actions Collection of AJAX actions.
6231
- *
6232
- * @return bool
6233
- */
6234
- function is_ajax_action($actions) {
6235
- // Verify it's an ajax call.
6236
- if (!self::is_ajax()) {
6237
- return false;
6238
- }
6239
-
6240
- // Verify the call is relevant for the plugin.
6241
- if ($this->_slug !== fs_request_get('slug')) {
6242
- return false;
6243
- }
6244
-
6245
- // Verify it's one of the specified actions.
6246
- if (is_string($actions)) {
6247
- $actions = explode(',', $actions);
6248
- }
6249
-
6250
- if (is_array($actions) && 0 < count($actions)) {
6251
- $ajax_action = fs_request_get('action');
6252
-
6253
- foreach ($actions as $action) {
6254
- if ($ajax_action === $this->get_action_tag($action)) {
6255
- return true;
6256
- }
6257
- }
6258
- }
6259
-
6260
- return false;
6261
- }
6262
- /**
6263
- * Check if it's an AJAX call targeted for current request.
6264
- *
6265
- * @author Vova Feldman (@svovaf)
6266
- * @since 1.2.0
6267
- *
6268
- * @param array|string $actions Collection of AJAX actions.
6269
- * @param string $slug
6270
- *
6271
- * @return bool
6272
- */
6273
- static function is_ajax_action_static($actions, $slug = '') {
6274
- // Verify it's an ajax call.
6275
- if (!self::is_ajax()) {
6276
- return false;
6277
- }
6278
-
6279
- if (!empty($slug)) {
6280
- // Verify the call is relevant for the plugin.
6281
- if ($slug !== fs_request_get('slug')) {
6282
- return false;
6283
- }
6284
- }
6285
-
6286
- // Verify it's one of the specified actions.
6287
- if (is_string($actions)) {
6288
- $actions = explode(',', $actions);
6289
- }
6290
-
6291
- if (is_array($actions) && 0 < count($actions)) {
6292
- $ajax_action = fs_request_get('action');
6293
-
6294
- foreach ($actions as $action) {
6295
- if ($ajax_action === self::get_ajax_action_static($action, $slug)) {
6296
- return true;
6297
- }
6298
- }
6299
- }
6300
-
6301
- return false;
6302
- }
6303
- /**
6304
- * @author Vova Feldman (@svovaf)
6305
- * @since 1.1.7
6306
- *
6307
- * @return bool
6308
- */
6309
- function is_cron() {
6310
- return ( defined('DOING_CRON') && DOING_CRON );
6311
- }
6312
- /**
6313
- * Check if a real user is visiting the admin dashboard.
6314
- *
6315
- * @author Vova Feldman (@svovaf)
6316
- * @since 1.1.7
6317
- *
6318
- * @return bool
6319
- */
6320
- function is_user_in_admin() {
6321
- return is_admin() && !self::is_ajax() && !$this->is_cron();
6322
- }
6323
- /**
6324
- * Check if running in HTTPS and if site's plan matching the specified plan.
6325
- *
6326
- * @param string $plan
6327
- * @param bool $exact
6328
- *
6329
- * @return bool
6330
- */
6331
- function is_ssl_and_plan($plan, $exact = false) {
6332
- return ( $this->is_ssl() && $this->is_plan($plan, $exact) );
6333
- }
6334
- /**
6335
- * Construct plugin's settings page URL.
6336
- *
6337
- * @author Vova Feldman (@svovaf)
6338
- * @since 1.0.4
6339
- *
6340
- * @param string $page
6341
- * @param array $params
6342
- *
6343
- * @return string
6344
- */
6345
- function _get_admin_page_url($page = '', $params = array()) {
6346
- if (0 < count($params)) {
6347
- foreach ($params as $k => $v) {
6348
- $params[$k] = urlencode($v);
6349
- }
6350
- }
6351
-
6352
- $page_param = $this->_menu->get_slug($page);
6353
-
6354
- if (!$this->has_settings_menu()) {
6355
- if (!empty($page)) {
6356
- // Module doesn't have a setting page, but since the request is for
6357
- // a specific Freemius page, use the admin.php path.
6358
- return add_query_arg(array_merge($params, array(
6359
- 'page' => $page_param,
6360
- )), admin_url('admin.php', 'admin'));
6361
- } else {
6362
- if ($this->is_activation_mode()) {
6363
- /**
6364
- * @author Vova Feldman
6365
- * @since 1.2.1.6
6366
- *
6367
- * If plugin doesn't have a settings page, create one for the opt-in screen.
6368
- */
6369
- return add_query_arg(array_merge($params, array(
6370
- 'page' => $this->_slug,
6371
- )), admin_url('admin.php', 'admin'));
6372
- } else {
6373
- // Plugin without a settings page.
6374
- return admin_url('plugins.php');
6375
- }
6376
- }
6377
- }
6378
-
6379
- // Module has a submenu settings page.
6380
- if (!$this->_menu->is_top_level()) {
6381
- $parent_slug = $this->_menu->get_parent_slug();
6382
- $menu_file = ( false !== strpos($parent_slug, '.php') ) ?
6383
- $parent_slug :
6384
- 'admin.php';
6385
-
6386
- return add_query_arg(array_merge($params, array(
6387
- 'page' => $page_param,
6388
- )), admin_url($menu_file, 'admin'));
6389
- }
6390
-
6391
- // Module has a top level CPT settings page.
6392
- if ($this->_menu->is_cpt()) {
6393
- if (empty($page) && $this->is_activation_mode()) {
6394
- return add_query_arg(array_merge($params, array(
6395
- 'page' => $page_param
6396
- )), admin_url('admin.php', 'admin'));
6397
- } else {
6398
- if (!empty($page)) {
6399
- $params['page'] = $page_param;
6400
- }
6401
-
6402
- return add_query_arg(
6403
- $params, admin_url($this->_menu->get_raw_slug(), 'admin')
6404
- );
6405
- }
6406
- }
6407
-
6408
- // Module has a custom top level settings page.
6409
- return add_query_arg(array_merge($params, array(
6410
- 'page' => $page_param,
6411
- )), admin_url('admin.php', 'admin'));
6412
- }
6413
- /**
6414
- * Plugin's account page + sync license URL.
6415
- *
6416
- * @author Vova Feldman (@svovaf)
6417
- * @since 1.1.9.1
6418
- *
6419
- * @param bool|number $plugin_id
6420
- * @param bool $add_action_nonce
6421
- * @param array $params
6422
- *
6423
- * @return string
6424
- */
6425
- function _get_sync_license_url($plugin_id = false, $add_action_nonce = true, $params = array()) {
6426
- if (is_numeric($plugin_id)) {
6427
- $params['plugin_id'] = $plugin_id;
6428
- }
6429
-
6430
- return $this->get_account_url(
6431
- $this->_slug . '_sync_license', $params, $add_action_nonce
6432
- );
6433
- }
6434
- /**
6435
- * Plugin's account URL.
6436
- *
6437
- * @author Vova Feldman (@svovaf)
6438
- * @since 1.0.4
6439
- *
6440
- * @param bool|string $action
6441
- * @param array $params
6442
- *
6443
- * @param bool $add_action_nonce
6444
- *
6445
- * @return string
6446
- */
6447
- function get_account_url($action = false, $params = array(), $add_action_nonce = true) {
6448
- if (is_string($action)) {
6449
- $params['fs_action'] = $action;
6450
- }
6451
-
6452
- self::require_pluggable_essentials();
6453
-
6454
- return ( $add_action_nonce && is_string($action) ) ?
6455
- fs_nonce_url($this->_get_admin_page_url('account', $params), $action) :
6456
- $this->_get_admin_page_url('account', $params);
6457
- }
6458
- /**
6459
- * @author Vova Feldman (@svovaf)
6460
- * @since 1.2.0
6461
- *
6462
- * @param string $tab
6463
- * @param bool $action
6464
- * @param array $params
6465
- * @param bool $add_action_nonce
6466
- *
6467
- * @return string
6468
- *
6469
- * @uses get_account_url()
6470
- */
6471
- function get_account_tab_url($tab, $action = false, $params = array(), $add_action_nonce = true) {
6472
- $params['tab'] = $tab;
6473
-
6474
- return $this->get_account_url($action, $params, $add_action_nonce);
6475
- }
6476
- /**
6477
- * Plugin's account URL.
6478
- *
6479
- * @author Vova Feldman (@svovaf)
6480
- * @since 1.0.4
6481
- *
6482
- * @param bool|string $topic
6483
- * @param bool|string $message
6484
- *
6485
- * @return string
6486
- */
6487
- function contact_url($topic = false, $message = false) {
6488
- $params = array();
6489
- if (is_string($topic)) {
6490
- $params['topic'] = $topic;
6491
- }
6492
- if (is_string($message)) {
6493
- $params['message'] = $message;
6494
- }
6495
-
6496
- if ($this->is_addon()) {
6497
- $params['addon_id'] = $this->get_id();
6498
-
6499
- return $this->get_parent_instance()->_get_admin_page_url('contact', $params);
6500
- } else {
6501
- return $this->_get_admin_page_url('contact', $params);
6502
- }
6503
- }
6504
- /**
6505
- * Add-on direct info URL.
6506
- *
6507
- * @author Vova Feldman (@svovaf)
6508
- * @since 1.1.0
6509
- *
6510
- * @param string $slug
6511
- *
6512
- * @return string
6513
- */
6514
- function addon_url($slug) {
6515
- return $this->_get_admin_page_url('addons', array(
6516
- 'slug' => $slug
6517
- ));
6518
- }
6519
- /* Logger
6520
- ------------------------------------------------------------------------------------------------------------------ */
6521
- /**
6522
- * @param string $id
6523
- * @param bool $prefix_slug
6524
- *
6525
- * @return FS_Logger
6526
- */
6527
- function get_logger($id = '', $prefix_slug = true) {
6528
- return FS_Logger::get_logger(( $prefix_slug ? $this->_slug : '' ) . ( (!$prefix_slug || empty($id) ) ? '' : '_' ) . $id);
6529
- }
6530
- /**
6531
- * @param $id
6532
- * @param bool $load_options
6533
- * @param bool $prefix_slug
6534
- *
6535
- * @return FS_Option_Manager
6536
- */
6537
- function get_options_manager($id, $load_options = false, $prefix_slug = true) {
6538
- return FS_Option_Manager::get_manager(( $prefix_slug ? $this->_slug : '' ) . ( (!$prefix_slug || empty($id) ) ? '' : '_' ) . $id, $load_options);
6539
- }
6540
- /* Security
6541
- ------------------------------------------------------------------------------------------------------------------ */
6542
- private static function _encrypt($str) {
6543
- if (is_null($str)) {
6544
- return null;
6545
- }
6546
-
6547
- /**
6548
- * The encrypt/decrypt functions are used to protect
6549
- * the user from messing up with some of the sensitive
6550
- * data stored for the module as a JSON in the database.
6551
- *
6552
- * I used the same suggested hack by the theme review team.
6553
- * For more details, look at the function `Base64UrlDecode()`
6554
- * in `./sdk/FreemiusBase.php`.
6555
- *
6556
- * @todo Remove this hack once the base64 error is removed from the Theme Check.
6557
- *
6558
- * @author Vova Feldman (@svovaf)
6559
- * @since 1.2.2
6560
- */
6561
- $fn = 'base64' . '_encode';
6562
-
6563
- return $fn($str);
6564
- }
6565
- static function _decrypt($str) {
6566
- if (is_null($str)) {
6567
- return null;
6568
- }
6569
-
6570
- /**
6571
- * The encrypt/decrypt functions are used to protect
6572
- * the user from messing up with some of the sensitive
6573
- * data stored for the module as a JSON in the database.
6574
- *
6575
- * I used the same suggested hack by the theme review team.
6576
- * For more details, look at the function `Base64UrlDecode()`
6577
- * in `./sdk/FreemiusBase.php`.
6578
- *
6579
- * @todo Remove this hack once the base64 error is removed from the Theme Check.
6580
- *
6581
- * @author Vova Feldman (@svovaf)
6582
- * @since 1.2.2
6583
- */
6584
- $fn = 'base64' . '_decode';
6585
-
6586
- return $fn($str);
6587
- }
6588
- /**
6589
- * @author Vova Feldman (@svovaf)
6590
- * @since 1.0.5
6591
- *
6592
- * @param FS_Entity $entity
6593
- *
6594
- * @return FS_Entity Return an encrypted clone entity.
6595
- */
6596
- private static function _encrypt_entity(FS_Entity $entity) {
6597
- $clone = clone $entity;
6598
- $props = get_object_vars($entity);
6599
-
6600
- foreach ($props as $key => $val) {
6601
- $clone->{$key} = self::_encrypt($val);
6602
- }
6603
-
6604
- return $clone;
6605
- }
6606
- /**
6607
- * @author Vova Feldman (@svovaf)
6608
- * @since 1.0.5
6609
- *
6610
- * @param FS_Entity $entity
6611
- *
6612
- * @return FS_Entity Return an decrypted clone entity.
6613
- */
6614
- private static function _decrypt_entity(FS_Entity $entity) {
6615
- $clone = clone $entity;
6616
- $props = get_object_vars($entity);
6617
-
6618
- foreach ($props as $key => $val) {
6619
- $clone->{$key} = self::_decrypt($val);
6620
- }
6621
-
6622
- return $clone;
6623
- }
6624
- /**
6625
- * Tries to activate account based on POST params.
6626
- *
6627
- * @author Vova Feldman (@svovaf)
6628
- * @since 1.0.2
6629
- */
6630
- function _activate_account() {
6631
- if ($this->is_registered()) {
6632
- // Already activated.
6633
- return;
6634
- }
6635
-
6636
- self::_clean_admin_content_section();
6637
-
6638
- if (fs_request_is_action('activate') && fs_request_is_post()) {
6639
- // check_admin_referer( 'activate_' . $this->_plugin->public_key );
6640
- // Verify matching plugin details.
6641
- if ($this->_plugin->id != fs_request_get('plugin_id') || $this->_slug != fs_request_get('plugin_slug')) {
6642
- return;
6643
- }
6644
-
6645
- $user = new FS_User();
6646
- $user->id = fs_request_get('user_id');
6647
- $user->public_key = fs_request_get('user_public_key');
6648
- $user->secret_key = fs_request_get('user_secret_key');
6649
- $user->email = fs_request_get('user_email');
6650
- $user->first = fs_request_get('user_first');
6651
- $user->last = fs_request_get('user_last');
6652
- $user->is_verified = fs_request_get_bool('user_is_verified');
6653
-
6654
- $site = new FS_Site();
6655
- $site->id = fs_request_get('install_id');
6656
- $site->public_key = fs_request_get('install_public_key');
6657
- $site->secret_key = fs_request_get('install_secret_key');
6658
- $site->plan->id = fs_request_get('plan_id');
6659
- $site->plan->title = fs_request_get('plan_title');
6660
- $site->plan->name = fs_request_get('plan_name');
6661
-
6662
- $plans = array();
6663
- $plans_data = json_decode(urldecode(fs_request_get('plans')));
6664
- foreach ($plans_data as $p) {
6665
- $plans[] = new FS_Plugin_Plan($p);
6666
- }
6667
-
6668
- $this->_set_account($user, $site, $plans);
6669
-
6670
- // Reload the page with the keys.
6671
- fs_redirect($this->_get_admin_page_url());
6672
- }
6673
- }
6674
- /**
6675
- * @author Vova Feldman (@svovaf)
6676
- * @since 1.0.7
6677
- *
6678
- * @param string $email
6679
- *
6680
- * @return FS_User|bool
6681
- */
6682
- static function _get_user_by_email($email) {
6683
- self::$_static_logger->entrance();
6684
-
6685
- $email = trim(strtolower($email));
6686
- $users = self::get_all_users();
6687
- if (is_array($users)) {
6688
- foreach ($users as $u) {
6689
- if ($email === trim(strtolower($u->email))) {
6690
- return $u;
6691
- }
6692
- }
6693
- }
6694
-
6695
- return false;
6696
- }
6697
- #----------------------------------------------------------------------------------
6698
- #region Account (Loading, Updates & Activation)
6699
- #----------------------------------------------------------------------------------
6700
-
6701
- /* * *
6702
- * Load account information (user + site).
6703
- *
6704
- * @author Vova Feldman (@svovaf)
6705
- * @since 1.0.1
6706
- */
6707
- private function _load_account() {
6708
- $this->_logger->entrance();
6709
-
6710
- $this->do_action('before_account_load');
6711
-
6712
- $sites = self::get_all_sites();
6713
- $users = self::get_all_users();
6714
- $plans = self::get_all_plans();
6715
- $licenses = self::get_all_licenses();
6716
-
6717
- if ($this->_logger->is_on() && is_admin()) {
6718
- $this->_logger->log('sites = ' . var_export($sites, true));
6719
- $this->_logger->log('users = ' . var_export($users, true));
6720
- $this->_logger->log('plans = ' . var_export($plans, true));
6721
- $this->_logger->log('licenses = ' . var_export($licenses, true));
6722
- }
6723
-
6724
- $site = isset($sites[$this->_slug]) ? $sites[$this->_slug] : false;
6725
-
6726
- if (is_object($site) &&
6727
- is_numeric($site->id) &&
6728
- is_numeric($site->user_id) &&
6729
- is_object($site->plan)
6730
- ) {
6731
- // Load site.
6732
- $this->_site = clone $site;
6733
- $this->_site->plan = self::_decrypt_entity($this->_site->plan);
6734
-
6735
- // Load relevant user.
6736
- $this->_user = clone $users[$this->_site->user_id];
6737
-
6738
- // Load plans.
6739
- $this->_plans = $plans[$this->_slug];
6740
- if (!is_array($this->_plans) || empty($this->_plans)) {
6741
- $this->_sync_plans();
6742
- } else {
6743
- for ($i = 0, $len = count($this->_plans); $i < $len; $i ++) {
6744
- if ($this->_plans[$i] instanceof FS_Plugin_Plan) {
6745
- $this->_plans[$i] = self::_decrypt_entity($this->_plans[$i]);
6746
- } else {
6747
- unset($this->_plans[$i]);
6748
- }
6749
- }
6750
- }
6751
-
6752
- // Load licenses.
6753
- $this->_licenses = array();
6754
- if (is_array($licenses) &&
6755
- isset($licenses[$this->_slug]) &&
6756
- isset($licenses[$this->_slug][$this->_user->id])
6757
- ) {
6758
- $this->_licenses = $licenses[$this->_slug][$this->_user->id];
6759
- }
6760
-
6761
- $this->_license = $this->_get_license_by_id($this->_site->license_id);
6762
-
6763
- if ($this->_site->version != $this->get_plugin_version()) {
6764
- // If stored install version is different than current installed plugin version,
6765
- // then update plugin version event.
6766
- $this->update_plugin_version_event();
6767
- }
6768
- }
6769
-
6770
- $this->_register_account_hooks();
6771
- }
6772
- /**
6773
- * @author Vova Feldman (@svovaf)
6774
- * @since 1.0.1
6775
- *
6776
- * @param FS_User $user
6777
- * @param FS_Site $site
6778
- * @param bool|array $plans
6779
- */
6780
- private function _set_account(FS_User $user, FS_Site $site, $plans = false) {
6781
- $site->slug = $this->_slug;
6782
- $site->user_id = $user->id;
6783
-
6784
- $this->_site = $site;
6785
- $this->_user = $user;
6786
- if (false !== $plans) {
6787
- $this->_plans = $plans;
6788
- }
6789
-
6790
- $this->send_install_update();
6791
-
6792
- $this->_store_account();
6793
- }
6794
- /**
6795
- * @author Vova Feldman (@svovaf)
6796
- * @since 1.1.7.4
6797
- *
6798
- * @param array $override_with
6799
- *
6800
- * @return array
6801
- */
6802
- function get_opt_in_params($override_with = array()) {
6803
- $this->_logger->entrance();
6804
-
6805
- $current_user = self::_get_current_wp_user();
6806
-
6807
- $activation_action = $this->_slug . '_activate_new';
6808
- $return_url = $this->is_anonymous() ?
6809
- // If skipped already, then return to the account page.
6810
- $this->get_account_url($activation_action, array(), false) :
6811
- // Return to the module's main page.
6812
- $this->_get_admin_page_url(
6813
- '', array('fs_action' => $activation_action)
6814
- );
6815
-
6816
- $params = array(
6817
- 'user_firstname' => $current_user->user_firstname,
6818
- 'user_lastname' => $current_user->user_lastname,
6819
- 'user_nickname' => $current_user->user_nicename,
6820
- 'user_email' => $current_user->user_email,
6821
- 'user_ip' => WP_FS__REMOTE_ADDR,
6822
- 'plugin_slug' => $this->_slug,
6823
- 'plugin_id' => $this->get_id(),
6824
- 'plugin_public_key' => $this->get_public_key(),
6825
- 'plugin_version' => $this->get_plugin_version(),
6826
- 'return_url' => fs_nonce_url($return_url, $activation_action),
6827
- 'account_url' => fs_nonce_url($this->_get_admin_page_url(
6828
- 'account', array('fs_action' => 'sync_user')
6829
- ), 'sync_user'),
6830
- 'site_uid' => $this->get_anonymous_id(),
6831
- 'site_url' => get_site_url(),
6832
- 'site_name' => get_bloginfo('name'),
6833
- 'platform_version' => get_bloginfo('version'),
6834
- 'sdk_version' => $this->version,
6835
- 'programming_language_version' => phpversion(),
6836
- 'language' => get_bloginfo('language'),
6837
- 'charset' => get_bloginfo('charset'),
6838
- 'is_premium' => $this->is_premium(),
6839
- 'is_active' => true,
6840
- 'is_uninstalled' => false,
6841
- );
6842
-
6843
- if ($this->is_pending_activation() &&
6844
- !empty($this->_storage->pending_license_key)
6845
- ) {
6846
- $params['license_key'] = $this->_storage->pending_license_key;
6847
- }
6848
-
6849
- if (WP_FS__SKIP_EMAIL_ACTIVATION && $this->has_secret_key()) {
6850
- // Even though rand() is known for its security issues,
6851
- // the timestamp adds another layer of protection.
6852
- // It would be very hard for an attacker to get the secret key form here.
6853
- // Plus, this should never run in production since the secret should never
6854
- // be included in the production version.
6855
- $params['ts'] = WP_FS__SCRIPT_START_TIME;
6856
- $params['salt'] = md5(uniqid(rand()));
6857
- $params['secure'] = md5(
6858
- $params['ts'] .
6859
- $params['salt'] .
6860
- $this->get_secret_key()
6861
- );
6862
- }
6863
-
6864
- return array_merge($params, $override_with);
6865
- }
6866
- /**
6867
- * 1. If successful opt-in or pending activation returns the next page that the user should be redirected to.
6868
- * 2. If there was an API error, return the API result.
6869
- *
6870
- * @author Vova Feldman (@svovaf)
6871
- * @since 1.1.7.4
6872
- *
6873
- * @param string|bool $email
6874
- * @param string|bool $first
6875
- * @param string|bool $last
6876
- * @param string|bool $license_key
6877
- * @param bool $is_uninstall If "true", this means that the module is currently being uninstalled.
6878
- * In this case, the user and site info will be sent to the server but no
6879
- * data will be saved to the WP installation's database.
6880
- * @param number|bool $trial_plan_id
6881
- *
6882
- * @return string|object
6883
- * @use WP_Error
6884
- */
6885
- function opt_in(
6886
- $email = false, $first = false, $last = false, $license_key = false, $is_uninstall = false, $trial_plan_id = false
6887
- ) {
6888
- $this->_logger->entrance();
6889
-
6890
- if (false === $email) {
6891
- $current_user = self::_get_current_wp_user();
6892
- $email = $current_user->user_email;
6893
- }
6894
-
6895
- /**
6896
- * @since 1.2.1 If activating with license key, ignore the context-user
6897
- * since the user will be automatically loaded from the license.
6898
- */
6899
- if (empty($license_key)) {
6900
- // Clean up pending license if opt-ing in again.
6901
- $this->_storage->remove('pending_license_key');
6902
-
6903
- if (!$is_uninstall) {
6904
- $fs_user = Freemius::_get_user_by_email($email);
6905
- if (is_object($fs_user) && !$this->is_pending_activation()) {
6906
- return $this->install_with_current_user(false, $trial_plan_id);
6907
- }
6908
- }
6909
- }
6910
-
6911
- $user_info = array();
6912
- if (!empty($email)) {
6913
- $user_info['user_email'] = $email;
6914
- }
6915
- if (!empty($first)) {
6916
- $user_info['user_firstname'] = $first;
6917
- }
6918
- if (!empty($last)) {
6919
- $user_info['user_lastname'] = $last;
6920
- }
6921
-
6922
- $params = $this->get_opt_in_params($user_info);
6923
-
6924
- $filtered_license_key = false;
6925
- if (is_string($license_key)) {
6926
- $filtered_license_key = $this->apply_filters('license_key', $license_key);
6927
- $params['license_key'] = $filtered_license_key;
6928
- } else if (FS_Plugin_Plan::is_valid_id($trial_plan_id)) {
6929
- $params['trial_plan_id'] = $trial_plan_id;
6930
- }
6931
-
6932
- if ($is_uninstall) {
6933
- $params['uninstall_params'] = array(
6934
- 'reason_id' => $this->_storage->uninstall_reason->id,
6935
- 'reason_info' => $this->_storage->uninstall_reason->info
6936
- );
6937
- }
6938
-
6939
- $params['format'] = 'json';
6940
-
6941
- $url = WP_FS__ADDRESS . '/action/service/user/install/';
6942
- if (isset($_COOKIE['XDEBUG_SESSION'])) {
6943
- $url = add_query_arg('XDEBUG_SESSION', 'PHPSTORM', $url);
6944
- }
6945
-
6946
- $response = wp_remote_post($url, array(
6947
- 'method' => 'POST',
6948
- 'body' => $params,
6949
- 'timeout' => 15,
6950
- ));
6951
-
6952
- if ($response instanceof WP_Error) {
6953
- if ('https://' === substr($url, 0, 8) &&
6954
- isset($response->errors) &&
6955
- isset($response->errors['http_request_failed'])
6956
- ) {
6957
- $http_error = strtolower($response->errors['http_request_failed'][0]);
6958
-
6959
- if (false !== strpos($http_error, 'ssl')) {
6960
- // Failed due to old version of cURL or Open SSL (SSLv3 is not supported by CloudFlare).
6961
- $url = 'http://' . substr($url, 8);
6962
-
6963
- $response = wp_remote_post($url, array(
6964
- 'method' => 'POST',
6965
- 'body' => $params,
6966
- 'timeout' => 15,
6967
- ));
6968
- }
6969
- }
6970
- }
6971
-
6972
- if (is_wp_error($response)) {
6973
- /**
6974
- * @var WP_Error $response
6975
- */
6976
- $result = new stdClass();
6977
-
6978
- $error_code = $response->get_error_code();
6979
- $error_type = str_replace(' ', '', ucwords(str_replace('_', ' ', $error_code)));
6980
-
6981
- $result->error = (object) array(
6982
- 'type' => $error_type,
6983
- 'message' => $response->get_error_message(),
6984
- 'code' => $error_code,
6985
- 'http' => 402
6986
- );
6987
-
6988
- return $result;
6989
- }
6990
-
6991
- // Module is being uninstalled, don't handle the returned data.
6992
- if ($is_uninstall) {
6993
- return true;
6994
- }
6995
-
6996
- $decoded = @json_decode($response['body']);
6997
-
6998
- if (empty($decoded)) {
6999
- return false;
7000
- }
7001
-
7002
- if (!$this->is_api_result_object($decoded)) {
7003
- if (!empty($params['license_key'])) {
7004
- // Pass the fully entered license key to the failure handler.
7005
- $params['license_key'] = $license_key;
7006
- }
7007
-
7008
- return $is_uninstall ?
7009
- $decoded :
7010
- $this->apply_filters('after_install_failure', $decoded, $params);
7011
- } else if (isset($decoded->pending_activation) && $decoded->pending_activation) {
7012
- // Pending activation, add message.
7013
- return $this->set_pending_confirmation(
7014
- true, false, $filtered_license_key, !empty($params['trial_plan_id'])
7015
- );
7016
- } else if (isset($decoded->install_secret_key)) {
7017
- return $this->install_with_new_user(
7018
- $decoded->user_id, $decoded->user_public_key, $decoded->user_secret_key, $decoded->install_id, $decoded->install_public_key, $decoded->install_secret_key, false
7019
- );
7020
- }
7021
-
7022
- return $decoded;
7023
- }
7024
- /**
7025
- * Set user and site identities.
7026
- *
7027
- * @author Vova Feldman (@svovaf)
7028
- * @since 1.0.9
7029
- *
7030
- * @param FS_User $user
7031
- * @param FS_Site $site
7032
- * @param bool $redirect
7033
- * @param bool $auto_install Since 1.2.1.7 If `true` and setting up an account with a valid license, will
7034
- * redirect (or return a URL) to the account page with a special parameter to
7035
- * trigger the auto installation processes.
7036
- *
7037
- * @return string If redirect is `false`, returns the next page the user should be redirected to.
7038
- */
7039
- function setup_account(
7040
- FS_User $user, FS_Site $site, $redirect = true, $auto_install = false
7041
- ) {
7042
- $this->_user = $user;
7043
- $this->_site = $site;
7044
-
7045
- $this->_sync_plans();
7046
-
7047
- $this->_enrich_site_plan(false);
7048
-
7049
- $this->_set_account($user, $site);
7050
-
7051
- if ($this->is_trial()) {
7052
- // Store trial plan information.
7053
- $this->_enrich_site_trial_plan(true);
7054
- }
7055
-
7056
- // If Freemius was OFF before, turn it on.
7057
- $this->turn_on();
7058
-
7059
- $this->do_action('after_account_connection', $user, $site);
7060
-
7061
- if (is_numeric($site->license_id)) {
7062
- $this->_license = $this->_get_license_by_id($site->license_id);
7063
- }
7064
-
7065
- $this->_admin_notices->remove_sticky('connect_account');
7066
-
7067
- if ($this->is_pending_activation()) {
7068
- // Remove pending activation sticky notice (if still exist).
7069
- $this->_admin_notices->remove_sticky('activation_pending');
7070
-
7071
- // Remove plugin from pending activation mode.
7072
- unset($this->_storage->is_pending_activation);
7073
-
7074
- if (!$this->is_paying_or_trial()) {
7075
- $this->_admin_notices->add_sticky(
7076
- sprintf($this->get_text('plugin-x-activation-message'), '<b>' . $this->get_plugin_name() . '</b>'), 'activation_complete'
7077
- );
7078
- }
7079
- }
7080
-
7081
- if ($this->is_paying_or_trial()) {
7082
- if (!$this->is_premium() || !$this->has_premium_version()) {
7083
- if ($this->is_paying()) {
7084
- $this->_admin_notices->add_sticky(
7085
- sprintf(
7086
- $this->get_text('activation-with-plan-x-message'), $this->_site->plan->title
7087
- ) . $this->get_complete_upgrade_instructions(), 'plan_upgraded', $this->get_text('yee-haw') . '!'
7088
- );
7089
- } else {
7090
- $this->_admin_notices->add_sticky(
7091
- sprintf(
7092
- $this->get_text('trial-started-message'), '<i>' . $this->get_plugin_name() . '</i>'
7093
- ) . $this->get_complete_upgrade_instructions($this->_storage->trial_plan->title), 'trial_started', $this->get_text('yee-haw') . '!'
7094
- );
7095
- }
7096
- }
7097
-
7098
- $this->_admin_notices->remove_sticky(array(
7099
- 'trial_promotion',
7100
- ));
7101
- }
7102
-
7103
- $plugin_id = fs_request_get('plugin_id', false);
7104
-
7105
- // Store activation time ONLY for plugins (not add-ons).
7106
- if (!is_numeric($plugin_id) || ( $plugin_id == $this->_plugin->id )) {
7107
- $this->_storage->activation_timestamp = WP_FS__SCRIPT_START_TIME;
7108
- }
7109
-
7110
- $next_page = '';
7111
-
7112
- $extra = array();
7113
- if ($auto_install) {
7114
- $extra['auto_install'] = 'true';
7115
- }
7116
-
7117
- if (is_numeric($plugin_id)) {
7118
- /**
7119
- * @author Leo Fajardo
7120
- * @since 1.2.1.6
7121
- *
7122
- * Also sync the license after an anonymous user subscribes.
7123
- */
7124
- if ($this->is_anonymous() || $plugin_id != $this->_plugin->id) {
7125
- // Add-on was installed - sync license right after install.
7126
- $next_page = $this->_get_sync_license_url($plugin_id, true, $extra);
7127
- }
7128
- } else {
7129
- /**
7130
- * @author Vova Feldman (@svovaf)
7131
- * @since 1.1.9 If site installed with a valid license, sync license.
7132
- */
7133
- if ($this->is_paying()) {
7134
- $this->_sync_plugin_license(true);
7135
- }
7136
-
7137
- // Reload the page with the keys.
7138
- $next_page = $this->is_anonymous() ?
7139
- // If user previously skipped, redirect to account page.
7140
- $this->get_account_url(false, $extra) :
7141
- $this->get_after_activation_url('after_connect_url');
7142
- }
7143
-
7144
- if (!empty($next_page) && $redirect) {
7145
- fs_redirect($next_page);
7146
- }
7147
-
7148
- return $next_page;
7149
- }
7150
- /**
7151
- * Install plugin with new user information after approval.
7152
- *
7153
- * @author Vova Feldman (@svovaf)
7154
- * @since 1.0.7
7155
- */
7156
- function _install_with_new_user() {
7157
- $this->_logger->entrance();
7158
-
7159
- if ($this->is_registered()) {
7160
- return;
7161
- }
7162
-
7163
- if (fs_request_is_action($this->_slug . '_activate_new')) {
7164
- // check_admin_referer( $this->_slug . '_activate_new' );
7165
-
7166
- if (fs_request_has('user_secret_key')) {
7167
- $this->install_with_new_user(
7168
- fs_request_get('user_id'), fs_request_get('user_public_key'), fs_request_get('user_secret_key'), fs_request_get('install_id'), fs_request_get('install_public_key'), fs_request_get('install_secret_key'), true, fs_request_get_bool('auto_install')
7169
- );
7170
- } else if (fs_request_has('pending_activation')) {
7171
- $this->set_pending_confirmation(fs_request_get('user_email'), true);
7172
- }
7173
- }
7174
- }
7175
- /**
7176
- * Install plugin with new user.
7177
- *
7178
- * @author Vova Feldman (@svovaf)
7179
- * @since 1.1.7.4
7180
- *
7181
- * @param number $user_id
7182
- * @param string $user_public_key
7183
- * @param string $user_secret_key
7184
- * @param number $install_id
7185
- * @param string $install_public_key
7186
- * @param string $install_secret_key
7187
- * @param bool $redirect
7188
- * @param bool $auto_install Since 1.2.1.7 If `true` and setting up an account with a valid license, will
7189
- * redirect (or return a URL) to the account page with a special parameter to
7190
- * trigger the auto installation processes.
7191
- *
7192
- * @return string If redirect is `false`, returns the next page the user should be redirected to.
7193
- */
7194
- private function install_with_new_user(
7195
- $user_id, $user_public_key, $user_secret_key, $install_id, $install_public_key, $install_secret_key, $redirect = true, $auto_install = false
7196
- ) {
7197
- $user = new FS_User();
7198
- $user->id = $user_id;
7199
- $user->public_key = $user_public_key;
7200
- $user->secret_key = $user_secret_key;
7201
-
7202
- $this->_user = $user;
7203
- $user_result = $this->get_api_user_scope()->get();
7204
- $user = new FS_User($user_result);
7205
- $this->_user = $user;
7206
-
7207
- $site = new FS_Site();
7208
- $site->id = $install_id;
7209
- $site->public_key = $install_public_key;
7210
- $site->secret_key = $install_secret_key;
7211
-
7212
- $this->_site = $site;
7213
- $site_result = $this->get_api_site_scope()->get();
7214
- $site = new FS_Site($site_result);
7215
- $this->_site = $site;
7216
-
7217
- return $this->setup_account(
7218
- $this->_user, $this->_site, $redirect, $auto_install
7219
- );
7220
- }
7221
- /**
7222
- * @author Vova Feldman (@svovaf)
7223
- * @since 1.1.7.4
7224
- *
7225
- * @param string|bool $email
7226
- * @param bool $redirect
7227
- * @param string|bool $license_key Since 1.2.1.5
7228
- * @param bool $is_pending_trial Since 1.2.1.5
7229
- *
7230
- * @return string Since 1.2.1.5 if $redirect is `false`, return the pending activation page.
7231
- */
7232
- private function set_pending_confirmation(
7233
- $email = false, $redirect = true, $license_key = false, $is_pending_trial = false
7234
- ) {
7235
- if ($this->_ignore_pending_mode) {
7236
- /**
7237
- * If explicitly asked to ignore pending mode, set to anonymous mode
7238
- * if require confirmation before finalizing the opt-in.
7239
- *
7240
- * @author Vova Feldman
7241
- * @since 1.2.1.6
7242
- */
7243
- $this->skip_connection();
7244
- } else {
7245
- // Install must be activated via email since
7246
- // user with the same email already exist.
7247
- $this->_storage->is_pending_activation = true;
7248
- $this->_add_pending_activation_notice($email, $is_pending_trial);
7249
- }
7250
-
7251
- if (!empty($license_key)) {
7252
- $this->_storage->pending_license_key = $license_key;
7253
- }
7254
-
7255
- // Remove the opt-in sticky notice.
7256
- $this->_admin_notices->remove_sticky(array(
7257
- 'connect_account',
7258
- 'trial_promotion',
7259
- ));
7260
-
7261
- $next_page = $this->get_after_activation_url('after_pending_connect_url');
7262
-
7263
- // Reload the page with with pending activation message.
7264
- if ($redirect) {
7265
- fs_redirect($next_page);
7266
- }
7267
-
7268
- return $next_page;
7269
- }
7270
- /**
7271
- * Install plugin with current logged WP user info.
7272
- *
7273
- * @author Vova Feldman (@svovaf)
7274
- * @since 1.0.7
7275
- */
7276
- function _install_with_current_user() {
7277
- $this->_logger->entrance();
7278
-
7279
- if ($this->is_registered()) {
7280
- return;
7281
- }
7282
-
7283
- if (fs_request_is_action($this->_slug . '_activate_existing') && fs_request_is_post()) {
7284
- // check_admin_referer( 'activate_existing_' . $this->_plugin->public_key );
7285
-
7286
- /**
7287
- * @author Vova Feldman (@svovaf)
7288
- * @since 1.1.9 Add license key if given.
7289
- */
7290
- $license_key = fs_request_get('license_secret_key');
7291
-
7292
- $this->install_with_current_user($license_key);
7293
- }
7294
- }
7295
- /**
7296
- * @author Vova Feldman (@svovaf)
7297
- * @since 1.1.7.4
7298
- *
7299
- * @param string|bool $license_key
7300
- * @param number|bool $trial_plan_id
7301
- * @param bool $redirect
7302
- *
7303
- * @return string|object If redirect is `false`, returns the next page the user should be redirected to, or the
7304
- * API error object if failed to install.
7305
- */
7306
- private function install_with_current_user(
7307
- $license_key = false, $trial_plan_id = false, $redirect = true
7308
- ) {
7309
- // Get current logged WP user.
7310
- $current_user = self::_get_current_wp_user();
7311
-
7312
- // Find the relevant FS user by the email.
7313
- $user = self::_get_user_by_email($current_user->user_email);
7314
-
7315
- // We have to set the user before getting user scope API handler.
7316
- $this->_user = $user;
7317
-
7318
- $extra_install_params = array(
7319
- 'uid' => $this->get_anonymous_id(),
7320
- );
7321
-
7322
- if (!empty($license_key)) {
7323
- $filtered_license_key = $this->apply_filters('license_key', $license_key);
7324
- $extra_install_params['license_key'] = $filtered_license_key;
7325
- } else if (FS_Plugin_Plan::is_valid_id($trial_plan_id)) {
7326
- $extra_install_params['trial_plan_id'] = $trial_plan_id;
7327
- }
7328
-
7329
- $args = $this->get_install_data_for_api($extra_install_params, false, false);
7330
-
7331
- // Install the plugin.
7332
- $install = $this->get_api_user_scope()->call(
7333
- "/plugins/{$this->get_id()}/installs.json", 'post', $args
7334
- );
7335
-
7336
- if (!$this->is_api_result_entity($install)) {
7337
- if (!empty($args['license_key'])) {
7338
- // Pass full the fully entered license key to the failure handler.
7339
- $args['license_key'] = $license_key;
7340
- }
7341
-
7342
- $install = $this->apply_filters('after_install_failure', $install, $args);
7343
-
7344
- $this->_admin_notices->add(
7345
- sprintf($this->get_text('could-not-activate-x'), $this->get_plugin_name()) . ' ' .
7346
- $this->get_text('contact-us-with-error-message') . ' ' . '<b>' . $install->error->message . '</b>', $this->get_text('oops') . '...', 'error'
7347
- );
7348
-
7349
- if ($redirect) {
7350
- fs_redirect($this->get_activation_url(array('error' => $install->error->message)));
7351
- }
7352
-
7353
- return $install;
7354
- }
7355
-
7356
- $site = new FS_Site($install);
7357
- $this->_site = $site;
7358
-
7359
- return $this->setup_account($this->_user, $this->_site, $redirect);
7360
- }
7361
- /**
7362
- * Tries to activate add-on account based on parent plugin info.
7363
- *
7364
- * @author Vova Feldman (@svovaf)
7365
- * @since 1.0.6
7366
- *
7367
- * @param Freemius $parent_fs
7368
- */
7369
- private function _activate_addon_account(Freemius $parent_fs) {
7370
- if ($this->is_registered()) {
7371
- // Already activated.
7372
- return;
7373
- }
7374
-
7375
- // Activate add-on with parent plugin credentials.
7376
- $addon_install = $parent_fs->get_api_site_scope()->call(
7377
- "/addons/{$this->_plugin->id}/installs.json", 'post', $this->get_install_data_for_api(array(
7378
- 'uid' => $this->get_anonymous_id(),
7379
- ), false, false)
7380
- );
7381
-
7382
- if (isset($addon_install->error)) {
7383
- $this->_admin_notices->add(
7384
- sprintf($this->get_text('could-not-activate-x'), $this->get_plugin_name()) . ' ' .
7385
- $this->get_text('contact-us-with-error-message') . ' ' . '<b>' . $addon_install->error->message . '</b>', $this->get_text('oops') . '...', 'error'
7386
- );
7387
-
7388
- return;
7389
- }
7390
-
7391
- // First of all, set site info - otherwise we won't
7392
- // be able to invoke API calls.
7393
- $this->_site = new FS_Site($addon_install);
7394
-
7395
- // Sync add-on plans.
7396
- $this->_sync_plans();
7397
-
7398
- // Get site's current plan.
7399
- $this->_site->plan = $this->_get_plan_by_id($this->_site->plan->id);
7400
-
7401
- // Get user information based on parent's plugin.
7402
- $user = $parent_fs->get_user();
7403
-
7404
- $this->_set_account($user, $this->_site);
7405
-
7406
- // Sync licenses.
7407
- $this->_sync_licenses();
7408
-
7409
- // Try to activate premium license.
7410
- $this->_activate_license(true);
7411
- }
7412
- #endregion
7413
- #----------------------------------------------------------------------------------
7414
- #region Admin Menu Items
7415
- #----------------------------------------------------------------------------------
7416
- private $_menu_items = array();
7417
- /**
7418
- * @author Vova Feldman (@svovaf)
7419
- * @since 1.0.7
7420
- *
7421
- * @return string
7422
- */
7423
- function get_menu_slug() {
7424
- return $this->_menu->get_slug();
7425
- }
7426
- /**
7427
- * @author Vova Feldman (@svovaf)
7428
- * @since 1.0.9
7429
- */
7430
- function _prepare_admin_menu() {
7431
- // if ( ! $this->is_on() ) {
7432
- // return;
7433
- // }
7434
-
7435
- if (!$this->has_api_connectivity() && !$this->is_enable_anonymous()) {
7436
- $this->_menu->remove_menu_item();
7437
- } else {
7438
- $this->do_action('before_admin_menu_init');
7439
-
7440
- $this->add_menu_action();
7441
- $this->add_submenu_items();
7442
- }
7443
- }
7444
- /**
7445
- * Admin dashboard menu items modifications.
7446
- *
7447
- * NOTE: admin_menu action executed before admin_init.
7448
- *
7449
- * @author Vova Feldman (@svovaf)
7450
- * @since 1.0.7
7451
- *
7452
- */
7453
- private function add_menu_action() {
7454
- if ($this->is_activation_mode()) {
7455
- $this->override_plugin_menu_with_activation();
7456
- } else {
7457
- // If not registered try to install user.
7458
- if (!$this->is_registered() &&
7459
- fs_request_is_action($this->_slug . '_activate_new')
7460
- ) {
7461
- $this->_install_with_new_user();
7462
- } else if (fs_request_is_action('sync_user') && !$this->has_settings_menu()) {
7463
- $this->_handle_account_user_sync();
7464
- }
7465
- }
7466
- }
7467
- /**
7468
- * @author Vova Feldman (@svovaf)
7469
- * @since 1.0.1
7470
- */
7471
- function _redirect_on_clicked_menu_link() {
7472
- $this->_logger->entrance();
7473
-
7474
- $page = strtolower(isset($_REQUEST['page']) ? $_REQUEST['page'] : '');
7475
-
7476
- $this->_logger->log('page = ' . $page);
7477
-
7478
- foreach ($this->_menu_items as $priority => $items) {
7479
- foreach ($items as $item) {
7480
- if (isset($item['url'])) {
7481
- if ($page === $this->_menu->get_slug(strtolower($item['menu_slug']))) {
7482
- $this->_logger->log('Redirecting to ' . $item['url']);
7483
-
7484
- fs_redirect($item['url']);
7485
- }
7486
- }
7487
- }
7488
- }
7489
- }
7490
- /**
7491
- * Remove plugin's all admin menu items & pages, and replace with activation page.
7492
- *
7493
- * @author Vova Feldman (@svovaf)
7494
- * @since 1.0.1
7495
- */
7496
- private function override_plugin_menu_with_activation() {
7497
- $this->_logger->entrance();
7498
-
7499
- $hook = false;
7500
-
7501
- if (!$this->_menu->has_menu()) {
7502
- // Add the opt-in page without a menu item.
7503
- $hook = FS_Admin_Menu_Manager::add_subpage(
7504
- null, $this->get_plugin_name(), $this->get_plugin_name(), 'manage_options', $this->_slug, array(&$this, '_connect_page_render')
7505
- );
7506
- } else if ($this->_menu->is_top_level()) {
7507
- $hook = $this->_menu->override_menu_item(array(&$this, '_connect_page_render'));
7508
-
7509
- if (false === $hook) {
7510
- // Create new menu item just for the opt-in.
7511
- $hook = FS_Admin_Menu_Manager::add_page(
7512
- $this->get_plugin_name(), $this->get_plugin_name(), 'manage_options', $this->_menu->get_slug(), array(&$this, '_connect_page_render')
7513
- );
7514
- }
7515
- } else {
7516
- $menus = array($this->_menu->get_parent_slug());
7517
-
7518
- if ($this->_menu->is_override_exact()) {
7519
- if (!$this->is_matching_url($_SERVER['REQUEST_URI'], $this->get_activation_url())) {
7520
- return;
7521
- }
7522
- }
7523
-
7524
- foreach ($menus as $parent_slug) {
7525
- $hook = $this->_menu->override_submenu_action(
7526
- $parent_slug, $this->_menu->get_raw_slug(), array(&$this, '_connect_page_render')
7527
- );
7528
-
7529
- if (false !== $hook) {
7530
- // Found plugin's submenu item.
7531
- break;
7532
- }
7533
- }
7534
- }
7535
-
7536
- if ($this->is_activation_page()) {
7537
- // Clean admin page from distracting content.
7538
- self::_clean_admin_content_section();
7539
- }
7540
-
7541
- if (false !== $hook) {
7542
- if (fs_request_is_action($this->_slug . '_activate_existing')) {
7543
- add_action("load-$hook", array(&$this, '_install_with_current_user'));
7544
- } else if (fs_request_is_action($this->_slug . '_activate_new')) {
7545
- add_action("load-$hook", array(&$this, '_install_with_new_user'));
7546
- }
7547
- }
7548
- }
7549
- /**
7550
- * @author Leo Fajardo (leorw)
7551
- * @since 1.2.1
7552
- *
7553
- * return string
7554
- */
7555
- function get_top_level_menu_capability() {
7556
- global $menu;
7557
-
7558
- $top_level_menu_slug = $this->get_top_level_menu_slug();
7559
-
7560
- foreach ($menu as $menu_info) {
7561
- /**
7562
- * The second element in the menu info array is the capability/role that has access to the menu and the
7563
- * third element is the menu slug.
7564
- */
7565
- if ($menu_info[2] === $top_level_menu_slug) {
7566
- return $menu_info[1];
7567
- }
7568
- }
7569
-
7570
- return 'read';
7571
- }
7572
- /**
7573
- * @author Vova Feldman (@svovaf)
7574
- * @since 1.0.0
7575
- *
7576
- * @return string
7577
- */
7578
- private function get_top_level_menu_slug() {
7579
- return ( $this->is_addon() ?
7580
- $this->get_parent_instance()->_menu->get_top_level_menu_slug() :
7581
- $this->_menu->get_top_level_menu_slug() );
7582
- }
7583
- /**
7584
- * Add default Freemius menu items.
7585
- *
7586
- * @author Vova Feldman (@svovaf)
7587
- * @since 1.0.0
7588
- */
7589
- private function add_submenu_items() {
7590
- $this->_logger->entrance();
7591
-
7592
- if (!$this->is_addon()) {
7593
- if (!$this->is_activation_mode()) {
7594
- if ($this->is_registered()) {
7595
- // Add user account page.
7596
- $this->add_submenu_item(
7597
- $this->get_text('account'), array(&$this, '_account_page_render'), $this->get_plugin_name() . ' &ndash; ' . $this->get_text('account'), 'manage_options', 'account', array(&$this, '_account_page_load'), WP_FS__DEFAULT_PRIORITY, $this->is_submenu_item_visible('account')
7598
- );
7599
- }
7600
-
7601
- // Add contact page.
7602
- $this->add_submenu_item(
7603
- $this->get_text('contact-us'), array(&$this, '_contact_page_render'), $this->get_plugin_name() . ' &ndash; ' . $this->get_text('contact-us'), 'manage_options', 'contact', 'Freemius::_clean_admin_content_section', WP_FS__DEFAULT_PRIORITY, $this->is_submenu_item_visible('contact')
7604
- );
7605
-
7606
- if ($this->has_addons()) {
7607
- $this->add_submenu_item(
7608
- $this->get_text('add-ons'), array(&$this, '_addons_page_render'), $this->get_plugin_name() . ' &ndash; ' . $this->get_text('add-ons'), 'manage_options', 'addons', array(&$this, '_addons_page_load'), WP_FS__LOWEST_PRIORITY - 1, $this->is_submenu_item_visible('addons')
7609
- );
7610
- }
7611
-
7612
- $show_pricing = (
7613
- // Has at least one paid plan.
7614
- $this->has_paid_plan() &&
7615
- // Didn't ask to hide the pricing page.
7616
- $this->is_submenu_item_visible('pricing') &&
7617
- // Don't have a valid active license or has more than one plan.
7618
- (!$this->is_paying() || !$this->is_single_plan() )
7619
- );
7620
- // If user don't have paid plans, add pricing page
7621
- // to support add-ons checkout but don't add the submenu item.
7622
- // || (isset( $_GET['page'] ) && $this->_menu->get_slug( 'pricing' ) == $_GET['page']);
7623
-
7624
- $pricing_cta_slug = 'upgrade';
7625
- $pricing_class = 'upgrade-mode';
7626
- if ($show_pricing) {
7627
- if ($this->_admin_notices->has_sticky('trial_promotion') &&
7628
- !$this->is_paying_or_trial()
7629
- ) {
7630
- // If running a trial promotion, modify the pricing to load the trial.
7631
- $pricing_cta_slug = 'start-trial';
7632
- $pricing_class = 'trial-mode';
7633
- } else if ($this->is_paying()) {
7634
- $pricing_cta_slug = 'pricing';
7635
- $pricing_class = '';
7636
- }
7637
- }
7638
-
7639
- // Add upgrade/pricing page.
7640
- $this->add_submenu_item(
7641
- $this->get_text($pricing_cta_slug) . '&nbsp;&nbsp;' . ( is_rtl() ? '&#x2190;' : '&#x27a4;' ), array(&$this, '_pricing_page_render'), $this->get_plugin_name() . ' &ndash; ' . $this->get_text('pricing'), 'manage_options', 'pricing', 'Freemius::_clean_admin_content_section', WP_FS__LOWEST_PRIORITY, $show_pricing, $pricing_class
7642
- );
7643
- }
7644
- }
7645
-
7646
-
7647
- if (0 < count($this->_menu_items)) {
7648
- if (!$this->_menu->is_top_level()) {
7649
- fs_enqueue_local_style('fs_common', '/admin/common.css');
7650
-
7651
- // Append submenu items right after the plugin's submenu item.
7652
- $this->order_sub_submenu_items();
7653
- } else {
7654
- // Append submenu items.
7655
- $this->embed_submenu_items();
7656
- }
7657
- }
7658
- }
7659
- /**
7660
- * Moved the actual submenu item additions to a separated function,
7661
- * in order to support sub-submenu items when the plugin's settings
7662
- * only have a submenu and not top-level menu item.
7663
- *
7664
- * @author Vova Feldman (@svovaf)
7665
- * @since 1.1.4
7666
- */
7667
- private function embed_submenu_items() {
7668
- $item_template = $this->_menu->is_top_level() ?
7669
- '<span class="fs-submenu-item %s %s %s">%s</span>' :
7670
- '<span class="fs-submenu-item fs-sub %s %s %s">%s</span>';
7671
-
7672
- $top_level_menu_capability = $this->get_top_level_menu_capability();
7673
-
7674
- ksort($this->_menu_items);
7675
-
7676
- foreach ($this->_menu_items as $priority => $items) {
7677
- foreach ($items as $item) {
7678
- $capability = (!empty($item['capability']) ? $item['capability'] : $top_level_menu_capability );
7679
-
7680
- $menu_item = sprintf(
7681
- $item_template, $this->_slug, $item['menu_slug'], !empty($item['class']) ? $item['class'] : '', $item['menu_title']
7682
- );
7683
-
7684
- $menu_slug = $this->_menu->get_slug($item['menu_slug']);
7685
-
7686
- if (!isset($item['url'])) {
7687
- $hook = FS_Admin_Menu_Manager::add_subpage(
7688
- $item['show_submenu'] ?
7689
- $this->get_top_level_menu_slug() :
7690
- null, $item['page_title'], $menu_item, $capability, $menu_slug, $item['render_function']
7691
- );
7692
-
7693
- if (false !== $item['before_render_function']) {
7694
- add_action("load-$hook", $item['before_render_function']);
7695
- }
7696
- } else {
7697
- FS_Admin_Menu_Manager::add_subpage(
7698
- $this->get_top_level_menu_slug(), $item['page_title'], $menu_item, $capability, $menu_slug, array($this, '')
7699
- );
7700
- }
7701
- }
7702
- }
7703
- }
7704
- /**
7705
- * Re-order the submenu items so all Freemius added new submenu items
7706
- * are added right after the plugin's settings submenu item.
7707
- *
7708
- * @author Vova Feldman (@svovaf)
7709
- * @since 1.1.4
7710
- */
7711
- private function order_sub_submenu_items() {
7712
- global $submenu;
7713
-
7714
- $menu_slug = $this->_menu->get_top_level_menu_slug();
7715
-
7716
- /**
7717
- * Before "admin_menu" fires, WordPress will loop over the default submenus and remove pages for which the user
7718
- * does not have permissions. So in case a plugin does not have top-level menu but does have submenus under any
7719
- * of the default menus, only users that have the right role can access its sub-submenus (Account, Contact Us,
7720
- * Support Forum, etc.) since $submenu[ $menu_slug ] will be empty if the user doesn't have permission.
7721
- *
7722
- * In case a plugin does not have submenus under any of the default menus but does have submenus under the menu
7723
- * of another plugin, only users that have the right role can access its sub-submenus since we will use the
7724
- * capability needed to access the parent menu as the capability for the submenus that we will add.
7725
- */
7726
- if (empty($submenu[$menu_slug])) {
7727
- return;
7728
- }
7729
-
7730
- $top_level_menu = &$submenu[$menu_slug];
7731
-
7732
- $all_submenu_items_after = array();
7733
-
7734
- $found_submenu_item = false;
7735
-
7736
- foreach ($top_level_menu as $submenu_id => $meta) {
7737
- if ($found_submenu_item) {
7738
- // Remove all submenu items after the plugin's submenu item.
7739
- $all_submenu_items_after[] = $meta;
7740
- unset($top_level_menu[$submenu_id]);
7741
- }
7742
-
7743
- if ($this->_menu->get_raw_slug() === $meta[2]) {
7744
- // Found the submenu item, put all below.
7745
- $found_submenu_item = true;
7746
- continue;
7747
- }
7748
- }
7749
-
7750
- // Embed all plugin's new submenu items.
7751
- $this->embed_submenu_items();
7752
-
7753
- // Start with specially high number to make sure it's appended.
7754
- $i = max(10000, max(array_keys($top_level_menu)) + 1);
7755
- foreach ($all_submenu_items_after as $meta) {
7756
- $top_level_menu[$i] = $meta;
7757
- $i ++;
7758
- }
7759
-
7760
- // Sort submenu items.
7761
- ksort($top_level_menu);
7762
- }
7763
- /**
7764
- * Displays the Support Forum link when enabled.
7765
- *
7766
- * Can be filtered like so:
7767
- *
7768
- * function _fs_show_support_menu( $is_visible, $menu_id ) {
7769
- * if ( 'support' === $menu_id ) {
7770
- * return _fs->is_registered();
7771
- * }
7772
- * return $is_visible;
7773
- * }
7774
- * _fs()->add_filter('is_submenu_visible', '_fs_show_support_menu', 10, 2);
7775
- *
7776
- */
7777
- function _add_default_submenu_items() {
7778
- if (!$this->is_on()) {
7779
- return;
7780
- }
7781
-
7782
- if (!$this->is_activation_mode()) {
7783
- if ($this->is_submenu_item_visible('support')) {
7784
- $this->add_submenu_link_item(
7785
- $this->apply_filters('support_forum_submenu', $this->get_text('support-forum')), $this->apply_filters('support_forum_url', 'https://wordpress.org/support/plugin/' . $this->_slug), 'wp-support-forum', null, 50
7786
- );
7787
- }
7788
- }
7789
- }
7790
- /**
7791
- * @author Vova Feldman (@svovaf)
7792
- * @since 1.0.1
7793
- *
7794
- * @param string $menu_title
7795
- * @param callable $render_function
7796
- * @param bool|string $page_title
7797
- * @param string $capability
7798
- * @param bool|string $menu_slug
7799
- * @param bool|callable $before_render_function
7800
- * @param int $priority
7801
- * @param bool $show_submenu
7802
- * @param string $class Since 1.2.1.5 can add custom classes to menu items.
7803
- */
7804
- function add_submenu_item(
7805
- $menu_title, $render_function, $page_title = false, $capability = 'manage_options', $menu_slug = false, $before_render_function = false, $priority = WP_FS__DEFAULT_PRIORITY, $show_submenu = true, $class = ''
7806
- ) {
7807
- $this->_logger->entrance('Title = ' . $menu_title);
7808
-
7809
- if ($this->is_addon()) {
7810
- $parent_fs = $this->get_parent_instance();
7811
-
7812
- if (is_object($parent_fs)) {
7813
- $parent_fs->add_submenu_item(
7814
- $menu_title, $render_function, $page_title, $capability, $menu_slug, $before_render_function, $priority, $show_submenu, $class
7815
- );
7816
-
7817
- return;
7818
- }
7819
- }
7820
-
7821
- if (!isset($this->_menu_items[$priority])) {
7822
- $this->_menu_items[$priority] = array();
7823
- }
7824
-
7825
- $this->_menu_items[$priority][] = array(
7826
- 'page_title' => is_string($page_title) ? $page_title : $menu_title,
7827
- 'menu_title' => $menu_title,
7828
- 'capability' => $capability,
7829
- 'menu_slug' => is_string($menu_slug) ? $menu_slug : strtolower($menu_title),
7830
- 'render_function' => $render_function,
7831
- 'before_render_function' => $before_render_function,
7832
- 'show_submenu' => $show_submenu,
7833
- 'class' => $class,
7834
- );
7835
- }
7836
- /**
7837
- * @author Vova Feldman (@svovaf)
7838
- * @since 1.0.1
7839
- *
7840
- * @param string $menu_title
7841
- * @param string $url
7842
- * @param bool $menu_slug
7843
- * @param string $capability
7844
- * @param int $priority
7845
- *
7846
- */
7847
- function add_submenu_link_item(
7848
- $menu_title, $url, $menu_slug = false, $capability = 'read', $priority = WP_FS__DEFAULT_PRIORITY
7849
- ) {
7850
- $this->_logger->entrance('Title = ' . $menu_title . '; Url = ' . $url);
7851
-
7852
- if ($this->is_addon()) {
7853
- $parent_fs = $this->get_parent_instance();
7854
-
7855
- if (is_object($parent_fs)) {
7856
- $parent_fs->add_submenu_link_item(
7857
- $menu_title, $url, $menu_slug, $capability, $priority
7858
- );
7859
-
7860
- return;
7861
- }
7862
- }
7863
-
7864
- if (!isset($this->_menu_items[$priority])) {
7865
- $this->_menu_items[$priority] = array();
7866
- }
7867
-
7868
- $this->_menu_items[$priority][] = array(
7869
- 'menu_title' => $menu_title,
7870
- 'capability' => $capability,
7871
- 'menu_slug' => is_string($menu_slug) ? $menu_slug : strtolower($menu_title),
7872
- 'url' => $url,
7873
- 'page_title' => $menu_title,
7874
- 'render_function' => 'fs_dummy',
7875
- 'before_render_function' => '',
7876
- );
7877
- }
7878
- #endregion ------------------------------------------------------------------
7879
- #--------------------------------------------------------------------------------
7880
- #region Actions / Hooks / Filters
7881
- #--------------------------------------------------------------------------------
7882
- /**
7883
- * @author Vova Feldman (@svovaf)
7884
- * @since 1.1.7
7885
- *
7886
- * @param string $tag
7887
- *
7888
- * @return string
7889
- */
7890
- public function get_action_tag($tag) {
7891
- return self::get_action_tag_static($tag, $this->_slug);
7892
- }
7893
- /**
7894
- * @author Vova Feldman (@svovaf)
7895
- * @since 1.2.1.6
7896
- *
7897
- * @param string $tag
7898
- * @param string $slug
7899
- *
7900
- * @return string
7901
- */
7902
- static function get_action_tag_static($tag, $slug = '') {
7903
- return "fs_{$tag}" . ( empty($slug) ? '' : "_{$slug}" );
7904
- }
7905
- /**
7906
- * @author Vova Feldman (@svovaf)
7907
- * @since 1.2.1
7908
- *
7909
- * @param string $tag
7910
- *
7911
- * @return string
7912
- */
7913
- function get_ajax_action($tag) {
7914
- return self::get_ajax_action_static($tag, $this->_slug);
7915
- }
7916
- /**
7917
- * @author Vova Feldman (@svovaf)
7918
- * @since 1.2.1.7
7919
- *
7920
- * @param string $tag
7921
- *
7922
- * @return string
7923
- */
7924
- function get_ajax_security($tag) {
7925
- return wp_create_nonce($this->get_ajax_action($tag));
7926
- }
7927
- /**
7928
- * @author Vova Feldman (@svovaf)
7929
- * @since 1.2.1.7
7930
- *
7931
- * @param string $tag
7932
- */
7933
- function check_ajax_referer($tag) {
7934
- check_ajax_referer($this->get_ajax_action($tag), 'security');
7935
- }
7936
- /**
7937
- * @author Vova Feldman (@svovaf)
7938
- * @since 1.2.1.6
7939
- *
7940
- * @param string $tag
7941
- * @param string $slug
7942
- *
7943
- * @return string
7944
- */
7945
- private static function get_ajax_action_static($tag, $slug = '') {
7946
- $action = "fs_{$tag}";
7947
-
7948
- if (!empty($slug)) {
7949
- $action .= "_{$slug}";
7950
- }
7951
-
7952
- return $action;
7953
- }
7954
- /**
7955
- * Do action, specific for the current context plugin.
7956
- *
7957
- * @author Vova Feldman (@svovaf)
7958
- * @since 1.0.1
7959
- *
7960
- * @param string $tag The name of the action to be executed.
7961
- * @param mixed $arg,... Optional. Additional arguments which are passed on to the
7962
- * functions hooked to the action. Default empty.
7963
- *
7964
- * @uses do_action()
7965
- */
7966
- function do_action($tag, $arg = '') {
7967
- $this->_logger->entrance($tag);
7968
-
7969
- $args = func_get_args();
7970
-
7971
- call_user_func_array('do_action', array_merge(
7972
- array($this->get_action_tag($tag)), array_slice($args, 1))
7973
- );
7974
- }
7975
- /**
7976
- * Add action, specific for the current context plugin.
7977
- *
7978
- * @author Vova Feldman (@svovaf)
7979
- * @since 1.0.1
7980
- *
7981
- * @param string $tag
7982
- * @param callable $function_to_add
7983
- * @param int $priority
7984
- * @param int $accepted_args
7985
- *
7986
- * @uses add_action()
7987
- */
7988
- function add_action(
7989
- $tag, $function_to_add, $priority = WP_FS__DEFAULT_PRIORITY, $accepted_args = 1
7990
- ) {
7991
- $this->_logger->entrance($tag);
7992
-
7993
- add_action($this->get_action_tag($tag), $function_to_add, $priority, $accepted_args);
7994
- }
7995
- /**
7996
- * Add AJAX action, specific for the current context plugin.
7997
- *
7998
- * @author Vova Feldman (@svovaf)
7999
- * @since 1.2.1
8000
- *
8001
- * @param string $tag
8002
- * @param callable $function_to_add
8003
- * @param int $priority
8004
- *
8005
- * @uses add_action()
8006
- *
8007
- * @return bool True if action added, false if no need to add the action since the AJAX call isn't matching.
8008
- */
8009
- function add_ajax_action(
8010
- $tag, $function_to_add, $priority = WP_FS__DEFAULT_PRIORITY
8011
- ) {
8012
- $this->_logger->entrance($tag);
8013
-
8014
- return self::add_ajax_action_static(
8015
- $tag, $function_to_add, $priority, $this->_slug
8016
- );
8017
- }
8018
- /**
8019
- * Add AJAX action.
8020
- *
8021
- * @author Vova Feldman (@svovaf)
8022
- * @since 1.2.1.6
8023
- *
8024
- * @param string $tag
8025
- * @param callable $function_to_add
8026
- * @param int $priority
8027
- * @param string $slug
8028
- *
8029
- * @return bool True if action added, false if no need to add the action since the AJAX call isn't matching.
8030
- * @uses add_action()
8031
- *
8032
- */
8033
- static function add_ajax_action_static(
8034
- $tag, $function_to_add, $priority = WP_FS__DEFAULT_PRIORITY, $slug = ''
8035
- ) {
8036
- self::$_static_logger->entrance($tag);
8037
-
8038
- if (!self::is_ajax_action_static($tag, $slug)) {
8039
- return false;
8040
- }
8041
-
8042
- add_action(
8043
- 'wp_ajax_' . self::get_ajax_action_static($tag, $slug), $function_to_add, $priority, 0
8044
- );
8045
-
8046
- self::$_static_logger->info("$tag AJAX callback action added.");
8047
-
8048
- return true;
8049
- }
8050
- /**
8051
- * Send a JSON response back to an Ajax request.
8052
- *
8053
- * @author Vova Feldman (@svovaf)
8054
- * @since 1.2.1.5
8055
- *
8056
- * @param mixed $response
8057
- */
8058
- static function shoot_ajax_response($response) {
8059
- wp_send_json($response);
8060
- }
8061
- /**
8062
- * Send a JSON response back to an Ajax request, indicating success.
8063
- *
8064
- * @author Vova Feldman (@svovaf)
8065
- * @since 1.2.1.5
8066
- *
8067
- * @param mixed $data Data to encode as JSON, then print and exit.
8068
- */
8069
- static function shoot_ajax_success($data = null) {
8070
- wp_send_json_success($data);
8071
- }
8072
- /**
8073
- * Send a JSON response back to an Ajax request, indicating failure.
8074
- *
8075
- * @author Vova Feldman (@svovaf)
8076
- * @since 1.2.1.5
8077
- *
8078
- * @param mixed $error Optional error message.
8079
- */
8080
- static function shoot_ajax_failure($error = '') {
8081
- $result = array('success' => false);
8082
- if (!empty($error)) {
8083
- $result['error'] = $error;
8084
- }
8085
-
8086
- wp_send_json($result);
8087
- }
8088
- /**
8089
- * Apply filter, specific for the current context plugin.
8090
- *
8091
- * @author Vova Feldman (@svovaf)
8092
- * @since 1.0.9
8093
- *
8094
- * @param string $tag The name of the filter hook.
8095
- * @param mixed $value The value on which the filters hooked to `$tag` are applied on.
8096
- *
8097
- * @return mixed The filtered value after all hooked functions are applied to it.
8098
- *
8099
- * @uses apply_filters()
8100
- */
8101
- function apply_filters($tag, $value) {
8102
- $this->_logger->entrance($tag);
8103
-
8104
- $args = func_get_args();
8105
- array_unshift($args, $this->_slug);
8106
-
8107
- return call_user_func_array('fs_apply_filter', $args);
8108
- }
8109
- /**
8110
- * Add filter, specific for the current context plugin.
8111
- *
8112
- * @author Vova Feldman (@svovaf)
8113
- * @since 1.0.9
8114
- *
8115
- * @param string $tag
8116
- * @param callable $function_to_add
8117
- * @param int $priority
8118
- * @param int $accepted_args
8119
- *
8120
- * @uses add_filter()
8121
- */
8122
- function add_filter($tag, $function_to_add, $priority = WP_FS__DEFAULT_PRIORITY, $accepted_args = 1) {
8123
- $this->_logger->entrance($tag);
8124
-
8125
- add_filter($this->get_action_tag($tag), $function_to_add, $priority, $accepted_args);
8126
- }
8127
- /**
8128
- * Check if has filter.
8129
- *
8130
- * @author Vova Feldman (@svovaf)
8131
- * @since 1.1.4
8132
- *
8133
- * @param string $tag
8134
- * @param callable|bool $function_to_check Optional. The callback to check for. Default false.
8135
- *
8136
- * @return false|int
8137
- *
8138
- * @uses has_filter()
8139
- */
8140
- function has_filter($tag, $function_to_check = false) {
8141
- $this->_logger->entrance($tag);
8142
-
8143
- return has_filter($this->get_action_tag($tag), $function_to_check);
8144
- }
8145
- #endregion
8146
- /**
8147
- * Override default i18n text phrases.
8148
- *
8149
- * @author Vova Feldman (@svovaf)
8150
- * @since 1.1.6
8151
- *
8152
- * @param string[] string $key_value
8153
- *
8154
- * @uses fs_override_i18n()
8155
- */
8156
- function override_i18n($key_value) {
8157
- fs_override_i18n($key_value, $this->_slug);
8158
- }
8159
- /* Account Page
8160
- ------------------------------------------------------------------------------------------------------------------ */
8161
- /**
8162
- * Update site information.
8163
- *
8164
- * @author Vova Feldman (@svovaf)
8165
- * @since 1.0.1
8166
- *
8167
- * @param bool $store Flush to Database if true.
8168
- */
8169
- private function _store_site($store = true) {
8170
- $this->_logger->entrance();
8171
-
8172
- if (empty($this->_site->id)) {
8173
- $this->_logger->error("Empty install ID, can't store site.");
8174
-
8175
- return;
8176
- }
8177
-
8178
- $encrypted_site = clone $this->_site;
8179
- $encrypted_site->plan = self::_encrypt_entity($this->_site->plan);
8180
-
8181
- $sites = self::get_all_sites();
8182
- $sites[$this->_slug] = $encrypted_site;
8183
- self::$_accounts->set_option('sites', $sites, $store);
8184
- }
8185
- /**
8186
- * Update plugin's plans information.
8187
- *
8188
- * @author Vova Feldman (@svovaf)
8189
- * @since 1.0.2
8190
- *
8191
- * @param bool $store Flush to Database if true.
8192
- */
8193
- private function _store_plans($store = true) {
8194
- $this->_logger->entrance();
8195
-
8196
- $plans = self::get_all_plans();
8197
-
8198
- // Copy plans.
8199
- $encrypted_plans = array();
8200
- for ($i = 0, $len = count($this->_plans); $i < $len; $i ++) {
8201
- $encrypted_plans[] = self::_encrypt_entity($this->_plans[$i]);
8202
- }
8203
-
8204
- $plans[$this->_slug] = $encrypted_plans;
8205
- self::$_accounts->set_option('plans', $plans, $store);
8206
- }
8207
- /**
8208
- * Update user's plugin licenses.
8209
- *
8210
- * @author Vova Feldman (@svovaf)
8211
- * @since 1.0.5
8212
- *
8213
- * @param bool $store
8214
- * @param string|bool $plugin_slug
8215
- * @param FS_Plugin_License[] $licenses
8216
- */
8217
- private function _store_licenses($store = true, $plugin_slug = false, $licenses = array()) {
8218
- $this->_logger->entrance();
8219
-
8220
- $all_licenses = self::get_all_licenses();
8221
-
8222
- if (!is_string($plugin_slug)) {
8223
- $plugin_slug = $this->_slug;
8224
- $licenses = $this->_licenses;
8225
- }
8226
-
8227
- if (!isset($all_licenses[$plugin_slug])) {
8228
- $all_licenses[$plugin_slug] = array();
8229
- }
8230
-
8231
- $all_licenses[$plugin_slug][$this->_user->id] = $licenses;
8232
-
8233
- self::$_accounts->set_option('licenses', $all_licenses, $store);
8234
- }
8235
- /**
8236
- * Update user information.
8237
- *
8238
- * @author Vova Feldman (@svovaf)
8239
- * @since 1.0.1
8240
- *
8241
- * @param bool $store Flush to Database if true.
8242
- */
8243
- private function _store_user($store = true) {
8244
- $this->_logger->entrance();
8245
-
8246
- if (empty($this->_user->id)) {
8247
- $this->_logger->error("Empty user ID, can't store user.");
8248
-
8249
- return;
8250
- }
8251
-
8252
- $users = self::get_all_users();
8253
- $users[$this->_user->id] = $this->_user;
8254
- self::$_accounts->set_option('users', $users, $store);
8255
- }
8256
- /**
8257
- * Update new updates information.
8258
- *
8259
- * @author Vova Feldman (@svovaf)
8260
- * @since 1.0.4
8261
- *
8262
- * @param FS_Plugin_Tag|null $update
8263
- * @param bool $store Flush to Database if true.
8264
- * @param bool|number $plugin_id
8265
- */
8266
- private function _store_update($update, $store = true, $plugin_id = false) {
8267
- $this->_logger->entrance();
8268
-
8269
- if ($update instanceof FS_Plugin_Tag) {
8270
- $update->updated = time();
8271
- }
8272
-
8273
- if (!is_numeric($plugin_id)) {
8274
- $plugin_id = $this->_plugin->id;
8275
- }
8276
-
8277
- $updates = self::get_all_updates();
8278
- $updates[$plugin_id] = $update;
8279
- self::$_accounts->set_option('updates', $updates, $store);
8280
- }
8281
- /**
8282
- * Update new updates information.
8283
- *
8284
- * @author Vova Feldman (@svovaf)
8285
- * @since 1.0.6
8286
- *
8287
- * @param FS_Plugin[] $plugin_addons
8288
- * @param bool $store Flush to Database if true.
8289
- */
8290
- private function _store_addons($plugin_addons, $store = true) {
8291
- $this->_logger->entrance();
8292
-
8293
- $addons = self::get_all_addons();
8294
- $addons[$this->_plugin->id] = $plugin_addons;
8295
- self::$_accounts->set_option('addons', $addons, $store);
8296
- }
8297
- /**
8298
- * Delete plugin's associated add-ons.
8299
- *
8300
- * @author Vova Feldman (@svovaf)
8301
- * @since 1.0.8
8302
- *
8303
- * @param bool $store
8304
- *
8305
- * @return bool
8306
- */
8307
- private function _delete_account_addons($store = true) {
8308
- $all_addons = self::get_all_account_addons();
8309
-
8310
- if (!isset($all_addons[$this->_plugin->id])) {
8311
- return false;
8312
- }
8313
-
8314
- unset($all_addons[$this->_plugin->id]);
8315
-
8316
- self::$_accounts->set_option('account_addons', $all_addons, $store);
8317
-
8318
- return true;
8319
- }
8320
- /**
8321
- * Update account add-ons list.
8322
- *
8323
- * @author Vova Feldman (@svovaf)
8324
- * @since 1.0.6
8325
- *
8326
- * @param FS_Plugin[] $addons
8327
- * @param bool $store Flush to Database if true.
8328
- */
8329
- private function _store_account_addons($addons, $store = true) {
8330
- $this->_logger->entrance();
8331
-
8332
- $all_addons = self::get_all_account_addons();
8333
- $all_addons[$this->_plugin->id] = $addons;
8334
- self::$_accounts->set_option('account_addons', $all_addons, $store);
8335
- }
8336
- /**
8337
- * Store account params in the Database.
8338
- *
8339
- * @author Vova Feldman (@svovaf)
8340
- * @since 1.0.1
8341
- */
8342
- private function _store_account() {
8343
- $this->_logger->entrance();
8344
-
8345
- $this->_store_site(false);
8346
- $this->_store_user(false);
8347
- $this->_store_plans(false);
8348
- $this->_store_licenses(false);
8349
-
8350
- self::$_accounts->store();
8351
- }
8352
- /**
8353
- * Sync user's information.
8354
- *
8355
- * @author Vova Feldman (@svovaf)
8356
- * @since 1.0.3
8357
- * @uses FS_Api
8358
- */
8359
- private function _handle_account_user_sync() {
8360
- $this->_logger->entrance();
8361
-
8362
- $api = $this->get_api_user_scope();
8363
-
8364
- // Get user's information.
8365
- $user = $api->get('/', true);
8366
-
8367
- if (isset($user->id)) {
8368
- $this->_user->first = $user->first;
8369
- $this->_user->last = $user->last;
8370
- $this->_user->email = $user->email;
8371
-
8372
- $is_menu_item_account_visible = $this->is_submenu_item_visible('account');
8373
-
8374
- if ($user->is_verified &&
8375
- (!isset($this->_user->is_verified) || false === $this->_user->is_verified )
8376
- ) {
8377
- $this->_user->is_verified = true;
8378
-
8379
- $this->do_action('account_email_verified', $user->email);
8380
-
8381
- $this->_admin_notices->add(
8382
- $this->get_text('email-verified-message'), $this->get_text('right-on') . '!', 'success',
8383
- // Make admin sticky if account menu item is invisible,
8384
- // since the page will be auto redirected to the plugin's
8385
- // main settings page, and the non-sticky message
8386
- // will disappear.
8387
- !$is_menu_item_account_visible, false, 'email_verified'
8388
- );
8389
- }
8390
-
8391
- // Flush user details to DB.
8392
- $this->_store_user();
8393
-
8394
- $this->do_action('after_account_user_sync', $user);
8395
-
8396
- /**
8397
- * If account menu item is hidden, redirect to plugin's main settings page.
8398
- *
8399
- * @author Vova Feldman (@svovaf)
8400
- * @since 1.1.6
8401
- *
8402
- * @link https://github.com/Freemius/wordpress-sdk/issues/6
8403
- */
8404
- if (!$is_menu_item_account_visible) {
8405
- fs_redirect($this->_get_admin_page_url());
8406
- }
8407
- }
8408
- }
8409
- /**
8410
- * @param bool $store
8411
- *
8412
- * @return FS_Plugin_Plan|object|false
8413
- */
8414
- private function _enrich_site_plan($store = true) {
8415
- // Try to load plan from local cache.
8416
- $plan = $this->_get_plan_by_id($this->_site->plan->id);
8417
-
8418
- if (false === $plan) {
8419
- $plan = $this->_fetch_site_plan();
8420
- }
8421
-
8422
- if ($plan instanceof FS_Plugin_Plan) {
8423
- $this->_update_plan($plan, $store);
8424
- }
8425
-
8426
- return $plan;
8427
- }
8428
- /**
8429
- * @author Vova Feldman (@svovaf)
8430
- * @since 1.0.9
8431
- * @uses FS_Api
8432
- *
8433
- * @param bool $store
8434
- *
8435
- * @return FS_Plugin_Plan|object|false
8436
- */
8437
- private function _enrich_site_trial_plan($store = true) {
8438
- // Try to load plan from local cache.
8439
- $trial_plan = $this->_get_plan_by_id($this->_site->trial_plan_id);
8440
-
8441
- if (false === $trial_plan) {
8442
- $trial_plan = $this->_fetch_site_plan($this->_site->trial_plan_id);
8443
- }
8444
-
8445
- if ($trial_plan instanceof FS_Plugin_Plan) {
8446
- $this->_storage->store('trial_plan', $trial_plan, $store);
8447
- }
8448
-
8449
- return $trial_plan;
8450
- }
8451
- /**
8452
- * @author Vova Feldman (@svovaf)
8453
- * @since 1.0.9
8454
- * @uses FS_Api
8455
- *
8456
- * @param number|bool $license_id
8457
- *
8458
- * @return FS_Subscription|object|bool
8459
- */
8460
- private function _fetch_site_license_subscription($license_id = false) {
8461
- $this->_logger->entrance();
8462
- $api = $this->get_api_site_scope();
8463
-
8464
- if (!is_numeric($license_id)) {
8465
- $license_id = $this->_license->id;
8466
- }
8467
-
8468
- $result = $api->get("/licenses/{$license_id}/subscriptions.json", true);
8469
-
8470
- return !isset($result->error) ?
8471
- ( ( is_array($result->subscriptions) && 0 < count($result->subscriptions) ) ?
8472
- new FS_Subscription($result->subscriptions[0]) :
8473
- false
8474
- ) :
8475
- $result;
8476
- }
8477
- /**
8478
- * @author Vova Feldman (@svovaf)
8479
- * @since 1.0.4
8480
- * @uses FS_Api
8481
- *
8482
- * @param number|bool $plan_id
8483
- *
8484
- * @return FS_Plugin_Plan|object
8485
- */
8486
- private function _fetch_site_plan($plan_id = false) {
8487
- $this->_logger->entrance();
8488
- $api = $this->get_api_site_scope();
8489
-
8490
- if (!is_numeric($plan_id)) {
8491
- $plan_id = $this->_site->plan->id;
8492
- }
8493
-
8494
- $plan = $api->get("/plans/{$plan_id}.json", true);
8495
-
8496
- return !isset($plan->error) ? new FS_Plugin_Plan($plan) : $plan;
8497
- }
8498
- /**
8499
- * @author Vova Feldman (@svovaf)
8500
- * @since 1.0.5
8501
- * @uses FS_Api
8502
- *
8503
- * @return FS_Plugin_Plan[]|object
8504
- */
8505
- private function _fetch_plugin_plans() {
8506
- $this->_logger->entrance();
8507
- $api = $this->get_api_site_scope();
8508
-
8509
- $result = $api->get('/plans.json', true);
8510
-
8511
- if ($this->is_api_result_object($result, 'plans') && is_array($result->plans)) {
8512
- for ($i = 0, $len = count($result->plans); $i < $len; $i ++) {
8513
- $result->plans[$i] = new FS_Plugin_Plan($result->plans[$i]);
8514
- }
8515
-
8516
- $result = $result->plans;
8517
- }
8518
-
8519
- return $result;
8520
- }
8521
- /**
8522
- * @author Vova Feldman (@svovaf)
8523
- * @since 1.0.5
8524
- * @uses FS_Api
8525
- *
8526
- * @param number|bool $plugin_id
8527
- * @param number|bool $site_license_id
8528
- *
8529
- * @return FS_Plugin_License[]|object
8530
- */
8531
- private function _fetch_licenses($plugin_id = false, $site_license_id = false) {
8532
- $this->_logger->entrance();
8533
-
8534
- $api = $this->get_api_user_scope();
8535
-
8536
- if (!is_numeric($plugin_id)) {
8537
- $plugin_id = $this->_plugin->id;
8538
- }
8539
-
8540
- $result = $api->get("/plugins/{$plugin_id}/licenses.json", true);
8541
-
8542
- $is_site_license_synced = false;
8543
-
8544
- $api_errors = array();
8545
-
8546
- if ($this->is_api_result_object($result, 'licenses') &&
8547
- is_array($result->licenses)
8548
- ) {
8549
- for ($i = 0, $len = count($result->licenses); $i < $len; $i ++) {
8550
- $result->licenses[$i] = new FS_Plugin_License($result->licenses[$i]);
8551
-
8552
- if ((!$is_site_license_synced ) && is_numeric($site_license_id)) {
8553
- $is_site_license_synced = ( $site_license_id == $result->licenses[$i]->id );
8554
- }
8555
- }
8556
-
8557
- $result = $result->licenses;
8558
- } else {
8559
- $api_errors[] = $result;
8560
- $result = array();
8561
- }
8562
-
8563
- if (!$is_site_license_synced) {
8564
- $api = $this->get_api_site_scope();
8565
-
8566
- if (is_numeric($site_license_id)) {
8567
- // Try to retrieve a foreign license that is linked to the install.
8568
- $api_result = $api->call('/licenses.json');
8569
-
8570
- if ($this->is_api_result_object($api_result, 'licenses') &&
8571
- is_array($api_result->licenses)
8572
- ) {
8573
- $licenses = $api_result->licenses;
8574
-
8575
- if (!empty($licenses)) {
8576
- $result[] = new FS_Plugin_License($licenses[0]);
8577
- }
8578
- } else {
8579
- $api_errors[] = $api_result;
8580
- }
8581
- } else if (is_object($this->_license)) {
8582
- // Fetch foreign license by ID and license key.
8583
- $license = $api->get("/licenses/{$this->_license->id}.json?license_key=" .
8584
- urlencode($this->_license->secret_key));
8585
-
8586
- if ($this->is_api_result_entity($license)) {
8587
- $result[] = new FS_Plugin_License($license);
8588
- } else {
8589
- $api_errors[] = $license;
8590
- }
8591
- }
8592
- }
8593
-
8594
- if (is_array($result) && 0 < count($result)) {
8595
- // If found at least one license, return license collection even if there are errors.
8596
- return $result;
8597
- }
8598
-
8599
- if (!empty($api_errors)) {
8600
- // If found any errors and no licenses, return first error.
8601
- return $api_errors[0];
8602
- }
8603
-
8604
- // Fallback to empty licenses list.
8605
- return $result;
8606
- }
8607
- /**
8608
- * @author Vova Feldman (@svovaf)
8609
- * @since 1.2.0
8610
- * @uses FS_Api
8611
- *
8612
- * @param number|bool $plugin_id
8613
- *
8614
- * @return FS_Payment[]|object
8615
- */
8616
- function _fetch_payments($plugin_id = false) {
8617
- $this->_logger->entrance();
8618
-
8619
- $api = $this->get_api_user_scope();
8620
-
8621
- if (!is_numeric($plugin_id)) {
8622
- $plugin_id = $this->_plugin->id;
8623
- }
8624
-
8625
- $result = $api->get("/plugins/{$plugin_id}/payments.json?include_addons=true", true);
8626
-
8627
- if (!isset($result->error)) {
8628
- for ($i = 0, $len = count($result->payments); $i < $len; $i ++) {
8629
- $result->payments[$i] = new FS_Payment($result->payments[$i]);
8630
- }
8631
- $result = $result->payments;
8632
- }
8633
-
8634
- return $result;
8635
- }
8636
- /**
8637
- * @author Vova Feldman (@svovaf)
8638
- * @since 1.2.1.5
8639
- * @uses FS_Api
8640
- *
8641
- * @return \FS_Billing|mixed
8642
- */
8643
- function _fetch_billing() {
8644
- require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-billing.php';
8645
-
8646
- $billing = $this->get_api_user_scope()->call('billing.json');
8647
-
8648
- if ($this->is_api_result_entity($billing)) {
8649
- $billing = new FS_Billing($billing);
8650
- }
8651
-
8652
- return $billing;
8653
- }
8654
- /**
8655
- * @author Vova Feldman (@svovaf)
8656
- * @since 1.0.4
8657
- *
8658
- * @param FS_Plugin_Plan $plan
8659
- * @param bool $store
8660
- */
8661
- private function _update_plan($plan, $store = false) {
8662
- $this->_logger->entrance();
8663
-
8664
- $this->_site->plan = $plan;
8665
- $this->_store_site($store);
8666
- }
8667
- /**
8668
- * @author Vova Feldman (@svovaf)
8669
- * @since 1.0.5
8670
- *
8671
- * @param FS_Plugin_License[] $licenses
8672
- * @param string|bool $plugin_slug
8673
- */
8674
- private function _update_licenses($licenses, $plugin_slug = false) {
8675
- $this->_logger->entrance();
8676
-
8677
- if (is_array($licenses)) {
8678
- for ($i = 0, $len = count($licenses); $i < $len; $i ++) {
8679
- $licenses[$i]->updated = time();
8680
- }
8681
- }
8682
-
8683
- if (!is_string($plugin_slug)) {
8684
- $this->_licenses = $licenses;
8685
- }
8686
-
8687
- $this->_store_licenses(true, $plugin_slug, $licenses);
8688
- }
8689
- /**
8690
- * @author Vova Feldman (@svovaf)
8691
- * @since 1.0.4
8692
- *
8693
- * @param bool|number $plugin_id
8694
- * @param bool $flush Since 1.1.7.3
8695
- *
8696
- * @return object|false New plugin tag info if exist.
8697
- */
8698
- private function _fetch_newer_version($plugin_id = false, $flush = true) {
8699
- $latest_tag = $this->_fetch_latest_version($plugin_id, $flush);
8700
-
8701
- if (!is_object($latest_tag)) {
8702
- return false;
8703
- }
8704
-
8705
- // Check if version is actually newer.
8706
- $has_new_version = // If it's an non-installed add-on then always return latest.
8707
- ( $this->_is_addon_id($plugin_id) && !$this->is_addon_activated($plugin_id) ) ||
8708
- // Compare versions.
8709
- version_compare($this->get_plugin_version(), $latest_tag->version, '<');
8710
-
8711
- $this->_logger->departure($has_new_version ? 'Found newer plugin version ' . $latest_tag->version : 'No new version' );
8712
-
8713
- return $has_new_version ? $latest_tag : false;
8714
- }
8715
- /**
8716
- * @author Vova Feldman (@svovaf)
8717
- * @since 1.0.5
8718
- *
8719
- * @param bool|number $plugin_id
8720
- * @param bool $flush Since 1.1.7.3
8721
- *
8722
- * @return bool|FS_Plugin_Tag
8723
- */
8724
- function get_update($plugin_id = false, $flush = true) {
8725
- $this->_logger->entrance();
8726
-
8727
- if (!is_numeric($plugin_id)) {
8728
- $plugin_id = $this->_plugin->id;
8729
- }
8730
-
8731
- $this->check_updates(true, $plugin_id, $flush);
8732
- $updates = $this->get_all_updates();
8733
-
8734
- return isset($updates[$plugin_id]) && is_object($updates[$plugin_id]) ? $updates[$plugin_id] : false;
8735
- }
8736
- /**
8737
- * Check if site assigned with active license.
8738
- *
8739
- * @author Vova Feldman (@svovaf)
8740
- * @since 1.0.6
8741
- *
8742
- * @deprecated Please use has_active_valid_license() instead because license can be cancelled.
8743
- */
8744
- function has_active_license() {
8745
- return (
8746
- is_object($this->_license) &&
8747
- is_numeric($this->_license->id) &&
8748
- !$this->_license->is_expired()
8749
- );
8750
- }
8751
- /**
8752
- * Check if site assigned with active & valid (not expired) license.
8753
- *
8754
- * @author Vova Feldman (@svovaf)
8755
- * @since 1.2.1
8756
- */
8757
- function has_active_valid_license() {
8758
- return (
8759
- is_object($this->_license) &&
8760
- is_numeric($this->_license->id) &&
8761
- $this->_license->is_active() &&
8762
- $this->_license->is_valid()
8763
- );
8764
- }
8765
- /**
8766
- * Check if site assigned with license with enabled features.
8767
- *
8768
- * @author Vova Feldman (@svovaf)
8769
- * @since 1.0.6
8770
- *
8771
- * @return bool
8772
- */
8773
- function has_features_enabled_license() {
8774
- return (
8775
- is_object($this->_license) &&
8776
- is_numeric($this->_license->id) &&
8777
- $this->_license->is_features_enabled()
8778
- );
8779
- }
8780
- /**
8781
- * Check if user is a trial or have feature enabled license.
8782
- *
8783
- * @author Vova Feldman (@svovaf)
8784
- * @since 1.1.7
8785
- *
8786
- * @return bool
8787
- */
8788
- function can_use_premium_code() {
8789
- return $this->is_trial() || $this->has_features_enabled_license();
8790
- }
8791
- /**
8792
- * Checks if the current user can activate plugins or switch themes. Note that this method should only be used
8793
- * after the `init` action is triggered because it is using `current_user_can()` which is only functional after
8794
- * the context user is authenticated.
8795
- *
8796
- * @author Leo Fajardo (@leorw)
8797
- * @since 1.2.2
8798
- *
8799
- * @return bool
8800
- */
8801
- function is_user_admin() {
8802
- return current_user_can('activate_plugins');
8803
- }
8804
- /**
8805
- * Sync site's plan.
8806
- *
8807
- * @author Vova Feldman (@svovaf)
8808
- * @since 1.0.3
8809
- *
8810
- * @uses FS_Api
8811
- *
8812
- * @param bool $background Hints the method if it's a background sync. If false, it means that was initiated by
8813
- * the admin.
8814
- */
8815
- private function _sync_license($background = false) {
8816
- $this->_logger->entrance();
8817
-
8818
- $plugin_id = fs_request_get('plugin_id', $this->get_id());
8819
-
8820
- $is_addon_sync = (!$this->_plugin->is_addon() && $plugin_id != $this->get_id() );
8821
-
8822
- if ($is_addon_sync) {
8823
- $this->_sync_addon_license($plugin_id, $background);
8824
- } else {
8825
- $this->_sync_plugin_license($background);
8826
- }
8827
-
8828
- $this->do_action('after_account_plan_sync', $this->_site->plan->name);
8829
- }
8830
- /**
8831
- * Sync plugin's add-on license.
8832
- *
8833
- * @author Vova Feldman (@svovaf)
8834
- * @since 1.0.6
8835
- * @uses FS_Api
8836
- *
8837
- * @param number $addon_id
8838
- * @param bool $background
8839
- */
8840
- private function _sync_addon_license($addon_id, $background) {
8841
- $this->_logger->entrance();
8842
-
8843
- if ($this->is_addon_activated($addon_id)) {
8844
- // If already installed, use add-on sync.
8845
- $fs_addon = self::get_instance_by_id($addon_id);
8846
- $fs_addon->_sync_license($background);
8847
-
8848
- return;
8849
- }
8850
-
8851
- // Validate add-on exists.
8852
- $addon = $this->get_addon($addon_id);
8853
-
8854
- if (!is_object($addon)) {
8855
- return;
8856
- }
8857
-
8858
- // Add add-on into account add-ons.
8859
- $account_addons = $this->get_account_addons();
8860
- if (!is_array($account_addons)) {
8861
- $account_addons = array();
8862
- }
8863
- $account_addons[] = $addon->id;
8864
- $account_addons = array_unique($account_addons);
8865
- $this->_store_account_addons($account_addons);
8866
-
8867
- // Load add-on licenses.
8868
- $licenses = $this->_fetch_licenses($addon->id);
8869
-
8870
- // Sync add-on licenses.
8871
- if ($this->is_array_instanceof($licenses, 'FS_Plugin_License')) {
8872
- $this->_update_licenses($licenses, $addon->slug);
8873
-
8874
- if (!$this->is_addon_installed($addon->slug) && FS_License_Manager::has_premium_license($licenses)) {
8875
- $plans_result = $this->get_api_site_or_plugin_scope()->get("/addons/{$addon_id}/plans.json");
8876
-
8877
- if (!isset($plans_result->error)) {
8878
- $plans = array();
8879
- foreach ($plans_result->plans as $plan) {
8880
- $plans[] = new FS_Plugin_Plan($plan);
8881
- }
8882
-
8883
- $this->_admin_notices->add_sticky(
8884
- FS_Plan_Manager::instance()->has_free_plan($plans) ?
8885
- sprintf(
8886
- $this->get_text('addon-successfully-upgraded-message'), $addon->title
8887
- ) . ' ' . $this->get_latest_download_link(
8888
- $this->get_text('download-latest-version'), $addon_id
8889
- ) :
8890
- sprintf(
8891
- $this->get_text('addon-successfully-purchased-message'), $addon->title
8892
- ) . ' ' . $this->get_latest_download_link(
8893
- $this->get_text('download-latest-version'), $addon_id
8894
- ), 'addon_plan_upgraded_' . $addon->slug, $this->get_text('yee-haw') . '!'
8895
- );
8896
- }
8897
- }
8898
- }
8899
- }
8900
- /**
8901
- * Sync site's plugin plan.
8902
- *
8903
- * @author Vova Feldman (@svovaf)
8904
- * @since 1.0.6
8905
- * @uses FS_Api
8906
- *
8907
- * @param bool $background Hints the method if it's a background sync. If false, it means that was initiated by
8908
- * the admin.
8909
- */
8910
- private function _sync_plugin_license($background = false) {
8911
- $this->_logger->entrance();
8912
-
8913
- /**
8914
- * Sync site info.
8915
- *
8916
- * @todo This line will execute install sync on a daily basis, even if running the free version (for opted-in users). The reason we want to keep it that way is for cases when the user was a paying customer, then there was a failure in subscription payment, and then after some time the payment was successful. This could be heavily optimized. For example, we can skip the $flush if the current install was never associated with a paid version.
8917
- */
8918
- $site = $this->send_install_update(array(), true);
8919
-
8920
- $plan_change = 'none';
8921
-
8922
- if (!$this->is_api_result_entity($site)) {
8923
- // Show API messages only if not background sync or if paying customer.
8924
- if (!$background || $this->is_paying()) {
8925
- // Try to ping API to see if not blocked.
8926
- if (!FS_Api::test()) {
8927
- /**
8928
- * Failed to ping API - blocked!
8929
- *
8930
- * @author Vova Feldman (@svovaf)
8931
- * @since 1.1.6 Only show message related to one of the Freemius powered plugins. Once it will be resolved it will fix the issue for all plugins anyways. There's no point to scare users with multiple error messages.
8932
- */
8933
- $api = $this->get_api_site_scope();
8934
-
8935
- if (!self::$_global_admin_notices->has_sticky('api_blocked')) {
8936
- self::$_global_admin_notices->add(
8937
- sprintf(
8938
- $this->get_text('server-blocking-access'), $this->get_plugin_name(), '<a href="' . $api->get_url() . '" target="_blank">' . $api->get_url() . '</a>'
8939
- ) . '<br> ' . $this->get_text('server-error-message') . var_export($site->error, true), $this->get_text('oops') . '...', 'error', $background, false, 'api_blocked'
8940
- );
8941
- }
8942
- } else {
8943
- // Authentication params are broken.
8944
- $this->_admin_notices->add(
8945
- $this->get_text('wrong-authentication-param-message'), $this->get_text('oops') . '...', 'error'
8946
- );
8947
- }
8948
- }
8949
-
8950
- // No reason to continue with license sync while there are API issues.
8951
- return;
8952
- }
8953
-
8954
- // Remove sticky API connectivity message.
8955
- self::$_global_admin_notices->remove_sticky('api_blocked');
8956
-
8957
- $site = new FS_Site($site);
8958
-
8959
- // Sync plans.
8960
- $this->_sync_plans();
8961
-
8962
- if (!$this->has_paid_plan()) {
8963
- $this->_site = $site;
8964
- $this->_enrich_site_plan(true);
8965
- $this->_store_site();
8966
- } else {
8967
- /**
8968
- * Sync licenses. Pass the site's license ID so that the foreign licenses will be fetched if the license
8969
- * associated with that ID is not included in the user's licenses collection.
8970
- */
8971
- $this->_sync_licenses($site->license_id);
8972
-
8973
- // Check if plan / license changed.
8974
- if (!FS_Entity::equals($site->plan, $this->_site->plan) ||
8975
- // Check if trial started.
8976
- $site->trial_plan_id != $this->_site->trial_plan_id ||
8977
- $site->trial_ends != $this->_site->trial_ends ||
8978
- // Check if license changed.
8979
- $site->license_id != $this->_site->license_id
8980
- ) {
8981
- if ($site->is_trial() && (!$this->_site->is_trial() || $site->trial_ends != $this->_site->trial_ends )) {
8982
- // New trial started.
8983
- $this->_site = $site;
8984
- $plan_change = 'trial_started';
8985
-
8986
- // Store trial plan information.
8987
- $this->_enrich_site_trial_plan(true);
8988
-
8989
- // For trial with subscription use-case.
8990
- $new_license = is_null($site->license_id) ? null : $this->_get_license_by_id($site->license_id);
8991
-
8992
- if (is_object($new_license) && $new_license->is_valid()) {
8993
- $this->_site = $site;
8994
- $this->_update_site_license($new_license);
8995
- $this->_store_licenses();
8996
- $this->_enrich_site_plan(true);
8997
-
8998
- $this->_sync_site_subscription($this->_license);
8999
- }
9000
- } else if ($this->_site->is_trial() && !$site->is_trial() && !is_numeric($site->license_id)) {
9001
- // Was in trial, but now trial expired and no license ID.
9002
- // New trial started.
9003
- $this->_site = $site;
9004
- $plan_change = 'trial_expired';
9005
-
9006
- // Clear trial plan information.
9007
- $this->_storage->trial_plan = null;
9008
- } else {
9009
- $is_free = $this->is_free_plan();
9010
-
9011
- // Make sure license exist and not expired.
9012
- $new_license = is_null($site->license_id) ?
9013
- null :
9014
- $this->_get_license_by_id($site->license_id);
9015
-
9016
- if ($is_free && is_null($new_license) && $this->has_any_license() && $this->_license->is_cancelled) {
9017
- // License cancelled.
9018
- $this->_site = $site;
9019
- $this->_update_site_license($new_license);
9020
- $this->_store_licenses();
9021
- $this->_enrich_site_plan(true);
9022
-
9023
- $plan_change = 'cancelled';
9024
- } else if ($is_free && ( (!is_object($new_license) || $new_license->is_expired() ) )) {
9025
- // The license is expired, so ignore upgrade method.
9026
- } else {
9027
- // License changed.
9028
- $this->_site = $site;
9029
- $this->_update_site_license($new_license);
9030
- $this->_store_licenses();
9031
- $this->_enrich_site_plan(true);
9032
-
9033
- $plan_change = $is_free ?
9034
- 'upgraded' :
9035
- ( is_object($new_license) ?
9036
- 'changed' :
9037
- 'downgraded' );
9038
- }
9039
- }
9040
-
9041
- // Store updated site info.
9042
- $this->_store_site();
9043
- } else {
9044
- if (is_object($this->_license) && $this->_license->is_expired()) {
9045
- if (!$this->has_features_enabled_license()) {
9046
- $this->_deactivate_license();
9047
- $plan_change = 'downgraded';
9048
- } else {
9049
- $plan_change = 'expired';
9050
- }
9051
- }
9052
-
9053
- if (is_numeric($site->license_id) && is_object($this->_license)) {
9054
- $this->_sync_site_subscription($this->_license);
9055
- }
9056
- }
9057
- }
9058
-
9059
- if ($this->has_paid_plan()) {
9060
- switch ($plan_change) {
9061
- case 'none':
9062
- if (!$background && is_admin()) {
9063
- $plan = $this->is_trial() ?
9064
- $this->_storage->trial_plan :
9065
- $this->_site->plan;
9066
-
9067
- if ($plan->is_free()) {
9068
- $this->_admin_notices->add(
9069
- sprintf(
9070
- $this->get_text('plan-did-not-change-message'), '<i><b>' . $plan->title . ( $this->is_trial() ? ' ' . $this->get_text('trial') : '' ) . '</b></i>'
9071
- ) . ' ' . sprintf(
9072
- '<a href="%s">%s</a>', $this->contact_url(
9073
- 'bug', sprintf($this->get_text('plan-did-not-change-email-message'), strtoupper($plan->name)
9074
- )
9075
- ), $this->get_text('contact-us-here')
9076
- ), $this->get_text('hmm') . '...'
9077
- );
9078
- }
9079
- }
9080
- break;
9081
- case 'upgraded':
9082
- $this->_admin_notices->add_sticky(
9083
- sprintf(
9084
- $this->get_text('plan-upgraded-message'), '<i>' . $this->get_plugin_name() . '</i>'
9085
- ) . $this->get_complete_upgrade_instructions(), 'plan_upgraded', $this->get_text('yee-haw') . '!'
9086
- );
9087
-
9088
- $this->_admin_notices->remove_sticky(array(
9089
- 'trial_started',
9090
- 'trial_promotion',
9091
- 'trial_expired',
9092
- 'activation_complete',
9093
- ));
9094
- break;
9095
- case 'changed':
9096
- $this->_admin_notices->add_sticky(
9097
- sprintf(
9098
- $this->get_text('plan-changed-to-x-message'), $this->_site->plan->title
9099
- ), 'plan_changed'
9100
- );
9101
-
9102
- $this->_admin_notices->remove_sticky(array(
9103
- 'trial_started',
9104
- 'trial_promotion',
9105
- 'trial_expired',
9106
- 'activation_complete',
9107
- ));
9108
- break;
9109
- case 'downgraded':
9110
- $this->_admin_notices->add_sticky(
9111
- sprintf($this->get_text('license-expired-blocking-message')), 'license_expired', $this->get_text('hmm') . '...'
9112
- );
9113
- $this->_admin_notices->remove_sticky('plan_upgraded');
9114
- break;
9115
- case 'cancelled':
9116
- $this->_admin_notices->add(
9117
- $this->get_text('license-cancelled') . ' ' .
9118
- sprintf(
9119
- '<a href="%s">%s</a>', $this->contact_url('bug'), $this->get_text('contact-us-here')
9120
- ), $this->get_text('hmm') . '...', 'error'
9121
- );
9122
- $this->_admin_notices->remove_sticky('plan_upgraded');
9123
- break;
9124
- case 'expired':
9125
- $this->_admin_notices->add_sticky(
9126
- sprintf($this->get_text('license-expired-non-blocking-message'), $this->_site->plan->title), 'license_expired', $this->get_text('hmm') . '...'
9127
- );
9128
- $this->_admin_notices->remove_sticky('plan_upgraded');
9129
- break;
9130
- case 'trial_started':
9131
- $this->_admin_notices->add_sticky(
9132
- sprintf(
9133
- $this->get_text('trial-started-message'), '<i>' . $this->get_plugin_name() . '</i>'
9134
- ) . $this->get_complete_upgrade_instructions($this->_storage->trial_plan->title), 'trial_started', $this->get_text('yee-haw') . '!'
9135
- );
9136
-
9137
- $this->_admin_notices->remove_sticky(array(
9138
- 'trial_promotion',
9139
- ));
9140
- break;
9141
- case 'trial_expired':
9142
- $this->_admin_notices->add_sticky(
9143
- $this->get_text('trial-expired-message'), 'trial_expired', $this->get_text('hmm') . '...'
9144
- );
9145
- $this->_admin_notices->remove_sticky(array(
9146
- 'trial_started',
9147
- 'trial_promotion',
9148
- 'plan_upgraded',
9149
- ));
9150
- break;
9151
- }
9152
- }
9153
-
9154
- if ('none' !== $plan_change) {
9155
- $this->do_action('after_license_change', $plan_change, $this->_site->plan);
9156
- }
9157
- }
9158
- /**
9159
- * @author Vova Feldman (@svovaf)
9160
- * @since 1.0.5
9161
- *
9162
- * @param bool $background
9163
- */
9164
- protected function _activate_license($background = false) {
9165
- $this->_logger->entrance();
9166
-
9167
- $license_id = fs_request_get('license_id');
9168
-
9169
- if (FS_Plugin_License::is_valid_id($license_id) && $license_id == $this->_site->license_id) {
9170
- // License is already activated.
9171
- return;
9172
- }
9173
-
9174
- $premium_license = FS_Plugin_License::is_valid_id($license_id) ?
9175
- $this->_get_license_by_id($license_id) :
9176
- $this->_get_available_premium_license();
9177
-
9178
- if (!is_object($premium_license)) {
9179
- return;
9180
- }
9181
-
9182
- /**
9183
- * If the premium license is already associated with the install, just
9184
- * update the license reference (activation is not required).
9185
- *
9186
- * @since 1.1.9
9187
- */
9188
- if ($premium_license->id == $this->_site->license_id) {
9189
- // License is already activated.
9190
- $this->_update_site_license($premium_license);
9191
- $this->_enrich_site_plan(false);
9192
- $this->_store_account();
9193
-
9194
- return;
9195
- }
9196
-
9197
- if ($this->_site->user_id != $premium_license->user_id) {
9198
- $api_request_params = array('license_key' => $premium_license->secret_key);
9199
- } else {
9200
- $api_request_params = array();
9201
- }
9202
-
9203
- $api = $this->get_api_site_scope();
9204
- $license = $api->call("/licenses/{$premium_license->id}.json", 'put', $api_request_params);
9205
-
9206
- if (!$this->is_api_result_entity($license)) {
9207
- if (!$background) {
9208
- $this->_admin_notices->add(sprintf(
9209
- '%s %s', $this->get_text('license-activation-failed-message'), ( is_object($license) && isset($license->error) ?
9210
- $license->error->message :
9211
- sprintf('%s<br><code>%s</code>', $this->get_text('server-error-message'), var_export($license, true)
9212
- )
9213
- )
9214
- ), $this->get_text('hmm') . '...', 'error'
9215
- );
9216
- }
9217
-
9218
- return;
9219
- }
9220
-
9221
- $premium_license = new FS_Plugin_License($license);
9222
-
9223
- // Updated site plan.
9224
- $site = $this->get_api_site_scope()->get('/', true);
9225
- if ($this->is_api_result_entity($site)) {
9226
- $this->_site = new FS_Site($site);
9227
- }
9228
- $this->_update_site_license($premium_license);
9229
- $this->_enrich_site_plan(false);
9230
-
9231
- $this->_store_account();
9232
-
9233
- if (!$background) {
9234
- $this->_admin_notices->add_sticky(
9235
- $this->get_text('license-activated-message') .
9236
- $this->get_complete_upgrade_instructions(), 'license_activated', $this->get_text('yee-haw') . '!'
9237
- );
9238
- }
9239
-
9240
- $this->_admin_notices->remove_sticky(array(
9241
- 'trial_promotion',
9242
- 'license_expired',
9243
- ));
9244
- }
9245
- /**
9246
- * @author Vova Feldman (@svovaf)
9247
- * @since 1.0.5
9248
- *
9249
- * @param bool $show_notice
9250
- */
9251
- protected function _deactivate_license($show_notice = true) {
9252
- $this->_logger->entrance();
9253
-
9254
- if (!is_object($this->_license)) {
9255
- $this->_admin_notices->add(
9256
- sprintf($this->get_text('no-active-license-message'), $this->_site->plan->title), $this->get_text('hmm') . '...'
9257
- );
9258
-
9259
- return;
9260
- }
9261
-
9262
- $api = $this->get_api_site_scope();
9263
- $license = $api->call("/licenses/{$this->_site->license_id}.json", 'delete');
9264
-
9265
- if (isset($license->error)) {
9266
- $this->_admin_notices->add(
9267
- $this->get_text('license-deactivation-failed-message') . '<br> ' .
9268
- $this->get_text('server-error-message') . ' ' . var_export($license->error, true), $this->get_text('hmm') . '...', 'error'
9269
- );
9270
-
9271
- return;
9272
- }
9273
-
9274
- // Update license cache.
9275
- for ($i = 0, $len = count($this->_licenses); $i < $len; $i ++) {
9276
- if ($license->id == $this->_licenses[$i]->id) {
9277
- $this->_licenses[$i] = new FS_Plugin_License($license);
9278
- }
9279
- }
9280
-
9281
- // Updated site plan to default.
9282
- $this->_sync_plans();
9283
- $this->_site->plan->id = $this->_plans[0]->id;
9284
- // Unlink license from site.
9285
- $this->_update_site_license(null);
9286
- $this->_enrich_site_plan(false);
9287
-
9288
- $this->_store_account();
9289
-
9290
- if ($show_notice) {
9291
- $this->_admin_notices->add(
9292
- sprintf($this->get_text('license-deactivation-message'), $this->_site->plan->title), $this->get_text('ok')
9293
- );
9294
- }
9295
-
9296
- $this->_admin_notices->remove_sticky(array(
9297
- 'plan_upgraded',
9298
- 'license_activated',
9299
- ));
9300
- }
9301
- /**
9302
- * Site plan downgrade.
9303
- *
9304
- * @author Vova Feldman (@svovaf)
9305
- * @since 1.0.4
9306
- *
9307
- * @uses FS_Api
9308
- */
9309
- private function _downgrade_site() {
9310
- $this->_logger->entrance();
9311
-
9312
- $api = $this->get_api_site_scope();
9313
- $site = $api->call('downgrade.json', 'put');
9314
-
9315
- $plan_downgraded = false;
9316
- $plan = false;
9317
- if ($this->is_api_result_entity($site)) {
9318
- $prev_plan_id = $this->_site->plan->id;
9319
-
9320
- // Update new site plan id.
9321
- $this->_site->plan->id = $site->plan_id;
9322
-
9323
- $plan = $this->_enrich_site_plan();
9324
- $subscription = $this->_sync_site_subscription($this->_license);
9325
-
9326
- // Plan downgraded if plan was changed or subscription was cancelled.
9327
- $plan_downgraded = ( $plan instanceof FS_Plugin_Plan && $prev_plan_id != $plan->id ) ||
9328
- ( is_object($subscription) && !isset($subscription->error) && !$subscription->is_active() );
9329
- } else {
9330
- // handle different error cases.
9331
- }
9332
-
9333
- if ($plan_downgraded) {
9334
- // Remove previous sticky message about upgrade (if exist).
9335
- $this->_admin_notices->remove_sticky('plan_upgraded');
9336
-
9337
- $this->_admin_notices->add(
9338
- sprintf($this->get_text('plan-x-downgraded-message'), $plan->title, human_time_diff(time(), strtotime($this->_license->expiration))
9339
- )
9340
- );
9341
-
9342
- // Store site updates.
9343
- $this->_store_site();
9344
- } else {
9345
- $this->_admin_notices->add(
9346
- $this->get_text('plan-downgraded-failure-message'), $this->get_text('oops') . '...', 'error'
9347
- );
9348
- }
9349
- }
9350
- /**
9351
- * @author Vova Feldman (@svovaf)
9352
- * @since 1.1.8.1
9353
- *
9354
- * @param bool|string $plan_name
9355
- *
9356
- * @return bool If trial was successfully started.
9357
- */
9358
- function start_trial($plan_name = false) {
9359
- $this->_logger->entrance();
9360
-
9361
- if ($this->is_trial()) {
9362
- // Already in trial mode.
9363
- $this->_admin_notices->add(
9364
- $this->get_text('in-trial-mode'), $this->get_text('oops') . '...', 'error'
9365
- );
9366
-
9367
- return false;
9368
- }
9369
-
9370
- if ($this->_site->is_trial_utilized()) {
9371
- // Trial was already utilized.
9372
- $this->_admin_notices->add(
9373
- $this->get_text('trial-utilized'), $this->get_text('oops') . '...', 'error'
9374
- );
9375
-
9376
- return false;
9377
- }
9378
-
9379
- if (false !== $plan_name) {
9380
- $plan = $this->get_plan_by_name($plan_name);
9381
-
9382
- if (false === $plan) {
9383
- // Plan doesn't exist.
9384
- $this->_admin_notices->add(
9385
- sprintf($this->get_text('trial-plan-x-not-exist'), $plan_name), $this->get_text('oops') . '...', 'error'
9386
- );
9387
-
9388
- return false;
9389
- }
9390
-
9391
- if (!$plan->has_trial()) {
9392
- // Plan doesn't exist.
9393
- $this->_admin_notices->add(
9394
- sprintf($this->get_text('plan-x-no-trial'), $plan_name), $this->get_text('oops') . '...', 'error'
9395
- );
9396
-
9397
- return false;
9398
- }
9399
- } else {
9400
- if (!$this->has_trial_plan()) {
9401
- // None of the plans have a trial.
9402
- $this->_admin_notices->add(
9403
- $this->get_text('no-trials'), $this->get_text('oops') . '...', 'error'
9404
- );
9405
-
9406
- return false;
9407
- }
9408
-
9409
- $plans_with_trial = FS_Plan_Manager::instance()->get_trial_plans($this->_plans);
9410
-
9411
- $plan = $plans_with_trial[0];
9412
- }
9413
-
9414
- $api = $this->get_api_site_scope();
9415
- $plan = $api->call("plans/{$plan->id}/trials.json", 'post');
9416
-
9417
- if (!$this->is_api_result_entity($plan)) {
9418
- // Some API error while trying to start the trial.
9419
- $this->_admin_notices->add(
9420
- $this->get_text('unexpected-api-error') . ' ' . var_export($plan, true), $this->get_text('oops') . '...', 'error'
9421
- );
9422
-
9423
- return false;
9424
- }
9425
-
9426
- // Sync license.
9427
- $this->_sync_license();
9428
-
9429
- return $this->is_trial();
9430
- }
9431
- /**
9432
- * Cancel site trial.
9433
- *
9434
- * @author Vova Feldman (@svovaf)
9435
- * @since 1.0.9
9436
- *
9437
- * @uses FS_Api
9438
- */
9439
- private function _cancel_trial() {
9440
- $this->_logger->entrance();
9441
-
9442
- if (!$this->is_trial()) {
9443
- $this->_admin_notices->add(
9444
- $this->get_text('trial-cancel-no-trial-message'), $this->get_text('oops') . '...', 'error'
9445
- );
9446
-
9447
- return;
9448
- }
9449
-
9450
- $api = $this->get_api_site_scope();
9451
- $site = $api->call('trials.json', 'delete');
9452
-
9453
- $trial_cancelled = false;
9454
-
9455
- if ($this->is_api_result_entity($site)) {
9456
- $prev_trial_ends = $this->_site->trial_ends;
9457
-
9458
- if ($this->is_paid_trial()) {
9459
- $this->_license->expiration = $site->trial_ends;
9460
- $this->_license->is_cancelled = true;
9461
- $this->_update_site_license($this->_license);
9462
- $this->_store_licenses();
9463
-
9464
- // Clear subscription reference.
9465
- $this->_sync_site_subscription(null);
9466
- }
9467
-
9468
- // Update site info.
9469
- $this->_site = new FS_Site($site);
9470
- $this->_enrich_site_plan();
9471
-
9472
- $trial_cancelled = ( $prev_trial_ends != $site->trial_ends );
9473
- } else {
9474
- // handle different error cases.
9475
- }
9476
-
9477
- if ($trial_cancelled) {
9478
- // Remove previous sticky messages about upgrade or trial (if exist).
9479
- $this->_admin_notices->remove_sticky(array(
9480
- 'trial_started',
9481
- 'trial_promotion',
9482
- 'plan_upgraded',
9483
- ));
9484
-
9485
- // Store site updates.
9486
- $this->_store_site();
9487
-
9488
- if (!$this->is_addon() ||
9489
- !$this->deactivate_premium_only_addon_without_license(true)
9490
- ) {
9491
- $this->_admin_notices->add(
9492
- sprintf($this->get_text('trial-cancel-message'), $this->_storage->trial_plan->title)
9493
- );
9494
- }
9495
-
9496
- // Clear trial plan information.
9497
- unset($this->_storage->trial_plan);
9498
- } else {
9499
- $this->_admin_notices->add(
9500
- $this->get_text('trial-cancel-failure-message'), $this->get_text('oops') . '...', 'error'
9501
- );
9502
- }
9503
- }
9504
- /**
9505
- * @author Vova Feldman (@svovaf)
9506
- * @since 1.0.6
9507
- *
9508
- * @param bool|number $plugin_id
9509
- *
9510
- * @return bool
9511
- */
9512
- private function _is_addon_id($plugin_id) {
9513
- return is_numeric($plugin_id) && ( $this->get_id() != $plugin_id );
9514
- }
9515
- /**
9516
- * Check if user eligible to download premium version updates.
9517
- *
9518
- * @author Vova Feldman (@svovaf)
9519
- * @since 1.0.6
9520
- *
9521
- * @return bool
9522
- */
9523
- private function _can_download_premium() {
9524
- return $this->has_active_valid_license() ||
9525
- ( $this->is_trial() && !$this->get_trial_plan()->is_free() );
9526
- }
9527
- /**
9528
- *
9529
- * @author Vova Feldman (@svovaf)
9530
- * @since 1.0.6
9531
- *
9532
- * @param bool|number $addon_id
9533
- * @param string $type "json" or "zip"
9534
- *
9535
- * @return string
9536
- */
9537
- private function _get_latest_version_endpoint($addon_id = false, $type = 'json') {
9538
-
9539
- $is_addon = $this->_is_addon_id($addon_id);
9540
-
9541
- $is_premium = null;
9542
- if (!$is_addon) {
9543
- $is_premium = $this->_can_download_premium();
9544
- } else if ($this->is_addon_activated($addon_id)) {
9545
- $is_premium = self::get_instance_by_id($addon_id)->_can_download_premium();
9546
- }
9547
-
9548
- // If add-on, then append add-on ID.
9549
- $endpoint = ( $is_addon ? "/addons/$addon_id" : '' ) .
9550
- '/updates/latest.' . $type;
9551
-
9552
- // If add-on and not yet activated, try to fetch based on server licensing.
9553
- if (is_bool($is_premium)) {
9554
- $endpoint = add_query_arg('is_premium', json_encode($is_premium), $endpoint);
9555
- }
9556
-
9557
- if ($this->has_secret_key()) {
9558
- $endpoint = add_query_arg('type', 'all', $endpoint);
9559
- }
9560
-
9561
- return $endpoint;
9562
- }
9563
- /**
9564
- * @author Vova Feldman (@svovaf)
9565
- * @since 1.0.4
9566
- *
9567
- * @param bool|number $addon_id
9568
- * @param bool $flush Since 1.1.7.3
9569
- *
9570
- * @return object|false Plugin latest tag info.
9571
- */
9572
- function _fetch_latest_version($addon_id = false, $flush = true) {
9573
- $this->_logger->entrance();
9574
-
9575
- /**
9576
- * @since 1.1.7.3 Check for plugin updates from Freemius only if opted-in.
9577
- * @since 1.1.7.4 Also check updates for add-ons.
9578
- */
9579
- if (!$this->is_registered() &&
9580
- !$this->_is_addon_id($addon_id)
9581
- ) {
9582
- return false;
9583
- }
9584
-
9585
- $tag = $this->get_api_site_or_plugin_scope()->get(
9586
- $this->_get_latest_version_endpoint($addon_id, 'json'), $flush
9587
- );
9588
-
9589
- $latest_version = ( is_object($tag) && isset($tag->version) ) ? $tag->version : 'couldn\'t get';
9590
-
9591
- $this->_logger->departure('Latest version ' . $latest_version);
9592
-
9593
- return ( is_object($tag) && isset($tag->version) ) ? $tag : false;
9594
- }
9595
- #----------------------------------------------------------------------------------
9596
- #region Download Plugin
9597
- #----------------------------------------------------------------------------------
9598
- /**
9599
- * Download latest plugin version, based on plan.
9600
- *
9601
- * Not like _download_latest(), this will redirect the page
9602
- * to secure download url to prevent dual download (from FS to WP server,
9603
- * and then from WP server to the client / browser).
9604
- *
9605
- * @author Vova Feldman (@svovaf)
9606
- * @since 1.0.9
9607
- *
9608
- * @param bool|number $plugin_id
9609
- *
9610
- * @uses FS_Api
9611
- * @uses wp_redirect()
9612
- */
9613
- private function download_latest_directly($plugin_id = false) {
9614
- $this->_logger->entrance();
9615
-
9616
- wp_redirect($this->get_latest_download_api_url($plugin_id));
9617
- }
9618
- /**
9619
- * Get latest plugin FS API download URL.
9620
- *
9621
- * @author Vova Feldman (@svovaf)
9622
- * @since 1.0.9
9623
- *
9624
- * @param bool|number $plugin_id
9625
- *
9626
- * @return string
9627
- */
9628
- private function get_latest_download_api_url($plugin_id = false) {
9629
- $this->_logger->entrance();
9630
-
9631
- return $this->get_api_site_scope()->get_signed_url(
9632
- $this->_get_latest_version_endpoint($plugin_id, 'zip')
9633
- );
9634
- }
9635
- /**
9636
- * Get payment invoice URL.
9637
- *
9638
- * @author Vova Feldman (@svovaf)
9639
- * @since 1.2.0
9640
- *
9641
- * @param bool|number $payment_id
9642
- *
9643
- * @return string
9644
- */
9645
- function _get_invoice_api_url($payment_id = false) {
9646
- $this->_logger->entrance();
9647
-
9648
- return $this->get_api_user_scope()->get_signed_url(
9649
- "/payments/{$payment_id}/invoice.pdf"
9650
- );
9651
- }
9652
- /**
9653
- * Get latest plugin download link.
9654
- *
9655
- * @author Vova Feldman (@svovaf)
9656
- * @since 1.0.9
9657
- *
9658
- * @param string $label
9659
- * @param bool|number $plugin_id
9660
- *
9661
- * @return string
9662
- */
9663
- private function get_latest_download_link($label, $plugin_id = false) {
9664
- return sprintf(
9665
- '<a target="_blank" href="%s">%s</a>', $this->_get_latest_download_local_url($plugin_id), $label
9666
- );
9667
- }
9668
- /**
9669
- * Get latest plugin download local URL.
9670
- *
9671
- * @author Vova Feldman (@svovaf)
9672
- * @since 1.0.9
9673
- *
9674
- * @param bool|number $plugin_id
9675
- *
9676
- * @return string
9677
- */
9678
- function _get_latest_download_local_url($plugin_id = false) {
9679
- // Add timestamp to protect from caching.
9680
- $params = array('ts' => WP_FS__SCRIPT_START_TIME);
9681
-
9682
- if (!empty($plugin_id)) {
9683
- $params['plugin_id'] = $plugin_id;
9684
- }
9685
-
9686
- return $this->get_account_url('download_latest', $params);
9687
- }
9688
- #endregion Download Plugin ------------------------------------------------------------------
9689
- /**
9690
- * @author Vova Feldman (@svovaf)
9691
- * @since 1.0.4
9692
- *
9693
- * @uses FS_Api
9694
- *
9695
- * @param bool $background Hints the method if it's a background updates check. If false, it means that
9696
- * was initiated by the admin.
9697
- * @param bool|number $plugin_id
9698
- * @param bool $flush Since 1.1.7.3
9699
- */
9700
- private function check_updates($background = false, $plugin_id = false, $flush = true) {
9701
- $this->_logger->entrance();
9702
-
9703
- // Check if there's a newer version for download.
9704
- $new_version = $this->_fetch_newer_version($plugin_id, $flush);
9705
-
9706
- $update = null;
9707
- if (is_object($new_version)) {
9708
- $update = new FS_Plugin_Tag($new_version);
9709
-
9710
- if (!$background) {
9711
- $this->_admin_notices->add(
9712
- sprintf(
9713
- $this->get_text('version-x-released') . ' ' . $this->get_text('please-download-x'), $update->version, sprintf(
9714
- '<a href="%s" target="_blank">%s</a>', $this->get_account_url('download_latest'), sprintf($this->get_text('latest-x-version'), $this->_site->plan->title)
9715
- )
9716
- ), $this->get_text('new') . '!'
9717
- );
9718
- }
9719
- } else if (false === $new_version && !$background) {
9720
- $this->_admin_notices->add(
9721
- $this->get_text('you-have-latest'), $this->get_text('you-are-good')
9722
- );
9723
- }
9724
-
9725
- $this->_store_update($update, true, $plugin_id);
9726
- }
9727
- /**
9728
- * @author Vova Feldman (@svovaf)
9729
- * @since 1.0.4
9730
- *
9731
- * @param bool $flush Since 1.1.7.3 add 24 hour cache by default.
9732
- *
9733
- * @return FS_Plugin[]
9734
- *
9735
- * @uses FS_Api
9736
- */
9737
- private function sync_addons($flush = false) {
9738
- $this->_logger->entrance();
9739
-
9740
- $api = $this->get_api_site_or_plugin_scope();
9741
-
9742
- /**
9743
- * @since 1.2.1
9744
- *
9745
- * If there's a cached version of the add-ons and not asking
9746
- * for a flush, just use the currently stored add-ons.
9747
- */
9748
- if (!$flush && $api->is_cached('/addons.json?enriched=true')) {
9749
- $addons = self::get_all_addons();
9750
-
9751
- return $addons[$this->_plugin->id];
9752
- }
9753
-
9754
- $result = $api->get('/addons.json?enriched=true', $flush);
9755
-
9756
- $addons = array();
9757
- if ($this->is_api_result_object($result, 'plugins') &&
9758
- is_array($result->plugins)
9759
- ) {
9760
- for ($i = 0, $len = count($result->plugins); $i < $len; $i ++) {
9761
- $addons[$i] = new FS_Plugin($result->plugins[$i]);
9762
- }
9763
-
9764
- $this->_store_addons($addons, true);
9765
- }
9766
-
9767
- return $addons;
9768
- }
9769
- /**
9770
- * Handle user email update.
9771
- *
9772
- * @author Vova Feldman (@svovaf)
9773
- * @since 1.0.3
9774
- * @uses FS_Api
9775
- *
9776
- * @param string $new_email
9777
- *
9778
- * @return object
9779
- */
9780
- private function update_email($new_email) {
9781
- $this->_logger->entrance();
9782
-
9783
-
9784
- $api = $this->get_api_user_scope();
9785
- $user = $api->call("?plugin_id={$this->_plugin->id}&fields=id,email,is_verified", 'put', array(
9786
- 'email' => $new_email,
9787
- 'after_email_confirm_url' => $this->_get_admin_page_url(
9788
- 'account', array('fs_action' => 'sync_user')
9789
- ),
9790
- ));
9791
-
9792
- if (!isset($user->error)) {
9793
- $this->_user->email = $user->email;
9794
- $this->_user->is_verified = $user->is_verified;
9795
- $this->_store_user();
9796
- } else {
9797
- // handle different error cases.
9798
- }
9799
-
9800
- return $user;
9801
- }
9802
- #----------------------------------------------------------------------------------
9803
- #region API Error Handling
9804
- #----------------------------------------------------------------------------------
9805
- /**
9806
- * @author Vova Feldman (@svovaf)
9807
- * @since 1.1.1
9808
- *
9809
- * @param mixed $result
9810
- *
9811
- * @return bool Is API result contains an error.
9812
- */
9813
- private function is_api_error($result) {
9814
- return FS_Api::is_api_error($result);
9815
- }
9816
- /**
9817
- * Checks if given API result is a non-empty and not an error object.
9818
- *
9819
- * @author Vova Feldman (@svovaf)
9820
- * @since 1.2.1.5
9821
- *
9822
- * @param mixed $result
9823
- * @param string|null $required_property Optional property we want to verify that is set.
9824
- *
9825
- * @return bool
9826
- */
9827
- function is_api_result_object($result, $required_property = null) {
9828
- return FS_Api::is_api_result_object($result, $required_property);
9829
- }
9830
- /**
9831
- * Checks if given API result is a non-empty entity object with non-empty ID.
9832
- *
9833
- * @author Vova Feldman (@svovaf)
9834
- * @since 1.2.1.5
9835
- *
9836
- * @param mixed $result
9837
- *
9838
- * @return bool
9839
- */
9840
- private function is_api_result_entity($result) {
9841
- return FS_Api::is_api_result_entity($result);
9842
- }
9843
- #endregion
9844
- /**
9845
- * Make sure a given argument is an array of a specific type.
9846
- *
9847
- * @author Vova Feldman (@svovaf)
9848
- * @since 1.2.1.5
9849
- *
9850
- * @param mixed $array
9851
- * @param string $class
9852
- *
9853
- * @return bool
9854
- */
9855
- private function is_array_instanceof($array, $class) {
9856
- return ( is_array($array) && ( empty($array) || $array[0] instanceof $class ) );
9857
- }
9858
- /**
9859
- * Start install ownership change.
9860
- *
9861
- * @author Vova Feldman (@svovaf)
9862
- * @since 1.1.1
9863
- * @uses FS_Api
9864
- *
9865
- * @param string $candidate_email
9866
- *
9867
- * @return bool Is ownership change successfully initiated.
9868
- */
9869
- private function init_change_owner($candidate_email) {
9870
- $this->_logger->entrance();
9871
-
9872
- $api = $this->get_api_site_scope();
9873
- $result = $api->call("/users/{$this->_user->id}.json", 'put', array(
9874
- 'email' => $candidate_email,
9875
- 'after_confirm_url' => $this->_get_admin_page_url(
9876
- 'account', array('fs_action' => 'change_owner')
9877
- ),
9878
- ));
9879
-
9880
- return !$this->is_api_error($result);
9881
- }
9882
- /**
9883
- * Handle install ownership change.
9884
- *
9885
- * @author Vova Feldman (@svovaf)
9886
- * @since 1.1.1
9887
- * @uses FS_Api
9888
- *
9889
- * @return bool Was ownership change successfully complete.
9890
- */
9891
- private function complete_change_owner() {
9892
- $this->_logger->entrance();
9893
-
9894
- $site_result = $this->get_api_site_scope(true)->get();
9895
- $site = new FS_Site($site_result);
9896
- $this->_site = $site;
9897
-
9898
- $user = new FS_User();
9899
- $user->id = fs_request_get('user_id');
9900
-
9901
- // Validate install's user and given user.
9902
- if ($user->id != $this->_site->user_id) {
9903
- return false;
9904
- }
9905
-
9906
- $user->public_key = fs_request_get('user_public_key');
9907
- $user->secret_key = fs_request_get('user_secret_key');
9908
-
9909
- // Fetch new user information.
9910
- $this->_user = $user;
9911
- $user_result = $this->get_api_user_scope(true)->get();
9912
- $user = new FS_User($user_result);
9913
- $this->_user = $user;
9914
-
9915
- $this->_set_account($user, $site);
9916
-
9917
- return true;
9918
- }
9919
- /**
9920
- * Handle user name update.
9921
- *
9922
- * @author Vova Feldman (@svovaf)
9923
- * @since 1.0.9
9924
- * @uses FS_Api
9925
- *
9926
- * @return object
9927
- */
9928
- private function update_user_name() {
9929
- $this->_logger->entrance();
9930
- $name = fs_request_get('fs_user_name_' . $this->_slug, '');
9931
-
9932
- $api = $this->get_api_user_scope();
9933
- $user = $api->call("?plugin_id={$this->_plugin->id}&fields=id,first,last", 'put', array(
9934
- 'name' => $name,
9935
- ));
9936
-
9937
- if (!isset($user->error)) {
9938
- $this->_user->first = $user->first;
9939
- $this->_user->last = $user->last;
9940
- $this->_store_user();
9941
- } else {
9942
- // handle different error cases.
9943
- }
9944
-
9945
- return $user;
9946
- }
9947
- /**
9948
- * Verify user email.
9949
- *
9950
- * @author Vova Feldman (@svovaf)
9951
- * @since 1.0.3
9952
- * @uses FS_Api
9953
- */
9954
- private function verify_email() {
9955
- $this->_handle_account_user_sync();
9956
-
9957
- if ($this->_user->is_verified()) {
9958
- return;
9959
- }
9960
-
9961
- $api = $this->get_api_site_scope();
9962
- $result = $api->call("/users/{$this->_user->id}/verify.json", 'put', array(
9963
- 'after_email_confirm_url' => $this->_get_admin_page_url(
9964
- 'account', array('fs_action' => 'sync_user')
9965
- )
9966
- ));
9967
-
9968
- if (!isset($result->error)) {
9969
- $this->_admin_notices->add(sprintf(
9970
- $this->get_text('verification-email-sent-message'), sprintf('<a href="mailto:%1s">%2s</a>', esc_url($this->_user->email), $this->_user->email)
9971
- ));
9972
- } else {
9973
- // handle different error cases.
9974
- }
9975
- }
9976
- /**
9977
- * @author Vova Feldman (@svovaf)
9978
- * @since 1.1.2
9979
- *
9980
- * @param array $params
9981
- *
9982
- * @return string
9983
- */
9984
- private function get_activation_url($params = array()) {
9985
- if ($this->is_addon()) {
9986
- /**
9987
- * @author Vova Feldman (@svovaf)
9988
- * @since 1.2.1.7 Add-on's activation is the parent's module activation.
9989
- */
9990
- return $this->get_parent_instance()->get_activation_url($params);
9991
- }
9992
-
9993
- return $this->apply_filters('connect_url', $this->_get_admin_page_url('', $params));
9994
- }
9995
- /**
9996
- * @author Vova Feldman (@svovaf)
9997
- * @since 1.2.1.5
9998
- *
9999
- * @param array $params
10000
- *
10001
- * @return string
10002
- */
10003
- function get_reconnect_url($params = array()) {
10004
- $params['fs_action'] = 'reset_anonymous_mode';
10005
- $params['fs_slug'] = $this->_slug;
10006
-
10007
- return $this->apply_filters('connect_url', $this->_get_admin_page_url('', $params));
10008
- }
10009
- /**
10010
- * Get the URL of the page that should be loaded after the user connect or skip in the opt-in screen.
10011
- *
10012
- * @author Vova Feldman (@svovaf)
10013
- * @since 1.1.3
10014
- *
10015
- * @param string $filter Filter name.
10016
- *
10017
- * @return string
10018
- */
10019
- function get_after_activation_url($filter) {
10020
- $first_time_path = $this->_menu->get_first_time_path();
10021
-
10022
- return $this->apply_filters(
10023
- $filter, empty($first_time_path) ?
10024
- $this->_get_admin_page_url() :
10025
- $first_time_path
10026
- );
10027
- }
10028
- /**
10029
- * Handle account page updates / edits / actions.
10030
- *
10031
- * @author Vova Feldman (@svovaf)
10032
- * @since 1.0.2
10033
- *
10034
- */
10035
- private function _handle_account_edits() {
10036
- if (!$this->is_user_admin()) {
10037
- return;
10038
- }
10039
-
10040
- $plugin_id = fs_request_get('plugin_id', $this->get_id());
10041
- $action = fs_get_action();
10042
-
10043
- switch ($action) {
10044
- case 'delete_account':
10045
- check_admin_referer($action);
10046
-
10047
- if ($plugin_id == $this->get_id()) {
10048
- $this->delete_account_event();
10049
-
10050
- // Clear user and site.
10051
- $this->_site = null;
10052
- $this->_user = null;
10053
-
10054
- fs_redirect($this->get_activation_url());
10055
- } else {
10056
- if ($this->is_addon_activated($plugin_id)) {
10057
- $fs_addon = self::get_instance_by_id($plugin_id);
10058
- $fs_addon->delete_account_event();
10059
-
10060
- fs_redirect($this->_get_admin_page_url('account'));
10061
- }
10062
- }
10063
-
10064
- return;
10065
-
10066
- case 'downgrade_account':
10067
- check_admin_referer($action);
10068
-
10069
- if ($plugin_id == $this->get_id()) {
10070
- $this->_downgrade_site();
10071
- } else if ($this->is_addon_activated($plugin_id)) {
10072
- $fs_addon = self::get_instance_by_id($plugin_id);
10073
- $fs_addon->_downgrade_site();
10074
- }
10075
-
10076
- return;
10077
-
10078
- case 'activate_license':
10079
- check_admin_referer($action);
10080
-
10081
- if ($plugin_id == $this->get_id()) {
10082
- $this->_activate_license();
10083
- } else {
10084
- if ($this->is_addon_activated($plugin_id)) {
10085
- $fs_addon = self::get_instance_by_id($plugin_id);
10086
- $fs_addon->_activate_license();
10087
- }
10088
- }
10089
-
10090
- return;
10091
-
10092
- case 'deactivate_license':
10093
- check_admin_referer($action);
10094
-
10095
- if ($plugin_id == $this->get_id()) {
10096
- $this->_deactivate_license();
10097
- } else {
10098
- if ($this->is_addon_activated($plugin_id)) {
10099
- $fs_addon = self::get_instance_by_id($plugin_id);
10100
- $fs_addon->_deactivate_license();
10101
- }
10102
- }
10103
-
10104
- return;
10105
-
10106
- case 'check_updates':
10107
- check_admin_referer($action);
10108
- $this->check_updates();
10109
-
10110
- return;
10111
-
10112
- case 'change_owner':
10113
- $state = fs_request_get('state', 'init');
10114
- switch ($state) {
10115
- case 'init':
10116
- $candidate_email = fs_request_get('candidate_email', '');
10117
-
10118
- if ($this->init_change_owner($candidate_email)) {
10119
- $this->_admin_notices->add(sprintf($this->get_text('change-owner-request-sent-x'), '<b>' . $this->_user->email . '</b>'));
10120
- }
10121
- break;
10122
- case 'owner_confirmed':
10123
- $candidate_email = fs_request_get('candidate_email', '');
10124
-
10125
- $this->_admin_notices->add(sprintf($this->get_text('change-owner-request_owner-confirmed'), '<b>' . $candidate_email . '</b>'));
10126
- break;
10127
- case 'candidate_confirmed':
10128
- if ($this->complete_change_owner()) {
10129
- $this->_admin_notices->add_sticky(
10130
- sprintf($this->get_text('change-owner-request_candidate-confirmed'), '<b>' . $this->_user->email . '</b>'), 'ownership_changed', $this->get_text('congrats') . '!'
10131
- );
10132
- } else {
10133
- // @todo Handle failed ownership change message.
10134
- }
10135
- break;
10136
- }
10137
-
10138
- return;
10139
-
10140
- case 'update_email':
10141
- check_admin_referer('update_email');
10142
-
10143
- $new_email = fs_request_get('fs_email_' . $this->_slug, '');
10144
- $result = $this->update_email($new_email);
10145
-
10146
- if (isset($result->error)) {
10147
- switch ($result->error->code) {
10148
- case 'user_exist':
10149
- $this->_admin_notices->add(
10150
- $this->get_text('user-exist-message') . ' ' .
10151
- sprintf($this->get_text('user-exist-message_ownership'), '<b>' . $new_email . '</b>') .
10152
- sprintf(
10153
- '<a style="margin-left: 10px;" href="%s"><button class="button button-primary">%s &nbsp;&#10140;</button></a>', $this->get_account_url('change_owner', array(
10154
- 'state' => 'init',
10155
- 'candidate_email' => $new_email
10156
- )), $this->get_text('change-ownership')
10157
- ), $this->get_text('oops') . '...', 'error'
10158
- );
10159
- break;
10160
- }
10161
- } else {
10162
- $this->_admin_notices->add($this->get_text('email-updated-message'));
10163
- }
10164
-
10165
- return;
10166
-
10167
- case 'update_user_name':
10168
- check_admin_referer('update_user_name');
10169
-
10170
- $result = $this->update_user_name();
10171
-
10172
- if (isset($result->error)) {
10173
- $this->_admin_notices->add(
10174
- $this->get_text('name-update-failed-message'), $this->get_text('oops') . '...', 'error'
10175
- );
10176
- } else {
10177
- $this->_admin_notices->add($this->get_text('name-updated-message'));
10178
- }
10179
-
10180
- return;
10181
-
10182
- #region Actions that might be called from external links (e.g. email)
10183
-
10184
- case 'cancel_trial':
10185
- if ($plugin_id == $this->get_id()) {
10186
- $this->_cancel_trial();
10187
- } else {
10188
- if ($this->is_addon_activated($plugin_id)) {
10189
- $fs_addon = self::get_instance_by_id($plugin_id);
10190
- $fs_addon->_cancel_trial();
10191
- }
10192
- }
10193
-
10194
- return;
10195
-
10196
- case 'verify_email':
10197
- $this->verify_email();
10198
-
10199
- return;
10200
-
10201
- case 'sync_user':
10202
- $this->_handle_account_user_sync();
10203
-
10204
- return;
10205
-
10206
- case $this->_slug . '_sync_license':
10207
- $this->_sync_license();
10208
-
10209
- return;
10210
-
10211
- case 'download_latest':
10212
- $this->download_latest_directly($plugin_id);
10213
-
10214
- return;
10215
-
10216
- #endregion
10217
- }
10218
-
10219
- if (WP_FS__IS_POST_REQUEST) {
10220
- $properties = array('site_secret_key', 'site_id', 'site_public_key');
10221
- foreach ($properties as $p) {
10222
- if ('update_' . $p === $action) {
10223
- check_admin_referer($action);
10224
-
10225
- $this->_logger->log($action);
10226
-
10227
- $site_property = substr($p, strlen('site_'));
10228
- $site_property_value = fs_request_get('fs_' . $p . '_' . $this->_slug, '');
10229
- $this->get_site()->{$site_property} = $site_property_value;
10230
-
10231
- // Store account after modification.
10232
- $this->_store_site();
10233
-
10234
- $this->do_action('account_property_edit', 'site', $site_property, $site_property_value);
10235
-
10236
- $this->_admin_notices->add(sprintf(
10237
- $this->get_text('x-updated'), '<b>' . str_replace('_', ' ', $p) . '</b>'));
10238
-
10239
- return;
10240
- }
10241
- }
10242
- }
10243
- }
10244
- /**
10245
- * Account page resources load.
10246
- *
10247
- * @author Vova Feldman (@svovaf)
10248
- * @since 1.0.6
10249
- */
10250
- function _account_page_load() {
10251
- $this->_logger->entrance();
10252
-
10253
- $this->_logger->info(var_export($_REQUEST, true));
10254
-
10255
- fs_enqueue_local_style('fs_account', '/admin/account.css');
10256
-
10257
- if ($this->has_addons()) {
10258
- wp_enqueue_script('plugin-install');
10259
- add_thickbox();
10260
- function fs_addons_body_class($classes) {
10261
- $classes .= ' plugins-php';
10262
-
10263
- return $classes;
10264
- }
10265
- add_filter('admin_body_class', 'fs_addons_body_class');
10266
- }
10267
-
10268
- if ($this->has_paid_plan() &&
10269
- !$this->has_any_license() &&
10270
- !$this->is_sync_executed() &&
10271
- $this->is_tracking_allowed()
10272
- ) {
10273
- /**
10274
- * If no licenses found and no sync job was executed during the last 24 hours,
10275
- * just execute the sync job right away (blocking execution).
10276
- *
10277
- * @since 1.1.7.3
10278
- */
10279
- $this->run_manual_sync();
10280
- }
10281
-
10282
- $this->_handle_account_edits();
10283
-
10284
- $this->do_action('account_page_load_before_departure');
10285
- }
10286
- /**
10287
- * Render account page.
10288
- *
10289
- * @author Vova Feldman (@svovaf)
10290
- * @since 1.0.0
10291
- */
10292
- function _account_page_render() {
10293
- $this->_logger->entrance();
10294
-
10295
- $template = 'account.php';
10296
- if ('billing' === fs_request_get('tab')) {
10297
- $template = 'billing.php';
10298
- }
10299
-
10300
- $vars = array('slug' => $this->_slug);
10301
-
10302
- /**
10303
- * Added filter to the template to allow developers wrapping the template
10304
- * in custom HTML (e.g. within a wizard/tabs).
10305
- *
10306
- * @author Vova Feldman (@svovaf)
10307
- * @since 1.2.1.6
10308
- */
10309
- echo $this->apply_filters("templates/{$template}", fs_get_template($template, $vars));
10310
- }
10311
- /**
10312
- * Render account connect page.
10313
- *
10314
- * @author Vova Feldman (@svovaf)
10315
- * @since 1.0.7
10316
- */
10317
- function _connect_page_render() {
10318
- $this->_logger->entrance();
10319
-
10320
- $vars = array('slug' => $this->_slug);
10321
-
10322
- /**
10323
- * Added filter to the template to allow developers wrapping the template
10324
- * in custom HTML (e.g. within a wizard/tabs).
10325
- *
10326
- * @author Vova Feldman (@svovaf)
10327
- * @since 1.2.1.6
10328
- */
10329
- echo $this->apply_filters('templates/connect.php', fs_get_template('connect.php', $vars));
10330
- }
10331
- /**
10332
- * Load required resources before add-ons page render.
10333
- *
10334
- * @author Vova Feldman (@svovaf)
10335
- * @since 1.0.6
10336
- */
10337
- function _addons_page_load() {
10338
- $this->_logger->entrance();
10339
-
10340
- fs_enqueue_local_style('fs_addons', '/admin/add-ons.css');
10341
-
10342
- wp_enqueue_script('plugin-install');
10343
- add_thickbox();
10344
- function fs_addons_body_class($classes) {
10345
- $classes .= ' plugins-php';
10346
-
10347
- return $classes;
10348
- }
10349
- add_filter('admin_body_class', 'fs_addons_body_class');
10350
-
10351
- if (!$this->is_registered() && $this->is_org_repo_compliant()) {
10352
- $this->_admin_notices->add(
10353
- sprintf($this->get_text('addons-info-external-message'), '<b>' . $this->get_plugin_name() . '</b>'), $this->get_text('heads-up'), 'update-nag'
10354
- );
10355
- }
10356
- }
10357
- /**
10358
- * Render add-ons page.
10359
- *
10360
- * @author Vova Feldman (@svovaf)
10361
- * @since 1.0.6
10362
- */
10363
- function _addons_page_render() {
10364
- $this->_logger->entrance();
10365
-
10366
- $vars = array('slug' => $this->_slug);
10367
-
10368
- /**
10369
- * Added filter to the template to allow developers wrapping the template
10370
- * in custom HTML (e.g. within a wizard/tabs).
10371
- *
10372
- * @author Vova Feldman (@svovaf)
10373
- * @since 1.2.1.6
10374
- */
10375
- echo $this->apply_filters('templates/add-ons.php', fs_get_template('add-ons.php', $vars));
10376
- }
10377
- /* Pricing & Upgrade
10378
- ------------------------------------------------------------------------------------------------------------------ */
10379
- /**
10380
- * Render pricing page.
10381
- *
10382
- * @author Vova Feldman (@svovaf)
10383
- * @since 1.0.0
10384
- */
10385
- function _pricing_page_render() {
10386
- $this->_logger->entrance();
10387
-
10388
- $vars = array('slug' => $this->_slug);
10389
-
10390
- if ('true' === fs_request_get('checkout', false)) {
10391
- fs_require_once_template('checkout.php', $vars);
10392
- } else {
10393
- fs_require_once_template('pricing.php', $vars);
10394
- }
10395
- }
10396
- #----------------------------------------------------------------------------------
10397
- #region Contact Us
10398
- #----------------------------------------------------------------------------------
10399
- /**
10400
- * Render contact-us page.
10401
- *
10402
- * @author Vova Feldman (@svovaf)
10403
- * @since 1.0.3
10404
- */
10405
- function _contact_page_render() {
10406
- $this->_logger->entrance();
10407
-
10408
- $vars = array('slug' => $this->_slug);
10409
- fs_require_once_template('contact.php', $vars);
10410
- }
10411
- #endregion ------------------------------------------------------------------------
10412
- /**
10413
- * Hide all admin notices to prevent distractions.
10414
- *
10415
- * @author Vova Feldman (@svovaf)
10416
- * @since 1.0.3
10417
- *
10418
- * @uses remove_all_actions()
10419
- */
10420
- private static function _hide_admin_notices() {
10421
- remove_all_actions('admin_notices');
10422
- remove_all_actions('network_admin_notices');
10423
- remove_all_actions('all_admin_notices');
10424
- remove_all_actions('user_admin_notices');
10425
- }
10426
- static function _clean_admin_content_section_hook() {
10427
- self::_hide_admin_notices();
10428
-
10429
- // Hide footer.
10430
- echo '<style>#wpfooter { display: none !important; }</style>';
10431
- }
10432
- /**
10433
- * Attach to admin_head hook to hide all admin notices.
10434
- *
10435
- * @author Vova Feldman (@svovaf)
10436
- * @since 1.0.3
10437
- */
10438
- static function _clean_admin_content_section() {
10439
- add_action('admin_head', 'Freemius::_clean_admin_content_section_hook');
10440
- }
10441
- /* CSS & JavaScript
10442
- ------------------------------------------------------------------------------------------------------------------ */
10443
- /* function _enqueue_script($handle, $src) {
10444
- $url = plugins_url( substr( WP_FS__DIR_JS, strlen( $this->_plugin_dir_path ) ) . '/assets/js/' . $src );
10445
-
10446
- $this->_logger->entrance( 'script = ' . $url );
10447
-
10448
- wp_enqueue_script( $handle, $url );
10449
- } */
10450
-
10451
- /* SDK
10452
- ------------------------------------------------------------------------------------------------------------------ */
10453
- private $_user_api;
10454
- /**
10455
- *
10456
- * @author Vova Feldman (@svovaf)
10457
- * @since 1.0.2
10458
- *
10459
- * @param bool $flush
10460
- *
10461
- * @return FS_Api
10462
- */
10463
- function get_api_user_scope($flush = false) {
10464
- if (!isset($this->_user_api) || $flush) {
10465
- $this->_user_api = FS_Api::instance(
10466
- $this->_slug, 'user', $this->_user->id, $this->_user->public_key, !$this->is_live(), $this->_user->secret_key
10467
- );
10468
- }
10469
-
10470
- return $this->_user_api;
10471
- }
10472
- private $_site_api;
10473
- /**
10474
- *
10475
- * @author Vova Feldman (@svovaf)
10476
- * @since 1.0.2
10477
- *
10478
- * @param bool $flush
10479
- *
10480
- * @return FS_Api
10481
- */
10482
- function get_api_site_scope($flush = false) {
10483
- if (!isset($this->_site_api) || $flush) {
10484
- $this->_site_api = FS_Api::instance(
10485
- $this->_slug, 'install', $this->_site->id, $this->_site->public_key, !$this->is_live(), $this->_site->secret_key
10486
- );
10487
- }
10488
-
10489
- return $this->_site_api;
10490
- }
10491
- private $_plugin_api;
10492
- /**
10493
- * Get plugin public API scope.
10494
- *
10495
- * @author Vova Feldman (@svovaf)
10496
- * @since 1.0.7
10497
- *
10498
- * @return FS_Api
10499
- */
10500
- function get_api_plugin_scope() {
10501
- if (!isset($this->_plugin_api)) {
10502
- $this->_plugin_api = FS_Api::instance(
10503
- $this->_slug, 'plugin', $this->_plugin->id, $this->_plugin->public_key, !$this->is_live()
10504
- );
10505
- }
10506
-
10507
- return $this->_plugin_api;
10508
- }
10509
- /**
10510
- * Get site API scope object (fallback to public plugin scope when not registered).
10511
- *
10512
- * @author Vova Feldman (@svovaf)
10513
- * @since 1.0.7
10514
- *
10515
- * @return FS_Api
10516
- */
10517
- function get_api_site_or_plugin_scope() {
10518
- return $this->is_registered() ?
10519
- $this->get_api_site_scope() :
10520
- $this->get_api_plugin_scope();
10521
- }
10522
- /**
10523
- * Show trial promotional notice (if any trial exist).
10524
- *
10525
- * @author Vova Feldman (@svovaf)
10526
- * @since 1.0.9
10527
- *
10528
- * @param $plans
10529
- */
10530
- function _check_for_trial_plans($plans) {
10531
- $this->_storage->has_trial_plan = FS_Plan_Manager::instance()->has_trial_plan($plans);
10532
- }
10533
- /**
10534
- * During trial promotion the "upgrade" submenu item turns to
10535
- * "start trial" to encourage the trial. Since we want to keep
10536
- * the same menu item handler and there's no robust way to
10537
- * add new arguments to the menu item link's querystring,
10538
- * use JavaScript to find the menu item and update the href of
10539
- * the link.
10540
- *
10541
- * @author Vova Feldman (@svovaf)
10542
- * @since 1.2.1.5
10543
- */
10544
- function _fix_start_trial_menu_item_url() {
10545
- $template_args = array('slug' => $this->_slug);
10546
- fs_require_template('add-trial-to-pricing.php', $template_args);
10547
- }
10548
- /**
10549
- * Show trial promotional notice (if any trial exist).
10550
- *
10551
- * @author Vova Feldman (@svovaf)
10552
- * @since 1.0.9
10553
- *
10554
- * @return bool If trial notice added.
10555
- */
10556
- function _add_trial_notice() {
10557
- if (!$this->is_user_admin()) {
10558
- return false;
10559
- }
10560
-
10561
- if (!$this->is_user_in_admin()) {
10562
- return false;
10563
- }
10564
-
10565
- // Check if trial message is already shown.
10566
- if ($this->_admin_notices->has_sticky('trial_promotion')) {
10567
- add_action('admin_footer', array(&$this, '_fix_start_trial_menu_item_url'));
10568
-
10569
- $this->_menu->add_counter_to_menu_item(1, 'fs-trial');
10570
-
10571
- return false;
10572
- }
10573
-
10574
- if ($this->is_premium() && !WP_FS__DEV_MODE) {
10575
- // Don't show trial if running the premium code, unless running in DEV mode.
10576
- return false;
10577
- }
10578
-
10579
- if (!$this->has_trial_plan()) {
10580
- // No plans with trial.
10581
- return false;
10582
- }
10583
-
10584
- if (!$this->apply_filters('show_trial', true)) {
10585
- // Developer explicitly asked not to show the trial promo.
10586
- return false;
10587
- }
10588
-
10589
- if ($this->is_registered()) {
10590
- // Check if trial already utilized.
10591
- if ($this->_site->is_trial_utilized()) {
10592
- return false;
10593
- }
10594
-
10595
- if ($this->is_paying_or_trial()) {
10596
- // Don't show trial if paying or already in trial.
10597
- return false;
10598
- }
10599
- }
10600
-
10601
- if ($this->is_activation_mode() || $this->is_pending_activation()) {
10602
- // If not yet opted-in/skipped, or pending activation, don't show trial.
10603
- return false;
10604
- }
10605
-
10606
- $last_time_trial_promotion_shown = $this->_storage->get('trial_promotion_shown', false);
10607
- $was_promotion_shown_before = ( false !== $last_time_trial_promotion_shown );
10608
-
10609
- // Show promotion if never shown before and 24 hours after initial activation with FS.
10610
- if (!$was_promotion_shown_before &&
10611
- $this->_storage->install_timestamp > ( time() - WP_FS__TIME_24_HOURS_IN_SEC )
10612
- ) {
10613
- return false;
10614
- }
10615
-
10616
- // OR if promotion was shown before, try showing it every 30 days.
10617
- if ($was_promotion_shown_before &&
10618
- 30 * WP_FS__TIME_24_HOURS_IN_SEC > time() - $last_time_trial_promotion_shown
10619
- ) {
10620
- return false;
10621
- }
10622
-
10623
- $trial_period = $this->_trial_days;
10624
- $require_payment = $this->_is_trial_require_payment;
10625
- $trial_url = $this->get_trial_url();
10626
- $plans_string = strtolower($this->get_text('awesome'));
10627
-
10628
- if ($this->is_registered()) {
10629
- // If opted-in, override trial with up to date data from API.
10630
- $trial_plans = FS_Plan_Manager::instance()->get_trial_plans($this->_plans);
10631
- $trial_plans_count = count($trial_plans);
10632
-
10633
- if (0 === $trial_plans_count) {
10634
- // If there's no plans with a trial just exit.
10635
- return false;
10636
- }
10637
-
10638
- /**
10639
- * @var FS_Plugin_Plan $paid_plan
10640
- */
10641
- $paid_plan = $trial_plans[0];
10642
- $require_payment = $paid_plan->is_require_subscription;
10643
- $trial_period = $paid_plan->trial_period;
10644
-
10645
- $total_paid_plans = count($this->_plans) - ( FS_Plan_Manager::instance()->has_free_plan($this->_plans) ? 1 : 0 );
10646
-
10647
- if ($total_paid_plans !== $trial_plans_count) {
10648
- // Not all paid plans have a trial - generate a string of those that have it.
10649
- for ($i = 0; $i < $trial_plans_count; $i ++) {
10650
- $plans_string .= sprintf(
10651
- '<a href="%s">%s</a>', $trial_url, $trial_plans[$i]->title
10652
- );
10653
-
10654
- if ($i < $trial_plans_count - 2) {
10655
- $plans_string .= ', ';
10656
- } else if ($i == $trial_plans_count - 2) {
10657
- $plans_string .= ' and ';
10658
- }
10659
- }
10660
- }
10661
- }
10662
-
10663
- $message = sprintf(
10664
- $this->get_text('hey') . '! ' . $this->get_text('trial-x-promotion-message'), sprintf('<b>%s</b>', $this->get_plugin_name()), $plans_string, $trial_period
10665
- );
10666
-
10667
- // "No Credit-Card Required" or "No Commitment for N Days".
10668
- $cc_string = $require_payment ?
10669
- sprintf($this->get_text('no-commitment-for-x-days'), $trial_period) :
10670
- $this->get_text('no-cc-required') . '!';
10671
-
10672
-
10673
- // Start trial button.
10674
- $button = ' ' . sprintf(
10675
- '<a style="margin-left: 10px; vertical-align: super;" href="%s"><button class="button button-primary">%s &nbsp;&#10140;</button></a>', $trial_url, $this->get_text('start-free-trial')
10676
- );
10677
-
10678
- $this->_admin_notices->add_sticky(
10679
- $this->apply_filters('trial_promotion_message', "{$message} {$cc_string} {$button}"), 'trial_promotion', '', 'promotion'
10680
- );
10681
-
10682
- $this->_storage->trial_promotion_shown = WP_FS__SCRIPT_START_TIME;
10683
-
10684
- return true;
10685
- }
10686
- /**
10687
- * @author Vova Feldman (@svovaf)
10688
- * @since 1.2.1.5
10689
- */
10690
- function _enqueue_common_css() {
10691
- if ($this->has_paid_plan() && !$this->is_paying()) {
10692
- // Add basic CSS for admin-notices and menu-item colors.
10693
- fs_enqueue_local_style('fs_common', '/admin/common.css');
10694
- }
10695
- }
10696
- /* Action Links
10697
- ------------------------------------------------------------------------------------------------------------------ */
10698
- private $_action_links_hooked = false;
10699
- private $_action_links = array();
10700
- /**
10701
- * Hook to plugin action links filter.
10702
- *
10703
- * @author Vova Feldman (@svovaf)
10704
- * @since 1.0.0
10705
- */
10706
- private function hook_plugin_action_links() {
10707
- $this->_logger->entrance();
10708
-
10709
- $this->_action_links_hooked = true;
10710
-
10711
- $this->_logger->log('Adding action links hooks.');
10712
-
10713
- // Add action link to settings page.
10714
- add_filter('plugin_action_links_' . $this->_plugin_basename, array(
10715
- &$this,
10716
- '_modify_plugin_action_links_hook'
10717
- ), WP_FS__DEFAULT_PRIORITY, 2);
10718
- add_filter('network_admin_plugin_action_links_' . $this->_plugin_basename, array(
10719
- &$this,
10720
- '_modify_plugin_action_links_hook'
10721
- ), WP_FS__DEFAULT_PRIORITY, 2);
10722
- }
10723
- /**
10724
- * Add plugin action link.
10725
- *
10726
- * @author Vova Feldman (@svovaf)
10727
- * @since 1.0.0
10728
- *
10729
- * @param $label
10730
- * @param $url
10731
- * @param bool $external
10732
- * @param int $priority
10733
- * @param bool $key
10734
- */
10735
- function add_plugin_action_link($label, $url, $external = false, $priority = WP_FS__DEFAULT_PRIORITY, $key = false) {
10736
- $this->_logger->entrance();
10737
-
10738
- if (!isset($this->_action_links[$priority])) {
10739
- $this->_action_links[$priority] = array();
10740
- }
10741
-
10742
- if (false === $key) {
10743
- $key = preg_replace("/[^A-Za-z0-9 ]/", '', strtolower($label));
10744
- }
10745
-
10746
- $this->_action_links[$priority][] = array(
10747
- 'label' => $label,
10748
- 'href' => $url,
10749
- 'key' => $key,
10750
- 'external' => $external
10751
- );
10752
- }
10753
- /**
10754
- * Adds Upgrade and Add-Ons links to the main Plugins page link actions collection.
10755
- *
10756
- * @author Vova Feldman (@svovaf)
10757
- * @since 1.0.0
10758
- */
10759
- function _add_upgrade_action_link() {
10760
- $this->_logger->entrance();
10761
-
10762
- if ($this->is_registered()) {
10763
- if (!$this->is_paying() && $this->has_paid_plan()) {
10764
- $this->add_plugin_action_link(
10765
- $this->get_text('upgrade'), $this->get_upgrade_url(), false, 7, 'upgrade'
10766
- );
10767
- }
10768
-
10769
- if ($this->has_addons()) {
10770
- $this->add_plugin_action_link(
10771
- $this->get_text('add-ons'), $this->_get_admin_page_url('addons'), false, 9, 'addons'
10772
- );
10773
- }
10774
- }
10775
- }
10776
- /**
10777
- * Adds "Activate License" or "Change License" link to the main Plugins page link actions collection.
10778
- *
10779
- * @author Leo Fajardo (@leorw)
10780
- * @since 1.1.9
10781
- */
10782
- function _add_license_action_link() {
10783
- $this->_logger->entrance();
10784
-
10785
- if ($this->is_free_plan() && $this->is_addon()) {
10786
- return;
10787
- }
10788
-
10789
- if (!self::is_ajax()) {
10790
- // Inject license activation dialog UI and client side code.
10791
- add_action('admin_footer', array(&$this, '_add_license_activation_dialog_box'));
10792
- }
10793
-
10794
- $link_text = $this->get_text(
10795
- $this->is_free_plan() ?
10796
- 'activate-license' :
10797
- 'change-license'
10798
- );
10799
-
10800
- $this->add_plugin_action_link(
10801
- $link_text, '#', false, 11, ( 'activate-license ' . $this->_slug)
10802
- );
10803
- }
10804
- /**
10805
- * Adds "Opt in" or "Opt out" link to the main "Plugins" page link actions collection.
10806
- *
10807
- * @author Leo Fajardo (@leorw)
10808
- * @since 1.2.1.5
10809
- */
10810
- function _add_tracking_links() {
10811
- if (!current_user_can('activate_plugins')) {
10812
- return;
10813
- }
10814
-
10815
- $this->_logger->entrance();
10816
-
10817
- if (!$this->is_plugins_page()) {
10818
- // Only show tracking links on the plugin's page.
10819
- return;
10820
- }
10821
-
10822
- if (!$this->is_enable_anonymous()) {
10823
- // Don't allow to opt-out if anonymous mode is disabled.
10824
- return;
10825
- }
10826
-
10827
- if (!$this->is_free_plan()) {
10828
- // Don't allow to opt-out if running in paid plan.
10829
- return;
10830
- }
10831
-
10832
- if ($this->add_ajax_action('stop_tracking', array(&$this, '_stop_tracking_callback'))) {
10833
- return;
10834
- }
10835
-
10836
- if ($this->add_ajax_action('allow_tracking', array(&$this, '_allow_tracking_callback'))) {
10837
- return;
10838
- }
10839
-
10840
- if (fs_request_is_action_secure($this->_slug . '_reconnect')) {
10841
- if (!$this->is_registered() && $this->is_anonymous()) {
10842
- $this->connect_again();
10843
-
10844
- return;
10845
- }
10846
- }
10847
-
10848
- $url = '#';
10849
-
10850
- if ($this->is_registered()) {
10851
- if ($this->is_tracking_allowed()) {
10852
- $link_text_id = 'opt-out';
10853
- } else {
10854
- $link_text_id = 'opt-in';
10855
- }
10856
-
10857
- add_action('admin_footer', array(&$this, '_add_optout_dialog'));
10858
- } else {
10859
- $link_text_id = 'opt-in';
10860
-
10861
- $params = !$this->is_anonymous() ?
10862
- array() :
10863
- array(
10864
- 'nonce' => wp_create_nonce($this->_slug . '_reconnect'),
10865
- 'fs_action' => ( $this->_slug . '_reconnect' ),
10866
- );
10867
-
10868
- $url = $this->get_activation_url($params);
10869
- }
10870
-
10871
- $this->add_plugin_action_link(
10872
- $this->get_text($link_text_id), $url, false, 13, "opt-in-or-opt-out {$this->_slug}"
10873
- );
10874
- }
10875
- /**
10876
- * Get the URL of the page that should be loaded right after the plugin activation.
10877
- *
10878
- * @author Vova Feldman (@svovaf)
10879
- * @since 1.1.7.4
10880
- *
10881
- * @return string
10882
- */
10883
- function get_after_plugin_activation_redirect_url() {
10884
- $url = false;
10885
- $plugin_fs = false;
10886
-
10887
- if (!$this->is_addon()) {
10888
- $first_time_path = $this->_menu->get_first_time_path();
10889
- $plugin_fs = $this;
10890
- $url = $plugin_fs->is_activation_mode() ?
10891
- $plugin_fs->get_activation_url() :
10892
- ( empty($first_time_path) ?
10893
- $this->_get_admin_page_url() :
10894
- $first_time_path );
10895
- } else {
10896
- if ($this->is_parent_plugin_installed()) {
10897
- $plugin_fs = self::get_parent_instance();
10898
- }
10899
-
10900
- if (is_object($plugin_fs)) {
10901
- if (!$plugin_fs->is_registered()) {
10902
- // Forward to parent plugin connect when parent not registered.
10903
- $url = $plugin_fs->get_activation_url();
10904
- } else {
10905
- // Forward to account page.
10906
- $url = $plugin_fs->_get_admin_page_url('account');
10907
- }
10908
- }
10909
- }
10910
-
10911
- return $url;
10912
- }
10913
- /**
10914
- * Forward page to activation page.
10915
- *
10916
- * @author Vova Feldman (@svovaf)
10917
- * @since 1.0.3
10918
- */
10919
- function _redirect_on_activation_hook() {
10920
- $url = $this->get_after_plugin_activation_redirect_url();
10921
-
10922
- if (is_string($url)) {
10923
- fs_redirect($url);
10924
- }
10925
- }
10926
- /**
10927
- * Modify plugin's page action links collection.
10928
- *
10929
- * @author Vova Feldman (@svovaf)
10930
- * @since 1.0.0
10931
- *
10932
- * @param array $links
10933
- * @param $file
10934
- *
10935
- * @return array
10936
- */
10937
- function _modify_plugin_action_links_hook($links, $file) {
10938
- $this->_logger->entrance();
10939
-
10940
- $passed_deactivate = false;
10941
- $deactivate_link = '';
10942
- $before_deactivate = array();
10943
- $after_deactivate = array();
10944
- foreach ($links as $key => $link) {
10945
- if ('deactivate' === $key) {
10946
- $deactivate_link = $link;
10947
- $passed_deactivate = true;
10948
- continue;
10949
- }
10950
-
10951
- if (!$passed_deactivate) {
10952
- $before_deactivate[$key] = $link;
10953
- } else {
10954
- $after_deactivate[$key] = $link;
10955
- }
10956
- }
10957
-
10958
- ksort($this->_action_links);
10959
-
10960
- foreach ($this->_action_links as $new_links) {
10961
- foreach ($new_links as $link) {
10962
- $before_deactivate[$link['key']] = '<a href="' . $link['href'] . '"' . ( $link['external'] ? ' target="_blank"' : '' ) . '>' . $link['label'] . '</a>';
10963
- }
10964
- }
10965
-
10966
- if (!empty($deactivate_link)) {
10967
- /**
10968
- * This HTML element is used to identify the correct plugin when attaching an event to its Deactivate link.
10969
- *
10970
- * @since 1.2.1.6 Always show the deactivation feedback form since we added automatic free version deactivation upon premium code activation.
10971
- */
10972
- $deactivate_link .= '<i class="fs-slug" data-slug="' . $this->_slug . '"></i>';
10973
-
10974
- // Append deactivation link.
10975
- $before_deactivate['deactivate'] = $deactivate_link;
10976
- }
10977
-
10978
- return array_merge($before_deactivate, $after_deactivate);
10979
- }
10980
- /**
10981
- * Adds admin message.
10982
- *
10983
- * @author Vova Feldman (@svovaf)
10984
- * @since 1.0.4
10985
- *
10986
- * @param string $message
10987
- * @param string $title
10988
- * @param string $type
10989
- */
10990
- function add_admin_message($message, $title = '', $type = 'success') {
10991
- $this->_admin_notices->add($message, $title, $type);
10992
- }
10993
- /**
10994
- * Adds sticky admin message.
10995
- *
10996
- * @author Vova Feldman (@svovaf)
10997
- * @since 1.1.0
10998
- *
10999
- * @param string $message
11000
- * @param string $id
11001
- * @param string $title
11002
- * @param string $type
11003
- */
11004
- function add_sticky_admin_message($message, $id, $title = '', $type = 'success') {
11005
- $this->_admin_notices->add_sticky($message, $id, $title, $type);
11006
- }
11007
- /**
11008
- * Helper function that returns the final steps for the upgrade completion.
11009
- *
11010
- * If the module is already running the premium code, returns an empty string.
11011
- *
11012
- * @author Vova Feldman (@svovaf)
11013
- * @since 1.2.1
11014
- *
11015
- * @param string $plan_title
11016
- *
11017
- * @return string
11018
- */
11019
- private function get_complete_upgrade_instructions($plan_title = '') {
11020
- if (!$this->has_premium_version() || $this->is_premium()) {
11021
- return '';
11022
- }
11023
-
11024
- if (empty($plan_title)) {
11025
- $plan_title = $this->_site->plan->title;
11026
- }
11027
-
11028
- // @since 1.2.1.5 The free version is auto deactivated.
11029
- $deactivation_step = version_compare($this->version, '1.2.1.5', '<') ?
11030
- ( '<li>' . $this->get_text('deactivate-free-version') . '.</li>' ) :
11031
- '';
11032
-
11033
- return sprintf(
11034
- ' %s: <ol><li>%s.</li>%s<li>%s (<a href="%s" target="_blank">%s</a>).</li></ol>', $this->get_text('follow-steps-to-complete-upgrade'), $this->get_latest_download_link(sprintf(
11035
- $this->get_text('download-latest-x-version'), $plan_title
11036
- )), $deactivation_step, $this->get_text('upload-and-activate'), '//bit.ly/upload-wp-plugin', $this->get_text('howto-upload-activate')
11037
- );
11038
- }
11039
- /* Plugin Auto-Updates (@since 1.0.4)
11040
- ------------------------------------------------------------------------------------------------------------------ */
11041
- /**
11042
- * @var string[]
11043
- */
11044
- private static $_auto_updated_plugins;
11045
- /**
11046
- * @todo TEST IF IT WORKS!!!
11047
- *
11048
- * Include plugins for automatic updates based on stored settings.
11049
- *
11050
- * @see http://wordpress.stackexchange.com/questions/131394/how-do-i-exclude-plugins-from-getting-automatically-updated/131404#131404
11051
- *
11052
- * @author Vova Feldman (@svovaf)
11053
- * @since 1.0.4
11054
- *
11055
- * @param bool $update Whether to update (not used for plugins)
11056
- * @param object $item The plugin's info
11057
- *
11058
- * @return bool
11059
- */
11060
- static function _include_plugins_in_auto_update($update, $item) {
11061
- // Before version 3.8.2 the $item was the file name of the plugin,
11062
- // while in 3.8.2 statistics were added (https://core.trac.wordpress.org/changeset/27905).
11063
- $by_slug = ( (int) str_replace('.', '', get_bloginfo('version')) >= 382 );
11064
-
11065
- if (!isset(self::$_auto_updated_plugins)) {
11066
- $plugins = self::$_accounts->get_option('plugins', array());
11067
-
11068
- $identifiers = array();
11069
- foreach ($plugins as $p) {
11070
- /**
11071
- * @var FS_Plugin $p
11072
- */
11073
- if (isset($p->auto_update) && $p->auto_update) {
11074
- $identifiers[] = ( $by_slug ? $p->slug : plugin_basename($p->file) );
11075
- }
11076
- }
11077
-
11078
- self::$_auto_updated_plugins = $identifiers;
11079
- }
11080
-
11081
- if (in_array($by_slug ? $item->slug : $item, self::$_auto_updated_plugins)) {
11082
- return true;
11083
- }
11084
-
11085
- // Pass update decision to next filters
11086
- return $update;
11087
- }
11088
- /**
11089
- * @author Vova Feldman (@svovaf)
11090
- * @since 1.2.1.7
11091
- *
11092
- * @param string $key
11093
- *
11094
- * @return string
11095
- */
11096
- function get_text($key) {
11097
- return fs_text($key, $this->_slug);
11098
- }
11099
- #----------------------------------------------------------------------------------
11100
- #region Versioning
11101
- #----------------------------------------------------------------------------------
11102
- /**
11103
- * Check if Freemius in SDK upgrade mode.
11104
- *
11105
- * @author Vova Feldman (@svovaf)
11106
- * @since 1.0.9
11107
- *
11108
- * @return bool
11109
- */
11110
- function is_sdk_upgrade_mode() {
11111
- return isset($this->_storage->sdk_upgrade_mode) ?
11112
- $this->_storage->sdk_upgrade_mode :
11113
- false;
11114
- }
11115
- /**
11116
- * Turn SDK upgrade mode off.
11117
- *
11118
- * @author Vova Feldman (@svovaf)
11119
- * @since 1.0.9
11120
- */
11121
- function set_sdk_upgrade_complete() {
11122
- $this->_storage->sdk_upgrade_mode = false;
11123
- }
11124
- /**
11125
- * Check if plugin upgrade mode.
11126
- *
11127
- * @author Vova Feldman (@svovaf)
11128
- * @since 1.0.9
11129
- *
11130
- * @return bool
11131
- */
11132
- function is_plugin_upgrade_mode() {
11133
- return isset($this->_storage->plugin_upgrade_mode) ?
11134
- $this->_storage->plugin_upgrade_mode :
11135
- false;
11136
- }
11137
- /**
11138
- * Turn plugin upgrade mode off.
11139
- *
11140
- * @author Vova Feldman (@svovaf)
11141
- * @since 1.0.9
11142
- */
11143
- function set_plugin_upgrade_complete() {
11144
- $this->_storage->plugin_upgrade_mode = false;
11145
- }
11146
- #endregion
11147
- #----------------------------------------------------------------------------------
11148
- #region Permissions
11149
- #----------------------------------------------------------------------------------
11150
- /**
11151
- * Check if specific permission requested.
11152
- *
11153
- * @author Vova Feldman (@svovaf)
11154
- * @since 1.1.6
11155
- *
11156
- * @param string $permission
11157
- *
11158
- * @return bool
11159
- */
11160
- function is_permission_requested($permission) {
11161
- return isset($this->_permissions[$permission]) && ( true === $this->_permissions[$permission] );
11162
- }
11163
- #endregion
11164
- #----------------------------------------------------------------------------------
11165
- #region Auto Activation
11166
- #----------------------------------------------------------------------------------
11167
- /**
11168
- * Hints the SDK if running an auto-installation.
11169
- *
11170
- * @var bool
11171
- */
11172
- private $_isAutoInstall = false;
11173
- /**
11174
- * After upgrade callback to install and auto activate a plugin.
11175
- * This code will only be executed on explicit request from the user,
11176
- * following the practice Jetpack are using with their theme installations.
11177
- *
11178
- * @link https://make.wordpress.org/plugins/2017/03/16/clarification-of-guideline-8-executable-code-and-installs/
11179
- *
11180
- * @author Vova Feldman (@svovaf)
11181
- * @since 1.2.1.7
11182
- */
11183
- function _install_premium_version_ajax_action() {
11184
- $this->_logger->entrance();
11185
-
11186
- $this->check_ajax_referer('install_premium_version');
11187
-
11188
- if (!$this->is_registered()) {
11189
- // Not registered.
11190
- self::shoot_ajax_failure(array(
11191
- 'message' => $this->get_text('auto-install-error-not-opted-in'),
11192
- 'code' => 'premium_installed',
11193
- ));
11194
- }
11195
-
11196
- $plugin_id = fs_request_get('module_id', $this->get_id());
11197
-
11198
- if (!FS_Plugin::is_valid_id($plugin_id)) {
11199
- // Invalid ID.
11200
- self::shoot_ajax_failure(array(
11201
- 'message' => $this->get_text('auto-install-error-invalid-id'),
11202
- 'code' => 'invalid_module_id',
11203
- ));
11204
- }
11205
-
11206
- if ($plugin_id == $this->get_id()) {
11207
- if ($this->is_premium()) {
11208
- // Already using the premium code version.
11209
- self::shoot_ajax_failure(array(
11210
- 'message' => $this->get_text('auto-install-error-premium-activated'),
11211
- 'code' => 'premium_installed',
11212
- ));
11213
- }
11214
- if (!$this->can_use_premium_code()) {
11215
- // Don't have access to the premium code.
11216
- self::shoot_ajax_failure(array(
11217
- 'message' => $this->get_text('auto-install-error-invalid-license'),
11218
- 'code' => 'invalid_license',
11219
- ));
11220
- }
11221
- if (!$this->has_release_on_freemius()) {
11222
- // Plugin is a serviceware, no premium code version.
11223
- self::shoot_ajax_failure(array(
11224
- 'message' => $this->get_text('auto-install-error-serviceware'),
11225
- 'code' => 'premium_version_missing',
11226
- ));
11227
- }
11228
- } else {
11229
- $addon = $this->get_addon($plugin_id);
11230
-
11231
- if (!is_object($addon)) {
11232
- // Invalid add-on ID.
11233
- self::shoot_ajax_failure(array(
11234
- 'message' => $this->get_text('auto-install-error-invalid-id'),
11235
- 'code' => 'invalid_module_id',
11236
- ));
11237
- }
11238
-
11239
- if ($this->is_addon_activated($plugin_id, true)) {
11240
- // Premium add-on version is already activated.
11241
- self::shoot_ajax_failure(array(
11242
- 'message' => $this->get_text('auto-install-error-premium-addon-activated'),
11243
- 'code' => 'premium_installed',
11244
- ));
11245
- }
11246
- }
11247
-
11248
- $this->_isAutoInstall = true;
11249
-
11250
- // Try to install and activate.
11251
- $updater = new FS_Plugin_Updater($this);
11252
- $result = $updater->install_and_activate_plugin($plugin_id);
11253
-
11254
- if (is_array($result) && !empty($result['message'])) {
11255
- self::shoot_ajax_failure(array(
11256
- 'message' => $result['message'],
11257
- 'code' => $result['code'],
11258
- ));
11259
- }
11260
-
11261
- self::shoot_ajax_success($result);
11262
- }
11263
- /**
11264
- * Displays module activation dialog box after a successful upgrade
11265
- * where the user explicitly requested to auto download and install
11266
- * the premium version.
11267
- *
11268
- * @author Vova Feldman (@svovaf)
11269
- * @since 1.2.1.7
11270
- */
11271
- function _add_auto_installation_dialog_box() {
11272
- $this->_logger->entrance();
11273
-
11274
- if (!$this->is_registered()) {
11275
- // Not registered.
11276
- return;
11277
- }
11278
-
11279
- $plugin_id = fs_request_get('plugin_id', $this->get_id());
11280
-
11281
- if (!FS_Plugin::is_valid_id($plugin_id)) {
11282
- // Invalid module ID.
11283
- return;
11284
- }
11285
-
11286
- if ($plugin_id == $this->get_id()) {
11287
- if ($this->is_premium()) {
11288
- // Already using the premium code version.
11289
- return;
11290
- }
11291
- if (!$this->can_use_premium_code()) {
11292
- // Don't have access to the premium code.
11293
- return;
11294
- }
11295
- if (!$this->has_release_on_freemius()) {
11296
- // Plugin is a serviceware, no premium code version.
11297
- return;
11298
- }
11299
- } else {
11300
- $addon = $this->get_addon($plugin_id);
11301
-
11302
- if (!is_object($addon)) {
11303
- // Invalid add-on ID.
11304
- return;
11305
- }
11306
-
11307
- if ($this->is_addon_activated($plugin_id, true)) {
11308
- // Premium add-on version is already activated.
11309
- return;
11310
- }
11311
- }
11312
-
11313
- $vars = array(
11314
- 'id' => $plugin_id,
11315
- 'slug' => $this->_slug,
11316
- );
11317
-
11318
- fs_require_template('auto-installation.php', $vars);
11319
- }
11320
- #endregion
11321
- #----------------------------------------------------------------------------------
11322
- #region Marketing
11323
- #----------------------------------------------------------------------------------
11324
- /**
11325
- * Check if current user purchased any other plugins before.
11326
- *
11327
- * @author Vova Feldman (@svovaf)
11328
- * @since 1.0.9
11329
- *
11330
- * @return bool
11331
- */
11332
- function has_purchased_before() {
11333
- // TODO: Implement has_purchased_before() method.
11334
- throw new Exception('not implemented');
11335
- }
11336
- /**
11337
- * Check if current user classified as an agency.
11338
- *
11339
- * @author Vova Feldman (@svovaf)
11340
- * @since 1.0.9
11341
- *
11342
- * @return bool
11343
- */
11344
- function is_agency() {
11345
- // TODO: Implement is_agency() method.
11346
- throw new Exception('not implemented');
11347
- }
11348
- /**
11349
- * Check if current user classified as a developer.
11350
- *
11351
- * @author Vova Feldman (@svovaf)
11352
- * @since 1.0.9
11353
- *
11354
- * @return bool
11355
- */
11356
- function is_developer() {
11357
- // TODO: Implement is_developer() method.
11358
- throw new Exception('not implemented');
11359
- }
11360
- /**
11361
- * Check if current user classified as a business.
11362
- *
11363
- * @author Vova Feldman (@svovaf)
11364
- * @since 1.0.9
11365
- *
11366
- * @return bool
11367
- */
11368
- function is_business() {
11369
- // TODO: Implement is_business() method.
11370
- throw new Exception('not implemented');
11371
- }
11372
- #endregion
11373
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/class-fs-api.php DELETED
@@ -1,523 +0,0 @@
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.4
7
- */
8
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- /**
12
- * Class FS_Api
13
- *
14
- * Wraps Freemius API SDK to handle:
15
- * 1. Clock sync.
16
- * 2. Fallback to HTTP when HTTPS fails.
17
- * 3. Adds caching layer to GET requests.
18
- * 4. Adds consistency for failed requests by using last cached version.
19
- */
20
- class FS_Api {
21
- /**
22
- * @var FS_Api[]
23
- */
24
- private static $_instances = array();
25
- /**
26
- * @var FS_Option_Manager Freemius options, options-manager.
27
- */
28
- private static $_options;
29
- /**
30
- * @var FS_Cache_Manager API Caching layer
31
- */
32
- private static $_cache;
33
- /**
34
- * @var int Clock diff in seconds between current server to API server.
35
- */
36
- private static $_clock_diff;
37
- /**
38
- * @var Freemius_Api
39
- */
40
- private $_api;
41
- /**
42
- * @var string
43
- */
44
- private $_slug;
45
- /**
46
- * @var FS_Logger
47
- * @since 1.0.4
48
- */
49
- private $_logger;
50
- /**
51
- * @param string $slug
52
- * @param string $scope 'app', 'developer', 'user' or 'install'.
53
- * @param number $id Element's id.
54
- * @param string $public_key Public key.
55
- * @param bool $is_sandbox
56
- * @param bool|string $secret_key Element's secret key.
57
- *
58
- * @return FS_Api
59
- */
60
- static function instance($slug, $scope, $id, $public_key, $is_sandbox, $secret_key = false) {
61
- $identifier = md5($slug . $scope . $id . $public_key . ( is_string($secret_key) ? $secret_key : '' ) . json_encode($is_sandbox));
62
-
63
- if (!isset(self::$_instances[$identifier])) {
64
- self::_init();
65
-
66
- self::$_instances[$identifier] = new FS_Api($slug, $scope, $id, $public_key, $secret_key, $is_sandbox);
67
- }
68
-
69
- return self::$_instances[$identifier];
70
- }
71
- private static function _init() {
72
- if (isset(self::$_options)) {
73
- return;
74
- }
75
-
76
- if (!class_exists('Freemius_Api')) {
77
- require_once WP_FS__DIR_SDK . '/Freemius.php';
78
- }
79
-
80
- self::$_options = FS_Option_Manager::get_manager(WP_FS__OPTIONS_OPTION_NAME, true);
81
- self::$_cache = FS_Cache_Manager::get_manager(WP_FS__API_CACHE_OPTION_NAME);
82
-
83
- self::$_clock_diff = self::$_options->get_option('api_clock_diff', 0);
84
- Freemius_Api::SetClockDiff(self::$_clock_diff);
85
-
86
- if (self::$_options->get_option('api_force_http', false)) {
87
- Freemius_Api::SetHttp();
88
- }
89
- }
90
- /**
91
- * @param string $slug
92
- * @param string $scope 'app', 'developer', 'user' or 'install'.
93
- * @param number $id Element's id.
94
- * @param string $public_key Public key.
95
- * @param bool|string $secret_key Element's secret key.
96
- * @param bool $is_sandbox
97
- */
98
- private function __construct($slug, $scope, $id, $public_key, $secret_key, $is_sandbox) {
99
- $this->_api = new Freemius_Api($scope, $id, $public_key, $secret_key, $is_sandbox);
100
-
101
- $this->_slug = $slug;
102
- $this->_logger = FS_Logger::get_logger(WP_FS__SLUG . '_' . $slug . '_api', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK);
103
- }
104
- /**
105
- * Find clock diff between server and API server, and store the diff locally.
106
- *
107
- * @param bool|int $diff
108
- *
109
- * @return bool|int False if clock diff didn't change, otherwise returns the clock diff in seconds.
110
- */
111
- private function _sync_clock_diff($diff = false) {
112
- $this->_logger->entrance();
113
-
114
- // Sync clock and store.
115
- $new_clock_diff = ( false === $diff ) ?
116
- Freemius_Api::FindClockDiff() :
117
- $diff;
118
-
119
- if ($new_clock_diff === self::$_clock_diff) {
120
- return false;
121
- }
122
-
123
- self::$_clock_diff = $new_clock_diff;
124
-
125
- // Update API clock's diff.
126
- Freemius_Api::SetClockDiff(self::$_clock_diff);
127
-
128
- // Store new clock diff in storage.
129
- self::$_options->set_option('api_clock_diff', self::$_clock_diff, true);
130
-
131
- return $new_clock_diff;
132
- }
133
- /**
134
- * Override API call to enable retry with servers' clock auto sync method.
135
- *
136
- * @param string $path
137
- * @param string $method
138
- * @param array $params
139
- * @param bool $retry Is in retry or first call attempt.
140
- *
141
- * @return array|mixed|string|void
142
- */
143
- private function _call($path, $method = 'GET', $params = array(), $retry = false) {
144
- $this->_logger->entrance($method . ':' . $path);
145
-
146
- if (self::is_temporary_down()) {
147
- $result = $this->get_temporary_unavailable_error();
148
- } else {
149
- $result = $this->_api->Api($path, $method, $params);
150
-
151
- if (null !== $result &&
152
- isset($result->error) &&
153
- isset($result->error->code) &&
154
- 'request_expired' === $result->error->code
155
- ) {
156
- if (!$retry) {
157
- $diff = isset($result->error->timestamp) ?
158
- ( time() - strtotime($result->error->timestamp) ) :
159
- false;
160
-
161
- // Try to sync clock diff.
162
- if (false !== $this->_sync_clock_diff($diff)) {
163
- // Retry call with new synced clock.
164
- return $this->_call($path, $method, $params, true);
165
- }
166
- }
167
- }
168
- }
169
-
170
- if ($this->_logger->is_on() && self::is_api_error($result)) {
171
- // Log API errors.
172
- $this->_logger->api_error($result);
173
- }
174
-
175
- return $result;
176
- }
177
- /**
178
- * Override API call to wrap it in servers' clock sync method.
179
- *
180
- * @param string $path
181
- * @param string $method
182
- * @param array $params
183
- *
184
- * @return array|mixed|string|void
185
- * @throws Freemius_Exception
186
- */
187
- function call($path, $method = 'GET', $params = array()) {
188
- return $this->_call($path, $method, $params);
189
- }
190
- /**
191
- * Get API request URL signed via query string.
192
- *
193
- * @param string $path
194
- *
195
- * @return string
196
- */
197
- function get_signed_url($path) {
198
- return $this->_api->GetSignedUrl($path);
199
- }
200
- /**
201
- * @param string $path
202
- * @param bool $flush
203
- * @param int $expiration (optional) Time until expiration in seconds from now, defaults to 24 hours
204
- *
205
- * @return stdClass|mixed
206
- */
207
- function get($path = '/', $flush = false, $expiration = WP_FS__TIME_24_HOURS_IN_SEC) {
208
- $this->_logger->entrance($path);
209
-
210
- $cache_key = $this->get_cache_key($path);
211
-
212
- // Always flush during development.
213
- if (WP_FS__DEV_MODE || $this->_api->IsSandbox()) {
214
- $flush = true;
215
- }
216
-
217
- $cached_result = self::$_cache->get($cache_key);
218
-
219
- if ($flush || !self::$_cache->has_valid($cache_key)) {
220
- $result = $this->call($path);
221
-
222
- if (!is_object($result) || isset($result->error)) {
223
- // Api returned an error.
224
- if (is_object($cached_result) &&
225
- !isset($cached_result)
226
- ) {
227
- // If there was an error during a newer data fetch,
228
- // fallback to older data version.
229
- $result = $cached_result;
230
-
231
- if ($this->_logger->is_on()) {
232
- $this->_logger->warn('Fallback to cached API result: ' . var_export($cached_result, true));
233
- }
234
- } else {
235
- // If no older data version, return result without
236
- // caching the error.
237
- return $result;
238
- }
239
- }
240
-
241
- self::$_cache->set($cache_key, $result, $expiration);
242
-
243
- $cached_result = $result;
244
- } else {
245
- $this->_logger->log('Using cached API result.');
246
- }
247
-
248
- return $cached_result;
249
- }
250
- /**
251
- * Check if there's a cached version of the API request.
252
- *
253
- * @author Vova Feldman (@svovaf)
254
- * @since 1.2.1
255
- *
256
- * @param string $path
257
- * @param string $method
258
- * @param array $params
259
- *
260
- * @return bool
261
- */
262
- function is_cached($path, $method = 'GET', $params = array()) {
263
- $cache_key = $this->get_cache_key($path, $method, $params);
264
-
265
- return self::$_cache->has_valid($cache_key);
266
- }
267
- /**
268
- * Invalidate a cached version of the API request.
269
- *
270
- * @author Vova Feldman (@svovaf)
271
- * @since 1.2.1.5
272
- *
273
- * @param string $path
274
- * @param string $method
275
- * @param array $params
276
- */
277
- function purge_cache($path, $method = 'GET', $params = array()) {
278
- $this->_logger->entrance("{$method}:{$path}");
279
-
280
- $cache_key = $this->get_cache_key($path, $method, $params);
281
-
282
- self::$_cache->purge($cache_key);
283
- }
284
- /**
285
- * @param string $path
286
- * @param string $method
287
- * @param array $params
288
- *
289
- * @return string
290
- * @throws \Freemius_Exception
291
- */
292
- private function get_cache_key($path, $method = 'GET', $params = array()) {
293
- $canonized = $this->_api->CanonizePath($path);
294
- // $exploded = explode('/', $canonized);
295
- // return $method . '_' . array_pop($exploded) . '_' . md5($canonized . json_encode($params));
296
- return strtolower($method . ':' . $canonized) . (!empty($params) ? '#' . md5(json_encode($params)) : '' );
297
- }
298
- /**
299
- * Test API connectivity.
300
- *
301
- * @author Vova Feldman (@svovaf)
302
- * @since 1.0.9 If fails, try to fallback to HTTP.
303
- * @since 1.1.6 Added a 5-min caching mechanism, to prevent from overloading the server if the API if
304
- * temporary down.
305
- *
306
- * @return bool True if successful connectivity to the API.
307
- */
308
- static function test() {
309
- self::_init();
310
-
311
- $cache_key = 'ping_test';
312
-
313
- $test = self::$_cache->get_valid($cache_key, null);
314
-
315
- if (is_null($test)) {
316
- $test = Freemius_Api::Test();
317
-
318
- if (false === $test && Freemius_Api::IsHttps()) {
319
- // Fallback to HTTP, since HTTPS fails.
320
- Freemius_Api::SetHttp();
321
-
322
- self::$_options->set_option('api_force_http', true, true);
323
-
324
- $test = Freemius_Api::Test();
325
-
326
- if (false === $test) {
327
- /**
328
- * API connectivity test fail also in HTTP request, therefore,
329
- * fallback to HTTPS to keep connection secure.
330
- *
331
- * @since 1.1.6
332
- */
333
- self::$_options->set_option('api_force_http', false, true);
334
- }
335
- }
336
-
337
- self::$_cache->set($cache_key, $test, WP_FS__TIME_5_MIN_IN_SEC);
338
- }
339
-
340
- return $test;
341
- }
342
- /**
343
- * Check if API is temporary down.
344
- *
345
- * @author Vova Feldman (@svovaf)
346
- * @since 1.1.6
347
- *
348
- * @return bool
349
- */
350
- static function is_temporary_down() {
351
- self::_init();
352
-
353
- $test = self::$_cache->get_valid('ping_test', null);
354
-
355
- return ( false === $test );
356
- }
357
- /**
358
- * @author Vova Feldman (@svovaf)
359
- * @since 1.1.6
360
- *
361
- * @return object
362
- */
363
- private function get_temporary_unavailable_error() {
364
- return (object) array(
365
- 'error' => (object) array(
366
- 'type' => 'TemporaryUnavailable',
367
- 'message' => 'API is temporary unavailable, please retry in ' . ( self::$_cache->get_record_expiration('ping_test') - WP_FS__SCRIPT_START_TIME ) . ' sec.',
368
- 'code' => 'temporary_unavailable',
369
- 'http' => 503
370
- )
371
- );
372
- }
373
- /**
374
- * Ping API for connectivity test, and return result object.
375
- *
376
- * @author Vova Feldman (@svovaf)
377
- * @since 1.0.9
378
- *
379
- * @param null|string $unique_anonymous_id
380
- * @param array $params
381
- *
382
- * @return object
383
- */
384
- function ping($unique_anonymous_id = null, $params = array()) {
385
- $this->_logger->entrance();
386
-
387
- if (self::is_temporary_down()) {
388
- return $this->get_temporary_unavailable_error();
389
- }
390
-
391
- $pong = is_null($unique_anonymous_id) ?
392
- Freemius_Api::Ping() :
393
- $this->_call('ping.json?' . http_build_query(array_merge(
394
- array('uid' => $unique_anonymous_id), $params
395
- )));
396
-
397
- if ($this->is_valid_ping($pong)) {
398
- return $pong;
399
- }
400
-
401
- if (self::should_try_with_http($pong)) {
402
- // Fallback to HTTP, since HTTPS fails.
403
- Freemius_Api::SetHttp();
404
-
405
- self::$_options->set_option('api_force_http', true, true);
406
-
407
- $pong = is_null($unique_anonymous_id) ?
408
- Freemius_Api::Ping() :
409
- $this->_call('ping.json?' . http_build_query(array_merge(
410
- array('uid' => $unique_anonymous_id), $params
411
- )));
412
-
413
- if (!$this->is_valid_ping($pong)) {
414
- self::$_options->set_option('api_force_http', false, true);
415
- }
416
- }
417
-
418
- return $pong;
419
- }
420
- /**
421
- * Check if based on the API result we should try
422
- * to re-run the same request with HTTP instead of HTTPS.
423
- *
424
- * @author Vova Feldman (@svovaf)
425
- * @since 1.1.6
426
- *
427
- * @param $result
428
- *
429
- * @return bool
430
- */
431
- private static function should_try_with_http($result) {
432
- if (!Freemius_Api::IsHttps()) {
433
- return false;
434
- }
435
-
436
- return (!is_object($result) ||
437
- !isset($result->error) ||
438
- !isset($result->error->code) ||
439
- !in_array($result->error->code, array(
440
- 'curl_missing',
441
- 'cloudflare_ddos_protection',
442
- 'maintenance_mode',
443
- 'squid_cache_block',
444
- 'too_many_requests',
445
- )) );
446
- }
447
- /**
448
- * Check if valid ping request result.
449
- *
450
- * @author Vova Feldman (@svovaf)
451
- * @since 1.1.1
452
- *
453
- * @param mixed $pong
454
- *
455
- * @return bool
456
- */
457
- function is_valid_ping($pong) {
458
- return Freemius_Api::Test($pong);
459
- }
460
- function get_url($path = '') {
461
- return Freemius_Api::GetUrl($path, $this->_api->IsSandbox());
462
- }
463
- /**
464
- * Clear API cache.
465
- *
466
- * @author Vova Feldman (@svovaf)
467
- * @since 1.0.9
468
- */
469
- static function clear_cache() {
470
- self::_init();
471
-
472
- self::$_cache = FS_Cache_Manager::get_manager(WP_FS__API_CACHE_OPTION_NAME);
473
- self::$_cache->clear();
474
- }
475
- #----------------------------------------------------------------------------------
476
- #region Error Handling
477
- #----------------------------------------------------------------------------------
478
- /**
479
- * @author Vova Feldman (@svovaf)
480
- * @since 1.2.1.5
481
- *
482
- * @param mixed $result
483
- *
484
- * @return bool Is API result contains an error.
485
- */
486
- static function is_api_error($result) {
487
- return ( is_object($result) && isset($result->error) ) ||
488
- is_string($result);
489
- }
490
- /**
491
- * Checks if given API result is a non-empty and not an error object.
492
- *
493
- * @author Vova Feldman (@svovaf)
494
- * @since 1.2.1.5
495
- *
496
- * @param mixed $result
497
- * @param string|null $required_property Optional property we want to verify that is set.
498
- *
499
- * @return bool
500
- */
501
- static function is_api_result_object($result, $required_property = null) {
502
- return (
503
- is_object($result) &&
504
- !isset($result->error) &&
505
- ( empty($required_property) || isset($result->{$required_property}) )
506
- );
507
- }
508
- /**
509
- * Checks if given API result is a non-empty entity object with non-empty ID.
510
- *
511
- * @author Vova Feldman (@svovaf)
512
- * @since 1.2.1.5
513
- *
514
- * @param mixed $result
515
- *
516
- * @return bool
517
- */
518
- static function is_api_result_entity($result) {
519
- return self::is_api_result_object($result, 'id') &&
520
- FS_Entity::is_valid_id($result->id);
521
- }
522
- #endregion
523
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/class-fs-logger.php DELETED
@@ -1,629 +0,0 @@
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
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- class FS_Logger {
12
- private $_id;
13
- private $_on = false;
14
- private $_echo = false;
15
- private $_file_start = 0;
16
- /**
17
- * @var int PHP Process ID.
18
- */
19
- private static $_processID;
20
- /**
21
- * @var string PHP Script user name.
22
- */
23
- private static $_ownerName;
24
- /**
25
- * @var bool Is storage logging turned on.
26
- */
27
- private static $_isStorageLoggingOn;
28
- /**
29
- * @var int ABSPATH length.
30
- */
31
- private static $_abspathLength;
32
- private static $LOGGERS = array();
33
- private static $LOG = array();
34
- private static $CNT = 0;
35
- private static $_HOOKED_FOOTER = false;
36
- private function __construct($id, $on = false, $echo = false) {
37
- $this->_id = $id;
38
-
39
- $bt = debug_backtrace();
40
- $caller = $bt[2];
41
-
42
- if (false !== strpos($caller['file'], 'plugins')) {
43
- $this->_file_start = strpos($caller['file'], 'plugins') + strlen('plugins/');
44
- } else {
45
- $this->_file_start = strpos($caller['file'], 'themes') + strlen('themes/');
46
- }
47
-
48
- if ($on) {
49
- $this->on();
50
- }
51
- if ($echo) {
52
- $this->echo_on();
53
- }
54
- }
55
- /**
56
- * @param string $id
57
- * @param bool $on
58
- * @param bool $echo
59
- *
60
- * @return FS_Logger
61
- */
62
- public static function get_logger($id, $on = false, $echo = false) {
63
- $id = strtolower($id);
64
-
65
- if (!isset(self::$_processID)) {
66
- self::init();
67
- }
68
-
69
- if (!isset(self::$LOGGERS[$id])) {
70
- self::$LOGGERS[$id] = new FS_Logger($id, $on, $echo);
71
- }
72
-
73
- return self::$LOGGERS[$id];
74
- }
75
- /**
76
- * Initialize logging global info.
77
- *
78
- * @author Vova Feldman (@svovaf)
79
- * @since 1.2.1.6
80
- */
81
- private static function init() {
82
- self::$_ownerName = function_exists('get_current_user') ?
83
- get_current_user() :
84
- 'unknown';
85
- self::$_isStorageLoggingOn = ( 1 == get_option('fs_storage_logger', 0) );
86
- self::$_abspathLength = strlen(ABSPATH);
87
- self::$_processID = mt_rand(0, 32000);
88
-
89
- // Process ID may be `false` on errors.
90
- if (!is_numeric(self::$_processID)) {
91
- self::$_processID = 0;
92
- }
93
- }
94
- private static function hook_footer() {
95
- if (self::$_HOOKED_FOOTER) {
96
- return;
97
- }
98
-
99
- if (is_admin()) {
100
- add_action('admin_footer', 'FS_Logger::dump', 100);
101
- } else {
102
- add_action('wp_footer', 'FS_Logger::dump', 100);
103
- }
104
- }
105
- function is_on() {
106
- return $this->_on;
107
- }
108
- function on() {
109
- $this->_on = true;
110
-
111
- if (!function_exists('dbDelta')) {
112
- require_once ABSPATH . 'wp-admin/includes/upgrade.php';
113
- }
114
-
115
- self::hook_footer();
116
- }
117
- function echo_on() {
118
- $this->on();
119
-
120
- $this->_echo = true;
121
- }
122
- function is_echo_on() {
123
- return $this->_echo;
124
- }
125
- function get_id() {
126
- return $this->_id;
127
- }
128
- function get_file() {
129
- return $this->_file_start;
130
- }
131
- private function _log(&$message, $type = 'log', $wrapper) {
132
- if (!$this->is_on()) {
133
- return;
134
- }
135
-
136
- $bt = debug_backtrace();
137
- $depth = $wrapper ? 3 : 2;
138
- while ($depth < count($bt) - 1 && 'eval' === $bt[$depth]['function']) {
139
- $depth ++;
140
- }
141
-
142
- $caller = $bt[$depth];
143
-
144
- /**
145
- * Retrieve the correct call file & line number from backtrace
146
- * when logging from a wrapper method.
147
- *
148
- * @author Vova Feldman
149
- * @since 1.2.1.6
150
- */
151
- if (empty($caller['line'])) {
152
- $depth --;
153
-
154
- while ($depth >= 0) {
155
- if (!empty($bt[$depth]['line'])) {
156
- $caller['line'] = $bt[$depth]['line'];
157
- $caller['file'] = $bt[$depth]['file'];
158
- break;
159
- }
160
- }
161
- }
162
-
163
- $log = array_merge($caller, array(
164
- 'cnt' => self::$CNT ++,
165
- 'logger' => $this,
166
- 'timestamp' => microtime(true),
167
- 'log_type' => $type,
168
- 'msg' => $message,
169
- ));
170
-
171
- if (self::$_isStorageLoggingOn) {
172
- $this->db_log($type, $message, self::$CNT, $caller);
173
- }
174
-
175
- self::$LOG[] = $log;
176
-
177
- if ($this->is_echo_on() && !Freemius::is_ajax()) {
178
- echo self::format_html($log) . "\n";
179
- }
180
- }
181
- function log($message, $wrapper = false) {
182
- $this->_log($message, 'log', $wrapper);
183
- }
184
- function info($message, $wrapper = false) {
185
- $this->_log($message, 'info', $wrapper);
186
- }
187
- function warn($message, $wrapper = false) {
188
- $this->_log($message, 'warn', $wrapper);
189
- }
190
- function error($message, $wrapper = false) {
191
- $this->_log($message, 'error', $wrapper);
192
- }
193
- /**
194
- * Log API error.
195
- *
196
- * @author Vova Feldman (@svovaf)
197
- * @since 1.2.1.5
198
- *
199
- * @param mixed $api_result
200
- * @param bool $wrapper
201
- */
202
- function api_error($api_result, $wrapper = false) {
203
- $message = '';
204
- if (is_object($api_result) && isset($api_result->error)) {
205
- $message = $api_result->error->message;
206
- } else if (is_object($api_result)) {
207
- $message = var_export($api_result, true);
208
- } else if (is_string($api_result)) {
209
- $message = $api_result;
210
- } else if (empty($api_result)) {
211
- $message = 'Empty API result.';
212
- }
213
-
214
- $message = 'API Error: ' . $message;
215
-
216
- $this->_log($message, 'error', $wrapper);
217
- }
218
- function entrance($message = '', $wrapper = false) {
219
- $msg = 'Entrance' . ( empty($message) ? '' : ' > ' ) . $message;
220
-
221
- $this->_log($msg, 'log', $wrapper);
222
- }
223
- function departure($message = '', $wrapper = false) {
224
- $msg = 'Departure' . ( empty($message) ? '' : ' > ' ) . $message;
225
-
226
- $this->_log($msg, 'log', $wrapper);
227
- }
228
- #--------------------------------------------------------------------------------
229
- #region Log Formatting
230
- #--------------------------------------------------------------------------------
231
- private static function format($log, $show_type = true) {
232
- return '[' . str_pad($log['cnt'], strlen(self::$CNT), '0', STR_PAD_LEFT) . '] [' . $log['logger']->_id . '] ' . ( $show_type ? '[' . $log['log_type'] . ']' : '' ) . (!empty($log['class']) ? $log['class'] . $log['type'] : '' ) . $log['function'] . ' >> ' . $log['msg'] . ( isset($log['file']) ? ' (' . substr($log['file'], $log['logger']->_file_start) . ' ' . $log['line'] . ') ' : '' ) . ' [' . $log['timestamp'] . ']';
233
- }
234
- private static function format_html($log) {
235
- return '<div style="font-size: 13px; font-family: monospace; color: #7da767; padding: 8px 3px; background: #000; border-bottom: 1px solid #555;">[' . $log['cnt'] . '] [' . $log['logger']->_id . '] [' . $log['log_type'] . '] <b><code style="color: #c4b1e0;">' . (!empty($log['class']) ? $log['class'] . $log['type'] : '' ) . $log['function'] . '</code> >> <b style="color: #f59330;">' . esc_html($log['msg']) . '</b></b>' . ( isset($log['file']) ? ' (' . substr($log['file'], $log['logger']->_file_start) . ' ' . $log['line'] . ')' : '' ) . ' [' . $log['timestamp'] . ']</div>';
236
- }
237
- #endregion
238
- static function dump() {
239
- ?>
240
- <!-- BEGIN: Freemius PHP Console Log -->
241
- <script type="text/javascript">
242
- <?php
243
- foreach (self::$LOG as $log) {
244
- echo 'console.' . $log['log_type'] . '(' . json_encode(self::format($log, false)) . ')' . "\n";
245
- }
246
- ?>
247
- </script>
248
- <!-- END: Freemius PHP Console Log -->
249
- <?php
250
- }
251
- static function get_log() {
252
- return self::$LOG;
253
- }
254
- #--------------------------------------------------------------------------------
255
- #region Database Logging
256
- #--------------------------------------------------------------------------------
257
- /**
258
- * @author Vova Feldman (@svovaf)
259
- * @since 1.2.1.6
260
- *
261
- * @return bool
262
- */
263
- public static function is_storage_logging_on() {
264
- if (!isset(self::$_isStorageLoggingOn)) {
265
- self::$_isStorageLoggingOn = ( 1 == get_option('fs_storage_logger', 0) );
266
- }
267
-
268
- return self::$_isStorageLoggingOn;
269
- }
270
- /**
271
- * Turns on/off database persistent debugging to capture
272
- * multi-session logs to debug complex flows like
273
- * plugin auto-deactivate on premium version activation.
274
- *
275
- * @todo Check if Theme Check has issues with DB tables for themes.
276
- *
277
- * @author Vova Feldman (@svovaf)
278
- * @since 1.2.1.6
279
- *
280
- * @param bool $is_on
281
- *
282
- * @return bool
283
- */
284
- public static function _set_storage_logging($is_on = true) {
285
- global $wpdb;
286
-
287
- $table = "{$wpdb->prefix}fs_logger";
288
-
289
- if ($is_on) {
290
- /**
291
- * Create logging table.
292
- *
293
- * NOTE:
294
- * dbDelta must use KEY and not INDEX for indexes.
295
- *
296
- * @link https://core.trac.wordpress.org/ticket/2695
297
- */
298
- $result = $wpdb->query("CREATE TABLE {$table} (
299
- `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
300
- `process_id` INT UNSIGNED NOT NULL,
301
- `user_name` VARCHAR(64) NOT NULL,
302
- `logger` VARCHAR(128) NOT NULL,
303
- `log_order` INT UNSIGNED NOT NULL,
304
- `type` ENUM('log','info','warn','error') NOT NULL DEFAULT 'log',
305
- `message` TEXT NOT NULL,
306
- `file` VARCHAR(256) NOT NULL,
307
- `line` INT UNSIGNED NOT NULL,
308
- `function` VARCHAR(256) NOT NULL,
309
- `request_type` ENUM('call','ajax','cron') NOT NULL DEFAULT 'call',
310
- `request_url` VARCHAR(1024) NOT NULL,
311
- `created` DECIMAL(16, 6) NOT NULL,
312
- PRIMARY KEY (`id`),
313
- KEY `process_id` (`process_id` ASC),
314
- KEY `process_logger` (`process_id` ASC, `logger` ASC),
315
- KEY `function` (`function` ASC),
316
- KEY `type` (`type` ASC))");
317
- } else {
318
- /**
319
- * Drop logging table.
320
- */
321
- $result = $wpdb->query("DROP TABLE IF EXISTS $table;");
322
- }
323
-
324
- if (false !== $result) {
325
- update_option('fs_storage_logger', ( $is_on ? 1 : 0));
326
- }
327
-
328
- return ( false !== $result );
329
- }
330
- /**
331
- * @author Vova Feldman (@svovaf)
332
- * @since 1.2.1.6
333
- *
334
- * @param string $type
335
- * @param string $message
336
- * @param int $log_order
337
- * @param array $caller
338
- *
339
- * @return false|int
340
- */
341
- private function db_log(
342
- &$type, &$message, &$log_order, &$caller
343
- ) {
344
- global $wpdb;
345
-
346
- $request_type = 'call';
347
- if (defined('DOING_CRON') && DOING_CRON) {
348
- $request_type = 'cron';
349
- } else if (defined('DOING_AJAX') && DOING_AJAX) {
350
- $request_type = 'ajax';
351
- }
352
-
353
- $request_url = WP_FS__IS_HTTP_REQUEST ?
354
- $_SERVER['REQUEST_URI'] :
355
- '';
356
-
357
- return $wpdb->insert(
358
- "{$wpdb->prefix}fs_logger", array(
359
- 'process_id' => self::$_processID,
360
- 'user_name' => self::$_ownerName,
361
- 'logger' => $this->_id,
362
- 'log_order' => $log_order,
363
- 'type' => $type,
364
- 'request_type' => $request_type,
365
- 'request_url' => $request_url,
366
- 'message' => $message,
367
- 'file' => isset($caller['file']) ?
368
- substr($caller['file'], self::$_abspathLength) :
369
- '',
370
- 'line' => $caller['line'],
371
- 'function' => (!empty($caller['class']) ? $caller['class'] . $caller['type'] : '' ) . $caller['function'],
372
- 'created' => microtime(true),
373
- )
374
- );
375
- }
376
- /**
377
- * Persistent DB logger columns.
378
- *
379
- * @var array
380
- */
381
- private static $_log_columns = array(
382
- 'id',
383
- 'process_id',
384
- 'user_name',
385
- 'logger',
386
- 'log_order',
387
- 'type',
388
- 'message',
389
- 'file',
390
- 'line',
391
- 'function',
392
- 'request_type',
393
- 'request_url',
394
- 'created',
395
- );
396
- /**
397
- * Create DB logs query.
398
- *
399
- * @author Vova Feldman (@svovaf)
400
- * @since 1.2.1.6
401
- *
402
- * @param bool $filters
403
- * @param int $limit
404
- * @param int $offset
405
- * @param bool $order
406
- * @param bool $escape_eol
407
- *
408
- * @return string
409
- */
410
- private static function build_db_logs_query(
411
- $filters = false, $limit = 200, $offset = 0, $order = false, $escape_eol = false
412
- ) {
413
- global $wpdb;
414
-
415
- $select = '*';
416
-
417
- if ($escape_eol) {
418
- $select = '';
419
- for ($i = 0, $len = count(self::$_log_columns); $i < $len; $i ++) {
420
- if ($i > 0) {
421
- $select .= ', ';
422
- }
423
-
424
- if ('message' !== self::$_log_columns[$i]) {
425
- $select .= self::$_log_columns[$i];
426
- } else {
427
- $select .= 'REPLACE(message , \'\n\', \' \') AS message';
428
- }
429
- }
430
- }
431
-
432
- $query = "SELECT {$select} FROM {$wpdb->prefix}fs_logger";
433
- if (is_array($filters)) {
434
- $criteria = array();
435
-
436
- if (!empty($filters['type']) && 'all' !== $filters['type']) {
437
- $filters['type'] = strtolower($filters['type']);
438
-
439
- switch ($filters['type']) {
440
- case 'warn_error':
441
- $criteria[] = array('col' => 'type', 'val' => array('warn', 'error'));
442
- break;
443
- case 'error':
444
- case 'warn':
445
- $criteria[] = array('col' => 'type', 'val' => $filters['type']);
446
- break;
447
- case 'info':
448
- default:
449
- $criteria[] = array('col' => 'type', 'val' => array('info', 'log'));
450
- break;
451
- }
452
- }
453
-
454
- if (!empty($filters['request_type'])) {
455
- $filters['request_type'] = strtolower($filters['request_type']);
456
-
457
- if (in_array($filters['request_type'], array('call', 'ajax', 'cron'))) {
458
- $criteria[] = array('col' => 'request_type', 'val' => $filters['request_type']);
459
- }
460
- }
461
-
462
- if (!empty($filters['file'])) {
463
- $criteria[] = array(
464
- 'col' => 'file',
465
- 'op' => 'LIKE',
466
- 'val' => '%' . esc_sql($filters['file']),
467
- );
468
- }
469
-
470
- if (!empty($filters['function'])) {
471
- $criteria[] = array(
472
- 'col' => 'function',
473
- 'op' => 'LIKE',
474
- 'val' => '%' . esc_sql($filters['function']),
475
- );
476
- }
477
-
478
- if (!empty($filters['process_id']) && is_numeric($filters['process_id'])) {
479
- $criteria[] = array('col' => 'process_id', 'val' => $filters['process_id']);
480
- }
481
-
482
- if (!empty($filters['logger'])) {
483
- $criteria[] = array(
484
- 'col' => 'logger',
485
- 'op' => 'LIKE',
486
- 'val' => '%' . esc_sql($filters['logger']) . '%',
487
- );
488
- }
489
-
490
- if (!empty($filters['message'])) {
491
- $criteria[] = array(
492
- 'col' => 'message',
493
- 'op' => 'LIKE',
494
- 'val' => '%' . esc_sql($filters['message']) . '%',
495
- );
496
- }
497
-
498
- if (0 < count($criteria)) {
499
- $query .= "\nWHERE\n";
500
-
501
- $first = true;
502
- foreach ($criteria as $c) {
503
- if (!$first) {
504
- $query .= "AND\n";
505
- }
506
-
507
- if (is_array($c['val'])) {
508
- $operator = 'IN';
509
-
510
- for ($i = 0, $len = count($c['val']); $i < $len; $i ++) {
511
- $c['val'][$i] = "'" . esc_sql($c['val'][$i]) . "'";
512
- }
513
-
514
- $val = '(' . implode(',', $c['val']) . ')';
515
- } else {
516
- $operator = !empty($c['op']) ? $c['op'] : '=';
517
- $val = "'" . esc_sql($c['val']) . "'";
518
- }
519
-
520
- $query .= "`{$c['col']}` {$operator} {$val}\n";
521
-
522
- $first = false;
523
- }
524
- }
525
- }
526
-
527
- if (!is_array($order)) {
528
- $order = array(
529
- 'col' => 'id',
530
- 'order' => 'desc'
531
- );
532
- }
533
-
534
- $query .= " ORDER BY {$order['col']} {$order['order']} LIMIT {$offset},{$limit}";
535
-
536
- return $query;
537
- }
538
- /**
539
- * Load logs from DB.
540
- *
541
- * @author Vova Feldman (@svovaf)
542
- * @since 1.2.1.6
543
- *
544
- * @param bool $filters
545
- * @param int $limit
546
- * @param int $offset
547
- * @param bool $order
548
- *
549
- * @return object[]|null
550
- */
551
- public static function load_db_logs(
552
- $filters = false, $limit = 200, $offset = 0, $order = false
553
- ) {
554
- global $wpdb;
555
-
556
- $query = self::build_db_logs_query(
557
- $filters, $limit, $offset, $order
558
- );
559
-
560
- return $wpdb->get_results($query);
561
- }
562
- /**
563
- * Load logs from DB.
564
- *
565
- * @author Vova Feldman (@svovaf)
566
- * @since 1.2.1.6
567
- *
568
- * @param bool $filters
569
- * @param string $filename
570
- * @param int $limit
571
- * @param int $offset
572
- * @param bool $order
573
- *
574
- * @return false|string File download URL or false on failure.
575
- */
576
- public static function download_db_logs(
577
- $filters = false, $filename = '', $limit = 10000, $offset = 0, $order = false
578
- ) {
579
- global $wpdb;
580
-
581
- $query = self::build_db_logs_query(
582
- $filters, $limit, $offset, $order, true
583
- );
584
-
585
- $upload_dir = wp_upload_dir();
586
- if (empty($filename)) {
587
- $filename = 'fs-logs-' . date('Y-m-d_H-i-s', WP_FS__SCRIPT_START_TIME) . '.csv';
588
- }
589
- $filepath = rtrim($upload_dir['path'], '/') . "/{$filename}";
590
-
591
- $query .= " INTO OUTFILE '{$filepath}' FIELDS TERMINATED BY '\t' ESCAPED BY '\\\\' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\\n'";
592
-
593
- $columns = '';
594
- for ($i = 0, $len = count(self::$_log_columns); $i < $len; $i ++) {
595
- if ($i > 0) {
596
- $columns .= ', ';
597
- }
598
-
599
- $columns .= "'" . self::$_log_columns[$i] . "'";
600
- }
601
-
602
- $query = "SELECT {$columns} UNION ALL " . $query;
603
-
604
- $result = $wpdb->query($query);
605
-
606
- if (false === $result) {
607
- return false;
608
- }
609
-
610
- return rtrim($upload_dir['url'], '/') . '/' . $filename;
611
- }
612
- /**
613
- * @author Vova Feldman (@svovaf)
614
- * @since 1.2.1.6
615
- *
616
- * @param string $filename
617
- *
618
- * @return string
619
- */
620
- public static function get_logs_download_url($filename = '') {
621
- $upload_dir = wp_upload_dir();
622
- if (empty($filename)) {
623
- $filename = 'fs-logs-' . date('Y-m-d_H-i-s', WP_FS__SCRIPT_START_TIME) . '.csv';
624
- }
625
-
626
- return rtrim($upload_dir['url'], '/') . $filename;
627
- }
628
- #endregion
629
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/class-fs-plugin-updater.php DELETED
@@ -1,656 +0,0 @@
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.4
7
- *
8
- * @link https://github.com/easydigitaldownloads/EDD-License-handler/blob/master/EDD_SL_Plugin_Updater.php
9
- */
10
- if (!defined('ABSPATH')) {
11
- exit;
12
- }
13
- // Uncomment this line for testing.
14
- // set_site_transient( 'update_plugins', null );
15
-
16
- class FS_Plugin_Updater {
17
- /**
18
- * @var Freemius
19
- * @since 1.0.4
20
- */
21
- private $_fs;
22
- /**
23
- * @var FS_Logger
24
- * @since 1.0.4
25
- */
26
- private $_logger;
27
- /**
28
- * @var object
29
- * @since 1.1.8.1
30
- */
31
- private $_update_details;
32
- function __construct(Freemius $freemius) {
33
- $this->_fs = $freemius;
34
-
35
- $this->_logger = FS_Logger::get_logger(WP_FS__SLUG . '_' . $freemius->get_slug() . '_updater', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK);
36
-
37
- $this->_filters();
38
- }
39
- /**
40
- * Initiate required filters.
41
- *
42
- * @author Vova Feldman (@svovaf)
43
- * @since 1.0.4
44
- */
45
- private function _filters() {
46
- // Override request for plugin information
47
- add_filter('plugins_api', array(&$this, 'plugins_api_filter'), 10, 3);
48
-
49
- // WP 3.0+
50
- add_filter('pre_set_site_transient_update_plugins', array(
51
- &$this,
52
- 'pre_set_site_transient_update_plugins_filter'
53
- ));
54
-
55
- if (!$this->_fs->has_active_valid_license()) {
56
- /**
57
- * If user has the premium plugin's code but do NOT have an active license,
58
- * encourage him to upgrade by showing that there's a new release, but instead
59
- * of showing an update link, show upgrade link to the pricing page.
60
- *
61
- * @since 1.1.6
62
- *
63
- */
64
- // WP 2.9+
65
- add_action("after_plugin_row_{$this->_fs->get_plugin_basename()}", array(
66
- &$this,
67
- 'catch_plugin_update_row'
68
- ), 9);
69
- add_action("after_plugin_row_{$this->_fs->get_plugin_basename()}", array(
70
- &$this,
71
- 'edit_and_echo_plugin_update_row'
72
- ), 11, 2);
73
- }
74
-
75
- if (!WP_FS__IS_PRODUCTION_MODE) {
76
- add_filter('http_request_host_is_external', array(
77
- $this,
78
- 'http_request_host_is_external_filter'
79
- ), 10, 3);
80
- }
81
-
82
- if ($this->_fs->is_premium() && $this->is_correct_folder_name()) {
83
- add_filter('upgrader_post_install', array(&$this, '_maybe_update_folder_name'), 10, 3);
84
- }
85
- }
86
- /**
87
- * Capture plugin update row by turning output buffering.
88
- *
89
- * @author Vova Feldman (@svovaf)
90
- * @since 1.1.6
91
- */
92
- function catch_plugin_update_row() {
93
- ob_start();
94
- }
95
- /**
96
- * Overrides default update message format with "renew your license" message.
97
- *
98
- * @author Vova Feldman (@svovaf)
99
- * @since 1.1.6
100
- *
101
- * @param string $file
102
- * @param array $plugin_data
103
- */
104
- function edit_and_echo_plugin_update_row($file, $plugin_data) {
105
- $plugin_update_row = ob_get_clean();
106
-
107
- $current = get_site_transient('update_plugins');
108
- if (!isset($current->response[$file])) {
109
- echo $plugin_update_row;
110
-
111
- return;
112
- }
113
-
114
- $r = $current->response[$file];
115
-
116
- $plugin_update_row = preg_replace(
117
- '/(\<div.+>)(.+)(\<a.+\<a.+)\<\/div\>/is', '$1 $2 ' . sprintf(
118
- $this->_fs->get_text('renew-license-now'), '<a href="' . $this->_fs->pricing_url() . '">', '</a>', $r->new_version) .
119
- '$4', $plugin_update_row
120
- );
121
-
122
- echo $plugin_update_row;
123
- }
124
- /**
125
- * Since WP version 3.6, a new security feature was added that denies access to repository with a local ip.
126
- * During development mode we want to be able updating plugin versions via our localhost repository. This
127
- * filter white-list all domains including "api.freemius".
128
- *
129
- * @link http://www.emanueletessore.com/wordpress-download-failed-valid-url-provided/
130
- *
131
- * @author Vova Feldman (@svovaf)
132
- * @since 1.0.4
133
- *
134
- * @param bool $allow
135
- * @param string $host
136
- * @param string $url
137
- *
138
- * @return bool
139
- */
140
- function http_request_host_is_external_filter($allow, $host, $url) {
141
- return ( false !== strpos($host, 'freemius') ) ? true : $allow;
142
- }
143
- /**
144
- * Check for Updates at the defined API endpoint and modify the update array.
145
- *
146
- * This function dives into the update api just when WordPress creates its update array,
147
- * then adds a custom API call and injects the custom plugin data retrieved from the API.
148
- * It is reassembled from parts of the native WordPress plugin update code.
149
- * See wp-includes/update.php line 121 for the original wp_update_plugins() function.
150
- *
151
- * @author Vova Feldman (@svovaf)
152
- * @since 1.0.4
153
- *
154
- * @uses FS_Api
155
- *
156
- * @param object $transient_data Update array build by WordPress.
157
- *
158
- * @return object Modified update array with custom plugin data.
159
- */
160
- function pre_set_site_transient_update_plugins_filter($transient_data) {
161
- $this->_logger->entrance();
162
-
163
- if (empty($transient_data) ||
164
- defined('WP_FS__UNINSTALL_MODE')
165
- ) {
166
- return $transient_data;
167
- }
168
-
169
- if (!isset($this->_update_details)) {
170
- // Get plugin's newest update.
171
- $new_version = $this->_fs->get_update(false, false);
172
-
173
- $this->_update_details = false;
174
-
175
- if (is_object($new_version)) {
176
- $this->_logger->log('Found newer plugin version ' . $new_version->version);
177
-
178
- $plugin_details = new stdClass();
179
- $plugin_details->slug = $this->_fs->get_slug();
180
- $plugin_details->new_version = $new_version->version;
181
- $plugin_details->url = WP_FS__ADDRESS;
182
- $plugin_details->package = $new_version->url;
183
- $plugin_details->plugin = $this->_fs->get_plugin_basename();
184
-
185
- /**
186
- * Cache plugin details locally since set_site_transient( 'update_plugins' )
187
- * called multiple times and the non wp.org plugins are filtered after the
188
- * call to .org.
189
- *
190
- * @since 1.1.8.1
191
- */
192
- $this->_update_details = $plugin_details;
193
- }
194
- }
195
-
196
- if (is_object($this->_update_details)) {
197
- // Add plugin to transient data.
198
- $transient_data->response[$this->_fs->get_plugin_basename()] = $this->_update_details;
199
- }
200
-
201
- return $transient_data;
202
- }
203
- /**
204
- * Try to fetch plugin's info from .org repository.
205
- *
206
- * @author Vova Feldman (@svovaf)
207
- * @since 1.0.5
208
- *
209
- * @param string $action
210
- * @param object $args
211
- *
212
- * @return bool|mixed
213
- */
214
- static function _fetch_plugin_info_from_repository($action, $args) {
215
- $url = $http_url = 'http://api.wordpress.org/plugins/info/1.0/';
216
- if ($ssl = wp_http_supports(array('ssl'))) {
217
- $url = set_url_scheme($url, 'https');
218
- }
219
-
220
- $args = array(
221
- 'timeout' => 15,
222
- 'body' => array(
223
- 'action' => $action,
224
- 'request' => serialize($args)
225
- )
226
- );
227
-
228
- $request = wp_remote_post($url, $args);
229
-
230
- if (is_wp_error($request)) {
231
- return false;
232
- }
233
-
234
- $res = maybe_unserialize(wp_remote_retrieve_body($request));
235
-
236
- if (!is_object($res) && !is_array($res)) {
237
- return false;
238
- }
239
-
240
- return $res;
241
- }
242
- /**
243
- * Updates information on the "View version x.x details" page with custom data.
244
- *
245
- * @author Vova Feldman (@svovaf)
246
- * @since 1.0.4
247
- *
248
- * @uses FS_Api
249
- *
250
- * @param object $data
251
- * @param string $action
252
- * @param mixed $args
253
- *
254
- * @return object
255
- */
256
- function plugins_api_filter($data, $action = '', $args = null) {
257
- $this->_logger->entrance();
258
-
259
- if (( 'plugin_information' !== $action ) ||
260
- !isset($args->slug)
261
- ) {
262
- return $data;
263
- }
264
-
265
- $addon = false;
266
- $is_addon = false;
267
-
268
- if ($this->_fs->get_slug() !== $args->slug) {
269
- $addon = $this->_fs->get_addon_by_slug($args->slug);
270
-
271
- if (!is_object($addon)) {
272
- return $data;
273
- }
274
-
275
- $is_addon = true;
276
- }
277
-
278
- $plugin_in_repo = false;
279
- if (!$is_addon) {
280
- // Try to fetch info from .org repository.
281
- $data = self::_fetch_plugin_info_from_repository($action, $args);
282
-
283
- $plugin_in_repo = ( false !== $data );
284
- }
285
-
286
- if (!$plugin_in_repo) {
287
- $data = $args;
288
-
289
- // Fetch as much as possible info from local files.
290
- $plugin_local_data = $this->_fs->get_plugin_data();
291
- $data->name = $plugin_local_data['Name'];
292
- $data->author = $plugin_local_data['Author'];
293
- $data->sections = array(
294
- 'description' => 'Upgrade ' . $plugin_local_data['Name'] . ' to latest.',
295
- );
296
-
297
- // @todo Store extra plugin info on Freemius or parse readme.txt markup.
298
- /* $info = $this->_fs->get_api_site_scope()->call('/information.json');
299
-
300
- if ( !isset($info->error) ) {
301
- $data = $info;
302
- } */
303
- }
304
-
305
- // Get plugin's newest update.
306
- $new_version = $this->get_latest_download_details($is_addon ? $addon->id : false);
307
-
308
- if (!is_object($new_version) || empty($new_version->version)) {
309
- $data->version = $this->_fs->get_plugin_version();
310
- } else {
311
- if ($is_addon) {
312
- $data->name = $addon->title . ' ' . $this->_fs->get_text('addon');
313
- $data->slug = $addon->slug;
314
- $data->url = WP_FS__ADDRESS;
315
- $data->package = $new_version->url;
316
- }
317
-
318
- if (!$plugin_in_repo) {
319
- $data->last_updated = !is_null($new_version->updated) ? $new_version->updated : $new_version->created;
320
- $data->requires = $new_version->requires_platform_version;
321
- $data->tested = $new_version->tested_up_to_version;
322
- }
323
-
324
- $data->version = $new_version->version;
325
- $data->download_link = $new_version->url;
326
- }
327
-
328
- return $data;
329
- }
330
- /**
331
- * @author Vova Feldman (@svovaf)
332
- * @since 1.2.1.7
333
- *
334
- * @param number|bool $addon_id
335
- *
336
- * @return object
337
- */
338
- private function get_latest_download_details($addon_id = false) {
339
- return $this->_fs->_fetch_latest_version($addon_id);
340
- }
341
- /**
342
- * Checks if a given basename has a matching folder name
343
- * with the current context plugin.
344
- *
345
- * @author Vova Feldman (@svovaf)
346
- * @since 1.2.1.6
347
- *
348
- * @param string $basename Current plugin's basename.
349
- *
350
- * @return bool
351
- */
352
- private function is_correct_folder_name($basename = '') {
353
- if (empty($basename)) {
354
- $basename = $this->_fs->get_plugin_basename();
355
- }
356
-
357
- return ( $this->_fs->get_target_folder_name() != trim(dirname($basename), '/\\') );
358
- }
359
- /**
360
- * This is a special after upgrade handler for migrating modules
361
- * that didn't use the '-premium' suffix folder structure before
362
- * the migration.
363
- *
364
- * @author Vova Feldman (@svovaf)
365
- * @since 1.2.1.6
366
- *
367
- * @param bool $response Install response.
368
- * @param array $hook_extra Extra arguments passed to hooked filters.
369
- * @param array $result Installation result data.
370
- *
371
- * @return bool
372
- */
373
- function _maybe_update_folder_name($response, $hook_extra, $result) {
374
- $basename = $this->_fs->get_plugin_basename();
375
-
376
- if (true !== $response ||
377
- empty($hook_extra) ||
378
- empty($hook_extra['plugin']) ||
379
- $basename !== $hook_extra['plugin']
380
- ) {
381
- return $response;
382
- }
383
-
384
- $active_plugins_basenames = get_option('active_plugins');
385
-
386
- for ($i = 0, $len = count($active_plugins_basenames); $i < $len; $i ++) {
387
- if ($basename === $active_plugins_basenames[$i]) {
388
- // Get filename including extension.
389
- $filename = basename($basename);
390
-
391
- $new_basename = plugin_basename(
392
- trailingslashit($this->_fs->get_slug() . ( $this->_fs->is_premium() ? '-premium' : '' )) .
393
- $filename
394
- );
395
-
396
- // Verify that the expected correct path exists.
397
- if (file_exists(fs_normalize_path(WP_PLUGIN_DIR . '/' . $new_basename))) {
398
- // Override active plugin name.
399
- $active_plugins_basenames[$i] = $new_basename;
400
- update_option('active_plugins', $active_plugins_basenames);
401
- }
402
-
403
- break;
404
- }
405
- }
406
-
407
- return $response;
408
- }
409
- #----------------------------------------------------------------------------------
410
- #region Auto Activation
411
- #----------------------------------------------------------------------------------
412
- /**
413
- * Installs and active a plugin when explicitly requested that from a 3rd party service.
414
- *
415
- * This logic was inspired by the TGMPA GPL licensed library by Thomas Griffin.
416
- *
417
- * @link http://tgmpluginactivation.com/
418
- *
419
- * @author Vova Feldman
420
- * @since 1.2.1.7
421
- *
422
- * @link https://make.wordpress.org/plugins/2017/03/16/clarification-of-guideline-8-executable-code-and-installs/
423
- *
424
- * @uses WP_Filesystem
425
- * @uses WP_Error
426
- * @uses WP_Upgrader
427
- * @uses Plugin_Upgrader
428
- * @uses Plugin_Installer_Skin
429
- * @uses Plugin_Upgrader_Skin
430
- *
431
- * @param number|bool $plugin_id
432
- *
433
- * @return array
434
- */
435
- function install_and_activate_plugin($plugin_id = false) {
436
- if (!empty($plugin_id) && !FS_Plugin::is_valid_id($plugin_id)) {
437
- // Invalid plugin ID.
438
- return array(
439
- 'message' => $this->_fs->get_text('auto-install-error-invalid-id'),
440
- 'code' => 'invalid_module_id',
441
- );
442
- }
443
-
444
- $is_addon = false;
445
- if (FS_Plugin::is_valid_id($plugin_id) &&
446
- $plugin_id != $this->_fs->get_id()
447
- ) {
448
- $addon = $this->_fs->get_addon($plugin_id);
449
-
450
- if (!is_object($addon)) {
451
- // Invalid add-on ID.
452
- return array(
453
- 'message' => $this->_fs->get_text('auto-install-error-invalid-id'),
454
- 'code' => 'invalid_module_id',
455
- );
456
- }
457
-
458
- $slug = $addon->slug;
459
- $title = $addon->title . ' ' . $this->_fs->get_text('addon');
460
-
461
- $is_addon = true;
462
- } else {
463
- $slug = $this->_fs->get_slug();
464
- $title = $this->_fs->get_plugin_title() .
465
- ( $this->_fs->is_addon() ? ' ' . $this->_fs->get_text('addon') : '' );
466
- }
467
-
468
- if ($this->is_premium_plugin_active($plugin_id)) {
469
- // Premium version already activated.
470
- return array(
471
- 'message' => $this->_fs->get_text(
472
- $is_addon ?
473
- 'auto-install-error-premium-addon-activated' :
474
- 'auto-install-error-premium-activated'
475
- ),
476
- 'code' => 'premium_installed',
477
- );
478
- }
479
-
480
- $latest_version = $this->get_latest_download_details($plugin_id);
481
- $target_folder = "{$slug}-premium";
482
-
483
- // Prep variables for Plugin_Installer_Skin class.
484
- $extra = array();
485
- $extra['slug'] = $target_folder;
486
- $source = $latest_version->url;
487
- $api = null;
488
-
489
- $install_url = add_query_arg(
490
- array(
491
- 'action' => 'install-plugin',
492
- 'plugin' => urlencode($slug),
493
- ), 'update.php'
494
- );
495
-
496
- if (!class_exists('Plugin_Upgrader', false)) {
497
- // Include required resources for the installation.
498
- require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
499
- }
500
-
501
- $skin_args = array(
502
- 'type' => 'web',
503
- 'title' => sprintf(fs_text('installing-plugin-x', $slug), $title),
504
- 'url' => esc_url_raw($install_url),
505
- 'nonce' => 'install-plugin_' . $slug,
506
- 'plugin' => '',
507
- 'api' => $api,
508
- 'extra' => $extra,
509
- );
510
-
511
- // $skin = new Automatic_Upgrader_Skin( $skin_args );
512
- // $skin = new Plugin_Installer_Skin( $skin_args );
513
- $skin = new WP_Ajax_Upgrader_Skin($skin_args);
514
-
515
- // Create a new instance of Plugin_Upgrader.
516
- $upgrader = new Plugin_Upgrader($skin);
517
-
518
- // Perform the action and install the plugin from the $source urldecode().
519
- add_filter('upgrader_source_selection', array(&$this, '_maybe_adjust_source_dir'), 1, 3);
520
-
521
- $install_result = $upgrader->install($source);
522
-
523
- remove_filter('upgrader_source_selection', array(&$this, '_maybe_adjust_source_dir'), 1);
524
-
525
- if (is_wp_error($install_result)) {
526
- return array(
527
- 'message' => $install_result->get_error_message(),
528
- 'code' => $install_result->get_error_code(),
529
- );
530
- } elseif (is_wp_error($skin->result)) {
531
- return array(
532
- 'message' => $skin->result->get_error_message(),
533
- 'code' => $skin->result->get_error_code(),
534
- );
535
- } elseif ($skin->get_errors()->get_error_code()) {
536
- return array(
537
- 'message' => $skin->get_error_messages(),
538
- 'code' => 'unknown',
539
- );
540
- } elseif (is_null($install_result)) {
541
- global $wp_filesystem;
542
-
543
- $error_code = 'unable_to_connect_to_filesystem';
544
- $error_message = __('Unable to connect to the filesystem. Please confirm your credentials.');
545
-
546
- // Pass through the error from WP_Filesystem if one was raised.
547
- if ($wp_filesystem instanceof WP_Filesystem_Base &&
548
- is_wp_error($wp_filesystem->errors) &&
549
- $wp_filesystem->errors->get_error_code()
550
- ) {
551
- $error_message = $wp_filesystem->errors->get_error_message();
552
- }
553
-
554
- return array(
555
- 'message' => $error_message,
556
- 'code' => $error_code,
557
- );
558
- }
559
-
560
- // Grab the full path to the main plugin's file.
561
- $plugin_activate = $upgrader->plugin_info();
562
-
563
- // Try to activate the plugin.
564
- $activation_result = $this->try_activate_plugin($plugin_activate);
565
-
566
- if (is_wp_error($activation_result)) {
567
- return array(
568
- 'message' => $activation_result->get_error_message(),
569
- 'code' => $activation_result->get_error_code(),
570
- );
571
- }
572
-
573
- return $skin->get_upgrade_messages();
574
- }
575
- /**
576
- * Tries to activate a plugin. If fails, returns the error.
577
- *
578
- * @author Vova Feldman
579
- * @since 1.2.1.7
580
- *
581
- * @param string $file_path Path within wp-plugins/ to main plugin file.
582
- * This determines the styling of the output messages.
583
- *
584
- * @return bool|WP_Error
585
- */
586
- protected function try_activate_plugin($file_path) {
587
- $activate = activate_plugin($file_path);
588
-
589
- return is_wp_error($activate) ?
590
- $activate :
591
- true;
592
- }
593
- /**
594
- * Check if a premium module version is already active.
595
- *
596
- * @author Vova Feldman
597
- * @since 1.2.1.7
598
- *
599
- * @param number|bool $plugin_id
600
- *
601
- * @return bool
602
- */
603
- private function is_premium_plugin_active($plugin_id = false) {
604
- if ($plugin_id != $this->_fs->get_id()) {
605
- return $this->_fs->is_addon_activated($plugin_id, true);
606
- }
607
-
608
- return is_plugin_active($this->_fs->premium_plugin_basename());
609
- }
610
- /**
611
- * Adjust the plugin directory name if necessary.
612
- * Assumes plugin has a folder (not a single file plugin).
613
- *
614
- * The final destination directory of a plugin is based on the subdirectory name found in the
615
- * (un)zipped source. In some cases this subdirectory name is not the same as the expected
616
- * slug and the plugin will not be recognized as installed. This is fixed by adjusting
617
- * the temporary unzipped source subdirectory name to the expected plugin slug.
618
- *
619
- * @author Vova Feldman
620
- * @since 1.2.1.7
621
- *
622
- * @param string $source Path to upgrade/zip-file-name.tmp/subdirectory/.
623
- * @param string $remote_source Path to upgrade/zip-file-name.tmp.
624
- * @param \WP_Upgrader $upgrader Instance of the upgrader which installs the plugin.
625
- *
626
- * @return string|WP_Error
627
- */
628
- function _maybe_adjust_source_dir($source, $remote_source, $upgrader) {
629
- if (!is_object($GLOBALS['wp_filesystem'])) {
630
- return $source;
631
- }
632
-
633
- // Figure out what the slug is supposed to be.
634
- $desired_slug = $upgrader->skin->options['extra']['slug'];
635
-
636
- $subdir_name = untrailingslashit(str_replace(trailingslashit($remote_source), '', $source));
637
-
638
- if (!empty($subdir_name) && $subdir_name !== $desired_slug) {
639
- $from_path = untrailingslashit($source);
640
- $to_path = trailingslashit($remote_source) . $desired_slug;
641
-
642
- if (true === $GLOBALS['wp_filesystem']->move($from_path, $to_path)) {
643
- return trailingslashit($to_path);
644
- } else {
645
- return new WP_Error(
646
- 'rename_failed', $this->_fs->get_text('module-package-rename-failure'), array(
647
- 'found' => $subdir_name,
648
- 'expected' => $desired_slug
649
- ));
650
- }
651
- }
652
-
653
- return $source;
654
- }
655
- #endregion
656
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/class-fs-security.php DELETED
@@ -1,78 +0,0 @@
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
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
-
12
- define('WP_FS__SECURITY_PARAMS_PREFIX', 's_');
13
- /**
14
- * Class FS_Security
15
- */
16
- class FS_Security {
17
- /**
18
- * @var FS_Security
19
- * @since 1.0.3
20
- */
21
- private static $_instance;
22
- /**
23
- * @var FS_Logger
24
- * @since 1.0.3
25
- */
26
- private static $_logger;
27
- /**
28
- * @return \FS_Security
29
- */
30
- public static function instance() {
31
- if (!isset(self::$_instance)) {
32
- self::$_instance = new FS_Security();
33
- self::$_logger = FS_Logger::get_logger(
34
- WP_FS__SLUG, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK
35
- );
36
- }
37
-
38
- return self::$_instance;
39
- }
40
- private function __construct() {
41
-
42
- }
43
- /**
44
- * @param \FS_Scope_Entity $entity
45
- * @param int $timestamp
46
- * @param string $action
47
- *
48
- * @return string
49
- */
50
- function get_secure_token(FS_Scope_Entity $entity, $timestamp, $action = '') {
51
- return md5(
52
- $timestamp .
53
- $entity->id .
54
- $entity->secret_key .
55
- $entity->public_key .
56
- $action
57
- );
58
- }
59
- /**
60
- * @param \FS_Scope_Entity $entity
61
- * @param int|bool $timestamp
62
- * @param string $action
63
- *
64
- * @return array
65
- */
66
- function get_context_params(FS_Scope_Entity $entity, $timestamp = false, $action = '') {
67
- if (false === $timestamp) {
68
- $timestamp = time();
69
- }
70
-
71
- return array(
72
- 's_ctx_type' => $entity->get_type(),
73
- 's_ctx_id' => $entity->id,
74
- 's_ctx_ts' => $timestamp,
75
- 's_ctx_secure' => $this->get_secure_token($entity, $timestamp, $action),
76
- );
77
- }
78
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/debug/class-fs-debug-bar-panel.php DELETED
@@ -1,59 +0,0 @@
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.7.3
7
- */
8
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- /**
12
- * Extends Debug Bar plugin by adding a panel to show all Freemius API requests.
13
- *
14
- * @author Vova Feldman (@svovaf)
15
- * @since 1.1.7.3
16
- *
17
- * Class Freemius_Debug_Bar_Panel
18
- */
19
- class Freemius_Debug_Bar_Panel extends Debug_Bar_Panel {
20
- function init() {
21
- $this->title('Freemius');
22
- }
23
- static function requests_count() {
24
- if (class_exists('Freemius_Api')) {
25
- $logger = Freemius_Api::GetLogger();
26
- } else {
27
- $logger = array();
28
- }
29
-
30
- return number_format(count($logger));
31
- }
32
- static function total_time() {
33
- if (class_exists('Freemius_Api')) {
34
- $logger = Freemius_Api::GetLogger();
35
- } else {
36
- $logger = array();
37
- }
38
-
39
- $total_time = .0;
40
- foreach ($logger as $l) {
41
- $total_time += $l['total'];
42
- }
43
-
44
- return number_format(100 * $total_time, 2) . ' ' . fs_text('ms');
45
- }
46
- function render() {
47
- ?>
48
- <div id='debug-bar-php'>
49
- <?php fs_require_template('/debug/api-calls.php') ?>
50
- <br>
51
- <?php fs_require_template('/debug/scheduled-crons.php') ?>
52
- <br>
53
- <?php fs_require_template('/debug/plugins-themes-sync.php') ?>
54
- <br>
55
- <?php fs_require_template('/debug/logger.php') ?>
56
- </div>
57
- <?php
58
- }
59
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/debug/debug-bar-start.php DELETED
@@ -1,48 +0,0 @@
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.7.3
7
- */
8
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
-
12
- if (!WP_FS__DEBUG_SDK) {
13
- return;
14
- }
15
- /**
16
- * Initialize Freemius custom debug panels.
17
- *
18
- * @param array $panels Debug bar panels objects
19
- *
20
- * @return array Debug bar panels with your custom panels
21
- */
22
- function fs_custom_panels_init($panels) {
23
- if (class_exists('Debug_Bar_Panel')) {
24
- if (FS_API__LOGGER_ON) {
25
- require_once dirname(__FILE__) . '/class-fs-debug-bar-panel.php';
26
- $panels[] = new Freemius_Debug_Bar_Panel();
27
- }
28
- }
29
-
30
- return $panels;
31
- }
32
- function fs_custom_status_init($statuses) {
33
- if (class_exists('Debug_Bar_Panel')) {
34
- if (FS_API__LOGGER_ON) {
35
- require_once dirname(__FILE__) . '/class-fs-debug-bar-panel.php';
36
- $statuses[] = array(
37
- 'fs_api_requests',
38
- fs_text('Freemius API'),
39
- Freemius_Debug_Bar_Panel::requests_count() . ' ' . fs_text('Requests') .
40
- ' (' . Freemius_Debug_Bar_Panel::total_time() . ')'
41
- );
42
- }
43
- }
44
-
45
- return $statuses;
46
- }
47
- add_filter('debug_bar_panels', 'fs_custom_panels_init');
48
- add_filter('debug_bar_statuses', 'fs_custom_status_init');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/debug/index.php DELETED
@@ -1,3 +0,0 @@
1
- <?php
2
- // Silence is golden.
3
- // Hide file structure from users on unprotected servers.
 
 
 
freemius/includes/entities/class-fs-billing.php DELETED
@@ -1,87 +0,0 @@
1
- <?php
2
- /**
3
- * @package Freemius for EDD Add-On
4
- * @copyright Copyright (c) 2016, Freemius, Inc.
5
- * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
- * @since 1.0.0
7
- */
8
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- class FS_Billing extends FS_Entity {
12
- #region Properties
13
- /**
14
- * @var int
15
- */
16
- public $entity_id;
17
- /**
18
- * @var string (Enum) Linked entity type. One of: developer, plugin, user, install
19
- */
20
- public $entity_type;
21
- /**
22
- * @var string
23
- */
24
- public $business_name;
25
- /**
26
- * @var string
27
- */
28
- public $first;
29
- /**
30
- * @var string
31
- */
32
- public $last;
33
- /**
34
- * @var string
35
- */
36
- public $email;
37
- /**
38
- * @var string
39
- */
40
- public $phone;
41
- /**
42
- * @var string
43
- */
44
- public $website;
45
- /**
46
- * @var string Tax or VAT ID.
47
- */
48
- public $tax_id;
49
- /**
50
- * @var string
51
- */
52
- public $address_street;
53
- /**
54
- * @var string
55
- */
56
- public $address_apt;
57
- /**
58
- * @var string
59
- */
60
- public $address_city;
61
- /**
62
- * @var string
63
- */
64
- public $address_country;
65
- /**
66
- * @var string Two chars country code.
67
- */
68
- public $address_country_code;
69
- /**
70
- * @var string
71
- */
72
- public $address_state;
73
- /**
74
- * @var number Numeric ZIP code (cab be with leading zeros).
75
- */
76
- public $address_zip;
77
- #endregion Properties
78
- /**
79
- * @param object|bool $event
80
- */
81
- function __construct($event = false) {
82
- parent::__construct($event);
83
- }
84
- static function get_type() {
85
- return 'billing';
86
- }
87
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/entities/class-fs-entity.php DELETED
@@ -1,139 +0,0 @@
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
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- /**
12
- * Get object's public variables.
13
- *
14
- * @author Vova Feldman (@svovaf)
15
- * @since 1.0.0
16
- *
17
- * @param object $object
18
- *
19
- * @return array
20
- */
21
- function fs_get_object_public_vars($object) {
22
- return get_object_vars($object);
23
- }
24
- class FS_Entity {
25
- /**
26
- * @var number
27
- */
28
- public $id;
29
- /**
30
- * @var string Datetime value in 'YYYY-MM-DD HH:MM:SS' format.
31
- */
32
- public $updated;
33
- /**
34
- * @var string Datetime value in 'YYYY-MM-DD HH:MM:SS' format.
35
- */
36
- public $created;
37
- /**
38
- * @param bool|object $entity
39
- */
40
- function __construct($entity = false) {
41
- if (!( $entity instanceof stdClass )) {
42
- return;
43
- }
44
-
45
- $props = fs_get_object_public_vars($this);
46
-
47
- foreach ($props as $key => $def_value) {
48
- $this->{$key} = isset($entity->{$key}) ?
49
- $entity->{$key} :
50
- $def_value;
51
- }
52
- }
53
- static function get_type() {
54
- return 'type';
55
- }
56
- /**
57
- * @author Vova Feldman (@svovaf)
58
- * @since 1.0.6
59
- *
60
- * @param FS_Entity $entity1
61
- * @param FS_Entity $entity2
62
- *
63
- * @return bool
64
- */
65
- static function equals($entity1, $entity2) {
66
- if (is_null($entity1) && is_null($entity2)) {
67
- return true;
68
- } else if (is_object($entity1) && is_object($entity2)) {
69
- return ( $entity1->id == $entity2->id );
70
- } else if (is_object($entity1)) {
71
- return is_null($entity1->id);
72
- } else {
73
- return is_null($entity2->id);
74
- }
75
- }
76
- private $_is_updated = false;
77
- /**
78
- * Update object property.
79
- *
80
- * @author Vova Feldman (@svovaf)
81
- * @since 1.0.9
82
- *
83
- * @param string|array[string]mixed $key
84
- * @param string|bool $val
85
- *
86
- * @return bool
87
- */
88
- function update($key, $val = false) {
89
- if (!is_array($key)) {
90
- $key = array($key => $val);
91
- }
92
-
93
- $is_updated = false;
94
-
95
- foreach ($key as $k => $v) {
96
- if ($this->{$k} === $v) {
97
- continue;
98
- }
99
-
100
- if (( is_string($this->{$k}) && is_numeric($v) ||
101
- ( is_numeric($this->{$k}) && is_string($v) ) ) &&
102
- $this->{$k} == $v
103
- ) {
104
- continue;
105
- }
106
-
107
- // Update value.
108
- $this->{$k} = $v;
109
-
110
- $is_updated = true;
111
- }
112
-
113
- $this->_is_updated = $is_updated;
114
-
115
- return $is_updated;
116
- }
117
- /**
118
- * Checks if entity was updated.
119
- *
120
- * @author Vova Feldman (@svovaf)
121
- * @since 1.0.9
122
- *
123
- * @return bool
124
- */
125
- function is_updated() {
126
- return $this->_is_updated;
127
- }
128
- /**
129
- * @param $id
130
- *
131
- * @author Vova Feldman (@svovaf)
132
- * @since 1.1.2
133
- *
134
- * @return bool
135
- */
136
- static function is_valid_id($id) {
137
- return is_numeric($id);
138
- }
139
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/entities/class-fs-payment.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
- /**
3
- * @package Freemius
4
- * @copyright Copyright (c) 2016, Freemius, Inc.
5
- * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
- * @since 1.0.0
7
- */
8
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- class FS_Payment extends FS_Entity {
12
- #region Properties
13
- /**
14
- * @var number
15
- */
16
- public $plugin_id;
17
- /**
18
- * @var number
19
- */
20
- public $user_id;
21
- /**
22
- * @var number
23
- */
24
- public $install_id;
25
- /**
26
- * @var number
27
- */
28
- public $subscription_id;
29
- /**
30
- * @var number
31
- */
32
- public $plan_id;
33
- /**
34
- * @var number
35
- */
36
- public $license_id;
37
- /**
38
- * @var float
39
- */
40
- public $gross;
41
- /**
42
- * @var number
43
- */
44
- public $bound_payment_id;
45
- /**
46
- * @var string
47
- */
48
- public $external_id;
49
- /**
50
- * @var string
51
- */
52
- public $gateway;
53
- /**
54
- * @var string ISO 3166-1 alpha-2 - two-letter country code.
55
- *
56
- * @link http://www.wikiwand.com/en/ISO_3166-1_alpha-2
57
- */
58
- public $country_code;
59
- /**
60
- * @var string
61
- */
62
- public $vat_id;
63
- /**
64
- * @var float Actual Tax / VAT in $$$
65
- */
66
- public $vat;
67
- #endregion Properties
68
- /**
69
- * @param object|bool $payment
70
- */
71
- function __construct($payment = false) {
72
- parent::__construct($payment);
73
- }
74
- static function get_type() {
75
- return 'payment';
76
- }
77
- /**
78
- * @author Vova Feldman (@svovaf)
79
- * @since 1.0.0
80
- *
81
- * @return bool
82
- */
83
- function is_refund() {
84
- return ( parent::is_valid_id($this->bound_payment_id) && 0 > $this->gross );
85
- }
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/entities/class-fs-plugin-info.php DELETED
@@ -1,30 +0,0 @@
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
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- class FS_Plugin_Info extends FS_Entity {
12
- public $plugin_id;
13
- public $description;
14
- public $short_description;
15
- public $banner_url;
16
- public $card_banner_url;
17
- public $selling_point_0;
18
- public $selling_point_1;
19
- public $selling_point_2;
20
- public $screenshots;
21
- /**
22
- * @param stdClass|bool $plugin_info
23
- */
24
- function __construct($plugin_info = false) {
25
- parent::__construct($plugin_info);
26
- }
27
- static function get_type() {
28
- return 'plugin';
29
- }
30
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/entities/class-fs-plugin-license.php DELETED
@@ -1,207 +0,0 @@
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.5
7
- */
8
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- /**
12
- * Class FS_Plugin_License
13
- */
14
- class FS_Plugin_License extends FS_Entity {
15
- #region Properties
16
- /**
17
- * @var number
18
- */
19
- public $plugin_id;
20
- /**
21
- * @var number
22
- */
23
- public $user_id;
24
- /**
25
- * @var number
26
- */
27
- public $plan_id;
28
- /**
29
- * @var number
30
- */
31
- public $pricing_id;
32
- /**
33
- * @var int|null
34
- */
35
- public $quota;
36
- /**
37
- * @var int
38
- */
39
- public $activated;
40
- /**
41
- * @var int
42
- */
43
- public $activated_local;
44
- /**
45
- * @var string
46
- */
47
- public $expiration;
48
- /**
49
- * @var string
50
- */
51
- public $secret_key;
52
- /**
53
- * @var bool $is_free_localhost Defaults to true. If true, allow unlimited localhost installs with the same
54
- * license.
55
- */
56
- public $is_free_localhost;
57
- /**
58
- * @var bool $is_block_features Defaults to true. If false, don't block features after license expiry - only
59
- * block updates and support.
60
- */
61
- public $is_block_features;
62
- /**
63
- * @var bool
64
- */
65
- public $is_cancelled;
66
- #endregion Properties
67
- /**
68
- * @param stdClass|bool $license
69
- */
70
- function __construct($license = false) {
71
- parent::__construct($license);
72
- }
73
- /**
74
- * Get entity type.
75
- *
76
- * @return string
77
- */
78
- static function get_type() {
79
- return 'license';
80
- }
81
- /**
82
- * Check how many site activations left.
83
- *
84
- * @author Vova Feldman (@svovaf)
85
- * @since 1.0.5
86
- *
87
- * @return int
88
- */
89
- function left() {
90
- if (!$this->is_active() || $this->is_expired()) {
91
- return 0;
92
- }
93
-
94
- if ($this->is_unlimited()) {
95
- return 999;
96
- }
97
-
98
- return ( $this->quota - $this->activated - ( $this->is_free_localhost ? 0 : $this->activated_local ) );
99
- }
100
- /**
101
- * Check if single site license.
102
- *
103
- * @author Vova Feldman (@svovaf)
104
- * @since 1.1.8.1
105
- *
106
- * @return bool
107
- */
108
- function is_single_site() {
109
- return ( is_numeric($this->quota) && 1 == $this->quota );
110
- }
111
- /**
112
- * @author Vova Feldman (@svovaf)
113
- * @since 1.0.5
114
- *
115
- * @return bool
116
- */
117
- function is_expired() {
118
- return !$this->is_lifetime() && ( strtotime($this->expiration) < WP_FS__SCRIPT_START_TIME );
119
- }
120
- /**
121
- * Check if license is not expired.
122
- *
123
- * @author Vova Feldman (@svovaf)
124
- * @since 1.2.1
125
- *
126
- * @return bool
127
- */
128
- function is_valid() {
129
- return !$this->is_expired();
130
- }
131
- /**
132
- * @author Vova Feldman (@svovaf)
133
- * @since 1.0.6
134
- *
135
- * @return bool
136
- */
137
- function is_lifetime() {
138
- return is_null($this->expiration);
139
- }
140
- /**
141
- * @author Vova Feldman (@svovaf)
142
- * @since 1.2.0
143
- *
144
- * @return bool
145
- */
146
- function is_unlimited() {
147
- return is_null($this->quota);
148
- }
149
- /**
150
- * Check if license is fully utilized.
151
- *
152
- * @author Vova Feldman (@svovaf)
153
- * @since 1.0.6
154
- *
155
- * @param bool $is_localhost
156
- *
157
- * @return bool
158
- */
159
- function is_utilized($is_localhost = null) {
160
- if (is_null($is_localhost)) {
161
- $is_localhost = WP_FS__IS_LOCALHOST_FOR_SERVER;
162
- }
163
-
164
- if ($this->is_unlimited()) {
165
- return false;
166
- }
167
-
168
- return !( $this->is_free_localhost && $is_localhost ) &&
169
- ( $this->quota <= $this->activated + ( $this->is_free_localhost ? 0 : $this->activated_local ) );
170
- }
171
- /**
172
- * @author Vova Feldman (@svovaf)
173
- * @since 1.2.1
174
- *
175
- * @return bool
176
- */
177
- function is_active() {
178
- return (!$this->is_cancelled );
179
- }
180
- /**
181
- * Check if license's plan features are enabled.
182
- *
183
- * - Either if plan not expired
184
- * - If expired, based on the configuration to block features or not.
185
- *
186
- * @author Vova Feldman (@svovaf)
187
- * @since 1.0.6
188
- *
189
- * @return bool
190
- */
191
- function is_features_enabled() {
192
- return $this->is_active() && (!$this->is_block_features || !$this->is_expired() );
193
- }
194
- /**
195
- * Subscription considered to be new without any payments
196
- * if the license expires in less than 24 hours
197
- * from the license creation.
198
- *
199
- * @author Vova Feldman (@svovaf)
200
- * @since 1.0.9
201
- *
202
- * @return bool
203
- */
204
- function is_first_payment_pending() {
205
- return ( WP_FS__TIME_24_HOURS_IN_SEC >= strtotime($this->expiration) - strtotime($this->created) );
206
- }
207
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/entities/class-fs-plugin-plan.php DELETED
@@ -1,135 +0,0 @@
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.5
7
- */
8
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- /**
12
- * Class FS_Plugin_Plan
13
- *
14
- * @property FS_Pricing[] $pricing
15
- */
16
- class FS_Plugin_Plan extends FS_Entity {
17
- #region Properties
18
- /**
19
- * @var number
20
- */
21
- public $plugin_id;
22
- /**
23
- * @var string
24
- */
25
- public $name;
26
- /**
27
- * @var string
28
- */
29
- public $title;
30
- /**
31
- * @var string
32
- */
33
- public $description;
34
- /**
35
- * @var bool Defaults to true. If true, allow unlimited localhost installs with the same license.
36
- */
37
- public $is_free_localhost;
38
- /**
39
- * @var bool Defaults to true. If false, don't block features after license expiry - only block updates and
40
- * support.
41
- */
42
- public $is_block_features;
43
- /**
44
- * @var int
45
- */
46
- public $license_type;
47
- /**
48
- * @var bool
49
- */
50
- public $is_https_support;
51
- /**
52
- * @var int Trial days.
53
- */
54
- public $trial_period;
55
- /**
56
- * @var string If true, require payment for trial.
57
- */
58
- public $is_require_subscription;
59
- /**
60
- * @var string Knowledge Base URL.
61
- */
62
- public $support_kb;
63
- /**
64
- * @var string Support Forum URL.
65
- */
66
- public $support_forum;
67
- /**
68
- * @var string Support email address.
69
- */
70
- public $support_email;
71
- /**
72
- * @var string Support phone.
73
- */
74
- public $support_phone;
75
- /**
76
- * @var string Support skype username.
77
- */
78
- public $support_skype;
79
- /**
80
- * @var bool Is personal success manager supported with the plan.
81
- */
82
- public $is_success_manager;
83
- /**
84
- * @var bool Is featured plan.
85
- */
86
- public $is_featured;
87
- #endregion Properties
88
- /**
89
- * @param object|bool $plan
90
- */
91
- function __construct($plan = false) {
92
- parent::__construct($plan);
93
-
94
- if (is_object($plan)) {
95
- $this->name = strtolower($plan->name);
96
- }
97
- }
98
- static function get_type() {
99
- return 'plan';
100
- }
101
- /**
102
- * @author Vova Feldman (@svovaf)
103
- * @since 1.0.9
104
- *
105
- * @return bool
106
- */
107
- function is_free() {
108
- return ( 'free' === $this->name );
109
- }
110
- /**
111
- * Checks if this plan supports "Technical Support".
112
- *
113
- * @author Leo Fajardo (leorw)
114
- * @since 1.2.0
115
- *
116
- * @return bool
117
- */
118
- function has_technical_support() {
119
- return (!empty($this->support_email) ||
120
- !empty($this->support_skype) ||
121
- !empty($this->support_phone) ||
122
- !empty($this->is_success_manager)
123
- );
124
- }
125
- /**
126
- * @author Vova Feldman (@svovaf)
127
- * @since 1.0.9
128
- *
129
- * @return bool
130
- */
131
- function has_trial() {
132
- return !$this->is_free() &&
133
- is_numeric($this->trial_period) && ( $this->trial_period > 0 );
134
- }
135
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/entities/class-fs-plugin-tag.php DELETED
@@ -1,20 +0,0 @@
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.4
7
- */
8
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- class FS_Plugin_Tag extends FS_Entity {
12
- public $version;
13
- public $url;
14
- function __construct($tag = false) {
15
- parent::__construct($tag);
16
- }
17
- static function get_type() {
18
- return 'tag';
19
- }
20
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/entities/class-fs-plugin.php DELETED
@@ -1,87 +0,0 @@
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
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- class FS_Plugin extends FS_Scope_Entity {
12
- /**
13
- * @since 1.0.6
14
- * @var null|number
15
- */
16
- public $parent_plugin_id;
17
- /**
18
- * @var string
19
- */
20
- public $title;
21
- /**
22
- * @var string
23
- */
24
- public $slug;
25
- /**
26
- * @var string 'plugin' or 'theme'
27
- */
28
- public $type;
29
-
30
- #region Install Specific Properties
31
- /**
32
- * @var string
33
- */
34
- public $file;
35
- /**
36
- * @var string
37
- */
38
- public $version;
39
- /**
40
- * @var bool
41
- */
42
- public $auto_update;
43
- /**
44
- * @var FS_Plugin_Info
45
- */
46
- public $info;
47
- /**
48
- * @since 1.0.9
49
- *
50
- * @var bool
51
- */
52
- public $is_premium;
53
- /**
54
- * @since 1.0.9
55
- *
56
- * @var bool
57
- */
58
- public $is_live;
59
- #endregion Install Specific Properties
60
- /**
61
- * @param stdClass|bool $plugin
62
- */
63
- function __construct($plugin = false) {
64
- parent::__construct($plugin);
65
-
66
- $this->is_premium = false;
67
- $this->is_live = true;
68
-
69
- if (isset($plugin->info) && is_object($plugin->info)) {
70
- $this->info = new FS_Plugin_Info($plugin->info);
71
- }
72
- }
73
- /**
74
- * Check if plugin is an add-on (has parent).
75
- *
76
- * @author Vova Feldman (@svovaf)
77
- * @since 1.0.6
78
- *
79
- * @return bool
80
- */
81
- function is_addon() {
82
- return isset($this->parent_plugin_id) && is_numeric($this->parent_plugin_id);
83
- }
84
- static function get_type() {
85
- return 'plugin';
86
- }
87
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/entities/class-fs-pricing.php DELETED
@@ -1,125 +0,0 @@
1
- <?php
2
- /**
3
- * @package Freemius for EDD Add-On
4
- * @copyright Copyright (c) 2015, Freemius, Inc.
5
- * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
- * @since 1.0.0
7
- */
8
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- class FS_Pricing extends FS_Entity {
12
- #region Properties
13
- /**
14
- * @var number
15
- */
16
- public $plan_id;
17
- /**
18
- * @var int
19
- */
20
- public $licenses;
21
- /**
22
- * @var null|float
23
- */
24
- public $monthly_price;
25
- /**
26
- * @var null|float
27
- */
28
- public $annual_price;
29
- /**
30
- * @var null|float
31
- */
32
- public $lifetime_price;
33
- #endregion Properties
34
- /**
35
- * @param object|bool $pricing
36
- */
37
- function __construct($pricing = false) {
38
- parent::__construct($pricing);
39
- }
40
- static function get_type() {
41
- return 'pricing';
42
- }
43
- /**
44
- * @author Vova Feldman (@svovaf)
45
- * @since 1.1.8
46
- *
47
- * @return bool
48
- */
49
- function has_monthly() {
50
- return ( is_numeric($this->monthly_price) && $this->monthly_price > 0 );
51
- }
52
- /**
53
- * @author Vova Feldman (@svovaf)
54
- * @since 1.1.8
55
- *
56
- * @return bool
57
- */
58
- function has_annual() {
59
- return ( is_numeric($this->annual_price) && $this->annual_price > 0 );
60
- }
61
- /**
62
- * @author Vova Feldman (@svovaf)
63
- * @since 1.1.8
64
- *
65
- * @return bool
66
- */
67
- function has_lifetime() {
68
- return ( is_numeric($this->lifetime_price) && $this->lifetime_price > 0 );
69
- }
70
- /**
71
- * Check if unlimited licenses pricing.
72
- *
73
- * @author Vova Feldman (@svovaf)
74
- * @since 1.1.8
75
- *
76
- * @return bool
77
- */
78
- function is_unlimited() {
79
- return is_null($this->licenses);
80
- }
81
- /**
82
- * Check if pricing has more than one billing cycle.
83
- *
84
- * @author Vova Feldman (@svovaf)
85
- * @since 1.1.8
86
- *
87
- * @return bool
88
- */
89
- function is_multi_cycle() {
90
- $cycles = 0;
91
- if ($this->has_monthly()) {
92
- $cycles ++;
93
- }
94
- if ($this->has_annual()) {
95
- $cycles ++;
96
- }
97
- if ($this->has_lifetime()) {
98
- $cycles ++;
99
- }
100
-
101
- return $cycles > 1;
102
- }
103
- /**
104
- * Get annual over monthly discount.
105
- *
106
- * @author Vova Feldman (@svovaf)
107
- * @since 1.1.8
108
- *
109
- * @return int
110
- */
111
- function annual_discount_percentage() {
112
- return floor($this->annual_savings() / ( $this->monthly_price * 12 * ( $this->is_unlimited() ? 1 : $this->licenses ) ) * 100);
113
- }
114
- /**
115
- * Get annual over monthly savings.
116
- *
117
- * @author Vova Feldman (@svovaf)
118
- * @since 1.1.8
119
- *
120
- * @return float
121
- */
122
- function annual_savings() {
123
- return ( $this->monthly_price * 12 - $this->annual_price ) * ( $this->is_unlimited() ? 1 : $this->licenses );
124
- }
125
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/entities/class-fs-scope-entity.php DELETED
@@ -1,26 +0,0 @@
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.4
7
- */
8
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- class FS_Scope_Entity extends FS_Entity {
12
- /**
13
- * @var string
14
- */
15
- public $public_key;
16
- /**
17
- * @var string
18
- */
19
- public $secret_key;
20
- /**
21
- * @param bool|stdClass $scope_entity
22
- */
23
- function __construct($scope_entity = false) {
24
- parent::__construct($scope_entity);
25
- }
26
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/entities/class-fs-site.php DELETED
@@ -1,141 +0,0 @@
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
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- class FS_Site extends FS_Scope_Entity {
12
- /**
13
- * @var string
14
- */
15
- public $slug;
16
- /**
17
- * @var number
18
- */
19
- public $site_id;
20
- /**
21
- * @var number
22
- */
23
- public $plugin_id;
24
- /**
25
- * @var number
26
- */
27
- public $user_id;
28
- /**
29
- * @var string
30
- */
31
- public $title;
32
- /**
33
- * @var string
34
- */
35
- public $url;
36
- /**
37
- * @var string
38
- */
39
- public $version;
40
- /**
41
- * @var string E.g. en-GB
42
- */
43
- public $language;
44
- /**
45
- * @var string E.g. UTF-8
46
- */
47
- public $charset;
48
- /**
49
- * @var string Platform version (e.g WordPress version).
50
- */
51
- public $platform_version;
52
- /**
53
- * Freemius SDK version
54
- *
55
- * @author Leo Fajardo (@leorw)
56
- * @since 1.2.2
57
- *
58
- * @var string SDK version (e.g.: 1.2.2)
59
- */
60
- public $sdk_version;
61
- /**
62
- * @var string Programming language version (e.g PHP version).
63
- */
64
- public $programming_language_version;
65
- /**
66
- * @var FS_Plugin_Plan $plan
67
- */
68
- public $plan;
69
- /**
70
- * @var number|null
71
- */
72
- public $license_id;
73
- /**
74
- * @var number|null
75
- */
76
- public $trial_plan_id;
77
- /**
78
- * @var string|null
79
- */
80
- public $trial_ends;
81
- /**
82
- * @since 1.0.9
83
- *
84
- * @var bool
85
- */
86
- public $is_premium = false;
87
- /**
88
- * @author Leo Fajardo (@leorw)
89
- *
90
- * @since 1.2.1.5
91
- *
92
- * @var bool
93
- */
94
- public $is_disconnected = false;
95
- /**
96
- * @param stdClass|bool $site
97
- */
98
- function __construct($site = false) {
99
- $this->plan = new FS_Plugin_Plan();
100
-
101
- parent::__construct($site);
102
-
103
- if (is_object($site)) {
104
- $this->plan->id = $site->plan_id;
105
- }
106
-
107
- if (!is_bool($this->is_disconnected)) {
108
- $this->is_disconnected = false;
109
- }
110
- }
111
- static function get_type() {
112
- return 'install';
113
- }
114
- function is_localhost() {
115
- // The server has no way to verify if localhost unless localhost appears in domain.
116
- return WP_FS__IS_LOCALHOST_FOR_SERVER;
117
- // return (substr($_SERVER['REMOTE_ADDR'], 0, 4) == '127.' || $_SERVER['REMOTE_ADDR'] == '::1');
118
- }
119
- /**
120
- * Check if site in trial.
121
- *
122
- * @author Vova Feldman (@svovaf)
123
- * @since 1.0.9
124
- *
125
- * @return bool
126
- */
127
- function is_trial() {
128
- return is_numeric($this->trial_plan_id) && ( strtotime($this->trial_ends) > WP_FS__SCRIPT_START_TIME );
129
- }
130
- /**
131
- * Check if user already utilized the trial with the current install.
132
- *
133
- * @author Vova Feldman (@svovaf)
134
- * @since 1.0.9
135
- *
136
- * @return bool
137
- */
138
- function is_trial_utilized() {
139
- return is_numeric($this->trial_plan_id);
140
- }
141
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/entities/class-fs-subscription.php DELETED
@@ -1,115 +0,0 @@
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.9
7
- */
8
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- class FS_Subscription extends FS_Entity {
12
- #region Properties
13
- /**
14
- * @var number
15
- */
16
- public $user_id;
17
- /**
18
- * @var number
19
- */
20
- public $install_id;
21
- /**
22
- * @var number
23
- */
24
- public $plan_id;
25
- /**
26
- * @var number
27
- */
28
- public $license_id;
29
- /**
30
- * @var float
31
- */
32
- public $total_gross;
33
- /**
34
- * @var float
35
- */
36
- public $amount_per_cycle;
37
- /**
38
- * @var int # of months
39
- */
40
- public $billing_cycle;
41
- /**
42
- * @var float
43
- */
44
- public $outstanding_balance;
45
- /**
46
- * @var int
47
- */
48
- public $failed_payments;
49
- /**
50
- * @var string
51
- */
52
- public $gateway;
53
- /**
54
- * @var string
55
- */
56
- public $external_id;
57
- /**
58
- * @var string|null
59
- */
60
- public $trial_ends;
61
- /**
62
- * @var string|null Datetime of the next payment, or null if cancelled
63
- */
64
- public $next_payment;
65
- /**
66
- * @var string|null
67
- */
68
- public $vat_id;
69
- /**
70
- * @var string Two characters country code
71
- */
72
- public $country_code;
73
- #endregion Properties
74
- /**
75
- * @param object|bool $subscription
76
- */
77
- function __construct($subscription = false) {
78
- parent::__construct($subscription);
79
- }
80
- static function get_type() {
81
- return 'subscription';
82
- }
83
- /**
84
- * Check if subscription is active.
85
- *
86
- * @author Vova Feldman (@svovaf)
87
- * @since 1.0.9
88
- *
89
- * @return bool
90
- */
91
- function is_active() {
92
- return !empty($this->next_payment) &&
93
- ( strtotime($this->next_payment) > WP_FS__SCRIPT_START_TIME );
94
- }
95
- /**
96
- * Subscription considered to be new without any payments
97
- * if the next payment should be made within less than 24 hours
98
- * from the subscription creation.
99
- *
100
- * @author Vova Feldman (@svovaf)
101
- * @since 1.0.9
102
- *
103
- * @return bool
104
- */
105
- function is_first_payment_pending() {
106
- return ( WP_FS__TIME_24_HOURS_IN_SEC >= strtotime($this->next_payment) - strtotime($this->created) );
107
- }
108
- /**
109
- * @author Vova Feldman (@svovaf)
110
- * @since 1.1.7
111
- */
112
- function has_trial() {
113
- return !is_null($this->trial_ends);
114
- }
115
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/entities/class-fs-user.php DELETED
@@ -1,53 +0,0 @@
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
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- class FS_User extends FS_Scope_Entity {
12
- #region Properties
13
- /**
14
- * @var string
15
- */
16
- public $email;
17
- /**
18
- * @var string
19
- */
20
- public $first;
21
- /**
22
- * @var string
23
- */
24
- public $last;
25
- /**
26
- * @var bool
27
- */
28
- public $is_verified;
29
- /**
30
- * @var string|null
31
- */
32
- public $customer_id;
33
- /**
34
- * @var float
35
- */
36
- public $gross;
37
- #endregion Properties
38
- /**
39
- * @param object|bool $user
40
- */
41
- function __construct($user = false) {
42
- parent::__construct($user);
43
- }
44
- function get_name() {
45
- return trim(ucfirst(trim(is_string($this->first) ? $this->first : '')) . ' ' . ucfirst(trim(is_string($this->last) ? $this->last : '')));
46
- }
47
- function is_verified() {
48
- return ( isset($this->is_verified) && true === $this->is_verified );
49
- }
50
- static function get_type() {
51
- return 'user';
52
- }
53
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/entities/index.php DELETED
@@ -1,3 +0,0 @@
1
- <?php
2
- // Silence is golden.
3
- // Hide file structure from users on unprotected servers.
 
 
 
freemius/includes/fs-core-functions.php DELETED
@@ -1,553 +0,0 @@
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
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
-
12
- if (!function_exists('fs_dummy')) {
13
- function fs_dummy() {
14
-
15
- }
16
- }
17
-
18
- /* Url.
19
- -------------------------------------------------------------------------------------------- */
20
- function fs_get_url_daily_cache_killer() {
21
- return date('\YY\Mm\Dd');
22
- }
23
- /* Templates / Views.
24
- -------------------------------------------------------------------------------------------- */
25
- if (!function_exists('fs_get_template_path')) {
26
- function fs_get_template_path($path) {
27
- return WP_FS__DIR_TEMPLATES . '/' . trim($path, '/');
28
- }
29
- function fs_include_template($path, &$params = null) {
30
- $VARS = &$params;
31
- include fs_get_template_path($path);
32
- }
33
- function fs_include_once_template($path, &$params = null) {
34
- $VARS = &$params;
35
- include_once fs_get_template_path($path);
36
- }
37
- function fs_require_template($path, &$params = null) {
38
- $VARS = &$params;
39
- require fs_get_template_path($path);
40
- }
41
- function fs_require_once_template($path, &$params = null) {
42
- $VARS = &$params;
43
- require_once fs_get_template_path($path);
44
- }
45
- function fs_get_template($path, &$params = null) {
46
- ob_start();
47
-
48
- $VARS = &$params;
49
- require fs_get_template_path($path);
50
-
51
- return ob_get_clean();
52
- }
53
- }
54
-
55
- /* Scripts and styles including.
56
- -------------------------------------------------------------------------------------------- */
57
- function fs_enqueue_local_style($handle, $path, $deps = array(), $ver = false, $media = 'all') {
58
- wp_enqueue_style($handle, plugins_url(plugin_basename(WP_FS__DIR_CSS . '/' . trim($path, '/'))), $deps, $ver, $media);
59
- }
60
- function fs_enqueue_local_script($handle, $path, $deps = array(), $ver = false, $in_footer = 'all') {
61
- wp_enqueue_script($handle, plugins_url(plugin_basename(WP_FS__DIR_JS . '/' . trim($path, '/'))), $deps, $ver, $in_footer);
62
- }
63
- function fs_img_url($path, $img_dir = WP_FS__DIR_IMG) {
64
- return plugins_url(plugin_basename($img_dir . '/' . trim($path, '/')));
65
- }
66
- /* Request handlers.
67
- -------------------------------------------------------------------------------------------- */
68
- /**
69
- * @param string $key
70
- * @param mixed $def
71
- * @param string|bool $type Since 1.2.1.7 - when set to 'get' will look for the value passed via querystring, when
72
- * set to 'post' will look for the value passed via the POST request's body, otherwise,
73
- * will check if the parameter was passed in any of the two.
74
- *
75
- * @return mixed
76
- */
77
- function fs_request_get($key, $def = false, $type = false) {
78
- if (is_string($type)) {
79
- $type = strtolower($type);
80
- }
81
-
82
- switch ($type) {
83
- case 'post':
84
- $value = isset($_POST[$key]) ? $_POST[$key] : $def;
85
- break;
86
- case 'get':
87
- $value = isset($_GET[$key]) ? $_GET[$key] : $def;
88
- break;
89
- default:
90
- $value = isset($_REQUEST[$key]) ? $_REQUEST[$key] : $def;
91
- break;
92
- }
93
-
94
- return $value;
95
- }
96
- function fs_request_has($key) {
97
- return isset($_REQUEST[$key]);
98
- }
99
- function fs_request_get_bool($key, $def = false) {
100
- if (!isset($_REQUEST[$key])) {
101
- return $def;
102
- }
103
-
104
- if (1 == $_REQUEST[$key] || 'true' === strtolower($_REQUEST[$key])) {
105
- return true;
106
- }
107
-
108
- if (0 == $_REQUEST[$key] || 'false' === strtolower($_REQUEST[$key])) {
109
- return false;
110
- }
111
-
112
- return $def;
113
- }
114
- function fs_request_is_post() {
115
- return ( 'post' === strtolower($_SERVER['REQUEST_METHOD']) );
116
- }
117
- function fs_request_is_get() {
118
- return ( 'get' === strtolower($_SERVER['REQUEST_METHOD']) );
119
- }
120
- function fs_get_action($action_key = 'action') {
121
- if (!empty($_REQUEST[$action_key])) {
122
- return strtolower($_REQUEST[$action_key]);
123
- }
124
-
125
- if ('action' == $action_key) {
126
- $action_key = 'fs_action';
127
-
128
- if (!empty($_REQUEST[$action_key])) {
129
- return strtolower($_REQUEST[$action_key]);
130
- }
131
- }
132
-
133
- return false;
134
- }
135
- function fs_request_is_action($action, $action_key = 'action') {
136
- return ( strtolower($action) === fs_get_action($action_key) );
137
- }
138
- /**
139
- * @author Vova Feldman (@svovaf)
140
- * @since 1.0.0
141
- *
142
- * @since 1.2.1.5 Allow nonce verification.
143
- *
144
- * @param string $action
145
- * @param string $action_key
146
- * @param string $nonce_key
147
- *
148
- * @return bool
149
- */
150
- function fs_request_is_action_secure(
151
- $action, $action_key = 'action', $nonce_key = 'nonce'
152
- ) {
153
- if (strtolower($action) !== fs_get_action($action_key)) {
154
- return false;
155
- }
156
-
157
- $nonce = !empty($_REQUEST[$nonce_key]) ?
158
- $_REQUEST[$nonce_key] :
159
- '';
160
-
161
- if (empty($nonce) ||
162
- ( false === wp_verify_nonce($nonce, $action) )
163
- ) {
164
- return false;
165
- }
166
-
167
- return true;
168
- }
169
- function fs_is_plugin_page($page_slug) {
170
- return ( is_admin() && $page_slug === fs_request_get('page') );
171
- }
172
- /* Core UI.
173
- -------------------------------------------------------------------------------------------- */
174
- /**
175
- * @param string $slug
176
- * @param string $page
177
- * @param string $action
178
- * @param string $title
179
- * @param array $params
180
- * @param bool $is_primary
181
- * @param string|bool $icon_class Optional class for an icon (since 1.1.7).
182
- * @param string|bool $confirmation Optional confirmation message before submit (since 1.1.7).
183
- * @param string $method Since 1.1.7
184
- *
185
- * @uses fs_ui_get_action_button()
186
- */
187
- function fs_ui_action_button(
188
- $slug, $page, $action, $title, $params = array(), $is_primary = true, $icon_class = false, $confirmation = false, $method = 'GET'
189
- ) {
190
- echo fs_ui_get_action_button(
191
- $slug, $page, $action, $title, $params, $is_primary, $icon_class, $confirmation, $method
192
- );
193
- }
194
- /**
195
- * @author Vova Feldman (@svovaf)
196
- * @since 1.1.7
197
- *
198
- * @param string $slug
199
- * @param string $page
200
- * @param string $action
201
- * @param string $title
202
- * @param array $params
203
- * @param bool $is_primary
204
- * @param string|bool $icon_class Optional class for an icon.
205
- * @param string|bool $confirmation Optional confirmation message before submit.
206
- * @param string $method
207
- *
208
- * @return string
209
- */
210
- function fs_ui_get_action_button(
211
- $slug, $page, $action, $title, $params = array(), $is_primary = true, $icon_class = false, $confirmation = false, $method = 'GET'
212
- ) {
213
- // Prepend icon (if set).
214
- $title = ( is_string($icon_class) ? '<i class="' . $icon_class . '"></i> ' : '' ) . $title;
215
-
216
- if (is_string($confirmation)) {
217
- return sprintf('<form action="%s" method="%s"><input type="hidden" name="fs_action" value="%s">%s<a href="#" class="%s" onclick="if (confirm(\'%s\')) this.parentNode.submit(); return false;">%s</a></form>', freemius($slug)->_get_admin_page_url($page, $params), $method, $action, wp_nonce_field($action, '_wpnonce', true, false), 'button' . ( $is_primary ? ' button-primary' : '' ), $confirmation, $title
218
- );
219
- } else if ('GET' !== strtoupper($method)) {
220
- return sprintf('<form action="%s" method="%s"><input type="hidden" name="fs_action" value="%s">%s<a href="#" class="%s" onclick="this.parentNode.submit(); return false;">%s</a></form>', freemius($slug)->_get_admin_page_url($page, $params), $method, $action, wp_nonce_field($action, '_wpnonce', true, false), 'button' . ( $is_primary ? ' button-primary' : '' ), $title
221
- );
222
- } else {
223
- return sprintf('<a href="%s" class="%s">%s</a></form>', wp_nonce_url(freemius($slug)->_get_admin_page_url($page, array_merge($params, array('fs_action' => $action))), $action), 'button' . ( $is_primary ? ' button-primary' : '' ), $title
224
- );
225
- }
226
- }
227
- function fs_ui_action_link($slug, $page, $action, $title, $params = array()) {
228
- ?><a class=""
229
- href="<?php echo wp_nonce_url(freemius($slug)->_get_admin_page_url($page, array_merge($params, array('fs_action' => $action))), $action) ?>"><?php echo $title ?></a><?php
230
- }
231
- /* function fs_error_handler($errno, $errstr, $errfile, $errline)
232
- {
233
- if (false === strpos($errfile, 'freemius/'))
234
- {
235
- // @todo Dump Freemius errors to local log.
236
- }
237
-
238
- // switch ($errno) {
239
- // case E_USER_ERROR:
240
- // break;
241
- // case E_WARNING:
242
- // case E_USER_WARNING:
243
- // break;
244
- // case E_NOTICE:
245
- // case E_USER_NOTICE:
246
- // break;
247
- // default:
248
- // break;
249
- // }
250
- }
251
-
252
- set_error_handler('fs_error_handler'); */
253
-
254
- if (!function_exists('fs_nonce_url')) {
255
- /**
256
- * Retrieve URL with nonce added to URL query.
257
- *
258
- * Originally was using `wp_nonce_url()` but the new version
259
- * changed the return value to escaped URL, that's not the expected
260
- * behaviour.
261
- *
262
- * @author Vova Feldman (@svovaf)
263
- * @since ~1.1.3
264
- *
265
- * @param string $actionurl URL to add nonce action.
266
- * @param int|string $action Optional. Nonce action name. Default -1.
267
- * @param string $name Optional. Nonce name. Default '_wpnonce'.
268
- *
269
- * @return string Escaped URL with nonce action added.
270
- */
271
- function fs_nonce_url($actionurl, $action = - 1, $name = '_wpnonce') {
272
- return add_query_arg($name, wp_create_nonce($action), $actionurl);
273
- }
274
- }
275
-
276
- if (!function_exists('fs_starts_with')) {
277
- /**
278
- * Check if string starts with.
279
- *
280
- * @author Vova Feldman (@svovaf)
281
- * @since 1.1.3
282
- *
283
- * @param string $haystack
284
- * @param string $needle
285
- *
286
- * @return bool
287
- */
288
- function fs_starts_with($haystack, $needle) {
289
- $length = strlen($needle);
290
-
291
- return ( substr($haystack, 0, $length) === $needle );
292
- }
293
- }
294
-
295
- #region Url Canonization ------------------------------------------------------------------
296
-
297
- if (!function_exists('fs_canonize_url')) {
298
- /**
299
- * @author Vova Feldman (@svovaf)
300
- * @since 1.1.3
301
- *
302
- * @param string $url
303
- * @param bool $omit_host
304
- * @param array $ignore_params
305
- *
306
- * @return string
307
- */
308
- function fs_canonize_url($url, $omit_host = false, $ignore_params = array()) {
309
- $parsed_url = parse_url(strtolower($url));
310
-
311
- // if ( ! isset( $parsed_url['host'] ) ) {
312
- // return $url;
313
- // }
314
-
315
- $canonical = ( ( $omit_host || !isset($parsed_url['host']) ) ? '' : $parsed_url['host'] ) . $parsed_url['path'];
316
-
317
- if (isset($parsed_url['query'])) {
318
- parse_str($parsed_url['query'], $queryString);
319
- $canonical .= '?' . fs_canonize_query_string($queryString, $ignore_params);
320
- }
321
-
322
- return $canonical;
323
- }
324
- }
325
-
326
- if (!function_exists('fs_canonize_query_string')) {
327
- /**
328
- * @author Vova Feldman (@svovaf)
329
- * @since 1.1.3
330
- *
331
- * @param array $params
332
- * @param array $ignore_params
333
- * @param bool $params_prefix
334
- *
335
- * @return string
336
- */
337
- function fs_canonize_query_string(array $params, array &$ignore_params, $params_prefix = false) {
338
- if (!is_array($params) || 0 === count($params)) {
339
- return '';
340
- }
341
-
342
- // Url encode both keys and values
343
- $keys = fs_urlencode_rfc3986(array_keys($params));
344
- $values = fs_urlencode_rfc3986(array_values($params));
345
- $params = array_combine($keys, $values);
346
-
347
- // Parameters are sorted by name, using lexicographical byte value ordering.
348
- // Ref: Spec: 9.1.1 (1)
349
- uksort($params, 'strcmp');
350
-
351
- $pairs = array();
352
- foreach ($params as $parameter => $value) {
353
- $lower_param = strtolower($parameter);
354
-
355
- // Skip ignore params.
356
- if (in_array($lower_param, $ignore_params) ||
357
- ( false !== $params_prefix && fs_starts_with($lower_param, $params_prefix) )
358
- ) {
359
- continue;
360
- }
361
-
362
- if (is_array($value)) {
363
- // If two or more parameters share the same name, they are sorted by their value
364
- // Ref: Spec: 9.1.1 (1)
365
- natsort($value);
366
- foreach ($value as $duplicate_value) {
367
- $pairs[] = $lower_param . '=' . $duplicate_value;
368
- }
369
- } else {
370
- $pairs[] = $lower_param . '=' . $value;
371
- }
372
- }
373
-
374
- if (0 === count($pairs)) {
375
- return '';
376
- }
377
-
378
- return implode("&", $pairs);
379
- }
380
- }
381
-
382
- if (!function_exists('fs_urlencode_rfc3986')) {
383
- /**
384
- * @author Vova Feldman (@svovaf)
385
- * @since 1.1.3
386
- *
387
- * @param string|string[] $input
388
- *
389
- * @return array|mixed|string
390
- */
391
- function fs_urlencode_rfc3986($input) {
392
- if (is_array($input)) {
393
- return array_map('fs_urlencode_rfc3986', $input);
394
- } else if (is_scalar($input)) {
395
- return str_replace('+', ' ', str_replace('%7E', '~', rawurlencode($input)));
396
- }
397
-
398
- return '';
399
- }
400
- }
401
-
402
- #endregion Url Canonization ------------------------------------------------------------------
403
- function fs_download_image($from, $to) {
404
- $ch = curl_init($from);
405
- $fp = fopen(fs_normalize_path($to), 'wb');
406
- curl_setopt($ch, CURLOPT_FILE, $fp);
407
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
408
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
409
- curl_setopt($ch, CURLOPT_HEADER, 0);
410
- curl_exec($ch);
411
- curl_close($ch);
412
- fclose($fp);
413
- }
414
- /* General Utilities
415
- -------------------------------------------------------------------------------------------- */
416
- /**
417
- * Sorts an array by the value of the priority key.
418
- *
419
- * @author Daniel Iser (@danieliser)
420
- * @since 1.1.7
421
- *
422
- * @param $a
423
- * @param $b
424
- *
425
- * @return int
426
- */
427
- function fs_sort_by_priority($a, $b) {
428
-
429
- // If b has a priority and a does not, b wins.
430
- if (!isset($a['priority']) && isset($b['priority'])) {
431
- return 1;
432
- } // If b has a priority and a does not, b wins.
433
- elseif (isset($a['priority']) && !isset($b['priority'])) {
434
- return - 1;
435
- } // If neither has a priority or both priorities are equal its a tie.
436
- elseif ((!isset($a['priority']) && !isset($b['priority']) ) || $a['priority'] === $b['priority']) {
437
- return 0;
438
- }
439
-
440
- // If both have priority return the winner.
441
- return ( $a['priority'] < $b['priority'] ) ? - 1 : 1;
442
- }
443
- #--------------------------------------------------------------------------------
444
- #region Localization
445
- #--------------------------------------------------------------------------------
446
-
447
- if (!function_exists('fs_text')) {
448
- /**
449
- * Retrieve a translated text by key.
450
- *
451
- * @author Vova Feldman (@svovaf)
452
- * @since 1.2.1.7
453
- *
454
- * @param string $key
455
- * @param string $slug
456
- *
457
- * @return string
458
- *
459
- * @global $fs_text, $fs_text_overrides
460
- */
461
- function fs_text($key, $slug = 'freemius') {
462
- return __fs($key, $slug);
463
- }
464
- /**
465
- * Output a translated text by key.
466
- *
467
- * @author Vova Feldman (@svovaf)
468
- * @since 1.2.1.7
469
- *
470
- * @param string $key
471
- * @param string $slug
472
- */
473
- function fs_echo($key, $slug = 'freemius') {
474
- echo fs_text($key, $slug);
475
- }
476
- }
477
- /**
478
- * @author Vova Feldman
479
- * @since 1.2.1.6
480
- *
481
- * @param string $key
482
- * @param string $slug
483
- *
484
- * @return string
485
- */
486
- function fs_esc_attr($key, $slug) {
487
- return esc_attr(fs_text($key, $slug));
488
- }
489
- /**
490
- * @author Vova Feldman
491
- * @since 1.2.1.6
492
- *
493
- * @param string $key
494
- * @param string $slug
495
- */
496
- function fs_esc_attr_echo($key, $slug) {
497
- echo esc_attr(fs_text($key, $slug));
498
- }
499
- /**
500
- * @author Vova Feldman
501
- * @since 1.2.1.6
502
- *
503
- * @param string $key
504
- * @param string $slug
505
- *
506
- * @return string
507
- */
508
- function fs_esc_js($key, $slug) {
509
- return esc_js(fs_text($key, $slug));
510
- }
511
- /**
512
- * @author Vova Feldman
513
- * @since 1.2.1.6
514
- *
515
- * @param string $key
516
- * @param string $slug
517
- */
518
- function fs_esc_js_echo($key, $slug) {
519
- echo esc_js(fs_text($key, $slug));
520
- }
521
- /**
522
- * @author Vova Feldman
523
- * @since 1.2.1.6
524
- *
525
- * @param string $key
526
- * @param string $slug
527
- */
528
- function fs_json_encode_echo($key, $slug) {
529
- echo json_encode(fs_text($key, $slug));
530
- }
531
- /**
532
- * @author Vova Feldman
533
- * @since 1.2.1.6
534
- *
535
- * @param string $key
536
- * @param string $slug
537
- *
538
- * @return string
539
- */
540
- function fs_esc_html($key, $slug) {
541
- return esc_html(fs_text($key, $slug));
542
- }
543
- /**
544
- * @author Vova Feldman
545
- * @since 1.2.1.6
546
- *
547
- * @param string $key
548
- * @param string $slug
549
- */
550
- function fs_esc_html_echo($key, $slug) {
551
- echo esc_html(fs_text($key, $slug));
552
- }
553
- #endregion
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/fs-essential-functions.php DELETED
@@ -1,443 +0,0 @@
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.5
7
- */
8
- if (!function_exists('fs_normalize_path')) {
9
- if (function_exists('wp_normalize_path')) {
10
- /**
11
- * Normalize a filesystem path.
12
- *
13
- * Replaces backslashes with forward slashes for Windows systems, and ensures
14
- * no duplicate slashes exist.
15
- *
16
- * @param string $path Path to normalize.
17
- *
18
- * @return string Normalized path.
19
- */
20
- function fs_normalize_path($path) {
21
- return wp_normalize_path($path);
22
- }
23
- } else {
24
- function fs_normalize_path($path) {
25
- $path = str_replace('\\', '/', $path);
26
- $path = preg_replace('|/+|', '/', $path);
27
-
28
- return $path;
29
- }
30
- }
31
- }
32
-
33
- #region Core Redirect (copied from BuddyPress) -----------------------------------------
34
-
35
- if (!function_exists('fs_redirect')) {
36
- /**
37
- * Redirects to another page, with a workaround for the IIS Set-Cookie bug.
38
- *
39
- * @link http://support.microsoft.com/kb/q176113/
40
- * @since 1.5.1
41
- * @uses apply_filters() Calls 'wp_redirect' hook on $location and $status.
42
- *
43
- * @param string $location The path to redirect to.
44
- * @param bool $exit If true, exit after redirect (Since 1.2.1.5).
45
- * @param int $status Status code to use.
46
- *
47
- * @return bool False if $location is not set
48
- */
49
- function fs_redirect($location, $exit = true, $status = 302) {
50
- global $is_IIS;
51
-
52
- $file = '';
53
- $line = '';
54
- if (headers_sent($file, $line)) {
55
- if (WP_FS__DEBUG_SDK && class_exists('FS_Admin_Notice_Manager')) {
56
- $notices = FS_Admin_Notice_Manager::instance('global');
57
-
58
- $notices->add("Freemius failed to redirect the page because the headers have been already sent from line <b><code>{$line}</code></b> in file <b><code>{$file}</code></b>. If it's unexpected, it usually happens due to invalid space and/or EOL character(s).", 'Oops...', 'error');
59
- }
60
-
61
- return false;
62
- }
63
-
64
- if (defined('DOING_AJAX')) {
65
- // Don't redirect on AJAX calls.
66
- return false;
67
- }
68
-
69
- if (!$location) { // allows the wp_redirect filter to cancel a redirect
70
- return false;
71
- }
72
-
73
- $location = fs_sanitize_redirect($location);
74
-
75
- if ($is_IIS) {
76
- header("Refresh: 0;url=$location");
77
- } else {
78
- if (php_sapi_name() != 'cgi-fcgi') {
79
- status_header($status);
80
- } // This causes problems on IIS and some FastCGI setups
81
- header("Location: $location");
82
- }
83
-
84
- if ($exit) {
85
- exit();
86
- }
87
-
88
- return true;
89
- }
90
- if (!function_exists('fs_sanitize_redirect')) {
91
- /**
92
- * Sanitizes a URL for use in a redirect.
93
- *
94
- * @since 2.3
95
- *
96
- * @param string $location
97
- *
98
- * @return string redirect-sanitized URL
99
- */
100
- function fs_sanitize_redirect($location) {
101
- $location = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%!]|i', '', $location);
102
- $location = fs_kses_no_null($location);
103
-
104
- // remove %0d and %0a from location
105
- $strip = array('%0d', '%0a');
106
- $found = true;
107
- while ($found) {
108
- $found = false;
109
- foreach ((array) $strip as $val) {
110
- while (strpos($location, $val) !== false) {
111
- $found = true;
112
- $location = str_replace($val, '', $location);
113
- }
114
- }
115
- }
116
-
117
- return $location;
118
- }
119
- }
120
-
121
- if (!function_exists('fs_kses_no_null')) {
122
- /**
123
- * Removes any NULL characters in $string.
124
- *
125
- * @since 1.0.0
126
- *
127
- * @param string $string
128
- *
129
- * @return string
130
- */
131
- function fs_kses_no_null($string) {
132
- $string = preg_replace('/\0+/', '', $string);
133
- $string = preg_replace('/(\\\\0)+/', '', $string);
134
-
135
- return $string;
136
- }
137
- }
138
- }
139
-
140
- #endregion Core Redirect (copied from BuddyPress) -----------------------------------------
141
-
142
- if (!function_exists('__fs')) {
143
- global $fs_text_overrides;
144
-
145
- if (!isset($fs_text_overrides)) {
146
- $fs_text_overrides = array();
147
- }
148
- /**
149
- * Retrieve a translated text by key.
150
- *
151
- * @deprecated Use `fs_text()` instead since methods starting with `__` trigger warnings in Php 7.
152
- *
153
- * @author Vova Feldman (@svovaf)
154
- * @since 1.1.4
155
- *
156
- * @param string $key
157
- * @param string $slug
158
- *
159
- * @return string
160
- *
161
- * @global $fs_text, $fs_text_overrides
162
- */
163
- function __fs($key, $slug = 'freemius') {
164
- global $fs_text,
165
- $fs_module_info_text,
166
- $fs_text_overrides;
167
-
168
- if (isset($fs_text_overrides[$slug])) {
169
- if (isset($fs_text_overrides[$slug][$key])) {
170
- return $fs_text_overrides[$slug][$key];
171
- }
172
-
173
- $lower_key = strtolower($key);
174
- if (isset($fs_text_overrides[$slug][$lower_key])) {
175
- return $fs_text_overrides[$slug][$lower_key];
176
- }
177
- }
178
-
179
- if (!isset($fs_text)) {
180
- $dir = defined('WP_FS__DIR_INCLUDES') ?
181
- WP_FS__DIR_INCLUDES :
182
- dirname(__FILE__);
183
-
184
- require_once $dir . '/i18n.php';
185
- }
186
-
187
- if (isset($fs_text[$key])) {
188
- return $fs_text[$key];
189
- }
190
-
191
- if (isset($fs_module_info_text[$key])) {
192
- return $fs_module_info_text[$key];
193
- }
194
-
195
- return $key;
196
- }
197
- /**
198
- * Output a translated text by key.
199
- *
200
- * @deprecated Use `fs_echo()` instead for consistency with `fs_text()`.
201
- *
202
- * @author Vova Feldman (@svovaf)
203
- * @since 1.1.4
204
- *
205
- * @param string $key
206
- * @param string $slug
207
- */
208
- function _efs($key, $slug = 'freemius') {
209
- fs_echo($key, $slug);
210
- }
211
- }
212
-
213
- if (!function_exists('fs_override_i18n')) {
214
- /**
215
- * Override default i18n text phrases.
216
- *
217
- * @author Vova Feldman (@svovaf)
218
- * @since 1.1.6
219
- *
220
- * @param string[] $key_value
221
- * @param string $slug
222
- *
223
- * @global $fs_text_overrides
224
- */
225
- function fs_override_i18n(array $key_value, $slug = 'freemius') {
226
- global $fs_text_overrides;
227
-
228
- if (!isset($fs_text_overrides[$slug])) {
229
- $fs_text_overrides[$slug] = array();
230
- }
231
-
232
- foreach ($key_value as $key => $value) {
233
- $fs_text_overrides[$slug][$key] = $value;
234
- }
235
- }
236
- }
237
-
238
- if (!function_exists('fs_get_ip')) {
239
- /**
240
- * Get client IP.
241
- *
242
- * @author Vova Feldman (@svovaf)
243
- * @since 1.1.2
244
- *
245
- * @return string|null
246
- */
247
- function fs_get_ip() {
248
- $fields = array(
249
- 'HTTP_CF_CONNECTING_IP',
250
- 'HTTP_CLIENT_IP',
251
- 'HTTP_X_FORWARDED_FOR',
252
- 'HTTP_X_FORWARDED',
253
- 'HTTP_FORWARDED_FOR',
254
- 'HTTP_FORWARDED',
255
- 'REMOTE_ADDR',
256
- );
257
-
258
- foreach ($fields as $ip_field) {
259
- if (!empty($_SERVER[$ip_field])) {
260
- return $_SERVER[$ip_field];
261
- }
262
- }
263
-
264
- return null;
265
- }
266
- }
267
- /**
268
- * Leverage backtrace to find caller plugin main file path.
269
- *
270
- * @author Vova Feldman (@svovaf)
271
- * @since 1.0.6
272
- *
273
- * @return string
274
- */
275
- function fs_find_caller_plugin_file() {
276
- /**
277
- * All the code below will be executed once on activation.
278
- * If the user changes the main plugin's file name, the file_exists()
279
- * will catch it.
280
- */
281
- if (!function_exists('get_plugins')) {
282
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
283
- }
284
-
285
- $all_plugins = get_plugins();
286
- $all_plugins_paths = array();
287
-
288
- // Get active plugin's main files real full names (might be symlinks).
289
- foreach ($all_plugins as $relative_path => &$data) {
290
- $all_plugins_paths[] = fs_normalize_path(realpath(WP_PLUGIN_DIR . '/' . $relative_path));
291
- }
292
-
293
- $plugin_file = null;
294
- for ($i = 1, $bt = debug_backtrace(), $len = count($bt); $i < $len; $i ++) {
295
- if (empty($bt[$i]['file'])) {
296
- continue;
297
- }
298
-
299
- if (in_array(fs_normalize_path($bt[$i]['file']), $all_plugins_paths)) {
300
- $plugin_file = $bt[$i]['file'];
301
- break;
302
- }
303
- }
304
-
305
- if (is_null($plugin_file)) {
306
- // Throw an error to the developer in case of some edge case dev environment.
307
- wp_die(
308
- "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error.", 'Error', array('back_link' => true)
309
- );
310
- }
311
-
312
- return $plugin_file;
313
- }
314
- require_once dirname(__FILE__) . '/supplements/fs-essential-functions-1.1.7.1.php';
315
- /**
316
- * Update SDK newest version reference.
317
- *
318
- * @author Vova Feldman (@svovaf)
319
- * @since 1.1.6
320
- *
321
- * @param string $sdk_relative_path
322
- * @param string|bool $plugin_file
323
- *
324
- * @global $fs_active_plugins
325
- */
326
- function fs_update_sdk_newest_version($sdk_relative_path, $plugin_file = false) {
327
- global $fs_active_plugins;
328
-
329
- if (!is_string($plugin_file)) {
330
- $plugin_file = plugin_basename(fs_find_caller_plugin_file());
331
- }
332
-
333
- $fs_active_plugins->newest = (object) array(
334
- 'plugin_path' => $plugin_file,
335
- 'sdk_path' => $sdk_relative_path,
336
- 'version' => $fs_active_plugins->plugins[$sdk_relative_path]->version,
337
- 'in_activation' => !is_plugin_active($plugin_file),
338
- 'timestamp' => time(),
339
- );
340
-
341
- // Update DB with latest SDK version and path.
342
- update_option('fs_active_plugins', $fs_active_plugins);
343
- }
344
- /**
345
- * Reorder the plugins load order so the plugin with the newest Freemius SDK is loaded first.
346
- *
347
- * @author Vova Feldman (@svovaf)
348
- * @since 1.1.6
349
- *
350
- * @return bool Was plugin order changed. Return false if plugin was loaded first anyways.
351
- *
352
- * @global $fs_active_plugins
353
- */
354
- function fs_newest_sdk_plugin_first() {
355
- global $fs_active_plugins;
356
-
357
- /**
358
- * @todo Multi-site network activated plugin are always loaded prior to site plugins so if there's a a plugin activated in the network mode that has an older version of the SDK of another plugin which is site activated that has new SDK version, the fs-essential-functions.php will be loaded from the older SDK. Same thing about MU plugins (loaded even before network activated plugins).
359
- *
360
- * @link https://github.com/Freemius/wordpress-sdk/issues/26
361
- */
362
- // $active_sitewide_plugins = get_site_option( 'active_sitewide_plugins' );
363
-
364
- $active_plugins = get_option('active_plugins');
365
- $newest_sdk_plugin_key = array_search($fs_active_plugins->newest->plugin_path, $active_plugins);
366
- if (0 == $newest_sdk_plugin_key) {
367
- // if it's 0 it's the first plugin already, no need to continue
368
- return false;
369
- }
370
-
371
- array_splice($active_plugins, $newest_sdk_plugin_key, 1);
372
- array_unshift($active_plugins, $fs_active_plugins->newest->plugin_path);
373
- update_option('active_plugins', $active_plugins);
374
-
375
- return true;
376
- }
377
- /**
378
- * Go over all Freemius SDKs in the system and find and "remember"
379
- * the newest SDK which is associated with an active plugin.
380
- *
381
- * @author Vova Feldman (@svovaf)
382
- * @since 1.1.6
383
- *
384
- * @global $fs_active_plugins
385
- */
386
- function fs_fallback_to_newest_active_sdk() {
387
- global $fs_active_plugins;
388
-
389
- /**
390
- * @var object $newest_sdk_data
391
- */
392
- $newest_sdk_data = null;
393
- $newest_sdk_path = null;
394
-
395
- foreach ($fs_active_plugins->plugins as $sdk_relative_path => $data) {
396
- if (is_null($newest_sdk_data) || version_compare($data->version, $newest_sdk_data->version, '>')
397
- ) {
398
- // If plugin inactive or SDK starter file doesn't exist, remove SDK reference.
399
- if (!is_plugin_active($data->plugin_path) ||
400
- !file_exists(fs_normalize_path(WP_PLUGIN_DIR . '/' . $sdk_relative_path . '/start.php'))
401
- ) {
402
- unset($fs_active_plugins->plugins[$sdk_relative_path]);
403
-
404
- // No need to store the data since it will be stored in fs_update_sdk_newest_version()
405
- // or explicitly with update_option().
406
- } else {
407
- $newest_sdk_data = $data;
408
- $newest_sdk_path = $sdk_relative_path;
409
- }
410
- }
411
- }
412
-
413
- if (is_null($newest_sdk_data)) {
414
- // Couldn't find any SDK reference.
415
- $fs_active_plugins = new stdClass();
416
- update_option('fs_active_plugins', $fs_active_plugins);
417
- } else {
418
- fs_update_sdk_newest_version($newest_sdk_path, $newest_sdk_data->plugin_path);
419
- }
420
- }
421
- #region Actions / Filters -----------------------------------------
422
- /**
423
- * Apply filter for specific plugin.
424
- *
425
- * @author Vova Feldman (@svovaf)
426
- * @since 1.0.9
427
- *
428
- * @param string $slug Plugin slug
429
- * @param string $tag The name of the filter hook.
430
- * @param mixed $value The value on which the filters hooked to `$tag` are applied on.
431
- *
432
- * @return mixed The filtered value after all hooked functions are applied to it.
433
- *
434
- * @uses apply_filters()
435
- */
436
- function fs_apply_filter($slug, $tag, $value) {
437
- $args = func_get_args();
438
-
439
- return call_user_func_array('apply_filters', array_merge(
440
- array("fs_{$tag}_{$slug}"), array_slice($args, 2))
441
- );
442
- }
443
- #endregion Actions / Filters -----------------------------------------
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/fs-plugin-info-dialog.php DELETED
@@ -1,938 +0,0 @@
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.6
7
- */
8
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- /**
12
- * Class FS_Plugin_Info_Dialog
13
- *
14
- * @author Vova Feldman (@svovaf)
15
- * @since 1.1.7
16
- */
17
- class FS_Plugin_Info_Dialog {
18
- /**
19
- * @since 1.1.7
20
- *
21
- * @var FS_Logger
22
- */
23
- private $_logger;
24
- /**
25
- * @since 1.1.7
26
- *
27
- * @var Freemius
28
- */
29
- private $_fs;
30
- function __construct(Freemius $fs) {
31
- $this->_fs = $fs;
32
-
33
- $this->_logger = FS_Logger::get_logger(WP_FS__SLUG . '_' . $fs->get_slug() . '_info', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK);
34
-
35
- // Remove default plugin information action.
36
- remove_all_actions('install_plugins_pre_plugin-information');
37
-
38
- // Override action with custom plugins function for add-ons.
39
- add_action('install_plugins_pre_plugin-information', array(&$this, 'install_plugin_information'));
40
-
41
- // Override request for plugin information for Add-ons.
42
- add_filter(
43
- 'fs_plugins_api', array(&$this, '_get_addon_info_filter'), WP_FS__DEFAULT_PRIORITY, 3);
44
- }
45
- /**
46
- * Generate add-on plugin information.
47
- *
48
- * @author Vova Feldman (@svovaf)
49
- * @since 1.0.6
50
- *
51
- * @param array $data
52
- * @param string $action
53
- * @param object|null $args
54
- *
55
- * @return array|null
56
- */
57
- function _get_addon_info_filter($data, $action = '', $args = null) {
58
- $this->_logger->entrance();
59
-
60
- $parent_plugin_id = fs_request_get('parent_plugin_id', false);
61
-
62
- if ($this->_fs->get_id() != $parent_plugin_id ||
63
- ( 'plugin_information' !== $action ) ||
64
- !isset($args->slug)
65
- ) {
66
- return $data;
67
- }
68
-
69
- // Find add-on by slug.
70
- $selected_addon = $this->_fs->get_addon_by_slug($args->slug, WP_FS__DEV_MODE);
71
-
72
- if (false === $selected_addon) {
73
- return $data;
74
- }
75
-
76
- if (!isset($selected_addon->info)) {
77
- // Setup some default info.
78
- $selected_addon->info = new stdClass();
79
- $selected_addon->info->selling_point_0 = 'Selling Point 1';
80
- $selected_addon->info->selling_point_1 = 'Selling Point 2';
81
- $selected_addon->info->selling_point_2 = 'Selling Point 3';
82
- $selected_addon->info->description = '<p>Tell your users all about your add-on</p>';
83
- }
84
-
85
- fs_enqueue_local_style('fs_addons', '/admin/add-ons.css');
86
-
87
- $data = $args;
88
-
89
- $is_free = true;
90
-
91
- // Load add-on pricing.
92
- $has_pricing = false;
93
- $has_features = false;
94
- $plans = false;
95
- $plans_result = $this->_fs->get_api_site_or_plugin_scope()->get("/addons/{$selected_addon->id}/plans.json?type=visible");
96
- if (!isset($plans_result->error)) {
97
- $plans = $plans_result->plans;
98
- if (is_array($plans)) {
99
- for ($i = 0, $len = count($plans); $i < $len; $i ++) {
100
- $plans[$i] = new FS_Plugin_Plan($plans[$i]);
101
- $plan = $plans[$i];
102
-
103
- $pricing_result = $this->_fs->get_api_site_or_plugin_scope()->get("/addons/{$selected_addon->id}/plans/{$plan->id}/pricing.json");
104
- if (!isset($pricing_result->error)) {
105
- // Update plan's pricing.
106
- $plan->pricing = $pricing_result->pricing;
107
-
108
- if (is_array($plan->pricing) && !empty($plan->pricing)) {
109
- $is_free = false;
110
-
111
- foreach ($plan->pricing as &$pricing) {
112
- $pricing = new FS_Pricing($pricing);
113
- }
114
- }
115
-
116
- $has_pricing = true;
117
- }
118
-
119
- $features_result = $this->_fs->get_api_site_or_plugin_scope()->get("/addons/{$selected_addon->id}/plans/{$plan->id}/features.json");
120
- if (!isset($features_result->error) &&
121
- is_array($features_result->features) &&
122
- 0 < count($features_result->features)
123
- ) {
124
- // Update plan's pricing.
125
- $plan->features = $features_result->features;
126
-
127
- $has_features = true;
128
- }
129
- }
130
- }
131
- }
132
-
133
- // Fetch latest version from Freemius.
134
- $latest = $this->_fs->_fetch_latest_version($selected_addon->id);
135
-
136
- if (!$is_free) {
137
- // If paid add-on, then it's not on wordpress.org
138
- $is_wordpress_org = false;
139
- } else {
140
- // If no versions found, then assume it's a .org plugin.
141
- $is_wordpress_org = ( false === $latest );
142
- }
143
-
144
- if ($is_wordpress_org) {
145
- $repo_data = FS_Plugin_Updater::_fetch_plugin_info_from_repository(
146
- 'plugin_information', (object) array(
147
- 'slug' => $selected_addon->slug,
148
- 'is_ssl' => is_ssl(),
149
- 'fields' => array(
150
- 'banners' => true,
151
- 'reviews' => true,
152
- 'downloaded' => false,
153
- 'active_installs' => true
154
- )
155
- ));
156
-
157
- if (!empty($repo_data)) {
158
- $data = $repo_data;
159
- $data->wp_org_missing = false;
160
- } else {
161
- // Couldn't find plugin on .org.
162
- $is_wordpress_org = false;
163
-
164
- // Plugin is missing, not on Freemius nor WP.org.
165
- $data->wp_org_missing = true;
166
- }
167
- }
168
-
169
- if (!$is_wordpress_org) {
170
- $data->checkout_link = $this->_fs->checkout_url();
171
- $data->fs_missing = ( false === $latest );
172
-
173
- if ($is_free) {
174
- $data->download_link = $this->_fs->_get_latest_download_local_url($selected_addon->id);
175
- }
176
- }
177
-
178
- if (!$is_wordpress_org) {
179
- // Fetch as much as possible info from local files.
180
- $plugin_local_data = $this->_fs->get_plugin_data();
181
- $data->name = $selected_addon->title;
182
- $data->author = $plugin_local_data['Author'];
183
- $view_vars = array('plugin' => $selected_addon);
184
- $data->sections = array(
185
- 'description' => fs_get_template('/plugin-info/description.php', $view_vars),
186
- );
187
-
188
- if (!empty($selected_addon->info->banner_url)) {
189
- $data->banners = array(
190
- 'low' => $selected_addon->info->banner_url,
191
- );
192
- }
193
-
194
- if (!empty($selected_addon->info->screenshots)) {
195
- $view_vars = array(
196
- 'screenshots' => $selected_addon->info->screenshots,
197
- 'plugin' => $selected_addon,
198
- );
199
- $data->sections['screenshots'] = fs_get_template('/plugin-info/screenshots.php', $view_vars);
200
- }
201
-
202
- if (is_object($latest)) {
203
- $data->version = $latest->version;
204
- $data->last_updated = !is_null($latest->updated) ? $latest->updated : $latest->created;
205
- $data->requires = $latest->requires_platform_version;
206
- $data->tested = $latest->tested_up_to_version;
207
- } else {
208
- // Add dummy version.
209
- $data->version = '1.0.0';
210
-
211
- // Add message to developer to deploy the plugin through Freemius.
212
- }
213
- }
214
-
215
- if ($has_pricing) {
216
- // Add plans to data.
217
- $data->plans = $plans;
218
-
219
- if ($has_features) {
220
- $view_vars = array(
221
- 'plans' => $plans,
222
- 'plugin' => $selected_addon,
223
- );
224
- $data->sections['features'] = fs_get_template('/plugin-info/features.php', $view_vars);
225
- }
226
- }
227
-
228
- $data->is_paid = !$is_free;
229
- $data->external = !$is_wordpress_org;
230
-
231
- return $data;
232
- }
233
- /**
234
- * @author Vova Feldman (@svovaf)
235
- * @since 1.1.7
236
- *
237
- * @param FS_Plugin_Plan $plan
238
- *
239
- * @return string
240
- */
241
- private function get_billing_cycle(FS_Plugin_Plan $plan) {
242
- $billing_cycle = null;
243
-
244
- if (1 === count($plan->pricing) && 1 == $plan->pricing[0]->licenses) {
245
- $pricing = $plan->pricing[0];
246
- if (isset($pricing->annual_price)) {
247
- $billing_cycle = 'annual';
248
- } else if (isset($pricing->monthly_price)) {
249
- $billing_cycle = 'monthly';
250
- } else if (isset($pricing->lifetime_price)) {
251
- $billing_cycle = 'lifetime';
252
- }
253
- } else {
254
- foreach ($plan->pricing as $pricing) {
255
- if (isset($pricing->annual_price)) {
256
- $billing_cycle = 'annual';
257
- } else if (isset($pricing->monthly_price)) {
258
- $billing_cycle = 'monthly';
259
- } else if (isset($pricing->lifetime_price)) {
260
- $billing_cycle = 'lifetime';
261
- }
262
-
263
- if (!is_null($billing_cycle)) {
264
- break;
265
- }
266
- }
267
- }
268
-
269
- return $billing_cycle;
270
- }
271
- /**
272
- * @author Vova Feldman (@svovaf)
273
- * @since 1.1.7
274
- *
275
- * @param FS_Plugin_Plan $plan
276
- * @param FS_Pricing $pricing
277
- *
278
- * @return float|null|string
279
- */
280
- private function get_price_tag(FS_Plugin_Plan $plan, FS_Pricing $pricing) {
281
- $price_tag = '';
282
- if (isset($pricing->annual_price)) {
283
- $price_tag = $pricing->annual_price . ( $plan->is_block_features ? ' / year' : '' );
284
- } else if (isset($pricing->monthly_price)) {
285
- $price_tag = $pricing->monthly_price . ' / mo';
286
- } else if (isset($pricing->lifetime_price)) {
287
- $price_tag = $pricing->lifetime_price;
288
- }
289
-
290
- return '$' . $price_tag;
291
- }
292
- /**
293
- * @author Vova Feldman (@svovaf)
294
- * @since 1.1.7
295
- *
296
- * @param object $api
297
- * @param FS_Plugin_Plan|null $plan
298
- *
299
- * @return string
300
- */
301
- private function get_plugin_cta($api, $plan = null) {
302
- if (( current_user_can('install_plugins') || current_user_can('update_plugins'))) {
303
-
304
- if (!empty($api->checkout_link) && isset($api->plans) && 0 < is_array($api->plans)) {
305
- if (is_null($plan)) {
306
- $plan = $api->plans[0];
307
- }
308
-
309
- return ' <a class="button button-primary right" href="' . $this->_fs->addon_checkout_url(
310
- $plan->plugin_id, $plan->pricing[0]->id, $this->get_billing_cycle($plan), $plan->has_trial()
311
- ) . '" target="_parent">' .
312
- (!$plan->has_trial() ?
313
- fs_text('purchase', $api->slug) :
314
- sprintf(fs_text('start-free-x', $api->slug), $this->get_trial_period($plan))
315
- ) .
316
- '</a>';
317
-
318
- // @todo Add Cart concept.
319
- // echo ' <a class="button right" href="' . $status['url'] . '" target="_parent">' . __( 'Add to Cart' ) . '</a>';
320
- } else if (!empty($api->download_link)) {
321
- $status = install_plugin_install_status($api);
322
-
323
- // Hosted on WordPress.org.
324
- switch ($status['status']) {
325
- case 'install':
326
- if ($api->external &&
327
- $this->_fs->is_org_repo_compliant() ||
328
- !$this->_fs->is_premium()
329
- ) {
330
- /**
331
- * Add-on hosted on Freemius, not yet installed, and core
332
- * plugin is wordpress.org compliant. Therefore, require a download
333
- * since installing external plugins is not allowed by the wp.org guidelines.
334
- */
335
- return ' <a class="button button-primary right" href="' . esc_url($api->download_link) . '" target="_blank">' . fs_text('download-latest', $api->slug) . '</a>';
336
- } else {
337
- if ($status['url']) {
338
- return '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . fs_text('install-now', $api->slug) . '</a>';
339
- }
340
- }
341
- break;
342
- case 'update_available':
343
- if ($status['url']) {
344
- return '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . fs_text('install-update-now', $api->slug) . '</a>';
345
- }
346
- break;
347
- case 'newer_installed':
348
- return '<a class="button button-primary right disabled">' . sprintf(fs_text('newer-installed', $api->slug), $status['version']) . '</a>';
349
- break;
350
- case 'latest_installed':
351
- return '<a class="button button-primary right disabled">' . fs_text('latest-installed', $api->slug) . '</a>';
352
- break;
353
- }
354
- }
355
- }
356
-
357
- return '';
358
- }
359
- /**
360
- * @author Vova Feldman (@svovaf)
361
- * @since 1.1.7
362
- *
363
- * @param FS_Plugin_Plan $plan
364
- *
365
- * @return string
366
- */
367
- private function get_trial_period($plan) {
368
- $trial_period = (int) $plan->trial_period;
369
-
370
- switch ($trial_period) {
371
- case 30:
372
- return 'month';
373
- case 60:
374
- return '2 months';
375
- default:
376
- return "{$plan->trial_period} days";
377
- }
378
- }
379
- /**
380
- * Display plugin information in dialog box form.
381
- *
382
- * Based on core install_plugin_information() function.
383
- *
384
- * @author Vova Feldman (@svovaf)
385
- * @since 1.0.6
386
- */
387
- function install_plugin_information() {
388
- global $tab;
389
-
390
- if (empty($_REQUEST['plugin'])) {
391
- return;
392
- }
393
-
394
- $args = array(
395
- 'slug' => wp_unslash($_REQUEST['plugin']),
396
- 'is_ssl' => is_ssl(),
397
- 'fields' => array(
398
- 'banners' => true,
399
- 'reviews' => true,
400
- 'downloaded' => false,
401
- 'active_installs' => true
402
- )
403
- );
404
-
405
- if (is_array($args)) {
406
- $args = (object) $args;
407
- }
408
-
409
- if (!isset($args->per_page)) {
410
- $args->per_page = 24;
411
- }
412
-
413
- if (!isset($args->locale)) {
414
- $args->locale = get_locale();
415
- }
416
-
417
- $api = apply_filters('fs_plugins_api', false, 'plugin_information', $args);
418
-
419
- if (is_wp_error($api)) {
420
- wp_die($api);
421
- }
422
-
423
- $plugins_allowedtags = array(
424
- 'a' => array(
425
- 'href' => array(),
426
- 'title' => array(),
427
- 'target' => array(),
428
- // Add image style for screenshots.
429
- 'class' => array()
430
- ),
431
- 'style' => array(),
432
- 'abbr' => array('title' => array()),
433
- 'acronym' => array('title' => array()),
434
- 'code' => array(),
435
- 'pre' => array(),
436
- 'em' => array(),
437
- 'strong' => array(),
438
- 'div' => array('class' => array()),
439
- 'span' => array('class' => array()),
440
- 'p' => array(),
441
- 'ul' => array(),
442
- 'ol' => array(),
443
- 'li' => array('class' => array()),
444
- 'i' => array('class' => array()),
445
- 'h1' => array(),
446
- 'h2' => array(),
447
- 'h3' => array(),
448
- 'h4' => array(),
449
- 'h5' => array(),
450
- 'h6' => array(),
451
- 'img' => array('src' => array(), 'class' => array(), 'alt' => array()),
452
- // 'table' => array(),
453
- // 'td' => array(),
454
- // 'tr' => array(),
455
- // 'th' => array(),
456
- // 'thead' => array(),
457
- // 'tbody' => array(),
458
- );
459
-
460
- $plugins_section_titles = array(
461
- 'description' => fs_text('description', $api->slug),
462
- 'installation' => fs_text('installation', $api->slug),
463
- 'faq' => fs_text('faq', $api->slug),
464
- 'screenshots' => fs_text('screenshots', $api->slug),
465
- 'changelog' => fs_text('changelog', $api->slug),
466
- 'reviews' => fs_text('reviews', $api->slug),
467
- 'other_notes' => fs_text('other_notes', $api->slug),
468
- );
469
-
470
- // Sanitize HTML
471
- // foreach ( (array) $api->sections as $section_name => $content ) {
472
- // $api->sections[$section_name] = wp_kses( $content, $plugins_allowedtags );
473
- // }
474
-
475
- foreach (array('version', 'author', 'requires', 'tested', 'homepage', 'downloaded', 'slug') as $key) {
476
- if (isset($api->$key)) {
477
- $api->$key = wp_kses($api->$key, $plugins_allowedtags);
478
- }
479
- }
480
-
481
- // Add after $api->slug is ready.
482
- $plugins_section_titles['features'] = fs_text('features-and-pricing', $api->slug);
483
-
484
- $_tab = esc_attr($tab);
485
-
486
- $section = isset($_REQUEST['section']) ? wp_unslash($_REQUEST['section']) : 'description'; // Default to the Description tab, Do not translate, API returns English.
487
- if (empty($section) || !isset($api->sections[$section])) {
488
- $section_titles = array_keys((array) $api->sections);
489
- $section = array_shift($section_titles);
490
- }
491
-
492
- iframe_header(fs_text('plugin-install', $api->slug));
493
-
494
- $_with_banner = '';
495
-
496
- // var_dump($api->banners);
497
- if (!empty($api->banners) && (!empty($api->banners['low']) || !empty($api->banners['high']) )) {
498
- $_with_banner = 'with-banner';
499
- $low = empty($api->banners['low']) ? $api->banners['high'] : $api->banners['low'];
500
- $high = empty($api->banners['high']) ? $api->banners['low'] : $api->banners['high'];
501
- ?>
502
- <style type="text/css">
503
- #plugin-information-title.with-banner
504
- {
505
- background-image: url( <?php echo esc_url($low); ?> );
506
- }
507
-
508
- @media only screen and ( -webkit-min-device-pixel-ratio: 1.5 )
509
- {
510
- #plugin-information-title.with-banner
511
- {
512
- background-image: url( <?php echo esc_url($high); ?> );
513
- }
514
- }
515
- </style>
516
- <?php
517
- }
518
-
519
- echo '<div id="plugin-information-scrollable">';
520
- echo "<div id='{$_tab}-title' class='{$_with_banner}'><div class='vignette'></div><h2>{$api->name}</h2></div>";
521
- echo "<div id='{$_tab}-tabs' class='{$_with_banner}'>\n";
522
-
523
- foreach ((array) $api->sections as $section_name => $content) {
524
- if ('reviews' === $section_name && ( empty($api->ratings) || 0 === array_sum((array) $api->ratings) )) {
525
- continue;
526
- }
527
-
528
- if (isset($plugins_section_titles[$section_name])) {
529
- $title = $plugins_section_titles[$section_name];
530
- } else {
531
- $title = ucwords(str_replace('_', ' ', $section_name));
532
- }
533
-
534
- $class = ( $section_name === $section ) ? ' class="current"' : '';
535
- $href = add_query_arg(array('tab' => $tab, 'section' => $section_name));
536
- $href = esc_url($href);
537
- $san_section = esc_attr($section_name);
538
- echo "\t<a name='$san_section' href='$href' $class>$title</a>\n";
539
- }
540
-
541
- echo "</div>\n";
542
- ?>
543
- <div id="<?php echo $_tab; ?>-content" class='<?php echo $_with_banner; ?>'>
544
- <div class="fyi">
545
- <?php if ($api->is_paid) : ?>
546
- <?php if (isset($api->plans)) : ?>
547
- <div class="plugin-information-pricing">
548
- <?php foreach ($api->plans as $plan) : ?>
549
- <?php
550
- /**
551
- * @var FS_Plugin_Plan $plan
552
- */
553
- ?>
554
- <?php $first_pricing = $plan->pricing[0] ?>
555
- <?php $is_multi_cycle = $first_pricing->is_multi_cycle() ?>
556
- <div class="fs-plan<?php
557
- if (!$is_multi_cycle) {
558
- echo ' fs-single-cycle';
559
- }
560
- ?>" data-plan-id="<?php echo $plan->id ?>">
561
- <h3 data-plan="<?php echo $plan->id ?>"><?php printf(fs_text('x-plan', $api->slug), $plan->title) ?></h3>
562
- <?php $has_annual = $first_pricing->has_annual() ?>
563
- <?php $has_monthly = $first_pricing->has_monthly() ?>
564
- <div class="nav-tab-wrapper">
565
- <?php $billing_cycles = array('monthly', 'annual', 'lifetime') ?>
566
- <?php
567
- $i = 0;
568
- foreach ($billing_cycles as $cycle) :
569
- ?>
570
- <?php
571
- $prop = "{$cycle}_price";
572
- if (isset($first_pricing->{$prop})) :
573
- ?>
574
- <?php $is_featured = ( 'annual' === $cycle && $is_multi_cycle ) ?>
575
- <?php
576
- $prices = array();
577
- foreach ($plan->pricing as $pricing) {
578
- if (isset($pricing->{$prop})) {
579
- $prices[] = array(
580
- 'id' => $pricing->id,
581
- 'licenses' => $pricing->licenses,
582
- 'price' => $pricing->{$prop}
583
- );
584
- }
585
- }
586
- ?>
587
- <a class="nav-tab" data-billing-cycle="<?php echo $cycle ?>"
588
- data-pricing="<?php echo esc_attr(json_encode($prices)) ?>">
589
- <?php if ($is_featured) : ?>
590
- <label>&#9733; <?php fs_echo('best', $api->slug) ?> &#9733;</label>
591
- <?php endif ?>
592
- <?php fs_echo($cycle, $api->slug) ?>
593
- </a>
594
- <?php endif ?>
595
- <?php
596
- $i ++;
597
- endforeach
598
- ?>
599
- <?php wp_enqueue_script('jquery') ?>
600
- <script type="text/javascript">
601
- (function ($, undef) {
602
- var
603
- _formatBillingFrequency = function (cycle) {
604
- switch (cycle) {
605
- case 'monthly':
606
- return '<?php printf(fs_text('billed-x', $api->slug), fs_text('monthly', $api->slug)) ?>';
607
- case 'annual':
608
- return '<?php printf(fs_text('billed-x', $api->slug), fs_text('annually', $api->slug)) ?>';
609
- case 'lifetime':
610
- return '<?php printf(fs_text('billed-x', $api->slug), fs_text('once', $api->slug)) ?>';
611
- }
612
- },
613
- _formatLicensesTitle = function (pricing) {
614
- switch (pricing.licenses) {
615
- case 1:
616
- return '<?php fs_echo('license-single-site', $api->slug) ?>';
617
- case null:
618
- return '<?php fs_echo('license-unlimited', $api->slug) ?>';
619
- default:
620
- return '<?php fs_echo('license-x-sites', $api->slug) ?>'.replace('%s', pricing.licenses);
621
- }
622
- },
623
- _formatPrice = function (pricing, cycle, multipleLicenses) {
624
- if (undef === multipleLicenses)
625
- multipleLicenses = true;
626
-
627
- var priceCycle;
628
- switch (cycle) {
629
- case 'monthly':
630
- priceCycle = ' / <?php fs_echo('mo', $api->slug) ?>';
631
- break;
632
- case 'lifetime':
633
- priceCycle = '';
634
- break;
635
- case 'annual':
636
- default:
637
- priceCycle = ' / <?php fs_echo('year', $api->slug) ?>';
638
- break;
639
- }
640
-
641
- if (!multipleLicenses && 1 == pricing.licenses) {
642
- return '$' + pricing.price + priceCycle;
643
- }
644
-
645
- return _formatLicensesTitle(pricing) + ' - <var class="fs-price">$' + pricing.price + priceCycle + '</var>';
646
- },
647
- _checkoutUrl = function (plan, pricing, cycle) {
648
- return '<?php echo esc_url_raw(remove_query_arg('billing_cycle', add_query_arg(array('plugin_id' => $plan->plugin_id), $api->checkout_link))) ?>' +
649
- '&plan_id=' + plan +
650
- '&pricing_id=' + pricing +
651
- '&billing_cycle=' + cycle<?php
652
- if ($plan->has_trial()) {
653
- echo " + '&trial=true'";
654
- }
655
- ?>;
656
- },
657
- _updateCtaUrl = function (plan, pricing, cycle) {
658
- $('.plugin-information-pricing .button, #plugin-information-footer .button').attr('href', _checkoutUrl(plan, pricing, cycle));
659
- };
660
-
661
- $(document).ready(function () {
662
- var $plan = $('.plugin-information-pricing .fs-plan[data-plan-id=<?php echo $plan->id ?>]');
663
- $plan.find('input[type=radio]').live('click', function () {
664
- _updateCtaUrl(
665
- $plan.attr('data-plan-id'),
666
- $(this).val(),
667
- $plan.find('.nav-tab-active').attr('data-billing-cycle')
668
- );
669
-
670
- $plan.find('.fs-trial-terms .fs-price').html(
671
- $(this).parents('label').find('.fs-price').html()
672
- );
673
- });
674
-
675
- $plan.find('.nav-tab').click(function () {
676
- if ($(this).hasClass('nav-tab-active'))
677
- return;
678
-
679
- var $this = $(this),
680
- billingCycle = $this.attr('data-billing-cycle'),
681
- pricing = JSON.parse($this.attr('data-pricing')),
682
- $pricesList = $this.parents('.fs-plan').find('.fs-pricing-body .fs-licenses'),
683
- html = '';
684
-
685
- // Un-select previously selected tab.
686
- $plan.find('.nav-tab').removeClass('nav-tab-active');
687
-
688
- // Select current tab.
689
- $this.addClass('nav-tab-active');
690
-
691
- // Render licenses prices.
692
- if (1 == pricing.length) {
693
- html = '<li><label><?php fs_echo('price', $api->slug) ?>: ' + _formatPrice(pricing[0], billingCycle, false) + '</label></li>';
694
- } else {
695
- for (var i = 0; i < pricing.length; i++) {
696
- html += '<li><label><input name="pricing-<?php echo $plan->id ?>" type="radio" value="' + pricing[i].id + '">' + _formatPrice(pricing[i], billingCycle) + '</label></li>';
697
- }
698
- }
699
- $pricesList.html(html);
700
-
701
- if (1 < pricing.length) {
702
- // Select first license option.
703
- $pricesList.find('li:first input').click();
704
- } else {
705
- _updateCtaUrl(
706
- $plan.attr('data-plan-id'),
707
- pricing[0].id,
708
- billingCycle
709
- );
710
- }
711
-
712
- // Update billing frequency.
713
- $plan.find('.fs-billing-frequency').html(_formatBillingFrequency(billingCycle));
714
-
715
- if ('annual' === billingCycle) {
716
- $plan.find('.fs-annual-discount').show();
717
- } else {
718
- $plan.find('.fs-annual-discount').hide();
719
- }
720
- });
721
-
722
- <?php if ($has_annual) : ?>
723
- // Select annual by default.
724
- $plan.find('.nav-tab[data-billing-cycle=annual]').click();
725
- <?php else : ?>
726
- // Select first tab.
727
- $plan.find('.nav-tab:first').click();
728
- <?php endif ?>
729
- });
730
- }(jQuery));
731
- </script>
732
- </div>
733
- <div class="fs-pricing-body">
734
- <span class="fs-billing-frequency"></span>
735
- <?php $annual_discount = ( $has_annual && $has_monthly ) ? $plan->pricing[0]->annual_discount_percentage() : 0 ?>
736
- <?php if ($annual_discount > 0) : ?>
737
- <span
738
- class="fs-annual-discount"><?php printf(fs_text('save-x', $api->slug), $annual_discount . '%') ?></span>
739
- <?php endif ?>
740
- <ul class="fs-licenses">
741
- </ul>
742
- <?php echo $this->get_plugin_cta($api, $plan) ?>
743
- <div style="clear:both"></div>
744
- <?php if ($plan->has_trial()) : ?>
745
- <?php $trial_period = $this->get_trial_period($plan) ?>
746
- <ul class="fs-trial-terms">
747
- <li>
748
- <i class="dashicons dashicons-yes"></i><?php printf(fs_text('no-commitment-x', $api->slug), $trial_period) ?>
749
- </li>
750
- <li>
751
- <i class="dashicons dashicons-yes"></i><?php printf(fs_text('after-x-pay-as-little-y', $api->slug), $trial_period, '<var class="fs-price">' . $this->get_price_tag($plan, $plan->pricing[0]) . '</var>') ?>
752
- </li>
753
- </ul>
754
- <?php endif ?>
755
- </div>
756
- </div>
757
- </div>
758
- <?php endforeach ?>
759
- <?php endif ?>
760
- <?php endif ?>
761
- <div>
762
- <h3><?php fs_echo('details', $api->slug) ?></h3>
763
- <ul>
764
- <?php if (!empty($api->version)) { ?>
765
- <li><strong><?php fs_echo('version', $api->slug); ?>:</strong> <?php echo $api->version; ?></li>
766
- <?php
767
- }
768
- if (!empty($api->author)) {
769
- ?>
770
- <li>
771
- <strong><?php fs_echo('author:', $api->slug); ?></strong> <?php echo links_add_target($api->author, '_blank'); ?>
772
- </li>
773
- <?php
774
- }
775
- if (!empty($api->last_updated)) {
776
- ?>
777
- <li><strong><?php fs_echo('last-updated:', $api->slug); ?></strong> <span
778
- title="<?php echo $api->last_updated; ?>">
779
- <?php printf(fs_text('x-ago', $api->slug), human_time_diff(strtotime($api->last_updated))); ?>
780
- </span></li>
781
- <?php
782
- }
783
- if (!empty($api->requires)) {
784
- ?>
785
- <li>
786
- <strong><?php fs_echo('requires-wordpress-version:', $api->slug); ?></strong> <?php printf(fs_text('x-or-higher', $api->slug), $api->requires); ?>
787
- </li>
788
- <?php
789
- }
790
- if (!empty($api->tested)) {
791
- ?>
792
- <li><strong><?php fs_echo('compatible-up-to:', $api->slug); ?></strong> <?php echo $api->tested; ?>
793
- </li>
794
- <?php
795
- }
796
- if (!empty($api->downloaded)) {
797
- ?>
798
- <li>
799
- <strong><?php fs_echo('downloaded:', $api->slug); ?></strong> <?php
800
- printf(
801
- fs_text(( 1 == $api->downloaded ) ? 'x-time' : 'x-times', $api->slug), number_format_i18n($api->downloaded)
802
- );
803
- ?>
804
- </li>
805
- <?php
806
- }
807
- if (!empty($api->slug) && empty($api->external)) {
808
- ?>
809
- <li><a target="_blank"
810
- href="https://wordpress.org/plugins/<?php echo $api->slug; ?>/"><?php fs_echo('wp-org-plugin-page', $api->slug); ?> &#187;</a>
811
- </li>
812
- <?php
813
- }
814
- if (!empty($api->homepage)) {
815
- ?>
816
- <li><a target="_blank"
817
- href="<?php echo esc_url($api->homepage); ?>"><?php fs_echo('plugin-homepage', $api->slug); ?> &#187;</a>
818
- </li>
819
- <?php
820
- }
821
- if (!empty($api->donate_link) && empty($api->contributors)) {
822
- ?>
823
- <li><a target="_blank"
824
- href="<?php echo esc_url($api->donate_link); ?>"><?php fs_echo('donate-to-plugin', $api->slug); ?> &#187;</a>
825
- </li>
826
- <?php } ?>
827
- </ul>
828
- </div>
829
- <?php if (!empty($api->rating)) { ?>
830
- <h3><?php fs_echo('average-rating', $api->slug); ?></h3>
831
- <?php
832
- wp_star_rating(array(
833
- 'rating' => $api->rating,
834
- 'type' => 'percent',
835
- 'number' => $api->num_ratings
836
- ));
837
- ?>
838
- <small>(<?php
839
- printf(
840
- fs_text('based-on-x', $api->slug), sprintf(
841
- fs_text(( 1 == $api->num_ratings ) ? 'x-rating' : 'x-ratings', $api->slug), number_format_i18n($api->num_ratings)
842
- ));
843
- ?>)</small>
844
- <?php
845
- }
846
-
847
- if (!empty($api->ratings) && array_sum((array) $api->ratings) > 0) {
848
- foreach ($api->ratings as $key => $ratecount) {
849
- // Avoid div-by-zero.
850
- $_rating = $api->num_ratings ? ( $ratecount / $api->num_ratings ) : 0;
851
- $stars_label = sprintf(
852
- fs_text(( 1 == $key ) ? 'x-star' : 'x-stars', $api->slug), number_format_i18n($key)
853
- );
854
- ?>
855
- <div class="counter-container">
856
- <span class="counter-label"><a
857
- href="https://wordpress.org/support/view/plugin-reviews/<?php echo $api->slug; ?>?filter=<?php echo $key; ?>"
858
- target="_blank"
859
- title="<?php echo esc_attr(sprintf(fs_text('click-to-reviews', $api->slug), $stars_label)) ?>"><?php echo $stars_label ?></a></span>
860
- <span class="counter-back">
861
- <span class="counter-bar" style="width: <?php echo 92 * $_rating; ?>px;"></span>
862
- </span>
863
- <span class="counter-count"><?php echo number_format_i18n($ratecount); ?></span>
864
- </div>
865
- <?php
866
- }
867
- }
868
- if (!empty($api->contributors)) {
869
- ?>
870
- <h3><?php fs_echo('contributors', $api->slug); ?></h3>
871
- <ul class="contributors">
872
- <?php
873
- foreach ((array) $api->contributors as $contrib_username => $contrib_profile) {
874
- if (empty($contrib_username) && empty($contrib_profile)) {
875
- continue;
876
- }
877
- if (empty($contrib_username)) {
878
- $contrib_username = preg_replace('/^.+\/(.+)\/?$/', '\1', $contrib_profile);
879
- }
880
- $contrib_username = sanitize_user($contrib_username);
881
- if (empty($contrib_profile)) {
882
- echo "<li><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&amp;s=36' width='18' height='18' />{$contrib_username}</li>";
883
- } else {
884
- echo "<li><a href='{$contrib_profile}' target='_blank'><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&amp;s=36' width='18' height='18' />{$contrib_username}</a></li>";
885
- }
886
- }
887
- ?>
888
- </ul>
889
- <?php if (!empty($api->donate_link)) { ?>
890
- <a target="_blank"
891
- href="<?php echo esc_url($api->donate_link); ?>"><?php fs_echo('donate-to-plugin', $api->slug) ?> &#187;</a>
892
- <?php } ?>
893
- <?php } ?>
894
- </div>
895
- <div id="section-holder" class="wrap">
896
- <?php
897
- if (!empty($api->tested) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->tested)), $api->tested, '>')) {
898
- echo '<div class="notice notice-warning"><p>' . '<strong>' . fs_text('warning:', $api->slug) . '</strong> ' . fs_text('not-tested-warning', $api->slug) . '</p></div>';
899
- } else if (!empty($api->requires) && version_compare(substr($GLOBALS['wp_version'], 0, strlen($api->requires)), $api->requires, '<')) {
900
- echo '<div class="notice notice-warning"><p>' . '<strong>' . fs_text('warning:', $api->slug) . '</strong> ' . fs_text('not-compatible-warning', $api->slug) . '</p></div>';
901
- }
902
-
903
- foreach ((array) $api->sections as $section_name => $content) {
904
- $content = links_add_base_url($content, 'https://wordpress.org/plugins/' . $api->slug . '/');
905
- $content = links_add_target($content, '_blank');
906
-
907
- $san_section = esc_attr($section_name);
908
-
909
- $display = ( $section_name === $section ) ? 'block' : 'none';
910
-
911
- if ('description' === $section_name &&
912
- ( (!$api->external && $api->wp_org_missing ) ||
913
- ( $api->external && $api->fs_missing ) )
914
- ) {
915
- $missing_notice = array(
916
- 'type' => 'error',
917
- 'id' => md5(microtime()),
918
- 'message' => fs_text(( $api->is_paid ? 'paid-addon-not-deployed' : 'free-addon-not-deployed'), $api->slug),
919
- );
920
- fs_require_template('admin-notice.php', $missing_notice);
921
- }
922
- echo "\t<div id='section-{$san_section}' class='section' style='display: {$display};'>\n";
923
- echo $content;
924
- echo "\t</div>\n";
925
- }
926
- echo "</div>\n";
927
- echo "</div>\n";
928
- echo "</div>\n"; // #plugin-information-scrollable
929
- echo "<div id='$tab-footer'>\n";
930
-
931
- echo $this->get_plugin_cta($api);
932
-
933
- echo "</div>\n";
934
-
935
- iframe_footer();
936
- exit;
937
- }
938
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/i18n.php DELETED
@@ -1,518 +0,0 @@
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
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
-
12
- require_once dirname(__FILE__) . '/l10n.php';
13
-
14
- /**
15
- * All strings can now be overridden.
16
- *
17
- * For example, if we want to override:
18
- * 'you-are-step-away' => 'You are just one step away - %s',
19
- *
20
- * We can use the filter:
21
- * fs_override_i18n( array(
22
- * 'opt-in-connect' => __( "Yes - I'm in!", '{your-text_domain}' ),
23
- * 'skip' => __( 'Not today', '{your-text_domain}' ),
24
- * ), '{plugin_slug}' );
25
- *
26
- * Or with the Freemius instance:
27
- *
28
- * my_freemius->override_i18n( array(
29
- * 'opt-in-connect' => __( "Yes - I'm in!", '{your-text_domain}' ),
30
- * 'skip' => __( 'Not today', '{your-text_domain}' ),
31
- * );
32
- */
33
- global $fs_text;
34
-
35
- $fs_text = array(
36
- 'account' => _fs_text('Account'),
37
- 'addon' => _fs_text('Add On'),
38
- 'contact-us' => _fs_text('Contact Us'),
39
- 'contact-support' => _fs_text('Contact Support'),
40
- 'change-ownership' => _fs_text('Change Ownership'),
41
- 'support' => _fs_text('Support'),
42
- 'support-forum' => _fs_text('Support Forum'),
43
- 'add-ons' => _fs_text('Add Ons'),
44
- 'upgrade' => _fs_x('Upgrade', 'verb'),
45
- 'awesome' => _fs_text('Awesome'),
46
- 'pricing' => _fs_x('Pricing', 'noun'),
47
- 'price' => _fs_x('Price', 'noun'),
48
- 'unlimited-updates' => _fs_text('Unlimited Updates'),
49
- 'downgrade' => _fs_x('Downgrade', 'verb'),
50
- 'cancel-subscription' => _fs_x('Cancel Subscription', 'verb'),
51
- 'cancel-trial' => _fs_text('Cancel Trial'),
52
- 'free-trial' => _fs_text('Free Trial'),
53
- 'start-free-x' => _fs_text('Start my free %s'),
54
- 'no-commitment-x' => _fs_text('No commitment for %s - cancel anytime'),
55
- 'after-x-pay-as-little-y' => _fs_text('After your free %s, pay as little as %s'),
56
- 'details' => _fs_text('Details'),
57
- 'account-details' => _fs_text('Account Details'),
58
- 'delete' => _fs_x('Delete', 'verb'),
59
- 'show' => _fs_x('Show', 'verb'),
60
- 'hide' => _fs_x('Hide', 'verb'),
61
- 'edit' => _fs_x('Edit', 'verb'),
62
- 'update' => _fs_x('Update', 'verb'),
63
- 'date' => _fs_text('Date'),
64
- 'amount' => _fs_text('Amount'),
65
- 'invoice' => _fs_text('Invoice'),
66
- 'billing' => _fs_text('Billing'),
67
- 'payments' => _fs_text('Payments'),
68
- 'delete-account' => _fs_text('Delete Account'),
69
- 'dismiss' => _fs_x('Dismiss', 'as close a window'),
70
- 'plan' => _fs_x('Plan', 'as product pricing plan'),
71
- 'change-plan' => _fs_text('Change Plan'),
72
- 'download-x-version' => _fs_x('Download %s Version', 'as download professional version'),
73
- 'download-x-version-now' => _fs_x('Download %s version now', 'as download professional version now'),
74
- 'download-latest' => _fs_x('Download Latest', 'as download latest version'),
75
- 'you-have-x-license' => _fs_x('You have a %s license.', 'E.g. you have a professional license.'),
76
- 'new' => _fs_text('New'),
77
- 'free' => _fs_text('Free'),
78
- 'trial' => _fs_x('Trial', 'as trial plan'),
79
- 'start-trial' => _fs_x('Start Trial', 'as starting a trial plan'),
80
- 'purchase' => _fs_x('Purchase', 'verb'),
81
- 'purchase-license' => _fs_text('Purchase License'),
82
- 'buy' => _fs_x('Buy', 'verb'),
83
- 'buy-license' => _fs_text('Buy License'),
84
- 'license-single-site' => _fs_text('Single Site License'),
85
- 'license-unlimited' => _fs_text('Unlimited Licenses'),
86
- 'license-x-sites' => _fs_text('Up to %s Sites'),
87
- 'renew-license-now' => _fs_text('%sRenew your license now%s to access version %s features and support.'),
88
- 'ask-for-upgrade-email-address' => _fs_text("Enter the email address you've used for the upgrade below and we will resend you the license key."),
89
- 'x-plan' => _fs_x('%s Plan', 'e.g. Professional Plan'),
90
- 'you-are-step-away' => _fs_text('You are just one step away - %s'),
91
- 'activate-x-now' => _fs_x('Complete "%s" Activation Now', '%s - plugin name. As complete "Jetpack" activation now'),
92
- 'few-plugin-tweaks' => _fs_text('We made a few tweaks to the plugin, %s'),
93
- 'optin-x-now' => _fs_text('Opt-in to make "%s" Better!'),
94
- 'error' => _fs_text('Error'),
95
- 'failed-finding-main-path' => _fs_text('Freemius SDK couldn\'t find the plugin\'s main file. Please contact sdk@freemius.com with the current error.'),
96
- #region Account
97
- 'expiration' => _fs_x('Expiration', 'as expiration date'),
98
- 'license' => _fs_x('License', 'as software license'),
99
- 'not-verified' => _fs_text('not verified'),
100
- 'verify-email' => _fs_text('Verify Email'),
101
- 'expires-in' => _fs_x('Expires in %s', 'e.g. expires in 2 months'),
102
- 'renews-in' => _fs_x('Auto renews in %s', 'e.g. auto renews in 2 months'),
103
- 'no-expiration' => _fs_text('No expiration'),
104
- 'expired' => _fs_text('Expired'),
105
- 'cancelled' => _fs_text('Cancelled'),
106
- 'in-x' => _fs_x('In %s', 'e.g. In 2 hours'),
107
- 'x-ago' => _fs_x('%s ago', 'e.g. 2 min ago'),
108
- /* translators: %s: Version number (e.g. 4.6 or higher) */
109
- 'x-or-higher' => _fs_text('%s or higher'),
110
- 'version' => _fs_x('Version', 'as plugin version'),
111
- 'name' => _fs_text('Name'),
112
- 'email' => _fs_text('Email'),
113
- 'email-address' => _fs_text('Email address'),
114
- 'verified' => _fs_text('Verified'),
115
- 'module' => _fs_text('Module'),
116
- 'module-type' => _fs_text('Module Type'),
117
- 'plugin' => _fs_text('Plugin'),
118
- 'plugins' => _fs_text('Plugins'),
119
- 'theme' => _fs_text('Theme'),
120
- 'themes' => _fs_text('Themes'),
121
- 'path' => _fs_x('Path', 'as file/folder path'),
122
- 'title' => _fs_text('Title'),
123
- 'free-version' => _fs_text('Free version'),
124
- 'premium-version' => _fs_text('Premium version'),
125
- 'slug' => _fs_x('Slug', 'as WP plugin slug'),
126
- 'id' => _fs_text('ID'),
127
- 'users' => _fs_text('Users'),
128
- 'plugin-installs' => _fs_text('Plugin Installs'),
129
- 'module-installs' => _fs_text('%s Installs'),
130
- 'sites' => _fs_x('Sites', 'like websites'),
131
- 'user-id' => _fs_text('User ID'),
132
- 'site-id' => _fs_text('Site ID'),
133
- 'public-key' => _fs_text('Public Key'),
134
- 'secret-key' => _fs_text('Secret Key'),
135
- 'no-secret' => _fs_x('No Secret', 'as secret encryption key missing'),
136
- 'no-id' => _fs_text('No ID'),
137
- 'sync-license' => _fs_x('Sync License', 'as synchronize license'),
138
- 'sync' => _fs_x('Sync', 'as synchronize'),
139
- 'activate-license' => _fs_text('Activate License'),
140
- 'activate-free-version' => _fs_text('Activate Free Version'),
141
- 'activate-license-message' => _fs_text('Please enter the license key that you received in the email right after the purchase:'),
142
- 'activating-license' => _fs_text('Activating license...'),
143
- 'change-license' => _fs_text('Change License'),
144
- 'update-license' => _fs_text('Update License'),
145
- 'deactivate-license' => _fs_text('Deactivate License'),
146
- 'activate' => _fs_text('Activate'),
147
- 'deactivate' => _fs_text('Deactivate'),
148
- 'skip-deactivate' => _fs_text('Skip & Deactivate'),
149
- 'skip-and-x' => _fs_text('Skip & %s'),
150
- 'no-deactivate' => _fs_text('No - just deactivate'),
151
- 'yes-do-your-thing' => _fs_text('Yes - do your thing'),
152
- 'active' => _fs_x('Active', 'active mode'),
153
- 'is-active' => _fs_x('Is Active', 'is active mode?'),
154
- 'install-now' => _fs_text('Install Now'),
155
- 'install-update-now' => _fs_text('Install Update Now'),
156
- 'more-information-about-x' => _fs_text('More information about %s'),
157
- 'localhost' => _fs_text('Localhost'),
158
- 'activate-x-plan' => _fs_x('Activate %s Plan', 'as activate Professional plan'),
159
- 'x-left' => _fs_x('%s left', 'as 5 licenses left'),
160
- 'last-license' => _fs_text('Last license'),
161
- 'what-is-your-x' => _fs_text('What is your %s?'),
162
- 'activate-this-addon' => _fs_text('Activate this add-on'),
163
- 'deactivate-license-confirm' => _fs_text('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?'),
164
- 'delete-account-x-confirm' => _fs_text('Deleting the account will automatically deactivate your %s plan license so you can use it on other sites. If you want to terminate the recurring payments as well, click the "Cancel" button, and first "Downgrade" your account. Are you sure you would like to continue with the deletion?'),
165
- 'delete-account-confirm' => _fs_text('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?'),
166
- 'downgrade-x-confirm' => _fs_text('Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s.'),
167
- 'cancel-trial-confirm' => _fs_text('Cancelling the trial will immediately block access to all premium features. Are you sure?'),
168
- 'after-downgrade-non-blocking' => _fs_text('You can still enjoy all %s features but you will not have access to plugin updates and support.'),
169
- 'after-downgrade-blocking' => _fs_text('Once your license expires you can still use the Free version but you will NOT have access to the %s features.'),
170
- 'proceed-confirmation' => _fs_text('Are you sure you want to proceed?'),
171
- #endregion Account
172
- 'add-ons-for-x' => _fs_text('Add Ons for %s'),
173
- 'add-ons-missing' => _fs_text('We could\'nt load the add-ons list. It\'s probably an issue on our side, please try to come back in few minutes.'),
174
- #region Plugin Deactivation
175
- 'anonymous-feedback' => _fs_text('Anonymous feedback'),
176
- 'quick-feedback' => _fs_text('Quick feedback'),
177
- 'deactivation-share-reason' => _fs_text('If you have a moment, please let us know why you are deactivating'),
178
- 'deactivation-modal-button-confirm' => _fs_text('Yes - Deactivate'),
179
- 'deactivation-modal-button-submit' => _fs_text('Submit & Deactivate'),
180
- 'cancel' => _fs_text('Cancel'),
181
- 'reason-no-longer-needed' => _fs_text('I no longer need the plugin'),
182
- 'reason-found-a-better-plugin' => _fs_text('I found a better plugin'),
183
- 'reason-needed-for-a-short-period' => _fs_text('I only needed the plugin for a short period'),
184
- 'reason-broke-my-site' => _fs_text('The plugin broke my site'),
185
- 'reason-suddenly-stopped-working' => _fs_text('The plugin suddenly stopped working'),
186
- 'reason-cant-pay-anymore' => _fs_text("I can't pay for it anymore"),
187
- 'reason-temporary-deactivation' => _fs_text("It's a temporary deactivation. I'm just debugging an issue."),
188
- 'reason-other' => _fs_x('Other', 'the text of the "other" reason for deactivating the plugin that is shown in the modal box.'),
189
- 'ask-for-reason-message' => _fs_text('Kindly tell us the reason so we can improve.'),
190
- 'placeholder-plugin-name' => _fs_text("What's the plugin's name?"),
191
- 'placeholder-comfortable-price' => _fs_text('What price would you feel comfortable paying?'),
192
- 'reason-couldnt-make-it-work' => _fs_text("I couldn't understand how to make it work"),
193
- 'reason-great-but-need-specific-feature' => _fs_text("The plugin is great, but I need specific feature that you don't support"),
194
- 'reason-not-working' => _fs_text('The plugin is not working'),
195
- 'reason-not-what-i-was-looking-for' => _fs_text("It's not what I was looking for"),
196
- 'reason-didnt-work-as-expected' => _fs_text("The plugin didn't work as expected"),
197
- 'placeholder-feature' => _fs_text('What feature?'),
198
- 'placeholder-share-what-didnt-work' => _fs_text("Kindly share what didn't work so we can fix it for future users..."),
199
- 'placeholder-what-youve-been-looking-for' => _fs_text("What you've been looking for?"),
200
- 'placeholder-what-did-you-expect' => _fs_text("What did you expect?"),
201
- 'reason-didnt-work' => _fs_text("The plugin didn't work"),
202
- 'reason-dont-like-to-share-my-information' => _fs_text("I don't like to share my information with you"),
203
- 'dont-have-to-share-any-data' => _fs_text("You might have missed it, but you don't have to share any data and can just %s the opt-in."),
204
- #endregion Plugin Deactivation
205
- #region Connect
206
- 'hey-x' => _fs_x('Hey %s,', 'greeting'),
207
- 'thanks-x' => _fs_x('Thanks %s!', 'a greeting. E.g. Thanks John!'),
208
- 'connect-message' => _fs_text('Never miss an important update - opt-in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s.'),
209
- 'connect-message_on-update' => _fs_text('Please help us improve %1$s! If you opt-in, some data about your usage of %1$s will be sent to %4$s. If you skip this, that\'s okay! %1$s will still work just fine.'),
210
- 'pending-activation-message' => _fs_text('You should receive an activation email for %s to your mailbox at %s. Please make sure you click the activation button in that email to %s.'),
211
- 'complete-the-install' => _fs_text('complete the install'),
212
- 'start-the-trial' => _fs_text('start the trial'),
213
- 'thanks-for-purchasing' => _fs_text('Thanks for purchasing %s! To get started, please enter your license key:'),
214
- 'license-sync-disclaimer' => _fs_text('The plugin will be periodically sending data to %s to check for plugin updates and verify the validity of your license.'),
215
- 'what-permissions' => _fs_text('What permissions are being granted?'),
216
- 'permissions-profile' => _fs_text('Your Profile Overview'),
217
- 'permissions-profile_desc' => _fs_text('Name and email address'),
218
- 'permissions-site' => _fs_text('Your Site Overview'),
219
- 'permissions-site_desc' => _fs_text('Site URL, WP version, PHP info, plugins & themes'),
220
- 'permissions-events' => _fs_text('Current Plugin Events'),
221
- 'permissions-events_desc' => _fs_text('Activation, deactivation and uninstall'),
222
- 'permissions-plugins_themes' => _fs_text('Plugins & Themes'),
223
- 'permissions-plugins_themes_desc' => _fs_text('Titles, versions and state.'),
224
- 'permissions-admin-notices' => _fs_text('Admin Notices'),
225
- 'permissions-newsletter' => _fs_text('Newsletter'),
226
- 'permissions-newsletter_desc' => _fs_text('Updates, announcements, marketing, no spam'),
227
- 'privacy-policy' => _fs_text('Privacy Policy'),
228
- 'tos' => _fs_text('Terms of Service'),
229
- 'activating' => _fs_x('Activating', 'as activating plugin'),
230
- 'sending-email' => _fs_x('Sending email', 'as in the process of sending an email'),
231
- 'opt-in-connect' => _fs_x('Allow & Continue', 'button label'),
232
- 'agree-activate-license' => _fs_x('Agree & Activate License', 'button label'),
233
- 'skip' => _fs_x('Skip', 'verb'),
234
- 'click-here-to-use-plugin-anonymously' => _fs_text('Click here to use the plugin anonymously'),
235
- 'resend-activation-email' => _fs_text('Re-send activation email'),
236
- 'license-key' => _fs_text('License key'),
237
- 'send-license-key' => _fs_text('Send License Key'),
238
- 'sending-license-key' => _fs_text('Sending license key'),
239
- 'have-license-key' => _fs_text('Have a license key?'),
240
- 'dont-have-license-key' => _fs_text('Don\'t have a license key?'),
241
- 'cant-find-license-key' => _fs_text("Can't find your license key?"),
242
- 'email-not-found' => _fs_text("We couldn't find your email address in the system, are you sure it's the right address?"),
243
- 'no-active-licenses' => _fs_text("We can't see any active licenses associated with that email address, are you sure it's the right address?"),
244
- 'opt-in' => _fs_text('Opt In'),
245
- 'opt-out' => _fs_text('Opt Out'),
246
- 'opt-out-cancel' => _fs_text('On second thought - I want to continue helping'),
247
- 'opting-out' => _fs_text('Opting out...'),
248
- 'opting-in' => _fs_text('Opting in...'),
249
- 'opt-out-message-appreciation' => _fs_text('We appreciate your help in making the %s better by letting us track some usage data.'),
250
- 'opt-out-message-usage-tracking' => _fs_text("Usage tracking is done in the name of making %s better. Making a better user experience, prioritizing new features, and more good things. We'd really appreciate if you'll reconsider letting us continue with the tracking."),
251
- 'opt-out-message-clicking-opt-out' => _fs_text('By clicking "Opt Out", we will no longer be sending any data from %s to %s.'),
252
- #endregion Connect
253
- #region Screenshots
254
- 'screenshots' => _fs_text('Screenshots'),
255
- 'view-full-size-x' => _fs_text('Click to view full-size screenshot %d'),
256
- #endregion Screenshots
257
- #region Debug
258
- 'freemius-debug' => _fs_text('Freemius Debug'),
259
- 'on' => _fs_x('On', 'as turned on'),
260
- 'off' => _fs_x('Off', 'as turned off'),
261
- 'debugging' => _fs_x('Debugging', 'as code debugging'),
262
- 'freemius-state' => _fs_text('Freemius State'),
263
- 'connected' => _fs_x('Connected', 'as connection was successful'),
264
- 'blocked' => _fs_x('Blocked', 'as connection blocked'),
265
- 'api' => _fs_x('API', 'as application program interface'),
266
- 'sdk' => _fs_x('SDK', 'as software development kit versions'),
267
- 'sdk-versions' => _fs_x('SDK Versions', 'as software development kit versions'),
268
- 'plugin-path' => _fs_x('Plugin Path', 'as plugin folder path'),
269
- 'sdk-path' => _fs_x('SDK Path', 'as sdk path'),
270
- 'addons-of-x' => _fs_text('Add Ons of Plugin %s'),
271
- 'delete-all-confirm' => _fs_text('Are you sure you want to delete all Freemius data?'),
272
- 'actions' => _fs_text('Actions'),
273
- 'delete-all-accounts' => _fs_text('Delete All Accounts'),
274
- 'start-fresh' => _fs_text('Start Fresh'),
275
- 'clear-api-cache' => _fs_text('Clear API Cache'),
276
- 'sync-data-from-server' => _fs_text('Sync Data From Server'),
277
- 'scheduled-crons' => _fs_text('Scheduled Crons'),
278
- 'cron-type' => _fs_text('Cron Type'),
279
- 'plugins-themes-sync' => _fs_text('Plugins & Themes Sync'),
280
- 'licenses' => _fs_text('Licenses'),
281
- 'debug-log' => _fs_text('Debug Log'),
282
- 'all' => _fs_text('All'),
283
- 'file' => _fs_text('File'),
284
- 'function' => _fs_text('Function'),
285
- 'process-id' => _fs_text('Process ID'),
286
- 'logger' => _fs_text('Logger'),
287
- 'message' => _fs_text('Message'),
288
- 'download' => _fs_text('Download'),
289
- 'filter' => _fs_text('Filter'),
290
- 'type' => _fs_text('Type'),
291
- 'all-types' => _fs_text('All Types'),
292
- 'all-requests' => _fs_text('All Requests'),
293
- #endregion Debug
294
- #region Expressions
295
- 'congrats' => _fs_x('Congrats', 'as congratulations'),
296
- 'oops' => _fs_x('Oops', 'exclamation'),
297
- 'yee-haw' => _fs_x('Yee-haw', 'interjection expressing joy or exuberance'),
298
- 'woot' => _fs_x('W00t', '(especially in electronic communication) used to express elation, enthusiasm, or triumph.'),
299
- 'right-on' => _fs_x('Right on', 'a positive response'),
300
- 'hmm' => _fs_x('Hmm', 'something somebody says when they are thinking about what you have just said. '),
301
- 'ok' => _fs_text('O.K'),
302
- 'hey' => _fs_x('Hey', 'exclamation'),
303
- 'heads-up' => _fs_x('Heads up', 'advance notice of something that will need attention.'),
304
- #endregion Expressions
305
- #region Admin Notices
306
- 'you-have-latest' => _fs_text('Seems like you got the latest release.'),
307
- 'you-are-good' => _fs_text('You are all good!'),
308
- 'user-exist-message' => _fs_text('Sorry, we could not complete the email update. Another user with the same email is already registered.'),
309
- 'user-exist-message_ownership' => _fs_text('If you would like to give up the ownership of the plugin\'s account to %s click the Change Ownership button.'),
310
- 'email-updated-message' => _fs_text('Your email was successfully updated. You should receive an email with confirmation instructions in few moments.'),
311
- 'name-updated-message' => _fs_text('Your name was successfully updated.'),
312
- 'x-updated' => _fs_text('You have successfully updated your %s.'),
313
- 'name-update-failed-message' => _fs_text('Please provide your full name.'),
314
- 'verification-email-sent-message' => _fs_text('Verification mail was just sent to %s. If you can\'t find it after 5 min, please check your spam box.'),
315
- 'addons-info-external-message' => _fs_text('Just letting you know that the add-ons information of %s is being pulled from an external server.'),
316
- 'no-cc-required' => _fs_text('No credit card required'),
317
- 'premium-activated-message' => _fs_text('Premium plugin version was successfully activated.'),
318
- 'successful-version-upgrade-message' => _fs_text('The upgrade of %s was successfully completed.'),
319
- 'activation-with-plan-x-message' => _fs_text('Your account was successfully activated with the %s plan.'),
320
- 'download-latest-x-version-now' => _fs_text('Download the latest %s version now'),
321
- 'follow-steps-to-complete-upgrade' => _fs_text('Please follow these steps to complete the upgrade'),
322
- 'download-latest-x-version' => _fs_text('Download the latest %s version'),
323
- 'download-latest-version' => _fs_text('Download the latest version'),
324
- 'deactivate-free-version' => _fs_text('Deactivate the free version'),
325
- 'upload-and-activate' => _fs_text('Upload and activate the downloaded version'),
326
- 'howto-upload-activate' => _fs_text('How to upload and activate?'),
327
- 'addon-successfully-purchased-message' => _fs_x('%s Add-on was successfully purchased.', '%s - product name, e.g. Facebook add-on was successfully...'),
328
- 'addon-successfully-upgraded-message' => _fs_text('Your %s Add-on plan was successfully upgraded.'),
329
- 'email-verified-message' => _fs_text('Your email has been successfully verified - you are AWESOME!'),
330
- 'plan-upgraded-message' => _fs_text('Your plan was successfully upgraded.'),
331
- 'plan-changed-to-x-message' => _fs_text('Your plan was successfully changed to %s.'),
332
- 'license-expired-blocking-message' => _fs_text('Your license has expired. You can still continue using the free plugin forever.'),
333
- 'license-cancelled' => _fs_text('Your license has been cancelled. If you think it\'s a mistake, please contact support.'),
334
- 'trial-started-message' => _fs_text('Your trial has been successfully started.'),
335
- 'license-activated-message' => _fs_text('Your license was successfully activated.'),
336
- 'no-active-license-message' => _fs_text('It looks like your site currently doesn\'t have an active license.'),
337
- 'license-deactivation-message' => _fs_text('Your license was successfully deactivated, you are back to the %s plan.'),
338
- 'license-deactivation-failed-message' => _fs_text('It looks like the license deactivation failed.'),
339
- 'license-activation-failed-message' => _fs_text('It looks like the license could not be activated.'),
340
- 'server-error-message' => _fs_text('Error received from the server:'),
341
- 'trial-expired-message' => _fs_text('Your trial has expired. You can still continue using all our free features.'),
342
- 'plan-x-downgraded-message' => _fs_text('Your plan was successfully downgraded. Your %s plan license will expire in %s.'),
343
- 'plan-downgraded-failure-message' => _fs_text('Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes.'),
344
- 'trial-cancel-no-trial-message' => _fs_text('It looks like you are not in trial mode anymore so there\'s nothing to cancel :)'),
345
- 'trial-cancel-message' => _fs_text('Your %s free trial was successfully cancelled.'),
346
- 'version-x-released' => _fs_x('Version %s was released.', '%s - numeric version number'),
347
- 'please-download-x' => _fs_text('Please download %s.'),
348
- 'latest-x-version' => _fs_x('the latest %s version here', '%s - plan name, as the latest professional version here'),
349
- 'trial-x-promotion-message' => _fs_text('How do you like %s so far? Test all our %s premium features with a %d-day free trial.'),
350
- 'start-free-trial' => _fs_x('Start free trial', 'call to action'),
351
- 'starting-trial' => _fs_text('Starting trial'),
352
- 'please-wait' => _fs_text('Please wait'),
353
- 'trial-cancel-failure-message' => _fs_text('Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes.'),
354
- 'trial-utilized' => _fs_text('You already utilized a trial before.'),
355
- 'in-trial-mode' => _fs_text('You are already running the plugin in a trial mode.'),
356
- 'trial-plan-x-not-exist' => _fs_text('Plan %s do not exist, therefore, can\'t start a trial.'),
357
- 'plan-x-no-trial' => _fs_text('Plan %s does not support a trial period.'),
358
- 'no-trials' => _fs_text('None of the plugin\'s plans supports a trial period.'),
359
- 'unexpected-api-error' => _fs_text('Unexpected API error. Please contact the plugin\'s author with the following error.'),
360
- 'no-commitment-for-x-days' => _fs_text('No commitment for %s days - cancel anytime!'),
361
- 'license-expired-non-blocking-message' => _fs_text('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.'),
362
- 'could-not-activate-x' => _fs_text('Couldn\'t activate %s.'),
363
- 'contact-us-with-error-message' => _fs_text('Please contact us with the following message:'),
364
- 'plan-did-not-change-message' => _fs_text('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.'),
365
- 'contact-us-here' => _fs_text('Please contact us here'),
366
- 'plan-did-not-change-email-message' => _fs_text('I have upgraded my account but when I try to Sync the License, the plan remains %s.'),
367
- #endregion Admin Notices
368
- #region Connectivity Issues
369
- 'connectivity-test-fails-message' => _fs_text('From unknown reason, the API connectivity test failed.'),
370
- 'connectivity-test-maybe-temporary' => _fs_text('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?'),
371
- 'curl-missing-message' => _fs_text('We use PHP cURL library for the API calls, which is a very common library and usually installed and activated out of the box. Unfortunately, cURL is not activated (or disabled) on your server.'),
372
- 'curl-disabled-methods' => _fs_text('Disabled method(s):'),
373
- 'cloudflare-blocks-connection-message' => _fs_text('From unknown reason, CloudFlare, the firewall we use, blocks the connection.'),
374
- 'x-requires-access-to-api' => _fs_x('%s requires an access to our API.', 'as pluginX requires an access to our API'),
375
- 'squid-blocks-connection-message' => _fs_text('It looks like your server is using Squid ACL (access control lists), which blocks the connection.'),
376
- 'squid-no-clue-title' => _fs_text('I don\'t know what is Squid or ACL, help me!'),
377
- 'squid-no-clue-desc' => _fs_text('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.'),
378
- 'sysadmin-title' => _fs_text('I\'m a system administrator'),
379
- 'squid-sysadmin-desc' => _fs_text('Great, please whitelist the following domains: %s. Once you are done, deactivate the plugin and activate it again.'),
380
- 'curl-missing-no-clue-title' => _fs_text('I don\'t know what is cURL or how to install it, help me!'),
381
- 'curl-missing-no-clue-desc' => _fs_text('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.'),
382
- 'curl-missing-sysadmin-desc' => _fs_text('Great, please install cURL and enable it in your php.ini file. In addition, search for the \'disable_functions\' directive in your php.ini file and remove any disabled methods starting with \'curl_\'. To make sure it was successfully activated, use \'phpinfo()\'. Once activated, deactivate the plugin and reactivate it back again.'),
383
- 'happy-to-resolve-issue-asap' => _fs_text('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.'),
384
- 'contact-support-before-deactivation' => _fs_text('Sorry for the inconvenience and we are here to help if you give us a chance.'),
385
- 'fix-issue-title' => _fs_text('Yes - I\'m giving you a chance to fix it'),
386
- 'fix-issue-desc' => _fs_text('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.'),
387
- 'install-previous-title' => _fs_text('Let\'s try your previous version'),
388
- 'install-previous-desc' => _fs_text('Uninstall this version and install the previous one.'),
389
- 'deactivate-plugin-title' => _fs_text('That\'s exhausting, please deactivate'),
390
- 'deactivate-plugin-desc' => _fs_text('We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future.'),
391
- 'fix-request-sent-message' => _fs_text('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.'),
392
- 'server-blocking-access' => _fs_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'),
393
- 'wrong-authentication-param-message' => _fs_text('It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again.'),
394
- #endregion Connectivity Issues
395
- #region Change Owner
396
- 'change-owner-request-sent-x' => _fs_text('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.'),
397
- 'change-owner-request_owner-confirmed' => _fs_text('Thanks for confirming the ownership change. An email was just sent to %s for final approval.'),
398
- 'change-owner-request_candidate-confirmed' => _fs_text('%s is the new owner of the account.'),
399
- #endregion Change Owner
400
- 'addon-x-cannot-run-without-y' => _fs_x('%s cannot run without %s.', 'addonX cannot run without pluginY'),
401
- 'addon-x-cannot-run-without-parent' => _fs_x('%s cannot run without the plugin.', 'addonX cannot run...'),
402
- 'plugin-x-activation-message' => _fs_x('%s activation was successfully completed.', 'pluginX activation was successfully...'),
403
- 'features-and-pricing' => _fs_x('Features & Pricing', 'Plugin installer section title'),
404
- 'free-addon-not-deployed' => _fs_text('Add-on must be deployed to WordPress.org or Freemius.'),
405
- 'paid-addon-not-deployed' => _fs_text('Paid add-on must be deployed to Freemius.'),
406
- #--------------------------------------------------------------------------------
407
- #region Add-On Licensing
408
- #--------------------------------------------------------------------------------
409
- 'addon-no-license-message' => _fs_text('%s is a premium only add-on. You have to purchase a license first before activating the plugin.'),
410
- 'addon-trial-cancelled-message' => _fs_text('%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.'),
411
- #endregion
412
- #--------------------------------------------------------------------------------
413
- #region Billing Cycles
414
- #--------------------------------------------------------------------------------
415
- 'monthly' => _fs_x('Monthly', 'as every month'),
416
- 'mo' => _fs_x('mo', 'as monthly period'),
417
- 'annual' => _fs_x('Annual', 'as once a year'),
418
- 'annually' => _fs_x('Annually', 'as once a year'),
419
- 'once' => _fs_x('Once', 'as once a year'),
420
- 'year' => _fs_x('year', 'as annual period'),
421
- 'lifetime' => _fs_text('Lifetime'),
422
- 'best' => _fs_x('Best', 'e.g. the best product'),
423
- 'billed-x' => _fs_x('Billed %s', 'e.g. billed monthly'),
424
- 'save-x' => _fs_x('Save %s', 'as a discount of $5 or 10%'),
425
- #endregion Billing Cycles
426
- 'view-details' => _fs_text('View details'),
427
- #--------------------------------------------------------------------------------
428
- #region Trial
429
- #--------------------------------------------------------------------------------
430
- 'approve-start-trial' => _fs_x('Approve & Start Trial', 'button label'),
431
- /* translators: %1$s: Number of trial days; %2$s: Plan name; */
432
- 'start-trial-prompt-header' => _fs_text('You are 1-click away from starting your %1$s-day free trial of the %2$s plan.'),
433
- /* translators: %s: Link to freemius.com */
434
- 'start-trial-prompt-message' => _fs_text('For compliance with the WordPress.org guidelines, before we start the trial we ask that you opt-in with your user and non-sensitive site information, allowing the plugin to periodically send data to %s to check for version updates and to validate your trial.'),
435
- #endregion
436
- #--------------------------------------------------------------------------------
437
- #region Billing Details
438
- #--------------------------------------------------------------------------------
439
- 'business-name' => _fs_text('Business name'),
440
- 'tax-vat-id' => _fs_text('Tax / VAT ID'),
441
- 'address-line-n' => _fs_text('Address Line %d'),
442
- 'country' => _fs_text('Country'),
443
- 'select-country' => _fs_text('Select Country'),
444
- 'city' => _fs_text('City'),
445
- 'town' => _fs_text('Town'),
446
- 'state' => _fs_text('State'),
447
- 'province' => _fs_text('Province'),
448
- 'zip-postal-code' => _fs_text('ZIP / Postal Code'),
449
- #endregion
450
- #--------------------------------------------------------------------------------
451
- #region Module Installation
452
- #--------------------------------------------------------------------------------
453
- 'installing-plugin-x' => _fs_text('Installing plugin: %s'),
454
- 'auto-installation' => _fs_text('Automatic Installation'),
455
- /* translators: %s: Number of seconds */
456
- 'x-sec' => _fs_text('%s sec'),
457
- 'installing-in-n' => _fs_text('An automated download and installation of %s (paid version) from %s will start in %s. If you would like to do it manually - click the cancellation button now.'),
458
- 'installing-module-x' => _fs_text('The installation process has started and may take a few minutes to complete. Please wait until it is done - do not refresh this page.'),
459
- 'cancel-installation' => _fs_text('Cancel Installation'),
460
- 'module-package-rename-failure' => _fs_text('The remote plugin package does not contain a folder with the desired slug and renaming did not work.'),
461
- 'auto-install-error-invalid-id' => _fs_text('Invalid module ID.'),
462
- 'auto-install-error-not-opted-in' => _fs_text('Auto installation only works for opted-in users.'),
463
- 'auto-install-error-premium-activated' => _fs_text('Premium version already active.'),
464
- 'auto-install-error-premium-addon-activated' => _fs_text('Premium add-on version already installed.'),
465
- 'auto-install-error-invalid-license' => _fs_text('You do not have a valid license to access the premium version.'),
466
- 'auto-install-error-serviceware' => _fs_text('Plugin is a "Serviceware" which means it does not have a premium code version.'),
467
- #endregion
468
- );
469
-
470
- /**
471
- * Localization of the strings in the plugin/theme info dialog box.
472
- *
473
- * $fs_module_info_text should ONLY include strings that are not located in $fs_text.
474
- *
475
- * @author Vova Feldman (@svovaf)
476
- * @since 1.2.2
477
- */
478
- global $fs_module_info_text;
479
-
480
- $fs_module_info_text = array(
481
- 'description' => _fs_x('Description', 'Plugin installer section title'),
482
- 'installation' => _fs_x('Installation', 'Plugin installer section title'),
483
- 'faq' => _fs_x('FAQ', 'Plugin installer section title'),
484
- 'changelog' => _fs_x('Changelog', 'Plugin installer section title'),
485
- 'reviews' => _fs_x('Reviews', 'Plugin installer section title'),
486
- 'other_notes' => _fs_x('Other Notes', 'Plugin installer section title'),
487
- /* translators: %s: 1 or One */
488
- 'x-star' => _fs_text('%s star'),
489
- /* translators: %s: Number larger than 1 */
490
- 'x-stars' => _fs_text('%s stars'),
491
- /* translators: %s: 1 or One */
492
- 'x-rating' => _fs_text('%s rating'),
493
- /* translators: %s: Number larger than 1 */
494
- 'x-ratings' => _fs_text('%s ratings'),
495
- /* translators: %s: 1 or One (Number of times downloaded) */
496
- 'x-time' => _fs_text('%s time'),
497
- /* translators: %s: Number of times downloaded */
498
- 'x-times' => _fs_text('%s times'),
499
- /* translators: %s: # of stars (e.g. 5 stars) */
500
- 'click-to-reviews' => _fs_text('Click to see reviews that provided a rating of %s'),
501
- 'last-updated:' => _fs_text('Last Updated'),
502
- 'requires-wordpress-version:' => _fs_text('Requires WordPress Version:'),
503
- 'author:' => _fs_x('Author:', 'as the plugin author'),
504
- 'compatible-up-to:' => _fs_text('Compatible up to:'),
505
- 'downloaded:' => _fs_text('Downloaded:'),
506
- 'wp-org-plugin-page' => _fs_text('WordPress.org Plugin Page'),
507
- 'plugin-homepage' => _fs_text('Plugin Homepage'),
508
- 'donate-to-plugin' => _fs_text('Donate to this plugin'),
509
- 'average-rating' => _fs_text('Average Rating'),
510
- 'based-on-x' => _fs_text('based on %s'),
511
- 'warning:' => _fs_text('Warning:'),
512
- 'contributors' => _fs_text('Contributors'),
513
- 'plugin-install' => _fs_text('Plugin Install'),
514
- 'not-tested-warning' => _fs_text('This plugin has not been tested with your current version of WordPress.'),
515
- 'not-compatible-warning' => _fs_text('This plugin has not been marked as compatible with your version of WordPress.'),
516
- 'newer-installed' => _fs_text('Newer Version (%s) Installed'),
517
- 'latest-installed' => _fs_text('Latest Version Installed'),
518
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/index.php DELETED
@@ -1,3 +0,0 @@
1
- <?php
2
- // Silence is golden.
3
- // Hide file structure from users on unprotected servers.
 
 
 
freemius/includes/l10n.php DELETED
@@ -1,235 +0,0 @@
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.2.1.6
7
- */
8
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- /**
12
- * Retrieve the translation of $text.
13
- *
14
- * @since 1.2.1.6
15
- *
16
- * @param string $text
17
- *
18
- * @return string
19
- */
20
- function _fs_text($text) {
21
- return translate($text, 'freemius');
22
- }
23
- /**
24
- * Retrieve the translation of $text and escapes it for safe use in an attribute.
25
- *
26
- * @since 1.2.1.6
27
- *
28
- * @param string $text
29
- *
30
- * @return string
31
- */
32
- function _fs_esc_attr($text) {
33
- return esc_attr(translate($text, 'freemius'));
34
- }
35
- /**
36
- * Retrieve the translation of $text and escapes it for safe use in HTML output.
37
- *
38
- * @since 1.2.1.6
39
- *
40
- * @param string $text
41
- *
42
- * @return string
43
- */
44
- function _fs_esc_html($text) {
45
- return esc_html(translate($text, 'freemius'));
46
- }
47
- /**
48
- * Display translated text.
49
- *
50
- * @since 1.2.0
51
- *
52
- * @param string $text
53
- */
54
- function _fs_echo($text) {
55
- echo translate($text, 'freemius');
56
- }
57
- /**
58
- * Display translated text that has been escaped for safe use in an attribute.
59
- *
60
- * @since 1.2.1.6
61
- *
62
- * @param string $text
63
- */
64
- function _fs_esc_attr_echo($text) {
65
- echo esc_attr(translate($text, 'freemius'));
66
- }
67
- /**
68
- * Display translated text that has been escaped for safe use in HTML output.
69
- *
70
- * @since 1.2.1.6
71
- *
72
- * @param string $text
73
- */
74
- function _fs_esc_html_echo($text) {
75
- echo esc_html(translate($text, 'freemius'));
76
- }
77
- /**
78
- * Retrieve translated string with gettext context.
79
- *
80
- * Quite a few times, there will be collisions with similar translatable text
81
- * found in more than two places, but with different translated context.
82
- *
83
- * By including the context in the pot file, translators can translate the two
84
- * strings differently.
85
- *
86
- * @since 1.2.1.6
87
- *
88
- * @param string $text
89
- * @param string $context
90
- *
91
- * @return string
92
- */
93
- function _fs_x($text, $context) {
94
- return translate_with_gettext_context($text, $context, 'freemius');
95
- }
96
- /**
97
- * Display translated string with gettext context.
98
- *
99
- * @since 1.2.1.6
100
- *
101
- * @param string $text
102
- * @param string $context
103
- */
104
- function _fs_ex($text, $context) {
105
- // Avoid misleading Theme Check warning.
106
- $fn = '_x';
107
- echo $fn($text, $context, 'freemius');
108
- }
109
- /**
110
- * Translate string with gettext context, and escapes it for safe use in an attribute.
111
- *
112
- * @since 1.2.1.6
113
- *
114
- * @param string $text
115
- * @param string $context
116
- *
117
- * @return string
118
- */
119
- function _fs_esc_attr_x($text, $context) {
120
- return esc_attr(translate_with_gettext_context($text, $context, 'freemius'));
121
- }
122
- /**
123
- * Translate string with gettext context, and escapes it for safe use in HTML output.
124
- *
125
- * @since 2.9.0
126
- *
127
- * @param string $text
128
- * @param string $context
129
- *
130
- * @return string
131
- */
132
- function _fs_esc_html_x($text, $context) {
133
- return esc_html(translate_with_gettext_context($text, $context, 'freemius'));
134
- }
135
- /**
136
- * Translates and retrieves the singular or plural form based on the supplied number.
137
- *
138
- * @since 1.2.1.6
139
- *
140
- * @param string $single
141
- * @param string $plural
142
- * @param int $number
143
- *
144
- * @return string
145
- */
146
- function _fs_n($single, $plural, $number) {
147
- $translations = get_translations_for_domain('freemius');
148
- $translation = $translations->translate_plural($single, $plural, $number);
149
-
150
- /**
151
- * Filters the singular or plural form of a string.
152
- *
153
- * @since WP 2.2.0
154
- *
155
- * @param string $translation
156
- * @param string $single
157
- * @param string $plural
158
- * @param string $number
159
- * @param string $domain
160
- */
161
- return apply_filters('ngettext', $translation, $single, $plural, $number, 'freemius');
162
- }
163
- /**
164
- * Translates and retrieves the singular or plural form based on the supplied number, with gettext context.
165
- *
166
- * @since 1.2.1.6
167
- *
168
- * @param string $single
169
- * @param string $plural
170
- * @param int $number
171
- * @param string $context
172
- *
173
- * @return string
174
- */
175
- function _fs_nx($single, $plural, $number, $context) {
176
- $translations = get_translations_for_domain('freemius');
177
- $translation = $translations->translate_plural($single, $plural, $number, $context);
178
-
179
- /**
180
- * Filters the singular or plural form of a string with gettext context.
181
- *
182
- * @since WP 3.0
183
- *
184
- * @param string $translation
185
- * @param string $single
186
- * @param string $plural
187
- * @param string $number
188
- * @param string $context
189
- * @param string $domain
190
- */
191
- return apply_filters('ngettext_with_context', $translation, $single, $plural, $number, $context, 'freemius');
192
- }
193
- /**
194
- * Registers plural strings in POT file, but does not translate them.
195
- *
196
- * Used when you want to keep structures with translatable plural
197
- * strings and use them later when the number is known.
198
- *
199
- * @since 1.2.1.6
200
- *
201
- * @param string $singular
202
- * @param string $plural
203
- *
204
- * @return array
205
- */
206
- function _fs_n_noop($singular, $plural) {
207
- return array(
208
- 'singular' => $singular,
209
- 'plural' => $plural,
210
- 'context' => null,
211
- 'domain' => 'freemius'
212
- );
213
- }
214
- /**
215
- * Registers plural strings with gettext context in POT file, but does not translate them.
216
- *
217
- * Used when you want to keep structures with translatable plural
218
- * strings and use them later when the number is known.
219
- *
220
- * @since 1.2.1.6
221
- *
222
- * @param string $singular
223
- * @param string $plural
224
- * @param string $context
225
- *
226
- * @return array
227
- */
228
- function _fs_nx_noop($singular, $plural, $context) {
229
- return array(
230
- 'singular' => $singular,
231
- 'plural' => $plural,
232
- 'context' => $context,
233
- 'domain' => 'freemius'
234
- );
235
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/managers/class-fs-admin-menu-manager.php DELETED
@@ -1,700 +0,0 @@
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.3
7
- */
8
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- class FS_Admin_Menu_Manager {
12
- #region Properties
13
- /**
14
- * @var string
15
- */
16
- protected $_plugin_slug;
17
- /**
18
- * @since 1.0.6
19
- *
20
- * @var string
21
- */
22
- private $_menu_slug;
23
- /**
24
- * @since 1.1.3
25
- *
26
- * @var string
27
- */
28
- private $_parent_slug;
29
- /**
30
- * @since 1.1.3
31
- *
32
- * @var string
33
- */
34
- private $_parent_type;
35
- /**
36
- * @since 1.1.3
37
- *
38
- * @var string
39
- */
40
- private $_type;
41
- /**
42
- * @since 1.1.3
43
- *
44
- * @var bool
45
- */
46
- private $_is_top_level;
47
- /**
48
- * @since 1.1.3
49
- *
50
- * @var bool
51
- */
52
- private $_is_override_exact;
53
- /**
54
- * @since 1.1.3
55
- *
56
- * @var array<string,bool>
57
- */
58
- private $_default_submenu_items;
59
- /**
60
- * @since 1.1.3
61
- *
62
- * @var string
63
- */
64
- private $_first_time_path;
65
- /**
66
- * @since 1.2.2
67
- *
68
- * @var bool
69
- */
70
- private $_menu_exists;
71
-
72
- #endregion Properties
73
- /**
74
- * @var FS_Logger
75
- */
76
- protected $_logger;
77
-
78
- #region Singleton
79
- /**
80
- * @var FS_Admin_Menu_Manager[]
81
- */
82
- private static $_instances = array();
83
- /**
84
- * @param string $plugin_slug
85
- *
86
- * @return FS_Admin_Menu_Manager
87
- */
88
- static function instance($plugin_slug) {
89
- if (!isset(self::$_instances[$plugin_slug])) {
90
- self::$_instances[$plugin_slug] = new FS_Admin_Menu_Manager($plugin_slug);
91
- }
92
-
93
- return self::$_instances[$plugin_slug];
94
- }
95
- protected function __construct($plugin_slug) {
96
- $this->_logger = FS_Logger::get_logger(WP_FS__SLUG . '_' . $plugin_slug . '_admin_menu', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK);
97
-
98
- $this->_plugin_slug = $plugin_slug;
99
- }
100
- #endregion Singleton
101
- #region Helpers
102
- private function get_option(&$options, $key, $default = false) {
103
- return !empty($options[$key]) ? $options[$key] : $default;
104
- }
105
- private function get_bool_option(&$options, $key, $default = false) {
106
- return isset($options[$key]) && is_bool($options[$key]) ? $options[$key] : $default;
107
- }
108
- #endregion Helpers
109
- /**
110
- * @param array $menu
111
- * @param bool $is_addon
112
- */
113
- function init($menu, $is_addon = false) {
114
- $this->_menu_exists = ( isset($menu['slug']) && !empty($menu['slug']) );
115
-
116
- $this->_menu_slug = !empty($menu['slug']) ? $menu['slug'] : null;
117
-
118
- $this->_default_submenu_items = array();
119
- // @deprecated
120
- $this->_type = 'page';
121
- $this->_is_top_level = true;
122
- $this->_is_override_exact = false;
123
- $this->_parent_slug = false;
124
- // @deprecated
125
- $this->_parent_type = 'page';
126
-
127
- if (!$is_addon && isset($menu)) {
128
- $this->_default_submenu_items = array(
129
- 'contact' => $this->get_bool_option($menu, 'contact', true),
130
- 'support' => $this->get_bool_option($menu, 'support', true),
131
- 'account' => $this->get_bool_option($menu, 'account', true),
132
- 'pricing' => $this->get_bool_option($menu, 'pricing', true),
133
- 'addons' => $this->get_bool_option($menu, 'addons', true),
134
- );
135
-
136
- // @deprecated
137
- $this->_type = $this->get_option($menu, 'type', 'page');
138
- $this->_is_override_exact = $this->get_bool_option($menu, 'override_exact');
139
-
140
- if (isset($menu['parent'])) {
141
- $this->_parent_slug = $this->get_option($menu['parent'], 'slug');
142
- // @deprecated
143
- $this->_parent_type = $this->get_option($menu['parent'], 'type', 'page');
144
-
145
- // If parent's slug is different, then it's NOT a top level menu item.
146
- $this->_is_top_level = ( $this->_parent_slug === $this->_menu_slug );
147
- } else {
148
- /**
149
- * If no parent then top level if:
150
- * - Has custom admin menu ('page')
151
- * - CPT menu type ('cpt')
152
- */
153
- // $this->_is_top_level = in_array( $this->_type, array(
154
- // 'cpt',
155
- // 'page'
156
- // ) );
157
- }
158
-
159
- $this->_first_time_path = $this->get_option($menu, 'first-path', false);
160
- if (!empty($this->_first_time_path) && is_string($this->_first_time_path)) {
161
- $this->_first_time_path = admin_url($this->_first_time_path, 'admin');
162
- }
163
- }
164
- }
165
- /**
166
- * Check if top level menu.
167
- *
168
- * @author Vova Feldman (@svovaf)
169
- * @since 1.1.3
170
- *
171
- * @return bool False if submenu item.
172
- */
173
- function is_top_level() {
174
- return $this->_is_top_level;
175
- }
176
- /**
177
- * Check if the page should be override on exact URL match.
178
- *
179
- * @author Vova Feldman (@svovaf)
180
- * @since 1.1.3
181
- *
182
- * @return bool False if submenu item.
183
- */
184
- function is_override_exact() {
185
- return $this->_is_override_exact;
186
- }
187
- /**
188
- * Get the path of the page the user should be forwarded to after first activation.
189
- *
190
- * @author Vova Feldman (@svovaf)
191
- * @since 1.1.3
192
- *
193
- * @return string
194
- */
195
- function get_first_time_path() {
196
- return $this->_first_time_path;
197
- }
198
- /**
199
- * Check if plugin's menu item is part of a custom top level menu.
200
- *
201
- * @author Vova Feldman (@svovaf)
202
- * @since 1.1.3
203
- *
204
- * @return bool
205
- */
206
- function has_custom_parent() {
207
- return !$this->_is_top_level && is_string($this->_parent_slug);
208
- }
209
- /**
210
- * @author Leo Fajardo (@leorw)
211
- * @since 1.2.2
212
- *
213
- * @return bool
214
- */
215
- function has_menu() {
216
- return $this->_menu_exists;
217
- }
218
- /**
219
- * @author Vova Feldman (@svovaf)
220
- * @since 1.1.3
221
- *
222
- * @param string $id
223
- * @param bool $default
224
- *
225
- * @return bool
226
- */
227
- function is_submenu_item_visible($id, $default = true) {
228
- if (!$this->has_menu()) {
229
- return false;
230
- }
231
-
232
- return fs_apply_filter(
233
- $this->_plugin_slug, 'is_submenu_visible', $this->get_bool_option($this->_default_submenu_items, $id, $default), $id
234
- );
235
- }
236
- /**
237
- * Calculates admin settings menu slug.
238
- * If plugin's menu slug is a file (e.g. CPT), uses plugin's slug as the menu slug.
239
- *
240
- * @author Vova Feldman (@svovaf)
241
- * @since 1.1.3
242
- *
243
- * @param string $page
244
- *
245
- * @return string
246
- */
247
- function get_slug($page = '') {
248
- return ( ( false === strpos($this->_menu_slug, '.php?') ) ?
249
- $this->_menu_slug :
250
- $this->_plugin_slug ) . ( empty($page) ? '' : ( '-' . $page ) );
251
- }
252
- /**
253
- * Check if module has a menu slug set.
254
- *
255
- * @author Vova Feldman (@svovaf)
256
- * @since 1.2.1.6
257
- *
258
- * @return bool
259
- */
260
- function has_menu_slug() {
261
- return $this->has_menu();
262
- }
263
- /**
264
- * @author Vova Feldman (@svovaf)
265
- * @since 1.1.3
266
- *
267
- * @return string
268
- */
269
- function get_parent_slug() {
270
- return $this->_parent_slug;
271
- }
272
- /**
273
- * @author Vova Feldman (@svovaf)
274
- * @since 1.1.3
275
- *
276
- * @return string
277
- */
278
- function get_type() {
279
- return $this->_type;
280
- }
281
- /**
282
- * @author Vova Feldman (@svovaf)
283
- * @since 1.1.3
284
- *
285
- * @return bool
286
- */
287
- function is_cpt() {
288
- return ( 0 === strpos($this->_menu_slug, 'edit.php?post_type=') ||
289
- // Back compatibility.
290
- 'cpt' === $this->_type
291
- );
292
- }
293
- /**
294
- * @author Vova Feldman (@svovaf)
295
- * @since 1.1.3
296
- *
297
- * @return string
298
- */
299
- function get_parent_type() {
300
- return $this->_parent_type;
301
- }
302
- /**
303
- * @author Vova Feldman (@svovaf)
304
- * @since 1.1.3
305
- *
306
- * @return string
307
- */
308
- function get_raw_slug() {
309
- return $this->_menu_slug;
310
- }
311
- /**
312
- * Get plugin's original menu slug.
313
- *
314
- * @author Vova Feldman (@svovaf)
315
- * @since 1.1.3
316
- *
317
- * @return string
318
- */
319
- function get_original_menu_slug() {
320
- if ('cpt' === $this->_type) {
321
- return add_query_arg(array(
322
- 'post_type' => $this->_menu_slug
323
- ), 'edit.php');
324
- }
325
-
326
- if (false === strpos($this->_menu_slug, '.php?')) {
327
- return $this->_menu_slug;
328
- } else {
329
- return $this->_plugin_slug;
330
- }
331
- }
332
- /**
333
- * @author Vova Feldman (@svovaf)
334
- * @since 1.1.3
335
- *
336
- * @return string
337
- */
338
- function get_top_level_menu_slug() {
339
- return $this->has_custom_parent() ?
340
- $this->get_parent_slug() :
341
- $this->get_raw_slug();
342
- }
343
- /**
344
- * Is user on plugin's admin activation page.
345
- *
346
- * @author Vova Feldman (@svovaf)
347
- * @since 1.0.8
348
- *
349
- * @return bool
350
- */
351
- function is_main_settings_page() {
352
- if ($this->_menu_exists &&
353
- ( fs_is_plugin_page($this->_menu_slug) || fs_is_plugin_page($this->_plugin_slug) )
354
- ) {
355
- /**
356
- * Module has a settings menu and the context page is the main settings page, so assume it's in
357
- * activation (doesn't really check if already opted-in/skipped or not).
358
- *
359
- * @since 1.2.2
360
- */
361
- return true;
362
- }
363
-
364
- return false;
365
- }
366
- #region Submenu Override
367
- /**
368
- * Override submenu's action.
369
- *
370
- * @author Vova Feldman (@svovaf)
371
- * @since 1.1.0
372
- *
373
- * @param string $parent_slug
374
- * @param string $menu_slug
375
- * @param callable $function
376
- *
377
- * @return false|string If submenu exist, will return the hook name.
378
- */
379
- function override_submenu_action($parent_slug, $menu_slug, $function) {
380
- global $submenu;
381
-
382
- $menu_slug = plugin_basename($menu_slug);
383
- $parent_slug = plugin_basename($parent_slug);
384
-
385
- if (!isset($submenu[$parent_slug])) {
386
- // Parent menu not exist.
387
- return false;
388
- }
389
-
390
- $found_submenu_item = false;
391
- foreach ($submenu[$parent_slug] as $submenu_item) {
392
- if ($menu_slug === $submenu_item[2]) {
393
- $found_submenu_item = $submenu_item;
394
- break;
395
- }
396
- }
397
-
398
- if (false === $found_submenu_item) {
399
- // Submenu item not found.
400
- return false;
401
- }
402
-
403
- // Remove current function.
404
- $hookname = get_plugin_page_hookname($menu_slug, $parent_slug);
405
- remove_all_actions($hookname);
406
-
407
- // Attach new action.
408
- add_action($hookname, $function);
409
-
410
- return $hookname;
411
- }
412
- #endregion Submenu Override
413
- #region Top level menu Override
414
- /**
415
- * Find plugin's admin dashboard main menu item.
416
- *
417
- * @author Vova Feldman (@svovaf)
418
- * @since 1.0.2
419
- *
420
- * @return string[]|false
421
- */
422
- private function find_top_level_menu() {
423
- global $menu;
424
-
425
- $position = - 1;
426
- $found_menu = false;
427
-
428
- $menu_slug = $this->get_raw_slug();
429
-
430
- $hook_name = get_plugin_page_hookname($menu_slug, '');
431
- foreach ($menu as $pos => $m) {
432
- if ($menu_slug === $m[2]) {
433
- $position = $pos;
434
- $found_menu = $m;
435
- break;
436
- }
437
- }
438
-
439
- if (false === $found_menu) {
440
- return false;
441
- }
442
-
443
- return array(
444
- 'menu' => $found_menu,
445
- 'position' => $position,
446
- 'hook_name' => $hook_name
447
- );
448
- }
449
- /**
450
- * Find plugin's admin dashboard main submenu item.
451
- *
452
- * @author Vova Feldman (@svovaf)
453
- * @since 1.2.1.6
454
- *
455
- * @return array|false
456
- */
457
- private function find_main_submenu() {
458
- global $submenu;
459
-
460
- $top_level_menu_slug = $this->get_top_level_menu_slug();
461
-
462
- if (!isset($submenu[$top_level_menu_slug])) {
463
- return false;
464
- }
465
-
466
- $submenu_slug = $this->get_raw_slug();
467
-
468
- $position = - 1;
469
- $found_submenu = false;
470
-
471
- $hook_name = get_plugin_page_hookname($submenu_slug, '');
472
-
473
- foreach ($submenu[$top_level_menu_slug] as $pos => $sub) {
474
- if ($submenu_slug === $sub[2]) {
475
- $position = $pos;
476
- $found_submenu = $sub;
477
- }
478
- }
479
-
480
- if (false === $found_submenu) {
481
- return false;
482
- }
483
-
484
- return array(
485
- 'menu' => $found_submenu,
486
- 'parent_slug' => $top_level_menu_slug,
487
- 'position' => $position,
488
- 'hook_name' => $hook_name
489
- );
490
- }
491
- /**
492
- * Remove all sub-menu items.
493
- *
494
- * @author Vova Feldman (@svovaf)
495
- * @since 1.0.7
496
- *
497
- * @return bool If submenu with plugin's menu slug was found.
498
- */
499
- private function remove_all_submenu_items() {
500
- global $submenu;
501
-
502
- $menu_slug = $this->get_raw_slug();
503
-
504
- if (!isset($submenu[$menu_slug])) {
505
- return false;
506
- }
507
-
508
- $submenu[$menu_slug] = array();
509
-
510
- return true;
511
- }
512
- /**
513
- *
514
- * @author Vova Feldman (@svovaf)
515
- * @since 1.0.9
516
- *
517
- * @return false|array[string]mixed
518
- */
519
- function remove_menu_item() {
520
- $this->_logger->entrance();
521
-
522
- // Find main menu item.
523
- $menu = $this->find_top_level_menu();
524
-
525
- if (false === $menu) {
526
- return false;
527
- }
528
-
529
- // Remove it with its actions.
530
- remove_all_actions($menu['hook_name']);
531
-
532
- // Remove all submenu items.
533
- $this->remove_all_submenu_items();
534
-
535
- return $menu;
536
- }
537
- /**
538
- * @author Vova Feldman (@svovaf)
539
- * @since 1.1.4
540
- *
541
- * @param callable $function
542
- *
543
- * @return false|array[string]mixed
544
- */
545
- function override_menu_item($function) {
546
- $found_menu = $this->remove_menu_item();
547
-
548
- if (false === $found_menu) {
549
- return false;
550
- }
551
-
552
- if (!$this->is_top_level() || !$this->is_cpt()) {
553
- $menu_slug = plugin_basename($this->get_slug());
554
-
555
- $hookname = get_plugin_page_hookname($menu_slug, '');
556
-
557
- // Override menu action.
558
- add_action($hookname, $function);
559
- } else {
560
- global $menu;
561
-
562
- // Remove original CPT menu.
563
- unset($menu[$found_menu['position']]);
564
-
565
- // Create new top-level menu action.
566
- $hookname = self::add_page(
567
- $found_menu['menu'][3], $found_menu['menu'][0], 'manage_options', $this->get_slug(), $function, $found_menu['menu'][6], $found_menu['position']
568
- );
569
- }
570
-
571
- return $hookname;
572
- }
573
- /**
574
- * Adds a counter to the module's top level menu item.
575
- *
576
- * @author Vova Feldman (@svovaf)
577
- * @since 1.2.1.5
578
- *
579
- * @param int $counter
580
- * @param string $class
581
- */
582
- function add_counter_to_menu_item($counter = 1, $class = '') {
583
- global $menu, $submenu;
584
-
585
- $mask = '%s <span class="update-plugins %s count-%3$s" aria-hidden="true"><span>%3$s<span class="screen-reader-text">%3$s notifications</span></span></span>';
586
-
587
- if ($this->_is_top_level) {
588
- // Find main menu item.
589
- $found_menu = $this->find_top_level_menu();
590
-
591
- if (false !== $found_menu) {
592
- // Override menu label.
593
- $menu[$found_menu['position']][0] = sprintf(
594
- $mask, $found_menu['menu'][0], $class, $counter
595
- );
596
- }
597
- } else {
598
- $found_submenu = $this->find_main_submenu();
599
-
600
- if (false !== $found_submenu) {
601
- // Override menu label.
602
- $submenu[$found_submenu['parent_slug']][$found_submenu['position']][0] = sprintf(
603
- $mask, $found_submenu['menu'][0], $class, $counter
604
- );
605
- }
606
- }
607
- }
608
- #endregion Top level menu Override
609
- /**
610
- * Add a top-level menu page.
611
- *
612
- * Note for WordPress.org Theme/Plugin reviewer:
613
- *
614
- * This is a replication of `add_menu_page()` to avoid Theme Check warning.
615
- *
616
- * Why?
617
- * ====
618
- * Freemius is an SDK for plugin and theme developers. Since the core
619
- * of the SDK is relevant both for plugins and themes, for obvious reasons,
620
- * we only develop and maintain one code base.
621
- *
622
- * This method will not run for wp.org themes (only plugins) since theme
623
- * admin settings/options are now only allowed in the customizer.
624
- *
625
- * If you have any questions or need clarifications, please don't hesitate
626
- * pinging me on slack, my username is @svovaf.
627
- *
628
- * @author Vova Feldman (@svovaf)
629
- * @since 1.2.2
630
- *
631
- * @param string $page_title The text to be displayed in the title tags of the page when the menu is
632
- * selected.
633
- * @param string $menu_title The text to be used for the menu.
634
- * @param string $capability The capability required for this menu to be displayed to the user.
635
- * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
636
- * @param callable|string $function The function to be called to output the content for this page.
637
- * @param string $icon_url The URL to the icon to be used for this menu.
638
- * * Pass a base64-encoded SVG using a data URI, which will be colored to
639
- * match the color scheme. This should begin with
640
- * 'data:image/svg+xml;base64,'.
641
- * * Pass the name of a Dashicons helper class to use a font icon,
642
- * e.g. 'dashicons-chart-pie'.
643
- * * Pass 'none' to leave div.wp-menu-image empty so an icon can be added
644
- * via CSS.
645
- * @param int $position The position in the menu order this one should appear.
646
- *
647
- * @return string The resulting page's hook_suffix.
648
- */
649
- static function add_page(
650
- $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '', $position = null
651
- ) {
652
- $fn = 'add_menu' . '_page';
653
-
654
- return $fn(
655
- $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position
656
- );
657
- }
658
- /**
659
- * Add a submenu page.
660
- *
661
- * Note for WordPress.org Theme/Plugin reviewer:
662
- *
663
- * This is a replication of `add_submenu_page()` to avoid Theme Check warning.
664
- *
665
- * Why?
666
- * ====
667
- * Freemius is an SDK for plugin and theme developers. Since the core
668
- * of the SDK is relevant both for plugins and themes, for obvious reasons,
669
- * we only develop and maintain one code base.
670
- *
671
- * This method will not run for wp.org themes (only plugins) since theme
672
- * admin settings/options are now only allowed in the customizer.
673
- *
674
- * If you have any questions or need clarifications, please don't hesitate
675
- * pinging me on slack, my username is @svovaf.
676
- *
677
- * @author Vova Feldman (@svovaf)
678
- * @since 1.2.2
679
- *
680
- * @param string $parent_slug The slug name for the parent menu (or the file name of a standard
681
- * WordPress admin page).
682
- * @param string $page_title The text to be displayed in the title tags of the page when the menu is
683
- * selected.
684
- * @param string $menu_title The text to be used for the menu.
685
- * @param string $capability The capability required for this menu to be displayed to the user.
686
- * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
687
- * @param callable|string $function The function to be called to output the content for this page.
688
- *
689
- * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability
690
- * required.
691
- */
692
- static function add_subpage(
693
- $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function = ''
694
- ) {
695
- $fn = 'add_submenu' . '_page';
696
-
697
- return $fn($parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function
698
- );
699
- }
700
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/managers/class-fs-admin-notice-manager.php DELETED
@@ -1,289 +0,0 @@
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
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- class FS_Admin_Notice_Manager {
12
- /**
13
- * @var string
14
- */
15
- protected $_slug;
16
- /**
17
- * @var string
18
- */
19
- protected $_title;
20
- /**
21
- * @var array[]
22
- */
23
- private $_admin_messages = array();
24
- /**
25
- * @var FS_Key_Value_Storage
26
- */
27
- private $_sticky_storage;
28
- /**
29
- * @var FS_Plugin_Manager[]
30
- */
31
- private static $_instances = array();
32
- /**
33
- * @var FS_Logger
34
- */
35
- protected $_logger;
36
- /**
37
- * @param string $slug
38
- * @param string $title
39
- *
40
- * @return FS_Admin_Notice_Manager
41
- */
42
- static function instance($slug, $title = '') {
43
- if (!isset(self::$_instances[$slug])) {
44
- self::$_instances[$slug] = new FS_Admin_Notice_Manager($slug, $title);
45
- }
46
-
47
- return self::$_instances[$slug];
48
- }
49
- protected function __construct($slug, $title = '') {
50
- $this->_logger = FS_Logger::get_logger(WP_FS__SLUG . '_' . $slug . '_data', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK);
51
-
52
- $this->_slug = $slug;
53
- $this->_title = !empty($title) ? $title : '';
54
- $this->_sticky_storage = FS_Key_Value_Storage::instance('admin_notices', $this->_slug);
55
-
56
- if (is_admin()) {
57
- if (0 < count($this->_sticky_storage)) {
58
- // If there are sticky notices for the current slug, add a callback
59
- // to the AJAX action that handles message dismiss.
60
- add_action("wp_ajax_fs_dismiss_notice_action_{$slug}", array(
61
- &$this,
62
- 'dismiss_notice_ajax_callback'
63
- ));
64
-
65
- foreach ($this->_sticky_storage as $id => $msg) {
66
- // Add admin notice.
67
- $this->add(
68
- $msg['message'], $msg['title'], $msg['type'], true, $msg['all'], $msg['id'], false
69
- );
70
- }
71
- }
72
- }
73
- }
74
- /**
75
- * Remove sticky message by ID.
76
- *
77
- * @author Vova Feldman (@svovaf)
78
- * @since 1.0.7
79
- *
80
- */
81
- function dismiss_notice_ajax_callback() {
82
- $this->_sticky_storage->remove($_POST['message_id']);
83
- wp_die();
84
- }
85
- /**
86
- * Rendered sticky message dismiss JavaScript.
87
- *
88
- * @author Vova Feldman (@svovaf)
89
- * @since 1.0.7
90
- */
91
- static function _add_sticky_dismiss_javascript() {
92
- $params = array();
93
- fs_require_once_template('sticky-admin-notice-js.php', $params);
94
- }
95
- private static $_added_sticky_javascript = false;
96
- /**
97
- * Hook to the admin_footer to add sticky message dismiss JavaScript handler.
98
- *
99
- * @author Vova Feldman (@svovaf)
100
- * @since 1.0.7
101
- */
102
- private static function has_sticky_messages() {
103
- if (!self::$_added_sticky_javascript) {
104
- add_action('admin_footer', array('FS_Admin_Notice_Manager', '_add_sticky_dismiss_javascript'));
105
- }
106
- }
107
- /**
108
- * Handle admin_notices by printing the admin messages stacked in the queue.
109
- *
110
- * @author Vova Feldman (@svovaf)
111
- * @since 1.0.4
112
- *
113
- */
114
- function _admin_notices_hook() {
115
- $notice_type = 'admin_notices';
116
-
117
- if (function_exists('current_user_can') &&
118
- !current_user_can('manage_options')
119
- ) {
120
- // Only show messages to admins.
121
- return;
122
- }
123
-
124
- if (!isset($this->_admin_messages[$notice_type]) || !is_array($this->_admin_messages[$notice_type])) {
125
- return;
126
- }
127
-
128
- foreach ($this->_admin_messages[$notice_type] as $id => $msg) {
129
- fs_require_template('admin-notice.php', $msg);
130
-
131
- if ($msg['sticky']) {
132
- self::has_sticky_messages();
133
- }
134
- }
135
- }
136
- /**
137
- * Handle all_admin_notices by printing the admin messages stacked in the queue.
138
- *
139
- * @author Vova Feldman (@svovaf)
140
- * @since 1.0.4
141
- *
142
- */
143
- function _all_admin_notices_hook() {
144
- $notice_type = 'all_admin_notices';
145
-
146
- if (!isset($this->_admin_messages[$notice_type]) || !is_array($this->_admin_messages[$notice_type])) {
147
- return;
148
- }
149
-
150
- foreach ($this->_admin_messages[$notice_type] as $id => $msg) {
151
- fs_require_template('all-admin-notice.php', $msg);
152
- }
153
- }
154
- /**
155
- * Enqueue common stylesheet to style admin notice.
156
- *
157
- * @author Vova Feldman (@svovaf)
158
- * @since 1.0.7
159
- */
160
- function _enqueue_styles() {
161
- fs_enqueue_local_style('fs_common', '/admin/common.css');
162
- }
163
- /**
164
- * Add admin message to admin messages queue, and hook to admin_notices / all_admin_notices if not yet hooked.
165
- *
166
- * @author Vova Feldman (@svovaf)
167
- * @since 1.0.4
168
- *
169
- * @param string $message
170
- * @param string $title
171
- * @param string $type
172
- * @param bool $is_sticky
173
- * @param bool $all_admin
174
- * @param string $id Message ID
175
- * @param bool $store_if_sticky
176
- *
177
- * @uses add_action()
178
- */
179
- function add($message, $title = '', $type = 'success', $is_sticky = false, $all_admin = false, $id = '', $store_if_sticky = true) {
180
- $key = ( $all_admin ? 'all_admin_notices' : 'admin_notices' );
181
-
182
- if (!isset($this->_admin_messages[$key])) {
183
- $this->_admin_messages[$key] = array();
184
-
185
- add_action($key, array(&$this, "_{$key}_hook"));
186
- add_action('admin_enqueue_scripts', array(&$this, '_enqueue_styles'));
187
- }
188
-
189
- if ('' === $id) {
190
- $id = md5($title . ' ' . $message . ' ' . $type);
191
- }
192
-
193
- $message_object = array(
194
- 'message' => $message,
195
- 'title' => $title,
196
- 'type' => $type,
197
- 'sticky' => $is_sticky,
198
- 'id' => $id,
199
- 'all' => $all_admin,
200
- 'slug' => $this->_slug,
201
- 'plugin' => $this->_title,
202
- );
203
-
204
- if ($is_sticky && $store_if_sticky) {
205
- $this->_sticky_storage->{$id} = $message_object;
206
- }
207
-
208
- $this->_admin_messages[$key][$id] = $message_object;
209
- }
210
- /**
211
- * @author Vova Feldman (@svovaf)
212
- * @since 1.0.7
213
- *
214
- * @param string|string[] $ids
215
- */
216
- function remove_sticky($ids) {
217
- if (!is_array($ids)) {
218
- $ids = array($ids);
219
- }
220
-
221
- foreach ($ids as $id) {
222
- // Remove from sticky storage.
223
- $this->_sticky_storage->remove($id);
224
-
225
- // Remove from current admin messages.
226
- if (isset($this->_admin_messages['all_admin_notices']) && isset($this->_admin_messages['all_admin_notices'][$id])) {
227
- unset($this->_admin_messages['all_admin_notices'][$id]);
228
- }
229
- if (isset($this->_admin_messages['admin_notices']) && isset($this->_admin_messages['admin_notices'][$id])) {
230
- unset($this->_admin_messages['admin_notices'][$id]);
231
- }
232
- }
233
- }
234
- /**
235
- * Check if sticky message exists by id.
236
- *
237
- * @author Vova Feldman (@svovaf)
238
- * @since 1.0.9
239
- *
240
- * @param $id
241
- *
242
- * @return bool
243
- */
244
- function has_sticky($id) {
245
- return isset($this->_sticky_storage[$id]);
246
- }
247
- /**
248
- * Adds sticky admin notification.
249
- *
250
- * @author Vova Feldman (@svovaf)
251
- * @since 1.0.7
252
- *
253
- * @param string $message
254
- * @param string $id Message ID
255
- * @param string $title
256
- * @param string $type
257
- * @param bool $all_admin
258
- */
259
- function add_sticky($message, $id, $title = '', $type = 'success', $all_admin = false) {
260
- $message = fs_apply_filter($this->_slug, "sticky_message_{$id}", $message);
261
- $title = fs_apply_filter($this->_slug, "sticky_title_{$id}", $title);
262
-
263
- $this->add($message, $title, $type, true, $all_admin, $id);
264
- }
265
- /**
266
- * Clear all sticky messages.
267
- *
268
- * @author Vova Feldman (@svovaf)
269
- * @since 1.0.8
270
- */
271
- function clear_all_sticky() {
272
- $this->_sticky_storage->clear_all();
273
- }
274
- /**
275
- * Add admin message to all admin messages queue, and hook to all_admin_notices if not yet hooked.
276
- *
277
- * @author Vova Feldman (@svovaf)
278
- * @since 1.0.4
279
- *
280
- * @param string $message
281
- * @param string $title
282
- * @param string $type
283
- * @param bool $is_sticky
284
- * @param string $id Message ID
285
- */
286
- function add_all($message, $title = '', $type = 'success', $is_sticky = false, $id = '') {
287
- $this->add($message, $title, $type, $is_sticky, true, $id);
288
- }
289
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/managers/class-fs-cache-manager.php DELETED
@@ -1,222 +0,0 @@
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.6
7
- */
8
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- class FS_Cache_Manager {
12
- /**
13
- * @var FS_Option_Manager
14
- */
15
- private $_options;
16
- /**
17
- * @var FS_Logger
18
- */
19
- private $_logger;
20
- /**
21
- * @var FS_Cache_Manager[]
22
- */
23
- private static $_MANAGERS = array();
24
- /**
25
- * @author Vova Feldman (@svovaf)
26
- * @since 1.1.3
27
- *
28
- * @param string $id
29
- */
30
- private function __construct($id) {
31
- $this->_logger = FS_Logger::get_logger(WP_FS__SLUG . '_cach_mngr_' . $id, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK);
32
-
33
- $this->_logger->entrance();
34
- $this->_logger->log('id = ' . $id);
35
-
36
- $this->_options = FS_Option_Manager::get_manager($id, true);
37
- }
38
- /**
39
- * @author Vova Feldman (@svovaf)
40
- * @since 1.1.6
41
- *
42
- * @param $id
43
- *
44
- * @return FS_Cache_Manager
45
- */
46
- static function get_manager($id) {
47
- $id = strtolower($id);
48
-
49
- if (!isset(self::$_MANAGERS[$id])) {
50
- self::$_MANAGERS[$id] = new FS_Cache_Manager($id);
51
- }
52
-
53
- return self::$_MANAGERS[$id];
54
- }
55
- /**
56
- * @author Vova Feldman (@svovaf)
57
- * @since 1.1.6
58
- *
59
- * @return bool
60
- */
61
- function is_empty() {
62
- $this->_logger->entrance();
63
-
64
- return $this->_options->is_empty();
65
- }
66
- /**
67
- * @author Vova Feldman (@svovaf)
68
- * @since 1.1.6
69
- */
70
- function clear() {
71
- $this->_logger->entrance();
72
-
73
- $this->_options->clear(true);
74
- }
75
- /**
76
- * Delete cache manager from DB.
77
- *
78
- * @author Vova Feldman (@svovaf)
79
- * @since 1.0.9
80
- */
81
- function delete() {
82
- $this->_options->delete();
83
- }
84
- /**
85
- * Check if there's a cached item.
86
- *
87
- * @author Vova Feldman (@svovaf)
88
- * @since 1.1.6
89
- *
90
- * @param string $key
91
- *
92
- * @return bool
93
- */
94
- function has($key) {
95
- $cache_entry = $this->_options->get_option($key, false);
96
-
97
- return ( is_object($cache_entry) &&
98
- isset($cache_entry->timestamp) &&
99
- is_numeric($cache_entry->timestamp)
100
- );
101
- }
102
- /**
103
- * Check if there's a valid cached item.
104
- *
105
- * @author Vova Feldman (@svovaf)
106
- * @since 1.1.6
107
- *
108
- * @param string $key
109
- *
110
- * @return bool
111
- */
112
- function has_valid($key) {
113
- $cache_entry = $this->_options->get_option($key, false);
114
-
115
- return ( is_object($cache_entry) &&
116
- isset($cache_entry->timestamp) &&
117
- is_numeric($cache_entry->timestamp) &&
118
- $cache_entry->timestamp > WP_FS__SCRIPT_START_TIME
119
- );
120
- }
121
- /**
122
- * @author Vova Feldman (@svovaf)
123
- * @since 1.1.6
124
- *
125
- * @param string $key
126
- * @param mixed $default
127
- *
128
- * @return mixed
129
- */
130
- function get($key, $default = null) {
131
- $this->_logger->entrance('key = ' . $key);
132
-
133
- $cache_entry = $this->_options->get_option($key, false);
134
-
135
- if (is_object($cache_entry) &&
136
- isset($cache_entry->timestamp) &&
137
- is_numeric($cache_entry->timestamp)
138
- ) {
139
- return $cache_entry->result;
140
- }
141
-
142
- return $default;
143
- }
144
- /**
145
- * @author Vova Feldman (@svovaf)
146
- * @since 1.1.6
147
- *
148
- * @param string $key
149
- * @param mixed $default
150
- *
151
- * @return mixed
152
- */
153
- function get_valid($key, $default = null) {
154
- $this->_logger->entrance('key = ' . $key);
155
-
156
- $cache_entry = $this->_options->get_option($key, false);
157
-
158
- if (is_object($cache_entry) &&
159
- isset($cache_entry->timestamp) &&
160
- is_numeric($cache_entry->timestamp) &&
161
- $cache_entry->timestamp > WP_FS__SCRIPT_START_TIME
162
- ) {
163
- return $cache_entry->result;
164
- }
165
-
166
- return $default;
167
- }
168
- /**
169
- * @author Vova Feldman (@svovaf)
170
- * @since 1.1.6
171
- *
172
- * @param string $key
173
- * @param mixed $value
174
- * @param int $expiration
175
- */
176
- function set($key, $value, $expiration = WP_FS__TIME_24_HOURS_IN_SEC) {
177
- $this->_logger->entrance('key = ' . $key);
178
-
179
- $cache_entry = new stdClass();
180
- $cache_entry->result = $value;
181
- $cache_entry->timestamp = WP_FS__SCRIPT_START_TIME + $expiration;
182
- $this->_options->set_option($key, $cache_entry, true);
183
- }
184
- /**
185
- * Get cached record expiration, or false if not cached or expired.
186
- *
187
- * @author Vova Feldman (@svovaf)
188
- * @since 1.1.7.3
189
- *
190
- * @param string $key
191
- *
192
- * @return bool|int
193
- */
194
- function get_record_expiration($key) {
195
- $this->_logger->entrance('key = ' . $key);
196
-
197
- $cache_entry = $this->_options->get_option($key, false);
198
-
199
- if (is_object($cache_entry) &&
200
- isset($cache_entry->timestamp) &&
201
- is_numeric($cache_entry->timestamp) &&
202
- $cache_entry->timestamp > WP_FS__SCRIPT_START_TIME
203
- ) {
204
- return $cache_entry->timestamp;
205
- }
206
-
207
- return false;
208
- }
209
- /**
210
- * Purge cached item.
211
- *
212
- * @author Vova Feldman (@svovaf)
213
- * @since 1.1.6
214
- *
215
- * @param string $key
216
- */
217
- function purge($key) {
218
- $this->_logger->entrance('key = ' . $key);
219
-
220
- $this->_options->unset_option($key, true);
221
- }
222
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/managers/class-fs-key-value-storage.php DELETED
@@ -1,298 +0,0 @@
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
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- /**
12
- * Class FS_Key_Value_Storage
13
- *
14
- * @property int $install_timestamp
15
- * @property int $activation_timestamp
16
- * @property int $sync_timestamp
17
- * @property object $sync_cron
18
- * @property int $install_sync_timestamp
19
- * @property array $connectivity_test
20
- * @property array $is_on
21
- * @property object $trial_plan
22
- * @property bool $has_trial_plan
23
- * @property bool $trial_promotion_shown
24
- * @property string $sdk_version
25
- * @property string $sdk_last_version
26
- * @property bool $sdk_upgrade_mode
27
- * @property bool $sdk_downgrade_mode
28
- * @property bool $plugin_upgrade_mode
29
- * @property bool $plugin_downgrade_mode
30
- * @property string $plugin_version
31
- * @property string $plugin_last_version
32
- * @property bool $is_plugin_new_install
33
- * @property bool $was_plugin_loaded
34
- * @property object $plugin_main_file
35
- * @property bool $prev_is_premium
36
- * @property array $is_anonymous
37
- * @property bool $is_pending_activation
38
- * @property bool $sticky_optin_added
39
- * @property object $uninstall_reason
40
- * @property object $subscription
41
- */
42
- class FS_Key_Value_Storage implements ArrayAccess, Iterator, Countable {
43
- /**
44
- * @var string
45
- */
46
- protected $_id;
47
- /**
48
- * @var string
49
- */
50
- protected $_slug;
51
- /**
52
- * @var array
53
- */
54
- protected $_data;
55
- /**
56
- * @var FS_Plugin_Manager[]
57
- */
58
- private static $_instances = array();
59
- /**
60
- * @var FS_Logger
61
- */
62
- protected $_logger;
63
- /**
64
- * @param string $id
65
- * @param string $slug
66
- *
67
- * @return FS_Key_Value_Storage
68
- */
69
- static function instance($id, $slug) {
70
- $key = $id . ':' . $slug;
71
- if (!isset(self::$_instances[$key])) {
72
- self::$_instances[$key] = new FS_Key_Value_Storage($id, $slug);
73
- }
74
-
75
- return self::$_instances[$key];
76
- }
77
- protected function __construct($id, $slug) {
78
- $this->_logger = FS_Logger::get_logger(WP_FS__SLUG . '_' . $slug . '_' . $id, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK);
79
-
80
- $this->_slug = $slug;
81
- $this->_id = $id;
82
- $this->load();
83
- }
84
- protected function get_option_manager() {
85
- return FS_Option_Manager::get_manager(WP_FS__ACCOUNTS_OPTION_NAME, true);
86
- }
87
- protected function get_all_data() {
88
- return $this->get_option_manager()->get_option($this->_id, array());
89
- }
90
- /**
91
- * Load plugin data from local DB.
92
- *
93
- * @author Vova Feldman (@svovaf)
94
- * @since 1.0.7
95
- */
96
- function load() {
97
- $all_plugins_data = $this->get_all_data();
98
- $this->_data = isset($all_plugins_data[$this->_slug]) ?
99
- $all_plugins_data[$this->_slug] :
100
- array();
101
- }
102
- /**
103
- * @author Vova Feldman (@svovaf)
104
- * @since 1.0.7
105
- *
106
- * @param string $key
107
- * @param mixed $value
108
- * @param bool $flush
109
- */
110
- function store($key, $value, $flush = true) {
111
- if ($this->_logger->is_on()) {
112
- $this->_logger->entrance($key . ' = ' . var_export($value, true));
113
- }
114
-
115
- if (array_key_exists($key, $this->_data) && $value === $this->_data[$key]) {
116
- // No need to store data if the value wasn't changed.
117
- return;
118
- }
119
-
120
- $all_data = $this->get_all_data();
121
-
122
- $this->_data[$key] = $value;
123
-
124
- $all_data[$this->_slug] = $this->_data;
125
-
126
- $options_manager = $this->get_option_manager();
127
- $options_manager->set_option($this->_id, $all_data, $flush);
128
- }
129
- /**
130
- * @author Vova Feldman (@svovaf)
131
- * @since 1.0.7
132
- *
133
- * @param bool $store
134
- * @param string[] $exceptions Set of keys to keep and not clear.
135
- */
136
- function clear_all($store = true, $exceptions = array()) {
137
- $new_data = array();
138
- foreach ($exceptions as $key) {
139
- if (isset($this->_data[$key])) {
140
- $new_data[$key] = $this->_data[$key];
141
- }
142
- }
143
-
144
- $this->_data = $new_data;
145
-
146
- if ($store) {
147
- $all_data = $this->get_all_data();
148
- $all_data[$this->_slug] = $this->_data;
149
- $options_manager = $this->get_option_manager();
150
- $options_manager->set_option($this->_id, $all_data, true);
151
- }
152
- }
153
- /**
154
- * Delete key-value storage.
155
- *
156
- * @author Vova Feldman (@svovaf)
157
- * @since 1.0.9
158
- */
159
- function delete() {
160
- $this->_data = array();
161
-
162
- $all_data = $this->get_all_data();
163
- unset($all_data[$this->_slug]);
164
- $options_manager = $this->get_option_manager();
165
- $options_manager->set_option($this->_id, $all_data, true);
166
- }
167
- /**
168
- * @author Vova Feldman (@svovaf)
169
- * @since 1.0.7
170
- *
171
- * @param string $key
172
- * @param bool $store
173
- */
174
- function remove($key, $store = true) {
175
- if (!array_key_exists($key, $this->_data)) {
176
- return;
177
- }
178
-
179
- unset($this->_data[$key]);
180
-
181
- if ($store) {
182
- $all_data = $this->get_all_data();
183
- $all_data[$this->_slug] = $this->_data;
184
- $options_manager = $this->get_option_manager();
185
- $options_manager->set_option($this->_id, $all_data, true);
186
- }
187
- }
188
- /**
189
- * @author Vova Feldman (@svovaf)
190
- * @since 1.0.7
191
- *
192
- * @param string $key
193
- * @param mixed $default
194
- *
195
- * @return bool|\FS_Plugin
196
- */
197
- function get($key, $default = false) {
198
- return array_key_exists($key, $this->_data) ?
199
- $this->_data[$key] :
200
- $default;
201
- }
202
- /* ArrayAccess + Magic Access (better for refactoring)
203
- ----------------------------------------------------------------------------------- */
204
- function __set($k, $v) {
205
- $this->store($k, $v);
206
- }
207
- function __isset($k) {
208
- return array_key_exists($k, $this->_data);
209
- }
210
- function __unset($k) {
211
- $this->remove($k);
212
- }
213
- function __get($k) {
214
- return $this->get($k, null);
215
- }
216
- function offsetSet($k, $v) {
217
- if (is_null($k)) {
218
- throw new Exception('Can\'t append value to request params.');
219
- } else {
220
- $this->{$k} = $v;
221
- }
222
- }
223
- function offsetExists($k) {
224
- return array_key_exists($k, $this->_data);
225
- }
226
- function offsetUnset($k) {
227
- unset($this->$k);
228
- }
229
- function offsetGet($k) {
230
- return $this->get($k, null);
231
- }
232
- /**
233
- * (PHP 5 &gt;= 5.0.0)<br/>
234
- * Return the current element
235
- *
236
- * @link http://php.net/manual/en/iterator.current.php
237
- * @return mixed Can return any type.
238
- */
239
- public function current() {
240
- return current($this->_data);
241
- }
242
- /**
243
- * (PHP 5 &gt;= 5.0.0)<br/>
244
- * Move forward to next element
245
- *
246
- * @link http://php.net/manual/en/iterator.next.php
247
- * @return void Any returned value is ignored.
248
- */
249
- public function next() {
250
- next($this->_data);
251
- }
252
- /**
253
- * (PHP 5 &gt;= 5.0.0)<br/>
254
- * Return the key of the current element
255
- *
256
- * @link http://php.net/manual/en/iterator.key.php
257
- * @return mixed scalar on success, or null on failure.
258
- */
259
- public function key() {
260
- return key($this->_data);
261
- }
262
- /**
263
- * (PHP 5 &gt;= 5.0.0)<br/>
264
- * Checks if current position is valid
265
- *
266
- * @link http://php.net/manual/en/iterator.valid.php
267
- * @return boolean The return value will be casted to boolean and then evaluated.
268
- * Returns true on success or false on failure.
269
- */
270
- public function valid() {
271
- $key = key($this->_data);
272
-
273
- return ( $key !== null && $key !== false );
274
- }
275
- /**
276
- * (PHP 5 &gt;= 5.0.0)<br/>
277
- * Rewind the Iterator to the first element
278
- *
279
- * @link http://php.net/manual/en/iterator.rewind.php
280
- * @return void Any returned value is ignored.
281
- */
282
- public function rewind() {
283
- reset($this->_data);
284
- }
285
- /**
286
- * (PHP 5 &gt;= 5.1.0)<br/>
287
- * Count elements of an object
288
- *
289
- * @link http://php.net/manual/en/countable.count.php
290
- * @return int The custom count as an integer.
291
- * </p>
292
- * <p>
293
- * The return value is cast to an integer.
294
- */
295
- public function count() {
296
- return count($this->_data);
297
- }
298
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/managers/class-fs-license-manager.php DELETED
@@ -1,100 +0,0 @@
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.6
7
- */
8
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- class FS_License_Manager /* extends FS_Abstract_Manager */ {
12
- //
13
- //
14
- // /**
15
- // * @var FS_License_Manager[]
16
- // */
17
- // private static $_instances = array();
18
- //
19
- // static function instance( Freemius $fs ) {
20
- // $slug = strtolower( $fs->get_slug() );
21
- //
22
- // if ( ! isset( self::$_instances[ $slug ] ) ) {
23
- // self::$_instances[ $slug ] = new FS_License_Manager( $slug, $fs );
24
- // }
25
- //
26
- // return self::$_instances[ $slug ];
27
- // }
28
- //
29
- //// private function __construct($slug) {
30
- //// parent::__construct($slug);
31
- //// }
32
- //
33
- // function entry_id() {
34
- // return 'licenses';
35
- // }
36
- //
37
- // function sync( $id ) {
38
- //
39
- // }
40
- //
41
- // /**
42
- // * @author Vova Feldman (@svovaf)
43
- // * @since 1.0.5
44
- // * @uses FS_Api
45
- // *
46
- // * @param number|bool $plugin_id
47
- // *
48
- // * @return FS_Plugin_License[]|stdClass Licenses or API error.
49
- // */
50
- // function api_get_user_plugin_licenses( $plugin_id = false ) {
51
- // $api = $this->_fs->get_api_user_scope();
52
- //
53
- // if ( ! is_numeric( $plugin_id ) ) {
54
- // $plugin_id = $this->_fs->get_id();
55
- // }
56
- //
57
- // $result = $api->call( "/plugins/{$plugin_id}/licenses.json" );
58
- //
59
- // if ( ! isset( $result->error ) ) {
60
- // for ( $i = 0, $len = count( $result->licenses ); $i < $len; $i ++ ) {
61
- // $result->licenses[ $i ] = new FS_Plugin_License( $result->licenses[ $i ] );
62
- // }
63
- //
64
- // $result = $result->licenses;
65
- // }
66
- //
67
- // return $result;
68
- // }
69
- //
70
- // function api_get_many() {
71
- //
72
- // }
73
- //
74
- // function api_activate( $id ) {
75
- //
76
- // }
77
- //
78
- // function api_deactivate( $id ) {
79
- //
80
- // }
81
- /**
82
- * @param FS_Plugin_License[] $licenses
83
- *
84
- * @return bool
85
- */
86
- static function has_premium_license($licenses) {
87
- if (is_array($licenses)) {
88
- foreach ($licenses as $license) {
89
- /**
90
- * @var FS_Plugin_License $license
91
- */
92
- if (!$license->is_utilized() && $license->is_features_enabled()) {
93
- return true;
94
- }
95
- }
96
- }
97
-
98
- return false;
99
- }
100
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/managers/class-fs-option-manager.php DELETED
@@ -1,283 +0,0 @@
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
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- /**
12
- * 3-layer lazy options manager.
13
- * layer 3: Memory
14
- * layer 2: Cache (if there's any caching plugin and if WP_FS__DEBUG_SDK is FALSE)
15
- * layer 1: Database (options table). All options stored as one option record in the DB to reduce number of DB
16
- * queries.
17
- *
18
- * If load() is not explicitly called, starts as empty manager. Same thing about saving the data - you have to
19
- * explicitly call store().
20
- *
21
- * Class Freemius_Option_Manager
22
- */
23
- class FS_Option_Manager {
24
- /**
25
- * @var string
26
- */
27
- private $_id;
28
- /**
29
- * @var array
30
- */
31
- private $_options;
32
- /**
33
- * @var FS_Logger
34
- */
35
- private $_logger;
36
- /**
37
- * @var FS_Option_Manager[]
38
- */
39
- private static $_MANAGERS = array();
40
- /**
41
- * @author Vova Feldman (@svovaf)
42
- * @since 1.0.3
43
- *
44
- * @param string $id
45
- * @param bool $load
46
- */
47
- private function __construct($id, $load = false) {
48
- $this->_logger = FS_Logger::get_logger(WP_FS__SLUG . '_opt_mngr_' . $id, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK);
49
-
50
- $this->_logger->entrance();
51
- $this->_logger->log('id = ' . $id);
52
-
53
- $this->_id = $id;
54
-
55
- if ($load) {
56
- $this->load();
57
- }
58
- }
59
- /**
60
- * @author Vova Feldman (@svovaf)
61
- * @since 1.0.3
62
- *
63
- * @param $id
64
- * @param $load
65
- *
66
- * @return FS_Option_Manager
67
- */
68
- static function get_manager($id, $load = false) {
69
- $id = strtolower($id);
70
-
71
- if (!isset(self::$_MANAGERS[$id])) {
72
- self::$_MANAGERS[$id] = new FS_Option_Manager($id, $load);
73
- } // If load required but not yet loaded, load.
74
- else if ($load && !self::$_MANAGERS[$id]->is_loaded()) {
75
- self::$_MANAGERS[$id]->load();
76
- }
77
-
78
- return self::$_MANAGERS[$id];
79
- }
80
- private function _get_option_manager_name() {
81
- // return WP_FS__SLUG . '_' . $this->_id;
82
- return $this->_id;
83
- }
84
- /**
85
- * @author Vova Feldman (@svovaf)
86
- * @since 1.0.3
87
- *
88
- * @param bool $flush
89
- */
90
- function load($flush = false) {
91
- $this->_logger->entrance();
92
-
93
- $option_name = $this->_get_option_manager_name();
94
-
95
- if ($flush || !isset($this->_options)) {
96
- if (isset($this->_options)) {
97
- // Clear prev options.
98
- $this->clear();
99
- }
100
-
101
- if (!WP_FS__DEBUG_SDK) {
102
- $this->_options = wp_cache_get($option_name, WP_FS__SLUG);
103
- }
104
-
105
- // $this->_logger->info('wp_cache_get = ' . var_export($this->_options, true));
106
- // if ( is_array( $this->_options ) ) {
107
- // $this->clear();
108
- // }
109
-
110
- $cached = true;
111
-
112
- if (empty($this->_options)) {
113
- $this->_options = get_option($option_name);
114
-
115
- if (is_string($this->_options)) {
116
- $this->_options = json_decode($this->_options);
117
- }
118
-
119
- // $this->_logger->info('get_option = ' . var_export($this->_options, true));
120
-
121
- if (false === $this->_options) {
122
- $this->clear();
123
- }
124
-
125
- $cached = false;
126
- }
127
-
128
- if (!WP_FS__DEBUG_SDK && !$cached) { // Set non encoded cache.
129
- wp_cache_set($option_name, $this->_options, WP_FS__SLUG);
130
- }
131
- }
132
- }
133
- /**
134
- * @author Vova Feldman (@svovaf)
135
- * @since 1.0.3
136
- *
137
- * @return bool
138
- */
139
- function is_loaded() {
140
- return isset($this->_options);
141
- }
142
- /**
143
- * @author Vova Feldman (@svovaf)
144
- * @since 1.0.3
145
- *
146
- * @return bool
147
- */
148
- function is_empty() {
149
- return ( $this->is_loaded() && false === $this->_options );
150
- }
151
- /**
152
- * @author Vova Feldman (@svovaf)
153
- * @since 1.0.6
154
- *
155
- * @param bool $flush
156
- */
157
- function clear($flush = false) {
158
- $this->_logger->entrance();
159
-
160
- $this->_options = array();
161
-
162
- if ($flush) {
163
- $this->store();
164
- }
165
- }
166
- /**
167
- * Delete options manager from DB.
168
- *
169
- * @author Vova Feldman (@svovaf)
170
- * @since 1.0.9
171
- */
172
- function delete() {
173
- delete_option($this->_get_option_manager_name());
174
- }
175
- /**
176
- * @author Vova Feldman (@svovaf)
177
- * @since 1.0.6
178
- *
179
- * @param string $option
180
- *
181
- * @return bool
182
- */
183
- function has_option($option) {
184
- return array_key_exists($option, $this->_options);
185
- }
186
- /**
187
- * @author Vova Feldman (@svovaf)
188
- * @since 1.0.3
189
- *
190
- * @param string $option
191
- * @param mixed $default
192
- *
193
- * @return mixed
194
- */
195
- function get_option($option, $default = null) {
196
- $this->_logger->entrance('option = ' . $option);
197
-
198
- if (is_array($this->_options)) {
199
- return isset($this->_options[$option]) ? $this->_options[$option] : $default;
200
- } else if (is_object($this->_options)) {
201
- return isset($this->_options->{$option}) ? $this->_options->{$option} : $default;
202
- }
203
-
204
- return $default;
205
- }
206
- /**
207
- * @author Vova Feldman (@svovaf)
208
- * @since 1.0.3
209
- *
210
- * @param string $option
211
- * @param mixed $value
212
- * @param bool $flush
213
- */
214
- function set_option($option, $value, $flush = false) {
215
- $this->_logger->entrance('option = ' . $option);
216
-
217
- if (!$this->is_loaded()) {
218
- $this->clear();
219
- }
220
-
221
- if (is_array($this->_options)) {
222
- $this->_options[$option] = $value;
223
- } else if (is_object($this->_options)) {
224
- $this->_options->{$option} = $value;
225
- }
226
-
227
- if ($flush) {
228
- $this->store();
229
- }
230
- }
231
- /**
232
- * Unset option.
233
- *
234
- * @author Vova Feldman (@svovaf)
235
- * @since 1.0.3
236
- *
237
- * @param string $option
238
- * @param bool $flush
239
- */
240
- function unset_option($option, $flush = false) {
241
- $this->_logger->entrance('option = ' . $option);
242
-
243
- if (is_array($this->_options)) {
244
- if (!isset($this->_options[$option])) {
245
- return;
246
- }
247
-
248
- unset($this->_options[$option]);
249
- } else if (is_object($this->_options)) {
250
- if (!isset($this->_options->{$option})) {
251
- return;
252
- }
253
-
254
- unset($this->_options->{$option});
255
- }
256
-
257
- if ($flush) {
258
- $this->store();
259
- }
260
- }
261
- /**
262
- * Dump options to database.
263
- *
264
- * @author Vova Feldman (@svovaf)
265
- * @since 1.0.3
266
- */
267
- function store() {
268
- $this->_logger->entrance();
269
-
270
- $option_name = $this->_get_option_manager_name();
271
-
272
- if ($this->_logger->is_on()) {
273
- $this->_logger->info($option_name . ' = ' . var_export($this->_options, true));
274
- }
275
-
276
- // Update DB.
277
- update_option($option_name, $this->_options);
278
-
279
- if (!WP_FS__DEBUG_SDK) {
280
- wp_cache_set($option_name, $this->_options, WP_FS__SLUG);
281
- }
282
- }
283
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/managers/class-fs-plan-manager.php DELETED
@@ -1,154 +0,0 @@
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.6
7
- */
8
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- class FS_Plan_Manager {
12
- /**
13
- * @var FS_Plan_Manager
14
- */
15
- private static $_instance;
16
- /**
17
- * @return FS_Plan_Manager
18
- */
19
- static function instance() {
20
- if (!isset(self::$_instance)) {
21
- self::$_instance = new FS_Plan_Manager();
22
- }
23
-
24
- return self::$_instance;
25
- }
26
- private function __construct() {
27
-
28
- }
29
- /**
30
- * @param FS_Plugin_License[] $licenses
31
- *
32
- * @return bool
33
- */
34
- function has_premium_license($licenses) {
35
- if (is_array($licenses)) {
36
- /**
37
- * @var FS_Plugin_License[] $licenses
38
- */
39
- foreach ($licenses as $license) {
40
- if (!$license->is_utilized() && $license->is_features_enabled()) {
41
- return true;
42
- }
43
- }
44
- }
45
-
46
- return false;
47
- }
48
- /**
49
- * Check if plugin has any paid plans.
50
- *
51
- * @author Vova Feldman (@svovaf)
52
- * @since 1.0.7
53
- *
54
- * @param FS_Plugin_Plan[] $plans
55
- *
56
- * @return bool
57
- */
58
- function has_paid_plan($plans) {
59
- if (!is_array($plans) || 0 === count($plans)) {
60
- return false;
61
- }
62
-
63
- /**
64
- * @var FS_Plugin_Plan[] $plans
65
- */
66
- for ($i = 0, $len = count($plans); $i < $len; $i ++) {
67
- if (!$plans[$i]->is_free()) {
68
- return true;
69
- }
70
- }
71
-
72
- return false;
73
- }
74
- /**
75
- * Check if plugin has any free plan, or is it premium only.
76
- *
77
- * Note: If no plans configured, assume plugin is free.
78
- *
79
- * @author Vova Feldman (@svovaf)
80
- * @since 1.0.7
81
- *
82
- * @param FS_Plugin_Plan[] $plans
83
- *
84
- * @return bool
85
- */
86
- function has_free_plan($plans) {
87
- if (!is_array($plans) || 0 === count($plans)) {
88
- return true;
89
- }
90
-
91
- /**
92
- * @var FS_Plugin_Plan[] $plans
93
- */
94
- for ($i = 0, $len = count($plans); $i < $len; $i ++) {
95
- if ($plans[$i]->is_free()) {
96
- return true;
97
- }
98
- }
99
-
100
- return false;
101
- }
102
- /**
103
- * Find all plans that have trial.
104
- *
105
- * @author Vova Feldman (@svovaf)
106
- * @since 1.0.9
107
- *
108
- * @param FS_Plugin_Plan[] $plans
109
- *
110
- * @return FS_Plugin_Plan[]
111
- */
112
- function get_trial_plans($plans) {
113
- $trial_plans = array();
114
-
115
- if (is_array($plans) && 0 < count($plans)) {
116
- /**
117
- * @var FS_Plugin_Plan[] $plans
118
- */
119
- for ($i = 0, $len = count($plans); $i < $len; $i ++) {
120
- if ($plans[$i]->has_trial()) {
121
- $trial_plans[] = $plans[$i];
122
- }
123
- }
124
- }
125
-
126
- return $trial_plans;
127
- }
128
- /**
129
- * Check if plugin has any trial plan.
130
- *
131
- * @author Vova Feldman (@svovaf)
132
- * @since 1.0.9
133
- *
134
- * @param FS_Plugin_Plan[] $plans
135
- *
136
- * @return bool
137
- */
138
- function has_trial_plan($plans) {
139
- if (!is_array($plans) || 0 === count($plans)) {
140
- return true;
141
- }
142
-
143
- /**
144
- * @var FS_Plugin_Plan[] $plans
145
- */
146
- for ($i = 0, $len = count($plans); $i < $len; $i ++) {
147
- if ($plans[$i]->has_trial()) {
148
- return true;
149
- }
150
- }
151
-
152
- return false;
153
- }
154
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/managers/class-fs-plugin-manager.php DELETED
@@ -1,140 +0,0 @@
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.6
7
- */
8
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- class FS_Plugin_Manager {
12
- /**
13
- * @var string
14
- */
15
- protected $_slug;
16
- /**
17
- * @var FS_Plugin
18
- */
19
- protected $_plugin;
20
- /**
21
- * @var FS_Plugin_Manager[]
22
- */
23
- private static $_instances = array();
24
- /**
25
- * @var FS_Logger
26
- */
27
- protected $_logger;
28
- /**
29
- * @param string $slug
30
- *
31
- * @return FS_Plugin_Manager
32
- */
33
- static function instance($slug) {
34
- if (!isset(self::$_instances[$slug])) {
35
- self::$_instances[$slug] = new FS_Plugin_Manager($slug);
36
- }
37
-
38
- return self::$_instances[$slug];
39
- }
40
- protected function __construct($slug) {
41
- $this->_logger = FS_Logger::get_logger(WP_FS__SLUG . '_' . $slug . '_' . 'plugins', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK);
42
-
43
- $this->_slug = $slug;
44
- $this->load();
45
- }
46
- protected function get_option_manager() {
47
- return FS_Option_Manager::get_manager(WP_FS__ACCOUNTS_OPTION_NAME, true);
48
- }
49
- protected function get_all_plugins() {
50
- return $this->get_option_manager()->get_option('plugins', array());
51
- }
52
- /**
53
- * Load plugin data from local DB.
54
- *
55
- * @author Vova Feldman (@svovaf)
56
- * @since 1.0.6
57
- */
58
- function load() {
59
- $all_plugins = $this->get_all_plugins();
60
- $this->_plugin = isset($all_plugins[$this->_slug]) ?
61
- $all_plugins[$this->_slug] :
62
- null;
63
- }
64
- /**
65
- * Store plugin on local DB.
66
- *
67
- * @author Vova Feldman (@svovaf)
68
- * @since 1.0.6
69
- *
70
- * @param bool|FS_Plugin $plugin
71
- * @param bool $flush
72
- *
73
- * @return bool|\FS_Plugin
74
- */
75
- function store($plugin = false, $flush = true) {
76
- $all_plugins = $this->get_all_plugins();
77
-
78
- if (false !== $plugin) {
79
- $this->_plugin = $plugin;
80
- }
81
-
82
- $all_plugins[$this->_slug] = $this->_plugin;
83
-
84
- $options_manager = $this->get_option_manager();
85
- $options_manager->set_option('plugins', $all_plugins, $flush);
86
-
87
- return $this->_plugin;
88
- }
89
- /**
90
- * Update local plugin data if different.
91
- *
92
- * @author Vova Feldman (@svovaf)
93
- * @since 1.0.6
94
- *
95
- * @param \FS_Plugin $plugin
96
- * @param bool $store
97
- *
98
- * @return bool True if plugin was updated.
99
- */
100
- function update(FS_Plugin $plugin, $store = true) {
101
- if (!( $this->_plugin instanceof FS_Plugin ) ||
102
- $this->_plugin->slug != $plugin->slug ||
103
- $this->_plugin->public_key != $plugin->public_key ||
104
- $this->_plugin->secret_key != $plugin->secret_key ||
105
- $this->_plugin->parent_plugin_id != $plugin->parent_plugin_id ||
106
- $this->_plugin->title != $plugin->title
107
- ) {
108
- $this->store($plugin, $store);
109
-
110
- return true;
111
- }
112
-
113
- return false;
114
- }
115
- /**
116
- * @author Vova Feldman (@svovaf)
117
- * @since 1.0.6
118
- *
119
- * @param FS_Plugin $plugin
120
- * @param bool $store
121
- */
122
- function set(FS_Plugin $plugin, $store = false) {
123
- $this->_plugin = $plugin;
124
-
125
- if ($store) {
126
- $this->store();
127
- }
128
- }
129
- /**
130
- * @author Vova Feldman (@svovaf)
131
- * @since 1.0.6
132
- *
133
- * @return bool|\FS_Plugin
134
- */
135
- function get() {
136
- return isset($this->_plugin) ?
137
- $this->_plugin :
138
- false;
139
- }
140
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/managers/index.php DELETED
@@ -1,3 +0,0 @@
1
- <?php
2
- // Silence is golden.
3
- // Hide file structure from users on unprotected servers.
 
 
 
freemius/includes/sdk/Exceptions/ArgumentNotExistException.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- if (!class_exists('Freemius_InvalidArgumentException')) {
3
- exit;
4
- }
5
-
6
- if (!class_exists('Freemius_ArgumentNotExistException')) {
7
- class Freemius_ArgumentNotExistException extends Freemius_InvalidArgumentException {
8
-
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
freemius/includes/sdk/Exceptions/EmptyArgumentException.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- if (!class_exists('Freemius_InvalidArgumentException')) {
3
- exit;
4
- }
5
-
6
- if (!class_exists('Freemius_EmptyArgumentException')) {
7
- class Freemius_EmptyArgumentException extends Freemius_InvalidArgumentException {
8
-
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
freemius/includes/sdk/Exceptions/Exception.php DELETED
@@ -1,69 +0,0 @@
1
- <?php
2
- if (!class_exists('Freemius_Exception')) {
3
- /**
4
- * Thrown when an API call returns an exception.
5
- *
6
- */
7
- class Freemius_Exception extends Exception {
8
- protected $_result;
9
- protected $_type;
10
- protected $_code;
11
- /**
12
- * Make a new API Exception with the given result.
13
- *
14
- * @param array $result The result from the API server.
15
- */
16
- public function __construct($result) {
17
- $this->_result = $result;
18
-
19
- $code = 0;
20
- $message = 'Unknown error, please check GetResult().';
21
- $type = '';
22
-
23
- if (isset($result['error']) && is_array($result['error'])) {
24
- if (isset($result['error']['code'])) {
25
- $code = $result['error']['code'];
26
- }
27
- if (isset($result['error']['message'])) {
28
- $message = $result['error']['message'];
29
- }
30
- if (isset($result['error']['type'])) {
31
- $type = $result['error']['type'];
32
- }
33
- }
34
-
35
- $this->_type = $type;
36
- $this->_code = $code;
37
-
38
- parent::__construct($message, is_numeric($code) ? $code : 0 );
39
- }
40
- /**
41
- * Return the associated result object returned by the API server.
42
- *
43
- * @return array The result from the API server
44
- */
45
- public function getResult() {
46
- return $this->_result;
47
- }
48
- public function getStringCode() {
49
- return $this->_code;
50
- }
51
- public function getType() {
52
- return $this->_type;
53
- }
54
- /**
55
- * To make debugging easier.
56
- *
57
- * @return string The string representation of the error
58
- */
59
- public function __toString() {
60
- $str = $this->getType() . ': ';
61
-
62
- if ($this->code != 0) {
63
- $str .= $this->getStringCode() . ': ';
64
- }
65
-
66
- return $str . $this->getMessage();
67
- }
68
- }
69
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/sdk/Exceptions/InvalidArgumentException.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- if (!class_exists('Freemius_Exception')) {
3
- exit;
4
- }
5
-
6
- if (!class_exists('Freemius_InvalidArgumentException')) {
7
- class Freemius_InvalidArgumentException extends Freemius_Exception {
8
-
9
- }
10
- }
 
 
 
 
 
 
 
 
 
 
freemius/includes/sdk/Exceptions/OAuthException.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- if (!class_exists('Freemius_Exception')) {
3
- exit;
4
- }
5
-
6
- if (!class_exists('Freemius_OAuthException')) {
7
- class Freemius_OAuthException extends Freemius_Exception {
8
- public function __construct($pResult) {
9
- parent::__construct($pResult);
10
- }
11
- }
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/sdk/Exceptions/index.php DELETED
@@ -1,3 +0,0 @@
1
- <?php
2
- // Silence is golden.
3
- // Hide file structure from users on unprotected servers.
 
 
 
freemius/includes/sdk/Freemius.php DELETED
@@ -1,586 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright 2014 Freemius, Inc.
4
- *
5
- * Licensed under the GPL v2 (the "License"); you may
6
- * not use this file except in compliance with the License. You may obtain
7
- * a copy of the License at
8
- *
9
- * http://choosealicense.com/licenses/gpl-v2/
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations
15
- * under the License.
16
- */
17
- require_once dirname(__FILE__) . '/FreemiusBase.php';
18
-
19
- if (!defined('FS_SDK__USER_AGENT')) {
20
- define('FS_SDK__USER_AGENT', 'fs-php-' . Freemius_Api_Base::VERSION);
21
- }
22
-
23
- if (!defined('FS_SDK__SIMULATE_NO_CURL')) {
24
- define('FS_SDK__SIMULATE_NO_CURL', false);
25
- }
26
-
27
- if (!defined('FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE')) {
28
- define('FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', false);
29
- }
30
-
31
- if (!defined('FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL')) {
32
- define('FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', false);
33
- }
34
-
35
- if (!defined('FS_SDK__HAS_CURL')) {
36
- if (FS_SDK__SIMULATE_NO_CURL) {
37
- define('FS_SDK__HAS_CURL', false);
38
- } else {
39
- $curl_required_methods = array(
40
- 'curl_version',
41
- 'curl_exec',
42
- 'curl_init',
43
- 'curl_close',
44
- 'curl_setopt',
45
- 'curl_setopt_array',
46
- 'curl_error',
47
- );
48
-
49
- $has_curl = true;
50
- foreach ($curl_required_methods as $m) {
51
- if (!function_exists($m)) {
52
- $has_curl = false;
53
- break;
54
- }
55
- }
56
-
57
- define('FS_SDK__HAS_CURL', $has_curl);
58
- }
59
- }
60
-
61
- $curl_version = FS_SDK__HAS_CURL ?
62
- curl_version() :
63
- array('version' => '7.37');
64
-
65
- if (!defined('FS_API__PROTOCOL')) {
66
- define('FS_API__PROTOCOL', version_compare($curl_version['version'], '7.37', '>=') ? 'https' : 'http' );
67
- }
68
-
69
- if (!defined('FS_API__LOGGER_ON')) {
70
- define('FS_API__LOGGER_ON', false);
71
- }
72
-
73
- if (!defined('FS_API__ADDRESS')) {
74
- define('FS_API__ADDRESS', '://api.freemius.com');
75
- }
76
- if (!defined('FS_API__SANDBOX_ADDRESS')) {
77
- define('FS_API__SANDBOX_ADDRESS', '://sandbox-api.freemius.com');
78
- }
79
-
80
- if (class_exists('Freemius_Api')) {
81
- return;
82
- }
83
- class Freemius_Api extends Freemius_Api_Base {
84
- private static $_logger = array();
85
- /**
86
- * @param string $pScope 'app', 'developer', 'user' or 'install'.
87
- * @param number $pID Element's id.
88
- * @param string $pPublic Public key.
89
- * @param string|bool $pSecret Element's secret key.
90
- * @param bool $pSandbox Whether or not to run API in sandbox mode.
91
- */
92
- public function __construct($pScope, $pID, $pPublic, $pSecret = false, $pSandbox = false) {
93
- // If secret key not provided, use public key encryption.
94
- if (is_bool($pSecret)) {
95
- $pSecret = $pPublic;
96
- }
97
-
98
- parent::Init($pScope, $pID, $pPublic, $pSecret, $pSandbox);
99
- }
100
- public static function GetUrl($pCanonizedPath = '', $pIsSandbox = false) {
101
- $address = ( $pIsSandbox ? FS_API__SANDBOX_ADDRESS : FS_API__ADDRESS );
102
-
103
- if (':' === $address[0]) {
104
- $address = self::$_protocol . $address;
105
- }
106
-
107
- return $address . $pCanonizedPath;
108
- }
109
- #----------------------------------------------------------------------------------
110
- #region Servers Clock Diff
111
- #----------------------------------------------------------------------------------
112
- /**
113
- * @var int Clock diff in seconds between current server to API server.
114
- */
115
- private static $_clock_diff = 0;
116
- /**
117
- * Set clock diff for all API calls.
118
- *
119
- * @since 1.0.3
120
- *
121
- * @param $pSeconds
122
- */
123
- public static function SetClockDiff($pSeconds) {
124
- self::$_clock_diff = $pSeconds;
125
- }
126
- /**
127
- * Find clock diff between current server to API server.
128
- *
129
- * @since 1.0.2
130
- * @return int Clock diff in seconds.
131
- */
132
- public static function FindClockDiff() {
133
- $time = time();
134
- $pong = self::Ping();
135
-
136
- return ( $time - strtotime($pong->timestamp) );
137
- }
138
- #endregion
139
- /**
140
- * @var string http or https
141
- */
142
- private static $_protocol = FS_API__PROTOCOL;
143
- /**
144
- * Set API connection protocol.
145
- *
146
- * @since 1.0.4
147
- */
148
- public static function SetHttp() {
149
- self::$_protocol = 'http';
150
- }
151
- /**
152
- * @since 1.0.4
153
- *
154
- * @return bool
155
- */
156
- public static function IsHttps() {
157
- return ( 'https' === self::$_protocol );
158
- }
159
- /**
160
- * Sign request with the following HTTP headers:
161
- * Content-MD5: MD5(HTTP Request body)
162
- * Date: Current date (i.e Sat, 14 Feb 2015 20:24:46 +0000)
163
- * Authorization: FS {scope_entity_id}:{scope_entity_public_key}:base64encode(sha256(string_to_sign,
164
- * {scope_entity_secret_key}))
165
- *
166
- * @param string $pResourceUrl
167
- * @param array $pCurlOptions
168
- *
169
- * @return array
170
- */
171
- function SignRequest($pResourceUrl, $pCurlOptions) {
172
- $eol = "\n";
173
- $content_md5 = '';
174
- $now = ( time() - self::$_clock_diff );
175
- $date = date('r', $now);
176
- $content_type = '';
177
-
178
- if (isset($pCurlOptions[CURLOPT_POST]) && 0 < $pCurlOptions[CURLOPT_POST]) {
179
- $content_md5 = md5($pCurlOptions[CURLOPT_POSTFIELDS]);
180
- $pCurlOptions[CURLOPT_HTTPHEADER][] = 'Content-MD5: ' . $content_md5;
181
- $content_type = 'application/json';
182
- }
183
-
184
- $pCurlOptions[CURLOPT_HTTPHEADER][] = 'Date: ' . $date;
185
-
186
- $string_to_sign = implode($eol, array(
187
- $pCurlOptions[CURLOPT_CUSTOMREQUEST],
188
- $content_md5,
189
- $content_type,
190
- $date,
191
- $pResourceUrl
192
- ));
193
-
194
- // If secret and public keys are identical, it means that
195
- // the signature uses public key hash encoding.
196
- $auth_type = ( $this->_secret !== $this->_public ) ? 'FS' : 'FSP';
197
-
198
- // Add authorization header.
199
- $pCurlOptions[CURLOPT_HTTPHEADER][] = 'Authorization: ' .
200
- $auth_type . ' ' .
201
- $this->_id . ':' .
202
- $this->_public . ':' .
203
- self::Base64UrlEncode(
204
- hash_hmac('sha256', $string_to_sign, $this->_secret)
205
- );
206
-
207
- return $pCurlOptions;
208
- }
209
- /**
210
- * Get API request URL signed via query string.
211
- *
212
- * @param string $pPath
213
- *
214
- * @throws Freemius_Exception
215
- *
216
- * @return string
217
- */
218
- function GetSignedUrl($pPath) {
219
- $resource = explode('?', $this->CanonizePath($pPath));
220
- $pResourceUrl = $resource[0];
221
-
222
- $eol = "\n";
223
- $content_md5 = '';
224
- $content_type = '';
225
- $now = ( time() - self::$_clock_diff );
226
- $date = date('r', $now);
227
-
228
- $string_to_sign = implode($eol, array(
229
- 'GET',
230
- $content_md5,
231
- $content_type,
232
- $date,
233
- $pResourceUrl
234
- ));
235
-
236
- // If secret and public keys are identical, it means that
237
- // the signature uses public key hash encoding.
238
- $auth_type = ( $this->_secret !== $this->_public ) ? 'FS' : 'FSP';
239
-
240
- return Freemius_Api::GetUrl(
241
- $pResourceUrl . '?' .
242
- ( 1 < count($resource) && !empty($resource[1]) ? $resource[1] . '&' : '' ) .
243
- http_build_query(array(
244
- 'auth_date' => $date,
245
- 'authorization' => $auth_type . ' ' . $this->_id . ':' .
246
- $this->_public . ':' .
247
- self::Base64UrlEncode(hash_hmac(
248
- 'sha256', $string_to_sign, $this->_secret
249
- ))
250
- )), $this->_isSandbox);
251
- }
252
- /**
253
- * @param resource $pCurlHandler
254
- * @param array $pCurlOptions
255
- *
256
- * @return mixed
257
- */
258
- private static function ExecuteRequest(&$pCurlHandler, &$pCurlOptions) {
259
- $start = microtime(true);
260
-
261
- $result = curl_exec($pCurlHandler);
262
-
263
- if (FS_API__LOGGER_ON) {
264
- $end = microtime(true);
265
-
266
- $has_body = ( isset($pCurlOptions[CURLOPT_POST]) && 0 < $pCurlOptions[CURLOPT_POST] );
267
-
268
- self::$_logger[] = array(
269
- 'id' => count(self::$_logger),
270
- 'start' => $start,
271
- 'end' => $end,
272
- 'total' => ( $end - $start ),
273
- 'method' => $pCurlOptions[CURLOPT_CUSTOMREQUEST],
274
- 'path' => $pCurlOptions[CURLOPT_URL],
275
- 'body' => $has_body ? $pCurlOptions[CURLOPT_POSTFIELDS] : null,
276
- 'result' => $result,
277
- 'code' => curl_getinfo($pCurlHandler, CURLINFO_HTTP_CODE),
278
- 'backtrace' => debug_backtrace(),
279
- );
280
- }
281
-
282
- return $result;
283
- }
284
- /**
285
- * @return array
286
- */
287
- static function GetLogger() {
288
- return self::$_logger;
289
- }
290
- /**
291
- * @param string $pCanonizedPath
292
- * @param string $pMethod
293
- * @param array $pParams
294
- * @param null|resource $pCurlHandler
295
- * @param bool $pIsSandbox
296
- * @param null|callable $pBeforeExecutionFunction
297
- *
298
- * @return object[]|object|null
299
- *
300
- * @throws \Freemius_Exception
301
- */
302
- private static function MakeStaticRequest(
303
- $pCanonizedPath, $pMethod = 'GET', $pParams = array(), $pCurlHandler = null, $pIsSandbox = false, $pBeforeExecutionFunction = null
304
- ) {
305
- if (!FS_SDK__HAS_CURL) {
306
- self::ThrowNoCurlException();
307
- }
308
-
309
- // Connectivity errors simulation.
310
- if (FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE) {
311
- self::ThrowCloudFlareDDoSException();
312
- } else if (FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL) {
313
- self::ThrowSquidAclException();
314
- }
315
-
316
- if (!$pCurlHandler) {
317
- $pCurlHandler = curl_init();
318
- }
319
-
320
- $opts = array(
321
- CURLOPT_CONNECTTIMEOUT => 10,
322
- CURLOPT_RETURNTRANSFER => true,
323
- CURLOPT_TIMEOUT => 60,
324
- CURLOPT_USERAGENT => FS_SDK__USER_AGENT,
325
- CURLOPT_HTTPHEADER => array(),
326
- );
327
-
328
- if ('POST' === $pMethod || 'PUT' === $pMethod) {
329
- if (is_array($pParams) && 0 < count($pParams)) {
330
- $opts[CURLOPT_HTTPHEADER][] = 'Content-Type: application/json';
331
- $opts[CURLOPT_POST] = count($pParams);
332
- $opts[CURLOPT_POSTFIELDS] = json_encode($pParams);
333
- }
334
-
335
- $opts[CURLOPT_RETURNTRANSFER] = true;
336
- }
337
-
338
- $request_url = self::GetUrl($pCanonizedPath, $pIsSandbox);
339
-
340
- $opts[CURLOPT_URL] = $request_url;
341
- $opts[CURLOPT_CUSTOMREQUEST] = $pMethod;
342
-
343
- $resource = explode('?', $pCanonizedPath);
344
-
345
- // Disable the 'Expect: 100-continue' behaviour. This causes CURL to wait
346
- // for 2 seconds if the server does not support this header.
347
- $opts[CURLOPT_HTTPHEADER][] = 'Expect:';
348
-
349
- if ('https' === substr(strtolower($request_url), 0, 5)) {
350
- $opts[CURLOPT_SSL_VERIFYHOST] = false;
351
- $opts[CURLOPT_SSL_VERIFYPEER] = false;
352
- }
353
-
354
- if (false !== $pBeforeExecutionFunction &&
355
- is_callable($pBeforeExecutionFunction)
356
- ) {
357
- $opts = call_user_func($pBeforeExecutionFunction, $resource[0], $opts);
358
- }
359
-
360
- curl_setopt_array($pCurlHandler, $opts);
361
- $result = self::ExecuteRequest($pCurlHandler, $opts);
362
-
363
- /* if (curl_errno($ch) == 60) // CURLE_SSL_CACERT
364
- {
365
- self::errorLog('Invalid or no certificate authority found, using bundled information');
366
- curl_setopt($ch, CURLOPT_CAINFO,
367
- dirname(__FILE__) . '/fb_ca_chain_bundle.crt');
368
- $result = curl_exec($ch);
369
- } */
370
-
371
- // With dual stacked DNS responses, it's possible for a server to
372
- // have IPv6 enabled but not have IPv6 connectivity. If this is
373
- // the case, curl will try IPv4 first and if that fails, then it will
374
- // fall back to IPv6 and the error EHOSTUNREACH is returned by the
375
- // operating system.
376
- if (false === $result && empty($opts[CURLOPT_IPRESOLVE])) {
377
- $matches = array();
378
- $regex = '/Failed to connect to ([^:].*): Network is unreachable/';
379
- if (preg_match($regex, curl_error($pCurlHandler), $matches)) {
380
- if (strlen(@inet_pton($matches[1])) === 16) {
381
- // self::errorLog('Invalid IPv6 configuration on server, Please disable or get native IPv6 on your server.');
382
- $opts[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V4;
383
- curl_setopt($pCurlHandler, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
384
- $result = self::ExecuteRequest($pCurlHandler, $opts);
385
- }
386
- }
387
- }
388
-
389
- if ($result === false) {
390
- self::ThrowCurlException($pCurlHandler);
391
- }
392
-
393
- curl_close($pCurlHandler);
394
-
395
- if (empty($result)) {
396
- return null;
397
- }
398
-
399
- $decoded = json_decode($result);
400
-
401
- if (is_null($decoded)) {
402
- if (preg_match('/Please turn JavaScript on/i', $result) &&
403
- preg_match('/text\/javascript/', $result)
404
- ) {
405
- self::ThrowCloudFlareDDoSException($result);
406
- } else if (preg_match('/Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect./', $result) &&
407
- preg_match('/squid/', $result)
408
- ) {
409
- self::ThrowSquidAclException($result);
410
- } else {
411
- $decoded = (object) array(
412
- 'error' => (object) array(
413
- 'type' => 'Unknown',
414
- 'message' => $result,
415
- 'code' => 'unknown',
416
- 'http' => 402
417
- )
418
- );
419
- }
420
- }
421
-
422
- return $decoded;
423
- }
424
- /**
425
- * Makes an HTTP request. This method can be overridden by subclasses if
426
- * developers want to do fancier things or use something other than curl to
427
- * make the request.
428
- *
429
- * @param string $pCanonizedPath The URL to make the request to
430
- * @param string $pMethod HTTP method
431
- * @param array $pParams The parameters to use for the POST body
432
- * @param null|resource $pCurlHandler Initialized curl handle
433
- *
434
- * @return object[]|object|null
435
- *
436
- * @throws Freemius_Exception
437
- */
438
- public function MakeRequest(
439
- $pCanonizedPath, $pMethod = 'GET', $pParams = array(), $pCurlHandler = null
440
- ) {
441
- $resource = explode('?', $pCanonizedPath);
442
-
443
- // Only sign request if not ping.json connectivity test.
444
- $sign_request = ( '/v1/ping.json' !== strtolower(substr($resource[0], - strlen('/v1/ping.json'))) );
445
-
446
- return self::MakeStaticRequest(
447
- $pCanonizedPath, $pMethod, $pParams, $pCurlHandler, $this->_isSandbox, $sign_request ? array(&$this, 'SignRequest') : null
448
- );
449
- }
450
- #----------------------------------------------------------------------------------
451
- #region Connectivity Test
452
- #----------------------------------------------------------------------------------
453
- /**
454
- * If successful connectivity to the API endpoint using ping.json endpoint.
455
- *
456
- * - OR -
457
- *
458
- * Validate if ping result object is valid.
459
- *
460
- * @param mixed $pPong
461
- *
462
- * @return bool
463
- */
464
- public static function Test($pPong = null) {
465
- $pong = is_null($pPong) ?
466
- self::Ping() :
467
- $pPong;
468
-
469
- return (
470
- is_object($pong) &&
471
- isset($pong->api) &&
472
- 'pong' === $pong->api
473
- );
474
- }
475
- /**
476
- * Ping API to test connectivity.
477
- *
478
- * @return object
479
- */
480
- public static function Ping() {
481
- try {
482
- $result = self::MakeStaticRequest('/v' . FS_API__VERSION . '/ping.json');
483
- } catch (Freemius_Exception $e) {
484
- // Map to error object.
485
- $result = (object) $e->getResult();
486
- } catch (Exception $e) {
487
- // Map to error object.
488
- $result = (object) array(
489
- 'error' => array(
490
- 'type' => 'Unknown',
491
- 'message' => $e->getMessage() . ' (' . $e->getFile() . ': ' . $e->getLine() . ')',
492
- 'code' => 'unknown',
493
- 'http' => 402
494
- )
495
- );
496
- }
497
-
498
- return $result;
499
- }
500
- #endregion
501
- #----------------------------------------------------------------------------------
502
- #region Connectivity Exceptions
503
- #----------------------------------------------------------------------------------
504
- /**
505
- * @param resource $pCurlHandler
506
- *
507
- * @throws Freemius_Exception
508
- */
509
- private static function ThrowCurlException($pCurlHandler) {
510
- $e = new Freemius_Exception(array(
511
- 'error' => array(
512
- 'code' => curl_errno($pCurlHandler),
513
- 'message' => curl_error($pCurlHandler),
514
- 'type' => 'CurlException',
515
- ),
516
- ));
517
-
518
- curl_close($pCurlHandler);
519
- throw $e;
520
- }
521
- /**
522
- * @param string $pResult
523
- *
524
- * @throws Freemius_Exception
525
- */
526
- private static function ThrowNoCurlException($pResult = '') {
527
- $curl_required_methods = array(
528
- 'curl_version',
529
- 'curl_exec',
530
- 'curl_init',
531
- 'curl_close',
532
- 'curl_setopt',
533
- 'curl_setopt_array',
534
- 'curl_error',
535
- );
536
-
537
- // Find all missing methods.
538
- $missing_methods = array();
539
- foreach ($curl_required_methods as $m) {
540
- if (!function_exists($m)) {
541
- $missing_methods[] = $m;
542
- }
543
- }
544
-
545
- throw new Freemius_Exception(array(
546
- 'error' => (object) array(
547
- 'type' => 'cUrlMissing',
548
- 'message' => $pResult,
549
- 'code' => 'curl_missing',
550
- 'http' => 402
551
- ),
552
- 'missing_methods' => $missing_methods,
553
- ));
554
- }
555
- /**
556
- * @param string $pResult
557
- *
558
- * @throws Freemius_Exception
559
- */
560
- private static function ThrowCloudFlareDDoSException($pResult = '') {
561
- throw new Freemius_Exception(array(
562
- 'error' => (object) array(
563
- 'type' => 'CloudFlareDDoSProtection',
564
- 'message' => $pResult,
565
- 'code' => 'cloudflare_ddos_protection',
566
- 'http' => 402
567
- )
568
- ));
569
- }
570
- /**
571
- * @param string $pResult
572
- *
573
- * @throws Freemius_Exception
574
- */
575
- private static function ThrowSquidAclException($pResult = '') {
576
- throw new Freemius_Exception(array(
577
- 'error' => (object) array(
578
- 'type' => 'SquidCacheBlock',
579
- 'message' => $pResult,
580
- 'code' => 'squid_cache_block',
581
- 'http' => 402
582
- )
583
- ));
584
- }
585
- #endregion
586
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/sdk/FreemiusBase.php DELETED
@@ -1,176 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright 2014 Freemius, Inc.
4
- *
5
- * Licensed under the GPL v2 (the "License"); you may
6
- * not use this file except in compliance with the License. You may obtain
7
- * a copy of the License at
8
- *
9
- * http://choosealicense.com/licenses/gpl-v2/
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations
15
- * under the License.
16
- */
17
- if (!defined('FS_API__VERSION')) {
18
- define('FS_API__VERSION', '1');
19
- }
20
- if (!defined('FS_SDK__PATH')) {
21
- define('FS_SDK__PATH', dirname(__FILE__));
22
- }
23
- if (!defined('FS_SDK__EXCEPTIONS_PATH')) {
24
- define('FS_SDK__EXCEPTIONS_PATH', FS_SDK__PATH . '/Exceptions/');
25
- }
26
-
27
- if (!function_exists('json_decode')) {
28
- throw new Exception('Freemius needs the JSON PHP extension.');
29
- }
30
-
31
- // Include all exception files.
32
- $exceptions = array(
33
- 'Exception',
34
- 'InvalidArgumentException',
35
- 'ArgumentNotExistException',
36
- 'EmptyArgumentException',
37
- 'OAuthException'
38
- );
39
-
40
- foreach ($exceptions as $e) {
41
- require_once FS_SDK__EXCEPTIONS_PATH . $e . '.php';
42
- }
43
-
44
- if (class_exists('Freemius_Api_Base')) {
45
- return;
46
- }
47
- abstract class Freemius_Api_Base {
48
- const VERSION = '1.0.4';
49
- const FORMAT = 'json';
50
- protected $_id;
51
- protected $_public;
52
- protected $_secret;
53
- protected $_scope;
54
- protected $_isSandbox;
55
- /**
56
- * @param string $pScope 'app', 'developer', 'plugin', 'user' or 'install'.
57
- * @param number $pID Element's id.
58
- * @param string $pPublic Public key.
59
- * @param string $pSecret Element's secret key.
60
- * @param bool $pIsSandbox Whether or not to run API in sandbox mode.
61
- */
62
- public function Init($pScope, $pID, $pPublic, $pSecret, $pIsSandbox = false) {
63
- $this->_id = $pID;
64
- $this->_public = $pPublic;
65
- $this->_secret = $pSecret;
66
- $this->_scope = $pScope;
67
- $this->_isSandbox = $pIsSandbox;
68
- }
69
- public function IsSandbox() {
70
- return $this->_isSandbox;
71
- }
72
- function CanonizePath($pPath) {
73
- $pPath = trim($pPath, '/');
74
- $query_pos = strpos($pPath, '?');
75
- $query = '';
76
-
77
- if (false !== $query_pos) {
78
- $query = substr($pPath, $query_pos);
79
- $pPath = substr($pPath, 0, $query_pos);
80
- }
81
-
82
- // Trim '.json' suffix.
83
- $format_length = strlen('.' . self::FORMAT);
84
- $start = $format_length * ( - 1 ); //negative
85
- if (substr(strtolower($pPath), $start) === ( '.' . self::FORMAT )) {
86
- $pPath = substr($pPath, 0, strlen($pPath) - $format_length);
87
- }
88
-
89
- switch ($this->_scope) {
90
- case 'app':
91
- $base = '/apps/' . $this->_id;
92
- break;
93
- case 'developer':
94
- $base = '/developers/' . $this->_id;
95
- break;
96
- case 'user':
97
- $base = '/users/' . $this->_id;
98
- break;
99
- case 'plugin':
100
- $base = '/plugins/' . $this->_id;
101
- break;
102
- case 'install':
103
- $base = '/installs/' . $this->_id;
104
- break;
105
- default:
106
- throw new Freemius_Exception('Scope not implemented.');
107
- }
108
-
109
- return '/v' . FS_API__VERSION . $base .
110
- (!empty($pPath) ? '/' : '' ) . $pPath .
111
- ( ( false === strpos($pPath, '.') ) ? '.' . self::FORMAT : '' ) . $query;
112
- }
113
- abstract function MakeRequest($pCanonizedPath, $pMethod = 'GET', $pParams = array());
114
- /**
115
- * @param string $pPath
116
- * @param string $pMethod
117
- * @param array $pParams
118
- *
119
- * @return object[]|object|null
120
- */
121
- private function _Api($pPath, $pMethod = 'GET', $pParams = array()) {
122
- $pMethod = strtoupper($pMethod);
123
-
124
- try {
125
- $result = $this->MakeRequest($pPath, $pMethod, $pParams);
126
- } catch (Freemius_Exception $e) {
127
- // Map to error object.
128
- $result = (object) $e->getResult();
129
- } catch (Exception $e) {
130
- // Map to error object.
131
- $result = (object) array(
132
- 'error' => array(
133
- 'type' => 'Unknown',
134
- 'message' => $e->getMessage() . ' (' . $e->getFile() . ': ' . $e->getLine() . ')',
135
- 'code' => 'unknown',
136
- 'http' => 402
137
- )
138
- );
139
- }
140
-
141
- return $result;
142
- }
143
- public function Api($pPath, $pMethod = 'GET', $pParams = array()) {
144
- return $this->_Api($this->CanonizePath($pPath), $pMethod, $pParams);
145
- }
146
- /**
147
- * Base64 encoding that does not need to be urlencode()ed.
148
- * Exactly the same as base64_encode except it uses
149
- * - instead of +
150
- * _ instead of /
151
- * No padded =
152
- *
153
- * @param string $input base64UrlEncoded string
154
- *
155
- * @return string
156
- */
157
- protected static function Base64UrlDecode($input) {
158
- return base64_decode(strtr($input, '-_', '+/'));
159
- }
160
- /**
161
- * Base64 encoding that does not need to be urlencode()ed.
162
- * Exactly the same as base64_encode except it uses
163
- * - instead of +
164
- * _ instead of /
165
- *
166
- * @param string $input string
167
- *
168
- * @return string base64Url encoded string
169
- */
170
- protected static function Base64UrlEncode($input) {
171
- $str = strtr(base64_encode($input), '+/', '-_');
172
- $str = str_replace('=', '', $str);
173
-
174
- return $str;
175
- }
176
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/sdk/LICENSE.txt DELETED
@@ -1,340 +0,0 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 2, June 1991
3
-
4
- Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
5
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
- Everyone is permitted to copy and distribute verbatim copies
7
- of this license document, but changing it is not allowed.
8
-
9
- Preamble
10
-
11
- The licenses for most software are designed to take away your
12
- freedom to share and change it. By contrast, the GNU General Public
13
- License is intended to guarantee your freedom to share and change free
14
- software--to make sure the software is free for all its users. This
15
- General Public License applies to most of the Free Software
16
- Foundation's software and to any other program whose authors commit to
17
- using it. (Some other Free Software Foundation software is covered by
18
- the GNU Lesser General Public License instead.) You can apply it to
19
- your programs, too.
20
-
21
- When we speak of free software, we are referring to freedom, not
22
- price. Our General Public Licenses are designed to make sure that you
23
- have the freedom to distribute copies of free software (and charge for
24
- this service if you wish), that you receive source code or can get it
25
- if you want it, that you can change the software or use pieces of it
26
- in new free programs; and that you know you can do these things.
27
-
28
- To protect your rights, we need to make restrictions that forbid
29
- anyone to deny you these rights or to ask you to surrender the rights.
30
- These restrictions translate to certain responsibilities for you if you
31
- distribute copies of the software, or if you modify it.
32
-
33
- For example, if you distribute copies of such a program, whether
34
- gratis or for a fee, you must give the recipients all the rights that
35
- you have. You must make sure that they, too, receive or can get the
36
- source code. And you must show them these terms so they know their
37
- rights.
38
-
39
- We protect your rights with two steps: (1) copyright the software, and
40
- (2) offer you this license which gives you legal permission to copy,
41
- distribute and/or modify the software.
42
-
43
- Also, for each author's protection and ours, we want to make certain
44
- that everyone understands that there is no warranty for this free
45
- software. If the software is modified by someone else and passed on, we
46
- want its recipients to know that what they have is not the original, so
47
- that any problems introduced by others will not reflect on the original
48
- authors' reputations.
49
-
50
- Finally, any free program is threatened constantly by software
51
- patents. We wish to avoid the danger that redistributors of a free
52
- program will individually obtain patent licenses, in effect making the
53
- program proprietary. To prevent this, we have made it clear that any
54
- patent must be licensed for everyone's free use or not licensed at all.
55
-
56
- The precise terms and conditions for copying, distribution and
57
- modification follow.
58
-
59
- GNU GENERAL PUBLIC LICENSE
60
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
-
62
- 0. This License applies to any program or other work which contains
63
- a notice placed by the copyright holder saying it may be distributed
64
- under the terms of this General Public License. The "Program", below,
65
- refers to any such program or work, and a "work based on the Program"
66
- means either the Program or any derivative work under copyright law:
67
- that is to say, a work containing the Program or a portion of it,
68
- either verbatim or with modifications and/or translated into another
69
- language. (Hereinafter, translation is included without limitation in
70
- the term "modification".) Each licensee is addressed as "you".
71
-
72
- Activities other than copying, distribution and modification are not
73
- covered by this License; they are outside its scope. The act of
74
- running the Program is not restricted, and the output from the Program
75
- is covered only if its contents constitute a work based on the
76
- Program (independent of having been made by running the Program).
77
- Whether that is true depends on what the Program does.
78
-
79
- 1. You may copy and distribute verbatim copies of the Program's
80
- source code as you receive it, in any medium, provided that you
81
- conspicuously and appropriately publish on each copy an appropriate
82
- copyright notice and disclaimer of warranty; keep intact all the
83
- notices that refer to this License and to the absence of any warranty;
84
- and give any other recipients of the Program a copy of this License
85
- along with the Program.
86
-
87
- You may charge a fee for the physical act of transferring a copy, and
88
- you may at your option offer warranty protection in exchange for a fee.
89
-
90
- 2. You may modify your copy or copies of the Program or any portion
91
- of it, thus forming a work based on the Program, and copy and
92
- distribute such modifications or work under the terms of Section 1
93
- above, provided that you also meet all of these conditions:
94
-
95
- a) You must cause the modified files to carry prominent notices
96
- stating that you changed the files and the date of any change.
97
-
98
- b) You must cause any work that you distribute or publish, that in
99
- whole or in part contains or is derived from the Program or any
100
- part thereof, to be licensed as a whole at no charge to all third
101
- parties under the terms of this License.
102
-
103
- c) If the modified program normally reads commands interactively
104
- when run, you must cause it, when started running for such
105
- interactive use in the most ordinary way, to print or display an
106
- announcement including an appropriate copyright notice and a
107
- notice that there is no warranty (or else, saying that you provide
108
- a warranty) and that users may redistribute the program under
109
- these conditions, and telling the user how to view a copy of this
110
- License. (Exception: if the Program itself is interactive but
111
- does not normally print such an announcement, your work based on
112
- the Program is not required to print an announcement.)
113
-
114
- These requirements apply to the modified work as a whole. If
115
- identifiable sections of that work are not derived from the Program,
116
- and can be reasonably considered independent and separate works in
117
- themselves, then this License, and its terms, do not apply to those
118
- sections when you distribute them as separate works. But when you
119
- distribute the same sections as part of a whole which is a work based
120
- on the Program, the distribution of the whole must be on the terms of
121
- this License, whose permissions for other licensees extend to the
122
- entire whole, and thus to each and every part regardless of who wrote it.
123
-
124
- Thus, it is not the intent of this section to claim rights or contest
125
- your rights to work written entirely by you; rather, the intent is to
126
- exercise the right to control the distribution of derivative or
127
- collective works based on the Program.
128
-
129
- In addition, mere aggregation of another work not based on the Program
130
- with the Program (or with a work based on the Program) on a volume of
131
- a storage or distribution medium does not bring the other work under
132
- the scope of this License.
133
-
134
- 3. You may copy and distribute the Program (or a work based on it,
135
- under Section 2) in object code or executable form under the terms of
136
- Sections 1 and 2 above provided that you also do one of the following:
137
-
138
- a) Accompany it with the complete corresponding machine-readable
139
- source code, which must be distributed under the terms of Sections
140
- 1 and 2 above on a medium customarily used for software interchange; or,
141
-
142
- b) Accompany it with a written offer, valid for at least three
143
- years, to give any third party, for a charge no more than your
144
- cost of physically performing source distribution, a complete
145
- machine-readable copy of the corresponding source code, to be
146
- distributed under the terms of Sections 1 and 2 above on a medium
147
- customarily used for software interchange; or,
148
-
149
- c) Accompany it with the information you received as to the offer
150
- to distribute corresponding source code. (This alternative is
151
- allowed only for noncommercial distribution and only if you
152
- received the program in object code or executable form with such
153
- an offer, in accord with Subsection b above.)
154
-
155
- The source code for a work means the preferred form of the work for
156
- making modifications to it. For an executable work, complete source
157
- code means all the source code for all modules it contains, plus any
158
- associated interface definition files, plus the scripts used to
159
- control compilation and installation of the executable. However, as a
160
- special exception, the source code distributed need not include
161
- anything that is normally distributed (in either source or binary
162
- form) with the major components (compiler, kernel, and so on) of the
163
- operating system on which the executable runs, unless that component
164
- itself accompanies the executable.
165
-
166
- If distribution of executable or object code is made by offering
167
- access to copy from a designated place, then offering equivalent
168
- access to copy the source code from the same place counts as
169
- distribution of the source code, even though third parties are not
170
- compelled to copy the source along with the object code.
171
-
172
- 4. You may not copy, modify, sublicense, or distribute the Program
173
- except as expressly provided under this License. Any attempt
174
- otherwise to copy, modify, sublicense or distribute the Program is
175
- void, and will automatically terminate your rights under this License.
176
- However, parties who have received copies, or rights, from you under
177
- this License will not have their licenses terminated so long as such
178
- parties remain in full compliance.
179
-
180
- 5. You are not required to accept this License, since you have not
181
- signed it. However, nothing else grants you permission to modify or
182
- distribute the Program or its derivative works. These actions are
183
- prohibited by law if you do not accept this License. Therefore, by
184
- modifying or distributing the Program (or any work based on the
185
- Program), you indicate your acceptance of this License to do so, and
186
- all its terms and conditions for copying, distributing or modifying
187
- the Program or works based on it.
188
-
189
- 6. Each time you redistribute the Program (or any work based on the
190
- Program), the recipient automatically receives a license from the
191
- original licensor to copy, distribute or modify the Program subject to
192
- these terms and conditions. You may not impose any further
193
- restrictions on the recipients' exercise of the rights granted herein.
194
- You are not responsible for enforcing compliance by third parties to
195
- this License.
196
-
197
- 7. If, as a consequence of a court judgment or allegation of patent
198
- infringement or for any other reason (not limited to patent issues),
199
- conditions are imposed on you (whether by court order, agreement or
200
- otherwise) that contradict the conditions of this License, they do not
201
- excuse you from the conditions of this License. If you cannot
202
- distribute so as to satisfy simultaneously your obligations under this
203
- License and any other pertinent obligations, then as a consequence you
204
- may not distribute the Program at all. For example, if a patent
205
- license would not permit royalty-free redistribution of the Program by
206
- all those who receive copies directly or indirectly through you, then
207
- the only way you could satisfy both it and this License would be to
208
- refrain entirely from distribution of the Program.
209
-
210
- If any portion of this section is held invalid or unenforceable under
211
- any particular circumstance, the balance of the section is intended to
212
- apply and the section as a whole is intended to apply in other
213
- circumstances.
214
-
215
- It is not the purpose of this section to induce you to infringe any
216
- patents or other property right claims or to contest validity of any
217
- such claims; this section has the sole purpose of protecting the
218
- integrity of the free software distribution system, which is
219
- implemented by public license practices. Many people have made
220
- generous contributions to the wide range of software distributed
221
- through that system in reliance on consistent application of that
222
- system; it is up to the author/donor to decide if he or she is willing
223
- to distribute software through any other system and a licensee cannot
224
- impose that choice.
225
-
226
- This section is intended to make thoroughly clear what is believed to
227
- be a consequence of the rest of this License.
228
-
229
- 8. If the distribution and/or use of the Program is restricted in
230
- certain countries either by patents or by copyrighted interfaces, the
231
- original copyright holder who places the Program under this License
232
- may add an explicit geographical distribution limitation excluding
233
- those countries, so that distribution is permitted only in or among
234
- countries not thus excluded. In such case, this License incorporates
235
- the limitation as if written in the body of this License.
236
-
237
- 9. The Free Software Foundation may publish revised and/or new versions
238
- of the General Public License from time to time. Such new versions will
239
- be similar in spirit to the present version, but may differ in detail to
240
- address new problems or concerns.
241
-
242
- Each version is given a distinguishing version number. If the Program
243
- specifies a version number of this License which applies to it and "any
244
- later version", you have the option of following the terms and conditions
245
- either of that version or of any later version published by the Free
246
- Software Foundation. If the Program does not specify a version number of
247
- this License, you may choose any version ever published by the Free Software
248
- Foundation.
249
-
250
- 10. If you wish to incorporate parts of the Program into other free
251
- programs whose distribution conditions are different, write to the author
252
- to ask for permission. For software which is copyrighted by the Free
253
- Software Foundation, write to the Free Software Foundation; we sometimes
254
- make exceptions for this. Our decision will be guided by the two goals
255
- of preserving the free status of all derivatives of our free software and
256
- of promoting the sharing and reuse of software generally.
257
-
258
- NO WARRANTY
259
-
260
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
- FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
- OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
- PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
- OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
- TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
- PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
- REPAIR OR CORRECTION.
269
-
270
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
- REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
- INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
- OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
- TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
- YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
- PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
- POSSIBILITY OF SUCH DAMAGES.
279
-
280
- END OF TERMS AND CONDITIONS
281
-
282
- How to Apply These Terms to Your New Programs
283
-
284
- If you develop a new program, and you want it to be of the greatest
285
- possible use to the public, the best way to achieve this is to make it
286
- free software which everyone can redistribute and change under these terms.
287
-
288
- To do so, attach the following notices to the program. It is safest
289
- to attach them to the start of each source file to most effectively
290
- convey the exclusion of warranty; and each file should have at least
291
- the "copyright" line and a pointer to where the full notice is found.
292
-
293
- {description}
294
- Copyright (C) {year} {fullname}
295
-
296
- This program is free software; you can redistribute it and/or modify
297
- it under the terms of the GNU General Public License as published by
298
- the Free Software Foundation; either version 2 of the License, or
299
- (at your option) any later version.
300
-
301
- This program is distributed in the hope that it will be useful,
302
- but WITHOUT ANY WARRANTY; without even the implied warranty of
303
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
- GNU General Public License for more details.
305
-
306
- You should have received a copy of the GNU General Public License along
307
- with this program; if not, write to the Free Software Foundation, Inc.,
308
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
-
310
- Also add information on how to contact you by electronic and paper mail.
311
-
312
- If the program is interactive, make it output a short notice like this
313
- when it starts in an interactive mode:
314
-
315
- Gnomovision version 69, Copyright (C) year name of author
316
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
- This is free software, and you are welcome to redistribute it
318
- under certain conditions; type `show c' for details.
319
-
320
- The hypothetical commands `show w' and `show c' should show the appropriate
321
- parts of the General Public License. Of course, the commands you use may
322
- be called something other than `show w' and `show c'; they could even be
323
- mouse-clicks or menu items--whatever suits your program.
324
-
325
- You should also get your employer (if you work as a programmer) or your
326
- school, if any, to sign a "copyright disclaimer" for the program, if
327
- necessary. Here is a sample; alter the names:
328
-
329
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
-
332
- {signature of Ty Coon}, 1 April 1989
333
- Ty Coon, President of Vice
334
-
335
- This General Public License does not permit incorporating your program into
336
- proprietary programs. If your program is a subroutine library, you may
337
- consider it more useful to permit linking proprietary applications with the
338
- library. If this is what you want to do, use the GNU Lesser General
339
- Public License instead of this License.
340
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/sdk/index.php DELETED
@@ -1,3 +0,0 @@
1
- <?php
2
- // Silence is golden.
3
- // Hide file structure from users on unprotected servers.
 
 
 
freemius/includes/supplements/fs-essential-functions-1.1.7.1.php DELETED
@@ -1,45 +0,0 @@
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.7
7
- */
8
- if (!defined('ABSPATH')) {
9
- exit;
10
- }
11
- /**
12
- * Find the plugin main file path based on any give file inside the plugin's folder.
13
- *
14
- * @author Vova Feldman (@svovaf)
15
- * @since 1.1.7.1
16
- *
17
- * @param string $file Absolute path to a file inside a plugin's folder.
18
- *
19
- * @return string
20
- */
21
- function fs_find_direct_caller_plugin_file($file) {
22
- /**
23
- * All the code below will be executed once on activation.
24
- * If the user changes the main plugin's file name, the file_exists()
25
- * will catch it.
26
- */
27
- if (!function_exists('get_plugins')) {
28
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
29
- }
30
-
31
- $all_plugins = get_plugins();
32
-
33
- $file_real_path = fs_normalize_path(realpath($file));
34
-
35
- // Get active plugin's main files real full names (might be symlinks).
36
- foreach ($all_plugins as $relative_path => &$data) {
37
- if (0 === strpos($file_real_path, fs_normalize_path(dirname(realpath(WP_PLUGIN_DIR . '/' . $relative_path))))) {
38
- if ('.' !== dirname(trailingslashit($relative_path))) {
39
- return $relative_path;
40
- }
41
- }
42
- }
43
-
44
- return null;
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/includes/supplements/index.php DELETED
@@ -1,3 +0,0 @@
1
- <?php
2
- // Silence is golden.
3
- // Hide file structure from users on unprotected servers.
 
 
 
freemius/index.php DELETED
@@ -1,3 +0,0 @@
1
- <?php
2
- // Silence is golden.
3
- // Hide file structure from users on unprotected servers.
 
 
 
freemius/languages/freemius-da_DK.mo DELETED
Binary file
freemius/languages/freemius-da_DK.po DELETED
@@ -1,1790 +0,0 @@
1
- # Copyright (C) 2017 freemius
2
- # This file is distributed under the same license as the freemius package.
3
- # Translators:
4
- # Joachim Jensen <jv@intox.dk>, 2016-2017
5
- msgid ""
6
- msgstr ""
7
- "Project-Id-Version: WordPress SDK\n"
8
- "Report-Msgid-Bugs-To: https://github.com/Freemius/wordpress-sdk/issues\n"
9
- "POT-Creation-Date: \n"
10
- "PO-Revision-Date: 2017-05-12 17:32+0000\n"
11
- "Last-Translator: Vova Feldman <vova@freemius.com>\n"
12
- "Language: da_DK\n"
13
- "Language-Team: Danish (Denmark) (http://www.transifex.com/freemius/wordpress-sdk/language/da_DK/)\n"
14
- "Content-Type: text/plain; charset=UTF-8\n"
15
- "Content-Transfer-Encoding: 8bit\n"
16
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
- "MIME-Version: 1.0\n"
18
- "X-Poedit-Basepath: ..\n"
19
- "X-Poedit-KeywordsList: _fs_text;_fs_echo;_fs_esc_attr;_fs_esc_attr_echo;_fs_esc_html;_fs_esc_html_echo;_fs_x:1,2c;_fs_ex:1,2c;_fs_esc_attr_x:1,2c;_fs_esc_html_x:1,2c;_fs_n:1,2;_fs_n_noop:1,2;_fs_nx:1,2,4c;_fs_nx_noop:1,2,3c\n"
20
- "X-Poedit-SearchPath-0: .\n"
21
- "X-Poedit-SearchPathExcluded-0: *.js\n"
22
- "X-Poedit-SourceCharset: UTF-8\n"
23
-
24
- #: includes/i18n.php:37
25
- msgid "Account"
26
- msgstr "Konto"
27
-
28
- #: includes/i18n.php:38
29
- msgid "Add On"
30
- msgstr "Tilføjelse"
31
-
32
- #: includes/i18n.php:39
33
- msgid "Contact Us"
34
- msgstr "Kontakt os"
35
-
36
- #: includes/i18n.php:40
37
- msgid "Contact Support"
38
- msgstr "Kontakt support"
39
-
40
- #: includes/i18n.php:41
41
- msgid "Change Ownership"
42
- msgstr "Skift ejerskab"
43
-
44
- #: includes/i18n.php:42
45
- msgid "Support"
46
- msgstr "Support"
47
-
48
- #: includes/i18n.php:43
49
- msgid "Support Forum"
50
- msgstr "Supportforum"
51
-
52
- #: includes/i18n.php:44
53
- msgid "Add Ons"
54
- msgstr "Tilføjelser"
55
-
56
- #: includes/i18n.php:45
57
- msgctxt "verb"
58
- msgid "Upgrade"
59
- msgstr "Opgrader"
60
-
61
- #: includes/i18n.php:46
62
- msgid "Awesome"
63
- msgstr "Sejt"
64
-
65
- #: includes/i18n.php:47
66
- msgctxt "noun"
67
- msgid "Pricing"
68
- msgstr "Priser"
69
-
70
- #: includes/i18n.php:48
71
- msgctxt "noun"
72
- msgid "Price"
73
- msgstr "Pris"
74
-
75
- #: includes/i18n.php:49
76
- msgid "Unlimited Updates"
77
- msgstr "Ubegrænsede opdateringer"
78
-
79
- #: includes/i18n.php:50
80
- msgctxt "verb"
81
- msgid "Downgrade"
82
- msgstr "Nedgrader"
83
-
84
- #: includes/i18n.php:51
85
- msgctxt "verb"
86
- msgid "Cancel Subscription"
87
- msgstr "Cancel Subscription"
88
-
89
- #: includes/i18n.php:52
90
- msgid "Cancel Trial"
91
- msgstr "Annuller prøveperiode"
92
-
93
- #: includes/i18n.php:53
94
- msgid "Free Trial"
95
- msgstr "Gratis prøveperiode"
96
-
97
- #: includes/i18n.php:54
98
- msgid "Start my free %s"
99
- msgstr "Start min gratis %s"
100
-
101
- #: includes/i18n.php:55
102
- msgid "No commitment for %s - cancel anytime"
103
- msgstr "Ingen bindinger ved %s - annuller når som helst"
104
-
105
- #: includes/i18n.php:56
106
- msgid "After your free %s, pay as little as %s"
107
- msgstr "Efter din gratis %s er prisen kun %s"
108
-
109
- #: includes/i18n.php:57
110
- msgid "Details"
111
- msgstr "Detaljer"
112
-
113
- #: includes/i18n.php:58
114
- msgid "Account Details"
115
- msgstr "Kontodetaljer"
116
-
117
- #: includes/i18n.php:59
118
- msgctxt "verb"
119
- msgid "Delete"
120
- msgstr "Slet"
121
-
122
- #: includes/i18n.php:60
123
- msgctxt "verb"
124
- msgid "Show"
125
- msgstr "Vis"
126
-
127
- #: includes/i18n.php:61
128
- msgctxt "verb"
129
- msgid "Hide"
130
- msgstr "Skjul"
131
-
132
- #: includes/i18n.php:62
133
- msgctxt "verb"
134
- msgid "Edit"
135
- msgstr "Rediger"
136
-
137
- #: includes/i18n.php:63
138
- msgctxt "verb"
139
- msgid "Update"
140
- msgstr "Opdater"
141
-
142
- #: includes/i18n.php:64
143
- msgid "Date"
144
- msgstr "Dato"
145
-
146
- #: includes/i18n.php:65
147
- msgid "Amount"
148
- msgstr "Beløb"
149
-
150
- #: includes/i18n.php:66
151
- msgid "Invoice"
152
- msgstr "Faktura"
153
-
154
- #: includes/i18n.php:67
155
- msgid "Billing"
156
- msgstr "Betaling"
157
-
158
- #: includes/i18n.php:68
159
- msgid "Payments"
160
- msgstr "Betalinger"
161
-
162
- #: includes/i18n.php:69
163
- msgid "Delete Account"
164
- msgstr "Slet konto"
165
-
166
- #: includes/i18n.php:70
167
- msgctxt "as close a window"
168
- msgid "Dismiss"
169
- msgstr "Fjern"
170
-
171
- #: includes/i18n.php:71
172
- msgctxt "as product pricing plan"
173
- msgid "Plan"
174
- msgstr "Plan"
175
-
176
- #: includes/i18n.php:72
177
- msgid "Change Plan"
178
- msgstr "Skift plan"
179
-
180
- #: includes/i18n.php:73
181
- msgctxt "as download professional version"
182
- msgid "Download %s Version"
183
- msgstr "Download %s Version"
184
-
185
- #: includes/i18n.php:74
186
- msgctxt "as download professional version now"
187
- msgid "Download %s version now"
188
- msgstr "Download %s version now"
189
-
190
- #: includes/i18n.php:75
191
- msgctxt "as download latest version"
192
- msgid "Download Latest"
193
- msgstr "Download seneste"
194
-
195
- #: includes/i18n.php:76
196
- msgctxt "E.g. you have a professional license."
197
- msgid "You have a %s license."
198
- msgstr "Du har en %s licens."
199
-
200
- #: includes/i18n.php:77
201
- msgid "New"
202
- msgstr "Ny"
203
-
204
- #: includes/i18n.php:78
205
- msgid "Free"
206
- msgstr "Gratis"
207
-
208
- #: includes/i18n.php:79
209
- msgctxt "as trial plan"
210
- msgid "Trial"
211
- msgstr "Prøveperiode"
212
-
213
- #: includes/i18n.php:80
214
- msgctxt "as starting a trial plan"
215
- msgid "Start Trial"
216
- msgstr "Start prøveperiode"
217
-
218
- #: includes/i18n.php:81
219
- msgctxt "verb"
220
- msgid "Purchase"
221
- msgstr "Køb"
222
-
223
- #: includes/i18n.php:82
224
- msgid "Purchase License"
225
- msgstr "Køb licens"
226
-
227
- #: includes/i18n.php:83
228
- msgctxt "verb"
229
- msgid "Buy"
230
- msgstr "Køb"
231
-
232
- #: includes/i18n.php:84
233
- msgid "Buy License"
234
- msgstr "Køb licens"
235
-
236
- #: includes/i18n.php:85
237
- msgid "Single Site License"
238
- msgstr "Single Site License"
239
-
240
- #: includes/i18n.php:86
241
- msgid "Unlimited Licenses"
242
- msgstr "Ubegrænsede licenser"
243
-
244
- #: includes/i18n.php:87
245
- msgid "Up to %s Sites"
246
- msgstr "Op til %s websteder"
247
-
248
- #: includes/i18n.php:88
249
- msgid "%sRenew your license now%s to access version %s features and support."
250
- msgstr "%sRenew your license now%s to access version %s features and support."
251
-
252
- #: includes/i18n.php:89
253
- msgid "Enter the email address you've used for the upgrade below and we will resend you the license key."
254
- msgstr "Enter the email address you've used for the upgrade below and we will resend you the license key."
255
-
256
- #: includes/i18n.php:90
257
- msgctxt "e.g. Professional Plan"
258
- msgid "%s Plan"
259
- msgstr "%s Plan"
260
-
261
- #: includes/i18n.php:91
262
- msgid "You are just one step away - %s"
263
- msgstr "Du mangler kun ét skridt - %s"
264
-
265
- #: includes/i18n.php:92
266
- msgctxt "%s - plugin name. As complete \"Jetpack\" activation now"
267
- msgid "Complete \"%s\" Activation Now"
268
- msgstr "Færdiggør aktivering af \"%s\" nu"
269
-
270
- #: includes/i18n.php:94
271
- msgid "We made a few tweaks to the plugin, %s"
272
- msgstr "Vi har lavet nogle få rettelser til pluginnet, %s"
273
-
274
- #: includes/i18n.php:95
275
- msgid "Opt-in to make \"%s\" Better!"
276
- msgstr "Tilmeld for at gøre \"%s\" bedre!"
277
-
278
- #: includes/i18n.php:96
279
- msgid "Error"
280
- msgstr "Fejl"
281
-
282
- #: includes/i18n.php:97
283
- msgid "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
284
- msgstr "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
285
-
286
- #: includes/i18n.php:100
287
- msgctxt "as expiration date"
288
- msgid "Expiration"
289
- msgstr "Expiration"
290
-
291
- #: includes/i18n.php:101
292
- msgctxt "as software license"
293
- msgid "License"
294
- msgstr "Licens"
295
-
296
- #: includes/i18n.php:102
297
- msgid "not verified"
298
- msgstr "ikke verificeret"
299
-
300
- #: includes/i18n.php:103
301
- msgid "Verify Email"
302
- msgstr "Verificer e-mail"
303
-
304
- #: includes/i18n.php:104
305
- msgctxt "e.g. expires in 2 months"
306
- msgid "Expires in %s"
307
- msgstr "Udløber om %s"
308
-
309
- #: includes/i18n.php:105
310
- msgctxt "e.g. auto renews in 2 months"
311
- msgid "Auto renews in %s"
312
- msgstr "Auto-fornyer om %s"
313
-
314
- #: includes/i18n.php:106
315
- msgid "No expiration"
316
- msgstr "Udløber ikke"
317
-
318
- #: includes/i18n.php:107
319
- msgid "Expired"
320
- msgstr "Udløbet"
321
-
322
- #: includes/i18n.php:108
323
- msgid "Cancelled"
324
- msgstr "Annulleret"
325
-
326
- #: includes/i18n.php:109
327
- msgctxt "e.g. In 2 hours"
328
- msgid "In %s"
329
- msgstr "Om %s"
330
-
331
- #: includes/i18n.php:110
332
- msgctxt "e.g. 2 min ago"
333
- msgid "%s ago"
334
- msgstr "%s siden"
335
-
336
- #: includes/i18n.php:112
337
- msgid "%s or higher"
338
- msgstr "%s eller højere"
339
-
340
- #: includes/i18n.php:113
341
- msgctxt "as plugin version"
342
- msgid "Version"
343
- msgstr "Version"
344
-
345
- #: includes/i18n.php:114
346
- msgid "Name"
347
- msgstr "Navn"
348
-
349
- #: includes/i18n.php:115
350
- msgid "Email"
351
- msgstr "E-mail"
352
-
353
- #: includes/i18n.php:116
354
- msgid "Email address"
355
- msgstr "E-mailadresse"
356
-
357
- #: includes/i18n.php:117
358
- msgid "Verified"
359
- msgstr "Verificeret"
360
-
361
- #: includes/i18n.php:118
362
- msgid "Module"
363
- msgstr "Modul"
364
-
365
- #: includes/i18n.php:119
366
- msgid "Module Type"
367
- msgstr "Modultype"
368
-
369
- #: includes/i18n.php:120
370
- msgid "Plugin"
371
- msgstr "Plugin"
372
-
373
- #: includes/i18n.php:121
374
- msgid "Plugins"
375
- msgstr "Plugins"
376
-
377
- #: includes/i18n.php:122
378
- msgid "Theme"
379
- msgstr "Tema"
380
-
381
- #: includes/i18n.php:123
382
- msgid "Themes"
383
- msgstr "Temaer"
384
-
385
- #: includes/i18n.php:124
386
- msgctxt "as file/folder path"
387
- msgid "Path"
388
- msgstr "Sti"
389
-
390
- #: includes/i18n.php:125
391
- msgid "Title"
392
- msgstr "Titel"
393
-
394
- #: includes/i18n.php:126
395
- msgid "Free version"
396
- msgstr "Gratis version"
397
-
398
- #: includes/i18n.php:127
399
- msgid "Premium version"
400
- msgstr "Premium version"
401
-
402
- #: includes/i18n.php:128
403
- msgctxt "as WP plugin slug"
404
- msgid "Slug"
405
- msgstr "Kortnavn"
406
-
407
- #: includes/i18n.php:129
408
- msgid "ID"
409
- msgstr "ID"
410
-
411
- #: includes/i18n.php:130
412
- msgid "Users"
413
- msgstr "Brugere"
414
-
415
- #: includes/i18n.php:131
416
- msgid "Plugin Installs"
417
- msgstr "Plugin-installationer"
418
-
419
- #: includes/i18n.php:132
420
- msgid "%s Installs"
421
- msgstr "%s installeringer"
422
-
423
- #: includes/i18n.php:133
424
- msgctxt "like websites"
425
- msgid "Sites"
426
- msgstr "Websteder"
427
-
428
- #: includes/i18n.php:134
429
- msgid "User ID"
430
- msgstr "Bruger-ID"
431
-
432
- #: includes/i18n.php:135
433
- msgid "Site ID"
434
- msgstr "Websteds-ID"
435
-
436
- #: includes/i18n.php:136
437
- msgid "Public Key"
438
- msgstr "Offentlig nøgle"
439
-
440
- #: includes/i18n.php:137
441
- msgid "Secret Key"
442
- msgstr "Privat nøgle"
443
-
444
- #: includes/i18n.php:138
445
- msgctxt "as secret encryption key missing"
446
- msgid "No Secret"
447
- msgstr "Ingen privat nøgle"
448
-
449
- #: includes/i18n.php:139
450
- msgid "No ID"
451
- msgstr "Intet ID"
452
-
453
- #: includes/i18n.php:140
454
- msgctxt "as synchronize license"
455
- msgid "Sync License"
456
- msgstr "Synkroniser licens"
457
-
458
- #: includes/i18n.php:141
459
- msgctxt "as synchronize"
460
- msgid "Sync"
461
- msgstr "Synkroniser"
462
-
463
- #: includes/i18n.php:142
464
- msgid "Activate License"
465
- msgstr "Aktiver licens"
466
-
467
- #: includes/i18n.php:143
468
- msgid "Activate Free Version"
469
- msgstr "Aktiver gratis version"
470
-
471
- #: includes/i18n.php:144
472
- msgid "Please enter the license key that you received in the email right after the purchase:"
473
- msgstr "Please enter the license key that you received in the email right after the purchase:"
474
-
475
- #: includes/i18n.php:145
476
- msgid "Activating license..."
477
- msgstr "Aktiverer licens..."
478
-
479
- #: includes/i18n.php:146
480
- msgid "Change License"
481
- msgstr "Skift licens"
482
-
483
- #: includes/i18n.php:147
484
- msgid "Update License"
485
- msgstr "Opdater licens"
486
-
487
- #: includes/i18n.php:148
488
- msgid "Deactivate License"
489
- msgstr "Deaktiver licens"
490
-
491
- #: includes/i18n.php:149
492
- msgid "Activate"
493
- msgstr "Aktiver"
494
-
495
- #: includes/i18n.php:150
496
- msgid "Deactivate"
497
- msgstr "Deaktiver"
498
-
499
- #: includes/i18n.php:151
500
- msgid "Skip & Deactivate"
501
- msgstr "Spring over & deaktiver"
502
-
503
- #: includes/i18n.php:152
504
- msgid "Skip & %s"
505
- msgstr "Spring over & %s"
506
-
507
- #: includes/i18n.php:153
508
- msgid "No - just deactivate"
509
- msgstr "Nej - bare deaktiver"
510
-
511
- #: includes/i18n.php:154
512
- msgid "Yes - do your thing"
513
- msgstr "Yes - do your thing"
514
-
515
- #: includes/i18n.php:155
516
- msgctxt "active mode"
517
- msgid "Active"
518
- msgstr "Aktiv"
519
-
520
- #: includes/i18n.php:156
521
- msgctxt "is active mode?"
522
- msgid "Is Active"
523
- msgstr "Er aktiv"
524
-
525
- #: includes/i18n.php:157
526
- msgid "Install Now"
527
- msgstr "Installer nu"
528
-
529
- #: includes/i18n.php:158
530
- msgid "Install Update Now"
531
- msgstr "Installer opdatering nu"
532
-
533
- #: includes/i18n.php:159
534
- msgid "More information about %s"
535
- msgstr "Mere information om %s"
536
-
537
- #: includes/i18n.php:160
538
- msgid "Localhost"
539
- msgstr "Localhost"
540
-
541
- #: includes/i18n.php:161
542
- msgctxt "as activate Professional plan"
543
- msgid "Activate %s Plan"
544
- msgstr "Aktiver plan %s"
545
-
546
- #: includes/i18n.php:162
547
- msgctxt "as 5 licenses left"
548
- msgid "%s left"
549
- msgstr "%s tilbage"
550
-
551
- #: includes/i18n.php:163
552
- msgid "Last license"
553
- msgstr "Seneste license"
554
-
555
- #: includes/i18n.php:164
556
- msgid "What is your %s?"
557
- msgstr "What is your %s?"
558
-
559
- #: includes/i18n.php:165
560
- msgid "Activate this add-on"
561
- msgstr "Aktiver denne tilføjelse"
562
-
563
- #: includes/i18n.php:166
564
- msgid "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?"
565
- msgstr "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?"
566
-
567
- #: includes/i18n.php:167
568
- msgid "Deleting the account will automatically deactivate your %s plan license so you can use it on other sites. If you want to terminate the recurring payments as well, click the \"Cancel\" button, and first \"Downgrade\" your account. Are you sure you would like to continue with the deletion?"
569
- msgstr "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?"
570
-
571
- #: includes/i18n.php:168
572
- msgid "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?"
573
- msgstr "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?"
574
-
575
- #: includes/i18n.php:169
576
- msgid "Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s."
577
- msgstr "Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s."
578
-
579
- #: includes/i18n.php:170
580
- msgid "Cancelling the trial will immediately block access to all premium features. Are you sure?"
581
- msgstr "Cancelling the trial will immediately block access to all premium features. Are you sure?"
582
-
583
- #: includes/i18n.php:171
584
- msgid "You can still enjoy all %s features but you will not have access to plugin updates and support."
585
- msgstr "You can still enjoy all %s features but you will not have access to plugin updates and support."
586
-
587
- #: includes/i18n.php:172
588
- msgid "Once your license expires you can still use the Free version but you will NOT have access to the %s features."
589
- msgstr "Once your license expires you can still use the Free version but you will NOT have access to the %s features."
590
-
591
- #: includes/i18n.php:173
592
- msgid "Are you sure you want to proceed?"
593
- msgstr "Er du sikker på, du vil fortsætte?"
594
-
595
- #: includes/i18n.php:176
596
- msgid "Add Ons for %s"
597
- msgstr "Tilføjelser til %s"
598
-
599
- #: includes/i18n.php:177
600
- msgid "We could'nt load the add-ons list. It's probably an issue on our side, please try to come back in few minutes."
601
- msgstr "We could'nt load the add-ons list. It's probably an issue on our side, please try to come back in few minutes."
602
-
603
- #: includes/i18n.php:179
604
- msgid "Anonymous feedback"
605
- msgstr "Anonym feedback"
606
-
607
- #: includes/i18n.php:180
608
- msgid "Quick feedback"
609
- msgstr "Hurtig feedback"
610
-
611
- #: includes/i18n.php:181
612
- msgid "If you have a moment, please let us know why you are deactivating"
613
- msgstr "Hvis du har et øjeblik, så lad os venligst vide, hvorfor du deaktiverer"
614
-
615
- #: includes/i18n.php:182
616
- msgid "Yes - Deactivate"
617
- msgstr "Ja - deaktiver"
618
-
619
- #: includes/i18n.php:183
620
- msgid "Submit & Deactivate"
621
- msgstr "Send & deaktiver"
622
-
623
- #: includes/i18n.php:184
624
- msgid "Cancel"
625
- msgstr "Annuller"
626
-
627
- #: includes/i18n.php:185
628
- msgid "I no longer need the plugin"
629
- msgstr "Jeg har ikke længere brug for dette plugin"
630
-
631
- #: includes/i18n.php:186
632
- msgid "I found a better plugin"
633
- msgstr "Jeg har fundet et bedre plugin"
634
-
635
- #: includes/i18n.php:187
636
- msgid "I only needed the plugin for a short period"
637
- msgstr "Jeg skulle kun bruge pluginnet i en kort periode"
638
-
639
- #: includes/i18n.php:188
640
- msgid "The plugin broke my site"
641
- msgstr "Pluginnet ødelagde mit websted"
642
-
643
- #: includes/i18n.php:189
644
- msgid "The plugin suddenly stopped working"
645
- msgstr "Pluginnet virker ikke længere"
646
-
647
- #: includes/i18n.php:190
648
- msgid "I can't pay for it anymore"
649
- msgstr "Jeg kan ikke længere betale for det"
650
-
651
- #: includes/i18n.php:191
652
- msgid "It's a temporary deactivation. I'm just debugging an issue."
653
- msgstr "Det er en midlertidig deaktivering. Jeg prøver at fejlfinde et problem."
654
-
655
- #: includes/i18n.php:192
656
- msgctxt ""
657
- msgid "Other"
658
- msgstr "Andet"
659
-
660
- #: includes/i18n.php:194
661
- msgid "Kindly tell us the reason so we can improve."
662
- msgstr "Fortæl os venligst årsagen, så vi kan forbedre det."
663
-
664
- #: includes/i18n.php:195
665
- msgid "What's the plugin's name?"
666
- msgstr "Hvad er pluginnets navn?"
667
-
668
- #: includes/i18n.php:196
669
- msgid "What price would you feel comfortable paying?"
670
- msgstr "What price would you feel comfortable paying?"
671
-
672
- #: includes/i18n.php:197
673
- msgid "I couldn't understand how to make it work"
674
- msgstr "Jeg forstod ikke, hvordan jeg skulle få det til at fungere."
675
-
676
- #: includes/i18n.php:198
677
- msgid "The plugin is great, but I need specific feature that you don't support"
678
- msgstr "Pluginnet er godt, men jeg har brug for en specifik funktionalitet, som det ikke understøtter."
679
-
680
- #: includes/i18n.php:199
681
- msgid "The plugin is not working"
682
- msgstr "Pluginnet virker ikke"
683
-
684
- #: includes/i18n.php:200
685
- msgid "It's not what I was looking for"
686
- msgstr "Det er ikke, hvad jeg søgte"
687
-
688
- #: includes/i18n.php:201
689
- msgid "The plugin didn't work as expected"
690
- msgstr "Plugin virkede ikke som forventet"
691
-
692
- #: includes/i18n.php:202
693
- msgid "What feature?"
694
- msgstr "Hvilken feature?"
695
-
696
- #: includes/i18n.php:203
697
- msgid "Kindly share what didn't work so we can fix it for future users..."
698
- msgstr "Kindly share what didn't work so we can fix it for future users..."
699
-
700
- #: includes/i18n.php:204
701
- msgid "What you've been looking for?"
702
- msgstr "What you've been looking for?"
703
-
704
- #: includes/i18n.php:205
705
- msgid "What did you expect?"
706
- msgstr "Hvad forventede du?"
707
-
708
- #: includes/i18n.php:206
709
- msgid "The plugin didn't work"
710
- msgstr "Pluginnet virkede ikke"
711
-
712
- #: includes/i18n.php:207
713
- msgid "I don't like to share my information with you"
714
- msgstr "I don't like to share my information with you"
715
-
716
- #: includes/i18n.php:208
717
- msgid "You might have missed it, but you don't have to share any data and can just %s the opt-in."
718
- msgstr "You might have missed it, but you don't have to share any data and can just %s the opt-in."
719
-
720
- #: includes/i18n.php:212
721
- msgctxt "greeting"
722
- msgid "Hey %s,"
723
- msgstr "Hey %s,"
724
-
725
- #: includes/i18n.php:213
726
- msgctxt "a greeting. E.g. Thanks John!"
727
- msgid "Thanks %s!"
728
- msgstr "Tak %s!"
729
-
730
- #: includes/i18n.php:214
731
- msgid "Never miss an important update - opt-in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s."
732
- msgstr "Never miss an important update - opt-in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s."
733
-
734
- #: includes/i18n.php:215
735
- msgid "Please help us improve %1$s! If you opt-in, some data about your usage of %1$s will be sent to %4$s. If you skip this, that's okay! %1$s will still work just fine."
736
- msgstr "Please help us improve %1$s! If you opt-in, some data about your usage of %1$s will be sent to %4$s. If you skip this, that's okay! %1$s will still work just fine."
737
-
738
- #: includes/i18n.php:216
739
- msgid "You should receive an activation email for %s to your mailbox at %s. Please make sure you click the activation button in that email to %s."
740
- msgstr "You should receive an activation email for %s to your mailbox at %s. Please make sure you click the activation button in that email to %s."
741
-
742
- #: includes/i18n.php:217
743
- msgid "complete the install"
744
- msgstr "færdiggør installeringen"
745
-
746
- #: includes/i18n.php:218
747
- msgid "start the trial"
748
- msgstr "start prøveperioden"
749
-
750
- #: includes/i18n.php:219
751
- msgid "Thanks for purchasing %s! To get started, please enter your license key:"
752
- msgstr "Thanks for purchasing %s! To get started, please enter your license key:"
753
-
754
- #: includes/i18n.php:220
755
- msgid "The plugin will be periodically sending data to %s to check for plugin updates and verify the validity of your license."
756
- msgstr "The plugin will be periodically sending data to %s to check for plugin updates and verify the validity of your license."
757
-
758
- #: includes/i18n.php:221
759
- msgid "What permissions are being granted?"
760
- msgstr "Hvilke tilladelser bliver givet?"
761
-
762
- #: includes/i18n.php:222
763
- msgid "Your Profile Overview"
764
- msgstr "Overblik af din profil"
765
-
766
- #: includes/i18n.php:223
767
- msgid "Name and email address"
768
- msgstr "Navn og e-mailadresse"
769
-
770
- #: includes/i18n.php:224
771
- msgid "Your Site Overview"
772
- msgstr "Overblik af dit websted"
773
-
774
- #: includes/i18n.php:225
775
- msgid "Site URL, WP version, PHP info, plugins & themes"
776
- msgstr "Websteds-URL, WP version, PHP info, plugins og temaer"
777
-
778
- #: includes/i18n.php:226
779
- msgid "Current Plugin Events"
780
- msgstr "Nuværende plugin-begivenheder"
781
-
782
- #: includes/i18n.php:227
783
- msgid "Activation, deactivation and uninstall"
784
- msgstr "Aktivering, deaktivering og afinstallering"
785
-
786
- #: includes/i18n.php:228
787
- msgid "Plugins & Themes"
788
- msgstr "Plugins & Temaer"
789
-
790
- #: includes/i18n.php:229
791
- msgid "Titles, versions and state."
792
- msgstr "Titler, versioner og tilstand."
793
-
794
- #: includes/i18n.php:230
795
- msgid "Admin Notices"
796
- msgstr "Admin Notices"
797
-
798
- #: includes/i18n.php:231
799
- msgid "Newsletter"
800
- msgstr "Nyhedsbrev"
801
-
802
- #: includes/i18n.php:232
803
- msgid "Updates, announcements, marketing, no spam"
804
- msgstr "Updates, announcements, marketing, no spam"
805
-
806
- #: includes/i18n.php:233
807
- msgid "Privacy Policy"
808
- msgstr "Privatlivspolitik"
809
-
810
- #: includes/i18n.php:234
811
- msgid "Terms of Service"
812
- msgstr "Servicevilkår"
813
-
814
- #: includes/i18n.php:235
815
- msgctxt "as activating plugin"
816
- msgid "Activating"
817
- msgstr "Aktiverer"
818
-
819
- #: includes/i18n.php:236
820
- msgctxt "as in the process of sending an email"
821
- msgid "Sending email"
822
- msgstr "Sender e-mail"
823
-
824
- #: includes/i18n.php:237
825
- msgctxt "button label"
826
- msgid "Allow & Continue"
827
- msgstr "Tillad & Fortsæt"
828
-
829
- #: includes/i18n.php:238
830
- msgctxt "button label"
831
- msgid "Agree & Activate License"
832
- msgstr "Accepter & aktiver licens"
833
-
834
- #: includes/i18n.php:239
835
- msgctxt "verb"
836
- msgid "Skip"
837
- msgstr "Spring over"
838
-
839
- #: includes/i18n.php:240
840
- msgid "Click here to use the plugin anonymously"
841
- msgstr "Klik her for at benytte pluginnet anonymt"
842
-
843
- #: includes/i18n.php:241
844
- msgid "Re-send activation email"
845
- msgstr "Gensend e-mail om aktivering"
846
-
847
- #: includes/i18n.php:242
848
- msgid "License key"
849
- msgstr "Licensnøgle"
850
-
851
- #: includes/i18n.php:243
852
- msgid "Send License Key"
853
- msgstr "Send licensnøgle"
854
-
855
- #: includes/i18n.php:244
856
- msgid "Sending license key"
857
- msgstr "Sender licensnøgle"
858
-
859
- #: includes/i18n.php:245
860
- msgid "Have a license key?"
861
- msgstr "Har du en licensnøgle?"
862
-
863
- #: includes/i18n.php:246
864
- msgid "Don't have a license key?"
865
- msgstr "Har du ikke en licensnøgle?"
866
-
867
- #: includes/i18n.php:247
868
- msgid "Can't find your license key?"
869
- msgstr "Kan du ikke finde din licensnøgle?"
870
-
871
- #: includes/i18n.php:248
872
- msgid "We couldn't find your email address in the system, are you sure it's the right address?"
873
- msgstr "We couldn't find your email address in the system, are you sure it's the right address?"
874
-
875
- #: includes/i18n.php:249
876
- msgid "We can't see any active licenses associated with that email address, are you sure it's the right address?"
877
- msgstr "We can't see any active licenses associated with that email address, are you sure it's the right address?"
878
-
879
- #: includes/i18n.php:250
880
- msgid "Opt In"
881
- msgstr "Tilmeld"
882
-
883
- #: includes/i18n.php:251
884
- msgid "Opt Out"
885
- msgstr "Frameld"
886
-
887
- #: includes/i18n.php:252
888
- msgid "On second thought - I want to continue helping"
889
- msgstr "Ved nærmere eftertanke - Jeg vil fortsætte med at hjælpe"
890
-
891
- #: includes/i18n.php:253
892
- msgid "Opting out..."
893
- msgstr "Framelder..."
894
-
895
- #: includes/i18n.php:254
896
- msgid "Opting in..."
897
- msgstr "Tilmelder..."
898
-
899
- #: includes/i18n.php:255
900
- msgid "We appreciate your help in making the %s better by letting us track some usage data."
901
- msgstr "We appreciate your help in making the %s better by letting us track some usage data."
902
-
903
- #: includes/i18n.php:256
904
- msgid "Usage tracking is done in the name of making %s better. Making a better user experience, prioritizing new features, and more good things. We'd really appreciate if you'll reconsider letting us continue with the tracking."
905
- msgstr "Usage tracking is done in the name of making %s better. Making a better user experience, prioritizing new features, and more good things. We'd really appreciate if you'll reconsider letting us continue with the tracking."
906
-
907
- #: includes/i18n.php:257
908
- msgid "By clicking \"Opt Out\", we will no longer be sending any data from %s to %s."
909
- msgstr "Ved at klikke \"Frameld\" vil vi ikke længere sende data fra %s til %s."
910
-
911
- #: includes/i18n.php:261
912
- msgid "Screenshots"
913
- msgstr "Skærmbilleder"
914
-
915
- #: includes/i18n.php:262
916
- msgid "Click to view full-size screenshot %d"
917
- msgstr "Click to view full-size screenshot %d"
918
-
919
- #: includes/i18n.php:266
920
- msgid "Freemius Debug"
921
- msgstr "Freemius Debug"
922
-
923
- #: includes/i18n.php:267
924
- msgctxt "as turned on"
925
- msgid "On"
926
- msgstr "Til"
927
-
928
- #: includes/i18n.php:268
929
- msgctxt "as turned off"
930
- msgid "Off"
931
- msgstr "Fra"
932
-
933
- #: includes/i18n.php:269
934
- msgctxt "as code debugging"
935
- msgid "Debugging"
936
- msgstr "Fejlfinding"
937
-
938
- #: includes/i18n.php:270
939
- msgid "Freemius State"
940
- msgstr "Freemius tilstand"
941
-
942
- #: includes/i18n.php:271
943
- msgctxt "as connection was successful"
944
- msgid "Connected"
945
- msgstr "Forbundet"
946
-
947
- #: includes/i18n.php:272
948
- msgctxt "as connection blocked"
949
- msgid "Blocked"
950
- msgstr "Blokeret"
951
-
952
- #: includes/i18n.php:273
953
- msgctxt "as application program interface"
954
- msgid "API"
955
- msgstr "API"
956
-
957
- #: includes/i18n.php:274
958
- msgctxt "as software development kit versions"
959
- msgid "SDK"
960
- msgstr "SDK"
961
-
962
- #: includes/i18n.php:275
963
- msgctxt "as software development kit versions"
964
- msgid "SDK Versions"
965
- msgstr "SDK-versioner"
966
-
967
- #: includes/i18n.php:276
968
- msgctxt "as plugin folder path"
969
- msgid "Plugin Path"
970
- msgstr "Plugin-sti"
971
-
972
- #: includes/i18n.php:277
973
- msgctxt "as sdk path"
974
- msgid "SDK Path"
975
- msgstr "SDK-sti"
976
-
977
- #: includes/i18n.php:278
978
- msgid "Add Ons of Plugin %s"
979
- msgstr "Tilføjelser til plugin %s"
980
-
981
- #: includes/i18n.php:279
982
- msgid "Are you sure you want to delete all Freemius data?"
983
- msgstr "Er du sikker på, du vil slette al Freemius data?"
984
-
985
- #: includes/i18n.php:280
986
- msgid "Actions"
987
- msgstr "Handlinger"
988
-
989
- #: includes/i18n.php:281
990
- msgid "Delete All Accounts"
991
- msgstr "Slet alle konti"
992
-
993
- #: includes/i18n.php:282
994
- msgid "Start Fresh"
995
- msgstr "Start forfra"
996
-
997
- #: includes/i18n.php:283
998
- msgid "Clear API Cache"
999
- msgstr "Ryd API-cache"
1000
-
1001
- #: includes/i18n.php:284
1002
- msgid "Sync Data From Server"
1003
- msgstr "Synkroniser data fra server"
1004
-
1005
- #: includes/i18n.php:285
1006
- msgid "Scheduled Crons"
1007
- msgstr "Planlagte cron jobs"
1008
-
1009
- #: includes/i18n.php:286
1010
- msgid "Cron Type"
1011
- msgstr "Cron Type"
1012
-
1013
- #: includes/i18n.php:287
1014
- msgid "Plugins & Themes Sync"
1015
- msgstr "Synkronisering af plugins og temaer"
1016
-
1017
- #: includes/i18n.php:288
1018
- msgid "Licenses"
1019
- msgstr "Licenser"
1020
-
1021
- #: includes/i18n.php:289
1022
- msgid "Debug Log"
1023
- msgstr "Fejlfindingslog"
1024
-
1025
- #: includes/i18n.php:290
1026
- msgid "All"
1027
- msgstr "Alle"
1028
-
1029
- #: includes/i18n.php:291
1030
- msgid "File"
1031
- msgstr "Fil"
1032
-
1033
- #: includes/i18n.php:292
1034
- msgid "Function"
1035
- msgstr "Funktion"
1036
-
1037
- #: includes/i18n.php:293
1038
- msgid "Process ID"
1039
- msgstr "Proces-ID"
1040
-
1041
- #: includes/i18n.php:294
1042
- msgid "Logger"
1043
- msgstr "Logger"
1044
-
1045
- #: includes/i18n.php:295
1046
- msgid "Message"
1047
- msgstr "Besked"
1048
-
1049
- #: includes/i18n.php:296
1050
- msgid "Download"
1051
- msgstr "Download"
1052
-
1053
- #: includes/i18n.php:297
1054
- msgid "Filter"
1055
- msgstr "Filter"
1056
-
1057
- #: includes/i18n.php:298
1058
- msgid "Type"
1059
- msgstr "Type"
1060
-
1061
- #: includes/i18n.php:299
1062
- msgid "All Types"
1063
- msgstr "Alle typer"
1064
-
1065
- #: includes/i18n.php:300
1066
- msgid "All Requests"
1067
- msgstr "Alle forespørgsler"
1068
-
1069
- #: includes/i18n.php:304
1070
- msgctxt "as congratulations"
1071
- msgid "Congrats"
1072
- msgstr "Tillykke"
1073
-
1074
- #: includes/i18n.php:305
1075
- msgctxt "exclamation"
1076
- msgid "Oops"
1077
- msgstr "Ups"
1078
-
1079
- #: includes/i18n.php:306
1080
- msgctxt "interjection expressing joy or exuberance"
1081
- msgid "Yee-haw"
1082
- msgstr "Yee-haw"
1083
-
1084
- #: includes/i18n.php:307
1085
- msgctxt ""
1086
- msgid "W00t"
1087
- msgstr "W00t"
1088
-
1089
- #: includes/i18n.php:309
1090
- msgctxt "a positive response"
1091
- msgid "Right on"
1092
- msgstr "Sådan"
1093
-
1094
- #: includes/i18n.php:310
1095
- msgctxt ""
1096
- msgid "Hmm"
1097
- msgstr "Hmm"
1098
-
1099
- #: includes/i18n.php:312
1100
- msgid "O.K"
1101
- msgstr "O.K"
1102
-
1103
- #: includes/i18n.php:313
1104
- msgctxt "exclamation"
1105
- msgid "Hey"
1106
- msgstr "Hey"
1107
-
1108
- #: includes/i18n.php:314
1109
- msgctxt "advance notice of something that will need attention."
1110
- msgid "Heads up"
1111
- msgstr "Se her"
1112
-
1113
- #: includes/i18n.php:319
1114
- msgid "Seems like you got the latest release."
1115
- msgstr "Det ser ud til, at du har den seneste udgivelse."
1116
-
1117
- #: includes/i18n.php:320
1118
- msgid "You are all good!"
1119
- msgstr "Det var det!"
1120
-
1121
- #: includes/i18n.php:321
1122
- msgid "Sorry, we could not complete the email update. Another user with the same email is already registered."
1123
- msgstr "Sorry, we could not complete the email update. Another user with the same email is already registered."
1124
-
1125
- #: includes/i18n.php:322
1126
- msgid "If you would like to give up the ownership of the plugin's account to %s click the Change Ownership button."
1127
- msgstr "If you would like to give up the ownership of the plugin's account to %s click the Change Ownership button."
1128
-
1129
- #: includes/i18n.php:323
1130
- msgid "Your email was successfully updated. You should receive an email with confirmation instructions in few moments."
1131
- msgstr "Your email was successfully updated. You should receive an email with confirmation instructions in few moments."
1132
-
1133
- #: includes/i18n.php:324
1134
- msgid "Your name was successfully updated."
1135
- msgstr "Dit navn er blevet opdateret."
1136
-
1137
- #: includes/i18n.php:325
1138
- msgid "You have successfully updated your %s."
1139
- msgstr "Opdatering af %s blev gennemført."
1140
-
1141
- #: includes/i18n.php:326
1142
- msgid "Please provide your full name."
1143
- msgstr "Indtast venligst dit fulde navn."
1144
-
1145
- #: includes/i18n.php:327
1146
- msgid "Verification mail was just sent to %s. If you can't find it after 5 min, please check your spam box."
1147
- msgstr "Verification mail was just sent to %s. If you can't find it after 5 min, please check your spam box."
1148
-
1149
- #: includes/i18n.php:328
1150
- msgid "Just letting you know that the add-ons information of %s is being pulled from an external server."
1151
- msgstr "Just letting you know that the add-ons information of %s is being pulled from an external server."
1152
-
1153
- #: includes/i18n.php:329
1154
- msgid "No credit card required"
1155
- msgstr "Betalingskort ikke påkrævet"
1156
-
1157
- #: includes/i18n.php:330
1158
- msgid "Premium plugin version was successfully activated."
1159
- msgstr "Premium-versionen af pluginnet blev aktiveret."
1160
-
1161
- #: includes/i18n.php:331
1162
- msgid "The upgrade of %s was successfully completed."
1163
- msgstr "Opgraderingen af %s blev fuldendt."
1164
-
1165
- #: includes/i18n.php:332
1166
- msgid "Your account was successfully activated with the %s plan."
1167
- msgstr "Din konto blev aktiveret med planen %s."
1168
-
1169
- #: includes/i18n.php:333
1170
- msgid "Download the latest %s version now"
1171
- msgstr "Download den seneste version af %s nu"
1172
-
1173
- #: includes/i18n.php:334
1174
- msgid "Please follow these steps to complete the upgrade"
1175
- msgstr "Følg venligst disse trin for at færdiggøre opgraderingen"
1176
-
1177
- #: includes/i18n.php:335
1178
- msgid "Download the latest %s version"
1179
- msgstr "Download den seneste version af %s"
1180
-
1181
- #: includes/i18n.php:336
1182
- msgid "Download the latest version"
1183
- msgstr "Download den seneste version"
1184
-
1185
- #: includes/i18n.php:337
1186
- msgid "Deactivate the free version"
1187
- msgstr "Deaktiver den gratis version"
1188
-
1189
- #: includes/i18n.php:338
1190
- msgid "Upload and activate the downloaded version"
1191
- msgstr "Upload og aktiver den downloadede version"
1192
-
1193
- #: includes/i18n.php:339
1194
- msgid "How to upload and activate?"
1195
- msgstr "Upload og aktivering, hvordan?"
1196
-
1197
- #: includes/i18n.php:340
1198
- msgctxt "%s - product name, e.g. Facebook add-on was successfully..."
1199
- msgid "%s Add-on was successfully purchased."
1200
- msgstr "Betalingen for tilføjelsen %s blev gennemført."
1201
-
1202
- #: includes/i18n.php:342
1203
- msgid "Your %s Add-on plan was successfully upgraded."
1204
- msgstr "Your %s Add-on plan was successfully upgraded."
1205
-
1206
- #: includes/i18n.php:343
1207
- msgid "Your email has been successfully verified - you are AWESOME!"
1208
- msgstr "Your email has been successfully verified - you are AWESOME!"
1209
-
1210
- #: includes/i18n.php:344
1211
- msgid "Your plan was successfully upgraded."
1212
- msgstr "Din plan er blevet opgraderet."
1213
-
1214
- #: includes/i18n.php:345
1215
- msgid "Your plan was successfully changed to %s."
1216
- msgstr "Din plan er blevet ændret til %s."
1217
-
1218
- #: includes/i18n.php:346
1219
- msgid "Your license has expired. You can still continue using the free plugin forever."
1220
- msgstr "Din licens er udløbet. Du kan stadig fortsætte med at benytte det gratis plugin for evigt."
1221
-
1222
- #: includes/i18n.php:347
1223
- msgid "Your license has been cancelled. If you think it's a mistake, please contact support."
1224
- msgstr "Din licens er blevet annulleret. Hvis du mener, dette er en fejl, så kontakt venligst support."
1225
-
1226
- #: includes/i18n.php:348
1227
- msgid "Your trial has been successfully started."
1228
- msgstr "Din prøveperiode er begyndt."
1229
-
1230
- #: includes/i18n.php:349
1231
- msgid "Your license was successfully activated."
1232
- msgstr "Din licens er blevet aktiveret."
1233
-
1234
- #: includes/i18n.php:350
1235
- msgid "It looks like your site currently doesn't have an active license."
1236
- msgstr "Det ser ud til, at dit websted endnu ikke har en aktiv licens."
1237
-
1238
- #: includes/i18n.php:351
1239
- msgid "Your license was successfully deactivated, you are back to the %s plan."
1240
- msgstr "Din licens blev deaktiveret, du er tilbage på planen %s."
1241
-
1242
- #: includes/i18n.php:352
1243
- msgid "It looks like the license deactivation failed."
1244
- msgstr "Det ser ud til, at licens-deaktiveringen mislykkedes."
1245
-
1246
- #: includes/i18n.php:353
1247
- msgid "It looks like the license could not be activated."
1248
- msgstr "Det ser ud til, at licensen ikke kunne aktiveres."
1249
-
1250
- #: includes/i18n.php:354
1251
- msgid "Error received from the server:"
1252
- msgstr "Fejl modtager fra serveren:"
1253
-
1254
- #: includes/i18n.php:355
1255
- msgid "Your trial has expired. You can still continue using all our free features."
1256
- msgstr "Din prøveperiode er udløbet. Du kan fortsat bruge alle vores gratis funktioner."
1257
-
1258
- #: includes/i18n.php:356
1259
- msgid "Your plan was successfully downgraded. Your %s plan license will expire in %s."
1260
- msgstr "Din plan blev nedgraderet. Licensen til din %s plan vil udløbe om %s."
1261
-
1262
- #: includes/i18n.php:357
1263
- msgid "Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes."
1264
- msgstr "Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes."
1265
-
1266
- #: includes/i18n.php:358
1267
- msgid "It looks like you are not in trial mode anymore so there's nothing to cancel :)"
1268
- msgstr "It looks like you are not in trial mode anymore so there's nothing to cancel :)"
1269
-
1270
- #: includes/i18n.php:359
1271
- msgid "Your %s free trial was successfully cancelled."
1272
- msgstr "Din gratis prøveperiode for %s er blevet annulleret."
1273
-
1274
- #: includes/i18n.php:360
1275
- msgctxt "%s - numeric version number"
1276
- msgid "Version %s was released."
1277
- msgstr "Version %s er blevet udgivet."
1278
-
1279
- #: includes/i18n.php:361
1280
- msgid "Please download %s."
1281
- msgstr "Download venligst %s."
1282
-
1283
- #: includes/i18n.php:362
1284
- msgctxt "%s - plan name, as the latest professional version here"
1285
- msgid "the latest %s version here"
1286
- msgstr "den seneste version af %s her"
1287
-
1288
- #: includes/i18n.php:364
1289
- msgid "How do you like %s so far? Test all our %s premium features with a %d-day free trial."
1290
- msgstr "How do you like %s so far? Test all our %s premium features with a %d-day free trial."
1291
-
1292
- #: includes/i18n.php:365
1293
- msgctxt "call to action"
1294
- msgid "Start free trial"
1295
- msgstr "Start gratis prøveperiode"
1296
-
1297
- #: includes/i18n.php:366
1298
- msgid "Starting trial"
1299
- msgstr "Starter prøveperiode"
1300
-
1301
- #: includes/i18n.php:367
1302
- msgid "Please wait"
1303
- msgstr "Vent venligst"
1304
-
1305
- #: includes/i18n.php:368
1306
- msgid "Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes."
1307
- msgstr "Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes."
1308
-
1309
- #: includes/i18n.php:369
1310
- msgid "You already utilized a trial before."
1311
- msgstr "Du har allerede brugt din prøveperiode."
1312
-
1313
- #: includes/i18n.php:370
1314
- msgid "You are already running the plugin in a trial mode."
1315
- msgstr "Du benytter allerede dette plugin under en prøveperiode."
1316
-
1317
- #: includes/i18n.php:371
1318
- msgid "Plan %s do not exist, therefore, can't start a trial."
1319
- msgstr "Plan %s eksisterer ikke og kan derfor ikke starte prøveperiode."
1320
-
1321
- #: includes/i18n.php:372
1322
- msgid "Plan %s does not support a trial period."
1323
- msgstr "Plan %s understøtter ikke en prøveperiode."
1324
-
1325
- #: includes/i18n.php:373
1326
- msgid "None of the plugin's plans supports a trial period."
1327
- msgstr "Ingen af dette plugins planer understøtter prøveperiode."
1328
-
1329
- #: includes/i18n.php:374
1330
- msgid "Unexpected API error. Please contact the plugin's author with the following error."
1331
- msgstr "Unexpected API error. Please contact the plugin's author with the following error."
1332
-
1333
- #: includes/i18n.php:375
1334
- msgid "No commitment for %s days - cancel anytime!"
1335
- msgstr "Ingen bindinger i %s dage - annuller når som helst!"
1336
-
1337
- #: includes/i18n.php:376
1338
- msgid "Your license has expired. You can still continue using all the %s features, but you'll need to renew your license to continue getting updates and support."
1339
- msgstr "Din licens er udløbet. Du kan stadig benytte alle funktionerne i %s, men du bliver nødt til at fornye din licens for at få opdateringer og support."
1340
-
1341
- #: includes/i18n.php:377
1342
- msgid "Couldn't activate %s."
1343
- msgstr "Kunne ikke aktivere %s."
1344
-
1345
- #: includes/i18n.php:378
1346
- msgid "Please contact us with the following message:"
1347
- msgstr "Kontakt os venligst med følgende besked:"
1348
-
1349
- #: includes/i18n.php:379
1350
- msgid "It looks like you are still on the %s plan. If you did upgrade or change your plan, it's probably an issue on our side - sorry."
1351
- msgstr "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."
1352
-
1353
- #: includes/i18n.php:380
1354
- msgid "Please contact us here"
1355
- msgstr "Kontakt os her"
1356
-
1357
- #: includes/i18n.php:381
1358
- msgid "I have upgraded my account but when I try to Sync the License, the plan remains %s."
1359
- msgstr "I have upgraded my account but when I try to Sync the License, the plan remains %s."
1360
-
1361
- #: includes/i18n.php:384
1362
- msgid "From unknown reason, the API connectivity test failed."
1363
- msgstr "From unknown reason, the API connectivity test failed."
1364
-
1365
- #: includes/i18n.php:385
1366
- msgid "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?"
1367
- msgstr "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?"
1368
-
1369
- #: includes/i18n.php:386
1370
- msgid "We use PHP cURL library for the API calls, which is a very common library and usually installed and activated out of the box. Unfortunately, cURL is not activated (or disabled) on your server."
1371
- msgstr "We use PHP cURL library for the API calls, which is a very common library and usually installed and activated out of the box. Unfortunately, cURL is not activated (or disabled) on your server."
1372
-
1373
- #: includes/i18n.php:387
1374
- msgid "Disabled method(s):"
1375
- msgstr "Disabled method(s):"
1376
-
1377
- #: includes/i18n.php:388
1378
- msgid "From unknown reason, CloudFlare, the firewall we use, blocks the connection."
1379
- msgstr "Af en ukendt årsag blokerer CloudFlare, vores firewall, forbindelsen."
1380
-
1381
- #: includes/i18n.php:389
1382
- msgctxt "as pluginX requires an access to our API"
1383
- msgid "%s requires an access to our API."
1384
- msgstr "%s påkræver adgang til vores API."
1385
-
1386
- #: includes/i18n.php:391
1387
- msgid "It looks like your server is using Squid ACL (access control lists), which blocks the connection."
1388
- msgstr "Det ser ud til, at din server benytter Squid ACL (access control lists), som blokerer forbindelsen."
1389
-
1390
- #: includes/i18n.php:392
1391
- msgid "I don't know what is Squid or ACL, help me!"
1392
- msgstr "Jeg ved ikke hvad Squid eller ACL er. Hjælp mig!"
1393
-
1394
- #: includes/i18n.php393, includes/i18n.php:397
1395
- msgid "We'll make sure to contact your hosting company and resolve the issue. You will get a follow-up email to %s once we have an update."
1396
- msgstr "Vi vil kontakte din udbyder og løse problemet. Når vi har opdatinger i sagen, vil vi følge op med en email til dig på %s."
1397
-
1398
- #: includes/i18n.php:394
1399
- msgid "I'm a system administrator"
1400
- msgstr "Jeg er en system-administrator"
1401
-
1402
- #: includes/i18n.php:395
1403
- msgid "Great, please whitelist the following domains: %s. Once you are done, deactivate the plugin and activate it again."
1404
- msgstr "Sådan, venligst whitelist følgende domæner: %s. Når du er færdig, skal du deaktivere pluginnet og aktivere det igen."
1405
-
1406
- #: includes/i18n.php:396
1407
- msgid "I don't know what is cURL or how to install it, help me!"
1408
- msgstr "Jeg ved ikke hvad cURL er, eller hvordan jeg installerer det. Hjælp mig!"
1409
-
1410
- #: includes/i18n.php:398
1411
- msgid "Great, please install cURL and enable it in your php.ini file. In addition, search for the 'disable_functions' directive in your php.ini file and remove any disabled methods starting with 'curl_'. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the plugin and reactivate it back again."
1412
- msgstr "Great, please install cURL and enable it in your php.ini file. In addition, search for the 'disable_functions' directive in your php.ini file and remove any disabled methods starting with 'curl_'. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the plugin and reactivate it back again."
1413
-
1414
- #: includes/i18n.php:399
1415
- msgid "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."
1416
- msgstr "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."
1417
-
1418
- #: includes/i18n.php:400
1419
- msgid "Sorry for the inconvenience and we are here to help if you give us a chance."
1420
- msgstr "Vi beklager ulejligheden, og vi er her for at hjælpe, hvis du giver os chancen."
1421
-
1422
- #: includes/i18n.php:401
1423
- msgid "Yes - I'm giving you a chance to fix it"
1424
- msgstr "Ja - jeg giver jer en chance for at rette det"
1425
-
1426
- #: includes/i18n.php:402
1427
- msgid "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."
1428
- msgstr "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."
1429
-
1430
- #: includes/i18n.php:403
1431
- msgid "Let's try your previous version"
1432
- msgstr "Lad os prøve din forrige version"
1433
-
1434
- #: includes/i18n.php:404
1435
- msgid "Uninstall this version and install the previous one."
1436
- msgstr "Afinstaller denne version og installer den forrige."
1437
-
1438
- #: includes/i18n.php:405
1439
- msgid "That's exhausting, please deactivate"
1440
- msgstr "Det er udmattende, deaktiver venligst"
1441
-
1442
- #: includes/i18n.php:406
1443
- msgid "We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future."
1444
- msgstr "We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future."
1445
-
1446
- #: includes/i18n.php:407
1447
- msgid "Thank for giving us the chance to fix it! A message was just sent to our technical staff. We will get back to you as soon as we have an update to %s. Appreciate your patience."
1448
- msgstr "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."
1449
-
1450
- #: includes/i18n.php:408
1451
- msgctxt "%1s - plugin title, %2s - API domain"
1452
- msgid "Your server is blocking the access to Freemius' API, which is crucial for %1s synchronization. Please contact your host to whitelist %2s"
1453
- msgstr "Your server is blocking the access to Freemius' API, which is crucial for %1s synchronization. Please contact your host to whitelist %2s"
1454
-
1455
- #: includes/i18n.php:410
1456
- msgid "It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again."
1457
- msgstr "It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again."
1458
-
1459
- #: includes/i18n.php:413
1460
- msgid "Please check your mailbox, you should receive an email via %s to confirm the ownership change. From security reasons, you must confirm the change within the next 15 min. If you cannot find the email, please check your spam folder."
1461
- msgstr "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."
1462
-
1463
- #: includes/i18n.php:414
1464
- msgid "Thanks for confirming the ownership change. An email was just sent to %s for final approval."
1465
- msgstr "Thanks for confirming the ownership change. An email was just sent to %s for final approval."
1466
-
1467
- #: includes/i18n.php:415
1468
- msgid "%s is the new owner of the account."
1469
- msgstr "%s er den nye ejer af kontoen."
1470
-
1471
- #: includes/i18n.php:417
1472
- msgctxt "addonX cannot run without pluginY"
1473
- msgid "%s cannot run without %s."
1474
- msgstr "%s virker ikke uden %s."
1475
-
1476
- #: includes/i18n.php:419
1477
- msgctxt "addonX cannot run..."
1478
- msgid "%s cannot run without the plugin."
1479
- msgstr "%s virker ikke uden pluginnet."
1480
-
1481
- #: includes/i18n.php:420
1482
- msgctxt "pluginX activation was successfully..."
1483
- msgid "%s activation was successfully completed."
1484
- msgstr "Aktivering af %s blev gennemført."
1485
-
1486
- #: includes/i18n.php:422
1487
- msgctxt "Plugin installer section title"
1488
- msgid "Features & Pricing"
1489
- msgstr "Funktioner og priser"
1490
-
1491
- #: includes/i18n.php:423
1492
- msgid "Add-on must be deployed to WordPress.org or Freemius."
1493
- msgstr "Add-on must be deployed to WordPress.org or Freemius."
1494
-
1495
- #: includes/i18n.php:424
1496
- msgid "Paid add-on must be deployed to Freemius."
1497
- msgstr "Paid add-on must be deployed to Freemius."
1498
-
1499
- #: includes/i18n.php:428
1500
- msgid "%s is a premium only add-on. You have to purchase a license first before activating the plugin."
1501
- msgstr "%s is a premium only add-on. You have to purchase a license first before activating the plugin."
1502
-
1503
- #: includes/i18n.php:429
1504
- msgid "%s free trial was successfully cancelled. Since the add-on is premium only it was automatically deactivated. If you like to use it in the future, you'll have to purchase a license."
1505
- msgstr "%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."
1506
-
1507
- #: includes/i18n.php:434
1508
- msgctxt "as every month"
1509
- msgid "Monthly"
1510
- msgstr "Månedligt"
1511
-
1512
- #: includes/i18n.php:435
1513
- msgctxt "as monthly period"
1514
- msgid "mo"
1515
- msgstr "md"
1516
-
1517
- #: includes/i18n.php:436
1518
- msgctxt "as once a year"
1519
- msgid "Annual"
1520
- msgstr "Årligt"
1521
-
1522
- #: includes/i18n.php:437
1523
- msgctxt "as once a year"
1524
- msgid "Annually"
1525
- msgstr "Årligt"
1526
-
1527
- #: includes/i18n.php:438
1528
- msgctxt "as once a year"
1529
- msgid "Once"
1530
- msgstr "Engangsbeløb"
1531
-
1532
- #: includes/i18n.php:439
1533
- msgctxt "as annual period"
1534
- msgid "year"
1535
- msgstr "år"
1536
-
1537
- #: includes/i18n.php:440
1538
- msgid "Lifetime"
1539
- msgstr "Livstid"
1540
-
1541
- #: includes/i18n.php:441
1542
- msgctxt "e.g. the best product"
1543
- msgid "Best"
1544
- msgstr "Bedste"
1545
-
1546
- #: includes/i18n.php:442
1547
- msgctxt "e.g. billed monthly"
1548
- msgid "Billed %s"
1549
- msgstr "Faktureret %s"
1550
-
1551
- #: includes/i18n.php:443
1552
- msgctxt "as a discount of $5 or 10%"
1553
- msgid "Save %s"
1554
- msgstr "Spar %s"
1555
-
1556
- #: includes/i18n.php:445
1557
- msgid "View details"
1558
- msgstr "Vis detaljer"
1559
-
1560
- #: includes/i18n.php:449
1561
- msgctxt "button label"
1562
- msgid "Approve & Start Trial"
1563
- msgstr "Godkend & start prøveperiode"
1564
-
1565
- #: includes/i18n.php:451
1566
- msgid "You are 1-click away from starting your %1$s-day free trial of the %2$s plan."
1567
- msgstr "Du er 1 klik fra at begynde din %1$s dages gratis prøveperiode af planen %2$s."
1568
-
1569
- #: includes/i18n.php:453
1570
- msgid "For compliance with the WordPress.org guidelines, before we start the trial we ask that you opt-in with your user and non-sensitive site information, allowing the plugin to periodically send data to %s to check for version updates and to validate your trial."
1571
- msgstr "For compliance with the WordPress.org guidelines, before we start the trial we ask that you opt-in with your user and non-sensitive site information, allowing the plugin to periodically send data to %s to check for version updates and to validate your trial."
1572
-
1573
- #: includes/i18n.php:459
1574
- msgid "Business name"
1575
- msgstr "Firmanavn"
1576
-
1577
- #: includes/i18n.php:460
1578
- msgid "Tax / VAT ID"
1579
- msgstr "Moms / VAT ID"
1580
-
1581
- #: includes/i18n.php:461
1582
- msgid "Address Line %d"
1583
- msgstr "Adresselinje %d"
1584
-
1585
- #: includes/i18n.php:462
1586
- msgid "Country"
1587
- msgstr "Land"
1588
-
1589
- #: includes/i18n.php:463
1590
- msgid "Select Country"
1591
- msgstr "Vælg land"
1592
-
1593
- #: includes/i18n.php:464
1594
- msgid "City"
1595
- msgstr "By"
1596
-
1597
- #: includes/i18n.php:465
1598
- msgid "Town"
1599
- msgstr "By"
1600
-
1601
- #: includes/i18n.php:466
1602
- msgid "State"
1603
- msgstr "Stat"
1604
-
1605
- #: includes/i18n.php:467
1606
- msgid "Province"
1607
- msgstr "Provins"
1608
-
1609
- #: includes/i18n.php:468
1610
- msgid "ZIP / Postal Code"
1611
- msgstr "ZIP / Postnummer"
1612
-
1613
- #: includes/i18n.php:473
1614
- msgid "Installing plugin: %s"
1615
- msgstr "Installing plugin: %s"
1616
-
1617
- #: includes/i18n.php:474
1618
- msgid "Automatic Installation"
1619
- msgstr "Automatic Installation"
1620
-
1621
- #: includes/i18n.php:476
1622
- msgid "%s sec"
1623
- msgstr "%s sec"
1624
-
1625
- #: includes/i18n.php:477
1626
- msgid "An automated download and installation of %s (paid version) from %s will start in %s. If you would like to do it manually - click the cancellation button now."
1627
- msgstr "An automated download and installation of %s (paid version) from %s will start in %s. If you would like to do it manually - click the cancellation button now."
1628
-
1629
- #: includes/i18n.php:478
1630
- msgid "The installation process has started and may take a few minutes to complete. Please wait until it is done - do not refresh this page."
1631
- msgstr "The installation process has started and may take a few minutes to complete. Please wait until it is done - do not refresh this page."
1632
-
1633
- #: includes/i18n.php:479
1634
- msgid "Cancel Installation"
1635
- msgstr "Cancel Installation"
1636
-
1637
- #: includes/i18n.php:480
1638
- msgid "The remote plugin package does not contain a folder with the desired slug and renaming did not work."
1639
- msgstr "The remote plugin package does not contain a folder with the desired slug and renaming did not work."
1640
-
1641
- #: includes/i18n.php:481
1642
- msgid "Invalid module ID."
1643
- msgstr "Invalid module ID."
1644
-
1645
- #: includes/i18n.php:482
1646
- msgid "Auto installation only works for opted-in users."
1647
- msgstr "Auto installation only works for opted-in users."
1648
-
1649
- #: includes/i18n.php:483
1650
- msgid "Premium version already active."
1651
- msgstr "Premium version already active."
1652
-
1653
- #: includes/i18n.php:484
1654
- msgid "Premium add-on version already installed."
1655
- msgstr "Premium add-on version already installed."
1656
-
1657
- #: includes/i18n.php:485
1658
- msgid "You do not have a valid license to access the premium version."
1659
- msgstr "You do not have a valid license to access the premium version."
1660
-
1661
- #: includes/i18n.php:486
1662
- msgid "Plugin is a \"Serviceware\" which means it does not have a premium code version."
1663
- msgstr "Plugin is a \"Serviceware\" which means it does not have a premium code version."
1664
-
1665
- #: includes/i18n.php:501
1666
- msgctxt "Plugin installer section title"
1667
- msgid "Description"
1668
- msgstr "Beskrivelse"
1669
-
1670
- #: includes/i18n.php:502
1671
- msgctxt "Plugin installer section title"
1672
- msgid "Installation"
1673
- msgstr "Installering"
1674
-
1675
- #: includes/i18n.php:503
1676
- msgctxt "Plugin installer section title"
1677
- msgid "FAQ"
1678
- msgstr "FAQ"
1679
-
1680
- #: includes/i18n.php:504
1681
- msgctxt "Plugin installer section title"
1682
- msgid "Changelog"
1683
- msgstr "Ændringslog"
1684
-
1685
- #: includes/i18n.php:505
1686
- msgctxt "Plugin installer section title"
1687
- msgid "Reviews"
1688
- msgstr "Anmeldelser"
1689
-
1690
- #: includes/i18n.php:506
1691
- msgctxt "Plugin installer section title"
1692
- msgid "Other Notes"
1693
- msgstr "Andre noter"
1694
-
1695
- #: includes/i18n.php:508
1696
- msgid "%s star"
1697
- msgstr "%s stjerne"
1698
-
1699
- #: includes/i18n.php:510
1700
- msgid "%s stars"
1701
- msgstr "%s stjerner"
1702
-
1703
- #: includes/i18n.php:512
1704
- msgid "%s rating"
1705
- msgstr "%s vurdering"
1706
-
1707
- #: includes/i18n.php:514
1708
- msgid "%s ratings"
1709
- msgstr "%s vurderinger"
1710
-
1711
- #: includes/i18n.php:516
1712
- msgid "%s time"
1713
- msgstr "%s gang"
1714
-
1715
- #: includes/i18n.php:518
1716
- msgid "%s times"
1717
- msgstr "%s gange"
1718
-
1719
- #: includes/i18n.php:520
1720
- msgid "Click to see reviews that provided a rating of %s"
1721
- msgstr "Click to see reviews that provided a rating of %s"
1722
-
1723
- #: includes/i18n.php:521
1724
- msgid "Last Updated"
1725
- msgstr "Senest opdateret"
1726
-
1727
- #: includes/i18n.php:522
1728
- msgid "Requires WordPress Version:"
1729
- msgstr "Kræver WordPress-version:"
1730
-
1731
- #: includes/i18n.php:523
1732
- msgctxt "as the plugin author"
1733
- msgid "Author:"
1734
- msgstr "Forfatter:"
1735
-
1736
- #: includes/i18n.php:524
1737
- msgid "Compatible up to:"
1738
- msgstr "Kompatibel op til:"
1739
-
1740
- #: includes/i18n.php:525
1741
- msgid "Downloaded:"
1742
- msgstr "Hentet:"
1743
-
1744
- #: includes/i18n.php:526
1745
- msgid "WordPress.org Plugin Page"
1746
- msgstr "WordPress.org Plugin-side"
1747
-
1748
- #: includes/i18n.php:527
1749
- msgid "Plugin Homepage"
1750
- msgstr "Plugin-websted"
1751
-
1752
- #: includes/i18n.php:528
1753
- msgid "Donate to this plugin"
1754
- msgstr "Donér til dette plugin"
1755
-
1756
- #: includes/i18n.php:529
1757
- msgid "Average Rating"
1758
- msgstr "Gennemsnitlig vurdering"
1759
-
1760
- #: includes/i18n.php:530
1761
- msgid "based on %s"
1762
- msgstr "baseret på %s"
1763
-
1764
- #: includes/i18n.php:531
1765
- msgid "Warning:"
1766
- msgstr "Advarsel:"
1767
-
1768
- #: includes/i18n.php:532
1769
- msgid "Contributors"
1770
- msgstr "Bidragsydere"
1771
-
1772
- #: includes/i18n.php:533
1773
- msgid "Plugin Install"
1774
- msgstr "Plugin Install"
1775
-
1776
- #: includes/i18n.php:534
1777
- msgid "This plugin has not been tested with your current version of WordPress."
1778
- msgstr "This plugin has not been tested with your current version of WordPress."
1779
-
1780
- #: includes/i18n.php:535
1781
- msgid "This plugin has not been marked as compatible with your version of WordPress."
1782
- msgstr "This plugin has not been marked as compatible with your version of WordPress."
1783
-
1784
- #: includes/i18n.php:536
1785
- msgid "Newer Version (%s) Installed"
1786
- msgstr "Nyere version (%s) installeret"
1787
-
1788
- #: includes/i18n.php:537
1789
- msgid "Latest Version Installed"
1790
- msgstr "Seneste version installeret"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/languages/freemius-en.mo DELETED
Binary file
freemius/languages/freemius-en.po DELETED
@@ -1,1788 +0,0 @@
1
- # Copyright (C) 2017 freemius
2
- # This file is distributed under the same license as the freemius package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: freemius\n"
6
- "Report-Msgid-Bugs-To: https://github.com/Freemius/wordpress-sdk/issues\n"
7
- "POT-Creation-Date: \n"
8
- "PO-Revision-Date: \n"
9
- "Last-Translator: Vova Feldman <vova@freemius.com>\n"
10
- "Language: \n"
11
- "Language-Team: Freemius Team <admin@freemius.com>\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
- "Content-Transfer-Encoding: 8bit\n"
14
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
- "MIME-Version: 1.0\n"
16
- "X-Poedit-Basepath: ..\n"
17
- "X-Poedit-KeywordsList: _fs_text;_fs_echo;_fs_esc_attr;_fs_esc_attr_echo;_fs_esc_html;_fs_esc_html_echo;_fs_x:1,2c;_fs_ex:1,2c;_fs_esc_attr_x:1,2c;_fs_esc_html_x:1,2c;_fs_n:1,2;_fs_n_noop:1,2;_fs_nx:1,2,4c;_fs_nx_noop:1,2,3c\n"
18
- "X-Poedit-SearchPath-0: .\n"
19
- "X-Poedit-SearchPathExcluded-0: *.js\n"
20
- "X-Poedit-SourceCharset: UTF-8\n"
21
-
22
- #: includes/i18n.php:37
23
- msgid "Account"
24
- msgstr "Account"
25
-
26
- #: includes/i18n.php:38
27
- msgid "Add On"
28
- msgstr "Add On"
29
-
30
- #: includes/i18n.php:39
31
- msgid "Contact Us"
32
- msgstr "Contact Us"
33
-
34
- #: includes/i18n.php:40
35
- msgid "Contact Support"
36
- msgstr "Contact Support"
37
-
38
- #: includes/i18n.php:41
39
- msgid "Change Ownership"
40
- msgstr "Change Ownership"
41
-
42
- #: includes/i18n.php:42
43
- msgid "Support"
44
- msgstr "Support"
45
-
46
- #: includes/i18n.php:43
47
- msgid "Support Forum"
48
- msgstr "Support Forum"
49
-
50
- #: includes/i18n.php:44
51
- msgid "Add Ons"
52
- msgstr "Add Ons"
53
-
54
- #: includes/i18n.php:45
55
- msgctxt "verb"
56
- msgid "Upgrade"
57
- msgstr "Upgrade"
58
-
59
- #: includes/i18n.php:46
60
- msgid "Awesome"
61
- msgstr "Awesome"
62
-
63
- #: includes/i18n.php:47
64
- msgctxt "noun"
65
- msgid "Pricing"
66
- msgstr "Pricing"
67
-
68
- #: includes/i18n.php:48
69
- msgctxt "noun"
70
- msgid "Price"
71
- msgstr "Price"
72
-
73
- #: includes/i18n.php:49
74
- msgid "Unlimited Updates"
75
- msgstr "Unlimited Updates"
76
-
77
- #: includes/i18n.php:50
78
- msgctxt "verb"
79
- msgid "Downgrade"
80
- msgstr "Downgrade"
81
-
82
- #: includes/i18n.php:51
83
- msgctxt "verb"
84
- msgid "Cancel Subscription"
85
- msgstr "Cancel Subscription"
86
-
87
- #: includes/i18n.php:52
88
- msgid "Cancel Trial"
89
- msgstr "Cancel Trial"
90
-
91
- #: includes/i18n.php:53
92
- msgid "Free Trial"
93
- msgstr "Free Trial"
94
-
95
- #: includes/i18n.php:54
96
- msgid "Start my free %s"
97
- msgstr "Start my free %s"
98
-
99
- #: includes/i18n.php:55
100
- msgid "No commitment for %s - cancel anytime"
101
- msgstr "No commitment for %s - cancel anytime"
102
-
103
- #: includes/i18n.php:56
104
- msgid "After your free %s, pay as little as %s"
105
- msgstr "After your free %s, pay as little as %s"
106
-
107
- #: includes/i18n.php:57
108
- msgid "Details"
109
- msgstr "Details"
110
-
111
- #: includes/i18n.php:58
112
- msgid "Account Details"
113
- msgstr "Account Details"
114
-
115
- #: includes/i18n.php:59
116
- msgctxt "verb"
117
- msgid "Delete"
118
- msgstr "Delete"
119
-
120
- #: includes/i18n.php:60
121
- msgctxt "verb"
122
- msgid "Show"
123
- msgstr "Show"
124
-
125
- #: includes/i18n.php:61
126
- msgctxt "verb"
127
- msgid "Hide"
128
- msgstr "Hide"
129
-
130
- #: includes/i18n.php:62
131
- msgctxt "verb"
132
- msgid "Edit"
133
- msgstr "Edit"
134
-
135
- #: includes/i18n.php:63
136
- msgctxt "verb"
137
- msgid "Update"
138
- msgstr "Update"
139
-
140
- #: includes/i18n.php:64
141
- msgid "Date"
142
- msgstr "Date"
143
-
144
- #: includes/i18n.php:65
145
- msgid "Amount"
146
- msgstr "Amount"
147
-
148
- #: includes/i18n.php:66
149
- msgid "Invoice"
150
- msgstr "Invoice"
151
-
152
- #: includes/i18n.php:67
153
- msgid "Billing"
154
- msgstr "Billing"
155
-
156
- #: includes/i18n.php:68
157
- msgid "Payments"
158
- msgstr "Payments"
159
-
160
- #: includes/i18n.php:69
161
- msgid "Delete Account"
162
- msgstr "Delete Account"
163
-
164
- #: includes/i18n.php:70
165
- msgctxt "as close a window"
166
- msgid "Dismiss"
167
- msgstr "Dismiss"
168
-
169
- #: includes/i18n.php:71
170
- msgctxt "as product pricing plan"
171
- msgid "Plan"
172
- msgstr "Plan"
173
-
174
- #: includes/i18n.php:72
175
- msgid "Change Plan"
176
- msgstr "Change Plan"
177
-
178
- #: includes/i18n.php:73
179
- msgctxt "as download professional version"
180
- msgid "Download %s Version"
181
- msgstr "Download %s Version"
182
-
183
- #: includes/i18n.php:74
184
- msgctxt "as download professional version now"
185
- msgid "Download %s version now"
186
- msgstr "Download %s version now"
187
-
188
- #: includes/i18n.php:75
189
- msgctxt "as download latest version"
190
- msgid "Download Latest"
191
- msgstr "Download Latest"
192
-
193
- #: includes/i18n.php:76
194
- msgctxt "E.g. you have a professional license."
195
- msgid "You have a %s license."
196
- msgstr "You have a %s license."
197
-
198
- #: includes/i18n.php:77
199
- msgid "New"
200
- msgstr "New"
201
-
202
- #: includes/i18n.php:78
203
- msgid "Free"
204
- msgstr "Free"
205
-
206
- #: includes/i18n.php:79
207
- msgctxt "as trial plan"
208
- msgid "Trial"
209
- msgstr "Trial"
210
-
211
- #: includes/i18n.php:80
212
- msgctxt "as starting a trial plan"
213
- msgid "Start Trial"
214
- msgstr "Start Trial"
215
-
216
- #: includes/i18n.php:81
217
- msgctxt "verb"
218
- msgid "Purchase"
219
- msgstr "Purchase"
220
-
221
- #: includes/i18n.php:82
222
- msgid "Purchase License"
223
- msgstr "Purchase License"
224
-
225
- #: includes/i18n.php:83
226
- msgctxt "verb"
227
- msgid "Buy"
228
- msgstr "Buy"
229
-
230
- #: includes/i18n.php:84
231
- msgid "Buy License"
232
- msgstr "Buy License"
233
-
234
- #: includes/i18n.php:85
235
- msgid "Single Site License"
236
- msgstr "Single Site License"
237
-
238
- #: includes/i18n.php:86
239
- msgid "Unlimited Licenses"
240
- msgstr "Unlimited Licenses"
241
-
242
- #: includes/i18n.php:87
243
- msgid "Up to %s Sites"
244
- msgstr "Up to %s Sites"
245
-
246
- #: includes/i18n.php:88
247
- msgid "%sRenew your license now%s to access version %s features and support."
248
- msgstr "%sRenew your license now%s to access version %s features and support."
249
-
250
- #: includes/i18n.php:89
251
- msgid "Enter the email address you've used for the upgrade below and we will resend you the license key."
252
- msgstr "Enter the email address you've used for the upgrade below and we will resend you the license key."
253
-
254
- #: includes/i18n.php:90
255
- msgctxt "e.g. Professional Plan"
256
- msgid "%s Plan"
257
- msgstr "%s Plan"
258
-
259
- #: includes/i18n.php:91
260
- msgid "You are just one step away - %s"
261
- msgstr "You are just one step away - %s"
262
-
263
- #: includes/i18n.php:92
264
- msgctxt "%s - plugin name. As complete \"Jetpack\" activation now"
265
- msgid "Complete \"%s\" Activation Now"
266
- msgstr "Complete \"%s\" Activation Now"
267
-
268
- #: includes/i18n.php:94
269
- msgid "We made a few tweaks to the plugin, %s"
270
- msgstr "We made a few tweaks to the plugin, %s"
271
-
272
- #: includes/i18n.php:95
273
- msgid "Opt-in to make \"%s\" Better!"
274
- msgstr "Opt-in to make \"%s\" Better!"
275
-
276
- #: includes/i18n.php:96
277
- msgid "Error"
278
- msgstr "Error"
279
-
280
- #: includes/i18n.php:97
281
- msgid "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
282
- msgstr "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
283
-
284
- #: includes/i18n.php:100
285
- msgctxt "as expiration date"
286
- msgid "Expiration"
287
- msgstr "Expiration"
288
-
289
- #: includes/i18n.php:101
290
- msgctxt "as software license"
291
- msgid "License"
292
- msgstr "License"
293
-
294
- #: includes/i18n.php:102
295
- msgid "not verified"
296
- msgstr "not verified"
297
-
298
- #: includes/i18n.php:103
299
- msgid "Verify Email"
300
- msgstr "Verify Email"
301
-
302
- #: includes/i18n.php:104
303
- msgctxt "e.g. expires in 2 months"
304
- msgid "Expires in %s"
305
- msgstr "Expires in %s"
306
-
307
- #: includes/i18n.php:105
308
- msgctxt "e.g. auto renews in 2 months"
309
- msgid "Auto renews in %s"
310
- msgstr "Auto renews in %s"
311
-
312
- #: includes/i18n.php:106
313
- msgid "No expiration"
314
- msgstr "No expiration"
315
-
316
- #: includes/i18n.php:107
317
- msgid "Expired"
318
- msgstr "Expired"
319
-
320
- #: includes/i18n.php:108
321
- msgid "Cancelled"
322
- msgstr "Cancelled"
323
-
324
- #: includes/i18n.php:109
325
- msgctxt "e.g. In 2 hours"
326
- msgid "In %s"
327
- msgstr "In %s"
328
-
329
- #: includes/i18n.php:110
330
- msgctxt "e.g. 2 min ago"
331
- msgid "%s ago"
332
- msgstr "%s ago"
333
-
334
- #: includes/i18n.php:112
335
- msgid "%s or higher"
336
- msgstr "%s or higher"
337
-
338
- #: includes/i18n.php:113
339
- msgctxt "as plugin version"
340
- msgid "Version"
341
- msgstr "Version"
342
-
343
- #: includes/i18n.php:114
344
- msgid "Name"
345
- msgstr "Name"
346
-
347
- #: includes/i18n.php:115
348
- msgid "Email"
349
- msgstr "Email"
350
-
351
- #: includes/i18n.php:116
352
- msgid "Email address"
353
- msgstr "Email address"
354
-
355
- #: includes/i18n.php:117
356
- msgid "Verified"
357
- msgstr "Verified"
358
-
359
- #: includes/i18n.php:118
360
- msgid "Module"
361
- msgstr "Module"
362
-
363
- #: includes/i18n.php:119
364
- msgid "Module Type"
365
- msgstr "Module Type"
366
-
367
- #: includes/i18n.php:120
368
- msgid "Plugin"
369
- msgstr "Plugin"
370
-
371
- #: includes/i18n.php:121
372
- msgid "Plugins"
373
- msgstr "Plugins"
374
-
375
- #: includes/i18n.php:122
376
- msgid "Theme"
377
- msgstr "Theme"
378
-
379
- #: includes/i18n.php:123
380
- msgid "Themes"
381
- msgstr "Themes"
382
-
383
- #: includes/i18n.php:124
384
- msgctxt "as file/folder path"
385
- msgid "Path"
386
- msgstr "Path"
387
-
388
- #: includes/i18n.php:125
389
- msgid "Title"
390
- msgstr "Title"
391
-
392
- #: includes/i18n.php:126
393
- msgid "Free version"
394
- msgstr "Free version"
395
-
396
- #: includes/i18n.php:127
397
- msgid "Premium version"
398
- msgstr "Premium version"
399
-
400
- #: includes/i18n.php:128
401
- msgctxt "as WP plugin slug"
402
- msgid "Slug"
403
- msgstr "Slug"
404
-
405
- #: includes/i18n.php:129
406
- msgid "ID"
407
- msgstr "ID"
408
-
409
- #: includes/i18n.php:130
410
- msgid "Users"
411
- msgstr "Users"
412
-
413
- #: includes/i18n.php:131
414
- msgid "Plugin Installs"
415
- msgstr "Plugin Installs"
416
-
417
- #: includes/i18n.php:132
418
- msgid "%s Installs"
419
- msgstr "%s Installs"
420
-
421
- #: includes/i18n.php:133
422
- msgctxt "like websites"
423
- msgid "Sites"
424
- msgstr "Sites"
425
-
426
- #: includes/i18n.php:134
427
- msgid "User ID"
428
- msgstr "User ID"
429
-
430
- #: includes/i18n.php:135
431
- msgid "Site ID"
432
- msgstr "Site ID"
433
-
434
- #: includes/i18n.php:136
435
- msgid "Public Key"
436
- msgstr "Public Key"
437
-
438
- #: includes/i18n.php:137
439
- msgid "Secret Key"
440
- msgstr "Secret Key"
441
-
442
- #: includes/i18n.php:138
443
- msgctxt "as secret encryption key missing"
444
- msgid "No Secret"
445
- msgstr "No Secret"
446
-
447
- #: includes/i18n.php:139
448
- msgid "No ID"
449
- msgstr "No ID"
450
-
451
- #: includes/i18n.php:140
452
- msgctxt "as synchronize license"
453
- msgid "Sync License"
454
- msgstr "Sync License"
455
-
456
- #: includes/i18n.php:141
457
- msgctxt "as synchronize"
458
- msgid "Sync"
459
- msgstr "Sync"
460
-
461
- #: includes/i18n.php:142
462
- msgid "Activate License"
463
- msgstr "Activate License"
464
-
465
- #: includes/i18n.php:143
466
- msgid "Activate Free Version"
467
- msgstr "Activate Free Version"
468
-
469
- #: includes/i18n.php:144
470
- msgid "Please enter the license key that you received in the email right after the purchase:"
471
- msgstr "Please enter the license key that you received in the email right after the purchase:"
472
-
473
- #: includes/i18n.php:145
474
- msgid "Activating license..."
475
- msgstr "Activating license..."
476
-
477
- #: includes/i18n.php:146
478
- msgid "Change License"
479
- msgstr "Change License"
480
-
481
- #: includes/i18n.php:147
482
- msgid "Update License"
483
- msgstr "Update License"
484
-
485
- #: includes/i18n.php:148
486
- msgid "Deactivate License"
487
- msgstr "Deactivate License"
488
-
489
- #: includes/i18n.php:149
490
- msgid "Activate"
491
- msgstr "Activate"
492
-
493
- #: includes/i18n.php:150
494
- msgid "Deactivate"
495
- msgstr "Deactivate"
496
-
497
- #: includes/i18n.php:151
498
- msgid "Skip & Deactivate"
499
- msgstr "Skip & Deactivate"
500
-
501
- #: includes/i18n.php:152
502
- msgid "Skip & %s"
503
- msgstr "Skip & %s"
504
-
505
- #: includes/i18n.php:153
506
- msgid "No - just deactivate"
507
- msgstr "No - just deactivate"
508
-
509
- #: includes/i18n.php:154
510
- msgid "Yes - do your thing"
511
- msgstr "Yes - do your thing"
512
-
513
- #: includes/i18n.php:155
514
- msgctxt "active mode"
515
- msgid "Active"
516
- msgstr "Active"
517
-
518
- #: includes/i18n.php:156
519
- msgctxt "is active mode?"
520
- msgid "Is Active"
521
- msgstr "Is Active"
522
-
523
- #: includes/i18n.php:157
524
- msgid "Install Now"
525
- msgstr "Install Now"
526
-
527
- #: includes/i18n.php:158
528
- msgid "Install Update Now"
529
- msgstr "Install Update Now"
530
-
531
- #: includes/i18n.php:159
532
- msgid "More information about %s"
533
- msgstr "More information about %s"
534
-
535
- #: includes/i18n.php:160
536
- msgid "Localhost"
537
- msgstr "Localhost"
538
-
539
- #: includes/i18n.php:161
540
- msgctxt "as activate Professional plan"
541
- msgid "Activate %s Plan"
542
- msgstr "Activate %s Plan"
543
-
544
- #: includes/i18n.php:162
545
- msgctxt "as 5 licenses left"
546
- msgid "%s left"
547
- msgstr "%s left"
548
-
549
- #: includes/i18n.php:163
550
- msgid "Last license"
551
- msgstr "Last license"
552
-
553
- #: includes/i18n.php:164
554
- msgid "What is your %s?"
555
- msgstr "What is your %s?"
556
-
557
- #: includes/i18n.php:165
558
- msgid "Activate this add-on"
559
- msgstr "Activate this add-on"
560
-
561
- #: includes/i18n.php:166
562
- msgid "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?"
563
- msgstr "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?"
564
-
565
- #: includes/i18n.php:167
566
- msgid "Deleting the account will automatically deactivate your %s plan license so you can use it on other sites. If you want to terminate the recurring payments as well, click the \"Cancel\" button, and first \"Downgrade\" your account. Are you sure you would like to continue with the deletion?"
567
- msgstr "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?"
568
-
569
- #: includes/i18n.php:168
570
- msgid "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?"
571
- msgstr "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?"
572
-
573
- #: includes/i18n.php:169
574
- msgid "Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s."
575
- msgstr "Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s."
576
-
577
- #: includes/i18n.php:170
578
- msgid "Cancelling the trial will immediately block access to all premium features. Are you sure?"
579
- msgstr "Cancelling the trial will immediately block access to all premium features. Are you sure?"
580
-
581
- #: includes/i18n.php:171
582
- msgid "You can still enjoy all %s features but you will not have access to plugin updates and support."
583
- msgstr "You can still enjoy all %s features but you will not have access to plugin updates and support."
584
-
585
- #: includes/i18n.php:172
586
- msgid "Once your license expires you can still use the Free version but you will NOT have access to the %s features."
587
- msgstr "Once your license expires you can still use the Free version but you will NOT have access to the %s features."
588
-
589
- #: includes/i18n.php:173
590
- msgid "Are you sure you want to proceed?"
591
- msgstr "Are you sure you want to proceed?"
592
-
593
- #: includes/i18n.php:176
594
- msgid "Add Ons for %s"
595
- msgstr "Add Ons for %s"
596
-
597
- #: includes/i18n.php:177
598
- msgid "We could'nt load the add-ons list. It's probably an issue on our side, please try to come back in few minutes."
599
- msgstr "We could'nt load the add-ons list. It's probably an issue on our side, please try to come back in few minutes."
600
-
601
- #: includes/i18n.php:179
602
- msgid "Anonymous feedback"
603
- msgstr "Anonymous feedback"
604
-
605
- #: includes/i18n.php:180
606
- msgid "Quick feedback"
607
- msgstr "Quick feedback"
608
-
609
- #: includes/i18n.php:181
610
- msgid "If you have a moment, please let us know why you are deactivating"
611
- msgstr "If you have a moment, please let us know why you are deactivating"
612
-
613
- #: includes/i18n.php:182
614
- msgid "Yes - Deactivate"
615
- msgstr "Yes - Deactivate"
616
-
617
- #: includes/i18n.php:183
618
- msgid "Submit & Deactivate"
619
- msgstr "Submit & Deactivate"
620
-
621
- #: includes/i18n.php:184
622
- msgid "Cancel"
623
- msgstr "Cancel"
624
-
625
- #: includes/i18n.php:185
626
- msgid "I no longer need the plugin"
627
- msgstr "I no longer need the plugin"
628
-
629
- #: includes/i18n.php:186
630
- msgid "I found a better plugin"
631
- msgstr "I found a better plugin"
632
-
633
- #: includes/i18n.php:187
634
- msgid "I only needed the plugin for a short period"
635
- msgstr "I only needed the plugin for a short period"
636
-
637
- #: includes/i18n.php:188
638
- msgid "The plugin broke my site"
639
- msgstr "The plugin broke my site"
640
-
641
- #: includes/i18n.php:189
642
- msgid "The plugin suddenly stopped working"
643
- msgstr "The plugin suddenly stopped working"
644
-
645
- #: includes/i18n.php:190
646
- msgid "I can't pay for it anymore"
647
- msgstr "I can't pay for it anymore"
648
-
649
- #: includes/i18n.php:191
650
- msgid "It's a temporary deactivation. I'm just debugging an issue."
651
- msgstr "It's a temporary deactivation. I'm just debugging an issue."
652
-
653
- #: includes/i18n.php:192
654
- msgctxt "the text of the \"other\" reason for deactivating the plugin that is shown in the modal box."
655
- msgid "Other"
656
- msgstr "Other"
657
-
658
- #: includes/i18n.php:194
659
- msgid "Kindly tell us the reason so we can improve."
660
- msgstr "Kindly tell us the reason so we can improve."
661
-
662
- #: includes/i18n.php:195
663
- msgid "What's the plugin's name?"
664
- msgstr "What's the plugin's name?"
665
-
666
- #: includes/i18n.php:196
667
- msgid "What price would you feel comfortable paying?"
668
- msgstr "What price would you feel comfortable paying?"
669
-
670
- #: includes/i18n.php:197
671
- msgid "I couldn't understand how to make it work"
672
- msgstr "I couldn't understand how to make it work"
673
-
674
- #: includes/i18n.php:198
675
- msgid "The plugin is great, but I need specific feature that you don't support"
676
- msgstr "The plugin is great, but I need specific feature that you don't support"
677
-
678
- #: includes/i18n.php:199
679
- msgid "The plugin is not working"
680
- msgstr "The plugin is not working"
681
-
682
- #: includes/i18n.php:200
683
- msgid "It's not what I was looking for"
684
- msgstr "It's not what I was looking for"
685
-
686
- #: includes/i18n.php:201
687
- msgid "The plugin didn't work as expected"
688
- msgstr "The plugin didn't work as expected"
689
-
690
- #: includes/i18n.php:202
691
- msgid "What feature?"
692
- msgstr "What feature?"
693
-
694
- #: includes/i18n.php:203
695
- msgid "Kindly share what didn't work so we can fix it for future users..."
696
- msgstr "Kindly share what didn't work so we can fix it for future users..."
697
-
698
- #: includes/i18n.php:204
699
- msgid "What you've been looking for?"
700
- msgstr "What you've been looking for?"
701
-
702
- #: includes/i18n.php:205
703
- msgid "What did you expect?"
704
- msgstr "What did you expect?"
705
-
706
- #: includes/i18n.php:206
707
- msgid "The plugin didn't work"
708
- msgstr "The plugin didn't work"
709
-
710
- #: includes/i18n.php:207
711
- msgid "I don't like to share my information with you"
712
- msgstr "I don't like to share my information with you"
713
-
714
- #: includes/i18n.php:208
715
- msgid "You might have missed it, but you don't have to share any data and can just %s the opt-in."
716
- msgstr "You might have missed it, but you don't have to share any data and can just %s the opt-in."
717
-
718
- #: includes/i18n.php:212
719
- msgctxt "greeting"
720
- msgid "Hey %s,"
721
- msgstr "Hey %s,"
722
-
723
- #: includes/i18n.php:213
724
- msgctxt "a greeting. E.g. Thanks John!"
725
- msgid "Thanks %s!"
726
- msgstr "Thanks %s!"
727
-
728
- #: includes/i18n.php:214
729
- msgid "Never miss an important update - opt-in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s."
730
- msgstr "Never miss an important update - opt-in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s."
731
-
732
- #: includes/i18n.php:215
733
- msgid "Please help us improve %1$s! If you opt-in, some data about your usage of %1$s will be sent to %4$s. If you skip this, that's okay! %1$s will still work just fine."
734
- msgstr "Please help us improve %1$s! If you opt-in, some data about your usage of %1$s will be sent to %4$s. If you skip this, that's okay! %1$s will still work just fine."
735
-
736
- #: includes/i18n.php:216
737
- msgid "You should receive an activation email for %s to your mailbox at %s. Please make sure you click the activation button in that email to %s."
738
- msgstr "You should receive an activation email for %s to your mailbox at %s. Please make sure you click the activation button in that email to %s."
739
-
740
- #: includes/i18n.php:217
741
- msgid "complete the install"
742
- msgstr "complete the install"
743
-
744
- #: includes/i18n.php:218
745
- msgid "start the trial"
746
- msgstr "start the trial"
747
-
748
- #: includes/i18n.php:219
749
- msgid "Thanks for purchasing %s! To get started, please enter your license key:"
750
- msgstr "Thanks for purchasing %s! To get started, please enter your license key:"
751
-
752
- #: includes/i18n.php:220
753
- msgid "The plugin will be periodically sending data to %s to check for plugin updates and verify the validity of your license."
754
- msgstr "The plugin will be periodically sending data to %s to check for plugin updates and verify the validity of your license."
755
-
756
- #: includes/i18n.php:221
757
- msgid "What permissions are being granted?"
758
- msgstr "What permissions are being granted?"
759
-
760
- #: includes/i18n.php:222
761
- msgid "Your Profile Overview"
762
- msgstr "Your Profile Overview"
763
-
764
- #: includes/i18n.php:223
765
- msgid "Name and email address"
766
- msgstr "Name and email address"
767
-
768
- #: includes/i18n.php:224
769
- msgid "Your Site Overview"
770
- msgstr "Your Site Overview"
771
-
772
- #: includes/i18n.php:225
773
- msgid "Site URL, WP version, PHP info, plugins & themes"
774
- msgstr "Site URL, WP version, PHP info, plugins & themes"
775
-
776
- #: includes/i18n.php:226
777
- msgid "Current Plugin Events"
778
- msgstr "Current Plugin Events"
779
-
780
- #: includes/i18n.php:227
781
- msgid "Activation, deactivation and uninstall"
782
- msgstr "Activation, deactivation and uninstall"
783
-
784
- #: includes/i18n.php:228
785
- msgid "Plugins & Themes"
786
- msgstr "Plugins & Themes"
787
-
788
- #: includes/i18n.php:229
789
- msgid "Titles, versions and state."
790
- msgstr "Titles, versions and state."
791
-
792
- #: includes/i18n.php:230
793
- msgid "Admin Notices"
794
- msgstr "Admin Notices"
795
-
796
- #: includes/i18n.php:231
797
- msgid "Newsletter"
798
- msgstr "Newsletter"
799
-
800
- #: includes/i18n.php:232
801
- msgid "Updates, announcements, marketing, no spam"
802
- msgstr "Updates, announcements, marketing, no spam"
803
-
804
- #: includes/i18n.php:233
805
- msgid "Privacy Policy"
806
- msgstr "Privacy Policy"
807
-
808
- #: includes/i18n.php:234
809
- msgid "Terms of Service"
810
- msgstr "Terms of Service"
811
-
812
- #: includes/i18n.php:235
813
- msgctxt "as activating plugin"
814
- msgid "Activating"
815
- msgstr "Activating"
816
-
817
- #: includes/i18n.php:236
818
- msgctxt "as in the process of sending an email"
819
- msgid "Sending email"
820
- msgstr "Sending email"
821
-
822
- #: includes/i18n.php:237
823
- msgctxt "button label"
824
- msgid "Allow & Continue"
825
- msgstr "Allow & Continue"
826
-
827
- #: includes/i18n.php:238
828
- msgctxt "button label"
829
- msgid "Agree & Activate License"
830
- msgstr "Agree & Activate License"
831
-
832
- #: includes/i18n.php:239
833
- msgctxt "verb"
834
- msgid "Skip"
835
- msgstr "Skip"
836
-
837
- #: includes/i18n.php:240
838
- msgid "Click here to use the plugin anonymously"
839
- msgstr "Click here to use the plugin anonymously"
840
-
841
- #: includes/i18n.php:241
842
- msgid "Re-send activation email"
843
- msgstr "Re-send activation email"
844
-
845
- #: includes/i18n.php:242
846
- msgid "License key"
847
- msgstr "License key"
848
-
849
- #: includes/i18n.php:243
850
- msgid "Send License Key"
851
- msgstr "Send License Key"
852
-
853
- #: includes/i18n.php:244
854
- msgid "Sending license key"
855
- msgstr "Sending license key"
856
-
857
- #: includes/i18n.php:245
858
- msgid "Have a license key?"
859
- msgstr "Have a license key?"
860
-
861
- #: includes/i18n.php:246
862
- msgid "Don't have a license key?"
863
- msgstr "Don't have a license key?"
864
-
865
- #: includes/i18n.php:247
866
- msgid "Can't find your license key?"
867
- msgstr "Can't find your license key?"
868
-
869
- #: includes/i18n.php:248
870
- msgid "We couldn't find your email address in the system, are you sure it's the right address?"
871
- msgstr "We couldn't find your email address in the system, are you sure it's the right address?"
872
-
873
- #: includes/i18n.php:249
874
- msgid "We can't see any active licenses associated with that email address, are you sure it's the right address?"
875
- msgstr "We can't see any active licenses associated with that email address, are you sure it's the right address?"
876
-
877
- #: includes/i18n.php:250
878
- msgid "Opt In"
879
- msgstr "Opt In"
880
-
881
- #: includes/i18n.php:251
882
- msgid "Opt Out"
883
- msgstr "Opt Out"
884
-
885
- #: includes/i18n.php:252
886
- msgid "On second thought - I want to continue helping"
887
- msgstr "On second thought - I want to continue helping"
888
-
889
- #: includes/i18n.php:253
890
- msgid "Opting out..."
891
- msgstr "Opting out..."
892
-
893
- #: includes/i18n.php:254
894
- msgid "Opting in..."
895
- msgstr "Opting in..."
896
-
897
- #: includes/i18n.php:255
898
- msgid "We appreciate your help in making the %s better by letting us track some usage data."
899
- msgstr "We appreciate your help in making the %s better by letting us track some usage data."
900
-
901
- #: includes/i18n.php:256
902
- msgid "Usage tracking is done in the name of making %s better. Making a better user experience, prioritizing new features, and more good things. We'd really appreciate if you'll reconsider letting us continue with the tracking."
903
- msgstr "Usage tracking is done in the name of making %s better. Making a better user experience, prioritizing new features, and more good things. We'd really appreciate if you'll reconsider letting us continue with the tracking."
904
-
905
- #: includes/i18n.php:257
906
- msgid "By clicking \"Opt Out\", we will no longer be sending any data from %s to %s."
907
- msgstr "By clicking \"Opt Out\", we will no longer be sending any data from %s to %s."
908
-
909
- #: includes/i18n.php:261
910
- msgid "Screenshots"
911
- msgstr "Screenshots"
912
-
913
- #: includes/i18n.php:262
914
- msgid "Click to view full-size screenshot %d"
915
- msgstr "Click to view full-size screenshot %d"
916
-
917
- #: includes/i18n.php:266
918
- msgid "Freemius Debug"
919
- msgstr "Freemius Debug"
920
-
921
- #: includes/i18n.php:267
922
- msgctxt "as turned on"
923
- msgid "On"
924
- msgstr "On"
925
-
926
- #: includes/i18n.php:268
927
- msgctxt "as turned off"
928
- msgid "Off"
929
- msgstr "Off"
930
-
931
- #: includes/i18n.php:269
932
- msgctxt "as code debugging"
933
- msgid "Debugging"
934
- msgstr "Debugging"
935
-
936
- #: includes/i18n.php:270
937
- msgid "Freemius State"
938
- msgstr "Freemius State"
939
-
940
- #: includes/i18n.php:271
941
- msgctxt "as connection was successful"
942
- msgid "Connected"
943
- msgstr "Connected"
944
-
945
- #: includes/i18n.php:272
946
- msgctxt "as connection blocked"
947
- msgid "Blocked"
948
- msgstr "Blocked"
949
-
950
- #: includes/i18n.php:273
951
- msgctxt "as application program interface"
952
- msgid "API"
953
- msgstr "API"
954
-
955
- #: includes/i18n.php:274
956
- msgctxt "as software development kit versions"
957
- msgid "SDK"
958
- msgstr "SDK"
959
-
960
- #: includes/i18n.php:275
961
- msgctxt "as software development kit versions"
962
- msgid "SDK Versions"
963
- msgstr "SDK Versions"
964
-
965
- #: includes/i18n.php:276
966
- msgctxt "as plugin folder path"
967
- msgid "Plugin Path"
968
- msgstr "Plugin Path"
969
-
970
- #: includes/i18n.php:277
971
- msgctxt "as sdk path"
972
- msgid "SDK Path"
973
- msgstr "SDK Path"
974
-
975
- #: includes/i18n.php:278
976
- msgid "Add Ons of Plugin %s"
977
- msgstr "Add Ons of Plugin %s"
978
-
979
- #: includes/i18n.php:279
980
- msgid "Are you sure you want to delete all Freemius data?"
981
- msgstr "Are you sure you want to delete all Freemius data?"
982
-
983
- #: includes/i18n.php:280
984
- msgid "Actions"
985
- msgstr "Actions"
986
-
987
- #: includes/i18n.php:281
988
- msgid "Delete All Accounts"
989
- msgstr "Delete All Accounts"
990
-
991
- #: includes/i18n.php:282
992
- msgid "Start Fresh"
993
- msgstr "Start Fresh"
994
-
995
- #: includes/i18n.php:283
996
- msgid "Clear API Cache"
997
- msgstr "Clear API Cache"
998
-
999
- #: includes/i18n.php:284
1000
- msgid "Sync Data From Server"
1001
- msgstr "Sync Data From Server"
1002
-
1003
- #: includes/i18n.php:285
1004
- msgid "Scheduled Crons"
1005
- msgstr "Scheduled Crons"
1006
-
1007
- #: includes/i18n.php:286
1008
- msgid "Cron Type"
1009
- msgstr "Cron Type"
1010
-
1011
- #: includes/i18n.php:287
1012
- msgid "Plugins & Themes Sync"
1013
- msgstr "Plugins & Themes Sync"
1014
-
1015
- #: includes/i18n.php:288
1016
- msgid "Licenses"
1017
- msgstr "Licenses"
1018
-
1019
- #: includes/i18n.php:289
1020
- msgid "Debug Log"
1021
- msgstr "Debug Log"
1022
-
1023
- #: includes/i18n.php:290
1024
- msgid "All"
1025
- msgstr "All"
1026
-
1027
- #: includes/i18n.php:291
1028
- msgid "File"
1029
- msgstr "File"
1030
-
1031
- #: includes/i18n.php:292
1032
- msgid "Function"
1033
- msgstr "Function"
1034
-
1035
- #: includes/i18n.php:293
1036
- msgid "Process ID"
1037
- msgstr "Process ID"
1038
-
1039
- #: includes/i18n.php:294
1040
- msgid "Logger"
1041
- msgstr "Logger"
1042
-
1043
- #: includes/i18n.php:295
1044
- msgid "Message"
1045
- msgstr "Message"
1046
-
1047
- #: includes/i18n.php:296
1048
- msgid "Download"
1049
- msgstr "Download"
1050
-
1051
- #: includes/i18n.php:297
1052
- msgid "Filter"
1053
- msgstr "Filter"
1054
-
1055
- #: includes/i18n.php:298
1056
- msgid "Type"
1057
- msgstr "Type"
1058
-
1059
- #: includes/i18n.php:299
1060
- msgid "All Types"
1061
- msgstr "All Types"
1062
-
1063
- #: includes/i18n.php:300
1064
- msgid "All Requests"
1065
- msgstr "All Requests"
1066
-
1067
- #: includes/i18n.php:304
1068
- msgctxt "as congratulations"
1069
- msgid "Congrats"
1070
- msgstr "Congrats"
1071
-
1072
- #: includes/i18n.php:305
1073
- msgctxt "exclamation"
1074
- msgid "Oops"
1075
- msgstr "Oops"
1076
-
1077
- #: includes/i18n.php:306
1078
- msgctxt "interjection expressing joy or exuberance"
1079
- msgid "Yee-haw"
1080
- msgstr "Yee-haw"
1081
-
1082
- #: includes/i18n.php:307
1083
- msgctxt "(especially in electronic communication) used to express elation, enthusiasm, or triumph."
1084
- msgid "W00t"
1085
- msgstr "W00t"
1086
-
1087
- #: includes/i18n.php:309
1088
- msgctxt "a positive response"
1089
- msgid "Right on"
1090
- msgstr "Right on"
1091
-
1092
- #: includes/i18n.php:310
1093
- msgctxt "something somebody says when they are thinking about what you have just said. "
1094
- msgid "Hmm"
1095
- msgstr "Hmm"
1096
-
1097
- #: includes/i18n.php:312
1098
- msgid "O.K"
1099
- msgstr "O.K"
1100
-
1101
- #: includes/i18n.php:313
1102
- msgctxt "exclamation"
1103
- msgid "Hey"
1104
- msgstr "Hey"
1105
-
1106
- #: includes/i18n.php:314
1107
- msgctxt "advance notice of something that will need attention."
1108
- msgid "Heads up"
1109
- msgstr "Heads up"
1110
-
1111
- #: includes/i18n.php:319
1112
- msgid "Seems like you got the latest release."
1113
- msgstr "Seems like you got the latest release."
1114
-
1115
- #: includes/i18n.php:320
1116
- msgid "You are all good!"
1117
- msgstr "You are all good!"
1118
-
1119
- #: includes/i18n.php:321
1120
- msgid "Sorry, we could not complete the email update. Another user with the same email is already registered."
1121
- msgstr "Sorry, we could not complete the email update. Another user with the same email is already registered."
1122
-
1123
- #: includes/i18n.php:322
1124
- msgid "If you would like to give up the ownership of the plugin's account to %s click the Change Ownership button."
1125
- msgstr "If you would like to give up the ownership of the plugin's account to %s click the Change Ownership button."
1126
-
1127
- #: includes/i18n.php:323
1128
- msgid "Your email was successfully updated. You should receive an email with confirmation instructions in few moments."
1129
- msgstr "Your email was successfully updated. You should receive an email with confirmation instructions in few moments."
1130
-
1131
- #: includes/i18n.php:324
1132
- msgid "Your name was successfully updated."
1133
- msgstr "Your name was successfully updated."
1134
-
1135
- #: includes/i18n.php:325
1136
- msgid "You have successfully updated your %s."
1137
- msgstr "You have successfully updated your %s."
1138
-
1139
- #: includes/i18n.php:326
1140
- msgid "Please provide your full name."
1141
- msgstr "Please provide your full name."
1142
-
1143
- #: includes/i18n.php:327
1144
- msgid "Verification mail was just sent to %s. If you can't find it after 5 min, please check your spam box."
1145
- msgstr "Verification mail was just sent to %s. If you can't find it after 5 min, please check your spam box."
1146
-
1147
- #: includes/i18n.php:328
1148
- msgid "Just letting you know that the add-ons information of %s is being pulled from an external server."
1149
- msgstr "Just letting you know that the add-ons information of %s is being pulled from an external server."
1150
-
1151
- #: includes/i18n.php:329
1152
- msgid "No credit card required"
1153
- msgstr "No credit card required"
1154
-
1155
- #: includes/i18n.php:330
1156
- msgid "Premium plugin version was successfully activated."
1157
- msgstr "Premium plugin version was successfully activated."
1158
-
1159
- #: includes/i18n.php:331
1160
- msgid "The upgrade of %s was successfully completed."
1161
- msgstr "The upgrade of %s was successfully completed."
1162
-
1163
- #: includes/i18n.php:332
1164
- msgid "Your account was successfully activated with the %s plan."
1165
- msgstr "Your account was successfully activated with the %s plan."
1166
-
1167
- #: includes/i18n.php:333
1168
- msgid "Download the latest %s version now"
1169
- msgstr "Download the latest %s version now"
1170
-
1171
- #: includes/i18n.php:334
1172
- msgid "Please follow these steps to complete the upgrade"
1173
- msgstr "Please follow these steps to complete the upgrade"
1174
-
1175
- #: includes/i18n.php:335
1176
- msgid "Download the latest %s version"
1177
- msgstr "Download the latest %s version"
1178
-
1179
- #: includes/i18n.php:336
1180
- msgid "Download the latest version"
1181
- msgstr "Download the latest version"
1182
-
1183
- #: includes/i18n.php:337
1184
- msgid "Deactivate the free version"
1185
- msgstr "Deactivate the free version"
1186
-
1187
- #: includes/i18n.php:338
1188
- msgid "Upload and activate the downloaded version"
1189
- msgstr "Upload and activate the downloaded version"
1190
-
1191
- #: includes/i18n.php:339
1192
- msgid "How to upload and activate?"
1193
- msgstr "How to upload and activate?"
1194
-
1195
- #: includes/i18n.php:340
1196
- msgctxt "%s - product name, e.g. Facebook add-on was successfully..."
1197
- msgid "%s Add-on was successfully purchased."
1198
- msgstr "%s Add-on was successfully purchased."
1199
-
1200
- #: includes/i18n.php:342
1201
- msgid "Your %s Add-on plan was successfully upgraded."
1202
- msgstr "Your %s Add-on plan was successfully upgraded."
1203
-
1204
- #: includes/i18n.php:343
1205
- msgid "Your email has been successfully verified - you are AWESOME!"
1206
- msgstr "Your email has been successfully verified - you are AWESOME!"
1207
-
1208
- #: includes/i18n.php:344
1209
- msgid "Your plan was successfully upgraded."
1210
- msgstr "Your plan was successfully upgraded."
1211
-
1212
- #: includes/i18n.php:345
1213
- msgid "Your plan was successfully changed to %s."
1214
- msgstr "Your plan was successfully changed to %s."
1215
-
1216
- #: includes/i18n.php:346
1217
- msgid "Your license has expired. You can still continue using the free plugin forever."
1218
- msgstr "Your license has expired. You can still continue using the free plugin forever."
1219
-
1220
- #: includes/i18n.php:347
1221
- msgid "Your license has been cancelled. If you think it's a mistake, please contact support."
1222
- msgstr "Your license has been cancelled. If you think it's a mistake, please contact support."
1223
-
1224
- #: includes/i18n.php:348
1225
- msgid "Your trial has been successfully started."
1226
- msgstr "Your trial has been successfully started."
1227
-
1228
- #: includes/i18n.php:349
1229
- msgid "Your license was successfully activated."
1230
- msgstr "Your license was successfully activated."
1231
-
1232
- #: includes/i18n.php:350
1233
- msgid "It looks like your site currently doesn't have an active license."
1234
- msgstr "It looks like your site currently doesn't have an active license."
1235
-
1236
- #: includes/i18n.php:351
1237
- msgid "Your license was successfully deactivated, you are back to the %s plan."
1238
- msgstr "Your license was successfully deactivated, you are back to the %s plan."
1239
-
1240
- #: includes/i18n.php:352
1241
- msgid "It looks like the license deactivation failed."
1242
- msgstr "It looks like the license deactivation failed."
1243
-
1244
- #: includes/i18n.php:353
1245
- msgid "It looks like the license could not be activated."
1246
- msgstr "It looks like the license could not be activated."
1247
-
1248
- #: includes/i18n.php:354
1249
- msgid "Error received from the server:"
1250
- msgstr "Error received from the server:"
1251
-
1252
- #: includes/i18n.php:355
1253
- msgid "Your trial has expired. You can still continue using all our free features."
1254
- msgstr "Your trial has expired. You can still continue using all our free features."
1255
-
1256
- #: includes/i18n.php:356
1257
- msgid "Your plan was successfully downgraded. Your %s plan license will expire in %s."
1258
- msgstr "Your plan was successfully downgraded. Your %s plan license will expire in %s."
1259
-
1260
- #: includes/i18n.php:357
1261
- msgid "Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes."
1262
- msgstr "Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes."
1263
-
1264
- #: includes/i18n.php:358
1265
- msgid "It looks like you are not in trial mode anymore so there's nothing to cancel :)"
1266
- msgstr "It looks like you are not in trial mode anymore so there's nothing to cancel :)"
1267
-
1268
- #: includes/i18n.php:359
1269
- msgid "Your %s free trial was successfully cancelled."
1270
- msgstr "Your %s free trial was successfully cancelled."
1271
-
1272
- #: includes/i18n.php:360
1273
- msgctxt "%s - numeric version number"
1274
- msgid "Version %s was released."
1275
- msgstr "Version %s was released."
1276
-
1277
- #: includes/i18n.php:361
1278
- msgid "Please download %s."
1279
- msgstr "Please download %s."
1280
-
1281
- #: includes/i18n.php:362
1282
- msgctxt "%s - plan name, as the latest professional version here"
1283
- msgid "the latest %s version here"
1284
- msgstr "the latest %s version here"
1285
-
1286
- #: includes/i18n.php:364
1287
- msgid "How do you like %s so far? Test all our %s premium features with a %d-day free trial."
1288
- msgstr "How do you like %s so far? Test all our %s premium features with a %d-day free trial."
1289
-
1290
- #: includes/i18n.php:365
1291
- msgctxt "call to action"
1292
- msgid "Start free trial"
1293
- msgstr "Start free trial"
1294
-
1295
- #: includes/i18n.php:366
1296
- msgid "Starting trial"
1297
- msgstr "Starting trial"
1298
-
1299
- #: includes/i18n.php:367
1300
- msgid "Please wait"
1301
- msgstr "Please wait"
1302
-
1303
- #: includes/i18n.php:368
1304
- msgid "Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes."
1305
- msgstr "Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes."
1306
-
1307
- #: includes/i18n.php:369
1308
- msgid "You already utilized a trial before."
1309
- msgstr "You already utilized a trial before."
1310
-
1311
- #: includes/i18n.php:370
1312
- msgid "You are already running the plugin in a trial mode."
1313
- msgstr "You are already running the plugin in a trial mode."
1314
-
1315
- #: includes/i18n.php:371
1316
- msgid "Plan %s do not exist, therefore, can't start a trial."
1317
- msgstr "Plan %s do not exist, therefore, can't start a trial."
1318
-
1319
- #: includes/i18n.php:372
1320
- msgid "Plan %s does not support a trial period."
1321
- msgstr "Plan %s does not support a trial period."
1322
-
1323
- #: includes/i18n.php:373
1324
- msgid "None of the plugin's plans supports a trial period."
1325
- msgstr "None of the plugin's plans supports a trial period."
1326
-
1327
- #: includes/i18n.php:374
1328
- msgid "Unexpected API error. Please contact the plugin's author with the following error."
1329
- msgstr "Unexpected API error. Please contact the plugin's author with the following error."
1330
-
1331
- #: includes/i18n.php:375
1332
- msgid "No commitment for %s days - cancel anytime!"
1333
- msgstr "No commitment for %s days - cancel anytime!"
1334
-
1335
- #: includes/i18n.php:376
1336
- msgid "Your license has expired. You can still continue using all the %s features, but you'll need to renew your license to continue getting updates and support."
1337
- msgstr "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."
1338
-
1339
- #: includes/i18n.php:377
1340
- msgid "Couldn't activate %s."
1341
- msgstr "Couldn't activate %s."
1342
-
1343
- #: includes/i18n.php:378
1344
- msgid "Please contact us with the following message:"
1345
- msgstr "Please contact us with the following message:"
1346
-
1347
- #: includes/i18n.php:379
1348
- msgid "It looks like you are still on the %s plan. If you did upgrade or change your plan, it's probably an issue on our side - sorry."
1349
- msgstr "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."
1350
-
1351
- #: includes/i18n.php:380
1352
- msgid "Please contact us here"
1353
- msgstr "Please contact us here"
1354
-
1355
- #: includes/i18n.php:381
1356
- msgid "I have upgraded my account but when I try to Sync the License, the plan remains %s."
1357
- msgstr "I have upgraded my account but when I try to Sync the License, the plan remains %s."
1358
-
1359
- #: includes/i18n.php:384
1360
- msgid "From unknown reason, the API connectivity test failed."
1361
- msgstr "From unknown reason, the API connectivity test failed."
1362
-
1363
- #: includes/i18n.php:385
1364
- msgid "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?"
1365
- msgstr "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?"
1366
-
1367
- #: includes/i18n.php:386
1368
- msgid "We use PHP cURL library for the API calls, which is a very common library and usually installed and activated out of the box. Unfortunately, cURL is not activated (or disabled) on your server."
1369
- msgstr "We use PHP cURL library for the API calls, which is a very common library and usually installed and activated out of the box. Unfortunately, cURL is not activated (or disabled) on your server."
1370
-
1371
- #: includes/i18n.php:387
1372
- msgid "Disabled method(s):"
1373
- msgstr "Disabled method(s):"
1374
-
1375
- #: includes/i18n.php:388
1376
- msgid "From unknown reason, CloudFlare, the firewall we use, blocks the connection."
1377
- msgstr "From unknown reason, CloudFlare, the firewall we use, blocks the connection."
1378
-
1379
- #: includes/i18n.php:389
1380
- msgctxt "as pluginX requires an access to our API"
1381
- msgid "%s requires an access to our API."
1382
- msgstr "%s requires an access to our API."
1383
-
1384
- #: includes/i18n.php:391
1385
- msgid "It looks like your server is using Squid ACL (access control lists), which blocks the connection."
1386
- msgstr "It looks like your server is using Squid ACL (access control lists), which blocks the connection."
1387
-
1388
- #: includes/i18n.php:392
1389
- msgid "I don't know what is Squid or ACL, help me!"
1390
- msgstr "I don't know what is Squid or ACL, help me!"
1391
-
1392
- #: includes/i18n.php:393, includes/i18n.php:397
1393
- msgid "We'll make sure to contact your hosting company and resolve the issue. You will get a follow-up email to %s once we have an update."
1394
- msgstr "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."
1395
-
1396
- #: includes/i18n.php:394
1397
- msgid "I'm a system administrator"
1398
- msgstr "I'm a system administrator"
1399
-
1400
- #: includes/i18n.php:395
1401
- msgid "Great, please whitelist the following domains: %s. Once you are done, deactivate the plugin and activate it again."
1402
- msgstr "Great, please whitelist the following domains: %s. Once you are done, deactivate the plugin and activate it again."
1403
-
1404
- #: includes/i18n.php:396
1405
- msgid "I don't know what is cURL or how to install it, help me!"
1406
- msgstr "I don't know what is cURL or how to install it, help me!"
1407
-
1408
- #: includes/i18n.php:398
1409
- msgid "Great, please install cURL and enable it in your php.ini file. In addition, search for the 'disable_functions' directive in your php.ini file and remove any disabled methods starting with 'curl_'. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the plugin and reactivate it back again."
1410
- msgstr "Great, please install cURL and enable it in your php.ini file. In addition, search for the 'disable_functions' directive in your php.ini file and remove any disabled methods starting with 'curl_'. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the plugin and reactivate it back again."
1411
-
1412
- #: includes/i18n.php:399
1413
- msgid "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."
1414
- msgstr "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."
1415
-
1416
- #: includes/i18n.php:400
1417
- msgid "Sorry for the inconvenience and we are here to help if you give us a chance."
1418
- msgstr "Sorry for the inconvenience and we are here to help if you give us a chance."
1419
-
1420
- #: includes/i18n.php:401
1421
- msgid "Yes - I'm giving you a chance to fix it"
1422
- msgstr "Yes - I'm giving you a chance to fix it"
1423
-
1424
- #: includes/i18n.php:402
1425
- msgid "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."
1426
- msgstr "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."
1427
-
1428
- #: includes/i18n.php:403
1429
- msgid "Let's try your previous version"
1430
- msgstr "Let's try your previous version"
1431
-
1432
- #: includes/i18n.php:404
1433
- msgid "Uninstall this version and install the previous one."
1434
- msgstr "Uninstall this version and install the previous one."
1435
-
1436
- #: includes/i18n.php:405
1437
- msgid "That's exhausting, please deactivate"
1438
- msgstr "That's exhausting, please deactivate"
1439
-
1440
- #: includes/i18n.php:406
1441
- msgid "We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future."
1442
- msgstr "We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future."
1443
-
1444
- #: includes/i18n.php:407
1445
- msgid "Thank for giving us the chance to fix it! A message was just sent to our technical staff. We will get back to you as soon as we have an update to %s. Appreciate your patience."
1446
- msgstr "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."
1447
-
1448
- #: includes/i18n.php:408
1449
- msgctxt "%1s - plugin title, %2s - API domain"
1450
- msgid "Your server is blocking the access to Freemius' API, which is crucial for %1s synchronization. Please contact your host to whitelist %2s"
1451
- msgstr "Your server is blocking the access to Freemius' API, which is crucial for %1s synchronization. Please contact your host to whitelist %2s"
1452
-
1453
- #: includes/i18n.php:410
1454
- msgid "It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again."
1455
- msgstr "It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again."
1456
-
1457
- #: includes/i18n.php:413
1458
- msgid "Please check your mailbox, you should receive an email via %s to confirm the ownership change. From security reasons, you must confirm the change within the next 15 min. If you cannot find the email, please check your spam folder."
1459
- msgstr "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."
1460
-
1461
- #: includes/i18n.php:414
1462
- msgid "Thanks for confirming the ownership change. An email was just sent to %s for final approval."
1463
- msgstr "Thanks for confirming the ownership change. An email was just sent to %s for final approval."
1464
-
1465
- #: includes/i18n.php:415
1466
- msgid "%s is the new owner of the account."
1467
- msgstr "%s is the new owner of the account."
1468
-
1469
- #: includes/i18n.php:417
1470
- msgctxt "addonX cannot run without pluginY"
1471
- msgid "%s cannot run without %s."
1472
- msgstr "%s cannot run without %s."
1473
-
1474
- #: includes/i18n.php:419
1475
- msgctxt "addonX cannot run..."
1476
- msgid "%s cannot run without the plugin."
1477
- msgstr "%s cannot run without the plugin."
1478
-
1479
- #: includes/i18n.php:420
1480
- msgctxt "pluginX activation was successfully..."
1481
- msgid "%s activation was successfully completed."
1482
- msgstr "%s activation was successfully completed."
1483
-
1484
- #: includes/i18n.php:422
1485
- msgctxt "Plugin installer section title"
1486
- msgid "Features & Pricing"
1487
- msgstr "Features & Pricing"
1488
-
1489
- #: includes/i18n.php:423
1490
- msgid "Add-on must be deployed to WordPress.org or Freemius."
1491
- msgstr "Add-on must be deployed to WordPress.org or Freemius."
1492
-
1493
- #: includes/i18n.php:424
1494
- msgid "Paid add-on must be deployed to Freemius."
1495
- msgstr "Paid add-on must be deployed to Freemius."
1496
-
1497
- #: includes/i18n.php:428
1498
- msgid "%s is a premium only add-on. You have to purchase a license first before activating the plugin."
1499
- msgstr "%s is a premium only add-on. You have to purchase a license first before activating the plugin."
1500
-
1501
- #: includes/i18n.php:429
1502
- msgid "%s free trial was successfully cancelled. Since the add-on is premium only it was automatically deactivated. If you like to use it in the future, you'll have to purchase a license."
1503
- msgstr "%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."
1504
-
1505
- #: includes/i18n.php:434
1506
- msgctxt "as every month"
1507
- msgid "Monthly"
1508
- msgstr "Monthly"
1509
-
1510
- #: includes/i18n.php:435
1511
- msgctxt "as monthly period"
1512
- msgid "mo"
1513
- msgstr "mo"
1514
-
1515
- #: includes/i18n.php:436
1516
- msgctxt "as once a year"
1517
- msgid "Annual"
1518
- msgstr "Annual"
1519
-
1520
- #: includes/i18n.php:437
1521
- msgctxt "as once a year"
1522
- msgid "Annually"
1523
- msgstr "Annually"
1524
-
1525
- #: includes/i18n.php:438
1526
- msgctxt "as once a year"
1527
- msgid "Once"
1528
- msgstr "Once"
1529
-
1530
- #: includes/i18n.php:439
1531
- msgctxt "as annual period"
1532
- msgid "year"
1533
- msgstr "year"
1534
-
1535
- #: includes/i18n.php:440
1536
- msgid "Lifetime"
1537
- msgstr "Lifetime"
1538
-
1539
- #: includes/i18n.php:441
1540
- msgctxt "e.g. the best product"
1541
- msgid "Best"
1542
- msgstr "Best"
1543
-
1544
- #: includes/i18n.php:442
1545
- msgctxt "e.g. billed monthly"
1546
- msgid "Billed %s"
1547
- msgstr "Billed %s"
1548
-
1549
- #: includes/i18n.php:443
1550
- msgctxt "as a discount of $5 or 10%"
1551
- msgid "Save %s"
1552
- msgstr "Save %s"
1553
-
1554
- #: includes/i18n.php:445
1555
- msgid "View details"
1556
- msgstr "View details"
1557
-
1558
- #: includes/i18n.php:449
1559
- msgctxt "button label"
1560
- msgid "Approve & Start Trial"
1561
- msgstr "Approve & Start Trial"
1562
-
1563
- #: includes/i18n.php:451
1564
- msgid "You are 1-click away from starting your %1$s-day free trial of the %2$s plan."
1565
- msgstr "You are 1-click away from starting your %1$s-day free trial of the %2$s plan."
1566
-
1567
- #: includes/i18n.php:453
1568
- msgid "For compliance with the WordPress.org guidelines, before we start the trial we ask that you opt-in with your user and non-sensitive site information, allowing the plugin to periodically send data to %s to check for version updates and to validate your trial."
1569
- msgstr "For compliance with the WordPress.org guidelines, before we start the trial we ask that you opt-in with your user and non-sensitive site information, allowing the plugin to periodically send data to %s to check for version updates and to validate your trial."
1570
-
1571
- #: includes/i18n.php:459
1572
- msgid "Business name"
1573
- msgstr "Business name"
1574
-
1575
- #: includes/i18n.php:460
1576
- msgid "Tax / VAT ID"
1577
- msgstr "Tax / VAT ID"
1578
-
1579
- #: includes/i18n.php:461
1580
- msgid "Address Line %d"
1581
- msgstr "Address Line %d"
1582
-
1583
- #: includes/i18n.php:462
1584
- msgid "Country"
1585
- msgstr "Country"
1586
-
1587
- #: includes/i18n.php:463
1588
- msgid "Select Country"
1589
- msgstr "Select Country"
1590
-
1591
- #: includes/i18n.php:464
1592
- msgid "City"
1593
- msgstr "City"
1594
-
1595
- #: includes/i18n.php:465
1596
- msgid "Town"
1597
- msgstr "Town"
1598
-
1599
- #: includes/i18n.php:466
1600
- msgid "State"
1601
- msgstr "State"
1602
-
1603
- #: includes/i18n.php:467
1604
- msgid "Province"
1605
- msgstr "Province"
1606
-
1607
- #: includes/i18n.php:468
1608
- msgid "ZIP / Postal Code"
1609
- msgstr "ZIP / Postal Code"
1610
-
1611
- #: includes/i18n.php:473
1612
- msgid "Installing plugin: %s"
1613
- msgstr "Installing plugin: %s"
1614
-
1615
- #: includes/i18n.php:474
1616
- msgid "Automatic Installation"
1617
- msgstr "Automatic Installation"
1618
-
1619
- #: includes/i18n.php:476
1620
- msgid "%s sec"
1621
- msgstr "%s sec"
1622
-
1623
- #: includes/i18n.php:477
1624
- msgid "An automated download and installation of %s (paid version) from %s will start in %s. If you would like to do it manually - click the cancellation button now."
1625
- msgstr "An automated download and installation of %s (paid version) from %s will start in %s. If you would like to do it manually - click the cancellation button now."
1626
-
1627
- #: includes/i18n.php:478
1628
- msgid "The installation process has started and may take a few minutes to complete. Please wait until it is done - do not refresh this page."
1629
- msgstr "The installation process has started and may take a few minutes to complete. Please wait until it is done - do not refresh this page."
1630
-
1631
- #: includes/i18n.php:479
1632
- msgid "Cancel Installation"
1633
- msgstr "Cancel Installation"
1634
-
1635
- #: includes/i18n.php:480
1636
- msgid "The remote plugin package does not contain a folder with the desired slug and renaming did not work."
1637
- msgstr "The remote plugin package does not contain a folder with the desired slug and renaming did not work."
1638
-
1639
- #: includes/i18n.php:481
1640
- msgid "Invalid module ID."
1641
- msgstr "Invalid module ID."
1642
-
1643
- #: includes/i18n.php:482
1644
- msgid "Auto installation only works for opted-in users."
1645
- msgstr "Auto installation only works for opted-in users."
1646
-
1647
- #: includes/i18n.php:483
1648
- msgid "Premium version already active."
1649
- msgstr "Premium version already active."
1650
-
1651
- #: includes/i18n.php:484
1652
- msgid "Premium add-on version already installed."
1653
- msgstr "Premium add-on version already installed."
1654
-
1655
- #: includes/i18n.php:485
1656
- msgid "You do not have a valid license to access the premium version."
1657
- msgstr "You do not have a valid license to access the premium version."
1658
-
1659
- #: includes/i18n.php:486
1660
- msgid "Plugin is a \"Serviceware\" which means it does not have a premium code version."
1661
- msgstr "Plugin is a \"Serviceware\" which means it does not have a premium code version."
1662
-
1663
- #: includes/i18n.php:501
1664
- msgctxt "Plugin installer section title"
1665
- msgid "Description"
1666
- msgstr "Description"
1667
-
1668
- #: includes/i18n.php:502
1669
- msgctxt "Plugin installer section title"
1670
- msgid "Installation"
1671
- msgstr "Installation"
1672
-
1673
- #: includes/i18n.php:503
1674
- msgctxt "Plugin installer section title"
1675
- msgid "FAQ"
1676
- msgstr "FAQ"
1677
-
1678
- #: includes/i18n.php:504
1679
- msgctxt "Plugin installer section title"
1680
- msgid "Changelog"
1681
- msgstr "Changelog"
1682
-
1683
- #: includes/i18n.php:505
1684
- msgctxt "Plugin installer section title"
1685
- msgid "Reviews"
1686
- msgstr "Reviews"
1687
-
1688
- #: includes/i18n.php:506
1689
- msgctxt "Plugin installer section title"
1690
- msgid "Other Notes"
1691
- msgstr "Other Notes"
1692
-
1693
- #: includes/i18n.php:508
1694
- msgid "%s star"
1695
- msgstr "%s star"
1696
-
1697
- #: includes/i18n.php:510
1698
- msgid "%s stars"
1699
- msgstr "%s stars"
1700
-
1701
- #: includes/i18n.php:512
1702
- msgid "%s rating"
1703
- msgstr "%s rating"
1704
-
1705
- #: includes/i18n.php:514
1706
- msgid "%s ratings"
1707
- msgstr "%s ratings"
1708
-
1709
- #: includes/i18n.php:516
1710
- msgid "%s time"
1711
- msgstr "%s time"
1712
-
1713
- #: includes/i18n.php:518
1714
- msgid "%s times"
1715
- msgstr "%s times"
1716
-
1717
- #: includes/i18n.php:520
1718
- msgid "Click to see reviews that provided a rating of %s"
1719
- msgstr "Click to see reviews that provided a rating of %s"
1720
-
1721
- #: includes/i18n.php:521
1722
- msgid "Last Updated"
1723
- msgstr "Last Updated"
1724
-
1725
- #: includes/i18n.php:522
1726
- msgid "Requires WordPress Version:"
1727
- msgstr "Requires WordPress Version:"
1728
-
1729
- #: includes/i18n.php:523
1730
- msgctxt "as the plugin author"
1731
- msgid "Author:"
1732
- msgstr "Author:"
1733
-
1734
- #: includes/i18n.php:524
1735
- msgid "Compatible up to:"
1736
- msgstr "Compatible up to:"
1737
-
1738
- #: includes/i18n.php:525
1739
- msgid "Downloaded:"
1740
- msgstr "Downloaded:"
1741
-
1742
- #: includes/i18n.php:526
1743
- msgid "WordPress.org Plugin Page"
1744
- msgstr "WordPress.org Plugin Page"
1745
-
1746
- #: includes/i18n.php:527
1747
- msgid "Plugin Homepage"
1748
- msgstr "Plugin Homepage"
1749
-
1750
- #: includes/i18n.php:528
1751
- msgid "Donate to this plugin"
1752
- msgstr "Donate to this plugin"
1753
-
1754
- #: includes/i18n.php:529
1755
- msgid "Average Rating"
1756
- msgstr "Average Rating"
1757
-
1758
- #: includes/i18n.php:530
1759
- msgid "based on %s"
1760
- msgstr "based on %s"
1761
-
1762
- #: includes/i18n.php:531
1763
- msgid "Warning:"
1764
- msgstr "Warning:"
1765
-
1766
- #: includes/i18n.php:532
1767
- msgid "Contributors"
1768
- msgstr "Contributors"
1769
-
1770
- #: includes/i18n.php:533
1771
- msgid "Plugin Install"
1772
- msgstr "Plugin Install"
1773
-
1774
- #: includes/i18n.php:534
1775
- msgid "This plugin has not been tested with your current version of WordPress."
1776
- msgstr "This plugin has not been tested with your current version of WordPress."
1777
-
1778
- #: includes/i18n.php:535
1779
- msgid "This plugin has not been marked as compatible with your version of WordPress."
1780
- msgstr "This plugin has not been marked as compatible with your version of WordPress."
1781
-
1782
- #: includes/i18n.php:536
1783
- msgid "Newer Version (%s) Installed"
1784
- msgstr "Newer Version (%s) Installed"
1785
-
1786
- #: includes/i18n.php:537
1787
- msgid "Latest Version Installed"
1788
- msgstr "Latest Version Installed"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/languages/freemius-he.mo DELETED
Binary file
freemius/languages/freemius-he.po DELETED
@@ -1,1791 +0,0 @@
1
- # Copyright (C) 2017 freemius
2
- # This file is distributed under the same license as the freemius package.
3
- # Translators:
4
- # Rami Yushuvaev <r_a_m_i@hotmail.com>, 2017
5
- # Vova Feldman <vova@freemius.com>, 2016
6
- msgid ""
7
- msgstr ""
8
- "Project-Id-Version: WordPress SDK\n"
9
- "Report-Msgid-Bugs-To: https://github.com/Freemius/wordpress-sdk/issues\n"
10
- "POT-Creation-Date: \n"
11
- "PO-Revision-Date: 2017-05-12 17:32+0000\n"
12
- "Last-Translator: Vova Feldman <vova@freemius.com>\n"
13
- "Language: he\n"
14
- "Language-Team: Hebrew (http://www.transifex.com/freemius/wordpress-sdk/language/he/)\n"
15
- "Content-Type: text/plain; charset=UTF-8\n"
16
- "Content-Transfer-Encoding: 8bit\n"
17
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
- "MIME-Version: 1.0\n"
19
- "X-Poedit-Basepath: ..\n"
20
- "X-Poedit-KeywordsList: _fs_text;_fs_echo;_fs_esc_attr;_fs_esc_attr_echo;_fs_esc_html;_fs_esc_html_echo;_fs_x:1,2c;_fs_ex:1,2c;_fs_esc_attr_x:1,2c;_fs_esc_html_x:1,2c;_fs_n:1,2;_fs_n_noop:1,2;_fs_nx:1,2,4c;_fs_nx_noop:1,2,3c\n"
21
- "X-Poedit-SearchPath-0: .\n"
22
- "X-Poedit-SearchPathExcluded-0: *.js\n"
23
- "X-Poedit-SourceCharset: UTF-8\n"
24
-
25
- #: includes/i18n.php:37
26
- msgid "Account"
27
- msgstr "חשבון"
28
-
29
- #: includes/i18n.php:38
30
- msgid "Add On"
31
- msgstr "הרחבה"
32
-
33
- #: includes/i18n.php:39
34
- msgid "Contact Us"
35
- msgstr "יצירת קשר"
36
-
37
- #: includes/i18n.php:40
38
- msgid "Contact Support"
39
- msgstr "צור קשר"
40
-
41
- #: includes/i18n.php:41
42
- msgid "Change Ownership"
43
- msgstr "עדכון בעלות"
44
-
45
- #: includes/i18n.php:42
46
- msgid "Support"
47
- msgstr "תמיכה"
48
-
49
- #: includes/i18n.php:43
50
- msgid "Support Forum"
51
- msgstr "פורום תמיכה"
52
-
53
- #: includes/i18n.php:44
54
- msgid "Add Ons"
55
- msgstr "הרחבות"
56
-
57
- #: includes/i18n.php:45
58
- msgctxt "verb"
59
- msgid "Upgrade"
60
- msgstr "שדרג"
61
-
62
- #: includes/i18n.php:46
63
- msgid "Awesome"
64
- msgstr "אדיר"
65
-
66
- #: includes/i18n.php:47
67
- msgctxt "noun"
68
- msgid "Pricing"
69
- msgstr "מחירון"
70
-
71
- #: includes/i18n.php:48
72
- msgctxt "noun"
73
- msgid "Price"
74
- msgstr "מחיר"
75
-
76
- #: includes/i18n.php:49
77
- msgid "Unlimited Updates"
78
- msgstr "עדכונים ללא הגבלה"
79
-
80
- #: includes/i18n.php:50
81
- msgctxt "verb"
82
- msgid "Downgrade"
83
- msgstr "שנמך"
84
-
85
- #: includes/i18n.php:51
86
- msgctxt "verb"
87
- msgid "Cancel Subscription"
88
- msgstr "Cancel Subscription"
89
-
90
- #: includes/i18n.php:52
91
- msgid "Cancel Trial"
92
- msgstr "ביט"
93
-
94
- #: includes/i18n.php:53
95
- msgid "Free Trial"
96
- msgstr "ניסיון חינם"
97
-
98
- #: includes/i18n.php:54
99
- msgid "Start my free %s"
100
- msgstr "התחל את %s הניסיון שלי"
101
-
102
- #: includes/i18n.php:55
103
- msgid "No commitment for %s - cancel anytime"
104
- msgstr "No commitment for %s - cancel anytime"
105
-
106
- #: includes/i18n.php:56
107
- msgid "After your free %s, pay as little as %s"
108
- msgstr "After your free %s, pay as little as %s"
109
-
110
- #: includes/i18n.php:57
111
- msgid "Details"
112
- msgstr "פרטים"
113
-
114
- #: includes/i18n.php:58
115
- msgid "Account Details"
116
- msgstr "פרטי חשבון"
117
-
118
- #: includes/i18n.php:59
119
- msgctxt "verb"
120
- msgid "Delete"
121
- msgstr "מחק"
122
-
123
- #: includes/i18n.php:60
124
- msgctxt "verb"
125
- msgid "Show"
126
- msgstr "הצג"
127
-
128
- #: includes/i18n.php:61
129
- msgctxt "verb"
130
- msgid "Hide"
131
- msgstr "הסתר"
132
-
133
- #: includes/i18n.php:62
134
- msgctxt "verb"
135
- msgid "Edit"
136
- msgstr "ערוך"
137
-
138
- #: includes/i18n.php:63
139
- msgctxt "verb"
140
- msgid "Update"
141
- msgstr "עדכן"
142
-
143
- #: includes/i18n.php:64
144
- msgid "Date"
145
- msgstr "תאריך"
146
-
147
- #: includes/i18n.php:65
148
- msgid "Amount"
149
- msgstr "סכום"
150
-
151
- #: includes/i18n.php:66
152
- msgid "Invoice"
153
- msgstr "חשבונית"
154
-
155
- #: includes/i18n.php:67
156
- msgid "Billing"
157
- msgstr "בילינג"
158
-
159
- #: includes/i18n.php:68
160
- msgid "Payments"
161
- msgstr "תשלומים"
162
-
163
- #: includes/i18n.php:69
164
- msgid "Delete Account"
165
- msgstr "מחיקת חשבון"
166
-
167
- #: includes/i18n.php:70
168
- msgctxt "as close a window"
169
- msgid "Dismiss"
170
- msgstr "סגירה"
171
-
172
- #: includes/i18n.php:71
173
- msgctxt "as product pricing plan"
174
- msgid "Plan"
175
- msgstr "חבילה"
176
-
177
- #: includes/i18n.php:72
178
- msgid "Change Plan"
179
- msgstr "שינוי חבילה"
180
-
181
- #: includes/i18n.php:73
182
- msgctxt "as download professional version"
183
- msgid "Download %s Version"
184
- msgstr "הורד גרסת %s"
185
-
186
- #: includes/i18n.php:74
187
- msgctxt "as download professional version now"
188
- msgid "Download %s version now"
189
- msgstr "הורד עכשיו גרסת %s"
190
-
191
- #: includes/i18n.php:75
192
- msgctxt "as download latest version"
193
- msgid "Download Latest"
194
- msgstr "הורד גרסה אחרונה"
195
-
196
- #: includes/i18n.php:76
197
- msgctxt "E.g. you have a professional license."
198
- msgid "You have a %s license."
199
- msgstr "יש לך רישיון %s."
200
-
201
- #: includes/i18n.php:77
202
- msgid "New"
203
- msgstr "חדש"
204
-
205
- #: includes/i18n.php:78
206
- msgid "Free"
207
- msgstr "חינם"
208
-
209
- #: includes/i18n.php:79
210
- msgctxt "as trial plan"
211
- msgid "Trial"
212
- msgstr "ניסיון"
213
-
214
- #: includes/i18n.php:80
215
- msgctxt "as starting a trial plan"
216
- msgid "Start Trial"
217
- msgstr "התחל תקופת ניסיון"
218
-
219
- #: includes/i18n.php:81
220
- msgctxt "verb"
221
- msgid "Purchase"
222
- msgstr "רכישה"
223
-
224
- #: includes/i18n.php:82
225
- msgid "Purchase License"
226
- msgstr "קניית רישיון"
227
-
228
- #: includes/i18n.php:83
229
- msgctxt "verb"
230
- msgid "Buy"
231
- msgstr "קנייה"
232
-
233
- #: includes/i18n.php:84
234
- msgid "Buy License"
235
- msgstr "קניית רישיון"
236
-
237
- #: includes/i18n.php:85
238
- msgid "Single Site License"
239
- msgstr "רשיון לאתר אחד"
240
-
241
- #: includes/i18n.php:86
242
- msgid "Unlimited Licenses"
243
- msgstr "רשיונות ללא הגבלה"
244
-
245
- #: includes/i18n.php:87
246
- msgid "Up to %s Sites"
247
- msgstr "עד %s אתרים"
248
-
249
- #: includes/i18n.php:88
250
- msgid "%sRenew your license now%s to access version %s features and support."
251
- msgstr "%sRenew your license now%s to access version %s features and support."
252
-
253
- #: includes/i18n.php:89
254
- msgid "Enter the email address you've used for the upgrade below and we will resend you the license key."
255
- msgstr "Enter the email address you've used for the upgrade below and we will resend you the license key."
256
-
257
- #: includes/i18n.php:90
258
- msgctxt "e.g. Professional Plan"
259
- msgid "%s Plan"
260
- msgstr "חבילה %s"
261
-
262
- #: includes/i18n.php:91
263
- msgid "You are just one step away - %s"
264
- msgstr "You are just one step away - %s"
265
-
266
- #: includes/i18n.php:92
267
- msgctxt "%s - plugin name. As complete \"Jetpack\" activation now"
268
- msgid "Complete \"%s\" Activation Now"
269
- msgstr "השלם הפעלת \"%s\" עכשיו"
270
-
271
- #: includes/i18n.php:94
272
- msgid "We made a few tweaks to the plugin, %s"
273
- msgstr "ביצענו מספר שינויים לתוסף, %s"
274
-
275
- #: includes/i18n.php:95
276
- msgid "Opt-in to make \"%s\" Better!"
277
- msgstr "Opt-in to make \"%s\" Better!"
278
-
279
- #: includes/i18n.php:96
280
- msgid "Error"
281
- msgstr "שגיאה"
282
-
283
- #: includes/i18n.php:97
284
- msgid "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
285
- msgstr "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
286
-
287
- #: includes/i18n.php:100
288
- msgctxt "as expiration date"
289
- msgid "Expiration"
290
- msgstr "תפוגה"
291
-
292
- #: includes/i18n.php:101
293
- msgctxt "as software license"
294
- msgid "License"
295
- msgstr "רישיון"
296
-
297
- #: includes/i18n.php:102
298
- msgid "not verified"
299
- msgstr "לא מאומת"
300
-
301
- #: includes/i18n.php:103
302
- msgid "Verify Email"
303
- msgstr "אמת כתובת דוא\"ל"
304
-
305
- #: includes/i18n.php:104
306
- msgctxt "e.g. expires in 2 months"
307
- msgid "Expires in %s"
308
- msgstr "פג תוקף בעוד %s"
309
-
310
- #: includes/i18n.php:105
311
- msgctxt "e.g. auto renews in 2 months"
312
- msgid "Auto renews in %s"
313
- msgstr "עדכן אוטומטית בעוד %s"
314
-
315
- #: includes/i18n.php:106
316
- msgid "No expiration"
317
- msgstr "ללא תפוגה"
318
-
319
- #: includes/i18n.php:107
320
- msgid "Expired"
321
- msgstr "פג תוקף"
322
-
323
- #: includes/i18n.php:108
324
- msgid "Cancelled"
325
- msgstr "בוטל"
326
-
327
- #: includes/i18n.php:109
328
- msgctxt "e.g. In 2 hours"
329
- msgid "In %s"
330
- msgstr "בעוד %s"
331
-
332
- #: includes/i18n.php:110
333
- msgctxt "e.g. 2 min ago"
334
- msgid "%s ago"
335
- msgstr "לפני %s"
336
-
337
- #: includes/i18n.php:112
338
- msgid "%s or higher"
339
- msgstr "%s ומעלה"
340
-
341
- #: includes/i18n.php:113
342
- msgctxt "as plugin version"
343
- msgid "Version"
344
- msgstr "גרסה"
345
-
346
- #: includes/i18n.php:114
347
- msgid "Name"
348
- msgstr "שם"
349
-
350
- #: includes/i18n.php:115
351
- msgid "Email"
352
- msgstr "דוא\"ל"
353
-
354
- #: includes/i18n.php:116
355
- msgid "Email address"
356
- msgstr "כתובת דוא\"ל"
357
-
358
- #: includes/i18n.php:117
359
- msgid "Verified"
360
- msgstr "מאומת"
361
-
362
- #: includes/i18n.php:118
363
- msgid "Module"
364
- msgstr "מודול"
365
-
366
- #: includes/i18n.php:119
367
- msgid "Module Type"
368
- msgstr "סוג מודול"
369
-
370
- #: includes/i18n.php:120
371
- msgid "Plugin"
372
- msgstr "תוסף"
373
-
374
- #: includes/i18n.php:121
375
- msgid "Plugins"
376
- msgstr "תוספים"
377
-
378
- #: includes/i18n.php:122
379
- msgid "Theme"
380
- msgstr "תבנית"
381
-
382
- #: includes/i18n.php:123
383
- msgid "Themes"
384
- msgstr "תבניות"
385
-
386
- #: includes/i18n.php:124
387
- msgctxt "as file/folder path"
388
- msgid "Path"
389
- msgstr "נתיב"
390
-
391
- #: includes/i18n.php:125
392
- msgid "Title"
393
- msgstr "כותרת"
394
-
395
- #: includes/i18n.php:126
396
- msgid "Free version"
397
- msgstr "גירסה חינאמית"
398
-
399
- #: includes/i18n.php:127
400
- msgid "Premium version"
401
- msgstr "גירסת פרימיום"
402
-
403
- #: includes/i18n.php:128
404
- msgctxt "as WP plugin slug"
405
- msgid "Slug"
406
- msgstr "מזהה כתובת"
407
-
408
- #: includes/i18n.php:129
409
- msgid "ID"
410
- msgstr "מזהה"
411
-
412
- #: includes/i18n.php:130
413
- msgid "Users"
414
- msgstr "משתמשים"
415
-
416
- #: includes/i18n.php:131
417
- msgid "Plugin Installs"
418
- msgstr "התקנות תוסף"
419
-
420
- #: includes/i18n.php:132
421
- msgid "%s Installs"
422
- msgstr "%s התקנות"
423
-
424
- #: includes/i18n.php:133
425
- msgctxt "like websites"
426
- msgid "Sites"
427
- msgstr "אתרים"
428
-
429
- #: includes/i18n.php:134
430
- msgid "User ID"
431
- msgstr "מזהה משתמש"
432
-
433
- #: includes/i18n.php:135
434
- msgid "Site ID"
435
- msgstr "מזהה אתר"
436
-
437
- #: includes/i18n.php:136
438
- msgid "Public Key"
439
- msgstr "מפתח פומבי"
440
-
441
- #: includes/i18n.php:137
442
- msgid "Secret Key"
443
- msgstr "מפתח סודי"
444
-
445
- #: includes/i18n.php:138
446
- msgctxt "as secret encryption key missing"
447
- msgid "No Secret"
448
- msgstr "אין מפתח סודי"
449
-
450
- #: includes/i18n.php:139
451
- msgid "No ID"
452
- msgstr "אין מזהה"
453
-
454
- #: includes/i18n.php:140
455
- msgctxt "as synchronize license"
456
- msgid "Sync License"
457
- msgstr "סינכרן רישיון"
458
-
459
- #: includes/i18n.php:141
460
- msgctxt "as synchronize"
461
- msgid "Sync"
462
- msgstr "סינכרון"
463
-
464
- #: includes/i18n.php:142
465
- msgid "Activate License"
466
- msgstr "הפעלת רישיון"
467
-
468
- #: includes/i18n.php:143
469
- msgid "Activate Free Version"
470
- msgstr "הפעלת גירסה חינאמית"
471
-
472
- #: includes/i18n.php:144
473
- msgid "Please enter the license key that you received in the email right after the purchase:"
474
- msgstr "Please enter the license key that you received in the email right after the purchase:"
475
-
476
- #: includes/i18n.php:145
477
- msgid "Activating license..."
478
- msgstr "מפעיל רישיון..."
479
-
480
- #: includes/i18n.php:146
481
- msgid "Change License"
482
- msgstr "שינוי רישיון"
483
-
484
- #: includes/i18n.php:147
485
- msgid "Update License"
486
- msgstr "עדכון רישיון"
487
-
488
- #: includes/i18n.php:148
489
- msgid "Deactivate License"
490
- msgstr "שיחרור רישיון"
491
-
492
- #: includes/i18n.php:149
493
- msgid "Activate"
494
- msgstr "הפעלה"
495
-
496
- #: includes/i18n.php:150
497
- msgid "Deactivate"
498
- msgstr "כיבוי"
499
-
500
- #: includes/i18n.php:151
501
- msgid "Skip & Deactivate"
502
- msgstr "דלג והמשך כיבוי"
503
-
504
- #: includes/i18n.php:152
505
- msgid "Skip & %s"
506
- msgstr "דלג ו%s"
507
-
508
- #: includes/i18n.php:153
509
- msgid "No - just deactivate"
510
- msgstr "לא - פשוט כבה"
511
-
512
- #: includes/i18n.php:154
513
- msgid "Yes - do your thing"
514
- msgstr "כן - בצעו את מה שצריך"
515
-
516
- #: includes/i18n.php:155
517
- msgctxt "active mode"
518
- msgid "Active"
519
- msgstr "מופעל"
520
-
521
- #: includes/i18n.php:156
522
- msgctxt "is active mode?"
523
- msgid "Is Active"
524
- msgstr "האם פעיל"
525
-
526
- #: includes/i18n.php:157
527
- msgid "Install Now"
528
- msgstr "התקן עכשיו"
529
-
530
- #: includes/i18n.php:158
531
- msgid "Install Update Now"
532
- msgstr "התקן עדכון במיידי"
533
-
534
- #: includes/i18n.php:159
535
- msgid "More information about %s"
536
- msgstr "מידע נוסף אודות %s"
537
-
538
- #: includes/i18n.php:160
539
- msgid "Localhost"
540
- msgstr "שרת לוקאלי"
541
-
542
- #: includes/i18n.php:161
543
- msgctxt "as activate Professional plan"
544
- msgid "Activate %s Plan"
545
- msgstr "הפעל חבילה %s"
546
-
547
- #: includes/i18n.php:162
548
- msgctxt "as 5 licenses left"
549
- msgid "%s left"
550
- msgstr "נשארו %s"
551
-
552
- #: includes/i18n.php:163
553
- msgid "Last license"
554
- msgstr "רישיון אחרון"
555
-
556
- #: includes/i18n.php:164
557
- msgid "What is your %s?"
558
- msgstr "מה ה%s שלך?"
559
-
560
- #: includes/i18n.php:165
561
- msgid "Activate this add-on"
562
- msgstr "הפעל את ההרחבה"
563
-
564
- #: includes/i18n.php:166
565
- msgid "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?"
566
- msgstr "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?"
567
-
568
- #: includes/i18n.php:167
569
- msgid "Deleting the account will automatically deactivate your %s plan license so you can use it on other sites. If you want to terminate the recurring payments as well, click the \"Cancel\" button, and first \"Downgrade\" your account. Are you sure you would like to continue with the deletion?"
570
- msgstr "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?"
571
-
572
- #: includes/i18n.php:168
573
- msgid "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?"
574
- msgstr "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?"
575
-
576
- #: includes/i18n.php:169
577
- msgid "Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s."
578
- msgstr "Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s."
579
-
580
- #: includes/i18n.php:170
581
- msgid "Cancelling the trial will immediately block access to all premium features. Are you sure?"
582
- msgstr "Cancelling the trial will immediately block access to all premium features. Are you sure?"
583
-
584
- #: includes/i18n.php:171
585
- msgid "You can still enjoy all %s features but you will not have access to plugin updates and support."
586
- msgstr "You can still enjoy all %s features but you will not have access to plugin updates and support."
587
-
588
- #: includes/i18n.php:172
589
- msgid "Once your license expires you can still use the Free version but you will NOT have access to the %s features."
590
- msgstr "Once your license expires you can still use the Free version but you will NOT have access to the %s features."
591
-
592
- #: includes/i18n.php:173
593
- msgid "Are you sure you want to proceed?"
594
- msgstr "האם את/ה בטוח רוצה להמשיך?"
595
-
596
- #: includes/i18n.php:176
597
- msgid "Add Ons for %s"
598
- msgstr "הרחבות עבור %s"
599
-
600
- #: includes/i18n.php:177
601
- msgid "We could'nt load the add-ons list. It's probably an issue on our side, please try to come back in few minutes."
602
- msgstr "We could'nt load the add-ons list. It's probably an issue on our side, please try to come back in few minutes."
603
-
604
- #: includes/i18n.php:179
605
- msgid "Anonymous feedback"
606
- msgstr "פידבק אנונימי"
607
-
608
- #: includes/i18n.php:180
609
- msgid "Quick feedback"
610
- msgstr "פידבק זריז"
611
-
612
- #: includes/i18n.php:181
613
- msgid "If you have a moment, please let us know why you are deactivating"
614
- msgstr "If you have a moment, please let us know why you are deactivating"
615
-
616
- #: includes/i18n.php:182
617
- msgid "Yes - Deactivate"
618
- msgstr "כן - "
619
-
620
- #: includes/i18n.php:183
621
- msgid "Submit & Deactivate"
622
- msgstr "שלח וכבה"
623
-
624
- #: includes/i18n.php:184
625
- msgid "Cancel"
626
- msgstr "בטל"
627
-
628
- #: includes/i18n.php:185
629
- msgid "I no longer need the plugin"
630
- msgstr "אין לי צורך יותר בתוסף"
631
-
632
- #: includes/i18n.php:186
633
- msgid "I found a better plugin"
634
- msgstr "מצאתי תוסף טוב יותר"
635
-
636
- #: includes/i18n.php:187
637
- msgid "I only needed the plugin for a short period"
638
- msgstr "השתמשתי בתוסף לתקופה קצרה"
639
-
640
- #: includes/i18n.php:188
641
- msgid "The plugin broke my site"
642
- msgstr "התוסף הרס לי את האתר"
643
-
644
- #: includes/i18n.php:189
645
- msgid "The plugin suddenly stopped working"
646
- msgstr "התוסף לפתע הפסיק לעבוד"
647
-
648
- #: includes/i18n.php:190
649
- msgid "I can't pay for it anymore"
650
- msgstr "אני לא יכול/ה להמשיך לשלם על זה"
651
-
652
- #: includes/i18n.php:191
653
- msgid "It's a temporary deactivation. I'm just debugging an issue."
654
- msgstr "כיבוי זמני לשם דיבאג."
655
-
656
- #: includes/i18n.php:192
657
- msgctxt ""
658
- msgid "Other"
659
- msgstr "אחר"
660
-
661
- #: includes/i18n.php:194
662
- msgid "Kindly tell us the reason so we can improve."
663
- msgstr "אנא שתף את הסיבה כדי שנוכל להשתפר."
664
-
665
- #: includes/i18n.php:195
666
- msgid "What's the plugin's name?"
667
- msgstr "מהו שם התוסף?"
668
-
669
- #: includes/i18n.php:196
670
- msgid "What price would you feel comfortable paying?"
671
- msgstr "מה המחיר שכן תרגיש\\י בנוח לשלם?"
672
-
673
- #: includes/i18n.php:197
674
- msgid "I couldn't understand how to make it work"
675
- msgstr "לא הצלחתי להבין איך לגרום לזה לעבוד"
676
-
677
- #: includes/i18n.php:198
678
- msgid "The plugin is great, but I need specific feature that you don't support"
679
- msgstr "התוסף מעולה, אבל אני צריכ\\ה פיצ'ר ספציפי שלא נתמך"
680
-
681
- #: includes/i18n.php:199
682
- msgid "The plugin is not working"
683
- msgstr "התוסף לא עובד"
684
-
685
- #: includes/i18n.php:200
686
- msgid "It's not what I was looking for"
687
- msgstr "חיפשתי משהו אחר"
688
-
689
- #: includes/i18n.php:201
690
- msgid "The plugin didn't work as expected"
691
- msgstr "התוסף לא עבד כמצופה"
692
-
693
- #: includes/i18n.php:202
694
- msgid "What feature?"
695
- msgstr "איזה פיטצ'ר?"
696
-
697
- #: includes/i18n.php:203
698
- msgid "Kindly share what didn't work so we can fix it for future users..."
699
- msgstr "אנא שתפ\\י מה לא עבד כדי שנוכל לתקן זאת עבור משתמשים עתידיים..."
700
-
701
- #: includes/i18n.php:204
702
- msgid "What you've been looking for?"
703
- msgstr "מה חיפשת?"
704
-
705
- #: includes/i18n.php:205
706
- msgid "What did you expect?"
707
- msgstr "למה ציפית?"
708
-
709
- #: includes/i18n.php:206
710
- msgid "The plugin didn't work"
711
- msgstr "התוסף לא עבד"
712
-
713
- #: includes/i18n.php:207
714
- msgid "I don't like to share my information with you"
715
- msgstr "אני לא אוהב את הרעיון של שיתוף מידע איתכם"
716
-
717
- #: includes/i18n.php:208
718
- msgid "You might have missed it, but you don't have to share any data and can just %s the opt-in."
719
- msgstr "אולי פספסת את זה אבל אינך חייב\\ת לשתף כל מידע איתנו, ביכולתך %s על שיתוף המידע."
720
-
721
- #: includes/i18n.php:212
722
- msgctxt "greeting"
723
- msgid "Hey %s,"
724
- msgstr "היי %s,"
725
-
726
- #: includes/i18n.php:213
727
- msgctxt "a greeting. E.g. Thanks John!"
728
- msgid "Thanks %s!"
729
- msgstr "תודה %s!"
730
-
731
- #: includes/i18n.php:214
732
- msgid "Never miss an important update - opt-in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s."
733
- msgstr "Never miss an important update - opt-in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s."
734
-
735
- #: includes/i18n.php:215
736
- msgid "Please help us improve %1$s! If you opt-in, some data about your usage of %1$s will be sent to %4$s. If you skip this, that's okay! %1$s will still work just fine."
737
- msgstr "Please help us improve %1$s! If you opt-in, some data about your usage of %1$s will be sent to %4$s. If you skip this, that's okay! %1$s will still work just fine."
738
-
739
- #: includes/i18n.php:216
740
- msgid "You should receive an activation email for %s to your mailbox at %s. Please make sure you click the activation button in that email to %s."
741
- msgstr "You should receive an activation email for %s to your mailbox at %s. Please make sure you click the activation button in that email to %s."
742
-
743
- #: includes/i18n.php:217
744
- msgid "complete the install"
745
- msgstr "השלם התקנה"
746
-
747
- #: includes/i18n.php:218
748
- msgid "start the trial"
749
- msgstr "התחל תקופת ניסיון"
750
-
751
- #: includes/i18n.php:219
752
- msgid "Thanks for purchasing %s! To get started, please enter your license key:"
753
- msgstr "Thanks for purchasing %s! To get started, please enter your license key:"
754
-
755
- #: includes/i18n.php:220
756
- msgid "The plugin will be periodically sending data to %s to check for plugin updates and verify the validity of your license."
757
- msgstr "The plugin will be periodically sending data to %s to check for plugin updates and verify the validity of your license."
758
-
759
- #: includes/i18n.php:221
760
- msgid "What permissions are being granted?"
761
- msgstr "מהן ההרשאות המוענקות?"
762
-
763
- #: includes/i18n.php:222
764
- msgid "Your Profile Overview"
765
- msgstr "פרטים כלליים על הפרופיל"
766
-
767
- #: includes/i18n.php:223
768
- msgid "Name and email address"
769
- msgstr "שם וכתובת דו\"אל"
770
-
771
- #: includes/i18n.php:224
772
- msgid "Your Site Overview"
773
- msgstr "פרטים כלליים על האתר"
774
-
775
- #: includes/i18n.php:225
776
- msgid "Site URL, WP version, PHP info, plugins & themes"
777
- msgstr "כתובת אתר, גרסת וורדפרס, פרטי PHP, תוספים ותבניות"
778
-
779
- #: includes/i18n.php:226
780
- msgid "Current Plugin Events"
781
- msgstr "שינויי מצב בתוסף הנוכחי"
782
-
783
- #: includes/i18n.php:227
784
- msgid "Activation, deactivation and uninstall"
785
- msgstr "הפעלה, כיבוי והסרה"
786
-
787
- #: includes/i18n.php:228
788
- msgid "Plugins & Themes"
789
- msgstr "תוספים ותבניות"
790
-
791
- #: includes/i18n.php:229
792
- msgid "Titles, versions and state."
793
- msgstr "שמות, גרסאות וסטאטוס."
794
-
795
- #: includes/i18n.php:230
796
- msgid "Admin Notices"
797
- msgstr "התראות מנהל"
798
-
799
- #: includes/i18n.php:231
800
- msgid "Newsletter"
801
- msgstr "ניוסלטר"
802
-
803
- #: includes/i18n.php:232
804
- msgid "Updates, announcements, marketing, no spam"
805
- msgstr "Updates, announcements, marketing, no spam"
806
-
807
- #: includes/i18n.php:233
808
- msgid "Privacy Policy"
809
- msgstr "מדיניות פרטיות"
810
-
811
- #: includes/i18n.php:234
812
- msgid "Terms of Service"
813
- msgstr "תנאי השירות"
814
-
815
- #: includes/i18n.php:235
816
- msgctxt "as activating plugin"
817
- msgid "Activating"
818
- msgstr "מפעיל"
819
-
820
- #: includes/i18n.php:236
821
- msgctxt "as in the process of sending an email"
822
- msgid "Sending email"
823
- msgstr "שולח דוא\"ל"
824
-
825
- #: includes/i18n.php:237
826
- msgctxt "button label"
827
- msgid "Allow & Continue"
828
- msgstr "אפשר\\י והמשכ\\י"
829
-
830
- #: includes/i18n.php:238
831
- msgctxt "button label"
832
- msgid "Agree & Activate License"
833
- msgstr "הסכמה והפעלת רישיון"
834
-
835
- #: includes/i18n.php:239
836
- msgctxt "verb"
837
- msgid "Skip"
838
- msgstr "דלג"
839
-
840
- #: includes/i18n.php:240
841
- msgid "Click here to use the plugin anonymously"
842
- msgstr "Click here to use the plugin anonymously"
843
-
844
- #: includes/i18n.php:241
845
- msgid "Re-send activation email"
846
- msgstr "שליחה חוזרת של מייל האקטיבציה"
847
-
848
- #: includes/i18n.php:242
849
- msgid "License key"
850
- msgstr "מפתח רישיון"
851
-
852
- #: includes/i18n.php:243
853
- msgid "Send License Key"
854
- msgstr "שליחת מפתח רישיון"
855
-
856
- #: includes/i18n.php:244
857
- msgid "Sending license key"
858
- msgstr "שולח מפתח רישיון"
859
-
860
- #: includes/i18n.php:245
861
- msgid "Have a license key?"
862
- msgstr "האם ברשותך רישיון?"
863
-
864
- #: includes/i18n.php:246
865
- msgid "Don't have a license key?"
866
- msgstr "האם אין ברשותך מפתח רישיון?"
867
-
868
- #: includes/i18n.php:247
869
- msgid "Can't find your license key?"
870
- msgstr "האם אינך מוצא את מפתח הרישיון?"
871
-
872
- #: includes/i18n.php:248
873
- msgid "We couldn't find your email address in the system, are you sure it's the right address?"
874
- msgstr "We couldn't find your email address in the system, are you sure it's the right address?"
875
-
876
- #: includes/i18n.php:249
877
- msgid "We can't see any active licenses associated with that email address, are you sure it's the right address?"
878
- msgstr "We can't see any active licenses associated with that email address, are you sure it's the right address?"
879
-
880
- #: includes/i18n.php:250
881
- msgid "Opt In"
882
- msgstr "Opt In"
883
-
884
- #: includes/i18n.php:251
885
- msgid "Opt Out"
886
- msgstr "Opt Out"
887
-
888
- #: includes/i18n.php:252
889
- msgid "On second thought - I want to continue helping"
890
- msgstr "במחשבה שנייה - אני רוצה להמשיך לעזור"
891
-
892
- #: includes/i18n.php:253
893
- msgid "Opting out..."
894
- msgstr "Opting out..."
895
-
896
- #: includes/i18n.php:254
897
- msgid "Opting in..."
898
- msgstr "Opting in..."
899
-
900
- #: includes/i18n.php:255
901
- msgid "We appreciate your help in making the %s better by letting us track some usage data."
902
- msgstr "We appreciate your help in making the %s better by letting us track some usage data."
903
-
904
- #: includes/i18n.php:256
905
- msgid "Usage tracking is done in the name of making %s better. Making a better user experience, prioritizing new features, and more good things. We'd really appreciate if you'll reconsider letting us continue with the tracking."
906
- msgstr "Usage tracking is done in the name of making %s better. Making a better user experience, prioritizing new features, and more good things. We'd really appreciate if you'll reconsider letting us continue with the tracking."
907
-
908
- #: includes/i18n.php:257
909
- msgid "By clicking \"Opt Out\", we will no longer be sending any data from %s to %s."
910
- msgstr "By clicking \"Opt Out\", we will no longer be sending any data from %s to %s."
911
-
912
- #: includes/i18n.php:261
913
- msgid "Screenshots"
914
- msgstr "צילומי מסך"
915
-
916
- #: includes/i18n.php:262
917
- msgid "Click to view full-size screenshot %d"
918
- msgstr "Click to view full-size screenshot %d"
919
-
920
- #: includes/i18n.php:266
921
- msgid "Freemius Debug"
922
- msgstr "Freemius Debug"
923
-
924
- #: includes/i18n.php:267
925
- msgctxt "as turned on"
926
- msgid "On"
927
- msgstr "דלוק"
928
-
929
- #: includes/i18n.php:268
930
- msgctxt "as turned off"
931
- msgid "Off"
932
- msgstr "כבוי"
933
-
934
- #: includes/i18n.php:269
935
- msgctxt "as code debugging"
936
- msgid "Debugging"
937
- msgstr "דיבוג"
938
-
939
- #: includes/i18n.php:270
940
- msgid "Freemius State"
941
- msgstr "Freemius State"
942
-
943
- #: includes/i18n.php:271
944
- msgctxt "as connection was successful"
945
- msgid "Connected"
946
- msgstr "מחובר"
947
-
948
- #: includes/i18n.php:272
949
- msgctxt "as connection blocked"
950
- msgid "Blocked"
951
- msgstr "חסום"
952
-
953
- #: includes/i18n.php:273
954
- msgctxt "as application program interface"
955
- msgid "API"
956
- msgstr "API"
957
-
958
- #: includes/i18n.php:274
959
- msgctxt "as software development kit versions"
960
- msgid "SDK"
961
- msgstr "SDK"
962
-
963
- #: includes/i18n.php:275
964
- msgctxt "as software development kit versions"
965
- msgid "SDK Versions"
966
- msgstr "גרסאות SDK"
967
-
968
- #: includes/i18n.php:276
969
- msgctxt "as plugin folder path"
970
- msgid "Plugin Path"
971
- msgstr "נתיב התוסף"
972
-
973
- #: includes/i18n.php:277
974
- msgctxt "as sdk path"
975
- msgid "SDK Path"
976
- msgstr "מיקום SDK"
977
-
978
- #: includes/i18n.php:278
979
- msgid "Add Ons of Plugin %s"
980
- msgstr "הרחבות עבור %s"
981
-
982
- #: includes/i18n.php:279
983
- msgid "Are you sure you want to delete all Freemius data?"
984
- msgstr "Are you sure you want to delete all Freemius data?"
985
-
986
- #: includes/i18n.php:280
987
- msgid "Actions"
988
- msgstr "פעולות"
989
-
990
- #: includes/i18n.php:281
991
- msgid "Delete All Accounts"
992
- msgstr "מחיקת כל החשבונות"
993
-
994
- #: includes/i18n.php:282
995
- msgid "Start Fresh"
996
- msgstr "התחל מחדש"
997
-
998
- #: includes/i18n.php:283
999
- msgid "Clear API Cache"
1000
- msgstr "ניקוי מטמון ה-API"
1001
-
1002
- #: includes/i18n.php:284
1003
- msgid "Sync Data From Server"
1004
- msgstr "סנכרון מידע מהשרת"
1005
-
1006
- #: includes/i18n.php:285
1007
- msgid "Scheduled Crons"
1008
- msgstr "Scheduled Crons"
1009
-
1010
- #: includes/i18n.php:286
1011
- msgid "Cron Type"
1012
- msgstr "Cron Type"
1013
-
1014
- #: includes/i18n.php:287
1015
- msgid "Plugins & Themes Sync"
1016
- msgstr "Plugins & Themes Sync"
1017
-
1018
- #: includes/i18n.php:288
1019
- msgid "Licenses"
1020
- msgstr "רישיונות"
1021
-
1022
- #: includes/i18n.php:289
1023
- msgid "Debug Log"
1024
- msgstr "Debug Log"
1025
-
1026
- #: includes/i18n.php:290
1027
- msgid "All"
1028
- msgstr "הכל"
1029
-
1030
- #: includes/i18n.php:291
1031
- msgid "File"
1032
- msgstr "קובץ"
1033
-
1034
- #: includes/i18n.php:292
1035
- msgid "Function"
1036
- msgstr "פונקציה"
1037
-
1038
- #: includes/i18n.php:293
1039
- msgid "Process ID"
1040
- msgstr "Process ID"
1041
-
1042
- #: includes/i18n.php:294
1043
- msgid "Logger"
1044
- msgstr "Logger"
1045
-
1046
- #: includes/i18n.php:295
1047
- msgid "Message"
1048
- msgstr "הודעה"
1049
-
1050
- #: includes/i18n.php:296
1051
- msgid "Download"
1052
- msgstr "הורדה"
1053
-
1054
- #: includes/i18n.php:297
1055
- msgid "Filter"
1056
- msgstr "פילטר"
1057
-
1058
- #: includes/i18n.php:298
1059
- msgid "Type"
1060
- msgstr "סוג"
1061
-
1062
- #: includes/i18n.php:299
1063
- msgid "All Types"
1064
- msgstr "כל הסוגים"
1065
-
1066
- #: includes/i18n.php:300
1067
- msgid "All Requests"
1068
- msgstr "כל הבקשות"
1069
-
1070
- #: includes/i18n.php:304
1071
- msgctxt "as congratulations"
1072
- msgid "Congrats"
1073
- msgstr "מזל טוב"
1074
-
1075
- #: includes/i18n.php:305
1076
- msgctxt "exclamation"
1077
- msgid "Oops"
1078
- msgstr "אופס"
1079
-
1080
- #: includes/i18n.php:306
1081
- msgctxt "interjection expressing joy or exuberance"
1082
- msgid "Yee-haw"
1083
- msgstr "Yee-haw"
1084
-
1085
- #: includes/i18n.php:307
1086
- msgctxt ""
1087
- msgid "W00t"
1088
- msgstr "W00t"
1089
-
1090
- #: includes/i18n.php:309
1091
- msgctxt "a positive response"
1092
- msgid "Right on"
1093
- msgstr "מעולה"
1094
-
1095
- #: includes/i18n.php:310
1096
- msgctxt ""
1097
- msgid "Hmm"
1098
- msgstr "הממ"
1099
-
1100
- #: includes/i18n.php:312
1101
- msgid "O.K"
1102
- msgstr "אוקיי"
1103
-
1104
- #: includes/i18n.php:313
1105
- msgctxt "exclamation"
1106
- msgid "Hey"
1107
- msgstr "היי"
1108
-
1109
- #: includes/i18n.php:314
1110
- msgctxt "advance notice of something that will need attention."
1111
- msgid "Heads up"
1112
- msgstr "לתשמות לבך"
1113
-
1114
- #: includes/i18n.php:319
1115
- msgid "Seems like you got the latest release."
1116
- msgstr "Seems like you got the latest release."
1117
-
1118
- #: includes/i18n.php:320
1119
- msgid "You are all good!"
1120
- msgstr "את\\ה מסודר!"
1121
-
1122
- #: includes/i18n.php:321
1123
- msgid "Sorry, we could not complete the email update. Another user with the same email is already registered."
1124
- msgstr "Sorry, we could not complete the email update. Another user with the same email is already registered."
1125
-
1126
- #: includes/i18n.php:322
1127
- msgid "If you would like to give up the ownership of the plugin's account to %s click the Change Ownership button."
1128
- msgstr "If you would like to give up the ownership of the plugin's account to %s click the Change Ownership button."
1129
-
1130
- #: includes/i18n.php:323
1131
- msgid "Your email was successfully updated. You should receive an email with confirmation instructions in few moments."
1132
- msgstr "Your email was successfully updated. You should receive an email with confirmation instructions in few moments."
1133
-
1134
- #: includes/i18n.php:324
1135
- msgid "Your name was successfully updated."
1136
- msgstr "שמך עודכן בהצלחה."
1137
-
1138
- #: includes/i18n.php:325
1139
- msgid "You have successfully updated your %s."
1140
- msgstr "You have successfully updated your %s."
1141
-
1142
- #: includes/i18n.php:326
1143
- msgid "Please provide your full name."
1144
- msgstr "נא למלא את שמך המלא."
1145
-
1146
- #: includes/i18n.php:327
1147
- msgid "Verification mail was just sent to %s. If you can't find it after 5 min, please check your spam box."
1148
- msgstr "Verification mail was just sent to %s. If you can't find it after 5 min, please check your spam box."
1149
-
1150
- #: includes/i18n.php:328
1151
- msgid "Just letting you know that the add-ons information of %s is being pulled from an external server."
1152
- msgstr "Just letting you know that the add-ons information of %s is being pulled from an external server."
1153
-
1154
- #: includes/i18n.php:329
1155
- msgid "No credit card required"
1156
- msgstr "לא נדרש כרטיס אשראי"
1157
-
1158
- #: includes/i18n.php:330
1159
- msgid "Premium plugin version was successfully activated."
1160
- msgstr "Premium plugin version was successfully activated."
1161
-
1162
- #: includes/i18n.php:331
1163
- msgid "The upgrade of %s was successfully completed."
1164
- msgstr "The upgrade of %s was successfully completed."
1165
-
1166
- #: includes/i18n.php:332
1167
- msgid "Your account was successfully activated with the %s plan."
1168
- msgstr "חשבונך הופעל בהצלחה עם חבילת %s."
1169
-
1170
- #: includes/i18n.php:333
1171
- msgid "Download the latest %s version now"
1172
- msgstr "הורדת גרסת ה-%s העדכנית - עכשיו"
1173
-
1174
- #: includes/i18n.php:334
1175
- msgid "Please follow these steps to complete the upgrade"
1176
- msgstr "נא לבצע את הצעדים הבאים להשלמת השידרוג"
1177
-
1178
- #: includes/i18n.php:335
1179
- msgid "Download the latest %s version"
1180
- msgstr "הורד\\י את גרסת ה-%s העדכנית"
1181
-
1182
- #: includes/i18n.php:336
1183
- msgid "Download the latest version"
1184
- msgstr "הורד את הגרסה האחרונה"
1185
-
1186
- #: includes/i18n.php:337
1187
- msgid "Deactivate the free version"
1188
- msgstr "כבה\\י את הגרסה החינאמית"
1189
-
1190
- #: includes/i18n.php:338
1191
- msgid "Upload and activate the downloaded version"
1192
- msgstr "העלה\\י והפעיל\\י את הגרסה שהורדת"
1193
-
1194
- #: includes/i18n.php:339
1195
- msgid "How to upload and activate?"
1196
- msgstr "איך להעלות ולהפעיל?"
1197
-
1198
- #: includes/i18n.php:340
1199
- msgctxt "%s - product name, e.g. Facebook add-on was successfully..."
1200
- msgid "%s Add-on was successfully purchased."
1201
- msgstr "ההרחבה %s נרכשה בהצלחה."
1202
-
1203
- #: includes/i18n.php:342
1204
- msgid "Your %s Add-on plan was successfully upgraded."
1205
- msgstr "חבילת ההרחבה %s שודרגה בהצלחה."
1206
-
1207
- #: includes/i18n.php:343
1208
- msgid "Your email has been successfully verified - you are AWESOME!"
1209
- msgstr "Your email has been successfully verified - you are AWESOME!"
1210
-
1211
- #: includes/i18n.php:344
1212
- msgid "Your plan was successfully upgraded."
1213
- msgstr "החבילה שודרגה בהצלחה."
1214
-
1215
- #: includes/i18n.php:345
1216
- msgid "Your plan was successfully changed to %s."
1217
- msgstr "החבילה עודכנה בהצלחה אל %s."
1218
-
1219
- #: includes/i18n.php:346
1220
- msgid "Your license has expired. You can still continue using the free plugin forever."
1221
- msgstr "פג תוקפו של הרישיון. עדיין ניתן להמשיך להשתמש בגרסה החינאמית של התוסף ללא מגבלת זמן."
1222
-
1223
- #: includes/i18n.php:347
1224
- msgid "Your license has been cancelled. If you think it's a mistake, please contact support."
1225
- msgstr "רשיונך בוטל. אם לדעתך זו טעות, נא ליצור קשר עם התמיכה."
1226
-
1227
- #: includes/i18n.php:348
1228
- msgid "Your trial has been successfully started."
1229
- msgstr "הניסיון שלך הופעל בהצלחה."
1230
-
1231
- #: includes/i18n.php:349
1232
- msgid "Your license was successfully activated."
1233
- msgstr "הרישיון הופעל בהצלחה."
1234
-
1235
- #: includes/i18n.php:350
1236
- msgid "It looks like your site currently doesn't have an active license."
1237
- msgstr "נראה לאתר עדיין אין רישיון פעיל."
1238
-
1239
- #: includes/i18n.php:351
1240
- msgid "Your license was successfully deactivated, you are back to the %s plan."
1241
- msgstr "רישיונך נותק בהצלחה, חזרת לחבילת %s"
1242
-
1243
- #: includes/i18n.php:352
1244
- msgid "It looks like the license deactivation failed."
1245
- msgstr "נראה שניתוק הרישיון נכשל."
1246
-
1247
- #: includes/i18n.php:353
1248
- msgid "It looks like the license could not be activated."
1249
- msgstr "נראה שלא ניתן להפעיל את הרישיון."
1250
-
1251
- #: includes/i18n.php:354
1252
- msgid "Error received from the server:"
1253
- msgstr "הוחזרה שגיאה מהשרת:"
1254
-
1255
- #: includes/i18n.php:355
1256
- msgid "Your trial has expired. You can still continue using all our free features."
1257
- msgstr "תקופת הניסיון נגמרה. ביכולתך להמשיך להשתמש בכל הפיטצ'רים החינאמיים."
1258
-
1259
- #: includes/i18n.php:356
1260
- msgid "Your plan was successfully downgraded. Your %s plan license will expire in %s."
1261
- msgstr "Your plan was successfully downgraded. Your %s plan license will expire in %s."
1262
-
1263
- #: includes/i18n.php:357
1264
- msgid "Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes."
1265
- msgstr "Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes."
1266
-
1267
- #: includes/i18n.php:358
1268
- msgid "It looks like you are not in trial mode anymore so there's nothing to cancel :)"
1269
- msgstr "It looks like you are not in trial mode anymore so there's nothing to cancel :)"
1270
-
1271
- #: includes/i18n.php:359
1272
- msgid "Your %s free trial was successfully cancelled."
1273
- msgstr "תקופת הניסיון החינמית של %s בוטלה בהצלחה."
1274
-
1275
- #: includes/i18n.php:360
1276
- msgctxt "%s - numeric version number"
1277
- msgid "Version %s was released."
1278
- msgstr "גרסה %s הושקה."
1279
-
1280
- #: includes/i18n.php:361
1281
- msgid "Please download %s."
1282
- msgstr "נא להוריד את %s."
1283
-
1284
- #: includes/i18n.php:362
1285
- msgctxt "%s - plan name, as the latest professional version here"
1286
- msgid "the latest %s version here"
1287
- msgstr "גרסת ה-%s האחרונה כאן"
1288
-
1289
- #: includes/i18n.php:364
1290
- msgid "How do you like %s so far? Test all our %s premium features with a %d-day free trial."
1291
- msgstr "How do you like %s so far? Test all our %s premium features with a %d-day free trial."
1292
-
1293
- #: includes/i18n.php:365
1294
- msgctxt "call to action"
1295
- msgid "Start free trial"
1296
- msgstr "התחלת ניסיון חינם"
1297
-
1298
- #: includes/i18n.php:366
1299
- msgid "Starting trial"
1300
- msgstr "מתחיל תקופת ניסיון"
1301
-
1302
- #: includes/i18n.php:367
1303
- msgid "Please wait"
1304
- msgstr "נא להמתין"
1305
-
1306
- #: includes/i18n.php:368
1307
- msgid "Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes."
1308
- msgstr "Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes."
1309
-
1310
- #: includes/i18n.php:369
1311
- msgid "You already utilized a trial before."
1312
- msgstr "הניסיון כבר נוצל בעבר."
1313
-
1314
- #: includes/i18n.php:370
1315
- msgid "You are already running the plugin in a trial mode."
1316
- msgstr "התוסף כבר עכשיו בתקופת ניסיון."
1317
-
1318
- #: includes/i18n.php:371
1319
- msgid "Plan %s do not exist, therefore, can't start a trial."
1320
- msgstr "החבילה %s אינה קיימת, לכן, לא ניתן להתחיל תקופת ניסיון."
1321
-
1322
- #: includes/i18n.php:372
1323
- msgid "Plan %s does not support a trial period."
1324
- msgstr "תוכנית %s אינה תומכת בתקופת ניסיון."
1325
-
1326
- #: includes/i18n.php:373
1327
- msgid "None of the plugin's plans supports a trial period."
1328
- msgstr "אף אחת מהחבילות אינה מאפשרת תקופת ניסיון."
1329
-
1330
- #: includes/i18n.php:374
1331
- msgid "Unexpected API error. Please contact the plugin's author with the following error."
1332
- msgstr "שגיאת API בלתי צפוייה. נא לפנות למפתח התוסף עם השגיאה הבאה."
1333
-
1334
- #: includes/i18n.php:375
1335
- msgid "No commitment for %s days - cancel anytime!"
1336
- msgstr "ללא התחייבות ל-%s ימין - בטלו בכל רגע!"
1337
-
1338
- #: includes/i18n.php:376
1339
- msgid "Your license has expired. You can still continue using all the %s features, but you'll need to renew your license to continue getting updates and support."
1340
- msgstr "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."
1341
-
1342
- #: includes/i18n.php:377
1343
- msgid "Couldn't activate %s."
1344
- msgstr "לא ניתן להפעיל את %s."
1345
-
1346
- #: includes/i18n.php:378
1347
- msgid "Please contact us with the following message:"
1348
- msgstr "אנא צור איתנו קשר יחד עם ההודעה הבאה:"
1349
-
1350
- #: includes/i18n.php:379
1351
- msgid "It looks like you are still on the %s plan. If you did upgrade or change your plan, it's probably an issue on our side - sorry."
1352
- msgstr "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."
1353
-
1354
- #: includes/i18n.php:380
1355
- msgid "Please contact us here"
1356
- msgstr "אנא צור איתנו קשר כאן"
1357
-
1358
- #: includes/i18n.php:381
1359
- msgid "I have upgraded my account but when I try to Sync the License, the plan remains %s."
1360
- msgstr "שידרגתי את החשבון שלי אבל כשאני מנסה לבצע סנכרון לרישיון החבילה נשארת %s."
1361
-
1362
- #: includes/i18n.php:384
1363
- msgid "From unknown reason, the API connectivity test failed."
1364
- msgstr "יש בעיית תקשורת ל-API מסיבה בלתי ברורה."
1365
-
1366
- #: includes/i18n.php:385
1367
- msgid "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?"
1368
- msgstr "ככל הנראה זאת בעיה זמנית בצד שלנו. ברשותך, ורק כדי להיות בטוחים שזאת הבעיה, האם זה יהיה בסדר לבצע בדיקת תקשורת נוספת?"
1369
-
1370
- #: includes/i18n.php:386
1371
- msgid "We use PHP cURL library for the API calls, which is a very common library and usually installed and activated out of the box. Unfortunately, cURL is not activated (or disabled) on your server."
1372
- msgstr "We use PHP cURL library for the API calls, which is a very common library and usually installed and activated out of the box. Unfortunately, cURL is not activated (or disabled) on your server."
1373
-
1374
- #: includes/i18n.php:387
1375
- msgid "Disabled method(s):"
1376
- msgstr "Disabled method(s):"
1377
-
1378
- #: includes/i18n.php:388
1379
- msgid "From unknown reason, CloudFlare, the firewall we use, blocks the connection."
1380
- msgstr "מסיבה בלתי ברורה, CloudFlare, חומת האש שאנחנו משתמשים בה, חוסמת את התקשורת."
1381
-
1382
- #: includes/i18n.php:389
1383
- msgctxt "as pluginX requires an access to our API"
1384
- msgid "%s requires an access to our API."
1385
- msgstr "%s מחייב גישה ל-API שלנו."
1386
-
1387
- #: includes/i18n.php:391
1388
- msgid "It looks like your server is using Squid ACL (access control lists), which blocks the connection."
1389
- msgstr "It looks like your server is using Squid ACL (access control lists), which blocks the connection."
1390
-
1391
- #: includes/i18n.php:392
1392
- msgid "I don't know what is Squid or ACL, help me!"
1393
- msgstr "אין לי מושג מה זה Squid או ACL - אשמח לעזרה!"
1394
-
1395
- #: includes/i18n.php393, includes/i18n.php:397
1396
- msgid "We'll make sure to contact your hosting company and resolve the issue. You will get a follow-up email to %s once we have an update."
1397
- msgstr "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."
1398
-
1399
- #: includes/i18n.php:394
1400
- msgid "I'm a system administrator"
1401
- msgstr "אני מנהל מערכת"
1402
-
1403
- #: includes/i18n.php:395
1404
- msgid "Great, please whitelist the following domains: %s. Once you are done, deactivate the plugin and activate it again."
1405
- msgstr "Great, please whitelist the following domains: %s. Once you are done, deactivate the plugin and activate it again."
1406
-
1407
- #: includes/i18n.php:396
1408
- msgid "I don't know what is cURL or how to install it, help me!"
1409
- msgstr "אין לי מושג מה זה cURL או איך להתקין אותו - אשמח לעזרה!"
1410
-
1411
- #: includes/i18n.php:398
1412
- msgid "Great, please install cURL and enable it in your php.ini file. In addition, search for the 'disable_functions' directive in your php.ini file and remove any disabled methods starting with 'curl_'. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the plugin and reactivate it back again."
1413
- msgstr "Great, please install cURL and enable it in your php.ini file. In addition, search for the 'disable_functions' directive in your php.ini file and remove any disabled methods starting with 'curl_'. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the plugin and reactivate it back again."
1414
-
1415
- #: includes/i18n.php:399
1416
- msgid "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."
1417
- msgstr "זו בטח בעיה בצד שלנו ואנחנו נשמח לעזור כדי לפתור את העניין בהקדם האפשר, רק במידה ותאפשר\\י זאת."
1418
-
1419
- #: includes/i18n.php:400
1420
- msgid "Sorry for the inconvenience and we are here to help if you give us a chance."
1421
- msgstr "מצטערים על חוסר הנעימות, אנחנו כאן כדי לעזור אם תאפשר\\י זאת."
1422
-
1423
- #: includes/i18n.php:401
1424
- msgid "Yes - I'm giving you a chance to fix it"
1425
- msgstr "כן - אני נותן לך צ'אנס לתקן את זה"
1426
-
1427
- #: includes/i18n.php:402
1428
- msgid "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."
1429
- msgstr "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."
1430
-
1431
- #: includes/i18n.php:403
1432
- msgid "Let's try your previous version"
1433
- msgstr "בוא ננסה את הגירסה הקודמת"
1434
-
1435
- #: includes/i18n.php:404
1436
- msgid "Uninstall this version and install the previous one."
1437
- msgstr "הסר את הגרסה הנוכחית והתקן את הגרסה קודמת."
1438
-
1439
- #: includes/i18n.php:405
1440
- msgid "That's exhausting, please deactivate"
1441
- msgstr "זה מתיש, אנא לכבות"
1442
-
1443
- #: includes/i18n.php:406
1444
- msgid "We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future."
1445
- msgstr "We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future."
1446
-
1447
- #: includes/i18n.php:407
1448
- msgid "Thank for giving us the chance to fix it! A message was just sent to our technical staff. We will get back to you as soon as we have an update to %s. Appreciate your patience."
1449
- msgstr "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."
1450
-
1451
- #: includes/i18n.php:408
1452
- msgctxt "%1s - plugin title, %2s - API domain"
1453
- msgid "Your server is blocking the access to Freemius' API, which is crucial for %1s synchronization. Please contact your host to whitelist %2s"
1454
- msgstr "Your server is blocking the access to Freemius' API, which is crucial for %1s synchronization. Please contact your host to whitelist %2s"
1455
-
1456
- #: includes/i18n.php:410
1457
- msgid "It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again."
1458
- msgstr "It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again."
1459
-
1460
- #: includes/i18n.php:413
1461
- msgid "Please check your mailbox, you should receive an email via %s to confirm the ownership change. From security reasons, you must confirm the change within the next 15 min. If you cannot find the email, please check your spam folder."
1462
- msgstr "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."
1463
-
1464
- #: includes/i18n.php:414
1465
- msgid "Thanks for confirming the ownership change. An email was just sent to %s for final approval."
1466
- msgstr "תודה על אישור ביצוע החלפת הבעלות. הרגע נשלח מייל ל-%s כדי לקבל אישור סופי."
1467
-
1468
- #: includes/i18n.php:415
1469
- msgid "%s is the new owner of the account."
1470
- msgstr "%s הינו הבעלים החד של חשבון זה."
1471
-
1472
- #: includes/i18n.php:417
1473
- msgctxt "addonX cannot run without pluginY"
1474
- msgid "%s cannot run without %s."
1475
- msgstr "%s לא יכול לעבוד ללא %s."
1476
-
1477
- #: includes/i18n.php:419
1478
- msgctxt "addonX cannot run..."
1479
- msgid "%s cannot run without the plugin."
1480
- msgstr "ההרחבה %s אינה יכולה לפעול ללא התוסף."
1481
-
1482
- #: includes/i18n.php:420
1483
- msgctxt "pluginX activation was successfully..."
1484
- msgid "%s activation was successfully completed."
1485
- msgstr "הפעלת %s הושלמה בהצלחה."
1486
-
1487
- #: includes/i18n.php:422
1488
- msgctxt "Plugin installer section title"
1489
- msgid "Features & Pricing"
1490
- msgstr "פיטצ'רים ומחירים"
1491
-
1492
- #: includes/i18n.php:423
1493
- msgid "Add-on must be deployed to WordPress.org or Freemius."
1494
- msgstr "Add-on must be deployed to WordPress.org or Freemius."
1495
-
1496
- #: includes/i18n.php:424
1497
- msgid "Paid add-on must be deployed to Freemius."
1498
- msgstr "Paid add-on must be deployed to Freemius."
1499
-
1500
- #: includes/i18n.php:428
1501
- msgid "%s is a premium only add-on. You have to purchase a license first before activating the plugin."
1502
- msgstr "%s is a premium only add-on. You have to purchase a license first before activating the plugin."
1503
-
1504
- #: includes/i18n.php:429
1505
- msgid "%s free trial was successfully cancelled. Since the add-on is premium only it was automatically deactivated. If you like to use it in the future, you'll have to purchase a license."
1506
- msgstr "%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."
1507
-
1508
- #: includes/i18n.php:434
1509
- msgctxt "as every month"
1510
- msgid "Monthly"
1511
- msgstr "חודשי"
1512
-
1513
- #: includes/i18n.php:435
1514
- msgctxt "as monthly period"
1515
- msgid "mo"
1516
- msgstr "חודשים"
1517
-
1518
- #: includes/i18n.php:436
1519
- msgctxt "as once a year"
1520
- msgid "Annual"
1521
- msgstr "שנתי"
1522
-
1523
- #: includes/i18n.php:437
1524
- msgctxt "as once a year"
1525
- msgid "Annually"
1526
- msgstr "שנתי"
1527
-
1528
- #: includes/i18n.php:438
1529
- msgctxt "as once a year"
1530
- msgid "Once"
1531
- msgstr "פעם אחת"
1532
-
1533
- #: includes/i18n.php:439
1534
- msgctxt "as annual period"
1535
- msgid "year"
1536
- msgstr "שנה"
1537
-
1538
- #: includes/i18n.php:440
1539
- msgid "Lifetime"
1540
- msgstr "לכל החיים"
1541
-
1542
- #: includes/i18n.php:441
1543
- msgctxt "e.g. the best product"
1544
- msgid "Best"
1545
- msgstr "הכי טוב"
1546
-
1547
- #: includes/i18n.php:442
1548
- msgctxt "e.g. billed monthly"
1549
- msgid "Billed %s"
1550
- msgstr "מחוייב על בסיס %s"
1551
-
1552
- #: includes/i18n.php:443
1553
- msgctxt "as a discount of $5 or 10%"
1554
- msgid "Save %s"
1555
- msgstr "שמירת %s"
1556
-
1557
- #: includes/i18n.php:445
1558
- msgid "View details"
1559
- msgstr "פרטים נוספים"
1560
-
1561
- #: includes/i18n.php:449
1562
- msgctxt "button label"
1563
- msgid "Approve & Start Trial"
1564
- msgstr "אשר והתחל תקופת ניסיון"
1565
-
1566
- #: includes/i18n.php:451
1567
- msgid "You are 1-click away from starting your %1$s-day free trial of the %2$s plan."
1568
- msgstr "You are 1-click away from starting your %1$s-day free trial of the %2$s plan."
1569
-
1570
- #: includes/i18n.php:453
1571
- msgid "For compliance with the WordPress.org guidelines, before we start the trial we ask that you opt-in with your user and non-sensitive site information, allowing the plugin to periodically send data to %s to check for version updates and to validate your trial."
1572
- msgstr "For compliance with the WordPress.org guidelines, before we start the trial we ask that you opt-in with your user and non-sensitive site information, allowing the plugin to periodically send data to %s to check for version updates and to validate your trial."
1573
-
1574
- #: includes/i18n.php:459
1575
- msgid "Business name"
1576
- msgstr "שם עסק"
1577
-
1578
- #: includes/i18n.php:460
1579
- msgid "Tax / VAT ID"
1580
- msgstr "Tax / VAT ID"
1581
-
1582
- #: includes/i18n.php:461
1583
- msgid "Address Line %d"
1584
- msgstr "כתובת %s"
1585
-
1586
- #: includes/i18n.php:462
1587
- msgid "Country"
1588
- msgstr "מדינה"
1589
-
1590
- #: includes/i18n.php:463
1591
- msgid "Select Country"
1592
- msgstr "בחר מדינה"
1593
-
1594
- #: includes/i18n.php:464
1595
- msgid "City"
1596
- msgstr "עיר"
1597
-
1598
- #: includes/i18n.php:465
1599
- msgid "Town"
1600
- msgstr "כפר"
1601
-
1602
- #: includes/i18n.php:466
1603
- msgid "State"
1604
- msgstr "מחוז/מדינה"
1605
-
1606
- #: includes/i18n.php:467
1607
- msgid "Province"
1608
- msgstr "פרובינציה"
1609
-
1610
- #: includes/i18n.php:468
1611
- msgid "ZIP / Postal Code"
1612
- msgstr "מיקוד / תא דואר"
1613
-
1614
- #: includes/i18n.php:473
1615
- msgid "Installing plugin: %s"
1616
- msgstr "Installing plugin: %s"
1617
-
1618
- #: includes/i18n.php:474
1619
- msgid "Automatic Installation"
1620
- msgstr "Automatic Installation"
1621
-
1622
- #: includes/i18n.php:476
1623
- msgid "%s sec"
1624
- msgstr "%s sec"
1625
-
1626
- #: includes/i18n.php:477
1627
- msgid "An automated download and installation of %s (paid version) from %s will start in %s. If you would like to do it manually - click the cancellation button now."
1628
- msgstr "An automated download and installation of %s (paid version) from %s will start in %s. If you would like to do it manually - click the cancellation button now."
1629
-
1630
- #: includes/i18n.php:478
1631
- msgid "The installation process has started and may take a few minutes to complete. Please wait until it is done - do not refresh this page."
1632
- msgstr "The installation process has started and may take a few minutes to complete. Please wait until it is done - do not refresh this page."
1633
-
1634
- #: includes/i18n.php:479
1635
- msgid "Cancel Installation"
1636
- msgstr "Cancel Installation"
1637
-
1638
- #: includes/i18n.php:480
1639
- msgid "The remote plugin package does not contain a folder with the desired slug and renaming did not work."
1640
- msgstr "The remote plugin package does not contain a folder with the desired slug and renaming did not work."
1641
-
1642
- #: includes/i18n.php:481
1643
- msgid "Invalid module ID."
1644
- msgstr "Invalid module ID."
1645
-
1646
- #: includes/i18n.php:482
1647
- msgid "Auto installation only works for opted-in users."
1648
- msgstr "Auto installation only works for opted-in users."
1649
-
1650
- #: includes/i18n.php:483
1651
- msgid "Premium version already active."
1652
- msgstr "Premium version already active."
1653
-
1654
- #: includes/i18n.php:484
1655
- msgid "Premium add-on version already installed."
1656
- msgstr "Premium add-on version already installed."
1657
-
1658
- #: includes/i18n.php:485
1659
- msgid "You do not have a valid license to access the premium version."
1660
- msgstr "You do not have a valid license to access the premium version."
1661
-
1662
- #: includes/i18n.php:486
1663
- msgid "Plugin is a \"Serviceware\" which means it does not have a premium code version."
1664
- msgstr "Plugin is a \"Serviceware\" which means it does not have a premium code version."
1665
-
1666
- #: includes/i18n.php:501
1667
- msgctxt "Plugin installer section title"
1668
- msgid "Description"
1669
- msgstr "תיאור"
1670
-
1671
- #: includes/i18n.php:502
1672
- msgctxt "Plugin installer section title"
1673
- msgid "Installation"
1674
- msgstr "התקנה"
1675
-
1676
- #: includes/i18n.php:503
1677
- msgctxt "Plugin installer section title"
1678
- msgid "FAQ"
1679
- msgstr "שאלות נפוצות"
1680
-
1681
- #: includes/i18n.php:504
1682
- msgctxt "Plugin installer section title"
1683
- msgid "Changelog"
1684
- msgstr "לוג שינויים"
1685
-
1686
- #: includes/i18n.php:505
1687
- msgctxt "Plugin installer section title"
1688
- msgid "Reviews"
1689
- msgstr "ביקורות"
1690
-
1691
- #: includes/i18n.php:506
1692
- msgctxt "Plugin installer section title"
1693
- msgid "Other Notes"
1694
- msgstr "היערות נוספות"
1695
-
1696
- #: includes/i18n.php:508
1697
- msgid "%s star"
1698
- msgstr "כוכב %s"
1699
-
1700
- #: includes/i18n.php:510
1701
- msgid "%s stars"
1702
- msgstr "%s כוכבים"
1703
-
1704
- #: includes/i18n.php:512
1705
- msgid "%s rating"
1706
- msgstr "דרוג %s"
1707
-
1708
- #: includes/i18n.php:514
1709
- msgid "%s ratings"
1710
- msgstr "%s דרוגים"
1711
-
1712
- #: includes/i18n.php:516
1713
- msgid "%s time"
1714
- msgstr "פעם %s"
1715
-
1716
- #: includes/i18n.php:518
1717
- msgid "%s times"
1718
- msgstr "%s פעמים"
1719
-
1720
- #: includes/i18n.php:520
1721
- msgid "Click to see reviews that provided a rating of %s"
1722
- msgstr "Click to see reviews that provided a rating of %s"
1723
-
1724
- #: includes/i18n.php:521
1725
- msgid "Last Updated"
1726
- msgstr "עודכן לאחרונה"
1727
-
1728
- #: includes/i18n.php:522
1729
- msgid "Requires WordPress Version:"
1730
- msgstr "Requires WordPress Version:"
1731
-
1732
- #: includes/i18n.php:523
1733
- msgctxt "as the plugin author"
1734
- msgid "Author:"
1735
- msgstr "מחבר:"
1736
-
1737
- #: includes/i18n.php:524
1738
- msgid "Compatible up to:"
1739
- msgstr "Compatible up to:"
1740
-
1741
- #: includes/i18n.php:525
1742
- msgid "Downloaded:"
1743
- msgstr "הורדות:"
1744
-
1745
- #: includes/i18n.php:526
1746
- msgid "WordPress.org Plugin Page"
1747
- msgstr "WordPress.org Plugin Page"
1748
-
1749
- #: includes/i18n.php:527
1750
- msgid "Plugin Homepage"
1751
- msgstr "Plugin Homepage"
1752
-
1753
- #: includes/i18n.php:528
1754
- msgid "Donate to this plugin"
1755
- msgstr "Donate to this plugin"
1756
-
1757
- #: includes/i18n.php:529
1758
- msgid "Average Rating"
1759
- msgstr "דירוג ממוצע"
1760
-
1761
- #: includes/i18n.php:530
1762
- msgid "based on %s"
1763
- msgstr "מבוסס על %s"
1764
-
1765
- #: includes/i18n.php:531
1766
- msgid "Warning:"
1767
- msgstr "אזהרה:"
1768
-
1769
- #: includes/i18n.php:532
1770
- msgid "Contributors"
1771
- msgstr "תורמים"
1772
-
1773
- #: includes/i18n.php:533
1774
- msgid "Plugin Install"
1775
- msgstr "התקנת תוסף"
1776
-
1777
- #: includes/i18n.php:534
1778
- msgid "This plugin has not been tested with your current version of WordPress."
1779
- msgstr "This plugin has not been tested with your current version of WordPress."
1780
-
1781
- #: includes/i18n.php:535
1782
- msgid "This plugin has not been marked as compatible with your version of WordPress."
1783
- msgstr "This plugin has not been marked as compatible with your version of WordPress."
1784
-
1785
- #: includes/i18n.php:536
1786
- msgid "Newer Version (%s) Installed"
1787
- msgstr "גרסה חדשה (%s) הותקנה"
1788
-
1789
- #: includes/i18n.php:537
1790
- msgid "Latest Version Installed"
1791
- msgstr "הגרסה האחרונה הותקנה"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
freemius/languages/freemius-it_IT.mo DELETED
Binary file
freemius/languages/freemius-it_IT.po DELETED
@@ -1,1793 +0,0 @@
1
- # Copyright (C) 2017 freemius
2
- # This file is distributed under the same license as the freemius package.
3
- # Translators:
4
- # Pelly Benassi <plasmax@gmail.com>, 2016
5
- # Daniele Scasciafratte Mte90 <mte90net@gmail.com>, 2015-2017
6
- # Pelly Benassi <plasmax@gmail.com>, 2016-2017
7
- # Vova Feldman <vova@freemius.com>, 2015-2016
8
- msgid ""
9
- msgstr ""
10
- "Project-Id-Version: WordPress SDK\n"
11
- "Report-Msgid-Bugs-To: https://github.com/Freemius/wordpress-sdk/issues\n"
12
- "POT-Creation-Date: \n"
13
- "PO-Revision-Date: 2017-05-12 17:32+0000\n"
14
- "Last-Translator: Vova Feldman <vova@freemius.com>\n"
15
- "Language: it_IT\n"
16
- "Language-Team: Italian (Italy) (http://www.transifex.com/freemius/wordpress-sdk/language/it_IT/)\n"
17
- "Content-Type: text/plain; charset=UTF-8\n"
18
- "Content-Transfer-Encoding: 8bit\n"
19
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
20
- "MIME-Version: 1.0\n"
21
- "X-Poedit-Basepath: ..\n"
22
- "X-Poedit-KeywordsList: _fs_text;_fs_echo;_fs_esc_attr;_fs_esc_attr_echo;_fs_esc_html;_fs_esc_html_echo;_fs_x:1,2c;_fs_ex:1,2c;_fs_esc_attr_x:1,2c;_fs_esc_html_x:1,2c;_fs_n:1,2;_fs_n_noop:1,2;_fs_nx:1,2,4c;_fs_nx_noop:1,2,3c\n"
23
- "X-Poedit-SearchPath-0: .\n"
24
- "X-Poedit-SearchPathExcluded-0: *.js\n"
25
- "X-Poedit-SourceCharset: UTF-8\n"
26
-
27
- #: includes/i18n.php:37
28
- msgid "Account"
29
- msgstr "Account"
30
-
31
- #: includes/i18n.php:38
32
- msgid "Add On"
33
- msgstr "Add-on"
34
-
35
- #: includes/i18n.php:39
36
- msgid "Contact Us"
37
- msgstr "Contattaci"
38
-
39
- #: includes/i18n.php:40
40
- msgid "Contact Support"
41
- msgstr "Contatta il supporto"
42
-
43
- #: includes/i18n.php:41
44
- msgid "Change Ownership"
45
- msgstr "Cambia Proprietario"
46
-
47
- #: includes/i18n.php:42
48
- msgid "Support"
49
- msgstr "Supporto"
50
-
51
- #: includes/i18n.php:43
52
- msgid "Support Forum"
53
- msgstr "Forum di supporto"
54
-
55
- #: includes/i18n.php:44
56
- msgid "Add Ons"
57
- msgstr "Add-on"
58
-
59
- #: includes/i18n.php:45
60
- msgctxt "verb"
61
- msgid "Upgrade"
62
- msgstr "Aggiornamento"
63
-
64
- #: includes/i18n.php:46
65
- msgid "Awesome"
66
- msgstr "Fantastico"
67
-
68
- #: includes/i18n.php:47
69
- msgctxt "noun"
70
- msgid "Pricing"
71
- msgstr "Prezzi"
72
-
73
- #: includes/i18n.php:48
74
- msgctxt "noun"
75
- msgid "Price"
76
- msgstr "Prezzo"
77
-
78
- #: includes/i18n.php:49
79
- msgid "Unlimited Updates"
80
- msgstr "Aggiornamenti Illimitati"
81
-
82
- #: includes/i18n.php:50
83
- msgctxt "verb"
84
- msgid "Downgrade"
85
- msgstr "Downgrade"
86
-
87
- #: includes/i18n.php:51
88
- msgctxt "verb"
89
- msgid "Cancel Subscription"
90
- msgstr "Cancel Subscription"
91
-
92
- #: includes/i18n.php:52
93
- msgid "Cancel Trial"
94
- msgstr "Annulla prova gratuita"
95
-
96
- #: includes/i18n.php:53
97
- msgid "Free Trial"
98
- msgstr "Prova gratuita"
99
-
100
- #: includes/i18n.php:54
101
- msgid "Start my free %s"
102
- msgstr "Inizia la mia %s"
103
-
104
- #: includes/i18n.php:55
105
- msgid "No commitment for %s - cancel anytime"
106
- msgstr "Nessun impegno con %s - cancella quando vuoi"
107
-
108
- #: includes/i18n.php:56
109
- msgid "After your free %s, pay as little as %s"
110
- msgstr "Dopo il tuo %s gratuito, paghi solamente %s"
111
-
112
- #: includes/i18n.php:57
113
- msgid "Details"
114
- msgstr "Dettagli"
115
-
116
- #: includes/i18n.php:58
117
- msgid "Account Details"
118
- msgstr "Dettagli dell'account"
119
-
120
- #: includes/i18n.php:59
121
- msgctxt "verb"
122
- msgid "Delete"
123
- msgstr "Elimina"
124
-
125
- #: includes/i18n.php:60
126
- msgctxt "verb"
127
- msgid "Show"
128
- msgstr "Mostra"
129
-
130
- #: includes/i18n.php:61
131
- msgctxt "verb"
132
- msgid "Hide"
133
- msgstr "Nascondi"
134
-
135
- #: includes/i18n.php:62
136
- msgctxt "verb"
137
- msgid "Edit"
138
- msgstr "Modifica"
139
-
140
- #: includes/i18n.php:63
141
- msgctxt "verb"
142
- msgid "Update"
143
- msgstr "Aggiorna"
144
-
145
- #: includes/i18n.php:64
146
- msgid "Date"
147
- msgstr "Data"
148
-
149
- #: includes/i18n.php:65
150
- msgid "Amount"
151
- msgstr "Importo"
152
-
153
- #: includes/i18n.php:66
154
- msgid "Invoice"
155
- msgstr "Fattura"
156
-
157
- #: includes/i18n.php:67
158
- msgid "Billing"
159
- msgstr "Fatturazione"
160
-
161
- #: includes/i18n.php:68
162
- msgid "Payments"
163
- msgstr "Pagamenti"
164
-
165
- #: includes/i18n.php:69
166
- msgid "Delete Account"
167
- msgstr "Elimina Account"
168
-
169
- #: includes/i18n.php:70
170
- msgctxt "as close a window"
171
- msgid "Dismiss"
172
- msgstr "Chiudi"
173
-
174
- #: includes/i18n.php:71
175
- msgctxt "as product pricing plan"
176
- msgid "Plan"
177
- msgstr "Piano"
178
-
179
- #: includes/i18n.php:72
180
- msgid "Change Plan"
181
- msgstr "Cambia piano"
182
-
183
- #: includes/i18n.php:73
184
- msgctxt "as download professional version"
185
- msgid "Download %s Version"
186
- msgstr "Scarica la versione %s"
187
-
188
- #: includes/i18n.php:74
189
- msgctxt "as download professional version now"
190
- msgid "Download %s version now"
191
- msgstr "Scarica la versione %s ora"
192
-
193
- #: includes/i18n.php:75
194
- msgctxt "as download latest version"
195
- msgid "Download Latest"
196
- msgstr "Scarica l'ultima versione"
197
-
198
- #: includes/i18n.php:76
199
- msgctxt "E.g. you have a professional license."
200
- msgid "You have a %s license."
201
- msgstr "Hai la licenza %s."
202
-
203
- #: includes/i18n.php:77
204
- msgid "New"
205
- msgstr "Nuovo"
206
-
207
- #: includes/i18n.php:78
208
- msgid "Free"
209
- msgstr "Gratuito"
210
-
211
- #: includes/i18n.php:79
212
- msgctxt "as trial plan"
213
- msgid "Trial"
214
- msgstr "Prova gratuita"
215
-
216
- #: includes/i18n.php:80
217
- msgctxt "as starting a trial plan"
218
- msgid "Start Trial"
219
- msgstr "Inizia il periodo di prova gratuito"
220
-
221
- #: includes/i18n.php:81
222
- msgctxt "verb"
223
- msgid "Purchase"
224
- msgstr "Acquisto"
225
-
226
- #: includes/i18n.php:82
227
- msgid "Purchase License"
228
- msgstr "Acquista licenza"
229
-
230
- #: includes/i18n.php:83
231
- msgctxt "verb"
232
- msgid "Buy"
233
- msgstr "Compra"
234
-
235
- #: includes/i18n.php:84
236
- msgid "Buy License"
237
- msgstr "Compra licenza"
238
-
239
- #: includes/i18n.php:85
240
- msgid "Single Site License"
241
- msgstr "Licenza per sito singolo"
242
-
243
- #: includes/i18n.php:86
244
- msgid "Unlimited Licenses"
245
- msgstr "Licenze illimitate"
246
-
247
- #: includes/i18n.php:87
248
- msgid "Up to %s Sites"
249
- msgstr "Fino a %s siti"
250
-
251
- #: includes/i18n.php:88
252
- msgid "%sRenew your license now%s to access version %s features and support."
253
- msgstr "%sRinnova la tua licenza ora%s per accedere a funzionalità e supporto della versione %s."
254
-
255
- #: includes/i18n.php:89
256
- msgid "Enter the email address you've used for the upgrade below and we will resend you the license key."
257
- msgstr "Inserisci qui sotto l'indirizzo email che hai usato per registrare l'aggiornamento e ti invieremo di nuovo la chiave di licenza."
258
-
259
- #: includes/i18n.php:90
260
- msgctxt "e.g. Professional Plan"
261
- msgid "%s Plan"
262
- msgstr "Piano %s"
263
-
264
- #: includes/i18n.php:91
265
- msgid "You are just one step away - %s"
266
- msgstr "Sei a un passo dalla fine - %s"
267
-
268
- #: includes/i18n.php:92
269
- msgctxt "%s - plugin name. As complete \"Jetpack\" activation now"
270
- msgid "Complete \"%s\" Activation Now"
271
- msgstr "Completa l'attivazione di \"%s\" ora"
272
-
273
- #: includes/i18n.php:94
274
- msgid "We made a few tweaks to the plugin, %s"
275
- msgstr "Abbiamo apportato alcune modifiche al plugin, %s"
276
-
277
- #: includes/i18n.php:95
278
- msgid "Opt-in to make \"%s\" Better!"
279
- msgstr "Contribuisci a rendere \"%s\" migliore!"
280
-
281
- #: includes/i18n.php:96
282
- msgid "Error"
283
- msgstr "Errore"
284
-
285
- #: includes/i18n.php:97
286
- msgid "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
287
- msgstr "L'SDK di Freemius non è riuscito a trovare il file principale del plugin. Per favore contatta sdk@freemius.com riportando l'errore."
288
-
289
- #: includes/i18n.php:100
290
- msgctxt "as expiration date"
291
- msgid "Expiration"
292
- msgstr "Scadenza"
293
-
294
- #: includes/i18n.php:101
295
- msgctxt "as software license"
296
- msgid "License"
297
- msgstr "Licenza"
298
-
299
- #: includes/i18n.php:102
300
- msgid "not verified"
301
- msgstr "non verificato"
302
-
303
- #: includes/i18n.php:103
304
- msgid "Verify Email"
305
- msgstr "Verifica email"
306
-
307
- #: includes/i18n.php:104
308
- msgctxt "e.g. expires in 2 months"
309
- msgid "Expires in %s"
310
- msgstr "Scade in %s"
311
-
312
- #: includes/i18n.php:105
313
- msgctxt "e.g. auto renews in 2 months"
314
- msgid "Auto renews in %s"
315
- msgstr "Rinnovo automatico in %s"
316
-
317
- #: includes/i18n.php:106
318
- msgid "No expiration"
319
- msgstr "Nessuna scadenza"
320
-
321
- #: includes/i18n.php:107
322
- msgid "Expired"
323
- msgstr "Scaduto"
324
-
325
- #: includes/i18n.php:108
326
- msgid "Cancelled"
327
- msgstr "Annullato"
328
-
329
- #: includes/i18n.php:109
330
- msgctxt "e.g. In 2 hours"
331
- msgid "In %s"
332
- msgstr "In %s"
333
-
334
- #: includes/i18n.php:110
335
- msgctxt "e.g. 2 min ago"
336
- msgid "%s ago"
337
- msgstr "%s fa"
338
-
339
- #: includes/i18n.php:112
340
- msgid "%s or higher"
341
- msgstr "%s o superiore"
342
-
343
- #: includes/i18n.php:113
344
- msgctxt "as plugin version"
345
- msgid "Version"
346
- msgstr "Versione"
347
-
348
- #: includes/i18n.php:114
349
- msgid "Name"
350
- msgstr "Nome"
351
-
352
- #: includes/i18n.php:115
353
- msgid "Email"
354
- msgstr "Email"
355
-
356
- #: includes/i18n.php:116
357
- msgid "Email address"
358
- msgstr "Indirizzo email"
359
-
360
- #: includes/i18n.php:117
361
- msgid "Verified"
362
- msgstr "Verificato"
363
-
364
- #: includes/i18n.php:118
365
- msgid "Module"
366
- msgstr "Modulo"
367
-
368
- #: includes/i18n.php:119
369
- msgid "Module Type"
370
- msgstr "Tipo di modulo"
371
-
372
- #: includes/i18n.php:120
373
- msgid "Plugin"
374
- msgstr "Plugin"
375
-
376
- #: includes/i18n.php:121
377
- msgid "Plugins"
378
- msgstr "Plugin"
379
-
380
- #: includes/i18n.php:122
381
- msgid "Theme"
382
- msgstr "Tema"
383
-
384
- #: includes/i18n.php:123
385
- msgid "Themes"
386
- msgstr "Temi"
387
-
388
- #: includes/i18n.php:124
389
- msgctxt "as file/folder path"
390
- msgid "Path"
391
- msgstr "Percorso"
392
-
393
- #: includes/i18n.php:125
394
- msgid "Title"
395
- msgstr "Titolo"
396
-
397
- #: includes/i18n.php:126
398
- msgid "Free version"
399
- msgstr "Versione gratuita"
400
-
401
- #: includes/i18n.php:127
402
- msgid "Premium version"
403
- msgstr "Versione premium"
404
-
405
- #: includes/i18n.php:128
406
- msgctxt "as WP plugin slug"
407
- msgid "Slug"
408
- msgstr "Slug"
409
-
410
- #: includes/i18n.php:129
411
- msgid "ID"
412
- msgstr "ID"
413
-
414
- #: includes/i18n.php:130
415
- msgid "Users"
416
- msgstr "Utenti"
417
-
418
- #: includes/i18n.php:131
419
- msgid "Plugin Installs"
420
- msgstr "Installazioni Plugin"
421
-
422
- #: includes/i18n.php:132
423
- msgid "%s Installs"
424
- msgstr "%s Installazioni"
425
-
426
- #: includes/i18n.php:133
427
- msgctxt "like websites"
428
- msgid "Sites"
429
- msgstr "Siti"
430
-
431
- #: includes/i18n.php:134
432
- msgid "User ID"
433
- msgstr "ID utente"
434
-
435
- #: includes/i18n.php:135
436
- msgid "Site ID"
437
- msgstr "ID del sito"
438
-
439
- #: includes/i18n.php:136
440
- msgid "Public Key"
441
- msgstr "Chiave pubblica"
442
-
443
- #: includes/i18n.php:137
444
- msgid "Secret Key"
445
- msgstr "Chiave segreta"
446
-
447
- #: includes/i18n.php:138
448
- msgctxt "as secret encryption key missing"
449
- msgid "No Secret"
450
- msgstr "Nessuna chiave"
451
-
452
- #: includes/i18n.php:139
453
- msgid "No ID"
454
- msgstr "Nessun ID"
455
-
456
- #: includes/i18n.php:140
457
- msgctxt "as synchronize license"
458
- msgid "Sync License"
459
- msgstr "Sincronizza la licenza"
460
-
461
- #: includes/i18n.php:141
462
- msgctxt "as synchronize"
463
- msgid "Sync"
464
- msgstr "Sincronizza"
465
-
466
- #: includes/i18n.php:142
467
- msgid "Activate License"
468
- msgstr "Attiva licenza"
469
-
470
- #: includes/i18n.php:143
471
- msgid "Activate Free Version"
472
- msgstr "Attiva versione gratuita"
473
-
474
- #: includes/i18n.php:144
475
- msgid "Please enter the license key that you received in the email right after the purchase:"
476
- msgstr "Per favore inserisci la chiave di licenza che hai ricevuto via mail subito dopo l'acquisto:"
477
-
478
- #: includes/i18n.php:145
479
- msgid "Activating license..."
480
- msgstr "Sto attivando la licenza..."
481
-
482
- #: includes/i18n.php:146
483
- msgid "Change License"
484
- msgstr "Cambia licenza"
485
-
486
- #: includes/i18n.php:147
487
- msgid "Update License"
488
- msgstr "Aggiorna licenza"
489
-
490
- #: includes/i18n.php:148
491
- msgid "Deactivate License"
492
- msgstr "Disattiva licenza"
493
-
494
- #: includes/i18n.php:149
495
- msgid "Activate"
496
- msgstr "Attiva"
497
-
498
- #: includes/i18n.php:150
499
- msgid "Deactivate"
500
- msgstr "Disattiva"
501
-
502
- #: includes/i18n.php:151
503
- msgid "Skip & Deactivate"
504
- msgstr "Salta e disattiva"
505
-
506
- #: includes/i18n.php:152
507
- msgid "Skip & %s"
508
- msgstr "Salta & %s"
509
-
510
- #: includes/i18n.php:153
511
- msgid "No - just deactivate"
512
- msgstr "No - disattiva e basta"
513
-
514
- #: includes/i18n.php:154
515
- msgid "Yes - do your thing"
516
- msgstr "Sì - fai pure"
517
-
518
- #: includes/i18n.php:155
519
- msgctxt "active mode"
520
- msgid "Active"
521
- msgstr "Attiva"
522
-
523
- #: includes/i18n.php:156
524
- msgctxt "is active mode?"
525
- msgid "Is Active"
526
- msgstr "è attiva"
527
-
528
- #: includes/i18n.php:157
529
- msgid "Install Now"
530
- msgstr "Installa ora"
531
-
532
- #: includes/i18n.php:158
533
- msgid "Install Update Now"
534
- msgstr "Installa l'aggiornamento ora"
535
-
536
- #: includes/i18n.php:159
537
- msgid "More information about %s"
538
- msgstr "Ulteriori informazioni su %s"
539
-
540
- #: includes/i18n.php:160
541
- msgid "Localhost"
542
- msgstr "Localhost"
543
-
544
- #: includes/i18n.php:161
545
- msgctxt "as activate Professional plan"
546
- msgid "Activate %s Plan"
547
- msgstr "Attivare il piano %s"
548
-
549
- #: includes/i18n.php:162
550
- msgctxt "as 5 licenses left"
551
- msgid "%s left"
552
- msgstr "%s rimanenti"
553
-
554
- #: includes/i18n.php:163
555
- msgid "Last license"
556
- msgstr "Ultima licenza"
557
-
558
- #: includes/i18n.php:164
559
- msgid "What is your %s?"
560
- msgstr "Qual è il tuo %s?"
561
-
562
- #: includes/i18n.php:165
563
- msgid "Activate this add-on"
564
- msgstr "Attivare questo addon"
565
-
566
- #: includes/i18n.php:166
567
- msgid "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?"
568
- msgstr "La disattivazione della licenza bloccherà tutte le funzionalità premium, ma vi permetterà di attivare la licenza su un altro sito. Sei sicuro di voler procedere?"
569
-
570
- #: includes/i18n.php:167
571
- msgid "Deleting the account will automatically deactivate your %s plan license so you can use it on other sites. If you want to terminate the recurring payments as well, click the \"Cancel\" button, and first \"Downgrade\" your account. Are you sure you would like to continue with the deletion?"
572
- msgstr "L'eliminazione dell'account disattiva automaticamente la tua licenza del piano %s quindi è possibile utilizzarlo su altri siti. Se si desidera anche terminare i pagamenti ricorrenti, fare clic sul pulsante \"Annulla\" ed effettuare il \"Downgrade\" del tuo account. Sei sicuro di voler continuare con l'eliminazione?"
573
-
574
- #: includes/i18n.php:168
575
- msgid "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?"
576
- msgstr "L'eliminazione non è temporanea. Cancella solo se non si desidera più utilizzare questo plugin. Sei sicuro di voler continuare con l'eliminazione?"
577
-
578
- #: includes/i18n.php:169
579
- msgid "Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s."
580
- msgstr "Effettuare il downgrade del piano interromperà immediatamente tutti i futuri pagamenti ricorrenti e la licenza del piano %s scadrà in %s."
581
-
582
- #: includes/i18n.php:170
583
- msgid "Cancelling the trial will immediately block access to all premium features. Are you sure?"
584
- msgstr "Cancellando il periodo di prova gratuito bloccherai immediatamente l'accesso a tutte le funzionalità premium. Vuoi continuare?"
585
-
586
- #: includes/i18n.php:171
587
- msgid "You can still enjoy all %s features but you will not have access to plugin updates and support."
588
- msgstr "Puoi ancora sfruttare tutte le funzionalità di %s, ma non avrai accesso al supporto ed agli aggiornamenti del plugin."
589
-
590
- #: includes/i18n.php:172
591
- msgid "Once your license expires you can still use the Free version but you will NOT have access to the %s features."
592
- msgstr "Quando la tua licenza scadrà, potrai comunque continuare a usare la versione gratuita, ma NON avrai accesso alle funzionalità %s."
593
-
594
- #: includes/i18n.php:173
595
- msgid "Are you sure you want to proceed?"
596
- msgstr "Sei sicuro di voler procedere?"
597
-
598
- #: includes/i18n.php:176
599
- msgid "Add Ons for %s"
600
- msgstr "Add-on per %s"
601
-
602
- #: includes/i18n.php:177
603
- msgid "We could'nt load the add-ons list. It's probably an issue on our side, please try to come back in few minutes."
604
- msgstr "Non siamo riusciti a caricare la lista degli add-on. Si tratta probabilmente di un problema nel nostro sistema, per favore riprova tra qualche minuto."
605
-
606
- #: includes/i18n.php:179
607
- msgid "Anonymous feedback"
608
- msgstr "Feedback anonimo"
609
-
610
- #: includes/i18n.php:180
611
- msgid "Quick feedback"
612
- msgstr "Feedback veloce"
613
-
614
- #: includes/i18n.php:181
615
- msgid "If you have a moment, please let us know why you are deactivating"
616
- msgstr "Se hai un momento, potresti dirci perché lo hai disattivato?"
617
-
618
- #: includes/i18n.php:182
619
- msgid "Yes - Deactivate"
620
- msgstr "Si - Disattiva"
621
-
622
- #: includes/i18n.php:183
623
- msgid "Submit & Deactivate"
624
- msgstr "Invia & Disattiva"
625
-
626
- #: includes/i18n.php:184
627
- msgid "Cancel"
628
- msgstr "Annulla"
629
-
630
- #: includes/i18n.php:185
631
- msgid "I no longer need the plugin"
632
- msgstr "Non ho piú bisogno di questo plugin"
633
-
634
- #: includes/i18n.php:186
635
- msgid "I found a better plugin"
636
- msgstr "Ho trovato un plugin migliore"
637
-
638
- #: includes/i18n.php:187
639
- msgid "I only needed the plugin for a short period"
640
- msgstr "Avevo bisogno del plugin solo per un breve periodo"
641
-
642
- #: includes/i18n.php:188
643
- msgid "The plugin broke my site"
644
- msgstr "Il plugin ha causato problemi al mio sito"
645
-
646
- #: includes/i18n.php:189
647
- msgid "The plugin suddenly stopped working"
648
- msgstr "Il plugin ha smesso di funzionare"
649
-
650
- #: includes/i18n.php:190
651
- msgid "I can't pay for it anymore"
652
- msgstr "Non posso piú pagarlo"
653
-
654
- #: includes/i18n.php:191
655
- msgid "It's a temporary deactivation. I'm just debugging an issue."
656
- msgstr "È una disattivazione temporanea. Sto solo cercando di risolvere un problema."
657
-
658
- #: includes/i18n.php:192
659
- msgctxt ""
660
- msgid "Other"
661
- msgstr "Altro"
662
-
663
- #: includes/i18n.php:194
664
- msgid "Kindly tell us the reason so we can improve."
665
- msgstr "Spiegandoci il motivo ci aiuterai a migliorare."
666
-
667
- #: includes/i18n.php:195
668
- msgid "What's the plugin's name?"
669
- msgstr "Qual è il nome del plugin?"
670
-
671
- #: includes/i18n.php:196
672
- msgid "What price would you feel comfortable paying?"
673
- msgstr "Che prezzo ritieni opportuno pagare?"
674
-
675
- #: includes/i18n.php:197
676
- msgid "I couldn't understand how to make it work"
677
- msgstr "Non capisco come farlo funzionare"
678
-
679
- #: includes/i18n.php:198
680
- msgid "The plugin is great, but I need specific feature that you don't support"
681
- msgstr "Il plugin é ottimo ma ho bisogno di una funzionalitá specifica che non é supportata"
682
-
683
- #: includes/i18n.php:199
684
- msgid "The plugin is not working"
685
- msgstr "Il plugin non funziona"
686
-
687
- #: includes/i18n.php:200
688
- msgid "It's not what I was looking for"
689
- msgstr "Non é quello che stavo cercando"
690
-
691
- #: includes/i18n.php:201
692
- msgid "The plugin didn't work as expected"
693
- msgstr "Il plugin non funziona come mi aspettavo"
694
-
695
- #: includes/i18n.php:202
696
- msgid "What feature?"
697
- msgstr "Quale funzionalitá?"
698
-
699
- #: includes/i18n.php:203
700
- msgid "Kindly share what didn't work so we can fix it for future users..."
701
- msgstr "Condividi cosa non ha funzionato in modo da migliorare il prodotto per gli utenti futuri..."
702
-
703
- #: includes/i18n.php:204
704
- msgid "What you've been looking for?"
705
- msgstr "Che cosa stai cercando?"
706
-
707
- #: includes/i18n.php:205
708
- msgid "What did you expect?"
709
- msgstr "Che cosa ti aspettavi?"
710
-
711
- #: includes/i18n.php:206
712
- msgid "The plugin didn't work"
713
- msgstr "Il plugin non funziona"
714
-
715
- #: includes/i18n.php:207
716
- msgid "I don't like to share my information with you"
717
- msgstr "Non voglio condividere i miei dati con te"
718
-
719
- #: includes/i18n.php:208
720
- msgid "You might have missed it, but you don't have to share any data and can just %s the opt-in."
721
- msgstr "Potresti non averci fatto caso, ma non sei obbligato a condividere i tuoi dati e puoi semplicemente %s la tua partecipazione."
722
-
723
- #: includes/i18n.php:212
724
- msgctxt "greeting"
725
- msgid "Hey %s,"
726
- msgstr "Hey %s,"
727
-
728
- #: includes/i18n.php:213
729
- msgctxt "a greeting. E.g. Thanks John!"
730
- msgid "Thanks %s!"
731
- msgstr "Grazie %s!"
732
-
733
- #: includes/i18n.php:214
734
- msgid "Never miss an important update - opt-in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s."
735
- msgstr "Non perdere nessun aggiornamento importante - iscriviti per ricevere notifiche su aggiornamenti relativi alla sicurezza e nuove versioni, oltre al tracciamento di diagnostica non sensibile con %4$s."
736
-
737
- #: includes/i18n.php:215
738
- msgid "Please help us improve %1$s! If you opt-in, some data about your usage of %1$s will be sent to %4$s. If you skip this, that's okay! %1$s will still work just fine."
739
- msgstr "Aiutaci a migliorare %1$s! Se ti iscrivi, alcuni dati riguardanti il tuo utilizzo di %1$s verranno inviati a %4$s. Se salti questo passaggio, non c'è problema! %1$s funzionerà ugualmente."
740
-
741
- #: includes/i18n.php:216
742
- msgid "You should receive an activation email for %s to your mailbox at %s. Please make sure you click the activation button in that email to %s."
743
- msgstr "Dovresti ricevere un'email di attivazione di %s all'indirizzo %s. Assicurati di fare clic sul pulsante di attivazione nell'email per %s."
744
-
745
- #: includes/i18n.php:217
746
- msgid "complete the install"
747
- msgstr "completa l'installazione"
748
-
749
- #: includes/i18n.php:218
750
- msgid "start the trial"
751
- msgstr "Inizia il periodo di prova gratuito"
752
-
753
- #: includes/i18n.php:219
754
- msgid "Thanks for purchasing %s! To get started, please enter your license key:"
755
- msgstr "Grazie per aver acquistato %s! Per iniziare, per favore inserisci la tua chiave di licenza:"
756
-
757
- #: includes/i18n.php:220
758
- msgid "The plugin will be periodically sending data to %s to check for plugin updates and verify the validity of your license."
759
- msgstr "Il plugin invierà dati periodicamente a %s per controllare l'esistenza di aggiornamenti e verificare la validità della tua licenza."
760
-
761
- #: includes/i18n.php:221
762
- msgid "What permissions are being granted?"
763
- msgstr "Quali autorizzazioni vengono concesse?"
764
-
765
- #: includes/i18n.php:222
766
- msgid "Your Profile Overview"
767
- msgstr "Panoramica del tuo profilo"
768
-
769
- #: includes/i18n.php:223
770
- msgid "Name and email address"
771
- msgstr "Nome ed indirizzo email"
772
-
773
- #: includes/i18n.php:224
774
- msgid "Your Site Overview"
775
- msgstr "Panoramica del tuo sito"
776
-
777
- #: includes/i18n.php:225
778
- msgid "Site URL, WP version, PHP info, plugins & themes"
779
- msgstr "URL del sito, versione di WP, informazioni PHP, plugin e temi"
780
-
781
- #: includes/i18n.php:226
782
- msgid "Current Plugin Events"
783
- msgstr "Eventi correnti del plugin"
784
-
785
- #: includes/i18n.php:227
786
- msgid "Activation, deactivation and uninstall"
787
- msgstr "Attiva, disattivazione e disinstallazione"
788
-
789
- #: includes/i18n.php:228
790
- msgid "Plugins & Themes"
791
- msgstr "Plugin e temi"
792
-
793
- #: includes/i18n.php:229
794
- msgid "Titles, versions and state."
795
- msgstr "Titoli, versioni e stato."
796
-
797
- #: includes/i18n.php:230
798
- msgid "Admin Notices"
799
- msgstr "Avvisi amministratore"
800
-
801
- #: includes/i18n.php:231
802
- msgid "Newsletter"
803
- msgstr "Newsletter"
804
-
805
- #: includes/i18n.php:232
806
- msgid "Updates, announcements, marketing, no spam"
807
- msgstr "Aggiornamenti, annunci, marketing, no spam"
808
-
809
- #: includes/i18n.php:233
810
- msgid "Privacy Policy"
811
- msgstr "Politica sulla privacy"
812
-
813
- #: includes/i18n.php:234
814
- msgid "Terms of Service"
815
- msgstr "Termini del Servizio"
816
-
817
- #: includes/i18n.php:235
818
- msgctxt "as activating plugin"
819
- msgid "Activating"
820
- msgstr "Attivazione"
821
-
822
- #: includes/i18n.php:236
823
- msgctxt "as in the process of sending an email"
824
- msgid "Sending email"
825
- msgstr "Invio email"
826
-
827
- #: includes/i18n.php:237
828
- msgctxt "button label"
829
- msgid "Allow & Continue"
830
- msgstr "Consenti & Continua"
831
-
832
- #: includes/i18n.php:238
833
- msgctxt "button label"
834
- msgid "Agree & Activate License"
835
- msgstr "Accetta e attiva la licenza"
836
-
837
- #: includes/i18n.php:239
838
- msgctxt "verb"
839
- msgid "Skip"
840
- msgstr "Salta"
841
-
842
- #: includes/i18n.php:240
843
- msgid "Click here to use the plugin anonymously"
844
- msgstr "Fai clic qui per usare il plugin anonimamente"
845
-
846
- #: includes/i18n.php:241
847
- msgid "Re-send activation email"
848
- msgstr "Invia nuovamente l'email di attivazione"
849
-
850
- #: includes/i18n.php:242
851
- msgid "License key"
852
- msgstr "Chiave di licenza"
853
-
854
- #: includes/i18n.php:243
855
- msgid "Send License Key"
856
- msgstr "Invia chiave di licenza"
857
-
858
- #: includes/i18n.php:244
859
- msgid "Sending license key"
860
- msgstr "Invio chiave di licenza"
861
-
862
- #: includes/i18n.php:245
863
- msgid "Have a license key?"
864
- msgstr "Hai una chiave di licenza?"
865
-
866
- #: includes/i18n.php:246
867
- msgid "Don't have a license key?"
868
- msgstr "Non hai una chiave di licenza?"
869
-
870
- #: includes/i18n.php:247
871
- msgid "Can't find your license key?"
872
- msgstr "Non trovi la tua chiave di licenza?"
873
-
874
- #: includes/i18n.php:248
875
- msgid "We couldn't find your email address in the system, are you sure it's the right address?"
876
- msgstr "Non siamo riusciti a trovare il tuo indirizzo email nel sistema, sei sicuro che sia l'indirizzo giusto?"
877
-
878
- #: includes/i18n.php:249
879
- msgid "We can't see any active licenses associated with that email address, are you sure it's the right address?"
880
- msgstr "Non siamo riusciti a trovare alcuna licenza attiva associata al tuo indirizzo email, sei sicuro che sia l'indirizzo giusto?"
881
-
882
- #: includes/i18n.php:250
883
- msgid "Opt In"
884
- msgstr "Iscriviti"
885
-
886
- #: includes/i18n.php:251
887
- msgid "Opt Out"
888
- msgstr "Cancella iscrizione"
889
-
890
- #: includes/i18n.php:252
891
- msgid "On second thought - I want to continue helping"
892
- msgstr "Ci ho ripensato, voglio continuare a fornire il mio aiuto"
893
-
894
- #: includes/i18n.php:253
895
- msgid "Opting out..."
896
- msgstr "Cancellamento dell'iscrizione..."
897
-
898
- #: includes/i18n.php:254
899
- msgid "Opting in..."
900
- msgstr "Iscrizione in corso..."
901
-
902
- #: includes/i18n.php:255
903
- msgid "We appreciate your help in making the %s better by letting us track some usage data."
904
- msgstr "Ti ringraziamo per averci concesso di tracciare alcuni dati di utilizzo al fine di migliorare %s"
905
-
906
- #: includes/i18n.php:256
907
- msgid "Usage tracking is done in the name of making %s better. Making a better user experience, prioritizing new features, and more good things. We'd really appreciate if you'll reconsider letting us continue with the tracking."
908
- msgstr "Tracciamo l'utilizzo esclusivamente per rendere %s migliore, creando una migliore esperienza utente e dando priorità a nuove funzionalità, oltre a molte altre buone cose. Saremmo veramente felici di vederti cambiare idea e lasciarci continuare con il tracciamento."
909
-
910
- #: includes/i18n.php:257
911
- msgid "By clicking \"Opt Out\", we will no longer be sending any data from %s to %s."
912
- msgstr "Cliccando su \"Cancella iscrizione\", non invieremo più nessuna informazione da %s a %s."
913
-
914
- #: includes/i18n.php:261
915
- msgid "Screenshots"
916
- msgstr "Screenshots"
917
-
918
- #: includes/i18n.php:262
919
- msgid "Click to view full-size screenshot %d"
920
- msgstr "Fare clic per visualizzare lo screenshot in grandi dimensioni %d"
921
-
922
- #: includes/i18n.php:266
923
- msgid "Freemius Debug"
924
- msgstr "Debug Freemius"
925
-
926
- #: includes/i18n.php:267
927
- msgctxt "as turned on"
928
- msgid "On"
929
- msgstr "Attivo"
930
-
931
- #: includes/i18n.php:268
932
- msgctxt "as turned off"
933
- msgid "Off"
934
- msgstr "Non attivo"
935
-
936
- #: includes/i18n.php:269
937
- msgctxt "as code debugging"
938
- msgid "Debugging"
939
- msgstr "Debugging"
940
-
941
- #: includes/i18n.php:270
942
- msgid "Freemius State"
943
- msgstr "Stato di Freemius"
944
-
945
- #: includes/i18n.php:271
946
- msgctxt "as connection was successful"
947
- msgid "Connected"
948
- msgstr "Connesso"
949
-
950
- #: includes/i18n.php:272
951
- msgctxt "as connection blocked"
952
- msgid "Blocked"
953
- msgstr "Bloccato"
954
-
955
- #: includes/i18n.php:273
956
- msgctxt "as application program interface"
957
- msgid "API"
958
- msgstr "API"
959
-
960
- #: includes/i18n.php:274
961
- msgctxt "as software development kit versions"
962
- msgid "SDK"
963
- msgstr "SDK"
964
-
965
- #: includes/i18n.php:275
966
- msgctxt "as software development kit versions"
967
- msgid "SDK Versions"
968
- msgstr "Versioni SDK"
969
-
970
- #: includes/i18n.php:276
971
- msgctxt "as plugin folder path"
972
- msgid "Plugin Path"
973
- msgstr "Percorso del plugin"
974
-
975
- #: includes/i18n.php:277
976
- msgctxt "as sdk path"
977
- msgid "SDK Path"
978
- msgstr "Percorso SDK"
979
-
980
- #: includes/i18n.php:278
981
- msgid "Add Ons of Plugin %s"
982
- msgstr "Add-on del Plugin %s"
983
-
984
- #: includes/i18n.php:279
985
- msgid "Are you sure you want to delete all Freemius data?"
986
- msgstr "Sei sicuro di voler eliminare tutti i dati di Freemius?"
987
-
988
- #: includes/i18n.php:280
989
- msgid "Actions"
990
- msgstr "Azioni"
991
-
992
- #: includes/i18n.php:281
993
- msgid "Delete All Accounts"
994
- msgstr "Eliminare tutti gli account"
995
-
996
- #: includes/i18n.php:282
997
- msgid "Start Fresh"
998
- msgstr "Inizia da capo"
999
-
1000
- #: includes/i18n.php:283
1001
- msgid "Clear API Cache"
1002
- msgstr "Elimina cache API"
1003
-
1004
- #: includes/i18n.php:284
1005
- msgid "Sync Data From Server"
1006
- msgstr "Sincronizza i dati dal server"
1007
-
1008
- #: includes/i18n.php:285
1009
- msgid "Scheduled Crons"
1010
- msgstr "Azioni programmate"
1011
-
1012
- #: includes/i18n.php:286
1013
- msgid "Cron Type"
1014
- msgstr "Tipo di Cron"
1015
-
1016
- #: includes/i18n.php:287
1017
- msgid "Plugins & Themes Sync"
1018
- msgstr "Sincronizzazione plugin e temi"
1019
-
1020
- #: includes/i18n.php:288
1021
- msgid "Licenses"
1022
- msgstr "Licenze"
1023
-
1024
- #: includes/i18n.php:289
1025
- msgid "Debug Log"
1026
- msgstr "Debug Log"
1027
-
1028
- #: includes/i18n.php:290
1029
- msgid "All"
1030
- msgstr "Tutto"
1031
-
1032
- #: includes/i18n.php:291
1033
- msgid "File"
1034
- msgstr "File"
1035
-
1036
- #: includes/i18n.php:292
1037
- msgid "Function"
1038
- msgstr "Funzione"
1039
-
1040
- #: includes/i18n.php:293
1041
- msgid "Process ID"
1042
- msgstr "ID processo"
1043
-
1044
- #: includes/i18n.php:294
1045
- msgid "Logger"
1046
- msgstr "Logger"
1047
-
1048
- #: includes/i18n.php:295
1049
- msgid "Message"
1050
- msgstr "Messaggio"
1051
-
1052
- #: includes/i18n.php:296
1053
- msgid "Download"
1054
- msgstr "Download"
1055
-
1056
- #: includes/i18n.php:297
1057
- msgid "Filter"
1058
- msgstr "Filtro"
1059
-
1060
- #: includes/i18n.php:298
1061
- msgid "Type"
1062
- msgstr "Tipo"
1063
-
1064
- #: includes/i18n.php:299
1065
- msgid "All Types"
1066
- msgstr "Tutti i tipi"
1067
-
1068
- #: includes/i18n.php:300
1069
- msgid "All Requests"
1070
- msgstr "Tutte le richieste"
1071
-
1072
- #: includes/i18n.php:304
1073
- msgctxt "as congratulations"
1074
- msgid "Congrats"
1075
- msgstr "Congratulazioni"
1076
-
1077
- #: includes/i18n.php:305
1078
- msgctxt "exclamation"
1079
- msgid "Oops"
1080
- msgstr "Ops"
1081
-
1082
- #: includes/i18n.php:306
1083
- msgctxt "interjection expressing joy or exuberance"
1084
- msgid "Yee-haw"
1085
- msgstr "Evvai"
1086
-
1087
- #: includes/i18n.php:307
1088
- msgctxt ""
1089
- msgid "W00t"
1090
- msgstr "Forte"
1091
-
1092
- #: includes/i18n.php:309
1093
- msgctxt "a positive response"
1094
- msgid "Right on"
1095
- msgstr "Sì"
1096
-
1097
- #: includes/i18n.php:310
1098
- msgctxt ""
1099
- msgid "Hmm"
1100
- msgstr "Uhm"
1101
-
1102
- #: includes/i18n.php:312
1103
- msgid "O.K"
1104
- msgstr "OK"
1105
-
1106
- #: includes/i18n.php:313
1107
- msgctxt "exclamation"
1108
- msgid "Hey"
1109
- msgstr "Hey"
1110
-
1111
- #: includes/i18n.php:314
1112
- msgctxt "advance notice of something that will need attention."
1113
- msgid "Heads up"
1114
- msgstr "Attenzione"
1115
-
1116
- #: includes/i18n.php:319
1117
- msgid "Seems like you got the latest release."
1118
- msgstr "Sembra che tu abbia la versione più recente."
1119
-
1120
- #: includes/i18n.php:320
1121
- msgid "You are all good!"
1122
- msgstr "Sei fantastico!"
1123
-
1124
- #: includes/i18n.php:321
1125
- msgid "Sorry, we could not complete the email update. Another user with the same email is already registered."
1126
- msgstr "Siamo spiacenti, non siamo riusciti a completare l'aggiornamento via email. Un altro utente con lo stesso indirizzo email è già registrato."
1127
-
1128
- #: includes/i18n.php:322
1129
- msgid "If you would like to give up the ownership of the plugin's account to %s click the Change Ownership button."
1130
- msgstr "Se vuoi cedere la proprietá dell'account del plugin a %s clicca su Cambia Proprietà."
1131
-
1132
- #: includes/i18n.php:323
1133
- msgid "Your email was successfully updated. You should receive an email with confirmation instructions in few moments."
1134
- msgstr "Il tuo indirizzo email è stato aggiornato correttamente. Riceverai un'email con le istruzioni di conferma in pochi istanti."
1135
-
1136
- #: includes/i18n.php:324
1137
- msgid "Your name was successfully updated."
1138
- msgstr "Il tuo nome è stato aggiornato correttamente."
1139
-
1140
- #: includes/i18n.php:325
1141
- msgid "You have successfully updated your %s."
1142
- msgstr "Hai aggiornato con successo il tuo %s."
1143
-
1144
- #: includes/i18n.php:326
1145
- msgid "Please provide your full name."
1146
- msgstr "Per favore inserisci il tuo nome completo."
1147
-
1148
- #: includes/i18n.php:327
1149
- msgid "Verification mail was just sent to %s. If you can't find it after 5 min, please check your spam box."
1150
- msgstr "L'email di verifica è stata inviata a %s. Se dopo 5 minuti non è ancora arrivata, per favore controlla nella tua casella di posta indesiderata."
1151
-
1152
- #: includes/i18n.php:328
1153
- msgid "Just letting you know that the add-ons information of %s is being pulled from an external server."
1154
- msgstr "Le informazioni sugli add-on di %s vengono scaricate da un server esterno."
1155
-
1156
- #: includes/i18n.php:329
1157
- msgid "No credit card required"
1158
- msgstr "Nessuna carta di credito richiesta"
1159
-
1160
- #: includes/i18n.php:330
1161
- msgid "Premium plugin version was successfully activated."
1162
- msgstr "La versione Premium del plugin è stata attivata correttamente."
1163
-
1164
- #: includes/i18n.php:331
1165
- msgid "The upgrade of %s was successfully completed."
1166
- msgstr "L'aggiornamento di %s è stato completato con successo."
1167
-
1168
- #: includes/i18n.php:332
1169
- msgid "Your account was successfully activated with the %s plan."
1170
- msgstr "Il tuo account è stato attivato correttamente con il piano %s."
1171
-
1172
- #: includes/i18n.php:333
1173
- msgid "Download the latest %s version now"
1174
- msgstr "Scarica l'ultima versione di %s"
1175
-
1176
- #: includes/i18n.php:334
1177
- msgid "Please follow these steps to complete the upgrade"
1178
- msgstr "Segui i passi seguenti per completare l'aggiornamento"
1179
-
1180
- #: includes/i18n.php:335
1181
- msgid "Download the latest %s version"
1182
- msgstr "Scarica l'ultima versione di %s"
1183
-
1184
- #: includes/i18n.php:336
1185
- msgid "Download the latest version"
1186
- msgstr "Scarica l'ultima versione"
1187
-
1188
- #: includes/i18n.php:337
1189
- msgid "Deactivate the free version"
1190
- msgstr "Disattiva la versione gratuita"
1191
-
1192
- #: includes/i18n.php:338
1193
- msgid "Upload and activate the downloaded version"
1194
- msgstr "Carica e attiva la versione scaricata"
1195
-
1196
- #: includes/i18n.php:339
1197
- msgid "How to upload and activate?"
1198
- msgstr "Come faccio a caricare ed attivare?"
1199
-
1200
- #: includes/i18n.php:340
1201
- msgctxt "%s - product name, e.g. Facebook add-on was successfully..."
1202
- msgid "%s Add-on was successfully purchased."
1203
- msgstr "L' add-on %s è stato acquistato con successo."
1204
-
1205
- #: includes/i18n.php:342
1206
- msgid "Your %s Add-on plan was successfully upgraded."
1207
- msgstr "Il piano del tuo add-on %s è stato aggiornato con successo."
1208
-
1209
- #: includes/i18n.php:343
1210
- msgid "Your email has been successfully verified - you are AWESOME!"
1211
- msgstr "Il tuo indirizzo email è stato verificato con successo - SEI UN GRANDE!"
1212
-
1213
- #: includes/i18n.php:344
1214
- msgid "Your plan was successfully upgraded."
1215
- msgstr "Il piano è stato aggiornato con successo."
1216
-
1217
- #: includes/i18n.php:345
1218
- msgid "Your plan was successfully changed to %s."
1219
- msgstr "Il piano è stato cambiato con successo a %s."
1220
-
1221
- #: includes/i18n.php:346
1222
- msgid "Your license has expired. You can still continue using the free plugin forever."
1223
- msgstr "La licenza è scaduta. È comunque possibile continuare ad utilizzare il plugin gratuito per sempre."
1224
-
1225
- #: includes/i18n.php:347
1226
- msgid "Your license has been cancelled. If you think it's a mistake, please contact support."
1227
- msgstr "La tua licenza è stata cancellata. Se credi sia un errore, per favore contatta il supporto."
1228
-
1229
- #: includes/i18n.php:348
1230
- msgid "Your trial has been successfully started."
1231
- msgstr "La versione di prova è stata avviata correttamente."
1232
-
1233
- #: includes/i18n.php:349
1234
- msgid "Your license was successfully activated."
1235
- msgstr "La tua licenza è stata attivata correttamente."
1236
-
1237
- #: includes/i18n.php:350
1238
- msgid "It looks like your site currently doesn't have an active license."
1239
- msgstr "Sembra che il tuo sito non disponga di alcuna licenza attiva."
1240
-
1241
- #: includes/i18n.php:351
1242
- msgid "Your license was successfully deactivated, you are back to the %s plan."
1243
- msgstr "La tua licenza é stata disattivata con successo, sei tornato al piano %s."
1244
-
1245
- #: includes/i18n.php:352
1246
- msgid "It looks like the license deactivation failed."
1247
- msgstr "Sembra che la disattivazione della licenza non sia riuscita."
1248
-
1249
- #: includes/i18n.php:353
1250
- msgid "It looks like the license could not be activated."
1251
- msgstr "Sembra che la licenza non possa essere attivata."
1252
-
1253
- #: includes/i18n.php:354
1254
- msgid "Error received from the server:"
1255
- msgstr "Errore ricevuto dal server:"
1256
-
1257
- #: includes/i18n.php:355
1258
- msgid "Your trial has expired. You can still continue using all our free features."
1259
- msgstr "La versione di prova è scaduta. Si può comunque continuare a utilizzare tutte le nostre funzioni gratuite."
1260
-
1261
- #: includes/i18n.php:356
1262
- msgid "Your plan was successfully downgraded. Your %s plan license will expire in %s."
1263
- msgstr "Il tuo piano è stato declassato con successo. La licenza del piano %s scadrà in %s."
1264
-
1265
- #: includes/i18n.php:357
1266
- msgid "Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes."
1267
- msgstr "Stiamo avendo qualche problema temporaneo con il downgrade del piano. Riprova tra qualche minuto."
1268
-
1269
- #: includes/i18n.php:358
1270
- msgid "It looks like you are not in trial mode anymore so there's nothing to cancel :)"
1271
- msgstr "Sembra che tu non stia più usando la prova gratuita, quindi non c'è niente che tu debba annullare :)"
1272
-
1273
- #: includes/i18n.php:359
1274
- msgid "Your %s free trial was successfully cancelled."
1275
- msgstr "Il tuo periodo di prova gratuito %s è stato annullato con successo."
1276
-
1277
- #: includes/i18n.php:360
1278
- msgctxt "%s - numeric version number"
1279
- msgid "Version %s was released."
1280
- msgstr "La versione %s é stata rilasciata."
1281
-
1282
- #: includes/i18n.php:361
1283
- msgid "Please download %s."
1284
- msgstr "Scarica %s."
1285
-
1286
- #: includes/i18n.php:362
1287
- msgctxt "%s - plan name, as the latest professional version here"
1288
- msgid "the latest %s version here"
1289
- msgstr "l'ultima versione %s é quì"
1290
-
1291
- #: includes/i18n.php:364
1292
- msgid "How do you like %s so far? Test all our %s premium features with a %d-day free trial."
1293
- msgstr "Come sta andando con %s? Prova tutte le funzionalità premium di %s con una prova gratuita di %d giorni."
1294
-
1295
- #: includes/i18n.php:365
1296
- msgctxt "call to action"
1297
- msgid "Start free trial"
1298
- msgstr "Inizia il periodo di prova gratuito"
1299
-
1300
- #: includes/i18n.php:366
1301
- msgid "Starting trial"
1302
- msgstr "Inizio del periodo di prova gratuito"
1303
-
1304
- #: includes/i18n.php:367
1305
- msgid "Please wait"
1306
- msgstr "Attendere"
1307
-
1308
- #: includes/i18n.php:368
1309
- msgid "Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes."
1310
- msgstr "Stiamo avendo qualche problema temporaneo con l'annullamento del periodo di prova. Riprova tra qualche minuto."
1311
-
1312
- #: includes/i18n.php:369
1313
- msgid "You already utilized a trial before."
1314
- msgstr "Hai già utilizzato una prova gratuita in passato."
1315
-
1316
- #: includes/i18n.php:370
1317
- msgid "You are already running the plugin in a trial mode."
1318
- msgstr "Stai già usando il plugin in modalità di prova gratuita."
1319
-
1320
- #: includes/i18n.php:371
1321
- msgid "Plan %s do not exist, therefore, can't start a trial."
1322
- msgstr "Il piano %s non esiste, per questo motivo non è possibile iniziare il periodo di prova."
1323
-
1324
- #: includes/i18n.php:372
1325
- msgid "Plan %s does not support a trial period."
1326
- msgstr "Il piano %s non supporta il periodo di prova."
1327
-
1328
- #: includes/i18n.php:373
1329
- msgid "None of the plugin's plans supports a trial period."
1330
- msgstr "Non esiste alcun piano del plugin che offra il periodo di prova."
1331
-
1332
- #: includes/i18n.php:374
1333
- msgid "Unexpected API error. Please contact the plugin's author with the following error."
1334
- msgstr "Errore inaspettato dell'API. Per favore contatta l'autore del plugin riportando il seguente errore."
1335
-
1336
- #: includes/i18n.php:375
1337
- msgid "No commitment for %s days - cancel anytime!"
1338
- msgstr "Nessun impegno per %s giorni - puoi annullare in qualsiasi momento!"
1339
-
1340
- #: includes/i18n.php:376
1341
- msgid "Your license has expired. You can still continue using all the %s features, but you'll need to renew your license to continue getting updates and support."
1342
- msgstr "La licenza è scaduta. È comunque possibile continuare a utilizzare tutte le funzionalità di %s, ma sarà necessario rinnovare la licenza per continuare a ricevere gli aggiornamenti ed il supporto."
1343
-
1344
- #: includes/i18n.php:377
1345
- msgid "Couldn't activate %s."
1346
- msgstr "Non é stato possibile attivare %s."
1347
-
1348
- #: includes/i18n.php:378
1349
- msgid "Please contact us with the following message:"
1350
- msgstr "Contattaci con il seguente messaggio:"
1351
-
1352
- #: includes/i18n.php:379
1353
- msgid "It looks like you are still on the %s plan. If you did upgrade or change your plan, it's probably an issue on our side - sorry."
1354
- msgstr "Sembra che tu sia ancora usando il piano %s. Se hai effettuato un upgrade o cambiato il piano, è probabile che ci sia un problema nei nostri sistemi."
1355
-
1356
- #: includes/i18n.php:380
1357
- msgid "Please contact us here"
1358
- msgstr "Contattaci qui"
1359
-
1360
- #: includes/i18n.php:381
1361
- msgid "I have upgraded my account but when I try to Sync the License, the plan remains %s."
1362
- msgstr "Ho aggiornato il mio account, ma quando cerco di sincronizzare la licenza, il piano rimane %s."
1363
-
1364
- #: includes/i18n.php:384
1365
- msgid "From unknown reason, the API connectivity test failed."
1366
- msgstr "Il test di connettività dell'API ha fallito per motivi sconosciuti."
1367
-
1368
- #: includes/i18n.php:385
1369
- msgid "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?"
1370
- msgstr "Si tratta probabilmente di un problema nei nostri sistemi. Per esserne sicuri, potresti darci il permesso di effettuare un ulteriore test della connettività? "
1371
-
1372
- #: includes/i18n.php:386
1373
- msgid "We use PHP cURL library for the API calls, which is a very common library and usually installed and activated out of the box. Unfortunately, cURL is not activated (or disabled) on your server."
1374
- msgstr "We use PHP cURL library for the API calls, which is a very common library and usually installed and activated out of the box. Unfortunately, cURL is not activated (or disabled) on your server."
1375
-
1376
- #: includes/i18n.php:387
1377
- msgid "Disabled method(s):"
1378
- msgstr "Disabled method(s):"
1379
-
1380
- #: includes/i18n.php:388
1381
- msgid "From unknown reason, CloudFlare, the firewall we use, blocks the connection."
1382
- msgstr "Per un motivo sconosciuto, CloudFlare, il firewall che utilizziamo, blocca la connessione."
1383
-
1384
- #: includes/i18n.php:389
1385
- msgctxt "as pluginX requires an access to our API"
1386
- msgid "%s requires an access to our API."
1387
- msgstr "%s richiede un accesso alla nostra API."
1388
-
1389
- #: includes/i18n.php:391
1390
- msgid "It looks like your server is using Squid ACL (access control lists), which blocks the connection."
1391
- msgstr "Sembra che il tuo server stia usando Squid ACL (lista per il controllo degli accessi) il quale blocca la connessione."
1392
-
1393
- #: includes/i18n.php:392
1394
- msgid "I don't know what is Squid or ACL, help me!"
1395
- msgstr "Non ho idea di cosa sia Squid o ACL, aiutami!"
1396
-
1397
- #: includes/i18n.php393, includes/i18n.php:397
1398
- msgid "We'll make sure to contact your hosting company and resolve the issue. You will get a follow-up email to %s once we have an update."
1399
- msgstr "Contatteremo il tuo hosting e risolveremo il problema. Riceverai un' email a %s non appena ci saranno aggiornamenti."
1400
-
1401
- #: includes/i18n.php:394
1402
- msgid "I'm a system administrator"
1403
- msgstr "Sono un sistemista"
1404
-
1405
- #: includes/i18n.php:395
1406
- msgid "Great, please whitelist the following domains: %s. Once you are done, deactivate the plugin and activate it again."
1407
- msgstr "Perfetto, ora per favore aggiungi alla whitelist i seguenti domini: %s. Quando hai fatto, disattiva il plugin e riattivalo di nuovo."
1408
-
1409
- #: includes/i18n.php:396
1410
- msgid "I don't know what is cURL or how to install it, help me!"
1411
- msgstr "Non ho idea di cosa sia cURL o come installarlo, aiutami!"
1412
-
1413
- #: includes/i18n.php:398
1414
- msgid "Great, please install cURL and enable it in your php.ini file. In addition, search for the 'disable_functions' directive in your php.ini file and remove any disabled methods starting with 'curl_'. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the plugin and reactivate it back again."
1415
- msgstr "Great, please install cURL and enable it in your php.ini file. In addition, search for the 'disable_functions' directive in your php.ini file and remove any disabled methods starting with 'curl_'. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the plugin and reactivate it back again."
1416
-
1417
- #: includes/i18n.php:399
1418
- msgid "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."
1419
- msgstr "Siamo sicuri che sia un nostro problema e siamo più che felici di risolverlo per te al più presto. Per poter procedere abbiamo bisogno del tuo consenso."
1420
-
1421
- #: includes/i18n.php:400
1422
- msgid "Sorry for the inconvenience and we are here to help if you give us a chance."
1423
- msgstr "Siamo spiacenti per l'inconveniente e siamo qui per aiutarti con il tuo permesso."
1424
-
1425
- #: includes/i18n.php:401
1426
- msgid "Yes - I'm giving you a chance to fix it"
1427
- msgstr "Sì - sto dandovi la possibilità di risolvere il problema"
1428
-
1429
- #: includes/i18n.php:402
1430
- msgid "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."
1431
- msgstr "Faremo del nostro meglio per mettere il server in whitelist e risolvere il problema il prima possibile. Avrai un aggiornamento dello stato tramite email all'indirizzo %s."
1432
-
1433
- #: includes/i18n.php:403
1434
- msgid "Let's try your previous version"
1435
- msgstr "Proviamo con la versione precedente"
1436
-
1437
- #: includes/i18n.php:404
1438
- msgid "Uninstall this version and install the previous one."
1439
- msgstr "Disinstalla questa versione e installa quella precedente."
1440
-
1441
- #: includes/i18n.php:405
1442
- msgid "That's exhausting, please deactivate"
1443
- msgstr "È estenuante, disattivalo"
1444
-
1445
- #: includes/i18n.php:406
1446
- msgid "We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future."
1447
- msgstr "Capiamo la tua frustrazione e ci scusiamo per l'inconveniente. Speriamo di rivederti nuovamente in futuro."
1448
-
1449
- #: includes/i18n.php:407
1450
- msgid "Thank for giving us the chance to fix it! A message was just sent to our technical staff. We will get back to you as soon as we have an update to %s. Appreciate your patience."
1451
- msgstr "Grazie per averci dato la possibilità di risolvere il problema! È stato appena inviato un messaggio al nostro staff tecnico. Ti risponderemo non appena avremo un aggiornamento riguardante %s. Grazie per la tua pazienza."
1452
-
1453
- #: includes/i18n.php:408
1454
- msgctxt "%1s - plugin title, %2s - API domain"
1455
- msgid "Your server is blocking the access to Freemius' API, which is crucial for %1s synchronization. Please contact your host to whitelist %2s"
1456
- msgstr "Il tuo server sta bloccando l'accesso all'API di Freemius. L'accesso è cruciale per quanto riguarda la la sincronizzazione di %1s. Per favore contatta il tuo host per aggiungere %2s alla whitelist."
1457
-
1458
- #: includes/i18n.php:410
1459
- msgid "It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again."
1460
- msgstr "Sembra che uno dei parametri di autenticazione sia sbagliato. Aggiorna la tua chiave pubblica, Secret Key & User ID e riprova."
1461
-
1462
- #: includes/i18n.php:413
1463
- msgid "Please check your mailbox, you should receive an email via %s to confirm the ownership change. From security reasons, you must confirm the change within the next 15 min. If you cannot find the email, please check your spam folder."
1464
- msgstr "Verifica di aver ricevuto l'email da %s per confermare il cambiamento del proprietario. Per ragioni di sicurezza devi confermare il cambiamento entro 15 minuti. Se non trovi l'email controlla nella posta indesiderata."
1465
-
1466
- #: includes/i18n.php:414
1467
- msgid "Thanks for confirming the ownership change. An email was just sent to %s for final approval."
1468
- msgstr "Grazie per aver confermato il cambiamento del proprietario. Un' email è stata appena inviata a %s per la conferma finale."
1469
-
1470
- #: includes/i18n.php:415
1471
- msgid "%s is the new owner of the account."
1472
- msgstr "%s è il nuovo proprietario dell'account."
1473
-
1474
- #: includes/i18n.php:417
1475
- msgctxt "addonX cannot run without pluginY"
1476
- msgid "%s cannot run without %s."
1477
- msgstr "%s non può funzionare senza %s."
1478
-
1479
- #: includes/i18n.php:419
1480
- msgctxt "addonX cannot run..."
1481
- msgid "%s cannot run without the plugin."
1482
- msgstr "%s non può funzionare senza il plugin."
1483
-
1484
- #: includes/i18n.php:420
1485
- msgctxt "pluginX activation was successfully..."
1486
- msgid "%s activation was successfully completed."
1487
- msgstr "%s è stato attivato con successo."
1488
-
1489
- #: includes/i18n.php:422
1490
- msgctxt "Plugin installer section title"
1491
- msgid "Features & Pricing"
1492
- msgstr "Caratteristiche & prezzi"
1493
-
1494
- #: includes/i18n.php:423
1495
- msgid "Add-on must be deployed to WordPress.org or Freemius."
1496
- msgstr "L'add-on dev'essere distribuito da WordPress.org o Freemius."
1497
-
1498
- #: includes/i18n.php:424
1499
- msgid "Paid add-on must be deployed to Freemius."
1500
- msgstr "Gli add-on a pagamento devono essere distribuiti da Freemius."
1501
-
1502
- #: includes/i18n.php:428
1503
- msgid "%s is a premium only add-on. You have to purchase a license first before activating the plugin."
1504
- msgstr "%s è un add-on premium. Devi comprare una licenza prima di poter attivare il plugin."
1505
-
1506
- #: includes/i18n.php:429
1507
- msgid "%s free trial was successfully cancelled. Since the add-on is premium only it was automatically deactivated. If you like to use it in the future, you'll have to purchase a license."
1508
- msgstr "Il periodo di prova gratuito %s è stato annullato con successo. Siccome l'add-on è premium, è stato disattivato automaticamente. Se vorrai usarlo in futuro, dovrai comprare una licenza."
1509
-
1510
- #: includes/i18n.php:434
1511
- msgctxt "as every month"
1512
- msgid "Monthly"
1513
- msgstr "Mensilmente"
1514
-
1515
- #: includes/i18n.php:435
1516
- msgctxt "as monthly period"
1517
- msgid "mo"
1518
- msgstr "mese"
1519
-
1520
- #: includes/i18n.php:436
1521
- msgctxt "as once a year"
1522
- msgid "Annual"
1523
- msgstr "Annuale"
1524
-
1525
- #: includes/i18n.php:437
1526
- msgctxt "as once a year"
1527
- msgid "Annually"
1528
- msgstr "Annualmente"
1529
-
1530
- #: includes/i18n.php:438
1531
- msgctxt "as once a year"
1532
- msgid "Once"
1533
- msgstr "Una volta"
1534
-
1535
- #: includes/i18n.php:439
1536
- msgctxt "as annual period"
1537
- msgid "year"
1538
- msgstr "anno"
1539
-
1540
- #: includes/i18n.php:440
1541
- msgid "Lifetime"
1542
- msgstr "Tutta la vita"
1543
-
1544
- #: includes/i18n.php:441
1545
- msgctxt "e.g. the best product"
1546
- msgid "Best"
1547
- msgstr "Migliore"
1548
-
1549
- #: includes/i18n.php:442
1550
- msgctxt "e.g. billed monthly"
1551
- msgid "Billed %s"
1552
- msgstr "Fatturato %s"
1553
-
1554
- #: includes/i18n.php:443
1555
- msgctxt "as a discount of $5 or 10%"
1556
- msgid "Save %s"
1557
- msgstr "Risparmia %s"
1558
-
1559
- #: includes/i18n.php:445
1560
- msgid "View details"
1561
- msgstr "Visualizza dettagli"
1562
-
1563
- #: includes/i18n.php:449
1564
- msgctxt "button label"
1565
- msgid "Approve & Start Trial"
1566
- msgstr "Approva e inizia il periodo di prova gratuito"
1567
-
1568
- #: includes/i18n.php:451
1569
- msgid "You are 1-click away from starting your %1$s-day free trial of the %2$s plan."
1570
- msgstr "Sei a un clic di distanza dall'iniziare il tuo periodo di prova gratuito di %1$s giorni per il piano %2$s."
1571
-
1572
- #: includes/i18n.php:453
1573
- msgid "For compliance with the WordPress.org guidelines, before we start the trial we ask that you opt-in with your user and non-sensitive site information, allowing the plugin to periodically send data to %s to check for version updates and to validate your trial."
1574
- msgstr "Per seguire le linee guida di WordPress, prima di iniziare il periodo di prova ti chiediamo di iscriverti con il tuo utente e i dati non sensibili inerenti al tuo sito, così da permettere periodicamente al plugin di inviare dati a %s per poter controllare la presenza di nuove versioni e convalidare il tuo periodo di prova gratuito."
1575
-
1576
- #: includes/i18n.php:459
1577
- msgid "Business name"
1578
- msgstr "Nome della compagnia"
1579
-
1580
- #: includes/i18n.php:460
1581
- msgid "Tax / VAT ID"
1582
- msgstr "Numero Partita Iva o VAT"
1583
-
1584
- #: includes/i18n.php:461
1585
- msgid "Address Line %d"
1586
- msgstr "Riga indirizzo %d"
1587
-
1588
- #: includes/i18n.php:462
1589
- msgid "Country"
1590
- msgstr "Nazione"
1591
-
1592
- #: includes/i18n.php:463
1593
- msgid "Select Country"
1594
- msgstr "Seleziona Nazione"
1595
-
1596
- #: includes/i18n.php:464
1597
- msgid "City"
1598
- msgstr "Città"
1599
-
1600
- #: includes/i18n.php:465
1601
- msgid "Town"
1602
- msgstr "Cittadina"
1603
-
1604
- #: includes/i18n.php:466
1605
- msgid "State"
1606
- msgstr "Stato"
1607
-
1608
- #: includes/i18n.php:467
1609
- msgid "Province"
1610
- msgstr "Provincia"
1611
-
1612
- #: includes/i18n.php:468
1613
- msgid "ZIP / Postal Code"
1614
- msgstr "CAP"
1615
-
1616
- #: includes/i18n.php:473
1617
- msgid "Installing plugin: %s"
1618
- msgstr "Installing plugin: %s"
1619
-
1620
- #: includes/i18n.php:474
1621
- msgid "Automatic Installation"
1622
- msgstr "Automatic Installation"
1623
-
1624
- #: includes/i18n.php:476
1625
- msgid "%s sec"
1626
- msgstr "%s sec"
1627
-
1628
- #: includes/i18n.php:477
1629
- msgid "An automated download and installation of %s (paid version) from %s will start in %s. If you would like to do it manually - click the cancellation button now."
1630
- msgstr "An automated download and installation of %s (paid version) from %s will start in %s. If you would like to do it manually - click the cancellation button now."
1631
-
1632
- #: includes/i18n.php:478
1633
- msgid "The installation process has started and may take a few minutes to complete. Please wait until it is done - do not refresh this page."
1634
- msgstr "The installation process has started and may take a few minutes to complete. Please wait until it is done - do not refresh this page."
1635
-
1636
- #: includes/i18n.php:479
1637
- msgid "Cancel Installation"
1638
- msgstr "Cancel Installation"
1639
-
1640
- #: includes/i18n.php:480
1641
- msgid "The remote plugin package does not contain a folder with the desired slug and renaming did not work."
1642
- msgstr "The remote plugin package does not contain a folder with the de