Popups – WordPress Popup - Version 1.7.1.1

Version Description

  • Added freemius insights
  • Changed some assets
Download this release

Release Info

Developer timersys
Plugin Icon 128x128 Popups – WordPress Popup
Version 1.7.1.1
Comparing to
See all releases

Code changes from version 1.7.1 to 1.7.1.1

Files changed (99) hide show
  1. README.txt +7 -3
  2. freemius/LICENSE.txt +340 -0
  3. freemius/README.md +253 -0
  4. freemius/assets/css/admin/account.css +1 -0
  5. freemius/assets/css/admin/add-ons.css +2 -0
  6. freemius/assets/css/admin/checkout.css +1 -0
  7. freemius/assets/css/admin/common.css +2 -0
  8. freemius/assets/css/admin/connect.css +1 -0
  9. freemius/assets/css/admin/deactivation-feedback.css +1 -0
  10. freemius/assets/css/admin/debug.css +1 -0
  11. freemius/assets/css/admin/dialog-boxes.css +2 -0
  12. freemius/assets/css/admin/license-activation.css +1 -0
  13. freemius/assets/css/common.css +1 -0
  14. freemius/assets/img/plugin-icon.png +0 -0
  15. freemius/assets/img/popups.png +0 -0
  16. freemius/assets/index.php +3 -0
  17. freemius/assets/js/nojquery.ba-postmessage.js +140 -0
  18. freemius/assets/js/nojquery.ba-postmessage.min.js +12 -0
  19. freemius/assets/js/postmessage.js +135 -0
  20. freemius/assets/scss/_colors.scss +58 -0
  21. freemius/assets/scss/_functions.scss +0 -0
  22. freemius/assets/scss/_load.scss +4 -0
  23. freemius/assets/scss/_mixins.scss +227 -0
  24. freemius/assets/scss/_start.scss +4 -0
  25. freemius/assets/scss/_vars.scss +6 -0
  26. freemius/assets/scss/admin/_deactivation-feedback.scss +55 -0
  27. freemius/assets/scss/admin/_license-activation.scss +7 -0
  28. freemius/assets/scss/admin/_license-key-resend.scss +68 -0
  29. freemius/assets/scss/admin/_modal-common.scss +155 -0
  30. freemius/assets/scss/admin/account.scss +250 -0
  31. freemius/assets/scss/admin/add-ons.scss +449 -0
  32. freemius/assets/scss/admin/checkout.scss +5 -0
  33. freemius/assets/scss/admin/common.scss +173 -0
  34. freemius/assets/scss/admin/connect.scss +471 -0
  35. freemius/assets/scss/admin/debug.scss +135 -0
  36. freemius/assets/scss/admin/dialog-boxes.scss +5 -0
  37. freemius/config.php +319 -0
  38. freemius/includes/class-freemius-abstract.php +553 -0
  39. freemius/includes/class-freemius.php +11626 -0
  40. freemius/includes/class-fs-api.php +558 -0
  41. freemius/includes/class-fs-logger.php +686 -0
  42. freemius/includes/class-fs-plugin-updater.php +415 -0
  43. freemius/includes/class-fs-security.php +85 -0
  44. freemius/includes/debug/class-fs-debug-bar-panel.php +64 -0
  45. freemius/includes/debug/debug-bar-start.php +52 -0
  46. freemius/includes/debug/index.php +3 -0
  47. freemius/includes/entities/class-fs-billing.php +95 -0
  48. freemius/includes/entities/class-fs-entity.php +149 -0
  49. freemius/includes/entities/class-fs-payment.php +94 -0
  50. freemius/includes/entities/class-fs-plugin-info.php +34 -0
  51. freemius/includes/entities/class-fs-plugin-license.php +224 -0
  52. freemius/includes/entities/class-fs-plugin-plan.php +145 -0
  53. freemius/includes/entities/class-fs-plugin-tag.php +24 -0
  54. freemius/includes/entities/class-fs-plugin.php +94 -0
  55. freemius/includes/entities/class-fs-pricing.php +141 -0
  56. freemius/includes/entities/class-fs-scope-entity.php +29 -0
  57. freemius/includes/entities/class-fs-site.php +148 -0
  58. freemius/includes/entities/class-fs-subscription.php +125 -0
  59. freemius/includes/entities/class-fs-user.php +62 -0
  60. freemius/includes/entities/index.php +3 -0
  61. freemius/includes/fs-core-functions.php +594 -0
  62. freemius/includes/fs-essential-functions.php +445 -0
  63. freemius/includes/fs-plugin-info-dialog.php +942 -0
  64. freemius/includes/i18n.php +518 -0
  65. freemius/includes/index.php +3 -0
  66. freemius/includes/l10n.php +250 -0
  67. freemius/includes/managers/class-fs-admin-menu-manager.php +635 -0
  68. freemius/includes/managers/class-fs-admin-notice-manager.php +313 -0
  69. freemius/includes/managers/class-fs-cache-manager.php +237 -0
  70. freemius/includes/managers/class-fs-key-value-storage.php +326 -0
  71. freemius/includes/managers/class-fs-license-manager.php +104 -0
  72. freemius/includes/managers/class-fs-option-manager.php +302 -0
  73. freemius/includes/managers/class-fs-plan-manager.php +162 -0
  74. freemius/includes/managers/class-fs-plugin-manager.php +154 -0
  75. freemius/includes/managers/index.php +3 -0
  76. freemius/includes/sdk/Exceptions/ArgumentNotExistException.php +9 -0
  77. freemius/includes/sdk/Exceptions/EmptyArgumentException.php +9 -0
  78. freemius/includes/sdk/Exceptions/Exception.php +74 -0
  79. freemius/includes/sdk/Exceptions/InvalidArgumentException.php +8 -0
  80. freemius/includes/sdk/Exceptions/OAuthException.php +12 -0
  81. freemius/includes/sdk/Exceptions/index.php +3 -0
  82. freemius/includes/sdk/Freemius.php +583 -0
  83. freemius/includes/sdk/FreemiusBase.php +188 -0
  84. freemius/includes/sdk/LICENSE.txt +340 -0
  85. freemius/includes/sdk/index.php +3 -0
  86. freemius/includes/supplements/fs-essential-functions-1.1.7.1.php +47 -0
  87. freemius/includes/supplements/index.php +3 -0
  88. freemius/index.php +3 -0
  89. freemius/languages/freemius-da_DK.mo +0 -0
  90. freemius/languages/freemius-da_DK.po +1661 -0
  91. freemius/languages/freemius-en.mo +0 -0
  92. freemius/languages/freemius-en.po +1727 -0
  93. freemius/languages/freemius-he.mo +0 -0
  94. freemius/languages/freemius-he.po +1661 -0
  95. freemius/languages/freemius-it_IT.mo +0 -0
  96. freemius/languages/freemius-it_IT.po +1871 -0
  97. freemius/languages/freemius-ja_JP.mo +0 -0
  98. freemius/languages/freemius-ja_JP.po +1662 -0
  99. freemius/languages/freemius.pot +1532 -0
README.txt CHANGED
@@ -4,16 +4,16 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: popup,twitter,google+, facebook,Popups, twitter follow, facebook like, google plus,social boost, social splash, postmatic, mailpoet, facebook popup, scroll popups, popups, wordpress popup, wp popups, cf7, gf, gravity forms, contact form 7, ifs, infusion soft, subscribe, login popup, ajax login popups
5
  Requires at least: 3.6
6
  Tested up to: 4.7.3
7
- Stable tag: 1.7.1
8
  Text Domain: popups
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
- Most complete free Popups plugin, scroll triggered popups, compatible with social networks, Gravity Forms, Ninja Forms, Contact form 7, Mailpoet, Mailchimp for WP, Postmatic, etc
13
 
14
  == Description ==
15
 
16
- The new Popups plugin can display multiple popups. Is the perfect solution to increase your social followers, add call to actions, increase your mailing lists by adding a form like mailchimp or to display any important message in a simple popup.
17
 
18
  It's compatible with the major form plugins like (read FAQ):
19
 
@@ -196,6 +196,10 @@ If you have cache be sure to enable AJAX mode in the plugin settings page
196
 
197
  == Changelog ==
198
 
 
 
 
 
199
  = 1.7.1 =
200
  * Added new google+ version
201
  * Added fractional time support for cookies
4
  Tags: popup,twitter,google+, facebook,Popups, twitter follow, facebook like, google plus,social boost, social splash, postmatic, mailpoet, facebook popup, scroll popups, popups, wordpress popup, wp popups, cf7, gf, gravity forms, contact form 7, ifs, infusion soft, subscribe, login popup, ajax login popups
5
  Requires at least: 3.6
6
  Tested up to: 4.7.3
7
+ Stable tag: 1.7.1.1
8
  Text Domain: popups
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
+ Popup plugin that works! Most complete free popup plugin with display filters, scroll triggered popups, compatible with social networks, Gravity Forms, Ninja Forms, Contact form 7, Mailpoet, Mailchimp for WP, Postmatic, etc
13
 
14
  == Description ==
15
 
16
+ The new Popups plugin can display multiple popups. Is the perfect solution to show important messages such as EU Cookie notice, increase your social followers, add call to actions, increase your mailing lists by adding a form like mailchimp or to display any other important message in a simple popup.
17
 
18
  It's compatible with the major form plugins like (read FAQ):
19
 
196
 
197
  == Changelog ==
198
 
199
+ = 1.7.1.1 =
200
+ * Added freemius insights
201
+ * Changed some assets
202
+
203
  = 1.7.1 =
204
  * Added new google+ version
205
  * Added fractional time support for cookies
freemius/LICENSE.txt ADDED
@@ -0,0 +1,340 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1 @@
 
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 ADDED
@@ -0,0 +1,2 @@
 
 
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 ADDED
@@ -0,0 +1 @@
 
1
+ @media screen and (max-width: 782px){#wpbody-content{padding-bottom:0 !important}}
freemius/assets/css/admin/common.css ADDED
@@ -0,0 +1,2 @@
 
 
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 ADDED
@@ -0,0 +1 @@
 
1
+ #fs_connect{width:480px;-moz-box-shadow:0px 1px 2px rgba(0,0,0,0.3);-webkit-box-shadow:0px 1px 2px rgba(0,0,0,0.3);box-shadow:0px 1px 2px rgba(0,0,0,0.3);margin:20px 0}@media screen and (max-width: 479px){#fs_connect{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;width:auto;margin:0 0 0 -10px}}#fs_connect .fs-content{background:#fff;padding:15px 20px}#fs_connect .fs-content .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 ADDED
@@ -0,0 +1 @@
 
1
+ .fs-modal{position:fixed;overflow:auto;height:100%;width:100%;top:0;z-index:100000;display:none;background:rgba(0,0,0,0.6)}.fs-modal .fs-modal-dialog{background:transparent;position:absolute;left:50%;margin-left:-298px;padding-bottom:30px;top:-100%;z-index:100001;width:596px}@media (max-width: 650px){.fs-modal .fs-modal-dialog{margin-left:-50%;box-sizing:border-box;padding-left:10px;padding-right:10px;width:100%}.fs-modal .fs-modal-dialog .fs-modal-panel>h3>strong{font-size:1.3em}.fs-modal .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 ADDED
@@ -0,0 +1 @@
 
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 ADDED
@@ -0,0 +1,2 @@
 
 
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-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}
freemius/assets/css/admin/license-activation.css ADDED
@@ -0,0 +1 @@
 
1
+ .fs-modal{position:fixed;overflow:auto;height:100%;width:100%;top:0;z-index:100000;display:none;background:rgba(0,0,0,0.6)}.fs-modal .fs-modal-dialog{background:transparent;position:absolute;left:50%;margin-left:-298px;padding-bottom:30px;top:-100%;z-index:100001;width:596px}@media (max-width: 650px){.fs-modal .fs-modal-dialog{margin-left:-50%;box-sizing:border-box;padding-left:10px;padding-right:10px;width:100%}.fs-modal .fs-modal-dialog .fs-modal-panel>h3>strong{font-size:1.3em}}.fs-modal.active{display:block}.fs-modal.active:before{display:block}.fs-modal.active .fs-modal-dialog{top:10%}.fs-modal .fs-modal-body,.fs-modal .fs-modal-footer{border:0;background:#fefefe;padding:20px}.fs-modal .fs-modal-body{border-bottom:0}.fs-modal .fs-modal-body .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 ADDED
@@ -0,0 +1 @@
 
1
+ .fs-notice.success{color:green;font-weight:700}
freemius/assets/img/plugin-icon.png ADDED
Binary file
freemius/assets/img/popups.png ADDED
Binary file
freemius/assets/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ // Silence is golden.
3
+ // Hide file structure from users on unprotected servers.
freemius/assets/js/nojquery.ba-postmessage.js ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ }
96
+ else {
97
+ // Post to parent.
98
+ _postman.postMessage(JSON.stringify({
99
+ type: type,
100
+ data: data
101
+ }), _parent_url, window.parent);
102
+ }
103
+ },
104
+ receive: function (type, callback)
105
+ {
106
+ console.debug('PostMessage.receive', type);
107
+
108
+ if (undef === _callbacks[type])
109
+ _callbacks[type] = [];
110
+
111
+ _callbacks[type].push(callback);
112
+ },
113
+ receiveOnce: function (type, callback)
114
+ {
115
+ if (this.is_set(type))
116
+ return;
117
+
118
+ this.receive(type, callback);
119
+ },
120
+ // Check if any callbacks assigned to a specified message type.
121
+ is_set: function (type)
122
+ {
123
+ return (undef != _callbacks[type]);
124
+ },
125
+ parent_url: function ()
126
+ {
127
+ return _parent_url;
128
+ },
129
+ parent_subdomain: function ()
130
+ {
131
+ return _parent_subdomain;
132
+ }
133
+ };
134
+ }();
135
+ })(jQuery);
freemius/assets/scss/_colors.scss ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ $fs-notice-promotion-border-color: #00a0d2;
24
+ $fs-notice-promotion-bkg: #f2fcff;
25
+
26
+ // WordPress colors.
27
+ $page-header-bkg: #333;
28
+ $page-header-color: $fms-white;
29
+ $text-dark-color: #333;
30
+ $text-light-color: #666;
31
+ $text-lightest-color: #999;
32
+
33
+ // WP Buttons.
34
+ $button-primary-bkg: #6bc406;
35
+ $button-primary-color: $fms-white;
36
+ $button-secondary-bkg: #333;
37
+ $button-secondary-color: $fms-white;
38
+ $featured-color: #6bc406;
39
+ $wp-selected-color: #0074a3;
40
+
41
+ $wordpress_color: #01749A;
42
+ $blogger_color: #ff8100;
43
+ $wix_color: #fac102;
44
+ $shopify_color: #80d100;
45
+ $addthis_color: #fe6d4e;
46
+ $tumblr_color: #34506b;
47
+ $zepo_color: #00baf2;
48
+ $jquery_color: #000919;
49
+ $javascript_color: #00baf2;
50
+ $squarespace_color: #000;
51
+
52
+ $blog_color: #ff6600;
53
+ $facebook_color: #3b5998;
54
+ $twitter_color: #4099ff;
55
+ $linkedin_color: #4875b4;
56
+ $youtube_color: #ff3333;
57
+ $gplus_color: #c63d2d;
58
+
freemius/assets/scss/_functions.scss ADDED
File without changes
freemius/assets/scss/_load.scss ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ @import 'mixins';
2
+ @import "vars";
3
+ @import "functions";
4
+ @import "colors";
freemius/assets/scss/_mixins.scss ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 {
82
+ // @-moz-keyframes { @content; }
83
+ // @-ms-keyframes { @content; }
84
+ // @-o-keyframes { @content; }
85
+ // @-webkit-keyframes { @content; }
86
+ // @keyframes { @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
+ // ==== /CSS3 SASS MIXINS ====
196
+
197
+ @mixin opacity($opacity) {
198
+ opacity: $opacity;
199
+ $opacity-ie: $opacity * 100;
200
+ filter: alpha(opacity=$opacity-ie); //IE8
201
+ }
202
+
203
+ @mixin size($width, $height: $width)
204
+ {
205
+ width: $width;
206
+ height: $height;
207
+ }
208
+
209
+ @mixin clearfix
210
+ {
211
+ &:after {
212
+ content: "";
213
+ display: table;
214
+ clear: both;
215
+ }
216
+ }
217
+
218
+ // Placeholder text
219
+ @mixin placeholder($color: $input-color-placeholder) {
220
+ // Firefox
221
+ &::-moz-placeholder {
222
+ color: $color;
223
+ opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
224
+ }
225
+ &:-ms-input-placeholder { color: $color; } // Internet Explorer 10+
226
+ &::-webkit-input-placeholder { color: $color; } // Safari and Chrome
227
+ }
freemius/assets/scss/_start.scss ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ @import "vars";
2
+ @import "colors";
3
+ @import "mixins";
4
+ @import "functions";
freemius/assets/scss/_vars.scss ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
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/_deactivation-feedback.scss ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-modal-body,
50
+ .fs-modal-footer {
51
+ border: 0;
52
+ background: #fefefe;
53
+ padding: 20px;
54
+ }
55
+
56
+ .fs-modal-header {
57
+ border-bottom: #eeeeee solid 1px;
58
+ background: #fbfbfb;
59
+ padding: 15px 20px;
60
+ position: relative;
61
+ margin-bottom: -10px;
62
+ // z-index: 2;
63
+
64
+ h4 {
65
+ margin: 0;
66
+ padding: 0;
67
+ text-transform: uppercase;
68
+ font-size: 1.2em;
69
+ font-weight: bold;
70
+ color: #cacaca;
71
+ text-shadow: 1px 1px 1px #fff;
72
+ letter-spacing: 0.6px;
73
+ -webkit-font-smoothing: antialiased;
74
+ }
75
+
76
+ .fs-close {
77
+ position: absolute;
78
+ right: 10px;
79
+ top: 12px;
80
+ cursor: pointer;
81
+ color: #bbb;
82
+ @include border-radius(20px);
83
+ padding: 3px;
84
+ @include transition(all 0.2s ease-in-out);
85
+
86
+ &:hover {
87
+ color: #fff;
88
+ background: #aaa;
89
+ }
90
+ }
91
+ }
92
+
93
+ .fs-modal-body {
94
+ border-bottom: 0;
95
+
96
+ p {
97
+ font-size: 14px;
98
+ }
99
+
100
+ h2 {
101
+ font-size: 20px;
102
+ line-height: 1.5em;
103
+ }
104
+
105
+ > div {
106
+ margin-top: 10px;
107
+
108
+ h2 {
109
+ font-weight: bold;
110
+ font-size: 20px;
111
+ margin-top: 0;
112
+ }
113
+ }
114
+ }
115
+
116
+ .fs-modal-footer {
117
+ border-top: #eeeeee solid 1px;
118
+ text-align: right;
119
+
120
+ > .button {
121
+ margin: 0 7px;
122
+
123
+ &:first-child {
124
+ margin: 0;
125
+ }
126
+ }
127
+ }
128
+
129
+ .fs-modal-panel {
130
+ > .notice.inline {
131
+ margin: 0;
132
+ display: none;
133
+ }
134
+
135
+ &:not(.active) {
136
+ display: none;
137
+ }
138
+ }
139
+ }
140
+
141
+ .rtl
142
+ {
143
+ .fs-modal {
144
+ .fs-modal-header {
145
+ .fs-close {
146
+ right: auto;
147
+ left: 20px;
148
+ }
149
+ }
150
+ }
151
+ }
152
+
153
+ body.has-fs-modal {
154
+ overflow: hidden;
155
+ }
freemius/assets/scss/admin/account.scss ADDED
@@ -0,0 +1,250 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,449 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ @media screen and (max-width: 782px) {
2
+ #wpbody-content {
3
+ padding-bottom: 0 !important;
4
+ }
5
+ }
freemius/assets/scss/admin/common.scss ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,471 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import "../start";
2
+
3
+ $form_width: 480px;
4
+
5
+ #fs_connect
6
+ {
7
+ width: $form_width;
8
+ @include box-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));
9
+ margin: 20px 0;
10
+
11
+ @media screen and (max-width: ($form_width - 1)) {
12
+ @include box-shadow(none);
13
+ width: auto;
14
+ margin: 0 0 0 -10px;
15
+ }
16
+
17
+ .fs-content
18
+ {
19
+ background: #fff;
20
+ padding: 15px 20px;
21
+
22
+ .fs-error {
23
+ background: snow;
24
+ color: $fs-logo-magenta-color;
25
+ border: 1px solid $fs-logo-magenta-color;
26
+ @include box-shadow(0 1px 1px 0 rgba(0,0,0,.1));
27
+ text-align: center;
28
+ padding: 5px;
29
+ margin-bottom: 10px;
30
+ }
31
+
32
+ p
33
+ {
34
+ margin: 0;
35
+ padding: 0;
36
+ font-size: 1.2em;
37
+ }
38
+ }
39
+
40
+ .fs-license-key-container {
41
+ position: relative;
42
+ width: 280px;
43
+ margin: 10px auto 0 auto;
44
+
45
+ input {
46
+ width: 100%;
47
+ }
48
+
49
+ .dashicons {
50
+ position: absolute;
51
+ top: 5px;
52
+ right: 5px;
53
+ }
54
+ }
55
+
56
+ .fs-actions
57
+ {
58
+ padding: 10px 20px;
59
+ background: #C0C7CA;
60
+
61
+ .button
62
+ {
63
+ padding: 0 10px 1px;
64
+ line-height: 35px;
65
+ height: 37px;
66
+ font-size: 16px;
67
+ margin-bottom: 0;
68
+
69
+ .dashicons
70
+ {
71
+ font-size: 37px;
72
+ margin-left: -8px;
73
+ margin-right: 12px;
74
+ }
75
+
76
+ &.button-primary
77
+ {
78
+ padding-right: 15px;
79
+ padding-left: 15px;
80
+
81
+ &:after
82
+ {
83
+ content: ' \279C';
84
+ }
85
+
86
+ &.fs-loading
87
+ {
88
+ &:after
89
+ {
90
+ content: '';
91
+ }
92
+ }
93
+ }
94
+
95
+ &.button-secondary
96
+ {
97
+ float: right;
98
+ }
99
+ }
100
+
101
+ // .fs-skip
102
+ // {
103
+ // line-height: 38px;
104
+ // vertical-align: middle;
105
+ // text-decoration: none;
106
+ // margin-left: 10px;
107
+ // }
108
+ }
109
+
110
+ &.fs-anonymous-disabled
111
+ {
112
+ .fs-actions
113
+ {
114
+ .button.button-primary
115
+ {
116
+ width: 100%;
117
+ }
118
+ }
119
+ }
120
+
121
+ .fs-permissions
122
+ {
123
+ padding: 10px 20px;
124
+ background: #FEFEFE;
125
+ // background: #F1F1F1;
126
+ @include transition(background 0.5s ease);
127
+
128
+ .fs-license-sync-disclaimer {
129
+ text-align: center;
130
+ margin-top: 0;
131
+ }
132
+
133
+ .fs-trigger
134
+ {
135
+ font-size: 0.9em;
136
+ text-decoration: none;
137
+ text-align: center;
138
+ display: block;
139
+ }
140
+
141
+ ul
142
+ {
143
+ height: 0;
144
+ overflow: hidden;
145
+ margin: 0;
146
+
147
+ li
148
+ {
149
+ margin-bottom: 12px;
150
+
151
+ &:last-child
152
+ {
153
+ margin-bottom: 0;
154
+ }
155
+
156
+ i.dashicons
157
+ {
158
+ float: left;
159
+ font-size: 40px;
160
+ width: 40px;
161
+ height: 40px;
162
+ }
163
+
164
+ div
165
+ {
166
+ margin-left: 55px;
167
+
168
+ span
169
+ {
170
+ font-weight: bold;
171
+ text-transform: uppercase;
172
+ color: #23282d;
173
+ }
174
+
175
+ p
176
+ {
177
+ margin: 2px 0 0 0;
178
+ }
179
+ }
180
+ }
181
+ }
182
+
183
+ &.fs-open
184
+ {
185
+ background: #fff;
186
+
187
+ ul
188
+ {
189
+ height: auto;
190
+ margin: 20px 20px 10px 20px;
191
+ }
192
+ }
193
+
194
+ @media screen and (max-width: ($form_width - 1)) {
195
+ background: #fff;
196
+
197
+ .fs-trigger
198
+ {
199
+ display: none;
200
+ }
201
+
202
+ ul
203
+ {
204
+ height: auto;
205
+ margin: 20px;
206
+ }
207
+ }
208
+ }
209
+
210
+ .fs-freemium-licensing {
211
+ padding: 8px;
212
+ // background: #0085BA;
213
+ background: #777;
214
+ color: #fff;
215
+
216
+ p {
217
+ text-align: center;
218
+ display: block;
219
+ margin: 0;
220
+ padding: 0;
221
+ }
222
+
223
+ a {
224
+ color: #C2EEFF;
225
+ text-decoration: underline;
226
+ }
227
+ }
228
+
229
+ $icon_size: 80px;
230
+ $wp_logo_padding: $icon_size / 10;
231
+ $icons_top: 10px;
232
+
233
+ .fs-visual
234
+ {
235
+ padding: 12px;
236
+ line-height: 0;
237
+ background: #fafafa;
238
+ height: $icon_size;
239
+ position: relative;
240
+
241
+ .fs-site-icon
242
+ {
243
+ position: absolute;
244
+ left: 20px;
245
+ top: $icons_top;
246
+ }
247
+
248
+ .fs-connect-logo
249
+ {
250
+ position: absolute;
251
+ right: 20px;
252
+ top: $icons_top;
253
+ }
254
+
255
+ .fs-plugin-icon
256
+ {
257
+ position: absolute;
258
+ top: $icons_top;
259
+ left: 50%;
260
+ margin-left: - ($icon_size / 2);
261
+ }
262
+
263
+ .fs-plugin-icon,
264
+ .fs-site-icon,
265
+ img,
266
+ object
267
+ {
268
+ width: $icon_size;
269
+ height: $icon_size;
270
+ }
271
+
272
+ .dashicons-wordpress
273
+ {
274
+ font-size: $icon_size - ($wp_logo_padding * 2);
275
+ background: $wordpress_color;
276
+ color: #fff;
277
+ width: $icon_size - ($wp_logo_padding * 2);
278
+ height: $icon_size - ($wp_logo_padding * 2);
279
+ padding: $wp_logo_padding;
280
+ }
281
+
282
+ .dashicons-plus
283
+ {
284
+ position: absolute;
285
+ top: 50%;
286
+ font-size: 30px;
287
+ margin-top: -10px;
288
+ color: #bbb;
289
+
290
+ &.fs-first
291
+ {
292
+ left: 28%;
293
+ }
294
+ &.fs-second
295
+ {
296
+ left: 65%;
297
+ }
298
+ }
299
+
300
+ .fs-plugin-icon,
301
+ .fs-connect-logo,
302
+ .fs-site-icon
303
+ {
304
+ border: 1px solid #ccc;
305
+ padding: 1px;
306
+ background: #fff;
307
+ }
308
+ }
309
+
310
+ .fs-terms
311
+ {
312
+ text-align: center;
313
+ font-size: 0.85em;
314
+ padding: 5px;
315
+ background: rgba(0, 0, 0, 0.05);
316
+
317
+ &, a
318
+ {
319
+ color: #999;
320
+ }
321
+
322
+ a
323
+ {
324
+ text-decoration: none;
325
+ }
326
+ }
327
+ }
328
+
329
+ .rtl
330
+ {
331
+ #fs_connect
332
+ {
333
+ .fs-actions
334
+ {
335
+ padding: 10px 20px;
336
+ background: #C0C7CA;
337
+
338
+ .button
339
+ {
340
+ .dashicons
341
+ {
342
+ font-size: 37px;
343
+ margin-left: -8px;
344
+ margin-right: 12px;
345
+ }
346
+
347
+ &.button-primary
348
+ {
349
+ &:after
350
+ {
351
+ content: ' \000bb';
352
+ }
353
+
354
+ &.fs-loading
355
+ {
356
+ &:after
357
+ {
358
+ content: '';
359
+ }
360
+ }
361
+ }
362
+
363
+ &.button-secondary
364
+ {
365
+ float: left;
366
+ }
367
+ }
368
+ }
369
+
370
+ .fs-permissions
371
+ {
372
+ ul
373
+ {
374
+ li
375
+ {
376
+ div
377
+ {
378
+ margin-right: 55px;
379
+ margin-left: 0;
380
+ }
381
+
382
+ i.dashicons
383
+ {
384
+ float: right;
385
+ }
386
+
387
+ }
388
+ }
389
+ }
390
+
391
+ .fs-visual
392
+ {
393
+ .fs-site-icon
394
+ {
395
+ right: 20px;
396
+ left: auto;
397
+ }
398
+
399
+ .fs-connect-logo
400
+ {
401
+ right: auto;
402
+ left: 20px;
403
+ }
404
+ }
405
+ }
406
+ }
407
+
408
+ .wp-pointer-content
409
+ {
410
+ #fs_connect
411
+ {
412
+ margin: 0;
413
+ @include box-shadow(none);
414
+ }
415
+ }
416
+
417
+ .fs-opt-in-pointer
418
+ {
419
+ .wp-pointer-content
420
+ {
421
+ padding: 0;
422
+ }
423
+
424
+ &.wp-pointer-top
425
+ {
426
+ .wp-pointer-arrow
427
+ {
428
+ border-bottom-color: #dfdfdf;
429
+ }
430
+ .wp-pointer-arrow-inner
431
+ {
432
+ border-bottom-color: #fafafa;
433
+ }
434
+ }
435
+
436
+ &.wp-pointer-bottom
437
+ {
438
+ .wp-pointer-arrow
439
+ {
440
+ border-top-color: #dfdfdf;
441
+ }
442
+ .wp-pointer-arrow-inner
443
+ {
444
+ border-top-color: #fafafa;
445
+ }
446
+ }
447
+
448
+ &.wp-pointer-left
449
+ {
450
+ .wp-pointer-arrow
451
+ {
452
+ border-right-color: #dfdfdf;
453
+ }
454
+ .wp-pointer-arrow-inner
455
+ {
456
+ border-right-color: #fafafa;
457
+ }
458
+ }
459
+
460
+ &.wp-pointer-right
461
+ {
462
+ .wp-pointer-arrow
463
+ {
464
+ border-left-color: #dfdfdf;
465
+ }
466
+ .wp-pointer-arrow-inner
467
+ {
468
+ border-left-color: #fafafa;
469
+ }
470
+ }
471
+ }
freemius/assets/scss/admin/debug.scss ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ @import "../start";
2
+ @import "modal-common";
3
+ @import "deactivation-feedback";
4
+ @import "license-activation";
5
+ @import "license-key-resend";
freemius/config.php ADDED
@@ -0,0 +1,319 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ if ( ! defined( 'WP_FS__SLUG' ) ) {
14
+ define( 'WP_FS__SLUG', 'freemius' );
15
+ }
16
+ if ( ! defined( 'WP_FS__DEV_MODE' ) ) {
17
+ define( 'WP_FS__DEV_MODE', false );
18
+ }
19
+
20
+ #--------------------------------------------------------------------------------
21
+ #region API Connectivity Issues Simulation
22
+ #--------------------------------------------------------------------------------
23
+
24
+ if ( ! defined( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY' ) ) {
25
+ define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY', false );
26
+ }
27
+ if ( ! defined( 'WP_FS__SIMULATE_NO_CURL' ) ) {
28
+ define( 'WP_FS__SIMULATE_NO_CURL', false );
29
+ }
30
+ if ( ! defined( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE' ) ) {
31
+ define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', false );
32
+ }
33
+ if ( ! defined( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL' ) ) {
34
+ define( 'WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', false );
35
+ }
36
+ if ( WP_FS__SIMULATE_NO_CURL ) {
37
+ define( 'FS_SDK__SIMULATE_NO_CURL', true );
38
+ }
39
+ if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE ) {
40
+ define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', true );
41
+ }
42
+ if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL ) {
43
+ define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', true );
44
+ }
45
+
46
+ #endregion
47
+
48
+ if ( ! defined( 'WP_FS__SIMULATE_FREEMIUS_OFF' ) ) {
49
+ define( 'WP_FS__SIMULATE_FREEMIUS_OFF', false );
50
+ }
51
+
52
+ if ( ! defined( 'WP_FS__PING_API_ON_IP_OR_HOST_CHANGES' ) ) {
53
+ /**
54
+ * @since 1.1.7.3
55
+ * @author Vova Feldman (@svovaf)
56
+ *
57
+ * I'm not sure if shared servers periodically change IP, or the subdomain of the
58
+ * admin dashboard. Also, I've seen sites that have strange loop of switching
59
+ * between domains on a daily basis. Therefore, to eliminate the risk of
60
+ * multiple unwanted connectivity test pings, temporary ignore domain or
61
+ * server IP changes.
62
+ */
63
+ define( 'WP_FS__PING_API_ON_IP_OR_HOST_CHANGES', false );
64
+ }
65
+
66
+ /**
67
+ * If your dev environment supports custom public network IP setup
68
+ * like VVV, please update WP_FS__LOCALHOST_IP with your public IP
69
+ * and uncomment it during dev.
70
+ */
71
+ if ( ! defined( 'WP_FS__LOCALHOST_IP' ) ) {
72
+ // VVV default public network IP.
73
+ define( 'WP_FS__VVV_DEFAULT_PUBLIC_IP', '192.168.50.4' );
74
+
75
+ // define( 'WP_FS__LOCALHOST_IP', WP_FS__VVV_DEFAULT_PUBLIC_IP );
76
+ }
77
+
78
+ /**
79
+ * If true and running with secret key, the opt-in process
80
+ * will skip the email activation process which is invoked
81
+ * when the email of the context user already exist in Freemius
82
+ * database (as a security precaution, to prevent sharing user
83
+ * secret with unauthorized entity).
84
+ *
85
+ * IMPORTANT:
86
+ * AS A SECURITY PRECAUTION, WE VALIDATE THE TIMESTAMP OF THE OPT-IN REQUEST.
87
+ * THEREFORE, MAKE SURE THAT WHEN USING THIS PARAMETER,YOUR TESTING ENVIRONMENT'S
88
+ * CLOCK IS SYNCED.
89
+ */
90
+ if ( ! defined( 'WP_FS__SKIP_EMAIL_ACTIVATION' ) ) {
91
+ define( 'WP_FS__SKIP_EMAIL_ACTIVATION', false );
92
+ }
93
+
94
+
95
+ #--------------------------------------------------------------------------------
96
+ #region Directories
97
+ #--------------------------------------------------------------------------------
98
+
99
+ if ( ! defined( 'WP_FS__DIR' ) ) {
100
+ define( 'WP_FS__DIR', dirname( __FILE__ ) );
101
+ }
102
+ if ( ! defined( 'WP_FS__DIR_INCLUDES' ) ) {
103
+ define( 'WP_FS__DIR_INCLUDES', WP_FS__DIR . '/includes' );
104
+ }
105
+ if ( ! defined( 'WP_FS__DIR_TEMPLATES' ) ) {
106
+ define( 'WP_FS__DIR_TEMPLATES', WP_FS__DIR . '/templates' );
107
+ }
108
+ if ( ! defined( 'WP_FS__DIR_ASSETS' ) ) {
109
+ define( 'WP_FS__DIR_ASSETS', WP_FS__DIR . '/assets' );
110
+ }
111
+ if ( ! defined( 'WP_FS__DIR_CSS' ) ) {
112
+ define( 'WP_FS__DIR_CSS', WP_FS__DIR_ASSETS . '/css' );
113
+ }
114
+ if ( ! defined( 'WP_FS__DIR_JS' ) ) {
115
+ define( 'WP_FS__DIR_JS', WP_FS__DIR_ASSETS . '/js' );
116
+ }
117
+ if ( ! defined( 'WP_FS__DIR_IMG' ) ) {
118
+ define( 'WP_FS__DIR_IMG', WP_FS__DIR_ASSETS . '/img' );
119
+ }
120
+ if ( ! defined( 'WP_FS__DIR_SDK' ) ) {
121
+ define( 'WP_FS__DIR_SDK', WP_FS__DIR_INCLUDES . '/sdk' );
122
+ }
123
+
124
+ #endregion
125
+
126
+ /**
127
+ * Domain / URL / Address
128
+ */
129
+ define( 'WP_FS__DOMAIN_PRODUCTION', 'wp.freemius.com' );
130
+ define( 'WP_FS__ADDRESS_PRODUCTION', 'https://' . WP_FS__DOMAIN_PRODUCTION );
131
+
132
+ if ( ! defined( 'WP_FS__DOMAIN_LOCALHOST' ) ) {
133
+ define( 'WP_FS__DOMAIN_LOCALHOST', 'wp.freemius' );
134
+ }
135
+ if ( ! defined( 'WP_FS__ADDRESS_LOCALHOST' ) ) {
136
+ define( 'WP_FS__ADDRESS_LOCALHOST', 'http://' . WP_FS__DOMAIN_LOCALHOST . ':8080' );
137
+ }
138
+
139
+ if ( ! defined( 'WP_FS__TESTING_DOMAIN' ) ) {
140
+ define( 'WP_FS__TESTING_DOMAIN', 'fswp' );
141
+ }
142
+
143
+ #--------------------------------------------------------------------------------
144
+ #region HTTP
145
+ #--------------------------------------------------------------------------------
146
+
147
+ if ( ! defined( 'WP_FS__IS_HTTP_REQUEST' ) ) {
148
+ define( 'WP_FS__IS_HTTP_REQUEST', isset( $_SERVER['HTTP_HOST'] ) );
149
+ }
150
+
151
+ if ( ! defined( 'WP_FS__IS_HTTPS' ) ) {
152
+ define( 'WP_FS__IS_HTTPS', ( WP_FS__IS_HTTP_REQUEST &&
153
+ // Checks if CloudFlare's HTTPS (Flexible SSL support).
154
+ isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) &&
155
+ 'https' === strtolower( $_SERVER['HTTP_X_FORWARDED_PROTO'] )
156
+ ) ||
157
+ // Check if HTTPS request.
158
+ ( isset( $_SERVER['HTTPS'] ) && 'on' == $_SERVER['HTTPS'] ) ||
159
+ ( isset( $_SERVER['SERVER_PORT'] ) && 443 == $_SERVER['SERVER_PORT'] )
160
+ );
161
+ }
162
+
163
+ if ( ! defined( 'WP_FS__IS_POST_REQUEST' ) ) {
164
+ define( 'WP_FS__IS_POST_REQUEST', ( WP_FS__IS_HTTP_REQUEST &&
165
+ strtoupper( $_SERVER['REQUEST_METHOD'] ) == 'POST' ) );
166
+ }
167
+
168
+ if ( ! defined( 'WP_FS__REMOTE_ADDR' ) ) {
169
+ define( 'WP_FS__REMOTE_ADDR', fs_get_ip() );
170
+ }
171
+
172
+ if ( ! defined( 'WP_FS__IS_LOCALHOST' ) ) {
173
+ if ( defined( 'WP_FS__LOCALHOST_IP' ) ) {
174
+ define( 'WP_FS__IS_LOCALHOST', ( WP_FS__LOCALHOST_IP === WP_FS__REMOTE_ADDR ) );
175
+ } else {
176
+ define( 'WP_FS__IS_LOCALHOST', WP_FS__IS_HTTP_REQUEST &&
177
+ is_string( WP_FS__REMOTE_ADDR ) &&
178
+ ( substr( WP_FS__REMOTE_ADDR, 0, 4 ) === '127.' ||
179
+ WP_FS__REMOTE_ADDR === '::1' )
180
+ );
181
+ }
182
+ }
183
+
184
+ if ( ! defined( 'WP_FS__IS_LOCALHOST_FOR_SERVER' ) ) {
185
+ define( 'WP_FS__IS_LOCALHOST_FOR_SERVER', ( ! WP_FS__IS_HTTP_REQUEST ||
186
+ false !== strpos( $_SERVER['HTTP_HOST'], 'localhost' ) ) );
187
+ }
188
+
189
+ #endregion
190
+
191
+ if ( ! defined( 'WP_FS__IS_PRODUCTION_MODE' ) ) {
192
+ // By default, run with Freemius production servers.
193
+ define( 'WP_FS__IS_PRODUCTION_MODE', true );
194
+ }
195
+
196
+ if ( ! defined( 'WP_FS__ADDRESS' ) ) {
197
+ define( 'WP_FS__ADDRESS', ( WP_FS__IS_PRODUCTION_MODE ? WP_FS__ADDRESS_PRODUCTION : WP_FS__ADDRESS_LOCALHOST ) );
198
+ }
199
+
200
+
201
+ #--------------------------------------------------------------------------------
202
+ #region API
203
+ #--------------------------------------------------------------------------------
204
+
205
+ if ( ! defined( 'WP_FS__API_ADDRESS_LOCALHOST' ) ) {
206
+ define( 'WP_FS__API_ADDRESS_LOCALHOST', 'http://api.freemius:8080' );
207
+ }
208
+ if ( ! defined( 'WP_FS__API_SANDBOX_ADDRESS_LOCALHOST' ) ) {
209
+ define( 'WP_FS__API_SANDBOX_ADDRESS_LOCALHOST', 'http://sandbox-api.freemius:8080' );
210
+ }
211
+
212
+ // Set API address for local testing.
213
+ if ( ! WP_FS__IS_PRODUCTION_MODE ) {
214
+ if ( ! defined( 'FS_API__ADDRESS' ) ) {
215
+ define( 'FS_API__ADDRESS', WP_FS__API_ADDRESS_LOCALHOST );
216
+ }
217
+ if ( ! defined( 'FS_API__SANDBOX_ADDRESS' ) ) {
218
+ define( 'FS_API__SANDBOX_ADDRESS', WP_FS__API_SANDBOX_ADDRESS_LOCALHOST );
219
+ }
220
+ }
221
+
222
+ #endregion
223
+
224
+ #--------------------------------------------------------------------------------
225
+ #region Checkout
226
+ #--------------------------------------------------------------------------------
227
+
228
+ if ( ! defined( 'FS_CHECKOUT__ADDRESS_PRODUCTION' ) ) {
229
+ define( 'FS_CHECKOUT__ADDRESS_PRODUCTION', 'https://checkout.freemius.com' );
230
+ }
231
+
232
+ if ( ! defined( 'FS_CHECKOUT__ADDRESS_LOCALHOST' ) ) {
233
+ define( 'FS_CHECKOUT__ADDRESS_LOCALHOST', 'http://checkout.freemius:8080' );
234
+ }
235
+
236
+ if ( ! defined( 'FS_CHECKOUT__ADDRESS' ) ) {
237
+ define( 'FS_CHECKOUT__ADDRESS', ( WP_FS__IS_PRODUCTION_MODE ? FS_CHECKOUT__ADDRESS_PRODUCTION : FS_CHECKOUT__ADDRESS_LOCALHOST ) );
238
+ }
239
+
240
+ #endregion
241
+
242
+ define( 'WP_FS___OPTION_PREFIX', 'fs' . ( WP_FS__IS_PRODUCTION_MODE ? '' : '_dbg' ) . '_' );
243
+
244
+ if ( ! defined( 'WP_FS__ACCOUNTS_OPTION_NAME' ) ) {
245
+ define( 'WP_FS__ACCOUNTS_OPTION_NAME', WP_FS___OPTION_PREFIX . 'accounts' );
246
+ }
247
+ if ( ! defined( 'WP_FS__API_CACHE_OPTION_NAME' ) ) {
248
+ define( 'WP_FS__API_CACHE_OPTION_NAME', WP_FS___OPTION_PREFIX . 'api_cache' );
249
+ }
250
+ define( 'WP_FS__OPTIONS_OPTION_NAME', WP_FS___OPTION_PREFIX . 'options' );
251
+
252
+ /**
253
+ * Billing Frequencies
254
+ */
255
+ define( 'WP_FS__PERIOD_ANNUALLY', 'annual' );
256
+ define( 'WP_FS__PERIOD_MONTHLY', 'monthly' );
257
+ define( 'WP_FS__PERIOD_LIFETIME', 'lifetime' );
258
+
259
+ /**
260
+ * Plans
261
+ */
262
+ define( 'WP_FS__PLAN_DEFAULT_PAID', false );
263
+ define( 'WP_FS__PLAN_FREE', 'free' );
264
+ define( 'WP_FS__PLAN_TRIAL', 'trial' );
265
+
266
+ /**
267
+ * Times in seconds
268
+ */
269
+ if ( ! defined( 'WP_FS__TIME_5_MIN_IN_SEC' ) ) {
270
+ define( 'WP_FS__TIME_5_MIN_IN_SEC', 300 );
271
+ }
272
+ if ( ! defined( 'WP_FS__TIME_10_MIN_IN_SEC' ) ) {
273
+ define( 'WP_FS__TIME_10_MIN_IN_SEC', 600 );
274
+ }
275
+ // define( 'WP_FS__TIME_15_MIN_IN_SEC', 900 );
276
+ if ( ! defined( 'WP_FS__TIME_24_HOURS_IN_SEC' ) ) {
277
+ define( 'WP_FS__TIME_24_HOURS_IN_SEC', 86400 );
278
+ }
279
+
280
+ #--------------------------------------------------------------------------------
281
+ #region Debugging
282
+ #--------------------------------------------------------------------------------
283
+
284
+ if ( ! defined( 'WP_FS__DEBUG_SDK' ) ) {
285
+ $debug_mode = get_option( 'fs_debug_mode', null );
286
+
287
+ if ( $debug_mode === null ) {
288
+ $debug_mode = false;
289
+ add_option( 'fs_debug_mode', $debug_mode );
290
+ }
291
+
292
+ define( 'WP_FS__DEBUG_SDK', is_numeric( $debug_mode ) ? ( 0 < $debug_mode ) : WP_FS__DEV_MODE );
293
+ }
294
+
295
+ if ( ! defined( 'WP_FS__ECHO_DEBUG_SDK' ) ) {
296
+ define( 'WP_FS__ECHO_DEBUG_SDK', WP_FS__DEV_MODE && ! empty( $_GET['fs_dbg_echo'] ) );
297
+ }
298
+ if ( ! defined( 'WP_FS__LOG_DATETIME_FORMAT' ) ) {
299
+ define( 'WP_FS__LOG_DATETIME_FORMAT', 'Y-m-d H:i:s' );
300
+ }
301
+ if ( ! defined( 'FS_API__LOGGER_ON' ) ) {
302
+ define( 'FS_API__LOGGER_ON', WP_FS__DEBUG_SDK );
303
+ }
304
+
305
+ if ( WP_FS__ECHO_DEBUG_SDK ) {
306
+ error_reporting( E_ALL );
307
+ }
308
+
309
+ #endregion
310
+
311
+ if ( ! defined( 'WP_FS__SCRIPT_START_TIME' ) ) {
312
+ define( 'WP_FS__SCRIPT_START_TIME', time() );
313
+ }
314
+ if ( ! defined( 'WP_FS__DEFAULT_PRIORITY' ) ) {
315
+ define( 'WP_FS__DEFAULT_PRIORITY', 10 );
316
+ }
317
+ if ( ! defined( 'WP_FS__LOWEST_PRIORITY' ) ) {
318
+ define( 'WP_FS__LOWEST_PRIORITY', 999999999 );
319
+ }
freemius/includes/class-freemius-abstract.php ADDED
@@ -0,0 +1,553 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
+ * @since 1.0.7
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+
14
+ /**
15
+ * - Each instance of Freemius class represents a single plugin
16
+ * install by a single user (the installer of the plugin).
17
+ *
18
+ * - Each website can only have one install of the same plugin.
19
+ *
20
+ * - Install entity is only created after a user connects his account with Freemius.
21
+ *
22
+ * Class Freemius_Abstract
23
+ */
24
+ abstract class Freemius_Abstract {
25
+
26
+ #----------------------------------------------------------------------------------
27
+ #region Identity
28
+ #----------------------------------------------------------------------------------
29
+
30
+ /**
31
+ * Check if user registered with Freemius by connecting his account.
32
+ *
33
+ * @since 1.0.1
34
+ * @return bool
35
+ */
36
+ abstract function is_registered();
37
+
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
+ /**
48
+ * Check if the user currently in activation mode.
49
+ *
50
+ * @since 1.0.7
51
+ *
52
+ * @return bool
53
+ */
54
+ abstract function is_activation_mode();
55
+
56
+ #endregion
57
+
58
+ #----------------------------------------------------------------------------------
59
+ #region Usage Tracking
60
+ #----------------------------------------------------------------------------------
61
+
62
+ /**
63
+ * Returns TRUE if the user opted-in and didn't disconnect (opt-out).
64
+ *
65
+ * @author Leo Fajardo (@leorw)
66
+ * @since 1.2.1.5
67
+ *
68
+ * @return bool
69
+ */
70
+ abstract function is_tracking_allowed();
71
+
72
+ /**
73
+ * Returns TRUE if the user never opted-in or manually opted-out.
74
+ *
75
+ * @author Vova Feldman (@svovaf)
76
+ * @since 1.2.1.5
77
+ *
78
+ * @return bool
79
+ */
80
+ function is_tracking_prohibited() {
81
+ return ! $this->is_registered() || ! $this->is_tracking_allowed();
82
+ }
83
+
84
+ /**
85
+ * Opt-out from usage tracking.
86
+ *
87
+ * Note: This will not delete the account information but will stop all tracking.
88
+ *
89
+ * Returns:
90
+ * 1. FALSE - If the user never opted-in.
91
+ * 2. TRUE - If successfully opted-out.
92
+ * 3. object - API Result on failure.
93
+ *
94
+ * @author Leo Fajardo (@leorw)
95
+ * @since 1.2.1.5
96
+ *
97
+ * @return bool|object
98
+ */
99
+ abstract function stop_tracking();
100
+
101
+ /**
102
+ * Opt-in back into usage tracking.
103
+ *
104
+ * Note: This will only work if the user opted-in previously.
105
+ *
106
+ * Returns:
107
+ * 1. FALSE - If the user never opted-in.
108
+ * 2. TRUE - If successfully opted-in back to usage tracking.
109
+ * 3. object - API result on failure.
110
+ *
111
+ * @author Leo Fajardo (@leorw)
112
+ * @since 1.2.1.5
113
+ *
114
+ * @return bool|object
115
+ */
116
+ abstract function allow_tracking();
117
+
118
+ #endregion
119
+
120
+ #----------------------------------------------------------------------------------
121
+ #region Permissions
122
+ #----------------------------------------------------------------------------------
123
+
124
+ /**
125
+ * Check if plugin must be WordPress.org compliant.
126
+ *
127
+ * @since 1.0.7
128
+ *
129
+ * @return bool
130
+ */
131
+ abstract function is_org_repo_compliant();
132
+
133
+ /**
134
+ * Check if plugin is allowed to install executable files.
135
+ *
136
+ * @author Vova Feldman (@svovaf)
137
+ * @since 1.0.5
138
+ *
139
+ * @return bool
140
+ */
141
+ function is_allowed_to_install() {
142
+ return ( $this->is_premium() || ! $this->is_org_repo_compliant() );
143
+ }
144
+
145
+ #endregion
146
+
147
+ /**
148
+ * Check if user in trial or in free plan (not paying).
149
+ *
150
+ * @author Vova Feldman (@svovaf)
151
+ * @since 1.0.4
152
+ *
153
+ * @return bool
154
+ */
155
+ function is_not_paying() {
156
+ return ( $this->is_trial() || $this->is_free_plan() );
157
+ }
158
+
159
+ /**
160
+ * Check if the user has an activated and valid paid license on current plugin's install.
161
+ *
162
+ * @since 1.0.9
163
+ *
164
+ * @return bool
165
+ */
166
+ abstract function is_paying();
167
+
168
+ /**
169
+ * Check if the user is paying or in trial.
170
+ *
171
+ * @since 1.0.9
172
+ *
173
+ * @return bool
174
+ */
175
+ function is_paying_or_trial() {
176
+ return ( $this->is_paying() || $this->is_trial() );
177
+ }
178
+
179
+ /**
180
+ * Check if user in a trial or have feature enabled license.
181
+ *
182
+ * @author Vova Feldman (@svovaf)
183
+ * @since 1.1.7
184
+ *
185
+ * @return bool
186
+ */
187
+ abstract function can_use_premium_code();
188
+
189
+ #----------------------------------------------------------------------------------
190
+ #region Premium Only
191
+ #----------------------------------------------------------------------------------
192
+
193
+ /**
194
+ * All logic wrapped in methods with "__premium_only()" suffix will be only
195
+ * included in the premium code.
196
+ *
197
+ * Example:
198
+ * if ( freemius()->is__premium_only() ) {
199
+ * ...
200
+ * }
201
+ */
202
+
203
+ /**
204
+ * Returns true when running premium plugin code.
205
+ *
206
+ * @since 1.0.9
207
+ *
208
+ * @return bool
209
+ */
210
+ function is__premium_only() {
211
+ return $this->is_premium();
212
+ }
213
+
214
+ /**
215
+ * Check if the user has an activated and valid paid license on current plugin's install.
216
+ *
217
+ * @since 1.0.9
218
+ *
219
+ * @return bool
220
+ *
221
+ */
222
+ function is_paying__premium_only() {
223
+ return ( $this->is__premium_only() && $this->is_paying() );
224
+ }
225
+
226
+ /**
227
+ * All code wrapped in this statement will be only included in the premium code.
228
+ *
229
+ * @since 1.0.9
230
+ *
231
+ * @param string $plan Plan name.
232
+ * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
233
+ *
234
+ * @return bool
235
+ */
236
+ function is_plan__premium_only( $plan, $exact = false ) {
237
+ return ( $this->is_premium() && $this->is_plan( $plan, $exact ) );
238
+ }
239
+
240
+ /**
241
+ * Check if plan matches active license' plan or active trial license' plan.
242
+ *
243
+ * All code wrapped in this statement will be only included in the premium code.
244
+ *
245
+ * @since 1.0.9
246
+ *
247
+ * @param string $plan Plan name.
248
+ * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
249
+ *
250
+ * @return bool
251
+ */
252
+ function is_plan_or_trial__premium_only( $plan, $exact = false ) {
253
+ return ( $this->is_premium() && $this->is_plan_or_trial( $plan, $exact ) );
254
+ }
255
+
256
+ /**
257
+ * Check if the user is paying or in trial.
258
+ *
259
+ * All code wrapped in this statement will be only included in the premium code.
260
+ *
261
+ * @since 1.0.9
262
+ *
263
+ * @return bool
264
+ */
265
+ function is_paying_or_trial__premium_only() {
266
+ return $this->is_premium() && $this->is_paying_or_trial();
267
+ }
268
+
269
+ /**
270
+ * Check if the user has an activated and valid paid license on current plugin's install.
271
+ *
272
+ * @since 1.0.4
273
+ *
274
+ * @return bool
275
+ *
276
+ * @deprecated Method name is confusing since it's not clear from the name the code will be removed.
277
+ * @using Alias to is_paying__premium_only()
278
+ */
279
+ function is_paying__fs__() {
280
+ return $this->is_paying__premium_only();
281
+ }
282
+
283
+ /**
284
+ * Check if user in a trial or have feature enabled license.
285
+ *
286
+ * All code wrapped in this statement will be only included in the premium code.
287
+ *
288
+ * @author Vova Feldman (@svovaf)
289
+ * @since 1.1.9
290
+ *
291
+ * @return bool
292
+ */
293
+ function can_use_premium_code__premium_only() {
294
+ return $this->is_premium() && $this->can_use_premium_code();
295
+ }
296
+
297
+ #endregion
298
+
299
+ #----------------------------------------------------------------------------------
300
+ #region Trial
301
+ #----------------------------------------------------------------------------------
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
+ /**
313
+ * Check if trial already utilized.
314
+ *
315
+ * @since 1.0.9
316
+ *
317
+ * @return bool
318
+ */
319
+ abstract function is_trial_utilized();
320
+
321
+ #endregion
322
+
323
+ #----------------------------------------------------------------------------------
324
+ #region Plans
325
+ #----------------------------------------------------------------------------------
326
+
327
+ /**
328
+ * Check if plugin using the free plan.
329
+ *
330
+ * @since 1.0.4
331
+ *
332
+ * @return bool
333
+ */
334
+ abstract function is_free_plan();
335
+
336
+ /**
337
+ * @since 1.0.2
338
+ *
339
+ * @param string $plan Plan name.
340
+ * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
341
+ *
342
+ * @return bool
343
+ */
344
+ abstract function is_plan( $plan, $exact = false );
345
+
346
+ /**
347
+ * Check if plan based on trial. If not in trial mode, should return false.
348
+ *
349
+ * @since 1.0.9
350
+ *
351
+ * @param string $plan Plan name.
352
+ * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
353
+ *
354
+ * @return bool
355
+ */
356
+ abstract function is_trial_plan( $plan, $exact = false );
357
+
358
+ /**
359
+ * Check if plan matches active license' plan or active trial license' plan.
360
+ *
361
+ * @since 1.0.9
362
+ *
363
+ * @param string $plan Plan name.
364
+ * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
365
+ *
366
+ * @return bool
367
+ */
368
+ function is_plan_or_trial( $plan, $exact = false ) {
369
+ return $this->is_plan( $plan, $exact ) ||
370
+ $this->is_trial_plan( $plan, $exact );
371
+ }
372
+
373
+ /**
374
+ * Check if plugin has any paid plans.
375
+ *
376
+ * @author Vova Feldman (@svovaf)
377
+ * @since 1.0.7
378
+ *
379
+ * @return bool
380
+ */
381
+ abstract function has_paid_plan();
382
+
383
+ /**
384
+ * Check if plugin has any free plan, or is it premium only.
385
+ *
386
+ * Note: If no plans configured, assume plugin is free.
387
+ *
388
+ * @author Vova Feldman (@svovaf)
389
+ * @since 1.0.7
390
+ *
391
+ * @return bool
392
+ */
393
+ abstract function has_free_plan();
394
+
395
+ /**
396
+ * Check if plugin is premium only (no free plans).
397
+ *
398
+ * NOTE: is__premium_only() is very different method, don't get confused.
399
+ *
400
+ * @author Vova Feldman (@svovaf)
401
+ * @since 1.1.9
402
+ *
403
+ * @return bool
404
+ */
405
+ abstract function is_only_premium();
406
+
407
+ /**
408
+ * Check if module has a premium code version.
409
+ *
410
+ * Serviceware module might be freemium without any
411
+ * premium code version, where the paid features
412
+ * are all part of the service.
413
+ *
414
+ * @author Vova Feldman (@svovaf)
415
+ * @since 1.2.1.6
416
+ *
417
+ * @return bool
418
+ */
419
+ abstract function has_premium_version();
420
+
421
+ /**
422
+ * Check if module has any release on Freemius,
423
+ * or all plugin's code is on WordPress.org (Serviceware).
424
+ *
425
+ * @return bool
426
+ */
427
+ function has_release_on_freemius() {
428
+ return ! $this->is_org_repo_compliant() ||
429
+ $this->has_premium_version();
430
+ }
431
+
432
+ /**
433
+ * Checks if it's a freemium plugin.
434
+ *
435
+ * @author Vova Feldman (@svovaf)
436
+ * @since 1.1.9
437
+ *
438
+ * @return bool
439
+ */
440
+ function is_freemium() {
441
+ return $this->has_paid_plan() &&
442
+ $this->has_free_plan();
443
+ }
444
+
445
+ #endregion
446
+
447
+ /**
448
+ * Check if running payments in sandbox mode.
449
+ *
450
+ * @since 1.0.4
451
+ *
452
+ * @return bool
453
+ */
454
+ abstract function is_payments_sandbox();
455
+
456
+ /**
457
+ * Check if running test vs. live plugin.
458
+ *
459
+ * @since 1.0.5
460
+ *
461
+ * @return bool
462
+ */
463
+ abstract function is_live();
464
+
465
+ /**
466
+ * Check if running premium plugin code.
467
+ *
468
+ * @since 1.0.5
469
+ *
470
+ * @return bool
471
+ */
472
+ abstract function is_premium();
473
+
474
+ /**
475
+ * Get upgrade URL.
476
+ *
477
+ * @author Vova Feldman (@svovaf)
478
+ * @since 1.0.2
479
+ *
480
+ * @param string $period Billing cycle.
481
+ *
482
+ * @return string
483
+ */
484
+ abstract function get_upgrade_url( $period = WP_FS__PERIOD_ANNUALLY );
485
+
486
+ /**
487
+ * Check if Freemius was first added in a plugin update.
488
+ *
489
+ * @author Vova Feldman (@svovaf)
490
+ * @since 1.1.5
491
+ *
492
+ * @return bool
493
+ */
494
+ function is_plugin_update() {
495
+ return ! $this->is_plugin_new_install();
496
+ }
497
+
498
+ /**
499
+ * Check if Freemius was part of the plugin when the user installed it first.
500
+ *
501
+ * @author Vova Feldman (@svovaf)
502
+ * @since 1.1.5
503
+ *
504
+ * @return bool
505
+ */
506
+ abstract function is_plugin_new_install();
507
+
508
+ #----------------------------------------------------------------------------------
509
+ #region Marketing
510
+ #----------------------------------------------------------------------------------
511
+
512
+ /**
513
+ * Check if current user purchased any other plugins before.
514
+ *
515
+ * @author Vova Feldman (@svovaf)
516
+ * @since 1.0.9
517
+ *
518
+ * @return bool
519
+ */
520
+ abstract function has_purchased_before();
521
+
522
+ /**
523
+ * Check if current user classified as an agency.
524
+ *
525
+ * @author Vova Feldman (@svovaf)
526
+ * @since 1.0.9
527
+ *
528
+ * @return bool
529
+ */
530
+ abstract function is_agency();
531
+
532
+ /**
533
+ * Check if current user classified as a developer.
534
+ *
535
+ * @author Vova Feldman (@svovaf)
536
+ * @since 1.0.9
537
+ *
538
+ * @return bool
539
+ */
540
+ abstract function is_developer();
541
+
542
+ /**
543
+ * Check if current user classified as a business.
544
+ *
545
+ * @author Vova Feldman (@svovaf)
546
+ * @since 1.0.9
547
+ *
548
+ * @return bool
549
+ */
550
+ abstract function is_business();
551
+
552
+ #endregion
553
+ }
freemius/includes/class-freemius.php ADDED
@@ -0,0 +1,11626 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ // "final class"
13
+ class Freemius extends Freemius_Abstract {
14
+ /**
15
+ * SDK Version
16
+ *
17
+ * @var string
18
+ */
19
+ public $version = WP_FS__SDK_VERSION;
20
+
21
+ #region Plugin Info
22
+
23
+ /**
24
+ * @since 1.0.1
25
+ *
26
+ * @var string
27
+ */
28
+ private $_slug;
29
+
30
+ /**
31
+ * @since 1.0.0
32
+ *
33
+ * @var string
34
+ */
35
+ private $_plugin_basename;
36
+ /**
37
+ * @since 1.0.0
38
+ *
39
+ * @var string
40
+ */
41
+ private $_free_plugin_basename;
42
+ /**
43
+ * @since 1.0.0
44
+ *
45
+ * @var string
46
+ */
47
+ private $_plugin_dir_path;
48
+ /**
49
+ * @since 1.0.0
50
+ *
51
+ * @var string
52
+ */
53
+ private $_plugin_dir_name;
54
+ /**
55
+ * @since 1.0.0
56
+ *
57
+ * @var string
58
+ */
59
+ private $_plugin_main_file_path;
60
+ /**
61
+ * @var string[]
62
+ */
63
+ private $_plugin_data;
64
+ /**
65
+ * @since 1.0.9
66
+ *
67
+ * @var string
68
+ */
69
+ private $_plugin_name;
70
+
71
+ #endregion Plugin Info
72
+
73
+ /**
74
+ * @since 1.0.9
75
+ *
76
+ * @var bool If false, don't turn Freemius on.
77
+ */
78
+ private $_is_on;
79
+
80
+ /**
81
+ * @since 1.1.3
82
+ *
83
+ * @var bool If false, don't turn Freemius on.
84
+ */
85
+ private $_is_anonymous;
86
+
87
+ /**
88
+ * @since 1.0.9
89
+ * @var bool If false, issues with connectivity to Freemius API.
90
+ */
91
+ private $_has_api_connection;
92
+
93
+ /**
94
+ * @since 1.0.9
95
+ * @var bool Hints the SDK if plugin can support anonymous mode (if skip connect is visible).
96
+ */
97
+ private $_enable_anonymous;
98
+
99
+ /**
100
+ * @since 1.1.7.5
101
+ * @var bool Hints the SDK if plugin should run in anonymous mode (only adds feedback form).
102
+ */
103
+ private $_anonymous_mode;
104
+
105
+ /**
106
+ * @since 1.1.9
107
+ * @var bool Hints the SDK if plugin have any free plans.
108
+ */
109
+ private $_is_premium_only;
110
+
111
+ /**
112
+ * @since 1.2.1.6
113
+ * @var bool Hints the SDK if plugin have premium code version at all.
114
+ */
115
+ private $_has_premium_version;
116
+
117
+ /**
118
+ * @since 1.2.1.6
119
+ * @var bool Hints the SDK if plugin should ignore pending mode by simulating a skip.
120
+ */
121
+ private $_ignore_pending_mode;
122
+
123
+ /**
124
+ * @since 1.0.8
125
+ * @var bool Hints the SDK if the plugin has any paid plans.
126
+ */
127
+ private $_has_paid_plans;
128
+
129
+ /**
130
+ * @since 1.2.1.5
131
+ * @var int Hints the SDK if the plugin offers a trial period. If negative, no trial, if zero - has a trial but
132
+ * without a specified period, if positive - the number of trial days.
133
+ */
134
+ private $_trial_days = - 1;
135
+
136
+ /**
137
+ * @since 1.2.1.5
138
+ * @var bool Hints the SDK if the trial requires a payment method or not.
139
+ */
140
+ private $_is_trial_require_payment = false;
141
+
142
+ /**
143
+ * @since 1.0.7
144
+ * @var bool Hints the SDK if the plugin is WordPress.org compliant.
145
+ */
146
+ private $_is_org_compliant;
147
+
148
+ /**
149
+ * @since 1.0.7
150
+ * @var bool Hints the SDK if the plugin is has add-ons.
151
+ */
152
+ private $_has_addons;
153
+
154
+ /**
155
+ * @since 1.1.6
156
+ * @var string[]bool.
157
+ */
158
+ private $_permissions;
159
+
160
+ /**
161
+ * @var FS_Key_Value_Storage
162
+ */
163
+ private $_storage;
164
+
165
+ /**
166
+ * @since 1.0.0
167
+ *
168
+ * @var FS_Logger
169
+ */
170
+ private $_logger;
171
+ /**
172
+ * @since 1.0.4
173
+ *
174
+ * @var FS_Plugin
175
+ */
176
+ private $_plugin = false;
177
+ /**
178
+ * @since 1.0.4
179
+ *
180
+ * @var FS_Plugin|false
181
+ */
182
+ private $_parent_plugin = false;
183
+ /**
184
+ * @since 1.1.1
185
+ *
186
+ * @var Freemius
187
+ */
188
+ private $_parent = false;
189
+ /**
190
+ * @since 1.0.1
191
+ *
192
+ * @var FS_User
193
+ */
194
+ private $_user = false;
195
+ /**
196
+ * @since 1.0.1
197
+ *
198
+ * @var FS_Site
199
+ */
200
+ private $_site = false;
201
+ /**
202
+ * @since 1.0.1
203
+ *
204
+ * @var FS_Plugin_License
205
+ */
206
+ private $_license;
207
+ /**
208
+ * @since 1.0.2
209
+ *
210
+ * @var FS_Plugin_Plan[]
211
+ */
212
+ private $_plans = false;
213
+ /**
214
+ * @var FS_Plugin_License[]
215
+ * @since 1.0.5
216
+ */
217
+ private $_licenses = false;
218
+
219
+ /**
220
+ * @since 1.0.1
221
+ *
222
+ * @var FS_Admin_Menu_Manager
223
+ */
224
+ private $_menu;
225
+
226
+ /**
227
+ * @var FS_Admin_Notice_Manager
228
+ */
229
+ private $_admin_notices;
230
+
231
+ /**
232
+ * @since 1.1.6
233
+ *
234
+ * @var FS_Admin_Notice_Manager
235
+ */
236
+ private static $_global_admin_notices;
237
+
238
+ /**
239
+ * @var FS_Logger
240
+ * @since 1.0.0
241
+ */
242
+ private static $_static_logger;
243
+
244
+ /**
245
+ * @var FS_Option_Manager
246
+ * @since 1.0.2
247
+ */
248
+ private static $_accounts;
249
+
250
+ /**
251
+ * @var Freemius[]
252
+ */
253
+ private static $_instances = array();
254
+
255
+ #region Uninstall Reasons IDs
256
+
257
+ const REASON_NO_LONGER_NEEDED = 1;
258
+ const REASON_FOUND_A_BETTER_PLUGIN = 2;
259
+ const REASON_NEEDED_FOR_A_SHORT_PERIOD = 3;
260
+ const REASON_BROKE_MY_SITE = 4;
261
+ const REASON_SUDDENLY_STOPPED_WORKING = 5;
262
+ const REASON_CANT_PAY_ANYMORE = 6;
263
+ const REASON_OTHER = 7;
264
+ const REASON_DIDNT_WORK = 8;
265
+ const REASON_DONT_LIKE_TO_SHARE_MY_INFORMATION = 9;
266
+ const REASON_COULDNT_MAKE_IT_WORK = 10;
267
+ const REASON_GREAT_BUT_NEED_SPECIFIC_FEATURE = 11;
268
+ const REASON_NOT_WORKING = 12;
269
+ const REASON_NOT_WHAT_I_WAS_LOOKING_FOR = 13;
270
+ const REASON_DIDNT_WORK_AS_EXPECTED = 14;
271
+ const REASON_TEMPORARY_DEACTIVATION = 15;
272
+
273
+ #endregion
274
+
275
+ /* Ctor
276
+ ------------------------------------------------------------------------------------------------------------------*/
277
+
278
+ /**
279
+ * Main singleton instance.
280
+ *
281
+ * @author Vova Feldman (@svovaf)
282
+ * @since 1.0.0
283
+ *
284
+ * @param string $slug
285
+ * @param bool $is_init Since 1.2.1 Is initiation sequence.
286
+ */
287
+ private function __construct( $slug, $is_init = false ) {
288
+ $this->_slug = $slug;
289
+
290
+ $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $slug, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
291
+
292
+ $this->_storage = FS_Key_Value_Storage::instance( 'plugin_data', $this->_slug );
293
+
294
+ $this->_plugin_main_file_path = $this->_find_caller_plugin_file( $is_init );
295
+ $this->_plugin_dir_path = plugin_dir_path( $this->_plugin_main_file_path );
296
+ $this->_plugin_basename = plugin_basename( $this->_plugin_main_file_path );
297
+ $this->_free_plugin_basename = str_replace( '-premium/', '/', $this->_plugin_basename );
298
+
299
+ $base_name_split = explode( '/', $this->_plugin_basename );
300
+ $this->_plugin_dir_name = $base_name_split[0];
301
+
302
+ if ( $this->_logger->is_on() ) {
303
+ $this->_logger->info( 'plugin_main_file_path = ' . $this->_plugin_main_file_path );
304
+ $this->_logger->info( 'plugin_dir_path = ' . $this->_plugin_dir_path );
305
+ $this->_logger->info( 'plugin_basename = ' . $this->_plugin_basename );
306
+ $this->_logger->info( 'free_plugin_basename = ' . $this->_free_plugin_basename );
307
+ $this->_logger->info( 'plugin_dir_name = ' . $this->_plugin_dir_name );
308
+ }
309
+
310
+ // Remember link between file to slug.
311
+ $this->store_file_slug_map();
312
+
313
+ // Store plugin's initial install timestamp.
314
+ if ( ! isset( $this->_storage->install_timestamp ) ) {
315
+ $this->_storage->install_timestamp = WP_FS__SCRIPT_START_TIME;
316
+ }
317
+
318
+ $this->_plugin = FS_Plugin_Manager::instance( $this->_slug )->get();
319
+
320
+ $this->_admin_notices = FS_Admin_Notice_Manager::instance(
321
+ $slug,
322
+ is_object( $this->_plugin ) ? $this->_plugin->title : ''
323
+ );
324
+
325
+ if ( 'true' === fs_request_get( 'fs_clear_api_cache' ) ||
326
+ 'true' === fs_request_is_action( 'restart_freemius' )
327
+ ) {
328
+ FS_Api::clear_cache();
329
+ }
330
+
331
+ $this->_register_hooks();
332
+
333
+ $this->_load_account();
334
+
335
+ $this->_version_updates_handler();
336
+ }
337
+
338
+ /**
339
+ * @author Vova Feldman (@svovaf)
340
+ * @since 1.0.9
341
+ */
342
+ private function _version_updates_handler() {
343
+ if ( ! isset( $this->_storage->sdk_version ) || $this->_storage->sdk_version != $this->version ) {
344
+ // Freemius version upgrade mode.
345
+ $this->_storage->sdk_last_version = $this->_storage->sdk_version;
346
+ $this->_storage->sdk_version = $this->version;
347
+
348
+ if ( empty( $this->_storage->sdk_last_version ) ||
349
+ version_compare( $this->_storage->sdk_last_version, $this->version, '<' )
350
+ ) {
351
+ $this->_storage->sdk_upgrade_mode = true;
352
+ $this->_storage->sdk_downgrade_mode = false;
353
+ } else {
354
+ $this->_storage->sdk_downgrade_mode = true;
355
+ $this->_storage->sdk_upgrade_mode = false;
356
+
357
+ }
358
+
359
+ $this->do_action( 'sdk_version_update', $this->_storage->sdk_last_version, $this->version );
360
+ }
361
+
362
+ $plugin_version = $this->get_plugin_version();
363
+ if ( ! isset( $this->_storage->plugin_version ) || $this->_storage->plugin_version != $plugin_version ) {
364
+ // Plugin version upgrade mode.
365
+ $this->_storage->plugin_last_version = $this->_storage->plugin_version;
366
+ $this->_storage->plugin_version = $plugin_version;
367
+
368
+ if ( empty( $this->_storage->plugin_last_version ) ||
369
+ version_compare( $this->_storage->plugin_last_version, $plugin_version, '<' )
370
+ ) {
371
+ $this->_storage->plugin_upgrade_mode = true;
372
+ $this->_storage->plugin_downgrade_mode = false;
373
+ } else {
374
+ $this->_storage->plugin_downgrade_mode = true;
375
+ $this->_storage->plugin_upgrade_mode = false;
376
+ }
377
+
378
+ if ( ! empty( $this->_storage->plugin_last_version ) ) {
379
+ // Different version of the plugin was installed before, therefore it's an update.
380
+ $this->_storage->is_plugin_new_install = false;
381
+ }
382
+
383
+ $this->do_action( 'plugin_version_update', $this->_storage->plugin_last_version, $plugin_version );
384
+ }
385
+ }
386
+
387
+ /**
388
+ * @author Vova Feldman (@svovaf)
389
+ * @since 1.1.5
390
+ *
391
+ * @param string $sdk_prev_version
392
+ * @param string $sdk_version
393
+ */
394
+ function _data_migration( $sdk_prev_version, $sdk_version ) {
395
+ /**
396
+ * @since 1.1.7.3 Fixed unwanted connectivity test cleanup.
397
+ */
398
+ if ( empty( $sdk_prev_version ) ) {
399
+ return;
400
+ }
401
+
402
+ if ( version_compare( $sdk_prev_version, '1.1.5', '<' ) &&
403
+ version_compare( $sdk_version, '1.1.5', '>=' )
404
+ ) {
405
+ // On version 1.1.5 merged connectivity and is_on data.
406
+ if ( isset( $this->_storage->connectivity_test ) ) {
407
+ if ( ! isset( $this->_storage->is_on ) ) {
408
+ unset( $this->_storage->connectivity_test );
409
+ } else {
410
+ $connectivity_data = $this->_storage->connectivity_test;
411
+ $connectivity_data['is_active'] = $this->_storage->is_on['is_active'];
412
+ $connectivity_data['timestamp'] = $this->_storage->is_on['timestamp'];
413
+
414
+ // Override.
415
+ $this->_storage->connectivity_test = $connectivity_data;
416
+
417
+ // Remove previous structure.
418
+ unset( $this->_storage->is_on );
419
+ }
420
+
421
+ }
422
+ }
423
+ }
424
+
425
+ /**
426
+ * This action is connected to the 'plugins_loaded' hook and helps to determine
427
+ * if this is a new plugin installation or a plugin update.
428
+ *
429
+ * There are 3 different use-cases:
430
+ * 1) New plugin installation right with Freemius:
431
+ * 1.1 _activate_plugin_event_hook() will be executed first
432
+ * 1.2 Since $this->_storage->is_plugin_new_install is not set,
433
+ * and $this->_storage->plugin_last_version is not set,
434
+ * $this->_storage->is_plugin_new_install will be set to TRUE.
435
+ * 1.3 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install will
436
+ * be already set to TRUE.
437
+ *
438
+ * 2) Plugin update, didn't have Freemius before, and now have the SDK:
439
+ * 2.1 _activate_plugin_event_hook() will not be executed, because
440
+ * the activation hook do NOT fires on updates since WP 3.1.
441
+ * 2.2 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install will
442
+ * be empty, therefore, it will be set to FALSE.
443
+ *
444
+ * 3) Plugin update, had Freemius in prev version as well:
445
+ * 3.1 _version_updates_handler() will be executed 1st, since FS was installed
446
+ * before, $this->_storage->plugin_last_version will NOT be empty,
447
+ * therefore, $this->_storage->is_plugin_new_install will be set to FALSE.
448
+ * 3.2 When _plugins_loaded() will be executed, $this->_storage->is_plugin_new_install is
449
+ * already set, therefore, it will not be modified.
450
+ *
451
+ * Use-case #3 is backward compatible, #3.1 will be executed since 1.0.9.
452
+ *
453
+ * NOTE:
454
+ * The only fallback of this mechanism is if an admin updates a plugin based on use-case #2,
455
+ * and then, the next immediate PageView is the plugin's main settings page, it will not
456
+ * show the opt-in right away. The reason it will happen is because Freemius execution
457
+ * will be turned off till the plugin is fully loaded at least once
458
+ * (till $this->_storage->was_plugin_loaded is TRUE).
459
+ *
460
+ * @author Vova Feldman (@svovaf)
461
+ * @since 1.1.9
462
+ *
463
+ */
464
+ function _plugins_loaded() {
465
+ // Update flag that plugin was loaded with Freemius at least once.
466
+ $this->_storage->was_plugin_loaded = true;
467
+
468
+ if ( ! isset( $this->_storage->is_plugin_new_install ) ) {
469
+ $this->_storage->is_plugin_new_install = false;
470
+ }
471
+ }
472
+
473
+ /**
474
+ * @author Vova Feldman (@svovaf)
475
+ * @since 1.0.9
476
+ */
477
+ private function _register_hooks() {
478
+ $this->_logger->entrance();
479
+
480
+ if ( is_admin() ) {
481
+ $plugin_dir = dirname( $this->_plugin_dir_path ) . '/';
482
+
483
+ /**
484
+ * @since 1.2.2
485
+ *
486
+ * Hook to both free and premium version activations to support
487
+ * auto deactivation on the other version activation.
488
+ */
489
+ register_activation_hook(
490
+ $plugin_dir . $this->_free_plugin_basename,
491
+ array( &$this, '_activate_plugin_event_hook' )
492
+ );
493
+ register_activation_hook(
494
+ $plugin_dir . $this->premium_plugin_basename(),
495
+ array( &$this, '_activate_plugin_event_hook' )
496
+ );
497
+
498
+ /**
499
+ * Part of the mechanism to identify new plugin install vs. plugin update.
500
+ *
501
+ * @author Vova Feldman (@svovaf)
502
+ * @since 1.1.9
503
+ */
504
+ if ( empty( $this->_storage->was_plugin_loaded ) ) {
505
+ if ( $this->is_activation_mode( false ) ) {
506
+ add_action( 'plugins_loaded', array( &$this, '_plugins_loaded' ) );
507
+ } else {
508
+ // If was activated before, then it was already loaded before.
509
+ $this->_plugins_loaded();
510
+ }
511
+ }
512
+
513
+ if ( ! self::is_ajax() ) {
514
+ if ( ! $this->is_addon() ) {
515
+ add_action( 'init', array( &$this, '_add_default_submenu_items' ), WP_FS__LOWEST_PRIORITY );
516
+ add_action( 'admin_menu', array( &$this, '_prepare_admin_menu' ), WP_FS__LOWEST_PRIORITY );
517
+ }
518
+ }
519
+ }
520
+
521
+ register_deactivation_hook( $this->_plugin_main_file_path, array( &$this, '_deactivate_plugin_hook' ) );
522
+
523
+ add_action( 'init', array( &$this, '_redirect_on_clicked_menu_link' ), WP_FS__LOWEST_PRIORITY );
524
+
525
+ add_action( 'admin_init', array( &$this, '_add_tracking_links' ) );
526
+ add_action( 'admin_init', array( &$this, '_add_license_activation' ) );
527
+ $this->add_ajax_action( 'update_billing', array( &$this, '_update_billing_ajax_action' ) );
528
+ $this->add_ajax_action( 'start_trial', array( &$this, '_start_trial_ajax_action' ) );
529
+
530
+ $this->add_action( 'after_plans_sync', array( &$this, '_check_for_trial_plans' ) );
531
+
532
+ $this->add_action( 'sdk_version_update', array( &$this, '_data_migration' ), WP_FS__DEFAULT_PRIORITY, 2 );
533
+
534
+ add_action( 'admin_init', array( &$this, '_add_trial_notice' ) );
535
+ add_action( 'admin_init', array( &$this, '_enqueue_common_css' ) );
536
+
537
+ /**
538
+ * Handle request to reset anonymous mode for `get_reconnect_url()`.
539
+ *
540
+ * @author Vova Feldman (@svovaf)
541
+ * @since 1.2.1.5
542
+ */
543
+ if ( fs_request_is_action( 'reset_anonymous_mode' ) &&
544
+ $this->_slug === fs_request_get( 'fs_slug' )
545
+ ) {
546
+ add_action( 'admin_init', array( &$this, 'connect_again' ) );
547
+ }
548
+ }
549
+
550
+ /**
551
+ * Keeping the uninstall hook registered for free or premium plugin version may result to a fatal error that
552
+ * could happen when a user tries to uninstall either version while one of them is still active. Uninstalling a
553
+ * plugin will trigger inclusion of the free or premium version and if one of them is active during the
554
+ * uninstallation, a fatal error may occur in case the plugin's class or functions are already defined.
555
+ *
556
+ * @author Leo Fajardo (leorw)
557
+ *
558
+ * @since 1.2.0
559
+ */
560
+ private function unregister_uninstall_hook() {
561
+ $uninstallable_plugins = (array) get_option( 'uninstall_plugins' );
562
+ unset( $uninstallable_plugins[ $this->_free_plugin_basename ] );
563
+ unset( $uninstallable_plugins[ $this->premium_plugin_basename() ] );
564
+
565
+ update_option( 'uninstall_plugins', $uninstallable_plugins );
566
+ }
567
+
568
+ /**
569
+ * @since 1.2.0 Invalidate module's main file cache, otherwise, FS_Plugin_Updater will not fetch updates.
570
+ */
571
+ private function clear_module_main_file_cache() {
572
+ if ( ! isset( $this->_storage->plugin_main_file ) ||
573
+ empty( $this->_storage->plugin_main_file->path )
574
+ ) {
575
+ return;
576
+ }
577
+
578
+ $plugin_main_file = clone $this->_storage->plugin_main_file;
579
+
580
+ // Store cached path (2nd layer cache).
581
+ $plugin_main_file->prev_path = $plugin_main_file->path;
582
+
583
+ // Clear cached path.
584
+ unset( $plugin_main_file->path );
585
+
586
+ $this->_storage->plugin_main_file = $plugin_main_file;
587
+ }
588
+
589
+ /**
590
+ * @author Vova Feldman (@svovaf)
591
+ * @since 1.0.9
592
+ */
593
+ private function _register_account_hooks() {
594
+ if ( ! is_admin() ) {
595
+ return;
596
+ }
597
+
598
+ /**
599
+ * Always show the deactivation feedback form since we added
600
+ * automatic free version deactivation upon premium code activation.
601
+ *
602
+ * @since 1.2.1.6
603
+ */
604
+ $this->add_ajax_action(
605
+ 'submit_uninstall_reason',
606
+ 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
+ /**
621
+ * Leverage backtrace to find caller plugin file path.
622
+ *
623
+ * @author Vova Feldman (@svovaf)
624
+ * @since 1.0.6
625
+ *
626
+ * @param bool $is_init Is initiation sequence.
627
+ *
628
+ * @return string
629
+ *
630
+ * @uses fs_find_caller_plugin_file
631
+ */
632
+ private function _find_caller_plugin_file( $is_init = false ) {
633
+ // Try to load the cached value of the file path.
634
+ if ( isset( $this->_storage->plugin_main_file ) ) {
635
+ $plugin_main_file = $this->_storage->plugin_main_file;
636
+ if ( isset( $plugin_main_file->path ) && file_exists( $plugin_main_file->path ) ) {
637
+ return $this->_storage->plugin_main_file->path;
638
+ }
639
+ }
640
+
641
+ /**
642
+ * @since 1.2.1
643
+ *
644
+ * `clear_module_main_file_cache()` is clearing the plugin's cached path on
645
+ * deactivation. Therefore, if any plugin/theme was initiating `Freemius`
646
+ * with that plugin's slug, it was overriding the empty plugin path with a wrong path.
647
+ *
648
+ * So, we've added a special mechanism with a 2nd layer of cache that uses `prev_path`
649
+ * when the class instantiator isn't the module.
650
+ */
651
+ if ( ! $is_init ) {
652
+ // Fetch prev path cache.
653
+ if ( isset( $this->_storage->plugin_main_file ) &&
654
+ isset( $this->_storage->plugin_main_file->prev_path )
655
+ ) {
656
+ if ( file_exists( $this->_storage->plugin_main_file->prev_path ) ) {
657
+ return $this->_storage->plugin_main_file->prev_path;
658
+ }
659
+ }
660
+
661
+ wp_die(
662
+ __fs( 'failed-finding-main-path', $this->_slug ),
663
+ __fs( 'error' ),
664
+ array( 'back_link' => true )
665
+ );
666
+ }
667
+
668
+ /**
669
+ * @since 1.2.1
670
+ *
671
+ * Only the original instantiator that calls dynamic_init can modify the module's path.
672
+ */
673
+ // Find caller module.
674
+ $plugin_file = fs_find_caller_plugin_file();
675
+
676
+ $this->_storage->plugin_main_file = (object) array(
677
+ 'path' => fs_normalize_path( $plugin_file ),
678
+ );
679
+
680
+ return $plugin_file;
681
+ }
682
+
683
+
684
+ #----------------------------------------------------------------------------------
685
+ #region Deactivation Feedback Form
686
+ #----------------------------------------------------------------------------------
687
+
688
+ /**
689
+ * Displays a confirmation and feedback dialog box when the user clicks on the "Deactivate" link on the plugins
690
+ * page.
691
+ *
692
+ * @author Vova Feldman (@svovaf)
693
+ * @author Leo Fajardo (@leorw)
694
+ * @since 1.1.2
695
+ */
696
+ function _add_deactivation_feedback_dialog_box() {
697
+ /* Check the type of user:
698
+ * 1. Long-term (long-term)
699
+ * 2. Non-registered and non-anonymous short-term (non-registered-and-non-anonymous-short-term).
700
+ * 3. Short-term (short-term)
701
+ */
702
+ $is_long_term_user = true;
703
+
704
+ // Check if the site is at least 2 days old.
705
+ $time_installed = $this->_storage->install_timestamp;
706
+
707
+ // Difference in seconds.
708
+ $date_diff = time() - $time_installed;
709
+
710
+ // Convert seconds to days.
711
+ $date_diff_days = floor( $date_diff / ( 60 * 60 * 24 ) );
712
+
713
+ if ( $date_diff_days < 2 ) {
714
+ $is_long_term_user = false;
715
+ }
716
+
717
+ $is_long_term_user = $this->apply_filters( 'is_long_term_user', $is_long_term_user );
718
+
719
+ if ( $is_long_term_user ) {
720
+ $user_type = 'long-term';
721
+ } else {
722
+ if ( ! $this->is_registered() && ! $this->is_anonymous() ) {
723
+ $user_type = 'non-registered-and-non-anonymous-short-term';
724
+ } else {
725
+ $user_type = 'short-term';
726
+ }
727
+ }
728
+
729
+ $uninstall_reasons = $this->_get_uninstall_reasons( $user_type );
730
+
731
+ // Load the HTML template for the deactivation feedback dialog box.
732
+ $vars = array(
733
+ 'reasons' => $uninstall_reasons,
734
+ 'slug' => $this->_slug
735
+ );
736
+
737
+ /**
738
+ * @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.
739
+ */
740
+ fs_require_template( 'forms/deactivation/form.php', $vars );
741
+ }
742
+
743
+ /**
744
+ * @author Leo Fajardo (leorw)
745
+ * @since 1.1.2
746
+ *
747
+ * @param string $user_type
748
+ *
749
+ * @return array The uninstall reasons for the specified user type.
750
+ */
751
+ function _get_uninstall_reasons( $user_type = 'long-term' ) {
752
+ $internal_message_template_var = array(
753
+ 'slug' => $this->_slug
754
+ );
755
+
756
+ if ( $this->is_registered() && false !== $this->get_plan() && $this->get_plan()->has_technical_support() ) {
757
+ $contact_support_template = fs_get_template( 'forms/deactivation/contact.php', $internal_message_template_var );
758
+ } else {
759
+ $contact_support_template = '';
760
+ }
761
+
762
+ $reason_found_better_plugin = array(
763
+ 'id' => self::REASON_FOUND_A_BETTER_PLUGIN,
764
+ 'text' => __fs( 'reason-found-a-better-plugin', $this->_slug ),
765
+ 'input_type' => 'textfield',
766
+ 'input_placeholder' => __fs( 'placeholder-plugin-name', $this->_slug )
767
+ );
768
+
769
+ $reason_temporary_deactivation = array(
770
+ 'id' => self::REASON_TEMPORARY_DEACTIVATION,
771
+ 'text' => __fs( 'reason-temporary-deactivation', $this->_slug ),
772
+ 'input_type' => '',
773
+ 'input_placeholder' => ''
774
+ );
775
+
776
+ $reason_other = array(
777
+ 'id' => self::REASON_OTHER,
778
+ 'text' => __fs( 'reason-other', $this->_slug ),
779
+ 'input_type' => 'textfield',
780
+ 'input_placeholder' => ''
781
+ );
782
+
783
+ $long_term_user_reasons = array(
784
+ array(
785
+ 'id' => self::REASON_NO_LONGER_NEEDED,
786
+ 'text' => __fs( 'reason-no-longer-needed', $this->_slug ),
787
+ 'input_type' => '',
788
+ 'input_placeholder' => ''
789
+ ),
790
+ $reason_found_better_plugin,
791
+ array(
792
+ 'id' => self::REASON_NEEDED_FOR_A_SHORT_PERIOD,
793
+ 'text' => __fs( 'reason-needed-for-a-short-period', $this->_slug ),
794
+ 'input_type' => '',
795
+ 'input_placeholder' => ''
796
+ ),
797
+ array(
798
+ 'id' => self::REASON_BROKE_MY_SITE,
799
+ 'text' => __fs( 'reason-broke-my-site', $this->_slug ),
800
+ 'input_type' => '',
801
+ 'input_placeholder' => '',
802
+ 'internal_message' => $contact_support_template
803
+ ),
804
+ array(
805
+ 'id' => self::REASON_SUDDENLY_STOPPED_WORKING,
806
+ 'text' => __fs( 'reason-suddenly-stopped-working', $this->_slug ),
807
+ 'input_type' => '',
808
+ 'input_placeholder' => '',
809
+ 'internal_message' => $contact_support_template
810
+ )
811
+ );
812
+
813
+ if ( $this->is_paying() ) {
814
+ $long_term_user_reasons[] = array(
815
+ 'id' => self::REASON_CANT_PAY_ANYMORE,
816
+ 'text' => __fs( 'reason-cant-pay-anymore', $this->_slug ),
817
+ 'input_type' => 'textfield',
818
+ 'input_placeholder' => __fs( 'placeholder-comfortable-price', $this->_slug )
819
+ );
820
+ }
821
+
822
+ $reason_dont_share_info = array(
823
+ 'id' => self::REASON_DONT_LIKE_TO_SHARE_MY_INFORMATION,
824
+ 'text' => __fs( 'reason-dont-like-to-share-my-information', $this->_slug ),
825
+ 'input_type' => '',
826
+ 'input_placeholder' => ''
827
+ );
828
+
829
+ /**
830
+ * If the current user has selected the "don't share data" reason in the deactivation feedback modal, inform the
831
+ * user by showing additional message that he doesn't have to share data and can just choose to skip the opt-in
832
+ * (the Skip button is included in the message to show). This message will only be shown if anonymous mode is
833
+ * enabled and the user's account is currently not in pending activation state (similar to the way the Skip
834
+ * button in the opt-in form is shown/hidden).
835
+ */
836
+ if ( $this->is_enable_anonymous() && ! $this->is_pending_activation() ) {
837
+ $reason_dont_share_info['internal_message'] = fs_get_template( 'forms/deactivation/retry-skip.php', $internal_message_template_var );
838
+ }
839
+
840
+ $uninstall_reasons = array(
841
+ 'long-term' => $long_term_user_reasons,
842
+ 'non-registered-and-non-anonymous-short-term' => array(
843
+ array(
844
+ 'id' => self::REASON_DIDNT_WORK,
845
+ 'text' => __fs( 'reason-didnt-work', $this->_slug ),
846
+ 'input_type' => '',
847
+ 'input_placeholder' => ''
848
+ ),
849
+ $reason_dont_share_info,
850
+ $reason_found_better_plugin
851
+ ),
852
+ 'short-term' => array(
853
+ array(
854
+ 'id' => self::REASON_COULDNT_MAKE_IT_WORK,
855
+ 'text' => __fs( 'reason-couldnt-make-it-work', $this->_slug ),
856
+ 'input_type' => '',
857
+ 'input_placeholder' => '',
858
+ 'internal_message' => $contact_support_template
859
+ ),
860
+ $reason_found_better_plugin,
861
+ array(
862
+ 'id' => self::REASON_GREAT_BUT_NEED_SPECIFIC_FEATURE,
863
+ 'text' => __fs( 'reason-great-but-need-specific-feature', $this->_slug ),
864
+ 'input_type' => 'textarea',
865
+ 'input_placeholder' => __fs( 'placeholder-feature', $this->_slug )
866
+ ),
867
+ array(
868
+ 'id' => self::REASON_NOT_WORKING,
869
+ 'text' => __fs( 'reason-not-working', $this->_slug ),
870
+ 'input_type' => 'textarea',
871
+ 'input_placeholder' => __fs( 'placeholder-share-what-didnt-work', $this->_slug )
872
+ ),
873
+ array(
874
+ 'id' => self::REASON_NOT_WHAT_I_WAS_LOOKING_FOR,
875
+ 'text' => __fs( 'reason-not-what-i-was-looking-for', $this->_slug ),
876
+ 'input_type' => 'textarea',
877
+ 'input_placeholder' => __fs( 'placeholder-what-youve-been-looking-for', $this->_slug )
878
+ ),
879
+ array(
880
+ 'id' => self::REASON_DIDNT_WORK_AS_EXPECTED,
881
+ 'text' => __fs( 'reason-didnt-work-as-expected', $this->_slug ),
882
+ 'input_type' => 'textarea',
883
+ 'input_placeholder' => __fs( 'placeholder-what-did-you-expect', $this->_slug )
884
+ )
885
+ )
886
+ );
887
+
888
+ // Randomize the reasons for the current user type.
889
+ shuffle( $uninstall_reasons[ $user_type ] );
890
+
891
+ // Keep the following reasons as the last items in the list.
892
+ $uninstall_reasons[ $user_type ][] = $reason_temporary_deactivation;
893
+ $uninstall_reasons[ $user_type ][] = $reason_other;
894
+
895
+ $uninstall_reasons = $this->apply_filters( 'uninstall_reasons', $uninstall_reasons );
896
+
897
+ return $uninstall_reasons[ $user_type ];
898
+ }
899
+
900
+ /**
901
+ * Called after the user has submitted his reason for deactivating the plugin.
902
+ *
903
+ * @author Leo Fajardo (@leorw)
904
+ * @since 1.1.2
905
+ */
906
+ function _submit_uninstall_reason_action() {
907
+ $reason_id = fs_request_get( 'reason_id' );
908
+
909
+ // Check if the given reason ID is an unsigned integer.
910
+ if ( ! ctype_digit( $reason_id ) ) {
911
+ exit;
912
+ }
913
+
914
+ $reason_info = trim( fs_request_get( 'reason_info', '' ) );
915
+ if ( ! empty( $reason_info ) ) {
916
+ $reason_info = substr( $reason_info, 0, 128 );
917
+ }
918
+
919
+ $reason = (object) array(
920
+ 'id' => $reason_id,
921
+ 'info' => $reason_info,
922
+ 'is_anonymous' => fs_request_get_bool( 'is_anonymous' )
923
+ );
924
+
925
+ $this->_storage->store( 'uninstall_reason', $reason );
926
+
927
+ // Print '1' for successful operation.
928
+ echo 1;
929
+ exit;
930
+ }
931
+
932
+ #endregion
933
+
934
+ #----------------------------------------------------------------------------------
935
+ #region Instance
936
+ #----------------------------------------------------------------------------------
937
+
938
+ /**
939
+ * Main singleton instance.
940
+ *
941
+ * @author Vova Feldman (@svovaf)
942
+ * @since 1.0.0
943
+ *
944
+ * @param string $slug
945
+ * @param bool $is_init Is initiation sequence.
946
+ *
947
+ * @return Freemius
948
+ */
949
+ static function instance( $slug, $is_init = false ) {
950
+ $slug = strtolower( $slug );
951
+
952
+ if ( ! isset( self::$_instances[ $slug ] ) ) {
953
+ if ( 0 === count( self::$_instances ) ) {
954
+ self::_load_required_static();
955
+ }
956
+
957
+ self::$_instances[ $slug ] = new Freemius( $slug, $is_init );
958
+ }
959
+
960
+ return self::$_instances[ $slug ];
961
+ }
962
+
963
+ /**
964
+ * @author Vova Feldman (@svovaf)
965
+ * @since 1.0.6
966
+ *
967
+ * @param string|number $slug_or_id
968
+ *
969
+ * @return bool
970
+ */
971
+ private static function has_instance( $slug_or_id ) {
972
+ return ! is_numeric( $slug_or_id ) ?
973
+ isset( self::$_instances[ strtolower( $slug_or_id ) ] ) :
974
+ ( false !== self::get_instance_by_id( $slug_or_id ) );
975
+ }
976
+
977
+ /**
978
+ * @author Vova Feldman (@svovaf)
979
+ * @since 1.0.6
980
+ *
981
+ * @param $id
982
+ *
983
+ * @return false|Freemius
984
+ */
985
+ static function get_instance_by_id( $id ) {
986
+ foreach ( self::$_instances as $slug => $instance ) {
987
+ if ( $id == $instance->get_id() ) {
988
+ return $instance;
989
+ }
990
+ }
991
+
992
+ return false;
993
+ }
994
+
995
+ /**
996
+ *
997
+ * @author Vova Feldman (@svovaf)
998
+ * @since 1.0.1
999
+ *
1000
+ * @param $plugin_file
1001
+ *
1002
+ * @return false|Freemius
1003
+ */
1004
+ static function get_instance_by_file( $plugin_file ) {
1005
+ $slug = self::find_slug_by_basename( $plugin_file );
1006
+
1007
+ return ( false !== $slug ) ?
1008
+ self::instance( $slug ) :
1009
+ false;
1010
+ }
1011
+
1012
+ /**
1013
+ * @author Vova Feldman (@svovaf)
1014
+ * @since 1.0.6
1015
+ *
1016
+ * @return false|Freemius
1017
+ */
1018
+ function get_parent_instance() {
1019
+ return self::get_instance_by_id( $this->_plugin->parent_plugin_id );
1020
+ }
1021
+
1022
+ /**
1023
+ * @author Vova Feldman (@svovaf)
1024
+ * @since 1.0.6
1025
+ *
1026
+ * @param $slug_or_id
1027
+ *
1028
+ * @return bool|Freemius
1029
+ */
1030
+ function get_addon_instance( $slug_or_id ) {
1031
+ return ! is_numeric( $slug_or_id ) ?
1032
+ self::instance( strtolower( $slug_or_id ) ) :
1033
+ self::get_instance_by_id( $slug_or_id );
1034
+ }
1035
+
1036
+ #endregion ------------------------------------------------------------------
1037
+
1038
+ /**
1039
+ * @author Vova Feldman (@svovaf)
1040
+ * @since 1.0.6
1041
+ *
1042
+ * @return bool
1043
+ */
1044
+ function is_parent_plugin_installed() {
1045
+ return self::has_instance( $this->_plugin->parent_plugin_id );
1046
+ }
1047
+
1048
+ /**
1049
+ * Check if add-on parent plugin in activation mode.
1050
+ *
1051
+ * @author Vova Feldman (@svovaf)
1052
+ * @since 1.0.7
1053
+ *
1054
+ * @return bool
1055
+ */
1056
+ function is_parent_in_activation() {
1057
+ $parent_fs = $this->get_parent_instance();
1058
+ if ( ! is_object( $parent_fs ) ) {
1059
+ return false;
1060
+ }
1061
+
1062
+ return ( $parent_fs->is_activation_mode() );
1063
+ }
1064
+
1065
+ /**
1066
+ * Is plugin in activation mode.
1067
+ *
1068
+ * @author Vova Feldman (@svovaf)
1069
+ * @since 1.0.7
1070
+ *
1071
+ * @param bool $and_on
1072
+ *
1073
+ * @return bool
1074
+ */
1075
+ function is_activation_mode( $and_on = true ) {
1076
+ return (
1077
+ ( $this->is_on() || ! $and_on ) &&
1078
+ ! $this->is_registered() &&
1079
+ ( ! $this->is_enable_anonymous() ||
1080
+ ( ! $this->is_anonymous() && ! $this->is_pending_activation() ) )
1081
+ );
1082
+ }
1083
+
1084
+ /**
1085
+ * Get collection of all active plugins.
1086
+ *
1087
+ * @author Vova Feldman (@svovaf)
1088
+ * @since 1.0.9
1089
+ *
1090
+ * @return array[string]array
1091
+ */
1092
+ private static function get_active_plugins() {
1093
+ self::require_plugin_essentials();
1094
+
1095
+ $active_plugin = array();
1096
+ $all_plugins = get_plugins();
1097
+ $active_plugins_basenames = get_option( 'active_plugins' );
1098
+
1099
+ foreach ( $active_plugins_basenames as $plugin_basename ) {
1100
+ $active_plugin[ $plugin_basename ] = $all_plugins[ $plugin_basename ];
1101
+ }
1102
+
1103
+ return $active_plugin;
1104
+ }
1105
+
1106
+ /**
1107
+ * Get collection of all plugins.
1108
+ *
1109
+ * @author Vova Feldman (@svovaf)
1110
+ * @since 1.1.8
1111
+ *
1112
+ * @return array Key is the plugin file path and the value is an array of the plugin data.
1113
+ */
1114
+ private static function get_all_plugins() {
1115
+ self::require_plugin_essentials();
1116
+
1117
+ $all_plugins = get_plugins();
1118
+ $active_plugins_basenames = get_option( 'active_plugins' );
1119
+
1120
+ foreach ( $all_plugins as $basename => &$data ) {
1121
+ // By default set to inactive (next foreach update the active plugins).
1122
+ $data['is_active'] = false;
1123
+ // Enrich with plugin slug.
1124
+ $data['slug'] = self::get_plugin_slug( $basename );
1125
+ }
1126
+
1127
+ // Flag active plugins.
1128
+ foreach ( $active_plugins_basenames as $basename ) {
1129
+ if ( isset( $all_plugins[ $basename ] ) ) {
1130
+ $all_plugins[ $basename ]['is_active'] = true;
1131
+ }
1132
+ }
1133
+
1134
+ return $all_plugins;
1135
+ }
1136
+
1137
+
1138
+ /**
1139
+ * Cached result of get_site_transient( 'update_plugins' )
1140
+ *
1141
+ * @author Vova Feldman (@svovaf)
1142
+ * @since 1.1.8
1143
+ *
1144
+ * @var object
1145
+ */
1146
+ private static $_plugins_info;
1147
+
1148
+ /**
1149
+ * Helper function to get specified plugin's slug.
1150
+ *
1151
+ * @author Vova Feldman (@svovaf)
1152
+ * @since 1.1.8
1153
+ *
1154
+ * @param $basename
1155
+ *
1156
+ * @return string
1157
+ */
1158
+ private static function get_plugin_slug( $basename ) {
1159
+ if ( ! isset( self::$_plugins_info ) ) {
1160
+ self::$_plugins_info = get_site_transient( 'update_plugins' );
1161
+ }
1162
+
1163
+ $slug = '';
1164
+
1165
+ if ( is_object( self::$_plugins_info ) ) {
1166
+ if ( isset( self::$_plugins_info->no_update ) &&
1167
+ isset( self::$_plugins_info->no_update[ $basename ] ) &&
1168
+ ! empty( self::$_plugins_info->no_update[ $basename ]->slug )
1169
+ ) {
1170
+ $slug = self::$_plugins_info->no_update[ $basename ]->slug;
1171
+ } else if ( isset( self::$_plugins_info->response ) &&
1172
+ isset( self::$_plugins_info->response[ $basename ] ) &&
1173
+ ! empty( self::$_plugins_info->response[ $basename ]->slug )
1174
+ ) {
1175
+ $slug = self::$_plugins_info->response[ $basename ]->slug;
1176
+ }
1177
+ }
1178
+
1179
+ if ( empty( $slug ) ) {
1180
+ // Try to find slug from FS data.
1181
+ $slug = self::find_slug_by_basename( $basename );
1182
+ }
1183
+
1184
+ if ( empty( $slug ) ) {
1185
+ // Fallback to plugin's folder name.
1186
+ $slug = dirname( $basename );
1187
+ }
1188
+
1189
+ return $slug;
1190
+ }
1191
+
1192
+ private static $_statics_loaded = false;
1193
+
1194
+ /**
1195
+ * Load static resources.
1196
+ *
1197
+ * @author Vova Feldman (@svovaf)
1198
+ * @since 1.0.1
1199
+ */
1200
+ private static function _load_required_static() {
1201
+ if ( self::$_statics_loaded ) {
1202
+ return;
1203
+ }
1204
+
1205
+ self::$_static_logger = FS_Logger::get_logger( WP_FS__SLUG, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
1206
+
1207
+ self::$_static_logger->entrance();
1208
+
1209
+ self::$_accounts = FS_Option_Manager::get_manager( WP_FS__ACCOUNTS_OPTION_NAME, true );
1210
+
1211
+ self::$_global_admin_notices = FS_Admin_Notice_Manager::instance( 'global' );
1212
+
1213
+ // Configure which Freemius powered plugins should be auto updated.
1214
+ // add_filter( 'auto_update_plugin', '_include_plugins_in_auto_update', 10, 2 );
1215
+
1216
+ add_action( 'admin_menu', array( 'Freemius', 'add_debug_page' ) );
1217
+
1218
+ add_action( "wp_ajax_fs_toggle_debug_mode", array( 'Freemius', '_toggle_debug_mode' ) );
1219
+
1220
+ self::add_ajax_action_static( 'get_debug_log', array( 'Freemius', '_get_debug_log' ) );
1221
+
1222
+ add_action( 'plugins_loaded', array( 'Freemius', '_load_textdomain' ), 1 );
1223
+
1224
+ self::$_statics_loaded = true;
1225
+ }
1226
+
1227
+ #----------------------------------------------------------------------------------
1228
+ #region Localization
1229
+ #----------------------------------------------------------------------------------
1230
+
1231
+ /**
1232
+ * Load framework's text domain.
1233
+ *
1234
+ * @author Vova Feldman (@svovaf)
1235
+ * @since 1.2.1
1236
+ */
1237
+ static function _load_textdomain() {
1238
+ if ( ! is_admin() ) {
1239
+ return;
1240
+ }
1241
+
1242
+ global $fs_active_plugins;
1243
+
1244
+ load_plugin_textdomain(
1245
+ 'freemius',
1246
+ false,
1247
+ $fs_active_plugins->newest->sdk_path . '/languages/'
1248
+ );
1249
+
1250
+ // @todo Load for themes.
1251
+ }
1252
+
1253
+ #endregion
1254
+
1255
+ #----------------------------------------------------------------------------------
1256
+ #region Debugging
1257
+ #----------------------------------------------------------------------------------
1258
+
1259
+ /**
1260
+ * @author Vova Feldman (@svovaf)
1261
+ * @since 1.0.8
1262
+ */
1263
+ static function add_debug_page() {
1264
+ if ( ! current_user_can( 'activate_plugins' ) ) {
1265
+ return;
1266
+ }
1267
+
1268
+ self::$_static_logger->entrance();
1269
+
1270
+ $title = sprintf( '%s [v.%s]', __fs( 'freemius-debug' ), WP_FS__SDK_VERSION );
1271
+
1272
+ $hook = null;
1273
+
1274
+ if ( WP_FS__DEV_MODE ) {
1275
+ // Add top-level debug menu item.
1276
+ $hook = add_menu_page(
1277
+ $title,
1278
+ $title,
1279
+ 'manage_options',
1280
+ 'freemius',
1281
+ array( 'Freemius', '_debug_page_render' )
1282
+ );
1283
+ } else {
1284
+ if ( 'freemius' === fs_request_get( 'page' ) ) {
1285
+ // Add hidden debug page.
1286
+ $hook = add_submenu_page(
1287
+ null,
1288
+ $title,
1289
+ $title,
1290
+ 'manage_options',
1291
+ 'freemius',
1292
+ array( 'Freemius', '_debug_page_render' )
1293
+ );
1294
+ }
1295
+ }
1296
+
1297
+ if ( ! empty( $hook ) ) {
1298
+ add_action( "load-$hook", array( 'Freemius', '_debug_page_actions' ) );
1299
+ }
1300
+ }
1301
+
1302
+ /**
1303
+ * @author Vova Feldman (@svovaf)
1304
+ * @since 1.1.7.3
1305
+ */
1306
+ static function _toggle_debug_mode() {
1307
+ if ( fs_request_is_post() && in_array( $_POST['is_on'], array( 0, 1 ) ) ) {
1308
+ update_option( 'fs_debug_mode', $_POST['is_on'] );
1309
+
1310
+ // Turn on/off storage logging.
1311
+ FS_Logger::_set_storage_logging( ( 1 == $_POST['is_on'] ) );
1312
+ }
1313
+
1314
+ exit;
1315
+ }
1316
+
1317
+ /**
1318
+ * @author Vova Feldman (@svovaf)
1319
+ * @since 1.2.1.6
1320
+ */
1321
+ static function _get_debug_log() {
1322
+ $logs = FS_Logger::load_db_logs(
1323
+ ! empty( $_POST['filters'] ) ? $_POST['filters'] : false,
1324
+ ! empty( $_POST['limit'] ) && is_numeric( $_POST['limit'] ) ? $_POST['limit'] : 200,
1325
+ ! empty( $_POST['offset'] ) && is_numeric( $_POST['offset'] ) ? $_POST['offset'] : 0
1326
+ );
1327
+
1328
+ self::shoot_ajax_success( $logs );
1329
+ }
1330
+
1331
+ /**
1332
+ * @author Vova Feldman (@svovaf)
1333
+ * @since 1.0.8
1334
+ */
1335
+ static function _debug_page_actions() {
1336
+ self::_clean_admin_content_section();
1337
+
1338
+ if ( fs_request_is_action( 'restart_freemius' ) ) {
1339
+ check_admin_referer( 'restart_freemius' );
1340
+
1341
+ // Clear accounts data.
1342
+ self::$_accounts->clear( true );
1343
+
1344
+ // Clear SDK reference cache.
1345
+ delete_option( 'fs_active_plugins' );
1346
+ } else if ( fs_request_is_action( 'simulate_trial' ) ) {
1347
+ check_admin_referer( 'simulate_trial' );
1348
+
1349
+ $slug = fs_request_get( 'slug' );
1350
+
1351
+ $fs = freemius( $slug );
1352
+
1353
+ // Update SDK install to at least 24 hours before.
1354
+ $fs->_storage->install_timestamp = ( time() - WP_FS__TIME_24_HOURS_IN_SEC );
1355
+ // Unset the trial shown timestamp.
1356
+ unset( $fs->_storage->trial_promotion_shown );
1357
+ } else if ( fs_request_is_action( 'download_logs' ) ) {
1358
+ check_admin_referer( 'download_logs' );
1359
+
1360
+ $download_url = FS_Logger::download_db_logs(
1361
+ ! empty( $_POST['filters'] ) ? $_POST['filters'] : false
1362
+ );
1363
+
1364
+ if ( false === $download_url ) {
1365
+ 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.' );
1366
+ }
1367
+
1368
+ fs_redirect( $download_url );
1369
+ }
1370
+ }
1371
+
1372
+ /**
1373
+ * @author Vova Feldman (@svovaf)
1374
+ * @since 1.0.8
1375
+ */
1376
+ static function _debug_page_render() {
1377
+ self::$_static_logger->entrance();
1378
+
1379
+ $sites = self::get_all_sites();
1380
+ $users = self::get_all_users();
1381
+ $addons = self::get_all_addons();
1382
+ $account_addons = self::get_all_account_addons();
1383
+ $licenses = self::get_all_licenses();
1384
+
1385
+ // $plans = self::get_all_plans();
1386
+ // $licenses = self::get_all_licenses();
1387
+
1388
+ $vars = array(
1389
+ 'sites' => $sites,
1390
+ 'users' => $users,
1391
+ 'addons' => $addons,
1392
+ 'account_addons' => $account_addons,
1393
+ 'licenses' => $licenses,
1394
+ );
1395
+
1396
+ fs_enqueue_local_style( 'fs_debug', '/admin/debug.css' );
1397
+ fs_require_once_template( 'debug.php', $vars );
1398
+ }
1399
+
1400
+ #endregion
1401
+
1402
+ #----------------------------------------------------------------------------------
1403
+ #region Connectivity Issues
1404
+ #----------------------------------------------------------------------------------
1405
+
1406
+ /**
1407
+ * Check if Freemius should be turned on for the current plugin install.
1408
+ *
1409
+ * Note:
1410
+ * $this->_is_on is updated in has_api_connectivity()
1411
+ *
1412
+ * @author Vova Feldman (@svovaf)
1413
+ * @since 1.0.9
1414
+ *
1415
+ * @return bool
1416
+ */
1417
+ function is_on() {
1418
+ self::$_static_logger->entrance();
1419
+
1420
+ if ( isset( $this->_is_on ) ) {
1421
+ return $this->_is_on;
1422
+ }
1423
+
1424
+ // If already installed or pending then sure it's on :)
1425
+ if ( $this->is_registered() || $this->is_pending_activation() ) {
1426
+ $this->_is_on = true;
1427
+
1428
+ return true;
1429
+ }
1430
+
1431
+ return false;
1432
+ }
1433
+
1434
+ /**
1435
+ * @author Vova Feldman (@svovaf)
1436
+ * @since 1.1.7.3
1437
+ *
1438
+ * @param bool $flush_if_no_connectivity
1439
+ *
1440
+ * @return bool
1441
+ */
1442
+ private function should_run_connectivity_test( $flush_if_no_connectivity = false ) {
1443
+ if ( ! isset( $this->_storage->connectivity_test ) ) {
1444
+ // Connectivity test was never executed, or cache was cleared.
1445
+ return true;
1446
+ }
1447
+
1448
+ if ( WP_FS__PING_API_ON_IP_OR_HOST_CHANGES ) {
1449
+ if ( WP_FS__IS_HTTP_REQUEST ) {
1450
+ if ( $_SERVER['HTTP_HOST'] != $this->_storage->connectivity_test['host'] ) {
1451
+ // Domain changed.
1452
+ return true;
1453
+ }
1454
+
1455
+ if ( WP_FS__REMOTE_ADDR != $this->_storage->connectivity_test['server_ip'] ) {
1456
+ // Server IP changed.
1457
+ return true;
1458
+ }
1459
+ }
1460
+ }
1461
+
1462
+ if ( $this->_storage->connectivity_test['is_connected'] &&
1463
+ $this->_storage->connectivity_test['is_active']
1464
+ ) {
1465
+ // API connected and Freemius is active - no need to run connectivity check.
1466
+ return false;
1467
+ }
1468
+
1469
+ if ( $flush_if_no_connectivity ) {
1470
+ /**
1471
+ * If explicitly asked to flush when no connectivity - do it only
1472
+ * if at least 10 sec passed from the last API connectivity test.
1473
+ */
1474
+ return ( isset( $this->_storage->connectivity_test['timestamp'] ) &&
1475
+ ( WP_FS__SCRIPT_START_TIME - $this->_storage->connectivity_test['timestamp'] ) > 10 );
1476
+ }
1477
+
1478
+ /**
1479
+ * @since 1.1.7 Don't check for connectivity on plugin downgrade.
1480
+ */
1481
+ $version = $this->get_plugin_version();
1482
+ if ( version_compare( $version, $this->_storage->connectivity_test['version'], '>' ) ) {
1483
+ // If it's a plugin version upgrade and Freemius is off or no connectivity, run connectivity test.
1484
+ return true;
1485
+ }
1486
+
1487
+ return false;
1488
+ }
1489
+
1490
+ /**
1491
+ * @author Vova Feldman (@svovaf)
1492
+ * @since 1.1.7.4
1493
+ *
1494
+ * @return object|false
1495
+ */
1496
+ private function ping() {
1497
+ if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY ) {
1498
+ return false;
1499
+ }
1500
+
1501
+ $version = $this->get_plugin_version();
1502
+
1503
+ $is_update = $this->apply_filters( 'is_plugin_update', $this->is_plugin_update() );
1504
+
1505
+ return $this->get_api_plugin_scope()->ping(
1506
+ $this->get_anonymous_id(),
1507
+ array(
1508
+ 'is_update' => json_encode( $is_update ),
1509
+ 'version' => $version,
1510
+ 'sdk' => $this->version,
1511
+ 'is_admin' => json_encode( is_admin() ),
1512
+ 'is_ajax' => json_encode( self::is_ajax() ),
1513
+ 'is_cron' => json_encode( $this->is_cron() ),
1514
+ 'is_http' => json_encode( WP_FS__IS_HTTP_REQUEST ),
1515
+ )
1516
+ );
1517
+ }
1518
+
1519
+ /**
1520
+ * Check if there's any connectivity issue to Freemius API.
1521
+ *
1522
+ * @author Vova Feldman (@svovaf)
1523
+ * @since 1.0.9
1524
+ *
1525
+ * @param bool $flush_if_no_connectivity
1526
+ *
1527
+ * @return bool
1528
+ */
1529
+ function has_api_connectivity( $flush_if_no_connectivity = false ) {
1530
+ $this->_logger->entrance();
1531
+
1532
+ if ( isset( $this->_has_api_connection ) && ( $this->_has_api_connection || ! $flush_if_no_connectivity ) ) {
1533
+ return $this->_has_api_connection;
1534
+ }
1535
+
1536
+ if ( WP_FS__SIMULATE_NO_API_CONNECTIVITY &&
1537
+ isset( $this->_storage->connectivity_test ) &&
1538
+ true === $this->_storage->connectivity_test['is_connected']
1539
+ ) {
1540
+ unset( $this->_storage->connectivity_test );
1541
+ }
1542
+
1543
+ if ( ! $this->should_run_connectivity_test( $flush_if_no_connectivity ) ) {
1544
+ $this->_has_api_connection = $this->_storage->connectivity_test['is_connected'];
1545
+ /**
1546
+ * @since 1.1.6 During dev mode, if there's connectivity - turn Freemius on regardless the configuration.
1547
+ *
1548
+ * @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.
1549
+ */
1550
+ $this->_is_on = $this->_storage->connectivity_test['is_active'] ||
1551
+ $this->is_premium() ||
1552
+ ( WP_FS__DEV_MODE && $this->_has_api_connection && ! WP_FS__SIMULATE_FREEMIUS_OFF );
1553
+
1554
+ return $this->_has_api_connection;
1555
+ }
1556
+
1557
+ $pong = $this->ping();
1558
+ $is_connected = $this->get_api_plugin_scope()->is_valid_ping( $pong );
1559
+
1560
+ if ( ! $is_connected ) {
1561
+ // API failure.
1562
+ $this->_add_connectivity_issue_message( $pong );
1563
+ }
1564
+
1565
+ $this->store_connectivity_info( $pong, $is_connected );
1566
+
1567
+ return $this->_has_api_connection;
1568
+ }
1569
+
1570
+ /**
1571
+ * @author Vova Feldman (@svovaf)
1572
+ * @since 1.1.7.4
1573
+ *
1574
+ * @param object $pong
1575
+ * @param bool $is_connected
1576
+ */
1577
+ private function store_connectivity_info( $pong, $is_connected ) {
1578
+ $this->_logger->entrance();
1579
+
1580
+ $version = $this->get_plugin_version();
1581
+
1582
+ if ( ! $is_connected || WP_FS__SIMULATE_FREEMIUS_OFF ) {
1583
+ $is_active = false;
1584
+ } else {
1585
+ $is_active = ( isset( $pong->is_active ) && true == $pong->is_active );
1586
+ }
1587
+
1588
+ $is_active = $this->apply_filters(
1589
+ 'is_on',
1590
+ $is_active,
1591
+ $this->is_plugin_update(),
1592
+ $version
1593
+ );
1594
+
1595
+ $this->_storage->connectivity_test = array(
1596
+ 'is_connected' => $is_connected,
1597
+ 'host' => $_SERVER['HTTP_HOST'],
1598
+ 'server_ip' => WP_FS__REMOTE_ADDR,
1599
+ 'is_active' => $is_active,
1600
+ 'timestamp' => WP_FS__SCRIPT_START_TIME,
1601
+ // Last version with connectivity attempt.
1602
+ 'version' => $version,
1603
+ );
1604
+
1605
+ $this->_has_api_connection = $is_connected;
1606
+ $this->_is_on = $is_active || ( WP_FS__DEV_MODE && $is_connected && ! WP_FS__SIMULATE_FREEMIUS_OFF );
1607
+ }
1608
+
1609
+ /**
1610
+ * Force turning Freemius on.
1611
+ *
1612
+ * @author Vova Feldman (@svovaf)
1613
+ * @since 1.1.8.1
1614
+ *
1615
+ * @return bool TRUE if successfully turned on.
1616
+ */
1617
+ private function turn_on() {
1618
+ $this->_logger->entrance();
1619
+
1620
+ if ( $this->is_on() || ! isset( $this->_storage->connectivity_test['is_active'] ) ) {
1621
+ return false;
1622
+ }
1623
+
1624
+ $updated_connectivity = $this->_storage->connectivity_test;
1625
+ $updated_connectivity['is_active'] = true;
1626
+ $updated_connectivity['timestamp'] = WP_FS__SCRIPT_START_TIME;
1627
+ $this->_storage->connectivity_test = $updated_connectivity;
1628
+
1629
+ $this->_is_on = true;
1630
+
1631
+ return true;
1632
+ }
1633
+
1634
+ /**
1635
+ * Anonymous and unique site identifier (Hash).
1636
+ *
1637
+ * @author Vova Feldman (@svovaf)
1638
+ * @since 1.1.0
1639
+ *
1640
+ * @return string
1641
+ */
1642
+ function get_anonymous_id() {
1643
+ $unique_id = self::$_accounts->get_option( 'unique_id' );
1644
+
1645
+ if ( empty( $unique_id ) || ! is_string( $unique_id ) ) {
1646
+ $key = get_site_url();
1647
+
1648
+ // If localhost, assign microtime instead of domain.
1649
+ if ( WP_FS__IS_LOCALHOST ||
1650
+ false !== strpos( $key, 'localhost' ) ||
1651
+ false === strpos( $key, '.' )
1652
+ ) {
1653
+ $key = microtime();
1654
+ }
1655
+
1656
+ $unique_id = md5( $key );
1657
+
1658
+ self::$_accounts->set_option( 'unique_id', $unique_id, true );
1659
+ }
1660
+
1661
+ $this->_logger->departure( $unique_id );
1662
+
1663
+ return $unique_id;
1664
+ }
1665
+
1666
+ /**
1667
+ * @author Vova Feldman (@svovaf)
1668
+ * @since 1.1.7.4
1669
+ *
1670
+ * @return \WP_User
1671
+ */
1672
+ static function _get_current_wp_user() {
1673
+ self::require_pluggable_essentials();
1674
+
1675
+ return wp_get_current_user();
1676
+ }
1677
+
1678
+ /**
1679
+ * Generate API connectivity issue message.
1680
+ *
1681
+ * @author Vova Feldman (@svovaf)
1682
+ * @since 1.0.9
1683
+ *
1684
+ * @param mixed $api_result
1685
+ * @param bool $is_first_failure
1686
+ */
1687
+ function _add_connectivity_issue_message( $api_result, $is_first_failure = true ) {
1688
+ if ( ! $this->is_premium() && $this->_enable_anonymous ) {
1689
+ // Don't add message if it's the free version and can run anonymously.
1690
+ return;
1691
+ }
1692
+
1693
+ if ( ! function_exists( 'wp_nonce_url' ) ) {
1694
+ require_once ABSPATH . 'wp-includes/functions.php';
1695
+ }
1696
+
1697
+ $current_user = self::_get_current_wp_user();
1698
+ // $admin_email = get_option( 'admin_email' );
1699
+ $admin_email = $current_user->user_email;
1700
+
1701
+ $message = false;
1702
+ if ( is_object( $api_result ) &&
1703
+ isset( $api_result->error ) &&
1704
+ isset( $api_result->error->code )
1705
+ ) {
1706
+ switch ( $api_result->error->code ) {
1707
+ case 'curl_missing':
1708
+ $message = sprintf(
1709
+ __fs( 'x-requires-access-to-api', $this->_slug ) . ' ' .
1710
+ __fs( 'curl-missing-message', $this->_slug ) . ' ' .
1711
+ ' %s',
1712
+ '<b>' . $this->get_plugin_name() . '</b>',
1713
+ sprintf(
1714
+ '<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
1715
+ sprintf(
1716
+ '<a class="fs-resolve" data-type="curl" href="#"><b>%s</b></a>%s',
1717
+ __fs( 'curl-missing-no-clue-title', $this->_slug ),
1718
+ ' - ' . sprintf(
1719
+ __fs( 'curl-missing-no-clue-desc', $this->_slug ),
1720
+ '<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
1721
+ )
1722
+ ),
1723
+ sprintf(
1724
+ '<b>%s</b> - %s',
1725
+ __fs( 'sysadmin-title', $this->_slug ),
1726
+ __fs( 'curl-missing-sysadmin-desc', $this->_slug )
1727
+ ),
1728
+ sprintf(
1729
+ '<a href="%s"><b>%s</b></a>%s',
1730
+ 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 ),
1731
+ __fs( 'deactivate-plugin-title', $this->_slug ),
1732
+ ' - ' . __fs( 'deactivate-plugin-desc', 'freemius', $this->_slug )
1733
+ )
1734
+ )
1735
+ );
1736
+ break;
1737
+ case 'cloudflare_ddos_protection':
1738
+ $message = sprintf(
1739
+ __fs( 'x-requires-access-to-api', $this->_slug ) . ' ' .
1740
+ __fs( 'cloudflare-blocks-connection-message', $this->_slug ) . ' ' .
1741
+ __fs( 'happy-to-resolve-issue-asap', $this->_slug ) .
1742
+ ' %s',
1743
+ '<b>' . $this->get_plugin_name() . '</b>',
1744
+ sprintf(
1745
+ '<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
1746
+ sprintf(
1747
+ '<a class="fs-resolve" data-type="cloudflare" href="#"><b>%s</b></a>%s',
1748
+ __fs( 'fix-issue-title', $this->_slug ),
1749
+ ' - ' . sprintf(
1750
+ __fs( 'fix-issue-desc', $this->_slug ),
1751
+ '<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
1752
+ )
1753
+ ),
1754
+ sprintf(
1755
+ '<a href="%s" target="_blank"><b>%s</b></a>%s',
1756
+ sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ),
1757
+ __fs( 'install-previous-title', $this->_slug ),
1758
+ ' - ' . __fs( 'install-previous-desc', $this->_slug )
1759
+ ),
1760
+ sprintf(
1761
+ '<a href="%s"><b>%s</b></a>%s',
1762
+ 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 ),
1763
+ __fs( 'deactivate-plugin-title', $this->_slug ),
1764
+ ' - ' . __fs( 'deactivate-plugin-desc', $this->_slug )
1765
+ )
1766
+ )
1767
+ );
1768
+ break;
1769
+ case 'squid_cache_block':
1770
+ $message = sprintf(
1771
+ __fs( 'x-requires-access-to-api', $this->_slug ) . ' ' .
1772
+ __fs( 'squid-blocks-connection-message', $this->_slug ) .
1773
+ ' %s',
1774
+ '<b>' . $this->get_plugin_name() . '</b>',
1775
+ sprintf(
1776
+ '<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
1777
+ sprintf(
1778
+ '<a class="fs-resolve" data-type="squid" href="#"><b>%s</b></a>%s',
1779
+ __fs( 'squid-no-clue-title', $this->_slug ),
1780
+ ' - ' . sprintf(
1781
+ __fs( 'squid-no-clue-desc', $this->_slug ),
1782
+ '<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
1783
+ )
1784
+ ),
1785
+ sprintf(
1786
+ '<b>%s</b> - %s',
1787
+ __fs( 'sysadmin-title', $this->_slug ),
1788
+ sprintf(
1789
+ __fs( 'squid-sysadmin-desc', $this->_slug ),
1790
+ // We use a filter since the plugin might require additional API connectivity.
1791
+ '<b>' . implode( ', ', $this->apply_filters( 'api_domains', array( 'api.freemius.com' ) ) ) . '</b>' )
1792
+ ),
1793
+ sprintf(
1794
+ '<a href="%s"><b>%s</b></a>%s',
1795
+ 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 ),
1796
+ __fs( 'deactivate-plugin-title', $this->_slug ),
1797
+ ' - ' . __fs( 'deactivate-plugin-desc', $this->_slug )
1798
+ )
1799
+ )
1800
+ );
1801
+ break;
1802
+ // default:
1803
+ // $message = __fs( 'connectivity-test-fails-message', $this->_slug );
1804
+ // break;
1805
+ }
1806
+ }
1807
+
1808
+ $message_id = 'failed_connect_api';
1809
+ $type = 'error';
1810
+
1811
+ if ( false === $message ) {
1812
+ if ( $is_first_failure ) {
1813
+ // First attempt failed.
1814
+ $message = sprintf(
1815
+ __fs( 'x-requires-access-to-api', $this->_slug ) . ' ' .
1816
+ __fs( 'connectivity-test-fails-message', $this->_slug ) . ' ' .
1817
+ __fs( 'connectivity-test-maybe-temporary', $this->_slug ) . '<br><br>' .
1818
+ '%s',
1819
+ '<b>' . $this->get_plugin_name() . '</b>',
1820
+ sprintf(
1821
+ '<div id="fs_firewall_issue_options">%s %s</div>',
1822
+ sprintf(
1823
+ '<a class="button button-primary fs-resolve" data-type="retry_ping" href="#">%s</a>',
1824
+ __fs( 'yes-do-your-thing', $this->_slug )
1825
+ ),
1826
+ sprintf(
1827
+ '<a href="%s" class="button">%s</a>',
1828
+ 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 ),
1829
+ __fs( 'no-deactivate', $this->_slug )
1830
+ )
1831
+ )
1832
+ );
1833
+
1834
+ $message_id = 'failed_connect_api_first';
1835
+ $type = 'promotion';
1836
+ } else {
1837
+ // Second connectivity attempt failed.
1838
+ $message = sprintf(
1839
+ __fs( 'x-requires-access-to-api', $this->_slug ) . ' ' .
1840
+ __fs( 'connectivity-test-fails-message', $this->_slug ) . ' ' .
1841
+ __fs( 'happy-to-resolve-issue-asap', $this->_slug ) .
1842
+ ' %s',
1843
+ '<b>' . $this->get_plugin_name() . '</b>',
1844
+ sprintf(
1845
+ '<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
1846
+ sprintf(
1847
+ '<a class="fs-resolve" data-type="general" href="#"><b>%s</b></a>%s',
1848
+ __fs( 'fix-issue-title', $this->_slug ),
1849
+ ' - ' . sprintf(
1850
+ __fs( 'fix-issue-desc', $this->_slug ),
1851
+ '<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
1852
+ )
1853
+ ),
1854
+ sprintf(
1855
+ '<a href="%s" target="_blank"><b>%s</b></a>%s',
1856
+ sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ),
1857
+ __fs( 'install-previous-title', $this->_slug ),
1858
+ ' - ' . __fs( 'install-previous-desc', $this->_slug )
1859
+ ),
1860
+ sprintf(
1861
+ '<a href="%s"><b>%s</b></a>%s',
1862
+ 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 ),
1863
+ __fs( 'deactivate-plugin-title', $this->_slug ),
1864
+ ' - ' . __fs( 'deactivate-plugin-desc', $this->_slug )
1865
+ )
1866
+ )
1867
+ );
1868
+ }
1869
+ }
1870
+
1871
+ $this->_admin_notices->add_sticky(
1872
+ $message,
1873
+ $message_id,
1874
+ __fs( 'oops', $this->_slug ) . '...',
1875
+ $type
1876
+ );
1877
+ }
1878
+
1879
+ /**
1880
+ * Handle user request to resolve connectivity issue.
1881
+ * This method will send an email to Freemius API technical staff for resolution.
1882
+ * The email will contain server's info and installed plugins (might be caching issue).
1883
+ *
1884
+ * @author Vova Feldman (@svovaf)
1885
+ * @since 1.0.9
1886
+ */
1887
+ function _email_about_firewall_issue() {
1888
+ $this->_admin_notices->remove_sticky( 'failed_connect_api' );
1889
+
1890
+ $pong = $this->ping();
1891
+
1892
+ $is_connected = $this->get_api_plugin_scope()->is_valid_ping( $pong );
1893
+
1894
+ if ( $is_connected ) {
1895
+ $this->store_connectivity_info( $pong, $is_connected );
1896
+
1897
+ echo $this->get_after_plugin_activation_redirect_url();
1898
+ exit;
1899
+ }
1900
+
1901
+ $current_user = self::_get_current_wp_user();
1902
+ $admin_email = $current_user->user_email;
1903
+
1904
+ $error_type = fs_request_get( 'error_type', 'general' );
1905
+
1906
+ switch ( $error_type ) {
1907
+ case 'squid':
1908
+ $title = 'Squid ACL Blocking Issue';
1909
+ break;
1910
+ case 'cloudflare':
1911
+ $title = 'CloudFlare Blocking Issue';
1912
+ break;
1913
+ default:
1914
+ $title = 'API Connectivity Issue';
1915
+ break;
1916
+ }
1917
+
1918
+ $custom_email_sections = array();
1919
+
1920
+ // Add 'API Error' custom email section.
1921
+ $custom_email_sections['api_error'] = array(
1922
+ 'title' => "API Error",
1923
+ 'rows' => array(
1924
+ 'ping' => array(
1925
+ 'API Error',
1926
+ is_string( $pong ) ? htmlentities( $pong ) : json_encode( $pong )
1927
+ ),
1928
+ )
1929
+ );
1930
+
1931
+ // Send email with technical details to resolve API connectivity issues.
1932
+ $this->send_email(
1933
+ 'api@freemius.com', // recipient
1934
+ $title . ' [' . $this->get_plugin_name() . ']', // subject
1935
+ $custom_email_sections,
1936
+ array( "Reply-To: $admin_email <$admin_email>" ) // headers
1937
+ );
1938
+
1939
+ $this->_admin_notices->add_sticky(
1940
+ sprintf(
1941
+ __fs( 'fix-request-sent-message', $this->_slug ),
1942
+ '<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
1943
+ ),
1944
+ 'server_details_sent'
1945
+ );
1946
+
1947
+ // Action was taken, tell that API connectivity troubleshooting should be off now.
1948
+
1949
+ echo "1";
1950
+ exit;
1951
+ }
1952
+
1953
+ /**
1954
+ * Handle connectivity test retry approved by the user.
1955
+ *
1956
+ * @author Vova Feldman (@svovaf)
1957
+ * @since 1.1.7.4
1958
+ */
1959
+ function _retry_connectivity_test() {
1960
+ $this->_admin_notices->remove_sticky( 'failed_connect_api_first' );
1961
+
1962
+ $pong = $this->ping();
1963
+
1964
+ $is_connected = $this->get_api_plugin_scope()->is_valid_ping( $pong );
1965
+
1966
+ if ( $is_connected ) {
1967
+ $this->store_connectivity_info( $pong, $is_connected );
1968
+
1969
+ echo $this->get_after_plugin_activation_redirect_url();
1970
+ } else {
1971
+ // Add connectivity issue message after 2nd failed attempt.
1972
+ $this->_add_connectivity_issue_message( $pong, false );
1973
+
1974
+ echo "1";
1975
+ }
1976
+
1977
+ exit;
1978
+ }
1979
+
1980
+ static function _add_firewall_issues_javascript() {
1981
+ $params = array();
1982
+ fs_require_once_template( 'firewall-issues-js.php', $params );
1983
+ }
1984
+
1985
+ #endregion
1986
+
1987
+ #----------------------------------------------------------------------------------
1988
+ #region Email
1989
+ #----------------------------------------------------------------------------------
1990
+
1991
+ /**
1992
+ * Generates and sends an HTML email with customizable sections.
1993
+ *
1994
+ * @author Leo Fajardo (@leorw)
1995
+ * @since 1.1.2
1996
+ *
1997
+ * @param string $to_address
1998
+ * @param string $subject
1999
+ * @param array $sections
2000
+ * @param array $headers
2001
+ *
2002
+ * @return bool Whether the email contents were sent successfully.
2003
+ */
2004
+ private function send_email(
2005
+ $to_address,
2006
+ $subject,
2007
+ $sections = array(),
2008
+ $headers = array()
2009
+ ) {
2010
+ $default_sections = $this->get_email_sections();
2011
+
2012
+ // Insert new sections or replace the default email sections.
2013
+ if ( is_array( $sections ) && ! empty( $sections ) ) {
2014
+ foreach ( $sections as $section_id => $custom_section ) {
2015
+ if ( ! isset( $default_sections[ $section_id ] ) ) {
2016
+ // If the section does not exist, add it.
2017
+ $default_sections[ $section_id ] = $custom_section;
2018
+ } else {
2019
+ // If the section already exists, override it.
2020
+ $current_section = $default_sections[ $section_id ];
2021
+
2022
+ // Replace the current section's title if a custom section title exists.
2023
+ if ( isset( $custom_section['title'] ) ) {
2024
+ $current_section['title'] = $custom_section['title'];
2025
+ }
2026
+
2027
+ // Insert new rows under the current section or replace the default rows.
2028
+ if ( isset( $custom_section['rows'] ) && is_array( $custom_section['rows'] ) && ! empty( $custom_section['rows'] ) ) {
2029
+ foreach ( $custom_section['rows'] as $row_id => $row ) {
2030
+ $current_section['rows'][ $row_id ] = $row;
2031
+ }
2032
+ }
2033
+
2034
+ $default_sections[ $section_id ] = $current_section;
2035
+ }
2036
+ }
2037
+ }
2038
+
2039
+ $vars = array( 'sections' => $default_sections );
2040
+ $message = fs_get_template( 'email.php', $vars );
2041
+
2042
+ // Set the type of email to HTML.
2043
+ $headers[] = 'Content-type: text/html; charset=UTF-8';
2044
+
2045
+ $header_string = implode( "\r\n", $headers );
2046
+
2047
+ return wp_mail(
2048
+ $to_address,
2049
+ $subject,
2050
+ $message,
2051
+ $header_string
2052
+ );
2053
+ }
2054
+
2055
+ /**
2056
+ * Generates the data for the sections of the email content.
2057
+ *
2058
+ * @author Leo Fajardo (@leorw)
2059
+ * @since 1.1.2
2060
+ *
2061
+ * @return array
2062
+ */
2063
+ private function get_email_sections() {
2064
+ // Retrieve the current user's information so that we can get the user's email, first name, and last name below.
2065
+ $current_user = self::_get_current_wp_user();
2066
+
2067
+ // Retrieve the cURL version information so that we can get the version number below.
2068
+ $curl_version_information = curl_version();
2069
+
2070
+ $active_plugin = self::get_active_plugins();
2071
+
2072
+ // Generate the list of active plugins separated by new line.
2073
+ $active_plugin_string = '';
2074
+ foreach ( $active_plugin as $plugin ) {
2075
+ $active_plugin_string .= sprintf(
2076
+ '<a href="%s">%s</a> [v%s]<br>',
2077
+ $plugin['PluginURI'],
2078
+ $plugin['Name'],
2079
+ $plugin['Version']
2080
+ );
2081
+ }
2082
+
2083
+ $server_ip = WP_FS__REMOTE_ADDR;
2084
+
2085
+ // Add PHP info for deeper investigation.
2086
+ ob_start();
2087
+ phpinfo();
2088
+ $php_info = ob_get_clean();
2089
+
2090
+ $api_domain = substr( FS_API__ADDRESS, strpos( FS_API__ADDRESS, ':' ) + 3 );
2091
+
2092
+ // Generate the default email sections.
2093
+ $sections = array(
2094
+ 'sdk' => array(
2095
+ 'title' => 'SDK',
2096
+ 'rows' => array(
2097
+ 'fs_version' => array( 'FS Version', $this->version ),
2098
+ 'curl_version' => array( 'cURL Version', $curl_version_information['version'] )
2099
+ )
2100
+ ),
2101
+ 'plugin' => array(
2102
+ 'title' => 'Plugin',
2103
+ 'rows' => array(
2104
+ 'name' => array( 'Name', $this->get_plugin_name() ),
2105
+ 'version' => array( 'Version', $this->get_plugin_version() )
2106
+ )
2107
+ ),
2108
+ 'api' => array(
2109
+ 'title' => 'API Subdomain',
2110
+ 'rows' => array(
2111
+ 'dns' => array( 'DNS_CNAME', var_export( @dns_get_record( $api_domain, DNS_CNAME ), true ) ),
2112
+ 'ip' => array( 'IP', @gethostbyname( $api_domain ) ),
2113
+ ),
2114
+ ),
2115
+ 'site' => array(
2116
+ 'title' => 'Site',
2117
+ 'rows' => array(
2118
+ 'unique_id' => array( 'Unique ID', $this->get_anonymous_id() ),
2119
+ 'address' => array( 'Address', site_url() ),
2120
+ 'host' => array(
2121
+ 'HTTP_HOST',
2122
+ ( ! empty( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : '' )
2123
+ ),
2124
+ 'hosting' => array(
2125
+ 'Hosting Company' => fs_request_has( 'hosting_company' ) ?
2126
+ fs_request_get( 'hosting_company' ) :
2127
+ 'Unknown',
2128
+ ),
2129
+ 'server_addr' => array(
2130
+ 'SERVER_ADDR',
2131
+ '<a href="http://www.projecthoneypot.org/ip_' . $server_ip . '">' . $server_ip . '</a>'
2132
+ )
2133
+ )
2134
+ ),
2135
+ 'user' => array(
2136
+ 'title' => 'User',
2137
+ 'rows' => array(
2138
+ 'email' => array( 'Email', $current_user->user_email ),
2139
+ 'first' => array( 'First', $current_user->user_firstname ),
2140
+ 'last' => array( 'Last', $current_user->user_lastname )
2141
+ )
2142
+ ),
2143
+ 'plugins' => array(
2144
+ 'title' => 'Plugins',
2145
+ 'rows' => array(
2146
+ 'active_plugins' => array( 'Active Plugins', $active_plugin_string )
2147
+ )
2148
+ ),
2149
+ 'php_info' => array(
2150
+ 'title' => 'PHP Info',
2151
+ 'rows' => array(
2152
+ 'info' => array( $php_info )
2153
+ ),
2154
+ )
2155
+ );
2156
+
2157
+ // Allow the sections to be modified by other code.
2158
+ $sections = $this->apply_filters( 'email_template_sections', $sections );
2159
+
2160
+ return $sections;
2161
+ }
2162
+
2163
+ #endregion
2164
+
2165
+ #----------------------------------------------------------------------------------
2166
+ #region Initialization
2167
+ #----------------------------------------------------------------------------------
2168
+
2169
+ /**
2170
+ * Init plugin's Freemius instance.
2171
+ *
2172
+ * @author Vova Feldman (@svovaf)
2173
+ * @since 1.0.1
2174
+ *
2175
+ * @param number $id
2176
+ * @param string $public_key
2177
+ * @param bool $is_live
2178
+ * @param bool $is_premium
2179
+ */
2180
+ function init( $id, $public_key, $is_live = true, $is_premium = true ) {
2181
+ $this->_logger->entrance();
2182
+
2183
+ $this->dynamic_init( array(
2184
+ 'id' => $id,
2185
+ 'public_key' => $public_key,
2186
+ 'is_live' => $is_live,
2187
+ 'is_premium' => $is_premium,
2188
+ ) );
2189
+ }
2190
+
2191
+ /**
2192
+ * Dynamic initiator, originally created to support initiation
2193
+ * with parent_id for add-ons.
2194
+ *
2195
+ * @author Vova Feldman (@svovaf)
2196
+ * @since 1.0.6
2197
+ *
2198
+ * @param array $plugin_info
2199
+ *
2200
+ * @throws Freemius_Exception
2201
+ */
2202
+ function dynamic_init( array $plugin_info ) {
2203
+ $this->_logger->entrance();
2204
+
2205
+ $this->parse_settings( $plugin_info );
2206
+
2207
+ if ( $this->should_stop_execution() ) {
2208
+ return;
2209
+ }
2210
+
2211
+ if ( ! $this->is_registered() ) {
2212
+ if ( $this->is_anonymous() ) {
2213
+ // If user skipped, no need to test connectivity.
2214
+ $this->_has_api_connection = true;
2215
+ $this->_is_on = true;
2216
+ } else {
2217
+ if ( ! $this->has_api_connectivity() ) {
2218
+ if ( $this->_admin_notices->has_sticky( 'failed_connect_api_first' ) ||
2219
+ $this->_admin_notices->has_sticky( 'failed_connect_api' )
2220
+ ) {
2221
+ if ( ! $this->_enable_anonymous || $this->is_premium() ) {
2222
+ // If anonymous mode is disabled, add firewall admin-notice message.
2223
+ add_action( 'admin_footer', array( 'Freemius', '_add_firewall_issues_javascript' ) );
2224
+
2225
+ $this->add_ajax_action( 'resolve_firewall_issues', array(
2226
+ &$this,
2227
+ '_email_about_firewall_issue'
2228
+ ) );
2229
+
2230
+ $this->add_ajax_action( 'retry_connectivity_test', array(
2231
+ &$this,
2232
+ '_retry_connectivity_test'
2233
+ ) );
2234
+ }
2235
+ }
2236
+
2237
+ return;
2238
+ } else {
2239
+ $this->_admin_notices->remove_sticky( array(
2240
+ 'failed_connect_api_first',
2241
+ 'failed_connect_api',
2242
+ ) );
2243
+
2244
+ if ( $this->_anonymous_mode ) {
2245
+ // Simulate anonymous mode.
2246
+ $this->_is_anonymous = true;
2247
+ }
2248
+ }
2249
+ }
2250
+
2251
+ // Check if Freemius is on for the current plugin.
2252
+ // This MUST be executed after all the plugin variables has been loaded.
2253
+ if ( ! $this->is_on() ) {
2254
+ return;
2255
+ }
2256
+ }
2257
+
2258
+ if ( $this->has_api_connectivity() ) {
2259
+ if ( $this->is_cron() ) {
2260
+ $this->hook_callback_to_sync_cron();
2261
+ } else if ( $this->is_user_in_admin() ) {
2262
+ /**
2263
+ * Schedule daily data sync cron if:
2264
+ *
2265
+ * 1. User opted-in (for tracking).
2266
+ * 2. If skipped, but later upgraded (opted-in via upgrade).
2267
+ *
2268
+ * @author Vova Feldman (@svovaf)
2269
+ * @since 1.1.7.3
2270
+ *
2271
+ */
2272
+ if ( $this->is_registered() ) {
2273
+ if ( ! $this->is_sync_cron_on() && $this->is_tracking_allowed() ) {
2274
+ $this->schedule_sync_cron();
2275
+ }
2276
+ }
2277
+
2278
+ /**
2279
+ * Check if requested for manual blocking background sync.
2280
+ */
2281
+ if ( fs_request_has( 'background_sync' ) ) {
2282
+ $this->run_manual_sync();
2283
+ }
2284
+ }
2285
+ }
2286
+
2287
+ if ( $this->is_registered() ) {
2288
+ $this->hook_callback_to_install_sync();
2289
+ }
2290
+
2291
+ if ( $this->is_addon() ) {
2292
+ if ( $this->is_parent_plugin_installed() ) {
2293
+ // Link to parent FS.
2294
+ $this->_parent = self::get_instance_by_id( $this->_plugin->parent_plugin_id );
2295
+
2296
+ // Get parent plugin reference.
2297
+ $this->_parent_plugin = $this->_parent->get_plugin();
2298
+ }
2299
+ }
2300
+
2301
+ if ( $this->is_user_in_admin() ) {
2302
+ if ( $this->is_plugins_page() ) {
2303
+ $this->hook_plugin_action_links();
2304
+ }
2305
+
2306
+ if ( $this->is_addon() ) {
2307
+ if ( ! $this->is_parent_plugin_installed() ) {
2308
+ $parent_name = $this->get_option( $plugin_info, 'parent_name', null );
2309
+
2310
+ if ( isset( $plugin_info['parent'] ) ) {
2311
+ $parent_name = $this->get_option( $plugin_info['parent'], 'name', null );
2312
+ }
2313
+
2314
+ $this->_admin_notices->add(
2315
+ ( ! empty( $parent_name ) ?
2316
+ sprintf( __fs( 'addon-x-cannot-run-without-y', $this->_slug ), $this->get_plugin_name(), $parent_name ) :
2317
+ sprintf( __fs( 'addon-x-cannot-run-without-parent', $this->_slug ), $this->get_plugin_name() )
2318
+ ),
2319
+ __fs( 'oops', $this->_slug ) . '...',
2320
+ 'error'
2321
+ );
2322
+
2323
+ return;
2324
+ } else {
2325
+ if ( $this->_parent->is_registered() && ! $this->is_registered() ) {
2326
+ // If parent plugin activated, automatically install add-on for the user.
2327
+ $this->_activate_addon_account( $this->_parent );
2328
+ }
2329
+
2330
+ // @todo This should be only executed on activation. It should be migrated to register_activation_hook() together with other activation related logic.
2331
+ if ( $this->is_premium() ) {
2332
+ // Remove add-on download admin-notice.
2333
+ $this->_parent->_admin_notices->remove_sticky( array(
2334
+ 'addon_plan_upgraded_' . $this->_slug,
2335
+ 'no_addon_license_' . $this->_slug,
2336
+ ) );
2337
+ }
2338
+
2339
+ $this->deactivate_premium_only_addon_without_license();
2340
+ }
2341
+ } else {
2342
+ add_action( 'admin_init', array( &$this, '_admin_init_action' ) );
2343
+
2344
+ if ( $this->has_addons() &&
2345
+ 'plugin-information' === fs_request_get( 'tab', false ) &&
2346
+ $this->get_id() == fs_request_get( 'parent_plugin_id', false )
2347
+ ) {
2348
+ require_once WP_FS__DIR_INCLUDES . '/fs-plugin-info-dialog.php';
2349
+
2350
+ new FS_Plugin_Info_Dialog( $this );
2351
+ }
2352
+ }
2353
+
2354
+ // if ( $this->is_registered() ||
2355
+ // $this->is_anonymous() ||
2356
+ // $this->is_pending_activation()
2357
+ // ) {
2358
+ // $this->_init_admin();
2359
+ // }
2360
+ }
2361
+
2362
+ /**
2363
+ * Should be called outside `$this->is_user_in_admin()` scope
2364
+ * because the updater has some logic that needs to be executed
2365
+ * during AJAX calls.
2366
+ *
2367
+ * Currently we need to hook to the `http_request_host_is_external` filter.
2368
+ * In the future, there might be additional logic added.
2369
+ *
2370
+ * @author Vova Feldman
2371
+ * @since 1.2.1.6
2372
+ */
2373
+ if ( $this->is_premium() && $this->has_release_on_freemius() ) {
2374
+ new FS_Plugin_Updater( $this );
2375
+ }
2376
+
2377
+ $this->do_action( 'initiated' );
2378
+
2379
+ if ( $this->_storage->prev_is_premium !== $this->_plugin->is_premium ) {
2380
+ if ( isset( $this->_storage->prev_is_premium ) ) {
2381
+ $this->apply_filters(
2382
+ 'after_code_type_change',
2383
+ // New code type.
2384
+ $this->_plugin->is_premium
2385
+ );
2386
+ } else {
2387
+ // Set for code type for the first time.
2388
+ $this->_storage->prev_is_premium = $this->_plugin->is_premium;
2389
+ }
2390
+ }
2391
+
2392
+ if ( ! $this->is_addon() ) {
2393
+ if ( $this->is_registered() ) {
2394
+ // Fix for upgrade from versions < 1.0.9.
2395
+ if ( ! isset( $this->_storage->activation_timestamp ) ) {
2396
+ $this->_storage->activation_timestamp = WP_FS__SCRIPT_START_TIME;
2397
+ }
2398
+
2399
+ $this->do_action( 'after_init_plugin_registered' );
2400
+ } else if ( $this->is_anonymous() ) {
2401
+ $this->do_action( 'after_init_plugin_anonymous' );
2402
+ } else if ( $this->is_pending_activation() ) {
2403
+ $this->do_action( 'after_init_plugin_pending_activations' );
2404
+ }
2405
+ } else {
2406
+ if ( $this->is_registered() ) {
2407
+ $this->do_action( 'after_init_addon_registered' );
2408
+ } else if ( $this->is_anonymous() ) {
2409
+ $this->do_action( 'after_init_addon_anonymous' );
2410
+ } else if ( $this->is_pending_activation() ) {
2411
+ $this->do_action( 'after_init_addon_pending_activations' );
2412
+ }
2413
+ }
2414
+ }
2415
+
2416
+ /**
2417
+ * @author Leo Fajardo (@leorw)
2418
+ *
2419
+ * @since 1.2.1.5
2420
+ */
2421
+ function _stop_tracking_callback() {
2422
+ $result = $this->stop_tracking();
2423
+
2424
+ if ( true === $result ) {
2425
+ self::shoot_ajax_success();
2426
+ }
2427
+
2428
+ $this->_logger->api_error( $result );
2429
+
2430
+ self::shoot_ajax_failure(
2431
+ __fs( 'unexpected-api-error', $this->_slug ) .
2432
+ ( $this->is_api_error( $result ) && isset( $result->error ) ?
2433
+ $result->error->message :
2434
+ var_export( $result, true ) )
2435
+ );
2436
+ }
2437
+
2438
+ /**
2439
+ * @author Leo Fajardo (@leorw)
2440
+ * @since 1.2.1.5
2441
+ */
2442
+ function _allow_tracking_callback() {
2443
+ $result = $this->allow_tracking();
2444
+
2445
+ if ( true === $result ) {
2446
+ self::shoot_ajax_success();
2447
+ }
2448
+
2449
+ $this->_logger->api_error( $result );
2450
+
2451
+ self::shoot_ajax_failure(
2452
+ __fs( 'unexpected-api-error', $this->_slug ) .
2453
+ ( $this->is_api_error( $result ) && isset( $result->error ) ?
2454
+ $result->error->message :
2455
+ var_export( $result, true ) )
2456
+ );
2457
+ }
2458
+
2459
+ /**
2460
+ * Opt-out from usage tracking.
2461
+ *
2462
+ * Note: This will not delete the account information but will stop all tracking.
2463
+ *
2464
+ * Returns:
2465
+ * 1. FALSE - If the user never opted-in.
2466
+ * 2. TRUE - If successfully opted-out.
2467
+ * 3. object - API result on failure.
2468
+ *
2469
+ * @author Leo Fajardo (@leorw)
2470
+ * @since 1.2.1.5
2471
+ *
2472
+ * @return bool|object
2473
+ */
2474
+ function stop_tracking() {
2475
+ $this->_logger->entrance();
2476
+
2477
+ if ( ! $this->is_registered() ) {
2478
+ // User never opted-in.
2479
+ return false;
2480
+ }
2481
+
2482
+ if ( $this->is_tracking_prohibited() ) {
2483
+ // Already disconnected.
2484
+ return true;
2485
+ }
2486
+
2487
+ // Send update to FS.
2488
+ $result = $this->get_api_site_scope()->call( '/?fields=is_disconnected', 'put', array(
2489
+ 'is_disconnected' => true
2490
+ ) );
2491
+
2492
+ if ( ! $this->is_api_result_entity( $result ) ||
2493
+ ! isset( $result->is_disconnected ) ||
2494
+ ! $result->is_disconnected
2495
+ ) {
2496
+ $this->_logger->api_error( $result );
2497
+
2498
+ return $result;
2499
+ }
2500
+
2501
+ $this->_site->is_disconnected = $result->is_disconnected;
2502
+ $this->_store_site();
2503
+
2504
+ $this->clear_sync_cron();
2505
+
2506
+ // Successfully disconnected.
2507
+ return true;
2508
+ }
2509
+
2510
+ /**
2511
+ * Opt-in back into usage tracking.
2512
+ *
2513
+ * Note: This will only work if the user opted-in previously.
2514
+ *
2515
+ * Returns:
2516
+ * 1. FALSE - If the user never opted-in.
2517
+ * 2. TRUE - If successfully opted-in back to usage tracking.
2518
+ * 3. object - API result on failure.
2519
+ *
2520
+ * @author Leo Fajardo (@leorw)
2521
+ * @since 1.2.1.5
2522
+ *
2523
+ * @return bool|object
2524
+ */
2525
+ function allow_tracking() {
2526
+ $this->_logger->entrance();
2527
+
2528
+ if ( ! $this->is_registered() ) {
2529
+ // User never opted-in.
2530
+ return false;
2531
+ }
2532
+
2533
+ if ( $this->is_tracking_allowed() ) {
2534
+ // Tracking already allowed.
2535
+ return true;
2536
+ }
2537
+
2538
+ $result = $this->get_api_site_scope()->call( '/?is_disconnected', 'put', array(
2539
+ 'is_disconnected' => false
2540
+ ) );
2541
+
2542
+ if ( ! $this->is_api_result_entity( $result ) ||
2543
+ ! isset( $result->is_disconnected ) ||
2544
+ $result->is_disconnected
2545
+ ) {
2546
+ $this->_logger->api_error( $result );
2547
+
2548
+ return $result;
2549
+ }
2550
+
2551
+ $this->_site->is_disconnected = $result->is_disconnected;
2552
+ $this->_store_site();
2553
+
2554
+ $this->schedule_sync_cron();
2555
+
2556
+ // Successfully reconnected.
2557
+ return true;
2558
+ }
2559
+
2560
+ /**
2561
+ * If user opted-in and later disabled usage-tracking,
2562
+ * re-allow tracking for licensing and updates.
2563
+ *
2564
+ * @author Leo Fajardo (@leorw)
2565
+ *
2566
+ * @since 1.2.1.5
2567
+ */
2568
+ private function reconnect_locally() {
2569
+ $this->_logger->entrance();
2570
+
2571
+ if ( $this->is_tracking_prohibited() &&
2572
+ $this->is_registered()
2573
+ ) {
2574
+ $this->_site->is_disconnected = false;
2575
+ $this->_store_site();
2576
+ }
2577
+ }
2578
+
2579
+ /**
2580
+ * Parse plugin's settings (as defined by the plugin dev).
2581
+ *
2582
+ * @author Vova Feldman (@svovaf)
2583
+ * @since 1.1.7.3
2584
+ *
2585
+ * @param array $plugin_info
2586
+ *
2587
+ * @throws \Freemius_Exception
2588
+ */
2589
+ private function parse_settings( &$plugin_info ) {
2590
+ $this->_logger->entrance();
2591
+
2592
+ $id = $this->get_numeric_option( $plugin_info, 'id', false );
2593
+ $public_key = $this->get_option( $plugin_info, 'public_key', false );
2594
+ $secret_key = $this->get_option( $plugin_info, 'secret_key', null );
2595
+ $parent_id = $this->get_numeric_option( $plugin_info, 'parent_id', null );
2596
+ $parent_name = $this->get_option( $plugin_info, 'parent_name', null );
2597
+
2598
+ /**
2599
+ * @author Vova Feldman (@svovaf)
2600
+ * @since 1.1.9 Try to pull secret key from external config.
2601
+ */
2602
+ if ( is_null( $secret_key ) && defined( "WP_FS__{$this->_slug}_SECRET_KEY" ) ) {
2603
+ $secret_key = constant( "WP_FS__{$this->_slug}_SECRET_KEY" );
2604
+ }
2605
+
2606
+ if ( isset( $plugin_info['parent'] ) ) {
2607
+ $parent_id = $this->get_numeric_option( $plugin_info['parent'], 'id', null );
2608
+ // $parent_slug = $this->get_option( $plugin_info['parent'], 'slug', null );
2609
+ // $parent_public_key = $this->get_option( $plugin_info['parent'], 'public_key', null );
2610
+ // $parent_name = $this->get_option( $plugin_info['parent'], 'name', null );
2611
+ }
2612
+
2613
+ if ( false === $id ) {
2614
+ throw new Freemius_Exception( 'Plugin id parameter is not set.' );
2615
+ }
2616
+ if ( false === $public_key ) {
2617
+ throw new Freemius_Exception( 'Plugin public_key parameter is not set.' );
2618
+ }
2619
+
2620
+ $plugin = ( $this->_plugin instanceof FS_Plugin ) ?
2621
+ $this->_plugin :
2622
+ new FS_Plugin();
2623
+
2624
+ $plugin->update( array(
2625
+ 'id' => $id,
2626
+ 'public_key' => $public_key,
2627
+ 'slug' => $this->_slug,
2628
+ 'parent_plugin_id' => $parent_id,
2629
+ 'version' => $this->get_plugin_version(),
2630
+ 'title' => $this->get_plugin_name(),
2631
+ 'file' => $this->_plugin_basename,
2632
+ 'is_premium' => $this->get_bool_option( $plugin_info, 'is_premium', true ),
2633
+ 'is_live' => $this->get_bool_option( $plugin_info, 'is_live', true ),
2634
+ // 'secret_key' => $secret_key,
2635
+ ) );
2636
+
2637
+ if ( $plugin->is_updated() ) {
2638
+ // Update plugin details.
2639
+ $this->_plugin = FS_Plugin_Manager::instance( $this->_slug )->store( $plugin );
2640
+ }
2641
+ // Set the secret key after storing the plugin, we don't want to store the key in the storage.
2642
+ $this->_plugin->secret_key = $secret_key;
2643
+
2644
+ if (! isset( $plugin_info['menu'] )) {
2645
+ $plugin_info['menu'] = array();
2646
+
2647
+ if ( ! empty( $this->_storage->sdk_last_version ) &&
2648
+ version_compare( $this->_storage->sdk_last_version, '1.1.2', '<=' )
2649
+ ) {
2650
+ // Backward compatibility to 1.1.2
2651
+ $plugin_info['menu']['slug'] = isset( $plugin_info['menu_slug'] ) ?
2652
+ $plugin_info['menu_slug'] :
2653
+ $this->_slug;
2654
+ }
2655
+ }
2656
+
2657
+ $this->_menu = FS_Admin_Menu_Manager::instance( $this->_slug );
2658
+ $this->_menu->init( $plugin_info['menu'], $this->is_addon() );
2659
+
2660
+ $this->_has_addons = $this->get_bool_option( $plugin_info, 'has_addons', false );
2661
+ $this->_has_paid_plans = $this->get_bool_option( $plugin_info, 'has_paid_plans', true );
2662
+ $this->_has_premium_version = $this->get_bool_option( $plugin_info, 'has_premium_version', $this->_has_paid_plans );
2663
+ $this->_ignore_pending_mode = $this->get_bool_option( $plugin_info, 'ignore_pending_mode', false );
2664
+ $this->_is_org_compliant = $this->get_bool_option( $plugin_info, 'is_org_compliant', true );
2665
+ $this->_is_premium_only = $this->get_bool_option( $plugin_info, 'is_premium_only', false );
2666
+ if ( $this->_is_premium_only ) {
2667
+ // If premium only plugin, disable anonymous mode.
2668
+ $this->_enable_anonymous = false;
2669
+ $this->_anonymous_mode = false;
2670
+ } else {
2671
+ $this->_enable_anonymous = $this->get_bool_option( $plugin_info, 'enable_anonymous', true );
2672
+ $this->_anonymous_mode = $this->get_bool_option( $plugin_info, 'anonymous_mode', false );
2673
+ }
2674
+ $this->_permissions = $this->get_option( $plugin_info, 'permissions', array() );
2675
+
2676
+ if ( ! empty( $plugin_info['trial'] ) ) {
2677
+ $this->_trial_days = $this->get_numeric_option(
2678
+ $plugin_info['trial'],
2679
+ 'days',
2680
+ // Default to 0 - trial without days specification.
2681
+ 0
2682
+ );
2683
+
2684
+ $this->_is_trial_require_payment = $this->get_bool_option( $plugin_info['trial'], 'is_require_payment', false );
2685
+ }
2686
+ }
2687
+
2688
+ /**
2689
+ * @param string[] $options
2690
+ * @param string $key
2691
+ * @param mixed $default
2692
+ *
2693
+ * @return bool
2694
+ */
2695
+ private function get_option( &$options, $key, $default = false ) {
2696
+ return ! empty( $options[ $key ] ) ? $options[ $key ] : $default;
2697
+ }
2698
+
2699
+ private function get_bool_option( &$options, $key, $default = false ) {
2700
+ return isset( $options[ $key ] ) && is_bool( $options[ $key ] ) ? $options[ $key ] : $default;
2701
+ }
2702
+
2703
+ private function get_numeric_option( &$options, $key, $default = false ) {
2704
+ return isset( $options[ $key ] ) && is_numeric( $options[ $key ] ) ? $options[ $key ] : $default;
2705
+ }
2706
+
2707
+ /**
2708
+ * Gate keeper.
2709
+ *
2710
+ * @author Vova Feldman (@svovaf)
2711
+ * @since 1.1.7.3
2712
+ *
2713
+ * @return bool
2714
+ */
2715
+ private function should_stop_execution() {
2716
+ if ( empty( $this->_storage->was_plugin_loaded ) ) {
2717
+ /**
2718
+ * Don't execute Freemius until plugin was fully loaded at least once,
2719
+ * to give the opportunity for the activation hook to run before pinging
2720
+ * the API for connectivity test. This logic is relevant for the
2721
+ * identification of new plugin install vs. plugin update.
2722
+ *
2723
+ * @author Vova Feldman (@svovaf)
2724
+ * @since 1.1.9
2725
+ */
2726
+ return true;
2727
+ }
2728
+
2729
+ if ( $this->is_activation_mode() ) {
2730
+ if ( ! is_admin() ) {
2731
+ /**
2732
+ * If in activation mode, don't execute Freemius outside of the
2733
+ * admin dashboard.
2734
+ *
2735
+ * @author Vova Feldman (@svovaf)
2736
+ * @since 1.1.7.3
2737
+ */
2738
+ return true;
2739
+ }
2740
+
2741
+ if ( ! WP_FS__IS_HTTP_REQUEST ) {
2742
+ /**
2743
+ * If in activation and executed without HTTP context (e.g. CLI, Cronjob),
2744
+ * then don't start Freemius.
2745
+ *
2746
+ * @author Vova Feldman (@svovaf)
2747
+ * @since 1.1.6.3
2748
+ *
2749
+ * @link https://wordpress.org/support/topic/errors-in-the-freemius-class-when-running-in-wordpress-in-cli
2750
+ */
2751
+ return true;
2752
+ }
2753
+
2754
+ if ( $this->is_cron() ) {
2755
+ /**
2756
+ * If in activation mode, don't execute Freemius during wp crons
2757
+ * (wp crons have HTTP context - called as HTTP request).
2758
+ *
2759
+ * @author Vova Feldman (@svovaf)
2760
+ * @since 1.1.7.3
2761
+ */
2762
+ return true;
2763
+ }
2764
+
2765
+ if ( self::is_ajax() &&
2766
+ ! $this->_admin_notices->has_sticky( 'failed_connect_api_first' ) &&
2767
+ ! $this->_admin_notices->has_sticky( 'failed_connect_api' )
2768
+ ) {
2769
+ /**
2770
+ * During activation, if running in AJAX mode, unless there's a sticky
2771
+ * connectivity issue notice, don't run Freemius.
2772
+ *
2773
+ * @author Vova Feldman (@svovaf)
2774
+ * @since 1.1.7.3
2775
+ */
2776
+ return true;
2777
+ }
2778
+ }
2779
+
2780
+ return false;
2781
+ }
2782
+
2783
+ /**
2784
+ * Triggered after code type has changed.
2785
+ *
2786
+ * @author Vova Feldman (@svovaf)
2787
+ * @since 1.1.9.1
2788
+ */
2789
+ function _after_code_type_change() {
2790
+ $this->_logger->entrance();
2791
+
2792
+ add_action( is_admin() ? 'admin_init' : 'init', array(
2793
+ &$this,
2794
+ '_plugin_code_type_changed'
2795
+ ) );
2796
+ }
2797
+
2798
+ /**
2799
+ * Handles plugin's code type change (free <--> premium).
2800
+ *
2801
+ * @author Vova Feldman (@svovaf)
2802
+ * @since 1.0.9
2803
+ */
2804
+ function _plugin_code_type_changed() {
2805
+ $this->_logger->entrance();
2806
+
2807
+ if ( $this->is_premium() ) {
2808
+ $this->reconnect_locally();
2809
+
2810
+ // Activated premium code.
2811
+ $this->do_action( 'after_premium_version_activation' );
2812
+
2813
+ // Remove all sticky messages related to download of the premium version.
2814
+ $this->_admin_notices->remove_sticky( array(
2815
+ 'trial_started',
2816
+ 'plan_upgraded',
2817
+ 'plan_changed',
2818
+ 'license_activated',
2819
+ ) );
2820
+
2821
+ $this->_admin_notices->add_sticky(
2822
+ __fs( 'premium-activated-message', $this->_slug ),
2823
+ 'premium_activated',
2824
+ __fs( 'woot', $this->_slug ) . '!'
2825
+ );
2826
+ } else {
2827
+ // Remove sticky message related to premium code activation.
2828
+ $this->_admin_notices->remove_sticky( 'premium_activated' );
2829
+
2830
+ // Activated free code (after had the premium before).
2831
+ $this->do_action( 'after_free_version_reactivation' );
2832
+
2833
+ if ( $this->is_paying() && ! $this->is_premium() ) {
2834
+ $this->_admin_notices->add_sticky(
2835
+ sprintf(
2836
+ __fs( 'you-have-x-license', $this->_slug ),
2837
+ $this->_site->plan->title
2838
+ ) . $this->get_complete_upgrade_instructions(),
2839
+ 'plan_upgraded',
2840
+ __fs( 'yee-haw', $this->_slug ) . '!'
2841
+ );
2842
+ }
2843
+ }
2844
+
2845
+ // Schedule code type changes event.
2846
+ $this->schedule_install_sync();
2847
+
2848
+ /**
2849
+ * Unregister the uninstall hook for the other version of the plugin (with different code type) to avoid
2850
+ * triggering a fatal error when uninstalling that plugin. For example, after deactivating the "free" version
2851
+ * of a specific plugin, its uninstall hook should be unregistered after the "premium" version has been
2852
+ * activated. If we don't do that, a fatal error will occur when we try to uninstall the "free" version since
2853
+ * the main file of the "free" version will be loaded first before calling the hooked callback. Since the
2854
+ * free and premium versions are almost identical (same class or have same functions), a fatal error like
2855
+ * "Cannot redeclare class MyClass" or "Cannot redeclare my_function()" will occur.
2856
+ */
2857
+ $this->unregister_uninstall_hook();
2858
+
2859
+ $this->clear_module_main_file_cache();
2860
+
2861
+ // Update is_premium of latest version.
2862
+ $this->_storage->prev_is_premium = $this->_plugin->is_premium;
2863
+ }
2864
+
2865
+ #endregion
2866
+
2867
+ #----------------------------------------------------------------------------------
2868
+ #region Add-ons
2869
+ #----------------------------------------------------------------------------------
2870
+
2871
+ /**
2872
+ * Check if add-on installed and activated on site.
2873
+ *
2874
+ * @author Vova Feldman (@svovaf)
2875
+ * @since 1.0.6
2876
+ *
2877
+ * @param string|number $slug_or_id
2878
+ *
2879
+ * @return bool
2880
+ */
2881
+ function is_addon_activated( $slug_or_id ) {
2882
+ return self::has_instance( $slug_or_id );
2883
+ }
2884
+
2885
+ /**
2886
+ * Check if add-on was connected to install
2887
+ *
2888
+ * @author Vova Feldman (@svovaf)
2889
+ * @since 1.1.7
2890
+ *
2891
+ * @param string $slug
2892
+ *
2893
+ * @return bool
2894
+ */
2895
+ function is_addon_connected( $slug ) {
2896
+ $sites = self::get_all_sites();
2897
+
2898
+ if ( ! isset( $sites[ $slug ] ) ) {
2899
+ return false;
2900
+ }
2901
+
2902
+ $site = $sites[ $slug ];
2903
+
2904
+ $plugin = FS_Plugin_Manager::instance( $slug )->get();
2905
+
2906
+ if ( $plugin->parent_plugin_id != $this->_plugin->id ) {
2907
+ // The given slug do NOT belong to any of the plugin's add-ons.
2908
+ return false;
2909
+ }
2910
+
2911
+ return ( is_object( $site ) &&
2912
+ is_numeric( $site->id ) &&
2913
+ is_numeric( $site->user_id ) &&
2914
+ is_object( $site->plan )
2915
+ );
2916
+ }
2917
+
2918
+ /**
2919
+ * Determines if add-on installed.
2920
+ *
2921
+ * NOTE: This is a heuristic and only works if the folder/file named as the slug.
2922
+ *
2923
+ * @author Vova Feldman (@svovaf)
2924
+ * @since 1.0.6
2925
+ *
2926
+ * @param string $slug
2927
+ *
2928
+ * @return bool
2929
+ */
2930
+ function is_addon_installed( $slug ) {
2931
+ return file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $this->get_addon_basename( $slug ) ) );
2932
+ }
2933
+
2934
+ /**
2935
+ * Get add-on basename.
2936
+ *
2937
+ * @author Vova Feldman (@svovaf)
2938
+ * @since 1.0.6
2939
+ *
2940
+ * @param string $slug
2941
+ *
2942
+ * @return string
2943
+ */
2944
+ function get_addon_basename( $slug ) {
2945
+ if ( $this->is_addon_activated( $slug ) ) {
2946
+ self::instance( $slug )->get_plugin_basename();
2947
+ }
2948
+
2949
+ $premium_basename = $slug . '-premium/' . $slug . '.php';
2950
+
2951
+ if ( file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $premium_basename ) ) ) {
2952
+ return $premium_basename;
2953
+ }
2954
+
2955
+ $free_basename = $slug . '/' . $slug . '.php';
2956
+
2957
+ return $free_basename;
2958
+ }
2959
+
2960
+ /**
2961
+ * Get installed add-ons instances.
2962
+ *
2963
+ * @author Vova Feldman (@svovaf)
2964
+ * @since 1.0.6
2965
+ *
2966
+ * @return Freemius[]
2967
+ */
2968
+ function get_installed_addons() {
2969
+ $installed_addons = array();
2970
+ foreach ( self::$_instances as $slug => $instance ) {
2971
+ if ( $instance->is_addon() && is_object( $instance->_parent_plugin ) ) {
2972
+ if ( $this->_plugin->id == $instance->_parent_plugin->id ) {
2973
+ $installed_addons[] = $instance;
2974
+ }
2975
+ }
2976
+ }
2977
+
2978
+ return $installed_addons;
2979
+ }
2980
+
2981
+ /**
2982
+ * Check if any add-ons of the plugin are installed.
2983
+ *
2984
+ * @author Leo Fajardo (@leorw)
2985
+ * @since 1.1.1
2986
+ *
2987
+ * @return bool
2988
+ */
2989
+ function has_installed_addons() {
2990
+ if ( ! $this->has_addons() ) {
2991
+ return false;
2992
+ }
2993
+
2994
+ foreach ( self::$_instances as $slug => $instance ) {
2995
+ if ( $instance->is_addon() && is_object( $instance->_parent_plugin ) ) {
2996
+ if ( $this->_plugin->id == $instance->_parent_plugin->id ) {
2997
+ return true;
2998
+ }
2999
+ }
3000
+ }
3001
+
3002
+ return false;
3003
+ }
3004
+
3005
+ /**
3006
+ * Tell Freemius that the current plugin is an add-on.
3007
+ *
3008
+ * @author Vova Feldman (@svovaf)
3009
+ * @since 1.0.6
3010
+ *
3011
+ * @param number $parent_plugin_id The parent plugin ID
3012
+ */
3013
+ function init_addon( $parent_plugin_id ) {
3014
+ $this->_plugin->parent_plugin_id = $parent_plugin_id;
3015
+ }
3016
+
3017
+ /**
3018
+ * @author Vova Feldman (@svovaf)
3019
+ * @since 1.0.6
3020
+ *
3021
+ * @return bool
3022
+ */
3023
+ function is_addon() {
3024
+ return isset( $this->_plugin->parent_plugin_id ) && is_numeric( $this->_plugin->parent_plugin_id );
3025
+ }
3026
+
3027
+ /**
3028
+ * Deactivate add-on if it's premium only and the user does't have a valid license.
3029
+ *
3030
+ * @param bool $is_after_trial_cancel
3031
+ *
3032
+ * @return bool If add-on was deactivated.
3033
+ */
3034
+ private function deactivate_premium_only_addon_without_license( $is_after_trial_cancel = false ) {
3035
+ if ( ! $this->has_free_plan() &&
3036
+ ! $this->has_features_enabled_license() &&
3037
+ ! $this->_has_premium_license()
3038
+ ) {
3039
+ // IF wrapper is turned off because activation_timestamp is currently only stored for plugins (not addons).
3040
+ // if (empty($this->_storage->activation_timestamp) ||
3041
+ // (WP_FS__SCRIPT_START_TIME - $this->_storage->activation_timestamp) > 30
3042
+ // ) {
3043
+ /**
3044
+ * @todo When it's first fail, there's no reason to try and re-sync because the licenses were just synced after initial activation.
3045
+ *
3046
+ * Retry syncing the user add-on licenses.
3047
+ */
3048
+ // Sync licenses.
3049
+ $this->_sync_licenses();
3050
+ // }
3051
+
3052
+ // Try to activate premium license.
3053
+ $this->_activate_license( true );
3054
+
3055
+ if ( ! $this->has_free_plan() &&
3056
+ ! $this->has_features_enabled_license() &&
3057
+ ! $this->_has_premium_license()
3058
+ ) {
3059
+ // @todo Check if deactivate plugins also call the deactivation hook.
3060
+
3061
+ deactivate_plugins( array( $this->_plugin_basename ), true );
3062
+
3063
+ $this->_parent->_admin_notices->add_sticky(
3064
+ sprintf(
3065
+ __fs( ( $is_after_trial_cancel ?
3066
+ 'addon-trial-cancelled-message' :
3067
+ 'addon-no-license-message' ),
3068
+ $this->_parent->_slug
3069
+ ),
3070
+ '<b>' . $this->_plugin->title . '</b>'
3071
+ ) . ' ' . sprintf(
3072
+ '<a href="%s" aria-label="%s" class="button button-primary" style="margin-left: 10px; vertical-align: middle;">%s &nbsp;&#10140;</a>',
3073
+ $this->_parent->addon_url( $this->_slug ),
3074
+ esc_attr( sprintf( __fs( 'more-information-about-x', $this->_parent->_slug ), $this->_plugin->title ) ),
3075
+ __fs( 'purchase-license', $this->_parent->_slug )
3076
+ ),
3077
+ 'no_addon_license_' . $this->_slug,
3078
+ ( $is_after_trial_cancel ? '' : __fs( 'oops', $this->_parent->_slug ) . '...' ),
3079
+ ( $is_after_trial_cancel ? 'success' : 'error' )
3080
+ );
3081
+
3082
+ return true;
3083
+ }
3084
+ }
3085
+
3086
+ return false;
3087
+ }
3088
+
3089
+ #endregion
3090
+
3091
+ #----------------------------------------------------------------------------------
3092
+ #region Sandbox
3093
+ #----------------------------------------------------------------------------------
3094
+
3095
+ /**
3096
+ * Set Freemius into sandbox mode for debugging.
3097
+ *
3098
+ * @author Vova Feldman (@svovaf)
3099
+ * @since 1.0.4
3100
+ *
3101
+ * @param string $secret_key
3102
+ */
3103
+ function init_sandbox( $secret_key ) {
3104
+ $this->_plugin->secret_key = $secret_key;
3105
+
3106
+ // Update plugin details.
3107
+ FS_Plugin_Manager::instance( $this->_slug )->update( $this->_plugin, true );
3108
+ }
3109
+
3110
+ /**
3111
+ * Check if running payments in sandbox mode.
3112
+ *
3113
+ * @author Vova Feldman (@svovaf)
3114
+ * @since 1.0.4
3115
+ *
3116
+ * @return bool
3117
+ */
3118
+ function is_payments_sandbox() {
3119
+ return ( ! $this->is_live() ) || isset( $this->_plugin->secret_key );
3120
+ }
3121
+
3122
+ #endregion
3123
+
3124
+ /**
3125
+ * Check if running test vs. live plugin.
3126
+ *
3127
+ * @author Vova Feldman (@svovaf)
3128
+ * @since 1.0.5
3129
+ *
3130
+ * @return bool
3131
+ */
3132
+ function is_live() {
3133
+ return $this->_plugin->is_live;
3134
+ }
3135
+
3136
+ /**
3137
+ * Check if the user skipped connecting the account with Freemius.
3138
+ *
3139
+ * @author Vova Feldman (@svovaf)
3140
+ * @since 1.0.7
3141
+ *
3142
+ * @return bool
3143
+ */
3144
+ function is_anonymous() {
3145
+ if ( ! isset( $this->_is_anonymous ) ) {
3146
+ if ( ! isset( $this->_storage->is_anonymous ) ) {
3147
+ // Not skipped.
3148
+ $this->_is_anonymous = false;
3149
+ } else if ( is_bool( $this->_storage->is_anonymous ) ) {
3150
+ // For back compatibility, since the variable was boolean before.
3151
+ $this->_is_anonymous = $this->_storage->is_anonymous;
3152
+
3153
+ // Upgrade stored data format to 1.1.3 format.
3154
+ $this->set_anonymous_mode( $this->_storage->is_anonymous );
3155
+ } else {
3156
+ // Version 1.1.3 and later.
3157
+ $this->_is_anonymous = $this->_storage->is_anonymous['is'];
3158
+ }
3159
+ }
3160
+
3161
+ return $this->_is_anonymous;
3162
+ }
3163
+
3164
+ /**
3165
+ * Check if user connected his account and install pending email activation.
3166
+ *
3167
+ * @author Vova Feldman (@svovaf)
3168
+ * @since 1.0.7
3169
+ *
3170
+ * @return bool
3171
+ */
3172
+ function is_pending_activation() {
3173
+ return $this->_storage->get( 'is_pending_activation', false );
3174
+ }
3175
+
3176
+ /**
3177
+ * Check if plugin must be WordPress.org compliant.
3178
+ *
3179
+ * @since 1.0.7
3180
+ *
3181
+ * @return bool
3182
+ */
3183
+ function is_org_repo_compliant() {
3184
+ return $this->_is_org_compliant;
3185
+ }
3186
+
3187
+ #----------------------------------------------------------------------------------
3188
+ #region Daily Sync Cron
3189
+ #----------------------------------------------------------------------------------
3190
+
3191
+ /**
3192
+ * @author Vova Feldman (@svovaf)
3193
+ * @since 1.1.7.3
3194
+ */
3195
+ private function run_manual_sync() {
3196
+ $this->require_pluggable_essentials();
3197
+
3198
+ if ( ! current_user_can( 'activate_plugins' ) ) {
3199
+ return;
3200
+ }
3201
+
3202
+ // Run manual sync.
3203
+ $this->_sync_cron();
3204
+
3205
+ // Reschedule next cron to run 24 hours from now (performance optimization).
3206
+ $this->clear_sync_cron();
3207
+
3208
+ $this->schedule_sync_cron( time() + WP_FS__TIME_24_HOURS_IN_SEC, false );
3209
+ }
3210
+
3211
+ /**
3212
+ * Data sync cron job. Replaces the background sync non blocking HTTP request
3213
+ * that doesn't halt page loading.
3214
+ *
3215
+ * @author Vova Feldman (@svovaf)
3216
+ * @since 1.1.7.3
3217
+ */
3218
+ function _sync_cron() {
3219
+ $this->_logger->entrance();
3220
+
3221
+ // Store the last time data sync was executed.
3222
+ $this->_storage->sync_timestamp = time();
3223
+
3224
+ // Check if API is temporary down.
3225
+ if ( FS_Api::is_temporary_down() ) {
3226
+ return;
3227
+ }
3228
+
3229
+ // @todo Add logic that identifies API latency, and reschedule the next background sync randomly between 8-16 hours.
3230
+
3231
+ if ( $this->is_registered() ) {
3232
+ if ( $this->has_paid_plan() ) {
3233
+ // Initiate background plan sync.
3234
+ $this->_sync_license( true );
3235
+
3236
+ if ( $this->is_paying() ) {
3237
+ // Check for premium plugin updates.
3238
+ $this->check_updates( true );
3239
+ }
3240
+ } else {
3241
+ // Sync install (only if something changed locally).
3242
+ $this->sync_install();
3243
+ }
3244
+ }
3245
+
3246
+ $this->do_action( 'after_sync_cron' );
3247
+ }
3248
+
3249
+ /**
3250
+ * Check if sync was executed in the last $period of seconds.
3251
+ *
3252
+ * @author Vova Feldman (@svovaf)
3253
+ * @since 1.1.7.3
3254
+ *
3255
+ * @param int $period In seconds
3256
+ *
3257
+ * @return bool
3258
+ */
3259
+ private function is_sync_executed( $period = WP_FS__TIME_24_HOURS_IN_SEC ) {
3260
+ if ( ! isset( $this->_storage->sync_timestamp ) ) {
3261
+ return false;
3262
+ }
3263
+
3264
+ return ( $this->_storage->sync_timestamp > ( WP_FS__SCRIPT_START_TIME - $period ) );
3265
+ }
3266
+
3267
+ /**
3268
+ * @author Vova Feldman (@svovaf)
3269
+ * @since 1.1.7.3
3270
+ *
3271
+ * @return bool
3272
+ */
3273
+ private function is_sync_cron_on() {
3274
+ /**
3275
+ * @var object $sync_cron_data
3276
+ */
3277
+ $sync_cron_data = $this->_storage->get( 'sync_cron', null );
3278
+
3279
+ return ( ! is_null( $sync_cron_data ) && true === $sync_cron_data->on );
3280
+ }
3281
+
3282
+ /**
3283
+ * @author Vova Feldman (@svovaf)
3284
+ * @since 1.1.7.3
3285
+ *
3286
+ * @param int $start_at Defaults to now.
3287
+ * @param bool $randomize_start If true, schedule first job randomly during the next 12 hours. Otherwise,
3288
+ * schedule job to start right away.
3289
+ */
3290
+ private function schedule_sync_cron( $start_at = WP_FS__SCRIPT_START_TIME, $randomize_start = true ) {
3291
+ $this->_logger->entrance();
3292
+
3293
+ if ( $randomize_start ) {
3294
+ // Schedule first sync with a random 12 hour time range from now.
3295
+ $start_at += rand( 0, ( WP_FS__TIME_24_HOURS_IN_SEC / 2 ) );
3296
+ }
3297
+
3298
+ // Schedule daily WP cron.
3299
+ wp_schedule_event(
3300
+ $start_at,
3301
+ 'daily',
3302
+ $this->get_action_tag( 'data_sync' )
3303
+ );
3304
+
3305
+ $this->_storage->store( 'sync_cron', (object) array(
3306
+ 'version' => $this->get_plugin_version(),
3307
+ 'sdk_version' => $this->version,
3308
+ 'timestamp' => WP_FS__SCRIPT_START_TIME,
3309
+ 'on' => true,
3310
+ ) );
3311
+ }
3312
+
3313
+ /**
3314
+ * Add the actual sync function to the cron job hook.
3315
+ *
3316
+ * @author Vova Feldman (@svovaf)
3317
+ * @since 1.1.7.3
3318
+ */
3319
+ private function hook_callback_to_sync_cron() {
3320
+ $this->add_action( 'data_sync', array( &$this, '_sync_cron' ) );
3321
+ }
3322
+
3323
+ /**
3324
+ * @author Vova Feldman (@svovaf)
3325
+ * @since 1.1.7.3
3326
+ */
3327
+ private function clear_sync_cron() {
3328
+ $this->_logger->entrance();
3329
+
3330
+ if ( ! $this->is_sync_cron_on() ) {
3331
+ return;
3332
+ }
3333
+
3334
+ $this->_storage->remove( 'sync_cron' );
3335
+
3336
+ wp_clear_scheduled_hook( $this->get_action_tag( 'data_sync' ) );
3337
+ }
3338
+
3339
+ /**
3340
+ * Unix timestamp for next sync cron execution or false if not scheduled.
3341
+ *
3342
+ * @author Vova Feldman (@svovaf)
3343
+ * @since 1.1.7.3
3344
+ *
3345
+ * @return int|false
3346
+ */
3347
+ function next_sync_cron() {
3348
+ $this->_logger->entrance();
3349
+
3350
+ if ( ! $this->is_sync_cron_on() ) {
3351
+ return false;
3352
+ }
3353
+
3354
+ return wp_next_scheduled( $this->get_action_tag( 'data_sync' ) );
3355
+ }
3356
+
3357
+ /**
3358
+ * Unix timestamp for previous sync cron execution or false if never executed.
3359
+ *
3360
+ * @author Vova Feldman (@svovaf)
3361
+ * @since 1.1.7.3
3362
+ *
3363
+ * @return int|false
3364
+ */
3365
+ function last_sync_cron() {
3366
+ $this->_logger->entrance();
3367
+
3368
+ return $this->_storage->get( 'sync_timestamp' );
3369
+ }
3370
+
3371
+ #endregion Daily Sync Cron ------------------------------------------------------------------
3372
+
3373
+ #----------------------------------------------------------------------------------
3374
+ #region Async Install Sync
3375
+ #----------------------------------------------------------------------------------
3376
+
3377
+ /**
3378
+ * @author Vova Feldman (@svovaf)
3379
+ * @since 1.1.7.3
3380
+ *
3381
+ * @return bool
3382
+ */
3383
+ private function is_install_sync_scheduled() {
3384
+ /**
3385
+ * @var object $cron_data
3386
+ */
3387
+ $cron_data = $this->_storage->get( 'install_sync_cron', null );
3388
+
3389
+ return ( ! is_null( $cron_data ) && true === $cron_data->on );
3390
+ }
3391
+
3392
+ /**
3393
+ * Instead of running blocking install sync event, execute non blocking scheduled wp-cron.
3394
+ *
3395
+ * @author Vova Feldman (@svovaf)
3396
+ * @since 1.1.7.3
3397
+ */
3398
+ private function schedule_install_sync() {
3399
+ $this->_logger->entrance();
3400
+
3401
+ $this->clear_install_sync_cron();
3402
+
3403
+ // Schedule immediate install sync.
3404
+ wp_schedule_single_event(
3405
+ WP_FS__SCRIPT_START_TIME,
3406
+ $this->get_action_tag( 'install_sync' )
3407
+ );
3408
+
3409
+ $this->_storage->store( 'install_sync_cron', (object) array(
3410
+ 'version' => $this->get_plugin_version(),
3411
+ 'sdk_version' => $this->version,
3412
+ 'timestamp' => WP_FS__SCRIPT_START_TIME,
3413
+ 'on' => true,
3414
+ ) );
3415
+ }
3416
+
3417
+ /**
3418
+ * Unix timestamp for previous install sync cron execution or false if never executed.
3419
+ *
3420
+ * @todo There's some very strange bug that $this->_storage->install_sync_timestamp value is not being
3421
+ * updated. But for sure the sync event is working.
3422
+ *
3423
+ * @author Vova Feldman (@svovaf)
3424
+ * @since 1.1.7.3
3425
+ *
3426
+ * @return int|false
3427
+ */
3428
+ function last_install_sync() {
3429
+ $this->_logger->entrance();
3430
+
3431
+ return $this->_storage->get( 'install_sync_timestamp' );
3432
+ }
3433
+
3434
+ /**
3435
+ * Unix timestamp for next install sync cron execution or false if not scheduled.
3436
+ *
3437
+ * @author Vova Feldman (@svovaf)
3438
+ * @since 1.1.7.3
3439
+ *
3440
+ * @return int|false
3441
+ */
3442
+ function next_install_sync() {
3443
+ $this->_logger->entrance();
3444
+
3445
+ if ( ! $this->is_install_sync_scheduled() ) {
3446
+ return false;
3447
+ }
3448
+
3449
+ return wp_next_scheduled( $this->get_action_tag( 'install_sync' ) );
3450
+ }
3451
+
3452
+ /**
3453
+ * Add the actual install sync function to the cron job hook.
3454
+ *
3455
+ * @author Vova Feldman (@svovaf)
3456
+ * @since 1.1.7.3
3457
+ */
3458
+ private function hook_callback_to_install_sync() {
3459
+ $this->add_action( 'install_sync', array( &$this, '_run_sync_install' ) );
3460
+ }
3461
+
3462
+ /**
3463
+ * @author Vova Feldman (@svovaf)
3464
+ * @since 1.1.7.3
3465
+ */
3466
+ private function clear_install_sync_cron() {
3467
+ $this->_logger->entrance();
3468
+
3469
+ if ( ! $this->is_install_sync_scheduled() ) {
3470
+ return;
3471
+ }
3472
+
3473
+ $this->_storage->remove( 'install_sync_cron' );
3474
+
3475
+ wp_clear_scheduled_hook( $this->get_action_tag( 'install_sync' ) );
3476
+ }
3477
+
3478
+ /**
3479
+ * @author Vova Feldman (@svovaf)
3480
+ * @since 1.1.7.3
3481
+ */
3482
+ public function _run_sync_install() {
3483
+ $this->_logger->entrance();
3484
+
3485
+ // Update last install sync timestamp.
3486
+ $this->_storage->install_sync_timestamp = time();
3487
+
3488
+ $this->sync_install( array(), true );
3489
+ }
3490
+
3491
+ #endregion Async Install Sync ------------------------------------------------------------------
3492
+
3493
+ /**
3494
+ * Show a notice that activation is currently pending.
3495
+ *
3496
+ * @author Vova Feldman (@svovaf)
3497
+ * @since 1.0.7
3498
+ *
3499
+ * @param bool|string $email
3500
+ * @param bool $is_pending_trial Since 1.2.1.5
3501
+ */
3502
+ function _add_pending_activation_notice( $email = false, $is_pending_trial = false ) {
3503
+ if ( ! is_string( $email ) ) {
3504
+ $current_user = self::_get_current_wp_user();
3505
+ $email = $current_user->user_email;
3506
+ }
3507
+
3508
+ $this->_admin_notices->add_sticky(
3509
+ sprintf(
3510
+ __fs( 'pending-activation-message', $this->_slug ),
3511
+ '<b>' . $this->get_plugin_name() . '</b>',
3512
+ '<b>' . $email . '</b>',
3513
+ __fs( $is_pending_trial ? 'start-the-trial' : 'complete-the-install', $this->_slug )
3514
+ ),
3515
+ 'activation_pending',
3516
+ 'Thanks!'
3517
+ );
3518
+ }
3519
+
3520
+ /**
3521
+ * Check if currently in plugin activation.
3522
+ *
3523
+ * @author Vova Feldman (@svovaf)
3524
+ * @since 1.1.4
3525
+ *
3526
+ * @return bool
3527
+ */
3528
+ function is_plugin_activation() {
3529
+ return get_option( "fs_{$this->_slug}_activated", false );
3530
+ }
3531
+
3532
+ /**
3533
+ *
3534
+ * NOTE: admin_menu action executed before admin_init.
3535
+ *
3536
+ * @author Vova Feldman (@svovaf)
3537
+ * @since 1.0.7
3538
+ */
3539
+ function _admin_init_action() {
3540
+ /**
3541
+ * Automatically redirect to connect/activation page after plugin activation.
3542
+ *
3543
+ * @since 1.1.7 Do NOT redirect to opt-in when running in network admin mode.
3544
+ */
3545
+ if ( $this->is_plugin_activation() ) {
3546
+ delete_option( "fs_{$this->_slug}_activated" );
3547
+
3548
+ if ( ! function_exists( 'is_network_admin' ) || ! is_network_admin() ) {
3549
+ $this->_redirect_on_activation_hook();
3550
+
3551
+ return;
3552
+ }
3553
+ }
3554
+
3555
+ if ( fs_request_is_action( $this->_slug . '_skip_activation' ) ) {
3556
+ check_admin_referer( $this->_slug . '_skip_activation' );
3557
+
3558
+ $this->skip_connection();
3559
+
3560
+ fs_redirect( $this->get_after_activation_url( 'after_skip_url' ) );
3561
+ }
3562
+
3563
+ if ( ! $this->is_addon() && ! $this->is_registered() && ! $this->is_anonymous() ) {
3564
+ if ( ! $this->is_pending_activation() ) {
3565
+ if ( ! $this->_menu->is_activation_page() ) {
3566
+ if ( $this->is_plugin_new_install() || $this->is_only_premium() ) {
3567
+ // Show notice for new plugin installations.
3568
+ $this->_admin_notices->add(
3569
+ sprintf(
3570
+ __fs( 'you-are-step-away', $this->_slug ),
3571
+ sprintf( '<b><a href="%s">%s</a></b>',
3572
+ $this->get_activation_url(),
3573
+ sprintf( __fs( 'activate-x-now', $this->_slug ), $this->get_plugin_name() )
3574
+ )
3575
+ ),
3576
+ '',
3577
+ 'update-nag'
3578
+ );
3579
+ } else {
3580
+ if ( ! isset( $this->_storage->sticky_optin_added ) ) {
3581
+ $this->_storage->sticky_optin_added = true;
3582
+
3583
+ // Show notice for new plugin installations.
3584
+ $this->_admin_notices->add_sticky(
3585
+ sprintf(
3586
+ __fs( 'few-plugin-tweaks', $this->_slug ),
3587
+ sprintf( '<b><a href="%s">%s</a></b>',
3588
+ $this->get_activation_url(),
3589
+ sprintf( __fs( 'optin-x-now', $this->_slug ), $this->get_plugin_name() )
3590
+ )
3591
+ ),
3592
+ 'connect_account',
3593
+ '',
3594
+ 'update-nag'
3595
+ );
3596
+ }
3597
+
3598
+ if ( $this->has_filter( 'optin_pointer_element' ) ) {
3599
+ // Don't show admin nag if plugin update.
3600
+ wp_enqueue_script( 'wp-pointer' );
3601
+ wp_enqueue_style( 'wp-pointer' );
3602
+
3603
+ $this->_enqueue_connect_essentials();
3604
+
3605
+ add_action( 'admin_print_footer_scripts', array(
3606
+ $this,
3607
+ '_add_connect_pointer_script'
3608
+ ) );
3609
+ }
3610
+
3611
+ }
3612
+ }
3613
+ }
3614
+ }
3615
+
3616
+ $this->_add_upgrade_action_link();
3617
+ }
3618
+
3619
+ /**
3620
+ * Enqueue connect requires scripts and styles.
3621
+ *
3622
+ * @author Vova Feldman (@svovaf)
3623
+ * @since 1.1.4
3624
+ */
3625
+ function _enqueue_connect_essentials() {
3626
+ wp_enqueue_script( 'jquery' );
3627
+ wp_enqueue_script( 'json2' );
3628
+
3629
+ fs_enqueue_local_script( 'postmessage', 'nojquery.ba-postmessage.min.js' );
3630
+ fs_enqueue_local_script( 'fs-postmessage', 'postmessage.js' );
3631
+
3632
+ fs_enqueue_local_style( 'fs_connect', '/admin/connect.css' );
3633
+ }
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
3666
+ echo $this->apply_filters( 'optin_pointer_execute', "
3667
+
3668
+ optin.pointer('open');
3669
+
3670
+ // Tag the opt-in pointer with custom class.
3671
+ $('.wp-pointer #fs_connect')
3672
+ .parents('.wp-pointer.wp-pointer-top')
3673
+ .addClass('fs-opt-in-pointer');
3674
+
3675
+ ", 'element', 'optin' ) ?>
3676
+ }
3677
+ }
3678
+ });
3679
+ // ]]></script>
3680
+ <?php
3681
+ }
3682
+
3683
+ /**
3684
+ * Return current page's URL.
3685
+ *
3686
+ * @author Vova Feldman (@svovaf)
3687
+ * @since 1.0.7
3688
+ *
3689
+ * @return string
3690
+ */
3691
+ function current_page_url() {
3692
+ $url = 'http';
3693
+
3694
+ if ( isset( $_SERVER["HTTPS"] ) ) {
3695
+ if ( $_SERVER["HTTPS"] == "on" ) {
3696
+ $url .= "s";
3697
+ }
3698
+ }
3699
+ $url .= "://";
3700
+ if ( $_SERVER["SERVER_PORT"] != "80" ) {
3701
+ $url .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
3702
+ } else {
3703
+ $url .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
3704
+ }
3705
+
3706
+ return esc_url( $url );
3707
+ }
3708
+
3709
+ /**
3710
+ * Check if the current page is the plugin's main admin settings page.
3711
+ *
3712
+ * @author Vova Feldman (@svovaf)
3713
+ * @since 1.0.7
3714
+ *
3715
+ * @return bool
3716
+ */
3717
+ function _is_plugin_page() {
3718
+ return fs_is_plugin_page( $this->_menu->get_raw_slug() ) ||
3719
+ fs_is_plugin_page( $this->_slug );
3720
+ }
3721
+
3722
+ /* Events
3723
+ ------------------------------------------------------------------------------------------------------------------*/
3724
+ /**
3725
+ * Delete site install from Database.
3726
+ *
3727
+ * @author Vova Feldman (@svovaf)
3728
+ * @since 1.0.1
3729
+ *
3730
+ * @param bool $store
3731
+ */
3732
+ function _delete_site( $store = true ) {
3733
+ $sites = self::get_all_sites();
3734
+
3735
+ if ( isset( $sites[ $this->_slug ] ) ) {
3736
+ unset( $sites[ $this->_slug ] );
3737
+ }
3738
+
3739
+ self::$_accounts->set_option( 'sites', $sites, $store );
3740
+ }
3741
+
3742
+ /**
3743
+ * Delete plugin's plans information.
3744
+ *
3745
+ * @param bool $store Flush to Database if true.
3746
+ *
3747
+ * @author Vova Feldman (@svovaf)
3748
+ * @since 1.0.9
3749
+ */
3750
+ private function _delete_plans( $store = true ) {
3751
+ $this->_logger->entrance();
3752
+
3753
+ $plans = self::get_all_plans();
3754
+
3755
+ unset( $plans[ $this->_slug ] );
3756
+
3757
+ self::$_accounts->set_option( 'plans', $plans, $store );
3758
+ }
3759
+
3760
+ /**
3761
+ * Delete all plugin licenses.
3762
+ *
3763
+ * @author Vova Feldman (@svovaf)
3764
+ * @since 1.0.9
3765
+ *
3766
+ * @param bool $store
3767
+ * @param string|bool $plugin_slug
3768
+ */
3769
+ private function _delete_licenses( $store = true, $plugin_slug = false ) {
3770
+ $this->_logger->entrance();
3771
+
3772
+ $all_licenses = self::get_all_licenses();
3773
+
3774
+ if ( ! is_string( $plugin_slug ) ) {
3775
+ $plugin_slug = $this->_slug;
3776
+ }
3777
+
3778
+ unset( $all_licenses[ $plugin_slug ] );
3779
+
3780
+ self::$_accounts->set_option( 'licenses', $all_licenses, $store );
3781
+ }
3782
+
3783
+ /**
3784
+ * Check if Freemius was added on new plugin installation.
3785
+ *
3786
+ * @author Vova Feldman (@svovaf)
3787
+ * @since 1.1.5
3788
+ *
3789
+ * @return bool
3790
+ */
3791
+ function is_plugin_new_install() {
3792
+ return isset( $this->_storage->is_plugin_new_install ) &&
3793
+ $this->_storage->is_plugin_new_install;
3794
+ }
3795
+
3796
+ /**
3797
+ * Check if it's the first plugin release that is running Freemius.
3798
+ *
3799
+ * @author Vova Feldman (@svovaf)
3800
+ * @since 1.2.1.5
3801
+ *
3802
+ * @return bool
3803
+ */
3804
+ function is_first_freemius_powered_version() {
3805
+ return empty( $this->_storage->plugin_last_version );
3806
+ }
3807
+
3808
+ /**
3809
+ * Plugin activated hook.
3810
+ *
3811
+ * @author Vova Feldman (@svovaf)
3812
+ * @since 1.0.1
3813
+ *
3814
+ * @uses FS_Api
3815
+ */
3816
+ function _activate_plugin_event_hook() {
3817
+ $this->_logger->entrance( 'slug = ' . $this->_slug );
3818
+
3819
+ if ( ! current_user_can( 'activate_plugins' ) ) {
3820
+ return;
3821
+ }
3822
+
3823
+ $this->unregister_uninstall_hook();
3824
+
3825
+ // Clear API cache on activation.
3826
+ FS_Api::clear_cache();
3827
+
3828
+ if ( $this->is_registered() ) {
3829
+ $is_premium_version_activation = ( current_filter() !== ( 'activate_' . $this->_free_plugin_basename ) );
3830
+
3831
+ if ( $is_premium_version_activation ) {
3832
+ $this->reconnect_locally();
3833
+ }
3834
+
3835
+ $this->_logger->info( 'Activating ' . ( $is_premium_version_activation ? 'premium' : 'free' ) . ' plugin version.' );
3836
+
3837
+ // Schedule re-activation event and sync.
3838
+ // $this->sync_install( array(), true );
3839
+ $this->schedule_install_sync();
3840
+
3841
+ // 1. If running in the activation of the FREE module, get the basename of the PREMIUM.
3842
+ // 2. If running in the activation of the PREMIUM module, get the basename of the FREE.
3843
+ $other_version_basename = $is_premium_version_activation ?
3844
+ $this->_free_plugin_basename :
3845
+ $this->premium_plugin_basename();
3846
+
3847
+ /**
3848
+ * If the other module version is activate, deactivate it.
3849
+ *
3850
+ * @author Leo Fajardo (@leorw)
3851
+ * @since 1.2.2
3852
+ */
3853
+ if ( is_plugin_active( $other_version_basename ) ) {
3854
+ deactivate_plugins( $other_version_basename );
3855
+ }
3856
+
3857
+ // If activating the premium module version, add an admin notice to congratulate for an upgrade completion.
3858
+ if ( $is_premium_version_activation ) {
3859
+ $this->_admin_notices->add(
3860
+ sprintf( __fs( 'successful-version-upgrade-message', $this->_slug ), sprintf( '<b>%s</b>', $this->_plugin->title ) ),
3861
+ __fs( 'woot', $this->_slug ) . '!'
3862
+ );
3863
+ }
3864
+ } else if ( $this->is_anonymous() ) {
3865
+ /**
3866
+ * Reset "skipped" click cache on the following:
3867
+ * 1. Development mode.
3868
+ * 2. If the user skipped the exact same version before.
3869
+ *
3870
+ * @todo 3. If explicitly asked to retry after every activation.
3871
+ */
3872
+ if ( WP_FS__DEV_MODE ||
3873
+ $this->get_plugin_version() == $this->_storage->is_anonymous['version']
3874
+ ) {
3875
+ $this->reset_anonymous_mode();
3876
+ }
3877
+ }
3878
+
3879
+ if ( ! isset( $this->_storage->is_plugin_new_install ) ) {
3880
+ /**
3881
+ * If no previous version of plugin's version exist, it means that it's either
3882
+ * the first time that the plugin installed on the site, or the plugin was installed
3883
+ * before but didn't have Freemius integrated.
3884
+ *
3885
+ * Since register_activation_hook() do NOT fires on updates since 3.1, and only fires
3886
+ * on manual activation via the dashboard, is_plugin_activation() is TRUE
3887
+ * only after immediate activation.
3888
+ *
3889
+ * @since 1.1.4
3890
+ * @link https://make.wordpress.org/core/2010/10/27/plugin-activation-hooks-no-longer-fire-for-updates/
3891
+ */
3892
+ $this->_storage->is_plugin_new_install = empty( $this->_storage->plugin_last_version );
3893
+ }
3894
+
3895
+ if ( ! $this->_anonymous_mode && $this->has_api_connectivity( WP_FS__DEV_MODE ) ) {
3896
+ // Store hint that the plugin was just activated to enable auto-redirection to settings.
3897
+ add_option( "fs_{$this->_slug}_activated", true );
3898
+ }
3899
+
3900
+ /**
3901
+ * Activation hook is executed after the plugin's main file is loaded, therefore,
3902
+ * after the plugin was loaded. The logic is located at activate_plugin()
3903
+ * ./wp-admin/includes/plugin.php.
3904
+ *
3905
+ * @author Vova Feldman (@svovaf)
3906
+ * @since 1.1.9
3907
+ */
3908
+ $this->_storage->was_plugin_loaded = true;
3909
+ }
3910
+
3911
+ /**
3912
+ * Delete account.
3913
+ *
3914
+ * @author Vova Feldman (@svovaf)
3915
+ * @since 1.0.3
3916
+ *
3917
+ * @param bool $check_user Enforce checking if user have plugins activation privileges.
3918
+ */
3919
+ function delete_account_event( $check_user = true ) {
3920
+ $this->_logger->entrance( 'slug = ' . $this->_slug );
3921
+
3922
+ if ( $check_user && ! current_user_can( 'activate_plugins' ) ) {
3923
+ return;
3924
+ }
3925
+
3926
+ $this->do_action( 'before_account_delete' );
3927
+
3928
+ // Clear all admin notices.
3929
+ $this->_admin_notices->clear_all_sticky();
3930
+
3931
+ $this->_delete_site( false );
3932
+
3933
+ $this->_delete_plans( false );
3934
+
3935
+ $this->_delete_licenses( false );
3936
+
3937
+ // Delete add-ons related to plugin's account.
3938
+ $this->_delete_account_addons( false );
3939
+
3940
+ // @todo Delete plans and licenses of add-ons.
3941
+
3942
+ self::$_accounts->store();
3943
+
3944
+ /**
3945
+ * IMPORTANT:
3946
+ * Clear crons must be executed before clearing all storage.
3947
+ * Otherwise, the cron will not be cleared.
3948
+ */
3949
+ $this->clear_sync_cron();
3950
+ $this->clear_install_sync_cron();
3951
+
3952
+ // Clear all storage data.
3953
+ $this->_storage->clear_all( true, array(
3954
+ 'connectivity_test',
3955
+ 'is_on',
3956
+ ) );
3957
+
3958
+ // Send delete event.
3959
+ $this->get_api_site_scope()->call( '/', 'delete' );
3960
+
3961
+ $this->do_action( 'after_account_delete' );
3962
+ }
3963
+
3964
+ /**
3965
+ * Plugin deactivation hook.
3966
+ *
3967
+ * @author Vova Feldman (@svovaf)
3968
+ * @since 1.0.1
3969
+ */
3970
+ function _deactivate_plugin_hook() {
3971
+ $this->_logger->entrance( 'slug = ' . $this->_slug );
3972
+
3973
+ if ( ! current_user_can( 'activate_plugins' ) ) {
3974
+ return;
3975
+ }
3976
+
3977
+ $this->_admin_notices->clear_all_sticky();
3978
+ if ( isset( $this->_storage->sticky_optin_added ) ) {
3979
+ unset( $this->_storage->sticky_optin_added );
3980
+ }
3981
+
3982
+ if ( ! isset( $this->_storage->is_plugin_new_install ) ) {
3983
+ // Remember that plugin was already installed.
3984
+ $this->_storage->is_plugin_new_install = false;
3985
+ }
3986
+
3987
+ // Hook to plugin uninstall.
3988
+ register_uninstall_hook( $this->_plugin_main_file_path, array( 'Freemius', '_uninstall_plugin_hook' ) );
3989
+
3990
+ $this->clear_module_main_file_cache();
3991
+ $this->clear_sync_cron();
3992
+ $this->clear_install_sync_cron();
3993
+
3994
+ if ( $this->is_registered() ) {
3995
+ // Send deactivation event.
3996
+ $this->sync_install( array(
3997
+ 'is_active' => false,
3998
+ ) );
3999
+ } else {
4000
+ if ( ! $this->has_api_connectivity() ) {
4001
+ // Reset connectivity test cache.
4002
+ unset( $this->_storage->connectivity_test );
4003
+ }
4004
+ }
4005
+
4006
+ // Clear API cache on deactivation.
4007
+ FS_Api::clear_cache();
4008
+
4009
+ $this->remove_sdk_reference();
4010
+ }
4011
+
4012
+ /**
4013
+ * @author Vova Feldman (@svovaf)
4014
+ * @since 1.1.6
4015
+ */
4016
+ private function remove_sdk_reference() {
4017
+ global $fs_active_plugins;
4018
+
4019
+ foreach ( $fs_active_plugins->plugins as $sdk_path => &$data ) {
4020
+ if ( $this->_plugin_basename == $data->plugin_path ) {
4021
+ unset( $fs_active_plugins->plugins[ $sdk_path ] );
4022
+ break;
4023
+ }
4024
+ }
4025
+
4026
+ fs_fallback_to_newest_active_sdk();
4027
+ }
4028
+
4029
+ /**
4030
+ * @author Vova Feldman (@svovaf)
4031
+ * @since 1.1.3
4032
+ *
4033
+ * @param bool $is_anonymous
4034
+ */
4035
+ private function set_anonymous_mode( $is_anonymous = true ) {
4036
+ // Store information regarding skip to try and opt-in the user
4037
+ // again in the future.
4038
+ $this->_storage->is_anonymous = array(
4039
+ 'is' => $is_anonymous,
4040
+ 'timestamp' => WP_FS__SCRIPT_START_TIME,
4041
+ 'version' => $this->get_plugin_version(),
4042
+ );
4043
+
4044
+ // Update anonymous mode cache.
4045
+ $this->_is_anonymous = $is_anonymous;
4046
+ }
4047
+
4048
+ /**
4049
+ * @author Vova Feldman (@svovaf)
4050
+ * @since 1.1.3
4051
+ */
4052
+ private function reset_anonymous_mode() {
4053
+ unset( $this->_storage->is_anonymous );
4054
+ }
4055
+
4056
+ /**
4057
+ * Clears the anonymous mode and redirects to the opt-in screen.
4058
+ *
4059
+ * @author Vova Feldman (@svovaf)
4060
+ * @since 1.1.7
4061
+ */
4062
+ function connect_again() {
4063
+ if ( ! $this->is_anonymous() ) {
4064
+ return;
4065
+ }
4066
+
4067
+ $this->reset_anonymous_mode();
4068
+
4069
+ fs_redirect( $this->get_activation_url() );
4070
+ }
4071
+
4072
+ /**
4073
+ * Skip account connect, and set anonymous mode.
4074
+ *
4075
+ * @author Vova Feldman (@svovaf)
4076
+ * @since 1.1.1
4077
+ */
4078
+ private function skip_connection() {
4079
+ $this->_logger->entrance();
4080
+
4081
+ $this->_admin_notices->remove_sticky( 'connect_account' );
4082
+
4083
+ $this->set_anonymous_mode();
4084
+
4085
+ // Send anonymous skip event.
4086
+ // No user identified info nor any tracking will be sent after the user skips the opt-in.
4087
+ $this->get_api_plugin_scope()->call( 'skip.json', 'put', array(
4088
+ 'uid' => $this->get_anonymous_id(),
4089
+ ) );
4090
+ }
4091
+
4092
+ /**
4093
+ * Plugin version update hook.
4094
+ *
4095
+ * @author Vova Feldman (@svovaf)
4096
+ * @since 1.0.4
4097
+ */
4098
+ private function update_plugin_version_event() {
4099
+ $this->_logger->entrance();
4100
+
4101
+ if ( ! $this->is_registered() ) {
4102
+ return;
4103
+ }
4104
+
4105
+ $this->schedule_install_sync();
4106
+ // $this->sync_install( array(), true );
4107
+ }
4108
+
4109
+ /**
4110
+ * Return a list of modified plugins since the last sync.
4111
+ *
4112
+ * Note:
4113
+ * There's no point to store a plugins counter since even if the number of
4114
+ * plugins didn't change, we still need to check if the versions are all the
4115
+ * same and the activity state is similar.
4116
+ *
4117
+ * @author Vova Feldman (@svovaf)
4118
+ * @since 1.1.8
4119
+ *
4120
+ * @return array|false
4121
+ */
4122
+ private function get_plugins_data_for_api() {
4123
+ // Alias.
4124
+ $option_name = 'all_plugins';
4125
+
4126
+ $all_cached_plugins = self::$_accounts->get_option( $option_name );
4127
+
4128
+ if ( ! is_object( $all_cached_plugins ) ) {
4129
+ $all_cached_plugins = (object) array(
4130
+ 'timestamp' => '',
4131
+ 'md5' => '',
4132
+ 'plugins' => array(),
4133
+ );
4134
+ }
4135
+
4136
+ $time = time();
4137
+
4138
+ if ( ! empty( $all_cached_plugins->timestamp ) &&
4139
+ ( $time - $all_cached_plugins->timestamp ) < WP_FS__TIME_5_MIN_IN_SEC
4140
+ ) {
4141
+ // Don't send plugin updates if last update was in the past 5 min.
4142
+ return false;
4143
+ }
4144
+
4145
+ // Write timestamp to lock the logic.
4146
+ $all_cached_plugins->timestamp = $time;
4147
+ self::$_accounts->set_option( $option_name, $all_cached_plugins, true );
4148
+
4149
+ // Reload options from DB.
4150
+ self::$_accounts->load( true );
4151
+ $all_cached_plugins = self::$_accounts->get_option( $option_name );
4152
+
4153
+ if ( $time != $all_cached_plugins->timestamp ) {
4154
+ // If timestamp is different, then another thread captured the lock.
4155
+ return false;
4156
+ }
4157
+
4158
+ // Check if there's a change in plugins.
4159
+ $all_plugins = self::get_all_plugins();
4160
+
4161
+ // Check if plugins changed.
4162
+ ksort( $all_plugins );
4163
+
4164
+ $plugins_signature = '';
4165
+ foreach ( $all_plugins as $basename => $data ) {
4166
+ $plugins_signature .= $data['slug'] . ',' .
4167
+ $data['Version'] . ',' .
4168
+ ( $data['is_active'] ? '1' : '0' ) . ';';
4169
+ }
4170
+
4171
+ // Check if plugins status changed (version or active/inactive).
4172
+ $plugins_changed = ( $all_cached_plugins->md5 !== md5( $plugins_signature ) );
4173
+
4174
+ $plugins_update_data = array();
4175
+
4176
+ if ( $plugins_changed ) {
4177
+ // Change in plugins, report changes.
4178
+
4179
+ // Update existing plugins info.
4180
+ foreach ( $all_cached_plugins->plugins as $basename => $data ) {
4181
+ if ( ! isset( $all_plugins[ $basename ] ) ) {
4182
+ // Plugin uninstalled.
4183
+ $uninstalled_plugin_data = $data;
4184
+ $uninstalled_plugin_data['is_active'] = false;
4185
+ $uninstalled_plugin_data['is_uninstalled'] = true;
4186
+ $plugins_update_data[] = $uninstalled_plugin_data;
4187
+
4188
+ unset( $all_plugins[ $basename ] );
4189
+ unset( $all_cached_plugins->plugins[ $basename ] );
4190
+ } else if ( $data['is_active'] !== $all_plugins[ $basename ]['is_active'] ||
4191
+ $data['version'] !== $all_plugins[ $basename ]['Version']
4192
+ ) {
4193
+ // Plugin activated or deactivated, or version changed.
4194
+ $all_cached_plugins->plugins[ $basename ]['is_active'] = $all_plugins[ $basename ]['is_active'];
4195
+ $all_cached_plugins->plugins[ $basename ]['version'] = $all_plugins[ $basename ]['Version'];
4196
+
4197
+ $plugins_update_data[] = $all_cached_plugins->plugins[ $basename ];
4198
+ }
4199
+ }
4200
+
4201
+ // Find new plugins that weren't yet seen before.
4202
+ foreach ( $all_plugins as $basename => $data ) {
4203
+ if ( ! isset( $all_cached_plugins->plugins[ $basename ] ) ) {
4204
+ // New plugin.
4205
+ $new_plugin = array(
4206
+ 'slug' => $data['slug'],
4207
+ 'version' => $data['Version'],
4208
+ 'title' => $data['Name'],
4209
+ 'is_active' => $data['is_active'],
4210
+ 'is_uninstalled' => false,
4211
+ );
4212
+
4213
+ $plugins_update_data[] = $new_plugin;
4214
+ $all_cached_plugins->plugins[ $basename ] = $new_plugin;
4215
+ }
4216
+ }
4217
+
4218
+ $all_cached_plugins->md5 = md5( $plugins_signature );
4219
+ $all_cached_plugins->timestamp = $time;
4220
+ self::$_accounts->set_option( $option_name, $all_cached_plugins, true );
4221
+ }
4222
+
4223
+ return $plugins_update_data;
4224
+ }
4225
+
4226
+ /**
4227
+ * Return a list of modified themes since the last sync.
4228
+ *
4229
+ * Note:
4230
+ * There's no point to store a themes counter since even if the number of
4231
+ * themes didn't change, we still need to check if the versions are all the
4232
+ * same and the activity state is similar.
4233
+ *
4234
+ * @author Vova Feldman (@svovaf)
4235
+ * @since 1.1.8
4236
+ *
4237
+ * @return array|false
4238
+ */
4239
+ private function get_themes_data_for_api() {
4240
+ // Alias.
4241
+ $option_name = 'all_themes';
4242
+
4243
+ $all_cached_themes = self::$_accounts->get_option( $option_name );
4244
+
4245
+ if ( ! is_object( $all_cached_themes ) ) {
4246
+ $all_cached_themes = (object) array(
4247
+ 'timestamp' => '',
4248
+ 'md5' => '',
4249
+ 'themes' => array(),
4250
+ );
4251
+ }
4252
+
4253
+ $time = time();
4254
+
4255
+ if ( ! empty( $all_cached_themes->timestamp ) &&
4256
+ ( $time - $all_cached_themes->timestamp ) < WP_FS__TIME_5_MIN_IN_SEC
4257
+ ) {
4258
+ // Don't send theme updates if last update was in the past 5 min.
4259
+ return false;
4260
+ }
4261
+
4262
+ // Write timestamp to lock the logic.
4263
+ $all_cached_themes->timestamp = $time;
4264
+ self::$_accounts->set_option( $option_name, $all_cached_themes, true );
4265
+
4266
+ // Reload options from DB.
4267
+ self::$_accounts->load( true );
4268
+ $all_cached_themes = self::$_accounts->get_option( $option_name );
4269
+
4270
+ if ( $time != $all_cached_themes->timestamp ) {
4271
+ // If timestamp is different, then another thread captured the lock.
4272
+ return false;
4273
+ }
4274
+
4275
+ // Get active theme.
4276
+ $active_theme = wp_get_theme();
4277
+ $active_theme_stylesheet = $active_theme->get_stylesheet();
4278
+
4279
+ // Check if there's a change in themes.
4280
+ $all_themes = wp_get_themes();
4281
+
4282
+ // Check if themes changed.
4283
+ ksort( $all_themes );
4284
+
4285
+ $themes_signature = '';
4286
+ foreach ( $all_themes as $slug => $data ) {
4287
+ $is_active = ( $slug === $active_theme_stylesheet );
4288
+ $themes_signature .= $slug . ',' .
4289
+ $data->version . ',' .
4290
+ ( $is_active ? '1' : '0' ) . ';';
4291
+ }
4292
+
4293
+ // Check if themes status changed (version or active/inactive).
4294
+ $themes_changed = ( $all_cached_themes->md5 !== md5( $themes_signature ) );
4295
+
4296
+ $themes_update_data = array();
4297
+
4298
+ if ( $themes_changed ) {
4299
+ // Change in themes, report changes.
4300
+
4301
+ // Update existing themes info.
4302
+ foreach ( $all_cached_themes->themes as $slug => $data ) {
4303
+ $is_active = ( $slug === $active_theme_stylesheet );
4304
+
4305
+ if ( ! isset( $all_themes[ $slug ] ) ) {
4306
+ // Plugin uninstalled.
4307
+ $uninstalled_theme_data = $data;
4308
+ $uninstalled_theme_data['is_active'] = false;
4309
+ $uninstalled_theme_data['is_uninstalled'] = true;
4310
+ $themes_update_data[] = $uninstalled_theme_data;
4311
+
4312
+ unset( $all_themes[ $slug ] );
4313
+ unset( $all_cached_themes->themes[ $slug ] );
4314
+ } else if ( $data['is_active'] !== $is_active ||
4315
+ $data['version'] !== $all_themes[ $slug ]->version
4316
+ ) {
4317
+ // Plugin activated or deactivated, or version changed.
4318
+
4319
+ $all_cached_themes->themes[ $slug ]['is_active'] = $is_active;
4320
+ $all_cached_themes->themes[ $slug ]['version'] = $all_themes[ $slug ]->version;
4321
+
4322
+ $themes_update_data[] = $all_cached_themes->themes[ $slug ];
4323
+ }
4324
+ }
4325
+
4326
+ // Find new themes that weren't yet seen before.
4327
+ foreach ( $all_themes as $slug => $data ) {
4328
+ if ( ! isset( $all_cached_themes->themes[ $slug ] ) ) {
4329
+ $is_active = ( $slug === $active_theme_stylesheet );
4330
+
4331
+ // New plugin.
4332
+ $new_plugin = array(
4333
+ 'slug' => $slug,
4334
+ 'version' => $data->version,
4335
+ 'title' => $data->name,
4336
+ 'is_active' => $is_active,
4337
+ 'is_uninstalled' => false,
4338
+ );
4339
+
4340
+ $themes_update_data[] = $new_plugin;
4341
+ $all_cached_themes->themes[ $slug ] = $new_plugin;
4342
+ }
4343
+ }
4344
+
4345
+ $all_cached_themes->md5 = md5( $themes_signature );
4346
+ $all_cached_themes->timestamp = time();
4347
+ self::$_accounts->set_option( $option_name, $all_cached_themes, true );
4348
+ }
4349
+
4350
+ return $themes_update_data;
4351
+ }
4352
+
4353
+ /**
4354
+ * Update install details.
4355
+ *
4356
+ * @author Vova Feldman (@svovaf)
4357
+ * @since 1.1.2
4358
+ *
4359
+ * @param string[] string $override
4360
+ * @param bool $include_plugins Since 1.1.8 by default include plugin changes.
4361
+ * @param bool $include_themes Since 1.1.8 by default include plugin changes.
4362
+ *
4363
+ * @return array
4364
+ */
4365
+ private function get_install_data_for_api(
4366
+ array $override,
4367
+ $include_plugins = true,
4368
+ $include_themes = true
4369
+ ) {
4370
+ /**
4371
+ * @since 1.1.8 Also send plugin updates.
4372
+ */
4373
+ if ( $include_plugins && ! isset( $override['plugins'] ) ) {
4374
+ $plugins = $this->get_plugins_data_for_api();
4375
+ if ( ! empty( $plugins ) ) {
4376
+ $override['plugins'] = $plugins;
4377
+ }
4378
+ }
4379
+ /**
4380
+ * @since 1.1.8 Also send themes updates.
4381
+ */
4382
+ if ( $include_themes && ! isset( $override['themes'] ) ) {
4383
+ $themes = $this->get_themes_data_for_api();
4384
+ if ( ! empty( $themes ) ) {
4385
+ $override['themes'] = $themes;
4386
+ }
4387
+ }
4388
+
4389
+ return array_merge( array(
4390
+ 'version' => $this->get_plugin_version(),
4391
+ 'is_premium' => $this->is_premium(),
4392
+ 'language' => get_bloginfo( 'language' ),
4393
+ 'charset' => get_bloginfo( 'charset' ),
4394
+ 'platform_version' => get_bloginfo( 'version' ),
4395
+ 'sdk_version' => $this->version,
4396
+ 'programming_language_version' => phpversion(),
4397
+ 'title' => get_bloginfo( 'name' ),
4398
+ 'url' => get_site_url(),
4399
+ // Special params.
4400
+ 'is_active' => true,
4401
+ 'is_disconnected' => $this->is_tracking_prohibited(),
4402
+ 'is_uninstalled' => false,
4403
+ ), $override );
4404
+ }
4405
+
4406
+ /**
4407
+ * Update install only if changed.
4408
+ *
4409
+ * @author Vova Feldman (@svovaf)
4410
+ * @since 1.0.9
4411
+ *
4412
+ * @param string[] string $override
4413
+ * @param bool $flush
4414
+ *
4415
+ * @return false|object|string
4416
+ */
4417
+ private function send_install_update( $override = array(), $flush = false ) {
4418
+ $this->_logger->entrance();
4419
+
4420
+ $check_properties = $this->get_install_data_for_api( $override );
4421
+
4422
+ if ( $flush ) {
4423
+ $params = $check_properties;
4424
+ } else {
4425
+ $params = array();
4426
+ $special = array();
4427
+ $special_override = false;
4428
+
4429
+ foreach ( $check_properties as $p => $v ) {
4430
+ if ( property_exists( $this->_site, $p ) ) {
4431
+ if ( ( is_bool( $this->_site->{$p} ) || ! empty( $this->_site->{$p} ) ) &&
4432
+ $this->_site->{$p} != $v
4433
+ ) {
4434
+ $this->_site->{$p} = $v;
4435
+ $params[ $p ] = $v;
4436
+ }
4437
+ } else {
4438
+ $special[ $p ] = $v;
4439
+
4440
+ if ( isset( $override[ $p ] ) ||
4441
+ 'plugins' === $p ||
4442
+ 'themes' === $p
4443
+ ) {
4444
+ $special_override = true;
4445
+ }
4446
+ }
4447
+ }
4448
+
4449
+ if ( $special_override || 0 < count( $params ) ) {
4450
+ // Add special params only if has at least one
4451
+ // standard param, or if explicitly requested to
4452
+ // override a special param or a param which is not exist
4453
+ // in the install object.
4454
+ $params = array_merge( $params, $special );
4455
+ }
4456
+ }
4457
+
4458
+ if ( 0 < count( $params ) ) {
4459
+ // Update last install sync timestamp.
4460
+ $this->_storage->install_sync_timestamp = time();
4461
+
4462
+ $params['uid'] = $this->get_anonymous_id();
4463
+
4464
+ // Send updated values to FS.
4465
+ $site = $this->get_api_site_scope()->call( '/', 'put', $params );
4466
+
4467
+ if ( $this->is_api_result_entity( $site ) ) {
4468
+ // I successfully sent install update, clear scheduled sync if exist.
4469
+ $this->clear_install_sync_cron();
4470
+ }
4471
+
4472
+ return $site;
4473
+ }
4474
+
4475
+ return false;
4476
+ }
4477
+
4478
+ /**
4479
+ * Update install only if changed.
4480
+ *
4481
+ * @author Vova Feldman (@svovaf)
4482
+ * @since 1.0.9
4483
+ *
4484
+ * @param string[] string $override
4485
+ * @param bool $flush
4486
+ */
4487
+ private function sync_install( $override = array(), $flush = false ) {
4488
+ $this->_logger->entrance();
4489
+
4490
+ $site = $this->send_install_update( $override, $flush );
4491
+
4492
+ if ( false === $site ) {
4493
+ // No sync required.
4494
+ return;
4495
+ }
4496
+
4497
+ if ( ! $this->is_api_result_entity( $site ) ) {
4498
+ // Failed to sync, don't update locally.
4499
+ return;
4500
+ }
4501
+
4502
+ $plan = $this->get_plan();
4503
+ $this->_site = new FS_Site( $site );
4504
+ $this->_site->plan = $plan;
4505
+
4506
+ $this->_store_site( true );
4507
+ }
4508
+
4509
+ /**
4510
+ * Track install's custom event.
4511
+ *
4512
+ * IMPORTANT:
4513
+ * Custom event tracking is currently only supported for specific clients.
4514
+ * If you are not one of them, please don't use this method. If you will,
4515
+ * the API will simply ignore your request based on the plugin ID.
4516
+ *
4517
+ * Need custom tracking for your plugin or theme?
4518
+ * If you are interested in custom event tracking please contact yo@freemius.com
4519
+ * for further details.
4520
+ *
4521
+ * @author Vova Feldman (@svovaf)
4522
+ * @since 1.2.1
4523
+ *
4524
+ * @param string $name Event name.
4525
+ * @param array $properties Associative key/value array with primitive values only
4526
+ * @param bool $process_at A valid future date-time in the following format Y-m-d H:i:s.
4527
+ * @param bool $once If true, event will be tracked only once. IMPORTANT: Still trigger the API call.
4528
+ *
4529
+ * @return object|false Event data or FALSE on failure.
4530
+ *
4531
+ * @throws \Freemius_InvalidArgumentException
4532
+ */
4533
+ public function track_event( $name, $properties = array(), $process_at = false, $once = false ) {
4534
+ $this->_logger->entrance( http_build_query( array( 'name' => $name, 'once' => $once ) ) );
4535
+
4536
+ if ( ! $this->is_registered() ) {
4537
+ return false;
4538
+ }
4539
+
4540
+ $event = array( 'type' => $name );
4541
+
4542
+ if ( is_numeric( $process_at ) && $process_at > time() ) {
4543
+ $event['process_at'] = $process_at;
4544
+ }
4545
+
4546
+ if ( $once ) {
4547
+ $event['once'] = true;
4548
+ }
4549
+
4550
+ if ( ! empty( $properties ) ) {
4551
+ // Verify associative array values are primitive.
4552
+ foreach ( $properties as $k => $v ) {
4553
+ if ( ! is_scalar( $v ) ) {
4554
+ throw new Freemius_InvalidArgumentException( 'The $properties argument must be an associative key/value array with primitive values only.' );
4555
+ }
4556
+ }
4557
+
4558
+ $event['properties'] = $properties;
4559
+ }
4560
+
4561
+ $result = $this->get_api_site_scope()->call( 'events.json', 'post', $event );
4562
+
4563
+ return $this->is_api_error( $result ) ?
4564
+ false :
4565
+ $result;
4566
+ }
4567
+
4568
+ /**
4569
+ * Track install's custom event only once, but it still triggers the API call.
4570
+ *
4571
+ * IMPORTANT:
4572
+ * Custom event tracking is currently only supported for specific clients.
4573
+ * If you are not one of them, please don't use this method. If you will,
4574
+ * the API will simply ignore your request based on the plugin ID.
4575
+ *
4576
+ * Need custom tracking for your plugin or theme?
4577
+ * If you are interested in custom event tracking please contact yo@freemius.com
4578
+ * for further details.
4579
+ *
4580
+ * @author Vova Feldman (@svovaf)
4581
+ * @since 1.2.1
4582
+ *
4583
+ * @param string $name Event name.
4584
+ * @param array $properties Associative key/value array with primitive values only
4585
+ * @param bool $process_at A valid future date-time in the following format Y-m-d H:i:s.
4586
+ *
4587
+ * @return object|false Event data or FALSE on failure.
4588
+ *
4589
+ * @throws \Freemius_InvalidArgumentException
4590
+ *
4591
+ * @user Freemius::track_event()
4592
+ */
4593
+ public function track_event_once( $name, $properties = array(), $process_at = false ) {
4594
+ return $this->track_event( $name, $properties, $process_at, true );
4595
+ }
4596
+
4597
+ /**
4598
+ * Plugin uninstall hook.
4599
+ *
4600
+ * @author Vova Feldman (@svovaf)
4601
+ * @since 1.0.1
4602
+ *
4603
+ * @param bool $check_user Enforce checking if user have plugins activation privileges.
4604
+ */
4605
+ function _uninstall_plugin_event( $check_user = true ) {
4606
+ $this->_logger->entrance( 'slug = ' . $this->_slug );
4607
+
4608
+ if ( $check_user && ! current_user_can( 'activate_plugins' ) ) {
4609
+ return;
4610
+ }
4611
+
4612
+ $params = array();
4613
+ $uninstall_reason = null;
4614
+ if ( isset( $this->_storage->uninstall_reason ) ) {
4615
+ $uninstall_reason = $this->_storage->uninstall_reason;
4616
+ $params['reason_id'] = $uninstall_reason->id;
4617
+ $params['reason_info'] = $uninstall_reason->info;
4618
+ }
4619
+
4620
+ if ( ! $this->is_registered() ) {
4621
+ // Send anonymous uninstall event only if user submitted a feedback.
4622
+ if ( isset( $uninstall_reason ) ) {
4623
+ if ( isset( $uninstall_reason->is_anonymous ) && ! $uninstall_reason->is_anonymous ) {
4624
+ $this->opt_in( false, false, false, false, true );
4625
+ } else {
4626
+ $params['uid'] = $this->get_anonymous_id();
4627
+ $this->get_api_plugin_scope()->call( 'uninstall.json', 'put', $params );
4628
+ }
4629
+ }
4630
+ } else {
4631
+ // Send uninstall event.
4632
+ $this->send_install_update( array_merge( $params, array(
4633
+ 'is_active' => false,
4634
+ 'is_uninstalled' => true,
4635
+ ) ) );
4636
+ }
4637
+
4638
+ // @todo Decide if we want to delete plugin information from db.
4639
+ }
4640
+
4641
+ /**
4642
+ * @author Vova Feldman (@svovaf)
4643
+ * @since 1.1.1
4644
+ *
4645
+ * @return string
4646
+ */
4647
+ private function premium_plugin_basename() {
4648
+ return preg_replace( '/\//', '-premium/', $this->_free_plugin_basename, 1 );
4649
+ }
4650
+
4651
+ /**
4652
+ * Uninstall plugin hook. Called only when connected his account with Freemius for active sites tracking.
4653
+ *
4654
+ * @author Vova Feldman (@svovaf)
4655
+ * @since 1.0.2
4656
+ */
4657
+ public static function _uninstall_plugin_hook() {
4658
+ self::_load_required_static();
4659
+
4660
+ self::$_static_logger->entrance();
4661
+
4662
+ if ( ! current_user_can( 'activate_plugins' ) ) {
4663
+ return;
4664
+ }
4665
+
4666
+ $plugin_file = substr( current_filter(), strlen( 'uninstall_' ) );
4667
+
4668
+ self::$_static_logger->info( 'plugin = ' . $plugin_file );
4669
+
4670
+ define( 'WP_FS__UNINSTALL_MODE', true );
4671
+
4672
+ $fs = self::get_instance_by_file( $plugin_file );
4673
+
4674
+ if ( is_object( $fs ) ) {
4675
+ self::require_plugin_essentials();
4676
+
4677
+ if ( is_plugin_active( $fs->_free_plugin_basename ) ||
4678
+ is_plugin_active( $fs->premium_plugin_basename() )
4679
+ ) {
4680
+ // Deleting Free or Premium plugin version while the other version still installed.
4681
+ return;
4682
+ }
4683
+
4684
+ $fs->_uninstall_plugin_event();
4685
+
4686
+ $fs->do_action( 'after_uninstall' );
4687
+ }
4688
+ }
4689
+
4690
+ #----------------------------------------------------------------------------------
4691
+ #region Plugin Information
4692
+ #----------------------------------------------------------------------------------
4693
+
4694
+ /**
4695
+ * Load WordPress core plugin.php essential module.
4696
+ *
4697
+ * @author Vova Feldman (@svovaf)
4698
+ * @since 1.1.1
4699
+ */
4700
+ private static function require_plugin_essentials() {
4701
+ if ( ! function_exists( 'get_plugins' ) ) {
4702
+ self::$_static_logger->log( 'Including wp-admin/includes/plugin.php...' );
4703
+
4704
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
4705
+ }
4706
+ }
4707
+
4708
+ /**
4709
+ * Load WordPress core pluggable.php module.
4710
+ *
4711
+ * @author Vova Feldman (@svovaf)
4712
+ * @since 1.1.2
4713
+ */
4714
+ private static function require_pluggable_essentials() {
4715
+ if ( ! function_exists( 'wp_get_current_user' ) ) {
4716
+ require_once ABSPATH . 'wp-includes/pluggable.php';
4717
+ }
4718
+ }
4719
+
4720
+ /**
4721
+ * Return plugin data.
4722
+ *
4723
+ * @author Vova Feldman (@svovaf)
4724
+ * @since 1.0.1
4725
+ *
4726
+ * @return array
4727
+ */
4728
+ function get_plugin_data() {
4729
+ if ( ! isset( $this->_plugin_data ) ) {
4730
+ self::require_plugin_essentials();
4731
+
4732
+ /**
4733
+ * @author Vova Feldman (@svovaf)
4734
+ * @since 1.2.0 When using get_plugin_data() do NOT translate plugin data.
4735
+ *
4736
+ * @link https://github.com/Freemius/wordpress-sdk/issues/77
4737
+ */
4738
+ $this->_plugin_data = get_plugin_data(
4739
+ $this->_plugin_main_file_path,
4740
+ false,
4741
+ false
4742
+ );
4743
+ }
4744
+
4745
+ return $this->_plugin_data;
4746
+ }
4747
+
4748
+ /**
4749
+ * @author Vova Feldman (@svovaf)
4750
+ * @since 1.0.1
4751
+ *
4752
+ * @return string Plugin slug.
4753
+ */
4754
+ function get_slug() {
4755
+ return $this->_slug;
4756
+ }
4757
+
4758
+ /**
4759
+ * @author Vova Feldman (@svovaf)
4760
+ * @since 1.0.1
4761
+ *
4762
+ * @return number Plugin ID.
4763
+ */
4764
+ function get_id() {
4765
+ return $this->_plugin->id;
4766
+ }
4767
+
4768
+ /**
4769
+ * @author Vova Feldman (@svovaf)
4770
+ * @since 1.2.1.5
4771
+ *
4772
+ * @return string Freemius SDK version
4773
+ */
4774
+ function get_sdk_version() {
4775
+ return $this->version;
4776
+ }
4777
+
4778
+ /**
4779
+ * @author Vova Feldman (@svovaf)
4780
+ * @since 1.2.1.5
4781
+ *
4782
+ * @return number Parent plugin ID (if parent exist).
4783
+ */
4784
+ function get_parent_id() {
4785
+ return $this->is_addon() ?
4786
+ $this->get_parent_instance()->get_id() :
4787
+ $this->_plugin->id;
4788
+ }
4789
+
4790
+ /**
4791
+ * @author Vova Feldman (@svovaf)
4792
+ * @since 1.0.1
4793
+ *
4794
+ * @return string Plugin public key.
4795
+ */
4796
+ function get_public_key() {
4797
+ return $this->_plugin->public_key;
4798
+ }
4799
+
4800
+ /**
4801
+ * Will be available only on sandbox mode.
4802
+ *
4803
+ * @author Vova Feldman (@svovaf)
4804
+ * @since 1.0.4
4805
+ *
4806
+ * @return mixed Plugin secret key.
4807
+ */
4808
+ function get_secret_key() {
4809
+ return $this->_plugin->secret_key;
4810
+ }
4811
+
4812
+ /**
4813
+ * @author Vova Feldman (@svovaf)
4814
+ * @since 1.1.1
4815
+ *
4816
+ * @return bool
4817
+ */
4818
+ function has_secret_key() {
4819
+ return ! empty( $this->_plugin->secret_key );
4820
+ }
4821
+
4822
+ /**
4823
+ * @author Vova Feldman (@svovaf)
4824
+ * @since 1.0.9
4825
+ *
4826
+ * @return string
4827
+ */
4828
+ function get_plugin_name() {
4829
+ $this->_logger->entrance();
4830
+
4831
+ if ( ! isset( $this->_plugin_name ) ) {
4832
+ $plugin_data = $this->get_plugin_data();
4833
+
4834
+ // Get name.
4835
+ $this->_plugin_name = $plugin_data['Name'];
4836
+
4837
+ // Check if plugin name contains [Premium] suffix and remove it.
4838
+ $suffix = '[premium]';
4839
+ $suffix_len = strlen( $suffix );
4840
+
4841
+ if ( strlen( $plugin_data['Name'] ) > $suffix_len &&
4842
+ $suffix === substr( strtolower( $plugin_data['Name'] ), - $suffix_len )
4843
+ ) {
4844
+ $this->_plugin_name = substr( $plugin_data['Name'], 0, - $suffix_len );
4845
+ }
4846
+
4847
+ $this->_logger->departure( 'Name = ' . $this->_plugin_name );
4848
+ }
4849
+
4850
+ return $this->_plugin_name;
4851
+ }
4852
+
4853
+ /**
4854
+ * @author Vova Feldman (@svovaf)
4855
+ * @since 1.0.0
4856
+ *
4857
+ * @return string
4858
+ */
4859
+ function get_plugin_version() {
4860
+ $this->_logger->entrance();
4861
+
4862
+ $plugin_data = $this->get_plugin_data();
4863
+
4864
+ $this->_logger->departure( 'Version = ' . $plugin_data['Version'] );
4865
+
4866
+ return $this->apply_filters( 'plugin_version', $plugin_data['Version'] );
4867
+ }
4868
+
4869
+ /**
4870
+ * @author Vova Feldman (@svovaf)
4871
+ * @since 1.0.4
4872
+ *
4873
+ * @return string
4874
+ */
4875
+ function get_plugin_basename() {
4876
+ return $this->_plugin_basename;
4877
+ }
4878
+
4879
+ function get_plugin_folder_name() {
4880
+ $this->_logger->entrance();
4881
+
4882
+ $plugin_folder = $this->_plugin_basename;
4883
+
4884
+ while ( '.' !== dirname( $plugin_folder ) ) {
4885
+ $plugin_folder = dirname( $plugin_folder );
4886
+ }
4887
+
4888
+ $this->_logger->departure( 'Folder Name = ' . $plugin_folder );
4889
+
4890
+ return $plugin_folder;
4891
+ }
4892
+
4893
+ #endregion ------------------------------------------------------------------
4894
+
4895
+ /* Account
4896
+ ------------------------------------------------------------------------------------------------------------------*/
4897
+
4898
+ /**
4899
+ * Find plugin's slug by plugin's basename.
4900
+ *
4901
+ * @author Vova Feldman (@svovaf)
4902
+ * @since 1.0.9
4903
+ *
4904
+ * @param string $plugin_base_name
4905
+ *
4906
+ * @return false|string
4907
+ */
4908
+ private static function find_slug_by_basename( $plugin_base_name ) {
4909
+ $file_slug_map = self::$_accounts->get_option( 'file_slug_map', array() );
4910
+
4911
+ if ( ! array( $file_slug_map ) || ! isset( $file_slug_map[ $plugin_base_name ] ) ) {
4912
+ return false;
4913
+ }
4914
+
4915
+ return $file_slug_map[ $plugin_base_name ];
4916
+ }
4917
+
4918
+ /**
4919
+ * Store the map between the plugin's basename to the slug.
4920
+ *
4921
+ * @author Vova Feldman (@svovaf)
4922
+ * @since 1.0.9
4923
+ */
4924
+ private function store_file_slug_map() {
4925
+ $file_slug_map = self::$_accounts->get_option( 'file_slug_map', array() );
4926
+
4927
+ if ( ! array( $file_slug_map ) ) {
4928
+ $file_slug_map = array();
4929
+ }
4930
+
4931
+ if ( ! isset( $file_slug_map[ $this->_plugin_basename ] ) ||
4932
+ $file_slug_map[ $this->_plugin_basename ] !== $this->_slug
4933
+ ) {
4934
+ $file_slug_map[ $this->_plugin_basename ] = $this->_slug;
4935
+ self::$_accounts->set_option( 'file_slug_map', $file_slug_map, true );
4936
+ }
4937
+ }
4938
+
4939
+ /**
4940
+ * @return FS_User[]
4941
+ */
4942
+ static function get_all_users() {
4943
+ $users = self::$_accounts->get_option( 'users', array() );
4944
+
4945
+ if ( ! is_array( $users ) ) {
4946
+ $users = array();
4947
+ }
4948
+
4949
+ return $users;
4950
+ }
4951
+
4952
+ /**
4953
+ * @return FS_Site[]
4954
+ */
4955
+ private static function get_all_sites() {
4956
+ $sites = self::$_accounts->get_option( 'sites', array() );
4957
+
4958
+ if ( ! is_array( $sites ) ) {
4959
+ $sites = array();
4960
+ }
4961
+
4962
+ return $sites;
4963
+ }
4964
+
4965
+ /**
4966
+ * @author Vova Feldman (@svovaf)
4967
+ * @since 1.0.6
4968
+ *
4969
+ * @return FS_Plugin_License[]
4970
+ */
4971
+ private static function get_all_licenses() {
4972
+ $licenses = self::$_accounts->get_option( 'licenses', array() );
4973
+
4974
+ if ( ! is_array( $licenses ) ) {
4975
+ $licenses = array();
4976
+ }
4977
+
4978
+ return $licenses;
4979
+ }
4980
+
4981
+ /**
4982
+ * @return FS_Plugin_Plan[]
4983
+ */
4984
+ private static function get_all_plans() {
4985
+ $plans = self::$_accounts->get_option( 'plans', array() );
4986
+
4987
+ if ( ! is_array( $plans ) ) {
4988
+ $plans = array();
4989
+ }
4990
+
4991
+ return $plans;
4992
+ }
4993
+
4994
+ /**
4995
+ * @author Vova Feldman (@svovaf)
4996
+ * @since 1.0.4
4997
+ *
4998
+ * @return FS_Plugin_Tag[]
4999
+ */
5000
+ private static function get_all_updates() {
5001
+ $updates = self::$_accounts->get_option( 'updates', array() );
5002
+
5003
+ if ( ! is_array( $updates ) ) {
5004
+ $updates = array();
5005
+ }
5006
+
5007
+ return $updates;
5008
+ }
5009
+
5010
+ /**
5011
+ * @author Vova Feldman (@svovaf)
5012
+ * @since 1.0.6
5013
+ *
5014
+ * @return array<number,FS_Plugin[]>|false
5015
+ */
5016
+ private static function get_all_addons() {
5017
+ $addons = self::$_accounts->get_option( 'addons', array() );
5018
+
5019
+ if ( ! is_array( $addons ) ) {
5020
+ $addons = array();
5021
+ }
5022
+
5023
+ return $addons;
5024
+ }
5025
+
5026
+ /**
5027
+ * @author Vova Feldman (@svovaf)
5028
+ * @since 1.0.6
5029
+ *
5030
+ * @return FS_Plugin[]|false
5031
+ */
5032
+ private static function get_all_account_addons() {
5033
+ $addons = self::$_accounts->get_option( 'account_addons', array() );
5034
+
5035
+ if ( ! is_array( $addons ) ) {
5036
+ $addons = array();
5037
+ }
5038
+
5039
+ return $addons;
5040
+ }
5041
+
5042
+ /**
5043
+ * Check if user is registered.
5044
+ *
5045
+ * @author Vova Feldman (@svovaf)
5046
+ * @since 1.0.1
5047
+ * @return bool
5048
+ */
5049
+ function is_registered() {
5050
+ return is_object( $this->_user );
5051
+ }
5052
+
5053
+ /**
5054
+ * Returns TRUE if the user opted-in and didn't disconnect (opt-out).
5055
+ *
5056
+ * @author Leo Fajardo (@leorw)
5057
+ * @since 1.2.1.5
5058
+ *
5059
+ * @return bool
5060
+ */
5061
+ function is_tracking_allowed() {
5062
+ return ( is_object( $this->_site ) && true !== $this->_site->is_disconnected );
5063
+ }
5064
+
5065
+ /**
5066
+ * @author Vova Feldman (@svovaf)
5067
+ * @since 1.0.4
5068
+ *
5069
+ * @return FS_Plugin
5070
+ */
5071
+ function get_plugin() {
5072
+ return $this->_plugin;
5073
+ }
5074
+
5075
+ /**
5076
+ * @author Vova Feldman (@svovaf)
5077
+ * @since 1.0.3
5078
+ *
5079
+ * @return FS_User
5080
+ */
5081
+ function get_user() {
5082
+ return $this->_user;
5083
+ }
5084
+
5085
+ /**
5086
+ * @author Vova Feldman (@svovaf)
5087
+ * @since 1.0.3
5088
+ *
5089
+ * @return FS_Site
5090
+ */
5091
+ function get_site() {
5092
+ return $this->_site;
5093
+ }
5094
+
5095
+ /**
5096
+ * Get plugin add-ons.
5097
+ *
5098
+ * @author Vova Feldman (@svovaf)
5099
+ * @since 1.0.6
5100
+ *
5101
+ * @since 1.1.7.3 If not yet loaded, fetch data from the API.
5102
+ *
5103
+ * @param bool $flush
5104
+ *
5105
+ * @return FS_Plugin[]|false
5106
+ */
5107
+ function get_addons( $flush = false ) {
5108
+ $this->_logger->entrance();
5109
+
5110
+ if ( ! $this->_has_addons ) {
5111
+ return false;
5112
+ }
5113
+
5114
+ $addons = $this->sync_addons( $flush );
5115
+
5116
+ return ( ! is_array( $addons ) || empty( $addons ) ) ?
5117
+ false :
5118
+ $addons;
5119
+ }
5120
+
5121
+ /**
5122
+ * @author Vova Feldman (@svovaf)
5123
+ * @since 1.0.6
5124
+ *
5125
+ * @return FS_Plugin[]|false
5126
+ */
5127
+ function get_account_addons() {
5128
+ $this->_logger->entrance();
5129
+
5130
+ $addons = self::get_all_account_addons();
5131
+
5132
+ if ( ! is_array( $addons ) ||
5133
+ ! isset( $addons[ $this->_plugin->id ] ) ||
5134
+ ! is_array( $addons[ $this->_plugin->id ] ) ||
5135
+ 0 === count( $addons[ $this->_plugin->id ] )
5136
+ ) {
5137
+ return false;
5138
+ }
5139
+
5140
+ return $addons[ $this->_plugin->id ];
5141
+ }
5142
+
5143
+ /**
5144
+ * Check if user has any
5145
+ *
5146
+ * @author Vova Feldman (@svovaf)
5147
+ * @since 1.1.6
5148
+ *
5149
+ * @return bool
5150
+ */
5151
+ function has_account_addons() {
5152
+ $addons = $this->get_account_addons();
5153
+
5154
+ return is_array( $addons ) && ( 0 < count( $addons ) );
5155
+ }
5156
+
5157
+
5158
+ /**
5159
+ * Get add-on by ID (from local data).
5160
+ *
5161
+ * @author Vova Feldman (@svovaf)
5162
+ * @since 1.0.6
5163
+ *
5164
+ * @param number $id
5165
+ *
5166
+ * @return FS_Plugin|false
5167
+ */
5168
+ function get_addon( $id ) {
5169
+ $this->_logger->entrance();
5170
+
5171
+ $addons = $this->get_addons();
5172
+
5173
+ if ( is_array( $addons ) ) {
5174
+ foreach ( $addons as $addon ) {
5175
+ if ( $id == $addon->id ) {
5176
+ return $addon;
5177
+ }
5178
+ }
5179
+ }
5180
+
5181
+ return false;
5182
+ }
5183
+
5184
+ /**
5185
+ * Get add-on by slug (from local data).
5186
+ *
5187
+ * @author Vova Feldman (@svovaf)
5188
+ * @since 1.0.6
5189
+ *
5190
+ * @param string $slug
5191
+ *
5192
+ * @param bool $flush
5193
+ *
5194
+ * @return FS_Plugin|false
5195
+ */
5196
+ function get_addon_by_slug( $slug, $flush = false ) {
5197
+ $this->_logger->entrance();
5198
+
5199
+ $addons = $this->get_addons( $flush );
5200
+
5201
+ if ( is_array( $addons ) ) {
5202
+ foreach ( $addons as $addon ) {
5203
+ if ( $slug === $addon->slug ) {
5204
+ return $addon;
5205
+ }
5206
+ }
5207
+ }
5208
+
5209
+ return false;
5210
+ }
5211
+
5212
+ #----------------------------------------------------------------------------------
5213
+ #region Plans & Licensing
5214
+ #----------------------------------------------------------------------------------
5215
+
5216
+ /**
5217
+ * Check if running premium plugin code.
5218
+ *
5219
+ * @author Vova Feldman (@svovaf)
5220
+ * @since 1.0.5
5221
+ *
5222
+ * @return bool
5223
+ */
5224
+ function is_premium() {
5225
+ return $this->_plugin->is_premium;
5226
+ }
5227
+
5228
+ /**
5229
+ * Get site's plan ID.
5230
+ *
5231
+ * @author Vova Feldman (@svovaf)
5232
+ * @since 1.0.2
5233
+ *
5234
+ * @return number
5235
+ */
5236
+ function get_plan_id() {
5237
+ return $this->_site->plan->id;
5238
+ }
5239
+
5240
+ /**
5241
+ * Get site's plan title.
5242
+ *
5243
+ * @author Vova Feldman (@svovaf)
5244
+ * @since 1.0.2
5245
+ *
5246
+ * @return string
5247
+ */
5248
+ function get_plan_title() {
5249
+ return $this->_site->plan->title;
5250
+ }
5251
+
5252
+ /**
5253
+ * @author Vova Feldman (@svovaf)
5254
+ * @since 1.0.9
5255
+ *
5256
+ * @return FS_Plugin_Plan|false
5257
+ */
5258
+ function get_plan() {
5259
+ return is_object( $this->_site->plan ) ?
5260
+ $this->_site->plan :
5261
+ false;
5262
+ }
5263
+
5264
+ /**
5265
+ * @author Vova Feldman (@svovaf)
5266
+ * @since 1.0.3
5267
+ *
5268
+ * @return bool
5269
+ */
5270
+ function is_trial() {
5271
+ $this->_logger->entrance();
5272
+
5273
+ if ( ! $this->is_registered() ) {
5274
+ return false;
5275
+ }
5276
+
5277
+ return $this->_site->is_trial();
5278
+ }
5279
+
5280
+ /**
5281
+ * Check if currently in a trial with payment method (credit card or paypal).
5282
+ *
5283
+ * @author Vova Feldman (@svovaf)
5284
+ * @since 1.1.7
5285
+ *
5286
+ * @return bool
5287
+ */
5288
+ function is_paid_trial() {
5289
+ $this->_logger->entrance();
5290
+
5291
+ if ( ! $this->is_trial() ) {
5292
+ return false;
5293
+ }
5294
+
5295
+ return $this->has_active_valid_license() && ( $this->_site->trial_plan_id == $this->_license->plan_id );
5296
+ }
5297
+
5298
+ /**
5299
+ * Check if trial already utilized.
5300
+ *
5301
+ * @since 1.0.9
5302
+ *
5303
+ * @return bool
5304
+ */
5305
+ function is_trial_utilized() {
5306
+ $this->_logger->entrance();
5307
+
5308
+ if ( ! $this->is_registered() ) {
5309
+ return false;
5310
+ }
5311
+
5312
+ return $this->_site->is_trial_utilized();
5313
+ }
5314
+
5315
+ /**
5316
+ * Get trial plan information (if in trial).
5317
+ *
5318
+ * @author Vova Feldman (@svovaf)
5319
+ * @since 1.0.9
5320
+ *
5321
+ * @return bool|FS_Plugin_Plan
5322
+ */
5323
+ function get_trial_plan() {
5324
+ $this->_logger->entrance();
5325
+
5326
+ if ( ! $this->is_trial() ) {
5327
+ return false;
5328
+ }
5329
+
5330
+ return $this->_storage->trial_plan;
5331
+ }
5332
+
5333
+ /**
5334
+ * Check if the user has an activate, non-expired license on current plugin's install.
5335
+ *
5336
+ * @since 1.0.9
5337
+ *
5338
+ * @return bool
5339
+ */
5340
+ function is_paying() {
5341
+ $this->_logger->entrance();
5342
+
5343
+ if ( ! $this->is_registered() ) {
5344
+ return false;
5345
+ }
5346
+
5347
+ if ( ! $this->has_paid_plan() ) {
5348
+ return false;
5349
+ }
5350
+
5351
+ return (
5352
+ ! $this->is_trial() &&
5353
+ 'free' !== $this->_site->plan->name &&
5354
+ $this->has_active_valid_license()
5355
+ );
5356
+ }
5357
+
5358
+ /**
5359
+ * @author Vova Feldman (@svovaf)
5360
+ * @since 1.0.4
5361
+ *
5362
+ * @return bool
5363
+ */
5364
+ function is_free_plan() {
5365
+ if ( ! $this->is_registered() ) {
5366
+ return true;
5367
+ }
5368
+
5369
+ if ( ! $this->has_paid_plan() ) {
5370
+ return true;
5371
+ }
5372
+
5373
+ return (
5374
+ 'free' === $this->_site->plan->name ||
5375
+ ! $this->has_features_enabled_license()
5376
+ );
5377
+ }
5378
+
5379
+ /**
5380
+ * @author Vova Feldman (@svovaf)
5381
+ * @since 1.0.5
5382
+ *
5383
+ * @return bool
5384
+ */
5385
+ function _has_premium_license() {
5386
+ $this->_logger->entrance();
5387
+
5388
+ $premium_license = $this->_get_available_premium_license();
5389
+
5390
+ return ( false !== $premium_license );
5391
+ }
5392
+
5393
+ /**
5394
+ * Check if user has any licenses associated with the plugin (including expired or blocking).
5395
+ *
5396
+ * @author Vova Feldman (@svovaf)
5397
+ * @since 1.1.7.3
5398
+ *
5399
+ * @return bool
5400
+ */
5401
+ private function has_any_license() {
5402
+ return is_array( $this->_licenses ) && ( 0 < count( $this->_licenses ) );
5403
+ }
5404
+
5405
+ /**
5406
+ * @author Vova Feldman (@svovaf)
5407
+ * @since 1.0.5
5408
+ *
5409
+ * @return FS_Plugin_License|false
5410
+ */
5411
+ function _get_available_premium_license() {
5412
+ $this->_logger->entrance();
5413
+
5414
+ if ( ! $this->has_paid_plan() ) {
5415
+ return false;
5416
+ }
5417
+
5418
+ if ( is_array( $this->_licenses ) ) {
5419
+ foreach ( $this->_licenses as $license ) {
5420
+ if ( ! $license->is_utilized() && $license->is_features_enabled() ) {
5421
+ return $license;
5422
+ }
5423
+ }
5424
+ }
5425
+
5426
+ return false;
5427
+ }
5428
+
5429
+ /**
5430
+ * Sync local plugin plans with remote server.
5431
+ *
5432
+ * @author Vova Feldman (@svovaf)
5433
+ * @since 1.0.5
5434
+ *
5435
+ * @return FS_Plugin_Plan[]|object
5436
+ */
5437
+ function _sync_plans() {
5438
+ $plans = $this->_fetch_plugin_plans();
5439
+
5440
+ if ( $this->is_array_instanceof( $plans, 'FS_Plugin_Plan' ) ) {
5441
+ $this->_plans = $plans;
5442
+ $this->_store_plans();
5443
+ }
5444
+
5445
+ $this->do_action( 'after_plans_sync', $plans );
5446
+
5447
+ return $this->_plans;
5448
+ }
5449
+
5450
+ /**
5451
+ * @author Vova Feldman (@svovaf)
5452
+ * @since 1.0.5
5453
+ *
5454
+ * @param number $id
5455
+ *
5456
+ * @return FS_Plugin_Plan|false
5457
+ */
5458
+ function _get_plan_by_id( $id ) {
5459
+ $this->_logger->entrance();
5460
+
5461
+ if ( ! is_array( $this->_plans ) || 0 === count( $this->_plans ) ) {
5462
+ $this->_sync_plans();
5463
+ }
5464
+
5465
+ foreach ( $this->_plans as $plan ) {
5466
+ if ( $id == $plan->id ) {
5467
+ return $plan;
5468
+ }
5469
+ }
5470
+
5471
+ return false;
5472
+ }
5473
+
5474
+ /**
5475
+ * @author Vova Feldman (@svovaf)
5476
+ * @since 1.1.8.1
5477
+ *
5478
+ * @param string $name
5479
+ *
5480
+ * @return FS_Plugin_Plan|false
5481
+ */
5482
+ private function get_plan_by_name( $name ) {
5483
+ $this->_logger->entrance();
5484
+
5485
+ if ( ! is_array( $this->_plans ) || 0 === count( $this->_plans ) ) {
5486
+ $this->_sync_plans();
5487
+ }
5488
+
5489
+ foreach ( $this->_plans as $plan ) {
5490
+ if ( $name == $plan->name ) {
5491
+ return $plan;
5492
+ }
5493
+ }
5494
+
5495
+ return false;
5496
+ }
5497
+
5498
+ /**
5499
+ * Sync local plugin plans with remote server.
5500
+ *
5501
+ * @author Vova Feldman (@svovaf)
5502
+ * @since 1.0.6
5503
+ *
5504
+ * @param number|bool $site_license_id
5505
+ *
5506
+ * @return FS_Plugin_License[]|object
5507
+ */
5508
+ function _sync_licenses( $site_license_id = false ) {
5509
+ $licenses = $this->_fetch_licenses( false, $site_license_id );
5510
+
5511
+ if ( $this->is_array_instanceof( $licenses, 'FS_Plugin_License' ) ) {
5512
+ $this->_licenses = $licenses;
5513
+ $this->_store_licenses();
5514
+ }
5515
+
5516
+ // Update current license.
5517
+ if ( is_object( $this->_license ) ) {
5518
+ $this->_license = $this->_get_license_by_id( $this->_license->id );
5519
+ }
5520
+
5521
+ return $this->_licenses;
5522
+ }
5523
+
5524
+ /**
5525
+ * @author Vova Feldman (@svovaf)
5526
+ * @since 1.0.5
5527
+ *
5528
+ * @param number $id
5529
+ *
5530
+ * @return FS_Plugin_License|false
5531
+ */
5532
+ function _get_license_by_id( $id ) {
5533
+ $this->_logger->entrance();
5534
+
5535
+ if ( ! is_numeric( $id ) ) {
5536
+ return false;
5537
+ }
5538
+
5539
+ if ( ! $this->has_any_license() ) {
5540
+ $this->_sync_licenses();
5541
+ }
5542
+
5543
+ foreach ( $this->_licenses as $license ) {
5544
+ if ( $id == $license->id ) {
5545
+ return $license;
5546
+ }
5547
+ }
5548
+
5549
+ return false;
5550
+ }
5551
+
5552
+ /**
5553
+ * Sync site's license with user licenses.
5554
+ *
5555
+ * @author Vova Feldman (@svovaf)
5556
+ * @since 1.0.6
5557
+ *
5558
+ * @param FS_Plugin_License|null $new_license
5559
+ */
5560
+ function _update_site_license( $new_license ) {
5561
+ $this->_logger->entrance();
5562
+
5563
+ $this->_license = $new_license;
5564
+
5565
+ if ( ! is_object( $new_license ) ) {
5566
+ $this->_site->license_id = null;
5567
+ $this->_sync_site_subscription( null );
5568
+
5569
+ return;
5570
+ }
5571
+
5572
+ $this->_site->license_id = $this->_license->id;
5573
+
5574
+ if ( ! is_array( $this->_licenses ) ) {
5575
+ $this->_licenses = array();
5576
+ }
5577
+
5578
+ $is_license_found = false;
5579
+ for ( $i = 0, $len = count( $this->_licenses ); $i < $len; $i ++ ) {
5580
+ if ( $new_license->id == $this->_licenses[ $i ]->id ) {
5581
+ $this->_licenses[ $i ] = $new_license;
5582
+
5583
+ $is_license_found = true;
5584
+ break;
5585
+ }
5586
+ }
5587
+
5588
+ // If new license just append.
5589
+ if ( ! $is_license_found ) {
5590
+ $this->_licenses[] = $new_license;
5591
+ }
5592
+
5593
+ $this->_sync_site_subscription( $new_license );
5594
+ }
5595
+
5596
+ /**
5597
+ * Sync site's subscription.
5598
+ *
5599
+ * @author Vova Feldman (@svovaf)
5600
+ * @since 1.0.9
5601
+ *
5602
+ * @param FS_Plugin_License|null $license
5603
+ *
5604
+ * @return bool|\FS_Subscription
5605
+ */
5606
+ private function _sync_site_subscription( $license ) {
5607
+ if ( ! is_object( $license ) ) {
5608
+ unset( $this->_storage->subscription );
5609
+
5610
+ return false;
5611
+ }
5612
+
5613
+ // Load subscription details if not lifetime.
5614
+ $subscription = $license->is_lifetime() ?
5615
+ false :
5616
+ $this->_fetch_site_license_subscription();
5617
+
5618
+ if ( is_object( $subscription ) && ! isset( $subscription->error ) ) {
5619
+ $this->_storage->subscription = $subscription;
5620
+ } else {
5621
+ unset( $this->_storage->subscription );
5622
+ }
5623
+
5624
+ return $subscription;
5625
+ }
5626
+
5627
+ /**
5628
+ * @author Vova Feldman (@svovaf)
5629
+ * @since 1.0.6
5630
+ *
5631
+ * @return bool|\FS_Plugin_License
5632
+ */
5633
+ function _get_license() {
5634
+ return $this->_license;
5635
+ }
5636
+
5637
+ /**
5638
+ * @return bool|\FS_Subscription
5639
+ */
5640
+ function _get_subscription() {
5641
+ return isset( $this->_storage->subscription ) ?
5642
+ $this->_storage->subscription :
5643
+ false;
5644
+ }
5645
+
5646
+ /**
5647
+ * @author Vova Feldman (@svovaf)
5648
+ * @since 1.0.2
5649
+ *
5650
+ * @param string $plan Plan name
5651
+ * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
5652
+ *
5653
+ * @return bool
5654
+ */
5655
+ function is_plan( $plan, $exact = false ) {
5656
+ $this->_logger->entrance();
5657
+
5658
+ if ( ! $this->is_registered() ) {
5659
+ return false;
5660
+ }
5661
+
5662
+ $plan = strtolower( $plan );
5663
+
5664
+ if ( $this->_site->plan->name === $plan ) // Exact plan.
5665
+ {
5666
+ return true;
5667
+ } else if ( $exact ) // Required exact, but plans are different.
5668
+ {
5669
+ return false;
5670
+ }
5671
+
5672
+ $current_plan_order = - 1;
5673
+ $required_plan_order = - 1;
5674
+ for ( $i = 0, $len = count( $this->_plans ); $i < $len; $i ++ ) {
5675
+ if ( $plan === $this->_plans[ $i ]->name ) {
5676
+ $required_plan_order = $i;
5677
+ } else if ( $this->_site->plan->name === $this->_plans[ $i ]->name ) {
5678
+ $current_plan_order = $i;
5679
+ }
5680
+ }
5681
+
5682
+ return ( $current_plan_order > $required_plan_order );
5683
+ }
5684
+
5685
+ /**
5686
+ * Check if plan based on trial. If not in trial mode, should return false.
5687
+ *
5688
+ * @since 1.0.9
5689
+ *
5690
+ * @param string $plan Plan name
5691
+ * @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
5692
+ *
5693
+ * @return bool
5694
+ */
5695
+ function is_trial_plan( $plan, $exact = false ) {
5696
+ $this->_logger->entrance();
5697
+
5698
+ if ( ! $this->is_registered() ) {
5699
+ return false;
5700
+ }
5701
+
5702
+ if ( ! $this->is_trial() ) {
5703
+ return false;
5704
+ }
5705
+
5706
+ if ( ! isset( $this->_storage->trial_plan ) ) {
5707
+ // Store trial plan information.
5708
+ $this->_enrich_site_trial_plan( true );
5709
+ }
5710
+
5711
+ if ( $this->_storage->trial_plan->name === $plan ) // Exact plan.
5712
+ {
5713
+ return true;
5714
+ } else if ( $exact ) // Required exact, but plans are different.
5715
+ {
5716
+ return false;
5717
+ }
5718
+
5719
+ $current_plan_order = - 1;
5720
+ $required_plan_order = - 1;
5721
+ for ( $i = 0, $len = count( $this->_plans ); $i < $len; $i ++ ) {
5722
+ if ( $plan === $this->_plans[ $i ]->name ) {
5723
+ $required_plan_order = $i;
5724
+ } else if ( $this->_storage->trial_plan->name === $this->_plans[ $i ]->name ) {
5725
+ $current_plan_order = $i;
5726
+ }
5727
+ }
5728
+
5729
+ return ( $current_plan_order > $required_plan_order );
5730
+ }
5731
+
5732
+ /**
5733
+ * Check if plugin has any paid plans.
5734
+ *
5735
+ * @author Vova Feldman (@svovaf)
5736
+ * @since 1.0.7
5737
+ *
5738
+ * @return bool
5739
+ */
5740
+ function has_paid_plan() {
5741
+ return $this->_has_paid_plans ||
5742
+ FS_Plan_Manager::instance()->has_paid_plan( $this->_plans );
5743
+ }
5744
+
5745
+ /**
5746
+ * Check if plugin has any plan with a trail.
5747
+ *
5748
+ * @author Vova Feldman (@svovaf)
5749
+ * @since 1.0.9
5750
+ *
5751
+ * @return bool
5752
+ */
5753
+ function has_trial_plan() {
5754
+ if ( ! $this->is_registered() ) {
5755
+ /**
5756
+ * @author Vova Feldman(@svovaf)
5757
+ * @since 1.2.1.5
5758
+ *
5759
+ * Allow setting a trial from the SDK without calling the API.
5760
+ * But, if the user did opt-in, continue using the real data from the API.
5761
+ */
5762
+ if ( $this->_trial_days >= 0 ) {
5763
+ return true;
5764
+ }
5765
+
5766
+ return false;
5767
+ }
5768
+
5769
+ return $this->_storage->get( 'has_trial_plan', false );
5770
+ }
5771
+
5772
+ /**
5773
+ * Check if plugin has any free plan, or is it premium only.
5774
+ *
5775
+ * Note: If no plans configured, assume plugin is free.
5776
+ *
5777
+ * @author Vova Feldman (@svovaf)
5778
+ * @since 1.0.7
5779
+ *
5780
+ * @return bool
5781
+ */
5782
+ function has_free_plan() {
5783
+ return ! $this->is_only_premium();
5784
+ }
5785
+
5786
+ /**
5787
+ * Displays a license activation dialog box when the user clicks on the "Activate License"
5788
+ * or "Change License" link on the plugins
5789
+ * page.
5790
+ *
5791
+ * @author Leo Fajardo (@leorw)
5792
+ * @since 1.1.9
5793
+ */
5794
+ function _add_license_activation_dialog_box() {
5795
+ $vars = array(
5796
+ 'slug' => $this->_slug,
5797
+ );
5798
+
5799
+ fs_require_template( 'forms/license-activation.php', $vars );
5800
+ fs_require_template( 'forms/resend-key.php', $vars );
5801
+ }
5802
+
5803
+ /**
5804
+ * Displays the opt-out dialog box when the user clicks on the "Opt Out" link on the "Plugins"
5805
+ * page.
5806
+ *
5807
+ * @author Leo Fajardo (@leorw)
5808
+ * @since 1.2.1.5
5809
+ */
5810
+ function _add_optout_dialog() {
5811
+ $vars = array(
5812
+ 'slug' => $this->_slug,
5813
+ );
5814
+
5815
+ fs_require_template( 'forms/optout.php', $vars );
5816
+ }
5817
+
5818
+ /**
5819
+ * Prepare page to include all required UI and logic for the license activation dialog.
5820
+ *
5821
+ * @author Vova Feldman (@svovaf)
5822
+ * @since 1.2.0
5823
+ */
5824
+ function _add_license_activation() {
5825
+ if ( ! current_user_can( 'activate_plugins' ) ) {
5826
+ // Only admins can activate a license.
5827
+ return;
5828
+ }
5829
+
5830
+ if ( ! $this->has_paid_plan() ) {
5831
+ // Module doesn't have any paid plans.
5832
+ return;
5833
+ }
5834
+
5835
+ if ( ! $this->is_premium() ) {
5836
+ // Only add license activation logic to the premium version.
5837
+ return;
5838
+ }
5839
+
5840
+ // Add license activation link and AJAX request handler.
5841
+ if ( $this->is_plugins_page() ) {
5842
+ /**
5843
+ * @since 1.2.0 Add license action link only on plugins page.
5844
+ */
5845
+ $this->_add_license_action_link();
5846
+ }
5847
+
5848
+ // Add license activation AJAX callback.
5849
+ $this->add_ajax_action( 'activate_license', array( &$this, '_activate_license_ajax_action' ) );
5850
+
5851
+ // Add resend license AJAX callback.
5852
+ $this->add_ajax_action( 'resend_license_key', array( &$this, '_resend_license_key_ajax_action' ) );
5853
+ }
5854
+
5855
+ /**
5856
+ * @author Leo Fajardo (@leorw)
5857
+ * @since 1.1.9
5858
+ */
5859
+ function _activate_license_ajax_action() {
5860
+ $license_key = trim( fs_request_get( 'license_key' ) );
5861
+
5862
+ if ( empty( $license_key ) ) {
5863
+ exit;
5864
+ }
5865
+
5866
+ $slug = $_POST['slug'];
5867
+ $fs = ( ( $slug === $this->_slug ) ? $this : self::instance( $slug ) );
5868
+ $error = false;
5869
+ $next_page = false;
5870
+
5871
+ if ( $this->is_registered() ) {
5872
+ $api = $fs->get_api_site_scope();
5873
+ $install = $api->call( '/', 'put', array(
5874
+ 'license_key' => $this->apply_filters( 'license_key', $license_key )
5875
+ ) );
5876
+
5877
+ if ( isset( $install->error ) ) {
5878
+ $error = $install->error->message;
5879
+ } else {
5880
+ $fs = $this->is_addon() ?
5881
+ $this->get_parent_instance() :
5882
+ $this;
5883
+
5884
+ $next_page = $fs->_get_sync_license_url( $this->get_id(), true );
5885
+
5886
+ $this->reconnect_locally();
5887
+ }
5888
+ } else {
5889
+ $next_page = $this->opt_in( false, false, false, $license_key );
5890
+
5891
+ if ( isset( $next_page->error ) ) {
5892
+ $error = $next_page->error;
5893
+ }
5894
+ }
5895
+
5896
+ $result = array(
5897
+ 'success' => ( false === $error )
5898
+ );
5899
+
5900
+ if ( false !== $error ) {
5901
+ $result['error'] = $error;
5902
+ } else {
5903
+ $result['next_page'] = $next_page;
5904
+ }
5905
+
5906
+ echo json_encode( $result );
5907
+
5908
+ exit;
5909
+ }
5910
+
5911
+ /**
5912
+ * Billing update AJAX callback.
5913
+ *
5914
+ * @author Vova Feldman (@svovaf)
5915
+ * @since 1.2.1.5
5916
+ */
5917
+ function _update_billing_ajax_action() {
5918
+ check_ajax_referer( $this->get_action_tag( 'update_billing' ), 'security' );
5919
+
5920
+ if ( ! current_user_can( 'activate_plugins' ) ) {
5921
+ // Only for admins.
5922
+ self::shoot_ajax_failure();
5923
+ }
5924
+
5925
+ $billing = fs_request_get( 'billing' );
5926
+
5927
+ $api = $this->get_api_user_scope();
5928
+ $result = $api->call( '/billing.json', 'put', array_merge( $billing, array(
5929
+ 'plugin_id' => $this->get_parent_id(),
5930
+ ) ) );
5931
+
5932
+ if ( ! $this->is_api_result_entity( $result ) ) {
5933
+ self::shoot_ajax_failure();
5934
+ }
5935
+
5936
+ // Purge cached billing.
5937
+ $this->get_api_user_scope()->purge_cache( 'billing.json' );
5938
+
5939
+ self::shoot_ajax_success();
5940
+ }
5941
+
5942
+ /**
5943
+ * Trial start for anonymous users (AJAX callback).
5944
+ *
5945
+ * @author Vova Feldman (@svovaf)
5946
+ * @since 1.2.1.5
5947
+ */
5948
+ function _start_trial_ajax_action() {
5949
+ check_ajax_referer( $this->get_action_tag( 'start_trial' ), 'security' );
5950
+
5951
+ if ( ! current_user_can( 'activate_plugins' ) ) {
5952
+ // Only for admins.
5953
+ self::shoot_ajax_failure();
5954
+ }
5955
+
5956
+ $trial_data = fs_request_get( 'trial' );
5957
+
5958
+ $next_page = $this->opt_in(
5959
+ false,
5960
+ false,
5961
+ false,
5962
+ false,
5963
+ false,
5964
+ $trial_data['plan_id']
5965
+ );
5966
+
5967
+ if ( is_object( $next_page ) && $this->is_api_error( $next_page ) ) {
5968
+ self::shoot_ajax_failure(
5969
+ isset( $next_page->error ) ?
5970
+ $next_page->error->message :
5971
+ var_export( $next_page, true )
5972
+ );
5973
+ }
5974
+
5975
+ self::shoot_ajax_success( array(
5976
+ 'next_page' => $next_page,
5977
+ ) );
5978
+ }
5979
+
5980
+ /**
5981
+ * @author Leo Fajardo (@leorw)
5982
+ * @since 1.2.0
5983
+ */
5984
+ function _resend_license_key_ajax_action() {
5985
+ if ( ! isset( $_POST['email'] ) ) {
5986
+ exit;
5987
+ }
5988
+
5989
+ $email_address = trim( $_POST['email'] );
5990
+ if ( empty( $email_address ) ) {
5991
+ exit;
5992
+ }
5993
+
5994
+ $error = false;
5995
+
5996
+ $api = $this->get_api_plugin_scope();
5997
+ $result = $api->call( '/licenses/resend.json', 'post',
5998
+ array(
5999
+ 'email' => $email_address,
6000
+ 'url' => home_url(),
6001
+ )
6002
+ );
6003
+
6004
+ if ( is_object( $result ) && isset( $result->error ) ) {
6005
+ $error = $result->error;
6006
+
6007
+ if ( in_array( $error->code, array( 'invalid_email', 'no_user' ) ) ) {
6008
+ $error = __fs( 'email-not-found' );
6009
+ } else if ( 'no_license' === $error->code ) {
6010
+ $error = __fs( 'no-active-licenses' );
6011
+ } else {
6012
+ $error = $error->message;
6013
+ }
6014
+ }
6015
+
6016
+ $licenses = array(
6017
+ 'success' => ( false === $error )
6018
+ );
6019
+
6020
+ if ( false !== $error ) {
6021
+ $licenses['error'] = sprintf( '%s... %s', __fs( 'oops', $this->_slug ), strtolower( $error ) );
6022
+ }
6023
+
6024
+ echo json_encode( $licenses );
6025
+
6026
+ exit;
6027
+ }
6028
+
6029
+ /**
6030
+ * Helper method to check if user in the plugins page.
6031
+ *
6032
+ * @author Vova Feldman (@svovaf)
6033
+ * @since 1.2.1.5
6034
+ *
6035
+ * @return bool
6036
+ */
6037
+ private function is_plugins_page() {
6038
+ global $pagenow;
6039
+
6040
+ return ( 'plugins.php' === $pagenow );
6041
+ }
6042
+
6043
+ #----------------------------------------------------------------------------------
6044
+ #region URL Generators
6045
+ #----------------------------------------------------------------------------------
6046
+
6047
+ /**
6048
+ * Alias to pricing_url().
6049
+ *
6050
+ * @author Vova Feldman (@svovaf)
6051
+ * @since 1.0.2
6052
+ *
6053
+ * @uses pricing_url()
6054
+ *
6055
+ * @param string $period Billing cycle
6056
+ * @param bool $is_trial
6057
+ *
6058
+ * @return string
6059
+ */
6060
+ function get_upgrade_url( $period = WP_FS__PERIOD_ANNUALLY, $is_trial = false ) {
6061
+ return $this->pricing_url( $period, $is_trial );
6062
+ }
6063
+
6064
+ /**
6065
+ * @author Vova Feldman (@svovaf)
6066
+ * @since 1.0.9
6067
+ *
6068
+ * @uses get_upgrade_url()
6069
+ *
6070
+ * @return string
6071
+ */
6072
+ function get_trial_url() {
6073
+ return $this->get_upgrade_url( WP_FS__PERIOD_ANNUALLY, true );
6074
+ }
6075
+
6076
+ /**
6077
+ * Plugin's pricing URL.
6078
+ *
6079
+ * @author Vova Feldman (@svovaf)
6080
+ * @since 1.0.4
6081
+ *
6082
+ * @param string $billing_cycle Billing cycle
6083
+ *
6084
+ * @param bool $is_trial
6085
+ *
6086
+ * @return string
6087
+ */
6088
+ function pricing_url( $billing_cycle = WP_FS__PERIOD_ANNUALLY, $is_trial = false ) {
6089
+ $this->_logger->entrance();
6090
+
6091
+ $params = array(
6092
+ 'billing_cycle' => $billing_cycle
6093
+ );
6094
+
6095
+ if ( $is_trial ) {
6096
+ $params['trial'] = 'true';
6097
+ }
6098
+
6099
+ return $this->_get_admin_page_url( 'pricing', $params );
6100
+ }
6101
+
6102
+ /**
6103
+ * Checkout page URL.
6104
+ *
6105
+ * @author Vova Feldman (@svovaf)
6106
+ * @since 1.0.6
6107
+ *
6108
+ * @param string $billing_cycle Billing cycle
6109
+ * @param bool $is_trial
6110
+ * @param array $extra (optional) Extra parameters, override other query params.
6111
+ *
6112
+ * @return string
6113
+ */
6114
+ function checkout_url(
6115
+ $billing_cycle = WP_FS__PERIOD_ANNUALLY,
6116
+ $is_trial = false,
6117
+ $extra = array()
6118
+ ) {
6119
+ $this->_logger->entrance();
6120
+
6121
+ $params = array(
6122
+ 'checkout' => 'true',
6123
+ 'billing_cycle' => $billing_cycle,
6124
+ );
6125
+
6126
+ if ( $is_trial ) {
6127
+ $params['trial'] = 'true';
6128
+ }
6129
+
6130
+ /**
6131
+ * Params in extra override other params.
6132
+ */
6133
+ $params = array_merge( $params, $extra );
6134
+
6135
+ return $this->_get_admin_page_url( 'pricing', $params );
6136
+ }
6137
+
6138
+ /**
6139
+ * Add-on checkout URL.
6140
+ *
6141
+ * @author Vova Feldman (@svovaf)
6142
+ * @since 1.1.7
6143
+ *
6144
+ * @param number $addon_id
6145
+ * @param number $pricing_id
6146
+ * @param string $billing_cycle
6147
+ * @param bool $is_trial
6148
+ *
6149
+ * @return string
6150
+ */
6151
+ function addon_checkout_url(
6152
+ $addon_id,
6153
+ $pricing_id,
6154
+ $billing_cycle = WP_FS__PERIOD_ANNUALLY,
6155
+ $is_trial = false
6156
+ ) {
6157
+ return $this->checkout_url( $billing_cycle, $is_trial, array(
6158
+ 'plugin_id' => $addon_id,
6159
+ 'pricing_id' => $pricing_id,
6160
+ ) );
6161
+ }
6162
+
6163
+ #endregion
6164
+
6165
+ #endregion ------------------------------------------------------------------
6166
+
6167
+ /**
6168
+ * Check if plugin has any add-ons.
6169
+ *
6170
+ * @author Vova Feldman (@svovaf)
6171
+ * @since 1.0.5
6172
+ *
6173
+ * @since 1.1.7.3 Base logic only on the parameter provided by the developer in the init function.
6174
+ *
6175
+ * @return bool
6176
+ */
6177
+ function has_addons() {
6178
+ $this->_logger->entrance();
6179
+
6180
+ return $this->_has_addons;
6181
+ }
6182
+
6183
+ /**
6184
+ * Check if plugin can work in anonymous mode.
6185
+ *
6186
+ * @author Vova Feldman (@svovaf)
6187
+ * @since 1.0.9
6188
+ *
6189
+ * @return bool
6190
+ *
6191
+ * @deprecated Please use is_enable_anonymous() instead
6192
+ */
6193
+ function enable_anonymous() {
6194
+ return $this->_enable_anonymous;
6195
+ }
6196
+
6197
+ /**
6198
+ * Check if plugin can work in anonymous mode.
6199
+ *
6200
+ * @author Vova Feldman (@svovaf)
6201
+ * @since 1.1.9
6202
+ *
6203
+ * @return bool
6204
+ */
6205
+ function is_enable_anonymous() {
6206
+ return $this->_enable_anonymous;
6207
+ }
6208
+
6209
+ /**
6210
+ * Check if plugin is premium only (no free plans).
6211
+ *
6212
+ * @author Vova Feldman (@svovaf)
6213
+ * @since 1.1.9
6214
+ *
6215
+ * @return bool
6216
+ */
6217
+ function is_only_premium() {
6218
+ return $this->_is_premium_only;
6219
+ }
6220
+
6221
+ /**
6222
+ * Check if module has a premium code version.
6223
+ *
6224
+ * Serviceware module might be freemium without any
6225
+ * premium code version, where the paid features
6226
+ * are all part of the service.
6227
+ *
6228
+ * @author Vova Feldman (@svovaf)
6229
+ * @since 1.2.1.6
6230
+ *
6231
+ * @return bool
6232
+ */
6233
+ function has_premium_version() {
6234
+ return $this->_has_premium_version;
6235
+ }
6236
+
6237
+ /**
6238
+ * Check if feature supported with current site's plan.
6239
+ *
6240
+ * @author Vova Feldman (@svovaf)
6241
+ * @since 1.0.1
6242
+ *
6243
+ * @todo IMPLEMENT
6244
+ *
6245
+ * @param number $feature_id
6246
+ *
6247
+ * @throws Exception
6248
+ */
6249
+ function is_feature_supported( $feature_id ) {
6250
+ throw new Exception( 'not implemented' );
6251
+ }
6252
+
6253
+ /**
6254
+ * @author Vova Feldman (@svovaf)
6255
+ * @since 1.0.1
6256
+ *
6257
+ * @return bool Is running in SSL/HTTPS
6258
+ */
6259
+ function is_ssl() {
6260
+ return WP_FS__IS_HTTPS;
6261
+ }
6262
+
6263
+ /**
6264
+ * @author Vova Feldman (@svovaf)
6265
+ * @since 1.0.9
6266
+ *
6267
+ * @return bool Is running in AJAX call.
6268
+ *
6269
+ * @link http://wordpress.stackexchange.com/questions/70676/how-to-check-if-i-am-in-admin-ajax
6270
+ */
6271
+ static function is_ajax() {
6272
+ return ( defined( 'DOING_AJAX' ) && DOING_AJAX );
6273
+ }
6274
+
6275
+ /**
6276
+ * Check if it's an AJAX call targeted for the current module.
6277
+ *
6278
+ * @author Vova Feldman (@svovaf)
6279
+ * @since 1.2.0
6280
+ *
6281
+ * @param array|string $actions Collection of AJAX actions.
6282
+ *
6283
+ * @return bool
6284
+ */
6285
+ function is_ajax_action( $actions ) {
6286
+ // Verify it's an ajax call.
6287
+ if ( ! self::is_ajax() ) {
6288
+ return false;
6289
+ }
6290
+
6291
+ // Verify the call is relevant for the plugin.
6292
+ if ( $this->_slug !== fs_request_get( 'slug' ) ) {
6293
+ return false;
6294
+ }
6295
+
6296
+ // Verify it's one of the specified actions.
6297
+ if ( is_string( $actions ) ) {
6298
+ $actions = explode( ',', $actions );
6299
+ }
6300
+
6301
+ if ( is_array( $actions ) && 0 < count( $actions ) ) {
6302
+ $ajax_action = fs_request_get( 'action' );
6303
+
6304
+ foreach ( $actions as $action ) {
6305
+ if ( $ajax_action === $this->get_action_tag( $action ) ) {
6306
+ return true;
6307
+ }
6308
+ }
6309
+ }
6310
+
6311
+ return false;
6312
+ }
6313
+
6314
+ /**
6315
+ * Check if it's an AJAX call targeted for current request.
6316
+ *
6317
+ * @author Vova Feldman (@svovaf)
6318
+ * @since 1.2.0
6319
+ *
6320
+ * @param array|string $actions Collection of AJAX actions.
6321
+ * @param string $slug
6322
+ *
6323
+ * @return bool
6324
+ */
6325
+ static function is_ajax_action_static( $actions, $slug = '' ) {
6326
+ // Verify it's an ajax call.
6327
+ if ( ! self::is_ajax() ) {
6328
+ return false;
6329
+ }
6330
+
6331
+ if ( ! empty( $slug ) ) {
6332
+ // Verify the call is relevant for the plugin.
6333
+ if ( $slug !== fs_request_get( 'slug' ) ) {
6334
+ return false;
6335
+ }
6336
+ }
6337
+
6338
+ // Verify it's one of the specified actions.
6339
+ if ( is_string( $actions ) ) {
6340
+ $actions = explode( ',', $actions );
6341
+ }
6342
+
6343
+ if ( is_array( $actions ) && 0 < count( $actions ) ) {
6344
+ $ajax_action = fs_request_get( 'action' );
6345
+
6346
+ foreach ( $actions as $action ) {
6347
+ if ( $ajax_action === self::get_action_tag_static( $action, $slug ) ) {
6348
+ return true;
6349
+ }
6350
+ }
6351
+ }
6352
+
6353
+ return false;
6354
+ }
6355
+
6356
+ /**
6357
+ * @author Vova Feldman (@svovaf)
6358
+ * @since 1.1.7
6359
+ *
6360
+ * @return bool
6361
+ */
6362
+ function is_cron() {
6363
+ return ( defined( 'DOING_CRON' ) && DOING_CRON );
6364
+ }
6365
+
6366
+ /**
6367
+ * Check if a real user is visiting the admin dashboard.
6368
+ *
6369
+ * @author Vova Feldman (@svovaf)
6370
+ * @since 1.1.7
6371
+ *
6372
+ * @return bool
6373
+ */
6374
+ function is_user_in_admin() {
6375
+ return is_admin() && ! self::is_ajax() && ! $this->is_cron();
6376
+ }
6377
+
6378
+ /**
6379
+ * Check if running in HTTPS and if site's plan matching the specified plan.
6380
+ *
6381
+ * @param string $plan
6382
+ * @param bool $exact
6383
+ *
6384
+ * @return bool
6385
+ */
6386
+ function is_ssl_and_plan( $plan, $exact = false ) {
6387
+ return ( $this->is_ssl() && $this->is_plan( $plan, $exact ) );
6388
+ }
6389
+
6390
+ /**
6391
+ * Construct plugin's settings page URL.
6392
+ *
6393
+ * @author Vova Feldman (@svovaf)
6394
+ * @since 1.0.4
6395
+ *
6396
+ * @param string $page
6397
+ * @param array $params
6398
+ *
6399
+ * @return string
6400
+ */
6401
+ function _get_admin_page_url( $page = '', $params = array() ) {
6402
+ if ( 0 < count( $params ) ) {
6403
+ foreach ( $params as $k => $v ) {
6404
+ $params[ $k ] = urlencode( $v );
6405
+ }
6406
+ }
6407
+
6408
+ if ( $this->_menu->has_menu_slug() && ! $this->_menu->is_top_level() ) {
6409
+ $parent_slug = $this->_menu->get_parent_slug();
6410
+ $menu_file = ( false !== strpos( $parent_slug, '.php' ) ) ?
6411
+ $parent_slug :
6412
+ 'admin.php';
6413
+
6414
+ return add_query_arg( array_merge( $params, array(
6415
+ 'page' => $this->_menu->get_slug( $page ),
6416
+ ) ), admin_url( $menu_file, 'admin' ) );
6417
+ }
6418
+
6419
+ if ( $this->_menu->is_cpt() ) {
6420
+ if ( empty( $page ) && $this->is_activation_mode() ) {
6421
+ return add_query_arg( array_merge( $params, array(
6422
+ 'page' => $this->_menu->get_slug()
6423
+ ) ), admin_url( 'admin.php', 'admin' ) );
6424
+ } else {
6425
+ if ( ! empty( $page ) ) {
6426
+ $params['page'] = $this->_menu->get_slug( $page );
6427
+ }
6428
+
6429
+ return add_query_arg( $params, admin_url( $this->_menu->get_raw_slug(), 'admin' ) );
6430
+ }
6431
+ } else {
6432
+ /**
6433
+ * @author Vova Feldman
6434
+ * @since 1.2.1.6
6435
+ *
6436
+ * If module doesn't have a settings page, create one for the opt-in screen.
6437
+ */
6438
+ $menu_slug = $this->_menu->has_menu_slug() ?
6439
+ $this->_menu->get_slug( $page ) :
6440
+ $this->_slug;
6441
+
6442
+ return add_query_arg( array_merge( $params, array(
6443
+ 'page' => $menu_slug,
6444
+ ) ), admin_url( 'admin.php', 'admin' ) );
6445
+ }
6446
+ }
6447
+
6448
+ /**
6449
+ * Plugin's account page + sync license URL.
6450
+ *
6451
+ * @author Vova Feldman (@svovaf)
6452
+ * @since 1.1.9.1
6453
+ *
6454
+ * @param bool|number $plugin_id
6455
+ * @param bool $add_action_nonce
6456
+ *
6457
+ * @return string
6458
+ */
6459
+ function _get_sync_license_url( $plugin_id = false, $add_action_nonce = true ) {
6460
+ $params = array();
6461
+
6462
+ if ( is_numeric( $plugin_id ) ) {
6463
+ $params['plugin_id'] = $plugin_id;
6464
+ }
6465
+
6466
+ return $this->get_account_url(
6467
+ $this->_slug . '_sync_license',
6468
+ $params,
6469
+ $add_action_nonce
6470
+ );
6471
+ }
6472
+
6473
+ /**
6474
+ * Plugin's account URL.
6475
+ *
6476
+ * @author Vova Feldman (@svovaf)
6477
+ * @since 1.0.4
6478
+ *
6479
+ * @param bool|string $action
6480
+ * @param array $params
6481
+ *
6482
+ * @param bool $add_action_nonce
6483
+ *
6484
+ * @return string
6485
+ */
6486
+ function get_account_url( $action = false, $params = array(), $add_action_nonce = true ) {
6487
+ if ( is_string( $action ) ) {
6488
+ $params['fs_action'] = $action;
6489
+ }
6490
+
6491
+ self::require_pluggable_essentials();
6492
+
6493
+ return ( $add_action_nonce && is_string( $action ) ) ?
6494
+ fs_nonce_url( $this->_get_admin_page_url( 'account', $params ), $action ) :
6495
+ $this->_get_admin_page_url( 'account', $params );
6496
+ }
6497
+
6498
+ /**
6499
+ * @author Vova Feldman (@svovaf)
6500
+ * @since 1.2.0
6501
+ *
6502
+ * @param string $tab
6503
+ * @param bool $action
6504
+ * @param array $params
6505
+ * @param bool $add_action_nonce
6506
+ *
6507
+ * @return string
6508
+ *
6509
+ * @uses get_account_url()
6510
+ */
6511
+ function get_account_tab_url( $tab, $action = false, $params = array(), $add_action_nonce = true ) {
6512
+ $params['tab'] = $tab;
6513
+
6514
+ return $this->get_account_url( $action, $params, $add_action_nonce );
6515
+ }
6516
+
6517
+ /**
6518
+ * Plugin's account URL.
6519
+ *
6520
+ * @author Vova Feldman (@svovaf)
6521
+ * @since 1.0.4
6522
+ *
6523
+ * @param bool|string $topic
6524
+ * @param bool|string $message
6525
+ *
6526
+ * @return string
6527
+ */
6528
+ function contact_url( $topic = false, $message = false ) {
6529
+ $params = array();
6530
+ if ( is_string( $topic ) ) {
6531
+ $params['topic'] = $topic;
6532
+ }
6533
+ if ( is_string( $message ) ) {
6534
+ $params['message'] = $message;
6535
+ }
6536
+
6537
+ if ( $this->is_addon() ) {
6538
+ $params['addon_id'] = $this->get_id();
6539
+
6540
+ return $this->get_parent_instance()->_get_admin_page_url( 'contact', $params );
6541
+ } else {
6542
+ return $this->_get_admin_page_url( 'contact', $params );
6543
+ }
6544
+ }
6545
+
6546
+ /**
6547
+ * Add-on direct info URL.
6548
+ *
6549
+ * @author Vova Feldman (@svovaf)
6550
+ * @since 1.1.0
6551
+ *
6552
+ * @param string $slug
6553
+ *
6554
+ * @return string
6555
+ */
6556
+ function addon_url( $slug ) {
6557
+ return $this->_get_admin_page_url( 'addons', array(
6558
+ 'slug' => $slug
6559
+ ) );
6560
+ }
6561
+
6562
+ /* Logger
6563
+ ------------------------------------------------------------------------------------------------------------------*/
6564
+ /**
6565
+ * @param string $id
6566
+ * @param bool $prefix_slug
6567
+ *
6568
+ * @return FS_Logger
6569
+ */
6570
+ function get_logger( $id = '', $prefix_slug = true ) {
6571
+ return FS_Logger::get_logger( ( $prefix_slug ? $this->_slug : '' ) . ( ( ! $prefix_slug || empty( $id ) ) ? '' : '_' ) . $id );
6572
+ }
6573
+
6574
+ /**
6575
+ * @param $id
6576
+ * @param bool $load_options
6577
+ * @param bool $prefix_slug
6578
+ *
6579
+ * @return FS_Option_Manager
6580
+ */
6581
+ function get_options_manager( $id, $load_options = false, $prefix_slug = true ) {
6582
+ return FS_Option_Manager::get_manager( ( $prefix_slug ? $this->_slug : '' ) . ( ( ! $prefix_slug || empty( $id ) ) ? '' : '_' ) . $id, $load_options );
6583
+ }
6584
+
6585
+ /* Security
6586
+ ------------------------------------------------------------------------------------------------------------------*/
6587
+ private function _encrypt( $str ) {
6588
+ if ( is_null( $str ) ) {
6589
+ return null;
6590
+ }
6591
+
6592
+ return base64_encode( $str );
6593
+ }
6594
+
6595
+ private function _decrypt( $str ) {
6596
+ if ( is_null( $str ) ) {
6597
+ return null;
6598
+ }
6599
+
6600
+ return base64_decode( $str );
6601
+ }
6602
+
6603
+ /**
6604
+ * @author Vova Feldman (@svovaf)
6605
+ * @since 1.0.5
6606
+ *
6607
+ * @param FS_Entity $entity
6608
+ *
6609
+ * @return FS_Entity Return an encrypted clone entity.
6610
+ */
6611
+ private function _encrypt_entity( FS_Entity $entity ) {
6612
+ $clone = clone $entity;
6613
+ $props = get_object_vars( $entity );
6614
+
6615
+ foreach ( $props as $key => $val ) {
6616
+ $clone->{$key} = $this->_encrypt( $val );
6617
+ }
6618
+
6619
+ return $clone;
6620
+ }
6621
+
6622
+ /**
6623
+ * @author Vova Feldman (@svovaf)
6624
+ * @since 1.0.5
6625
+ *
6626
+ * @param FS_Entity $entity
6627
+ *
6628
+ * @return FS_Entity Return an decrypted clone entity.
6629
+ */
6630
+ private function _decrypt_entity( FS_Entity $entity ) {
6631
+ $clone = clone $entity;
6632
+ $props = get_object_vars( $entity );
6633
+
6634
+ foreach ( $props as $key => $val ) {
6635
+ $clone->{$key} = $this->_decrypt( $val );
6636
+ }
6637
+
6638
+ return $clone;
6639
+ }
6640
+
6641
+ /**
6642
+ * Tries to activate account based on POST params.
6643
+ *
6644
+ * @author Vova Feldman (@svovaf)
6645
+ * @since 1.0.2
6646
+ */
6647
+ function _activate_account() {
6648
+ if ( $this->is_registered() ) {
6649
+ // Already activated.
6650
+ return;
6651
+ }
6652
+
6653
+ self::_clean_admin_content_section();
6654
+
6655
+ if ( fs_request_is_action( 'activate' ) && fs_request_is_post() ) {
6656
+ // check_admin_referer( 'activate_' . $this->_plugin->public_key );
6657
+
6658
+ // Verify matching plugin details.
6659
+ if ( $this->_plugin->id != fs_request_get( 'plugin_id' ) || $this->_slug != fs_request_get( 'plugin_slug' ) ) {
6660
+ return;
6661
+ }
6662
+
6663
+ $user = new FS_User();
6664
+ $user->id = fs_request_get( 'user_id' );
6665
+ $user->public_key = fs_request_get( 'user_public_key' );
6666
+ $user->secret_key = fs_request_get( 'user_secret_key' );
6667
+ $user->email = fs_request_get( 'user_email' );
6668
+ $user->first = fs_request_get( 'user_first' );
6669
+ $user->last = fs_request_get( 'user_last' );
6670
+ $user->is_verified = fs_request_get_bool( 'user_is_verified' );
6671
+
6672
+ $site = new FS_Site();
6673
+ $site->id = fs_request_get( 'install_id' );
6674
+ $site->public_key = fs_request_get( 'install_public_key' );
6675
+ $site->secret_key = fs_request_get( 'install_secret_key' );
6676
+ $site->plan->id = fs_request_get( 'plan_id' );
6677
+ $site->plan->title = fs_request_get( 'plan_title' );
6678
+ $site->plan->name = fs_request_get( 'plan_name' );
6679
+
6680
+ $plans = array();
6681
+ $plans_data = json_decode( urldecode( fs_request_get( 'plans' ) ) );
6682
+ foreach ( $plans_data as $p ) {
6683
+ $plans[] = new FS_Plugin_Plan( $p );
6684
+ }
6685
+
6686
+ $this->_set_account( $user, $site, $plans );
6687
+
6688
+ // Reload the page with the keys.
6689
+ fs_redirect( $this->_get_admin_page_url() );
6690
+ }
6691
+ }
6692
+
6693
+ /**
6694
+ * @author Vova Feldman (@svovaf)
6695
+ * @since 1.0.7
6696
+ *
6697
+ * @param string $email
6698
+ *
6699
+ * @return FS_User|bool
6700
+ */
6701
+ static function _get_user_by_email( $email ) {
6702
+ self::$_static_logger->entrance();
6703
+
6704
+ $email = trim( strtolower( $email ) );
6705
+ $users = self::get_all_users();
6706
+ if ( is_array( $users ) ) {
6707
+ foreach ( $users as $u ) {
6708
+ if ( $email === trim( strtolower( $u->email ) ) ) {
6709
+ return $u;
6710
+ }
6711
+ }
6712
+ }
6713
+
6714
+ return false;
6715
+ }
6716
+
6717
+ #----------------------------------------------------------------------------------
6718
+ #region Account (Loading, Updates & Activation)
6719
+ #----------------------------------------------------------------------------------
6720
+
6721
+ /***
6722
+ * Load account information (user + site).
6723
+ *
6724
+ * @author Vova Feldman (@svovaf)
6725
+ * @since 1.0.1
6726
+ */
6727
+ private function _load_account() {
6728
+ $this->_logger->entrance();
6729
+
6730
+ $this->do_action( 'before_account_load' );
6731
+
6732
+ $sites = self::get_all_sites();
6733
+ $users = self::get_all_users();
6734
+ $plans = self::get_all_plans();
6735
+ $licenses = self::get_all_licenses();
6736
+
6737
+ if ( $this->_logger->is_on() && is_admin() ) {
6738
+ $this->_logger->log( 'sites = ' . var_export( $sites, true ) );
6739
+ $this->_logger->log( 'users = ' . var_export( $users, true ) );
6740
+ $this->_logger->log( 'plans = ' . var_export( $plans, true ) );
6741
+ $this->_logger->log( 'licenses = ' . var_export( $licenses, true ) );
6742
+ }
6743
+
6744
+ $site = isset( $sites[ $this->_slug ] ) ? $sites[ $this->_slug ] : false;
6745
+
6746
+ if ( is_object( $site ) &&
6747
+ is_numeric( $site->id ) &&
6748
+ is_numeric( $site->user_id ) &&
6749
+ is_object( $site->plan )
6750
+ ) {
6751
+ // Load site.
6752
+ $this->_site = clone $site;
6753
+ $this->_site->plan = $this->_decrypt_entity( $this->_site->plan );
6754
+
6755
+ // Load relevant user.
6756
+ $this->_user = clone $users[ $this->_site->user_id ];
6757
+
6758
+ // Load plans.
6759
+ $this->_plans = $plans[ $this->_slug ];
6760
+ if ( ! is_array( $this->_plans ) || empty( $this->_plans ) ) {
6761
+ $this->_sync_plans();
6762
+ } else {
6763
+ for ( $i = 0, $len = count( $this->_plans ); $i < $len; $i ++ ) {
6764
+ if ( $this->_plans[ $i ] instanceof FS_Plugin_Plan ) {
6765
+ $this->_plans[ $i ] = $this->_decrypt_entity( $this->_plans[ $i ] );
6766
+ } else {
6767
+ unset( $this->_plans[ $i ] );
6768
+ }
6769
+ }
6770
+ }
6771
+
6772
+ // Load licenses.
6773
+ $this->_licenses = array();
6774
+ if ( is_array( $licenses ) &&
6775
+ isset( $licenses[ $this->_slug ] ) &&
6776
+ isset( $licenses[ $this->_slug ][ $this->_user->id ] )
6777
+ ) {
6778
+ $this->_licenses = $licenses[ $this->_slug ][ $this->_user->id ];
6779
+ }
6780
+
6781
+ $this->_license = $this->_get_license_by_id( $this->_site->license_id );
6782
+
6783
+ if ( $this->_site->version != $this->get_plugin_version() ) {
6784
+ // If stored install version is different than current installed plugin version,
6785
+ // then update plugin version event.
6786
+ $this->update_plugin_version_event();
6787
+ }
6788
+ }
6789
+
6790
+ $this->_register_account_hooks();
6791
+ }
6792
+
6793
+ /**
6794
+ * @author Vova Feldman (@svovaf)
6795
+ * @since 1.0.1
6796
+ *
6797
+ * @param FS_User $user
6798
+ * @param FS_Site $site
6799
+ * @param bool|array $plans
6800
+ */
6801
+ private function _set_account( FS_User $user, FS_Site $site, $plans = false ) {
6802
+ $site->slug = $this->_slug;
6803
+ $site->user_id = $user->id;
6804
+
6805
+ $this->_site = $site;
6806
+ $this->_user = $user;
6807
+ if ( false !== $plans ) {
6808
+ $this->_plans = $plans;
6809
+ }
6810
+
6811
+ $this->send_install_update();
6812
+
6813
+ $this->_store_account();
6814
+
6815
+ }
6816
+
6817
+ /**
6818
+ * @author Vova Feldman (@svovaf)
6819
+ * @since 1.1.7.4
6820
+ *
6821
+ * @param array $override_with
6822
+ *
6823
+ * @return array
6824
+ */
6825
+ function get_opt_in_params( $override_with = array() ) {
6826
+ $this->_logger->entrance();
6827
+
6828
+ $current_user = self::_get_current_wp_user();
6829
+
6830
+ $activation_action = $this->_slug . '_activate_new';
6831
+ $return_url = $this->is_anonymous() ?
6832
+ // If skipped already, then return to the account page.
6833
+ $this->get_account_url( $activation_action, array(), false ) :
6834
+ // Return to the module's main page.
6835
+ $this->_get_admin_page_url(
6836
+ '',
6837
+ array( 'fs_action' => $activation_action )
6838
+ );
6839
+
6840
+ $params = array(
6841
+ 'user_firstname' => $current_user->user_firstname,
6842
+ 'user_lastname' => $current_user->user_lastname,
6843
+ 'user_nickname' => $current_user->user_nicename,
6844
+ 'user_email' => $current_user->user_email,
6845
+ 'user_ip' => WP_FS__REMOTE_ADDR,
6846
+ 'plugin_slug' => $this->_slug,
6847
+ 'plugin_id' => $this->get_id(),
6848
+ 'plugin_public_key' => $this->get_public_key(),
6849
+ 'plugin_version' => $this->get_plugin_version(),
6850
+ 'return_url' => fs_nonce_url( $return_url, $activation_action ),
6851
+ 'account_url' => fs_nonce_url( $this->_get_admin_page_url(
6852
+ 'account',
6853
+ array( 'fs_action' => 'sync_user' )
6854
+ ), 'sync_user' ),
6855
+ 'site_uid' => $this->get_anonymous_id(),
6856
+ 'site_url' => get_site_url(),
6857
+ 'site_name' => get_bloginfo( 'name' ),
6858
+ 'platform_version' => get_bloginfo( 'version' ),
6859
+ 'sdk_version' => $this->version,
6860
+ 'programming_language_version' => phpversion(),
6861
+ 'language' => get_bloginfo( 'language' ),
6862
+ 'charset' => get_bloginfo( 'charset' ),
6863
+ 'is_premium' => $this->is_premium(),
6864
+ 'is_active' => true,
6865
+ 'is_uninstalled' => false,
6866
+ );
6867
+
6868
+ if ( $this->is_pending_activation() &&
6869
+ ! empty( $this->_storage->pending_license_key )
6870
+ ) {
6871
+ $params['license_key'] = $this->_storage->pending_license_key;
6872
+ }
6873
+
6874
+ if ( WP_FS__SKIP_EMAIL_ACTIVATION && $this->has_secret_key() ) {
6875
+ // Even though rand() is known for its security issues,
6876
+ // the timestamp adds another layer of protection.
6877
+ // It would be very hard for an attacker to get the secret key form here.
6878
+ // Plus, this should never run in production since the secret should never
6879
+ // be included in the production version.
6880
+ $params['ts'] = WP_FS__SCRIPT_START_TIME;
6881
+ $params['salt'] = md5( uniqid( rand() ) );
6882
+ $params['secure'] = md5(
6883
+ $params['ts'] .
6884
+ $params['salt'] .
6885
+ $this->get_secret_key()
6886
+ );
6887
+ }
6888
+
6889
+ return array_merge( $params, $override_with );
6890
+ }
6891
+
6892
+ /**
6893
+ * 1. If successful opt-in or pending activation returns the next page that the user should be redirected to.
6894
+ * 2. If there was an API error, return the API result.
6895
+ *
6896
+ * @author Vova Feldman (@svovaf)
6897
+ * @since 1.1.7.4
6898
+ *
6899
+ * @param string|bool $email
6900
+ * @param string|bool $first
6901
+ * @param string|bool $last
6902
+ * @param string|bool $license_key
6903
+ * @param bool $is_uninstall If "true", this means that the module is currently being uninstalled.
6904
+ * In this case, the user and site info will be sent to the server but no
6905
+ * data will be saved to the WP installation's database.
6906
+ * @param number|bool $trial_plan_id
6907
+ *
6908
+ * @return string|object
6909
+ * @use WP_Error
6910
+ */
6911
+ function opt_in(
6912
+ $email = false,
6913
+ $first = false,
6914
+ $last = false,
6915
+ $license_key = false,
6916
+ $is_uninstall = false,
6917
+ $trial_plan_id = false
6918
+ ) {
6919
+ $this->_logger->entrance();
6920
+
6921
+ if ( false === $email ) {
6922
+ $current_user = self::_get_current_wp_user();
6923
+ $email = $current_user->user_email;
6924
+ }
6925
+
6926
+ /**
6927
+ * @since 1.2.1 If activating with license key, ignore the context-user
6928
+ * since the user will be automatically loaded from the license.
6929
+ */
6930
+ if ( empty( $license_key ) ) {
6931
+ // Clean up pending license if opt-ing in again.
6932
+ $this->_storage->remove( 'pending_license_key' );
6933
+
6934
+ if ( ! $is_uninstall ) {
6935
+ $fs_user = Freemius::_get_user_by_email( $email );
6936
+ if ( is_object( $fs_user ) && ! $this->is_pending_activation() ) {
6937
+ return $this->install_with_current_user( false, $trial_plan_id );
6938
+ }
6939
+ }
6940
+ }
6941
+
6942
+ $user_info = array();
6943
+ if ( ! empty( $email ) ) {
6944
+ $user_info['user_email'] = $email;
6945
+ }
6946
+ if ( ! empty( $first ) ) {
6947
+ $user_info['user_firstname'] = $first;
6948
+ }
6949
+ if ( ! empty( $last ) ) {
6950
+ $user_info['user_lastname'] = $last;
6951
+ }
6952
+
6953
+ $params = $this->get_opt_in_params( $user_info );
6954
+
6955
+ $filtered_license_key = false;
6956
+ if ( is_string( $license_key ) ) {
6957
+ $filtered_license_key = $this->apply_filters( 'license_key', $license_key );
6958
+ $params['license_key'] = $filtered_license_key;
6959
+ } else if ( FS_Plugin_Plan::is_valid_id( $trial_plan_id ) ) {
6960
+ $params['trial_plan_id'] = $trial_plan_id;
6961
+ }
6962
+
6963
+ if ( $is_uninstall ) {
6964
+ $params['uninstall_params'] = array(
6965
+ 'reason_id' => $this->_storage->uninstall_reason->id,
6966
+ 'reason_info' => $this->_storage->uninstall_reason->info
6967
+ );
6968
+ }
6969
+
6970
+ $params['format'] = 'json';
6971
+
6972
+ $url = WP_FS__ADDRESS . '/action/service/user/install/';
6973
+ if ( isset( $_COOKIE['XDEBUG_SESSION'] ) ) {
6974
+ $url = add_query_arg( 'XDEBUG_SESSION', 'PHPSTORM', $url );
6975
+ }
6976
+
6977
+ $response = wp_remote_post( $url, array(
6978
+ 'method' => 'POST',
6979
+ 'body' => $params,
6980
+ 'timeout' => 15,
6981
+ ) );
6982
+
6983
+ if ( $response instanceof WP_Error ) {
6984
+ if ( 'https://' === substr( $url, 0, 8 ) &&
6985
+ isset( $response->errors ) &&
6986
+ isset( $response->errors['http_request_failed'] )
6987
+ ) {
6988
+ $http_error = strtolower( $response->errors['http_request_failed'][0] );
6989
+
6990
+ if ( false !== strpos( $http_error, 'ssl' ) ) {
6991
+ // Failed due to old version of cURL or Open SSL (SSLv3 is not supported by CloudFlare).
6992
+ $url = 'http://' . substr( $url, 8 );
6993
+
6994
+ $response = wp_remote_post( $url, array(
6995
+ 'method' => 'POST',
6996
+ 'body' => $params,
6997
+ 'timeout' => 15,
6998
+ ) );
6999
+ }
7000
+ }
7001
+ }
7002
+
7003
+ if ( is_wp_error( $response ) ) {
7004
+ /**
7005
+ * @var WP_Error $response
7006
+ */
7007
+ $result = new stdClass();
7008
+
7009
+ $error_code = $response->get_error_code();
7010
+ $error_type = str_replace( ' ', '', ucwords( str_replace( '_', ' ', $error_code ) ) );
7011
+
7012
+ $result->error = (object) array(
7013
+ 'type' => $error_type,
7014
+ 'message' => $response->get_error_message(),
7015
+ 'code' => $error_code,
7016
+ 'http' => 402
7017
+ );
7018
+
7019
+ return $result;
7020
+ }
7021
+
7022
+ // Module is being uninstalled, don't handle the returned data.
7023
+ if ( $is_uninstall ) {
7024
+ return true;
7025
+ }
7026
+
7027
+ $decoded = @json_decode( $response['body'] );
7028
+
7029
+ if ( empty( $decoded ) ) {
7030
+ return false;
7031
+ }
7032
+
7033
+ if ( ! $this->is_api_result_object( $decoded ) ) {
7034
+ if ( ! empty( $params['license_key'] ) ) {
7035
+ // Pass the fully entered license key to the failure handler.
7036
+ $params['license_key'] = $license_key;
7037
+ }
7038
+
7039
+ return $is_uninstall ?
7040
+ $decoded :
7041
+ $this->apply_filters( 'after_install_failure', $decoded, $params );
7042
+ } else if ( isset( $decoded->pending_activation ) && $decoded->pending_activation ) {
7043
+ // Pending activation, add message.
7044
+ return $this->set_pending_confirmation(
7045
+ true,
7046
+ false,
7047
+ $filtered_license_key,
7048
+ ! empty( $params['trial_plan_id'] )
7049
+ );
7050
+ } else if ( isset( $decoded->install_secret_key ) ) {
7051
+ return $this->install_with_new_user(
7052
+ $decoded->user_id,
7053
+ $decoded->user_public_key,
7054
+ $decoded->user_secret_key,
7055
+ $decoded->install_id,
7056
+ $decoded->install_public_key,
7057
+ $decoded->install_secret_key,
7058
+ false
7059
+ );
7060
+ }
7061
+
7062
+ return $decoded;
7063
+ }
7064
+
7065
+ /**
7066
+ * Set user and site identities.
7067
+ *
7068
+ * @author Vova Feldman (@svovaf)
7069
+ * @since 1.0.9
7070
+ *
7071
+ * @param FS_User $user
7072
+ * @param FS_Site $site
7073
+ * @param bool $redirect
7074
+ *
7075
+ * @return string If redirect is `false`, returns the next page the user should be redirected to.
7076
+ */
7077
+ function setup_account( FS_User $user, FS_Site $site, $redirect = true ) {
7078
+ $this->_user = $user;
7079
+ $this->_site = $site;
7080
+
7081
+ $this->_sync_plans();
7082
+
7083
+ $this->_enrich_site_plan( false );
7084
+
7085
+ $this->_set_account( $user, $site );
7086
+
7087
+ if ( $this->is_trial() ) {
7088
+ // Store trial plan information.
7089
+ $this->_enrich_site_trial_plan( true );
7090
+ }
7091
+
7092
+ // If Freemius was OFF before, turn it on.
7093
+ $this->turn_on();
7094
+
7095
+ $this->do_action( 'after_account_connection', $user, $site );
7096
+
7097
+ if ( is_numeric( $site->license_id ) ) {
7098
+ $this->_license = $this->_get_license_by_id( $site->license_id );
7099
+ }
7100
+
7101
+ $this->_admin_notices->remove_sticky( 'connect_account' );
7102
+
7103
+ if ( $this->is_pending_activation() ) {
7104
+ // Remove pending activation sticky notice (if still exist).
7105
+ $this->_admin_notices->remove_sticky( 'activation_pending' );
7106
+
7107
+ // Remove plugin from pending activation mode.
7108
+ unset( $this->_storage->is_pending_activation );
7109
+
7110
+ if ( ! $this->is_paying_or_trial() ) {
7111
+ $this->_admin_notices->add_sticky(
7112
+ sprintf( __fs( 'plugin-x-activation-message', $this->_slug ), '<b>' . $this->get_plugin_name() . '</b>' ),
7113
+ 'activation_complete'
7114
+ );
7115
+ }
7116
+ }
7117
+
7118
+ if ( $this->is_paying_or_trial() ) {
7119
+ if ( ! $this->is_premium() || ! $this->has_premium_version() ) {
7120
+ if ( $this->is_paying() ) {
7121
+ $this->_admin_notices->add_sticky(
7122
+ sprintf(
7123
+ __fs( 'activation-with-plan-x-message', $this->_slug ),
7124
+ $this->_site->plan->title
7125
+ ) . $this->get_complete_upgrade_instructions(),
7126
+ 'plan_upgraded',
7127
+ __fs( 'yee-haw', $this->_slug ) . '!'
7128
+ );
7129
+ } else {
7130
+ $this->_admin_notices->add_sticky(
7131
+ sprintf(
7132
+ __fs( 'trial-started-message', $this->_slug ),
7133
+ '<i>' . $this->get_plugin_name() . '</i>'
7134
+ ) . $this->get_complete_upgrade_instructions( $this->_storage->trial_plan->title ),
7135
+ 'trial_started',
7136
+ __fs( 'yee-haw', $this->_slug ) . '!'
7137
+ );
7138
+ }
7139
+ }
7140
+
7141
+ $this->_admin_notices->remove_sticky( array(
7142
+ 'trial_promotion',
7143
+ ) );
7144
+ }
7145
+
7146
+ $plugin_id = fs_request_get( 'plugin_id', false );
7147
+
7148
+ // Store activation time ONLY for plugins (not add-ons).
7149
+ if ( ! is_numeric( $plugin_id ) || ( $plugin_id == $this->_plugin->id ) ) {
7150
+ $this->_storage->activation_timestamp = WP_FS__SCRIPT_START_TIME;
7151
+ }
7152
+
7153
+ $next_page = '';
7154
+
7155
+ if ( is_numeric( $plugin_id ) ) {
7156
+ /**
7157
+ * @author Leo Fajardo
7158
+ * @since 1.2.1.6
7159
+ *
7160
+ * Also sync the license after an anonymous user subscribes.
7161
+ */
7162
+ if ( $this->is_anonymous() || $plugin_id != $this->_plugin->id ) {
7163
+ // Add-on was installed - sync license right after install.
7164
+ $next_page = $this->_get_sync_license_url( $plugin_id );
7165
+ }
7166
+ } else {
7167
+ /**
7168
+ * @author Vova Feldman (@svovaf)
7169
+ * @since 1.1.9 If site installed with a valid license, sync license.
7170
+ */
7171
+ if ( $this->is_paying() ) {
7172
+ $this->_sync_plugin_license( true );
7173
+ }
7174
+
7175
+ // Reload the page with the keys.
7176
+ $next_page = $this->is_anonymous() ?
7177
+ // If user previously skipped, redirect to account page.
7178
+ $this->get_account_url() :
7179
+ $this->get_after_activation_url( 'after_connect_url' );
7180
+ }
7181
+
7182
+ if ( ! empty( $next_page ) && $redirect ) {
7183
+ fs_redirect( $next_page );
7184
+ }
7185
+
7186
+ return $next_page;
7187
+ }
7188
+
7189
+ /**
7190
+ * Install plugin with new user information after approval.
7191
+ *
7192
+ * @author Vova Feldman (@svovaf)
7193
+ * @since 1.0.7
7194
+ */
7195
+ function _install_with_new_user() {
7196
+ $this->_logger->entrance();
7197
+
7198
+ if ( $this->is_registered() ) {
7199
+ return;
7200
+ }
7201
+
7202
+ if ( fs_request_is_action( $this->_slug . '_activate_new' ) ) {
7203
+ // check_admin_referer( $this->_slug . '_activate_new' );
7204
+
7205
+ if ( fs_request_has( 'user_secret_key' ) ) {
7206
+ $this->install_with_new_user(
7207
+ fs_request_get( 'user_id' ),
7208
+ fs_request_get( 'user_public_key' ),
7209
+ fs_request_get( 'user_secret_key' ),
7210
+ fs_request_get( 'install_id' ),
7211
+ fs_request_get( 'install_public_key' ),
7212
+ fs_request_get( 'install_secret_key' )
7213
+ );
7214
+ } else if ( fs_request_has( 'pending_activation' ) ) {
7215
+ $this->set_pending_confirmation( fs_request_get( 'user_email' ), true );
7216
+ }
7217
+ }
7218
+ }
7219
+
7220
+ /**
7221
+ * Install plugin with new user.
7222
+ *
7223
+ * @author Vova Feldman (@svovaf)
7224
+ * @since 1.1.7.4
7225
+ *
7226
+ * @param number $user_id
7227
+ * @param string $user_public_key
7228
+ * @param string $user_secret_key
7229
+ * @param number $install_id
7230
+ * @param string $install_public_key
7231
+ * @param string $install_secret_key
7232
+ * @param bool $redirect
7233
+ *
7234
+ * @return string If redirect is `false`, returns the next page the user should be redirected to.
7235
+ */
7236
+ private function install_with_new_user(
7237
+ $user_id,
7238
+ $user_public_key,
7239
+ $user_secret_key,
7240
+ $install_id,
7241
+ $install_public_key,
7242
+ $install_secret_key,
7243
+ $redirect = true
7244
+ ) {
7245
+ $user = new FS_User();
7246
+ $user->id = $user_id;
7247
+ $user->public_key = $user_public_key;
7248
+ $user->secret_key = $user_secret_key;
7249
+
7250
+ $this->_user = $user;
7251
+ $user_result = $this->get_api_user_scope()->get();
7252
+ $user = new FS_User( $user_result );
7253
+ $this->_user = $user;
7254
+
7255
+ $site = new FS_Site();
7256
+ $site->id = $install_id;
7257
+ $site->public_key = $install_public_key;
7258
+ $site->secret_key = $install_secret_key;
7259
+
7260
+ $this->_site = $site;
7261
+ $site_result = $this->get_api_site_scope()->get();
7262
+ $site = new FS_Site( $site_result );
7263
+ $this->_site = $site;
7264
+
7265
+ return $this->setup_account( $this->_user, $this->_site, $redirect );
7266
+ }
7267
+
7268
+ /**
7269
+ * @author Vova Feldman (@svovaf)
7270
+ * @since 1.1.7.4
7271
+ *
7272
+ * @param string|bool $email
7273
+ * @param bool $redirect
7274
+ * @param string|bool $license_key Since 1.2.1.5
7275
+ * @param bool $is_pending_trial Since 1.2.1.5
7276
+ *
7277
+ * @return string Since 1.2.1.5 if $redirect is `false`, return the pending activation page.
7278
+ */
7279
+ private function set_pending_confirmation(
7280
+ $email = false,
7281
+ $redirect = true,
7282
+ $license_key = false,
7283
+ $is_pending_trial = false
7284
+ ) {
7285
+ if ( $this->_ignore_pending_mode ) {
7286
+ /**
7287
+ * If explicitly asked to ignore pending mode, set to anonymous mode
7288
+ * if require confirmation before finalizing the opt-in.
7289
+ *
7290
+ * @author Vova Feldman
7291
+ * @since 1.2.1.6
7292
+ */
7293
+ $this->skip_connection();
7294
+ } else {
7295
+ // Install must be activated via email since
7296
+ // user with the same email already exist.
7297
+ $this->_storage->is_pending_activation = true;
7298
+ $this->_add_pending_activation_notice( $email, $is_pending_trial );
7299
+ }
7300
+
7301
+ if ( ! empty( $license_key ) ) {
7302
+ $this->_storage->pending_license_key = $license_key;
7303
+ }
7304
+
7305
+ // Remove the opt-in sticky notice.
7306
+ $this->_admin_notices->remove_sticky( array(
7307
+ 'connect_account',
7308
+ 'trial_promotion',
7309
+ ) );
7310
+
7311
+ $next_page = $this->get_after_activation_url( 'after_pending_connect_url' );
7312
+
7313
+ // Reload the page with with pending activation message.
7314
+ if ( $redirect ) {
7315
+ fs_redirect( $next_page );
7316
+ }
7317
+
7318
+ return $next_page;
7319
+ }
7320
+
7321
+ /**
7322
+ * Install plugin with current logged WP user info.
7323
+ *
7324
+ * @author Vova Feldman (@svovaf)
7325
+ * @since 1.0.7
7326
+ */
7327
+ function _install_with_current_user() {
7328
+ $this->_logger->entrance();
7329
+
7330
+ if ( $this->is_registered() ) {
7331
+ return;
7332
+ }
7333
+
7334
+ if ( fs_request_is_action( $this->_slug . '_activate_existing' ) && fs_request_is_post() ) {
7335
+ // check_admin_referer( 'activate_existing_' . $this->_plugin->public_key );
7336
+
7337
+ /**
7338
+ * @author Vova Feldman (@svovaf)
7339
+ * @since 1.1.9 Add license key if given.
7340
+ */
7341
+ $license_key = fs_request_get( 'license_secret_key' );
7342
+
7343
+ $this->install_with_current_user( $license_key );
7344
+ }
7345
+ }
7346
+
7347
+
7348
+ /**
7349
+ * @author Vova Feldman (@svovaf)
7350
+ * @since 1.1.7.4
7351
+ *
7352
+ * @param string|bool $license_key
7353
+ * @param number|bool $trial_plan_id
7354
+ * @param bool $redirect
7355
+ *
7356
+ * @return string|object If redirect is `false`, returns the next page the user should be redirected to, or the
7357
+ * API error object if failed to install.
7358
+ */
7359
+ private function install_with_current_user(
7360
+ $license_key = false,
7361
+ $trial_plan_id = false,
7362
+ $redirect = true
7363
+ ) {
7364
+ // Get current logged WP user.
7365
+ $current_user = self::_get_current_wp_user();
7366
+
7367
+ // Find the relevant FS user by the email.
7368
+ $user = self::_get_user_by_email( $current_user->user_email );
7369
+
7370
+ // We have to set the user before getting user scope API handler.
7371
+ $this->_user = $user;
7372
+
7373
+ $extra_install_params = array(
7374
+ 'uid' => $this->get_anonymous_id(),
7375
+ );
7376
+
7377
+ if ( ! empty( $license_key ) ) {
7378
+ $filtered_license_key = $this->apply_filters( 'license_key', $license_key );
7379
+ $extra_install_params['license_key'] = $filtered_license_key;
7380
+ } else if ( FS_Plugin_Plan::is_valid_id( $trial_plan_id ) ) {
7381
+ $extra_install_params['trial_plan_id'] = $trial_plan_id;
7382
+ }
7383
+
7384
+ $args = $this->get_install_data_for_api( $extra_install_params, false, false );
7385
+
7386
+ // Install the plugin.
7387
+ $install = $this->get_api_user_scope()->call(
7388
+ "/plugins/{$this->get_id()}/installs.json",
7389
+ 'post',
7390
+ $args
7391
+ );
7392
+
7393
+ if ( ! $this->is_api_result_entity( $install ) ) {
7394
+ if ( ! empty( $args['license_key'] ) ) {
7395
+ // Pass full the fully entered license key to the failure handler.
7396
+ $args['license_key'] = $license_key;
7397
+ }
7398
+
7399
+ $install = $this->apply_filters( 'after_install_failure', $install, $args );
7400
+
7401
+ $this->_admin_notices->add(
7402
+ sprintf( __fs( 'could-not-activate-x', $this->_slug ), $this->get_plugin_name() ) . ' ' .
7403
+ __fs( 'contact-us-with-error-message', $this->_slug ) . ' ' . '<b>' . $install->error->message . '</b>',
7404
+ __fs( 'oops', $this->_slug ) . '...',
7405
+ 'error'
7406
+ );
7407
+
7408
+ if ( $redirect ) {
7409
+ fs_redirect( $this->get_activation_url( array( 'error' => $install->error->message ) ) );
7410
+ }
7411
+
7412
+ return $install;
7413
+ }
7414
+
7415
+ $site = new FS_Site( $install );
7416
+ $this->_site = $site;
7417
+
7418
+ return $this->setup_account( $this->_user, $this->_site, $redirect );
7419
+ }
7420
+
7421
+ /**
7422
+ * Tries to activate add-on account based on parent plugin info.
7423
+ *
7424
+ * @author Vova Feldman (@svovaf)
7425
+ * @since 1.0.6
7426
+ *
7427
+ * @param Freemius $parent_fs
7428
+ */
7429
+ private function _activate_addon_account( Freemius $parent_fs ) {
7430
+ if ( $this->is_registered() ) {
7431
+ // Already activated.
7432
+ return;
7433
+ }
7434
+
7435
+ // Activate add-on with parent plugin credentials.
7436
+ $addon_install = $parent_fs->get_api_site_scope()->call(
7437
+ "/addons/{$this->_plugin->id}/installs.json",
7438
+ 'post',
7439
+ $this->get_install_data_for_api( array(
7440
+ 'uid' => $this->get_anonymous_id(),
7441
+ ), false, false )
7442
+ );
7443
+
7444
+ if ( isset( $addon_install->error ) ) {
7445
+ $this->_admin_notices->add(
7446
+ sprintf( __fs( 'could-not-activate-x', $this->_slug ), $this->get_plugin_name() ) . ' ' .
7447
+ __fs( 'contact-us-with-error-message', $this->_slug ) . ' ' . '<b>' . $addon_install->error->message . '</b>',
7448
+ __fs( 'oops', $this->_slug ) . '...',
7449
+ 'error'
7450
+ );
7451
+
7452
+ return;
7453
+ }
7454
+
7455
+ // First of all, set site info - otherwise we won't
7456
+ // be able to invoke API calls.
7457
+ $this->_site = new FS_Site( $addon_install );
7458
+
7459
+ // Sync add-on plans.
7460
+ $this->_sync_plans();
7461
+
7462
+ // Get site's current plan.
7463
+ $this->_site->plan = $this->_get_plan_by_id( $this->_site->plan->id );
7464
+
7465
+ // Get user information based on parent's plugin.
7466
+ $user = $parent_fs->get_user();
7467
+
7468
+ $this->_set_account( $user, $this->_site );
7469
+
7470
+ // Sync licenses.
7471
+ $this->_sync_licenses();
7472
+
7473
+ // Try to activate premium license.
7474
+ $this->_activate_license( true );
7475
+ }
7476
+
7477
+ #endregion
7478
+
7479
+ #----------------------------------------------------------------------------------
7480
+ #region Admin Menu Items
7481
+ #----------------------------------------------------------------------------------
7482
+
7483
+ private $_menu_items = array();
7484
+
7485
+ /**
7486
+ * @author Vova Feldman (@svovaf)
7487
+ * @since 1.0.7
7488
+ *
7489
+ * @return string
7490
+ */
7491
+ function get_menu_slug() {
7492
+ return $this->_menu->get_slug();
7493
+ }
7494
+
7495
+ /**
7496
+ * @author Vova Feldman (@svovaf)
7497
+ * @since 1.0.9
7498
+ */
7499
+ function _prepare_admin_menu() {
7500
+ // if ( ! $this->is_on() ) {
7501
+ // return;
7502
+ // }
7503
+
7504
+ if ( ! $this->has_api_connectivity() && ! $this->is_enable_anonymous() ) {
7505
+ $this->_menu->remove_menu_item();
7506
+ } else {
7507
+ $this->do_action( 'before_admin_menu_init' );
7508
+
7509
+ $this->add_menu_action();
7510
+ $this->add_submenu_items();
7511
+ }
7512
+ }
7513
+
7514
+ /**
7515
+ * Admin dashboard menu items modifications.
7516
+ *
7517
+ * NOTE: admin_menu action executed before admin_init.
7518
+ *
7519
+ * @author Vova Feldman (@svovaf)
7520
+ * @since 1.0.7
7521
+ *
7522
+ */
7523
+ private function add_menu_action() {
7524
+ if ( $this->is_activation_mode() ) {
7525
+ $this->override_plugin_menu_with_activation();
7526
+ } else {
7527
+ // If not registered try to install user.
7528
+ if ( ! $this->is_registered() &&
7529
+ fs_request_is_action( $this->_slug . '_activate_new' )
7530
+ ) {
7531
+ $this->_install_with_new_user();
7532
+ }
7533
+ }
7534
+ }
7535
+
7536
+ /**
7537
+ * @author Vova Feldman (@svovaf)
7538
+ * @since 1.0.1
7539
+ */
7540
+ function _redirect_on_clicked_menu_link() {
7541
+ $this->_logger->entrance();
7542
+
7543
+ $page = strtolower( isset( $_REQUEST['page'] ) ? $_REQUEST['page'] : '' );
7544
+
7545
+ $this->_logger->log( 'page = ' . $page );
7546
+
7547
+ foreach ( $this->_menu_items as $priority => $items ) {
7548
+ foreach ( $items as $item ) {
7549
+ if ( isset( $item['url'] ) ) {
7550
+ if ( $page === $this->_menu->get_slug( strtolower( $item['menu_slug'] ) ) ) {
7551
+ $this->_logger->log( 'Redirecting to ' . $item['url'] );
7552
+
7553
+ fs_redirect( $item['url'] );
7554
+ }
7555
+ }
7556
+ }
7557
+ }
7558
+ }
7559
+
7560
+ /**
7561
+ * Remove plugin's all admin menu items & pages, and replace with activation page.
7562
+ *
7563
+ * @author Vova Feldman (@svovaf)
7564
+ * @since 1.0.1
7565
+ */
7566
+ private function override_plugin_menu_with_activation() {
7567
+ $this->_logger->entrance();
7568
+
7569
+ $hook = false;
7570
+
7571
+ if ( ! $this->_menu->has_menu_slug() ) {
7572
+ // Add the opt-in page without a menu item.
7573
+ $hook = add_submenu_page(
7574
+ null,
7575
+ $this->get_plugin_name(),
7576
+ $this->get_plugin_name(),
7577
+ 'manage_options',
7578
+ $this->_slug,
7579
+ array( &$this, '_connect_page_render' )
7580
+ );
7581
+ } else if ( $this->_menu->is_top_level() ) {
7582
+ $hook = $this->_menu->override_menu_item( array( &$this, '_connect_page_render' ) );
7583
+
7584
+ if ( false === $hook ) {
7585
+ // Create new menu item just for the opt-in.
7586
+ $hook = add_menu_page(
7587
+ $this->get_plugin_name(),
7588
+ $this->get_plugin_name(),
7589
+ 'manage_options',
7590
+ $this->_menu->get_slug(),
7591
+ array( &$this, '_connect_page_render' )
7592
+ );
7593
+ }
7594
+ } else {
7595
+ $menus = array( $this->_menu->get_parent_slug() );
7596
+
7597
+ if ( $this->_menu->is_override_exact() ) {
7598
+ // Make sure the current page is matching the activation page.
7599
+ $activation_url = strtolower( $this->get_activation_url() );
7600
+ $request_url = strtolower( $_SERVER['REQUEST_URI'] );
7601
+
7602
+ if ( parse_url( $activation_url, PHP_URL_PATH ) !== parse_url( $request_url, PHP_URL_PATH ) ) {
7603
+ // Different path - DO NOT OVERRIDE PAGE.
7604
+ return;
7605
+ }
7606
+
7607
+ $activation_url_params = array();
7608
+ parse_str( parse_url( $activation_url, PHP_URL_QUERY ), $activation_url_params );
7609
+
7610
+ $request_url_params = array();
7611
+ parse_str( parse_url( $request_url, PHP_URL_QUERY ), $request_url_params );
7612
+
7613
+
7614
+ foreach ( $activation_url_params as $key => $val ) {
7615
+ if ( ! isset( $request_url_params[ $key ] ) || $val != $request_url_params[ $key ] ) {
7616
+ // Not matching query string - DO NOT OVERRIDE PAGE.
7617
+ return;
7618
+ }
7619
+ }
7620
+ }
7621
+
7622
+ foreach ( $menus as $parent_slug ) {
7623
+ $hook = $this->_menu->override_submenu_action(
7624
+ $parent_slug,
7625
+ $this->_menu->get_raw_slug(),
7626
+ array( &$this, '_connect_page_render' )
7627
+ );
7628
+
7629
+ if ( false !== $hook ) {
7630
+ // Found plugin's submenu item.
7631
+ break;
7632
+ }
7633
+ }
7634
+ }
7635
+
7636
+ if ( $this->_menu->is_activation_page() ) {
7637
+ // Clean admin page from distracting content.
7638
+ self::_clean_admin_content_section();
7639
+ }
7640
+
7641
+ if ( false !== $hook ) {
7642
+ if ( fs_request_is_action( $this->_slug . '_activate_existing' ) ) {
7643
+ add_action( "load-$hook", array( &$this, '_install_with_current_user' ) );
7644
+ } else if ( fs_request_is_action( $this->_slug . '_activate_new' ) ) {
7645
+ add_action( "load-$hook", array( &$this, '_install_with_new_user' ) );
7646
+ }
7647
+ }
7648
+ }
7649
+
7650
+ /**
7651
+ * @author Leo Fajardo (leorw)
7652
+ * @since 1.2.1
7653
+ *
7654
+ * return string
7655
+ */
7656
+ function get_top_level_menu_capability() {
7657
+ global $menu;
7658
+
7659
+ $top_level_menu_slug = $this->get_top_level_menu_slug();
7660
+
7661
+ foreach ( $menu as $menu_info ) {
7662
+ /**
7663
+ * The second element in the menu info array is the capability/role that has access to the menu and the
7664
+ * third element is the menu slug.
7665
+ */
7666
+ if ( $menu_info[2] === $top_level_menu_slug ) {
7667
+ return $menu_info[1];
7668
+ }
7669
+ }
7670
+
7671
+ return 'read';
7672
+ }
7673
+
7674
+ /**
7675
+ * @author Vova Feldman (@svovaf)
7676
+ * @since 1.0.0
7677
+ *
7678
+ * @return string
7679
+ */
7680
+ private function get_top_level_menu_slug() {
7681
+ return ( $this->is_addon() ?
7682
+ $this->get_parent_instance()->_menu->get_top_level_menu_slug() :
7683
+ $this->_menu->get_top_level_menu_slug() );
7684
+ }
7685
+
7686
+ /**
7687
+ * Add default Freemius menu items.
7688
+ *
7689
+ * @author Vova Feldman (@svovaf)
7690
+ * @since 1.0.0
7691
+ */
7692
+ private function add_submenu_items() {
7693
+ $this->_logger->entrance();
7694
+
7695
+ if ( ! $this->is_addon() ) {
7696
+ if ( ! $this->is_activation_mode() ) {
7697
+ if ( $this->is_registered() ) {
7698
+ // Add user account page.
7699
+ $this->add_submenu_item(
7700
+ __fs( 'account', $this->_slug ),
7701
+ array( &$this, '_account_page_render' ),
7702
+ $this->get_plugin_name() . ' &ndash; ' . __fs( 'account', $this->_slug ),
7703
+ 'manage_options',
7704
+ 'account',
7705
+ array( &$this, '_account_page_load' ),
7706
+ WP_FS__DEFAULT_PRIORITY,
7707
+ $this->_menu->is_submenu_item_visible( 'account' )
7708
+ );
7709
+ }
7710
+
7711
+ // Add contact page.
7712
+ $this->add_submenu_item(
7713
+ __fs( 'contact-us', $this->_slug ),
7714
+ array( &$this, '_contact_page_render' ),
7715
+ $this->get_plugin_name() . ' &ndash; ' . __fs( 'contact-us', $this->_slug ),
7716
+ 'manage_options',
7717
+ 'contact',
7718
+ 'Freemius::_clean_admin_content_section',
7719
+ WP_FS__DEFAULT_PRIORITY,
7720
+ $this->_menu->is_submenu_item_visible( 'contact' )
7721
+ );
7722
+
7723
+ if ( $this->has_addons() ) {
7724
+ $this->add_submenu_item(
7725
+ __fs( 'add-ons', $this->_slug ),
7726
+ array( &$this, '_addons_page_render' ),
7727
+ $this->get_plugin_name() . ' &ndash; ' . __fs( 'add-ons', $this->_slug ),
7728
+ 'manage_options',
7729
+ 'addons',
7730
+ array( &$this, '_addons_page_load' ),
7731
+ WP_FS__LOWEST_PRIORITY - 1,
7732
+ $this->_menu->is_submenu_item_visible( 'addons' )
7733
+ );
7734
+ }
7735
+
7736
+ $show_pricing = ( $this->has_paid_plan() && $this->_menu->is_submenu_item_visible( 'pricing' ) );
7737
+ // If user don't have paid plans, add pricing page
7738
+ // to support add-ons checkout but don't add the submenu item.
7739
+ // || (isset( $_GET['page'] ) && $this->_menu->get_slug( 'pricing' ) == $_GET['page']);
7740
+
7741
+ $pricing_cta_slug = 'upgrade';
7742
+ $pricing_class = 'upgrade-mode';
7743
+ if ( $show_pricing ) {
7744
+ if ( $this->_admin_notices->has_sticky( 'trial_promotion' ) &&
7745
+ ! $this->is_paying_or_trial()
7746
+ ) {
7747
+ // If running a trial promotion, modify the pricing to load the trial.
7748
+ $pricing_cta_slug = 'start-trial';
7749
+ $pricing_class = 'trial-mode';
7750
+ } else if ( $this->is_paying() ) {
7751
+ $pricing_cta_slug = 'pricing';
7752
+ $pricing_class = '';
7753
+ }
7754
+ }
7755
+
7756
+ // Add upgrade/pricing page.
7757
+ $this->add_submenu_item(
7758
+ __fs( $pricing_cta_slug, $this->_slug ) . '&nbsp;&nbsp;&#x27a4;',
7759
+ array( &$this, '_pricing_page_render' ),
7760
+ $this->get_plugin_name() . ' &ndash; ' . __fs( 'pricing', $this->_slug ),
7761
+ 'manage_options',
7762
+ 'pricing',
7763
+ 'Freemius::_clean_admin_content_section',
7764
+ WP_FS__LOWEST_PRIORITY,
7765
+ $show_pricing,
7766
+ $pricing_class
7767
+ );
7768
+ }
7769
+ }
7770
+
7771
+
7772
+ if ( 0 < count( $this->_menu_items ) ) {
7773
+ if ( ! $this->_menu->is_top_level() ) {
7774
+ fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
7775
+
7776
+ // Append submenu items right after the plugin's submenu item.
7777
+ $this->order_sub_submenu_items();
7778
+ } else {
7779
+ // Append submenu items.
7780
+ $this->embed_submenu_items();
7781
+ }
7782
+ }
7783
+ }
7784
+
7785
+ /**
7786
+ * Moved the actual submenu item additions to a separated function,
7787
+ * in order to support sub-submenu items when the plugin's settings
7788
+ * only have a submenu and not top-level menu item.
7789
+ *
7790
+ * @author Vova Feldman (@svovaf)
7791
+ * @since 1.1.4
7792
+ */
7793
+ private function embed_submenu_items() {
7794
+ $item_template = $this->_menu->is_top_level() ?
7795
+ '<span class="fs-submenu-item %s %s %s">%s</span>' :
7796
+ '<span class="fs-submenu-item fs-sub %s %s %s">%s</span>';
7797
+
7798
+ $top_level_menu_capability = $this->get_top_level_menu_capability();
7799
+
7800
+ ksort( $this->_menu_items );
7801
+
7802
+ foreach ( $this->_menu_items as $priority => $items ) {
7803
+ foreach ( $items as $item ) {
7804
+ $capability = ( ! empty( $item['capability'] ) ? $item['capability'] : $top_level_menu_capability );
7805
+
7806
+ $menu_item = sprintf(
7807
+ $item_template,
7808
+ $this->_slug,
7809
+ $item['menu_slug'],
7810
+ ! empty( $item['class'] ) ? $item['class'] : '',
7811
+ $item['menu_title']
7812
+ );
7813
+
7814
+ $menu_slug = $this->_menu->get_slug( $item['menu_slug'] );
7815
+
7816
+ if ( ! isset( $item['url'] ) ) {
7817
+ $hook = add_submenu_page(
7818
+ $item['show_submenu'] ?
7819
+ $this->get_top_level_menu_slug() :
7820
+ null,
7821
+ $item['page_title'],
7822
+ $menu_item,
7823
+ $capability,
7824
+ $menu_slug,
7825
+ $item['render_function']
7826
+ );
7827
+
7828
+ if ( false !== $item['before_render_function'] ) {
7829
+ add_action( "load-$hook", $item['before_render_function'] );
7830
+ }
7831
+ } else {
7832
+ add_submenu_page(
7833
+ $this->get_top_level_menu_slug(),
7834
+ $item['page_title'],
7835
+ $menu_item,
7836
+ $capability,
7837
+ $menu_slug,
7838
+ array( $this, '' )
7839
+ );
7840
+ }
7841
+ }
7842
+ }
7843
+ }
7844
+
7845
+ /**
7846
+ * Re-order the submenu items so all Freemius added new submenu items
7847
+ * are added right after the plugin's settings submenu item.
7848
+ *
7849
+ * @author Vova Feldman (@svovaf)
7850
+ * @since 1.1.4
7851
+ */
7852
+ private function order_sub_submenu_items() {
7853
+ global $submenu;
7854
+
7855
+ $menu_slug = $this->_menu->get_top_level_menu_slug();
7856
+
7857
+ /**
7858
+ * Before "admin_menu" fires, WordPress will loop over the default submenus and remove pages for which the user
7859
+ * does not have permissions. So in case a plugin does not have top-level menu but does have submenus under any
7860
+ * of the default menus, only users that have the right role can access its sub-submenus (Account, Contact Us,
7861
+ * Support Forum, etc.) since $submenu[ $menu_slug ] will be empty if the user doesn't have permission.
7862
+ *
7863
+ * In case a plugin does not have submenus under any of the default menus but does have submenus under the menu
7864
+ * of another plugin, only users that have the right role can access its sub-submenus since we will use the
7865
+ * capability needed to access the parent menu as the capability for the submenus that we will add.
7866
+ */
7867
+ if ( empty( $submenu[ $menu_slug ] ) ) {
7868
+ return;
7869
+ }
7870
+
7871
+ $top_level_menu = &$submenu[ $menu_slug ];
7872
+
7873
+ $all_submenu_items_after = array();
7874
+
7875
+ $found_submenu_item = false;
7876
+
7877
+ foreach ( $top_level_menu as $submenu_id => $meta ) {
7878
+ if ( $found_submenu_item ) {
7879
+ // Remove all submenu items after the plugin's submenu item.
7880
+ $all_submenu_items_after[] = $meta;
7881
+ unset( $top_level_menu[ $submenu_id ] );
7882
+ }
7883
+
7884
+ if ( $this->_menu->get_raw_slug() === $meta[2] ) {
7885
+ // Found the submenu item, put all below.
7886
+ $found_submenu_item = true;
7887
+ continue;
7888
+ }
7889
+ }
7890
+
7891
+ // Embed all plugin's new submenu items.
7892
+ $this->embed_submenu_items();
7893
+
7894
+ // Start with specially high number to make sure it's appended.
7895
+ $i = max( 10000, max( array_keys( $top_level_menu ) ) + 1 );
7896
+ foreach ( $all_submenu_items_after as $meta ) {
7897
+ $top_level_menu[ $i ] = $meta;
7898
+ $i ++;
7899
+ }
7900
+
7901
+ // Sort submenu items.
7902
+ ksort( $top_level_menu );
7903
+ }
7904
+
7905
+ /**
7906
+ * Displays the Support Forum link when enabled.
7907
+ *
7908
+ * Can be filtered like so:
7909
+ *
7910
+ * function _fs_show_support_menu( $is_visible, $menu_id ) {
7911
+ * if ( 'support' === $menu_id ) {
7912
+ * return _fs->is_registered();
7913
+ * }
7914
+ * return $is_visible;
7915
+ * }
7916
+ * _fs()->add_filter('is_submenu_visible', '_fs_show_support_menu', 10, 2);
7917
+ *
7918
+ */
7919
+ function _add_default_submenu_items() {
7920
+ if ( ! $this->is_on() ) {
7921
+ return;
7922
+ }
7923
+
7924
+ if ( ! $this->is_activation_mode() ) {
7925
+ if ( $this->_menu->is_submenu_item_visible( 'support' ) ) {
7926
+ $this->add_submenu_link_item(
7927
+ $this->apply_filters( 'support_forum_submenu', __fs( 'support-forum', $this->_slug ) ),
7928
+ $this->apply_filters( 'support_forum_url', 'https://wordpress.org/support/plugin/' . $this->_slug ),
7929
+ 'wp-support-forum',
7930
+ null,
7931
+ 50
7932
+ );
7933
+ }
7934
+ }
7935
+ }
7936
+
7937
+ /**
7938
+ * @author Vova Feldman (@svovaf)
7939
+ * @since 1.0.1
7940
+ *
7941
+ * @param string $menu_title
7942
+ * @param callable $render_function
7943
+ * @param bool|string $page_title
7944
+ * @param string $capability
7945
+ * @param bool|string $menu_slug
7946
+ * @param bool|callable $before_render_function
7947
+ * @param int $priority
7948
+ * @param bool $show_submenu
7949
+ * @param string $class Since 1.2.1.5 can add custom classes to menu items.
7950
+ */
7951
+ function add_submenu_item(
7952
+ $menu_title,
7953
+ $render_function,
7954
+ $page_title = false,
7955
+ $capability = 'manage_options',
7956
+ $menu_slug = false,
7957
+ $before_render_function = false,
7958
+ $priority = WP_FS__DEFAULT_PRIORITY,
7959
+ $show_submenu = true,
7960
+ $class = ''
7961
+ ) {
7962
+ $this->_logger->entrance( 'Title = ' . $menu_title );
7963
+
7964
+ if ( $this->is_addon() ) {
7965
+ $parent_fs = $this->get_parent_instance();
7966
+
7967
+ if ( is_object( $parent_fs ) ) {
7968
+ $parent_fs->add_submenu_item(
7969
+ $menu_title,
7970
+ $render_function,
7971
+ $page_title,
7972
+ $capability,
7973
+ $menu_slug,
7974
+ $before_render_function,
7975
+ $priority,
7976
+ $show_submenu,
7977
+ $class
7978
+ );
7979
+
7980
+ return;
7981
+ }
7982
+ }
7983
+
7984
+ if ( ! isset( $this->_menu_items[ $priority ] ) ) {
7985
+ $this->_menu_items[ $priority ] = array();
7986
+ }
7987
+
7988
+ $this->_menu_items[ $priority ][] = array(
7989
+ 'page_title' => is_string( $page_title ) ? $page_title : $menu_title,
7990
+ 'menu_title' => $menu_title,
7991
+ 'capability' => $capability,
7992
+ 'menu_slug' => is_string( $menu_slug ) ? $menu_slug : strtolower( $menu_title ),
7993
+ 'render_function' => $render_function,
7994
+ 'before_render_function' => $before_render_function,
7995
+ 'show_submenu' => $show_submenu,
7996
+ 'class' => $class,
7997
+ );
7998
+ }
7999
+
8000
+ /**
8001
+ * @author Vova Feldman (@svovaf)
8002
+ * @since 1.0.1
8003
+ *
8004
+ * @param string $menu_title
8005
+ * @param string $url
8006
+ * @param bool $menu_slug
8007
+ * @param string $capability
8008
+ * @param int $priority
8009
+ *
8010
+ */
8011
+ function add_submenu_link_item(
8012
+ $menu_title,
8013
+ $url,
8014
+ $menu_slug = false,
8015
+ $capability = 'read',
8016
+ $priority = WP_FS__DEFAULT_PRIORITY
8017
+ ) {
8018
+ $this->_logger->entrance( 'Title = ' . $menu_title . '; Url = ' . $url );
8019
+
8020
+ if ( $this->is_addon() ) {
8021
+ $parent_fs = $this->get_parent_instance();
8022
+
8023
+ if ( is_object( $parent_fs ) ) {
8024
+ $parent_fs->add_submenu_link_item(
8025
+ $menu_title,
8026
+ $url,
8027
+ $menu_slug,
8028
+ $capability,
8029
+ $priority
8030
+ );
8031
+
8032
+ return;
8033
+ }
8034
+ }
8035
+
8036
+ if ( ! isset( $this->_menu_items[ $priority ] ) ) {
8037
+ $this->_menu_items[ $priority ] = array();
8038
+ }
8039
+
8040
+ $this->_menu_items[ $priority ][] = array(
8041
+ 'menu_title' => $menu_title,
8042
+ 'capability' => $capability,
8043
+ 'menu_slug' => is_string( $menu_slug ) ? $menu_slug : strtolower( $menu_title ),
8044
+ 'url' => $url,
8045
+ 'page_title' => $menu_title,
8046
+ 'render_function' => 'fs_dummy',
8047
+ 'before_render_function' => '',
8048
+ );
8049
+ }
8050
+
8051
+ #endregion ------------------------------------------------------------------
8052
+
8053
+ /* Actions / Hooks / Filters
8054
+ ------------------------------------------------------------------------------------------------------------------*/
8055
+ /**
8056
+ * @author Vova Feldman (@svovaf)
8057
+ * @since 1.1.7
8058
+ *
8059
+ * @param string $tag
8060
+ *
8061
+ * @return string
8062
+ */
8063
+ public function get_action_tag( $tag ) {
8064
+ return self::get_action_tag_static( $tag, $this->_slug );
8065
+ }
8066
+
8067
+ /**
8068
+ * @author Vova Feldman (@svovaf)
8069
+ * @since 1.2.1.6
8070
+ *
8071
+ * @param string $tag
8072
+ * @param string $slug
8073
+ *
8074
+ * @return string
8075
+ */
8076
+ static function get_action_tag_static( $tag, $slug = '' ) {
8077
+ return "fs_{$tag}" . ( empty( $slug ) ? '' : "_{$slug}" );
8078
+ }
8079
+
8080
+ /**
8081
+ * @author Vova Feldman (@svovaf)
8082
+ * @since 1.2.1
8083
+ *
8084
+ * @param string $tag
8085
+ *
8086
+ * @return string
8087
+ */
8088
+ private function get_ajax_action_tag( $tag ) {
8089
+ return 'wp_ajax_' . $this->get_action_tag( $tag );
8090
+ }
8091
+
8092
+ /**
8093
+ * @author Vova Feldman (@svovaf)
8094
+ * @since 1.2.1.6
8095
+ *
8096
+ * @param string $tag
8097
+ * @param string $slug
8098
+ *
8099
+ * @return string
8100
+ */
8101
+ private static function get_ajax_action_tag_static( $tag, $slug = '' ) {
8102
+ return 'wp_ajax_' . self::get_action_tag_static( $tag, $slug );
8103
+ }
8104
+
8105
+ /**
8106
+ * Do action, specific for the current context plugin.
8107
+ *
8108
+ * @author Vova Feldman (@svovaf)
8109
+ * @since 1.0.1
8110
+ *
8111
+ * @param string $tag The name of the action to be executed.
8112
+ * @param mixed $arg,... Optional. Additional arguments which are passed on to the
8113
+ * functions hooked to the action. Default empty.
8114
+ *
8115
+ * @uses do_action()
8116
+ */
8117
+ function do_action( $tag, $arg = '' ) {
8118
+ $this->_logger->entrance( $tag );
8119
+
8120
+ $args = func_get_args();
8121
+
8122
+ call_user_func_array( 'do_action', array_merge(
8123
+ array( $this->get_action_tag( $tag ) ),
8124
+ array_slice( $args, 1 ) )
8125
+ );
8126
+ }
8127
+
8128
+ /**
8129
+ * Add action, specific for the current context plugin.
8130
+ *
8131
+ * @author Vova Feldman (@svovaf)
8132
+ * @since 1.0.1
8133
+ *
8134
+ * @param string $tag
8135
+ * @param callable $function_to_add
8136
+ * @param int $priority
8137
+ * @param int $accepted_args
8138
+ *
8139
+ * @uses add_action()
8140
+ */
8141
+ function add_action( $tag, $function_to_add, $priority = WP_FS__DEFAULT_PRIORITY, $accepted_args = 1 ) {
8142
+ $this->_logger->entrance( $tag );
8143
+
8144
+ add_action( $this->get_action_tag( $tag ), $function_to_add, $priority, $accepted_args );
8145
+ }
8146
+
8147
+ /**
8148
+ * Add AJAX action, specific for the current context plugin.
8149
+ *
8150
+ * @author Vova Feldman (@svovaf)
8151
+ * @since 1.2.1
8152
+ *
8153
+ * @param string $tag
8154
+ * @param callable $function_to_add
8155
+ * @param int $priority
8156
+ *
8157
+ * @uses add_action()
8158
+ *
8159
+ * @return bool True if action added, false if no need to add the action since the AJAX call isn't matching.
8160
+ */
8161
+ function add_ajax_action(
8162
+ $tag,
8163
+ $function_to_add,
8164
+ $priority = WP_FS__DEFAULT_PRIORITY
8165
+ ) {
8166
+ $this->_logger->entrance( $tag );
8167
+
8168
+ return self::add_ajax_action_static(
8169
+ $tag,
8170
+ $function_to_add,
8171
+ $priority,
8172
+ $this->_slug
8173
+ );
8174
+ }
8175
+
8176
+ /**
8177
+ * Add AJAX action.
8178
+ *
8179
+ * @author Vova Feldman (@svovaf)
8180
+ * @since 1.2.1.6
8181
+ *
8182
+ * @param string $tag
8183
+ * @param callable $function_to_add
8184
+ * @param int $priority
8185
+ * @param string $slug
8186
+ *
8187
+ * @return bool True if action added, false if no need to add the action since the AJAX call isn't matching.
8188
+ * @uses add_action()
8189
+ *
8190
+ */
8191
+ static function add_ajax_action_static(
8192
+ $tag,
8193
+ $function_to_add,
8194
+ $priority = WP_FS__DEFAULT_PRIORITY,
8195
+ $slug = ''
8196
+ ) {
8197
+ self::$_static_logger->entrance( $tag );
8198
+
8199
+ if ( ! self::is_ajax_action_static( $tag, $slug ) ) {
8200
+ return false;
8201
+ }
8202
+
8203
+ add_action(
8204
+ self::get_ajax_action_tag_static( $tag, $slug ),
8205
+ $function_to_add,
8206
+ $priority,
8207
+ 0
8208
+ );
8209
+
8210
+ self::$_static_logger->info( "$tag AJAX callback action added." );
8211
+
8212
+ return true;
8213
+ }
8214
+
8215
+ /**
8216
+ * Send a JSON response back to an Ajax request.
8217
+ *
8218
+ * @author Vova Feldman (@svovaf)
8219
+ * @since 1.2.1.5
8220
+ *
8221
+ * @param mixed $response
8222
+ */
8223
+ static function shoot_ajax_response( $response ) {
8224
+ wp_send_json( $response );
8225
+ }
8226
+
8227
+ /**
8228
+ * Send a JSON response back to an Ajax request, indicating success.
8229
+ *
8230
+ * @author Vova Feldman (@svovaf)
8231
+ * @since 1.2.1.5
8232
+ *
8233
+ * @param mixed $data Data to encode as JSON, then print and exit.
8234
+ */
8235
+ static function shoot_ajax_success( $data = null ) {
8236
+ wp_send_json_success( $data );
8237
+ }
8238
+
8239
+ /**
8240
+ * Send a JSON response back to an Ajax request, indicating failure.
8241
+ *
8242
+ * @author Vova Feldman (@svovaf)
8243
+ * @since 1.2.1.5
8244
+ *
8245
+ * @param mixed $error Optional error message.
8246
+ */
8247
+ static function shoot_ajax_failure( $error = '' ) {
8248
+ $result = array( 'success' => false );
8249
+ if ( ! empty( $error ) ) {
8250
+ $result['error'] = $error;
8251
+ }
8252
+
8253
+ wp_send_json( $result );
8254
+ }
8255
+
8256
+ /**
8257
+ * Apply filter, specific for the current context plugin.
8258
+ *
8259
+ * @author Vova Feldman (@svovaf)
8260
+ * @since 1.0.9
8261
+ *
8262
+ * @param string $tag The name of the filter hook.
8263
+ * @param mixed $value The value on which the filters hooked to `$tag` are applied on.
8264
+ *
8265
+ * @return mixed The filtered value after all hooked functions are applied to it.
8266
+ *
8267
+ * @uses apply_filters()
8268
+ */
8269
+ function apply_filters( $tag, $value ) {
8270
+ $this->_logger->entrance( $tag );
8271
+
8272
+ $args = func_get_args();
8273
+ array_unshift( $args, $this->_slug );
8274
+
8275
+ return call_user_func_array( 'fs_apply_filter', $args );
8276
+ }
8277
+
8278
+ /**
8279
+ * Add filter, specific for the current context plugin.
8280
+ *
8281
+ * @author Vova Feldman (@svovaf)
8282
+ * @since 1.0.9
8283
+ *
8284
+ * @param string $tag
8285
+ * @param callable $function_to_add
8286
+ * @param int $priority
8287
+ * @param int $accepted_args
8288
+ *
8289
+ * @uses add_filter()
8290
+ */
8291
+ function add_filter( $tag, $function_to_add, $priority = WP_FS__DEFAULT_PRIORITY, $accepted_args = 1 ) {
8292
+ $this->_logger->entrance( $tag );
8293
+
8294
+ add_filter( $this->get_action_tag( $tag ), $function_to_add, $priority, $accepted_args );
8295
+ }
8296
+
8297
+ /**
8298
+ * Check if has filter.
8299
+ *
8300
+ * @author Vova Feldman (@svovaf)
8301
+ * @since 1.1.4
8302
+ *
8303
+ * @param string $tag
8304
+ * @param callable|bool $function_to_check Optional. The callback to check for. Default false.
8305
+ *
8306
+ * @return false|int
8307
+ *
8308
+ * @uses has_filter()
8309
+ */
8310
+ function has_filter( $tag, $function_to_check = false ) {
8311
+ $this->_logger->entrance( $tag );
8312
+
8313
+ return has_filter( $this->get_action_tag( $tag ), $function_to_check );
8314
+ }
8315
+
8316
+ /**
8317
+ * Override default i18n text phrases.
8318
+ *
8319
+ * @author Vova Feldman (@svovaf)
8320
+ * @since 1.1.6
8321
+ *
8322
+ * @param string[] string $key_value
8323
+ *
8324
+ * @uses fs_override_i18n()
8325
+ */
8326
+ function override_i18n( $key_value ) {
8327
+ fs_override_i18n( $key_value, $this->_slug );
8328
+ }
8329
+
8330
+ /* Account Page
8331
+ ------------------------------------------------------------------------------------------------------------------*/
8332
+ /**
8333
+ * Update site information.
8334
+ *
8335
+ * @author Vova Feldman (@svovaf)
8336
+ * @since 1.0.1
8337
+ *
8338
+ * @param bool $store Flush to Database if true.
8339
+ */
8340
+ private function _store_site( $store = true ) {
8341
+ $this->_logger->entrance();
8342
+
8343
+ if ( empty( $this->_site->id ) ) {
8344
+ $this->_logger->error( "Empty install ID, can't store site." );
8345
+
8346
+ return;
8347
+ }
8348
+
8349
+ $encrypted_site = clone $this->_site;
8350
+ $encrypted_site->plan = $this->_encrypt_entity( $this->_site->plan );
8351
+
8352
+ $sites = self::get_all_sites();
8353
+ $sites[ $this->_slug ] = $encrypted_site;
8354
+ self::$_accounts->set_option( 'sites', $sites, $store );
8355
+ }
8356
+
8357
+ /**
8358
+ * Update plugin's plans information.
8359
+ *
8360
+ * @author Vova Feldman (@svovaf)
8361
+ * @since 1.0.2
8362
+ *
8363
+ * @param bool $store Flush to Database if true.
8364
+ */
8365
+ private function _store_plans( $store = true ) {
8366
+ $this->_logger->entrance();
8367
+
8368
+ $plans = self::get_all_plans();
8369
+
8370
+ // Copy plans.
8371
+ $encrypted_plans = array();
8372
+ for ( $i = 0, $len = count( $this->_plans ); $i < $len; $i ++ ) {
8373
+ $encrypted_plans[] = $this->_encrypt_entity( $this->_plans[ $i ] );
8374
+ }
8375
+
8376
+ $plans[ $this->_slug ] = $encrypted_plans;
8377
+ self::$_accounts->set_option( 'plans', $plans, $store );
8378
+ }
8379
+
8380
+ /**
8381
+ * Update user's plugin licenses.
8382
+ *
8383
+ * @author Vova Feldman (@svovaf)
8384
+ * @since 1.0.5
8385
+ *
8386
+ * @param bool $store
8387
+ * @param string|bool $plugin_slug
8388
+ * @param FS_Plugin_License[] $licenses
8389
+ */
8390
+ private function _store_licenses( $store = true, $plugin_slug = false, $licenses = array() ) {
8391
+ $this->_logger->entrance();
8392
+
8393
+ $all_licenses = self::get_all_licenses();
8394
+
8395
+ if ( ! is_string( $plugin_slug ) ) {
8396
+ $plugin_slug = $this->_slug;
8397
+ $licenses = $this->_licenses;
8398
+ }
8399
+
8400
+ if ( ! isset( $all_licenses[ $plugin_slug ] ) ) {
8401
+ $all_licenses[ $plugin_slug ] = array();
8402
+ }
8403
+
8404
+ $all_licenses[ $plugin_slug ][ $this->_user->id ] = $licenses;
8405
+
8406
+ self::$_accounts->set_option( 'licenses', $all_licenses, $store );
8407
+ }
8408
+
8409
+ /**
8410
+ * Update user information.
8411
+ *
8412
+ * @author Vova Feldman (@svovaf)
8413
+ * @since 1.0.1
8414
+ *
8415
+ * @param bool $store Flush to Database if true.
8416
+ */
8417
+ private function _store_user( $store = true ) {
8418
+ $this->_logger->entrance();
8419
+
8420
+ if ( empty( $this->_user->id ) ) {
8421
+ $this->_logger->error( "Empty user ID, can't store user." );
8422
+
8423
+ return;
8424
+ }
8425
+
8426
+ $users = self::get_all_users();
8427
+ $users[ $this->_user->id ] = $this->_user;
8428
+ self::$_accounts->set_option( 'users', $users, $store );
8429
+ }
8430
+
8431
+ /**
8432
+ * Update new updates information.
8433
+ *
8434
+ * @author Vova Feldman (@svovaf)
8435
+ * @since 1.0.4
8436
+ *
8437
+ * @param FS_Plugin_Tag|null $update
8438
+ * @param bool $store Flush to Database if true.
8439
+ * @param bool|number $plugin_id
8440
+ */
8441
+ private function _store_update( $update, $store = true, $plugin_id = false ) {
8442
+ $this->_logger->entrance();
8443
+
8444
+ if ( $update instanceof FS_Plugin_Tag ) {
8445
+ $update->updated = time();
8446
+ }
8447
+
8448
+ if ( ! is_numeric( $plugin_id ) ) {
8449
+ $plugin_id = $this->_plugin->id;
8450
+ }
8451
+
8452
+ $updates = self::get_all_updates();
8453
+ $updates[ $plugin_id ] = $update;
8454
+ self::$_accounts->set_option( 'updates', $updates, $store );
8455
+ }
8456
+
8457
+ /**
8458
+ * Update new updates information.
8459
+ *
8460
+ * @author Vova Feldman (@svovaf)
8461
+ * @since 1.0.6
8462
+ *
8463
+ * @param FS_Plugin[] $plugin_addons
8464
+ * @param bool $store Flush to Database if true.
8465
+ */
8466
+ private function _store_addons( $plugin_addons, $store = true ) {
8467
+ $this->_logger->entrance();
8468
+
8469
+ $addons = self::get_all_addons();
8470
+ $addons[ $this->_plugin->id ] = $plugin_addons;
8471
+ self::$_accounts->set_option( 'addons', $addons, $store );
8472
+ }
8473
+
8474
+ /**
8475
+ * Delete plugin's associated add-ons.
8476
+ *
8477
+ * @author Vova Feldman (@svovaf)
8478
+ * @since 1.0.8
8479
+ *
8480
+ * @param bool $store
8481
+ *
8482
+ * @return bool
8483
+ */
8484
+ private function _delete_account_addons( $store = true ) {
8485
+ $all_addons = self::get_all_account_addons();
8486
+
8487
+ if ( ! isset( $all_addons[ $this->_plugin->id ] ) ) {
8488
+ return false;
8489
+ }
8490
+
8491
+ unset( $all_addons[ $this->_plugin->id ] );
8492
+
8493
+ self::$_accounts->set_option( 'account_addons', $all_addons, $store );
8494
+
8495
+ return true;
8496
+ }
8497
+
8498
+ /**
8499
+ * Update account add-ons list.
8500
+ *
8501
+ * @author Vova Feldman (@svovaf)
8502
+ * @since 1.0.6
8503
+ *
8504
+ * @param FS_Plugin[] $addons
8505
+ * @param bool $store Flush to Database if true.
8506
+ */
8507
+ private function _store_account_addons( $addons, $store = true ) {
8508
+ $this->_logger->entrance();
8509
+
8510
+ $all_addons = self::get_all_account_addons();
8511
+ $all_addons[ $this->_plugin->id ] = $addons;
8512
+ self::$_accounts->set_option( 'account_addons', $all_addons, $store );
8513
+ }
8514
+
8515
+ /**
8516
+ * Store account params in the Database.
8517
+ *
8518
+ * @author Vova Feldman (@svovaf)
8519
+ * @since 1.0.1
8520
+ */
8521
+ private function _store_account() {
8522
+ $this->_logger->entrance();
8523
+
8524
+ $this->_store_site( false );
8525
+ $this->_store_user( false );
8526
+ $this->_store_plans( false );
8527
+ $this->_store_licenses( false );
8528
+
8529
+ self::$_accounts->store();
8530
+ }
8531
+
8532
+ /**
8533
+ * Sync user's information.
8534
+ *
8535
+ * @author Vova Feldman (@svovaf)
8536
+ * @since 1.0.3
8537
+ * @uses FS_Api
8538
+ */
8539
+ private function _handle_account_user_sync() {
8540
+ $this->_logger->entrance();
8541
+
8542
+ $api = $this->get_api_user_scope();
8543
+
8544
+ // Get user's information.
8545
+ $user = $api->get( '/', true );
8546
+
8547
+ if ( isset( $user->id ) ) {
8548
+ $this->_user->first = $user->first;
8549
+ $this->_user->last = $user->last;
8550
+ $this->_user->email = $user->email;
8551
+
8552
+ $is_menu_item_account_visible = $this->_menu->is_submenu_item_visible( 'account' );
8553
+
8554
+ if ( $user->is_verified &&
8555
+ ( ! isset( $this->_user->is_verified ) || false === $this->_user->is_verified )
8556
+ ) {
8557
+ $this->_user->is_verified = true;
8558
+
8559
+ $this->do_action( 'account_email_verified', $user->email );
8560
+
8561
+ $this->_admin_notices->add(
8562
+ __fs( 'email-verified-message', $this->_slug ),
8563
+ __fs( 'right-on', $this->_slug ) . '!',
8564
+ 'success',
8565
+ // Make admin sticky if account menu item is invisible,
8566
+ // since the page will be auto redirected to the plugin's
8567
+ // main settings page, and the non-sticky message
8568
+ // will disappear.
8569
+ ! $is_menu_item_account_visible,
8570
+ false,
8571
+ 'email_verified'
8572
+ );
8573
+ }
8574
+
8575
+ // Flush user details to DB.
8576
+ $this->_store_user();
8577
+
8578
+ $this->do_action( 'after_account_user_sync', $user );
8579
+
8580
+ /**
8581
+ * If account menu item is hidden, redirect to plugin's main settings page.
8582
+ *
8583
+ * @author Vova Feldman (@svovaf)
8584
+ * @since 1.1.6
8585
+ *
8586
+ * @link https://github.com/Freemius/wordpress-sdk/issues/6
8587
+ */
8588
+ if ( ! $is_menu_item_account_visible ) {
8589
+ fs_redirect( $this->_get_admin_page_url() );
8590
+ }
8591
+ }
8592
+ }
8593
+
8594
+ /**
8595
+ * @param bool $store
8596
+ *
8597
+ * @return FS_Plugin_Plan|object|false
8598
+ */
8599
+ private function _enrich_site_plan( $store = true ) {
8600
+ // Try to load plan from local cache.
8601
+ $plan = $this->_get_plan_by_id( $this->_site->plan->id );
8602
+
8603
+ if ( false === $plan ) {
8604
+ $plan = $this->_fetch_site_plan();
8605
+ }
8606
+
8607
+ if ( $plan instanceof FS_Plugin_Plan ) {
8608
+ $this->_update_plan( $plan, $store );
8609
+ }
8610
+
8611
+ return $plan;
8612
+ }
8613
+
8614
+ /**
8615
+ * @author Vova Feldman (@svovaf)
8616
+ * @since 1.0.9
8617
+ * @uses FS_Api
8618
+ *
8619
+ * @param bool $store
8620
+ *
8621
+ * @return FS_Plugin_Plan|object|false
8622
+ */
8623
+ private function _enrich_site_trial_plan( $store = true ) {
8624
+ // Try to load plan from local cache.
8625
+ $trial_plan = $this->_get_plan_by_id( $this->_site->trial_plan_id );
8626
+
8627
+ if ( false === $trial_plan ) {
8628
+ $trial_plan = $this->_fetch_site_plan( $this->_site->trial_plan_id );
8629
+ }
8630
+
8631
+ if ( $trial_plan instanceof FS_Plugin_Plan ) {
8632
+ $this->_storage->store( 'trial_plan', $trial_plan, $store );
8633
+ }
8634
+
8635
+ return $trial_plan;
8636
+ }
8637
+
8638
+ /**
8639
+ * @author Vova Feldman (@svovaf)
8640
+ * @since 1.0.9
8641
+ * @uses FS_Api
8642
+ *
8643
+ * @param number|bool $license_id
8644
+ *
8645
+ * @return FS_Subscription|object|bool
8646
+ */
8647
+ private function _fetch_site_license_subscription( $license_id = false ) {
8648
+ $this->_logger->entrance();
8649
+ $api = $this->get_api_site_scope();
8650
+
8651
+ if ( ! is_numeric( $license_id ) ) {
8652
+ $license_id = $this->_license->id;
8653
+ }
8654
+
8655
+ $result = $api->get( "/licenses/{$license_id}/subscriptions.json", true );
8656
+
8657
+ return ! isset( $result->error ) ?
8658
+ ( ( is_array( $result->subscriptions ) && 0 < count( $result->subscriptions ) ) ?
8659
+ new FS_Subscription( $result->subscriptions[0] ) :
8660
+ false
8661
+ ) :
8662
+ $result;
8663
+ }
8664
+
8665
+ /**
8666
+ * @author Vova Feldman (@svovaf)
8667
+ * @since 1.0.4
8668
+ * @uses FS_Api
8669
+ *
8670
+ * @param number|bool $plan_id
8671
+ *
8672
+ * @return FS_Plugin_Plan|object
8673
+ */
8674
+ private function _fetch_site_plan( $plan_id = false ) {
8675
+ $this->_logger->entrance();
8676
+ $api = $this->get_api_site_scope();
8677
+
8678
+ if ( ! is_numeric( $plan_id ) ) {
8679
+ $plan_id = $this->_site->plan->id;
8680
+ }
8681
+
8682
+ $plan = $api->get( "/plans/{$plan_id}.json", true );
8683
+
8684
+ return ! isset( $plan->error ) ? new FS_Plugin_Plan( $plan ) : $plan;
8685
+ }
8686
+
8687
+ /**
8688
+ * @author Vova Feldman (@svovaf)
8689
+ * @since 1.0.5
8690
+ * @uses FS_Api
8691
+ *
8692
+ * @return FS_Plugin_Plan[]|object
8693
+ */
8694
+ private function _fetch_plugin_plans() {
8695
+ $this->_logger->entrance();
8696
+ $api = $this->get_api_site_scope();
8697
+
8698
+ $result = $api->get( '/plans.json', true );
8699
+
8700
+ if ( $this->is_api_result_object( $result, 'plans' ) && is_array( $result->plans ) ) {
8701
+ for ( $i = 0, $len = count( $result->plans ); $i < $len; $i ++ ) {
8702
+ $result->plans[ $i ] = new FS_Plugin_Plan( $result->plans[ $i ] );
8703
+ }
8704
+
8705
+ $result = $result->plans;
8706
+ }
8707
+
8708
+ return $result;
8709
+ }
8710
+
8711
+ /**
8712
+ * @author Vova Feldman (@svovaf)
8713
+ * @since 1.0.5
8714
+ * @uses FS_Api
8715
+ *
8716
+ * @param number|bool $plugin_id
8717
+ * @param number|bool $site_license_id
8718
+ *
8719
+ * @return FS_Plugin_License[]|object
8720
+ */
8721
+ private function _fetch_licenses( $plugin_id = false, $site_license_id = false ) {
8722
+ $this->_logger->entrance();
8723
+
8724
+ $api = $this->get_api_user_scope();
8725
+
8726
+ if ( ! is_numeric( $plugin_id ) ) {
8727
+ $plugin_id = $this->_plugin->id;
8728
+ }
8729
+
8730
+ $result = $api->get( "/plugins/{$plugin_id}/licenses.json", true );
8731
+
8732
+ $is_site_license_synced = false;
8733
+
8734
+ $api_errors = array();
8735
+
8736
+ if ( $this->is_api_result_object( $result, 'licenses' ) &&
8737
+ is_array( $result->licenses )
8738
+ ) {
8739
+ for ( $i = 0, $len = count( $result->licenses ); $i < $len; $i ++ ) {
8740
+ $result->licenses[ $i ] = new FS_Plugin_License( $result->licenses[ $i ] );
8741
+
8742
+ if ( ( ! $is_site_license_synced ) && is_numeric( $site_license_id ) ) {
8743
+ $is_site_license_synced = ( $site_license_id == $result->licenses[ $i ]->id );
8744
+ }
8745
+ }
8746
+
8747
+ $result = $result->licenses;
8748
+ } else {
8749
+ $api_errors[] = $result;
8750
+ $result = array();
8751
+ }
8752
+
8753
+ if ( ! $is_site_license_synced ) {
8754
+ $api = $this->get_api_site_scope();
8755
+
8756
+ if ( is_numeric( $site_license_id ) ) {
8757
+ // Try to retrieve a foreign license that is linked to the install.
8758
+ $api_result = $api->call( '/licenses.json' );
8759
+
8760
+ if ( $this->is_api_result_object( $api_result, 'licenses' ) &&
8761
+ is_array( $api_result->licenses )
8762
+ ) {
8763
+ $licenses = $api_result->licenses;
8764
+
8765
+ if ( ! empty( $licenses ) ) {
8766
+ $result[] = new FS_Plugin_License( $licenses[0] );
8767
+ }
8768
+ } else {
8769
+ $api_errors[] = $api_result;
8770
+ }
8771
+ } else if ( is_object( $this->_license ) ) {
8772
+ // Fetch foreign license by ID and license key.
8773
+ $license = $api->get( "/licenses/{$this->_license->id}.json?license_key=" .
8774
+ urlencode( $this->_license->secret_key ) );
8775
+
8776
+ if ( $this->is_api_result_entity( $license ) ) {
8777
+ $result[] = new FS_Plugin_License( $license );
8778
+ } else {
8779
+ $api_errors[] = $license;
8780
+ }
8781
+ }
8782
+ }
8783
+
8784
+ if ( is_array( $result ) && 0 < count( $result ) ) {
8785
+ // If found at least one license, return license collection even if there are errors.
8786
+ return $result;
8787
+ }
8788
+
8789
+ if ( ! empty( $api_errors ) ) {
8790
+ // If found any errors and no licenses, return first error.
8791
+ return $api_errors[0];
8792
+ }
8793
+
8794
+ // Fallback to empty licenses list.
8795
+ return $result;
8796
+ }
8797
+
8798
+ /**
8799
+ * @author Vova Feldman (@svovaf)
8800
+ * @since 1.2.0
8801
+ * @uses FS_Api
8802
+ *
8803
+ * @param number|bool $plugin_id
8804
+ *
8805
+ * @return FS_Payment[]|object
8806
+ */
8807
+ function _fetch_payments( $plugin_id = false ) {
8808
+ $this->_logger->entrance();
8809
+
8810
+ $api = $this->get_api_user_scope();
8811
+
8812
+ if ( ! is_numeric( $plugin_id ) ) {
8813
+ $plugin_id = $this->_plugin->id;
8814
+ }
8815
+
8816
+ $result = $api->get( "/plugins/{$plugin_id}/payments.json", true );
8817
+
8818
+ if ( ! isset( $result->error ) ) {
8819
+ for ( $i = 0, $len = count( $result->payments ); $i < $len; $i ++ ) {
8820
+ $result->payments[ $i ] = new FS_Payment( $result->payments[ $i ] );
8821
+ }
8822
+ $result = $result->payments;
8823
+ }
8824
+
8825
+ return $result;
8826
+ }
8827
+
8828
+ /**
8829
+ * @author Vova Feldman (@svovaf)
8830
+ * @since 1.2.1.5
8831
+ * @uses FS_Api
8832
+ *
8833
+ * @return \FS_Billing|mixed
8834
+ */
8835
+ function _fetch_billing() {
8836
+ require_once WP_FS__DIR_INCLUDES . '/entities/class-fs-billing.php';
8837
+
8838
+ $billing = $this->get_api_user_scope()->call( 'billing.json' );
8839
+
8840
+ if ( $this->is_api_result_entity( $billing ) ) {
8841
+ $billing = new FS_Billing( $billing );
8842
+ }
8843
+
8844
+ return $billing;
8845
+ }
8846
+
8847
+ /**
8848
+ * @author Vova Feldman (@svovaf)
8849
+ * @since 1.0.4
8850
+ *
8851
+ * @param FS_Plugin_Plan $plan
8852
+ * @param bool $store
8853
+ */
8854
+ private function _update_plan( $plan, $store = false ) {
8855
+ $this->_logger->entrance();
8856
+
8857
+ $this->_site->plan = $plan;
8858
+ $this->_store_site( $store );
8859
+ }
8860
+
8861
+ /**
8862
+ * @author Vova Feldman (@svovaf)
8863
+ * @since 1.0.5
8864
+ *
8865
+ * @param FS_Plugin_License[] $licenses
8866
+ * @param string|bool $plugin_slug
8867
+ */
8868
+ private function _update_licenses( $licenses, $plugin_slug = false ) {
8869
+ $this->_logger->entrance();
8870
+
8871
+ if ( is_array( $licenses ) ) {
8872
+ for ( $i = 0, $len = count( $licenses ); $i < $len; $i ++ ) {
8873
+ $licenses[ $i ]->updated = time();
8874
+ }
8875
+ }
8876
+
8877
+ if ( ! is_string( $plugin_slug ) ) {
8878
+ $this->_licenses = $licenses;
8879
+ }
8880
+
8881
+ $this->_store_licenses( true, $plugin_slug, $licenses );
8882
+ }
8883
+
8884
+ /**
8885
+ * @author Vova Feldman (@svovaf)
8886
+ * @since 1.0.4
8887
+ *
8888
+ * @param bool|number $plugin_id
8889
+ * @param bool $flush Since 1.1.7.3
8890
+ *
8891
+ * @return object|false New plugin tag info if exist.
8892
+ */
8893
+ private function _fetch_newer_version( $plugin_id = false, $flush = true ) {
8894
+ $latest_tag = $this->_fetch_latest_version( $plugin_id, $flush );
8895
+
8896
+ if ( ! is_object( $latest_tag ) ) {
8897
+ return false;
8898
+ }
8899
+
8900
+ // Check if version is actually newer.
8901
+ $has_new_version =
8902
+ // If it's an non-installed add-on then always return latest.
8903
+ ( $this->_is_addon_id( $plugin_id ) && ! $this->is_addon_activated( $plugin_id ) ) ||
8904
+ // Compare versions.
8905
+ version_compare( $this->get_plugin_version(), $latest_tag->version, '<' );
8906
+
8907
+ $this->_logger->departure( $has_new_version ? 'Found newer plugin version ' . $latest_tag->version : 'No new version' );
8908
+
8909
+ return $has_new_version ? $latest_tag : false;
8910
+ }
8911
+
8912
+ /**
8913
+ * @author Vova Feldman (@svovaf)
8914
+ * @since 1.0.5
8915
+ *
8916
+ * @param bool|number $plugin_id
8917
+ * @param bool $flush Since 1.1.7.3
8918
+ *
8919
+ * @return bool|FS_Plugin_Tag
8920
+ */
8921
+ function get_update( $plugin_id = false, $flush = true ) {
8922
+ $this->_logger->entrance();
8923
+
8924
+ if ( ! is_numeric( $plugin_id ) ) {
8925
+ $plugin_id = $this->_plugin->id;
8926
+ }
8927
+
8928
+ $this->check_updates( true, $plugin_id, $flush );
8929
+ $updates = $this->get_all_updates();
8930
+
8931
+ return isset( $updates[ $plugin_id ] ) && is_object( $updates[ $plugin_id ] ) ? $updates[ $plugin_id ] : false;
8932
+ }
8933
+
8934
+ /**
8935
+ * Check if site assigned with active license.
8936
+ *
8937
+ * @author Vova Feldman (@svovaf)
8938
+ * @since 1.0.6
8939
+ *
8940
+ * @deprecated Please use has_active_valid_license() instead because license can be cancelled.
8941
+ */
8942
+ function has_active_license() {
8943
+ return (
8944
+ is_object( $this->_license ) &&
8945
+ is_numeric( $this->_license->id ) &&
8946
+ ! $this->_license->is_expired()
8947
+ );
8948
+ }
8949
+
8950
+ /**
8951
+ * Check if site assigned with active & valid (not expired) license.
8952
+ *
8953
+ * @author Vova Feldman (@svovaf)
8954
+ * @since 1.2.1
8955
+ */
8956
+ function has_active_valid_license() {
8957
+ return (
8958
+ is_object( $this->_license ) &&
8959
+ is_numeric( $this->_license->id ) &&
8960
+ $this->_license->is_active() &&
8961
+ $this->_license->is_valid()
8962
+ );
8963
+ }
8964
+
8965
+ /**
8966
+ * Check if site assigned with license with enabled features.
8967
+ *
8968
+ * @author Vova Feldman (@svovaf)
8969
+ * @since 1.0.6
8970
+ *
8971
+ * @return bool
8972
+ */
8973
+ function has_features_enabled_license() {
8974
+ return (
8975
+ is_object( $this->_license ) &&
8976
+ is_numeric( $this->_license->id ) &&
8977
+ $this->_license->is_features_enabled()
8978
+ );
8979
+ }
8980
+
8981
+ /**
8982
+ * Check if user is a trial or have feature enabled license.
8983
+ *
8984
+ * @author Vova Feldman (@svovaf)
8985
+ * @since 1.1.7
8986
+ *
8987
+ * @return bool
8988
+ */
8989
+ function can_use_premium_code() {
8990
+ return $this->is_trial() || $this->has_features_enabled_license();
8991
+ }
8992
+
8993
+ /**
8994
+ * Sync site's plan.
8995
+ *
8996
+ * @author Vova Feldman (@svovaf)
8997
+ * @since 1.0.3
8998
+ *
8999
+ * @uses FS_Api
9000
+ *
9001
+ * @param bool $background Hints the method if it's a background sync. If false, it means that was initiated by
9002
+ * the admin.
9003
+ */
9004
+ private function _sync_license( $background = false ) {
9005
+ $this->_logger->entrance();
9006
+
9007
+ $plugin_id = fs_request_get( 'plugin_id', $this->get_id() );
9008
+
9009
+ $is_addon_sync = ( ! $this->_plugin->is_addon() && $plugin_id != $this->get_id() );
9010
+
9011
+ if ( $is_addon_sync ) {
9012
+ $this->_sync_addon_license( $plugin_id, $background );
9013
+ } else {
9014
+ $this->_sync_plugin_license( $background );
9015
+ }
9016
+
9017
+ $this->do_action( 'after_account_plan_sync', $this->_site->plan->name );
9018
+ }
9019
+
9020
+ /**
9021
+ * Sync plugin's add-on license.
9022
+ *
9023
+ * @author Vova Feldman (@svovaf)
9024
+ * @since 1.0.6
9025
+ * @uses FS_Api
9026
+ *
9027
+ * @param number $addon_id
9028
+ * @param bool $background
9029
+ */
9030
+ private function _sync_addon_license( $addon_id, $background ) {
9031
+ $this->_logger->entrance();
9032
+
9033
+ if ( $this->is_addon_activated( $addon_id ) ) {
9034
+ // If already installed, use add-on sync.
9035
+ $fs_addon = self::get_instance_by_id( $addon_id );
9036
+ $fs_addon->_sync_license( $background );
9037
+
9038
+ return;
9039
+ }
9040
+
9041
+ // Validate add-on exists.
9042
+ $addon = $this->get_addon( $addon_id );
9043
+
9044
+ if ( ! is_object( $addon ) ) {
9045
+ return;
9046
+ }
9047
+
9048
+ // Add add-on into account add-ons.
9049
+ $account_addons = $this->get_account_addons();
9050
+ if ( ! is_array( $account_addons ) ) {
9051
+ $account_addons = array();
9052
+ }
9053
+ $account_addons[] = $addon->id;
9054
+ $account_addons = array_unique( $account_addons );
9055
+ $this->_store_account_addons( $account_addons );
9056
+
9057
+ // Load add-on licenses.
9058
+ $licenses = $this->_fetch_licenses( $addon->id );
9059
+
9060
+ // Sync add-on licenses.
9061
+ if ( $this->is_array_instanceof( $licenses, 'FS_Plugin_License' ) ) {
9062
+ $this->_update_licenses( $licenses, $addon->slug );
9063
+
9064
+ if ( ! $this->is_addon_installed( $addon->slug ) && FS_License_Manager::has_premium_license( $licenses ) ) {
9065
+ $plans_result = $this->get_api_site_or_plugin_scope()->get( "/addons/{$addon_id}/plans.json" );
9066
+
9067
+ if ( ! isset( $plans_result->error ) ) {
9068
+ $plans = array();
9069
+ foreach ( $plans_result->plans as $plan ) {
9070
+ $plans[] = new FS_Plugin_Plan( $plan );
9071
+ }
9072
+
9073
+ $this->_admin_notices->add_sticky(
9074
+ FS_Plan_Manager::instance()->has_free_plan( $plans ) ?
9075
+ sprintf(
9076
+ __fs( 'addon-successfully-upgraded-message', $this->_slug ),
9077
+ $addon->title
9078
+ ) . ' ' . $this->get_latest_download_link(
9079
+ __fs( 'download-latest-version', $this->_slug ),
9080
+ $addon_id
9081
+ )
9082
+ :
9083
+ sprintf(
9084
+ __fs( 'addon-successfully-purchased-message', $this->_slug ),
9085
+ $addon->title
9086
+ ) . ' ' . $this->get_latest_download_link(
9087
+ __fs( 'download-latest-version', $this->_slug ),
9088
+ $addon_id
9089
+ ),
9090
+ 'addon_plan_upgraded_' . $addon->slug,
9091
+ __fs( 'yee-haw', $this->_slug ) . '!'
9092
+ );
9093
+ }
9094
+ }
9095
+ }
9096
+ }
9097
+
9098
+ /**
9099
+ * Sync site's plugin plan.
9100
+ *
9101
+ * @author Vova Feldman (@svovaf)
9102
+ * @since 1.0.6
9103
+ * @uses FS_Api
9104
+ *
9105
+ * @param bool $background Hints the method if it's a background sync. If false, it means that was initiated by
9106
+ * the admin.
9107
+ */
9108
+ private function _sync_plugin_license( $background = false ) {
9109
+ $this->_logger->entrance();
9110
+
9111
+ /**
9112
+ * Sync site info.
9113
+ *
9114
+ * @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.
9115
+ */
9116
+ $site = $this->send_install_update( array(), true );
9117
+
9118
+ $plan_change = 'none';
9119
+
9120
+ if ( ! $this->is_api_result_entity( $site ) ) {
9121
+ // Show API messages only if not background sync or if paying customer.
9122
+ if ( ! $background || $this->is_paying() ) {
9123
+ // Try to ping API to see if not blocked.
9124
+ if ( ! FS_Api::test() ) {
9125
+ /**
9126
+ * Failed to ping API - blocked!
9127
+ *
9128
+ * @author Vova Feldman (@svovaf)
9129
+ * @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.
9130
+ */
9131
+ $api = $this->get_api_site_scope();
9132
+
9133
+ if ( ! self::$_global_admin_notices->has_sticky( 'api_blocked' ) ) {
9134
+ self::$_global_admin_notices->add(
9135
+ sprintf(
9136
+ __fs( 'server-blocking-access', $this->_slug ),
9137
+ $this->get_plugin_name(),
9138
+ '<a href="' . $api->get_url() . '" target="_blank">' . $api->get_url() . '</a>'
9139
+ ) . '<br> ' . __fs( 'server-error-message', $this->_slug ) . var_export( $site->error, true ),
9140
+ __fs( 'oops', $this->_slug ) . '...',
9141
+ 'error',
9142
+ $background,
9143
+ false,
9144
+ 'api_blocked'
9145
+ );
9146
+ }
9147
+ } else {
9148
+ // Authentication params are broken.
9149
+ $this->_admin_notices->add(
9150
+ __fs( 'wrong-authentication-param-message', $this->_slug ),
9151
+ __fs( 'oops', $this->_slug ) . '...',
9152
+ 'error'
9153
+ );
9154
+ }
9155
+ }
9156
+
9157
+ // No reason to continue with license sync while there are API issues.
9158
+ return;
9159
+ }
9160
+
9161
+ // Remove sticky API connectivity message.
9162
+ self::$_global_admin_notices->remove_sticky( 'api_blocked' );
9163
+
9164
+ $site = new FS_Site( $site );
9165
+
9166
+ // Sync plans.
9167
+ $this->_sync_plans();
9168
+
9169
+ if ( ! $this->has_paid_plan() ) {
9170
+ $this->_site = $site;
9171
+ $this->_enrich_site_plan( true );
9172
+ $this->_store_site();
9173
+ } else {
9174
+ /**
9175
+ * Sync licenses. Pass the site's license ID so that the foreign licenses will be fetched if the license
9176
+ * associated with that ID is not included in the user's licenses collection.
9177
+ */
9178
+ $this->_sync_licenses( $site->license_id );
9179
+
9180
+ // Check if plan / license changed.
9181
+ if ( ! FS_Entity::equals( $site->plan, $this->_site->plan ) ||
9182
+ // Check if trial started.
9183
+ $site->trial_plan_id != $this->_site->trial_plan_id ||
9184
+ $site->trial_ends != $this->_site->trial_ends ||
9185
+ // Check if license changed.
9186
+ $site->license_id != $this->_site->license_id
9187
+ ) {
9188
+ if ( $site->is_trial() && ( ! $this->_site->is_trial() || $site->trial_ends != $this->_site->trial_ends ) ) {
9189
+ // New trial started.
9190
+ $this->_site = $site;
9191
+ $plan_change = 'trial_started';
9192
+
9193
+ // Store trial plan information.
9194
+ $this->_enrich_site_trial_plan( true );
9195
+
9196
+ // For trial with subscription use-case.
9197
+ $new_license = is_null( $site->license_id ) ? null : $this->_get_license_by_id( $site->license_id );
9198
+
9199
+ if ( is_object( $new_license ) && $new_license->is_valid() ) {
9200
+ $this->_site = $site;
9201
+ $this->_update_site_license( $new_license );
9202
+ $this->_store_licenses();
9203
+ $this->_enrich_site_plan( true );
9204
+
9205
+ $this->_sync_site_subscription( $this->_license );
9206
+ }
9207
+ } else if ( $this->_site->is_trial() && ! $site->is_trial() && ! is_numeric( $site->license_id ) ) {
9208
+ // Was in trial, but now trial expired and no license ID.
9209
+ // New trial started.
9210
+ $this->_site = $site;
9211
+ $plan_change = 'trial_expired';
9212
+
9213
+ // Clear trial plan information.
9214
+ $this->_storage->trial_plan = null;
9215
+
9216
+ } else {
9217
+ $is_free = $this->is_free_plan();
9218
+
9219
+ // Make sure license exist and not expired.
9220
+ $new_license = is_null( $site->license_id ) ?
9221
+ null :
9222
+ $this->_get_license_by_id( $site->license_id );
9223
+
9224
+ if ( $is_free && is_null( $new_license ) && $this->has_any_license() && $this->_license->is_cancelled ) {
9225
+ // License cancelled.
9226
+ $this->_site = $site;
9227
+ $this->_update_site_license( $new_license );
9228
+ $this->_store_licenses();
9229
+ $this->_enrich_site_plan( true );
9230
+
9231
+ $plan_change = 'cancelled';
9232
+ } else if ( $is_free && ( ( ! is_object( $new_license ) || $new_license->is_expired() ) ) ) {
9233
+ // The license is expired, so ignore upgrade method.
9234
+ } else {
9235
+ // License changed.
9236
+ $this->_site = $site;
9237
+ $this->_update_site_license( $new_license );
9238
+ $this->_store_licenses();
9239
+ $this->_enrich_site_plan( true );
9240
+
9241
+ $plan_change = $is_free ?
9242
+ 'upgraded' :
9243
+ ( is_object( $new_license ) ?
9244
+ 'changed' :
9245
+ 'downgraded' );
9246
+ }
9247
+ }
9248
+
9249
+ // Store updated site info.
9250
+ $this->_store_site();
9251
+ } else {
9252
+ if ( is_object( $this->_license ) && $this->_license->is_expired() ) {
9253
+ if ( ! $this->has_features_enabled_license() ) {
9254
+ $this->_deactivate_license();
9255
+ $plan_change = 'downgraded';
9256
+ } else {
9257
+ $plan_change = 'expired';
9258
+ }
9259
+ }
9260
+
9261
+ if ( is_numeric( $site->license_id ) && is_object( $this->_license ) ) {
9262
+ $this->_sync_site_subscription( $this->_license );
9263
+ }
9264
+ }
9265
+ }
9266
+
9267
+ if ( $this->has_paid_plan() ) {
9268
+ switch ( $plan_change ) {
9269
+ case 'none':
9270
+ if ( ! $background && is_admin() ) {
9271
+ $plan = $this->is_trial() ?
9272
+ $this->_storage->trial_plan :
9273
+ $this->_site->plan;
9274
+
9275
+ if ( $plan->is_free() ) {
9276
+ $this->_admin_notices->add(
9277
+ sprintf(
9278
+ __fs( 'plan-did-not-change-message', $this->_slug ),
9279
+ '<i><b>' . $plan->title . ( $this->is_trial() ? ' ' . __fs( 'trial', $this->_slug ) : '' ) . '</b></i>'
9280
+ ) . ' ' . sprintf(
9281
+ '<a href="%s">%s</a>',
9282
+ $this->contact_url(
9283
+ 'bug',
9284
+ sprintf( __fs( 'plan-did-not-change-email-message', $this->_slug ),
9285
+ strtoupper( $plan->name )
9286
+ )
9287
+ ),
9288
+ __fs( 'contact-us-here', $this->_slug )
9289
+ ),
9290
+ __fs( 'hmm', $this->_slug ) . '...'
9291
+ );
9292
+ }
9293
+ }
9294
+ break;
9295
+ case 'upgraded':
9296
+ $this->_admin_notices->add_sticky(
9297
+ sprintf(
9298
+ __fs( 'plan-upgraded-message', $this->_slug ),
9299
+ '<i>' . $this->get_plugin_name() . '</i>'
9300
+ ) . $this->get_complete_upgrade_instructions(),
9301
+ 'plan_upgraded',
9302
+ __fs( 'yee-haw', $this->_slug ) . '!'
9303
+ );
9304
+
9305
+ $this->_admin_notices->remove_sticky( array(
9306
+ 'trial_started',
9307
+ 'trial_promotion',
9308
+ 'trial_expired',
9309
+ 'activation_complete',
9310
+ ) );
9311
+ break;
9312
+ case 'changed':
9313
+ $this->_admin_notices->add_sticky(
9314
+ sprintf(
9315
+ __fs( 'plan-changed-to-x-message', $this->_slug ),
9316
+ $this->_site->plan->title
9317
+ ),
9318
+ 'plan_changed'
9319
+ );
9320
+
9321
+ $this->_admin_notices->remove_sticky( array(
9322
+ 'trial_started',
9323
+ 'trial_promotion',
9324
+ 'trial_expired',
9325
+ 'activation_complete',
9326
+ ) );
9327
+ break;
9328
+ case 'downgraded':
9329
+ $this->_admin_notices->add_sticky(
9330
+ sprintf( __fs( 'license-expired-blocking-message', $this->_slug ) ),
9331
+ 'license_expired',
9332
+ __fs( 'hmm', $this->_slug ) . '...'
9333
+ );
9334
+ $this->_admin_notices->remove_sticky( 'plan_upgraded' );
9335
+ break;
9336
+ case 'cancelled':
9337
+ $this->_admin_notices->add(
9338
+ __fs( 'license-cancelled', $this->_slug ) . ' ' .
9339
+ sprintf(
9340
+ '<a href="%s">%s</a>',
9341
+ $this->contact_url( 'bug' ),
9342
+ __fs( 'contact-us-here', $this->_slug )
9343
+ ),
9344
+ __fs( 'hmm', $this->_slug ) . '...',
9345
+ 'error'
9346
+ );
9347
+ $this->_admin_notices->remove_sticky( 'plan_upgraded' );
9348
+ break;
9349
+ case 'expired':
9350
+ $this->_admin_notices->add_sticky(
9351
+ sprintf( __fs( 'license-expired-non-blocking-message', $this->_slug ), $this->_site->plan->title ),
9352
+ 'license_expired',
9353
+ __fs( 'hmm', $this->_slug ) . '...'
9354
+ );
9355
+ $this->_admin_notices->remove_sticky( 'plan_upgraded' );
9356
+ break;
9357
+ case 'trial_started':
9358
+ $this->_admin_notices->add_sticky(
9359
+ sprintf(
9360
+ __fs( 'trial-started-message', $this->_slug ),
9361
+ '<i>' . $this->get_plugin_name() . '</i>'
9362
+ ) . $this->get_complete_upgrade_instructions( $this->_storage->trial_plan->title ),
9363
+ 'trial_started',
9364
+ __fs( 'yee-haw', $this->_slug ) . '!'
9365
+ );
9366
+
9367
+ $this->_admin_notices->remove_sticky( array(
9368
+ 'trial_promotion',
9369
+ ) );
9370
+ break;
9371
+ case 'trial_expired':
9372
+ $this->_admin_notices->add_sticky(
9373
+ __fs( 'trial-expired-message', $this->_slug ),
9374
+ 'trial_expired',
9375
+ __fs( 'hmm', $this->_slug ) . '...'
9376
+ );
9377
+ $this->_admin_notices->remove_sticky( array(
9378
+ 'trial_started',
9379
+ 'trial_promotion',
9380
+ 'plan_upgraded',
9381
+ ) );
9382
+ break;
9383
+ }
9384
+ }
9385
+
9386
+ if ( 'none' !== $plan_change ) {
9387
+ $this->do_action( 'after_license_change', $plan_change, $this->_site->plan );
9388
+ }
9389
+ }
9390
+
9391
+ /**
9392
+ * @author Vova Feldman (@svovaf)
9393
+ * @since 1.0.5
9394
+ *
9395
+ * @param bool $background
9396
+ */
9397
+ protected function _activate_license( $background = false ) {
9398
+ $this->_logger->entrance();
9399
+
9400
+ $license_id = fs_request_get( 'license_id' );
9401
+
9402
+ if ( FS_Plugin_License::is_valid_id( $license_id ) && $license_id == $this->_site->license_id ) {
9403
+ // License is already activated.
9404
+ return;
9405
+ }
9406
+
9407
+ $premium_license = FS_Plugin_License::is_valid_id( $license_id ) ?
9408
+ $this->_get_license_by_id( $license_id ) :
9409
+ $this->_get_available_premium_license();
9410
+
9411
+ if ( ! is_object( $premium_license ) ) {
9412
+ return;
9413
+ }
9414
+
9415
+ /**
9416
+ * If the premium license is already associated with the install, just
9417
+ * update the license reference (activation is not required).
9418
+ *
9419
+ * @since 1.1.9
9420
+ */
9421
+ if ( $premium_license->id == $this->_site->license_id ) {
9422
+ // License is already activated.
9423
+ $this->_update_site_license( $premium_license );
9424
+ $this->_enrich_site_plan( false );
9425
+ $this->_store_account();
9426
+
9427
+ return;
9428
+ }
9429
+
9430
+ if ( $this->_site->user_id != $premium_license->user_id ) {
9431
+ $api_request_params = array( 'license_key' => $premium_license->secret_key );
9432
+ } else {
9433
+ $api_request_params = array();
9434
+ }
9435
+
9436
+ $api = $this->get_api_site_scope();
9437
+ $license = $api->call( "/licenses/{$premium_license->id}.json", 'put', $api_request_params );
9438
+
9439
+ if ( ! $this->is_api_result_entity( $license ) ) {
9440
+ if ( ! $background ) {
9441
+ $this->_admin_notices->add( sprintf(
9442
+ '%s %s',
9443
+ __fs( 'license-activation-failed-message', $this->_slug ),
9444
+ ( is_object( $license ) && isset( $license->error ) ?
9445
+ $license->error->message :
9446
+ sprintf( '%s<br><code>%s</code>',
9447
+ __fs( 'server-error-message', $this->_slug ),
9448
+ var_export( $license, true )
9449
+ )
9450
+ )
9451
+ ),
9452
+ __fs( 'hmm', $this->_slug ) . '...',
9453
+ 'error'
9454
+ );
9455
+ }
9456
+
9457
+ return;
9458
+ }
9459
+
9460
+ $premium_license = new FS_Plugin_License( $license );
9461
+
9462
+ // Updated site plan.
9463
+ $site = $this->get_api_site_scope()->get( '/', true );
9464
+ if ( $this->is_api_result_entity( $site ) ) {
9465
+ $this->_site = new FS_Site( $site );
9466
+ }
9467
+ $this->_update_site_license( $premium_license );
9468
+ $this->_enrich_site_plan( false );
9469
+
9470
+ $this->_store_account();
9471
+
9472
+ if ( ! $background ) {
9473
+ $this->_admin_notices->add_sticky(
9474
+ __fs( 'license-activated-message', $this->_slug ) .
9475
+ $this->get_complete_upgrade_instructions(),
9476
+ 'license_activated',
9477
+ __fs( 'yee-haw', $this->_slug ) . '!'
9478
+ );
9479
+ }
9480
+
9481
+ $this->_admin_notices->remove_sticky( array(
9482
+ 'trial_promotion',
9483
+ 'license_expired',
9484
+ ) );
9485
+ }
9486
+
9487
+ /**
9488
+ * @author Vova Feldman (@svovaf)
9489
+ * @since 1.0.5
9490
+ *
9491
+ * @param bool $show_notice
9492
+ */
9493
+ protected function _deactivate_license( $show_notice = true ) {
9494
+ $this->_logger->entrance();
9495
+
9496
+ if ( ! is_object( $this->_license ) ) {
9497
+ $this->_admin_notices->add(
9498
+ sprintf( __fs( 'no-active-license-message', $this->_slug ), $this->_site->plan->title ),
9499
+ __fs( 'hmm', $this->_slug ) . '...'
9500
+ );
9501
+
9502
+ return;
9503
+ }
9504
+
9505
+ $api = $this->get_api_site_scope();
9506
+ $license = $api->call( "/licenses/{$this->_site->license_id}.json", 'delete' );
9507
+
9508
+ if ( isset( $license->error ) ) {
9509
+ $this->_admin_notices->add(
9510
+ __fs( 'license-deactivation-failed-message', $this->_slug ) . '<br> ' .
9511
+ __fs( 'server-error-message', $this->_slug ) . ' ' . var_export( $license->error, true ),
9512
+ __fs( 'hmm', $this->_slug ) . '...',
9513
+ 'error'
9514
+ );
9515
+
9516
+ return;
9517
+ }
9518
+
9519
+ // Update license cache.
9520
+ for ( $i = 0, $len = count( $this->_licenses ); $i < $len; $i ++ ) {
9521
+ if ( $license->id == $this->_licenses[ $i ]->id ) {
9522
+ $this->_licenses[ $i ] = new FS_Plugin_License( $license );
9523
+ }
9524
+ }
9525
+
9526
+ // Updated site plan to default.
9527
+ $this->_sync_plans();
9528
+ $this->_site->plan->id = $this->_plans[0]->id;
9529
+ // Unlink license from site.
9530
+ $this->_update_site_license( null );
9531
+ $this->_enrich_site_plan( false );
9532
+
9533
+ $this->_store_account();
9534
+
9535
+ if ( $show_notice ) {
9536
+ $this->_admin_notices->add(
9537
+ sprintf( __fs( 'license-deactivation-message', $this->_slug ), $this->_site->plan->title ),
9538
+ __fs( 'ok', $this->_slug )
9539
+ );
9540
+ }
9541
+
9542
+ $this->_admin_notices->remove_sticky( array(
9543
+ 'plan_upgraded',
9544
+ 'license_activated',
9545
+ ) );
9546
+ }
9547
+
9548
+ /**
9549
+ * Site plan downgrade.
9550
+ *
9551
+ * @author Vova Feldman (@svovaf)
9552
+ * @since 1.0.4
9553
+ *
9554
+ * @uses FS_Api
9555
+ */
9556
+ private function _downgrade_site() {
9557
+ $this->_logger->entrance();
9558
+
9559
+ $api = $this->get_api_site_scope();
9560
+ $site = $api->call( 'downgrade.json', 'put' );
9561
+
9562
+ $plan_downgraded = false;
9563
+ $plan = false;
9564
+ if ( $this->is_api_result_entity( $site ) ) {
9565
+ $prev_plan_id = $this->_site->plan->id;
9566
+
9567
+ // Update new site plan id.
9568
+ $this->_site->plan->id = $site->plan_id;
9569
+
9570
+ $plan = $this->_enrich_site_plan();
9571
+ $subscription = $this->_sync_site_subscription( $this->_license );
9572
+
9573
+ // Plan downgraded if plan was changed or subscription was cancelled.
9574
+ $plan_downgraded = ( $plan instanceof FS_Plugin_Plan && $prev_plan_id != $plan->id ) ||
9575
+ ( is_object( $subscription ) && ! isset( $subscription->error ) && ! $subscription->is_active() );
9576
+ } else {
9577
+ // handle different error cases.
9578
+
9579
+ }
9580
+
9581
+ if ( $plan_downgraded ) {
9582
+ // Remove previous sticky message about upgrade (if exist).
9583
+ $this->_admin_notices->remove_sticky( 'plan_upgraded' );
9584
+
9585
+ $this->_admin_notices->add(
9586
+ sprintf( __fs( 'plan-x-downgraded-message', $this->_slug ),
9587
+ $plan->title,
9588
+ human_time_diff( time(), strtotime( $this->_license->expiration ) )
9589
+ )
9590
+ );
9591
+
9592
+ // Store site updates.
9593
+ $this->_store_site();
9594
+ } else {
9595
+ $this->_admin_notices->add(
9596
+ __fs( 'plan-downgraded-failure-message', $this->_slug ),
9597
+ __fs( 'oops', $this->_slug ) . '...',
9598
+ 'error'
9599
+ );
9600
+ }
9601
+ }
9602
+
9603
+ /**
9604
+ * @author Vova Feldman (@svovaf)
9605
+ * @since 1.1.8.1
9606
+ *
9607
+ * @param bool|string $plan_name
9608
+ *
9609
+ * @return bool If trial was successfully started.
9610
+ */
9611
+ function start_trial( $plan_name = false ) {
9612
+ $this->_logger->entrance();
9613
+
9614
+ if ( $this->is_trial() ) {
9615
+ // Already in trial mode.
9616
+ $this->_admin_notices->add(
9617
+ __fs( 'in-trial-mode', $this->_slug ),
9618
+ __fs( 'oops', $this->_slug ) . '...',
9619
+ 'error'
9620
+ );
9621
+
9622
+ return false;
9623
+ }
9624
+
9625
+ if ( $this->_site->is_trial_utilized() ) {
9626
+ // Trial was already utilized.
9627
+ $this->_admin_notices->add(
9628
+ __fs( 'trial-utilized', $this->_slug ),
9629
+ __fs( 'oops', $this->_slug ) . '...',
9630
+ 'error'
9631
+ );
9632
+
9633
+ return false;
9634
+ }
9635
+
9636
+ if ( false !== $plan_name ) {
9637
+ $plan = $this->get_plan_by_name( $plan_name );
9638
+
9639
+ if ( false === $plan ) {
9640
+ // Plan doesn't exist.
9641
+ $this->_admin_notices->add(
9642
+ sprintf( __fs( 'trial-plan-x-not-exist', $this->_slug ), $plan_name ),
9643
+ __fs( 'oops', $this->_slug ) . '...',
9644
+ 'error'
9645
+ );
9646
+
9647
+ return false;
9648
+ }
9649
+
9650
+ if ( ! $plan->has_trial() ) {
9651
+ // Plan doesn't exist.
9652
+ $this->_admin_notices->add(
9653
+ sprintf( __fs( 'plan-x-no-trial', $this->_slug ), $plan_name ),
9654
+ __fs( 'oops', $this->_slug ) . '...',
9655
+ 'error'
9656
+ );
9657
+
9658
+ return false;
9659
+ }
9660
+ } else {
9661
+ if ( ! $this->has_trial_plan() ) {
9662
+ // None of the plans have a trial.
9663
+ $this->_admin_notices->add(
9664
+ __fs( 'no-trials', $this->_slug ),
9665
+ __fs( 'oops', $this->_slug ) . '...',
9666
+ 'error'
9667
+ );
9668
+
9669
+ return false;
9670
+ }
9671
+
9672
+ $plans_with_trial = FS_Plan_Manager::instance()->get_trial_plans( $this->_plans );
9673
+
9674
+ $plan = $plans_with_trial[0];
9675
+ }
9676
+
9677
+ $api = $this->get_api_site_scope();
9678
+ $plan = $api->call( "plans/{$plan->id}/trials.json", 'post' );
9679
+
9680
+ if ( ! $this->is_api_result_entity( $plan ) ) {
9681
+ // Some API error while trying to start the trial.
9682
+ $this->_admin_notices->add(
9683
+ __fs( 'unexpected-api-error', $this->_slug ) . ' ' . var_export( $plan, true ),
9684
+ __fs( 'oops', $this->_slug ) . '...',
9685
+ 'error'
9686
+ );
9687
+
9688
+ return false;
9689
+ }
9690
+
9691
+ // Sync license.
9692
+ $this->_sync_license();
9693
+
9694
+ return $this->is_trial();
9695
+ }
9696
+
9697
+ /**
9698
+ * Cancel site trial.
9699
+ *
9700
+ * @author Vova Feldman (@svovaf)
9701
+ * @since 1.0.9
9702
+ *
9703
+ * @uses FS_Api
9704
+ */
9705
+ private function _cancel_trial() {
9706
+ $this->_logger->entrance();
9707
+
9708
+ if ( ! $this->is_trial() ) {
9709
+ $this->_admin_notices->add(
9710
+ __fs( 'trial-cancel-no-trial-message', $this->_slug ),
9711
+ __fs( 'oops', $this->_slug ) . '...',
9712
+ 'error'
9713
+ );
9714
+
9715
+ return;
9716
+ }
9717
+
9718
+ $api = $this->get_api_site_scope();
9719
+ $site = $api->call( 'trials.json', 'delete' );
9720
+
9721
+ $trial_cancelled = false;
9722
+
9723
+ if ( $this->is_api_result_entity( $site ) ) {
9724
+ $prev_trial_ends = $this->_site->trial_ends;
9725
+
9726
+ if ( $this->is_paid_trial() ) {
9727
+ $this->_license->expiration = $site->trial_ends;
9728
+ $this->_license->is_cancelled = true;
9729
+ $this->_update_site_license( $this->_license );
9730
+ $this->_store_licenses();
9731
+
9732
+ // Clear subscription reference.
9733
+ $this->_sync_site_subscription( null );
9734
+ }
9735
+
9736
+ // Update site info.
9737
+ $this->_site = new FS_Site( $site );
9738
+ $this->_enrich_site_plan();
9739
+
9740
+ $trial_cancelled = ( $prev_trial_ends != $site->trial_ends );
9741
+ } else {
9742
+ // handle different error cases.
9743
+
9744
+ }
9745
+
9746
+ if ( $trial_cancelled ) {
9747
+ // Remove previous sticky messages about upgrade or trial (if exist).
9748
+ $this->_admin_notices->remove_sticky( array(
9749
+ 'trial_started',
9750
+ 'trial_promotion',
9751
+ 'plan_upgraded',
9752
+ ) );
9753
+
9754
+ // Store site updates.
9755
+ $this->_store_site();
9756
+
9757
+ if ( ! $this->is_addon() ||
9758
+ ! $this->deactivate_premium_only_addon_without_license( true )
9759
+ ) {
9760
+ $this->_admin_notices->add(
9761
+ sprintf( __fs( 'trial-cancel-message', $this->_slug ), $this->_storage->trial_plan->title )
9762
+ );
9763
+ }
9764
+
9765
+ // Clear trial plan information.
9766
+ unset( $this->_storage->trial_plan );
9767
+ } else {
9768
+ $this->_admin_notices->add(
9769
+ __fs( 'trial-cancel-failure-message', $this->_slug ),
9770
+ __fs( 'oops', $this->_slug ) . '...',
9771
+ 'error'
9772
+ );
9773
+ }
9774
+ }
9775
+
9776
+ /**
9777
+ * @author Vova Feldman (@svovaf)
9778
+ * @since 1.0.6
9779
+ *
9780
+ * @param bool|number $plugin_id
9781
+ *
9782
+ * @return bool
9783
+ */
9784
+ private function _is_addon_id( $plugin_id ) {
9785
+ return is_numeric( $plugin_id ) && ( $this->get_id() != $plugin_id );
9786
+ }
9787
+
9788
+ /**
9789
+ * Check if user eligible to download premium version updates.
9790
+ *
9791
+ * @author Vova Feldman (@svovaf)
9792
+ * @since 1.0.6
9793
+ *
9794
+ * @return bool
9795
+ */
9796
+ private function _can_download_premium() {
9797
+ return $this->has_active_valid_license() ||
9798
+ ( $this->is_trial() && ! $this->get_trial_plan()->is_free() );
9799
+ }
9800
+
9801
+ /**
9802
+ *
9803
+ * @author Vova Feldman (@svovaf)
9804
+ * @since 1.0.6
9805
+ *
9806
+ * @param bool|number $addon_id
9807
+ * @param string $type "json" or "zip"
9808
+ *
9809
+ * @return string
9810
+ */
9811
+ private function _get_latest_version_endpoint( $addon_id = false, $type = 'json' ) {
9812
+
9813
+ $is_addon = $this->_is_addon_id( $addon_id );
9814
+
9815
+ $is_premium = null;
9816
+ if ( ! $is_addon ) {
9817
+ $is_premium = $this->_can_download_premium();
9818
+ } else if ( $this->is_addon_activated( $addon_id ) ) {
9819
+ $is_premium = self::get_instance_by_id( $addon_id )->_can_download_premium();
9820
+ }
9821
+
9822
+ // If add-on, then append add-on ID.
9823
+ $endpoint = ( $is_addon ? "/addons/$addon_id" : '' ) .
9824
+ '/updates/latest.' . $type;
9825
+
9826
+ // If add-on and not yet activated, try to fetch based on server licensing.
9827
+ if ( is_bool( $is_premium ) ) {
9828
+ $endpoint = add_query_arg( 'is_premium', json_encode( $is_premium ), $endpoint );
9829
+ }
9830
+
9831
+ if ( $this->has_secret_key() ) {
9832
+ $endpoint = add_query_arg( 'type', 'all', $endpoint );
9833
+ }
9834
+
9835
+ return $endpoint;
9836
+ }
9837
+
9838
+ /**
9839
+ * @author Vova Feldman (@svovaf)
9840
+ * @since 1.0.4
9841
+ *
9842
+ * @param bool|number $addon_id
9843
+ * @param bool $flush Since 1.1.7.3
9844
+ *
9845
+ * @return object|false Plugin latest tag info.
9846
+ */
9847
+ function _fetch_latest_version( $addon_id = false, $flush = true ) {
9848
+ $this->_logger->entrance();
9849
+
9850
+ /**
9851
+ * @since 1.1.7.3 Check for plugin updates from Freemius only if opted-in.
9852
+ * @since 1.1.7.4 Also check updates for add-ons.
9853
+ */
9854
+ if ( ! $this->is_registered() &&
9855
+ ! $this->_is_addon_id( $addon_id )
9856
+ ) {
9857
+ return false;
9858
+ }
9859
+
9860
+ $tag = $this->get_api_site_or_plugin_scope()->get(
9861
+ $this->_get_latest_version_endpoint( $addon_id, 'json' ),
9862
+ $flush
9863
+ );
9864
+
9865
+ $latest_version = ( is_object( $tag ) && isset( $tag->version ) ) ? $tag->version : 'couldn\'t get';
9866
+
9867
+ $this->_logger->departure( 'Latest version ' . $latest_version );
9868
+
9869
+ return ( is_object( $tag ) && isset( $tag->version ) ) ? $tag : false;
9870
+ }
9871
+
9872
+ #----------------------------------------------------------------------------------
9873
+ #region Download Plugin
9874
+ #----------------------------------------------------------------------------------
9875
+
9876
+ /**
9877
+ * Download latest plugin version, based on plan.
9878
+ *
9879
+ * Not like _download_latest(), this will redirect the page
9880
+ * to secure download url to prevent dual download (from FS to WP server,
9881
+ * and then from WP server to the client / browser).
9882
+ *
9883
+ * @author Vova Feldman (@svovaf)
9884
+ * @since 1.0.9
9885
+ *
9886
+ * @param bool|number $plugin_id
9887
+ *
9888
+ * @uses FS_Api
9889
+ * @uses wp_redirect()
9890
+ */
9891
+ private function download_latest_directly( $plugin_id = false ) {
9892
+ $this->_logger->entrance();
9893
+
9894
+ wp_redirect( $this->get_latest_download_api_url( $plugin_id ) );
9895
+ }
9896
+
9897
+ /**
9898
+ * Get latest plugin FS API download URL.
9899
+ *
9900
+ * @author Vova Feldman (@svovaf)
9901
+ * @since 1.0.9
9902
+ *
9903
+ * @param bool|number $plugin_id
9904
+ *
9905
+ * @return string
9906
+ */
9907
+ private function get_latest_download_api_url( $plugin_id = false ) {
9908
+ $this->_logger->entrance();
9909
+
9910
+ return $this->get_api_site_scope()->get_signed_url(
9911
+ $this->_get_latest_version_endpoint( $plugin_id, 'zip' )
9912
+ );
9913
+ }
9914
+
9915
+ /**
9916
+ * Get payment invoice URL.
9917
+ *
9918
+ * @author Vova Feldman (@svovaf)
9919
+ * @since 1.2.0
9920
+ *
9921
+ * @param bool|number $payment_id
9922
+ *
9923
+ * @return string
9924
+ */
9925
+ function _get_invoice_api_url( $payment_id = false ) {
9926
+ $this->_logger->entrance();
9927
+
9928
+ return $this->get_api_user_scope()->get_signed_url(
9929
+ "/payments/{$payment_id}/invoice.pdf"
9930
+ );
9931
+ }
9932
+
9933
+ /**
9934
+ * Get latest plugin download link.
9935
+ *
9936
+ * @author Vova Feldman (@svovaf)
9937
+ * @since 1.0.9
9938
+ *
9939
+ * @param string $label
9940
+ * @param bool|number $plugin_id
9941
+ *
9942
+ * @return string
9943
+ */
9944
+ private function get_latest_download_link( $label, $plugin_id = false ) {
9945
+ return sprintf(
9946
+ '<a target="_blank" href="%s">%s</a>',
9947
+ $this->_get_latest_download_local_url( $plugin_id ),
9948
+ $label
9949
+ );
9950
+ }
9951
+
9952
+ /**
9953
+ * Get latest plugin download local URL.
9954
+ *
9955
+ * @author Vova Feldman (@svovaf)
9956
+ * @since 1.0.9
9957
+ *
9958
+ * @param bool|number $plugin_id
9959
+ *
9960
+ * @return string
9961
+ */
9962
+ function _get_latest_download_local_url( $plugin_id = false ) {
9963
+ // Add timestamp to protect from caching.
9964
+ $params = array( 'ts' => WP_FS__SCRIPT_START_TIME );
9965
+
9966
+ if ( ! empty( $plugin_id ) ) {
9967
+ $params['plugin_id'] = $plugin_id;
9968
+ }
9969
+
9970
+ return $this->get_account_url( 'download_latest', $params );
9971
+ }
9972
+
9973
+ #endregion Download Plugin ------------------------------------------------------------------
9974
+
9975
+ /**
9976
+ * @author Vova Feldman (@svovaf)
9977
+ * @since 1.0.4
9978
+ *
9979
+ * @uses FS_Api
9980
+ *
9981
+ * @param bool $background Hints the method if it's a background updates check. If false, it means that
9982
+ * was initiated by the admin.
9983
+ * @param bool|number $plugin_id
9984
+ * @param bool $flush Since 1.1.7.3
9985
+ */
9986
+ private function check_updates( $background = false, $plugin_id = false, $flush = true ) {
9987
+ $this->_logger->entrance();
9988
+
9989
+ // Check if there's a newer version for download.
9990
+ $new_version = $this->_fetch_newer_version( $plugin_id, $flush );
9991
+
9992
+ $update = null;
9993
+ if ( is_object( $new_version ) ) {
9994
+ $update = new FS_Plugin_Tag( $new_version );
9995
+
9996
+ if ( ! $background ) {
9997
+ $this->_admin_notices->add(
9998
+ sprintf(
9999
+ __fs( 'version-x-released', $this->_slug ) . ' ' . __fs( 'please-download-x', $this->_slug ),
10000
+ $update->version,
10001
+ sprintf(
10002
+ '<a href="%s" target="_blank">%s</a>',
10003
+ $this->get_account_url( 'download_latest' ),
10004
+ sprintf( __fs( 'latest-x-version', $this->_slug ), $this->_site->plan->title )
10005
+ )
10006
+ ),
10007
+ __fs( 'new', $this->_slug ) . '!'
10008
+ );
10009
+ }
10010
+ } else if ( false === $new_version && ! $background ) {
10011
+ $this->_admin_notices->add(
10012
+ __fs( 'you-have-latest', $this->_slug ),
10013
+ __fs( 'you-are-good', $this->_slug )
10014
+ );
10015
+ }
10016
+
10017
+ $this->_store_update( $update, true, $plugin_id );
10018
+ }
10019
+
10020
+ /**
10021
+ * @author Vova Feldman (@svovaf)
10022
+ * @since 1.0.4
10023
+ *
10024
+ * @param bool $flush Since 1.1.7.3 add 24 hour cache by default.
10025
+ *
10026
+ * @return FS_Plugin[]
10027
+ *
10028
+ * @uses FS_Api
10029
+ */
10030
+ private function sync_addons( $flush = false ) {
10031
+ $this->_logger->entrance();
10032
+
10033
+ $api = $this->get_api_site_or_plugin_scope();
10034
+
10035
+ /**
10036
+ * @since 1.2.1
10037
+ *
10038
+ * If there's a cached version of the add-ons and not asking
10039
+ * for a flush, just use the currently stored add-ons.
10040
+ */
10041
+ if ( ! $flush && $api->is_cached( '/addons.json?enriched=true' ) ) {
10042
+ $addons = self::get_all_addons();
10043
+
10044
+ return $addons[ $this->_plugin->id ];
10045
+ }
10046
+
10047
+ $result = $api->get( '/addons.json?enriched=true', $flush );
10048
+
10049
+ $addons = array();
10050
+ if ( $this->is_api_result_object( $result, 'plugins' ) &&
10051
+ is_array( $result->plugins )
10052
+ ) {
10053
+ for ( $i = 0, $len = count( $result->plugins ); $i < $len; $i ++ ) {
10054
+ $addons[ $i ] = new FS_Plugin( $result->plugins[ $i ] );
10055
+ }
10056
+
10057
+ $this->_store_addons( $addons, true );
10058
+ }
10059
+
10060
+ return $addons;
10061
+ }
10062
+
10063
+ /**
10064
+ * Handle user email update.
10065
+ *
10066
+ * @author Vova Feldman (@svovaf)
10067
+ * @since 1.0.3
10068
+ * @uses FS_Api
10069
+ *
10070
+ * @param string $new_email
10071
+ *
10072
+ * @return object
10073
+ */
10074
+ private function update_email( $new_email ) {
10075
+ $this->_logger->entrance();
10076
+
10077
+
10078
+ $api = $this->get_api_user_scope();
10079
+ $user = $api->call( "?plugin_id={$this->_plugin->id}&fields=id,email,is_verified", 'put', array(
10080
+ 'email' => $new_email,
10081
+ 'after_email_confirm_url' => $this->_get_admin_page_url(
10082
+ 'account',
10083
+ array( 'fs_action' => 'sync_user' )
10084
+ ),
10085
+ ) );
10086
+
10087
+ if ( ! isset( $user->error ) ) {
10088
+ $this->_user->email = $user->email;
10089
+ $this->_user->is_verified = $user->is_verified;
10090
+ $this->_store_user();
10091
+ } else {
10092
+ // handle different error cases.
10093
+
10094
+ }
10095
+
10096
+ return $user;
10097
+ }
10098
+
10099
+ #----------------------------------------------------------------------------------
10100
+ #region API Error Handling
10101
+ #----------------------------------------------------------------------------------
10102
+
10103
+ /**
10104
+ * @author Vova Feldman (@svovaf)
10105
+ * @since 1.1.1
10106
+ *
10107
+ * @param mixed $result
10108
+ *
10109
+ * @return bool Is API result contains an error.
10110
+ */
10111
+ private function is_api_error( $result ) {
10112
+ return FS_Api::is_api_error( $result );
10113
+ }
10114
+
10115
+ /**
10116
+ * Checks if given API result is a non-empty and not an error object.
10117
+ *
10118
+ * @author Vova Feldman (@svovaf)
10119
+ * @since 1.2.1.5
10120
+ *
10121
+ * @param mixed $result
10122
+ * @param string|null $required_property Optional property we want to verify that is set.
10123
+ *
10124
+ * @return bool
10125
+ */
10126
+ function is_api_result_object( $result, $required_property = null ) {
10127
+ return FS_Api::is_api_result_object( $result, $required_property );
10128
+ }
10129
+
10130
+ /**
10131
+ * Checks if given API result is a non-empty entity object with non-empty ID.
10132
+ *
10133
+ * @author Vova Feldman (@svovaf)
10134
+ * @since 1.2.1.5
10135
+ *
10136
+ * @param mixed $result
10137
+ *
10138
+ * @return bool
10139
+ */
10140
+ private function is_api_result_entity( $result ) {
10141
+ return FS_Api::is_api_result_entity( $result );
10142
+ }
10143
+
10144
+ #endregion
10145
+
10146
+ /**
10147
+ * Make sure a given argument is an array of a specific type.
10148
+ *
10149
+ * @author Vova Feldman (@svovaf)
10150
+ * @since 1.2.1.5
10151
+ *
10152
+ * @param mixed $array
10153
+ * @param string $class
10154
+ *
10155
+ * @return bool
10156
+ */
10157
+ private function is_array_instanceof( $array, $class ) {
10158
+ return ( is_array( $array ) && ( empty( $array ) || $array[0] instanceof $class ) );
10159
+ }
10160
+
10161
+ /**
10162
+ * Start install ownership change.
10163
+ *
10164
+ * @author Vova Feldman (@svovaf)
10165
+ * @since 1.1.1
10166
+ * @uses FS_Api
10167
+ *
10168
+ * @param string $candidate_email
10169
+ *
10170
+ * @return bool Is ownership change successfully initiated.
10171
+ */
10172
+ private function init_change_owner( $candidate_email ) {
10173
+ $this->_logger->entrance();
10174
+
10175
+ $api = $this->get_api_site_scope();
10176
+ $result = $api->call( "/users/{$this->_user->id}.json", 'put', array(
10177
+ 'email' => $candidate_email,
10178
+ 'after_confirm_url' => $this->_get_admin_page_url(
10179
+ 'account',
10180
+ array( 'fs_action' => 'change_owner' )
10181
+ ),
10182
+ ) );
10183
+
10184
+ return ! $this->is_api_error( $result );
10185
+ }
10186
+
10187
+ /**
10188
+ * Handle install ownership change.
10189
+ *
10190
+ * @author Vova Feldman (@svovaf)
10191
+ * @since 1.1.1
10192
+ * @uses FS_Api
10193
+ *
10194
+ * @return bool Was ownership change successfully complete.
10195
+ */
10196
+ private function complete_change_owner() {
10197
+ $this->_logger->entrance();
10198
+
10199
+ $site_result = $this->get_api_site_scope( true )->get();
10200
+ $site = new FS_Site( $site_result );
10201
+ $this->_site = $site;
10202
+
10203
+ $user = new FS_User();
10204
+ $user->id = fs_request_get( 'user_id' );
10205
+
10206
+ // Validate install's user and given user.
10207
+ if ( $user->id != $this->_site->user_id ) {
10208
+ return false;
10209
+ }
10210
+
10211
+ $user->public_key = fs_request_get( 'user_public_key' );
10212
+ $user->secret_key = fs_request_get( 'user_secret_key' );
10213
+
10214
+ // Fetch new user information.
10215
+ $this->_user = $user;
10216
+ $user_result = $this->get_api_user_scope( true )->get();
10217
+ $user = new FS_User( $user_result );
10218
+ $this->_user = $user;
10219
+
10220
+ $this->_set_account( $user, $site );
10221
+
10222
+ return true;
10223
+ }
10224
+
10225
+ /**
10226
+ * Handle user name update.
10227
+ *
10228
+ * @author Vova Feldman (@svovaf)
10229
+ * @since 1.0.9
10230
+ * @uses FS_Api
10231
+ *
10232
+ * @return object
10233
+ */
10234
+ private function update_user_name() {
10235
+ $this->_logger->entrance();
10236
+ $name = fs_request_get( 'fs_user_name_' . $this->_slug, '' );
10237
+
10238
+ $api = $this->get_api_user_scope();
10239
+ $user = $api->call( "?plugin_id={$this->_plugin->id}&fields=id,first,last", 'put', array(
10240
+ 'name' => $name,
10241
+ ) );
10242
+
10243
+ if ( ! isset( $user->error ) ) {
10244
+ $this->_user->first = $user->first;
10245
+ $this->_user->last = $user->last;
10246
+ $this->_store_user();
10247
+ } else {
10248
+ // handle different error cases.
10249
+
10250
+ }
10251
+
10252
+ return $user;
10253
+ }
10254
+
10255
+ /**
10256
+ * Verify user email.
10257
+ *
10258
+ * @author Vova Feldman (@svovaf)
10259
+ * @since 1.0.3
10260
+ * @uses FS_Api
10261
+ */
10262
+ private function verify_email() {
10263
+ $this->_handle_account_user_sync();
10264
+
10265
+ if ( $this->_user->is_verified() ) {
10266
+ return;
10267
+ }
10268
+
10269
+ $api = $this->get_api_site_scope();
10270
+ $result = $api->call( "/users/{$this->_user->id}/verify.json", 'put', array(
10271
+ 'after_email_confirm_url' => $this->_get_admin_page_url(
10272
+ 'account',
10273
+ array( 'fs_action' => 'sync_user' )
10274
+ )
10275
+ ) );
10276
+
10277
+ if ( ! isset( $result->error ) ) {
10278
+ $this->_admin_notices->add( sprintf(
10279
+ __fs( 'verification-email-sent-message', $this->_slug ),
10280
+ sprintf( '<a href="mailto:%1s">%2s</a>', esc_url( $this->_user->email ), $this->_user->email )
10281
+ ) );
10282
+ } else {
10283
+ // handle different error cases.
10284
+
10285
+ }
10286
+ }
10287
+
10288
+ /**
10289
+ * @author Vova Feldman (@svovaf)
10290
+ * @since 1.1.2
10291
+ *
10292
+ * @param array $params
10293
+ *
10294
+ * @return string
10295
+ */
10296
+ private function get_activation_url( $params = array() ) {
10297
+ return $this->apply_filters( 'connect_url', $this->_get_admin_page_url( '', $params ) );
10298
+ }
10299
+
10300
+ /**
10301
+ * @author Vova Feldman (@svovaf)
10302
+ * @since 1.2.1.5
10303
+ *
10304
+ * @param array $params
10305
+ *
10306
+ * @return string
10307
+ */
10308
+ function get_reconnect_url( $params = array() ) {
10309
+ $params['fs_action'] = 'reset_anonymous_mode';
10310
+ $params['fs_slug'] = $this->_slug;
10311
+
10312
+ return $this->apply_filters( 'connect_url', $this->_get_admin_page_url( '', $params ) );
10313
+ }
10314
+
10315
+ /**
10316
+ * Get the URL of the page that should be loaded after the user connect or skip in the opt-in screen.
10317
+ *
10318
+ * @author Vova Feldman (@svovaf)
10319
+ * @since 1.1.3
10320
+ *
10321
+ * @param string $filter Filter name.
10322
+ *
10323
+ * @return string
10324
+ */
10325
+ function get_after_activation_url( $filter ) {
10326
+ $first_time_path = $this->_menu->get_first_time_path();
10327
+
10328
+ return $this->apply_filters(
10329
+ $filter,
10330
+ empty( $first_time_path ) ?
10331
+ $this->_get_admin_page_url() :
10332
+ $first_time_path
10333
+ );
10334
+ }
10335
+
10336
+ /**
10337
+ * Handle account page updates / edits / actions.
10338
+ *
10339
+ * @author Vova Feldman (@svovaf)
10340
+ * @since 1.0.2
10341
+ *
10342
+ */
10343
+ private function _handle_account_edits() {
10344
+ if ( ! current_user_can( 'activate_plugins' ) ) {
10345
+ return;
10346
+ }
10347
+
10348
+ $plugin_id = fs_request_get( 'plugin_id', $this->get_id() );
10349
+ $action = fs_get_action();
10350
+
10351
+ switch ( $action ) {
10352
+ case 'delete_account':
10353
+ check_admin_referer( $action );
10354
+
10355
+ if ( $plugin_id == $this->get_id() ) {
10356
+ $this->delete_account_event();
10357
+
10358
+ // Clear user and site.
10359
+ $this->_site = null;
10360
+ $this->_user = null;
10361
+
10362
+ fs_redirect( $this->get_activation_url() );
10363
+ } else {
10364
+ if ( $this->is_addon_activated( $plugin_id ) ) {
10365
+ $fs_addon = self::get_instance_by_id( $plugin_id );
10366
+ $fs_addon->delete_account_event();
10367
+
10368
+ fs_redirect( $this->_get_admin_page_url( 'account' ) );
10369
+ }
10370
+ }
10371
+
10372
+ return;
10373
+
10374
+ case 'downgrade_account':
10375
+ check_admin_referer( $action );
10376
+
10377
+ if ( $plugin_id == $this->get_id() ) {
10378
+ $this->_downgrade_site();
10379
+ } else if ( $this->is_addon_activated( $plugin_id ) ) {
10380
+ $fs_addon = self::get_instance_by_id( $plugin_id );
10381
+ $fs_addon->_downgrade_site();
10382
+ }
10383
+
10384
+ return;
10385
+
10386
+ case 'activate_license':
10387
+ check_admin_referer( $action );
10388
+
10389
+ if ( $plugin_id == $this->get_id() ) {
10390
+ $this->_activate_license();
10391
+ } else {
10392
+ if ( $this->is_addon_activated( $plugin_id ) ) {
10393
+ $fs_addon = self::get_instance_by_id( $plugin_id );
10394
+ $fs_addon->_activate_license();
10395
+ }
10396
+ }
10397
+
10398
+ return;
10399
+
10400
+ case 'deactivate_license':
10401
+ check_admin_referer( $action );
10402
+
10403
+ if ( $plugin_id == $this->get_id() ) {
10404
+ $this->_deactivate_license();
10405
+ } else {
10406
+ if ( $this->is_addon_activated( $plugin_id ) ) {
10407
+ $fs_addon = self::get_instance_by_id( $plugin_id );
10408
+ $fs_addon->_deactivate_license();
10409
+ }
10410
+ }
10411
+
10412
+ return;
10413
+
10414
+ case 'check_updates':
10415
+ check_admin_referer( $action );
10416
+ $this->check_updates();
10417
+
10418
+ return;
10419
+
10420
+ case 'change_owner':
10421
+ $state = fs_request_get( 'state', 'init' );
10422
+ switch ( $state ) {
10423
+ case 'init':
10424
+ $candidate_email = fs_request_get( 'candidate_email', '' );
10425
+
10426
+ if ( $this->init_change_owner( $candidate_email ) ) {
10427
+ $this->_admin_notices->add( sprintf( __fs( 'change-owner-request-sent-x', $this->_slug ), '<b>' . $this->_user->email . '</b>' ) );
10428
+ }
10429
+ break;
10430
+ case 'owner_confirmed':
10431
+ $candidate_email = fs_request_get( 'candidate_email', '' );
10432
+
10433
+ $this->_admin_notices->add( sprintf( __fs( 'change-owner-request_owner-confirmed', $this->_slug ), '<b>' . $candidate_email . '</b>' ) );
10434
+ break;
10435
+ case 'candidate_confirmed':
10436
+ if ( $this->complete_change_owner() ) {
10437
+ $this->_admin_notices->add_sticky(
10438
+ sprintf( __fs( 'change-owner-request_candidate-confirmed', $this->_slug ), '<b>' . $this->_user->email . '</b>' ),
10439
+ 'ownership_changed',
10440
+ __fs( 'congrats', $this->_slug ) . '!'
10441
+ );
10442
+ } else {
10443
+ // @todo Handle failed ownership change message.
10444
+ }
10445
+ break;
10446
+ }
10447
+
10448
+ return;
10449
+
10450
+ case 'update_email':
10451
+ check_admin_referer( 'update_email' );
10452
+
10453
+ $new_email = fs_request_get( 'fs_email_' . $this->_slug, '' );
10454
+ $result = $this->update_email( $new_email );
10455
+
10456
+ if ( isset( $result->error ) ) {
10457
+ switch ( $result->error->code ) {
10458
+ case 'user_exist':
10459
+ $this->_admin_notices->add(
10460
+ __fs( 'user-exist-message', $this->_slug ) . ' ' .
10461
+ sprintf( __fs( 'user-exist-message_ownership', $this->_slug ), '<b>' . $new_email . '</b>' ) .
10462
+ sprintf(
10463
+ '<a style="margin-left: 10px;" href="%s"><button class="button button-primary">%s &nbsp;&#10140;</button></a>',
10464
+ $this->get_account_url( 'change_owner', array(
10465
+ 'state' => 'init',
10466
+ 'candidate_email' => $new_email
10467
+ ) ),
10468
+ __fs( 'change-ownership', $this->_slug )
10469
+ ),
10470
+ __fs( 'oops', $this->_slug ) . '...',
10471
+ 'error'
10472
+ );
10473
+ break;
10474
+ }
10475
+ } else {
10476
+ $this->_admin_notices->add( __fs( 'email-updated-message', $this->_slug ) );
10477
+ }
10478
+
10479
+ return;
10480
+
10481
+ case 'update_user_name':
10482
+ check_admin_referer( 'update_user_name' );
10483
+
10484
+ $result = $this->update_user_name();
10485
+
10486
+ if ( isset( $result->error ) ) {
10487
+ $this->_admin_notices->add(
10488
+ __fs( 'name-update-failed-message', $this->_slug ),
10489
+ __fs( 'oops', $this->_slug ) . '...',
10490
+ 'error'
10491
+ );
10492
+ } else {
10493
+ $this->_admin_notices->add( __fs( 'name-updated-message', $this->_slug ) );
10494
+ }
10495
+
10496
+ return;
10497
+
10498
+ #region Actions that might be called from external links (e.g. email)
10499
+
10500
+ case 'cancel_trial':
10501
+ if ( $plugin_id == $this->get_id() ) {
10502
+ $this->_cancel_trial();
10503
+ } else {
10504
+ if ( $this->is_addon_activated( $plugin_id ) ) {
10505
+ $fs_addon = self::get_instance_by_id( $plugin_id );
10506
+ $fs_addon->_cancel_trial();
10507
+ }
10508
+ }
10509
+
10510
+ return;
10511
+
10512
+ case 'verify_email':
10513
+ $this->verify_email();
10514
+
10515
+ return;
10516
+
10517
+ case 'sync_user':
10518
+ $this->_handle_account_user_sync();
10519
+
10520
+ return;
10521
+
10522
+ case $this->_slug . '_sync_license':
10523
+ $this->_sync_license();
10524
+
10525
+ return;
10526
+
10527
+ case 'download_latest':
10528
+ $this->download_latest_directly( $plugin_id );
10529
+
10530
+ return;
10531
+
10532
+ #endregion
10533
+ }
10534
+
10535
+ if ( WP_FS__IS_POST_REQUEST ) {
10536
+ $properties = array( 'site_secret_key', 'site_id', 'site_public_key' );
10537
+ foreach ( $properties as $p ) {
10538
+ if ( 'update_' . $p === $action ) {
10539
+ check_admin_referer( $action );
10540
+
10541
+ $this->_logger->log( $action );
10542
+
10543
+ $site_property = substr( $p, strlen( 'site_' ) );
10544
+ $site_property_value = fs_request_get( 'fs_' . $p . '_' . $this->_slug, '' );
10545
+ $this->get_site()->{$site_property} = $site_property_value;
10546
+
10547
+ // Store account after modification.
10548
+ $this->_store_site();
10549
+
10550
+ $this->do_action( 'account_property_edit', 'site', $site_property, $site_property_value );
10551
+
10552
+ $this->_admin_notices->add( sprintf(
10553
+ __fs( 'x-updated', $this->_slug ),
10554
+ '<b>' . str_replace( '_', ' ', $p ) . '</b>' ) );
10555
+
10556
+ return;
10557
+ }
10558
+ }
10559
+ }
10560
+ }
10561
+
10562
+ /**
10563
+ * Account page resources load.
10564
+ *
10565
+ * @author Vova Feldman (@svovaf)
10566
+ * @since 1.0.6
10567
+ */
10568
+ function _account_page_load() {
10569
+ $this->_logger->entrance();
10570
+
10571
+ $this->_logger->info( var_export( $_REQUEST, true ) );
10572
+
10573
+ fs_enqueue_local_style( 'fs_account', '/admin/account.css' );
10574
+
10575
+ if ( $this->has_addons() ) {
10576
+ wp_enqueue_script( 'plugin-install' );
10577
+ add_thickbox();
10578
+
10579
+ function fs_addons_body_class( $classes ) {
10580
+ $classes .= ' plugins-php';
10581
+
10582
+ return $classes;
10583
+ }
10584
+
10585
+ add_filter( 'admin_body_class', 'fs_addons_body_class' );
10586
+ }
10587
+
10588
+ if ( $this->has_paid_plan() &&
10589
+ ! $this->has_any_license() &&
10590
+ ! $this->is_sync_executed() &&
10591
+ $this->is_tracking_allowed()
10592
+ ) {
10593
+ /**
10594
+ * If no licenses found and no sync job was executed during the last 24 hours,
10595
+ * just execute the sync job right away (blocking execution).
10596
+ *
10597
+ * @since 1.1.7.3
10598
+ */
10599
+ $this->run_manual_sync();
10600
+ }
10601
+
10602
+ $this->_handle_account_edits();
10603
+
10604
+ $this->do_action( 'account_page_load_before_departure' );
10605
+ }
10606
+
10607
+ /**
10608
+ * Render account page.
10609
+ *
10610
+ * @author Vova Feldman (@svovaf)
10611
+ * @since 1.0.0
10612
+ */
10613
+ function _account_page_render() {
10614
+ $this->_logger->entrance();
10615
+
10616
+ $template = 'account.php';
10617
+ if ( 'billing' === fs_request_get( 'tab' ) ) {
10618
+ $template = 'billing.php';
10619
+ }
10620
+
10621
+ $vars = array( 'slug' => $this->_slug );
10622
+
10623
+ /**
10624
+ * Added filter to the template to allow developers wrapping the template
10625
+ * in custom HTML (e.g. within a wizard/tabs).
10626
+ *
10627
+ * @author Vova Feldman (@svovaf)
10628
+ * @since 1.2.1.6
10629
+ */
10630
+ echo $this->apply_filters( "templates/{$template}", fs_get_template( $template, $vars ) );
10631
+ }
10632
+
10633
+ /**
10634
+ * Render account connect page.
10635
+ *
10636
+ * @author Vova Feldman (@svovaf)
10637
+ * @since 1.0.7
10638
+ */
10639
+ function _connect_page_render() {
10640
+ $this->_logger->entrance();
10641
+
10642
+ $vars = array( 'slug' => $this->_slug );
10643
+
10644
+ /**
10645
+ * Added filter to the template to allow developers wrapping the template
10646
+ * in custom HTML (e.g. within a wizard/tabs).
10647
+ *
10648
+ * @author Vova Feldman (@svovaf)
10649
+ * @since 1.2.1.6
10650
+ */
10651
+ echo $this->apply_filters( 'templates/connect.php', fs_get_template( 'connect.php', $vars ) );
10652
+ }
10653
+
10654
+ /**
10655
+ * Load required resources before add-ons page render.
10656
+ *
10657
+ * @author Vova Feldman (@svovaf)
10658
+ * @since 1.0.6
10659
+ */
10660
+ function _addons_page_load() {
10661
+ $this->_logger->entrance();
10662
+
10663
+ fs_enqueue_local_style( 'fs_addons', '/admin/add-ons.css' );
10664
+
10665
+ wp_enqueue_script( 'plugin-install' );
10666
+ add_thickbox();
10667
+
10668
+ function fs_addons_body_class( $classes ) {
10669
+ $classes .= ' plugins-php';
10670
+
10671
+ return $classes;
10672
+ }
10673
+
10674
+ add_filter( 'admin_body_class', 'fs_addons_body_class' );
10675
+
10676
+ if ( ! $this->is_registered() && $this->is_org_repo_compliant() ) {
10677
+ $this->_admin_notices->add(
10678
+ sprintf( __fs( 'addons-info-external-message', $this->_slug ), '<b>' . $this->get_plugin_name() . '</b>' ),
10679
+ __fs( 'heads-up', $this->_slug ),
10680
+ 'update-nag'
10681
+ );
10682
+ }
10683
+ }
10684
+
10685
+ /**
10686
+ * Render add-ons page.
10687
+ *
10688
+ * @author Vova Feldman (@svovaf)
10689
+ * @since 1.0.6
10690
+ */
10691
+ function _addons_page_render() {
10692
+ $this->_logger->entrance();
10693
+
10694
+ $vars = array( 'slug' => $this->_slug );
10695
+
10696
+ /**
10697
+ * Added filter to the template to allow developers wrapping the template
10698
+ * in custom HTML (e.g. within a wizard/tabs).
10699
+ *
10700
+ * @author Vova Feldman (@svovaf)
10701
+ * @since 1.2.1.6
10702
+ */
10703
+ echo $this->apply_filters( 'templates/add-ons.php', fs_get_template( 'add-ons.php', $vars ) );
10704
+ }
10705
+
10706
+ /* Pricing & Upgrade
10707
+ ------------------------------------------------------------------------------------------------------------------*/
10708
+ /**
10709
+ * Render pricing page.
10710
+ *
10711
+ * @author Vova Feldman (@svovaf)
10712
+ * @since 1.0.0
10713
+ */
10714
+ function _pricing_page_render() {
10715
+ $this->_logger->entrance();
10716
+
10717
+ $vars = array( 'slug' => $this->_slug );
10718
+
10719
+ if ( 'true' === fs_request_get( 'checkout', false ) ) {
10720
+ fs_require_once_template( 'checkout.php', $vars );
10721
+ } else {
10722
+ fs_require_once_template( 'pricing.php', $vars );
10723
+ }
10724
+ }
10725
+
10726
+ #----------------------------------------------------------------------------------
10727
+ #region Contact Us
10728
+ #----------------------------------------------------------------------------------
10729
+
10730
+ /**
10731
+ * Render contact-us page.
10732
+ *
10733
+ * @author Vova Feldman (@svovaf)
10734
+ * @since 1.0.3
10735
+ */
10736
+ function _contact_page_render() {
10737
+ $this->_logger->entrance();
10738
+
10739
+ $vars = array( 'slug' => $this->_slug );
10740
+ fs_require_once_template( 'contact.php', $vars );
10741
+ }
10742
+
10743
+ #endregion ------------------------------------------------------------------------
10744
+
10745
+ /**
10746
+ * Hide all admin notices to prevent distractions.
10747
+ *
10748
+ * @author Vova Feldman (@svovaf)
10749
+ * @since 1.0.3
10750
+ *
10751
+ * @uses remove_all_actions()
10752
+ */
10753
+ private static function _hide_admin_notices() {
10754
+ remove_all_actions( 'admin_notices' );
10755
+ remove_all_actions( 'network_admin_notices' );
10756
+ remove_all_actions( 'all_admin_notices' );
10757
+ remove_all_actions( 'user_admin_notices' );
10758
+ }
10759
+
10760
+ static function _clean_admin_content_section_hook() {
10761
+ self::_hide_admin_notices();
10762
+
10763
+ // Hide footer.
10764
+ echo '<style>#wpfooter { display: none !important; }</style>';
10765
+ }
10766
+
10767
+ /**
10768
+ * Attach to admin_head hook to hide all admin notices.
10769
+ *
10770
+ * @author Vova Feldman (@svovaf)
10771
+ * @since 1.0.3
10772
+ */
10773
+ static function _clean_admin_content_section() {
10774
+ add_action( 'admin_head', 'Freemius::_clean_admin_content_section_hook' );
10775
+ }
10776
+
10777
+ /* CSS & JavaScript
10778
+ ------------------------------------------------------------------------------------------------------------------*/
10779
+ /* function _enqueue_script($handle, $src) {
10780
+ $url = plugins_url( substr( WP_FS__DIR_JS, strlen( $this->_plugin_dir_path ) ) . '/assets/js/' . $src );
10781
+
10782
+ $this->_logger->entrance( 'script = ' . $url );
10783
+
10784
+ wp_enqueue_script( $handle, $url );
10785
+ }*/
10786
+
10787
+ /* SDK
10788
+ ------------------------------------------------------------------------------------------------------------------*/
10789
+ private $_user_api;
10790
+
10791
+ /**
10792
+ *
10793
+ * @author Vova Feldman (@svovaf)
10794
+ * @since 1.0.2
10795
+ *
10796
+ * @param bool $flush
10797
+ *
10798
+ * @return FS_Api
10799
+ */
10800
+ function get_api_user_scope( $flush = false ) {
10801
+ if ( ! isset( $this->_user_api ) || $flush ) {
10802
+ $this->_user_api = FS_Api::instance(
10803
+ $this->_slug,
10804
+ 'user',
10805
+ $this->_user->id,
10806
+ $this->_user->public_key,
10807
+ ! $this->is_live(),
10808
+ $this->_user->secret_key
10809
+ );
10810
+ }
10811
+
10812
+ return $this->_user_api;
10813
+ }
10814
+
10815
+ private $_site_api;
10816
+
10817
+ /**
10818
+ *
10819
+ * @author Vova Feldman (@svovaf)
10820
+ * @since 1.0.2
10821
+ *
10822
+ * @param bool $flush
10823
+ *
10824
+ * @return FS_Api
10825
+ */
10826
+ function get_api_site_scope( $flush = false ) {
10827
+ if ( ! isset( $this->_site_api ) || $flush ) {
10828
+ $this->_site_api = FS_Api::instance(
10829
+ $this->_slug,
10830
+ 'install',
10831
+ $this->_site->id,
10832
+ $this->_site->public_key,
10833
+ ! $this->is_live(),
10834
+ $this->_site->secret_key
10835
+ );
10836
+ }
10837
+
10838
+ return $this->_site_api;
10839
+ }
10840
+
10841
+ private $_plugin_api;
10842
+
10843
+ /**
10844
+ * Get plugin public API scope.
10845
+ *
10846
+ * @author Vova Feldman (@svovaf)
10847
+ * @since 1.0.7
10848
+ *
10849
+ * @return FS_Api
10850
+ */
10851
+ function get_api_plugin_scope() {
10852
+ if ( ! isset( $this->_plugin_api ) ) {
10853
+ $this->_plugin_api = FS_Api::instance(
10854
+ $this->_slug,
10855
+ 'plugin',
10856
+ $this->_plugin->id,
10857
+ $this->_plugin->public_key,
10858
+ ! $this->is_live()
10859
+ );
10860
+ }
10861
+
10862
+ return $this->_plugin_api;
10863
+ }
10864
+
10865
+ /**
10866
+ * Get site API scope object (fallback to public plugin scope when not registered).
10867
+ *
10868
+ * @author Vova Feldman (@svovaf)
10869
+ * @since 1.0.7
10870
+ *
10871
+ * @return FS_Api
10872
+ */
10873
+ function get_api_site_or_plugin_scope() {
10874
+ return $this->is_registered() ?
10875
+ $this->get_api_site_scope() :
10876
+ $this->get_api_plugin_scope();
10877
+ }
10878
+
10879
+ /**
10880
+ * Show trial promotional notice (if any trial exist).
10881
+ *
10882
+ * @author Vova Feldman (@svovaf)
10883
+ * @since 1.0.9
10884
+ *
10885
+ * @param $plans
10886
+ */
10887
+ function _check_for_trial_plans( $plans ) {
10888
+ $this->_storage->has_trial_plan = FS_Plan_Manager::instance()->has_trial_plan( $plans );
10889
+ }
10890
+
10891
+ /**
10892
+ * During trial promotion the "upgrade" submenu item turns to
10893
+ * "start trial" to encourage the trial. Since we want to keep
10894
+ * the same menu item handler and there's no robust way to
10895
+ * add new arguments to the menu item link's querystring,
10896
+ * use JavaScript to find the menu item and update the href of
10897
+ * the link.
10898
+ *
10899
+ * @author Vova Feldman (@svovaf)
10900
+ * @since 1.2.1.5
10901
+ */
10902
+ function _fix_start_trial_menu_item_url() {
10903
+ $template_args = array( 'slug' => $this->_slug );
10904
+ fs_require_template( 'add-trial-to-pricing.php', $template_args );
10905
+ }
10906
+
10907
+ /**
10908
+ * Show trial promotional notice (if any trial exist).
10909
+ *
10910
+ * @author Vova Feldman (@svovaf)
10911
+ * @since 1.0.9
10912
+ *
10913
+ * @return bool If trial notice added.
10914
+ */
10915
+ function _add_trial_notice() {
10916
+ if ( ! current_user_can( 'activate_plugins' ) ) {
10917
+ return false;
10918
+ }
10919
+
10920
+ if ( ! $this->is_user_in_admin() ) {
10921
+ return false;
10922
+ }
10923
+
10924
+ // Check if trial message is already shown.
10925
+ if ( $this->_admin_notices->has_sticky( 'trial_promotion' ) ) {
10926
+ add_action( 'admin_footer', array( &$this, '_fix_start_trial_menu_item_url' ) );
10927
+
10928
+ $this->_menu->add_counter_to_menu_item( 1, 'fs-trial' );
10929
+
10930
+ return false;
10931
+ }
10932
+
10933
+ if ( $this->is_premium() && ! WP_FS__DEV_MODE ) {
10934
+ // Don't show trial if running the premium code, unless running in DEV mode.
10935
+ return false;
10936
+ }
10937
+
10938
+ if ( ! $this->has_trial_plan() ) {
10939
+ // No plans with trial.
10940
+ return false;
10941
+ }
10942
+
10943
+ if ( ! $this->apply_filters( 'show_trial', true ) ) {
10944
+ // Developer explicitly asked not to show the trial promo.
10945
+ return false;
10946
+ }
10947
+
10948
+ if ( $this->is_registered() ) {
10949
+ // Check if trial already utilized.
10950
+ if ( $this->_site->is_trial_utilized() ) {
10951
+ return false;
10952
+ }
10953
+
10954
+ if ( $this->is_paying_or_trial() ) {
10955
+ // Don't show trial if paying or already in trial.
10956
+ return false;
10957
+ }
10958
+ }
10959
+
10960
+ if ( $this->is_activation_mode() || $this->is_pending_activation() ) {
10961
+ // If not yet opted-in/skipped, or pending activation, don't show trial.
10962
+ return false;
10963
+ }
10964
+
10965
+ $last_time_trial_promotion_shown = $this->_storage->get( 'trial_promotion_shown', false );
10966
+ $was_promotion_shown_before = ( false !== $last_time_trial_promotion_shown );
10967
+
10968
+ // Show promotion if never shown before and 24 hours after initial activation with FS.
10969
+ if ( ! $was_promotion_shown_before &&
10970
+ $this->_storage->install_timestamp > ( time() - WP_FS__TIME_24_HOURS_IN_SEC )
10971
+ ) {
10972
+ return false;
10973
+ }
10974
+
10975
+ // OR if promotion was shown before, try showing it every 30 days.
10976
+ if ( $was_promotion_shown_before &&
10977
+ 30 * WP_FS__TIME_24_HOURS_IN_SEC > time() - $last_time_trial_promotion_shown
10978
+ ) {
10979
+ return false;
10980
+ }
10981
+
10982
+ $trial_period = $this->_trial_days;
10983
+ $require_payment = $this->_is_trial_require_payment;
10984
+ $trial_url = $this->get_trial_url();
10985
+ $plans_string = strtolower( __fs( 'awesome', $this->_slug ) );
10986
+
10987
+ if ( $this->is_registered() ) {
10988
+ // If opted-in, override trial with up to date data from API.
10989
+ $trial_plans = FS_Plan_Manager::instance()->get_trial_plans( $this->_plans );
10990
+ $trial_plans_count = count( $trial_plans );
10991
+
10992
+ if ( 0 === $trial_plans_count ) {
10993
+ // If there's no plans with a trial just exit.
10994
+ return false;
10995
+ }
10996
+
10997
+ /**
10998
+ * @var FS_Plugin_Plan $paid_plan
10999
+ */
11000
+ $paid_plan = $trial_plans[0];
11001
+ $require_payment = $paid_plan->is_require_subscription;
11002
+ $trial_period = $paid_plan->trial_period;
11003
+
11004
+ $total_paid_plans = count( $this->_plans ) - ( FS_Plan_Manager::instance()->has_free_plan( $this->_plans ) ? 1 : 0 );
11005
+
11006
+ if ( $total_paid_plans !== $trial_plans_count ) {
11007
+ // Not all paid plans have a trial - generate a string of those that have it.
11008
+ for ( $i = 0; $i < $trial_plans_count; $i ++ ) {
11009
+ $plans_string .= sprintf(
11010
+ '<a href="%s">%s</a>',
11011
+ $trial_url,
11012
+ $trial_plans[ $i ]->title
11013
+ );
11014
+
11015
+ if ( $i < $trial_plans_count - 2 ) {
11016
+ $plans_string .= ', ';
11017
+ } else if ( $i == $trial_plans_count - 2 ) {
11018
+ $plans_string .= ' and ';
11019
+ }
11020
+ }
11021
+ }
11022
+ }
11023
+
11024
+ $message = sprintf(
11025
+ __fs( 'hey', $this->_slug ) . '! ' . __fs( 'trial-x-promotion-message', $this->_slug ),
11026
+ sprintf( '<b>%s</b>', $this->get_plugin_name() ),
11027
+ $plans_string,
11028
+ $trial_period
11029
+ );
11030
+
11031
+ // "No Credit-Card Required" or "No Commitment for N Days".
11032
+ $cc_string = $require_payment ?
11033
+ sprintf( __fs( 'no-commitment-for-x-days', $this->_slug ), $trial_period ) :
11034
+ __fs( 'no-cc-required', $this->_slug ) . '!';
11035
+
11036
+
11037
+ // Start trial button.
11038
+ $button = ' ' . sprintf(
11039
+ '<a style="margin-left: 10px; vertical-align: super;" href="%s"><button class="button button-primary">%s &nbsp;&#10140;</button></a>',
11040
+ $trial_url,
11041
+ __fs( 'start-free-trial', $this->_slug )
11042
+ );
11043
+
11044
+ $this->_admin_notices->add_sticky(
11045
+ $this->apply_filters( 'trial_promotion_message', "{$message} {$cc_string} {$button}" ),
11046
+ 'trial_promotion',
11047
+ '',
11048
+ 'promotion'
11049
+ );
11050
+
11051
+ $this->_storage->trial_promotion_shown = WP_FS__SCRIPT_START_TIME;
11052
+
11053
+ return true;
11054
+ }
11055
+
11056
+ /**
11057
+ * @author Vova Feldman (@svovaf)
11058
+ * @since 1.2.1.5
11059
+ */
11060
+ function _enqueue_common_css() {
11061
+ if ( $this->has_paid_plan() && ! $this->is_paying() ) {
11062
+ // Add basic CSS for admin-notices and menu-item colors.
11063
+ fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
11064
+ }
11065
+ }
11066
+
11067
+ /* Action Links
11068
+ ------------------------------------------------------------------------------------------------------------------*/
11069
+ private $_action_links_hooked = false;
11070
+ private $_action_links = array();
11071
+
11072
+ /**
11073
+ * Hook to plugin action links filter.
11074
+ *
11075
+ * @author Vova Feldman (@svovaf)
11076
+ * @since 1.0.0
11077
+ */
11078
+ private function hook_plugin_action_links() {
11079
+ $this->_logger->entrance();
11080
+
11081
+ $this->_action_links_hooked = true;
11082
+
11083
+ $this->_logger->log( 'Adding action links hooks.' );
11084
+
11085
+ // Add action link to settings page.
11086
+ add_filter( 'plugin_action_links_' . $this->_plugin_basename, array(
11087
+ &$this,
11088
+ '_modify_plugin_action_links_hook'
11089
+ ), WP_FS__DEFAULT_PRIORITY, 2 );
11090
+ add_filter( 'network_admin_plugin_action_links_' . $this->_plugin_basename, array(
11091
+ &$this,
11092
+ '_modify_plugin_action_links_hook'
11093
+ ), WP_FS__DEFAULT_PRIORITY, 2 );
11094
+ }
11095
+
11096
+ /**
11097
+ * Add plugin action link.
11098
+ *
11099
+ * @author Vova Feldman (@svovaf)
11100
+ * @since 1.0.0
11101
+ *
11102
+ * @param $label
11103
+ * @param $url
11104
+ * @param bool $external
11105
+ * @param int $priority
11106
+ * @param bool $key
11107
+ */
11108
+ function add_plugin_action_link( $label, $url, $external = false, $priority = WP_FS__DEFAULT_PRIORITY, $key = false ) {
11109
+ $this->_logger->entrance();
11110
+
11111
+ if ( ! isset( $this->_action_links[ $priority ] ) ) {
11112
+ $this->_action_links[ $priority ] = array();
11113
+ }
11114
+
11115
+ if ( false === $key ) {
11116
+ $key = preg_replace( "/[^A-Za-z0-9 ]/", '', strtolower( $label ) );
11117
+ }
11118
+
11119
+ $this->_action_links[ $priority ][] = array(
11120
+ 'label' => $label,
11121
+ 'href' => $url,
11122
+ 'key' => $key,
11123
+ 'external' => $external
11124
+ );
11125
+ }
11126
+
11127
+ /**
11128
+ * Adds Upgrade and Add-Ons links to the main Plugins page link actions collection.
11129
+ *
11130
+ * @author Vova Feldman (@svovaf)
11131
+ * @since 1.0.0
11132
+ */
11133
+ function _add_upgrade_action_link() {
11134
+ $this->_logger->entrance();
11135
+
11136
+ if ( $this->is_registered() ) {
11137
+ if ( ! $this->is_paying() && $this->has_paid_plan() ) {
11138
+ $this->add_plugin_action_link(
11139
+ __fs( 'upgrade', $this->_slug ),
11140
+ $this->get_upgrade_url(),
11141
+ false,
11142
+ 7,
11143
+ 'upgrade'
11144
+ );
11145
+ }
11146
+
11147
+ if ( $this->has_addons() ) {
11148
+ $this->add_plugin_action_link(
11149
+ __fs( 'add-ons', $this->_slug ),
11150
+ $this->_get_admin_page_url( 'addons' ),
11151
+ false,
11152
+ 9,
11153
+ 'addons'
11154
+ );
11155
+ }
11156
+ }
11157
+ }
11158
+
11159
+ /**
11160
+ * Adds "Activate License" or "Change License" link to the main Plugins page link actions collection.
11161
+ *
11162
+ * @author Leo Fajardo (@leorw)
11163
+ * @since 1.1.9
11164
+ */
11165
+ function _add_license_action_link() {
11166
+ $this->_logger->entrance();
11167
+
11168
+ if ( $this->is_free_plan() && $this->is_addon() ) {
11169
+ return;
11170
+ }
11171
+
11172
+ if ( ! self::is_ajax() ) {
11173
+ // Inject license activation dialog UI and client side code.
11174
+ add_action( 'admin_footer', array( &$this, '_add_license_activation_dialog_box' ) );
11175
+ }
11176
+
11177
+ $link_text = __fs(
11178
+ $this->is_free_plan() ? 'activate-license' : 'change-license',
11179
+ $this->_slug
11180
+ );
11181
+
11182
+ $this->add_plugin_action_link(
11183
+ $link_text,
11184
+ '#',
11185
+ false,
11186
+ 11,
11187
+ ( 'activate-license ' . $this->_slug )
11188
+ );
11189
+ }
11190
+
11191
+ /**
11192
+ * Adds "Opt in" or "Opt out" link to the main "Plugins" page link actions collection.
11193
+ *
11194
+ * @author Leo Fajardo (@leorw)
11195
+ * @since 1.2.1.5
11196
+ */
11197
+ function _add_tracking_links() {
11198
+ if ( ! current_user_can( 'activate_plugins' ) ) {
11199
+ return;
11200
+ }
11201
+
11202
+ $this->_logger->entrance();
11203
+
11204
+ if ( ! $this->is_enable_anonymous() ) {
11205
+ // Don't allow to opt-out if anonymous mode is disabled.
11206
+ return;
11207
+ }
11208
+
11209
+ if ( ! $this->is_free_plan() ) {
11210
+ // Don't allow to opt-out if running in paid plan.
11211
+ return;
11212
+ }
11213
+
11214
+ if ( $this->add_ajax_action( 'stop_tracking', array( &$this, '_stop_tracking_callback' ) ) ) {
11215
+ return;
11216
+ }
11217
+
11218
+ if ( $this->add_ajax_action( 'allow_tracking', array( &$this, '_allow_tracking_callback' ) ) ) {
11219
+ return;
11220
+ }
11221
+
11222
+ if ( fs_request_is_action_secure( $this->_slug . '_reconnect' ) ) {
11223
+ if ( ! $this->is_registered() && $this->is_anonymous() ) {
11224
+ $this->connect_again();
11225
+
11226
+ return;
11227
+ }
11228
+ }
11229
+
11230
+ $url = '#';
11231
+
11232
+ if ( $this->is_registered() ) {
11233
+ if ( $this->is_tracking_allowed() ) {
11234
+ $link_text_id = 'opt-out';
11235
+ } else {
11236
+ $link_text_id = 'opt-in';
11237
+ }
11238
+
11239
+ add_action( 'admin_footer', array( &$this, '_add_optout_dialog' ) );
11240
+ } else {
11241
+ $link_text_id = 'opt-in';
11242
+
11243
+ $params = ! $this->is_anonymous() ?
11244
+ array() :
11245
+ array(
11246
+ 'nonce' => wp_create_nonce( $this->_slug . '_reconnect' ),
11247
+ 'fs_action' => ( $this->_slug . '_reconnect' ),
11248
+ );
11249
+
11250
+ $url = $this->get_activation_url( $params );
11251
+ }
11252
+
11253
+ $this->add_plugin_action_link(
11254
+ __fs( $link_text_id, $this->_slug ),
11255
+ $url,
11256
+ false,
11257
+ 13,
11258
+ "opt-in-or-opt-out {$this->_slug}"
11259
+ );
11260
+ }
11261
+
11262
+ /**
11263
+ * Get the URL of the page that should be loaded right after the plugin activation.
11264
+ *
11265
+ * @author Vova Feldman (@svovaf)
11266
+ * @since 1.1.7.4
11267
+ *
11268
+ * @return string
11269
+ */
11270
+ function get_after_plugin_activation_redirect_url() {
11271
+ $url = false;
11272
+ $plugin_fs = false;
11273
+
11274
+ if ( ! $this->is_addon() ) {
11275
+ $first_time_path = $this->_menu->get_first_time_path();
11276
+ $plugin_fs = $this;
11277
+ $url = $plugin_fs->is_activation_mode() ?
11278
+ $plugin_fs->get_activation_url() :
11279
+ ( empty( $first_time_path ) ?
11280
+ $this->_get_admin_page_url() :
11281
+ $first_time_path );
11282
+ } else {
11283
+ if ( $this->is_parent_plugin_installed() ) {
11284
+ $plugin_fs = self::get_parent_instance();
11285
+ }
11286
+
11287
+ if ( is_object( $plugin_fs ) ) {
11288
+ if ( ! $plugin_fs->is_registered() ) {
11289
+ // Forward to parent plugin connect when parent not registered.
11290
+ $url = $plugin_fs->get_activation_url();
11291
+ } else {
11292
+ // Forward to account page.
11293
+ $url = $plugin_fs->_get_admin_page_url( 'account' );
11294
+ }
11295
+ }
11296
+ }
11297
+
11298
+ return $url;
11299
+ }
11300
+
11301
+ /**
11302
+ * Forward page to activation page.
11303
+ *
11304
+ * @author Vova Feldman (@svovaf)
11305
+ * @since 1.0.3
11306
+ */
11307
+ function _redirect_on_activation_hook() {
11308
+ $url = $this->get_after_plugin_activation_redirect_url();
11309
+
11310
+ if ( is_string( $url ) ) {
11311
+ fs_redirect( $url );
11312
+ }
11313
+ }
11314
+
11315
+ /**
11316
+ * Modify plugin's page action links collection.
11317
+ *
11318
+ * @author Vova Feldman (@svovaf)
11319
+ * @since 1.0.0
11320
+ *
11321
+ * @param array $links
11322
+ * @param $file
11323
+ *
11324
+ * @return array
11325
+ */
11326
+ function _modify_plugin_action_links_hook( $links, $file ) {
11327
+ $this->_logger->entrance();
11328
+
11329
+ $passed_deactivate = false;
11330
+ $deactivate_link = '';
11331
+ $before_deactivate = array();
11332
+ $after_deactivate = array();
11333
+ foreach ( $links as $key => $link ) {
11334
+ if ( 'deactivate' === $key ) {
11335
+ $deactivate_link = $link;
11336
+ $passed_deactivate = true;
11337
+ continue;
11338
+ }
11339
+
11340
+ if ( ! $passed_deactivate ) {
11341
+ $before_deactivate[ $key ] = $link;
11342
+ } else {
11343
+ $after_deactivate[ $key ] = $link;
11344
+ }
11345
+ }
11346
+
11347
+ ksort( $this->_action_links );
11348
+
11349
+ foreach ( $this->_action_links as $new_links ) {
11350
+ foreach ( $new_links as $link ) {
11351
+ $before_deactivate[ $link['key'] ] = '<a href="' . $link['href'] . '"' . ( $link['external'] ? ' target="_blank"' : '' ) . '>' . $link['label'] . '</a>';
11352
+ }
11353
+ }
11354
+
11355
+ if ( ! empty( $deactivate_link ) ) {
11356
+ if ( ! $this->is_paying_or_trial() || $this->is_premium() ) {
11357
+ /*
11358
+ * This HTML element is used to identify the correct plugin when attaching an event to its Deactivate link.
11359
+ *
11360
+ * If user is paying or in trial and have the free version installed,
11361
+ * assume that the deactivation is for the upgrade process, so this is not needed.
11362
+ */
11363
+ $deactivate_link .= '<i class="fs-slug" data-slug="' . $this->_slug . '"></i>';
11364
+ }
11365
+
11366
+ // Append deactivation link.
11367
+ $before_deactivate['deactivate'] = $deactivate_link;
11368
+ }
11369
+
11370
+ return array_merge( $before_deactivate, $after_deactivate );
11371
+ }
11372
+
11373
+ /**
11374
+ * Adds admin message.
11375
+ *
11376
+ * @author Vova Feldman (@svovaf)
11377
+ * @since 1.0.4
11378
+ *
11379
+ * @param string $message
11380
+ * @param string $title
11381
+ * @param string $type
11382
+ */
11383
+ function add_admin_message( $message, $title = '', $type = 'success' ) {
11384
+ $this->_admin_notices->add( $message, $title, $type );
11385
+ }
11386
+
11387
+ /**
11388
+ * Adds sticky admin message.
11389
+ *
11390
+ * @author Vova Feldman (@svovaf)
11391
+ * @since 1.1.0
11392
+ *
11393
+ * @param string $message
11394
+ * @param string $id
11395
+ * @param string $title
11396
+ * @param string $type
11397
+ */
11398
+ function add_sticky_admin_message( $message, $id, $title = '', $type = 'success' ) {
11399
+ $this->_admin_notices->add_sticky( $message, $id, $title, $type );
11400
+ }
11401
+
11402
+ /**
11403
+ * Helper function that returns the final steps for the upgrade completion.
11404
+ *
11405
+ * If the module is already running the premium code, returns an empty string.
11406
+ *
11407
+ * @author Vova Feldman (@svovaf)
11408
+ * @since 1.2.1
11409
+ *
11410
+ * @param string $plan_title
11411
+ *
11412
+ * @return string
11413
+ */
11414
+ private function get_complete_upgrade_instructions( $plan_title = '' ) {
11415
+ if ( ! $this->has_premium_version() || $this->is_premium() ) {
11416
+ return '';
11417
+ }
11418
+
11419
+ if ( empty( $plan_title ) ) {
11420
+ $plan_title = $this->_site->plan->title;
11421
+ }
11422
+
11423
+ // @since 1.2.1.5 The free version is auto deactivated.
11424
+ $deactivation_step = version_compare( $this->version, '1.2.1.5', '<' ) ?
11425
+ ( '<li>' . __fs( 'deactivate-free-version', $this->_slug ) . '.</li>' ) :
11426
+ '';
11427
+
11428
+ return sprintf(
11429
+ ' %s: <ol><li>%s.</li>%s<li>%s (<a href="%s" target="_blank">%s</a>).</li></ol>',
11430
+ __fs( 'follow-steps-to-complete-upgrade', $this->_slug ),
11431
+ $this->get_latest_download_link( sprintf(
11432
+ __fs( 'download-latest-x-version', $this->_slug ),
11433
+ $plan_title
11434
+ ) ),
11435
+ $deactivation_step,
11436
+ __fs( 'upload-and-activate', $this->_slug ),
11437
+ '//bit.ly/upload-wp-plugin',
11438
+ __fs( 'howto-upload-activate', $this->_slug )
11439
+ );
11440
+ }
11441
+
11442
+ /* Plugin Auto-Updates (@since 1.0.4)
11443
+ ------------------------------------------------------------------------------------------------------------------*/
11444
+ /**
11445
+ * @var string[]
11446
+ */
11447
+ private static $_auto_updated_plugins;
11448
+
11449
+ /**
11450
+ * @todo TEST IF IT WORKS!!!
11451
+ *
11452
+ * Include plugins for automatic updates based on stored settings.
11453
+ *
11454
+ * @see http://wordpress.stackexchange.com/questions/131394/how-do-i-exclude-plugins-from-getting-automatically-updated/131404#131404
11455
+ *
11456
+ * @author Vova Feldman (@svovaf)
11457
+ * @since 1.0.4
11458
+ *
11459
+ * @param bool $update Whether to update (not used for plugins)
11460
+ * @param object $item The plugin's info
11461
+ *
11462
+ * @return bool
11463
+ */
11464
+ static function _include_plugins_in_auto_update( $update, $item ) {
11465
+ // Before version 3.8.2 the $item was the file name of the plugin,
11466
+ // while in 3.8.2 statistics were added (https://core.trac.wordpress.org/changeset/27905).
11467
+ $by_slug = ( (int) str_replace( '.', '', get_bloginfo( 'version' ) ) >= 382 );
11468
+
11469
+ if ( ! isset( self::$_auto_updated_plugins ) ) {
11470
+ $plugins = self::$_accounts->get_option( 'plugins', array() );
11471
+
11472
+ $identifiers = array();
11473
+ foreach ( $plugins as $p ) {
11474
+ /**
11475
+ * @var FS_Plugin $p
11476
+ */
11477
+ if ( isset( $p->auto_update ) && $p->auto_update ) {
11478
+ $identifiers[] = ( $by_slug ? $p->slug : plugin_basename( $p->file ) );
11479
+ }
11480
+ }
11481
+
11482
+ self::$_auto_updated_plugins = $identifiers;
11483
+ }
11484
+
11485
+ if ( in_array( $by_slug ? $item->slug : $item, self::$_auto_updated_plugins ) ) {
11486
+ return true;
11487
+ }
11488
+
11489
+ // Pass update decision to next filters
11490
+ return $update;
11491
+ }
11492
+
11493
+ #----------------------------------------------------------------------------------
11494
+ #region Versioning
11495
+ #----------------------------------------------------------------------------------
11496
+
11497
+ /**
11498
+ * Check if Freemius in SDK upgrade mode.
11499
+ *
11500
+ * @author Vova Feldman (@svovaf)
11501
+ * @since 1.0.9
11502
+ *
11503
+ * @return bool
11504
+ */
11505
+ function is_sdk_upgrade_mode() {
11506
+ return isset( $this->_storage->sdk_upgrade_mode ) ?
11507
+ $this->_storage->sdk_upgrade_mode :
11508
+ false;
11509
+ }
11510
+
11511
+ /**
11512
+ * Turn SDK upgrade mode off.
11513
+ *
11514
+ * @author Vova Feldman (@svovaf)
11515
+ * @since 1.0.9
11516
+ */
11517
+ function set_sdk_upgrade_complete() {
11518
+ $this->_storage->sdk_upgrade_mode = false;
11519
+ }
11520
+
11521
+ /**
11522
+ * Check if plugin upgrade mode.
11523
+ *
11524
+ * @author Vova Feldman (@svovaf)
11525
+ * @since 1.0.9
11526
+ *
11527
+ * @return bool
11528
+ */
11529
+ function is_plugin_upgrade_mode() {
11530
+ return isset( $this->_storage->plugin_upgrade_mode ) ?
11531
+ $this->_storage->plugin_upgrade_mode :
11532
+ false;
11533
+ }
11534
+
11535
+ /**
11536
+ * Turn plugin upgrade mode off.
11537
+ *
11538
+ * @author Vova Feldman (@svovaf)
11539
+ * @since 1.0.9
11540
+ *
11541
+ * @return bool
11542
+ */
11543
+ function set_plugin_upgrade_complete() {
11544
+ $this->_storage->plugin_upgrade_mode = false;
11545
+ }
11546
+
11547
+ #endregion
11548
+
11549
+ #----------------------------------------------------------------------------------
11550
+ #region Permissions
11551
+ #----------------------------------------------------------------------------------
11552
+
11553
+ /**
11554
+ * Check if specific permission requested.
11555
+ *
11556
+ * @author Vova Feldman (@svovaf)
11557
+ * @since 1.1.6
11558
+ *
11559
+ * @param string $permission
11560
+ *
11561
+ * @return bool
11562
+ */
11563
+ function is_permission_requested( $permission ) {
11564
+ return isset( $this->_permissions[ $permission ] ) && ( true === $this->_permissions[ $permission ] );
11565
+ }
11566
+
11567
+ #endregion
11568
+
11569
+ #----------------------------------------------------------------------------------
11570
+ #region Marketing
11571
+ #----------------------------------------------------------------------------------
11572
+
11573
+ /**
11574
+ * Check if current user purchased any other plugins before.
11575
+ *
11576
+ * @author Vova Feldman (@svovaf)
11577
+ * @since 1.0.9
11578
+ *
11579
+ * @return bool
11580
+ */
11581
+ function has_purchased_before() {
11582
+ // TODO: Implement has_purchased_before() method.
11583
+ throw new Exception( 'not implemented' );
11584
+ }
11585
+
11586
+ /**
11587
+ * Check if current user classified as an agency.
11588
+ *
11589
+ * @author Vova Feldman (@svovaf)
11590
+ * @since 1.0.9
11591
+ *
11592
+ * @return bool
11593
+ */
11594
+ function is_agency() {
11595
+ // TODO: Implement is_agency() method.
11596
+ throw new Exception( 'not implemented' );
11597
+ }
11598
+
11599
+ /**
11600
+ * Check if current user classified as a developer.
11601
+ *
11602
+ * @author Vova Feldman (@svovaf)
11603
+ * @since 1.0.9
11604
+ *
11605
+ * @return bool
11606
+ */
11607
+ function is_developer() {
11608
+ // TODO: Implement is_developer() method.
11609
+ throw new Exception( 'not implemented' );
11610
+ }
11611
+
11612
+ /**
11613
+ * Check if current user classified as a business.
11614
+ *
11615
+ * @author Vova Feldman (@svovaf)
11616
+ * @since 1.0.9
11617
+ *
11618
+ * @return bool
11619
+ */
11620
+ function is_business() {
11621
+ // TODO: Implement is_business() method.
11622
+ throw new Exception( 'not implemented' );
11623
+ }
11624
+
11625
+ #endregion
11626
+ }
freemius/includes/class-fs-api.php ADDED
@@ -0,0 +1,558 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Class FS_Api
15
+ *
16
+ * Wraps Freemius API SDK to handle:
17
+ * 1. Clock sync.
18
+ * 2. Fallback to HTTP when HTTPS fails.
19
+ * 3. Adds caching layer to GET requests.
20
+ * 4. Adds consistency for failed requests by using last cached version.
21
+ */
22
+ class FS_Api {
23
+ /**
24
+ * @var FS_Api[]
25
+ */
26
+ private static $_instances = array();
27
+
28
+ /**
29
+ * @var FS_Option_Manager Freemius options, options-manager.
30
+ */
31
+ private static $_options;
32
+
33
+ /**
34
+ * @var FS_Cache_Manager API Caching layer
35
+ */
36
+ private static $_cache;
37
+
38
+ /**
39
+ * @var int Clock diff in seconds between current server to API server.
40
+ */
41
+ private static $_clock_diff;
42
+
43
+ /**
44
+ * @var Freemius_Api
45
+ */
46
+ private $_api;
47
+
48
+ /**
49
+ * @var string
50
+ */
51
+ private $_slug;
52
+
53
+ /**
54
+ * @var FS_Logger
55
+ * @since 1.0.4
56
+ */
57
+ private $_logger;
58
+
59
+ /**
60
+ * @param string $slug
61
+ * @param string $scope 'app', 'developer', 'user' or 'install'.
62
+ * @param number $id Element's id.
63
+ * @param string $public_key Public key.
64
+ * @param bool $is_sandbox
65
+ * @param bool|string $secret_key Element's secret key.
66
+ *
67
+ * @return FS_Api
68
+ */
69
+ static function instance( $slug, $scope, $id, $public_key, $is_sandbox, $secret_key = false ) {
70
+ $identifier = md5( $slug . $scope . $id . $public_key . ( is_string( $secret_key ) ? $secret_key : '' ) . json_encode( $is_sandbox ) );
71
+
72
+ if ( ! isset( self::$_instances[ $identifier ] ) ) {
73
+ self::_init();
74
+
75
+ self::$_instances[ $identifier ] = new FS_Api( $slug, $scope, $id, $public_key, $secret_key, $is_sandbox );
76
+ }
77
+
78
+ return self::$_instances[ $identifier ];
79
+ }
80
+
81
+ private static function _init() {
82
+ if ( isset( self::$_options ) ) {
83
+ return;
84
+ }
85
+
86
+ if ( ! class_exists( 'Freemius_Api' ) ) {
87
+ require_once WP_FS__DIR_SDK . '/Freemius.php';
88
+ }
89
+
90
+ self::$_options = FS_Option_Manager::get_manager( WP_FS__OPTIONS_OPTION_NAME, true );
91
+ self::$_cache = FS_Cache_Manager::get_manager( WP_FS__API_CACHE_OPTION_NAME );
92
+
93
+ self::$_clock_diff = self::$_options->get_option( 'api_clock_diff', 0 );
94
+ Freemius_Api::SetClockDiff( self::$_clock_diff );
95
+
96
+ if ( self::$_options->get_option( 'api_force_http', false ) ) {
97
+ Freemius_Api::SetHttp();
98
+ }
99
+ }
100
+
101
+ /**
102
+ * @param string $slug
103
+ * @param string $scope 'app', 'developer', 'user' or 'install'.
104
+ * @param number $id Element's id.
105
+ * @param string $public_key Public key.
106
+ * @param bool|string $secret_key Element's secret key.
107
+ * @param bool $is_sandbox
108
+ */
109
+ private function __construct( $slug, $scope, $id, $public_key, $secret_key, $is_sandbox ) {
110
+ $this->_api = new Freemius_Api( $scope, $id, $public_key, $secret_key, $is_sandbox );
111
+
112
+ $this->_slug = $slug;
113
+ $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $slug . '_api', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
114
+ }
115
+
116
+ /**
117
+ * Find clock diff between server and API server, and store the diff locally.
118
+ *
119
+ * @param bool|int $diff
120
+ *
121
+ * @return bool|int False if clock diff didn't change, otherwise returns the clock diff in seconds.
122
+ */
123
+ private function _sync_clock_diff( $diff = false ) {
124
+ $this->_logger->entrance();
125
+
126
+ // Sync clock and store.
127
+ $new_clock_diff = ( false === $diff ) ?
128
+ Freemius_Api::FindClockDiff() :
129
+ $diff;
130
+
131
+ if ( $new_clock_diff === self::$_clock_diff ) {
132
+ return false;
133
+ }
134
+
135
+ self::$_clock_diff = $new_clock_diff;
136
+
137
+ // Update API clock's diff.
138
+ Freemius_Api::SetClockDiff( self::$_clock_diff );
139
+
140
+ // Store new clock diff in storage.
141
+ self::$_options->set_option( 'api_clock_diff', self::$_clock_diff, true );
142
+
143
+ return $new_clock_diff;
144
+ }
145
+
146
+ /**
147
+ * Override API call to enable retry with servers' clock auto sync method.
148
+ *
149
+ * @param string $path
150
+ * @param string $method
151
+ * @param array $params
152
+ * @param bool $retry Is in retry or first call attempt.
153
+ *
154
+ * @return array|mixed|string|void
155
+ */
156
+ private function _call( $path, $method = 'GET', $params = array(), $retry = false ) {
157
+ $this->_logger->entrance( $method . ':' . $path );
158
+
159
+ if ( self::is_temporary_down() ) {
160
+ $result = $this->get_temporary_unavailable_error();
161
+ } else {
162
+ $result = $this->_api->Api( $path, $method, $params );
163
+
164
+ if ( null !== $result &&
165
+ isset( $result->error ) &&
166
+ isset( $result->error->code ) &&
167
+ 'request_expired' === $result->error->code
168
+ ) {
169
+ if ( ! $retry ) {
170
+ $diff = isset( $result->error->timestamp ) ?
171
+ ( time() - strtotime( $result->error->timestamp ) ) :
172
+ false;
173
+
174
+ // Try to sync clock diff.
175
+ if ( false !== $this->_sync_clock_diff( $diff ) ) {
176
+ // Retry call with new synced clock.
177
+ return $this->_call( $path, $method, $params, true );
178
+ }
179
+ }
180
+ }
181
+ }
182
+
183
+ if ( $this->_logger->is_on() && self::is_api_error( $result ) ) {
184
+ // Log API errors.
185
+ $this->_logger->api_error( $result );
186
+ }
187
+
188
+ return $result;
189
+ }
190
+
191
+ /**
192
+ * Override API call to wrap it in servers' clock sync method.
193
+ *
194
+ * @param string $path
195
+ * @param string $method
196
+ * @param array $params
197
+ *
198
+ * @return array|mixed|string|void
199
+ * @throws Freemius_Exception
200
+ */
201
+ function call( $path, $method = 'GET', $params = array() ) {
202
+ return $this->_call( $path, $method, $params );
203
+ }
204
+
205
+ /**
206
+ * Get API request URL signed via query string.
207
+ *
208
+ * @param string $path
209
+ *
210
+ * @return string
211
+ */
212
+ function get_signed_url( $path ) {
213
+ return $this->_api->GetSignedUrl( $path );
214
+ }
215
+
216
+ /**
217
+ * @param string $path
218
+ * @param bool $flush
219
+ * @param int $expiration (optional) Time until expiration in seconds from now, defaults to 24 hours
220
+ *
221
+ * @return stdClass|mixed
222
+ */
223
+ function get( $path = '/', $flush = false, $expiration = WP_FS__TIME_24_HOURS_IN_SEC ) {
224
+ $this->_logger->entrance( $path );
225
+
226
+ $cache_key = $this->get_cache_key( $path );
227
+
228
+ // Always flush during development.
229
+ if ( WP_FS__DEV_MODE || $this->_api->IsSandbox() ) {
230
+ $flush = true;
231
+ }
232
+
233
+ $cached_result = self::$_cache->get( $cache_key );
234
+
235
+ if ( $flush || ! self::$_cache->has_valid( $cache_key ) ) {
236
+ $result = $this->call( $path );
237
+
238
+ if ( ! is_object( $result ) || isset( $result->error ) ) {
239
+ // Api returned an error.
240
+ if ( is_object( $cached_result ) &&
241
+ ! isset( $cached_result )
242
+ ) {
243
+ // If there was an error during a newer data fetch,
244
+ // fallback to older data version.
245
+ $result = $cached_result;
246
+
247
+ if ( $this->_logger->is_on() ) {
248
+ $this->_logger->warn( 'Fallback to cached API result: ' . var_export( $cached_result, true ) );
249
+ }
250
+ } else {
251
+ // If no older data version, return result without
252
+ // caching the error.
253
+ return $result;
254
+ }
255
+ }
256
+
257
+ self::$_cache->set( $cache_key, $result, $expiration );
258
+
259
+ $cached_result = $result;
260
+ } else {
261
+ $this->_logger->log( 'Using cached API result.' );
262
+ }
263
+
264
+ return $cached_result;
265
+ }
266
+
267
+ /**
268
+ * Check if there's a cached version of the API request.
269
+ *
270
+ * @author Vova Feldman (@svovaf)
271
+ * @since 1.2.1
272
+ *
273
+ * @param string $path
274
+ * @param string $method
275
+ * @param array $params
276
+ *
277
+ * @return bool
278
+ */
279
+ function is_cached( $path, $method = 'GET', $params = array() ) {
280
+ $cache_key = $this->get_cache_key( $path, $method, $params );
281
+
282
+ return self::$_cache->has_valid( $cache_key );
283
+ }
284
+
285
+ /**
286
+ * Invalidate a cached version of the API request.
287
+ *
288
+ * @author Vova Feldman (@svovaf)
289
+ * @since 1.2.1.5
290
+ *
291
+ * @param string $path
292
+ * @param string $method
293
+ * @param array $params
294
+ */
295
+ function purge_cache( $path, $method = 'GET', $params = array() ) {
296
+ $this->_logger->entrance( "{$method}:{$path}" );
297
+
298
+ $cache_key = $this->get_cache_key( $path, $method, $params );
299
+
300
+ self::$_cache->purge( $cache_key );
301
+ }
302
+
303
+ /**
304
+ * @param string $path
305
+ * @param string $method
306
+ * @param array $params
307
+ *
308
+ * @return string
309
+ * @throws \Freemius_Exception
310
+ */
311
+ private function get_cache_key( $path, $method = 'GET', $params = array() ) {
312
+ $canonized = $this->_api->CanonizePath( $path );
313
+ // $exploded = explode('/', $canonized);
314
+ // return $method . '_' . array_pop($exploded) . '_' . md5($canonized . json_encode($params));
315
+ return strtolower( $method . ':' . $canonized ) . ( ! empty( $params ) ? '#' . md5( json_encode( $params ) ) : '' );
316
+ }
317
+
318
+ /**
319
+ * Test API connectivity.
320
+ *
321
+ * @author Vova Feldman (@svovaf)
322
+ * @since 1.0.9 If fails, try to fallback to HTTP.
323
+ * @since 1.1.6 Added a 5-min caching mechanism, to prevent from overloading the server if the API if
324
+ * temporary down.
325
+ *
326
+ * @return bool True if successful connectivity to the API.
327
+ */
328
+ static function test() {
329
+ self::_init();
330
+
331
+ $cache_key = 'ping_test';
332
+
333
+ $test = self::$_cache->get_valid( $cache_key, null );
334
+
335
+ if ( is_null( $test ) ) {
336
+ $test = Freemius_Api::Test();
337
+
338
+ if ( false === $test && Freemius_Api::IsHttps() ) {
339
+ // Fallback to HTTP, since HTTPS fails.
340
+ Freemius_Api::SetHttp();
341
+
342
+ self::$_options->set_option( 'api_force_http', true, true );
343
+
344
+ $test = Freemius_Api::Test();
345
+
346
+ if ( false === $test ) {
347
+ /**
348
+ * API connectivity test fail also in HTTP request, therefore,
349
+ * fallback to HTTPS to keep connection secure.
350
+ *
351
+ * @since 1.1.6
352
+ */
353
+ self::$_options->set_option( 'api_force_http', false, true );
354
+ }
355
+ }
356
+
357
+ self::$_cache->set( $cache_key, $test, WP_FS__TIME_5_MIN_IN_SEC );
358
+ }
359
+
360
+ return $test;
361
+ }
362
+
363
+ /**
364
+ * Check if API is temporary down.
365
+ *
366
+ * @author Vova Feldman (@svovaf)
367
+ * @since 1.1.6
368
+ *
369
+ * @return bool
370
+ */
371
+ static function is_temporary_down() {
372
+ self::_init();
373
+
374
+ $test = self::$_cache->get_valid( 'ping_test', null );
375
+
376
+ return ( false === $test );
377
+ }
378
+
379
+ /**
380
+ * @author Vova Feldman (@svovaf)
381
+ * @since 1.1.6
382
+ *
383
+ * @return object
384
+ */
385
+ private function get_temporary_unavailable_error() {
386
+ return (object) array(
387
+ 'error' => (object) array(
388
+ 'type' => 'TemporaryUnavailable',
389
+ 'message' => 'API is temporary unavailable, please retry in ' . ( self::$_cache->get_record_expiration( 'ping_test' ) - WP_FS__SCRIPT_START_TIME ) . ' sec.',
390
+ 'code' => 'temporary_unavailable',
391
+ 'http' => 503
392
+ )
393
+ );
394
+ }
395
+
396
+ /**
397
+ * Ping API for connectivity test, and return result object.
398
+ *
399
+ * @author Vova Feldman (@svovaf)
400
+ * @since 1.0.9
401
+ *
402
+ * @param null|string $unique_anonymous_id
403
+ * @param array $params
404
+ *
405
+ * @return object
406
+ */
407
+ function ping( $unique_anonymous_id = null, $params = array() ) {
408
+ $this->_logger->entrance();
409
+
410
+ if ( self::is_temporary_down() ) {
411
+ return $this->get_temporary_unavailable_error();
412
+ }
413
+
414
+ $pong = is_null( $unique_anonymous_id ) ?
415
+ Freemius_Api::Ping() :
416
+ $this->_call( 'ping.json?' . http_build_query( array_merge(
417
+ array( 'uid' => $unique_anonymous_id ),
418
+ $params
419
+ ) ) );
420
+
421
+ if ( $this->is_valid_ping( $pong ) ) {
422
+ return $pong;
423
+ }
424
+
425
+ if ( self::should_try_with_http( $pong ) ) {
426
+ // Fallback to HTTP, since HTTPS fails.
427
+ Freemius_Api::SetHttp();
428
+
429
+ self::$_options->set_option( 'api_force_http', true, true );
430
+
431
+ $pong = is_null( $unique_anonymous_id ) ?
432
+ Freemius_Api::Ping() :
433
+ $this->_call( 'ping.json?' . http_build_query( array_merge(
434
+ array( 'uid' => $unique_anonymous_id ),
435
+ $params
436
+ ) ) );
437
+
438
+ if ( ! $this->is_valid_ping( $pong ) ) {
439
+ self::$_options->set_option( 'api_force_http', false, true );
440
+ }
441
+ }
442
+
443
+ return $pong;
444
+ }
445
+
446
+ /**
447
+ * Check if based on the API result we should try
448
+ * to re-run the same request with HTTP instead of HTTPS.
449
+ *
450
+ * @author Vova Feldman (@svovaf)
451
+ * @since 1.1.6
452
+ *
453
+ * @param $result
454
+ *
455
+ * @return bool
456
+ */
457
+ private static function should_try_with_http( $result ) {
458
+ if ( ! Freemius_Api::IsHttps() ) {
459
+ return false;
460
+ }
461
+
462
+ return ( ! is_object( $result ) ||
463
+ ! isset( $result->error ) ||
464
+ ! isset( $result->error->code ) ||
465
+ ! in_array( $result->error->code, array(
466
+ 'curl_missing',
467
+ 'cloudflare_ddos_protection',
468
+ 'maintenance_mode',
469
+ 'squid_cache_block',
470
+ 'too_many_requests',
471
+ ) ) );
472
+
473
+ }
474
+
475
+ /**
476
+ * Check if valid ping request result.
477
+ *
478
+ * @author Vova Feldman (@svovaf)
479
+ * @since 1.1.1
480
+ *
481
+ * @param mixed $pong
482
+ *
483
+ * @return bool
484
+ */
485
+ function is_valid_ping( $pong ) {
486
+ return Freemius_Api::Test( $pong );
487
+ }
488
+
489
+ function get_url( $path = '' ) {
490
+ return Freemius_Api::GetUrl( $path, $this->_api->IsSandbox() );
491
+ }
492
+
493
+ /**
494
+ * Clear API cache.
495
+ *
496
+ * @author Vova Feldman (@svovaf)
497
+ * @since 1.0.9
498
+ */
499
+ static function clear_cache() {
500
+ self::_init();
501
+
502
+ self::$_cache = FS_Cache_Manager::get_manager( WP_FS__API_CACHE_OPTION_NAME );
503
+ self::$_cache->clear();
504
+ }
505
+
506
+ #----------------------------------------------------------------------------------
507
+ #region Error Handling
508
+ #----------------------------------------------------------------------------------
509
+
510
+ /**
511
+ * @author Vova Feldman (@svovaf)
512
+ * @since 1.2.1.5
513
+ *
514
+ * @param mixed $result
515
+ *
516
+ * @return bool Is API result contains an error.
517
+ */
518
+ static function is_api_error( $result ) {
519
+ return ( is_object( $result ) && isset( $result->error ) ) ||
520
+ is_string( $result );
521
+ }
522
+
523
+ /**
524
+ * Checks if given API result is a non-empty and not an error object.
525
+ *
526
+ * @author Vova Feldman (@svovaf)
527
+ * @since 1.2.1.5
528
+ *
529
+ * @param mixed $result
530
+ * @param string|null $required_property Optional property we want to verify that is set.
531
+ *
532
+ * @return bool
533
+ */
534
+ static function is_api_result_object( $result, $required_property = null ) {
535
+ return (
536
+ is_object( $result ) &&
537
+ ! isset( $result->error ) &&
538
+ ( empty( $required_property ) || isset( $result->{$required_property} ) )
539
+ );
540
+ }
541
+
542
+ /**
543
+ * Checks if given API result is a non-empty entity object with non-empty ID.
544
+ *
545
+ * @author Vova Feldman (@svovaf)
546
+ * @since 1.2.1.5
547
+ *
548
+ * @param mixed $result
549
+ *
550
+ * @return bool
551
+ */
552
+ static function is_api_result_entity( $result ) {
553
+ return self::is_api_result_object( $result, 'id' ) &&
554
+ FS_Entity::is_valid_id( $result->id );
555
+ }
556
+
557
+ #endregion
558
+ }
freemius/includes/class-fs-logger.php ADDED
@@ -0,0 +1,686 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
+ * @since 1.0.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Logger {
14
+ private $_id;
15
+ private $_on = false;
16
+ private $_echo = false;
17
+ private $_file_start = 0;
18
+ /**
19
+ * @var int PHP Process ID.
20
+ */
21
+ private static $_processID;
22
+ /**
23
+ * @var string PHP Script user name.
24
+ */
25
+ private static $_ownerName;
26
+ /**
27
+ * @var bool Is storage logging turned on.
28
+ */
29
+ private static $_isStorageLoggingOn;
30
+ /**
31
+ * @var int ABSPATH length.
32
+ */
33
+ private static $_abspathLength;
34
+
35
+ private static $LOGGERS = array();
36
+ private static $LOG = array();
37
+ private static $CNT = 0;
38
+ private static $_HOOKED_FOOTER = false;
39
+
40
+ private function __construct( $id, $on = false, $echo = false ) {
41
+ $this->_id = $id;
42
+
43
+ $bt = debug_backtrace();
44
+ $caller = $bt[2];
45
+
46
+ if ( false !== strpos( $caller['file'], 'plugins' ) ) {
47
+ $this->_file_start = strpos( $caller['file'], 'plugins' ) + strlen( 'plugins/' );
48
+ } else {
49
+ $this->_file_start = strpos( $caller['file'], 'themes' ) + strlen( 'themes/' );
50
+ }
51
+
52
+ if ( $on ) {
53
+ $this->on();
54
+ }
55
+ if ( $echo ) {
56
+ $this->echo_on();
57
+ }
58
+ }
59
+
60
+ /**
61
+ * @param string $id
62
+ * @param bool $on
63
+ * @param bool $echo
64
+ *
65
+ * @return FS_Logger
66
+ */
67
+ public static function get_logger( $id, $on = false, $echo = false ) {
68
+ $id = strtolower( $id );
69
+
70
+ if ( ! isset( self::$_processID ) ) {
71
+ self::init();
72
+ }
73
+
74
+ if ( ! isset( self::$LOGGERS[ $id ] ) ) {
75
+ self::$LOGGERS[ $id ] = new FS_Logger( $id, $on, $echo );
76
+ }
77
+
78
+ return self::$LOGGERS[ $id ];
79
+ }
80
+
81
+ /**
82
+ * Initialize logging global info.
83
+ *
84
+ * @author Vova Feldman (@svovaf)
85
+ * @since 1.2.1.6
86
+ */
87
+ private static function init() {
88
+ self::$_ownerName = get_current_user();
89
+ self::$_isStorageLoggingOn = ( 1 == get_option( 'fs_storage_logger', 0 ) );
90
+ self::$_abspathLength = strlen( ABSPATH );
91
+ self::$_processID = mt_rand(0, 32000);
92
+
93
+ // Process ID may be `false` on errors.
94
+ if ( ! is_numeric( self::$_processID ) ) {
95
+ self::$_processID = 0;
96
+ }
97
+ }
98
+
99
+ private static function hook_footer() {
100
+ if ( self::$_HOOKED_FOOTER ) {
101
+ return;
102
+ }
103
+
104
+ if ( is_admin() ) {
105
+ add_action( 'admin_footer', 'FS_Logger::dump', 100 );
106
+ } else {
107
+ add_action( 'wp_footer', 'FS_Logger::dump', 100 );
108
+ }
109
+ }
110
+
111
+ function is_on() {
112
+ return $this->_on;
113
+ }
114
+
115
+ function on() {
116
+ $this->_on = true;
117
+
118
+ if ( ! function_exists( 'dbDelta' ) ) {
119
+ require_once ABSPATH . 'wp-admin/includes/upgrade.php';
120
+ }
121
+
122
+ self::hook_footer();
123
+ }
124
+
125
+ function echo_on() {
126
+ $this->on();
127
+
128
+ $this->_echo = true;
129
+ }
130
+
131
+ function is_echo_on() {
132
+ return $this->_echo;
133
+ }
134
+
135
+ function get_id() {
136
+ return $this->_id;
137
+ }
138
+
139
+ function get_file() {
140
+ return $this->_file_start;
141
+ }
142
+
143
+ private function _log( &$message, $type = 'log', $wrapper ) {
144
+ if ( ! $this->is_on() ) {
145
+ return;
146
+ }
147
+
148
+ $bt = debug_backtrace();
149
+ $depth = $wrapper ? 3 : 2;
150
+ while ( $depth < count( $bt ) - 1 && 'eval' === $bt[ $depth ]['function'] ) {
151
+ $depth ++;
152
+ }
153
+
154
+ $caller = $bt[ $depth ];
155
+
156
+ /**
157
+ * Retrieve the correct call file & line number from backtrace
158
+ * when logging from a wrapper method.
159
+ *
160
+ * @author Vova Feldman
161
+ * @since 1.2.1.6
162
+ */
163
+ if ( empty( $caller['line'] ) ) {
164
+ $depth --;
165
+
166
+ while ( $depth >= 0 ) {
167
+ if ( ! empty( $bt[ $depth ]['line'] ) ) {
168
+ $caller['line'] = $bt[ $depth ]['line'];
169
+ $caller['file'] = $bt[ $depth ]['file'];
170
+ break;
171
+ }
172
+ }
173
+ }
174
+
175
+ $log = array_merge( $caller, array(
176
+ 'cnt' => self::$CNT ++,
177
+ 'logger' => $this,
178
+ 'timestamp' => microtime( true ),
179
+ 'log_type' => $type,
180
+ 'msg' => $message,
181
+ ) );
182
+
183
+ if ( self::$_isStorageLoggingOn ) {
184
+ $this->db_log( $type, $message, self::$CNT, $caller );
185
+ }
186
+
187
+ self::$LOG[] = $log;
188
+
189
+ if ( $this->is_echo_on() ) {
190
+ echo self::format_html( $log ) . "\n";
191
+ }
192
+ }
193
+
194
+ function log( $message, $wrapper = false ) {
195
+ $this->_log( $message, 'log', $wrapper );
196
+ }
197
+
198
+ function info( $message, $wrapper = false ) {
199
+ $this->_log( $message, 'info', $wrapper );
200
+ }
201
+
202
+ function warn( $message, $wrapper = false ) {
203
+ $this->_log( $message, 'warn', $wrapper );
204
+ }
205
+
206
+ function error( $message, $wrapper = false ) {
207
+ $this->_log( $message, 'error', $wrapper );
208
+ }
209
+
210
+ /**
211
+ * Log API error.
212
+ *
213
+ * @author Vova Feldman (@svovaf)
214
+ * @since 1.2.1.5
215
+ *
216
+ * @param mixed $api_result
217
+ * @param bool $wrapper
218
+ */
219
+ function api_error( $api_result, $wrapper = false ) {
220
+ $message = '';
221
+ if ( is_object( $api_result ) && isset( $api_result->error ) ) {
222
+ $message = $api_result->error->message;
223
+ } else if ( is_object( $api_result ) ) {
224
+ $message = var_export( $api_result, true );
225
+ } else if ( is_string( $api_result ) ) {
226
+ $message = $api_result;
227
+ } else if ( empty( $api_result ) ) {
228
+ $message = 'Empty API result.';
229
+ }
230
+
231
+ $message = 'API Error: ' . $message;
232
+
233
+ $this->_log( $message, 'error', $wrapper );
234
+ }
235
+
236
+ function entrance( $message = '', $wrapper = false ) {
237
+ $msg = 'Entrance' . ( empty( $message ) ? '' : ' > ' ) . $message;
238
+
239
+ $this->_log( $msg, 'log', $wrapper );
240
+ }
241
+
242
+ function departure( $message = '', $wrapper = false ) {
243
+ $msg = 'Departure' . ( empty( $message ) ? '' : ' > ' ) . $message;
244
+
245
+ $this->_log( $msg, 'log', $wrapper );
246
+ }
247
+
248
+ #--------------------------------------------------------------------------------
249
+ #region Log Formatting
250
+ #--------------------------------------------------------------------------------
251
+
252
+ private static function format( $log, $show_type = true ) {
253
+ 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'] . ']';
254
+ }
255
+
256
+ private static function format_html( $log ) {
257
+ 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>';
258
+ }
259
+
260
+ #endregion
261
+
262
+ static function dump() {
263
+ ?>
264
+ <!-- BEGIN: Freemius PHP Console Log -->
265
+ <script type="text/javascript">
266
+ <?php
267
+ foreach ( self::$LOG as $log ) {
268
+ echo 'console.' . $log['log_type'] . '(' . json_encode( self::format( $log, false ) ) . ')' . "\n";
269
+ }
270
+ ?>
271
+ </script>
272
+ <!-- END: Freemius PHP Console Log -->
273
+ <?php
274
+ }
275
+
276
+ static function get_log() {
277
+ return self::$LOG;
278
+ }
279
+
280
+ #--------------------------------------------------------------------------------
281
+ #region Database Logging
282
+ #--------------------------------------------------------------------------------
283
+
284
+ /**
285
+ * @author Vova Feldman (@svovaf)
286
+ * @since 1.2.1.6
287
+ *
288
+ * @return bool
289
+ */
290
+ public static function is_storage_logging_on() {
291
+ if ( ! isset( self::$_isStorageLoggingOn ) ) {
292
+ self::$_isStorageLoggingOn = ( 1 == get_option( 'fs_storage_logger', 0 ) );
293
+ }
294
+
295
+ return self::$_isStorageLoggingOn;
296
+ }
297
+
298
+ /**
299
+ * Turns on/off database persistent debugging to capture
300
+ * multi-session logs to debug complex flows like
301
+ * plugin auto-deactivate on premium version activation.
302
+ *
303
+ * @todo Check if Theme Check has issues with DB tables for themes.
304
+ *
305
+ * @author Vova Feldman (@svovaf)
306
+ * @since 1.2.1.6
307
+ *
308
+ * @param bool $is_on
309
+ *
310
+ * @return bool
311
+ */
312
+ public static function _set_storage_logging( $is_on = true ) {
313
+ global $wpdb;
314
+
315
+ $table = "{$wpdb->prefix}fs_logger";
316
+
317
+ if ( $is_on ) {
318
+ /**
319
+ * Create logging table.
320
+ *
321
+ * NOTE:
322
+ * dbDelta must use KEY and not INDEX for indexes.
323
+ *
324
+ * @link https://core.trac.wordpress.org/ticket/2695
325
+ */
326
+ $result = $wpdb->query( "CREATE TABLE {$table} (
327
+ `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
328
+ `process_id` INT UNSIGNED NOT NULL,
329
+ `user_name` VARCHAR(64) NOT NULL,
330
+ `logger` VARCHAR(128) NOT NULL,
331
+ `log_order` INT UNSIGNED NOT NULL,
332
+ `type` ENUM('log','info','warn','error') NOT NULL DEFAULT 'log',
333
+ `message` TEXT NOT NULL,
334
+ `file` VARCHAR(256) NOT NULL,
335
+ `line` INT UNSIGNED NOT NULL,
336
+ `function` VARCHAR(256) NOT NULL,
337
+ `request_type` ENUM('call','ajax','cron') NOT NULL DEFAULT 'call',
338
+ `request_url` VARCHAR(1024) NOT NULL,
339
+ `created` DECIMAL(16, 6) NOT NULL,
340
+ PRIMARY KEY (`id`),
341
+ KEY `process_id` (`process_id` ASC),
342
+ KEY `process_logger` (`process_id` ASC, `logger` ASC),
343
+ KEY `function` (`function` ASC),
344
+ KEY `type` (`type` ASC))" );
345
+ } else {
346
+ /**
347
+ * Drop logging table.
348
+ */
349
+ $result = $wpdb->query( "DROP TABLE IF EXISTS $table;" );
350
+ }
351
+
352
+ if ( false !== $result ) {
353
+ update_option( 'fs_storage_logger', ( $is_on ? 1 : 0 ) );
354
+ }
355
+
356
+ return ( false !== $result );
357
+ }
358
+
359
+ /**
360
+ * @author Vova Feldman (@svovaf)
361
+ * @since 1.2.1.6
362
+ *
363
+ * @param string $type
364
+ * @param string $message
365
+ * @param int $log_order
366
+ * @param array $caller
367
+ *
368
+ * @return false|int
369
+ */
370
+ private function db_log(
371
+ &$type,
372
+ &$message,
373
+ &$log_order,
374
+ &$caller
375
+ ) {
376
+ global $wpdb;
377
+
378
+ $request_type = 'call';
379
+ if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
380
+ $request_type = 'cron';
381
+ } else if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
382
+ $request_type = 'ajax';
383
+ }
384
+
385
+ $request_url = WP_FS__IS_HTTP_REQUEST ?
386
+ $_SERVER['REQUEST_URI'] :
387
+ '';
388
+
389
+ return $wpdb->insert(
390
+ "{$wpdb->prefix}fs_logger",
391
+ array(
392
+ 'process_id' => self::$_processID,
393
+ 'user_name' => self::$_ownerName,
394
+ 'logger' => $this->_id,
395
+ 'log_order' => $log_order,
396
+ 'type' => $type,
397
+ 'request_type' => $request_type,
398
+ 'request_url' => $request_url,
399
+ 'message' => $message,
400
+ 'file' => isset( $caller['file'] ) ?
401
+ substr( $caller['file'], self::$_abspathLength ) :
402
+ '',
403
+ 'line' => $caller['line'],
404
+ 'function' => ( ! empty( $caller['class'] ) ? $caller['class'] . $caller['type'] : '' ) . $caller['function'],
405
+ 'created' => microtime( true ),
406
+ )
407
+ );
408
+ }
409
+
410
+ /**
411
+ * Persistent DB logger columns.
412
+ *
413
+ * @var array
414
+ */
415
+ private static $_log_columns = array(
416
+ 'id',
417
+ 'process_id',
418
+ 'user_name',
419
+ 'logger',
420
+ 'log_order',
421
+ 'type',
422
+ 'message',
423
+ 'file',
424
+ 'line',
425
+ 'function',
426
+ 'request_type',
427
+ 'request_url',
428
+ 'created',
429
+ );
430
+
431
+ /**
432
+ * Create DB logs query.
433
+ *
434
+ * @author Vova Feldman (@svovaf)
435
+ * @since 1.2.1.6
436
+ *
437
+ * @param bool $filters
438
+ * @param int $limit
439
+ * @param int $offset
440
+ * @param bool $order
441
+ * @param bool $escape_eol
442
+ *
443
+ * @return string
444
+ */
445
+ private static function build_db_logs_query(
446
+ $filters = false,
447
+ $limit = 200,
448
+ $offset = 0,
449
+ $order = false,
450
+ $escape_eol = false
451
+ ) {
452
+ global $wpdb;
453
+
454
+ $select = '*';
455
+
456
+ if ( $escape_eol ) {
457
+ $select = '';
458
+ for ( $i = 0, $len = count( self::$_log_columns ); $i < $len; $i ++ ) {
459
+ if ( $i > 0 ) {
460
+ $select .= ', ';
461
+ }
462
+
463
+ if ( 'message' !== self::$_log_columns[ $i ] ) {
464
+ $select .= self::$_log_columns[ $i ];
465
+ } else {
466
+ $select .= 'REPLACE(message , \'\n\', \' \') AS message';
467
+ }
468
+ }
469
+ }
470
+
471
+ $query = "SELECT {$select} FROM {$wpdb->prefix}fs_logger";
472
+ if ( is_array( $filters ) ) {
473
+ $criteria = array();
474
+
475
+ if ( ! empty( $filters['type'] ) && 'all' !== $filters['type'] ) {
476
+ $filters['type'] = strtolower( $filters['type'] );
477
+
478
+ switch ( $filters['type'] ) {
479
+ case 'warn_error':
480
+ $criteria[] = array( 'col' => 'type', 'val' => array( 'warn', 'error' ) );
481
+ break;
482
+ case 'error':
483
+ case 'warn':
484
+ $criteria[] = array( 'col' => 'type', 'val' => $filters['type'] );
485
+ break;
486
+ case 'info':
487
+ default:
488
+ $criteria[] = array( 'col' => 'type', 'val' => array( 'info', 'log' ) );
489
+ break;
490
+ }
491
+ }
492
+
493
+ if ( ! empty( $filters['request_type'] ) ) {
494
+ $filters['request_type'] = strtolower( $filters['request_type'] );
495
+
496
+ if ( in_array( $filters['request_type'], array( 'call', 'ajax', 'cron' ) ) ) {
497
+ $criteria[] = array( 'col' => 'request_type', 'val' => $filters['request_type'] );
498
+ }
499
+ }
500
+
501
+ if ( ! empty( $filters['file'] ) ) {
502
+ $criteria[] = array(
503
+ 'col' => 'file',
504
+ 'op' => 'LIKE',
505
+ 'val' => '%' . esc_sql( $filters['file'] ),
506
+ );
507
+ }
508
+
509
+ if ( ! empty( $filters['function'] ) ) {
510
+ $criteria[] = array(
511
+ 'col' => 'function',
512
+ 'op' => 'LIKE',
513
+ 'val' => '%' . esc_sql( $filters['function'] ),
514
+ );
515
+ }
516
+
517
+ if ( ! empty( $filters['process_id'] ) && is_numeric( $filters['process_id'] ) ) {
518
+ $criteria[] = array( 'col' => 'process_id', 'val' => $filters['process_id'] );
519
+ }
520
+
521
+ if ( ! empty( $filters['logger'] ) ) {
522
+ $criteria[] = array(
523
+ 'col' => 'logger',
524
+ 'op' => 'LIKE',
525
+ 'val' => '%' . esc_sql( $filters['logger'] ) . '%',
526
+ );
527
+ }
528
+
529
+ if ( ! empty( $filters['message'] ) ) {
530
+ $criteria[] = array(
531
+ 'col' => 'message',
532
+ 'op' => 'LIKE',
533
+ 'val' => '%' . esc_sql( $filters['message'] ) . '%',
534
+ );
535
+ }
536
+
537
+ if ( 0 < count( $criteria ) ) {
538
+ $query .= "\nWHERE\n";
539
+
540
+ $first = true;
541
+ foreach ( $criteria as $c ) {
542
+ if ( ! $first ) {
543
+ $query .= "AND\n";
544
+ }
545
+
546
+ if ( is_array( $c['val'] ) ) {
547
+ $operator = 'IN';
548
+
549
+ for ( $i = 0, $len = count( $c['val'] ); $i < $len; $i ++ ) {
550
+ $c['val'][ $i ] = "'" . esc_sql( $c['val'][ $i ] ) . "'";
551
+ }
552
+
553
+ $val = '(' . implode( ',', $c['val'] ) . ')';
554
+ } else {
555
+ $operator = ! empty( $c['op'] ) ? $c['op'] : '=';
556
+ $val = "'" . esc_sql( $c['val'] ) . "'";
557
+ }
558
+
559
+ $query .= "`{$c['col']}` {$operator} {$val}\n";
560
+
561
+ $first = false;
562
+ }
563
+ }
564
+ }
565
+
566
+ if ( ! is_array( $order ) ) {
567
+ $order = array(
568
+ 'col' => 'id',
569
+ 'order' => 'desc'
570
+ );
571
+ }
572
+
573
+ $query .= " ORDER BY {$order['col']} {$order['order']} LIMIT {$offset},{$limit}";
574
+
575
+ return $query;
576
+ }
577
+
578
+ /**
579
+ * Load logs from DB.
580
+ *
581
+ * @author Vova Feldman (@svovaf)
582
+ * @since 1.2.1.6
583
+ *
584
+ * @param bool $filters
585
+ * @param int $limit
586
+ * @param int $offset
587
+ * @param bool $order
588
+ *
589
+ * @return object[]|null
590
+ */
591
+ public static function load_db_logs(
592
+ $filters = false,
593
+ $limit = 200,
594
+ $offset = 0,
595
+ $order = false
596
+ ) {
597
+ global $wpdb;
598
+
599
+ $query = self::build_db_logs_query(
600
+ $filters,
601
+ $limit,
602
+ $offset,
603
+ $order
604
+ );
605
+
606
+ return $wpdb->get_results( $query );
607
+ }
608
+
609
+ /**
610
+ * Load logs from DB.
611
+ *
612
+ * @author Vova Feldman (@svovaf)
613
+ * @since 1.2.1.6
614
+ *
615
+ * @param bool $filters
616
+ * @param string $filename
617
+ * @param int $limit
618
+ * @param int $offset
619
+ * @param bool $order
620
+ *
621
+ * @return false|string File download URL or false on failure.
622
+ */
623
+ public static function download_db_logs(
624
+ $filters = false,
625
+ $filename = '',
626
+ $limit = 10000,
627
+ $offset = 0,
628
+ $order = false
629
+ ) {
630
+ global $wpdb;
631
+
632
+ $query = self::build_db_logs_query(
633
+ $filters,
634
+ $limit,
635
+ $offset,
636
+ $order,
637
+ true
638
+ );
639
+
640
+ $upload_dir = wp_upload_dir();
641
+ if ( empty( $filename ) ) {
642
+ $filename = 'fs-logs-' . date( 'Y-m-d_H-i-s', WP_FS__SCRIPT_START_TIME ) . '.csv';
643
+ }
644
+ $filepath = rtrim( $upload_dir['path'], '/' ) . "/{$filename}";
645
+
646
+ $query .= " INTO OUTFILE '{$filepath}' FIELDS TERMINATED BY '\t' ESCAPED BY '\\\\' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\\n'";
647
+
648
+ $columns = '';
649
+ for ( $i = 0, $len = count( self::$_log_columns ); $i < $len; $i ++ ) {
650
+ if ( $i > 0 ) {
651
+ $columns .= ', ';
652
+ }
653
+
654
+ $columns .= "'" . self::$_log_columns[ $i ] . "'";
655
+ }
656
+
657
+ $query = "SELECT {$columns} UNION ALL " . $query;
658
+
659
+ $result = $wpdb->query( $query );
660
+
661
+ if ( false === $result ) {
662
+ return false;
663
+ }
664
+
665
+ return rtrim( $upload_dir['url'], '/' ) . '/' . $filename;
666
+ }
667
+
668
+ /**
669
+ * @author Vova Feldman (@svovaf)
670
+ * @since 1.2.1.6
671
+ *
672
+ * @param string $filename
673
+ *
674
+ * @return string
675
+ */
676
+ public static function get_logs_download_url( $filename = '' ) {
677
+ $upload_dir = wp_upload_dir();
678
+ if ( empty( $filename ) ) {
679
+ $filename = 'fs-logs-' . date( 'Y-m-d_H-i-s', WP_FS__SCRIPT_START_TIME ) . '.csv';
680
+ }
681
+
682
+ return rtrim( $upload_dir['url'], '/' ) . $filename;
683
+ }
684
+
685
+ #endregion
686
+ }
freemius/includes/class-fs-plugin-updater.php ADDED
@@ -0,0 +1,415 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ }
14
+
15
+ // Uncomment this line for testing.
16
+ // set_site_transient( 'update_plugins', null );
17
+
18
+ class FS_Plugin_Updater {
19
+
20
+ /**
21
+ * @var Freemius
22
+ * @since 1.0.4
23
+ */
24
+ private $_fs;
25
+ /**
26
+ * @var FS_Logger
27
+ * @since 1.0.4
28
+ */
29
+ private $_logger;
30
+ /**
31
+ * @var object
32
+ * @since 1.1.8.1
33
+ */
34
+ private $_update_details;
35
+
36
+ function __construct( Freemius $freemius ) {
37
+ $this->_fs = $freemius;
38
+
39
+ $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $freemius->get_slug() . '_updater', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
40
+
41
+ $this->_filters();
42
+ }
43
+
44
+ /**
45
+ * Initiate required filters.
46
+ *
47
+ * @author Vova Feldman (@svovaf)
48
+ * @since 1.0.4
49
+ */
50
+ private function _filters() {
51
+ // Override request for plugin information
52
+ add_filter( 'plugins_api', array( &$this, 'plugins_api_filter' ), 10, 3 );
53
+
54
+ // WP 3.0+
55
+ add_filter( 'pre_set_site_transient_update_plugins', array(
56
+ &$this,
57
+ 'pre_set_site_transient_update_plugins_filter'
58
+ ) );
59
+
60
+ if ( ! $this->_fs->has_active_valid_license() ) {
61
+ /**
62
+ * If user has the premium plugin's code but do NOT have an active license,
63
+ * encourage him to upgrade by showing that there's a new release, but instead
64
+ * of showing an update link, show upgrade link to the pricing page.
65
+ *
66
+ * @since 1.1.6
67
+ *
68
+ */
69
+ // WP 2.9+
70
+ add_action( "after_plugin_row_{$this->_fs->get_plugin_basename()}", array(
71
+ &$this,
72
+ 'catch_plugin_update_row'
73
+ ), 9 );
74
+ add_action( "after_plugin_row_{$this->_fs->get_plugin_basename()}", array(
75
+ &$this,
76
+ 'edit_and_echo_plugin_update_row'
77
+ ), 11, 2 );
78
+ }
79
+
80
+ if ( ! WP_FS__IS_PRODUCTION_MODE ) {
81
+ add_filter( 'http_request_host_is_external', array(
82
+ $this,
83
+ 'http_request_host_is_external_filter'
84
+ ), 10, 3 );
85
+ }
86
+
87
+ if ( $this->_fs->is_premium() && $this->is_correct_folder_name() ) {
88
+ add_filter( 'upgrader_post_install', array( &$this, '_maybe_update_folder_name' ), 10, 3 );
89
+ }
90
+ }
91
+
92
+ /**
93
+ * Capture plugin update row by turning output buffering.
94
+ *
95
+ * @author Vova Feldman (@svovaf)
96
+ * @since 1.1.6
97
+ */
98
+ function catch_plugin_update_row() {
99
+ ob_start();
100
+ }
101
+
102
+ /**
103
+ * Overrides default update message format with "renew your license" message.
104
+ *
105
+ * @author Vova Feldman (@svovaf)
106
+ * @since 1.1.6
107
+ *
108
+ * @param string $file
109
+ * @param array $plugin_data
110
+ */
111
+ function edit_and_echo_plugin_update_row( $file, $plugin_data ) {
112
+ $plugin_update_row = ob_get_clean();
113
+
114
+ $current = get_site_transient( 'update_plugins' );
115
+ if ( ! isset( $current->response[ $file ] ) ) {
116
+ echo $plugin_update_row;
117
+
118
+ return;
119
+ }
120
+
121
+ $r = $current->response[ $file ];
122
+
123
+ $plugin_update_row = preg_replace(
124
+ '/(\<div.+>)(.+)(\<a.+\<a.+)\<\/div\>/is',
125
+ '$1 $2 ' . sprintf(
126
+ __fs( 'renew-license-now' ),
127
+ '<a href="' . $this->_fs->pricing_url() . '">', '</a>',
128
+ $r->new_version ) .
129
+ '$4',
130
+ $plugin_update_row
131
+ );
132
+
133
+ echo $plugin_update_row;
134
+ }
135
+
136
+ /**
137
+ * Since WP version 3.6, a new security feature was added that denies access to repository with a local ip.
138
+ * During development mode we want to be able updating plugin versions via our localhost repository. This
139
+ * filter white-list all domains including "api.freemius".
140
+ *
141
+ * @link http://www.emanueletessore.com/wordpress-download-failed-valid-url-provided/
142
+ *
143
+ * @author Vova Feldman (@svovaf)
144
+ * @since 1.0.4
145
+ *
146
+ * @param bool $allow
147
+ * @param string $host
148
+ * @param string $url
149
+ *
150
+ * @return bool
151
+ */
152
+ function http_request_host_is_external_filter( $allow, $host, $url ) {
153
+ return ( false !== strpos( $host, 'freemius' ) ) ? true : $allow;
154
+ }
155
+
156
+ /**
157
+ * Check for Updates at the defined API endpoint and modify the update array.
158
+ *
159
+ * This function dives into the update api just when WordPress creates its update array,
160
+ * then adds a custom API call and injects the custom plugin data retrieved from the API.
161
+ * It is reassembled from parts of the native WordPress plugin update code.
162
+ * See wp-includes/update.php line 121 for the original wp_update_plugins() function.
163
+ *
164
+ * @author Vova Feldman (@svovaf)
165
+ * @since 1.0.4
166
+ *
167
+ * @uses FS_Api
168
+ *
169
+ * @param object $transient_data Update array build by WordPress.
170
+ *
171
+ * @return object Modified update array with custom plugin data.
172
+ */
173
+ function pre_set_site_transient_update_plugins_filter( $transient_data ) {
174
+ $this->_logger->entrance();
175
+
176
+ if ( empty( $transient_data ) ||
177
+ defined( 'WP_FS__UNINSTALL_MODE' )
178
+ ) {
179
+ return $transient_data;
180
+ }
181
+
182
+ if ( ! isset( $this->_update_details ) ) {
183
+ // Get plugin's newest update.
184
+ $new_version = $this->_fs->get_update( false, false );
185
+
186
+ $this->_update_details = false;
187
+
188
+ if ( is_object( $new_version ) ) {
189
+ $this->_logger->log( 'Found newer plugin version ' . $new_version->version );
190
+
191
+ $plugin_details = new stdClass();
192
+ $plugin_details->slug = $this->_fs->get_slug();
193
+ $plugin_details->new_version = $new_version->version;
194
+ $plugin_details->url = WP_FS__ADDRESS;
195
+ $plugin_details->package = $new_version->url;
196
+ $plugin_details->plugin = $this->_fs->get_plugin_basename();
197
+
198
+ /**
199
+ * Cache plugin details locally since set_site_transient( 'update_plugins' )
200
+ * called multiple times and the non wp.org plugins are filtered after the
201
+ * call to .org.
202
+ *
203
+ * @since 1.1.8.1
204
+ */
205
+ $this->_update_details = $plugin_details;
206
+ }
207
+ }
208
+
209
+ if ( is_object( $this->_update_details ) ) {
210
+ // Add plugin to transient data.
211
+ $transient_data->response[ $this->_fs->get_plugin_basename() ] = $this->_update_details;
212
+ }
213
+
214
+ return $transient_data;
215
+ }
216
+
217
+ /**
218
+ * Try to fetch plugin's info from .org repository.
219
+ *
220
+ * @author Vova Feldman (@svovaf)
221
+ * @since 1.0.5
222
+ *
223
+ * @param string $action
224
+ * @param object $args
225
+ *
226
+ * @return bool|mixed
227
+ */
228
+ static function _fetch_plugin_info_from_repository( $action, $args ) {
229
+ $url = $http_url = 'http://api.wordpress.org/plugins/info/1.0/';
230
+ if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) {
231
+ $url = set_url_scheme( $url, 'https' );
232
+ }
233
+
234
+ $args = array(
235
+ 'timeout' => 15,
236
+ 'body' => array(
237
+ 'action' => $action,
238
+ 'request' => serialize( $args )
239
+ )
240
+ );
241
+
242
+ $request = wp_remote_post( $url, $args );
243
+
244
+ if ( is_wp_error( $request ) ) {
245
+ return false;
246
+ }
247
+
248
+ $res = maybe_unserialize( wp_remote_retrieve_body( $request ) );
249
+
250
+ if ( ! is_object( $res ) && ! is_array( $res ) ) {
251
+ return false;
252
+ }
253
+
254
+ return $res;
255
+ }
256
+
257
+ /**
258
+ * Updates information on the "View version x.x details" page with custom data.
259
+ *
260
+ * @author Vova Feldman (@svovaf)
261
+ * @since 1.0.4
262
+ *
263
+ * @uses FS_Api
264
+ *
265
+ * @param object $data
266
+ * @param string $action
267
+ * @param mixed $args
268
+ *
269
+ * @return object
270
+ */
271
+ function plugins_api_filter( $data, $action = '', $args = null ) {
272
+ $this->_logger->entrance();
273
+
274
+ if ( ( 'plugin_information' !== $action ) ||
275
+ ! isset( $args->slug )
276
+ ) {
277
+ return $data;
278
+ }
279
+
280
+ $addon = false;
281
+ $is_addon = false;
282
+
283
+ if ( $this->_fs->get_slug() !== $args->slug ) {
284
+ $addon = $this->_fs->get_addon_by_slug( $args->slug );
285
+
286
+ if ( ! is_object( $addon ) ) {
287
+ return $data;
288
+ }
289
+
290
+ $is_addon = true;
291
+ }
292
+
293
+ $plugin_in_repo = false;
294
+ if ( ! $is_addon ) {
295
+ // Try to fetch info from .org repository.
296
+ $data = self::_fetch_plugin_info_from_repository( $action, $args );
297
+
298
+ $plugin_in_repo = ( false !== $data );
299
+ }
300
+
301
+ if ( ! $plugin_in_repo ) {
302
+ $data = $args;
303
+
304
+ // Fetch as much as possible info from local files.
305
+ $plugin_local_data = $this->_fs->get_plugin_data();
306
+ $data->name = $plugin_local_data['Name'];
307
+ $data->author = $plugin_local_data['Author'];
308
+ $data->sections = array(
309
+ 'description' => 'Upgrade ' . $plugin_local_data['Name'] . ' to latest.',
310
+ );
311
+
312
+ // @todo Store extra plugin info on Freemius or parse readme.txt markup.
313
+ /*$info = $this->_fs->get_api_site_scope()->call('/information.json');
314
+
315
+ if ( !isset($info->error) ) {
316
+ $data = $info;
317
+ }*/
318
+ }
319
+
320
+ // Get plugin's newest update.
321
+ $new_version = $this->_fs->_fetch_latest_version( $is_addon ? $addon->id : false );
322
+
323
+ if ( ! is_object( $new_version ) || empty( $new_version->version ) ) {
324
+ $data->version = $this->_fs->get_plugin_version();
325
+ } else {
326
+ if ( $is_addon ) {
327
+ $data->name = $addon->title . ' ' . __fs( 'addon', $this->_fs->get_slug() );
328
+ $data->slug = $addon->slug;
329
+ $data->url = WP_FS__ADDRESS;
330
+ $data->package = $new_version->url;
331
+ }
332
+
333
+ if ( ! $plugin_in_repo ) {
334
+ $data->last_updated = ! is_null( $new_version->updated ) ? $new_version->updated : $new_version->created;
335
+ $data->requires = $new_version->requires_platform_version;
336
+ $data->tested = $new_version->tested_up_to_version;
337
+ }
338
+
339
+ $data->version = $new_version->version;
340
+ $data->download_link = $new_version->url;
341
+ }
342
+
343
+ return $data;
344
+ }
345
+
346
+ /**
347
+ * Checks if a given basename has a matching folder name
348
+ * with the current context plugin.
349
+ *
350
+ * @author Vova Feldman (@svovaf)
351
+ * @since 1.2.1.6
352
+ *
353
+ * @param string $basename Current plugin's basename.
354
+ *
355
+ * @return bool
356
+ */
357
+ private function is_correct_folder_name( $basename = '' ) {
358
+ if ( empty( $basename ) ) {
359
+ $basename = $this->_fs->get_plugin_basename();
360
+ }
361
+
362
+ return ( $this->_fs->get_slug() . ( $this->_fs->is_premium() ? '-premium' : '' ) != trim( dirname( $basename ), '/\\' ) );
363
+ }
364
+
365
+ /**
366
+ * This is a special after upgrade handler for migrating modules
367
+ * that didn't use the '-premium' suffix folder structure before
368
+ * the migration.
369
+ *
370
+ * @author Vova Feldman (@svovaf)
371
+ * @since 1.2.1.6
372
+ *
373
+ * @param bool $response Install response.
374
+ * @param array $hook_extra Extra arguments passed to hooked filters.
375
+ * @param array $result Installation result data.
376
+ *
377
+ * @return bool
378
+ */
379
+ function _maybe_update_folder_name( $response, $hook_extra, $result ) {
380
+ $basename = $this->_fs->get_plugin_basename();
381
+
382
+ if ( true !== $response ||
383
+ empty( $hook_extra ) ||
384
+ empty( $hook_extra['plugin'] ) ||
385
+ $basename !== $hook_extra['plugin']
386
+ ) {
387
+ return $response;
388
+ }
389
+
390
+ $active_plugins_basenames = get_option( 'active_plugins' );
391
+
392
+ for ( $i = 0, $len = count( $active_plugins_basenames ); $i < $len; $i ++ ) {
393
+ if ( $basename === $active_plugins_basenames[ $i ] ) {
394
+ // Get filename including extension.
395
+ $filename = basename( $basename );
396
+
397
+ $new_basename = plugin_basename(
398
+ trailingslashit( $this->_fs->get_slug() . ( $this->_fs->is_premium() ? '-premium' : '' ) ) .
399
+ $filename
400
+ );
401
+
402
+ // Verify that the expected correct path exists.
403
+ if ( file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $new_basename ) ) ) {
404
+ // Override active plugin name.
405
+ $active_plugins_basenames[ $i ] = $new_basename;
406
+ update_option( 'active_plugins', $active_plugins_basenames );
407
+ }
408
+
409
+ break;
410
+ }
411
+ }
412
+
413
+ return $response;
414
+ }
415
+ }
freemius/includes/class-fs-security.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
+ * @since 1.0.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ define( 'WP_FS__SECURITY_PARAMS_PREFIX', 's_' );
14
+
15
+ /**
16
+ * Class FS_Security
17
+ */
18
+ class FS_Security {
19
+ /**
20
+ * @var FS_Security
21
+ * @since 1.0.3
22
+ */
23
+ private static $_instance;
24
+ /**
25
+ * @var FS_Logger
26
+ * @since 1.0.3
27
+ */
28
+ private static $_logger;
29
+
30
+ /**
31
+ * @return \FS_Security
32
+ */
33
+ public static function instance() {
34
+ if ( ! isset( self::$_instance ) ) {
35
+ self::$_instance = new FS_Security();
36
+ self::$_logger = FS_Logger::get_logger(
37
+ WP_FS__SLUG,
38
+ WP_FS__DEBUG_SDK,
39
+ WP_FS__ECHO_DEBUG_SDK
40
+ );
41
+ }
42
+
43
+ return self::$_instance;
44
+ }
45
+
46
+ private function __construct() {
47
+ }
48
+
49
+ /**
50
+ * @param \FS_Scope_Entity $entity
51
+ * @param int $timestamp
52
+ * @param string $action
53
+ *
54
+ * @return string
55
+ */
56
+ function get_secure_token( FS_Scope_Entity $entity, $timestamp, $action = '' ) {
57
+ return md5(
58
+ $timestamp .
59
+ $entity->id .
60
+ $entity->secret_key .
61
+ $entity->public_key .
62
+ $action
63
+ );
64
+ }
65
+
66
+ /**
67
+ * @param \FS_Scope_Entity $entity
68
+ * @param int|bool $timestamp
69
+ * @param string $action
70
+ *
71
+ * @return array
72
+ */
73
+ function get_context_params( FS_Scope_Entity $entity, $timestamp = false, $action = '' ) {
74
+ if ( false === $timestamp ) {
75
+ $timestamp = time();
76
+ }
77
+
78
+ return array(
79
+ 's_ctx_type' => $entity->get_type(),
80
+ 's_ctx_id' => $entity->id,
81
+ 's_ctx_ts' => $timestamp,
82
+ 's_ctx_secure' => $this->get_secure_token( $entity, $timestamp, $action ),
83
+ );
84
+ }
85
+ }
freemius/includes/debug/class-fs-debug-bar-panel.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Extends Debug Bar plugin by adding a panel to show all Freemius API requests.
15
+ *
16
+ * @author Vova Feldman (@svovaf)
17
+ * @since 1.1.7.3
18
+ *
19
+ * Class Freemius_Debug_Bar_Panel
20
+ */
21
+ class Freemius_Debug_Bar_Panel extends Debug_Bar_Panel {
22
+ function init() {
23
+ $this->title( 'Freemius' );
24
+ }
25
+
26
+ static function requests_count() {
27
+ if ( class_exists( 'Freemius_Api' ) ) {
28
+ $logger = Freemius_Api::GetLogger();
29
+ } else {
30
+ $logger = array();
31
+ }
32
+
33
+ return number_format( count( $logger ) );
34
+ }
35
+
36
+ static function total_time() {
37
+ if ( class_exists( 'Freemius_Api' ) ) {
38
+ $logger = Freemius_Api::GetLogger();
39
+ } else {
40
+ $logger = array();
41
+ }
42
+
43
+ $total_time = .0;
44
+ foreach ( $logger as $l ) {
45
+ $total_time += $l['total'];
46
+ }
47
+
48
+ return number_format( 100 * $total_time, 2 ) . ' ' . __fs( 'ms' );
49
+ }
50
+
51
+ function render() {
52
+ ?>
53
+ <div id='debug-bar-php'>
54
+ <?php fs_require_template( '/debug/api-calls.php' ) ?>
55
+ <br>
56
+ <?php fs_require_template( '/debug/scheduled-crons.php' ) ?>
57
+ <br>
58
+ <?php fs_require_template( '/debug/plugins-themes-sync.php' ) ?>
59
+ <br>
60
+ <?php fs_require_template( '/debug/logger.php' ) ?>
61
+ </div>
62
+ <?php
63
+ }
64
+ }
freemius/includes/debug/debug-bar-start.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ if ( ! WP_FS__DEBUG_SDK ) {
14
+ return;
15
+ }
16
+
17
+ /**
18
+ * Initialize Freemius custom debug panels.
19
+ *
20
+ * @param array $panels Debug bar panels objects
21
+ *
22
+ * @return array Debug bar panels with your custom panels
23
+ */
24
+ function fs_custom_panels_init( $panels ) {
25
+ if ( class_exists( 'Debug_Bar_Panel' ) ) {
26
+ if ( FS_API__LOGGER_ON ) {
27
+ require_once dirname( __FILE__ ) . '/class-fs-debug-bar-panel.php';
28
+ $panels[] = new Freemius_Debug_Bar_Panel();
29
+ }
30
+ }
31
+
32
+ return $panels;
33
+ }
34
+
35
+ function fs_custom_status_init( $statuses ) {
36
+ if ( class_exists( 'Debug_Bar_Panel' ) ) {
37
+ if ( FS_API__LOGGER_ON ) {
38
+ require_once dirname( __FILE__ ) . '/class-fs-debug-bar-panel.php';
39
+ $statuses[] = array(
40
+ 'fs_api_requests',
41
+ __fs( 'Freemius API' ),
42
+ Freemius_Debug_Bar_Panel::requests_count() . ' ' . __fs( 'Requests' ) .
43
+ ' (' . Freemius_Debug_Bar_Panel::total_time() . ')'
44
+ );
45
+ }
46
+ }
47
+
48
+ return $statuses;
49
+ }
50
+
51
+ add_filter( 'debug_bar_panels', 'fs_custom_panels_init' );
52
+ add_filter( 'debug_bar_statuses', 'fs_custom_status_init' );
freemius/includes/debug/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ // Silence is golden.
3
+ // Hide file structure from users on unprotected servers.
freemius/includes/entities/class-fs-billing.php ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Billing extends FS_Entity {
14
+
15
+ #region Properties
16
+
17
+ /**
18
+ * @var int
19
+ */
20
+ public $entity_id;
21
+ /**
22
+ * @var string (Enum) Linked entity type. One of: developer, plugin, user, install
23
+ */
24
+ public $entity_type;
25
+ /**
26
+ * @var string
27
+ */
28
+ public $business_name;
29
+ /**
30
+ * @var string
31
+ */
32
+ public $first;
33
+ /**
34
+ * @var string
35
+ */
36
+ public $last;
37
+ /**
38
+ * @var string
39
+ */
40
+ public $email;
41
+ /**
42
+ * @var string
43
+ */
44
+ public $phone;
45
+ /**
46
+ * @var string
47
+ */
48
+ public $website;
49
+ /**
50
+ * @var string Tax or VAT ID.
51
+ */
52
+ public $tax_id;
53
+ /**
54
+ * @var string
55
+ */
56
+ public $address_street;
57
+ /**
58
+ * @var string
59
+ */
60
+ public $address_apt;
61
+ /**
62
+ * @var string
63
+ */
64
+ public $address_city;
65
+ /**
66
+ * @var string
67
+ */
68
+ public $address_country;
69
+ /**
70
+ * @var string Two chars country code.
71
+ */
72
+ public $address_country_code;
73
+ /**
74
+ * @var string
75
+ */
76
+ public $address_state;
77
+ /**
78
+ * @var number Numeric ZIP code (cab be with leading zeros).
79
+ */
80
+ public $address_zip;
81
+
82
+ #endregion Properties
83
+
84
+
85
+ /**
86
+ * @param object|bool $event
87
+ */
88
+ function __construct( $event = false ) {
89
+ parent::__construct( $event );
90
+ }
91
+
92
+ static function get_type() {
93
+ return 'billing';
94
+ }
95
+ }
freemius/includes/entities/class-fs-entity.php ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
+ * @since 1.0.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Get object's public variables.
15
+ *
16
+ * @author Vova Feldman (@svovaf)
17
+ * @since 1.0.0
18
+ *
19
+ * @param object $object
20
+ *
21
+ * @return array
22
+ */
23
+ function fs_get_object_public_vars( $object ) {
24
+ return get_object_vars( $object );
25
+ }
26
+
27
+ class FS_Entity {
28
+ /**
29
+ * @var number
30
+ */
31
+ public $id;
32
+ /**
33
+ * @var string Datetime value in 'YYYY-MM-DD HH:MM:SS' format.
34
+ */
35
+ public $updated;
36
+ /**
37
+ * @var string Datetime value in 'YYYY-MM-DD HH:MM:SS' format.
38
+ */
39
+ public $created;
40
+
41
+ /**
42
+ * @param bool|object $entity
43
+ */
44
+ function __construct( $entity = false ) {
45
+ if ( ! ( $entity instanceof stdClass ) ) {
46
+ return;
47
+ }
48
+
49
+ $props = fs_get_object_public_vars( $this );
50
+
51
+ foreach ( $props as $key => $def_value ) {
52
+ $this->{$key} = isset( $entity->{$key} ) ?
53
+ $entity->{$key} :
54
+ $def_value;
55
+ }
56
+ }
57
+
58
+ static function get_type() {
59
+ return 'type';
60
+ }
61
+
62
+ /**
63
+ * @author Vova Feldman (@svovaf)
64
+ * @since 1.0.6
65
+ *
66
+ * @param FS_Entity $entity1
67
+ * @param FS_Entity $entity2
68
+ *
69
+ * @return bool
70
+ */
71
+ static function equals( $entity1, $entity2 ) {
72
+ if ( is_null( $entity1 ) && is_null( $entity2 ) ) {
73
+ return true;
74
+ } else if ( is_object( $entity1 ) && is_object( $entity2 ) ) {
75
+ return ( $entity1->id == $entity2->id );
76
+ } else if ( is_object( $entity1 ) ) {
77
+ return is_null( $entity1->id );
78
+ } else {
79
+ return is_null( $entity2->id );
80
+ }
81
+ }
82
+
83
+ private $_is_updated = false;
84
+
85
+ /**
86
+ * Update object property.
87
+ *
88
+ * @author Vova Feldman (@svovaf)
89
+ * @since 1.0.9
90
+ *
91
+ * @param string|array[string]mixed $key
92
+ * @param string|bool $val
93
+ *
94
+ * @return bool
95
+ */
96
+ function update( $key, $val = false ) {
97
+ if ( ! is_array( $key ) ) {
98
+ $key = array( $key => $val );
99
+ }
100
+
101
+ $is_updated = false;
102
+
103
+ foreach ( $key as $k => $v ) {
104
+ if ( $this->{$k} === $v ) {
105
+ continue;
106
+ }
107
+
108
+ if ( ( is_string( $this->{$k} ) && is_numeric( $v ) ||
109
+ ( is_numeric( $this->{$k} ) && is_string( $v ) ) ) &&
110
+ $this->{$k} == $v
111
+ ) {
112
+ continue;
113
+ }
114
+
115
+ // Update value.
116
+ $this->{$k} = $v;
117
+
118
+ $is_updated = true;
119
+ }
120
+
121
+ $this->_is_updated = $is_updated;
122
+
123
+ return $is_updated;
124
+ }
125
+
126
+ /**
127
+ * Checks if entity was updated.
128
+ *
129
+ * @author Vova Feldman (@svovaf)
130
+ * @since 1.0.9
131
+ *
132
+ * @return bool
133
+ */
134
+ function is_updated() {
135
+ return $this->_is_updated;
136
+ }
137
+
138
+ /**
139
+ * @param $id
140
+ *
141
+ * @author Vova Feldman (@svovaf)
142
+ * @since 1.1.2
143
+ *
144
+ * @return bool
145
+ */
146
+ static function is_valid_id($id){
147
+ return is_numeric($id);
148
+ }
149
+ }
freemius/includes/entities/class-fs-payment.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Payment extends FS_Entity {
14
+
15
+ #region Properties
16
+
17
+ /**
18
+ * @var number
19
+ */
20
+ public $plugin_id;
21
+ /**
22
+ * @var number
23
+ */
24
+ public $user_id;
25
+ /**
26
+ * @var number
27
+ */
28
+ public $install_id;
29
+ /**
30
+ * @var number
31
+ */
32
+ public $subscription_id;
33
+ /**
34
+ * @var number
35
+ */
36
+ public $plan_id;
37
+ /**
38
+ * @var number
39
+ */
40
+ public $license_id;
41
+ /**
42
+ * @var float
43
+ */
44
+ public $gross;
45
+ /**
46
+ * @var number
47
+ */
48
+ public $bound_payment_id;
49
+ /**
50
+ * @var string
51
+ */
52
+ public $external_id;
53
+ /**
54
+ * @var string
55
+ */
56
+ public $gateway;
57
+ /**
58
+ * @var string ISO 3166-1 alpha-2 - two-letter country code.
59
+ *
60
+ * @link http://www.wikiwand.com/en/ISO_3166-1_alpha-2
61
+ */
62
+ public $country_code;
63
+ /**
64
+ * @var string
65
+ */
66
+ public $vat_id;
67
+ /**
68
+ * @var float Actual Tax / VAT in $$$
69
+ */
70
+ public $vat;
71
+
72
+ #endregion Properties
73
+
74
+ /**
75
+ * @param object|bool $payment
76
+ */
77
+ function __construct( $payment = false ) {
78
+ parent::__construct( $payment );
79
+ }
80
+
81
+ static function get_type() {
82
+ return 'payment';
83
+ }
84
+
85
+ /**
86
+ * @author Vova Feldman (@svovaf)
87
+ * @since 1.0.0
88
+ *
89
+ * @return bool
90
+ */
91
+ function is_refund() {
92
+ return ( parent::is_valid_id( $this->bound_payment_id ) && 0 > $this->gross );
93
+ }
94
+ }
freemius/includes/entities/class-fs-plugin-info.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
+ * @since 1.0.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Plugin_Info extends FS_Entity {
14
+ public $plugin_id;
15
+ public $description;
16
+ public $short_description;
17
+ public $banner_url;
18
+ public $card_banner_url;
19
+ public $selling_point_0;
20
+ public $selling_point_1;
21
+ public $selling_point_2;
22
+ public $screenshots;
23
+
24
+ /**
25
+ * @param stdClass|bool $plugin_info
26
+ */
27
+ function __construct( $plugin_info = false ) {
28
+ parent::__construct( $plugin_info );
29
+ }
30
+
31
+ static function get_type() {
32
+ return 'plugin';
33
+ }
34
+ }
freemius/includes/entities/class-fs-plugin-license.php ADDED
@@ -0,0 +1,224 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Class FS_Plugin_License
15
+ */
16
+ class FS_Plugin_License extends FS_Entity {
17
+
18
+ #region Properties
19
+
20
+ /**
21
+ * @var number
22
+ */
23
+ public $plugin_id;
24
+ /**
25
+ * @var number
26
+ */
27
+ public $user_id;
28
+ /**
29
+ * @var number
30
+ */
31
+ public $plan_id;
32
+ /**
33
+ * @var number
34
+ */
35
+ public $pricing_id;
36
+ /**
37
+ * @var int|null
38
+ */
39
+ public $quota;
40
+ /**
41
+ * @var int
42
+ */
43
+ public $activated;
44
+ /**
45
+ * @var int
46
+ */
47
+ public $activated_local;
48
+ /**
49
+ * @var string
50
+ */
51
+ public $expiration;
52
+ /**
53
+ * @var string
54
+ */
55
+ public $secret_key;
56
+ /**
57
+ * @var bool $is_free_localhost Defaults to true. If true, allow unlimited localhost installs with the same
58
+ * license.
59
+ */
60
+ public $is_free_localhost;
61
+ /**
62
+ * @var bool $is_block_features Defaults to true. If false, don't block features after license expiry - only
63
+ * block updates and support.
64
+ */
65
+ public $is_block_features;
66
+ /**
67
+ * @var bool
68
+ */
69
+ public $is_cancelled;
70
+
71
+ #endregion Properties
72
+
73
+ /**
74
+ * @param stdClass|bool $license
75
+ */
76
+ function __construct( $license = false ) {
77
+ parent::__construct( $license );
78
+ }
79
+
80
+ /**
81
+ * Get entity type.
82
+ *
83
+ * @return string
84
+ */
85
+ static function get_type() {
86
+ return 'license';
87
+ }
88
+
89
+ /**
90
+ * Check how many site activations left.
91
+ *
92
+ * @author Vova Feldman (@svovaf)
93
+ * @since 1.0.5
94
+ *
95
+ * @return int
96
+ */
97
+ function left() {
98
+ if ( ! $this->is_active() || $this->is_expired() ) {
99
+ return 0;
100
+ }
101
+
102
+ if ( $this->is_unlimited() ) {
103
+ return 999;
104
+ }
105
+
106
+ return ( $this->quota - $this->activated - ( $this->is_free_localhost ? 0 : $this->activated_local ) );
107
+ }
108
+
109
+ /**
110
+ * Check if single site license.
111
+ *
112
+ * @author Vova Feldman (@svovaf)
113
+ * @since 1.1.8.1
114
+ *
115
+ * @return bool
116
+ */
117
+ function is_single_site() {
118
+ return ( is_numeric( $this->quota ) && 1 == $this->quota );
119
+ }
120
+
121
+ /**
122
+ * @author Vova Feldman (@svovaf)
123
+ * @since 1.0.5
124
+ *
125
+ * @return bool
126
+ */
127
+ function is_expired() {
128
+ return ! $this->is_lifetime() && ( strtotime( $this->expiration ) < WP_FS__SCRIPT_START_TIME );
129
+ }
130
+
131
+ /**
132
+ * Check if license is not expired.
133
+ *
134
+ * @author Vova Feldman (@svovaf)
135
+ * @since 1.2.1
136
+ *
137
+ * @return bool
138
+ */
139
+ function is_valid() {
140
+ return ! $this->is_expired();
141
+ }
142
+
143
+ /**
144
+ * @author Vova Feldman (@svovaf)
145
+ * @since 1.0.6
146
+ *
147
+ * @return bool
148
+ */
149
+ function is_lifetime() {
150
+ return is_null( $this->expiration );
151
+ }
152
+
153
+ /**
154
+ * @author Vova Feldman (@svovaf)
155
+ * @since 1.2.0
156
+ *
157
+ * @return bool
158
+ */
159
+ function is_unlimited() {
160
+ return is_null( $this->quota );
161
+ }
162
+
163
+ /**
164
+ * Check if license is fully utilized.
165
+ *
166
+ * @author Vova Feldman (@svovaf)
167
+ * @since 1.0.6
168
+ *
169
+ * @param bool $is_localhost
170
+ *
171
+ * @return bool
172
+ */
173
+ function is_utilized( $is_localhost = null ) {
174
+ if ( is_null( $is_localhost ) ) {
175
+ $is_localhost = WP_FS__IS_LOCALHOST_FOR_SERVER;
176
+ }
177
+
178
+ if ( $this->is_unlimited() ) {
179
+ return false;
180
+ }
181
+
182
+ return ! ( $this->is_free_localhost && $is_localhost ) &&
183
+ ( $this->quota <= $this->activated + ( $this->is_free_localhost ? 0 : $this->activated_local ) );
184
+ }
185
+
186
+ /**
187
+ * @author Vova Feldman (@svovaf)
188
+ * @since 1.2.1
189
+ *
190
+ * @return bool
191
+ */
192
+ function is_active() {
193
+ return ( ! $this->is_cancelled );
194
+ }
195
+
196
+ /**
197
+ * Check if license's plan features are enabled.
198
+ *
199
+ * - Either if plan not expired
200
+ * - If expired, based on the configuration to block features or not.
201
+ *
202
+ * @author Vova Feldman (@svovaf)
203
+ * @since 1.0.6
204
+ *
205
+ * @return bool
206
+ */
207
+ function is_features_enabled() {
208
+ return $this->is_active() && ( ! $this->is_block_features || ! $this->is_expired() );
209
+ }
210
+
211
+ /**
212
+ * Subscription considered to be new without any payments
213
+ * if the license expires in less than 24 hours
214
+ * from the license creation.
215
+ *
216
+ * @author Vova Feldman (@svovaf)
217
+ * @since 1.0.9
218
+ *
219
+ * @return bool
220
+ */
221
+ function is_first_payment_pending() {
222
+ return ( WP_FS__TIME_24_HOURS_IN_SEC >= strtotime( $this->expiration ) - strtotime( $this->created ) );
223
+ }
224
+ }
freemius/includes/entities/class-fs-plugin-plan.php ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Class FS_Plugin_Plan
15
+ *
16
+ * @property FS_Pricing[] $pricing
17
+ */
18
+ class FS_Plugin_Plan extends FS_Entity {
19
+
20
+ #region Properties
21
+
22
+ /**
23
+ * @var number
24
+ */
25
+ public $plugin_id;
26
+ /**
27
+ * @var string
28
+ */
29
+ public $name;
30
+ /**
31
+ * @var string
32
+ */
33
+ public $title;
34
+ /**
35
+ * @var string
36
+ */
37
+ public $description;
38
+ /**
39
+ * @var bool Defaults to true. If true, allow unlimited localhost installs with the same license.
40
+ */
41
+ public $is_free_localhost;
42
+ /**
43
+ * @var bool Defaults to true. If false, don't block features after license expiry - only block updates and
44
+ * support.
45
+ */
46
+ public $is_block_features;
47
+ /**
48
+ * @var int
49
+ */
50
+ public $license_type;
51
+ /**
52
+ * @var bool
53
+ */
54
+ public $is_https_support;
55
+ /**
56
+ * @var int Trial days.
57
+ */
58
+ public $trial_period;
59
+ /**
60
+ * @var string If true, require payment for trial.
61
+ */
62
+ public $is_require_subscription;
63
+ /**
64
+ * @var string Knowledge Base URL.
65
+ */
66
+ public $support_kb;
67
+ /**
68
+ * @var string Support Forum URL.
69
+ */
70
+ public $support_forum;
71
+ /**
72
+ * @var string Support email address.
73
+ */
74
+ public $support_email;
75
+ /**
76
+ * @var string Support phone.
77
+ */
78
+ public $support_phone;
79
+ /**
80
+ * @var string Support skype username.
81
+ */
82
+ public $support_skype;
83
+ /**
84
+ * @var bool Is personal success manager supported with the plan.
85
+ */
86
+ public $is_success_manager;
87
+ /**
88
+ * @var bool Is featured plan.
89
+ */
90
+ public $is_featured;
91
+
92
+ #endregion Properties
93
+
94
+ /**
95
+ * @param object|bool $plan
96
+ */
97
+ function __construct( $plan = false ) {
98
+ parent::__construct( $plan );
99
+
100
+ if ( is_object( $plan ) ) {
101
+ $this->name = strtolower( $plan->name );
102
+ }
103
+ }
104
+
105
+ static function get_type() {
106
+ return 'plan';
107
+ }
108
+
109
+ /**
110
+ * @author Vova Feldman (@svovaf)
111
+ * @since 1.0.9
112
+ *
113
+ * @return bool
114
+ */
115
+ function is_free() {
116
+ return ( 'free' === $this->name );
117
+ }
118
+
119
+ /**
120
+ * Checks if this plan supports "Technical Support".
121
+ *
122
+ * @author Leo Fajardo (leorw)
123
+ * @since 1.2.0
124
+ *
125
+ * @return bool
126
+ */
127
+ function has_technical_support() {
128
+ return ( ! empty( $this->support_email ) ||
129
+ ! empty( $this->support_skype ) ||
130
+ ! empty( $this->support_phone ) ||
131
+ ! empty( $this->is_success_manager )
132
+ );
133
+ }
134
+
135
+ /**
136
+ * @author Vova Feldman (@svovaf)
137
+ * @since 1.0.9
138
+ *
139
+ * @return bool
140
+ */
141
+ function has_trial() {
142
+ return ! $this->is_free() &&
143
+ is_numeric( $this->trial_period ) && ( $this->trial_period > 0 );
144
+ }
145
+ }
freemius/includes/entities/class-fs-plugin-tag.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Plugin_Tag extends FS_Entity {
14
+ public $version;
15
+ public $url;
16
+
17
+ function __construct( $tag = false ) {
18
+ parent::__construct( $tag );
19
+ }
20
+
21
+ static function get_type() {
22
+ return 'tag';
23
+ }
24
+ }
freemius/includes/entities/class-fs-plugin.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
+ * @since 1.0.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Plugin extends FS_Scope_Entity {
14
+ /**
15
+ * @since 1.0.6
16
+ * @var null|number
17
+ */
18
+ public $parent_plugin_id;
19
+ /**
20
+ * @var string
21
+ */
22
+ public $title;
23
+ /**
24
+ * @var string
25
+ */
26
+ public $slug;
27
+ /**
28
+ * @var string 'plugin' or 'theme'
29
+ */
30
+ public $type;
31
+
32
+ #region Install Specific Properties
33
+
34
+ /**
35
+ * @var string
36
+ */
37
+ public $file;
38
+ /**
39
+ * @var string
40
+ */
41
+ public $version;
42
+ /**
43
+ * @var bool
44
+ */
45
+ public $auto_update;
46
+ /**
47
+ * @var FS_Plugin_Info
48
+ */
49
+ public $info;
50
+ /**
51
+ * @since 1.0.9
52
+ *
53
+ * @var bool
54
+ */
55
+ public $is_premium;
56
+ /**
57
+ * @since 1.0.9
58
+ *
59
+ * @var bool
60
+ */
61
+ public $is_live;
62
+
63
+ #endregion Install Specific Properties
64
+
65
+ /**
66
+ * @param stdClass|bool $plugin
67
+ */
68
+ function __construct( $plugin = false ) {
69
+ parent::__construct( $plugin );
70
+
71
+ $this->is_premium = false;
72
+ $this->is_live = true;
73
+
74
+ if ( isset( $plugin->info ) && is_object( $plugin->info ) ) {
75
+ $this->info = new FS_Plugin_Info( $plugin->info );
76
+ }
77
+ }
78
+
79
+ /**
80
+ * Check if plugin is an add-on (has parent).
81
+ *
82
+ * @author Vova Feldman (@svovaf)
83
+ * @since 1.0.6
84
+ *
85
+ * @return bool
86
+ */
87
+ function is_addon() {
88
+ return isset( $this->parent_plugin_id ) && is_numeric( $this->parent_plugin_id );
89
+ }
90
+
91
+ static function get_type() {
92
+ return 'plugin';
93
+ }
94
+ }
freemius/includes/entities/class-fs-pricing.php ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Pricing extends FS_Entity {
14
+
15
+ #region Properties
16
+
17
+ /**
18
+ * @var number
19
+ */
20
+ public $plan_id;
21
+ /**
22
+ * @var int
23
+ */
24
+ public $licenses;
25
+ /**
26
+ * @var null|float
27
+ */
28
+ public $monthly_price;
29
+ /**
30
+ * @var null|float
31
+ */
32
+ public $annual_price;
33
+ /**
34
+ * @var null|float
35
+ */
36
+ public $lifetime_price;
37
+
38
+ #endregion Properties
39
+
40
+ /**
41
+ * @param object|bool $pricing
42
+ */
43
+ function __construct( $pricing = false ) {
44
+ parent::__construct( $pricing );
45
+ }
46
+
47
+ static function get_type() {
48
+ return 'pricing';
49
+ }
50
+
51
+ /**
52
+ * @author Vova Feldman (@svovaf)
53
+ * @since 1.1.8
54
+ *
55
+ * @return bool
56
+ */
57
+ function has_monthly() {
58
+ return ( is_numeric( $this->monthly_price ) && $this->monthly_price > 0 );
59
+ }
60
+
61
+ /**
62
+ * @author Vova Feldman (@svovaf)
63
+ * @since 1.1.8
64
+ *
65
+ * @return bool
66
+ */
67
+ function has_annual() {
68
+ return ( is_numeric( $this->annual_price ) && $this->annual_price > 0 );
69
+ }
70
+
71
+ /**
72
+ * @author Vova Feldman (@svovaf)
73
+ * @since 1.1.8
74
+ *
75
+ * @return bool
76
+ */
77
+ function has_lifetime() {
78
+ return ( is_numeric( $this->lifetime_price ) && $this->lifetime_price > 0 );
79
+ }
80
+
81
+ /**
82
+ * Check if unlimited licenses pricing.
83
+ *
84
+ * @author Vova Feldman (@svovaf)
85
+ * @since 1.1.8
86
+ *
87
+ * @return bool
88
+ */
89
+ function is_unlimited() {
90
+ return is_null( $this->licenses );
91
+ }
92
+
93
+
94
+ /**
95
+ * Check if pricing has more than one billing cycle.
96
+ *
97
+ * @author Vova Feldman (@svovaf)
98
+ * @since 1.1.8
99
+ *
100
+ * @return bool
101
+ */
102
+ function is_multi_cycle() {
103
+ $cycles = 0;
104
+ if ( $this->has_monthly() ) {
105
+ $cycles ++;
106
+ }
107
+ if ( $this->has_annual() ) {
108
+ $cycles ++;
109
+ }
110
+ if ( $this->has_lifetime() ) {
111
+ $cycles ++;
112
+ }
113
+
114
+ return $cycles > 1;
115
+ }
116
+
117
+ /**
118
+ * Get annual over monthly discount.
119
+ *
120
+ * @author Vova Feldman (@svovaf)
121
+ * @since 1.1.8
122
+ *
123
+ * @return int
124
+ */
125
+ function annual_discount_percentage() {
126
+ return floor( $this->annual_savings() / ( $this->monthly_price * 12 * ( $this->is_unlimited() ? 1 : $this->licenses ) ) * 100 );
127
+ }
128
+
129
+ /**
130
+ * Get annual over monthly savings.
131
+ *
132
+ * @author Vova Feldman (@svovaf)
133
+ * @since 1.1.8
134
+ *
135
+ * @return float
136
+ */
137
+ function annual_savings() {
138
+ return ( $this->monthly_price * 12 - $this->annual_price ) * ( $this->is_unlimited() ? 1 : $this->licenses );
139
+ }
140
+
141
+ }
freemius/includes/entities/class-fs-scope-entity.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Scope_Entity extends FS_Entity {
14
+ /**
15
+ * @var string
16
+ */
17
+ public $public_key;
18
+ /**
19
+ * @var string
20
+ */
21
+ public $secret_key;
22
+
23
+ /**
24
+ * @param bool|stdClass $scope_entity
25
+ */
26
+ function __construct( $scope_entity = false ) {
27
+ parent::__construct( $scope_entity );
28
+ }
29
+ }
freemius/includes/entities/class-fs-site.php ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
+ * @since 1.0.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Site extends FS_Scope_Entity {
14
+ /**
15
+ * @var string
16
+ */
17
+ public $slug;
18
+ /**
19
+ * @var number
20
+ */
21
+ public $site_id;
22
+ /**
23
+ * @var number
24
+ */
25
+ public $plugin_id;
26
+ /**
27
+ * @var number
28
+ */
29
+ public $user_id;
30
+ /**
31
+ * @var string
32
+ */
33
+ public $title;
34
+ /**
35
+ * @var string
36
+ */
37
+ public $url;
38
+ /**
39
+ * @var string
40
+ */
41
+ public $version;
42
+ /**
43
+ * @var string E.g. en-GB
44
+ */
45
+ public $language;
46
+ /**
47
+ * @var string E.g. UTF-8
48
+ */
49
+ public $charset;
50
+ /**
51
+ * @var string Platform version (e.g WordPress version).
52
+ */
53
+ public $platform_version;
54
+ /**
55
+ * Freemius SDK version
56
+ *
57
+ * @author Leo Fajardo (@leorw)
58
+ * @since 1.2.2
59
+ *
60
+ * @var string SDK version (e.g.: 1.2.2)
61
+ */
62
+ public $sdk_version;
63
+ /**
64
+ * @var string Programming language version (e.g PHP version).
65
+ */
66
+ public $programming_language_version;
67
+ /**
68
+ * @var FS_Plugin_Plan $plan
69
+ */
70
+ public $plan;
71
+ /**
72
+ * @var number|null
73
+ */
74
+ public $license_id;
75
+ /**
76
+ * @var number|null
77
+ */
78
+ public $trial_plan_id;
79
+ /**
80
+ * @var string|null
81
+ */
82
+ public $trial_ends;
83
+ /**
84
+ * @since 1.0.9
85
+ *
86
+ * @var bool
87
+ */
88
+ public $is_premium = false;
89
+ /**
90
+ * @author Leo Fajardo (@leorw)
91
+ *
92
+ * @since 1.2.1.5
93
+ *
94
+ * @var bool
95
+ */
96
+ public $is_disconnected = false;
97
+
98
+ /**
99
+ * @param stdClass|bool $site
100
+ */
101
+ function __construct( $site = false ) {
102
+ $this->plan = new FS_Plugin_Plan();
103
+
104
+ parent::__construct( $site );
105
+
106
+ if ( is_object( $site ) ) {
107
+ $this->plan->id = $site->plan_id;
108
+ }
109
+
110
+ if ( ! is_bool( $this->is_disconnected ) ) {
111
+ $this->is_disconnected = false;
112
+ }
113
+ }
114
+
115
+ static function get_type() {
116
+ return 'install';
117
+ }
118
+
119
+ function is_localhost() {
120
+ // The server has no way to verify if localhost unless localhost appears in domain.
121
+ return WP_FS__IS_LOCALHOST_FOR_SERVER;
122
+ // return (substr($_SERVER['REMOTE_ADDR'], 0, 4) == '127.' || $_SERVER['REMOTE_ADDR'] == '::1');
123
+ }
124
+
125
+ /**
126
+ * Check if site in trial.
127
+ *
128
+ * @author Vova Feldman (@svovaf)
129
+ * @since 1.0.9
130
+ *
131
+ * @return bool
132
+ */
133
+ function is_trial() {
134
+ return is_numeric( $this->trial_plan_id ) && ( strtotime( $this->trial_ends ) > WP_FS__SCRIPT_START_TIME );
135
+ }
136
+
137
+ /**
138
+ * Check if user already utilized the trial with the current install.
139
+ *
140
+ * @author Vova Feldman (@svovaf)
141
+ * @since 1.0.9
142
+ *
143
+ * @return bool
144
+ */
145
+ function is_trial_utilized() {
146
+ return is_numeric( $this->trial_plan_id );
147
+ }
148
+ }
freemius/includes/entities/class-fs-subscription.php ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Subscription extends FS_Entity {
14
+
15
+ #region Properties
16
+
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 $plan_id;
29
+ /**
30
+ * @var number
31
+ */
32
+ public $license_id;
33
+ /**
34
+ * @var float
35
+ */
36
+ public $total_gross;
37
+ /**
38
+ * @var float
39
+ */
40
+ public $amount_per_cycle;
41
+ /**
42
+ * @var int # of months
43
+ */
44
+ public $billing_cycle;
45
+ /**
46
+ * @var float
47
+ */
48
+ public $outstanding_balance;
49
+ /**
50
+ * @var int
51
+ */
52
+ public $failed_payments;
53
+ /**
54
+ * @var string
55
+ */
56
+ public $gateway;
57
+ /**
58
+ * @var string
59
+ */
60
+ public $external_id;
61
+ /**
62
+ * @var string|null
63
+ */
64
+ public $trial_ends;
65
+ /**
66
+ * @var string|null Datetime of the next payment, or null if cancelled
67
+ */
68
+ public $next_payment;
69
+ /**
70
+ * @var string|null
71
+ */
72
+ public $vat_id;
73
+ /**
74
+ * @var string Two characters country code
75
+ */
76
+ public $country_code;
77
+
78
+ #endregion Properties
79
+
80
+ /**
81
+ * @param object|bool $subscription
82
+ */
83
+ function __construct( $subscription = false ) {
84
+ parent::__construct( $subscription );
85
+ }
86
+
87
+ static function get_type() {
88
+ return 'subscription';
89
+ }
90
+
91
+ /**
92
+ * Check if subscription is active.
93
+ *
94
+ * @author Vova Feldman (@svovaf)
95
+ * @since 1.0.9
96
+ *
97
+ * @return bool
98
+ */
99
+ function is_active() {
100
+ return ! empty( $this->next_payment ) &&
101
+ ( strtotime( $this->next_payment ) > WP_FS__SCRIPT_START_TIME );
102
+ }
103
+
104
+ /**
105
+ * Subscription considered to be new without any payments
106
+ * if the next payment should be made within less than 24 hours
107
+ * from the subscription creation.
108
+ *
109
+ * @author Vova Feldman (@svovaf)
110
+ * @since 1.0.9
111
+ *
112
+ * @return bool
113
+ */
114
+ function is_first_payment_pending() {
115
+ return ( WP_FS__TIME_24_HOURS_IN_SEC >= strtotime( $this->next_payment ) - strtotime( $this->created ) );
116
+ }
117
+
118
+ /**
119
+ * @author Vova Feldman (@svovaf)
120
+ * @since 1.1.7
121
+ */
122
+ function has_trial() {
123
+ return ! is_null( $this->trial_ends );
124
+ }
125
+ }
freemius/includes/entities/class-fs-user.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
+ * @since 1.0.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_User extends FS_Scope_Entity {
14
+
15
+ #region Properties
16
+
17
+ /**
18
+ * @var string
19
+ */
20
+ public $email;
21
+ /**
22
+ * @var string
23
+ */
24
+ public $first;
25
+ /**
26
+ * @var string
27
+ */
28
+ public $last;
29
+ /**
30
+ * @var bool
31
+ */
32
+ public $is_verified;
33
+ /**
34
+ * @var string|null
35
+ */
36
+ public $customer_id;
37
+ /**
38
+ * @var float
39
+ */
40
+ public $gross;
41
+
42
+ #endregion Properties
43
+
44
+ /**
45
+ * @param object|bool $user
46
+ */
47
+ function __construct( $user = false ) {
48
+ parent::__construct( $user );
49
+ }
50
+
51
+ function get_name() {
52
+ return trim( ucfirst( trim( is_string( $this->first ) ? $this->first : '' ) ) . ' ' . ucfirst( trim( is_string( $this->last ) ? $this->last : '' ) ) );
53
+ }
54
+
55
+ function is_verified() {
56
+ return ( isset( $this->is_verified ) && true === $this->is_verified );
57
+ }
58
+
59
+ static function get_type() {
60
+ return 'user';
61
+ }
62
+ }
freemius/includes/entities/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ // Silence is golden.
3
+ // Hide file structure from users on unprotected servers.
freemius/includes/fs-core-functions.php ADDED
@@ -0,0 +1,594 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
+ * @since 1.0.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ global $fs_core_logger;
14
+
15
+ $fs_core_logger = FS_Logger::get_logger( WP_FS__SLUG . '_core', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
16
+
17
+ if ( ! function_exists( 'fs_dummy' ) ) {
18
+ function fs_dummy() {
19
+ }
20
+ }
21
+
22
+ /* Url.
23
+ --------------------------------------------------------------------------------------------*/
24
+ function fs_get_url_daily_cache_killer() {
25
+ return date( '\YY\Mm\Dd' );
26
+ }
27
+
28
+ /* Templates / Views.
29
+ --------------------------------------------------------------------------------------------*/
30
+ if ( ! function_exists( 'fs_get_template_path' ) ) {
31
+ function fs_get_template_path( $path ) {
32
+ return WP_FS__DIR_TEMPLATES . '/' . trim( $path, '/' );
33
+ }
34
+
35
+ function fs_include_template( $path, &$params = null ) {
36
+ $VARS = &$params;
37
+ include fs_get_template_path( $path );
38
+ }
39
+
40
+ function fs_include_once_template( $path, &$params = null ) {
41
+ $VARS = &$params;
42
+ include_once fs_get_template_path( $path );
43
+ }
44
+
45
+ function fs_require_template( $path, &$params = null ) {
46
+ $VARS = &$params;
47
+ require fs_get_template_path( $path );
48
+ }
49
+
50
+ function fs_require_once_template( $path, &$params = null ) {
51
+ $VARS = &$params;
52
+ require_once fs_get_template_path( $path );
53
+ }
54
+
55
+ function fs_get_template( $path, &$params = null ) {
56
+ ob_start();
57
+
58
+ $VARS = &$params;
59
+ require fs_get_template_path( $path );
60
+
61
+ return ob_get_clean();
62
+ }
63
+ }
64
+
65
+ /* Scripts and styles including.
66
+ --------------------------------------------------------------------------------------------*/
67
+ function fs_enqueue_local_style( $handle, $path, $deps = array(), $ver = false, $media = 'all' ) {
68
+ global $fs_core_logger;
69
+ if ( $fs_core_logger->is_on() ) {
70
+ $fs_core_logger->info( 'handle = ' . $handle . '; path = ' . $path . ';' );
71
+ $fs_core_logger->info( 'plugin_basename = ' . plugins_url( WP_FS__DIR_CSS . trim( $path, '/' ) ) );
72
+ $fs_core_logger->info( 'plugins_url = ' . plugins_url( plugin_basename( WP_FS__DIR_CSS . '/' . trim( $path, '/' ) ) ) );
73
+ }
74
+
75
+ wp_enqueue_style( $handle, plugins_url( plugin_basename( WP_FS__DIR_CSS . '/' . trim( $path, '/' ) ) ), $deps, $ver, $media );
76
+ }
77
+
78
+ function fs_enqueue_local_script( $handle, $path, $deps = array(), $ver = false, $in_footer = 'all' ) {
79
+ global $fs_core_logger;
80
+ if ( $fs_core_logger->is_on() ) {
81
+ $fs_core_logger->info( 'handle = ' . $handle . '; path = ' . $path . ';' );
82
+ $fs_core_logger->info( 'plugin_basename = ' . plugins_url( WP_FS__DIR_JS . trim( $path, '/' ) ) );
83
+ $fs_core_logger->info( 'plugins_url = ' . plugins_url( plugin_basename( WP_FS__DIR_JS . '/' . trim( $path, '/' ) ) ) );
84
+ }
85
+
86
+ wp_enqueue_script( $handle, plugins_url( plugin_basename( WP_FS__DIR_JS . '/' . trim( $path, '/' ) ) ), $deps, $ver, $in_footer );
87
+ }
88
+
89
+ function fs_img_url( $path, $img_dir = WP_FS__DIR_IMG ) {
90
+ return plugins_url( plugin_basename( $img_dir . '/' . trim( $path, '/' ) ) );
91
+ }
92
+
93
+ /* Request handlers.
94
+ --------------------------------------------------------------------------------------------*/
95
+ /**
96
+ * @param string $key
97
+ * @param mixed $def
98
+ *
99
+ * @return mixed
100
+ */
101
+ function fs_request_get( $key, $def = false ) {
102
+ return isset( $_REQUEST[ $key ] ) ? $_REQUEST[ $key ] : $def;
103
+ }
104
+
105
+ function fs_request_has( $key ) {
106
+ return isset( $_REQUEST[ $key ] );
107
+ }
108
+
109
+ function fs_request_get_bool( $key, $def = false ) {
110
+ if ( ! isset( $_REQUEST[ $key ] ) ) {
111
+ return $def;
112
+ }
113
+
114
+ if ( 1 == $_REQUEST[ $key ] || 'true' === strtolower( $_REQUEST[ $key ] ) ) {
115
+ return true;
116
+ }
117
+
118
+ if ( 0 == $_REQUEST[ $key ] || 'false' === strtolower( $_REQUEST[ $key ] ) ) {
119
+ return false;
120
+ }
121
+
122
+ return $def;
123
+ }
124
+
125
+ function fs_request_is_post() {
126
+ return ( 'post' === strtolower( $_SERVER['REQUEST_METHOD'] ) );
127
+ }
128
+
129
+ function fs_request_is_get() {
130
+ return ( 'get' === strtolower( $_SERVER['REQUEST_METHOD'] ) );
131
+ }
132
+
133
+ function fs_get_action( $action_key = 'action' ) {
134
+ if ( ! empty( $_REQUEST[ $action_key ] ) ) {
135
+ return strtolower( $_REQUEST[ $action_key ] );
136
+ }
137
+
138
+ if ( 'action' == $action_key ) {
139
+ $action_key = 'fs_action';
140
+
141
+ if ( ! empty( $_REQUEST[ $action_key ] ) ) {
142
+ return strtolower( $_REQUEST[ $action_key ] );
143
+ }
144
+ }
145
+
146
+ return false;
147
+ }
148
+
149
+ function fs_request_is_action( $action, $action_key = 'action' ) {
150
+ return ( strtolower( $action ) === fs_get_action( $action_key ) );
151
+ }
152
+
153
+ /**
154
+ * @author Vova Feldman (@svovaf)
155
+ * @since 1.0.0
156
+ *
157
+ * @since 1.2.1.5 Allow nonce verification.
158
+ *
159
+ * @param string $action
160
+ * @param string $action_key
161
+ * @param string $nonce_key
162
+ *
163
+ * @return bool
164
+ */
165
+ function fs_request_is_action_secure(
166
+ $action,
167
+ $action_key = 'action',
168
+ $nonce_key = 'nonce'
169
+ ) {
170
+ if ( strtolower( $action ) !== fs_get_action( $action_key ) ) {
171
+ return false;
172
+ }
173
+
174
+ $nonce = ! empty( $_REQUEST[ $nonce_key ] ) ?
175
+ $_REQUEST[ $nonce_key ] :
176
+ '';
177
+
178
+ if ( empty( $nonce ) ||
179
+ ( false === wp_verify_nonce( $nonce, $action ) )
180
+ ) {
181
+ return false;
182
+ }
183
+
184
+ return true;
185
+ }
186
+
187
+ function fs_is_plugin_page( $menu_slug ) {
188
+ return ( is_admin() && $_REQUEST['page'] === $menu_slug );
189
+ }
190
+
191
+ /* Core UI.
192
+ --------------------------------------------------------------------------------------------*/
193
+ /**
194
+ * @param string $slug
195
+ * @param string $page
196
+ * @param string $action
197
+ * @param string $title
198
+ * @param array $params
199
+ * @param bool $is_primary
200
+ * @param string|bool $icon_class Optional class for an icon (since 1.1.7).
201
+ * @param string|bool $confirmation Optional confirmation message before submit (since 1.1.7).
202
+ * @param string $method Since 1.1.7
203
+ *
204
+ * @uses fs_ui_get_action_button()
205
+ */
206
+ function fs_ui_action_button(
207
+ $slug,
208
+ $page,
209
+ $action,
210
+ $title,
211
+ $params = array(),
212
+ $is_primary = true,
213
+ $icon_class = false,
214
+ $confirmation = false,
215
+ $method = 'GET'
216
+ ) {
217
+ echo fs_ui_get_action_button(
218
+ $slug,
219
+ $page,
220
+ $action,
221
+ $title,
222
+ $params,
223
+ $is_primary,
224
+ $icon_class,
225
+ $confirmation,
226
+ $method
227
+ );
228
+ }
229
+
230
+ /**
231
+ * @author Vova Feldman (@svovaf)
232
+ * @since 1.1.7
233
+ *
234
+ * @param string $slug
235
+ * @param string $page
236
+ * @param string $action
237
+ * @param string $title
238
+ * @param array $params
239
+ * @param bool $is_primary
240
+ * @param string|bool $icon_class Optional class for an icon.
241
+ * @param string|bool $confirmation Optional confirmation message before submit.
242
+ * @param string $method
243
+ *
244
+ * @return string
245
+ */
246
+ function fs_ui_get_action_button(
247
+ $slug,
248
+ $page,
249
+ $action,
250
+ $title,
251
+ $params = array(),
252
+ $is_primary = true,
253
+ $icon_class = false,
254
+ $confirmation = false,
255
+ $method = 'GET'
256
+ ) {
257
+ // Prepend icon (if set).
258
+ $title = ( is_string( $icon_class ) ? '<i class="' . $icon_class . '"></i> ' : '' ) . $title;
259
+
260
+ if ( is_string( $confirmation ) ) {
261
+ 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>',
262
+ freemius( $slug )->_get_admin_page_url( $page, $params ),
263
+ $method,
264
+ $action,
265
+ wp_nonce_field( $action, '_wpnonce', true, false ),
266
+ 'button' . ( $is_primary ? ' button-primary' : '' ),
267
+ $confirmation,
268
+ $title
269
+ );
270
+ } else if ( 'GET' !== strtoupper( $method ) ) {
271
+ 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>',
272
+ freemius( $slug )->_get_admin_page_url( $page, $params ),
273
+ $method,
274
+ $action,
275
+ wp_nonce_field( $action, '_wpnonce', true, false ),
276
+ 'button' . ( $is_primary ? ' button-primary' : '' ),
277
+ $title
278
+ );
279
+ } else {
280
+ return sprintf( '<a href="%s" class="%s">%s</a></form>',
281
+ wp_nonce_url( freemius( $slug )->_get_admin_page_url( $page, array_merge( $params, array( 'fs_action' => $action ) ) ), $action ),
282
+ 'button' . ( $is_primary ? ' button-primary' : '' ),
283
+ $title
284
+ );
285
+ }
286
+ }
287
+
288
+ function fs_ui_action_link( $slug, $page, $action, $title, $params = array() ) {
289
+ ?><a class=""
290
+ 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
291
+ }
292
+
293
+ /*function fs_error_handler($errno, $errstr, $errfile, $errline)
294
+ {
295
+ if (false === strpos($errfile, 'freemius/'))
296
+ {
297
+ // @todo Dump Freemius errors to local log.
298
+ }
299
+
300
+ // switch ($errno) {
301
+ // case E_USER_ERROR:
302
+ // break;
303
+ // case E_WARNING:
304
+ // case E_USER_WARNING:
305
+ // break;
306
+ // case E_NOTICE:
307
+ // case E_USER_NOTICE:
308
+ // break;
309
+ // default:
310
+ // break;
311
+ // }
312
+ }
313
+
314
+ set_error_handler('fs_error_handler');*/
315
+
316
+ if ( ! function_exists( 'fs_nonce_url' ) ) {
317
+ /**
318
+ * Retrieve URL with nonce added to URL query.
319
+ *
320
+ * Originally was using `wp_nonce_url()` but the new version
321
+ * changed the return value to escaped URL, that's not the expected
322
+ * behaviour.
323
+ *
324
+ * @author Vova Feldman (@svovaf)
325
+ * @since ~1.1.3
326
+ *
327
+ * @param string $actionurl URL to add nonce action.
328
+ * @param int|string $action Optional. Nonce action name. Default -1.
329
+ * @param string $name Optional. Nonce name. Default '_wpnonce'.
330
+ *
331
+ * @return string Escaped URL with nonce action added.
332
+ */
333
+ function fs_nonce_url( $actionurl, $action = - 1, $name = '_wpnonce' ) {
334
+ return add_query_arg( $name, wp_create_nonce( $action ), $actionurl );
335
+ }
336
+ }
337
+
338
+ if ( ! function_exists( 'fs_starts_with' ) ) {
339
+ /**
340
+ * Check if string starts with.
341
+ *
342
+ * @author Vova Feldman (@svovaf)
343
+ * @since 1.1.3
344
+ *
345
+ * @param string $haystack
346
+ * @param string $needle
347
+ *
348
+ * @return bool
349
+ */
350
+ function fs_starts_with( $haystack, $needle ) {
351
+ $length = strlen( $needle );
352
+
353
+ return ( substr( $haystack, 0, $length ) === $needle );
354
+ }
355
+ }
356
+
357
+ #region Url Canonization ------------------------------------------------------------------
358
+
359
+ if ( ! function_exists( 'fs_canonize_url' ) ) {
360
+ /**
361
+ * @author Vova Feldman (@svovaf)
362
+ * @since 1.1.3
363
+ *
364
+ * @param string $url
365
+ * @param bool $omit_host
366
+ * @param array $ignore_params
367
+ *
368
+ * @return string
369
+ */
370
+ function fs_canonize_url( $url, $omit_host = false, $ignore_params = array() ) {
371
+ $parsed_url = parse_url( strtolower( $url ) );
372
+
373
+ // if ( ! isset( $parsed_url['host'] ) ) {
374
+ // return $url;
375
+ // }
376
+
377
+ $canonical = ( ( $omit_host || ! isset( $parsed_url['host'] ) ) ? '' : $parsed_url['host'] ) . $parsed_url['path'];
378
+
379
+ if ( isset( $parsed_url['query'] ) ) {
380
+ parse_str( $parsed_url['query'], $queryString );
381
+ $canonical .= '?' . fs_canonize_query_string( $queryString, $ignore_params );
382
+ }
383
+
384
+ return $canonical;
385
+ }
386
+ }
387
+
388
+ if ( ! function_exists( 'fs_canonize_query_string' ) ) {
389
+ /**
390
+ * @author Vova Feldman (@svovaf)
391
+ * @since 1.1.3
392
+ *
393
+ * @param array $params
394
+ * @param array $ignore_params
395
+ * @param bool $params_prefix
396
+ *
397
+ * @return string
398
+ */
399
+ function fs_canonize_query_string( array $params, array &$ignore_params, $params_prefix = false ) {
400
+ if ( ! is_array( $params ) || 0 === count( $params ) ) {
401
+ return '';
402
+ }
403
+
404
+ // Url encode both keys and values
405
+ $keys = fs_urlencode_rfc3986( array_keys( $params ) );
406
+ $values = fs_urlencode_rfc3986( array_values( $params ) );
407
+ $params = array_combine( $keys, $values );
408
+
409
+ // Parameters are sorted by name, using lexicographical byte value ordering.
410
+ // Ref: Spec: 9.1.1 (1)
411
+ uksort( $params, 'strcmp' );
412
+
413
+ $pairs = array();
414
+ foreach ( $params as $parameter => $value ) {
415
+ $lower_param = strtolower( $parameter );
416
+
417
+ // Skip ignore params.
418
+ if ( in_array( $lower_param, $ignore_params ) ||
419
+ ( false !== $params_prefix && fs_starts_with( $lower_param, $params_prefix ) )
420
+ ) {
421
+ continue;
422
+ }
423
+
424
+ if ( is_array( $value ) ) {
425
+ // If two or more parameters share the same name, they are sorted by their value
426
+ // Ref: Spec: 9.1.1 (1)
427
+ natsort( $value );
428
+ foreach ( $value as $duplicate_value ) {
429
+ $pairs[] = $lower_param . '=' . $duplicate_value;
430
+ }
431
+ } else {
432
+ $pairs[] = $lower_param . '=' . $value;
433
+ }
434
+ }
435
+
436
+ if ( 0 === count( $pairs ) ) {
437
+ return '';
438
+ }
439
+
440
+ return implode( "&", $pairs );
441
+ }
442
+ }
443
+
444
+ if ( ! function_exists( 'fs_urlencode_rfc3986' ) ) {
445
+ /**
446
+ * @author Vova Feldman (@svovaf)
447
+ * @since 1.1.3
448
+ *
449
+ * @param string|string[] $input
450
+ *
451
+ * @return array|mixed|string
452
+ */
453
+ function fs_urlencode_rfc3986( $input ) {
454
+ if ( is_array( $input ) ) {
455
+ return array_map( 'fs_urlencode_rfc3986', $input );
456
+ } else if ( is_scalar( $input ) ) {
457
+ return str_replace( '+', ' ', str_replace( '%7E', '~', rawurlencode( $input ) ) );
458
+ }
459
+
460
+ return '';
461
+ }
462
+ }
463
+
464
+ #endregion Url Canonization ------------------------------------------------------------------
465
+
466
+ function fs_download_image( $from, $to ) {
467
+ $ch = curl_init( $from );
468
+ $fp = fopen( fs_normalize_path( $to ), 'wb' );
469
+ curl_setopt( $ch, CURLOPT_FILE, $fp );
470
+ curl_setopt( $ch, CURLOPT_HEADER, 0 );
471
+ curl_exec( $ch );
472
+ curl_close( $ch );
473
+ fclose( $fp );
474
+ }
475
+
476
+ /* General Utilities
477
+ --------------------------------------------------------------------------------------------*/
478
+
479
+ /**
480
+ * Sorts an array by the value of the priority key.
481
+ *
482
+ * @author Daniel Iser (@danieliser)
483
+ * @since 1.1.7
484
+ *
485
+ * @param $a
486
+ * @param $b
487
+ *
488
+ * @return int
489
+ */
490
+ function fs_sort_by_priority( $a, $b ) {
491
+
492
+ // If b has a priority and a does not, b wins.
493
+ if ( ! isset( $a['priority'] ) && isset( $b['priority'] ) ) {
494
+ return 1;
495
+ } // If b has a priority and a does not, b wins.
496
+ elseif ( isset( $a['priority'] ) && ! isset( $b['priority'] ) ) {
497
+ return - 1;
498
+ } // If neither has a priority or both priorities are equal its a tie.
499
+ elseif ( ( ! isset( $a['priority'] ) && ! isset( $b['priority'] ) ) || $a['priority'] === $b['priority'] ) {
500
+ return 0;
501
+ }
502
+
503
+ // If both have priority return the winner.
504
+ return ( $a['priority'] < $b['priority'] ) ? - 1 : 1;
505
+ }
506
+
507
+ #--------------------------------------------------------------------------------
508
+ #region Localization
509
+ #--------------------------------------------------------------------------------
510
+
511
+ /**
512
+ * @author Vova Feldman
513
+ * @since 1.2.1.6
514
+ *
515
+ * @param string $key
516
+ * @param string $slug
517
+ *
518
+ * @return string
519
+ */
520
+ function fs_esc_attr($key, $slug) {
521
+ return esc_attr( __fs( $key, $slug ) );
522
+ }
523
+
524
+ /**
525
+ * @author Vova Feldman
526
+ * @since 1.2.1.6
527
+ *
528
+ * @param string $key
529
+ * @param string $slug
530
+ */
531
+ function fs_esc_attr_echo($key, $slug) {
532
+ echo esc_attr( __fs( $key, $slug ) );
533
+ }
534
+
535
+ /**
536
+ * @author Vova Feldman
537
+ * @since 1.2.1.6
538
+ *
539
+ * @param string $key
540
+ * @param string $slug
541
+ *
542
+ * @return string
543
+ */
544
+ function fs_esc_js($key, $slug) {
545
+ return esc_js( __fs( $key, $slug ) );
546
+ }
547
+
548
+ /**
549
+ * @author Vova Feldman
550
+ * @since 1.2.1.6
551
+ *
552
+ * @param string $key
553
+ * @param string $slug
554
+ */
555
+ function fs_esc_js_echo($key, $slug) {
556
+ echo esc_js( __fs( $key, $slug ) );
557
+ }
558
+
559
+ /**
560
+ * @author Vova Feldman
561
+ * @since 1.2.1.6
562
+ *
563
+ * @param string $key
564
+ * @param string $slug
565
+ */
566
+ function fs_json_encode_echo($key, $slug) {
567
+ echo json_encode( __fs( $key, $slug ) );
568
+ }
569
+
570
+ /**
571
+ * @author Vova Feldman
572
+ * @since 1.2.1.6
573
+ *
574
+ * @param string $key
575
+ * @param string $slug
576
+ *
577
+ * @return string
578
+ */
579
+ function fs_esc_html($key, $slug) {
580
+ return esc_html( __fs( $key, $slug ) );
581
+ }
582
+
583
+ /**
584
+ * @author Vova Feldman
585
+ * @since 1.2.1.6
586
+ *
587
+ * @param string $key
588
+ * @param string $slug
589
+ */
590
+ function fs_esc_html_echo($key, $slug) {
591
+ echo esc_html( __fs( $key, $slug ) );
592
+ }
593
+
594
+ #endregion
freemius/includes/fs-essential-functions.php ADDED
@@ -0,0 +1,445 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
9
+ if ( ! function_exists( 'fs_normalize_path' ) ) {
10
+ if ( function_exists( 'wp_normalize_path' ) ) {
11
+ /**
12
+ * Normalize a filesystem path.
13
+ *
14
+ * Replaces backslashes with forward slashes for Windows systems, and ensures
15
+ * no duplicate slashes exist.
16
+ *
17
+ * @param string $path Path to normalize.
18
+ *
19
+ * @return string Normalized path.
20
+ */
21
+ function fs_normalize_path( $path ) {
22
+ return wp_normalize_path( $path );
23
+ }
24
+ } else {
25
+ function fs_normalize_path( $path ) {
26
+ $path = str_replace( '\\', '/', $path );
27
+ $path = preg_replace( '|/+|', '/', $path );
28
+
29
+ return $path;
30
+ }
31
+ }
32
+ }
33
+
34
+ #region Core Redirect (copied from BuddyPress) -----------------------------------------
35
+
36
+ if ( ! function_exists( 'fs_redirect' ) ) {
37
+ /**
38
+ * Redirects to another page, with a workaround for the IIS Set-Cookie bug.
39
+ *
40
+ * @link http://support.microsoft.com/kb/q176113/
41
+ * @since 1.5.1
42
+ * @uses apply_filters() Calls 'wp_redirect' hook on $location and $status.
43
+ *
44
+ * @param string $location The path to redirect to.
45
+ * @param bool $exit If true, exit after redirect (Since 1.2.1.5).
46
+ * @param int $status Status code to use.
47
+ *
48
+ * @return bool False if $location is not set
49
+ */
50
+ function fs_redirect( $location, $exit = true, $status = 302 ) {
51
+ global $is_IIS;
52
+
53
+ $file = '';
54
+ $line = '';
55
+ if ( headers_sent($file, $line) ) {
56
+ if ( WP_FS__DEBUG_SDK && class_exists( 'FS_Admin_Notice_Manager' ) ) {
57
+ $notices = FS_Admin_Notice_Manager::instance( 'global' );
58
+
59
+ $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' );
60
+ }
61
+
62
+ return false;
63
+ }
64
+
65
+ if ( defined( 'DOING_AJAX' ) ) {
66
+ // Don't redirect on AJAX calls.
67
+ return false;
68
+ }
69
+
70
+ if ( ! $location ) // allows the wp_redirect filter to cancel a redirect
71
+ {
72
+ return false;
73
+ }
74
+
75
+ $location = fs_sanitize_redirect( $location );
76
+
77
+ if ( $is_IIS ) {
78
+ header( "Refresh: 0;url=$location" );
79
+ } else {
80
+ if ( php_sapi_name() != 'cgi-fcgi' ) {
81
+ status_header( $status );
82
+ } // This causes problems on IIS and some FastCGI setups
83
+ header( "Location: $location" );
84
+ }
85
+
86
+ if ( $exit ) {
87
+ exit();
88
+ }
89
+
90
+ return true;
91
+ }
92
+
93
+ if ( ! function_exists( 'fs_sanitize_redirect' ) ) {
94
+ /**
95
+ * Sanitizes a URL for use in a redirect.
96
+ *
97
+ * @since 2.3
98
+ *
99
+ * @param string $location
100
+ *
101
+ * @return string redirect-sanitized URL
102
+ */
103
+ function fs_sanitize_redirect( $location ) {
104
+ $location = preg_replace( '|[^a-z0-9-~+_.?#=&;,/:%!]|i', '', $location );
105
+ $location = fs_kses_no_null( $location );
106
+
107
+ // remove %0d and %0a from location
108
+ $strip = array( '%0d', '%0a' );
109
+ $found = true;
110
+ while ( $found ) {
111
+ $found = false;
112
+ foreach ( (array) $strip as $val ) {
113
+ while ( strpos( $location, $val ) !== false ) {
114
+ $found = true;
115
+ $location = str_replace( $val, '', $location );
116
+ }
117
+ }
118
+ }
119
+
120
+ return $location;
121
+ }
122
+ }
123
+
124
+ if ( ! function_exists( 'fs_kses_no_null' ) ) {
125
+ /**
126
+ * Removes any NULL characters in $string.
127
+ *
128
+ * @since 1.0.0
129
+ *
130
+ * @param string $string
131
+ *
132
+ * @return string
133
+ */
134
+ function fs_kses_no_null( $string ) {
135
+ $string = preg_replace( '/\0+/', '', $string );
136
+ $string = preg_replace( '/(\\\\0)+/', '', $string );
137
+
138
+ return $string;
139
+ }
140
+ }
141
+ }
142
+
143
+ #endregion Core Redirect (copied from BuddyPress) -----------------------------------------
144
+
145
+ if ( ! function_exists( '__fs' ) ) {
146
+ global $fs_text_overrides;
147
+
148
+ if ( ! isset( $fs_text_overrides ) ) {
149
+ $fs_text_overrides = array();
150
+ }
151
+
152
+ /**
153
+ * Retrieve a translated text by key.
154
+ *
155
+ * @author Vova Feldman (@svovaf)
156
+ * @since 1.1.4
157
+ *
158
+ * @param string $key
159
+ * @param string $slug
160
+ *
161
+ * @return string
162
+ *
163
+ * @global $fs_text , $fs_text_overrides
164
+ */
165
+ function __fs( $key, $slug = 'freemius' ) {
166
+ global $fs_text,
167
+ $fs_module_info_text,
168
+ $fs_text_overrides;
169
+
170
+ if ( isset( $fs_text_overrides[ $slug ] ) ) {
171
+ if ( isset( $fs_text_overrides[ $slug ][ $key ] ) ) {
172
+ return $fs_text_overrides[ $slug ][ $key ];
173
+ }
174
+
175
+ $lower_key = strtolower( $key );
176
+ if ( isset( $fs_text_overrides[ $slug ][ $lower_key ] ) ) {
177
+ return $fs_text_overrides[ $slug ][ $lower_key ];
178
+ }
179
+ }
180
+
181
+ if ( ! isset( $fs_text ) ) {
182
+ $dir = defined( 'WP_FS__DIR_INCLUDES' ) ?
183
+ WP_FS__DIR_INCLUDES :
184
+ dirname( __FILE__ );
185
+
186
+ require_once $dir . '/i18n.php';
187
+ }
188
+
189
+ if ( isset( $fs_text[ $key ] ) ) {
190
+ return $fs_text[ $key ];
191
+ }
192
+
193
+ if ( isset( $fs_module_info_text[ $key ] ) ) {
194
+ return $fs_module_info_text[ $key ];
195
+ }
196
+
197
+ return $key;
198
+ }
199
+
200
+ /**
201
+ * Display a translated text by key.
202
+ *
203
+ * @author Vova Feldman (@svovaf)
204
+ * @since 1.1.4
205
+ *
206
+ * @param string $key
207
+ * @param string $slug
208
+ */
209
+ function _efs( $key, $slug = 'freemius' ) {
210
+ echo __fs( $key, $slug );
211
+ }
212
+
213
+ /**
214
+ * Override default i18n text phrases.
215
+ *
216
+ * @author Vova Feldman (@svovaf)
217
+ * @since 1.1.6
218
+ *
219
+ * @param string[] $key_value
220
+ * @param string $slug
221
+ *
222
+ * @global $fs_text_overrides
223
+ */
224
+ function fs_override_i18n( array $key_value, $slug = 'freemius' ) {
225
+ global $fs_text_overrides;
226
+
227
+ if ( ! isset( $fs_text_overrides[ $slug ] ) ) {
228
+ $fs_text_overrides[ $slug ] = array();
229
+ }
230
+
231
+ foreach ( $key_value as $key => $value ) {
232
+ $fs_text_overrides[ $slug ][ $key ] = $value;
233
+ }
234
+ }
235
+ }
236
+
237
+ if ( ! function_exists( 'fs_get_ip' ) ) {
238
+ /**
239
+ * Get client IP.
240
+ *
241
+ * @author Vova Feldman (@svovaf)
242
+ * @since 1.1.2
243
+ *
244
+ * @return string|null
245
+ */
246
+ function fs_get_ip() {
247
+ $fields = array(
248
+ 'HTTP_CF_CONNECTING_IP',
249
+ 'HTTP_CLIENT_IP',
250
+ 'HTTP_X_FORWARDED_FOR',
251
+ 'HTTP_X_FORWARDED',
252
+ 'HTTP_FORWARDED_FOR',
253
+ 'HTTP_FORWARDED',
254
+ 'REMOTE_ADDR',
255
+ );
256
+
257
+ foreach ( $fields as $ip_field ) {
258
+ if ( ! empty( $_SERVER[ $ip_field ] ) ) {
259
+ return $_SERVER[ $ip_field ];
260
+ }
261
+ }
262
+
263
+ return null;
264
+ }
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 ( in_array( fs_normalize_path( $bt[ $i ]['file'] ), $all_plugins_paths ) ) {
296
+ $plugin_file = $bt[ $i ]['file'];
297
+ break;
298
+ }
299
+ }
300
+
301
+ if ( is_null( $plugin_file ) ) {
302
+ // Throw an error to the developer in case of some edge case dev environment.
303
+ wp_die( __fs( 'failed-finding-main-path' ), __fs( 'error' ), array( 'back_link' => true ) );
304
+ }
305
+
306
+ return $plugin_file;
307
+ }
308
+
309
+ require_once dirname( __FILE__ ) . '/supplements/fs-essential-functions-1.1.7.1.php';
310
+
311
+ /**
312
+ * Update SDK newest version reference.
313
+ *
314
+ * @author Vova Feldman (@svovaf)
315
+ * @since 1.1.6
316
+ *
317
+ * @param string $sdk_relative_path
318
+ * @param string|bool $plugin_file
319
+ *
320
+ * @global $fs_active_plugins
321
+ */
322
+ function fs_update_sdk_newest_version( $sdk_relative_path, $plugin_file = false ) {
323
+ global $fs_active_plugins;
324
+
325
+ if ( ! is_string( $plugin_file ) ) {
326
+ $plugin_file = plugin_basename( fs_find_caller_plugin_file() );
327
+ }
328
+
329
+ $fs_active_plugins->newest = (object) array(
330
+ 'plugin_path' => $plugin_file,
331
+ 'sdk_path' => $sdk_relative_path,
332
+ 'version' => $fs_active_plugins->plugins[ $sdk_relative_path ]->version,
333
+ 'in_activation' => ! is_plugin_active( $plugin_file ),
334
+ 'timestamp' => time(),
335
+ );
336
+
337
+ // Update DB with latest SDK version and path.
338
+ update_option( 'fs_active_plugins', $fs_active_plugins );
339
+ }
340
+
341
+ /**
342
+ * Reorder the plugins load order so the plugin with the newest Freemius SDK is loaded first.
343
+ *
344
+ * @author Vova Feldman (@svovaf)
345
+ * @since 1.1.6
346
+ *
347
+ * @return bool Was plugin order changed. Return false if plugin was loaded first anyways.
348
+ *
349
+ * @global $fs_active_plugins
350
+ */
351
+ function fs_newest_sdk_plugin_first() {
352
+ global $fs_active_plugins;
353
+
354
+ /**
355
+ * @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).
356
+ *
357
+ * @link https://github.com/Freemius/wordpress-sdk/issues/26
358
+ */
359
+ // $active_sitewide_plugins = get_site_option( 'active_sitewide_plugins' );
360
+
361
+ $active_plugins = get_option( 'active_plugins' );
362
+ $newest_sdk_plugin_key = array_search( $fs_active_plugins->newest->plugin_path, $active_plugins );
363
+ if ( 0 == $newest_sdk_plugin_key ) {
364
+ // if it's 0 it's the first plugin already, no need to continue
365
+ return false;
366
+ }
367
+
368
+ array_splice( $active_plugins, $newest_sdk_plugin_key, 1 );
369
+ array_unshift( $active_plugins, $fs_active_plugins->newest->plugin_path );
370
+ update_option( 'active_plugins', $active_plugins );
371
+
372
+ return true;
373
+ }
374
+
375
+ /**
376
+ * Go over all Freemius SDKs in the system and find and "remember"
377
+ * the newest SDK which is associated with an active plugin.
378
+ *
379
+ * @author Vova Feldman (@svovaf)
380
+ * @since 1.1.6
381
+ *
382
+ * @global $fs_active_plugins
383
+ */
384
+ function fs_fallback_to_newest_active_sdk() {
385
+ global $fs_active_plugins;
386
+
387
+ /**
388
+ * @var object $newest_sdk_data
389
+ */
390
+ $newest_sdk_data = null;
391
+ $newest_sdk_path = null;
392
+
393
+ foreach ( $fs_active_plugins->plugins as $sdk_relative_path => $data ) {
394
+ if ( is_null( $newest_sdk_data ) || version_compare( $data->version, $newest_sdk_data->version, '>' )
395
+ ) {
396
+ // If plugin inactive or SDK starter file doesn't exist, remove SDK reference.
397
+ if ( ! is_plugin_active( $data->plugin_path ) ||
398
+ ! file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $sdk_relative_path . '/start.php' ) )
399
+ ) {
400
+ unset( $fs_active_plugins->plugins[ $sdk_relative_path ] );
401
+
402
+ // No need to store the data since it will be stored in fs_update_sdk_newest_version()
403
+ // or explicitly with update_option().
404
+ } else {
405
+ $newest_sdk_data = $data;
406
+ $newest_sdk_path = $sdk_relative_path;
407
+ }
408
+ }
409
+ }
410
+
411
+ if ( is_null( $newest_sdk_data ) ) {
412
+ // Couldn't find any SDK reference.
413
+ $fs_active_plugins = new stdClass();
414
+ update_option( 'fs_active_plugins', $fs_active_plugins );
415
+ } else {
416
+ fs_update_sdk_newest_version( $newest_sdk_path, $newest_sdk_data->plugin_path );
417
+ }
418
+ }
419
+
420
+ #region Actions / Filters -----------------------------------------
421
+
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}" ),
441
+ array_slice( $args, 2 ) )
442
+ );
443
+ }
444
+
445
+ #endregion Actions / Filters -----------------------------------------
freemius/includes/fs-plugin-info-dialog.php ADDED
@@ -0,0 +1,942 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Class FS_Plugin_Info_Dialog
15
+ *
16
+ * @author Vova Feldman (@svovaf)
17
+ * @since 1.1.7
18
+ */
19
+ class FS_Plugin_Info_Dialog {
20
+ /**
21
+ * @since 1.1.7
22
+ *
23
+ * @var FS_Logger
24
+ */
25
+ private $_logger;
26
+
27
+ /**
28
+ * @since 1.1.7
29
+ *
30
+ * @var Freemius
31
+ */
32
+ private $_fs;
33
+
34
+ function __construct( Freemius $fs ) {
35
+ $this->_fs = $fs;
36
+
37
+ $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $fs->get_slug() . '_info', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
38
+
39
+ // Remove default plugin information action.
40
+ remove_all_actions( 'install_plugins_pre_plugin-information' );
41
+
42
+ // Override action with custom plugins function for add-ons.
43
+ add_action( 'install_plugins_pre_plugin-information', array( &$this, 'install_plugin_information' ) );
44
+
45
+ // Override request for plugin information for Add-ons.
46
+ add_filter(
47
+ 'fs_plugins_api',
48
+ array( &$this, '_get_addon_info_filter' ),
49
+ WP_FS__DEFAULT_PRIORITY, 3 );
50
+ }
51
+
52
+ /**
53
+ * Generate add-on plugin information.
54
+ *
55
+ * @author Vova Feldman (@svovaf)
56
+ * @since 1.0.6
57
+ *
58
+ * @param array $data
59
+ * @param string $action
60
+ * @param object|null $args
61
+ *
62
+ * @return array|null
63
+ */
64
+ function _get_addon_info_filter( $data, $action = '', $args = null ) {
65
+ $this->_logger->entrance();
66
+
67
+ $parent_plugin_id = fs_request_get( 'parent_plugin_id', false );
68
+
69
+ if ( $this->_fs->get_id() != $parent_plugin_id ||
70
+ ( 'plugin_information' !== $action ) ||
71
+ ! isset( $args->slug )
72
+ ) {
73
+ return $data;
74
+ }
75
+
76
+ // Find add-on by slug.
77
+ $selected_addon = $this->_fs->get_addon_by_slug($args->slug, WP_FS__DEV_MODE);
78
+
79
+ if ( false === $selected_addon ) {
80
+ return $data;
81
+ }
82
+
83
+ if ( ! isset( $selected_addon->info ) ) {
84
+ // Setup some default info.
85
+ $selected_addon->info = new stdClass();
86
+ $selected_addon->info->selling_point_0 = 'Selling Point 1';
87
+ $selected_addon->info->selling_point_1 = 'Selling Point 2';
88
+ $selected_addon->info->selling_point_2 = 'Selling Point 3';
89
+ $selected_addon->info->description = '<p>Tell your users all about your add-on</p>';
90
+ }
91
+
92
+ fs_enqueue_local_style( 'fs_addons', '/admin/add-ons.css' );
93
+
94
+ $data = $args;
95
+
96
+ $is_free = true;
97
+
98
+ // Load add-on pricing.
99
+ $has_pricing = false;
100
+ $has_features = false;
101
+ $plans = false;
102
+ $plans_result = $this->_fs->get_api_site_or_plugin_scope()->get( "/addons/{$selected_addon->id}/plans.json?type=visible" );
103
+ if ( ! isset( $plans_result->error ) ) {
104
+ $plans = $plans_result->plans;
105
+ if ( is_array( $plans ) ) {
106
+ for ( $i = 0, $len = count( $plans ); $i < $len; $i ++ ) {
107
+ $plans[ $i ] = new FS_Plugin_Plan( $plans[ $i ] );
108
+ $plan = $plans[ $i ];
109
+
110
+ $pricing_result = $this->_fs->get_api_site_or_plugin_scope()->get( "/addons/{$selected_addon->id}/plans/{$plan->id}/pricing.json" );
111
+ if ( ! isset( $pricing_result->error ) ) {
112
+ // Update plan's pricing.
113
+ $plan->pricing = $pricing_result->pricing;
114
+
115
+ if ( is_array( $plan->pricing ) && ! empty( $plan->pricing ) ) {
116
+ $is_free = false;
117
+
118
+ foreach ( $plan->pricing as &$pricing ) {
119
+ $pricing = new FS_Pricing( $pricing );
120
+ }
121
+ }
122
+
123
+ $has_pricing = true;
124
+ }
125
+
126
+ $features_result = $this->_fs->get_api_site_or_plugin_scope()->get( "/addons/{$selected_addon->id}/plans/{$plan->id}/features.json" );
127
+ if ( ! isset( $features_result->error ) &&
128
+ is_array( $features_result->features ) &&
129
+ 0 < count( $features_result->features )
130
+ ) {
131
+ // Update plan's pricing.
132
+ $plan->features = $features_result->features;
133
+
134
+ $has_features = true;
135
+ }
136
+ }
137
+ }
138
+ }
139
+
140
+ // Fetch latest version from Freemius.
141
+ $latest = $this->_fs->_fetch_latest_version( $selected_addon->id );
142
+
143
+ if ( ! $is_free ) {
144
+ // If paid add-on, then it's not on wordpress.org
145
+ $is_wordpress_org = false;
146
+ } else {
147
+ // If no versions found, then assume it's a .org plugin.
148
+ $is_wordpress_org = ( false === $latest );
149
+ }
150
+
151
+ if ( $is_wordpress_org ) {
152
+ $repo_data = FS_Plugin_Updater::_fetch_plugin_info_from_repository(
153
+ 'plugin_information', (object) array(
154
+ 'slug' => $selected_addon->slug,
155
+ 'is_ssl' => is_ssl(),
156
+ 'fields' => array(
157
+ 'banners' => true,
158
+ 'reviews' => true,
159
+ 'downloaded' => false,
160
+ 'active_installs' => true
161
+ )
162
+ ) );
163
+
164
+ if ( ! empty( $repo_data ) ) {
165
+ $data = $repo_data;
166
+ $data->wp_org_missing = false;
167
+ } else {
168
+ // Couldn't find plugin on .org.
169
+ $is_wordpress_org = false;
170
+
171
+ // Plugin is missing, not on Freemius nor WP.org.
172
+ $data->wp_org_missing = true;
173
+ }
174
+ }
175
+
176
+ if ( ! $is_wordpress_org ) {
177
+ $data->checkout_link = $this->_fs->checkout_url();
178
+ $data->fs_missing = ( false === $latest );
179
+
180
+ if ( $is_free ) {
181
+ $data->download_link = $this->_fs->_get_latest_download_local_url( $selected_addon->id );
182
+ }
183
+ }
184
+
185
+ if ( ! $is_wordpress_org ) {
186
+ // Fetch as much as possible info from local files.
187
+ $plugin_local_data = $this->_fs->get_plugin_data();
188
+ $data->name = $selected_addon->title;
189
+ $data->author = $plugin_local_data['Author'];
190
+ $view_vars = array( 'plugin' => $selected_addon );
191
+ $data->sections = array(
192
+ 'description' => fs_get_template( '/plugin-info/description.php', $view_vars ),
193
+ );
194
+
195
+ if ( ! empty( $selected_addon->info->banner_url ) ) {
196
+ $data->banners = array(
197
+ 'low' => $selected_addon->info->banner_url,
198
+ );
199
+ }
200
+
201
+ if ( ! empty( $selected_addon->info->screenshots ) ) {
202
+ $view_vars = array(
203
+ 'screenshots' => $selected_addon->info->screenshots,
204
+ 'plugin' => $selected_addon,
205
+ );
206
+ $data->sections['screenshots'] = fs_get_template( '/plugin-info/screenshots.php', $view_vars );
207
+ }
208
+
209
+ if ( is_object( $latest ) ) {
210
+ $data->version = $latest->version;
211
+ $data->last_updated = ! is_null( $latest->updated ) ? $latest->updated : $latest->created;
212
+ $data->requires = $latest->requires_platform_version;
213
+ $data->tested = $latest->tested_up_to_version;
214
+ } else {
215
+ // Add dummy version.
216
+ $data->version = '1.0.0';
217
+
218
+ // Add message to developer to deploy the plugin through Freemius.
219
+ }
220
+ }
221
+
222
+ if ( $has_pricing ) {
223
+ // Add plans to data.
224
+ $data->plans = $plans;
225
+
226
+ if ( $has_features ) {
227
+ $view_vars = array(
228
+ 'plans' => $plans,
229
+ 'plugin' => $selected_addon,
230
+ );
231
+ $data->sections['features'] = fs_get_template( '/plugin-info/features.php', $view_vars );
232
+ }
233
+ }
234
+
235
+ $data->is_paid = ! $is_free;
236
+ $data->external = ! $is_wordpress_org;
237
+
238
+ return $data;
239
+ }
240
+
241
+ /**
242
+ * @author Vova Feldman (@svovaf)
243
+ * @since 1.1.7
244
+ *
245
+ * @param FS_Plugin_Plan $plan
246
+ *
247
+ * @return string
248
+ */
249
+ private function get_billing_cycle( FS_Plugin_Plan $plan ) {
250
+ $billing_cycle = null;
251
+
252
+ if ( 1 === count( $plan->pricing ) && 1 == $plan->pricing[0]->licenses ) {
253
+ $pricing = $plan->pricing[0];
254
+ if ( isset( $pricing->annual_price ) ) {
255
+ $billing_cycle = 'annual';
256
+ } else if ( isset( $pricing->monthly_price ) ) {
257
+ $billing_cycle = 'monthly';
258
+ } else if ( isset( $pricing->lifetime_price ) ) {
259
+ $billing_cycle = 'lifetime';
260
+ }
261
+ } else {
262
+ foreach ( $plan->pricing as $pricing ) {
263
+ if ( isset( $pricing->annual_price ) ) {
264
+ $billing_cycle = 'annual';
265
+ } else if ( isset( $pricing->monthly_price ) ) {
266
+ $billing_cycle = 'monthly';
267
+ } else if ( isset( $pricing->lifetime_price ) ) {
268
+ $billing_cycle = 'lifetime';
269
+ }
270
+
271
+ if ( ! is_null( $billing_cycle ) ) {
272
+ break;
273
+ }
274
+ }
275
+ }
276
+
277
+ return $billing_cycle;
278
+ }
279
+
280
+ /**
281
+ * @author Vova Feldman (@svovaf)
282
+ * @since 1.1.7
283
+ *
284
+ * @param FS_Plugin_Plan $plan
285
+ * @param FS_Pricing $pricing
286
+ *
287
+ * @return float|null|string
288
+ */
289
+ private function get_price_tag( FS_Plugin_Plan $plan, FS_Pricing $pricing ) {
290
+ $price_tag = '';
291
+ if ( isset( $pricing->annual_price ) ) {
292
+ $price_tag = $pricing->annual_price . ( $plan->is_block_features ? ' / year' : '' );
293
+ } else if ( isset( $pricing->monthly_price ) ) {
294
+ $price_tag = $pricing->monthly_price . ' / mo';
295
+ } else if ( isset( $pricing->lifetime_price ) ) {
296
+ $price_tag = $pricing->lifetime_price;
297
+ }
298
+
299
+ return '$' . $price_tag;
300
+ }
301
+
302
+ /**
303
+ * @author Vova Feldman (@svovaf)
304
+ * @since 1.1.7
305
+ *
306
+ * @param object $api
307
+ * @param FS_Plugin_Plan|null $plan
308
+ *
309
+ * @return string
310
+ */
311
+ private function get_plugin_cta( $api, $plan = null ) {
312
+ if ( ( current_user_can( 'install_plugins' ) || current_user_can( 'update_plugins' ) ) ) {
313
+
314
+ if ( ! empty( $api->checkout_link ) && isset( $api->plans ) && 0 < is_array( $api->plans ) ) {
315
+ if ( is_null( $plan ) ) {
316
+ $plan = $api->plans[0];
317
+ }
318
+
319
+ return ' <a class="button button-primary right" href="' . $this->_fs->addon_checkout_url(
320
+ $plan->plugin_id,
321
+ $plan->pricing[0]->id,
322
+ $this->get_billing_cycle( $plan ),
323
+ $plan->has_trial()
324
+ ) . '" target="_parent">' .
325
+ ( ! $plan->has_trial() ?
326
+ __fs( 'purchase', $api->slug ) :
327
+ sprintf( __fs( 'start-free-x', $api->slug ), $this->get_trial_period( $plan ) )
328
+ ) .
329
+ '</a>';
330
+
331
+ // @todo Add Cart concept.
332
+ // echo ' <a class="button right" href="' . $status['url'] . '" target="_parent">' . __( 'Add to Cart' ) . '</a>';
333
+
334
+ } else if ( ! empty( $api->download_link ) ) {
335
+ $status = install_plugin_install_status( $api );
336
+
337
+ // Hosted on WordPress.org.
338
+ switch ( $status['status'] ) {
339
+ case 'install':
340
+ if ( $api->external &&
341
+ $this->_fs->is_org_repo_compliant() ||
342
+ ! $this->_fs->is_premium()
343
+ ) {
344
+ /**
345
+ * Add-on hosted on Freemius, not yet installed, and core
346
+ * plugin is wordpress.org compliant. Therefore, require a download
347
+ * since installing external plugins is not allowed by the wp.org guidelines.
348
+ */
349
+ return ' <a class="button button-primary right" href="' . esc_url( $api->download_link ) . '" target="_blank">' . __fs( 'download-latest', $api->slug ) . '</a>';
350
+ } else {
351
+ if ( $status['url'] ) {
352
+ return '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __fs( 'install-now', $api->slug ) . '</a>';
353
+ }
354
+ }
355
+ break;
356
+ case 'update_available':
357
+ if ( $status['url'] ) {
358
+ return '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __fs( 'install-update-now', $api->slug ) . '</a>';
359
+ }
360
+ break;
361
+ case 'newer_installed':
362
+ return '<a class="button button-primary right disabled">' . sprintf( __fs( 'newer-installed', $api->slug ), $status['version'] ) . '</a>';
363
+ break;
364
+ case 'latest_installed':
365
+ return '<a class="button button-primary right disabled">' . __fs( 'latest-installed', $api->slug ) . '</a>';
366
+ break;
367
+ }
368
+
369
+ }
370
+ }
371
+
372
+ return '';
373
+ }
374
+
375
+ /**
376
+ * @author Vova Feldman (@svovaf)
377
+ * @since 1.1.7
378
+ *
379
+ * @param FS_Plugin_Plan $plan
380
+ *
381
+ * @return string
382
+ */
383
+ private function get_trial_period( $plan ) {
384
+ $trial_period = (int) $plan->trial_period;
385
+
386
+ switch ( $trial_period ) {
387
+ case 30:
388
+ return 'month';
389
+ case 60:
390
+ return '2 months';
391
+ default:
392
+ return "{$plan->trial_period} days";
393
+ }
394
+ }
395
+
396
+ /**
397
+ * Display plugin information in dialog box form.
398
+ *
399
+ * Based on core install_plugin_information() function.
400
+ *
401
+ * @author Vova Feldman (@svovaf)
402
+ * @since 1.0.6
403
+ */
404
+ function install_plugin_information() {
405
+ global $tab;
406
+
407
+ if ( empty( $_REQUEST['plugin'] ) ) {
408
+ return;
409
+ }
410
+
411
+ $args = array(
412
+ 'slug' => wp_unslash( $_REQUEST['plugin'] ),
413
+ 'is_ssl' => is_ssl(),
414
+ 'fields' => array(
415
+ 'banners' => true,
416
+ 'reviews' => true,
417
+ 'downloaded' => false,
418
+ 'active_installs' => true
419
+ )
420
+ );
421
+
422
+ if ( is_array( $args ) ) {
423
+ $args = (object) $args;
424
+ }
425
+
426
+ if ( ! isset( $args->per_page ) ) {
427
+ $args->per_page = 24;
428
+ }
429
+
430
+ if ( ! isset( $args->locale ) ) {
431
+ $args->locale = get_locale();
432
+ }
433
+
434
+ $api = apply_filters( 'fs_plugins_api', false, 'plugin_information', $args );
435
+
436
+ if ( is_wp_error( $api ) ) {
437
+ wp_die( $api );
438
+ }
439
+
440
+ $plugins_allowedtags = array(
441
+ 'a' => array(
442
+ 'href' => array(),
443
+ 'title' => array(),
444
+ 'target' => array(),
445
+ // Add image style for screenshots.
446
+ 'class' => array()
447
+ ),
448
+ 'style' => array(),
449
+ 'abbr' => array( 'title' => array() ),
450
+ 'acronym' => array( 'title' => array() ),
451
+ 'code' => array(),
452
+ 'pre' => array(),
453
+ 'em' => array(),
454
+ 'strong' => array(),
455
+ 'div' => array( 'class' => array() ),
456
+ 'span' => array( 'class' => array() ),
457
+ 'p' => array(),
458
+ 'ul' => array(),
459
+ 'ol' => array(),
460
+ 'li' => array( 'class' => array() ),
461
+ 'i' => array( 'class' => array() ),
462
+ 'h1' => array(),
463
+ 'h2' => array(),
464
+ 'h3' => array(),
465
+ 'h4' => array(),
466
+ 'h5' => array(),
467
+ 'h6' => array(),
468
+ 'img' => array( 'src' => array(), 'class' => array(), 'alt' => array() ),
469
+ // 'table' => array(),
470
+ // 'td' => array(),
471
+ // 'tr' => array(),
472
+ // 'th' => array(),
473
+ // 'thead' => array(),
474
+ // 'tbody' => array(),
475
+ );
476
+
477
+ $plugins_section_titles = array(
478
+ 'description' => __fs( 'description', $api->slug ),
479
+ 'installation' => __fs( 'installation', $api->slug ),
480
+ 'faq' => __fs( 'faq', $api->slug ),
481
+ 'screenshots' => __fs( 'screenshots', $api->slug ),
482
+ 'changelog' => __fs( 'changelog', $api->slug ),
483
+ 'reviews' => __fs( 'reviews', $api->slug ),
484
+ 'other_notes' => __fs( 'other_notes', $api->slug ),
485
+ );
486
+
487
+ // Sanitize HTML
488
+ // foreach ( (array) $api->sections as $section_name => $content ) {
489
+ // $api->sections[$section_name] = wp_kses( $content, $plugins_allowedtags );
490
+ // }
491
+
492
+ foreach ( array( 'version', 'author', 'requires', 'tested', 'homepage', 'downloaded', 'slug' ) as $key ) {
493
+ if ( isset( $api->$key ) ) {
494
+ $api->$key = wp_kses( $api->$key, $plugins_allowedtags );
495
+ }
496
+ }
497
+
498
+ // Add after $api->slug is ready.
499
+ $plugins_section_titles['features'] = __fs( 'features-and-pricing', $api->slug );
500
+
501
+ $_tab = esc_attr( $tab );
502
+
503
+ $section = isset( $_REQUEST['section'] ) ? wp_unslash( $_REQUEST['section'] ) : 'description'; // Default to the Description tab, Do not translate, API returns English.
504
+ if ( empty( $section ) || ! isset( $api->sections[ $section ] ) ) {
505
+ $section_titles = array_keys( (array) $api->sections );
506
+ $section = array_shift( $section_titles );
507
+ }
508
+
509
+ iframe_header( __fs( 'plugin-install', $api->slug ) );
510
+
511
+ $_with_banner = '';
512
+
513
+ // var_dump($api->banners);
514
+ if ( ! empty( $api->banners ) && ( ! empty( $api->banners['low'] ) || ! empty( $api->banners['high'] ) ) ) {
515
+ $_with_banner = 'with-banner';
516
+ $low = empty( $api->banners['low'] ) ? $api->banners['high'] : $api->banners['low'];
517
+ $high = empty( $api->banners['high'] ) ? $api->banners['low'] : $api->banners['high'];
518
+ ?>
519
+ <style type="text/css">
520
+ #plugin-information-title.with-banner
521
+ {
522
+ background-image: url( <?php echo esc_url( $low ); ?> );
523
+ }
524
+
525
+ @media only screen and ( -webkit-min-device-pixel-ratio: 1.5 )
526
+ {
527
+ #plugin-information-title.with-banner
528
+ {
529
+ background-image: url( <?php echo esc_url( $high ); ?> );
530
+ }
531
+ }
532
+ </style>
533
+ <?php
534
+ }
535
+
536
+ echo '<div id="plugin-information-scrollable">';
537
+ echo "<div id='{$_tab}-title' class='{$_with_banner}'><div class='vignette'></div><h2>{$api->name}</h2></div>";
538
+ echo "<div id='{$_tab}-tabs' class='{$_with_banner}'>\n";
539
+
540
+ foreach ( (array) $api->sections as $section_name => $content ) {
541
+ if ( 'reviews' === $section_name && ( empty( $api->ratings ) || 0 === array_sum( (array) $api->ratings ) ) ) {
542
+ continue;
543
+ }
544
+
545
+ if ( isset( $plugins_section_titles[ $section_name ] ) ) {
546
+ $title = $plugins_section_titles[ $section_name ];
547
+ } else {
548
+ $title = ucwords( str_replace( '_', ' ', $section_name ) );
549
+ }
550
+
551
+ $class = ( $section_name === $section ) ? ' class="current"' : '';
552
+ $href = add_query_arg( array( 'tab' => $tab, 'section' => $section_name ) );
553
+ $href = esc_url( $href );
554
+ $san_section = esc_attr( $section_name );
555
+ echo "\t<a name='$san_section' href='$href' $class>$title</a>\n";
556
+ }
557
+
558
+ echo "</div>\n";
559
+
560
+ ?>
561
+ <div id="<?php echo $_tab; ?>-content" class='<?php echo $_with_banner; ?>'>
562
+ <div class="fyi">
563
+ <?php if ( $api->is_paid ) : ?>
564
+ <?php if ( isset( $api->plans ) ) : ?>
565
+ <div class="plugin-information-pricing">
566
+ <?php foreach ( $api->plans as $plan ) : ?>
567
+ <?php
568
+ /**
569
+ * @var FS_Plugin_Plan $plan
570
+ */
571
+ ?>
572
+ <?php $first_pricing = $plan->pricing[0] ?>
573
+ <?php $is_multi_cycle = $first_pricing->is_multi_cycle() ?>
574
+ <div class="fs-plan<?php if ( ! $is_multi_cycle ) {
575
+ echo ' fs-single-cycle';
576
+ } ?>" data-plan-id="<?php echo $plan->id ?>">
577
+ <h3 data-plan="<?php echo $plan->id ?>"><?php printf( __fs( 'x-plan', $api->slug ), $plan->title ) ?></h3>
578
+ <?php $has_annual = $first_pricing->has_annual() ?>
579
+ <?php $has_monthly = $first_pricing->has_monthly() ?>
580
+ <div class="nav-tab-wrapper">
581
+ <?php $billing_cycles = array( 'monthly', 'annual', 'lifetime' ) ?>
582
+ <?php $i = 0;
583
+ foreach ( $billing_cycles as $cycle ) : ?>
584
+ <?php $prop = "{$cycle}_price";
585
+ if ( isset( $first_pricing->{$prop} ) ) : ?>
586
+ <?php $is_featured = ( 'annual' === $cycle && $is_multi_cycle ) ?>
587
+ <?php
588
+ $prices = array();
589
+ foreach ( $plan->pricing as $pricing ) {
590
+ if ( isset( $pricing->{$prop} ) ) {
591
+ $prices[] = array(
592
+ 'id' => $pricing->id,
593
+ 'licenses' => $pricing->licenses,
594
+ 'price' => $pricing->{$prop}
595
+ );
596
+ }
597
+ }
598
+ ?>
599
+ <a class="nav-tab" data-billing-cycle="<?php echo $cycle ?>"
600
+ data-pricing="<?php echo esc_attr( json_encode( $prices ) ) ?>">
601
+ <?php if ( $is_featured ) : ?>
602
+ <label>&#9733; <?php _efs( 'best', $api->slug ) ?> &#9733;</label>
603
+ <?php endif ?>
604
+ <?php _efs( $cycle, $api->slug ) ?>
605
+ </a>
606
+ <?php endif ?>
607
+ <?php $i ++; endforeach ?>
608
+ <?php wp_enqueue_script( 'jquery' ) ?>
609
+ <script type="text/javascript">
610
+ (function ($, undef) {
611
+ var
612
+ _formatBillingFrequency = function (cycle) {
613
+ switch (cycle) {
614
+ case 'monthly':
615
+ return '<?php printf(__fs('billed-x', $api->slug), __fs('monthly', $api->slug)) ?>';
616
+ case 'annual':
617
+ return '<?php printf(__fs('billed-x', $api->slug), __fs('annually', $api->slug)) ?>';
618
+ case 'lifetime':
619
+ return '<?php printf(__fs('billed-x', $api->slug), __fs('once', $api->slug)) ?>';
620
+ }
621
+ },
622
+ _formatLicensesTitle = function (pricing) {
623
+ switch (pricing.licenses) {
624
+ case 1:
625
+ return '<?php _efs( 'license-single-site', $api->slug ) ?>';
626
+ case null:
627
+ return '<?php _efs( 'license-unlimited', $api->slug ) ?>';
628
+ default:
629
+ return '<?php _efs( 'license-x-sites', $api->slug ) ?>'.replace('%s', pricing.licenses);
630
+ }
631
+ },
632
+ _formatPrice = function (pricing, cycle, multipleLicenses) {
633
+ if (undef === multipleLicenses)
634
+ multipleLicenses = true;
635
+
636
+ var priceCycle;
637
+ switch (cycle) {
638
+ case 'monthly':
639
+ priceCycle = ' / <?php _efs('mo', $api->slug) ?>';
640
+ break;
641
+ case 'lifetime':
642
+ priceCycle = '';
643
+ break;
644
+ case 'annual':
645
+ default:
646
+ priceCycle = ' / <?php _efs('year', $api->slug) ?>';
647
+ break;
648
+ }
649
+
650
+ if (!multipleLicenses && 1 == pricing.licenses) {
651
+ return '$' + pricing.price + priceCycle;
652
+ }
653
+
654
+ return _formatLicensesTitle(pricing) + ' - <var class="fs-price">$' + pricing.price + priceCycle + '</var>';
655
+ },
656
+ _checkoutUrl = function (plan, pricing, cycle) {
657
+ return '<?php echo esc_url_raw(remove_query_arg('billing_cycle', add_query_arg(array('plugin_id' => $plan->plugin_id), $api->checkout_link))) ?>' +
658
+ '&plan_id=' + plan +
659
+ '&pricing_id=' + pricing +
660
+ '&billing_cycle=' + cycle<?php if ($plan->has_trial()) { echo " + '&trial=true'"; }?>;
661
+ },
662
+ _updateCtaUrl = function (plan, pricing, cycle) {
663
+ $('.plugin-information-pricing .button, #plugin-information-footer .button').attr('href', _checkoutUrl(plan, pricing, cycle));
664
+ };
665
+
666
+ $(document).ready(function () {
667
+ var $plan = $('.plugin-information-pricing .fs-plan[data-plan-id=<?php echo $plan->id ?>]');
668
+ $plan.find('input[type=radio]').live('click', function () {
669
+ _updateCtaUrl(
670
+ $plan.attr('data-plan-id'),
671
+ $(this).val(),
672
+ $plan.find('.nav-tab-active').attr('data-billing-cycle')
673
+ );
674
+
675
+ $plan.find('.fs-trial-terms .fs-price').html(
676
+ $(this).parents('label').find('.fs-price').html()
677
+ );
678
+ });
679
+
680
+ $plan.find('.nav-tab').click(function () {
681
+ if ($(this).hasClass('nav-tab-active'))
682
+ return;
683
+
684
+ var $this = $(this),
685
+ billingCycle = $this.attr('data-billing-cycle'),
686
+ pricing = JSON.parse($this.attr('data-pricing')),
687
+ $pricesList = $this.parents('.fs-plan').find('.fs-pricing-body .fs-licenses'),
688
+ html = '';
689
+
690
+ // Un-select previously selected tab.
691
+ $plan.find('.nav-tab').removeClass('nav-tab-active');
692
+
693
+ // Select current tab.
694
+ $this.addClass('nav-tab-active');
695
+
696
+ // Render licenses prices.
697
+ if (1 == pricing.length) {
698
+ html = '<li><label><?php _efs( 'price', $api->slug ) ?>: ' + _formatPrice(pricing[0], billingCycle, false) + '</label></li>';
699
+ } else {
700
+ for (var i = 0; i < pricing.length; i++) {
701
+ html += '<li><label><input name="pricing-<?php echo $plan->id ?>" type="radio" value="' + pricing[i].id + '">' + _formatPrice(pricing[i], billingCycle) + '</label></li>';
702
+ }
703
+ }
704
+ $pricesList.html(html);
705
+
706
+ if (1 < pricing.length) {
707
+ // Select first license option.
708
+ $pricesList.find('li:first input').click();
709
+ }
710
+ else {
711
+ _updateCtaUrl(
712
+ $plan.attr('data-plan-id'),
713
+ pricing[0].id,
714
+ billingCycle
715
+ );
716
+ }
717
+
718
+ // Update billing frequency.
719
+ $plan.find('.fs-billing-frequency').html(_formatBillingFrequency(billingCycle));
720
+
721
+ if ('annual' === billingCycle) {
722
+ $plan.find('.fs-annual-discount').show();
723
+ } else {
724
+ $plan.find('.fs-annual-discount').hide();
725
+ }
726
+ });
727
+
728
+ <?php if ( $has_annual ) : ?>
729
+ // Select annual by default.
730
+ $plan.find('.nav-tab[data-billing-cycle=annual]').click();
731
+ <?php else : ?>
732
+ // Select first tab.
733
+ $plan.find('.nav-tab:first').click();
734
+ <?php endif ?>
735
+ });
736
+ }(jQuery));
737
+ </script>
738
+ </div>
739
+ <div class="fs-pricing-body">
740
+ <span class="fs-billing-frequency"></span>
741
+ <?php $annual_discount = ( $has_annual && $has_monthly ) ? $plan->pricing[0]->annual_discount_percentage() : 0 ?>
742
+ <?php if ( $annual_discount > 0 ) : ?>
743
+ <span
744
+ class="fs-annual-discount"><?php printf( __fs( 'save-x', $api->slug ), $annual_discount . '%' ) ?></span>
745
+ <?php endif ?>
746
+ <ul class="fs-licenses">
747
+ </ul>
748
+ <?php echo $this->get_plugin_cta( $api, $plan ) ?>
749
+ <div style="clear:both"></div>
750
+ <?php if ( $plan->has_trial() ) : ?>
751
+ <?php $trial_period = $this->get_trial_period( $plan ) ?>
752
+ <ul class="fs-trial-terms">
753
+ <li>
754
+ <i class="dashicons dashicons-yes"></i><?php printf( __fs( 'no-commitment-x', $api->slug ), $trial_period ) ?>
755
+ </li>
756
+ <li>
757
+ <i class="dashicons dashicons-yes"></i><?php printf( __fs( 'after-x-pay-as-little-y', $api->slug ), $trial_period, '<var class="fs-price">' . $this->get_price_tag( $plan, $plan->pricing[0] ) . '</var>' ) ?>
758
+ </li>
759
+ </ul>
760
+ <?php endif ?>
761
+ </div>
762
+ </div>
763
+ </div>
764
+ <?php endforeach ?>
765
+ <?php endif ?>
766
+ <?php endif ?>
767
+ <div>
768
+ <h3><?php _efs( 'details', $api->slug ) ?></h3>
769
+ <ul>
770
+ <?php if ( ! empty( $api->version ) ) { ?>
771
+ <li><strong><?php _efs( 'version', $api->slug ); ?>:</strong> <?php echo $api->version; ?></li>
772
+ <?php
773
+ }
774
+ if ( ! empty( $api->author ) ) {
775
+ ?>
776
+ <li>
777
+ <strong><?php _efs( 'author:', $api->slug ); ?></strong> <?php echo links_add_target( $api->author, '_blank' ); ?>
778
+ </li>
779
+ <?php
780
+ }
781
+ if ( ! empty( $api->last_updated ) ) {
782
+ ?>
783
+ <li><strong><?php _efs( 'last-updated:', $api->slug ); ?></strong> <span
784
+ title="<?php echo $api->last_updated; ?>">
785
+ <?php printf( __fs( 'x-ago', $api->slug ), human_time_diff( strtotime( $api->last_updated ) ) ); ?>
786
+ </span></li>
787
+ <?php
788
+ }
789
+ if ( ! empty( $api->requires ) ) {
790
+ ?>
791
+ <li>
792
+ <strong><?php _efs( 'requires-wordpress-version:', $api->slug ); ?></strong> <?php printf( __fs( 'x-or-higher', $api->slug ), $api->requires ); ?>
793
+ </li>
794
+ <?php
795
+ }
796
+ if ( ! empty( $api->tested ) ) {
797
+ ?>
798
+ <li><strong><?php _efs( 'compatible-up-to:', $api->slug ); ?></strong> <?php echo $api->tested; ?>
799
+ </li>
800
+ <?php
801
+ }
802
+ if ( ! empty( $api->downloaded ) ) {
803
+ ?>
804
+ <li>
805
+ <strong><?php _efs( 'downloaded:', $api->slug ); ?></strong> <?php printf(
806
+ __fs( ( 1 == $api->downloaded ) ? 'x-time' : 'x-times', $api->slug ),
807
+ number_format_i18n( $api->downloaded )
808
+ ); ?>
809
+ </li>
810
+ <?php
811
+ }
812
+ if ( ! empty( $api->slug ) && empty( $api->external ) ) {
813
+ ?>
814
+ <li><a target="_blank"
815
+ href="https://wordpress.org/plugins/<?php echo $api->slug; ?>/"><?php _efs( 'wp-org-plugin-page', $api->slug ); ?> &#187;</a>
816
+ </li>
817
+ <?php
818
+ }
819
+ if ( ! empty( $api->homepage ) ) {
820
+ ?>
821
+ <li><a target="_blank"
822
+ href="<?php echo esc_url( $api->homepage ); ?>"><?php _efs( 'plugin-homepage', $api->slug ); ?> &#187;</a>
823
+ </li>
824
+ <?php
825
+ }
826
+ if ( ! empty( $api->donate_link ) && empty( $api->contributors ) ) {
827
+ ?>
828
+ <li><a target="_blank"
829
+ href="<?php echo esc_url( $api->donate_link ); ?>"><?php _efs( 'donate-to-plugin', $api->slug ); ?> &#187;</a>
830
+ </li>
831
+ <?php } ?>
832
+ </ul>
833
+ </div>
834
+ <?php if ( ! empty( $api->rating ) ) { ?>
835
+ <h3><?php _efs( 'average-rating', $api->slug ); ?></h3>
836
+ <?php wp_star_rating( array(
837
+ 'rating' => $api->rating,
838
+ 'type' => 'percent',
839
+ 'number' => $api->num_ratings
840
+ ) ); ?>
841
+ <small>(<?php printf(
842
+ __fs( 'based-on-x', $api->slug ),
843
+ sprintf(
844
+ __fs( ( 1 == $api->num_ratings ) ? 'x-rating' : 'x-ratings', $api->slug ),
845
+ number_format_i18n( $api->num_ratings )
846
+ ) ); ?>)</small>
847
+ <?php
848
+ }
849
+
850
+ if ( ! empty( $api->ratings ) && array_sum( (array) $api->ratings ) > 0 ) {
851
+ foreach ( $api->ratings as $key => $ratecount ) {
852
+ // Avoid div-by-zero.
853
+ $_rating = $api->num_ratings ? ( $ratecount / $api->num_ratings ) : 0;
854
+ $stars_label = sprintf(
855
+ __fs( ( 1 == $key ) ? 'x-star' : 'x-stars', $api->slug ),
856
+ number_format_i18n( $key )
857
+ );
858
+ ?>
859
+ <div class="counter-container">
860
+ <span class="counter-label"><a
861
+ href="https://wordpress.org/support/view/plugin-reviews/<?php echo $api->slug; ?>?filter=<?php echo $key; ?>"
862
+ target="_blank"
863
+ title="<?php echo esc_attr( sprintf( __fs('click-to-reviews', $api->slug), $stars_label) ) ?>"><?php echo $stars_label ?></a></span>
864
+ <span class="counter-back">
865
+ <span class="counter-bar" style="width: <?php echo 92 * $_rating; ?>px;"></span>
866
+ </span>
867
+ <span class="counter-count"><?php echo number_format_i18n( $ratecount ); ?></span>
868
+ </div>
869
+ <?php
870
+ }
871
+ }
872
+ if ( ! empty( $api->contributors ) ) {
873
+ ?>
874
+ <h3><?php _efs( 'contributors', $api->slug ); ?></h3>
875
+ <ul class="contributors">
876
+ <?php
877
+ foreach ( (array) $api->contributors as $contrib_username => $contrib_profile ) {
878
+ if ( empty( $contrib_username ) && empty( $contrib_profile ) ) {
879
+ continue;
880
+ }
881
+ if ( empty( $contrib_username ) ) {
882
+ $contrib_username = preg_replace( '/^.+\/(.+)\/?$/', '\1', $contrib_profile );
883
+ }
884
+ $contrib_username = sanitize_user( $contrib_username );
885
+ if ( empty( $contrib_profile ) ) {
886
+ echo "<li><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&amp;s=36' width='18' height='18' />{$contrib_username}</li>";
887
+ } else {
888
+ 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>";
889
+ }
890
+ }
891
+ ?>
892
+ </ul>
893
+ <?php if ( ! empty( $api->donate_link ) ) { ?>
894
+ <a target="_blank"
895
+ href="<?php echo esc_url( $api->donate_link ); ?>"><?php _efs( 'donate-to-plugin', $api->slug ) ?> &#187;</a>
896
+ <?php } ?>
897
+ <?php } ?>
898
+ </div>
899
+ <div id="section-holder" class="wrap">
900
+ <?php
901
+ if ( ! empty( $api->tested ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->tested ) ), $api->tested, '>' ) ) {
902
+ echo '<div class="notice notice-warning"><p>' . '<strong>' . __fs( 'warning:', $api->slug ) . '</strong> ' . __fs( 'not-tested-warning', $api->slug ) . '</p></div>';
903
+ } else if ( ! empty( $api->requires ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->requires ) ), $api->requires, '<' ) ) {
904
+ echo '<div class="notice notice-warning"><p>' . '<strong>' . __fs( 'warning:', $api->slug ) . '</strong> ' . __fs( 'not-compatible-warning', $api->slug ) . '</p></div>';
905
+ }
906
+
907
+ foreach ( (array) $api->sections as $section_name => $content ) {
908
+ $content = links_add_base_url( $content, 'https://wordpress.org/plugins/' . $api->slug . '/' );
909
+ $content = links_add_target( $content, '_blank' );
910
+
911
+ $san_section = esc_attr( $section_name );
912
+
913
+ $display = ( $section_name === $section ) ? 'block' : 'none';
914
+
915
+ if ( 'description' === $section_name &&
916
+ ( ( ! $api->external && $api->wp_org_missing ) ||
917
+ ( $api->external && $api->fs_missing ) )
918
+ ) {
919
+ $missing_notice = array(
920
+ 'type' => 'error',
921
+ 'id' => md5( microtime() ),
922
+ 'message' => __fs( ( $api->is_paid ? 'paid-addon-not-deployed' : 'free-addon-not-deployed' ), $api->slug ),
923
+ );
924
+ fs_require_template( 'admin-notice.php', $missing_notice );
925
+ }
926
+ echo "\t<div id='section-{$san_section}' class='section' style='display: {$display};'>\n";
927
+ echo $content;
928
+ echo "\t</div>\n";
929
+ }
930
+ echo "</div>\n";
931
+ echo "</div>\n";
932
+ echo "</div>\n"; // #plugin-information-scrollable
933
+ echo "<div id='$tab-footer'>\n";
934
+
935
+ echo $this->get_plugin_cta( $api );
936
+
937
+ echo "</div>\n";
938
+
939
+ iframe_footer();
940
+ exit;
941
+ }
942
+ }
freemius/includes/i18n.php ADDED
@@ -0,0 +1,518 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
+ * @since 1.1.4
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ require_once dirname( __FILE__ ) . '/l10n.php';
14
+
15
+ /**
16
+ * All strings can now be overridden.
17
+ *
18
+ * For example, if we want to override:
19
+ * 'you-are-step-away' => 'You are just one step away - %s',
20
+ *
21
+ * We can use the filter:
22
+ * fs_override_i18n( array(
23
+ * 'opt-in-connect' => __( "Yes - I'm in!", '{your-text_domain}' ),
24
+ * 'skip' => __( 'Not today', '{your-text_domain}' ),
25
+ * ), '{plugin_slug}' );
26
+ *
27
+ * Or with the Freemius instance:
28
+ *
29
+ * my_freemius->override_i18n( array(
30
+ * 'opt-in-connect' => __( "Yes - I'm in!", '{your-text_domain}' ),
31
+ * 'skip' => __( 'Not today', '{your-text_domain}' ),
32
+ * );
33
+ */
34
+ global $fs_text;
35
+
36
+ $fs_text = array(
37
+ 'account' => _fs_text( 'Account' ),
38
+ 'addon' => _fs_text( 'Add On' ),
39
+ 'contact-us' => _fs_text( 'Contact Us' ),
40
+ 'contact-support' => _fs_text( 'Contact Support' ),
41
+ 'change-ownership' => _fs_text( 'Change Ownership' ),
42
+ 'support' => _fs_text( 'Support' ),
43
+ 'support-forum' => _fs_text( 'Support Forum' ),
44
+ 'add-ons' => _fs_text( 'Add Ons' ),
45
+ 'upgrade' => _fs_x( 'Upgrade', 'verb' ),
46
+ 'awesome' => _fs_text( 'Awesome' ),
47
+ 'pricing' => _fs_x( 'Pricing', 'noun' ),
48
+ 'price' => _fs_x( 'Price', 'noun' ),
49
+ 'unlimited-updates' => _fs_text( 'Unlimited Updates' ),
50
+ 'downgrade' => _fs_x( 'Downgrade', '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',
92
+ '%s - plugin name. As complete "Jetpack" activation now' ),
93
+ 'few-plugin-tweaks' => _fs_text( 'We made a few tweaks to the plugin, %s' ),
94
+ 'optin-x-now' => _fs_text( 'Opt-in to make "%s" Better!' ),
95
+ 'error' => _fs_text( 'Error' ),
96
+ '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.' ),
97
+ #region Account
98
+
99
+ 'expiration' => _fs_x( 'Expiration', 'as expiration date' ),
100
+ 'license' => _fs_x( 'License', 'as software license' ),
101
+ 'not-verified' => _fs_text( 'not verified' ),
102
+ 'verify-email' => _fs_text( 'Verify Email' ),
103
+ 'expires-in' => _fs_x( 'Expires in %s', 'e.g. expires in 2 months' ),
104
+ 'renews-in' => _fs_x( 'Auto renews in %s', 'e.g. auto renews in 2 months' ),
105
+ 'no-expiration' => _fs_text( 'No expiration' ),
106
+ 'expired' => _fs_text( 'Expired' ),
107
+ 'cancelled' => _fs_text( 'Cancelled' ),
108
+ 'in-x' => _fs_x( 'In %s', 'e.g. In 2 hours' ),
109
+ 'x-ago' => _fs_x( '%s ago', 'e.g. 2 min ago' ),
110
+ /* translators: %s: Version number (e.g. 4.6 or higher) */
111
+ 'x-or-higher' => _fs_text( '%s or higher' ),
112
+ 'version' => _fs_x( 'Version', 'as plugin version' ),
113
+ 'name' => _fs_text( 'Name' ),
114
+ 'email' => _fs_text( 'Email' ),
115
+ 'email-address' => _fs_text( 'Email address' ),
116
+ 'verified' => _fs_text( 'Verified' ),
117
+ 'module' => _fs_text( 'Module' ),
118
+ 'module-type' => _fs_text( 'Module Type' ),
119
+ 'plugin' => _fs_text( 'Plugin' ),
120
+ 'plugins' => _fs_text( 'Plugins' ),
121
+ 'theme' => _fs_text( 'Theme' ),
122
+ 'themes' => _fs_text( 'Themes' ),
123
+ 'path' => _fs_x( 'Path', 'as file/folder path' ),
124
+ 'title' => _fs_text( 'Title' ),
125
+ 'free-version' => _fs_text( 'Free version' ),
126
+ 'premium-version' => _fs_text( 'Premium version' ),
127
+ 'slug' => _fs_x( 'Slug', 'as WP plugin slug' ),
128
+ 'id' => _fs_text( 'ID' ),
129
+ 'users' => _fs_text( 'Users' ),
130
+ 'plugin-installs' => _fs_text( 'Plugin Installs' ),
131
+ 'module-installs' => _fs_text( '%s Installs' ),
132
+ 'sites' => _fs_x( 'Sites', 'like websites' ),
133
+ 'user-id' => _fs_text( 'User ID' ),
134
+ 'site-id' => _fs_text( 'Site ID' ),
135
+ 'public-key' => _fs_text( 'Public Key' ),
136
+ 'secret-key' => _fs_text( 'Secret Key' ),
137
+ 'no-secret' => _fs_x( 'No Secret', 'as secret encryption key missing' ),
138
+ 'no-id' => _fs_text( 'No ID' ),
139
+ 'sync-license' => _fs_x( 'Sync License', 'as synchronize license' ),
140
+ 'sync' => _fs_x( 'Sync', 'as synchronize' ),
141
+ 'activate-license' => _fs_text( 'Activate License' ),
142
+ 'activate-free-version' => _fs_text( 'Activate Free Version' ),
143
+ 'activate-license-message' => _fs_text( 'Please enter the license key that you received in the email right after the purchase:' ),
144
+ 'activating-license' => _fs_text( 'Activating license...' ),
145
+ 'change-license' => _fs_text( 'Change License' ),
146
+ 'update-license' => _fs_text( 'Update License' ),
147
+ 'deactivate-license' => _fs_text( 'Deactivate License' ),
148
+ 'activate' => _fs_text( 'Activate' ),
149
+ 'deactivate' => _fs_text( 'Deactivate' ),
150
+ 'skip-deactivate' => _fs_text( 'Skip & Deactivate' ),
151
+ 'skip-and-x' => _fs_text( 'Skip & %s' ),
152
+ 'no-deactivate' => _fs_text( 'No - just deactivate' ),
153
+ 'yes-do-your-thing' => _fs_text( 'Yes - do your thing' ),
154
+ 'active' => _fs_x( 'Active', 'active mode' ),
155
+ 'is-active' => _fs_x( 'Is Active', 'is active mode?' ),
156
+ 'install-now' => _fs_text( 'Install Now' ),
157
+ 'install-update-now' => _fs_text( 'Install Update Now' ),
158
+ 'more-information-about-x' => _fs_text( 'More information about %s' ),
159
+ 'localhost' => _fs_text( 'Localhost' ),
160
+ 'activate-x-plan' => _fs_x( 'Activate %s Plan', 'as activate Professional plan' ),
161
+ 'x-left' => _fs_x( '%s left', 'as 5 licenses left' ),
162
+ 'last-license' => _fs_text( 'Last license' ),
163
+ 'what-is-your-x' => _fs_text( 'What is your %s?' ),
164
+ 'activate-this-addon' => _fs_text( 'Activate this add-on' ),
165
+ '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?' ),
166
+ '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?' ),
167
+ '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?' ),
168
+ 'downgrade-x-confirm' => _fs_text( 'Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s.' ),
169
+ 'cancel-trial-confirm' => _fs_text( 'Cancelling the trial will immediately block access to all premium features. Are you sure?' ),
170
+ 'after-downgrade-non-blocking' => _fs_text( 'You can still enjoy all %s features but you will not have access to plugin updates and support.' ),
171
+ '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.' ),
172
+ 'proceed-confirmation' => _fs_text( 'Are you sure you want to proceed?' ),
173
+ #endregion Account
174
+
175
+ 'add-ons-for-x' => _fs_text( 'Add Ons for %s' ),
176
+ '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.' ),
177
+ #region Plugin Deactivation
178
+ 'anonymous-feedback' => _fs_text( 'Anonymous feedback' ),
179
+ 'quick-feedback' => _fs_text( 'Quick feedback' ),
180
+ 'deactivation-share-reason' => _fs_text( 'If you have a moment, please let us know why you are deactivating' ),
181
+ 'deactivation-modal-button-confirm' => _fs_text( 'Yes - Deactivate' ),
182
+ 'deactivation-modal-button-submit' => _fs_text( 'Submit & Deactivate' ),
183
+ 'cancel' => _fs_text( 'Cancel' ),
184
+ 'reason-no-longer-needed' => _fs_text( 'I no longer need the plugin' ),
185
+ 'reason-found-a-better-plugin' => _fs_text( 'I found a better plugin' ),
186
+ 'reason-needed-for-a-short-period' => _fs_text( 'I only needed the plugin for a short period' ),
187
+ 'reason-broke-my-site' => _fs_text( 'The plugin broke my site' ),
188
+ 'reason-suddenly-stopped-working' => _fs_text( 'The plugin suddenly stopped working' ),
189
+ 'reason-cant-pay-anymore' => _fs_text( "I can't pay for it anymore" ),
190
+ 'reason-temporary-deactivation' => _fs_text( "It's a temporary deactivation. I'm just debugging an issue." ),
191
+ 'reason-other' => _fs_x( 'Other',
192
+ 'the text of the "other" reason for deactivating the plugin that is shown in the modal box.' ),
193
+ 'ask-for-reason-message' => _fs_text( 'Kindly tell us the reason so we can improve.' ),
194
+ 'placeholder-plugin-name' => _fs_text( "What's the plugin's name?" ),
195
+ 'placeholder-comfortable-price' => _fs_text( 'What price would you feel comfortable paying?' ),
196
+ 'reason-couldnt-make-it-work' => _fs_text( "I couldn't understand how to make it work" ),
197
+ 'reason-great-but-need-specific-feature' => _fs_text( "The plugin is great, but I need specific feature that you don't support" ),
198
+ 'reason-not-working' => _fs_text( 'The plugin is not working' ),
199
+ 'reason-not-what-i-was-looking-for' => _fs_text( "It's not what I was looking for" ),
200
+ 'reason-didnt-work-as-expected' => _fs_text( "The plugin didn't work as expected" ),
201
+ 'placeholder-feature' => _fs_text( 'What feature?' ),
202
+ 'placeholder-share-what-didnt-work' => _fs_text( "Kindly share what didn't work so we can fix it for future users..." ),
203
+ 'placeholder-what-youve-been-looking-for' => _fs_text( "What you've been looking for?" ),
204
+ 'placeholder-what-did-you-expect' => _fs_text( "What did you expect?" ),
205
+ 'reason-didnt-work' => _fs_text( "The plugin didn't work" ),
206
+ 'reason-dont-like-to-share-my-information' => _fs_text( "I don't like to share my information with you" ),
207
+ '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." ),
208
+ #endregion Plugin Deactivation
209
+
210
+ #region Connect
211
+ 'hey-x' => _fs_x( 'Hey %s,', 'greeting' ),
212
+ 'thanks-x' => _fs_x( 'Thanks %s!', 'a greeting. E.g. Thanks John!' ),
213
+ '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.' ),
214
+ '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.' ),
215
+ '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.' ),
216
+ 'complete-the-install' => _fs_text( 'complete the install' ),
217
+ 'start-the-trial' => _fs_text( 'start the trial' ),
218
+ 'thanks-for-purchasing' => _fs_text( 'Thanks for purchasing %s! To get started, please enter your license key:' ),
219
+ '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.' ),
220
+ 'what-permissions' => _fs_text( 'What permissions are being granted?' ),
221
+ 'permissions-profile' => _fs_text( 'Your Profile Overview' ),
222
+ 'permissions-profile_desc' => _fs_text( 'Name and email address' ),
223
+ 'permissions-site' => _fs_text( 'Your Site Overview' ),
224
+ 'permissions-site_desc' => _fs_text( 'Site URL, WP version, PHP info, plugins & themes' ),
225
+ 'permissions-events' => _fs_text( 'Current Plugin Events' ),
226
+ 'permissions-events_desc' => _fs_text( 'Activation, deactivation and uninstall' ),
227
+ 'permissions-plugins_themes' => _fs_text( 'Plugins & Themes' ),
228
+ 'permissions-plugins_themes_desc' => _fs_text( 'Titles, versions and state.' ),
229
+ 'permissions-admin-notices' => _fs_text( 'Admin Notices' ),
230
+ 'permissions-newsletter' => _fs_text( 'Newsletter' ),
231
+ 'permissions-newsletter_desc' => _fs_text( 'Updates, announcements, marketing, no spam' ),
232
+ 'privacy-policy' => _fs_text( 'Privacy Policy' ),
233
+ 'tos' => _fs_text( 'Terms of Service' ),
234
+ 'activating' => _fs_x( 'Activating', 'as activating plugin' ),
235
+ 'sending-email' => _fs_x( 'Sending email', 'as in the process of sending an email' ),
236
+ 'opt-in-connect' => _fs_x( 'Allow & Continue', 'button label' ),
237
+ 'agree-activate-license' => _fs_x( 'Agree & Activate License', 'button label' ),
238
+ 'skip' => _fs_x( 'Skip', 'verb' ),
239
+ 'click-here-to-use-plugin-anonymously' => _fs_text( 'Click here to use the plugin anonymously' ),
240
+ 'resend-activation-email' => _fs_text( 'Re-send activation email' ),
241
+ 'license-key' => _fs_text( 'License key' ),
242
+ 'send-license-key' => _fs_text( 'Send License Key' ),
243
+ 'sending-license-key' => _fs_text( 'Sending license key' ),
244
+ 'have-license-key' => _fs_text( 'Have a license key?' ),
245
+ 'dont-have-license-key' => _fs_text( 'Don\'t have a license key?' ),
246
+ 'cant-find-license-key' => _fs_text( "Can't find your license key?" ),
247
+ 'email-not-found' => _fs_text( "We couldn't find your email address in the system, are you sure it's the right address?" ),
248
+ '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?" ),
249
+ 'opt-in' => _fs_text( 'Opt In' ),
250
+ 'opt-out' => _fs_text( 'Opt Out' ),
251
+ 'opt-out-cancel' => _fs_text( 'On second thought - I want to continue helping' ),
252
+ 'opting-out' => _fs_text( 'Opting out...' ),
253
+ 'opting-in' => _fs_text( 'Opting in...' ),
254
+ 'opt-out-message-appreciation' => _fs_text( 'We appreciate your help in making the %s better by letting us track some usage data.' ),
255
+ '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." ),
256
+ 'opt-out-message-clicking-opt-out' => _fs_text( 'By clicking "Opt Out", we will no longer be sending any data from %s to %s.' ),
257
+ #endregion Connect
258
+
259
+ #region Screenshots
260
+ 'screenshots' => _fs_text( 'Screenshots' ),
261
+ 'view-full-size-x' => _fs_text( 'Click to view full-size screenshot %d' ),
262
+ #endregion Screenshots
263
+
264
+ #region Debug
265
+ 'freemius-debug' => _fs_text( 'Freemius Debug' ),
266
+ 'on' => _fs_x( 'On', 'as turned on' ),
267
+ 'off' => _fs_x( 'Off', 'as turned off' ),
268
+ 'debugging' => _fs_x( 'Debugging', 'as code debugging' ),
269
+ 'freemius-state' => _fs_text( 'Freemius State' ),
270
+ 'connected' => _fs_x( 'Connected', 'as connection was successful' ),
271
+ 'blocked' => _fs_x( 'Blocked', 'as connection blocked' ),
272
+ 'api' => _fs_x( 'API', 'as application program interface' ),
273
+ 'sdk' => _fs_x( 'SDK', 'as software development kit versions' ),
274
+ 'sdk-versions' => _fs_x( 'SDK Versions', 'as software development kit versions' ),
275
+ 'plugin-path' => _fs_x( 'Plugin Path', 'as plugin folder path' ),
276
+ 'sdk-path' => _fs_x( 'SDK Path', 'as sdk path' ),
277
+ 'addons-of-x' => _fs_text( 'Add Ons of Plugin %s' ),
278
+ 'delete-all-confirm' => _fs_text( 'Are you sure you want to delete all Freemius data?' ),
279
+ 'actions' => _fs_text( 'Actions' ),
280
+ 'delete-all-accounts' => _fs_text( 'Delete All Accounts' ),
281
+ 'start-fresh' => _fs_text( 'Start Fresh' ),
282
+ 'clear-api-cache' => _fs_text( 'Clear API Cache' ),
283
+ 'sync-data-from-server' => _fs_text( 'Sync Data From Server' ),
284
+ 'scheduled-crons' => _fs_text( 'Scheduled Crons' ),
285
+ 'cron-type' => _fs_text( 'Cron Type' ),
286
+ 'plugins-themes-sync' => _fs_text( 'Plugins & Themes Sync' ),
287
+ 'licenses' => _fs_text( 'Licenses' ),
288
+ 'debug-log' => _fs_text( 'Debug Log' ),
289
+ 'all' => _fs_text( 'All' ),
290
+ 'file' => _fs_text( 'File' ),
291
+ 'function' => _fs_text( 'Function' ),
292
+ 'process-id' => _fs_text( 'Process ID' ),
293
+ 'logger' => _fs_text( 'Logger' ),
294
+ 'message' => _fs_text( 'Message' ),
295
+ 'download' => _fs_text( 'Download' ),
296
+ 'filter' => _fs_text( 'Filter' ),
297
+ 'type' => _fs_text( 'Type' ),
298
+ 'all-types' => _fs_text( 'All Types' ),
299
+ 'all-requests' => _fs_text( 'All Requests' ),
300
+ #endregion Debug
301
+
302
+ #region Expressions
303
+ 'congrats' => _fs_x( 'Congrats', 'as congratulations' ),
304
+ 'oops' => _fs_x( 'Oops', 'exclamation' ),
305
+ 'yee-haw' => _fs_x( 'Yee-haw', 'interjection expressing joy or exuberance' ),
306
+ 'woot' => _fs_x( 'W00t',
307
+ '(especially in electronic communication) used to express elation, enthusiasm, or triumph.' ),
308
+ 'right-on' => _fs_x( 'Right on', 'a positive response' ),
309
+ 'hmm' => _fs_x( 'Hmm',
310
+ 'something somebody says when they are thinking about what you have just said. ' ),
311
+ 'ok' => _fs_text( 'O.K' ),
312
+ 'hey' => _fs_x( 'Hey', 'exclamation' ),
313
+ 'heads-up' => _fs_x( 'Heads up',
314
+ 'advance notice of something that will need attention.' ),
315
+ #endregion Expressions
316
+
317
+ #region Admin Notices
318
+ 'you-have-latest' => _fs_text( 'Seems like you got the latest release.' ),
319
+ 'you-are-good' => _fs_text( 'You are all good!' ),
320
+ 'user-exist-message' => _fs_text( 'Sorry, we could not complete the email update. Another user with the same email is already registered.' ),
321
+ '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.' ),
322
+ 'email-updated-message' => _fs_text( 'Your email was successfully updated. You should receive an email with confirmation instructions in few moments.' ),
323
+ 'name-updated-message' => _fs_text( 'Your name was successfully updated.' ),
324
+ 'x-updated' => _fs_text( 'You have successfully updated your %s.' ),
325
+ 'name-update-failed-message' => _fs_text( 'Please provide your full name.' ),
326
+ '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.' ),
327
+ 'addons-info-external-message' => _fs_text( 'Just letting you know that the add-ons information of %s is being pulled from an external server.' ),
328
+ 'no-cc-required' => _fs_text( 'No credit card required' ),
329
+ 'premium-activated-message' => _fs_text( 'Premium plugin version was successfully activated.' ),
330
+ 'successful-version-upgrade-message' => _fs_text( 'The upgrade of %s was successfully completed.' ),
331
+ 'activation-with-plan-x-message' => _fs_text( 'Your account was successfully activated with the %s plan.' ),
332
+ 'download-latest-x-version-now' => _fs_text( 'Download the latest %s version now' ),
333
+ 'follow-steps-to-complete-upgrade' => _fs_text( 'Please follow these steps to complete the upgrade' ),
334
+ 'download-latest-x-version' => _fs_text( 'Download the latest %s version' ),
335
+ 'download-latest-version' => _fs_text( 'Download the latest version' ),
336
+ 'deactivate-free-version' => _fs_text( 'Deactivate the free version' ),
337
+ 'upload-and-activate' => _fs_text( 'Upload and activate the downloaded version' ),
338
+ 'howto-upload-activate' => _fs_text( 'How to upload and activate?' ),
339
+ 'addon-successfully-purchased-message' => _fs_x( '%s Add-on was successfully purchased.',
340
+ '%s - product name, e.g. Facebook add-on was successfully...' ),
341
+ 'addon-successfully-upgraded-message' => _fs_text( 'Your %s Add-on plan was successfully upgraded.' ),
342
+ 'email-verified-message' => _fs_text( 'Your email has been successfully verified - you are AWESOME!' ),
343
+ 'plan-upgraded-message' => _fs_text( 'Your plan was successfully upgraded.' ),
344
+ 'plan-changed-to-x-message' => _fs_text( 'Your plan was successfully changed to %s.' ),
345
+ 'license-expired-blocking-message' => _fs_text( 'Your license has expired. You can still continue using the free plugin forever.' ),
346
+ 'license-cancelled' => _fs_text( 'Your license has been cancelled. If you think it\'s a mistake, please contact support.' ),
347
+ 'trial-started-message' => _fs_text( 'Your trial has been successfully started.' ),
348
+ 'license-activated-message' => _fs_text( 'Your license was successfully activated.' ),
349
+ 'no-active-license-message' => _fs_text( 'It looks like your site currently doesn\'t have an active license.' ),
350
+ 'license-deactivation-message' => _fs_text( 'Your license was successfully deactivated, you are back to the %s plan.' ),
351
+ 'license-deactivation-failed-message' => _fs_text( 'It looks like the license deactivation failed.' ),
352
+ 'license-activation-failed-message' => _fs_text( 'It looks like the license could not be activated.' ),
353
+ 'server-error-message' => _fs_text( 'Error received from the server:' ),
354
+ 'trial-expired-message' => _fs_text( 'Your trial has expired. You can still continue using all our free features.' ),
355
+ 'plan-x-downgraded-message' => _fs_text( 'Your plan was successfully downgraded. Your %s plan license will expire in %s.' ),
356
+ 'plan-downgraded-failure-message' => _fs_text( 'Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes.' ),
357
+ 'trial-cancel-no-trial-message' => _fs_text( 'It looks like you are not in trial mode anymore so there\'s nothing to cancel :)' ),
358
+ 'trial-cancel-message' => _fs_text( 'Your %s free trial was successfully cancelled.' ),
359
+ 'version-x-released' => _fs_x( 'Version %s was released.', '%s - numeric version number' ),
360
+ 'please-download-x' => _fs_text( 'Please download %s.' ),
361
+ 'latest-x-version' => _fs_x( 'the latest %s version here',
362
+ '%s - plan name, as the latest professional version here' ),
363
+ '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.' ),
364
+ 'start-free-trial' => _fs_x( 'Start free trial', 'call to action' ),
365
+ 'starting-trial' => _fs_text( 'Starting trial' ),
366
+ 'please-wait' => _fs_text( 'Please wait' ),
367
+ 'trial-cancel-failure-message' => _fs_text( 'Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes.' ),
368
+ 'trial-utilized' => _fs_text( 'You already utilized a trial before.' ),
369
+ 'in-trial-mode' => _fs_text( 'You are already running the plugin in a trial mode.' ),
370
+ 'trial-plan-x-not-exist' => _fs_text( 'Plan %s do not exist, therefore, can\'t start a trial.' ),
371
+ 'plan-x-no-trial' => _fs_text( 'Plan %s does not support a trial period.' ),
372
+ 'no-trials' => _fs_text( 'None of the plugin\'s plans supports a trial period.' ),
373
+ 'unexpected-api-error' => _fs_text( 'Unexpected API error. Please contact the plugin\'s author with the following error.' ),
374
+ 'no-commitment-for-x-days' => _fs_text( 'No commitment for %s days - cancel anytime!' ),
375
+ '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.' ),
376
+ 'could-not-activate-x' => _fs_text( 'Couldn\'t activate %s.' ),
377
+ 'contact-us-with-error-message' => _fs_text( 'Please contact us with the following message:' ),
378
+ '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.' ),
379
+ 'contact-us-here' => _fs_text( 'Please contact us here' ),
380
+ '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.' ),
381
+ #endregion Admin Notices
382
+ #region Connectivity Issues
383
+ 'connectivity-test-fails-message' => _fs_text( 'From unknown reason, the API connectivity test failed.' ),
384
+ '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?' ),
385
+ 'curl-missing-message' => _fs_text( 'We use PHP cURL library for the API calls, which is a very common library and usually installed out of the box. Unfortunately, cURL is not installed on your server.' ),
386
+ 'cloudflare-blocks-connection-message' => _fs_text( 'From unknown reason, CloudFlare, the firewall we use, blocks the connection.' ),
387
+ 'x-requires-access-to-api' => _fs_x( '%s requires an access to our API.',
388
+ 'as pluginX requires an access to our API' ),
389
+ 'squid-blocks-connection-message' => _fs_text( 'It looks like your server is using Squid ACL (access control lists), which blocks the connection.' ),
390
+ 'squid-no-clue-title' => _fs_text( 'I don\'t know what is Squid or ACL, help me!' ),
391
+ '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.' ),
392
+ 'sysadmin-title' => _fs_text( 'I\'m a system administrator' ),
393
+ 'squid-sysadmin-desc' => _fs_text( 'Great, please whitelist the following domains: %s. Once you are done, deactivate the plugin and activate it again.' ),
394
+ 'curl-missing-no-clue-title' => _fs_text( 'I don\'t know what is cURL or how to install it, help me!' ),
395
+ '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.' ),
396
+ 'curl-missing-sysadmin-desc' => _fs_text( 'Great, please install cURL and enable it in your php.ini file. To make sure it was successfully activated, use \'phpinfo()\'. Once activated, deactivate the plugin and reactivate it back again.' ),
397
+ '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.' ),
398
+ 'contact-support-before-deactivation' => _fs_text( 'Sorry for the inconvenience and we are here to help if you give us a chance.' ),
399
+ 'fix-issue-title' => _fs_text( 'Yes - I\'m giving you a chance to fix it' ),
400
+ '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.' ),
401
+ 'install-previous-title' => _fs_text( 'Let\'s try your previous version' ),
402
+ 'install-previous-desc' => _fs_text( 'Uninstall this version and install the previous one.' ),
403
+ 'deactivate-plugin-title' => _fs_text( 'That\'s exhausting, please deactivate' ),
404
+ 'deactivate-plugin-desc' => _fs_text( 'We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future.' ),
405
+ '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.' ),
406
+ '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',
407
+ '%1s - plugin title, %2s - API domain' ),
408
+ '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.' ),
409
+ #endregion Connectivity Issues
410
+ #region Change Owner
411
+ '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.' ),
412
+ 'change-owner-request_owner-confirmed' => _fs_text( 'Thanks for confirming the ownership change. An email was just sent to %s for final approval.' ),
413
+ 'change-owner-request_candidate-confirmed' => _fs_text( '%s is the new owner of the account.' ),
414
+ #endregion Change Owner
415
+ 'addon-x-cannot-run-without-y' => _fs_x( '%s cannot run without %s.',
416
+ 'addonX cannot run without pluginY' ),
417
+ 'addon-x-cannot-run-without-parent' => _fs_x( '%s cannot run without the plugin.', 'addonX cannot run...' ),
418
+ 'plugin-x-activation-message' => _fs_x( '%s activation was successfully completed.',
419
+ 'pluginX activation was successfully...' ),
420
+ 'features-and-pricing' => _fs_x( 'Features & Pricing', 'Plugin installer section title' ),
421
+ 'free-addon-not-deployed' => _fs_text( 'Add-on must be deployed to WordPress.org or Freemius.' ),
422
+ 'paid-addon-not-deployed' => _fs_text( 'Paid add-on must be deployed to Freemius.' ),
423
+ #--------------------------------------------------------------------------------
424
+ #region Add-On Licensing
425
+ #--------------------------------------------------------------------------------
426
+ 'addon-no-license-message' => _fs_text( '%s is a premium only add-on. You have to purchase a license first before activating the plugin.' ),
427
+ '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.' ),
428
+ #endregion
429
+ #--------------------------------------------------------------------------------
430
+ #region Billing Cycles
431
+ #--------------------------------------------------------------------------------
432
+ 'monthly' => _fs_x( 'Monthly', 'as every month' ),
433
+ 'mo' => _fs_x( 'mo', 'as monthly period' ),
434
+ 'annual' => _fs_x( 'Annual', 'as once a year' ),
435
+ 'annually' => _fs_x( 'Annually', 'as once a year' ),
436
+ 'once' => _fs_x( 'Once', 'as once a year' ),
437
+ 'year' => _fs_x( 'year', 'as annual period' ),
438
+ 'lifetime' => _fs_text( 'Lifetime' ),
439
+ 'best' => _fs_x( 'Best', 'e.g. the best product' ),
440
+ 'billed-x' => _fs_x( 'Billed %s', 'e.g. billed monthly' ),
441
+ 'save-x' => _fs_x( 'Save %s', 'as a discount of $5 or 10%' ),
442
+ #endregion Billing Cycles
443
+ 'view-details' => _fs_text( 'View details' ),
444
+ #--------------------------------------------------------------------------------
445
+ #region Trial
446
+ #--------------------------------------------------------------------------------
447
+ 'approve-start-trial' => _fs_x( 'Approve & Start Trial', 'button label' ),
448
+ /* translators: %1$s: Number of trial days; %2$s: Plan name; */
449
+ 'start-trial-prompt-header' => _fs_text( 'You are 1-click away from starting your %1$s-day free trial of the %2$s plan.' ),
450
+ /* translators: %s: Link to freemius.com */
451
+ '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.' ),
452
+
453
+ #endregion
454
+ #--------------------------------------------------------------------------------
455
+ #region Billing Details
456
+ #--------------------------------------------------------------------------------
457
+ 'business-name' => _fs_text( 'Business name' ),
458
+ 'tax-vat-id' => _fs_text( 'Tax / VAT ID' ),
459
+ 'address-line-n' => _fs_text( 'Address Line %d' ),
460
+ 'country' => _fs_text( 'Country' ),
461
+ 'select-country' => _fs_text( 'Select Country' ),
462
+ 'city' => _fs_text( 'City' ),
463
+ 'town' => _fs_text( 'Town' ),
464
+ 'state' => _fs_text( 'State' ),
465
+ 'province' => _fs_text( 'Province' ),
466
+ 'zip-postal-code' => _fs_text( 'ZIP / Postal Code' ),
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 ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ // Silence is golden.
3
+ // Hide file structure from users on unprotected servers.
freemius/includes/l10n.php ADDED
@@ -0,0 +1,250 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Retrieve the translation of $text.
15
+ *
16
+ * @since 1.2.1.6
17
+ *
18
+ * @param string $text
19
+ *
20
+ * @return string
21
+ */
22
+ function _fs_text( $text ) {
23
+ return translate( $text, 'freemius' );
24
+ }
25
+
26
+ /**
27
+ * Retrieve the translation of $text and escapes it for safe use in an attribute.
28
+ *
29
+ * @since 1.2.1.6
30
+ *
31
+ * @param string $text
32
+ *
33
+ * @return string
34
+ */
35
+ function _fs_esc_attr( $text ) {
36
+ return esc_attr( translate( $text, 'freemius' ) );
37
+ }
38
+
39
+ /**
40
+ * Retrieve the translation of $text and escapes it for safe use in HTML output.
41
+ *
42
+ * @since 1.2.1.6
43
+ *
44
+ * @param string $text
45
+ *
46
+ * @return string
47
+ */
48
+ function _fs_esc_html( $text ) {
49
+ return esc_html( translate( $text, 'freemius' ) );
50
+ }
51
+
52
+ /**
53
+ * Display translated text.
54
+ *
55
+ * @since 1.2.0
56
+ *
57
+ * @param string $text
58
+ */
59
+ function _fs_echo( $text ) {
60
+ echo translate( $text, 'freemius' );
61
+ }
62
+
63
+ /**
64
+ * Display translated text that has been escaped for safe use in an attribute.
65
+ *
66
+ * @since 1.2.1.6
67
+ *
68
+ * @param string $text
69
+ */
70
+ function _fs_esc_attr_echo( $text ) {
71
+ echo esc_attr( translate( $text, 'freemius' ) );
72
+ }
73
+
74
+ /**
75
+ * Display translated text that has been escaped for safe use in HTML output.
76
+ *
77
+ * @since 1.2.1.6
78
+ *
79
+ * @param string $text
80
+ */
81
+ function _fs_esc_html_echo( $text ) {
82
+ echo esc_html( translate( $text, 'freemius' ) );
83
+ }
84
+
85
+ /**
86
+ * Retrieve translated string with gettext context.
87
+ *
88
+ * Quite a few times, there will be collisions with similar translatable text
89
+ * found in more than two places, but with different translated context.
90
+ *
91
+ * By including the context in the pot file, translators can translate the two
92
+ * strings differently.
93
+ *
94
+ * @since 1.2.1.6
95
+ *
96
+ * @param string $text
97
+ * @param string $context
98
+ *
99
+ * @return string
100
+ */
101
+ function _fs_x( $text, $context ) {
102
+ return translate_with_gettext_context( $text, $context, 'freemius' );
103
+ }
104
+
105
+ /**
106
+ * Display translated string with gettext context.
107
+ *
108
+ * @since 1.2.1.6
109
+ *
110
+ * @param string $text
111
+ * @param string $context
112
+ */
113
+ function _fs_ex( $text, $context ) {
114
+ // Avoid misleading Theme Check warning.
115
+ $fn = '_x';
116
+ echo $fn( $text, $context, 'freemius' );
117
+ }
118
+
119
+ /**
120
+ * Translate string with gettext context, and escapes it for safe use in an attribute.
121
+ *
122
+ * @since 1.2.1.6
123
+ *
124
+ * @param string $text
125
+ * @param string $context
126
+ *
127
+ * @return string
128
+ */
129
+ function _fs_esc_attr_x( $text, $context ) {
130
+ return esc_attr( translate_with_gettext_context( $text, $context, 'freemius' ) );
131
+ }
132
+
133
+ /**
134
+ * Translate string with gettext context, and escapes it for safe use in HTML output.
135
+ *
136
+ * @since 2.9.0
137
+ *
138
+ * @param string $text
139
+ * @param string $context
140
+ *
141
+ * @return string
142
+ */
143
+ function _fs_esc_html_x( $text, $context ) {
144
+ return esc_html( translate_with_gettext_context( $text, $context, 'freemius' ) );
145
+ }
146
+
147
+ /**
148
+ * Translates and retrieves the singular or plural form based on the supplied number.
149
+ *
150
+ * @since 1.2.1.6
151
+ *
152
+ * @param string $single
153
+ * @param string $plural
154
+ * @param int $number
155
+ *
156
+ * @return string
157
+ */
158
+ function _fs_n( $single, $plural, $number ) {
159
+ $translations = get_translations_for_domain( 'freemius' );
160
+ $translation = $translations->translate_plural( $single, $plural, $number );
161
+
162
+ /**
163
+ * Filters the singular or plural form of a string.
164
+ *
165
+ * @since WP 2.2.0
166
+ *
167
+ * @param string $translation
168
+ * @param string $single
169
+ * @param string $plural
170
+ * @param string $number
171
+ * @param string $domain
172
+ */
173
+ return apply_filters( 'ngettext', $translation, $single, $plural, $number, 'freemius' );
174
+ }
175
+
176
+ /**
177
+ * Translates and retrieves the singular or plural form based on the supplied number, with gettext context.
178
+ *
179
+ * @since 1.2.1.6
180
+ *
181
+ * @param string $single
182
+ * @param string $plural
183
+ * @param int $number
184
+ * @param string $context
185
+ *
186
+ * @return string
187
+ */
188
+ function _fs_nx($single, $plural, $number, $context ) {
189
+ $translations = get_translations_for_domain( 'freemius' );
190
+ $translation = $translations->translate_plural( $single, $plural, $number, $context );
191
+
192
+ /**
193
+ * Filters the singular or plural form of a string with gettext context.
194
+ *
195
+ * @since WP 3.0
196
+ *
197
+ * @param string $translation
198
+ * @param string $single
199
+ * @param string $plural
200
+ * @param string $number
201
+ * @param string $context
202
+ * @param string $domain
203
+ */
204
+ return apply_filters( 'ngettext_with_context', $translation, $single, $plural, $number, $context, 'freemius' );
205
+ }
206
+
207
+ /**
208
+ * Registers plural strings in POT file, but does not translate them.
209
+ *
210
+ * Used when you want to keep structures with translatable plural
211
+ * strings and use them later when the number is known.
212
+ *
213
+ * @since 1.2.1.6
214
+ *
215
+ * @param string $singular
216
+ * @param string $plural
217
+ *
218
+ * @return array
219
+ */
220
+ function _fs_n_noop( $singular, $plural ) {
221
+ return array(
222
+ 'singular' => $singular,
223
+ 'plural' => $plural,
224
+ 'context' => null,
225
+ 'domain' => 'freemius'
226
+ );
227
+ }
228
+
229
+ /**
230
+ * Registers plural strings with gettext context in POT file, but does not translate them.
231
+ *
232
+ * Used when you want to keep structures with translatable plural
233
+ * strings and use them later when the number is known.
234
+ *
235
+ * @since 1.2.1.6
236
+ *
237
+ * @param string $singular
238
+ * @param string $plural
239
+ * @param string $context
240
+ *
241
+ * @return array
242
+ */
243
+ function _fs_nx_noop( $singular, $plural, $context ) {
244
+ return array(
245
+ 'singular' => $singular,
246
+ 'plural' => $plural,
247
+ 'context' => $context,
248
+ 'domain' => 'freemius'
249
+ );
250
+ }
freemius/includes/managers/class-fs-admin-menu-manager.php ADDED
@@ -0,0 +1,635 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Admin_Menu_Manager {
14
+
15
+ #region Properties
16
+
17
+ /**
18
+ * @var string
19
+ */
20
+ protected $_plugin_slug;
21
+
22
+ /**
23
+ * @since 1.0.6
24
+ *
25
+ * @var string
26
+ */
27
+ private $_menu_slug;
28
+ /**
29
+ * @since 1.1.3
30
+ *
31
+ * @var string
32
+ */
33
+ private $_parent_slug;
34
+ /**
35
+ * @since 1.1.3
36
+ *
37
+ * @var string
38
+ */
39
+ private $_parent_type;
40
+ /**
41
+ * @since 1.1.3
42
+ *
43
+ * @var string
44
+ */
45
+ private $_type;
46
+ /**
47
+ * @since 1.1.3
48
+ *
49
+ * @var bool
50
+ */
51
+ private $_is_top_level;
52
+ /**
53
+ * @since 1.1.3
54
+ *
55
+ * @var bool
56
+ */
57
+ private $_is_override_exact;
58
+ /**
59
+ * @since 1.1.3
60
+ *
61
+ * @var array<string,bool>
62
+ */
63
+ private $_default_submenu_items;
64
+ /**
65
+ * @since 1.1.3
66
+ *
67
+ * @var string
68
+ */
69
+ private $_first_time_path;
70
+
71
+ #endregion Properties
72
+
73
+ /**
74
+ * @var FS_Logger
75
+ */
76
+ protected $_logger;
77
+
78
+ #region Singleton
79
+
80
+ /**
81
+ * @var FS_Admin_Menu_Manager[]
82
+ */
83
+ private static $_instances = array();
84
+
85
+ /**
86
+ * @param string $plugin_slug
87
+ *
88
+ * @return FS_Admin_Notice_Manager
89
+ */
90
+ static function instance( $plugin_slug ) {
91
+ if ( ! isset( self::$_instances[ $plugin_slug ] ) ) {
92
+ self::$_instances[ $plugin_slug ] = new FS_Admin_Menu_Manager( $plugin_slug );
93
+ }
94
+
95
+ return self::$_instances[ $plugin_slug ];
96
+ }
97
+
98
+ protected function __construct( $plugin_slug ) {
99
+ $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $plugin_slug . '_admin_menu', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
100
+
101
+ $this->_plugin_slug = $plugin_slug;
102
+ }
103
+
104
+ #endregion Singleton
105
+
106
+ #region Helpers
107
+
108
+ private function get_option( &$options, $key, $default = false ) {
109
+ return ! empty( $options[ $key ] ) ? $options[ $key ] : $default;
110
+ }
111
+
112
+ private function get_bool_option( &$options, $key, $default = false ) {
113
+ return isset( $options[ $key ] ) && is_bool( $options[ $key ] ) ? $options[ $key ] : $default;
114
+ }
115
+
116
+ #endregion Helpers
117
+
118
+ /**
119
+ * @param array $menu
120
+ * @param bool $is_addon
121
+ */
122
+ function init( $menu, $is_addon = false ) {
123
+ $this->_menu_slug = ! empty( $menu['slug'] ) ? $menu['slug'] : null;
124
+
125
+ $this->_default_submenu_items = array();
126
+ // @deprecated
127
+ $this->_type = 'page';
128
+ $this->_is_top_level = true;
129
+ $this->_is_override_exact = false;
130
+ $this->_parent_slug = false;
131
+ // @deprecated
132
+ $this->_parent_type = 'page';
133
+
134
+ if ( ! $is_addon && isset( $menu ) ) {
135
+ $this->_default_submenu_items = array(
136
+ 'contact' => $this->get_bool_option( $menu, 'contact', true ),
137
+ 'support' => $this->get_bool_option( $menu, 'support', true ),
138
+ 'account' => $this->get_bool_option( $menu, 'account', true ),
139
+ 'pricing' => $this->get_bool_option( $menu, 'pricing', true ),
140
+ 'addons' => $this->get_bool_option( $menu, 'addons', true ),
141
+ );
142
+
143
+ // @deprecated
144
+ $this->_type = $this->get_option( $menu, 'type', 'page' );
145
+ $this->_is_override_exact = $this->get_bool_option( $menu, 'override_exact' );
146
+
147
+ if ( isset( $menu['parent'] ) ) {
148
+ $this->_parent_slug = $this->get_option( $menu['parent'], 'slug' );
149
+ // @deprecated
150
+ $this->_parent_type = $this->get_option( $menu['parent'], 'type', 'page' );
151
+
152
+ // If parent's slug is different, then it's NOT a top level menu item.
153
+ $this->_is_top_level = ( $this->_parent_slug === $this->_menu_slug );
154
+ } else {
155
+ /**
156
+ * If no parent then top level if:
157
+ * - Has custom admin menu ('page')
158
+ * - CPT menu type ('cpt')
159
+ */
160
+ // $this->_is_top_level = in_array( $this->_type, array(
161
+ // 'cpt',
162
+ // 'page'
163
+ // ) );
164
+ }
165
+
166
+ $this->_first_time_path = $this->get_option( $menu, 'first-path', false );
167
+ if ( ! empty( $this->_first_time_path ) && is_string( $this->_first_time_path ) ) {
168
+ $this->_first_time_path = admin_url( $this->_first_time_path, 'admin' );
169
+ }
170
+ }
171
+ }
172
+
173
+ /**
174
+ * Check if top level menu.
175
+ *
176
+ * @author Vova Feldman (@svovaf)
177
+ * @since 1.1.3
178
+ *
179
+ * @return bool False if submenu item.
180
+ */
181
+ function is_top_level() {
182
+ return $this->_is_top_level;
183
+ }
184
+
185
+ /**
186
+ * Check if the page should be override on exact URL match.
187
+ *
188
+ * @author Vova Feldman (@svovaf)
189
+ * @since 1.1.3
190
+ *
191
+ * @return bool False if submenu item.
192
+ */
193
+ function is_override_exact() {
194
+ return $this->_is_override_exact;
195
+ }
196
+
197
+
198
+ /**
199
+ * Get the path of the page the user should be forwarded to after first activation.
200
+ *
201
+ * @author Vova Feldman (@svovaf)
202
+ * @since 1.1.3
203
+ *
204
+ * @return string
205
+ */
206
+ function get_first_time_path() {
207
+ return $this->_first_time_path;
208
+ }
209
+
210
+ /**
211
+ * Check if plugin's menu item is part of a custom top level menu.
212
+ *
213
+ * @author Vova Feldman (@svovaf)
214
+ * @since 1.1.3
215
+ *
216
+ * @return bool
217
+ */
218
+ function has_custom_parent() {
219
+ return ! $this->_is_top_level && is_string( $this->_parent_slug );
220
+ }
221
+
222
+ /**
223
+ * @author Vova Feldman (@svovaf)
224
+ * @since 1.1.3
225
+ *
226
+ * @param string $id
227
+ * @param bool $default
228
+ *
229
+ * @return bool
230
+ */
231
+ function is_submenu_item_visible( $id, $default = true ) {
232
+ return fs_apply_filter(
233
+ $this->_plugin_slug,
234
+ 'is_submenu_visible',
235
+ $this->get_bool_option( $this->_default_submenu_items, $id, $default ),
236
+ $id
237
+ );
238
+ }
239
+
240
+ /**
241
+ * Calculates admin settings menu slug.
242
+ * If plugin's menu slug is a file (e.g. CPT), uses plugin's slug as the menu slug.
243
+ *
244
+ * @author Vova Feldman (@svovaf)
245
+ * @since 1.1.3
246
+ *
247
+ * @param string $page
248
+ *
249
+ * @return string
250
+ */
251
+ function get_slug( $page = '' ) {
252
+ return ( ( false === strpos( $this->_menu_slug, '.php?' ) ) ?
253
+ $this->_menu_slug :
254
+ $this->_plugin_slug ) . ( empty( $page ) ? '' : ( '-' . $page ) );
255
+ }
256
+
257
+ /**
258
+ * Check if module has a menu slug set.
259
+ *
260
+ * @author Vova Feldman (@svovaf)
261
+ * @since 1.2.1.6
262
+ *
263
+ * @return bool
264
+ */
265
+ function has_menu_slug() {
266
+ return ! empty( $this->_menu_slug );
267
+ }
268
+
269
+ /**
270
+ * @author Vova Feldman (@svovaf)
271
+ * @since 1.1.3
272
+ *
273
+ * @return string
274
+ */
275
+ function get_parent_slug() {
276
+ return $this->_parent_slug;
277
+ }
278
+
279
+ /**
280
+ * @author Vova Feldman (@svovaf)
281
+ * @since 1.1.3
282
+ *
283
+ * @return string
284
+ */
285
+ function get_type() {
286
+ return $this->_type;
287
+ }
288
+
289
+ /**
290
+ * @author Vova Feldman (@svovaf)
291
+ * @since 1.1.3
292
+ *
293
+ * @return bool
294
+ */
295
+ function is_cpt() {
296
+ return ( 0 === strpos( $this->_menu_slug, 'edit.php?post_type=' ) ||
297
+ // Back compatibility.
298
+ 'cpt' === $this->_type
299
+ );
300
+ }
301
+
302
+ /**
303
+ * @author Vova Feldman (@svovaf)
304
+ * @since 1.1.3
305
+ *
306
+ * @return string
307
+ */
308
+ function get_parent_type() {
309
+ return $this->_parent_type;
310
+ }
311
+
312
+ /**
313
+ * @author Vova Feldman (@svovaf)
314
+ * @since 1.1.3
315
+ *
316
+ * @return string
317
+ */
318
+ function get_raw_slug() {
319
+ return $this->_menu_slug;
320
+ }
321
+
322
+ /**
323
+ * Get plugin's original menu slug.
324
+ *
325
+ * @author Vova Feldman (@svovaf)
326
+ * @since 1.1.3
327
+ *
328
+ * @return string
329
+ */
330
+ function get_original_menu_slug() {
331
+ if ( 'cpt' === $this->_type ) {
332
+ return add_query_arg( array(
333
+ 'post_type' => $this->_menu_slug
334
+ ), 'edit.php' );
335
+ }
336
+
337
+ if ( false === strpos( $this->_menu_slug, '.php?' ) ) {
338
+ return $this->_menu_slug;
339
+ } else {
340
+ return $this->_plugin_slug;
341
+ }
342
+ }
343
+
344
+ /**
345
+ * @author Vova Feldman (@svovaf)
346
+ * @since 1.1.3
347
+ *
348
+ * @return string
349
+ */
350
+ function get_top_level_menu_slug() {
351
+ return $this->has_custom_parent() ?
352
+ $this->get_parent_slug() :
353
+ $this->get_raw_slug();
354
+ }
355
+
356
+ /**
357
+ * Is user on plugin's admin activation page.
358
+ *
359
+ * @author Vova Feldman (@svovaf)
360
+ * @since 1.0.8
361
+ *
362
+ * @return bool
363
+ */
364
+ function is_activation_page() {
365
+ return isset( $_GET['page'] ) &&
366
+ ( ( strtolower( $this->_menu_slug ) === strtolower( $_GET['page'] ) ) ||
367
+ ( strtolower( $this->_plugin_slug ) === strtolower( $_GET['page'] ) ) );
368
+ }
369
+
370
+ #region Submenu Override
371
+
372
+ /**
373
+ * Override submenu's action.
374
+ *
375
+ * @author Vova Feldman (@svovaf)
376
+ * @since 1.1.0
377
+ *
378
+ * @param string $parent_slug
379
+ * @param string $menu_slug
380
+ * @param callable $function
381
+ *
382
+ * @return false|string If submenu exist, will return the hook name.
383
+ */
384
+ function override_submenu_action( $parent_slug, $menu_slug, $function ) {
385
+ global $submenu;
386
+
387
+ $menu_slug = plugin_basename( $menu_slug );
388
+ $parent_slug = plugin_basename( $parent_slug );
389
+
390
+ if ( ! isset( $submenu[ $parent_slug ] ) ) {
391
+ // Parent menu not exist.
392
+ return false;
393
+ }
394
+
395
+ $found_submenu_item = false;
396
+ foreach ( $submenu[ $parent_slug ] as $submenu_item ) {
397
+ if ( $menu_slug === $submenu_item[2] ) {
398
+ $found_submenu_item = $submenu_item;
399
+ break;
400
+ }
401
+ }
402
+
403
+ if ( false === $found_submenu_item ) {
404
+ // Submenu item not found.
405
+ return false;
406
+ }
407
+
408
+ // Remove current function.
409
+ $hookname = get_plugin_page_hookname( $menu_slug, $parent_slug );
410
+ remove_all_actions( $hookname );
411
+
412
+ // Attach new action.
413
+ add_action( $hookname, $function );
414
+
415
+ return $hookname;
416
+ }
417
+
418
+ #endregion Submenu Override
419
+
420
+ #region Top level menu Override
421
+
422
+ /**
423
+ * Find plugin's admin dashboard main menu item.
424
+ *
425
+ * @author Vova Feldman (@svovaf)
426
+ * @since 1.0.2
427
+ *
428
+ * @return string[]|false
429
+ */
430
+ private function find_top_level_menu() {
431
+ global $menu;
432
+
433
+ $position = - 1;
434
+ $found_menu = false;
435
+
436
+ $menu_slug = $this->get_raw_slug();
437
+
438
+ $hook_name = get_plugin_page_hookname( $menu_slug, '' );
439
+ foreach ( $menu as $pos => $m ) {
440
+ if ( $menu_slug === $m[2] ) {
441
+ $position = $pos;
442
+ $found_menu = $m;
443
+ break;
444
+ }
445
+ }
446
+
447
+ if ( false === $found_menu ) {
448
+ return false;
449
+ }
450
+
451
+ return array(
452
+ 'menu' => $found_menu,
453
+ 'position' => $position,
454
+ 'hook_name' => $hook_name
455
+ );
456
+ }
457
+
458
+ /**
459
+ * Find plugin's admin dashboard main submenu item.
460
+ *
461
+ * @author Vova Feldman (@svovaf)
462
+ * @since 1.2.1.6
463
+ *
464
+ * @return array|false
465
+ */
466
+ private function find_main_submenu() {
467
+ global $submenu;
468
+
469
+ $top_level_menu_slug = $this->get_top_level_menu_slug();
470
+
471
+ if ( ! isset( $submenu[ $top_level_menu_slug ] ) ) {
472
+ return false;
473
+ }
474
+
475
+ $submenu_slug = $this->get_raw_slug();
476
+
477
+ $position = - 1;
478
+ $found_submenu = false;
479
+
480
+ $hook_name = get_plugin_page_hookname( $submenu_slug, '' );
481
+
482
+ foreach ( $submenu[ $top_level_menu_slug ] as $pos => $sub ) {
483
+ if ( $submenu_slug === $sub[2] ) {
484
+ $position = $pos;
485
+ $found_submenu = $sub;
486
+ }
487
+ }
488
+
489
+ if ( false === $found_submenu ) {
490
+ return false;
491
+ }
492
+
493
+ return array(
494
+ 'menu' => $found_submenu,
495
+ 'parent_slug' => $top_level_menu_slug,
496
+ 'position' => $position,
497
+ 'hook_name' => $hook_name
498
+ );
499
+ }
500
+
501
+ /**
502
+ * Remove all sub-menu items.
503
+ *
504
+ * @author Vova Feldman (@svovaf)
505
+ * @since 1.0.7
506
+ *
507
+ * @return bool If submenu with plugin's menu slug was found.
508
+ */
509
+ private function remove_all_submenu_items() {
510
+ global $submenu;
511
+
512
+ $menu_slug = $this->get_raw_slug();
513
+
514
+ if ( ! isset( $submenu[ $menu_slug ] ) ) {
515
+ return false;
516
+ }
517
+
518
+ $submenu[ $menu_slug ] = array();
519
+
520
+ return true;
521
+ }
522
+
523
+ /**
524
+ *
525
+ * @author Vova Feldman (@svovaf)
526
+ * @since 1.0.9
527
+ *
528
+ * @return array[string]mixed
529
+ */
530
+ function remove_menu_item() {
531
+ $this->_logger->entrance();
532
+
533
+ // Find main menu item.
534
+ $menu = $this->find_top_level_menu();
535
+
536
+ if ( false === $menu ) {
537
+ return false;
538
+ }
539
+
540
+ // Remove it with its actions.
541
+ remove_all_actions( $menu['hook_name'] );
542
+
543
+ // Remove all submenu items.
544
+ $this->remove_all_submenu_items();
545
+
546
+ return $menu;
547
+ }
548
+
549
+ /**
550
+ * @author Vova Feldman (@svovaf)
551
+ * @since 1.1.4
552
+ *
553
+ * @param callable $function
554
+ *
555
+ * @return array[string]mixed
556
+ */
557
+ function override_menu_item( $function ) {
558
+ $found_menu = $this->remove_menu_item();
559
+
560
+ if ( false === $found_menu ) {
561
+ return false;
562
+ }
563
+
564
+ if ( ! $this->is_top_level() || ! $this->is_cpt() ) {
565
+ $menu_slug = plugin_basename( $this->get_slug() );
566
+
567
+ $hookname = get_plugin_page_hookname( $menu_slug, '' );
568
+
569
+ // Override menu action.
570
+ add_action( $hookname, $function );
571
+ } else {
572
+ global $menu;
573
+
574
+ // Remove original CPT menu.
575
+ unset( $menu[ $found_menu['position'] ] );
576
+
577
+ // Create new top-level menu action.
578
+ $hookname = add_menu_page(
579
+ $found_menu['menu'][3],
580
+ $found_menu['menu'][0],
581
+ 'manage_options',
582
+ $this->get_slug(),
583
+ $function,
584
+ $found_menu['menu'][6],
585
+ $found_menu['position']
586
+ );
587
+ }
588
+
589
+ return $hookname;
590
+ }
591
+
592
+ /**
593
+ * Adds a counter to the module's top level menu item.
594
+ *
595
+ * @author Vova Feldman (@svovaf)
596
+ * @since 1.2.1.5
597
+ *
598
+ * @param int $counter
599
+ * @param string $class
600
+ */
601
+ function add_counter_to_menu_item( $counter = 1, $class = '' ) {
602
+ global $menu, $submenu;
603
+
604
+ $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>';
605
+
606
+ if ( $this->_is_top_level ) {
607
+ // Find main menu item.
608
+ $found_menu = $this->find_top_level_menu();
609
+
610
+ if ( false !== $found_menu ) {
611
+ // Override menu label.
612
+ $menu[ $found_menu['position'] ][0] = sprintf(
613
+ $mask,
614
+ $found_menu['menu'][0],
615
+ $class,
616
+ $counter
617
+ );
618
+ }
619
+ } else {
620
+ $found_submenu = $this->find_main_submenu();
621
+
622
+ if ( false !== $found_submenu ) {
623
+ // Override menu label.
624
+ $submenu[ $found_submenu['parent_slug'] ][ $found_submenu['position'] ][0] = sprintf(
625
+ $mask,
626
+ $found_submenu['menu'][0],
627
+ $class,
628
+ $counter
629
+ );
630
+ }
631
+ }
632
+ }
633
+
634
+ #endregion Top level menu Override
635
+ }
freemius/includes/managers/class-fs-admin-notice-manager.php ADDED
@@ -0,0 +1,313 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
+ * @since 1.0.7
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Admin_Notice_Manager {
14
+ /**
15
+ * @var string
16
+ */
17
+ protected $_slug;
18
+ /**
19
+ * @var string
20
+ */
21
+ protected $_title;
22
+ /**
23
+ * @var array[]
24
+ */
25
+ private $_admin_messages = array();
26
+ /**
27
+ * @var FS_Key_Value_Storage
28
+ */
29
+ private $_sticky_storage;
30
+ /**
31
+ * @var FS_Plugin_Manager[]
32
+ */
33
+ private static $_instances = array();
34
+ /**
35
+ * @var FS_Logger
36
+ */
37
+ protected $_logger;
38
+
39
+ /**
40
+ * @param string $slug
41
+ * @param string $title
42
+ *
43
+ * @return FS_Admin_Notice_Manager
44
+ */
45
+ static function instance( $slug, $title = '' ) {
46
+ if ( ! isset( self::$_instances[ $slug ] ) ) {
47
+ self::$_instances[ $slug ] = new FS_Admin_Notice_Manager( $slug, $title );
48
+ }
49
+
50
+ return self::$_instances[ $slug ];
51
+ }
52
+
53
+ protected function __construct( $slug, $title = '' ) {
54
+ $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $slug . '_data', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
55
+
56
+ $this->_slug = $slug;
57
+ $this->_title = ! empty( $title ) ? $title : '';
58
+ $this->_sticky_storage = FS_Key_Value_Storage::instance( 'admin_notices', $this->_slug );
59
+
60
+ if ( is_admin() ) {
61
+ if ( 0 < count( $this->_sticky_storage ) ) {
62
+ // If there are sticky notices for the current slug, add a callback
63
+ // to the AJAX action that handles message dismiss.
64
+ add_action( "wp_ajax_fs_dismiss_notice_action_{$slug}", array(
65
+ &$this,
66
+ 'dismiss_notice_ajax_callback'
67
+ ) );
68
+
69
+ foreach ( $this->_sticky_storage as $id => $msg ) {
70
+ // Add admin notice.
71
+ $this->add(
72
+ $msg['message'],
73
+ $msg['title'],
74
+ $msg['type'],
75
+ true,
76
+ $msg['all'],
77
+ $msg['id'],
78
+ false
79
+ );
80
+ }
81
+ }
82
+ }
83
+ }
84
+
85
+ /**
86
+ * Remove sticky message by ID.
87
+ *
88
+ * @author Vova Feldman (@svovaf)
89
+ * @since 1.0.7
90
+ *
91
+ */
92
+ function dismiss_notice_ajax_callback() {
93
+ $this->_sticky_storage->remove( $_POST['message_id'] );
94
+ wp_die();
95
+ }
96
+
97
+ /**
98
+ * Rendered sticky message dismiss JavaScript.
99
+ *
100
+ * @author Vova Feldman (@svovaf)
101
+ * @since 1.0.7
102
+ */
103
+ static function _add_sticky_dismiss_javascript() {
104
+ $params = array();
105
+ fs_require_once_template( 'sticky-admin-notice-js.php', $params );
106
+ }
107
+
108
+ private static $_added_sticky_javascript = false;
109
+
110
+ /**
111
+ * Hook to the admin_footer to add sticky message dismiss JavaScript handler.
112
+ *
113
+ * @author Vova Feldman (@svovaf)
114
+ * @since 1.0.7
115
+ */
116
+ private static function has_sticky_messages() {
117
+ if ( ! self::$_added_sticky_javascript ) {
118
+ add_action( 'admin_footer', array( 'FS_Admin_Notice_Manager', '_add_sticky_dismiss_javascript' ) );
119
+ }
120
+ }
121
+
122
+ /**
123
+ * Handle admin_notices by printing the admin messages stacked in the queue.
124
+ *
125
+ * @author Vova Feldman (@svovaf)
126
+ * @since 1.0.4
127
+ *
128
+ */
129
+ function _admin_notices_hook() {
130
+ $notice_type = 'admin_notices';
131
+
132
+ if ( function_exists( 'current_user_can' ) &&
133
+ ! current_user_can( 'manage_options' )
134
+ ) {
135
+ // Only show messages to admins.
136
+ return;
137
+ }
138
+
139
+ if ( ! isset( $this->_admin_messages[ $notice_type ] ) || ! is_array( $this->_admin_messages[ $notice_type ] ) ) {
140
+ return;
141
+ }
142
+
143
+ foreach ( $this->_admin_messages[ $notice_type ] as $id => $msg ) {
144
+ fs_require_template( 'admin-notice.php', $msg );
145
+
146
+ if ( $msg['sticky'] ) {
147
+ self::has_sticky_messages();
148
+ }
149
+ }
150
+ }
151
+
152
+ /**
153
+ * Handle all_admin_notices by printing the admin messages stacked in the queue.
154
+ *
155
+ * @author Vova Feldman (@svovaf)
156
+ * @since 1.0.4
157
+ *
158
+ */
159
+ function _all_admin_notices_hook() {
160
+ $notice_type = 'all_admin_notices';
161
+
162
+ if ( ! isset( $this->_admin_messages[ $notice_type ] ) || ! is_array( $this->_admin_messages[ $notice_type ] ) ) {
163
+ return;
164
+ }
165
+
166
+ foreach ( $this->_admin_messages[ $notice_type ] as $id => $msg ) {
167
+ fs_require_template( 'all-admin-notice.php', $msg );
168
+ }
169
+ }
170
+
171
+ /**
172
+ * Enqueue common stylesheet to style admin notice.
173
+ *
174
+ * @author Vova Feldman (@svovaf)
175
+ * @since 1.0.7
176
+ */
177
+ function _enqueue_styles() {
178
+ fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
179
+ }
180
+
181
+ /**
182
+ * Add admin message to admin messages queue, and hook to admin_notices / all_admin_notices if not yet hooked.
183
+ *
184
+ * @author Vova Feldman (@svovaf)
185
+ * @since 1.0.4
186
+ *
187
+ * @param string $message
188
+ * @param string $title
189
+ * @param string $type
190
+ * @param bool $is_sticky
191
+ * @param bool $all_admin
192
+ * @param string $id Message ID
193
+ * @param bool $store_if_sticky
194
+ *
195
+ * @uses add_action()
196
+ */
197
+ function add( $message, $title = '', $type = 'success', $is_sticky = false, $all_admin = false, $id = '', $store_if_sticky = true ) {
198
+ $key = ( $all_admin ? 'all_admin_notices' : 'admin_notices' );
199
+
200
+ if ( ! isset( $this->_admin_messages[ $key ] ) ) {
201
+ $this->_admin_messages[ $key ] = array();
202
+
203
+ add_action( $key, array( &$this, "_{$key}_hook" ) );
204
+ add_action( 'admin_enqueue_scripts', array( &$this, '_enqueue_styles' ) );
205
+
206
+ }
207
+
208
+ if ( '' === $id ) {
209
+ $id = md5( $title . ' ' . $message . ' ' . $type );
210
+ }
211
+
212
+ $message_object = array(
213
+ 'message' => $message,
214
+ 'title' => $title,
215
+ 'type' => $type,
216
+ 'sticky' => $is_sticky,
217
+ 'id' => $id,
218
+ 'all' => $all_admin,
219
+ 'slug' => $this->_slug,
220
+ 'plugin' => $this->_title,
221
+ );
222
+
223
+ if ( $is_sticky && $store_if_sticky ) {
224
+ $this->_sticky_storage->{$id} = $message_object;
225
+ }
226
+
227
+ $this->_admin_messages[ $key ][ $id ] = $message_object;
228
+ }
229
+
230
+ /**
231
+ * @author Vova Feldman (@svovaf)
232
+ * @since 1.0.7
233
+ *
234
+ * @param string|string[] $ids
235
+ */
236
+ function remove_sticky( $ids ) {
237
+ if ( ! is_array( $ids ) ) {
238
+ $ids = array( $ids );
239
+ }
240
+
241
+ foreach ( $ids as $id ) {
242
+ // Remove from sticky storage.
243
+ $this->_sticky_storage->remove( $id );
244
+
245
+ // Remove from current admin messages.
246
+ if ( isset( $this->_admin_messages['all_admin_notices'] ) && isset( $this->_admin_messages['all_admin_notices'][ $id ] ) ) {
247
+ unset( $this->_admin_messages['all_admin_notices'][ $id ] );
248
+ }
249
+ if ( isset( $this->_admin_messages['admin_notices'] ) && isset( $this->_admin_messages['admin_notices'][ $id ] ) ) {
250
+ unset( $this->_admin_messages['admin_notices'][ $id ] );
251
+ }
252
+ }
253
+ }
254
+
255
+ /**
256
+ * Check if sticky message exists by id.
257
+ *
258
+ * @author Vova Feldman (@svovaf)
259
+ * @since 1.0.9
260
+ *
261
+ * @param $id
262
+ *
263
+ * @return bool
264
+ */
265
+ function has_sticky( $id ) {
266
+ return isset( $this->_sticky_storage[ $id ] );
267
+ }
268
+
269
+ /**
270
+ * Adds sticky admin notification.
271
+ *
272
+ * @author Vova Feldman (@svovaf)
273
+ * @since 1.0.7
274
+ *
275
+ * @param string $message
276
+ * @param string $id Message ID
277
+ * @param string $title
278
+ * @param string $type
279
+ * @param bool $all_admin
280
+ */
281
+ function add_sticky( $message, $id, $title = '', $type = 'success', $all_admin = false ) {
282
+ $message = fs_apply_filter( $this->_slug, "sticky_message_{$id}", $message );
283
+ $title = fs_apply_filter( $this->_slug, "sticky_title_{$id}", $title );
284
+
285
+ $this->add( $message, $title, $type, true, $all_admin, $id );
286
+ }
287
+
288
+ /**
289
+ * Clear all sticky messages.
290
+ *
291
+ * @author Vova Feldman (@svovaf)
292
+ * @since 1.0.8
293
+ */
294
+ function clear_all_sticky() {
295
+ $this->_sticky_storage->clear_all();
296
+ }
297
+
298
+ /**
299
+ * Add admin message to all admin messages queue, and hook to all_admin_notices if not yet hooked.
300
+ *
301
+ * @author Vova Feldman (@svovaf)
302
+ * @since 1.0.4
303
+ *
304
+ * @param string $message
305
+ * @param string $title
306
+ * @param string $type
307
+ * @param bool $is_sticky
308
+ * @param string $id Message ID
309
+ */
310
+ function add_all( $message, $title = '', $type = 'success', $is_sticky = false, $id = '' ) {
311
+ $this->add( $message, $title, $type, $is_sticky, true, $id );
312
+ }
313
+ }
freemius/includes/managers/class-fs-cache-manager.php ADDED
@@ -0,0 +1,237 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Cache_Manager {
14
+ /**
15
+ * @var FS_Option_Manager
16
+ */
17
+ private $_options;
18
+ /**
19
+ * @var FS_Logger
20
+ */
21
+ private $_logger;
22
+
23
+ /**
24
+ * @var FS_Cache_Manager[]
25
+ */
26
+ private static $_MANAGERS = array();
27
+
28
+ /**
29
+ * @author Vova Feldman (@svovaf)
30
+ * @since 1.1.3
31
+ *
32
+ * @param string $id
33
+ */
34
+ private function __construct( $id ) {
35
+ $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_cach_mngr_' . $id, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
36
+
37
+ $this->_logger->entrance();
38
+ $this->_logger->log( 'id = ' . $id );
39
+
40
+ $this->_options = FS_Option_Manager::get_manager( $id, true );
41
+ }
42
+
43
+ /**
44
+ * @author Vova Feldman (@svovaf)
45
+ * @since 1.1.6
46
+ *
47
+ * @param $id
48
+ *
49
+ * @return FS_Cache_Manager
50
+ */
51
+ static function get_manager( $id ) {
52
+ $id = strtolower( $id );
53
+
54
+ if ( ! isset( self::$_MANAGERS[ $id ] ) ) {
55
+ self::$_MANAGERS[ $id ] = new FS_Cache_Manager( $id );
56
+ }
57
+
58
+ return self::$_MANAGERS[ $id ];
59
+ }
60
+
61
+ /**
62
+ * @author Vova Feldman (@svovaf)
63
+ * @since 1.1.6
64
+ *
65
+ * @return bool
66
+ */
67
+ function is_empty() {
68
+ $this->_logger->entrance();
69
+
70
+ return $this->_options->is_empty();
71
+ }
72
+
73
+ /**
74
+ * @author Vova Feldman (@svovaf)
75
+ * @since 1.1.6
76
+ */
77
+ function clear() {
78
+ $this->_logger->entrance();
79
+
80
+ $this->_options->clear( true );
81
+ }
82
+
83
+ /**
84
+ * Delete cache manager from DB.
85
+ *
86
+ * @author Vova Feldman (@svovaf)
87
+ * @since 1.0.9
88
+ */
89
+ function delete() {
90
+ $this->_options->delete();
91
+ }
92
+
93
+ /**
94
+ * Check if there's a cached item.
95
+ *
96
+ * @author Vova Feldman (@svovaf)
97
+ * @since 1.1.6
98
+ *
99
+ * @param string $key
100
+ *
101
+ * @return bool
102
+ */
103
+ function has( $key ) {
104
+ $cache_entry = $this->_options->get_option( $key, false );
105
+
106
+ return ( is_object( $cache_entry ) &&
107
+ isset( $cache_entry->timestamp ) &&
108
+ is_numeric( $cache_entry->timestamp )
109
+ );
110
+ }
111
+
112
+ /**
113
+ * Check if there's a valid cached item.
114
+ *
115
+ * @author Vova Feldman (@svovaf)
116
+ * @since 1.1.6
117
+ *
118
+ * @param string $key
119
+ *
120
+ * @return bool
121
+ */
122
+ function has_valid( $key ) {
123
+ $cache_entry = $this->_options->get_option( $key, false );
124
+
125
+ return ( is_object( $cache_entry ) &&
126
+ isset( $cache_entry->timestamp ) &&
127
+ is_numeric( $cache_entry->timestamp ) &&
128
+ $cache_entry->timestamp > WP_FS__SCRIPT_START_TIME
129
+ );
130
+ }
131
+
132
+ /**
133
+ * @author Vova Feldman (@svovaf)
134
+ * @since 1.1.6
135
+ *
136
+ * @param string $key
137
+ * @param mixed $default
138
+ *
139
+ * @return mixed
140
+ */
141
+ function get( $key, $default = null ) {
142
+ $this->_logger->entrance( 'key = ' . $key );
143
+
144
+ $cache_entry = $this->_options->get_option( $key, false );
145
+
146
+ if ( is_object( $cache_entry ) &&
147
+ isset( $cache_entry->timestamp ) &&
148
+ is_numeric( $cache_entry->timestamp )
149
+ ) {
150
+ return $cache_entry->result;
151
+ }
152
+
153
+ return $default;
154
+ }
155
+
156
+ /**
157
+ * @author Vova Feldman (@svovaf)
158
+ * @since 1.1.6
159
+ *
160
+ * @param string $key
161
+ * @param mixed $default
162
+ *
163
+ * @return mixed
164
+ */
165
+ function get_valid( $key, $default = null ) {
166
+ $this->_logger->entrance( 'key = ' . $key );
167
+
168
+ $cache_entry = $this->_options->get_option( $key, false );
169
+
170
+ if ( is_object( $cache_entry ) &&
171
+ isset( $cache_entry->timestamp ) &&
172
+ is_numeric( $cache_entry->timestamp ) &&
173
+ $cache_entry->timestamp > WP_FS__SCRIPT_START_TIME
174
+ ) {
175
+ return $cache_entry->result;
176
+ }
177
+
178
+ return $default;
179
+ }
180
+
181
+ /**
182
+ * @author Vova Feldman (@svovaf)
183
+ * @since 1.1.6
184
+ *
185
+ * @param string $key
186
+ * @param mixed $value
187
+ * @param int $expiration
188
+ */
189
+ function set( $key, $value, $expiration = WP_FS__TIME_24_HOURS_IN_SEC ) {
190
+ $this->_logger->entrance( 'key = ' . $key );
191
+
192
+ $cache_entry = new stdClass();
193
+ $cache_entry->result = $value;
194
+ $cache_entry->timestamp = WP_FS__SCRIPT_START_TIME + $expiration;
195
+ $this->_options->set_option( $key, $cache_entry, true );
196
+ }
197
+
198
+ /**
199
+ * Get cached record expiration, or false if not cached or expired.
200
+ *
201
+ * @author Vova Feldman (@svovaf)
202
+ * @since 1.1.7.3
203
+ *
204
+ * @param string $key
205
+ *
206
+ * @return bool|int
207
+ */
208
+ function get_record_expiration( $key ) {
209
+ $this->_logger->entrance( 'key = ' . $key );
210
+
211
+ $cache_entry = $this->_options->get_option( $key, false );
212
+
213
+ if ( is_object( $cache_entry ) &&
214
+ isset( $cache_entry->timestamp ) &&
215
+ is_numeric( $cache_entry->timestamp ) &&
216
+ $cache_entry->timestamp > WP_FS__SCRIPT_START_TIME
217
+ ) {
218
+ return $cache_entry->timestamp;
219
+ }
220
+
221
+ return false;
222
+ }
223
+
224
+ /**
225
+ * Purge cached item.
226
+ *
227
+ * @author Vova Feldman (@svovaf)
228
+ * @since 1.1.6
229
+ *
230
+ * @param string $key
231
+ */
232
+ function purge( $key ) {
233
+ $this->_logger->entrance( 'key = ' . $key );
234
+
235
+ $this->_options->unset_option( $key, true );
236
+ }
237
+ }
freemius/includes/managers/class-fs-key-value-storage.php ADDED
@@ -0,0 +1,326 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
+ * @since 1.0.7
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Class FS_Key_Value_Storage
15
+ *
16
+ * @property int $install_timestamp
17
+ * @property int $activation_timestamp
18
+ * @property int $sync_timestamp
19
+ * @property object $sync_cron
20
+ * @property int $install_sync_timestamp
21
+ * @property array $connectivity_test
22
+ * @property array $is_on
23
+ * @property object $trial_plan
24
+ * @property bool $has_trial_plan
25
+ * @property bool $trial_promotion_shown
26
+ * @property string $sdk_version
27
+ * @property string $sdk_last_version
28
+ * @property bool $sdk_upgrade_mode
29
+ * @property bool $sdk_downgrade_mode
30
+ * @property bool $plugin_upgrade_mode
31
+ * @property bool $plugin_downgrade_mode
32
+ * @property string $plugin_version
33
+ * @property string $plugin_last_version
34
+ * @property bool $is_plugin_new_install
35
+ * @property bool $was_plugin_loaded
36
+ * @property object $plugin_main_file
37
+ * @property bool $prev_is_premium
38
+ * @property array $is_anonymous
39
+ * @property bool $is_pending_activation
40
+ * @property bool $sticky_optin_added
41
+ * @property object $uninstall_reason
42
+ * @property object $subscription
43
+ */
44
+ class FS_Key_Value_Storage implements ArrayAccess, Iterator, Countable {
45
+ /**
46
+ * @var string
47
+ */
48
+ protected $_id;
49
+ /**
50
+ * @var string
51
+ */
52
+ protected $_slug;
53
+ /**
54
+ * @var array
55
+ */
56
+ protected $_data;
57
+
58
+ /**
59
+ * @var FS_Plugin_Manager[]
60
+ */
61
+ private static $_instances = array();
62
+ /**
63
+ * @var FS_Logger
64
+ */
65
+ protected $_logger;
66
+
67
+ /**
68
+ * @param string $id
69
+ * @param string $slug
70
+ *
71
+ * @return FS_Key_Value_Storage
72
+ */
73
+ static function instance( $id, $slug ) {
74
+ $key = $id . ':' . $slug;
75
+ if ( ! isset( self::$_instances[ $key ] ) ) {
76
+ self::$_instances[ $key ] = new FS_Key_Value_Storage( $id, $slug );
77
+ }
78
+
79
+ return self::$_instances[ $key ];
80
+ }
81
+
82
+ protected function __construct( $id, $slug ) {
83
+ $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $slug . '_' . $id, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
84
+
85
+ $this->_slug = $slug;
86
+ $this->_id = $id;
87
+ $this->load();
88
+ }
89
+
90
+ protected function get_option_manager() {
91
+ return FS_Option_Manager::get_manager( WP_FS__ACCOUNTS_OPTION_NAME, true );
92
+ }
93
+
94
+ protected function get_all_data() {
95
+ return $this->get_option_manager()->get_option( $this->_id, array() );
96
+ }
97
+
98
+ /**
99
+ * Load plugin data from local DB.
100
+ *
101
+ * @author Vova Feldman (@svovaf)
102
+ * @since 1.0.7
103
+ */
104
+ function load() {
105
+ $all_plugins_data = $this->get_all_data();
106
+ $this->_data = isset( $all_plugins_data[ $this->_slug ] ) ?
107
+ $all_plugins_data[ $this->_slug ] :
108
+ array();
109
+ }
110
+
111
+ /**
112
+ * @author Vova Feldman (@svovaf)
113
+ * @since 1.0.7
114
+ *
115
+ * @param string $key
116
+ * @param mixed $value
117
+ * @param bool $flush
118
+ */
119
+ function store( $key, $value, $flush = true ) {
120
+ if ( $this->_logger->is_on() ) {
121
+ $this->_logger->entrance( $key . ' = ' . var_export( $value, true ) );
122
+ }
123
+
124
+ if ( array_key_exists( $key, $this->_data ) && $value === $this->_data[ $key ] ) {
125
+ // No need to store data if the value wasn't changed.
126
+ return;
127
+ }
128
+
129
+ $all_data = $this->get_all_data();
130
+
131
+ $this->_data[ $key ] = $value;
132
+
133
+ $all_data[ $this->_slug ] = $this->_data;
134
+
135
+ $options_manager = $this->get_option_manager();
136
+ $options_manager->set_option( $this->_id, $all_data, $flush );
137
+ }
138
+
139
+ /**
140
+ * @author Vova Feldman (@svovaf)
141
+ * @since 1.0.7
142
+ *
143
+ * @param bool $store
144
+ * @param string[] $exceptions Set of keys to keep and not clear.
145
+ */
146
+ function clear_all( $store = true, $exceptions = array() ) {
147
+ $new_data = array();
148
+ foreach ( $exceptions as $key ) {
149
+ if ( isset( $this->_data[ $key ] ) ) {
150
+ $new_data[ $key ] = $this->_data[ $key ];
151
+ }
152
+ }
153
+
154
+ $this->_data = $new_data;
155
+
156
+ if ( $store ) {
157
+ $all_data = $this->get_all_data();
158
+ $all_data[ $this->_slug ] = $this->_data;
159
+ $options_manager = $this->get_option_manager();
160
+ $options_manager->set_option( $this->_id, $all_data, true );
161
+ }
162
+ }
163
+
164
+ /**
165
+ * Delete key-value storage.
166
+ *
167
+ * @author Vova Feldman (@svovaf)
168
+ * @since 1.0.9
169
+ */
170
+ function delete() {
171
+ $this->_data = array();
172
+
173
+ $all_data = $this->get_all_data();
174
+ unset( $all_data[ $this->_slug ] );
175
+ $options_manager = $this->get_option_manager();
176
+ $options_manager->set_option( $this->_id, $all_data, true );
177
+ }
178
+
179
+ /**
180
+ * @author Vova Feldman (@svovaf)
181
+ * @since 1.0.7
182
+ *
183
+ * @param string $key
184
+ * @param bool $store
185
+ */
186
+ function remove( $key, $store = true ) {
187
+ if ( ! array_key_exists( $key, $this->_data ) ) {
188
+ return;
189
+ }
190
+
191
+ unset( $this->_data[ $key ] );
192
+
193
+ if ( $store ) {
194
+ $all_data = $this->get_all_data();
195
+ $all_data[ $this->_slug ] = $this->_data;
196
+ $options_manager = $this->get_option_manager();
197
+ $options_manager->set_option( $this->_id, $all_data, true );
198
+ }
199
+ }
200
+
201
+ /**
202
+ * @author Vova Feldman (@svovaf)
203
+ * @since 1.0.7
204
+ *
205
+ * @param string $key
206
+ * @param mixed $default
207
+ *
208
+ * @return bool|\FS_Plugin
209
+ */
210
+ function get( $key, $default = false ) {
211
+ return array_key_exists( $key, $this->_data ) ?
212
+ $this->_data[ $key ] :
213
+ $default;
214
+ }
215
+
216
+
217
+ /* ArrayAccess + Magic Access (better for refactoring)
218
+ -----------------------------------------------------------------------------------*/
219
+ function __set( $k, $v ) {
220
+ $this->store( $k, $v );
221
+ }
222
+
223
+ function __isset( $k ) {
224
+ return array_key_exists( $k, $this->_data );
225
+ }
226
+
227
+ function __unset( $k ) {
228
+ $this->remove( $k );
229
+ }
230
+
231
+ function __get( $k ) {
232
+ return $this->get( $k, null );
233
+ }
234
+
235
+ function offsetSet( $k, $v ) {
236
+ if ( is_null( $k ) ) {
237
+ throw new Exception( 'Can\'t append value to request params.' );
238
+ } else {
239
+ $this->{$k} = $v;
240
+ }
241
+ }
242
+
243
+ function offsetExists( $k ) {
244
+ return array_key_exists( $k, $this->_data );
245
+ }
246
+
247
+ function offsetUnset( $k ) {
248
+ unset( $this->$k );
249
+ }
250
+
251
+ function offsetGet( $k ) {
252
+ return $this->get( $k, null );
253
+ }
254
+
255
+ /**
256
+ * (PHP 5 &gt;= 5.0.0)<br/>
257
+ * Return the current element
258
+ *
259
+ * @link http://php.net/manual/en/iterator.current.php
260
+ * @return mixed Can return any type.
261
+ */
262
+ public function current() {
263
+ return current( $this->_data );
264
+ }
265
+
266
+ /**
267
+ * (PHP 5 &gt;= 5.0.0)<br/>
268
+ * Move forward to next element
269
+ *
270
+ * @link http://php.net/manual/en/iterator.next.php
271
+ * @return void Any returned value is ignored.
272
+ */
273
+ public function next() {
274
+ next( $this->_data );
275
+ }
276
+
277
+ /**
278
+ * (PHP 5 &gt;= 5.0.0)<br/>
279
+ * Return the key of the current element
280
+ *
281
+ * @link http://php.net/manual/en/iterator.key.php
282
+ * @return mixed scalar on success, or null on failure.
283
+ */
284
+ public function key() {
285
+ return key( $this->_data );
286
+ }
287
+
288
+ /**
289
+ * (PHP 5 &gt;= 5.0.0)<br/>
290
+ * Checks if current position is valid
291
+ *
292
+ * @link http://php.net/manual/en/iterator.valid.php
293
+ * @return boolean The return value will be casted to boolean and then evaluated.
294
+ * Returns true on success or false on failure.
295
+ */
296
+ public function valid() {
297
+ $key = key( $this->_data );
298
+
299
+ return ( $key !== null && $key !== false );
300
+ }
301
+
302
+ /**
303
+ * (PHP 5 &gt;= 5.0.0)<br/>
304
+ * Rewind the Iterator to the first element
305
+ *
306
+ * @link http://php.net/manual/en/iterator.rewind.php
307
+ * @return void Any returned value is ignored.
308
+ */
309
+ public function rewind() {
310
+ reset( $this->_data );
311
+ }
312
+
313
+ /**
314
+ * (PHP 5 &gt;= 5.1.0)<br/>
315
+ * Count elements of an object
316
+ *
317
+ * @link http://php.net/manual/en/countable.count.php
318
+ * @return int The custom count as an integer.
319
+ * </p>
320
+ * <p>
321
+ * The return value is cast to an integer.
322
+ */
323
+ public function count() {
324
+ return count( $this->_data );
325
+ }
326
+ }
freemius/includes/managers/class-fs-license-manager.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_License_Manager /*extends FS_Abstract_Manager*/
14
+ {
15
+ //
16
+ //
17
+ // /**
18
+ // * @var FS_License_Manager[]
19
+ // */
20
+ // private static $_instances = array();
21
+ //
22
+ // static function instance( Freemius $fs ) {
23
+ // $slug = strtolower( $fs->get_slug() );
24
+ //
25
+ // if ( ! isset( self::$_instances[ $slug ] ) ) {
26
+ // self::$_instances[ $slug ] = new FS_License_Manager( $slug, $fs );
27
+ // }
28
+ //
29
+ // return self::$_instances[ $slug ];
30
+ // }
31
+ //
32
+ //// private function __construct($slug) {
33
+ //// parent::__construct($slug);
34
+ //// }
35
+ //
36
+ // function entry_id() {
37
+ // return 'licenses';
38
+ // }
39
+ //
40
+ // function sync( $id ) {
41
+ //
42
+ // }
43
+ //
44
+ // /**
45
+ // * @author Vova Feldman (@svovaf)
46
+ // * @since 1.0.5
47
+ // * @uses FS_Api
48
+ // *
49
+ // * @param number|bool $plugin_id
50
+ // *
51
+ // * @return FS_Plugin_License[]|stdClass Licenses or API error.
52
+ // */
53
+ // function api_get_user_plugin_licenses( $plugin_id = false ) {
54
+ // $api = $this->_fs->get_api_user_scope();
55
+ //
56
+ // if ( ! is_numeric( $plugin_id ) ) {
57
+ // $plugin_id = $this->_fs->get_id();
58
+ // }
59
+ //
60
+ // $result = $api->call( "/plugins/{$plugin_id}/licenses.json" );
61
+ //
62
+ // if ( ! isset( $result->error ) ) {
63
+ // for ( $i = 0, $len = count( $result->licenses ); $i < $len; $i ++ ) {
64
+ // $result->licenses[ $i ] = new FS_Plugin_License( $result->licenses[ $i ] );
65
+ // }
66
+ //
67
+ // $result = $result->licenses;
68
+ // }
69
+ //
70
+ // return $result;
71
+ // }
72
+ //
73
+ // function api_get_many() {
74
+ //
75
+ // }
76
+ //
77
+ // function api_activate( $id ) {
78
+ //
79
+ // }
80
+ //
81
+ // function api_deactivate( $id ) {
82
+ //
83
+ // }
84
+
85
+ /**
86
+ * @param FS_Plugin_License[] $licenses
87
+ *
88
+ * @return bool
89
+ */
90
+ static function has_premium_license( $licenses ) {
91
+ if ( is_array( $licenses ) ) {
92
+ foreach ( $licenses as $license ) {
93
+ /**
94
+ * @var FS_Plugin_License $license
95
+ */
96
+ if ( ! $license->is_utilized() && $license->is_features_enabled() ) {
97
+ return true;
98
+ }
99
+ }
100
+ }
101
+
102
+ return false;
103
+ }
104
+ }
freemius/includes/managers/class-fs-option-manager.php ADDED
@@ -0,0 +1,302 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package Freemius
4
+ * @copyright Copyright (c) 2015, Freemius, Inc.
5
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6
+ * @since 1.0.3
7
+ */
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * 3-layer lazy options manager.
15
+ * layer 3: Memory
16
+ * layer 2: Cache (if there's any caching plugin and if WP_FS__DEBUG_SDK is FALSE)
17
+ * layer 1: Database (options table). All options stored as one option record in the DB to reduce number of DB
18
+ * queries.
19
+ *
20
+ * If load() is not explicitly called, starts as empty manager. Same thing about saving the data - you have to
21
+ * explicitly call store().
22
+ *
23
+ * Class Freemius_Option_Manager
24
+ */
25
+ class FS_Option_Manager {
26
+ /**
27
+ * @var string
28
+ */
29
+ private $_id;
30
+ /**
31
+ * @var array
32
+ */
33
+ private $_options;
34
+ /**
35
+ * @var FS_Logger
36
+ */
37
+ private $_logger;
38
+
39
+ /**
40
+ * @var FS_Option_Manager[]
41
+ */
42
+ private static $_MANAGERS = array();
43
+
44
+ /**
45
+ * @author Vova Feldman (@svovaf)
46
+ * @since 1.0.3
47
+ *
48
+ * @param string $id
49
+ * @param bool $load
50
+ */
51
+ private function __construct( $id, $load = false ) {
52
+ $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_opt_mngr_' . $id, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
53
+
54
+ $this->_logger->entrance();
55
+ $this->_logger->log( 'id = ' . $id );
56
+
57
+ $this->_id = $id;
58
+
59
+ if ( $load ) {
60
+ $this->load();
61
+ }
62
+ }
63
+
64
+ /**
65
+ * @author Vova Feldman (@svovaf)
66
+ * @since 1.0.3
67
+ *
68
+ * @param $id
69
+ * @param $load
70
+ *
71
+ * @return FS_Option_Manager
72
+ */
73
+ static function get_manager( $id, $load = false ) {
74
+ $id = strtolower( $id );
75
+
76
+ if ( ! isset( self::$_MANAGERS[ $id ] ) ) {
77
+ self::$_MANAGERS[ $id ] = new FS_Option_Manager( $id, $load );
78
+ } // If load required but not yet loaded, load.
79
+ else if ( $load && ! self::$_MANAGERS[ $id ]->is_loaded() ) {
80
+ self::$_MANAGERS[ $id ]->load();
81
+ }
82
+
83
+ return self::$_MANAGERS[ $id ];
84
+ }
85
+
86
+ private function _get_option_manager_name() {
87
+ // return WP_FS__SLUG . '_' . $this->_id;
88
+ return $this->_id;
89
+ }
90
+
91
+ /**
92
+ * @author Vova Feldman (@svovaf)
93
+ * @since 1.0.3
94
+ *
95
+ * @param bool $flush
96
+ */
97
+ function load( $flush = false ) {
98
+ $this->_logger->entrance();
99
+
100
+ $option_name = $this->_get_option_manager_name();
101
+
102
+ if ( $flush || ! isset( $this->_options ) ) {
103
+ if ( isset( $this->_options ) ) {
104
+ // Clear prev options.
105
+ $this->clear();
106
+ }
107
+
108
+ if ( ! WP_FS__DEBUG_SDK ) {
109
+ $this->_options = wp_cache_get( $option_name, WP_FS__SLUG );
110
+ }
111
+
112
+ // $this->_logger->info('wp_cache_get = ' . var_export($this->_options, true));
113
+
114
+ // if ( is_array( $this->_options ) ) {
115
+ // $this->clear();
116
+ // }
117
+
118
+ $cached = true;
119
+
120
+ if ( empty( $this->_options ) ) {
121
+ $this->_options = get_option( $option_name );
122
+
123
+ if ( is_string( $this->_options ) ) {
124
+ $this->_options = json_decode( $this->_options );
125
+ }
126
+
127
+ // $this->_logger->info('get_option = ' . var_export($this->_options, true));
128
+
129
+ if ( false === $this->_options ) {
130
+ $this->clear();
131
+ }
132
+
133
+ $cached = false;
134
+ }
135
+
136
+ if ( ! WP_FS__DEBUG_SDK && ! $cached ) // Set non encoded cache.
137
+ {
138
+ wp_cache_set( $option_name, $this->_options, WP_FS__SLUG );
139
+ }
140
+ }
141
+ }
142
+
143
+ /**
144
+ * @author Vova Feldman (@svovaf)
145
+ * @since 1.0.3
146
+ *
147
+ * @return bool
148
+ */
149
+ function is_loaded() {
150
+ return isset( $this->_options );
151
+ }
152
+
153
+ /**
154
+ * @author Vova Feldman (@svovaf)
155
+ * @since 1.0.3
156
+ *
157
+ * @return bool
158
+ */
159
+ function is_empty() {
160
+ return ( $this->is_loaded() && false === $this->_options );
161
+ }
162
+
163
+ /**
164
+ * @author Vova Feldman (@svovaf)
165
+ * @since 1.0.6
166
+ *
167
+ * @param bool $flush
168
+ */
169
+ function clear( $flush = false ) {
170
+ $this->_logger->entrance();
171
+
172
+ $this->_options = array();
173
+
174
+ if ( $flush ) {
175
+ $this->store();
176
+ }
177
+ }
178
+
179
+ /**
180
+ * Delete options manager from DB.
181
+ *
182
+ * @author Vova Feldman (@svovaf)
183
+ * @since 1.0.9
184
+ */
185
+ function delete() {
186
+ delete_option( $this->_get_option_manager_name() );
187
+ }
188
+
189
+ /**
190
+ * @author Vova Feldman (@svovaf)
191
+ * @since 1.0.6
192
+ *
193
+ * @param string $option
194
+ *
195
+ * @return bool
196
+ */
197
+ function has_option( $option ) {
198
+ return array_key_exists( $option, $this->_options );
199
+ }
200
+
201
+ /**
202
+ * @author Vova Feldman (@svovaf)
203
+ * @since 1.0.3
204
+ *
205
+ * @param string $option
206
+ * @param mixed $default
207
+ *
208
+ * @return mixed
209
+ */
210
+ function get_option( $option, $default = null ) {
211
+ $this->_logger->entrance( 'option = ' . $option );
212
+
213
+ if ( is_array( $this->_options ) ) {
214
+ return isset( $this->_options[ $option ] ) ? $this->_options[ $option ] : $default;
215
+ } else if ( is_object( $this->_options ) ) {
216
+ return isset( $this->_options->{$option} ) ? $this->_options->{$option} : $default;
217
+ }
218
+
219
+ return $default;
220
+ }
221
+
222
+ /**
223
+ * @author Vova Feldman (@svovaf)
224
+ * @since 1.0.3
225
+ *
226
+ * @param string $option
227
+ * @param mixed $value
228
+ * @param bool $flush
229
+ */
230
+ function set_option( $option, $value, $flush = false ) {
231
+ $this->_logger->entrance( 'option = ' . $option );
232
+
233
+ if ( ! $this->is_loaded() ) {
234
+ $this->clear();
235
+ }
236
+
237
+ if ( is_array( $this->_options ) ) {
238
+ $this->_options[ $option ] = $value;
239
+ } else if ( is_object( $this->_options ) ) {
240
+ $this->_options->{$option} = $value;
241
+ }
242
+
243
+ if ( $flush ) {
244
+ $this->store();
245
+ }
246
+ }
247
+
248
+ /**
249
+ * Unset option.
250
+ *
251
+ * @author Vova Feldman (@svovaf)
252
+ * @since 1.0.3
253
+ *
254
+ * @param string $option
255
+ * @param bool $flush
256
+ */
257
+ function unset_option( $option, $flush = false ) {
258
+ $this->_logger->entrance( 'option = ' . $option );
259
+
260
+ if ( is_array( $this->_options ) ) {
261
+ if ( ! isset( $this->_options[ $option ] ) ) {
262
+ return;
263
+ }
264
+
265
+ unset( $this->_options[ $option ] );
266
+
267
+ } else if ( is_object( $this->_options ) ) {
268
+ if ( ! isset( $this->_options->{$option} ) ) {
269
+ return;
270
+ }
271
+
272
+ unset( $this->_options->{$option} );
273
+ }
274
+
275
+ if ( $flush ) {
276
+ $this->store();
277
+ }
278
+ }
279
+
280
+ /**
281
+ * Dump options to database.
282
+ *
283
+ * @author Vova Feldman (@svovaf)
284
+ * @since 1.0.3
285
+ */
286
+ function store() {
287
+ $this->_logger->entrance();
288
+
289
+ $option_name = $this->_get_option_manager_name();
290
+
291
+ if ( $this->_logger->is_on() ) {
292
+ $this->_logger->info( $option_name . ' = ' . var_export( $this->_options, true ) );
293
+ }
294
+
295
+ // Update DB.
296
+ update_option( $option_name, $this->_options );
297
+
298
+ if ( ! WP_FS__DEBUG_SDK ) {
299
+ wp_cache_set( $option_name, $this->_options, WP_FS__SLUG );
300
+ }
301
+ }
302
+ }
freemius/includes/managers/class-fs-plan-manager.php ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Plan_Manager {
14
+ /**
15
+ * @var FS_Plan_Manager
16
+ */
17
+ private static $_instance;
18
+
19
+ /**
20
+ * @return FS_Plan_Manager
21
+ */
22
+ static function instance() {
23
+ if ( ! isset( self::$_instance ) ) {
24
+ self::$_instance = new FS_Plan_Manager();
25
+ }
26
+
27
+ return self::$_instance;
28
+ }
29
+
30
+ private function __construct() {
31
+ }
32
+
33
+ /**
34
+ * @param FS_Plugin_License[] $licenses
35
+ *
36
+ * @return bool
37
+ */
38
+ function has_premium_license( $licenses ) {
39
+ if ( is_array( $licenses ) ) {
40
+ /**
41
+ * @var FS_Plugin_License[] $licenses
42
+ */
43
+ foreach ( $licenses as $license ) {
44
+ if ( ! $license->is_utilized() && $license->is_features_enabled() ) {
45
+ return true;
46
+ }
47
+ }
48
+ }
49
+
50
+ return false;
51
+ }
52
+
53
+ /**
54
+ * Check if plugin has any paid plans.
55
+ *
56
+ * @author Vova Feldman (@svovaf)
57
+ * @since 1.0.7
58
+ *
59
+ * @param FS_Plugin_Plan[] $plans
60
+ *
61
+ * @return bool
62
+ */
63
+ function has_paid_plan( $plans ) {
64
+ if ( ! is_array( $plans ) || 0 === count( $plans ) ) {
65
+ return false;
66
+ }
67
+
68
+ /**
69
+ * @var FS_Plugin_Plan[] $plans
70
+ */
71
+ for ( $i = 0, $len = count( $plans ); $i < $len; $i ++ ) {
72
+ if ( ! $plans[ $i ]->is_free() ) {
73
+ return true;
74
+ }
75
+ }
76
+
77
+ return false;
78
+ }
79
+
80
+ /**
81
+ * Check if plugin has any free plan, or is it premium only.
82
+ *
83
+ * Note: If no plans configured, assume plugin is free.
84
+ *
85
+ * @author Vova Feldman (@svovaf)
86
+ * @since 1.0.7
87
+ *
88
+ * @param FS_Plugin_Plan[] $plans
89
+ *
90
+ * @return bool
91
+ */
92
+ function has_free_plan( $plans ) {
93
+ if ( ! is_array( $plans ) || 0 === count( $plans ) ) {
94
+ return true;
95
+ }
96
+
97
+ /**
98
+ * @var FS_Plugin_Plan[] $plans
99
+ */
100
+ for ( $i = 0, $len = count( $plans ); $i < $len; $i ++ ) {
101
+ if ( $plans[ $i ]->is_free() ) {
102
+ return true;
103
+ }
104
+ }
105
+
106
+ return false;
107
+ }
108
+
109
+ /**
110
+ * Find all plans that have trial.
111
+ *
112
+ * @author Vova Feldman (@svovaf)
113
+ * @since 1.0.9
114
+ *
115
+ * @param FS_Plugin_Plan[] $plans
116
+ *
117
+ * @return FS_Plugin_Plan[]
118
+ */
119
+ function get_trial_plans( $plans ) {
120
+ $trial_plans = array();
121
+
122
+ if ( is_array( $plans ) && 0 < count( $plans ) ) {
123
+ /**
124
+ * @var FS_Plugin_Plan[] $plans
125
+ */
126
+ for ( $i = 0, $len = count( $plans ); $i < $len; $i ++ ) {
127
+ if ( $plans[ $i ]->has_trial() ) {
128
+ $trial_plans[] = $plans[ $i ];
129
+ }
130
+ }
131
+ }
132
+
133
+ return $trial_plans;
134
+ }
135
+
136
+ /**
137
+ * Check if plugin has any trial plan.
138
+ *
139
+ * @author Vova Feldman (@svovaf)
140
+ * @since 1.0.9
141
+ *
142
+ * @param FS_Plugin_Plan[] $plans
143
+ *
144
+ * @return bool
145
+ */
146
+ function has_trial_plan( $plans ) {
147
+ if ( ! is_array( $plans ) || 0 === count( $plans ) ) {
148
+ return true;
149
+ }
150
+
151
+ /**
152
+ * @var FS_Plugin_Plan[] $plans
153
+ */
154
+ for ( $i = 0, $len = count( $plans ); $i < $len; $i ++ ) {
155
+ if ( $plans[ $i ]->has_trial() ) {
156
+ return true;
157
+ }
158
+ }
159
+
160
+ return false;
161
+ }
162
+ }
freemius/includes/managers/class-fs-plugin-manager.php ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ class FS_Plugin_Manager {
14
+ /**
15
+ * @var string
16
+ */
17
+ protected $_slug;
18
+ /**
19
+ * @var FS_Plugin
20
+ */
21
+ protected $_plugin;
22
+
23
+ /**
24
+ * @var FS_Plugin_Manager[]
25
+ */
26
+ private static $_instances = array();
27
+ /**
28
+ * @var FS_Logger
29
+ */
30
+ protected $_logger;
31
+
32
+ /**
33
+ * @param string $slug
34
+ *
35
+ * @return FS_Plugin_Manager
36
+ */
37
+ static function instance( $slug ) {
38
+ if ( ! isset( self::$_instances[ $slug ] ) ) {
39
+ self::$_instances[ $slug ] = new FS_Plugin_Manager( $slug );
40
+ }
41
+
42
+ return self::$_instances[ $slug ];
43
+ }
44
+
45
+ protected function __construct( $slug ) {
46
+ $this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $slug . '_' . 'plugins', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
47
+
48
+ $this->_slug = $slug;
49
+ $this->load();
50
+ }
51
+
52
+ protected function get_option_manager() {
53
+ return FS_Option_Manager::get_manager( WP_FS__ACCOUNTS_OPTION_NAME, true );
54
+ }
55
+
56
+ protected function get_all_plugins() {
57
+ return $this->get_option_manager()->get_option( 'plugins', array() );
58
+ }
59
+
60
+ /**
61
+ * Load plugin data from local DB.
62
+ *
63
+ * @author Vova Feldman (@svovaf)
64
+ * @since 1.0.6
65
+ */
66
+ function load() {
67
+ $all_plugins = $this->get_all_plugins();
68
+ $this->_plugin = isset( $all_plugins[ $this->_slug ] ) ?
69
+ $all_plugins[ $this->_slug ] :
70
+ null;
71
+ }
72
+
73
+ /**
74
+ * Store plugin on local DB.
75
+ *
76
+ * @author Vova Feldman (@svovaf)
77
+ * @since 1.0.6
78
+ *
79
+ * @param bool|FS_Plugin $plugin
80
+ * @param bool $flush
81
+ *
82
+ * @return bool|\FS_Plugin
83
+ */
84
+ function store( $plugin = false, $flush = true ) {
85
+ $all_plugins = $this->get_all_plugins();
86
+
87
+ if ( false !== $plugin ) {
88
+ $this->_plugin = $plugin;
89
+ }
90
+
91
+ $all_plugins[ $this->_slug ] = $this->_plugin;
92
+
93
+ $options_manager = $this->get_option_manager();
94
+ $options_manager->set_option( 'plugins', $all_plugins, $flush );
95
+
96
+ return $this->_plugin;
97
+ }
98
+
99
+ /**
100
+ * Update local plugin data if different.
101
+ *
102
+ * @author Vova Feldman (@svovaf)
103
+ * @since 1.0.6
104
+ *
105
+ * @param \FS_Plugin $plugin
106
+ * @param bool $store
107
+ *
108
+ * @return bool True if plugin was updated.
109
+ */
110
+ function update( FS_Plugin $plugin, $store = true ) {
111
+ if ( ! ( $this->_plugin instanceof FS_Plugin ) ||
112
+ $this->_plugin->slug != $plugin->slug ||
113
+ $this->_plugin->public_key != $plugin->public_key ||
114
+ $this->_plugin->secret_key != $plugin->secret_key ||
115
+ $this->_plugin->parent_plugin_id != $plugin->parent_plugin_id ||
116
+ $this->_plugin->title != $plugin->title
117
+ ) {
118
+ $this->store( $plugin, $store );
119
+
120
+ return true;
121
+ }
122
+
123
+ return false;
124
+ }
125
+
126
+ /**
127
+ * @author Vova Feldman (@svovaf)
128
+ * @since 1.0.6
129
+ *
130
+ * @param FS_Plugin $plugin
131
+ * @param bool $store
132
+ */
133
+ function set( FS_Plugin $plugin, $store = false ) {
134
+ $this->_plugin = $plugin;
135
+
136
+ if ( $store ) {
137
+ $this->store();
138
+ }
139
+ }
140
+
141
+ /**
142
+ * @author Vova Feldman (@svovaf)
143
+ * @since 1.0.6
144
+ *
145
+ * @return bool|\FS_Plugin
146
+ */
147
+ function get() {
148
+ return isset( $this->_plugin ) ?
149
+ $this->_plugin :
150
+ false;
151
+ }
152
+
153
+
154
+ }
freemius/includes/managers/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ // Silence is golden.
3
+ // Hide file structure from users on unprotected servers.
freemius/includes/sdk/Exceptions/ArgumentNotExistException.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
3
+ exit;
4
+ }
5
+
6
+ if ( ! class_exists( 'Freemius_ArgumentNotExistException' ) ) {
7
+ class Freemius_ArgumentNotExistException extends Freemius_InvalidArgumentException {
8
+ }
9
+ }
freemius/includes/sdk/Exceptions/EmptyArgumentException.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
3
+ exit;
4
+ }
5
+
6
+ if ( ! class_exists( 'Freemius_EmptyArgumentException' ) ) {
7
+ class Freemius_EmptyArgumentException extends Freemius_InvalidArgumentException {
8
+ }
9
+ }
freemius/includes/sdk/Exceptions/Exception.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! class_exists( 'Freemius_Exception' ) ) {
3
+ /**
4
+ * Thrown when an API call returns an exception.
5
+ *
6
+ */
7
+ class Freemius_Exception extends Exception {
8
+ protected $_result;
9
+ protected $_type;
10
+ protected $_code;
11
+
12
+ /**
13
+ * Make a new API Exception with the given result.
14
+ *
15
+ * @param array $result The result from the API server.
16
+ */
17
+ public function __construct( $result ) {
18
+ $this->_result = $result;
19
+
20
+ $code = 0;
21
+ $message = 'Unknown error, please check GetResult().';
22
+ $type = '';
23
+
24
+ if ( isset( $result['error'] ) && is_array( $result['error'] ) ) {
25
+ if ( isset( $result['error']['code'] ) ) {
26
+ $code = $result['error']['code'];
27
+ }
28
+ if ( isset( $result['error']['message'] ) ) {
29
+ $message = $result['error']['message'];
30
+ }
31
+ if ( isset( $result['error']['type'] ) ) {
32
+ $type = $result['error']['type'];
33
+ }
34
+ }
35
+
36
+ $this->_type = $type;
37
+ $this->_code = $code;
38
+
39
+ parent::__construct( $message, is_numeric( $code ) ? $code : 0 );
40
+ }
41
+
42
+ /**
43
+ * Return the associated result object returned by the API server.
44
+ *
45
+ * @return array The result from the API server
46
+ */
47
+ public function getResult() {
48
+ return $this->_result;
49
+ }
50
+
51
+ public function getStringCode() {
52
+ return $this->_code;
53
+ }
54
+
55
+ public function getType() {
56
+ return $this->_type;
57
+ }
58
+
59
+ /**
60
+ * To make debugging easier.
61
+ *
62
+ * @return string The string representation of the error
63
+ */
64
+ public function __toString() {
65
+ $str = $this->getType() . ': ';
66
+
67
+ if ( $this->code != 0 ) {
68
+ $str .= $this->getStringCode() . ': ';
69
+ }
70
+
71
+ return $str . $this->getMessage();
72
+ }
73
+ }
74
+ }
freemius/includes/sdk/Exceptions/InvalidArgumentException.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! class_exists( 'Freemius_Exception' ) ) {
3
+ exit;
4
+ }
5
+
6
+ if ( ! class_exists( 'Freemius_InvalidArgumentException' ) ) {
7
+ class Freemius_InvalidArgumentException extends Freemius_Exception { }
8
+ }
freemius/includes/sdk/Exceptions/OAuthException.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! class_exists( 'Freemius_Exception' ) ) {
3
+ exit;
4
+ }
5
+
6
+ if ( ! class_exists( 'Freemius_OAuthException' ) ) {
7
+ class Freemius_OAuthException extends Freemius_Exception {
8
+ public function __construct( $pResult ) {
9
+ parent::__construct( $pResult );
10
+ }
11
+ }
12
+ }
freemius/includes/sdk/Exceptions/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ // Silence is golden.
3
+ // Hide file structure from users on unprotected servers.
freemius/includes/sdk/Freemius.php ADDED
@@ -0,0 +1,583 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright 2014 Freemius, Inc.
4
+ *
5
+ * Licensed under the GPL v2 (the "License"); you may
6
+ * not use this file except in compliance with the License. You may obtain
7
+ * a copy of the License at
8
+ *
9
+ * http://choosealicense.com/licenses/gpl-v2/
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations
15
+ * under the License.
16
+ */
17
+
18
+ require_once dirname( __FILE__ ) . '/FreemiusBase.php';
19
+
20
+ if ( ! defined( 'FS_SDK__USER_AGENT' ) ) {
21
+ define( 'FS_SDK__USER_AGENT', 'fs-php-' . Freemius_Api_Base::VERSION );
22
+ }
23
+
24
+ if ( ! defined( 'FS_SDK__SIMULATE_NO_CURL' ) ) {
25
+ define( 'FS_SDK__SIMULATE_NO_CURL', false );
26
+ }
27
+
28
+ if ( ! defined( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE' ) ) {
29
+ define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE', false );
30
+ }
31
+
32
+ if ( ! defined( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL' ) ) {
33
+ define( 'FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL', false );
34
+ }
35
+
36
+ if ( ! defined( 'FS_SDK__HAS_CURL' ) ) {
37
+ define( 'FS_SDK__HAS_CURL', ! FS_SDK__SIMULATE_NO_CURL && function_exists( 'curl_version' ) );
38
+ }
39
+
40
+ if ( ! FS_SDK__HAS_CURL ) {
41
+ $curl_version = array( 'version' => '7.0.0' );
42
+ } else {
43
+ $curl_version = curl_version();
44
+ }
45
+
46
+ if ( ! defined( 'FS_API__PROTOCOL' ) ) {
47
+ define( 'FS_API__PROTOCOL', version_compare( $curl_version['version'], '7.37', '>=' ) ? 'https' : 'http' );
48
+ }
49
+
50
+ if ( ! defined( 'FS_API__LOGGER_ON' ) ) {
51
+ define( 'FS_API__LOGGER_ON', false );
52
+ }
53
+
54
+ if ( ! defined( 'FS_API__ADDRESS' ) ) {
55
+ define( 'FS_API__ADDRESS', '://api.freemius.com' );
56
+ }
57
+ if ( ! defined( 'FS_API__SANDBOX_ADDRESS' ) ) {
58
+ define( 'FS_API__SANDBOX_ADDRESS', '://sandbox-api.freemius.com' );
59
+ }
60
+
61
+ if ( class_exists( 'Freemius_Api' ) ) {
62
+ return;
63
+ }
64
+
65
+ class Freemius_Api extends Freemius_Api_Base {
66
+ private static $_logger = array();
67
+
68
+ /**
69
+ * @param string $pScope 'app', 'developer', 'user' or 'install'.
70
+ * @param number $pID Element's id.
71
+ * @param string $pPublic Public key.
72
+ * @param string|bool $pSecret Element's secret key.
73
+ * @param bool $pSandbox Whether or not to run API in sandbox mode.
74
+ */
75
+ public function __construct( $pScope, $pID, $pPublic, $pSecret = false, $pSandbox = false ) {
76
+ // If secret key not provided, use public key encryption.
77
+ if ( is_bool( $pSecret ) ) {
78
+ $pSecret = $pPublic;
79
+ }
80
+
81
+ parent::Init( $pScope, $pID, $pPublic, $pSecret, $pSandbox );
82
+ }
83
+
84
+ public static function GetUrl( $pCanonizedPath = '', $pIsSandbox = false ) {
85
+ $address = ( $pIsSandbox ? FS_API__SANDBOX_ADDRESS : FS_API__ADDRESS );
86
+
87
+ if ( ':' === $address[0] ) {
88
+ $address = self::$_protocol . $address;
89
+ }
90
+
91
+ return $address . $pCanonizedPath;
92
+ }
93
+
94
+ #region Servers Clock Diff ------------------------------------------------------
95
+
96
+ /**
97
+ * @var int Clock diff in seconds between current server to API server.
98
+ */
99
+ private static $_clock_diff = 0;
100
+
101
+ /**
102
+ * Set clock diff for all API calls.
103
+ *
104
+ * @since 1.0.3
105
+ *
106
+ * @param $pSeconds
107
+ */
108
+ public static function SetClockDiff( $pSeconds ) {
109
+ self::$_clock_diff = $pSeconds;
110
+ }
111
+
112
+ /**
113
+ * Find clock diff between current server to API server.
114
+ *
115
+ * @since 1.0.2
116
+ * @return int Clock diff in seconds.
117
+ */
118
+ public static function FindClockDiff() {
119
+ $time = time();
120
+ $pong = self::Ping();
121
+
122
+ return ( $time - strtotime( $pong->timestamp ) );
123
+ }
124
+
125
+ #endregion Servers Clock Diff ------------------------------------------------------
126
+
127
+ /**
128
+ * @var string http or https
129
+ */
130
+ private static $_protocol = FS_API__PROTOCOL;
131
+
132
+ /**
133
+ * Set API connection protocol.
134
+ *
135
+ * @since 1.0.4
136
+ */
137
+ public static function SetHttp() {
138
+ self::$_protocol = 'http';
139
+ }
140
+
141
+ /**
142
+ * @since 1.0.4
143
+ *
144
+ * @return bool
145
+ */
146
+ public static function IsHttps() {
147
+ return ( 'https' === self::$_protocol );
148
+ }
149
+
150
+ /**
151
+ * Sign request with the following HTTP headers:
152
+ * Content-MD5: MD5(HTTP Request body)
153
+ * Date: Current date (i.e Sat, 14 Feb 2015 20:24:46 +0000)
154
+ * Authorization: FS {scope_entity_id}:{scope_entity_public_key}:base64encode(sha256(string_to_sign,
155
+ * {scope_entity_secret_key}))
156
+ *
157
+ * @param string $pResourceUrl
158
+ * @param array $pCurlOptions
159
+ *
160
+ * @return array
161
+ */
162
+ function SignRequest( $pResourceUrl, $pCurlOptions ) {
163
+ $eol = "\n";
164
+ $content_md5 = '';
165
+ $now = ( time() - self::$_clock_diff );
166
+ $date = date( 'r', $now );
167
+ $content_type = '';
168
+
169
+ if ( isset( $pCurlOptions[ CURLOPT_POST ] ) && 0 < $pCurlOptions[ CURLOPT_POST ] ) {
170
+ $content_md5 = md5( $pCurlOptions[ CURLOPT_POSTFIELDS ] );
171
+ $pCurlOptions[ CURLOPT_HTTPHEADER ][] = 'Content-MD5: ' . $content_md5;
172
+ $content_type = 'application/json';
173
+ }
174
+
175
+ $pCurlOptions[ CURLOPT_HTTPHEADER ][] = 'Date: ' . $date;
176
+
177
+ $string_to_sign = implode( $eol, array(
178
+ $pCurlOptions[ CURLOPT_CUSTOMREQUEST ],
179
+ $content_md5,
180
+ $content_type,
181
+ $date,
182
+ $pResourceUrl
183
+ ) );
184
+
185
+ // If secret and public keys are identical, it means that
186
+ // the signature uses public key hash encoding.
187
+ $auth_type = ( $this->_secret !== $this->_public ) ? 'FS' : 'FSP';
188
+
189
+ // Add authorization header.
190
+ $pCurlOptions[ CURLOPT_HTTPHEADER ][] = 'Authorization: ' .
191
+ $auth_type . ' ' .
192
+ $this->_id . ':' .
193
+ $this->_public . ':' .
194
+ self::Base64UrlEncode(
195
+ hash_hmac( 'sha256', $string_to_sign, $this->_secret )
196
+ );
197
+
198
+ return $pCurlOptions;
199
+ }
200
+
201
+ /**
202
+ * Get API request URL signed via query string.
203
+ *
204
+ * @param string $pPath
205
+ *
206
+ * @throws Freemius_Exception
207
+ *
208
+ * @return string
209
+ */
210
+ function GetSignedUrl( $pPath ) {
211
+ $resource = explode( '?', $this->CanonizePath( $pPath ) );
212
+ $pResourceUrl = $resource[0];
213
+
214
+ $eol = "\n";
215
+ $content_md5 = '';
216
+ $content_type = '';
217
+ $now = ( time() - self::$_clock_diff );
218
+ $date = date( 'r', $now );
219
+
220
+ $string_to_sign = implode( $eol, array(
221
+ 'GET',
222
+ $content_md5,
223
+ $content_type,
224
+ $date,
225
+ $pResourceUrl
226
+ ) );
227
+
228
+ // If secret and public keys are identical, it means that
229
+ // the signature uses public key hash encoding.
230
+ $auth_type = ( $this->_secret !== $this->_public ) ? 'FS' : 'FSP';
231
+
232
+ return Freemius_Api::GetUrl(
233
+ $pResourceUrl . '?' .
234
+ ( 1 < count( $resource ) && ! empty( $resource[1] ) ? $resource[1] . '&' : '' ) .
235
+ http_build_query( array(
236
+ 'auth_date' => $date,
237
+ 'authorization' => $auth_type . ' ' . $this->_id . ':' .
238
+ $this->_public . ':' .
239
+ self::Base64UrlEncode( hash_hmac(
240
+ 'sha256', $string_to_sign, $this->_secret
241
+ ) )
242
+ ) ), $this->_isSandbox );
243
+ }
244
+
245
+ /**
246
+ * @param resource $pCurlHandler
247
+ * @param array $pCurlOptions
248
+ *
249
+ * @return mixed
250
+ */
251
+ private static function ExecuteRequest( &$pCurlHandler, &$pCurlOptions ) {
252
+ $start = microtime( true );
253
+
254
+ $result = curl_exec( $pCurlHandler );
255
+
256
+ if ( FS_API__LOGGER_ON ) {
257
+ $end = microtime( true );
258
+
259
+ $has_body = ( isset( $pCurlOptions[ CURLOPT_POST ] ) && 0 < $pCurlOptions[ CURLOPT_POST ] );
260
+
261
+ self::$_logger[] = array(
262
+ 'id' => count( self::$_logger ),
263
+ 'start' => $start,
264
+ 'end' => $end,
265
+ 'total' => ( $end - $start ),
266
+ 'method' => $pCurlOptions[ CURLOPT_CUSTOMREQUEST ],
267
+ 'path' => $pCurlOptions[ CURLOPT_URL ],
268
+ 'body' => $has_body ? $pCurlOptions[ CURLOPT_POSTFIELDS ] : null,
269
+ 'result' => $result,
270
+ 'code' => curl_getinfo( $pCurlHandler, CURLINFO_HTTP_CODE ),
271
+ 'backtrace' => debug_backtrace(),
272
+ );
273
+ }
274
+
275
+ return $result;
276
+ }
277
+
278
+ /**
279
+ * @return array
280
+ */
281
+ static function GetLogger() {
282
+ return self::$_logger;
283
+ }
284
+
285
+ /**
286
+ * @param string $pCanonizedPath
287
+ * @param string $pMethod
288
+ * @param array $pParams
289
+ * @param null|resource $pCurlHandler
290
+ * @param bool $pIsSandbox
291
+ * @param null|callable $pBeforeExecutionFunction
292
+ *
293
+ * @return object[]|object|null
294
+ *
295
+ * @throws \Freemius_Exception
296
+ */
297
+ private static function MakeStaticRequest(
298
+ $pCanonizedPath,
299
+ $pMethod = 'GET',
300
+ $pParams = array(),
301
+ $pCurlHandler = null,
302
+ $pIsSandbox = false,
303
+ $pBeforeExecutionFunction = null
304
+ ) {
305
+ if ( ! FS_SDK__HAS_CURL ) {
306
+ self::ThrowNoCurlException();
307
+ }
308
+
309
+ // Connectivity errors simulation.
310
+ if ( FS_SDK__SIMULATE_NO_API_CONNECTIVITY_CLOUDFLARE ) {
311
+ self::ThrowCloudFlareDDoSException();
312
+ } else if ( FS_SDK__SIMULATE_NO_API_CONNECTIVITY_SQUID_ACL ) {
313
+ self::ThrowSquidAclException();
314
+ }
315
+
316
+ if ( ! $pCurlHandler ) {
317
+ $pCurlHandler = curl_init();
318
+ }
319
+
320
+ $opts = array(
321
+ CURLOPT_CONNECTTIMEOUT => 10,
322
+ CURLOPT_RETURNTRANSFER => true,
323
+ CURLOPT_TIMEOUT => 60,
324
+ CURLOPT_USERAGENT => FS_SDK__USER_AGENT,
325
+ CURLOPT_HTTPHEADER => array(),
326
+ );
327
+
328
+ if ( 'POST' === $pMethod || 'PUT' === $pMethod ) {
329
+ if ( is_array( $pParams ) && 0 < count( $pParams ) ) {
330
+ $opts[ CURLOPT_HTTPHEADER ][] = 'Content-Type: application/json';
331
+ $opts[ CURLOPT_POST ] = count( $pParams );
332
+ $opts[ CURLOPT_POSTFIELDS ] = json_encode( $pParams );
333
+ }
334
+
335
+ $opts[ CURLOPT_RETURNTRANSFER ] = true;
336
+ }
337
+
338
+ $request_url = self::GetUrl( $pCanonizedPath, $pIsSandbox );
339
+
340
+ $opts[ CURLOPT_URL ] = $request_url;
341
+ $opts[ CURLOPT_CUSTOMREQUEST ] = $pMethod;
342
+
343
+ $resource = explode( '?', $pCanonizedPath );
344
+
345
+ // disable the 'Expect: 100-continue' behaviour. This causes CURL to wait
346
+ // for 2 seconds if the server does not support this header.
347
+ $opts[ CURLOPT_HTTPHEADER ][] = 'Expect:';
348
+
349
+ if ( 'https' === substr( strtolower( $request_url ), 0, 5 ) ) {
350
+ $opts[ CURLOPT_SSL_VERIFYHOST ] = false;
351
+ $opts[ CURLOPT_SSL_VERIFYPEER ] = false;
352
+ }
353
+
354
+ if ( false !== $pBeforeExecutionFunction &&
355
+ is_callable( $pBeforeExecutionFunction )
356
+ ) {
357
+ $opts = call_user_func( $pBeforeExecutionFunction, $resource[0], $opts );
358
+ }
359
+
360
+ curl_setopt_array( $pCurlHandler, $opts );
361
+ $result = self::ExecuteRequest( $pCurlHandler, $opts );
362
+
363
+ /*if (curl_errno($ch) == 60) // CURLE_SSL_CACERT
364
+ {
365
+ self::errorLog('Invalid or no certificate authority found, using bundled information');
366
+ curl_setopt($ch, CURLOPT_CAINFO,
367
+ dirname(__FILE__) . '/fb_ca_chain_bundle.crt');
368
+ $result = curl_exec($ch);
369
+ }*/
370
+
371
+ // With dual stacked DNS responses, it's possible for a server to
372
+ // have IPv6 enabled but not have IPv6 connectivity. If this is
373
+ // the case, curl will try IPv4 first and if that fails, then it will
374
+ // fall back to IPv6 and the error EHOSTUNREACH is returned by the
375
+ // operating system.
376
+ if ( false === $result && empty( $opts[ CURLOPT_IPRESOLVE ] ) ) {
377
+ $matches = array();
378
+ $regex = '/Failed to connect to ([^:].*): Network is unreachable/';
379
+ if ( preg_match( $regex, curl_error( $pCurlHandler ), $matches ) ) {
380
+ if ( strlen( @inet_pton( $matches[1] ) ) === 16 ) {
381
+ // self::errorLog('Invalid IPv6 configuration on server, Please disable or get native IPv6 on your server.');
382
+ $opts[ CURLOPT_IPRESOLVE ] = CURL_IPRESOLVE_V4;
383
+ curl_setopt( $pCurlHandler, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );
384
+ $result = self::ExecuteRequest( $pCurlHandler, $opts );
385
+ }
386
+ }
387
+ }
388
+
389
+ if ( $result === false ) {
390
+ self::ThrowCurlException( $pCurlHandler );
391
+ }
392
+
393
+ curl_close( $pCurlHandler );
394
+
395
+ if ( empty( $result ) ) {
396
+ return null;
397
+ }
398
+
399
+ $decoded = json_decode( $result );
400
+
401
+ if ( is_null( $decoded ) ) {
402
+ if ( preg_match( '/Please turn JavaScript on/i', $result ) &&
403
+ preg_match( '/text\/javascript/', $result )
404
+ ) {
405
+ self::ThrowCloudFlareDDoSException( $result );
406
+ } else if ( preg_match( '/Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect./', $result ) &&
407
+ preg_match( '/squid/', $result )
408
+ ) {
409
+ self::ThrowSquidAclException( $result );
410
+ } else {
411
+ $decoded = (object) array(
412
+ 'error' => (object) array(
413
+ 'type' => 'Unknown',
414
+ 'message' => $result,
415
+ 'code' => 'unknown',
416
+ 'http' => 402
417
+ )
418
+ );
419
+ }
420
+ }
421
+
422
+ return $decoded;
423
+ }
424
+
425
+
426
+ /**
427
+ * Makes an HTTP request. This method can be overridden by subclasses if
428
+ * developers want to do fancier things or use something other than curl to
429
+ * make the request.
430
+ *
431
+ * @param string $pCanonizedPath The URL to make the request to
432
+ * @param string $pMethod HTTP method
433
+ * @param array $pParams The parameters to use for the POST body
434
+ * @param null|resource $pCurlHandler Initialized curl handle
435
+ *
436
+ * @return object[]|object|null
437
+ *
438
+ * @throws Freemius_Exception
439
+ */
440
+ public function MakeRequest(
441
+ $pCanonizedPath,
442
+ $pMethod = 'GET',
443
+ $pParams = array(),
444
+ $pCurlHandler = null
445
+ ) {
446
+ $resource = explode( '?', $pCanonizedPath );
447
+
448
+ // Only sign request if not ping.json connectivity test.
449
+ $sign_request = ( '/v1/ping.json' !== strtolower( substr( $resource[0], - strlen( '/v1/ping.json' ) ) ) );
450
+
451
+ return self::MakeStaticRequest(
452
+ $pCanonizedPath,
453
+ $pMethod,
454
+ $pParams,
455
+ $pCurlHandler,
456
+ $this->_isSandbox,
457
+ $sign_request ? array( &$this, 'SignRequest' ) : null
458
+ );
459
+ }
460
+
461
+ #region Connectivity Test ------------------------------------------------------
462
+
463
+ /**
464
+ * If successful connectivity to the API endpoint using ping.json endpoint.
465
+ *
466
+ * - OR -
467
+ *
468
+ * Validate if ping result object is valid.
469
+ *
470
+ * @param mixed $pPong
471
+ *
472
+ * @return bool
473
+ */
474
+ public static function Test( $pPong = null ) {
475
+ $pong = is_null( $pPong ) ?
476
+ self::Ping() :
477
+ $pPong;
478
+
479
+ return (
480
+ is_object( $pong ) &&
481
+ isset( $pong->api ) &&
482
+ 'pong' === $pong->api
483
+ );
484
+ }
485
+
486
+ /**
487
+ * Ping API to test connectivity.
488
+ *
489
+ * @return object
490
+ */
491
+ public static function Ping() {
492
+ try {
493
+ $result = self::MakeStaticRequest( '/v' . FS_API__VERSION . '/ping.json' );
494
+ } catch ( Freemius_Exception $e ) {
495
+ // Map to error object.
496
+ $result = (object) $e->getResult();
497
+ } catch ( Exception $e ) {
498
+ // Map to error object.
499
+ $result = (object) array(
500
+ 'error' => array(
501
+ 'type' => 'Unknown',
502
+ 'message' => $e->getMessage() . ' (' . $e->getFile() . ': ' . $e->getLine() . ')',
503
+ 'code' => 'unknown',
504
+ 'http' => 402
505
+ )
506
+ );
507
+ }
508
+
509
+ return $result;
510
+ }
511
+
512
+ #endregion Connectivity Test ------------------------------------------------------
513
+
514
+ #region Connectivity Exceptions ------------------------------------------------------
515
+
516
+ /**
517
+ * @param resource $pCurlHandler
518
+ *
519
+ * @throws Freemius_Exception
520
+ */
521
+ private static function ThrowCurlException( $pCurlHandler ) {
522
+ $e = new Freemius_Exception( array(
523
+ 'error' => array(
524
+ 'code' => curl_errno( $pCurlHandler ),
525
+ 'message' => curl_error( $pCurlHandler ),
526
+ 'type' => 'CurlException',
527
+ ),
528
+ ) );
529
+
530
+ curl_close( $pCurlHandler );
531
+ throw $e;
532
+ }
533
+
534
+ /**
535
+ * @param string $pResult
536
+ *
537
+ * @throws Freemius_Exception
538
+ */
539
+ private static function ThrowNoCurlException( $pResult = '' ) {
540
+ throw new Freemius_Exception( array(
541
+ 'error' => (object) array(
542
+ 'type' => 'cUrlMissing',
543
+ 'message' => $pResult,
544
+ 'code' => 'curl_missing',
545
+ 'http' => 402
546
+ )
547
+ ) );
548
+ }
549
+
550
+ /**
551
+ * @param string $pResult
552
+ *
553
+ * @throws Freemius_Exception
554
+ */
555
+ private static function ThrowCloudFlareDDoSException( $pResult = '' ) {
556
+ throw new Freemius_Exception( array(
557
+ 'error' => (object) array(
558
+ 'type' => 'CloudFlareDDoSProtection',
559
+ 'message' => $pResult,
560
+ 'code' => 'cloudflare_ddos_protection',
561
+ 'http' => 402
562
+ )
563
+ ) );
564
+ }
565
+
566
+ /**
567
+ * @param string $pResult
568
+ *
569
+ * @throws Freemius_Exception
570
+ */
571
+ private static function ThrowSquidAclException( $pResult = '' ) {
572
+ throw new Freemius_Exception( array(
573
+ 'error' => (object) array(
574
+ 'type' => 'SquidCacheBlock',
575
+ 'message' => $pResult,
576
+ 'code' => 'squid_cache_block',
577
+ 'http' => 402
578
+ )
579
+ ) );
580
+ }
581
+
582
+ #endregion Connectivity Exceptions ------------------------------------------------------
583
+ }
freemius/includes/sdk/FreemiusBase.php ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright 2014 Freemius, Inc.
4
+ *
5
+ * Licensed under the GPL v2 (the "License"); you may
6
+ * not use this file except in compliance with the License. You may obtain
7
+ * a copy of the License at
8
+ *
9
+ * http://choosealicense.com/licenses/gpl-v2/
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations
15
+ * under the License.
16
+ */
17
+
18
+ if ( ! defined( 'FS_API__VERSION' ) ) {
19
+ define( 'FS_API__VERSION', '1' );
20
+ }
21
+ if ( ! defined( 'FS_SDK__PATH' ) ) {
22
+ define( 'FS_SDK__PATH', dirname( __FILE__ ) );
23
+ }
24
+ if ( ! defined( 'FS_SDK__EXCEPTIONS_PATH' ) ) {
25
+ define( 'FS_SDK__EXCEPTIONS_PATH', FS_SDK__PATH . '/Exceptions/' );
26
+ }
27
+
28
+ if ( ! function_exists( 'json_decode' ) ) {
29
+ throw new Exception( 'Freemius needs the JSON PHP extension.' );
30
+ }
31
+
32
+ // Include all exception files.
33
+ $exceptions = array(
34
+ 'Exception',
35
+ 'InvalidArgumentException',
36
+ 'ArgumentNotExistException',
37
+ 'EmptyArgumentException',
38
+ 'OAuthException'
39
+ );
40
+
41
+ foreach ( $exceptions as $e ) {
42
+ require_once FS_SDK__EXCEPTIONS_PATH . $e . '.php';
43
+ }
44
+
45
+ if ( class_exists( 'Freemius_Api_Base' ) ) {
46
+ return;
47
+ }
48
+
49
+ abstract class Freemius_Api_Base {
50
+ const VERSION = '1.0.4';
51
+ const FORMAT = 'json';
52
+
53
+ protected $_id;
54
+ protected $_public;
55
+ protected $_secret;
56
+ protected $_scope;
57
+ protected $_isSandbox;
58
+
59
+ /**
60
+ * @param string $pScope 'app', 'developer', 'plugin', 'user' or 'install'.
61
+ * @param number $pID Element's id.
62
+ * @param string $pPublic Public key.
63
+ * @param string $pSecret Element's secret key.
64
+ * @param bool $pIsSandbox Whether or not to run API in sandbox mode.
65
+ */
66
+ public function Init( $pScope, $pID, $pPublic, $pSecret, $pIsSandbox = false ) {
67
+ $this->_id = $pID;
68
+ $this->_public = $pPublic;
69
+ $this->_secret = $pSecret;
70
+ $this->_scope = $pScope;
71
+ $this->_isSandbox = $pIsSandbox;
72
+ }
73
+
74
+ public function IsSandbox() {
75
+ return $this->_isSandbox;
76
+ }
77
+
78
+ function CanonizePath( $pPath ) {
79
+ $pPath = trim( $pPath, '/' );
80
+ $query_pos = strpos( $pPath, '?' );
81
+ $query = '';
82
+
83
+ if ( false !== $query_pos ) {
84
+ $query = substr( $pPath, $query_pos );
85
+ $pPath = substr( $pPath, 0, $query_pos );
86
+ }
87
+
88
+ // Trim '.json' suffix.
89
+ $format_length = strlen( '.' . self::FORMAT );
90
+ $start = $format_length * ( - 1 ); //negative
91
+ if ( substr( strtolower( $pPath ), $start ) === ( '.' . self::FORMAT ) ) {
92
+ $pPath = substr( $pPath, 0, strlen( $pPath ) - $format_length );
93
+ }
94
+
95
+ switch ( $this->_scope ) {
96
+ case 'app':
97
+ $base = '/apps/' . $this->_id;
98
+ break;
99
+ case 'developer':
100
+ $base = '/developers/' . $this->_id;
101
+ break;
102
+ case 'user':
103
+ $base = '/users/' . $this->_id;
104
+ break;
105
+ case 'plugin':
106
+ $base = '/plugins/' . $this->_id;
107
+ break;
108
+ case 'install':
109
+ $base = '/installs/' . $this->_id;
110
+ break;
111
+ default:
112
+ throw new Freemius_Exception( 'Scope not implemented.' );
113
+ }
114
+
115
+ return '/v' . FS_API__VERSION . $base .
116
+ ( ! empty( $pPath ) ? '/' : '' ) . $pPath .
117
+ ( ( false === strpos( $pPath, '.' ) ) ? '.' . self::FORMAT : '' ) . $query;
118
+ }
119
+
120
+ abstract function MakeRequest( $pCanonizedPath, $pMethod = 'GET', $pParams = array() );
121
+
122
+ /**
123
+ * @param string $pPath
124
+ * @param string $pMethod
125
+ * @param array $pParams
126
+ *
127
+ * @return object[]|object|null
128
+ */
129
+ private function _Api( $pPath, $pMethod = 'GET', $pParams = array() ) {
130
+ $pMethod = strtoupper( $pMethod );
131
+
132
+ try {
133
+ $result = $this->MakeRequest( $pPath, $pMethod, $pParams );
134
+ } catch ( Freemius_Exception $e ) {
135
+ // Map to error object.
136
+ $result = (object) $e->getResult();
137
+ } catch ( Exception $e ) {
138
+ // Map to error object.
139
+ $result = (object) array(
140
+ 'error' => array(
141
+ 'type' => 'Unknown',
142
+ 'message' => $e->getMessage() . ' (' . $e->getFile() . ': ' . $e->getLine() . ')',
143
+ 'code' => 'unknown',
144
+ 'http' => 402
145
+ )
146
+ );
147
+ }
148
+
149
+ return $result;
150
+ }
151
+
152
+ public function Api( $pPath, $pMethod = 'GET', $pParams = array() ) {
153
+ return $this->_Api( $this->CanonizePath( $pPath ), $pMethod, $pParams );
154
+ }
155
+
156
+ /**
157
+ * Base64 encoding that does not need to be urlencode()ed.
158
+ * Exactly the same as base64_encode except it uses
159
+ * - instead of +
160
+ * _ instead of /
161
+ * No padded =
162
+ *
163
+ * @param string $input base64UrlEncoded string
164
+ *
165
+ * @return string
166
+ */
167
+ protected static function Base64UrlDecode( $input ) {
168
+ return base64_decode( strtr( $input, '-_', '+/' ) );
169
+ }
170
+
171
+ /**
172
+ * Base64 encoding that does not need to be urlencode()ed.
173
+ * Exactly the same as base64_encode except it uses
174
+ * - instead of +
175
+ * _ instead of /
176
+ *
177
+ * @param string $input string
178
+ *
179
+ * @return string base64Url encoded string
180
+ */
181
+ protected static function Base64UrlEncode( $input ) {
182
+ $str = strtr( base64_encode( $input ), '+/', '-_' );
183
+ $str = str_replace( '=', '', $str );
184
+
185
+ return $str;
186
+ }
187
+
188
+ }
freemius/includes/sdk/LICENSE.txt ADDED
@@ -0,0 +1,340 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,3 @@
 
 
 
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 ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ exit;
11
+ }
12
+
13
+ /**
14
+ * Find the plugin main file path based on any give file inside the plugin's folder.
15
+ *
16
+ * @author Vova Feldman (@svovaf)
17
+ * @since 1.1.7.1
18
+ *
19
+ * @param string $file Absolute path to a file inside a plugin's folder.
20
+ *
21
+ * @return string
22
+ */
23
+ function fs_find_direct_caller_plugin_file( $file ) {
24
+ /**
25
+ * All the code below will be executed once on activation.
26
+ * If the user changes the main plugin's file name, the file_exists()
27
+ * will catch it.
28
+ */
29
+ if ( ! function_exists( 'get_plugins' ) ) {
30
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
31
+ }
32
+
33
+ $all_plugins = get_plugins();
34
+
35
+ $file_real_path = fs_normalize_path( realpath( $file ) );
36
+
37
+ // Get active plugin's main files real full names (might be symlinks).
38
+ foreach ( $all_plugins as $relative_path => &$data ) {
39
+ if ( 0 === strpos( $file_real_path, fs_normalize_path( dirname( realpath( WP_PLUGIN_DIR . '/' . $relative_path ) ) ) ) ) {
40
+ if ( '.' !== dirname( trailingslashit( $relative_path ) ) ) {
41
+ return $relative_path;
42
+ }
43
+ }
44
+ }
45
+
46
+ return null;
47
+ }
freemius/includes/supplements/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ // Silence is golden.
3
+ // Hide file structure from users on unprotected servers.
freemius/index.php ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ // Silence is golden.
3
+ // Hide file structure from users on unprotected servers.
freemius/languages/freemius-da_DK.mo ADDED
Binary file
freemius/languages/freemius-da_DK.po ADDED
@@ -0,0 +1,1661 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2016 freemius
2
+ # This file is distributed under the same license as the freemius package.
3
+ # Translators:
4
+ # Joachim Jensen <jv@intox.dk>, 2016
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
+ "PO-Revision-Date: 2016-12-07 01:29+0000\n"
10
+ "Last-Translator: Vova Feldman <vova@freemius.com>\n"
11
+ "Language-Team: Danish (Denmark) (http://www.transifex.com/freemius/wordpress-sdk/language/da_DK/)\n"
12
+ "MIME-Version: 1.0\n"
13
+ "Content-Type: text/plain; charset=UTF-8\n"
14
+ "Content-Transfer-Encoding: 8bit\n"
15
+ "Language: da_DK\n"
16
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
+ "X-Poedit-Basepath: ..\n"
18
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
19
+ "X-Poedit-SearchPath-0: .\n"
20
+ "X-Poedit-SearchPathExcluded-0: *.js\n"
21
+ "X-Poedit-SourceCharset: UTF-8\n"
22
+
23
+ #: includes/i18n.php41, includes/i18n.php:55
24
+ msgid "Yes - I'm in!"
25
+ msgstr "Ja - jeg er med!"
26
+
27
+ #: includes/i18n.php43, includes/i18n.php:57
28
+ msgid "Not today"
29
+ msgstr "Ikke i dag"
30
+
31
+ #: includes/i18n.php:69
32
+ msgid "Account"
33
+ msgstr "Konto"
34
+
35
+ #: includes/i18n.php:71
36
+ msgid "Add On"
37
+ msgstr "Tilføjelse"
38
+
39
+ #: includes/i18n.php:73
40
+ msgid "Contact Us"
41
+ msgstr "Kontakt os"
42
+
43
+ #: includes/i18n.php:75
44
+ msgid "Contact Support"
45
+ msgstr "Kontakt support"
46
+
47
+ #: includes/i18n.php:77
48
+ msgid "Change Ownership"
49
+ msgstr "Skift ejerskab"
50
+
51
+ #: includes/i18n.php:79
52
+ msgid "Support"
53
+ msgstr "Support"
54
+
55
+ #: includes/i18n.php:81
56
+ msgid "Support Forum"
57
+ msgstr "Supportforum"
58
+
59
+ #: includes/i18n.php:83
60
+ msgid "Add Ons"
61
+ msgstr "Tilføjelser"
62
+
63
+ #: includes/i18n.php:85
64
+ msgctxt "verb"
65
+ msgid "Upgrade"
66
+ msgstr "Opgrader"
67
+
68
+ #: includes/i18n.php:87
69
+ msgid "Awesome"
70
+ msgstr "Sejt"
71
+
72
+ #: includes/i18n.php:89
73
+ msgctxt "noun"
74
+ msgid "Pricing"
75
+ msgstr "Priser"
76
+
77
+ #: includes/i18n.php:91
78
+ msgctxt "noun"
79
+ msgid "Price"
80
+ msgstr "Pris"
81
+
82
+ #: includes/i18n.php:93
83
+ msgid "Unlimited Updates"
84
+ msgstr "Ubegrænsede opdateringer"
85
+
86
+ #: includes/i18n.php:95
87
+ msgctxt "verb"
88
+ msgid "Downgrade"
89
+ msgstr "Nedgrader"
90
+
91
+ #: includes/i18n.php:97
92
+ msgid "Cancel Trial"
93
+ msgstr "Annuller prøveperiode"
94
+
95
+ #: includes/i18n.php:99
96
+ msgid "Free Trial"
97
+ msgstr "Gratis prøveperiode"
98
+
99
+ #: includes/i18n.php:101
100
+ msgid "Start my free %s"
101
+ msgstr "Start min gratis %s"
102
+
103
+ #: includes/i18n.php:103
104
+ msgid "No commitment for %s - cancel anytime"
105
+ msgstr "Ingen bindinger ved %s - annuller når som helst"
106
+
107
+ #: includes/i18n.php:105
108
+ msgid "After your free %s, pay as little as %s"
109
+ msgstr "Efter din gratis %s er prisen kun %s"
110
+
111
+ #: includes/i18n.php:107
112
+ msgid "Details"
113
+ msgstr "Detaljer"
114
+
115
+ #: includes/i18n.php:109
116
+ msgid "Account Details"
117
+ msgstr "Kontodetaljer"
118
+
119
+ #: includes/i18n.php:111
120
+ msgctxt "verb"
121
+ msgid "Delete"
122
+ msgstr "Slet"
123
+
124
+ #: includes/i18n.php:113
125
+ msgctxt "verb"
126
+ msgid "Show"
127
+ msgstr "Vis"
128
+
129
+ #: includes/i18n.php:115
130
+ msgctxt "verb"
131
+ msgid "Hide"
132
+ msgstr "Skjul"
133
+
134
+ #: includes/i18n.php:117
135
+ msgctxt "verb"
136
+ msgid "Edit"
137
+ msgstr "Rediger"
138
+
139
+ #: includes/i18n.php:119
140
+ msgctxt "verb"
141
+ msgid "Update"
142
+ msgstr ""
143
+
144
+ #: includes/i18n.php:121
145
+ msgid "Date"
146
+ msgstr "Dato"
147
+
148
+ #: includes/i18n.php:123
149
+ msgid "Amount"
150
+ msgstr "Beløb"
151
+
152
+ #: includes/i18n.php:125
153
+ msgid "Invoice"
154
+ msgstr "Faktura"
155
+
156
+ #: includes/i18n.php:127
157
+ msgid "Billing"
158
+ msgstr "Betaling"
159
+
160
+ #: includes/i18n.php:129
161
+ msgid "Payments"
162
+ msgstr "Betalinger"
163
+
164
+ #: includes/i18n.php:131
165
+ msgid "Delete Account"
166
+ msgstr "Slet konto"
167
+
168
+ #: includes/i18n.php:133
169
+ msgctxt "as close a window"
170
+ msgid "Dismiss"
171
+ msgstr "Fjern"
172
+
173
+ #: includes/i18n.php:135
174
+ msgctxt "as product pricing plan"
175
+ msgid "Plan"
176
+ msgstr "Plan"
177
+
178
+ #: includes/i18n.php:137
179
+ msgid "Change Plan"
180
+ msgstr "Skift plan"
181
+
182
+ #: includes/i18n.php:139
183
+ msgctxt "as download professional version"
184
+ msgid "Download %s Version"
185
+ msgstr ""
186
+
187
+ #: includes/i18n.php:141
188
+ msgctxt "as download professional version now"
189
+ msgid "Download %s version now"
190
+ msgstr ""
191
+
192
+ #: includes/i18n.php:145
193
+ msgctxt "as download latest version"
194
+ msgid "Download Latest"
195
+ msgstr "Download seneste"
196
+
197
+ #: includes/i18n.php:147
198
+ msgctxt "E.g. you have a professional license."
199
+ msgid "You have a %s license."
200
+ msgstr "Du har en %s licens."
201
+
202
+ #: includes/i18n.php:151
203
+ msgid "New"
204
+ msgstr "Ny"
205
+
206
+ #: includes/i18n.php:153
207
+ msgid "Free"
208
+ msgstr "Gratis"
209
+
210
+ #: includes/i18n.php:155
211
+ msgctxt "as trial plan"
212
+ msgid "Trial"
213
+ msgstr "Prøveperiode"
214
+
215
+ #: includes/i18n.php:157
216
+ msgctxt "as starting a trial plan"
217
+ msgid "Start Trial"
218
+ msgstr ""
219
+
220
+ #: includes/i18n.php:159
221
+ msgctxt "verb"
222
+ msgid "Purchase"
223
+ msgstr "Køb"
224
+
225
+ #: includes/i18n.php:161
226
+ msgid "Purchase License"
227
+ msgstr "Køb licens"
228
+
229
+ #: includes/i18n.php:163
230
+ msgctxt "verb"
231
+ msgid "Buy"
232
+ msgstr "Køb"
233
+
234
+ #: includes/i18n.php:165
235
+ msgid "Buy License"
236
+ msgstr "Køb licens"
237
+
238
+ #: includes/i18n.php:167
239
+ msgid "Single Site License"
240
+ msgstr ""
241
+
242
+ #: includes/i18n.php:169
243
+ msgid "Unlimited Licenses"
244
+ msgstr "Ubegrænsede licenser"
245
+
246
+ #: includes/i18n.php:171
247
+ msgid "Up to %s Sites"
248
+ msgstr "Op til %s websteder"
249
+
250
+ #: includes/i18n.php:173
251
+ msgid "%sRenew your license now%s to access version %s features and support."
252
+ msgstr ""
253
+
254
+ #: includes/i18n.php:177
255
+ msgid ""
256
+ "Enter the email address you've used for the upgrade below and we will resend"
257
+ " you the license key."
258
+ msgstr ""
259
+
260
+ #: includes/i18n.php:181
261
+ msgctxt "e.g. Professional Plan"
262
+ msgid "%s Plan"
263
+ msgstr "%s Plan"
264
+
265
+ #: includes/i18n.php:183
266
+ msgid "You are just one step away - %s"
267
+ msgstr "Du mangler kun ét skridt - %s"
268
+
269
+ #: includes/i18n.php:185
270
+ msgctxt "%s - plugin name. As complete \"Jetpack\" activation now"
271
+ msgid "Complete \"%s\" Activation Now"
272
+ msgstr "Færdiggør aktivering af \"%s\" nu"
273
+
274
+ #: includes/i18n.php:189
275
+ msgid "We made a few tweaks to the plugin, %s"
276
+ msgstr ""
277
+
278
+ #: includes/i18n.php:191
279
+ msgid "Opt-in to make \"%s\" Better!"
280
+ msgstr ""
281
+
282
+ #: includes/i18n.php:193
283
+ msgid "Error"
284
+ msgstr "Fejl"
285
+
286
+ #: includes/i18n.php:195
287
+ msgid ""
288
+ "Freemius SDK couldn't find the plugin's main file. Please contact "
289
+ "sdk@freemius.com with the current error."
290
+ msgstr ""
291
+
292
+ #: includes/i18n.php:203
293
+ msgctxt "as expiration date"
294
+ msgid "Expiration"
295
+ msgstr ""
296
+
297
+ #: includes/i18n.php:205
298
+ msgctxt "as software license"
299
+ msgid "License"
300
+ msgstr "Licens"
301
+
302
+ #: includes/i18n.php:207
303
+ msgid "not verified"
304
+ msgstr "ikke verificeret"
305
+
306
+ #: includes/i18n.php:209
307
+ msgid "Verify Email"
308
+ msgstr "Verificer e-mail"
309
+
310
+ #: includes/i18n.php:211
311
+ msgctxt "e.g. expires in 2 months"
312
+ msgid "Expires in %s"
313
+ msgstr "Udløber om %s"
314
+
315
+ #: includes/i18n.php:213
316
+ msgctxt "e.g. auto renews in 2 months"
317
+ msgid "Auto renews in %s"
318
+ msgstr ""
319
+
320
+ #: includes/i18n.php:215
321
+ msgid "No expiration"
322
+ msgstr "Udløber ikke"
323
+
324
+ #: includes/i18n.php:217
325
+ msgid "Expired"
326
+ msgstr "Udløbet"
327
+
328
+ #: includes/i18n.php:219
329
+ msgid "Cancelled"
330
+ msgstr "Annulleret"
331
+
332
+ #: includes/i18n.php:221
333
+ msgctxt "e.g. In 2 hours"
334
+ msgid "In %s"
335
+ msgstr "Om %s"
336
+
337
+ #: includes/i18n.php:223
338
+ msgctxt "e.g. 2 min ago"
339
+ msgid "%s ago"
340
+ msgstr "%s siden"
341
+
342
+ #: includes/i18n.php:225
343
+ msgctxt "as plugin version"
344
+ msgid "Version"
345
+ msgstr "Version"
346
+
347
+ #: includes/i18n.php:227
348
+ msgid "Name"
349
+ msgstr "Navn"
350
+
351
+ #: includes/i18n.php:229
352
+ msgid "Email"
353
+ msgstr "E-mail"
354
+
355
+ #: includes/i18n.php:231
356
+ msgid "Email address"
357
+ msgstr "E-mailadresse"
358
+
359
+ #: includes/i18n.php:233
360
+ msgid "Verified"
361
+ msgstr "Verificeret"
362
+
363
+ #: includes/i18n.php:235
364
+ msgid "Plugin"
365
+ msgstr "Plugin"
366
+
367
+ #: includes/i18n.php:237
368
+ msgid "Plugins"
369
+ msgstr "Plugins"
370
+
371
+ #: includes/i18n.php:239
372
+ msgid "Themes"
373
+ msgstr "Temaer"
374
+
375
+ #: includes/i18n.php:241
376
+ msgctxt "as file/folder path"
377
+ msgid "Path"
378
+ msgstr "Sti"
379
+
380
+ #: includes/i18n.php:243
381
+ msgid "Title"
382
+ msgstr "Titel"
383
+
384
+ #: includes/i18n.php:245
385
+ msgid "Free version"
386
+ msgstr "Gratis version"
387
+
388
+ #: includes/i18n.php:247
389
+ msgid "Premium version"
390
+ msgstr ""
391
+
392
+ #: includes/i18n.php:249
393
+ msgctxt "as WP plugin slug"
394
+ msgid "Slug"
395
+ msgstr "Kortnavn"
396
+
397
+ #: includes/i18n.php:251
398
+ msgid "ID"
399
+ msgstr "ID"
400
+
401
+ #: includes/i18n.php:253
402
+ msgid "Users"
403
+ msgstr "Brugere"
404
+
405
+ #: includes/i18n.php:255
406
+ msgid "Plugin Installs"
407
+ msgstr "Plugin-installationer"
408
+
409
+ #: includes/i18n.php:257
410
+ msgctxt "like websites"
411
+ msgid "Sites"
412
+ msgstr "Websteder"
413
+
414
+ #: includes/i18n.php:259
415
+ msgid "User ID"
416
+ msgstr "Bruger-ID"
417
+
418
+ #: includes/i18n.php:261
419
+ msgid "Site ID"
420
+ msgstr "Websteds-ID"
421
+
422
+ #: includes/i18n.php:263
423
+ msgid "Public Key"
424
+ msgstr "Offentlig nøgle"
425
+
426
+ #: includes/i18n.php:265
427
+ msgid "Secret Key"
428
+ msgstr "Privat nøgle"
429
+
430
+ #: includes/i18n.php:267
431
+ msgctxt "as secret encryption key missing"
432
+ msgid "No Secret"
433
+ msgstr "Ingen privat nøgle"
434
+
435
+ #: includes/i18n.php:269
436
+ msgid "No ID"
437
+ msgstr "Intet ID"
438
+
439
+ #: includes/i18n.php:271
440
+ msgctxt "as synchronize license"
441
+ msgid "Sync License"
442
+ msgstr "Synkroniser licens"
443
+
444
+ #: includes/i18n.php:273
445
+ msgctxt "as synchronize"
446
+ msgid "Sync"
447
+ msgstr "Synkroniser"
448
+
449
+ #: includes/i18n.php:275
450
+ msgid "Activate License"
451
+ msgstr "Aktiver licens"
452
+
453
+ #: includes/i18n.php:277
454
+ msgid "Activate Free Version"
455
+ msgstr "Aktiver gratis version"
456
+
457
+ #: includes/i18n.php:279
458
+ msgid ""
459
+ "Please enter the license key that you received in the email right after the "
460
+ "purchase:"
461
+ msgstr ""
462
+
463
+ #: includes/i18n.php:283
464
+ msgid "Activating license..."
465
+ msgstr "Aktiverer licens..."
466
+
467
+ #: includes/i18n.php:285
468
+ msgid "Change License"
469
+ msgstr "Skift licens"
470
+
471
+ #: includes/i18n.php:287
472
+ msgid "Update License"
473
+ msgstr "Opdater licens"
474
+
475
+ #: includes/i18n.php:289
476
+ msgid "Deactivate License"
477
+ msgstr "Deaktiver licens"
478
+
479
+ #: includes/i18n.php:291
480
+ msgid "Activate"
481
+ msgstr "Aktiver"
482
+
483
+ #: includes/i18n.php:293
484
+ msgid "Deactivate"
485
+ msgstr "Deaktiver"
486
+
487
+ #: includes/i18n.php:295
488
+ msgid "Skip & Deactivate"
489
+ msgstr "Spring over & deaktiver"
490
+
491
+ #: includes/i18n.php:297
492
+ msgid "No - just deactivate"
493
+ msgstr "Nej - bare deaktiver"
494
+
495
+ #: includes/i18n.php:299
496
+ msgid "Yes - do your thing"
497
+ msgstr ""
498
+
499
+ #: includes/i18n.php:301
500
+ msgctxt "active mode"
501
+ msgid "Active"
502
+ msgstr "Aktiv"
503
+
504
+ #: includes/i18n.php:303
505
+ msgctxt "is active mode?"
506
+ msgid "Is Active"
507
+ msgstr "Er aktiv"
508
+
509
+ #: includes/i18n.php:305
510
+ msgid "Install Now"
511
+ msgstr "Installer nu"
512
+
513
+ #: includes/i18n.php:307
514
+ msgid "Install Update Now"
515
+ msgstr "Installer opdatering nu"
516
+
517
+ #: includes/i18n.php:309
518
+ msgid "More information about %s"
519
+ msgstr "Mere information om %s"
520
+
521
+ #: includes/i18n.php:311
522
+ msgid "Localhost"
523
+ msgstr "Localhost"
524
+
525
+ #: includes/i18n.php:313
526
+ msgctxt "as activate Professional plan"
527
+ msgid "Activate %s Plan"
528
+ msgstr "Aktiver plan %s"
529
+
530
+ #: includes/i18n.php:315
531
+ msgctxt "as 5 licenses left"
532
+ msgid "%s left"
533
+ msgstr "%s tilbage"
534
+
535
+ #: includes/i18n.php:317
536
+ msgid "Last license"
537
+ msgstr ""
538
+
539
+ #: includes/i18n.php:319
540
+ msgid "What is your %s?"
541
+ msgstr ""
542
+
543
+ #: includes/i18n.php:321
544
+ msgid "Activate this add-on"
545
+ msgstr "Aktiver denne tilføjelse"
546
+
547
+ #: includes/i18n.php:323
548
+ msgid ""
549
+ "Deactivating your license will block all premium features, but will enable "
550
+ "you to activate the license on another site. Are you sure you want to "
551
+ "proceed?"
552
+ msgstr ""
553
+
554
+ #: includes/i18n.php:327
555
+ msgid ""
556
+ "Deleting the account will automatically deactivate your %s plan license so "
557
+ "you can use it on other sites. If you want to terminate the recurring "
558
+ "payments as well, click the \"Cancel\" button, and first \"Downgrade\" your "
559
+ "account. Are you sure you would like to continue with the deletion?"
560
+ msgstr ""
561
+
562
+ #: includes/i18n.php:331
563
+ msgid ""
564
+ "Deletion is not temporary. Only delete if you no longer want to use this "
565
+ "plugin anymore. Are you sure you would like to continue with the deletion?"
566
+ msgstr ""
567
+
568
+ #: includes/i18n.php:335
569
+ msgid ""
570
+ "Downgrading your plan will immediately stop all future recurring payments "
571
+ "and your %s plan license will expire in %s."
572
+ msgstr ""
573
+
574
+ #: includes/i18n.php:339
575
+ msgid ""
576
+ "Cancelling the trial will immediately block access to all premium features. "
577
+ "Are you sure?"
578
+ msgstr ""
579
+
580
+ #: includes/i18n.php:343
581
+ msgid ""
582
+ "You can still enjoy all %s features but you will not have access to plugin "
583
+ "updates and support."
584
+ msgstr ""
585
+
586
+ #: includes/i18n.php:347
587
+ msgid ""
588
+ "Once your license expire you can still use the Free version but you will NOT"
589
+ " have access to the %s features."
590
+ msgstr ""
591
+
592
+ #: includes/i18n.php:351
593
+ msgid "Are you sure you want to proceed?"
594
+ msgstr ""
595
+
596
+ #: includes/i18n.php:357
597
+ msgid "Add Ons for %s"
598
+ msgstr "Tilføjelser til %s"
599
+
600
+ #: includes/i18n.php:359
601
+ msgid ""
602
+ "We could'nt load the add-ons list. It's probably an issue on our side, "
603
+ "please try to come back in few minutes."
604
+ msgstr ""
605
+
606
+ #: includes/i18n.php:365
607
+ msgid "Anonymous feedback"
608
+ msgstr "Anonym feedback"
609
+
610
+ #: includes/i18n.php:367
611
+ msgid "Quick feedback"
612
+ msgstr "Hurtig feedback"
613
+
614
+ #: includes/i18n.php:369
615
+ msgid "If you have a moment, please let us know why you are deactivating"
616
+ msgstr ""
617
+
618
+ #: includes/i18n.php:373
619
+ msgid "Yes - Deactivate"
620
+ msgstr "Ja - deaktiver"
621
+
622
+ #: includes/i18n.php:375
623
+ msgid "Submit & Deactivate"
624
+ msgstr "Send & deaktiver"
625
+
626
+ #: includes/i18n.php:377
627
+ msgid "Cancel"
628
+ msgstr "Annuller"
629
+
630
+ #: includes/i18n.php:379
631
+ msgid "I no longer need the plugin"
632
+ msgstr ""
633
+
634
+ #: includes/i18n.php:381
635
+ msgid "I found a better plugin"
636
+ msgstr "Jeg har fundet et bedre plugin"
637
+
638
+ #: includes/i18n.php:383
639
+ msgid "I only needed the plugin for a short period"
640
+ msgstr ""
641
+
642
+ #: includes/i18n.php:385
643
+ msgid "The plugin broke my site"
644
+ msgstr "Pluginnet ødelagde mit websted"
645
+
646
+ #: includes/i18n.php:387
647
+ msgid "The plugin suddenly stopped working"
648
+ msgstr "Pluginnet virker ikke længere"
649
+
650
+ #: includes/i18n.php:389
651
+ msgid "I can't pay for it anymore"
652
+ msgstr "Jeg kan ikke længere betale for det"
653
+
654
+ #: includes/i18n.php:391
655
+ msgid "It's a temporary deactivation. I'm just debugging an issue."
656
+ msgstr ""
657
+
658
+ #: includes/i18n.php:395
659
+ msgctxt ""
660
+ "the text of the \"other\" reason for deactivating the plugin that is shown "
661
+ "in the modal box."
662
+ msgid "Other"
663
+ msgstr "Andet"
664
+
665
+ #: includes/i18n.php:399
666
+ msgid "Kindly tell us the reason so we can improve."
667
+ msgstr ""
668
+
669
+ #: includes/i18n.php:401
670
+ msgid "What's the plugin's name?"
671
+ msgstr ""
672
+
673
+ #: includes/i18n.php:403
674
+ msgid "What price would you feel comfortable paying?"
675
+ msgstr ""
676
+
677
+ #: includes/i18n.php:405
678
+ msgid "I couldn't understand how to make it work"
679
+ msgstr ""
680
+
681
+ #: includes/i18n.php:407
682
+ msgid ""
683
+ "The plugin is great, but I need specific feature that you don't support"
684
+ msgstr ""
685
+
686
+ #: includes/i18n.php:411
687
+ msgid "The plugin is not working"
688
+ msgstr "Pluginnet virker ikke"
689
+
690
+ #: includes/i18n.php:413
691
+ msgid "It's not what I was looking for"
692
+ msgstr ""
693
+
694
+ #: includes/i18n.php:415
695
+ msgid "The plugin didn't work as expected"
696
+ msgstr ""
697
+
698
+ #: includes/i18n.php:417
699
+ msgid "What feature?"
700
+ msgstr ""
701
+
702
+ #: includes/i18n.php:419
703
+ msgid "Kindly share what didn't work so we can fix it for future users..."
704
+ msgstr ""
705
+
706
+ #: includes/i18n.php:423
707
+ msgid "What you've been looking for?"
708
+ msgstr ""
709
+
710
+ #: includes/i18n.php:425
711
+ msgid "What did you expect?"
712
+ msgstr "Hvad forventede du?"
713
+
714
+ #: includes/i18n.php:427
715
+ msgid "The plugin didn't work"
716
+ msgstr "Pluginnet virkede ikke"
717
+
718
+ #: includes/i18n.php:429
719
+ msgid "I don't like to share my information with you"
720
+ msgstr ""
721
+
722
+ #: includes/i18n.php:431
723
+ msgid ""
724
+ "You might have missed it, but you don't have to share any data and can just "
725
+ "%s the opt-in."
726
+ msgstr ""
727
+
728
+ #: includes/i18n.php:441
729
+ msgctxt "greeting"
730
+ msgid "Hey %s,"
731
+ msgstr "Hey %s,"
732
+
733
+ #: includes/i18n.php:443
734
+ msgctxt "a greeting. E.g. Thanks John!"
735
+ msgid "Thanks %s!"
736
+ msgstr "Tak %s!"
737
+
738
+ #: includes/i18n.php:445
739
+ msgid ""
740
+ "Never miss an important update - opt-in to our security and feature updates "
741
+ "notifications, and non-sensitive diagnostic tracking with %4$s."
742
+ msgstr ""
743
+
744
+ #: includes/i18n.php:449
745
+ msgid ""
746
+ "Please help us improve %1$s! If you opt-in, some data about your usage of "
747
+ "%1$s will be sent to %4$s. If you skip this, that's okay! %1$s will still "
748
+ "work just fine."
749
+ msgstr ""
750
+
751
+ #: includes/i18n.php:453
752
+ msgid ""
753
+ "You should receive an activation email for %s to your mailbox at %s. Please "
754
+ "make sure you click the activation button in that email to %s."
755
+ msgstr ""
756
+
757
+ #: includes/i18n.php:455
758
+ msgid "complete the install"
759
+ msgstr ""
760
+
761
+ #: includes/i18n.php:457
762
+ msgid "start the trial"
763
+ msgstr ""
764
+
765
+ #: includes/i18n.php:459
766
+ msgid ""
767
+ "Thanks for purchasing %s! To get started, please enter your license key:"
768
+ msgstr ""
769
+
770
+ #: includes/i18n.php:463
771
+ msgid ""
772
+ "The plugin will be periodically sending data to %s to check for plugin "
773
+ "updates and verify the validity of your license."
774
+ msgstr ""
775
+
776
+ #: includes/i18n.php:467
777
+ msgid "What permissions are being granted?"
778
+ msgstr "Hvilke tilladelser bliver givet?"
779
+
780
+ #: includes/i18n.php:469
781
+ msgid "Your Profile Overview"
782
+ msgstr "Overblik af din profil"
783
+
784
+ #: includes/i18n.php:471
785
+ msgid "Name and email address"
786
+ msgstr "Navn og e-mailadresse"
787
+
788
+ #: includes/i18n.php:473
789
+ msgid "Your Site Overview"
790
+ msgstr "Overblik af dit websted"
791
+
792
+ #: includes/i18n.php:475
793
+ msgid "Site URL, WP version, PHP info, plugins & themes"
794
+ msgstr ""
795
+
796
+ #: includes/i18n.php:479
797
+ msgid "Current Plugin Events"
798
+ msgstr "Nuværende plugin-begivenheder"
799
+
800
+ #: includes/i18n.php:481
801
+ msgid "Activation, deactivation and uninstall"
802
+ msgstr "Aktivering, deaktivering og afinstallering"
803
+
804
+ #: includes/i18n.php:483
805
+ msgid "Plugins & Themes"
806
+ msgstr "Plugins & Temaer"
807
+
808
+ #: includes/i18n.php:485
809
+ msgid "Titles, versions and state."
810
+ msgstr "Titler, versioner og tilstand."
811
+
812
+ #: includes/i18n.php:487
813
+ msgid "Admin Notices"
814
+ msgstr ""
815
+
816
+ #: includes/i18n.php:489
817
+ msgid "Newsletter"
818
+ msgstr "Nyhedsbrev"
819
+
820
+ #: includes/i18n.php:491
821
+ msgid "Updates, announcements, marketing, no spam"
822
+ msgstr ""
823
+
824
+ #: includes/i18n.php:493
825
+ msgid "Privacy Policy"
826
+ msgstr "Privatlivspolitik"
827
+
828
+ #: includes/i18n.php:495
829
+ msgid "Terms of Service"
830
+ msgstr "Servicevilkår"
831
+
832
+ #: includes/i18n.php:497
833
+ msgctxt "as activating plugin"
834
+ msgid "Activating"
835
+ msgstr "Aktiverer"
836
+
837
+ #: includes/i18n.php:499
838
+ msgctxt "as in the process of sending an email"
839
+ msgid "Sending email"
840
+ msgstr "Sender e-mail"
841
+
842
+ #: includes/i18n.php:503
843
+ msgctxt "button label"
844
+ msgid "Allow & Continue"
845
+ msgstr "Tillad & Fortsæt"
846
+
847
+ #: includes/i18n.php:505
848
+ msgctxt "button label"
849
+ msgid "Agree & Activate License"
850
+ msgstr "Accepter & aktiver licens"
851
+
852
+ #: includes/i18n.php:507
853
+ msgctxt "verb"
854
+ msgid "Skip"
855
+ msgstr "Spring over"
856
+
857
+ #: includes/i18n.php:509
858
+ msgid "Click here to use the plugin anonymously"
859
+ msgstr "Klik her for at benytte pluginnet anonymt"
860
+
861
+ #: includes/i18n.php:511
862
+ msgid "Re-send activation email"
863
+ msgstr "Gensend e-mail om aktivering"
864
+
865
+ #: includes/i18n.php:513
866
+ msgid "License key"
867
+ msgstr "Licensnøgle"
868
+
869
+ #: includes/i18n.php:515
870
+ msgid "Send License Key"
871
+ msgstr "Send licensnøgle"
872
+
873
+ #: includes/i18n.php:517
874
+ msgid "Sending license key"
875
+ msgstr "Sender licensnøgle"
876
+
877
+ #: includes/i18n.php:519
878
+ msgid "Have a license key?"
879
+ msgstr "Har du en licensnøgle?"
880
+
881
+ #: includes/i18n.php:521
882
+ msgid "Don't have a license key?"
883
+ msgstr "Har du ikke en licensnøgle?"
884
+
885
+ #: includes/i18n.php:523
886
+ msgid "Can't find your license key?"
887
+ msgstr "Kan du ikke finde din licensnøgle?"
888
+
889
+ #: includes/i18n.php:525
890
+ msgid ""
891
+ "We couldn't find your email address in the system, are you sure it's the "
892
+ "right address?"
893
+ msgstr ""
894
+
895
+ #: includes/i18n.php:529
896
+ msgid ""
897
+ "We can't see any active licenses associated with that email address, are you"
898
+ " sure it's the right address?"
899
+ msgstr ""
900
+
901
+ #: includes/i18n.php:533
902
+ msgid "Opt In"
903
+ msgstr ""
904
+
905
+ #: includes/i18n.php:535
906
+ msgid "Opt Out"
907
+ msgstr ""
908
+
909
+ #: includes/i18n.php:537
910
+ msgid "On second thought - I want to continue helping"
911
+ msgstr ""
912
+
913
+ #: includes/i18n.php:541
914
+ msgid "Opting out..."
915
+ msgstr ""
916
+
917
+ #: includes/i18n.php:543
918
+ msgid "Opting in..."
919
+ msgstr ""
920
+
921
+ #: includes/i18n.php:545
922
+ msgid ""
923
+ "We appreciate your help in making the %s better by letting us track some "
924
+ "usage data."
925
+ msgstr ""
926
+
927
+ #: includes/i18n.php:549
928
+ msgid ""
929
+ "Usage tracking is done in the name of making %s better. Making a better user"
930
+ " experience, prioritizing new features, and more good things. We'd really "
931
+ "appreciate if you'll reconsider letting us continue with the tracking."
932
+ msgstr ""
933
+
934
+ #: includes/i18n.php:553
935
+ msgid ""
936
+ "By clicking \"Opt Out\", we will no longer be sending any data from %s to "
937
+ "%s."
938
+ msgstr ""
939
+
940
+ #: includes/i18n.php:563
941
+ msgid "Screenshots"
942
+ msgstr "Skærmbilleder"
943
+
944
+ #: includes/i18n.php:565
945
+ msgid "Click to view full-size screenshot %d"
946
+ msgstr ""
947
+
948
+ #: includes/i18n.php:573
949
+ msgid "Freemius Debug"
950
+ msgstr "Freemius Debug"
951
+
952
+ #: includes/i18n.php:575
953
+ msgctxt "as turned on"
954
+ msgid "On"
955
+ msgstr "Til"
956
+
957
+ #: includes/i18n.php:577
958
+ msgctxt "as turned off"
959
+ msgid "Off"
960
+ msgstr "Fra"
961
+
962
+ #: includes/i18n.php:579
963
+ msgctxt "as code debugging"
964
+ msgid "Debugging"
965
+ msgstr "Fejlfinding"
966
+
967
+ #: includes/i18n.php:581
968
+ msgid "Freemius State"
969
+ msgstr "Freemius tilstand"
970
+
971
+ #: includes/i18n.php:583
972
+ msgctxt "as connection was successful"
973
+ msgid "Connected"
974
+ msgstr "Forbundet"
975
+
976
+ #: includes/i18n.php:585
977
+ msgctxt "as connection blocked"
978
+ msgid "Blocked"
979
+ msgstr "Blokeret"
980
+
981
+ #: includes/i18n.php:587
982
+ msgctxt "as application program interface"
983
+ msgid "API"
984
+ msgstr "API"
985
+
986
+ #: includes/i18n.php:589
987
+ msgctxt "as software development kit versions"
988
+ msgid "SDK"
989
+ msgstr "SDK"
990
+
991
+ #: includes/i18n.php:591
992
+ msgctxt "as software development kit versions"
993
+ msgid "SDK Versions"
994
+ msgstr "SDK-versioner"
995
+
996
+ #: includes/i18n.php:595
997
+ msgctxt "as plugin folder path"
998
+ msgid "Plugin Path"
999
+ msgstr "Plugin-sti"
1000
+
1001
+ #: includes/i18n.php:597
1002
+ msgctxt "as sdk path"
1003
+ msgid "SDK Path"
1004
+ msgstr "SDK-sti"
1005
+
1006
+ #: includes/i18n.php:599
1007
+ msgid "Add Ons of Plugin %s"
1008
+ msgstr "Tilføjelser til plugin %s"
1009
+
1010
+ #: includes/i18n.php:601
1011
+ msgid "Are you sure you want to delete all Freemius data?"
1012
+ msgstr ""
1013
+
1014
+ #: includes/i18n.php:605
1015
+ msgid "Actions"
1016
+ msgstr "Handlinger"
1017
+
1018
+ #: includes/i18n.php:607
1019
+ msgid "Delete All Accounts"
1020
+ msgstr "Slet alle konti"
1021
+
1022
+ #: includes/i18n.php:609
1023
+ msgid "Start Fresh"
1024
+ msgstr "Start forfra"
1025
+
1026
+ #: includes/i18n.php:611
1027
+ msgid "Clear API Cache"
1028
+ msgstr "Ryd API-cache"
1029
+
1030
+ #: includes/i18n.php:613
1031
+ msgid "Sync Data From Server"
1032
+ msgstr "Synkroniser data fra server"
1033
+
1034
+ #: includes/i18n.php:615
1035
+ msgid "Scheduled Crons"
1036
+ msgstr "Planlagte cron jobs"
1037
+
1038
+ #: includes/i18n.php:617
1039
+ msgid "Plugins & Themes Sync"
1040
+ msgstr "Synkronisering af plugins og temaer"
1041
+
1042
+ #: includes/i18n.php:625
1043
+ msgctxt "as congratulations"
1044
+ msgid "Congrats"
1045
+ msgstr "Tillykke"
1046
+
1047
+ #: includes/i18n.php:627
1048
+ msgctxt "exclamation"
1049
+ msgid "Oops"
1050
+ msgstr "Ups"
1051
+
1052
+ #: includes/i18n.php:629
1053
+ msgctxt "interjection expressing joy or exuberance"
1054
+ msgid "Yee-haw"
1055
+ msgstr ""
1056
+
1057
+ #: includes/i18n.php:633
1058
+ msgctxt ""
1059
+ "(especially in electronic communication) used to express elation, "
1060
+ "enthusiasm, or triumph."
1061
+ msgid "W00t"
1062
+ msgstr ""
1063
+
1064
+ #: includes/i18n.php:637
1065
+ msgctxt "a positive response"
1066
+ msgid "Right on"
1067
+ msgstr "Sådan"
1068
+
1069
+ #: includes/i18n.php:639
1070
+ msgctxt ""
1071
+ "something somebody says when they are thinking about what you have just "
1072
+ "said. "
1073
+ msgid "Hmm"
1074
+ msgstr "Hmm"
1075
+
1076
+ #: includes/i18n.php:643
1077
+ msgid "O.K"
1078
+ msgstr "O.K"
1079
+
1080
+ #: includes/i18n.php:645
1081
+ msgctxt "exclamation"
1082
+ msgid "Hey"
1083
+ msgstr "Hey"
1084
+
1085
+ #: includes/i18n.php:647
1086
+ msgctxt "advance notice of something that will need attention."
1087
+ msgid "Heads up"
1088
+ msgstr "Se her"
1089
+
1090
+ #: includes/i18n.php:657
1091
+ msgid "Seems like you got the latest release."
1092
+ msgstr ""
1093
+
1094
+ #: includes/i18n.php:659
1095
+ msgid "You are all good!"
1096
+ msgstr "Det var det!"
1097
+
1098
+ #: includes/i18n.php:661
1099
+ msgid ""
1100
+ "Sorry, we could not complete the email update. Another user with the same "
1101
+ "email is already registered."
1102
+ msgstr ""
1103
+
1104
+ #: includes/i18n.php:665
1105
+ msgid ""
1106
+ "If you would like to give up the ownership of the plugin's account to %s "
1107
+ "click the Change Ownership button."
1108
+ msgstr ""
1109
+
1110
+ #: includes/i18n.php:669
1111
+ msgid ""
1112
+ "Your email was successfully updated. You should receive an email with "
1113
+ "confirmation instructions in few moments."
1114
+ msgstr ""
1115
+
1116
+ #: includes/i18n.php:673
1117
+ msgid "Your name was successfully updated."
1118
+ msgstr "Dit navn er blevet opdateret."
1119
+
1120
+ #: includes/i18n.php:675
1121
+ msgid "You have successfully updated your %s."
1122
+ msgstr "Opdatering af %s blev gennemført."
1123
+
1124
+ #: includes/i18n.php:677
1125
+ msgid "Please provide your full name."
1126
+ msgstr "Indtast venligst dit fulde navn."
1127
+
1128
+ #: includes/i18n.php:679
1129
+ msgid ""
1130
+ "Verification mail was just sent to %s. If you can't find it after 5 min, "
1131
+ "please check your spam box."
1132
+ msgstr ""
1133
+
1134
+ #: includes/i18n.php:683
1135
+ msgid ""
1136
+ "Just letting you know that the add-ons information of %s is being pulled "
1137
+ "from an external server."
1138
+ msgstr ""
1139
+
1140
+ #: includes/i18n.php:687
1141
+ msgid "No credit card required"
1142
+ msgstr "Betalingskort ikke påkrævet"
1143
+
1144
+ #: includes/i18n.php:689
1145
+ msgid "Premium plugin version was successfully activated."
1146
+ msgstr ""
1147
+
1148
+ #: includes/i18n.php:693
1149
+ msgid "The upgrade of %s was successfully completed."
1150
+ msgstr ""
1151
+
1152
+ #: includes/i18n.php:695
1153
+ msgid "Your account was successfully activated with the %s plan."
1154
+ msgstr ""
1155
+
1156
+ #: includes/i18n.php:699
1157
+ msgid "Download the latest %s version now"
1158
+ msgstr "Download den seneste version af %s nu"
1159
+
1160
+ #: includes/i18n.php:701
1161
+ msgid "Please follow these steps to complete the upgrade"
1162
+ msgstr ""
1163
+
1164
+ #: includes/i18n.php:705
1165
+ msgid "Download the latest %s version"
1166
+ msgstr "Download den seneste version af %s"
1167
+
1168
+ #: includes/i18n.php:707
1169
+ msgid "Deactivate the free version"
1170
+ msgstr "Deaktiver den gratis version"
1171
+
1172
+ #: includes/i18n.php:709
1173
+ msgid "Upload and activate the downloaded version"
1174
+ msgstr "Upload og aktiver den downloadede version"
1175
+
1176
+ #: includes/i18n.php:711
1177
+ msgid "How to upload and activate?"
1178
+ msgstr "Upload og aktivering, hvordan?"
1179
+
1180
+ #: includes/i18n.php:713
1181
+ msgctxt "%s - product name, e.g. Facebook add-on was successfully..."
1182
+ msgid "%s Add-on was successfully purchased."
1183
+ msgstr "Betalingen for tilføjelsen %s blev gennemført."
1184
+
1185
+ #: includes/i18n.php:717
1186
+ msgid "Your %s Add-on plan was successfully upgraded."
1187
+ msgstr ""
1188
+
1189
+ #: includes/i18n.php:721
1190
+ msgid "Your email has been successfully verified - you are AWESOME!"
1191
+ msgstr ""
1192
+
1193
+ #: includes/i18n.php:725
1194
+ msgid "Your plan was successfully upgraded."
1195
+ msgstr "Din plan er blevet opgraderet."
1196
+
1197
+ #: includes/i18n.php:727
1198
+ msgid "Your plan was successfully changed to %s."
1199
+ msgstr "Din plan er blevet ændret til %s."
1200
+
1201
+ #: includes/i18n.php:729
1202
+ msgid ""
1203
+ "Your license has expired. You can still continue using the free plugin "
1204
+ "forever."
1205
+ msgstr ""
1206
+
1207
+ #: includes/i18n.php:733
1208
+ msgid ""
1209
+ "Your license has been cancelled. If you think it's a mistake, please contact"
1210
+ " support."
1211
+ msgstr ""
1212
+
1213
+ #: includes/i18n.php:737
1214
+ msgid "Your trial has been successfully started."
1215
+ msgstr "Din prøveperiode er begyndt."
1216
+
1217
+ #: includes/i18n.php:739
1218
+ msgid "Your license was successfully activated."
1219
+ msgstr "Din licens er blevet aktiveret."
1220
+
1221
+ #: includes/i18n.php:741
1222
+ msgid "It looks like your site currently doesn't have an active license."
1223
+ msgstr "Det ser ud til, at dit websted endnu ikke har en aktiv licens."
1224
+
1225
+ #: includes/i18n.php:745
1226
+ msgid ""
1227
+ "Your license was successfully deactivated, you are back to the %s plan."
1228
+ msgstr ""
1229
+
1230
+ #: includes/i18n.php:749
1231
+ msgid "It looks like the license deactivation failed."
1232
+ msgstr "Det ser ud til, at licens-deaktiveringen mislykkedes."
1233
+
1234
+ #: includes/i18n.php:753
1235
+ msgid "It looks like the license could not be activated."
1236
+ msgstr "Det ser ud til, at licensen ikke kunne aktiveres."
1237
+
1238
+ #: includes/i18n.php:757
1239
+ msgid "Error received from the server:"
1240
+ msgstr "Fejl modtager fra serveren:"
1241
+
1242
+ #: includes/i18n.php:759
1243
+ msgid ""
1244
+ "Your trial has expired. You can still continue using all our free features."
1245
+ msgstr "Din prøveperiode er udløbet. Du kan fortsat bruge alle vores gratis funktioner."
1246
+
1247
+ #: includes/i18n.php:763
1248
+ msgid ""
1249
+ "Your plan was successfully downgraded. Your %s plan license will expire in "
1250
+ "%s."
1251
+ msgstr ""
1252
+
1253
+ #: includes/i18n.php:767
1254
+ msgid ""
1255
+ "Seems like we are having some temporary issue with your plan downgrade. "
1256
+ "Please try again in few minutes."
1257
+ msgstr ""
1258
+
1259
+ #: includes/i18n.php:771
1260
+ msgid ""
1261
+ "It looks like you are not in trial mode anymore so there's nothing to cancel"
1262
+ " :)"
1263
+ msgstr ""
1264
+
1265
+ #: includes/i18n.php:775
1266
+ msgid "Your %s free trial was successfully cancelled."
1267
+ msgstr ""
1268
+
1269
+ #: includes/i18n.php:779
1270
+ msgctxt "%s - numeric version number"
1271
+ msgid "Version %s was released."
1272
+ msgstr "Version %s er blevet udgivet."
1273
+
1274
+ #: includes/i18n.php:783
1275
+ msgid "Please download %s."
1276
+ msgstr "Download venligst %s."
1277
+
1278
+ #: includes/i18n.php:785
1279
+ msgctxt "%s - plan name, as the latest professional version here"
1280
+ msgid "the latest %s version here"
1281
+ msgstr "den seneste version af %s her"
1282
+
1283
+ #: includes/i18n.php:789
1284
+ msgid ""
1285
+ "How do you like %s so far? Test all our %s premium features with a %d-day "
1286
+ "free trial."
1287
+ msgstr ""
1288
+
1289
+ #: includes/i18n.php:793
1290
+ msgctxt "call to action"
1291
+ msgid "Start free trial"
1292
+ msgstr "Start gratis prøveperiode"
1293
+
1294
+ #: includes/i18n.php:795
1295
+ msgid "Starting trial"
1296
+ msgstr ""
1297
+
1298
+ #: includes/i18n.php:797
1299
+ msgid "Please wait"
1300
+ msgstr ""
1301
+
1302
+ #: includes/i18n.php:799
1303
+ msgid ""
1304
+ "Seems like we are having some temporary issue with your trial cancellation. "
1305
+ "Please try again in few minutes."
1306
+ msgstr ""
1307
+
1308
+ #: includes/i18n.php:803
1309
+ msgid "You already utilized a trial before."
1310
+ msgstr "Du har allerede brugt din prøveperiode."
1311
+
1312
+ #: includes/i18n.php:805
1313
+ msgid "You are already running the plugin in a trial mode."
1314
+ msgstr ""
1315
+
1316
+ #: includes/i18n.php:809
1317
+ msgid "Plan %s do not exist, therefore, can't start a trial."
1318
+ msgstr ""
1319
+
1320
+ #: includes/i18n.php:813
1321
+ msgid "Plan %s does not support a trial period."
1322
+ msgstr "Plan %s understøtter ikke en prøveperiode."
1323
+
1324
+ #: includes/i18n.php:815
1325
+ msgid "None of the plugin's plans supports a trial period."
1326
+ msgstr ""
1327
+
1328
+ #: includes/i18n.php:819
1329
+ msgid ""
1330
+ "Unexpected API error. Please contact the plugin's author with the following "
1331
+ "error."
1332
+ msgstr ""
1333
+
1334
+ #: includes/i18n.php:823
1335
+ msgid "No commitment for %s days - cancel anytime!"
1336
+ msgstr "Ingen bindinger i %s dage - annuller når som helst!"
1337
+
1338
+ #: includes/i18n.php:825
1339
+ msgid ""
1340
+ "Your license has expired. You can still continue using all the %s features, "
1341
+ "but you'll need to renew your license to continue getting updates and "
1342
+ "support."
1343
+ msgstr ""
1344
+
1345
+ #: includes/i18n.php:829
1346
+ msgid "Couldn't activate %s."
1347
+ msgstr "Kunne ikke aktivere %s."
1348
+
1349
+ #: includes/i18n.php:831
1350
+ msgid "Please contact us with the following message:"
1351
+ msgstr "Kontakt os venligst med følgende besked:"
1352
+
1353
+ #: includes/i18n.php:833
1354
+ msgid ""
1355
+ "It looks like you are still on the %s plan. If you did upgrade or change "
1356
+ "your plan, it's probably an issue on our side - sorry."
1357
+ msgstr ""
1358
+
1359
+ #: includes/i18n.php:837
1360
+ msgid "Please contact us here"
1361
+ msgstr "Kontakt os her"
1362
+
1363
+ #: includes/i18n.php:839
1364
+ msgid ""
1365
+ "I have upgraded my account but when I try to Sync the License, the plan "
1366
+ "remains %s."
1367
+ msgstr ""
1368
+
1369
+ #: includes/i18n.php:847
1370
+ msgid "From unknown reason, the API connectivity test failed."
1371
+ msgstr ""
1372
+
1373
+ #: includes/i18n.php:851
1374
+ msgid ""
1375
+ "It's probably a temporary issue on our end. Just to be sure, with your "
1376
+ "permission, would it be o.k to run another connectivity test?"
1377
+ msgstr ""
1378
+
1379
+ #: includes/i18n.php:855
1380
+ msgid ""
1381
+ "We use PHP cURL library for the API calls, which is a very common library "
1382
+ "and usually installed out of the box. Unfortunately, cURL is not installed "
1383
+ "on your server."
1384
+ msgstr ""
1385
+
1386
+ #: includes/i18n.php:859
1387
+ msgid ""
1388
+ "From unknown reason, CloudFlare, the firewall we use, blocks the connection."
1389
+ msgstr ""
1390
+
1391
+ #: includes/i18n.php:863
1392
+ msgctxt "as pluginX requires an access to our API"
1393
+ msgid "%s requires an access to our API."
1394
+ msgstr ""
1395
+
1396
+ #: includes/i18n.php:867
1397
+ msgid ""
1398
+ "It looks like your server is using Squid ACL (access control lists), which "
1399
+ "blocks the connection."
1400
+ msgstr ""
1401
+
1402
+ #: includes/i18n.php:871
1403
+ msgid "I don't know what is Squid or ACL, help me!"
1404
+ msgstr ""
1405
+
1406
+ #: includes/i18n.php873, includes/i18n.php:887
1407
+ msgid ""
1408
+ "We'll make sure to contact your hosting company and resolve the issue. You "
1409
+ "will get a follow-up email to %s once we have an update."
1410
+ msgstr ""
1411
+
1412
+ #: includes/i18n.php:877
1413
+ msgid "I'm a system administrator"
1414
+ msgstr "Jeg er en system-administrator"
1415
+
1416
+ #: includes/i18n.php:879
1417
+ msgid ""
1418
+ "Great, please whitelist the following domains: %s. Once you done, deactivate"
1419
+ " the plugin and activate it again."
1420
+ msgstr ""
1421
+
1422
+ #: includes/i18n.php:883
1423
+ msgid "I don't know what is cURL or how to install it, help me!"
1424
+ msgstr ""
1425
+
1426
+ #: includes/i18n.php:891
1427
+ msgid ""
1428
+ "Great, please install cURL and enable it in your php.ini file. To make sure "
1429
+ "it was successfully activated, use 'phpinfo()'. Once activated, deactivate "
1430
+ "the plugin and reactivate it back again."
1431
+ msgstr ""
1432
+
1433
+ #: includes/i18n.php:895
1434
+ msgid ""
1435
+ "We are sure it's an issue on our side and more than happy to resolve it for "
1436
+ "you ASAP if you give us a chance."
1437
+ msgstr ""
1438
+
1439
+ #: includes/i18n.php:899
1440
+ msgid ""
1441
+ "Sorry for the inconvenience and we are here to help if you give us a chance."
1442
+ msgstr ""
1443
+
1444
+ #: includes/i18n.php:903
1445
+ msgid "Yes - I'm giving you a chance to fix it"
1446
+ msgstr "Ja - jeg giver jer en chance for at rette det"
1447
+
1448
+ #: includes/i18n.php:905
1449
+ msgid ""
1450
+ "We will do our best to whitelist your server and resolve this issue ASAP. "
1451
+ "You will get a follow-up email to %s once we have an update."
1452
+ msgstr ""
1453
+
1454
+ #: includes/i18n.php:909
1455
+ msgid "Let's try your previous version"
1456
+ msgstr "Lad os prøve din forrige version"
1457
+
1458
+ #: includes/i18n.php:911
1459
+ msgid "Uninstall this version and install the previous one."
1460
+ msgstr "Afinstaller denne version og installer den forrige."
1461
+
1462
+ #: includes/i18n.php:915
1463
+ msgid "That's exhausting, please deactivate"
1464
+ msgstr ""
1465
+
1466
+ #: includes/i18n.php:917
1467
+ msgid ""
1468
+ "We feel your frustration and sincerely apologize for the inconvenience. Hope"
1469
+ " to see you again in the future."
1470
+ msgstr ""
1471
+
1472
+ #: includes/i18n.php:921
1473
+ msgid ""
1474
+ "Thank for giving us the chance to fix it! A message was just sent to our "
1475
+ "technical staff. We will get back to you as soon as we have an update to %s."
1476
+ " Appreciate your patience."
1477
+ msgstr ""
1478
+
1479
+ #: includes/i18n.php:925
1480
+ msgctxt "%1s - plugin title, %2s - API domain"
1481
+ msgid ""
1482
+ "Your server is blocking the access to Freemius' API, which is crucial for "
1483
+ "%1s synchronization. Please contact your host to whitelist %2s"
1484
+ msgstr ""
1485
+
1486
+ #: includes/i18n.php:929
1487
+ msgid ""
1488
+ "It seems like one of the authentication parameters is wrong. Update your "
1489
+ "Public Key, Secret Key & User ID, and try again."
1490
+ msgstr ""
1491
+
1492
+ #: includes/i18n.php:937
1493
+ msgid ""
1494
+ "Please check your mailbox, you should receive an email via %s to confirm the"
1495
+ " ownership change. From security reasons, you must confirm the change within"
1496
+ " the next 15 min. If you cannot find the email, please check your spam "
1497
+ "folder."
1498
+ msgstr ""
1499
+
1500
+ #: includes/i18n.php:941
1501
+ msgid ""
1502
+ "Thanks for confirming the ownership change. An email was just sent to %s for"
1503
+ " final approval."
1504
+ msgstr ""
1505
+
1506
+ #: includes/i18n.php:945
1507
+ msgid "%s is the new owner of the account."
1508
+ msgstr "%s er den nye ejer af kontoen."
1509
+
1510
+ #: includes/i18n.php:949
1511
+ msgctxt "addonX cannot run without pluginY"
1512
+ msgid "%s cannot run without %s."
1513
+ msgstr "%s virker ikke uden %s."
1514
+
1515
+ #: includes/i18n.php:953
1516
+ msgctxt "addonX cannot run..."
1517
+ msgid "%s cannot run without the plugin."
1518
+ msgstr "%s virker ikke uden pluginnet."
1519
+
1520
+ #: includes/i18n.php:957
1521
+ msgctxt "pluginX activation was successfully..."
1522
+ msgid "%s activation was successfully completed."
1523
+ msgstr "Aktivering af %s blev gennemført."
1524
+
1525
+ #: includes/i18n.php:961
1526
+ msgctxt "Plugin installer section title"
1527
+ msgid "Features & Pricing"
1528
+ msgstr "Funktioner og priser"
1529
+
1530
+ #: includes/i18n.php:965
1531
+ msgid "Add-on must be deployed to WordPress.org or Freemius."
1532
+ msgstr ""
1533
+
1534
+ #: includes/i18n.php:969
1535
+ msgid "Paid add-on must be deployed to Freemius."
1536
+ msgstr ""
1537
+
1538
+ #: includes/i18n.php:977
1539
+ msgid ""
1540
+ "%s is a premium only add-on. You have to purchase a license first before "
1541
+ "activating the plugin."
1542
+ msgstr ""
1543
+
1544
+ #: includes/i18n.php:981
1545
+ msgid ""
1546
+ "%s free trial was successfully cancelled. Since the add-on is premium only "
1547
+ "it was automatically deactivated. If you like to use it in the future, "
1548
+ "you'll have to purchase a license."
1549
+ msgstr ""
1550
+
1551
+ #: includes/i18n.php:993
1552
+ msgctxt "as every month"
1553
+ msgid "Monthly"
1554
+ msgstr "Månedligt"
1555
+
1556
+ #: includes/i18n.php:995
1557
+ msgctxt "as monthly period"
1558
+ msgid "mo"
1559
+ msgstr "md"
1560
+
1561
+ #: includes/i18n.php:997
1562
+ msgctxt "as once a year"
1563
+ msgid "Annual"
1564
+ msgstr "Årligt"
1565
+
1566
+ #: includes/i18n.php:999
1567
+ msgctxt "as once a year"
1568
+ msgid "Annually"
1569
+ msgstr "Årligt"
1570
+
1571
+ #: includes/i18n.php:1001
1572
+ msgctxt "as once a year"
1573
+ msgid "Once"
1574
+ msgstr "Engangsbeløb"
1575
+
1576
+ #: includes/i18n.php:1003
1577
+ msgctxt "as annual period"
1578
+ msgid "year"
1579
+ msgstr "år"
1580
+
1581
+ #: includes/i18n.php:1005
1582
+ msgid "Lifetime"
1583
+ msgstr ""
1584
+
1585
+ #: includes/i18n.php:1007
1586
+ msgctxt "e.g. the best product"
1587
+ msgid "Best"
1588
+ msgstr "Bedste"
1589
+
1590
+ #: includes/i18n.php:1009
1591
+ msgctxt "e.g. billed monthly"
1592
+ msgid "Billed %s"
1593
+ msgstr ""
1594
+
1595
+ #: includes/i18n.php:1011
1596
+ msgctxt "as a discount of $5 or 10%"
1597
+ msgid "Save %s"
1598
+ msgstr "Spar %s"
1599
+
1600
+ #: includes/i18n.php:1015
1601
+ msgid "View details"
1602
+ msgstr "Vis detaljer"
1603
+
1604
+ #: includes/i18n.php:1023
1605
+ msgctxt "button label"
1606
+ msgid "Approve & Start Trial"
1607
+ msgstr ""
1608
+
1609
+ #: includes/i18n.php:1027
1610
+ msgid ""
1611
+ "You are 1-click away from starting your %1$s-day free trial of the %2$s "
1612
+ "plan."
1613
+ msgstr ""
1614
+
1615
+ #: includes/i18n.php:1031
1616
+ msgid ""
1617
+ "For compliance with the WordPress.org guidelines, before we start the trial "
1618
+ "we ask that you opt-in with your user and non-sensitive site information, "
1619
+ "allowing the plugin to periodically send data to %s to check for version "
1620
+ "updates and to validate your trial."
1621
+ msgstr ""
1622
+
1623
+ #: includes/i18n.php:1043
1624
+ msgid "Business name"
1625
+ msgstr ""
1626
+
1627
+ #: includes/i18n.php:1045
1628
+ msgid "Tax / VAT ID"
1629
+ msgstr ""
1630
+
1631
+ #: includes/i18n.php:1047
1632
+ msgid "Address Line %d"
1633
+ msgstr ""
1634
+
1635
+ #: includes/i18n.php:1049
1636
+ msgid "Country"
1637
+ msgstr ""
1638
+
1639
+ #: includes/i18n.php:1051
1640
+ msgid "Select Country"
1641
+ msgstr ""
1642
+
1643
+ #: includes/i18n.php:1053
1644
+ msgid "City"
1645
+ msgstr ""
1646
+
1647
+ #: includes/i18n.php:1055
1648
+ msgid "Town"
1649
+ msgstr ""
1650
+
1651
+ #: includes/i18n.php:1057
1652
+ msgid "State"
1653
+ msgstr ""
1654
+
1655
+ #: includes/i18n.php:1059
1656
+ msgid "Province"
1657
+ msgstr ""
1658
+
1659
+ #: includes/i18n.php:1061
1660
+ msgid "ZIP / Postal Code"
1661
+ msgstr ""
freemius/languages/freemius-en.mo ADDED
Binary file
freemius/languages/freemius-en.po ADDED
@@ -0,0 +1,1727 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ msgid "Cancel Trial"
84
+ msgstr "Cancel Trial"
85
+
86
+ #: includes/i18n.php:52
87
+ msgid "Free Trial"
88
+ msgstr "Free Trial"
89
+
90
+ #: includes/i18n.php:53
91
+ msgid "Start my free %s"
92
+ msgstr "Start my free %s"
93
+
94
+ #: includes/i18n.php:54
95
+ msgid "No commitment for %s - cancel anytime"
96
+ msgstr "No commitment for %s - cancel anytime"
97
+
98
+ #: includes/i18n.php:55
99
+ msgid "After your free %s, pay as little as %s"
100
+ msgstr "After your free %s, pay as little as %s"
101
+
102
+ #: includes/i18n.php:56
103
+ msgid "Details"
104
+ msgstr "Details"
105
+
106
+ #: includes/i18n.php:57
107
+ msgid "Account Details"
108
+ msgstr "Account Details"
109
+
110
+ #: includes/i18n.php:58
111
+ msgctxt "verb"
112
+ msgid "Delete"
113
+ msgstr "Delete"
114
+
115
+ #: includes/i18n.php:59
116
+ msgctxt "verb"
117
+ msgid "Show"
118
+ msgstr "Show"
119
+
120
+ #: includes/i18n.php:60
121
+ msgctxt "verb"
122
+ msgid "Hide"
123
+ msgstr "Hide"
124
+
125
+ #: includes/i18n.php:61
126
+ msgctxt "verb"
127
+ msgid "Edit"
128
+ msgstr "Edit"
129
+
130
+ #: includes/i18n.php:62
131
+ msgctxt "verb"
132
+ msgid "Update"
133
+ msgstr "Update"
134
+
135
+ #: includes/i18n.php:63
136
+ msgid "Date"
137
+ msgstr "Date"
138
+
139
+ #: includes/i18n.php:64
140
+ msgid "Amount"
141
+ msgstr "Amount"
142
+
143
+ #: includes/i18n.php:65
144
+ msgid "Invoice"
145
+ msgstr "Invoice"
146
+
147
+ #: includes/i18n.php:66
148
+ msgid "Billing"
149
+ msgstr "Billing"
150
+
151
+ #: includes/i18n.php:67
152
+ msgid "Payments"
153
+ msgstr "Payments"
154
+
155
+ #: includes/i18n.php:68
156
+ msgid "Delete Account"
157
+ msgstr "Delete Account"
158
+
159
+ #: includes/i18n.php:69
160
+ msgctxt "as close a window"
161
+ msgid "Dismiss"
162
+ msgstr "Dismiss"
163
+
164
+ #: includes/i18n.php:70
165
+ msgctxt "as product pricing plan"
166
+ msgid "Plan"
167
+ msgstr "Plan"
168
+
169
+ #: includes/i18n.php:71
170
+ msgid "Change Plan"
171
+ msgstr "Change Plan"
172
+
173
+ #: includes/i18n.php:72
174
+ msgctxt "as download professional version"
175
+ msgid "Download %s Version"
176
+ msgstr "Download %s Version"
177
+
178
+ #: includes/i18n.php:73
179
+ msgctxt "as download professional version now"
180
+ msgid "Download %s version now"
181
+ msgstr "Download %s version now"
182
+
183
+ #: includes/i18n.php:74
184
+ msgctxt "as download latest version"
185
+ msgid "Download Latest"
186
+ msgstr "Download Latest"
187
+
188
+ #: includes/i18n.php:75
189
+ msgctxt "E.g. you have a professional license."
190
+ msgid "You have a %s license."
191
+ msgstr "You have a %s license."
192
+
193
+ #: includes/i18n.php:76
194
+ msgid "New"
195
+ msgstr "New"
196
+
197
+ #: includes/i18n.php:77
198
+ msgid "Free"
199
+ msgstr "Free"
200
+
201
+ #: includes/i18n.php:78
202
+ msgctxt "as trial plan"
203
+ msgid "Trial"
204
+ msgstr "Trial"
205
+
206
+ #: includes/i18n.php:79
207
+ msgctxt "as starting a trial plan"
208
+ msgid "Start Trial"
209
+ msgstr "Start Trial"
210
+
211
+ #: includes/i18n.php:80
212
+ msgctxt "verb"
213
+ msgid "Purchase"
214
+ msgstr "Purchase"
215
+
216
+ #: includes/i18n.php:81
217
+ msgid "Purchase License"
218
+ msgstr "Purchase License"
219
+
220
+ #: includes/i18n.php:82
221
+ msgctxt "verb"
222
+ msgid "Buy"
223
+ msgstr "Buy"
224
+
225
+ #: includes/i18n.php:83
226
+ msgid "Buy License"
227
+ msgstr "Buy License"
228
+
229
+ #: includes/i18n.php:84
230
+ msgid "Single Site License"
231
+ msgstr "Single Site License"
232
+
233
+ #: includes/i18n.php:85
234
+ msgid "Unlimited Licenses"
235
+ msgstr "Unlimited Licenses"
236
+
237
+ #: includes/i18n.php:86
238
+ msgid "Up to %s Sites"
239
+ msgstr "Up to %s Sites"
240
+
241
+ #: includes/i18n.php:87
242
+ msgid "%sRenew your license now%s to access version %s features and support."
243
+ msgstr "%sRenew your license now%s to access version %s features and support."
244
+
245
+ #: includes/i18n.php:88
246
+ msgid "Enter the email address you've used for the upgrade below and we will resend you the license key."
247
+ msgstr "Enter the email address you've used for the upgrade below and we will resend you the license key."
248
+
249
+ #: includes/i18n.php:89
250
+ msgctxt "e.g. Professional Plan"
251
+ msgid "%s Plan"
252
+ msgstr "%s Plan"
253
+
254
+ #: includes/i18n.php:90
255
+ msgid "You are just one step away - %s"
256
+ msgstr "You are just one step away - %s"
257
+
258
+ #: includes/i18n.php:91
259
+ msgctxt "%s - plugin name. As complete \"Jetpack\" activation now"
260
+ msgid "Complete \"%s\" Activation Now"
261
+ msgstr "Complete \"%s\" Activation Now"
262
+
263
+ #: includes/i18n.php:93
264
+ msgid "We made a few tweaks to the plugin, %s"
265
+ msgstr "We made a few tweaks to the plugin, %s"
266
+
267
+ #: includes/i18n.php:94
268
+ msgid "Opt-in to make \"%s\" Better!"
269
+ msgstr "Opt-in to make \"%s\" Better!"
270
+
271
+ #: includes/i18n.php:95
272
+ msgid "Error"
273
+ msgstr "Error"
274
+
275
+ #: includes/i18n.php:96
276
+ msgid "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
277
+ msgstr "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
278
+
279
+ #: includes/i18n.php:99
280
+ msgctxt "as expiration date"
281
+ msgid "Expiration"
282
+ msgstr "Expiration"
283
+
284
+ #: includes/i18n.php:100
285
+ msgctxt "as software license"
286
+ msgid "License"
287
+ msgstr "License"
288
+
289
+ #: includes/i18n.php:101
290
+ msgid "not verified"
291
+ msgstr "not verified"
292
+
293
+ #: includes/i18n.php:102
294
+ msgid "Verify Email"
295
+ msgstr "Verify Email"
296
+
297
+ #: includes/i18n.php:103
298
+ msgctxt "e.g. expires in 2 months"
299
+ msgid "Expires in %s"
300
+ msgstr "Expires in %s"
301
+
302
+ #: includes/i18n.php:104
303
+ msgctxt "e.g. auto renews in 2 months"
304
+ msgid "Auto renews in %s"
305
+ msgstr "Auto renews in %s"
306
+
307
+ #: includes/i18n.php:105
308
+ msgid "No expiration"
309
+ msgstr "No expiration"
310
+
311
+ #: includes/i18n.php:106
312
+ msgid "Expired"
313
+ msgstr "Expired"
314
+
315
+ #: includes/i18n.php:107
316
+ msgid "Cancelled"
317
+ msgstr "Cancelled"
318
+
319
+ #: includes/i18n.php:108
320
+ msgctxt "e.g. In 2 hours"
321
+ msgid "In %s"
322
+ msgstr "In %s"
323
+
324
+ #: includes/i18n.php:109
325
+ msgctxt "e.g. 2 min ago"
326
+ msgid "%s ago"
327
+ msgstr "%s ago"
328
+
329
+ #: includes/i18n.php:111
330
+ msgid "%s or higher"
331
+ msgstr "%s or higher"
332
+
333
+ #: includes/i18n.php:112
334
+ msgctxt "as plugin version"
335
+ msgid "Version"
336
+ msgstr "Version"
337
+
338
+ #: includes/i18n.php:113
339
+ msgid "Name"
340
+ msgstr "Name"
341
+
342
+ #: includes/i18n.php:114
343
+ msgid "Email"
344
+ msgstr "Email"
345
+
346
+ #: includes/i18n.php:115
347
+ msgid "Email address"
348
+ msgstr "Email address"
349
+
350
+ #: includes/i18n.php:116
351
+ msgid "Verified"
352
+ msgstr "Verified"
353
+
354
+ #: includes/i18n.php:117
355
+ msgid "Module"
356
+ msgstr "Module"
357
+
358
+ #: includes/i18n.php:118
359
+ msgid "Module Type"
360
+ msgstr "Module Type"
361
+
362
+ #: includes/i18n.php:119
363
+ msgid "Plugin"
364
+ msgstr "Plugin"
365
+
366
+ #: includes/i18n.php:120
367
+ msgid "Plugins"
368
+ msgstr "Plugins"
369
+
370
+ #: includes/i18n.php:121
371
+ msgid "Theme"
372
+ msgstr "Theme"
373
+
374
+ #: includes/i18n.php:122
375
+ msgid "Themes"
376
+ msgstr "Themes"
377
+
378
+ #: includes/i18n.php:123
379
+ msgctxt "as file/folder path"
380
+ msgid "Path"
381
+ msgstr "Path"
382
+
383
+ #: includes/i18n.php:124
384
+ msgid "Title"
385
+ msgstr "Title"
386
+
387
+ #: includes/i18n.php:125
388
+ msgid "Free version"
389
+ msgstr "Free version"
390
+
391
+ #: includes/i18n.php:126
392
+ msgid "Premium version"
393
+ msgstr "Premium version"
394
+
395
+ #: includes/i18n.php:127
396
+ msgctxt "as WP plugin slug"
397
+ msgid "Slug"
398
+ msgstr "Slug"
399
+
400
+ #: includes/i18n.php:128
401
+ msgid "ID"
402
+ msgstr "ID"
403
+
404
+ #: includes/i18n.php:129
405
+ msgid "Users"
406
+ msgstr "Users"
407
+
408
+ #: includes/i18n.php:130
409
+ msgid "Plugin Installs"
410
+ msgstr "Plugin Installs"
411
+
412
+ #: includes/i18n.php:131
413
+ msgid "%s Installs"
414
+ msgstr "%s Installs"
415
+
416
+ #: includes/i18n.php:132
417
+ msgctxt "like websites"
418
+ msgid "Sites"
419
+ msgstr "Sites"
420
+
421
+ #: includes/i18n.php:133
422
+ msgid "User ID"
423
+ msgstr "User ID"
424
+
425
+ #: includes/i18n.php:134
426
+ msgid "Site ID"
427
+ msgstr "Site ID"
428
+
429
+ #: includes/i18n.php:135
430
+ msgid "Public Key"
431
+ msgstr "Public Key"
432
+
433
+ #: includes/i18n.php:136
434
+ msgid "Secret Key"
435
+ msgstr "Secret Key"
436
+
437
+ #: includes/i18n.php:137
438
+ msgctxt "as secret encryption key missing"
439
+ msgid "No Secret"
440
+ msgstr "No Secret"
441
+
442
+ #: includes/i18n.php:138
443
+ msgid "No ID"
444
+ msgstr "No ID"
445
+
446
+ #: includes/i18n.php:139
447
+ msgctxt "as synchronize license"
448
+ msgid "Sync License"
449
+ msgstr "Sync License"
450
+
451
+ #: includes/i18n.php:140
452
+ msgctxt "as synchronize"
453
+ msgid "Sync"
454
+ msgstr "Sync"
455
+
456
+ #: includes/i18n.php:141
457
+ msgid "Activate License"
458
+ msgstr "Activate License"
459
+
460
+ #: includes/i18n.php:142
461
+ msgid "Activate Free Version"
462
+ msgstr "Activate Free Version"
463
+
464
+ #: includes/i18n.php:143
465
+ msgid "Please enter the license key that you received in the email right after the purchase:"
466
+ msgstr "Please enter the license key that you received in the email right after the purchase:"
467
+
468
+ #: includes/i18n.php:144
469
+ msgid "Activating license..."
470
+ msgstr "Activating license..."
471
+
472
+ #: includes/i18n.php:145
473
+ msgid "Change License"
474
+ msgstr "Change License"
475
+
476
+ #: includes/i18n.php:146
477
+ msgid "Update License"
478
+ msgstr "Update License"
479
+
480
+ #: includes/i18n.php:147
481
+ msgid "Deactivate License"
482
+ msgstr "Deactivate License"
483
+
484
+ #: includes/i18n.php:148
485
+ msgid "Activate"
486
+ msgstr "Activate"
487
+
488
+ #: includes/i18n.php:149
489
+ msgid "Deactivate"
490
+ msgstr "Deactivate"
491
+
492
+ #: includes/i18n.php:150
493
+ msgid "Skip & Deactivate"
494
+ msgstr "Skip & Deactivate"
495
+
496
+ #: includes/i18n.php:151
497
+ msgid "Skip & %s"
498
+ msgstr "Skip & %s"
499
+
500
+ #: includes/i18n.php:152
501
+ msgid "No - just deactivate"
502
+ msgstr "No - just deactivate"
503
+
504
+ #: includes/i18n.php:153
505
+ msgid "Yes - do your thing"
506
+ msgstr "Yes - do your thing"
507
+
508
+ #: includes/i18n.php:154
509
+ msgctxt "active mode"
510
+ msgid "Active"
511
+ msgstr "Active"
512
+
513
+ #: includes/i18n.php:155
514
+ msgctxt "is active mode?"
515
+ msgid "Is Active"
516
+ msgstr "Is Active"
517
+
518
+ #: includes/i18n.php:156
519
+ msgid "Install Now"
520
+ msgstr "Install Now"
521
+
522
+ #: includes/i18n.php:157
523
+ msgid "Install Update Now"
524
+ msgstr "Install Update Now"
525
+
526
+ #: includes/i18n.php:158
527
+ msgid "More information about %s"
528
+ msgstr "More information about %s"
529
+
530
+ #: includes/i18n.php:159
531
+ msgid "Localhost"
532
+ msgstr "Localhost"
533
+
534
+ #: includes/i18n.php:160
535
+ msgctxt "as activate Professional plan"
536
+ msgid "Activate %s Plan"
537
+ msgstr "Activate %s Plan"
538
+
539
+ #: includes/i18n.php:161
540
+ msgctxt "as 5 licenses left"
541
+ msgid "%s left"
542
+ msgstr "%s left"
543
+
544
+ #: includes/i18n.php:162
545
+ msgid "Last license"
546
+ msgstr "Last license"
547
+
548
+ #: includes/i18n.php:163
549
+ msgid "What is your %s?"
550
+ msgstr "What is your %s?"
551
+
552
+ #: includes/i18n.php:164
553
+ msgid "Activate this add-on"
554
+ msgstr "Activate this add-on"
555
+
556
+ #: includes/i18n.php:165
557
+ 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?"
558
+ 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?"
559
+
560
+ #: includes/i18n.php:166
561
+ 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?"
562
+ 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?"
563
+
564
+ #: includes/i18n.php:167
565
+ 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?"
566
+ 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?"
567
+
568
+ #: includes/i18n.php:168
569
+ msgid "Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s."
570
+ msgstr "Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s."
571
+
572
+ #: includes/i18n.php:169
573
+ msgid "Cancelling the trial will immediately block access to all premium features. Are you sure?"
574
+ msgstr "Cancelling the trial will immediately block access to all premium features. Are you sure?"
575
+
576
+ #: includes/i18n.php:170
577
+ msgid "You can still enjoy all %s features but you will not have access to plugin updates and support."
578
+ msgstr "You can still enjoy all %s features but you will not have access to plugin updates and support."
579
+
580
+ #: includes/i18n.php:171
581
+ msgid "Once your license expires you can still use the Free version but you will NOT have access to the %s features."
582
+ msgstr "Once your license expires you can still use the Free version but you will NOT have access to the %s features."
583
+
584
+ #: includes/i18n.php:172
585
+ msgid "Are you sure you want to proceed?"
586
+ msgstr "Are you sure you want to proceed?"
587
+
588
+ #: includes/i18n.php:175
589
+ msgid "Add Ons for %s"
590
+ msgstr "Add Ons for %s"
591
+
592
+ #: includes/i18n.php:176
593
+ 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."
594
+ 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."
595
+
596
+ #: includes/i18n.php:178
597
+ msgid "Anonymous feedback"
598
+ msgstr "Anonymous feedback"
599
+
600
+ #: includes/i18n.php:179
601
+ msgid "Quick feedback"
602
+ msgstr "Quick feedback"
603
+
604
+ #: includes/i18n.php:180
605
+ msgid "If you have a moment, please let us know why you are deactivating"
606
+ msgstr "If you have a moment, please let us know why you are deactivating"
607
+
608
+ #: includes/i18n.php:181
609
+ msgid "Yes - Deactivate"
610
+ msgstr "Yes - Deactivate"
611
+
612
+ #: includes/i18n.php:182
613
+ msgid "Submit & Deactivate"
614
+ msgstr "Submit & Deactivate"
615
+
616
+ #: includes/i18n.php:183
617
+ msgid "Cancel"
618
+ msgstr "Cancel"
619
+
620
+ #: includes/i18n.php:184
621
+ msgid "I no longer need the plugin"
622
+ msgstr "I no longer need the plugin"
623
+
624
+ #: includes/i18n.php:185
625
+ msgid "I found a better plugin"
626
+ msgstr "I found a better plugin"
627
+
628
+ #: includes/i18n.php:186
629
+ msgid "I only needed the plugin for a short period"
630
+ msgstr "I only needed the plugin for a short period"
631
+
632
+ #: includes/i18n.php:187
633
+ msgid "The plugin broke my site"
634
+ msgstr "The plugin broke my site"
635
+
636
+ #: includes/i18n.php:188
637
+ msgid "The plugin suddenly stopped working"
638
+ msgstr "The plugin suddenly stopped working"
639
+
640
+ #: includes/i18n.php:189
641
+ msgid "I can't pay for it anymore"
642
+ msgstr "I can't pay for it anymore"
643
+
644
+ #: includes/i18n.php:190
645
+ msgid "It's a temporary deactivation. I'm just debugging an issue."
646
+ msgstr "It's a temporary deactivation. I'm just debugging an issue."
647
+
648
+ #: includes/i18n.php:191
649
+ msgctxt "the text of the \"other\" reason for deactivating the plugin that is shown in the modal box."
650
+ msgid "Other"
651
+ msgstr "Other"
652
+
653
+ #: includes/i18n.php:193
654
+ msgid "Kindly tell us the reason so we can improve."
655
+ msgstr "Kindly tell us the reason so we can improve."
656
+
657
+ #: includes/i18n.php:194
658
+ msgid "What's the plugin's name?"
659
+ msgstr "What's the plugin's name?"
660
+
661
+ #: includes/i18n.php:195
662
+ msgid "What price would you feel comfortable paying?"
663
+ msgstr "What price would you feel comfortable paying?"
664
+
665
+ #: includes/i18n.php:196
666
+ msgid "I couldn't understand how to make it work"
667
+ msgstr "I couldn't understand how to make it work"
668
+
669
+ #: includes/i18n.php:197
670
+ msgid "The plugin is great, but I need specific feature that you don't support"
671
+ msgstr "The plugin is great, but I need specific feature that you don't support"
672
+
673
+ #: includes/i18n.php:198
674
+ msgid "The plugin is not working"
675
+ msgstr "The plugin is not working"
676
+
677
+ #: includes/i18n.php:199
678
+ msgid "It's not what I was looking for"
679
+ msgstr "It's not what I was looking for"
680
+
681
+ #: includes/i18n.php:200
682
+ msgid "The plugin didn't work as expected"
683
+ msgstr "The plugin didn't work as expected"
684
+
685
+ #: includes/i18n.php:201
686
+ msgid "What feature?"
687
+ msgstr "What feature?"
688
+
689
+ #: includes/i18n.php:202
690
+ msgid "Kindly share what didn't work so we can fix it for future users..."
691
+ msgstr "Kindly share what didn't work so we can fix it for future users..."
692
+
693
+ #: includes/i18n.php:203
694
+ msgid "What you've been looking for?"
695
+ msgstr "What you've been looking for?"
696
+
697
+ #: includes/i18n.php:204
698
+ msgid "What did you expect?"
699
+ msgstr "What did you expect?"
700
+
701
+ #: includes/i18n.php:205
702
+ msgid "The plugin didn't work"
703
+ msgstr "The plugin didn't work"
704
+
705
+ #: includes/i18n.php:206
706
+ msgid "I don't like to share my information with you"
707
+ msgstr "I don't like to share my information with you"
708
+
709
+ #: includes/i18n.php:207
710
+ msgid "You might have missed it, but you don't have to share any data and can just %s the opt-in."
711
+ msgstr "You might have missed it, but you don't have to share any data and can just %s the opt-in."
712
+
713
+ #: includes/i18n.php:211
714
+ msgctxt "greeting"
715
+ msgid "Hey %s,"
716
+ msgstr "Hey %s,"
717
+
718
+ #: includes/i18n.php:212
719
+ msgctxt "a greeting. E.g. Thanks John!"
720
+ msgid "Thanks %s!"
721
+ msgstr "Thanks %s!"
722
+
723
+ #: includes/i18n.php:213
724
+ msgid "Never miss an important update - opt-in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s."
725
+ msgstr "Never miss an important update - opt-in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s."
726
+
727
+ #: includes/i18n.php:214
728
+ 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."
729
+ 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."
730
+
731
+ #: includes/i18n.php:215
732
+ 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."
733
+ 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."
734
+
735
+ #: includes/i18n.php:216
736
+ msgid "complete the install"
737
+ msgstr "complete the install"
738
+
739
+ #: includes/i18n.php:217
740
+ msgid "start the trial"
741
+ msgstr "start the trial"
742
+
743
+ #: includes/i18n.php:218
744
+ msgid "Thanks for purchasing %s! To get started, please enter your license key:"
745
+ msgstr "Thanks for purchasing %s! To get started, please enter your license key:"
746
+
747
+ #: includes/i18n.php:219
748
+ msgid "The plugin will be periodically sending data to %s to check for plugin updates and verify the validity of your license."
749
+ msgstr "The plugin will be periodically sending data to %s to check for plugin updates and verify the validity of your license."
750
+
751
+ #: includes/i18n.php:220
752
+ msgid "What permissions are being granted?"
753
+ msgstr "What permissions are being granted?"
754
+
755
+ #: includes/i18n.php:221
756
+ msgid "Your Profile Overview"
757
+ msgstr "Your Profile Overview"
758
+
759
+ #: includes/i18n.php:222
760
+ msgid "Name and email address"
761
+ msgstr "Name and email address"
762
+
763
+ #: includes/i18n.php:223
764
+ msgid "Your Site Overview"
765
+ msgstr "Your Site Overview"
766
+
767
+ #: includes/i18n.php:224
768
+ msgid "Site URL, WP version, PHP info, plugins & themes"
769
+ msgstr "Site URL, WP version, PHP info, plugins & themes"
770
+
771
+ #: includes/i18n.php:225
772
+ msgid "Current Plugin Events"
773
+ msgstr "Current Plugin Events"
774
+
775
+ #: includes/i18n.php:226
776
+ msgid "Activation, deactivation and uninstall"
777
+ msgstr "Activation, deactivation and uninstall"
778
+
779
+ #: includes/i18n.php:227
780
+ msgid "Plugins & Themes"
781
+ msgstr "Plugins & Themes"
782
+
783
+ #: includes/i18n.php:228
784
+ msgid "Titles, versions and state."
785
+ msgstr "Titles, versions and state."
786
+
787
+ #: includes/i18n.php:229
788
+ msgid "Admin Notices"
789
+ msgstr "Admin Notices"
790
+
791
+ #: includes/i18n.php:230
792
+ msgid "Newsletter"
793
+ msgstr "Newsletter"
794
+
795
+ #: includes/i18n.php:231
796
+ msgid "Updates, announcements, marketing, no spam"
797
+ msgstr "Updates, announcements, marketing, no spam"
798
+
799
+ #: includes/i18n.php:232
800
+ msgid "Privacy Policy"
801
+ msgstr "Privacy Policy"
802
+
803
+ #: includes/i18n.php:233
804
+ msgid "Terms of Service"
805
+ msgstr "Terms of Service"
806
+
807
+ #: includes/i18n.php:234
808
+ msgctxt "as activating plugin"
809
+ msgid "Activating"
810
+ msgstr "Activating"
811
+
812
+ #: includes/i18n.php:235
813
+ msgctxt "as in the process of sending an email"
814
+ msgid "Sending email"
815
+ msgstr "Sending email"
816
+
817
+ #: includes/i18n.php:236
818
+ msgctxt "button label"
819
+ msgid "Allow & Continue"
820
+ msgstr "Allow & Continue"
821
+
822
+ #: includes/i18n.php:237
823
+ msgctxt "button label"
824
+ msgid "Agree & Activate License"
825
+ msgstr "Agree & Activate License"
826
+
827
+ #: includes/i18n.php:238
828
+ msgctxt "verb"
829
+ msgid "Skip"
830
+ msgstr "Skip"
831
+
832
+ #: includes/i18n.php:239
833
+ msgid "Click here to use the plugin anonymously"
834
+ msgstr "Click here to use the plugin anonymously"
835
+
836
+ #: includes/i18n.php:240
837
+ msgid "Re-send activation email"
838
+ msgstr "Re-send activation email"
839
+
840
+ #: includes/i18n.php:241
841
+ msgid "License key"
842
+ msgstr "License key"
843
+
844
+ #: includes/i18n.php:242
845
+ msgid "Send License Key"
846
+ msgstr "Send License Key"
847
+
848
+ #: includes/i18n.php:243
849
+ msgid "Sending license key"
850
+ msgstr "Sending license key"
851
+
852
+ #: includes/i18n.php:244
853
+ msgid "Have a license key?"
854
+ msgstr "Have a license key?"
855
+
856
+ #: includes/i18n.php:245
857
+ msgid "Don't have a license key?"
858
+ msgstr "Don't have a license key?"
859
+
860
+ #: includes/i18n.php:246
861
+ msgid "Can't find your license key?"
862
+ msgstr "Can't find your license key?"
863
+
864
+ #: includes/i18n.php:247
865
+ msgid "We couldn't find your email address in the system, are you sure it's the right address?"
866
+ msgstr "We couldn't find your email address in the system, are you sure it's the right address?"
867
+
868
+ #: includes/i18n.php:248
869
+ msgid "We can't see any active licenses associated with that email address, are you sure it's the right address?"
870
+ msgstr "We can't see any active licenses associated with that email address, are you sure it's the right address?"
871
+
872
+ #: includes/i18n.php:249
873
+ msgid "Opt In"
874
+ msgstr "Opt In"
875
+
876
+ #: includes/i18n.php:250
877
+ msgid "Opt Out"
878
+ msgstr "Opt Out"
879
+
880
+ #: includes/i18n.php:251
881
+ msgid "On second thought - I want to continue helping"
882
+ msgstr "On second thought - I want to continue helping"
883
+
884
+ #: includes/i18n.php:252
885
+ msgid "Opting out..."
886
+ msgstr "Opting out..."
887
+
888
+ #: includes/i18n.php:253
889
+ msgid "Opting in..."
890
+ msgstr "Opting in..."
891
+
892
+ #: includes/i18n.php:254
893
+ msgid "We appreciate your help in making the %s better by letting us track some usage data."
894
+ msgstr "We appreciate your help in making the %s better by letting us track some usage data."
895
+
896
+ #: includes/i18n.php:255
897
+ 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."
898
+ 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."
899
+
900
+ #: includes/i18n.php:256
901
+ msgid "By clicking \"Opt Out\", we will no longer be sending any data from %s to %s."
902
+ msgstr "By clicking \"Opt Out\", we will no longer be sending any data from %s to %s."
903
+
904
+ #: includes/i18n.php:260
905
+ msgid "Screenshots"
906
+ msgstr "Screenshots"
907
+
908
+ #: includes/i18n.php:261
909
+ msgid "Click to view full-size screenshot %d"
910
+ msgstr "Click to view full-size screenshot %d"
911
+
912
+ #: includes/i18n.php:265
913
+ msgid "Freemius Debug"
914
+ msgstr "Freemius Debug"
915
+
916
+ #: includes/i18n.php:266
917
+ msgctxt "as turned on"
918
+ msgid "On"
919
+ msgstr "On"
920
+
921
+ #: includes/i18n.php:267
922
+ msgctxt "as turned off"
923
+ msgid "Off"
924
+ msgstr "Off"
925
+
926
+ #: includes/i18n.php:268
927
+ msgctxt "as code debugging"
928
+ msgid "Debugging"
929
+ msgstr "Debugging"
930
+
931
+ #: includes/i18n.php:269
932
+ msgid "Freemius State"
933
+ msgstr "Freemius State"
934
+
935
+ #: includes/i18n.php:270
936
+ msgctxt "as connection was successful"
937
+ msgid "Connected"
938
+ msgstr "Connected"
939
+
940
+ #: includes/i18n.php:271
941
+ msgctxt "as connection blocked"
942
+ msgid "Blocked"
943
+ msgstr "Blocked"
944
+
945
+ #: includes/i18n.php:272
946
+ msgctxt "as application program interface"
947
+ msgid "API"
948
+ msgstr "API"
949
+
950
+ #: includes/i18n.php:273
951
+ msgctxt "as software development kit versions"
952
+ msgid "SDK"
953
+ msgstr "SDK"
954
+
955
+ #: includes/i18n.php:274
956
+ msgctxt "as software development kit versions"
957
+ msgid "SDK Versions"
958
+ msgstr "SDK Versions"
959
+
960
+ #: includes/i18n.php:275
961
+ msgctxt "as plugin folder path"
962
+ msgid "Plugin Path"
963
+ msgstr "Plugin Path"
964
+
965
+ #: includes/i18n.php:276
966
+ msgctxt "as sdk path"
967
+ msgid "SDK Path"
968
+ msgstr "SDK Path"
969
+
970
+ #: includes/i18n.php:277
971
+ msgid "Add Ons of Plugin %s"
972
+ msgstr "Add Ons of Plugin %s"
973
+
974
+ #: includes/i18n.php:278
975
+ msgid "Are you sure you want to delete all Freemius data?"
976
+ msgstr "Are you sure you want to delete all Freemius data?"
977
+
978
+ #: includes/i18n.php:279
979
+ msgid "Actions"
980
+ msgstr "Actions"
981
+
982
+ #: includes/i18n.php:280
983
+ msgid "Delete All Accounts"
984
+ msgstr "Delete All Accounts"
985
+
986
+ #: includes/i18n.php:281
987
+ msgid "Start Fresh"
988
+ msgstr "Start Fresh"
989
+
990
+ #: includes/i18n.php:282
991
+ msgid "Clear API Cache"
992
+ msgstr "Clear API Cache"
993
+
994
+ #: includes/i18n.php:283
995
+ msgid "Sync Data From Server"
996
+ msgstr "Sync Data From Server"
997
+
998
+ #: includes/i18n.php:284
999
+ msgid "Scheduled Crons"
1000
+ msgstr "Scheduled Crons"
1001
+
1002
+ #: includes/i18n.php:285
1003
+ msgid "Cron Type"
1004
+ msgstr "Cron Type"
1005
+
1006
+ #: includes/i18n.php:286
1007
+ msgid "Plugins & Themes Sync"
1008
+ msgstr "Plugins & Themes Sync"
1009
+
1010
+ #: includes/i18n.php:287
1011
+ msgid "Licenses"
1012
+ msgstr "Licenses"
1013
+
1014
+ #: includes/i18n.php:288
1015
+ msgid "Debug Log"
1016
+ msgstr "Debug Log"
1017
+
1018
+ #: includes/i18n.php:289
1019
+ msgid "All"
1020
+ msgstr "All"
1021
+
1022
+ #: includes/i18n.php:290
1023
+ msgid "File"
1024
+ msgstr "File"
1025
+
1026
+ #: includes/i18n.php:291
1027
+ msgid "Function"
1028
+ msgstr "Function"
1029
+
1030
+ #: includes/i18n.php:292
1031
+ msgid "Process ID"
1032
+ msgstr "Process ID"
1033
+
1034
+ #: includes/i18n.php:293
1035
+ msgid "Logger"
1036
+ msgstr "Logger"
1037
+
1038
+ #: includes/i18n.php:294
1039
+ msgid "Message"
1040
+ msgstr "Message"
1041
+
1042
+ #: includes/i18n.php:295
1043
+ msgid "Download"
1044
+ msgstr "Download"
1045
+
1046
+ #: includes/i18n.php:296
1047
+ msgid "Filter"
1048
+ msgstr "Filter"
1049
+
1050
+ #: includes/i18n.php:297
1051
+ msgid "Type"
1052
+ msgstr "Type"
1053
+
1054
+ #: includes/i18n.php:298
1055
+ msgid "All Types"
1056
+ msgstr "All Types"
1057
+
1058
+ #: includes/i18n.php:299
1059
+ msgid "All Requests"
1060
+ msgstr "All Requests"
1061
+
1062
+ #: includes/i18n.php:303
1063
+ msgctxt "as congratulations"
1064
+ msgid "Congrats"
1065
+ msgstr "Congrats"
1066
+
1067
+ #: includes/i18n.php:304
1068
+ msgctxt "exclamation"
1069
+ msgid "Oops"
1070
+ msgstr "Oops"
1071
+
1072
+ #: includes/i18n.php:305
1073
+ msgctxt "interjection expressing joy or exuberance"
1074
+ msgid "Yee-haw"
1075
+ msgstr "Yee-haw"
1076
+
1077
+ #: includes/i18n.php:306
1078
+ msgctxt "(especially in electronic communication) used to express elation, enthusiasm, or triumph."
1079
+ msgid "W00t"
1080
+ msgstr "W00t"
1081
+
1082
+ #: includes/i18n.php:308
1083
+ msgctxt "a positive response"
1084
+ msgid "Right on"
1085
+ msgstr "Right on"
1086
+
1087
+ #: includes/i18n.php:309
1088
+ msgctxt "something somebody says when they are thinking about what you have just said. "
1089
+ msgid "Hmm"
1090
+ msgstr "Hmm"
1091
+
1092
+ #: includes/i18n.php:311
1093
+ msgid "O.K"
1094
+ msgstr "O.K"
1095
+
1096
+ #: includes/i18n.php:312
1097
+ msgctxt "exclamation"
1098
+ msgid "Hey"
1099
+ msgstr "Hey"
1100
+
1101
+ #: includes/i18n.php:313
1102
+ msgctxt "advance notice of something that will need attention."
1103
+ msgid "Heads up"
1104
+ msgstr "Heads up"
1105
+
1106
+ #: includes/i18n.php:318
1107
+ msgid "Seems like you got the latest release."
1108
+ msgstr "Seems like you got the latest release."
1109
+
1110
+ #: includes/i18n.php:319
1111
+ msgid "You are all good!"
1112
+ msgstr "You are all good!"
1113
+
1114
+ #: includes/i18n.php:320
1115
+ msgid "Sorry, we could not complete the email update. Another user with the same email is already registered."
1116
+ msgstr "Sorry, we could not complete the email update. Another user with the same email is already registered."
1117
+
1118
+ #: includes/i18n.php:321
1119
+ msgid "If you would like to give up the ownership of the plugin's account to %s click the Change Ownership button."
1120
+ msgstr "If you would like to give up the ownership of the plugin's account to %s click the Change Ownership button."
1121
+
1122
+ #: includes/i18n.php:322
1123
+ msgid "Your email was successfully updated. You should receive an email with confirmation instructions in few moments."
1124
+ msgstr "Your email was successfully updated. You should receive an email with confirmation instructions in few moments."
1125
+
1126
+ #: includes/i18n.php:323
1127
+ msgid "Your name was successfully updated."
1128
+ msgstr "Your name was successfully updated."
1129
+
1130
+ #: includes/i18n.php:324
1131
+ msgid "You have successfully updated your %s."
1132
+ msgstr "You have successfully updated your %s."
1133
+
1134
+ #: includes/i18n.php:325
1135
+ msgid "Please provide your full name."
1136
+ msgstr "Please provide your full name."
1137
+
1138
+ #: includes/i18n.php:326
1139
+ msgid "Verification mail was just sent to %s. If you can't find it after 5 min, please check your spam box."
1140
+ msgstr "Verification mail was just sent to %s. If you can't find it after 5 min, please check your spam box."
1141
+
1142
+ #: includes/i18n.php:327
1143
+ msgid "Just letting you know that the add-ons information of %s is being pulled from an external server."
1144
+ msgstr "Just letting you know that the add-ons information of %s is being pulled from an external server."
1145
+
1146
+ #: includes/i18n.php:328
1147
+ msgid "No credit card required"
1148
+ msgstr "No credit card required"
1149
+
1150
+ #: includes/i18n.php:329
1151
+ msgid "Premium plugin version was successfully activated."
1152
+ msgstr "Premium plugin version was successfully activated."
1153
+
1154
+ #: includes/i18n.php:330
1155
+ msgid "The upgrade of %s was successfully completed."
1156
+ msgstr "The upgrade of %s was successfully completed."
1157
+
1158
+ #: includes/i18n.php:331
1159
+ msgid "Your account was successfully activated with the %s plan."
1160
+ msgstr "Your account was successfully activated with the %s plan."
1161
+
1162
+ #: includes/i18n.php:332
1163
+ msgid "Download the latest %s version now"
1164
+ msgstr "Download the latest %s version now"
1165
+
1166
+ #: includes/i18n.php:333
1167
+ msgid "Please follow these steps to complete the upgrade"
1168
+ msgstr "Please follow these steps to complete the upgrade"
1169
+
1170
+ #: includes/i18n.php:334
1171
+ msgid "Download the latest %s version"
1172
+ msgstr "Download the latest %s version"
1173
+
1174
+ #: includes/i18n.php:335
1175
+ msgid "Download the latest version"
1176
+ msgstr "Download the latest version"
1177
+
1178
+ #: includes/i18n.php:336
1179
+ msgid "Deactivate the free version"
1180
+ msgstr "Deactivate the free version"
1181
+
1182
+ #: includes/i18n.php:337
1183
+ msgid "Upload and activate the downloaded version"
1184
+ msgstr "Upload and activate the downloaded version"
1185
+
1186
+ #: includes/i18n.php:338
1187
+ msgid "How to upload and activate?"
1188
+ msgstr "How to upload and activate?"
1189
+
1190
+ #: includes/i18n.php:339
1191
+ msgctxt "%s - product name, e.g. Facebook add-on was successfully..."
1192
+ msgid "%s Add-on was successfully purchased."
1193
+ msgstr "%s Add-on was successfully purchased."
1194
+
1195
+ #: includes/i18n.php:341
1196
+ msgid "Your %s Add-on plan was successfully upgraded."
1197
+ msgstr "Your %s Add-on plan was successfully upgraded."
1198
+
1199
+ #: includes/i18n.php:342
1200
+ msgid "Your email has been successfully verified - you are AWESOME!"
1201
+ msgstr "Your email has been successfully verified - you are AWESOME!"
1202
+
1203
+ #: includes/i18n.php:343
1204
+ msgid "Your plan was successfully upgraded."
1205
+ msgstr "Your plan was successfully upgraded."
1206
+
1207
+ #: includes/i18n.php:344
1208
+ msgid "Your plan was successfully changed to %s."
1209
+ msgstr "Your plan was successfully changed to %s."
1210
+
1211
+ #: includes/i18n.php:345
1212
+ msgid "Your license has expired. You can still continue using the free plugin forever."
1213
+ msgstr "Your license has expired. You can still continue using the free plugin forever."
1214
+
1215
+ #: includes/i18n.php:346
1216
+ msgid "Your license has been cancelled. If you think it's a mistake, please contact support."
1217
+ msgstr "Your license has been cancelled. If you think it's a mistake, please contact support."
1218
+
1219
+ #: includes/i18n.php:347
1220
+ msgid "Your trial has been successfully started."
1221
+ msgstr "Your trial has been successfully started."
1222
+
1223
+ #: includes/i18n.php:348
1224
+ msgid "Your license was successfully activated."
1225
+ msgstr "Your license was successfully activated."
1226
+
1227
+ #: includes/i18n.php:349
1228
+ msgid "It looks like your site currently doesn't have an active license."
1229
+ msgstr "It looks like your site currently doesn't have an active license."
1230
+
1231
+ #: includes/i18n.php:350
1232
+ msgid "Your license was successfully deactivated, you are back to the %s plan."
1233
+ msgstr "Your license was successfully deactivated, you are back to the %s plan."
1234
+
1235
+ #: includes/i18n.php:351
1236
+ msgid "It looks like the license deactivation failed."
1237
+ msgstr "It looks like the license deactivation failed."
1238
+
1239
+ #: includes/i18n.php:352
1240
+ msgid "It looks like the license could not be activated."
1241
+ msgstr "It looks like the license could not be activated."
1242
+
1243
+ #: includes/i18n.php:353
1244
+ msgid "Error received from the server:"
1245
+ msgstr "Error received from the server:"
1246
+
1247
+ #: includes/i18n.php:354
1248
+ msgid "Your trial has expired. You can still continue using all our free features."
1249
+ msgstr "Your trial has expired. You can still continue using all our free features."
1250
+
1251
+ #: includes/i18n.php:355
1252
+ msgid "Your plan was successfully downgraded. Your %s plan license will expire in %s."
1253
+ msgstr "Your plan was successfully downgraded. Your %s plan license will expire in %s."
1254
+
1255
+ #: includes/i18n.php:356
1256
+ msgid "Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes."
1257
+ msgstr "Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes."
1258
+
1259
+ #: includes/i18n.php:357
1260
+ msgid "It looks like you are not in trial mode anymore so there's nothing to cancel :)"
1261
+ msgstr "It looks like you are not in trial mode anymore so there's nothing to cancel :)"
1262
+
1263
+ #: includes/i18n.php:358
1264
+ msgid "Your %s free trial was successfully cancelled."
1265
+ msgstr "Your %s free trial was successfully cancelled."
1266
+
1267
+ #: includes/i18n.php:359
1268
+ msgctxt "%s - numeric version number"
1269
+ msgid "Version %s was released."
1270
+ msgstr "Version %s was released."
1271
+
1272
+ #: includes/i18n.php:360
1273
+ msgid "Please download %s."
1274
+ msgstr "Please download %s."
1275
+
1276
+ #: includes/i18n.php:361
1277
+ msgctxt "%s - plan name, as the latest professional version here"
1278
+ msgid "the latest %s version here"
1279
+ msgstr "the latest %s version here"
1280
+
1281
+ #: includes/i18n.php:363
1282
+ msgid "How do you like %s so far? Test all our %s premium features with a %d-day free trial."
1283
+ msgstr "How do you like %s so far? Test all our %s premium features with a %d-day free trial."
1284
+
1285
+ #: includes/i18n.php:364
1286
+ msgctxt "call to action"
1287
+ msgid "Start free trial"
1288
+ msgstr "Start free trial"
1289
+
1290
+ #: includes/i18n.php:365
1291
+ msgid "Starting trial"
1292
+ msgstr "Starting trial"
1293
+
1294
+ #: includes/i18n.php:366
1295
+ msgid "Please wait"
1296
+ msgstr "Please wait"
1297
+
1298
+ #: includes/i18n.php:367
1299
+ msgid "Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes."
1300
+ msgstr "Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes."
1301
+
1302
+ #: includes/i18n.php:368
1303
+ msgid "You already utilized a trial before."
1304
+ msgstr "You already utilized a trial before."
1305
+
1306
+ #: includes/i18n.php:369
1307
+ msgid "You are already running the plugin in a trial mode."
1308
+ msgstr "You are already running the plugin in a trial mode."
1309
+
1310
+ #: includes/i18n.php:370
1311
+ msgid "Plan %s do not exist, therefore, can't start a trial."
1312
+ msgstr "Plan %s do not exist, therefore, can't start a trial."
1313
+
1314
+ #: includes/i18n.php:371
1315
+ msgid "Plan %s does not support a trial period."
1316
+ msgstr "Plan %s does not support a trial period."
1317
+
1318
+ #: includes/i18n.php:372
1319
+ msgid "None of the plugin's plans supports a trial period."
1320
+ msgstr "None of the plugin's plans supports a trial period."
1321
+
1322
+ #: includes/i18n.php:373
1323
+ msgid "Unexpected API error. Please contact the plugin's author with the following error."
1324
+ msgstr "Unexpected API error. Please contact the plugin's author with the following error."
1325
+
1326
+ #: includes/i18n.php:374
1327
+ msgid "No commitment for %s days - cancel anytime!"
1328
+ msgstr "No commitment for %s days - cancel anytime!"
1329
+
1330
+ #: includes/i18n.php:375
1331
+ 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."
1332
+ 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."
1333
+
1334
+ #: includes/i18n.php:376
1335
+ msgid "Couldn't activate %s."
1336
+ msgstr "Couldn't activate %s."
1337
+
1338
+ #: includes/i18n.php:377
1339
+ msgid "Please contact us with the following message:"
1340
+ msgstr "Please contact us with the following message:"
1341
+
1342
+ #: includes/i18n.php:378
1343
+ 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."
1344
+ 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."
1345
+
1346
+ #: includes/i18n.php:379
1347
+ msgid "Please contact us here"
1348
+ msgstr "Please contact us here"
1349
+
1350
+ #: includes/i18n.php:380
1351
+ msgid "I have upgraded my account but when I try to Sync the License, the plan remains %s."
1352
+ msgstr "I have upgraded my account but when I try to Sync the License, the plan remains %s."
1353
+
1354
+ #: includes/i18n.php:383
1355
+ msgid "From unknown reason, the API connectivity test failed."
1356
+ msgstr "From unknown reason, the API connectivity test failed."
1357
+
1358
+ #: includes/i18n.php:384
1359
+ 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?"
1360
+ 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?"
1361
+
1362
+ #: includes/i18n.php:385
1363
+ msgid "We use PHP cURL library for the API calls, which is a very common library and usually installed out of the box. Unfortunately, cURL is not installed on your server."
1364
+ msgstr "We use PHP cURL library for the API calls, which is a very common library and usually installed out of the box. Unfortunately, cURL is not installed on your server."
1365
+
1366
+ #: includes/i18n.php:386
1367
+ msgid "From unknown reason, CloudFlare, the firewall we use, blocks the connection."
1368
+ msgstr "From unknown reason, CloudFlare, the firewall we use, blocks the connection."
1369
+
1370
+ #: includes/i18n.php:387
1371
+ msgctxt "as pluginX requires an access to our API"
1372
+ msgid "%s requires an access to our API."
1373
+ msgstr "%s requires an access to our API."
1374
+
1375
+ #: includes/i18n.php:389
1376
+ msgid "It looks like your server is using Squid ACL (access control lists), which blocks the connection."
1377
+ msgstr "It looks like your server is using Squid ACL (access control lists), which blocks the connection."
1378
+
1379
+ #: includes/i18n.php:390
1380
+ msgid "I don't know what is Squid or ACL, help me!"
1381
+ msgstr "I don't know what is Squid or ACL, help me!"
1382
+
1383
+ #: includes/i18n.php:391, includes/i18n.php:395
1384
+ 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."
1385
+ 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."
1386
+
1387
+ #: includes/i18n.php:392
1388
+ msgid "I'm a system administrator"
1389
+ msgstr "I'm a system administrator"
1390
+
1391
+ #: includes/i18n.php:393
1392
+ msgid "Great, please whitelist the following domains: %s. Once you are done, deactivate the plugin and activate it again."
1393
+ msgstr "Great, please whitelist the following domains: %s. Once you are done, deactivate the plugin and activate it again."
1394
+
1395
+ #: includes/i18n.php:394
1396
+ msgid "I don't know what is cURL or how to install it, help me!"
1397
+ msgstr "I don't know what is cURL or how to install it, help me!"
1398
+
1399
+ #: includes/i18n.php:396
1400
+ msgid "Great, please install cURL and enable it in your php.ini file. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the plugin and reactivate it back again."
1401
+ msgstr "Great, please install cURL and enable it in your php.ini file. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the plugin and reactivate it back again."
1402
+
1403
+ #: includes/i18n.php:397
1404
+ 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."
1405
+ 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."
1406
+
1407
+ #: includes/i18n.php:398
1408
+ msgid "Sorry for the inconvenience and we are here to help if you give us a chance."
1409
+ msgstr "Sorry for the inconvenience and we are here to help if you give us a chance."
1410
+
1411
+ #: includes/i18n.php:399
1412
+ msgid "Yes - I'm giving you a chance to fix it"
1413
+ msgstr "Yes - I'm giving you a chance to fix it"
1414
+
1415
+ #: includes/i18n.php:400
1416
+ 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."
1417
+ 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."
1418
+
1419
+ #: includes/i18n.php:401
1420
+ msgid "Let's try your previous version"
1421
+ msgstr "Let's try your previous version"
1422
+
1423
+ #: includes/i18n.php:402
1424
+ msgid "Uninstall this version and install the previous one."
1425
+ msgstr "Uninstall this version and install the previous one."
1426
+
1427
+ #: includes/i18n.php:403
1428
+ msgid "That's exhausting, please deactivate"
1429
+ msgstr "That's exhausting, please deactivate"
1430
+
1431
+ #: includes/i18n.php:404
1432
+ msgid "We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future."
1433
+ msgstr "We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future."
1434
+
1435
+ #: includes/i18n.php:405
1436
+ 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."
1437
+ 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."
1438
+
1439
+ #: includes/i18n.php:406
1440
+ msgctxt "%1s - plugin title, %2s - API domain"
1441
+ msgid "Your server is blocking the access to Freemius' API, which is crucial for %1s synchronization. Please contact your host to whitelist %2s"
1442
+ msgstr "Your server is blocking the access to Freemius' API, which is crucial for %1s synchronization. Please contact your host to whitelist %2s"
1443
+
1444
+ #: includes/i18n.php:408
1445
+ msgid "It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again."
1446
+ msgstr "It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again."
1447
+
1448
+ #: includes/i18n.php:411
1449
+ 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."
1450
+ 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."
1451
+
1452
+ #: includes/i18n.php:412
1453
+ msgid "Thanks for confirming the ownership change. An email was just sent to %s for final approval."
1454
+ msgstr "Thanks for confirming the ownership change. An email was just sent to %s for final approval."
1455
+
1456
+ #: includes/i18n.php:413
1457
+ msgid "%s is the new owner of the account."
1458
+ msgstr "%s is the new owner of the account."
1459
+
1460
+ #: includes/i18n.php:415
1461
+ msgctxt "addonX cannot run without pluginY"
1462
+ msgid "%s cannot run without %s."
1463
+ msgstr "%s cannot run without %s."
1464
+
1465
+ #: includes/i18n.php:417
1466
+ msgctxt "addonX cannot run..."
1467
+ msgid "%s cannot run without the plugin."
1468
+ msgstr "%s cannot run without the plugin."
1469
+
1470
+ #: includes/i18n.php:418
1471
+ msgctxt "pluginX activation was successfully..."
1472
+ msgid "%s activation was successfully completed."
1473
+ msgstr "%s activation was successfully completed."
1474
+
1475
+ #: includes/i18n.php:420
1476
+ msgctxt "Plugin installer section title"
1477
+ msgid "Features & Pricing"
1478
+ msgstr "Features & Pricing"
1479
+
1480
+ #: includes/i18n.php:421
1481
+ msgid "Add-on must be deployed to WordPress.org or Freemius."
1482
+ msgstr "Add-on must be deployed to WordPress.org or Freemius."
1483
+
1484
+ #: includes/i18n.php:422
1485
+ msgid "Paid add-on must be deployed to Freemius."
1486
+ msgstr "Paid add-on must be deployed to Freemius."
1487
+
1488
+ #: includes/i18n.php:426
1489
+ msgid "%s is a premium only add-on. You have to purchase a license first before activating the plugin."
1490
+ msgstr "%s is a premium only add-on. You have to purchase a license first before activating the plugin."
1491
+
1492
+ #: includes/i18n.php:427
1493
+ 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."
1494
+ 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."
1495
+
1496
+ #: includes/i18n.php:432
1497
+ msgctxt "as every month"
1498
+ msgid "Monthly"
1499
+ msgstr "Monthly"
1500
+
1501
+ #: includes/i18n.php:433
1502
+ msgctxt "as monthly period"
1503
+ msgid "mo"
1504
+ msgstr "mo"
1505
+
1506
+ #: includes/i18n.php:434
1507
+ msgctxt "as once a year"
1508
+ msgid "Annual"
1509
+ msgstr "Annual"
1510
+
1511
+ #: includes/i18n.php:435
1512
+ msgctxt "as once a year"
1513
+ msgid "Annually"
1514
+ msgstr "Annually"
1515
+
1516
+ #: includes/i18n.php:436
1517
+ msgctxt "as once a year"
1518
+ msgid "Once"
1519
+ msgstr "Once"
1520
+
1521
+ #: includes/i18n.php:437
1522
+ msgctxt "as annual period"
1523
+ msgid "year"
1524
+ msgstr "year"
1525
+
1526
+ #: includes/i18n.php:438
1527
+ msgid "Lifetime"
1528
+ msgstr "Lifetime"
1529
+
1530
+ #: includes/i18n.php:439
1531
+ msgctxt "e.g. the best product"
1532
+ msgid "Best"
1533
+ msgstr "Best"
1534
+
1535
+ #: includes/i18n.php:440
1536
+ msgctxt "e.g. billed monthly"
1537
+ msgid "Billed %s"
1538
+ msgstr "Billed %s"
1539
+
1540
+ #: includes/i18n.php:441
1541
+ msgctxt "as a discount of $5 or 10%"
1542
+ msgid "Save %s"
1543
+ msgstr "Save %s"
1544
+
1545
+ #: includes/i18n.php:443
1546
+ msgid "View details"
1547
+ msgstr "View details"
1548
+
1549
+ #: includes/i18n.php:447
1550
+ msgctxt "button label"
1551
+ msgid "Approve & Start Trial"
1552
+ msgstr "Approve & Start Trial"
1553
+
1554
+ #: includes/i18n.php:449
1555
+ msgid "You are 1-click away from starting your %1$s-day free trial of the %2$s plan."
1556
+ msgstr "You are 1-click away from starting your %1$s-day free trial of the %2$s plan."
1557
+
1558
+ #: includes/i18n.php:451
1559
+ 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."
1560
+ 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."
1561
+
1562
+ #: includes/i18n.php:457
1563
+ msgid "Business name"
1564
+ msgstr "Business name"
1565
+
1566
+ #: includes/i18n.php:458
1567
+ msgid "Tax / VAT ID"
1568
+ msgstr "Tax / VAT ID"
1569
+
1570
+ #: includes/i18n.php:459
1571
+ msgid "Address Line %d"
1572
+ msgstr "Address Line %d"
1573
+
1574
+ #: includes/i18n.php:460
1575
+ msgid "Country"
1576
+ msgstr "Country"
1577
+
1578
+ #: includes/i18n.php:461
1579
+ msgid "Select Country"
1580
+ msgstr "Select Country"
1581
+
1582
+ #: includes/i18n.php:462
1583
+ msgid "City"
1584
+ msgstr "City"
1585
+
1586
+ #: includes/i18n.php:463
1587
+ msgid "Town"
1588
+ msgstr "Town"
1589
+
1590
+ #: includes/i18n.php:464
1591
+ msgid "State"
1592
+ msgstr "State"
1593
+
1594
+ #: includes/i18n.php:465
1595
+ msgid "Province"
1596
+ msgstr "Province"
1597
+
1598
+ #: includes/i18n.php:466
1599
+ msgid "ZIP / Postal Code"
1600
+ msgstr "ZIP / Postal Code"
1601
+
1602
+ #: includes/i18n.php:481
1603
+ msgctxt "Plugin installer section title"
1604
+ msgid "Description"
1605
+ msgstr "Description"
1606
+
1607
+ #: includes/i18n.php:482
1608
+ msgctxt "Plugin installer section title"
1609
+ msgid "Installation"
1610
+ msgstr "Installation"
1611
+
1612
+ #: includes/i18n.php:483
1613
+ msgctxt "Plugin installer section title"
1614
+ msgid "FAQ"
1615
+ msgstr "FAQ"
1616
+
1617
+ #: includes/i18n.php:484
1618
+ msgctxt "Plugin installer section title"
1619
+ msgid "Changelog"
1620
+ msgstr "Changelog"
1621
+
1622
+ #: includes/i18n.php:485
1623
+ msgctxt "Plugin installer section title"
1624
+ msgid "Reviews"
1625
+ msgstr "Reviews"
1626
+
1627
+ #: includes/i18n.php:486
1628
+ msgctxt "Plugin installer section title"
1629
+ msgid "Other Notes"
1630
+ msgstr "Other Notes"
1631
+
1632
+ #: includes/i18n.php:488
1633
+ msgid "%s star"
1634
+ msgstr "%s star"
1635
+
1636
+ #: includes/i18n.php:490
1637
+ msgid "%s stars"
1638
+ msgstr "%s stars"
1639
+
1640
+ #: includes/i18n.php:492
1641
+ msgid "%s rating"
1642
+ msgstr "%s rating"
1643
+
1644
+ #: includes/i18n.php:494
1645
+ msgid "%s ratings"
1646
+ msgstr "%s ratings"
1647
+
1648
+ #: includes/i18n.php:496
1649
+ msgid "%s time"
1650
+ msgstr "%s time"
1651
+
1652
+ #: includes/i18n.php:498
1653
+ msgid "%s times"
1654
+ msgstr "%s times"
1655
+
1656
+ #: includes/i18n.php:500
1657
+ msgid "Click to see reviews that provided a rating of %s"
1658
+ msgstr "Click to see reviews that provided a rating of %s"
1659
+
1660
+ #: includes/i18n.php:501
1661
+ msgid "Last Updated"
1662
+ msgstr "Last Updated"
1663
+
1664
+ #: includes/i18n.php:502
1665
+ msgid "Requires WordPress Version:"
1666
+ msgstr "Requires WordPress Version:"
1667
+
1668
+ #: includes/i18n.php:503
1669
+ msgctxt "as the plugin author"
1670
+ msgid "Author:"
1671
+ msgstr "Author:"
1672
+
1673
+ #: includes/i18n.php:504
1674
+ msgid "Compatible up to:"
1675
+ msgstr "Compatible up to:"
1676
+
1677
+ #: includes/i18n.php:505
1678
+ msgid "Downloaded:"
1679
+ msgstr "Downloaded:"
1680
+
1681
+ #: includes/i18n.php:506
1682
+ msgid "WordPress.org Plugin Page"
1683
+ msgstr "WordPress.org Plugin Page"
1684
+
1685
+ #: includes/i18n.php:507
1686
+ msgid "Plugin Homepage"
1687
+ msgstr "Plugin Homepage"
1688
+
1689
+ #: includes/i18n.php:508
1690
+ msgid "Donate to this plugin"
1691
+ msgstr "Donate to this plugin"
1692
+
1693
+ #: includes/i18n.php:509
1694
+ msgid "Average Rating"
1695
+ msgstr "Average Rating"
1696
+
1697
+ #: includes/i18n.php:510
1698
+ msgid "based on %s"
1699
+ msgstr "based on %s"
1700
+
1701
+ #: includes/i18n.php:511
1702
+ msgid "Warning:"
1703
+ msgstr "Warning:"
1704
+
1705
+ #: includes/i18n.php:512
1706
+ msgid "Contributors"
1707
+ msgstr "Contributors"
1708
+
1709
+ #: includes/i18n.php:513
1710
+ msgid "Plugin Install"
1711
+ msgstr "Plugin Install"
1712
+
1713
+ #: includes/i18n.php:514
1714
+ msgid "This plugin has not been tested with your current version of WordPress."
1715
+ msgstr "This plugin has not been tested with your current version of WordPress."
1716
+
1717
+ #: includes/i18n.php:515
1718
+ msgid "This plugin has not been marked as compatible with your version of WordPress."
1719
+ msgstr "This plugin has not been marked as compatible with your version of WordPress."
1720
+
1721
+ #: includes/i18n.php:516
1722
+ msgid "Newer Version (%s) Installed"
1723
+ msgstr "Newer Version (%s) Installed"
1724
+
1725
+ #: includes/i18n.php:517
1726
+ msgid "Latest Version Installed"
1727
+ msgstr "Latest Version Installed"
freemius/languages/freemius-he.mo ADDED
Binary file
freemius/languages/freemius-he.po ADDED
@@ -0,0 +1,1661 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2016 freemius
2
+ # This file is distributed under the same license as the freemius package.
3
+ # Translators:
4
+ # Vova Feldman <vova@freemius.com>, 2016
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
+ "PO-Revision-Date: 2016-12-07 01:29+0000\n"
10
+ "Last-Translator: Vova Feldman <vova@freemius.com>\n"
11
+ "Language-Team: Hebrew (http://www.transifex.com/freemius/wordpress-sdk/language/he/)\n"
12
+ "MIME-Version: 1.0\n"
13
+ "Content-Type: text/plain; charset=UTF-8\n"
14
+ "Content-Transfer-Encoding: 8bit\n"
15
+ "Language: he\n"
16
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
+ "X-Poedit-Basepath: ..\n"
18
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
19
+ "X-Poedit-SearchPath-0: .\n"
20
+ "X-Poedit-SearchPathExcluded-0: *.js\n"
21
+ "X-Poedit-SourceCharset: UTF-8\n"
22
+
23
+ #: includes/i18n.php41, includes/i18n.php:55
24
+ msgid "Yes - I'm in!"
25
+ msgstr ""
26
+
27
+ #: includes/i18n.php43, includes/i18n.php:57
28
+ msgid "Not today"
29
+ msgstr "לא היום"
30
+
31
+ #: includes/i18n.php:69
32
+ msgid "Account"
33
+ msgstr "חשבון"
34
+
35
+ #: includes/i18n.php:71
36
+ msgid "Add On"
37
+ msgstr "תוסף"
38
+
39
+ #: includes/i18n.php:73
40
+ msgid "Contact Us"
41
+ msgstr "יצירת קשר"
42
+
43
+ #: includes/i18n.php:75
44
+ msgid "Contact Support"
45
+ msgstr "צור קשר"
46
+
47
+ #: includes/i18n.php:77
48
+ msgid "Change Ownership"
49
+ msgstr "עדכון בעלות"
50
+
51
+ #: includes/i18n.php:79
52
+ msgid "Support"
53
+ msgstr "תמיכה"
54
+
55
+ #: includes/i18n.php:81
56
+ msgid "Support Forum"
57
+ msgstr "פורום תמיכה"
58
+
59
+ #: includes/i18n.php:83
60
+ msgid "Add Ons"
61
+ msgstr "תוספים"
62
+
63
+ #: includes/i18n.php:85
64
+ msgctxt "verb"
65
+ msgid "Upgrade"
66
+ msgstr "שדרג"
67
+
68
+ #: includes/i18n.php:87
69
+ msgid "Awesome"
70
+ msgstr "אדיר"
71
+
72
+ #: includes/i18n.php:89
73
+ msgctxt "noun"
74
+ msgid "Pricing"
75
+ msgstr "מחירון"
76
+
77
+ #: includes/i18n.php:91
78
+ msgctxt "noun"
79
+ msgid "Price"
80
+ msgstr "מחיר"
81
+
82
+ #: includes/i18n.php:93
83
+ msgid "Unlimited Updates"
84
+ msgstr "עדכונים ללא הגבלה"
85
+
86
+ #: includes/i18n.php:95
87
+ msgctxt "verb"
88
+ msgid "Downgrade"
89
+ msgstr "שנמך"
90
+
91
+ #: includes/i18n.php:97
92
+ msgid "Cancel Trial"
93
+ msgstr "ביט"
94
+
95
+ #: includes/i18n.php:99
96
+ msgid "Free Trial"
97
+ msgstr "ניסיון חינם"
98
+
99
+ #: includes/i18n.php:101
100
+ msgid "Start my free %s"
101
+ msgstr "התחל את %s הניסיון שלי"
102
+
103
+ #: includes/i18n.php:103
104
+ msgid "No commitment for %s - cancel anytime"
105
+ msgstr ""
106
+
107
+ #: includes/i18n.php:105
108
+ msgid "After your free %s, pay as little as %s"
109
+ msgstr ""
110
+
111
+ #: includes/i18n.php:107
112
+ msgid "Details"
113
+ msgstr "פרטים"
114
+
115
+ #: includes/i18n.php:109
116
+ msgid "Account Details"
117
+ msgstr "פרטי חשבון"
118
+
119
+ #: includes/i18n.php:111
120
+ msgctxt "verb"
121
+ msgid "Delete"
122
+ msgstr "מחק"
123
+
124
+ #: includes/i18n.php:113
125
+ msgctxt "verb"
126
+ msgid "Show"
127
+ msgstr "הצג"
128
+
129
+ #: includes/i18n.php:115
130
+ msgctxt "verb"
131
+ msgid "Hide"
132
+ msgstr "הסתר"
133
+
134
+ #: includes/i18n.php:117
135
+ msgctxt "verb"
136
+ msgid "Edit"
137
+ msgstr "ערוך"
138
+
139
+ #: includes/i18n.php:119
140
+ msgctxt "verb"
141
+ msgid "Update"
142
+ msgstr ""
143
+
144
+ #: includes/i18n.php:121
145
+ msgid "Date"
146
+ msgstr "תאריך"
147
+
148
+ #: includes/i18n.php:123
149
+ msgid "Amount"
150
+ msgstr "סכום"
151
+
152
+ #: includes/i18n.php:125
153
+ msgid "Invoice"
154
+ msgstr "חשבונית"
155
+
156
+ #: includes/i18n.php:127
157
+ msgid "Billing"
158
+ msgstr "בילינג"
159
+
160
+ #: includes/i18n.php:129
161
+ msgid "Payments"
162
+ msgstr "תשלומים"
163
+
164
+ #: includes/i18n.php:131
165
+ msgid "Delete Account"
166
+ msgstr "מחיקת חשבון"
167
+
168
+ #: includes/i18n.php:133
169
+ msgctxt "as close a window"
170
+ msgid "Dismiss"
171
+ msgstr "סגירה"
172
+
173
+ #: includes/i18n.php:135
174
+ msgctxt "as product pricing plan"
175
+ msgid "Plan"
176
+ msgstr "חבילה"
177
+
178
+ #: includes/i18n.php:137
179
+ msgid "Change Plan"
180
+ msgstr "שינוי חבילה"
181
+
182
+ #: includes/i18n.php:139
183
+ msgctxt "as download professional version"
184
+ msgid "Download %s Version"
185
+ msgstr ""
186
+
187
+ #: includes/i18n.php:141
188
+ msgctxt "as download professional version now"
189
+ msgid "Download %s version now"
190
+ msgstr ""
191
+
192
+ #: includes/i18n.php:145
193
+ msgctxt "as download latest version"
194
+ msgid "Download Latest"
195
+ msgstr "הורד גרסה אחרונה"
196
+
197
+ #: includes/i18n.php:147
198
+ msgctxt "E.g. you have a professional license."
199
+ msgid "You have a %s license."
200
+ msgstr ""
201
+
202
+ #: includes/i18n.php:151
203
+ msgid "New"
204
+ msgstr "חדש"
205
+
206
+ #: includes/i18n.php:153
207
+ msgid "Free"
208
+ msgstr "חינם"
209
+
210
+ #: includes/i18n.php:155
211
+ msgctxt "as trial plan"
212
+ msgid "Trial"
213
+ msgstr "ניסיון"
214
+
215
+ #: includes/i18n.php:157
216
+ msgctxt "as starting a trial plan"
217
+ msgid "Start Trial"
218
+ msgstr ""
219
+
220
+ #: includes/i18n.php:159
221
+ msgctxt "verb"
222
+ msgid "Purchase"
223
+ msgstr "רכישה"
224
+
225
+ #: includes/i18n.php:161
226
+ msgid "Purchase License"
227
+ msgstr "קניית רישיון"
228
+
229
+ #: includes/i18n.php:163
230
+ msgctxt "verb"
231
+ msgid "Buy"
232
+ msgstr "קנייה"
233
+
234
+ #: includes/i18n.php:165
235
+ msgid "Buy License"
236
+ msgstr "קניית רישיון"
237
+
238
+ #: includes/i18n.php:167
239
+ msgid "Single Site License"
240
+ msgstr "רשיון לאתר אחד"
241
+
242
+ #: includes/i18n.php:169
243
+ msgid "Unlimited Licenses"
244
+ msgstr "רשיונות ללא הגבלה"
245
+
246
+ #: includes/i18n.php:171
247
+ msgid "Up to %s Sites"
248
+ msgstr "עד %s אתרים"
249
+
250
+ #: includes/i18n.php:173
251
+ msgid "%sRenew your license now%s to access version %s features and support."
252
+ msgstr ""
253
+
254
+ #: includes/i18n.php:177
255
+ msgid ""
256
+ "Enter the email address you've used for the upgrade below and we will resend"
257
+ " you the license key."
258
+ msgstr ""
259
+
260
+ #: includes/i18n.php:181
261
+ msgctxt "e.g. Professional Plan"
262
+ msgid "%s Plan"
263
+ msgstr ""
264
+
265
+ #: includes/i18n.php:183
266
+ msgid "You are just one step away - %s"
267
+ msgstr ""
268
+
269
+ #: includes/i18n.php:185
270
+ msgctxt "%s - plugin name. As complete \"Jetpack\" activation now"
271
+ msgid "Complete \"%s\" Activation Now"
272
+ msgstr ""
273
+
274
+ #: includes/i18n.php:189
275
+ msgid "We made a few tweaks to the plugin, %s"
276
+ msgstr "ביצענו מספר שינויים לתוסף, %s"
277
+
278
+ #: includes/i18n.php:191
279
+ msgid "Opt-in to make \"%s\" Better!"
280
+ msgstr ""
281
+
282
+ #: includes/i18n.php:193
283
+ msgid "Error"
284
+ msgstr "שגיאה"
285
+
286
+ #: includes/i18n.php:195
287
+ msgid ""
288
+ "Freemius SDK couldn't find the plugin's main file. Please contact "
289
+ "sdk@freemius.com with the current error."
290
+ msgstr ""
291
+
292
+ #: includes/i18n.php:203
293
+ msgctxt "as expiration date"
294
+ msgid "Expiration"
295
+ msgstr "תפוגה"
296
+
297
+ #: includes/i18n.php:205
298
+ msgctxt "as software license"
299
+ msgid "License"
300
+ msgstr "רישיון"
301
+
302
+ #: includes/i18n.php:207
303
+ msgid "not verified"
304
+ msgstr "לא מאומת"
305
+
306
+ #: includes/i18n.php:209
307
+ msgid "Verify Email"
308
+ msgstr "אמת כתובת דוא\"ל"
309
+
310
+ #: includes/i18n.php:211
311
+ msgctxt "e.g. expires in 2 months"
312
+ msgid "Expires in %s"
313
+ msgstr ""
314
+
315
+ #: includes/i18n.php:213
316
+ msgctxt "e.g. auto renews in 2 months"
317
+ msgid "Auto renews in %s"
318
+ msgstr ""
319
+
320
+ #: includes/i18n.php:215
321
+ msgid "No expiration"
322
+ msgstr "ללא תפוגה"
323
+
324
+ #: includes/i18n.php:217
325
+ msgid "Expired"
326
+ msgstr "פג תוקף"
327
+
328
+ #: includes/i18n.php:219
329
+ msgid "Cancelled"
330
+ msgstr "בוטל"
331
+
332
+ #: includes/i18n.php:221
333
+ msgctxt "e.g. In 2 hours"
334
+ msgid "In %s"
335
+ msgstr "בעוד %s"
336
+
337
+ #: includes/i18n.php:223
338
+ msgctxt "e.g. 2 min ago"
339
+ msgid "%s ago"
340
+ msgstr ""
341
+
342
+ #: includes/i18n.php:225
343
+ msgctxt "as plugin version"
344
+ msgid "Version"
345
+ msgstr "גרסה"
346
+
347
+ #: includes/i18n.php:227
348
+ msgid "Name"
349
+ msgstr "שם"
350
+
351
+ #: includes/i18n.php:229
352
+ msgid "Email"
353
+ msgstr "דוא\"ל"
354
+
355
+ #: includes/i18n.php:231
356
+ msgid "Email address"
357
+ msgstr "כתובת דוא\"ל"
358
+
359
+ #: includes/i18n.php:233
360
+ msgid "Verified"
361
+ msgstr "מאומת"
362
+
363
+ #: includes/i18n.php:235
364
+ msgid "Plugin"
365
+ msgstr "תוסף"
366
+
367
+ #: includes/i18n.php:237
368
+ msgid "Plugins"
369
+ msgstr "תוספים"
370
+
371
+ #: includes/i18n.php:239
372
+ msgid "Themes"
373
+ msgstr "תבניות"
374
+
375
+ #: includes/i18n.php:241
376
+ msgctxt "as file/folder path"
377
+ msgid "Path"
378
+ msgstr ""
379
+
380
+ #: includes/i18n.php:243
381
+ msgid "Title"
382
+ msgstr "כותרת"
383
+
384
+ #: includes/i18n.php:245
385
+ msgid "Free version"
386
+ msgstr "גירסה חינאמית"
387
+
388
+ #: includes/i18n.php:247
389
+ msgid "Premium version"
390
+ msgstr "גירסת פרימיום"
391
+
392
+ #: includes/i18n.php:249
393
+ msgctxt "as WP plugin slug"
394
+ msgid "Slug"
395
+ msgstr ""
396
+
397
+ #: includes/i18n.php:251
398
+ msgid "ID"
399
+ msgstr "מזהה"
400
+
401
+ #: includes/i18n.php:253
402
+ msgid "Users"
403
+ msgstr "משתמשים"
404
+
405
+ #: includes/i18n.php:255
406
+ msgid "Plugin Installs"
407
+ msgstr "התקנות תוסף"
408
+
409
+ #: includes/i18n.php:257
410
+ msgctxt "like websites"
411
+ msgid "Sites"
412
+ msgstr "אתרים"
413
+
414
+ #: includes/i18n.php:259
415
+ msgid "User ID"
416
+ msgstr "מזהה משתמש"
417
+
418
+ #: includes/i18n.php:261
419
+ msgid "Site ID"
420
+ msgstr "מזהה אתר"
421
+
422
+ #: includes/i18n.php:263
423
+ msgid "Public Key"
424
+ msgstr "מפתח פומבי"
425
+
426
+ #: includes/i18n.php:265
427
+ msgid "Secret Key"
428
+ msgstr "מפתח סודי"
429
+
430
+ #: includes/i18n.php:267
431
+ msgctxt "as secret encryption key missing"
432
+ msgid "No Secret"
433
+ msgstr "אין מפתח סודי"
434
+
435
+ #: includes/i18n.php:269
436
+ msgid "No ID"
437
+ msgstr "אין מזהה"
438
+
439
+ #: includes/i18n.php:271
440
+ msgctxt "as synchronize license"
441
+ msgid "Sync License"
442
+ msgstr "סינכרן רישיון"
443
+
444
+ #: includes/i18n.php:273
445
+ msgctxt "as synchronize"
446
+ msgid "Sync"
447
+ msgstr "סינכרון"
448
+
449
+ #: includes/i18n.php:275
450
+ msgid "Activate License"
451
+ msgstr "הפעלת רישיון"
452
+
453
+ #: includes/i18n.php:277
454
+ msgid "Activate Free Version"
455
+ msgstr "הפעלת גירסה חינאמית"
456
+
457
+ #: includes/i18n.php:279
458
+ msgid ""
459
+ "Please enter the license key that you received in the email right after the "
460
+ "purchase:"
461
+ msgstr ""
462
+
463
+ #: includes/i18n.php:283
464
+ msgid "Activating license..."
465
+ msgstr "מפעיל רישיון..."
466
+
467
+ #: includes/i18n.php:285
468
+ msgid "Change License"
469
+ msgstr "שינוי רישיון"
470
+
471
+ #: includes/i18n.php:287
472
+ msgid "Update License"
473
+ msgstr "עדכון רישיון"
474
+
475
+ #: includes/i18n.php:289
476
+ msgid "Deactivate License"
477
+ msgstr "שיחרור רישיון"
478
+
479
+ #: includes/i18n.php:291
480
+ msgid "Activate"
481
+ msgstr "הפעלה"
482
+
483
+ #: includes/i18n.php:293
484
+ msgid "Deactivate"
485
+ msgstr "כיבוי"
486
+
487
+ #: includes/i18n.php:295
488
+ msgid "Skip & Deactivate"
489
+ msgstr "דלג והמשך כיבוי"
490
+
491
+ #: includes/i18n.php:297
492
+ msgid "No - just deactivate"
493
+ msgstr "לא - פשוט כבה"
494
+
495
+ #: includes/i18n.php:299
496
+ msgid "Yes - do your thing"
497
+ msgstr "כן - בצעו את מה שצריך"
498
+
499
+ #: includes/i18n.php:301
500
+ msgctxt "active mode"
501
+ msgid "Active"
502
+ msgstr "מופעל"
503
+
504
+ #: includes/i18n.php:303
505
+ msgctxt "is active mode?"
506
+ msgid "Is Active"
507
+ msgstr "האם פעיל"
508
+
509
+ #: includes/i18n.php:305
510
+ msgid "Install Now"
511
+ msgstr "התקן עכשיו"
512
+
513
+ #: includes/i18n.php:307
514
+ msgid "Install Update Now"
515
+ msgstr "התקן עדכון במיידי"
516
+
517
+ #: includes/i18n.php:309
518
+ msgid "More information about %s"
519
+ msgstr ""
520
+
521
+ #: includes/i18n.php:311
522
+ msgid "Localhost"
523
+ msgstr "שרת לוקאלי"
524
+
525
+ #: includes/i18n.php:313
526
+ msgctxt "as activate Professional plan"
527
+ msgid "Activate %s Plan"
528
+ msgstr ""
529
+
530
+ #: includes/i18n.php:315
531
+ msgctxt "as 5 licenses left"
532
+ msgid "%s left"
533
+ msgstr "נשארו %s"
534
+
535
+ #: includes/i18n.php:317
536
+ msgid "Last license"
537
+ msgstr "רישיון אחרון"
538
+
539
+ #: includes/i18n.php:319
540
+ msgid "What is your %s?"
541
+ msgstr ""
542
+
543
+ #: includes/i18n.php:321
544
+ msgid "Activate this add-on"
545
+ msgstr "הפעל את התוסף"
546
+
547
+ #: includes/i18n.php:323
548
+ msgid ""
549
+ "Deactivating your license will block all premium features, but will enable "
550
+ "you to activate the license on another site. Are you sure you want to "
551
+ "proceed?"
552
+ msgstr ""
553
+
554
+ #: includes/i18n.php:327
555
+ msgid ""
556
+ "Deleting the account will automatically deactivate your %s plan license so "
557
+ "you can use it on other sites. If you want to terminate the recurring "
558
+ "payments as well, click the \"Cancel\" button, and first \"Downgrade\" your "
559
+ "account. Are you sure you would like to continue with the deletion?"
560
+ msgstr ""
561
+
562
+ #: includes/i18n.php:331
563
+ msgid ""
564
+ "Deletion is not temporary. Only delete if you no longer want to use this "
565
+ "plugin anymore. Are you sure you would like to continue with the deletion?"
566
+ msgstr ""
567
+
568
+ #: includes/i18n.php:335
569
+ msgid ""
570
+ "Downgrading your plan will immediately stop all future recurring payments "
571
+ "and your %s plan license will expire in %s."
572
+ msgstr ""
573
+
574
+ #: includes/i18n.php:339
575
+ msgid ""
576
+ "Cancelling the trial will immediately block access to all premium features. "
577
+ "Are you sure?"
578
+ msgstr ""
579
+
580
+ #: includes/i18n.php:343
581
+ msgid ""
582
+ "You can still enjoy all %s features but you will not have access to plugin "
583
+ "updates and support."
584
+ msgstr ""
585
+
586
+ #: includes/i18n.php:347
587
+ msgid ""
588
+ "Once your license expire you can still use the Free version but you will NOT"
589
+ " have access to the %s features."
590
+ msgstr ""
591
+
592
+ #: includes/i18n.php:351
593
+ msgid "Are you sure you want to proceed?"
594
+ msgstr "האם את/ה בטוח רוצה להמשיך?"
595
+
596
+ #: includes/i18n.php:357
597
+ msgid "Add Ons for %s"
598
+ msgstr ""
599
+
600
+ #: includes/i18n.php:359
601
+ msgid ""
602
+ "We could'nt load the add-ons list. It's probably an issue on our side, "
603
+ "please try to come back in few minutes."
604
+ msgstr ""
605
+
606
+ #: includes/i18n.php:365
607
+ msgid "Anonymous feedback"
608
+ msgstr "פידבק אנונימי"
609
+
610
+ #: includes/i18n.php:367
611
+ msgid "Quick feedback"
612
+ msgstr "פידבק זריז"
613
+
614
+ #: includes/i18n.php:369
615
+ msgid "If you have a moment, please let us know why you are deactivating"
616
+ msgstr ""
617
+
618
+ #: includes/i18n.php:373
619
+ msgid "Yes - Deactivate"
620
+ msgstr "כן - "
621
+
622
+ #: includes/i18n.php:375
623
+ msgid "Submit & Deactivate"
624
+ msgstr "שלח וכבה"
625
+
626
+ #: includes/i18n.php:377
627
+ msgid "Cancel"
628
+ msgstr "בטל"
629
+
630
+ #: includes/i18n.php:379
631
+ msgid "I no longer need the plugin"
632
+ msgstr "אין לי צורך יותר בתוסף"
633
+
634
+ #: includes/i18n.php:381
635
+ msgid "I found a better plugin"
636
+ msgstr "מצאתי תוסף טוב יותר"
637
+
638
+ #: includes/i18n.php:383
639
+ msgid "I only needed the plugin for a short period"
640
+ msgstr "השתמשתי בתוסף לתקופה קצרה"
641
+
642
+ #: includes/i18n.php:385
643
+ msgid "The plugin broke my site"
644
+ msgstr "התוסף הרס לי את האתר"
645
+
646
+ #: includes/i18n.php:387
647
+ msgid "The plugin suddenly stopped working"
648
+ msgstr "התוסף לפתע הפסיק לעבוד"
649
+
650
+ #: includes/i18n.php:389
651
+ msgid "I can't pay for it anymore"
652
+ msgstr "אני לא יכול/ה להמשיך לשלם על זה"
653
+
654
+ #: includes/i18n.php:391
655
+ msgid "It's a temporary deactivation. I'm just debugging an issue."
656
+ msgstr "כיבוי זמני לשם דיבאג."
657
+
658
+ #: includes/i18n.php:395
659
+ msgctxt ""
660
+ "the text of the \"other\" reason for deactivating the plugin that is shown "
661
+ "in the modal box."
662
+ msgid "Other"
663
+ msgstr "אחר"
664
+
665
+ #: includes/i18n.php:399
666
+ msgid "Kindly tell us the reason so we can improve."
667
+ msgstr "אנא שתף את הסיבה כדי שנוכל להשתפר."
668
+
669
+ #: includes/i18n.php:401
670
+ msgid "What's the plugin's name?"
671
+ msgstr "מהו שם התוסף?"
672
+
673
+ #: includes/i18n.php:403
674
+ msgid "What price would you feel comfortable paying?"
675
+ msgstr "מה המחיר שכן תרגיש\\י בנוח לשלם?"
676
+
677
+ #: includes/i18n.php:405
678
+ msgid "I couldn't understand how to make it work"
679
+ msgstr "לא הצלחתי להבין איך לגרום לזה לעבוד"
680
+
681
+ #: includes/i18n.php:407
682
+ msgid ""
683
+ "The plugin is great, but I need specific feature that you don't support"
684
+ msgstr "התוסף מעולה, אבל אני צריכ\\ה פיצ'ר ספציפי שלא נתמך"
685
+
686
+ #: includes/i18n.php:411
687
+ msgid "The plugin is not working"
688
+ msgstr "התוסף לא עובד"
689
+
690
+ #: includes/i18n.php:413
691
+ msgid "It's not what I was looking for"
692
+ msgstr "חיפשתי משהו אחר"
693
+
694
+ #: includes/i18n.php:415
695
+ msgid "The plugin didn't work as expected"
696
+ msgstr "התוסף לא עבד כמצופה"
697
+
698
+ #: includes/i18n.php:417
699
+ msgid "What feature?"
700
+ msgstr "איזה פיטצ'ר?"
701
+
702
+ #: includes/i18n.php:419
703
+ msgid "Kindly share what didn't work so we can fix it for future users..."
704
+ msgstr "אנא שתפ\\י מה לא עבד כדי שנוכל לתקן זאת עבור משתמשים עתידיים..."
705
+
706
+ #: includes/i18n.php:423
707
+ msgid "What you've been looking for?"
708
+ msgstr "מה חיפשת?"
709
+
710
+ #: includes/i18n.php:425
711
+ msgid "What did you expect?"
712
+ msgstr "למה ציפית?"
713
+
714
+ #: includes/i18n.php:427
715
+ msgid "The plugin didn't work"
716
+ msgstr "התוסף לא עבד"
717
+
718
+ #: includes/i18n.php:429
719
+ msgid "I don't like to share my information with you"
720
+ msgstr "אני לא אוהב את הרעיון של שיתוף מידע איתכם"
721
+
722
+ #: includes/i18n.php:431
723
+ msgid ""
724
+ "You might have missed it, but you don't have to share any data and can just "
725
+ "%s the opt-in."
726
+ msgstr "אולי פספסת את זה אבל אינך חייב\\ת לשתף כל מידע איתנו, ביכולתך %s על שיתוף המידע."
727
+
728
+ #: includes/i18n.php:441
729
+ msgctxt "greeting"
730
+ msgid "Hey %s,"
731
+ msgstr "היי %s,"
732
+
733
+ #: includes/i18n.php:443
734
+ msgctxt "a greeting. E.g. Thanks John!"
735
+ msgid "Thanks %s!"
736
+ msgstr "תודה %s!"
737
+
738
+ #: includes/i18n.php:445
739
+ msgid ""
740
+ "Never miss an important update - opt-in to our security and feature updates "
741
+ "notifications, and non-sensitive diagnostic tracking with %4$s."
742
+ msgstr ""
743
+
744
+ #: includes/i18n.php:449
745
+ msgid ""
746
+ "Please help us improve %1$s! If you opt-in, some data about your usage of "
747
+ "%1$s will be sent to %4$s. If you skip this, that's okay! %1$s will still "
748
+ "work just fine."
749
+ msgstr ""
750
+
751
+ #: includes/i18n.php:453
752
+ msgid ""
753
+ "You should receive an activation email for %s to your mailbox at %s. Please "
754
+ "make sure you click the activation button in that email to %s."
755
+ msgstr ""
756
+
757
+ #: includes/i18n.php:455
758
+ msgid "complete the install"
759
+ msgstr ""
760
+
761
+ #: includes/i18n.php:457
762
+ msgid "start the trial"
763
+ msgstr ""
764
+
765
+ #: includes/i18n.php:459
766
+ msgid ""
767
+ "Thanks for purchasing %s! To get started, please enter your license key:"
768
+ msgstr ""
769
+
770
+ #: includes/i18n.php:463
771
+ msgid ""
772
+ "The plugin will be periodically sending data to %s to check for plugin "
773
+ "updates and verify the validity of your license."
774
+ msgstr ""
775
+
776
+ #: includes/i18n.php:467
777
+ msgid "What permissions are being granted?"
778
+ msgstr "מהן ההרשאות המוענקות?"
779
+
780
+ #: includes/i18n.php:469
781
+ msgid "Your Profile Overview"
782
+ msgstr "פרטים כלליים על הפרופיל"
783
+
784
+ #: includes/i18n.php:471
785
+ msgid "Name and email address"
786
+ msgstr "שם וכתובת דו\"אל"
787
+
788
+ #: includes/i18n.php:473
789
+ msgid "Your Site Overview"
790
+ msgstr "פרטים כלליים על האתר"
791
+
792
+ #: includes/i18n.php:475
793
+ msgid "Site URL, WP version, PHP info, plugins & themes"
794
+ msgstr "כתובת אתר, גרסת וורדפרס, פרטי PHP, תוספים ותבניות"
795
+
796
+ #: includes/i18n.php:479
797
+ msgid "Current Plugin Events"
798
+ msgstr "שינויי מצב בתוסף הנוכחי"
799
+
800
+ #: includes/i18n.php:481
801
+ msgid "Activation, deactivation and uninstall"
802
+ msgstr "הפעלה, כיבוי והסרה"
803
+
804
+ #: includes/i18n.php:483
805
+ msgid "Plugins & Themes"
806
+ msgstr "תוספים ותבניות"
807
+
808
+ #: includes/i18n.php:485
809
+ msgid "Titles, versions and state."
810
+ msgstr "שמות, גרסאות וסטאטוס."
811
+
812
+ #: includes/i18n.php:487
813
+ msgid "Admin Notices"
814
+ msgstr ""
815
+
816
+ #: includes/i18n.php:489
817
+ msgid "Newsletter"
818
+ msgstr "ניוסלטר"
819
+
820
+ #: includes/i18n.php:491
821
+ msgid "Updates, announcements, marketing, no spam"
822
+ msgstr ""
823
+
824
+ #: includes/i18n.php:493
825
+ msgid "Privacy Policy"
826
+ msgstr "מדיניות פרטיות"
827
+
828
+ #: includes/i18n.php:495
829
+ msgid "Terms of Service"
830
+ msgstr "תנאי השירות"
831
+
832
+ #: includes/i18n.php:497
833
+ msgctxt "as activating plugin"
834
+ msgid "Activating"
835
+ msgstr "מפעיל"
836
+
837
+ #: includes/i18n.php:499
838
+ msgctxt "as in the process of sending an email"
839
+ msgid "Sending email"
840
+ msgstr "שולח דוא\"ל"
841
+
842
+ #: includes/i18n.php:503
843
+ msgctxt "button label"
844
+ msgid "Allow & Continue"
845
+ msgstr "אפשר\\י והמשכ\\י"
846
+
847
+ #: includes/i18n.php:505
848
+ msgctxt "button label"
849
+ msgid "Agree & Activate License"
850
+ msgstr "הסכמה והפעלת רישיון"
851
+
852
+ #: includes/i18n.php:507
853
+ msgctxt "verb"
854
+ msgid "Skip"
855
+ msgstr "דלג"
856
+
857
+ #: includes/i18n.php:509
858
+ msgid "Click here to use the plugin anonymously"
859
+ msgstr ""
860
+
861
+ #: includes/i18n.php:511
862
+ msgid "Re-send activation email"
863
+ msgstr "שליחה חוזרת של מייל האקטיבציה"
864
+
865
+ #: includes/i18n.php:513
866
+ msgid "License key"
867
+ msgstr "מפתח רישיון"
868
+
869
+ #: includes/i18n.php:515
870
+ msgid "Send License Key"
871
+ msgstr "שליחת מפתח רישיון"
872
+
873
+ #: includes/i18n.php:517
874
+ msgid "Sending license key"
875
+ msgstr "שולח מפתח רישיון"
876
+
877
+ #: includes/i18n.php:519
878
+ msgid "Have a license key?"
879
+ msgstr "האם ברשותך רישיון?"
880
+
881
+ #: includes/i18n.php:521
882
+ msgid "Don't have a license key?"
883
+ msgstr "האם אין ברשותך מפתח רישיון?"
884
+
885
+ #: includes/i18n.php:523
886
+ msgid "Can't find your license key?"
887
+ msgstr "האם אינך מוצא את מפתח הרישיון?"
888
+
889
+ #: includes/i18n.php:525
890
+ msgid ""
891
+ "We couldn't find your email address in the system, are you sure it's the "
892
+ "right address?"
893
+ msgstr ""
894
+
895
+ #: includes/i18n.php:529
896
+ msgid ""
897
+ "We can't see any active licenses associated with that email address, are you"
898
+ " sure it's the right address?"
899
+ msgstr ""
900
+
901
+ #: includes/i18n.php:533
902
+ msgid "Opt In"
903
+ msgstr ""
904
+
905
+ #: includes/i18n.php:535
906
+ msgid "Opt Out"
907
+ msgstr ""
908
+
909
+ #: includes/i18n.php:537
910
+ msgid "On second thought - I want to continue helping"
911
+ msgstr ""
912
+
913
+ #: includes/i18n.php:541
914
+ msgid "Opting out..."
915
+ msgstr ""
916
+
917
+ #: includes/i18n.php:543
918
+ msgid "Opting in..."
919
+ msgstr ""
920
+
921
+ #: includes/i18n.php:545
922
+ msgid ""
923
+ "We appreciate your help in making the %s better by letting us track some "
924
+ "usage data."
925
+ msgstr ""
926
+
927
+ #: includes/i18n.php:549
928
+ msgid ""
929
+ "Usage tracking is done in the name of making %s better. Making a better user"
930
+ " experience, prioritizing new features, and more good things. We'd really "
931
+ "appreciate if you'll reconsider letting us continue with the tracking."
932
+ msgstr ""
933
+
934
+ #: includes/i18n.php:553
935
+ msgid ""
936
+ "By clicking \"Opt Out\", we will no longer be sending any data from %s to "
937
+ "%s."
938
+ msgstr ""
939
+
940
+ #: includes/i18n.php:563
941
+ msgid "Screenshots"
942
+ msgstr "צילומי מסך"
943
+
944
+ #: includes/i18n.php:565
945
+ msgid "Click to view full-size screenshot %d"
946
+ msgstr ""
947
+
948
+ #: includes/i18n.php:573
949
+ msgid "Freemius Debug"
950
+ msgstr ""
951
+
952
+ #: includes/i18n.php:575
953
+ msgctxt "as turned on"
954
+ msgid "On"
955
+ msgstr "דלוק"
956
+
957
+ #: includes/i18n.php:577
958
+ msgctxt "as turned off"
959
+ msgid "Off"
960
+ msgstr "כבוי"
961
+
962
+ #: includes/i18n.php:579
963
+ msgctxt "as code debugging"
964
+ msgid "Debugging"
965
+ msgstr "דיבוג"
966
+
967
+ #: includes/i18n.php:581
968
+ msgid "Freemius State"
969
+ msgstr ""
970
+
971
+ #: includes/i18n.php:583
972
+ msgctxt "as connection was successful"
973
+ msgid "Connected"
974
+ msgstr "מחובר"
975
+
976
+ #: includes/i18n.php:585
977
+ msgctxt "as connection blocked"
978
+ msgid "Blocked"
979
+ msgstr "חסום"
980
+
981
+ #: includes/i18n.php:587
982
+ msgctxt "as application program interface"
983
+ msgid "API"
984
+ msgstr "API"
985
+
986
+ #: includes/i18n.php:589
987
+ msgctxt "as software development kit versions"
988
+ msgid "SDK"
989
+ msgstr "SDK"
990
+
991
+ #: includes/i18n.php:591
992
+ msgctxt "as software development kit versions"
993
+ msgid "SDK Versions"
994
+ msgstr "גרסאות SDK"
995
+
996
+ #: includes/i18n.php:595
997
+ msgctxt "as plugin folder path"
998
+ msgid "Plugin Path"
999
+ msgstr ""
1000
+
1001
+ #: includes/i18n.php:597
1002
+ msgctxt "as sdk path"
1003
+ msgid "SDK Path"
1004
+ msgstr "מיקום SDK"
1005
+
1006
+ #: includes/i18n.php:599
1007
+ msgid "Add Ons of Plugin %s"
1008
+ msgstr ""
1009
+
1010
+ #: includes/i18n.php:601
1011
+ msgid "Are you sure you want to delete all Freemius data?"
1012
+ msgstr ""
1013
+
1014
+ #: includes/i18n.php:605
1015
+ msgid "Actions"
1016
+ msgstr "פעולות"
1017
+
1018
+ #: includes/i18n.php:607
1019
+ msgid "Delete All Accounts"
1020
+ msgstr "מחיקת כל החשבונות"
1021
+
1022
+ #: includes/i18n.php:609
1023
+ msgid "Start Fresh"
1024
+ msgstr "התחל מחדש"
1025
+
1026
+ #: includes/i18n.php:611
1027
+ msgid "Clear API Cache"
1028
+ msgstr "ניקוי מטמון ה-API"
1029
+
1030
+ #: includes/i18n.php:613
1031
+ msgid "Sync Data From Server"
1032
+ msgstr "סנכרון מידע מהשרת"
1033
+
1034
+ #: includes/i18n.php:615
1035
+ msgid "Scheduled Crons"
1036
+ msgstr ""
1037
+
1038
+ #: includes/i18n.php:617
1039
+ msgid "Plugins & Themes Sync"
1040
+ msgstr ""
1041
+
1042
+ #: includes/i18n.php:625
1043
+ msgctxt "as congratulations"
1044
+ msgid "Congrats"
1045
+ msgstr "מזל טוב"
1046
+
1047
+ #: includes/i18n.php:627
1048
+ msgctxt "exclamation"
1049
+ msgid "Oops"
1050
+ msgstr "אופס"
1051
+
1052
+ #: includes/i18n.php:629
1053
+ msgctxt "interjection expressing joy or exuberance"
1054
+ msgid "Yee-haw"
1055
+ msgstr ""
1056
+
1057
+ #: includes/i18n.php:633
1058
+ msgctxt ""
1059
+ "(especially in electronic communication) used to express elation, "
1060
+ "enthusiasm, or triumph."
1061
+ msgid "W00t"
1062
+ msgstr ""
1063
+
1064
+ #: includes/i18n.php:637
1065
+ msgctxt "a positive response"
1066
+ msgid "Right on"
1067
+ msgstr ""
1068
+
1069
+ #: includes/i18n.php:639
1070
+ msgctxt ""
1071
+ "something somebody says when they are thinking about what you have just "
1072
+ "said. "
1073
+ msgid "Hmm"
1074
+ msgstr "הממ"
1075
+
1076
+ #: includes/i18n.php:643
1077
+ msgid "O.K"
1078
+ msgstr "אוקיי"
1079
+
1080
+ #: includes/i18n.php:645
1081
+ msgctxt "exclamation"
1082
+ msgid "Hey"
1083
+ msgstr "היי"
1084
+
1085
+ #: includes/i18n.php:647
1086
+ msgctxt "advance notice of something that will need attention."
1087
+ msgid "Heads up"
1088
+ msgstr "לתשמות לבך"
1089
+
1090
+ #: includes/i18n.php:657
1091
+ msgid "Seems like you got the latest release."
1092
+ msgstr ""
1093
+
1094
+ #: includes/i18n.php:659
1095
+ msgid "You are all good!"
1096
+ msgstr "את\\ה מסודר!"
1097
+
1098
+ #: includes/i18n.php:661
1099
+ msgid ""
1100
+ "Sorry, we could not complete the email update. Another user with the same "
1101
+ "email is already registered."
1102
+ msgstr ""
1103
+
1104
+ #: includes/i18n.php:665
1105
+ msgid ""
1106
+ "If you would like to give up the ownership of the plugin's account to %s "
1107
+ "click the Change Ownership button."
1108
+ msgstr ""
1109
+
1110
+ #: includes/i18n.php:669
1111
+ msgid ""
1112
+ "Your email was successfully updated. You should receive an email with "
1113
+ "confirmation instructions in few moments."
1114
+ msgstr ""
1115
+
1116
+ #: includes/i18n.php:673
1117
+ msgid "Your name was successfully updated."
1118
+ msgstr "שמך עודכן בהצלחה."
1119
+
1120
+ #: includes/i18n.php:675
1121
+ msgid "You have successfully updated your %s."
1122
+ msgstr ""
1123
+
1124
+ #: includes/i18n.php:677
1125
+ msgid "Please provide your full name."
1126
+ msgstr "נא למלא את שמך המלא."
1127
+
1128
+ #: includes/i18n.php:679
1129
+ msgid ""
1130
+ "Verification mail was just sent to %s. If you can't find it after 5 min, "
1131
+ "please check your spam box."
1132
+ msgstr ""
1133
+
1134
+ #: includes/i18n.php:683
1135
+ msgid ""
1136
+ "Just letting you know that the add-ons information of %s is being pulled "
1137
+ "from an external server."
1138
+ msgstr ""
1139
+
1140
+ #: includes/i18n.php:687
1141
+ msgid "No credit card required"
1142
+ msgstr "לא נדרש כרטיס אשראי"
1143
+
1144
+ #: includes/i18n.php:689
1145
+ msgid "Premium plugin version was successfully activated."
1146
+ msgstr ""
1147
+
1148
+ #: includes/i18n.php:693
1149
+ msgid "The upgrade of %s was successfully completed."
1150
+ msgstr ""
1151
+
1152
+ #: includes/i18n.php:695
1153
+ msgid "Your account was successfully activated with the %s plan."
1154
+ msgstr "חשבונך הופעל בהצלחה עם חבילת ה-%s."
1155
+
1156
+ #: includes/i18n.php:699
1157
+ msgid "Download the latest %s version now"
1158
+ msgstr "הורדת גרסת ה-%s העדכנית - עכשיו"
1159
+
1160
+ #: includes/i18n.php:701
1161
+ msgid "Please follow these steps to complete the upgrade"
1162
+ msgstr "נא לבצע את הצעדים הבאים להשלמת השידרוג"
1163
+
1164
+ #: includes/i18n.php:705
1165
+ msgid "Download the latest %s version"
1166
+ msgstr "הורד\\י את גרסת ה-%s העדכנית"
1167
+
1168
+ #: includes/i18n.php:707
1169
+ msgid "Deactivate the free version"
1170
+ msgstr "כבה\\י את הגרסה החינאמית"
1171
+
1172
+ #: includes/i18n.php:709
1173
+ msgid "Upload and activate the downloaded version"
1174
+ msgstr "העלה\\י והפעיל\\י את הגרסה שהורדת"
1175
+
1176
+ #: includes/i18n.php:711
1177
+ msgid "How to upload and activate?"
1178
+ msgstr "איך להעלות ולהפעיל?"
1179
+
1180
+ #: includes/i18n.php:713
1181
+ msgctxt "%s - product name, e.g. Facebook add-on was successfully..."
1182
+ msgid "%s Add-on was successfully purchased."
1183
+ msgstr ""
1184
+
1185
+ #: includes/i18n.php:717
1186
+ msgid "Your %s Add-on plan was successfully upgraded."
1187
+ msgstr ""
1188
+
1189
+ #: includes/i18n.php:721
1190
+ msgid "Your email has been successfully verified - you are AWESOME!"
1191
+ msgstr ""
1192
+
1193
+ #: includes/i18n.php:725
1194
+ msgid "Your plan was successfully upgraded."
1195
+ msgstr "החבילה הופעלה בהצלחה."
1196
+
1197
+ #: includes/i18n.php:727
1198
+ msgid "Your plan was successfully changed to %s."
1199
+ msgstr ""
1200
+
1201
+ #: includes/i18n.php:729
1202
+ msgid ""
1203
+ "Your license has expired. You can still continue using the free plugin "
1204
+ "forever."
1205
+ msgstr "פג תוקפו של הרישיון. עדיין ניתן להמשיך להשתמש בגרסה החינאמית של התוסף ללא מגבלת זמן."
1206
+
1207
+ #: includes/i18n.php:733
1208
+ msgid ""
1209
+ "Your license has been cancelled. If you think it's a mistake, please contact"
1210
+ " support."
1211
+ msgstr "רשיונך בוטל. אם לדעתך זו טעות, נא ליצור קשר עם התמיכה."
1212
+
1213
+ #: includes/i18n.php:737
1214
+ msgid "Your trial has been successfully started."
1215
+ msgstr "הניסיון שלך הופעל בהצלחה."
1216
+
1217
+ #: includes/i18n.php:739
1218
+ msgid "Your license was successfully activated."
1219
+ msgstr "הרישיון הופעל בהצלחה."
1220
+
1221
+ #: includes/i18n.php:741
1222
+ msgid "It looks like your site currently doesn't have an active license."
1223
+ msgstr "נראה לאתר עדיין אין רישיון פעיל."
1224
+
1225
+ #: includes/i18n.php:745
1226
+ msgid ""
1227
+ "Your license was successfully deactivated, you are back to the %s plan."
1228
+ msgstr "רישיונך נותק בהצלחה, חזרת לחבילת ה-%s"
1229
+
1230
+ #: includes/i18n.php:749
1231
+ msgid "It looks like the license deactivation failed."
1232
+ msgstr "נראה שניתוק הרישיון נכשל."
1233
+
1234
+ #: includes/i18n.php:753
1235
+ msgid "It looks like the license could not be activated."
1236
+ msgstr "נראה שלא ניתן להפעיל את הרישיון."
1237
+
1238
+ #: includes/i18n.php:757
1239
+ msgid "Error received from the server:"
1240
+ msgstr "הוחזרה שגיאה מהשרת:"
1241
+
1242
+ #: includes/i18n.php:759
1243
+ msgid ""
1244
+ "Your trial has expired. You can still continue using all our free features."
1245
+ msgstr "תקופת הניסיון נגמרה. ביכולתך להמשיך להשתמש בכל הפיטצ'רים החינאמיים."
1246
+
1247
+ #: includes/i18n.php:763
1248
+ msgid ""
1249
+ "Your plan was successfully downgraded. Your %s plan license will expire in "
1250
+ "%s."
1251
+ msgstr ""
1252
+
1253
+ #: includes/i18n.php:767
1254
+ msgid ""
1255
+ "Seems like we are having some temporary issue with your plan downgrade. "
1256
+ "Please try again in few minutes."
1257
+ msgstr ""
1258
+
1259
+ #: includes/i18n.php:771
1260
+ msgid ""
1261
+ "It looks like you are not in trial mode anymore so there's nothing to cancel"
1262
+ " :)"
1263
+ msgstr ""
1264
+
1265
+ #: includes/i18n.php:775
1266
+ msgid "Your %s free trial was successfully cancelled."
1267
+ msgstr ""
1268
+
1269
+ #: includes/i18n.php:779
1270
+ msgctxt "%s - numeric version number"
1271
+ msgid "Version %s was released."
1272
+ msgstr "גרסה %s הושקה."
1273
+
1274
+ #: includes/i18n.php:783
1275
+ msgid "Please download %s."
1276
+ msgstr ""
1277
+
1278
+ #: includes/i18n.php:785
1279
+ msgctxt "%s - plan name, as the latest professional version here"
1280
+ msgid "the latest %s version here"
1281
+ msgstr "גרסת ה-%s האחרונה כאן"
1282
+
1283
+ #: includes/i18n.php:789
1284
+ msgid ""
1285
+ "How do you like %s so far? Test all our %s premium features with a %d-day "
1286
+ "free trial."
1287
+ msgstr ""
1288
+
1289
+ #: includes/i18n.php:793
1290
+ msgctxt "call to action"
1291
+ msgid "Start free trial"
1292
+ msgstr "התחלת ניסיון חינם"
1293
+
1294
+ #: includes/i18n.php:795
1295
+ msgid "Starting trial"
1296
+ msgstr ""
1297
+
1298
+ #: includes/i18n.php:797
1299
+ msgid "Please wait"
1300
+ msgstr ""
1301
+
1302
+ #: includes/i18n.php:799
1303
+ msgid ""
1304
+ "Seems like we are having some temporary issue with your trial cancellation. "
1305
+ "Please try again in few minutes."
1306
+ msgstr ""
1307
+
1308
+ #: includes/i18n.php:803
1309
+ msgid "You already utilized a trial before."
1310
+ msgstr "הניסיון כבר נוצל בעבר."
1311
+
1312
+ #: includes/i18n.php:805
1313
+ msgid "You are already running the plugin in a trial mode."
1314
+ msgstr "התוסף כבר עכשיו בתקופת ניסיון."
1315
+
1316
+ #: includes/i18n.php:809
1317
+ msgid "Plan %s do not exist, therefore, can't start a trial."
1318
+ msgstr ""
1319
+
1320
+ #: includes/i18n.php:813
1321
+ msgid "Plan %s does not support a trial period."
1322
+ msgstr ""
1323
+
1324
+ #: includes/i18n.php:815
1325
+ msgid "None of the plugin's plans supports a trial period."
1326
+ msgstr "אף אחת מחבילות התוסף מאפשרת תקופת ניסיון."
1327
+
1328
+ #: includes/i18n.php:819
1329
+ msgid ""
1330
+ "Unexpected API error. Please contact the plugin's author with the following "
1331
+ "error."
1332
+ msgstr "שגיאת API בלתי צפוייה. נא לפנות למפתח התוסף עם השגיאה הבאה."
1333
+
1334
+ #: includes/i18n.php:823
1335
+ msgid "No commitment for %s days - cancel anytime!"
1336
+ msgstr ""
1337
+
1338
+ #: includes/i18n.php:825
1339
+ msgid ""
1340
+ "Your license has expired. You can still continue using all the %s features, "
1341
+ "but you'll need to renew your license to continue getting updates and "
1342
+ "support."
1343
+ msgstr ""
1344
+
1345
+ #: includes/i18n.php:829
1346
+ msgid "Couldn't activate %s."
1347
+ msgstr ""
1348
+
1349
+ #: includes/i18n.php:831
1350
+ msgid "Please contact us with the following message:"
1351
+ msgstr "אנא צור איתנו קשר יחד עם ההודעה הבאה:"
1352
+
1353
+ #: includes/i18n.php:833
1354
+ msgid ""
1355
+ "It looks like you are still on the %s plan. If you did upgrade or change "
1356
+ "your plan, it's probably an issue on our side - sorry."
1357
+ msgstr ""
1358
+
1359
+ #: includes/i18n.php:837
1360
+ msgid "Please contact us here"
1361
+ msgstr "אנא צור איתנו קשר כאן"
1362
+
1363
+ #: includes/i18n.php:839
1364
+ msgid ""
1365
+ "I have upgraded my account but when I try to Sync the License, the plan "
1366
+ "remains %s."
1367
+ msgstr "שידרגתי את החשבון שלי אבל כשאני מנסה לבצע סנכרון לרישיון החבילה נשארת %s"
1368
+
1369
+ #: includes/i18n.php:847
1370
+ msgid "From unknown reason, the API connectivity test failed."
1371
+ msgstr "יש בעיית תקשורת ל-API מסיבה בלתי ברורה."
1372
+
1373
+ #: includes/i18n.php:851
1374
+ msgid ""
1375
+ "It's probably a temporary issue on our end. Just to be sure, with your "
1376
+ "permission, would it be o.k to run another connectivity test?"
1377
+ msgstr "ככל הנראה זאת בעיה זמנית בצד שלנו. ברשותך, ורק כדי להיות בטוחים שזאת הבעיה, האם זה יהיה בסדר לבצע בדיקת תקשורת נוספת?"
1378
+
1379
+ #: includes/i18n.php:855
1380
+ msgid ""
1381
+ "We use PHP cURL library for the API calls, which is a very common library "
1382
+ "and usually installed out of the box. Unfortunately, cURL is not installed "
1383
+ "on your server."
1384
+ msgstr ""
1385
+
1386
+ #: includes/i18n.php:859
1387
+ msgid ""
1388
+ "From unknown reason, CloudFlare, the firewall we use, blocks the connection."
1389
+ msgstr "מסיבה בלתי ברורה, CloudFlare, חומת האש שאנחנו משתמשים בה, חוסמת את התקשורת."
1390
+
1391
+ #: includes/i18n.php:863
1392
+ msgctxt "as pluginX requires an access to our API"
1393
+ msgid "%s requires an access to our API."
1394
+ msgstr "%s מחייב גישה ל-API שלנו."
1395
+
1396
+ #: includes/i18n.php:867
1397
+ msgid ""
1398
+ "It looks like your server is using Squid ACL (access control lists), which "
1399
+ "blocks the connection."
1400
+ msgstr ""
1401
+
1402
+ #: includes/i18n.php:871
1403
+ msgid "I don't know what is Squid or ACL, help me!"
1404
+ msgstr "אין לי מושג מה זה Squid או ACL - אשמח לעזרה!"
1405
+
1406
+ #: includes/i18n.php873, includes/i18n.php:887
1407
+ msgid ""
1408
+ "We'll make sure to contact your hosting company and resolve the issue. You "
1409
+ "will get a follow-up email to %s once we have an update."
1410
+ msgstr ""
1411
+
1412
+ #: includes/i18n.php:877
1413
+ msgid "I'm a system administrator"
1414
+ msgstr ""
1415
+
1416
+ #: includes/i18n.php:879
1417
+ msgid ""
1418
+ "Great, please whitelist the following domains: %s. Once you done, deactivate"
1419
+ " the plugin and activate it again."
1420
+ msgstr ""
1421
+
1422
+ #: includes/i18n.php:883
1423
+ msgid "I don't know what is cURL or how to install it, help me!"
1424
+ msgstr "אין לי מושג מה זה cURL או איך להתקין אותו - אשמח לעזרה!"
1425
+
1426
+ #: includes/i18n.php:891
1427
+ msgid ""
1428
+ "Great, please install cURL and enable it in your php.ini file. To make sure "
1429
+ "it was successfully activated, use 'phpinfo()'. Once activated, deactivate "
1430
+ "the plugin and reactivate it back again."
1431
+ msgstr ""
1432
+
1433
+ #: includes/i18n.php:895
1434
+ msgid ""
1435
+ "We are sure it's an issue on our side and more than happy to resolve it for "
1436
+ "you ASAP if you give us a chance."
1437
+ msgstr "זו בטח בעיה בצד שלנו ואנחנו נשמח לעזור כדי לפתור את העניין בהקדם האפשר, רק במידה ותאפשר\\י זאת."
1438
+
1439
+ #: includes/i18n.php:899
1440
+ msgid ""
1441
+ "Sorry for the inconvenience and we are here to help if you give us a chance."
1442
+ msgstr "מצטערים על חוסר הנעימות, אנחנו כאן כדי לעזור אם תאפשר\\י זאת."
1443
+
1444
+ #: includes/i18n.php:903
1445
+ msgid "Yes - I'm giving you a chance to fix it"
1446
+ msgstr "כן - אני נותן לך צ'אנס לתקן את זה"
1447
+
1448
+ #: includes/i18n.php:905
1449
+ msgid ""
1450
+ "We will do our best to whitelist your server and resolve this issue ASAP. "
1451
+ "You will get a follow-up email to %s once we have an update."
1452
+ msgstr ""
1453
+
1454
+ #: includes/i18n.php:909
1455
+ msgid "Let's try your previous version"
1456
+ msgstr "בוא ננסה את הגירסה הקודמת"
1457
+
1458
+ #: includes/i18n.php:911
1459
+ msgid "Uninstall this version and install the previous one."
1460
+ msgstr "הסר את הגרסה הנוכחית והתקן את הגרסה קודמת."
1461
+
1462
+ #: includes/i18n.php:915
1463
+ msgid "That's exhausting, please deactivate"
1464
+ msgstr "זה מתיש, אנא לכבות"
1465
+
1466
+ #: includes/i18n.php:917
1467
+ msgid ""
1468
+ "We feel your frustration and sincerely apologize for the inconvenience. Hope"
1469
+ " to see you again in the future."
1470
+ msgstr ""
1471
+
1472
+ #: includes/i18n.php:921
1473
+ msgid ""
1474
+ "Thank for giving us the chance to fix it! A message was just sent to our "
1475
+ "technical staff. We will get back to you as soon as we have an update to %s."
1476
+ " Appreciate your patience."
1477
+ msgstr ""
1478
+
1479
+ #: includes/i18n.php:925
1480
+ msgctxt "%1s - plugin title, %2s - API domain"
1481
+ msgid ""
1482
+ "Your server is blocking the access to Freemius' API, which is crucial for "
1483
+ "%1s synchronization. Please contact your host to whitelist %2s"
1484
+ msgstr ""
1485
+
1486
+ #: includes/i18n.php:929
1487
+ msgid ""
1488
+ "It seems like one of the authentication parameters is wrong. Update your "
1489
+ "Public Key, Secret Key & User ID, and try again."
1490
+ msgstr ""
1491
+
1492
+ #: includes/i18n.php:937
1493
+ msgid ""
1494
+ "Please check your mailbox, you should receive an email via %s to confirm the"
1495
+ " ownership change. From security reasons, you must confirm the change within"
1496
+ " the next 15 min. If you cannot find the email, please check your spam "
1497
+ "folder."
1498
+ msgstr ""
1499
+
1500
+ #: includes/i18n.php:941
1501
+ msgid ""
1502
+ "Thanks for confirming the ownership change. An email was just sent to %s for"
1503
+ " final approval."
1504
+ msgstr "תודה על אישור ביצוע החלפת הבעלות. הרגע נשלח מייל ל-%s כדי לקבל אישור סופי."
1505
+
1506
+ #: includes/i18n.php:945
1507
+ msgid "%s is the new owner of the account."
1508
+ msgstr "%s הינו הבעלים החד של חשבון זה."
1509
+
1510
+ #: includes/i18n.php:949
1511
+ msgctxt "addonX cannot run without pluginY"
1512
+ msgid "%s cannot run without %s."
1513
+ msgstr "%s לא יכול לעבוד ללא %s."
1514
+
1515
+ #: includes/i18n.php:953
1516
+ msgctxt "addonX cannot run..."
1517
+ msgid "%s cannot run without the plugin."
1518
+ msgstr ""
1519
+
1520
+ #: includes/i18n.php:957
1521
+ msgctxt "pluginX activation was successfully..."
1522
+ msgid "%s activation was successfully completed."
1523
+ msgstr ""
1524
+
1525
+ #: includes/i18n.php:961
1526
+ msgctxt "Plugin installer section title"
1527
+ msgid "Features & Pricing"
1528
+ msgstr "פיטצ'רים ומחירים"
1529
+
1530
+ #: includes/i18n.php:965
1531
+ msgid "Add-on must be deployed to WordPress.org or Freemius."
1532
+ msgstr ""
1533
+
1534
+ #: includes/i18n.php:969
1535
+ msgid "Paid add-on must be deployed to Freemius."
1536
+ msgstr ""
1537
+
1538
+ #: includes/i18n.php:977
1539
+ msgid ""
1540
+ "%s is a premium only add-on. You have to purchase a license first before "
1541
+ "activating the plugin."
1542
+ msgstr ""
1543
+
1544
+ #: includes/i18n.php:981
1545
+ msgid ""
1546
+ "%s free trial was successfully cancelled. Since the add-on is premium only "
1547
+ "it was automatically deactivated. If you like to use it in the future, "
1548
+ "you'll have to purchase a license."
1549
+ msgstr ""
1550
+
1551
+ #: includes/i18n.php:993
1552
+ msgctxt "as every month"
1553
+ msgid "Monthly"
1554
+ msgstr "חודשי"
1555
+
1556
+ #: includes/i18n.php:995
1557
+ msgctxt "as monthly period"
1558
+ msgid "mo"
1559
+ msgstr ""
1560
+
1561
+ #: includes/i18n.php:997
1562
+ msgctxt "as once a year"
1563
+ msgid "Annual"
1564
+ msgstr "שנתי"
1565
+
1566
+ #: includes/i18n.php:999
1567
+ msgctxt "as once a year"
1568
+ msgid "Annually"
1569
+ msgstr "שנתי"
1570
+
1571
+ #: includes/i18n.php:1001
1572
+ msgctxt "as once a year"
1573
+ msgid "Once"
1574
+ msgstr "פעם אחת"
1575
+
1576
+ #: includes/i18n.php:1003
1577
+ msgctxt "as annual period"
1578
+ msgid "year"
1579
+ msgstr "שנה"
1580
+
1581
+ #: includes/i18n.php:1005
1582
+ msgid "Lifetime"
1583
+ msgstr "לכל החיים"
1584
+
1585
+ #: includes/i18n.php:1007
1586
+ msgctxt "e.g. the best product"
1587
+ msgid "Best"
1588
+ msgstr "הכי טוב"
1589
+
1590
+ #: includes/i18n.php:1009
1591
+ msgctxt "e.g. billed monthly"
1592
+ msgid "Billed %s"
1593
+ msgstr "מחוייב על בסיס %s"
1594
+
1595
+ #: includes/i18n.php:1011
1596
+ msgctxt "as a discount of $5 or 10%"
1597
+ msgid "Save %s"
1598
+ msgstr "שמירת %s"
1599
+
1600
+ #: includes/i18n.php:1015
1601
+ msgid "View details"
1602
+ msgstr "פרטים נוספים"
1603
+
1604
+ #: includes/i18n.php:1023
1605
+ msgctxt "button label"
1606
+ msgid "Approve & Start Trial"
1607
+ msgstr ""
1608
+
1609
+ #: includes/i18n.php:1027
1610
+ msgid ""
1611
+ "You are 1-click away from starting your %1$s-day free trial of the %2$s "
1612
+ "plan."
1613
+ msgstr ""
1614
+
1615
+ #: includes/i18n.php:1031
1616
+ msgid ""
1617
+ "For compliance with the WordPress.org guidelines, before we start the trial "
1618
+ "we ask that you opt-in with your user and non-sensitive site information, "
1619
+ "allowing the plugin to periodically send data to %s to check for version "
1620
+ "updates and to validate your trial."
1621
+ msgstr ""
1622
+
1623
+ #: includes/i18n.php:1043
1624
+ msgid "Business name"
1625
+ msgstr ""
1626
+
1627
+ #: includes/i18n.php:1045
1628
+ msgid "Tax / VAT ID"
1629
+ msgstr ""
1630
+
1631
+ #: includes/i18n.php:1047
1632
+ msgid "Address Line %d"
1633
+ msgstr ""
1634
+
1635
+ #: includes/i18n.php:1049
1636
+ msgid "Country"
1637
+ msgstr ""
1638
+
1639
+ #: includes/i18n.php:1051
1640
+ msgid "Select Country"
1641
+ msgstr ""
1642
+
1643
+ #: includes/i18n.php:1053
1644
+ msgid "City"
1645
+ msgstr ""
1646
+
1647
+ #: includes/i18n.php:1055
1648
+ msgid "Town"
1649
+ msgstr ""
1650
+
1651
+ #: includes/i18n.php:1057
1652
+ msgid "State"
1653
+ msgstr ""
1654
+
1655
+ #: includes/i18n.php:1059
1656
+ msgid "Province"
1657
+ msgstr ""
1658
+
1659
+ #: includes/i18n.php:1061
1660
+ msgid "ZIP / Postal Code"
1661
+ msgstr ""
freemius/languages/freemius-it_IT.mo ADDED
Binary file
freemius/languages/freemius-it_IT.po ADDED
@@ -0,0 +1,1871 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-03-09 20:58+0000\n"
14
+ "Last-Translator: Pelly Benassi <plasmax@gmail.com>\n"
15
+ "Language-Team: Italian (Italy) (http://www.transifex.com/freemius/wordpress-sdk/language/it_IT/)\n"
16
+ "MIME-Version: 1.0\n"
17
+ "Content-Type: text/plain; charset=UTF-8\n"
18
+ "Content-Transfer-Encoding: 8bit\n"
19
+ "Language: it_IT\n"
20
+ "Plural-Forms: nplurals=2; plural=(n != 1);\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:35
28
+ msgid "Account"
29
+ msgstr "Account"
30
+
31
+ #: includes/i18n.php:36
32
+ msgid "Add On"
33
+ msgstr "Add-on"
34
+
35
+ #: includes/i18n.php:37
36
+ msgid "Contact Us"
37
+ msgstr "Contattaci"
38
+
39
+ #: includes/i18n.php:38
40
+ msgid "Contact Support"
41
+ msgstr "Contatta il supporto"
42
+
43
+ #: includes/i18n.php:39
44
+ msgid "Change Ownership"
45
+ msgstr "Cambia Proprietario"
46
+
47
+ #: includes/i18n.php:40
48
+ msgid "Support"
49
+ msgstr "Supporto"
50
+
51
+ #: includes/i18n.php:41
52
+ msgid "Support Forum"
53
+ msgstr "Forum di supporto"
54
+
55
+ #: includes/i18n.php:42
56
+ msgid "Add Ons"
57
+ msgstr "Add-on"
58
+
59
+ #: includes/i18n.php:43
60
+ msgctxt "verb"
61
+ msgid "Upgrade"
62
+ msgstr "Aggiornamento"
63
+
64
+ #: includes/i18n.php:44
65
+ msgid "Awesome"
66
+ msgstr "Fantastico"
67
+
68
+ #: includes/i18n.php:45
69
+ msgctxt "noun"
70
+ msgid "Pricing"
71
+ msgstr "Prezzi"
72
+
73
+ #: includes/i18n.php:46
74
+ msgctxt "noun"
75
+ msgid "Price"
76
+ msgstr "Prezzo"
77
+
78
+ #: includes/i18n.php:47
79
+ msgid "Unlimited Updates"
80
+ msgstr "Aggiornamenti Illimitati"
81
+
82
+ #: includes/i18n.php:48
83
+ msgctxt "verb"
84
+ msgid "Downgrade"
85
+ msgstr "Downgrade"
86
+
87
+ #: includes/i18n.php:49
88
+ msgid "Cancel Trial"
89
+ msgstr "Annulla prova gratuita"
90
+
91
+ #: includes/i18n.php:50
92
+ msgid "Free Trial"
93
+ msgstr "Prova gratuita"
94
+
95
+ #: includes/i18n.php:51
96
+ msgid "Start my free %s"
97
+ msgstr "Inizia la mia %s"
98
+
99
+ #: includes/i18n.php:52
100
+ msgid "No commitment for %s - cancel anytime"
101
+ msgstr "Nessun impegno con %s - cancella quando vuoi"
102
+
103
+ #: includes/i18n.php:53
104
+ msgid "After your free %s, pay as little as %s"
105
+ msgstr "Dopo il tuo %s gratuito, paghi solamente %s"
106
+
107
+ #: includes/i18n.php:54
108
+ msgid "Details"
109
+ msgstr "Dettagli"
110
+
111
+ #: includes/i18n.php:55
112
+ msgid "Account Details"
113
+ msgstr "Dettagli dell'account"
114
+
115
+ #: includes/i18n.php:56
116
+ msgctxt "verb"
117
+ msgid "Delete"
118
+ msgstr "Elimina"
119
+
120
+ #: includes/i18n.php:57
121
+ msgctxt "verb"
122
+ msgid "Show"
123
+ msgstr "Mostra"
124
+
125
+ #: includes/i18n.php:58
126
+ msgctxt "verb"
127
+ msgid "Hide"
128
+ msgstr "Nascondi"
129
+
130
+ #: includes/i18n.php:59
131
+ msgctxt "verb"
132
+ msgid "Edit"
133
+ msgstr "Modifica"
134
+
135
+ #: includes/i18n.php:60
136
+ msgctxt "verb"
137
+ msgid "Update"
138
+ msgstr "Aggiorna"
139
+
140
+ #: includes/i18n.php:61
141
+ msgid "Date"
142
+ msgstr "Data"
143
+
144
+ #: includes/i18n.php:62
145
+ msgid "Amount"
146
+ msgstr "Importo"
147
+
148
+ #: includes/i18n.php:63
149
+ msgid "Invoice"
150
+ msgstr "Fattura"
151
+
152
+ #: includes/i18n.php:64
153
+ msgid "Billing"
154
+ msgstr "Fatturazione"
155
+
156
+ #: includes/i18n.php:65
157
+ msgid "Payments"
158
+ msgstr "Pagamenti"
159
+
160
+ #: includes/i18n.php:66
161
+ msgid "Delete Account"
162
+ msgstr "Elimina Account"
163
+
164
+ #: includes/i18n.php:67
165
+ msgctxt "as close a window"
166
+ msgid "Dismiss"
167
+ msgstr "Chiudi"
168
+
169
+ #: includes/i18n.php:68
170
+ msgctxt "as product pricing plan"
171
+ msgid "Plan"
172
+ msgstr "Piano"
173
+
174
+ #: includes/i18n.php:69
175
+ msgid "Change Plan"
176
+ msgstr "Cambia piano"
177
+
178
+ #: includes/i18n.php:70
179
+ msgctxt "as download professional version"
180
+ msgid "Download %s Version"
181
+ msgstr "Scarica la versione %s"
182
+
183
+ #: includes/i18n.php:71
184
+ msgctxt "as download professional version now"
185
+ msgid "Download %s version now"
186
+ msgstr "Scarica la versione %s ora"
187
+
188
+ #: includes/i18n.php:72
189
+ msgctxt "as download latest version"
190
+ msgid "Download Latest"
191
+ msgstr "Scarica l'ultima versione"
192
+
193
+ #: includes/i18n.php:73
194
+ msgctxt "E.g. you have a professional license."
195
+ msgid "You have a %s license."
196
+ msgstr "Hai la licenza %s."
197
+
198
+ #: includes/i18n.php:74
199
+ msgid "New"
200
+ msgstr "Nuovo"
201
+
202
+ #: includes/i18n.php:75
203
+ msgid "Free"
204
+ msgstr "Gratuito"
205
+
206
+ #: includes/i18n.php:76
207
+ msgctxt "as trial plan"
208
+ msgid "Trial"
209
+ msgstr "Prova gratuita"
210
+
211
+ #: includes/i18n.php:77
212
+ msgctxt "as starting a trial plan"
213
+ msgid "Start Trial"
214
+ msgstr "Inizia il periodo di prova gratuito"
215
+
216
+ #: includes/i18n.php:78
217
+ msgctxt "verb"
218
+ msgid "Purchase"
219
+ msgstr "Acquisto"
220
+
221
+ #: includes/i18n.php:79
222
+ msgid "Purchase License"
223
+ msgstr "Acquista licenza"
224
+
225
+ #: includes/i18n.php:80
226
+ msgctxt "verb"
227
+ msgid "Buy"
228
+ msgstr "Compra"
229
+
230
+ #: includes/i18n.php:81
231
+ msgid "Buy License"
232
+ msgstr "Compra licenza"
233
+
234
+ #: includes/i18n.php:82
235
+ msgid "Single Site License"
236
+ msgstr "Licenza per sito singolo"
237
+
238
+ #: includes/i18n.php:83
239
+ msgid "Unlimited Licenses"
240
+ msgstr "Licenze illimitate"
241
+
242
+ #: includes/i18n.php:84
243
+ msgid "Up to %s Sites"
244
+ msgstr "Fino a %s siti"
245
+
246
+ #: includes/i18n.php:85
247
+ msgid "%sRenew your license now%s to access version %s features and support."
248
+ msgstr "%sRinnova la tua licenza ora%s per accedere a funzionalità e supporto della versione %s."
249
+
250
+ #: includes/i18n.php:86
251
+ msgid ""
252
+ "Enter the email address you've used for the upgrade below and we will resend"
253
+ " you the license key."
254
+ msgstr "Inserisci qui sotto l'indirizzo email che hai usato per registrare l'aggiornamento e ti invieremo di nuovo la chiave di licenza."
255
+
256
+ #: includes/i18n.php:87
257
+ msgctxt "e.g. Professional Plan"
258
+ msgid "%s Plan"
259
+ msgstr "Piano %s"
260
+
261
+ #: includes/i18n.php:88
262
+ msgid "You are just one step away - %s"
263
+ msgstr "Sei a un passo dalla fine - %s"
264
+
265
+ #: includes/i18n.php:89
266
+ msgctxt "%s - plugin name. As complete \"Jetpack\" activation now"
267
+ msgid "Complete \"%s\" Activation Now"
268
+ msgstr "Completa l'attivazione di \"%s\" ora"
269
+
270
+ #: includes/i18n.php:91
271
+ msgid "We made a few tweaks to the plugin, %s"
272
+ msgstr "Abbiamo apportato alcune modifiche al plugin, %s"
273
+
274
+ #: includes/i18n.php:92
275
+ msgid "Opt-in to make \"%s\" Better!"
276
+ msgstr "Contribuisci a rendere \"%s\" migliore!"
277
+
278
+ #: includes/i18n.php:93
279
+ msgid "Error"
280
+ msgstr "Errore"
281
+
282
+ #: includes/i18n.php:94
283
+ msgid ""
284
+ "Freemius SDK couldn't find the plugin's main file. Please contact "
285
+ "sdk@freemius.com with the current error."
286
+ msgstr "L'SDK di Freemius non è riuscito a trovare il file principale del plugin. Per favore contatta sdk@freemius.com riportando l'errore."
287
+
288
+ #: includes/i18n.php:97
289
+ msgctxt "as expiration date"
290
+ msgid "Expiration"
291
+ msgstr "Scadenza"
292
+
293
+ #: includes/i18n.php:98
294
+ msgctxt "as software license"
295
+ msgid "License"
296
+ msgstr "Licenza"
297
+
298
+ #: includes/i18n.php:99
299
+ msgid "not verified"
300
+ msgstr "non verificato"
301
+
302
+ #: includes/i18n.php:100
303
+ msgid "Verify Email"
304
+ msgstr "Verifica email"
305
+
306
+ #: includes/i18n.php:101
307
+ msgctxt "e.g. expires in 2 months"
308
+ msgid "Expires in %s"
309
+ msgstr "Scade in %s"
310
+
311
+ #: includes/i18n.php:102
312
+ msgctxt "e.g. auto renews in 2 months"
313
+ msgid "Auto renews in %s"
314
+ msgstr "Rinnovo automatico in %s"
315
+
316
+ #: includes/i18n.php:103
317
+ msgid "No expiration"
318
+ msgstr "Nessuna scadenza"
319
+
320
+ #: includes/i18n.php:104
321
+ msgid "Expired"
322
+ msgstr "Scaduto"
323
+
324
+ #: includes/i18n.php:105
325
+ msgid "Cancelled"
326
+ msgstr "Annullato"
327
+
328
+ #: includes/i18n.php:106
329
+ msgctxt "e.g. In 2 hours"
330
+ msgid "In %s"
331
+ msgstr "In %s"
332
+
333
+ #: includes/i18n.php:107
334
+ msgctxt "e.g. 2 min ago"
335
+ msgid "%s ago"
336
+ msgstr "%s fa"
337
+
338
+ #: includes/i18n.php:109
339
+ msgid "%s or higher"
340
+ msgstr "%s o superiore"
341
+
342
+ #: includes/i18n.php:110
343
+ msgctxt "as plugin version"
344
+ msgid "Version"
345
+ msgstr "Versione"
346
+
347
+ #: includes/i18n.php:111
348
+ msgid "Name"
349
+ msgstr "Nome"
350
+
351
+ #: includes/i18n.php:112
352
+ msgid "Email"
353
+ msgstr "Email"
354
+
355
+ #: includes/i18n.php:113
356
+ msgid "Email address"
357
+ msgstr "Indirizzo email"
358
+
359
+ #: includes/i18n.php:114
360
+ msgid "Verified"
361
+ msgstr "Verificato"
362
+
363
+ #: includes/i18n.php:115
364
+ msgid "Module"
365
+ msgstr "Modulo"
366
+
367
+ #: includes/i18n.php:116
368
+ msgid "Module Type"
369
+ msgstr "Tipo di modulo"
370
+
371
+ #: includes/i18n.php:117
372
+ msgid "Plugin"
373
+ msgstr "Plugin"
374
+
375
+ #: includes/i18n.php:118
376
+ msgid "Plugins"
377
+ msgstr "Plugin"
378
+
379
+ #: includes/i18n.php:119
380
+ msgid "Theme"
381
+ msgstr "Tema"
382
+
383
+ #: includes/i18n.php:120
384
+ msgid "Themes"
385
+ msgstr "Temi"
386
+
387
+ #: includes/i18n.php:121
388
+ msgctxt "as file/folder path"
389
+ msgid "Path"
390
+ msgstr "Percorso"
391
+
392
+ #: includes/i18n.php:122
393
+ msgid "Title"
394
+ msgstr "Titolo"
395
+
396
+ #: includes/i18n.php:123
397
+ msgid "Free version"
398
+ msgstr "Versione gratuita"
399
+
400
+ #: includes/i18n.php:124
401
+ msgid "Premium version"
402
+ msgstr "Versione premium"
403
+
404
+ #: includes/i18n.php:125
405
+ msgctxt "as WP plugin slug"
406
+ msgid "Slug"
407
+ msgstr "Slug"
408
+
409
+ #: includes/i18n.php:126
410
+ msgid "ID"
411
+ msgstr "ID"
412
+
413
+ #: includes/i18n.php:127
414
+ msgid "Users"
415
+ msgstr "Utenti"
416
+
417
+ #: includes/i18n.php:128
418
+ msgid "Plugin Installs"
419
+ msgstr "Installazioni Plugin"
420
+
421
+ #: includes/i18n.php:129
422
+ msgid "%s Installs"
423
+ msgstr "%s Installazioni"
424
+
425
+ #: includes/i18n.php:130
426
+ msgctxt "like websites"
427
+ msgid "Sites"
428
+ msgstr "Siti"
429
+
430
+ #: includes/i18n.php:131
431
+ msgid "User ID"
432
+ msgstr "ID utente"
433
+
434
+ #: includes/i18n.php:132
435
+ msgid "Site ID"
436
+ msgstr "ID del sito"
437
+
438
+ #: includes/i18n.php:133
439
+ msgid "Public Key"
440
+ msgstr "Chiave pubblica"
441
+
442
+ #: includes/i18n.php:134
443
+ msgid "Secret Key"
444
+ msgstr "Chiave segreta"
445
+
446
+ #: includes/i18n.php:135
447
+ msgctxt "as secret encryption key missing"
448
+ msgid "No Secret"
449
+ msgstr "Nessuna chiave"
450
+
451
+ #: includes/i18n.php:136
452
+ msgid "No ID"
453
+ msgstr "Nessun ID"
454
+
455
+ #: includes/i18n.php:137
456
+ msgctxt "as synchronize license"
457
+ msgid "Sync License"
458
+ msgstr "Sincronizza la licenza"
459
+
460
+ #: includes/i18n.php:138
461
+ msgctxt "as synchronize"
462
+ msgid "Sync"
463
+ msgstr "Sincronizza"
464
+
465
+ #: includes/i18n.php:139
466
+ msgid "Activate License"
467
+ msgstr "Attiva licenza"
468
+
469
+ #: includes/i18n.php:140
470
+ msgid "Activate Free Version"
471
+ msgstr "Attiva versione gratuita"
472
+
473
+ #: includes/i18n.php:141
474
+ msgid ""
475
+ "Please enter the license key that you received in the email right after the "
476
+ "purchase:"
477
+ msgstr "Per favore inserisci la chiave di licenza che hai ricevuto via mail subito dopo l'acquisto:"
478
+
479
+ #: includes/i18n.php:142
480
+ msgid "Activating license..."
481
+ msgstr "Sto attivando la licenza..."
482
+
483
+ #: includes/i18n.php:143
484
+ msgid "Change License"
485
+ msgstr "Cambia licenza"
486
+
487
+ #: includes/i18n.php:144
488
+ msgid "Update License"
489
+ msgstr "Aggiorna licenza"
490
+
491
+ #: includes/i18n.php:145
492
+ msgid "Deactivate License"
493
+ msgstr "Disattiva licenza"
494
+
495
+ #: includes/i18n.php:146
496
+ msgid "Activate"
497
+ msgstr "Attiva"
498
+
499
+ #: includes/i18n.php:147
500
+ msgid "Deactivate"
501
+ msgstr "Disattiva"
502
+
503
+ #: includes/i18n.php:148
504
+ msgid "Skip & Deactivate"
505
+ msgstr "Salta e disattiva"
506
+
507
+ #: includes/i18n.php:149
508
+ msgid "Skip & %s"
509
+ msgstr "Salta & %s"
510
+
511
+ #: includes/i18n.php:150
512
+ msgid "No - just deactivate"
513
+ msgstr "No - disattiva e basta"
514
+
515
+ #: includes/i18n.php:151
516
+ msgid "Yes - do your thing"
517
+ msgstr "Sì - fai pure"
518
+
519
+ #: includes/i18n.php:152
520
+ msgctxt "active mode"
521
+ msgid "Active"
522
+ msgstr "Attiva"
523
+
524
+ #: includes/i18n.php:153
525
+ msgctxt "is active mode?"
526
+ msgid "Is Active"
527
+ msgstr "è attiva"
528
+
529
+ #: includes/i18n.php:154
530
+ msgid "Install Now"
531
+ msgstr "Installa ora"
532
+
533
+ #: includes/i18n.php:155
534
+ msgid "Install Update Now"
535
+ msgstr "Installa l'aggiornamento ora"
536
+
537
+ #: includes/i18n.php:156
538
+ msgid "More information about %s"
539
+ msgstr "Ulteriori informazioni su %s"
540
+
541
+ #: includes/i18n.php:157
542
+ msgid "Localhost"
543
+ msgstr "Localhost"
544
+
545
+ #: includes/i18n.php:158
546
+ msgctxt "as activate Professional plan"
547
+ msgid "Activate %s Plan"
548
+ msgstr "Attivare il piano %s"
549
+
550
+ #: includes/i18n.php:159
551
+ msgctxt "as 5 licenses left"
552
+ msgid "%s left"
553
+ msgstr "%s rimanenti"
554
+
555
+ #: includes/i18n.php:160
556
+ msgid "Last license"
557
+ msgstr "Ultima licenza"
558
+
559
+ #: includes/i18n.php:161
560
+ msgid "What is your %s?"
561
+ msgstr "Qual è il tuo %s?"
562
+
563
+ #: includes/i18n.php:162
564
+ msgid "Activate this add-on"
565
+ msgstr "Attivare questo addon"
566
+
567
+ #: includes/i18n.php:163
568
+ msgid ""
569
+ "Deactivating your license will block all premium features, but will enable "
570
+ "you to activate the license on another site. Are you sure you want to "
571
+ "proceed?"
572
+ 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?"
573
+
574
+ #: includes/i18n.php:164
575
+ msgid ""
576
+ "Deleting the account will automatically deactivate your %s plan license so "
577
+ "you can use it on other sites. If you want to terminate the recurring "
578
+ "payments as well, click the \"Cancel\" button, and first \"Downgrade\" your "
579
+ "account. Are you sure you would like to continue with the deletion?"
580
+ 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?"
581
+
582
+ #: includes/i18n.php:165
583
+ msgid ""
584
+ "Deletion is not temporary. Only delete if you no longer want to use this "
585
+ "plugin anymore. Are you sure you would like to continue with the deletion?"
586
+ msgstr "L'eliminazione non è temporanea. Cancella solo se non si desidera più utilizzare questo plugin. Sei sicuro di voler continuare con l'eliminazione?"
587
+
588
+ #: includes/i18n.php:166
589
+ msgid ""
590
+ "Downgrading your plan will immediately stop all future recurring payments "
591
+ "and your %s plan license will expire in %s."
592
+ msgstr "Effettuare il downgrade del piano interromperà immediatamente tutti i futuri pagamenti ricorrenti e la licenza del piano %s scadrà in %s."
593
+
594
+ #: includes/i18n.php:167
595
+ msgid ""
596
+ "Cancelling the trial will immediately block access to all premium features. "
597
+ "Are you sure?"
598
+ msgstr "Cancellando il periodo di prova gratuito bloccherai immediatamente l'accesso a tutte le funzionalità premium. Vuoi continuare?"
599
+
600
+ #: includes/i18n.php:168
601
+ msgid ""
602
+ "You can still enjoy all %s features but you will not have access to plugin "
603
+ "updates and support."
604
+ msgstr "Puoi ancora sfruttare tutte le funzionalità di %s, ma non avrai accesso al supporto ed agli aggiornamenti del plugin."
605
+
606
+ #: includes/i18n.php:169
607
+ msgid ""
608
+ "Once your license expires you can still use the Free version but you will "
609
+ "NOT have access to the %s features."
610
+ msgstr "Quando la tua licenza scadrà, potrai comunque continuare a usare la versione gratuita, ma NON avrai accesso alle funzionalità %s."
611
+
612
+ #: includes/i18n.php:170
613
+ msgid "Are you sure you want to proceed?"
614
+ msgstr "Sei sicuro di voler procedere?"
615
+
616
+ #: includes/i18n.php:173
617
+ msgid "Add Ons for %s"
618
+ msgstr "Add-on per %s"
619
+
620
+ #: includes/i18n.php:174
621
+ msgid ""
622
+ "We could'nt load the add-ons list. It's probably an issue on our side, "
623
+ "please try to come back in few minutes."
624
+ 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."
625
+
626
+ #: includes/i18n.php:176
627
+ msgid "Anonymous feedback"
628
+ msgstr "Feedback anonimo"
629
+
630
+ #: includes/i18n.php:177
631
+ msgid "Quick feedback"
632
+ msgstr "Feedback veloce"
633
+
634
+ #: includes/i18n.php:178
635
+ msgid "If you have a moment, please let us know why you are deactivating"
636
+ msgstr "Se hai un momento, potresti dirci perché lo hai disattivato?"
637
+
638
+ #: includes/i18n.php:179
639
+ msgid "Yes - Deactivate"
640
+ msgstr "Si - Disattiva"
641
+
642
+ #: includes/i18n.php:180
643
+ msgid "Submit & Deactivate"
644
+ msgstr "Invia & Disattiva"
645
+
646
+ #: includes/i18n.php:181
647
+ msgid "Cancel"
648
+ msgstr "Annulla"
649
+
650
+ #: includes/i18n.php:182
651
+ msgid "I no longer need the plugin"
652
+ msgstr "Non ho piú bisogno di questo plugin"
653
+
654
+ #: includes/i18n.php:183
655
+ msgid "I found a better plugin"
656
+ msgstr "Ho trovato un plugin migliore"
657
+
658
+ #: includes/i18n.php:184
659
+ msgid "I only needed the plugin for a short period"
660
+ msgstr "Avevo bisogno del plugin solo per un breve periodo"
661
+
662
+ #: includes/i18n.php:185
663
+ msgid "The plugin broke my site"
664
+ msgstr "Il plugin ha causato problemi al mio sito"
665
+
666
+ #: includes/i18n.php:186
667
+ msgid "The plugin suddenly stopped working"
668
+ msgstr "Il plugin ha smesso di funzionare"
669
+
670
+ #: includes/i18n.php:187
671
+ msgid "I can't pay for it anymore"
672
+ msgstr "Non posso piú pagarlo"
673
+
674
+ #: includes/i18n.php:188
675
+ msgid "It's a temporary deactivation. I'm just debugging an issue."
676
+ msgstr "È una disattivazione temporanea. Sto solo cercando di risolvere un problema."
677
+
678
+ #: includes/i18n.php:189
679
+ msgctxt ""
680
+ "the text of the \"other\" reason for deactivating the plugin that is shown "
681
+ "in the modal box."
682
+ msgid "Other"
683
+ msgstr "Altro"
684
+
685
+ #: includes/i18n.php:191
686
+ msgid "Kindly tell us the reason so we can improve."
687
+ msgstr "Spiegandoci il motivo ci aiuterai a migliorare."
688
+
689
+ #: includes/i18n.php:192
690
+ msgid "What's the plugin's name?"
691
+ msgstr "Qual è il nome del plugin?"
692
+
693
+ #: includes/i18n.php:193
694
+ msgid "What price would you feel comfortable paying?"
695
+ msgstr "Che prezzo ritieni opportuno pagare?"
696
+
697
+ #: includes/i18n.php:194
698
+ msgid "I couldn't understand how to make it work"
699
+ msgstr "Non capisco come farlo funzionare"
700
+
701
+ #: includes/i18n.php:195
702
+ msgid ""
703
+ "The plugin is great, but I need specific feature that you don't support"
704
+ msgstr "Il plugin é ottimo ma ho bisogno di una funzionalitá specifica che non é supportata"
705
+
706
+ #: includes/i18n.php:196
707
+ msgid "The plugin is not working"
708
+ msgstr "Il plugin non funziona"
709
+
710
+ #: includes/i18n.php:197
711
+ msgid "It's not what I was looking for"
712
+ msgstr "Non é quello che stavo cercando"
713
+
714
+ #: includes/i18n.php:198
715
+ msgid "The plugin didn't work as expected"
716
+ msgstr "Il plugin non funziona come mi aspettavo"
717
+
718
+ #: includes/i18n.php:199
719
+ msgid "What feature?"
720
+ msgstr "Quale funzionalitá?"
721
+
722
+ #: includes/i18n.php:200
723
+ msgid "Kindly share what didn't work so we can fix it for future users..."
724
+ msgstr "Condividi cosa non ha funzionato in modo da migliorare il prodotto per gli utenti futuri..."
725
+
726
+ #: includes/i18n.php:201
727
+ msgid "What you've been looking for?"
728
+ msgstr "Che cosa stai cercando?"
729
+
730
+ #: includes/i18n.php:202
731
+ msgid "What did you expect?"
732
+ msgstr "Che cosa ti aspettavi?"
733
+
734
+ #: includes/i18n.php:203
735
+ msgid "The plugin didn't work"
736
+ msgstr "Il plugin non funziona"
737
+
738
+ #: includes/i18n.php:204
739
+ msgid "I don't like to share my information with you"
740
+ msgstr "Non voglio condividere i miei dati con te"
741
+
742
+ #: includes/i18n.php:205
743
+ msgid ""
744
+ "You might have missed it, but you don't have to share any data and can just "
745
+ "%s the opt-in."
746
+ msgstr "Potresti non averci fatto caso, ma non sei obbligato a condividere i tuoi dati e puoi semplicemente %s la tua partecipazione."
747
+
748
+ #: includes/i18n.php:209
749
+ msgctxt "greeting"
750
+ msgid "Hey %s,"
751
+ msgstr "Hey %s,"
752
+
753
+ #: includes/i18n.php:210
754
+ msgctxt "a greeting. E.g. Thanks John!"
755
+ msgid "Thanks %s!"
756
+ msgstr "Grazie %s!"
757
+
758
+ #: includes/i18n.php:211
759
+ msgid ""
760
+ "Never miss an important update - opt-in to our security and feature updates "
761
+ "notifications, and non-sensitive diagnostic tracking with %4$s."
762
+ 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."
763
+
764
+ #: includes/i18n.php:212
765
+ msgid ""
766
+ "Please help us improve %1$s! If you opt-in, some data about your usage of "
767
+ "%1$s will be sent to %4$s. If you skip this, that's okay! %1$s will still "
768
+ "work just fine."
769
+ 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."
770
+
771
+ #: includes/i18n.php:213
772
+ msgid ""
773
+ "You should receive an activation email for %s to your mailbox at %s. Please "
774
+ "make sure you click the activation button in that email to %s."
775
+ msgstr "Dovresti ricevere un'email di attivazione di %s all'indirizzo %s. Assicurati di fare clic sul pulsante di attivazione nell'email per %s."
776
+
777
+ #: includes/i18n.php:214
778
+ msgid "complete the install"
779
+ msgstr "completa l'installazione"
780
+
781
+ #: includes/i18n.php:215
782
+ msgid "start the trial"
783
+ msgstr "Inizia il periodo di prova gratuito"
784
+
785
+ #: includes/i18n.php:216
786
+ msgid ""
787
+ "Thanks for purchasing %s! To get started, please enter your license key:"
788
+ msgstr "Grazie per aver acquistato %s! Per iniziare, per favore inserisci la tua chiave di licenza:"
789
+
790
+ #: includes/i18n.php:217
791
+ msgid ""
792
+ "The plugin will be periodically sending data to %s to check for plugin "
793
+ "updates and verify the validity of your license."
794
+ msgstr "Il plugin invierà dati periodicamente a %s per controllare l'esistenza di aggiornamenti e verificare la validità della tua licenza."
795
+
796
+ #: includes/i18n.php:218
797
+ msgid "What permissions are being granted?"
798
+ msgstr "Quali autorizzazioni vengono concesse?"
799
+
800
+ #: includes/i18n.php:219
801
+ msgid "Your Profile Overview"
802
+ msgstr "Panoramica del tuo profilo"
803
+
804
+ #: includes/i18n.php:220
805
+ msgid "Name and email address"
806
+ msgstr "Nome ed indirizzo email"
807
+
808
+ #: includes/i18n.php:221
809
+ msgid "Your Site Overview"
810
+ msgstr "Panoramica del tuo sito"
811
+
812
+ #: includes/i18n.php:222
813
+ msgid "Site URL, WP version, PHP info, plugins & themes"
814
+ msgstr "URL del sito, versione di WP, informazioni PHP, plugin e temi"
815
+
816
+ #: includes/i18n.php:223
817
+ msgid "Current Plugin Events"
818
+ msgstr "Eventi correnti del plugin"
819
+
820
+ #: includes/i18n.php:224
821
+ msgid "Activation, deactivation and uninstall"
822
+ msgstr "Attiva, disattivazione e disinstallazione"
823
+
824
+ #: includes/i18n.php:225
825
+ msgid "Plugins & Themes"
826
+ msgstr "Plugin e temi"
827
+
828
+ #: includes/i18n.php:226
829
+ msgid "Titles, versions and state."
830
+ msgstr "Titoli, versioni e stato."
831
+
832
+ #: includes/i18n.php:227
833
+ msgid "Admin Notices"
834
+ msgstr "Avvisi amministratore"
835
+
836
+ #: includes/i18n.php:228
837
+ msgid "Newsletter"
838
+ msgstr "Newsletter"
839
+
840
+ #: includes/i18n.php:229
841
+ msgid "Updates, announcements, marketing, no spam"
842
+ msgstr "Aggiornamenti, annunci, marketing, no spam"
843
+
844
+ #: includes/i18n.php:230
845
+ msgid "Privacy Policy"
846
+ msgstr "Politica sulla privacy"
847
+
848
+ #: includes/i18n.php:231
849
+ msgid "Terms of Service"
850
+ msgstr "Termini del Servizio"
851
+
852
+ #: includes/i18n.php:232
853
+ msgctxt "as activating plugin"
854
+ msgid "Activating"
855
+ msgstr "Attivazione"
856
+
857
+ #: includes/i18n.php:233
858
+ msgctxt "as in the process of sending an email"
859
+ msgid "Sending email"
860
+ msgstr "Invio email"
861
+
862
+ #: includes/i18n.php:234
863
+ msgctxt "button label"
864
+ msgid "Allow & Continue"
865
+ msgstr "Consenti & Continua"
866
+
867
+ #: includes/i18n.php:235
868
+ msgctxt "button label"
869
+ msgid "Agree & Activate License"
870
+ msgstr "Accetta e attiva la licenza"
871
+
872
+ #: includes/i18n.php:236
873
+ msgctxt "verb"
874
+ msgid "Skip"
875
+ msgstr "Salta"
876
+
877
+ #: includes/i18n.php:237
878
+ msgid "Click here to use the plugin anonymously"
879
+ msgstr "Fai clic qui per usare il plugin anonimamente"
880
+
881
+ #: includes/i18n.php:238
882
+ msgid "Re-send activation email"
883
+ msgstr "Invia nuovamente l'email di attivazione"
884
+
885
+ #: includes/i18n.php:239
886
+ msgid "License key"
887
+ msgstr "Chiave di licenza"
888
+
889
+ #: includes/i18n.php:240
890
+ msgid "Send License Key"
891
+ msgstr "Invia chiave di licenza"
892
+
893
+ #: includes/i18n.php:241
894
+ msgid "Sending license key"
895
+ msgstr "Invio chiave di licenza"
896
+
897
+ #: includes/i18n.php:242
898
+ msgid "Have a license key?"
899
+ msgstr "Hai una chiave di licenza?"
900
+
901
+ #: includes/i18n.php:243
902
+ msgid "Don't have a license key?"
903
+ msgstr "Non hai una chiave di licenza?"
904
+
905
+ #: includes/i18n.php:244
906
+ msgid "Can't find your license key?"
907
+ msgstr "Non trovi la tua chiave di licenza?"
908
+
909
+ #: includes/i18n.php:245
910
+ msgid ""
911
+ "We couldn't find your email address in the system, are you sure it's the "
912
+ "right address?"
913
+ msgstr "Non siamo riusciti a trovare il tuo indirizzo email nel sistema, sei sicuro che sia l'indirizzo giusto?"
914
+
915
+ #: includes/i18n.php:246
916
+ msgid ""
917
+ "We can't see any active licenses associated with that email address, are you"
918
+ " sure it's the right address?"
919
+ msgstr "Non siamo riusciti a trovare alcuna licenza attiva associata al tuo indirizzo email, sei sicuro che sia l'indirizzo giusto?"
920
+
921
+ #: includes/i18n.php:247
922
+ msgid "Opt In"
923
+ msgstr "Iscriviti"
924
+
925
+ #: includes/i18n.php:248
926
+ msgid "Opt Out"
927
+ msgstr "Cancella iscrizione"
928
+
929
+ #: includes/i18n.php:249
930
+ msgid "On second thought - I want to continue helping"
931
+ msgstr "Ci ho ripensato, voglio continuare a fornire il mio aiuto"
932
+
933
+ #: includes/i18n.php:250
934
+ msgid "Opting out..."
935
+ msgstr "Cancellamento dell'iscrizione..."
936
+
937
+ #: includes/i18n.php:251
938
+ msgid "Opting in..."
939
+ msgstr "Iscrizione in corso..."
940
+
941
+ #: includes/i18n.php:252
942
+ msgid ""
943
+ "We appreciate your help in making the %s better by letting us track some "
944
+ "usage data."
945
+ msgstr "Ti ringraziamo per averci concesso di tracciare alcuni dati di utilizzo al fine di migliorare %s"
946
+
947
+ #: includes/i18n.php:253
948
+ msgid ""
949
+ "Usage tracking is done in the name of making %s better. Making a better user"
950
+ " experience, prioritizing new features, and more good things. We'd really "
951
+ "appreciate if you'll reconsider letting us continue with the tracking."
952
+ 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."
953
+
954
+ #: includes/i18n.php:254
955
+ msgid ""
956
+ "By clicking \"Opt Out\", we will no longer be sending any data from %s to "
957
+ "%s."
958
+ msgstr "Cliccando su \"Cancella iscrizione\", non invieremo più nessuna informazione da %s a %s."
959
+
960
+ #: includes/i18n.php:258
961
+ msgid "Screenshots"
962
+ msgstr "Screenshots"
963
+
964
+ #: includes/i18n.php:259
965
+ msgid "Click to view full-size screenshot %d"
966
+ msgstr "Fare clic per visualizzare lo screenshot in grandi dimensioni %d"
967
+
968
+ #: includes/i18n.php:263
969
+ msgid "Freemius Debug"
970
+ msgstr "Debug Freemius"
971
+
972
+ #: includes/i18n.php:264
973
+ msgctxt "as turned on"
974
+ msgid "On"
975
+ msgstr "Attivo"
976
+
977
+ #: includes/i18n.php:265
978
+ msgctxt "as turned off"
979
+ msgid "Off"
980
+ msgstr "Non attivo"
981
+
982
+ #: includes/i18n.php:266
983
+ msgctxt "as code debugging"
984
+ msgid "Debugging"
985
+ msgstr "Debugging"
986
+
987
+ #: includes/i18n.php:267
988
+ msgid "Freemius State"
989
+ msgstr "Stato di Freemius"
990
+
991
+ #: includes/i18n.php:268
992
+ msgctxt "as connection was successful"
993
+ msgid "Connected"
994
+ msgstr "Connesso"
995
+
996
+ #: includes/i18n.php:269
997
+ msgctxt "as connection blocked"
998
+ msgid "Blocked"
999
+ msgstr "Bloccato"
1000
+
1001
+ #: includes/i18n.php:270
1002
+ msgctxt "as application program interface"
1003
+ msgid "API"
1004
+ msgstr "API"
1005
+
1006
+ #: includes/i18n.php:271
1007
+ msgctxt "as software development kit versions"
1008
+ msgid "SDK"
1009
+ msgstr "SDK"
1010
+
1011
+ #: includes/i18n.php:272
1012
+ msgctxt "as software development kit versions"
1013
+ msgid "SDK Versions"
1014
+ msgstr "Versioni SDK"
1015
+
1016
+ #: includes/i18n.php:273
1017
+ msgctxt "as plugin folder path"
1018
+ msgid "Plugin Path"
1019
+ msgstr "Percorso del plugin"
1020
+
1021
+ #: includes/i18n.php:274
1022
+ msgctxt "as sdk path"
1023
+ msgid "SDK Path"
1024
+ msgstr "Percorso SDK"
1025
+
1026
+ #: includes/i18n.php:275
1027
+ msgid "Add Ons of Plugin %s"
1028
+ msgstr "Add-on del Plugin %s"
1029
+
1030
+ #: includes/i18n.php:276
1031
+ msgid "Are you sure you want to delete all Freemius data?"
1032
+ msgstr "Sei sicuro di voler eliminare tutti i dati di Freemius?"
1033
+
1034
+ #: includes/i18n.php:277
1035
+ msgid "Actions"
1036
+ msgstr "Azioni"
1037
+
1038
+ #: includes/i18n.php:278
1039
+ msgid "Delete All Accounts"
1040
+ msgstr "Eliminare tutti gli account"
1041
+
1042
+ #: includes/i18n.php:279
1043
+ msgid "Start Fresh"
1044
+ msgstr "Inizia da capo"
1045
+
1046
+ #: includes/i18n.php:280
1047
+ msgid "Clear API Cache"
1048
+ msgstr "Elimina cache API"
1049
+
1050
+ #: includes/i18n.php:281
1051
+ msgid "Sync Data From Server"
1052
+ msgstr "Sincronizza i dati dal server"
1053
+
1054
+ #: includes/i18n.php:282
1055
+ msgid "Scheduled Crons"
1056
+ msgstr "Azioni programmate"
1057
+
1058
+ #: includes/i18n.php:283
1059
+ msgid "Cron Type"
1060
+ msgstr "Tipo di Cron"
1061
+
1062
+ #: includes/i18n.php:284
1063
+ msgid "Plugins & Themes Sync"
1064
+ msgstr "Sincronizzazione plugin e temi"
1065
+
1066
+ #: includes/i18n.php:285
1067
+ msgid "Licenses"
1068
+ msgstr "Licenze"
1069
+
1070
+ #: includes/i18n.php:286
1071
+ msgid "Debug Log"
1072
+ msgstr "Debug Log"
1073
+
1074
+ #: includes/i18n.php:287
1075
+ msgid "All"
1076
+ msgstr "Tutto"
1077
+
1078
+ #: includes/i18n.php:288
1079
+ msgid "File"
1080
+ msgstr "File"
1081
+
1082
+ #: includes/i18n.php:289
1083
+ msgid "Function"
1084
+ msgstr "Funzione"
1085
+
1086
+ #: includes/i18n.php:290
1087
+ msgid "Process ID"
1088
+ msgstr "ID processo"
1089
+
1090
+ #: includes/i18n.php:291
1091
+ msgid "Logger"
1092
+ msgstr "Logger"
1093
+
1094
+ #: includes/i18n.php:292
1095
+ msgid "Message"
1096
+ msgstr "Messaggio"
1097
+
1098
+ #: includes/i18n.php:293
1099
+ msgid "Download"
1100
+ msgstr "Download"
1101
+
1102
+ #: includes/i18n.php:294
1103
+ msgid "Filter"
1104
+ msgstr "Filtro"
1105
+
1106
+ #: includes/i18n.php:295
1107
+ msgid "Type"
1108
+ msgstr "Tipo"
1109
+
1110
+ #: includes/i18n.php:296
1111
+ msgid "All Types"
1112
+ msgstr "Tutti i tipi"
1113
+
1114
+ #: includes/i18n.php:297
1115
+ msgid "All Requests"
1116
+ msgstr "Tutte le richieste"
1117
+
1118
+ #: includes/i18n.php:301
1119
+ msgctxt "as congratulations"
1120
+ msgid "Congrats"
1121
+ msgstr "Congratulazioni"
1122
+
1123
+ #: includes/i18n.php:302
1124
+ msgctxt "exclamation"
1125
+ msgid "Oops"
1126
+ msgstr "Ops"
1127
+
1128
+ #: includes/i18n.php:303
1129
+ msgctxt "interjection expressing joy or exuberance"
1130
+ msgid "Yee-haw"
1131
+ msgstr "Evvai"
1132
+
1133
+ #: includes/i18n.php:304
1134
+ msgctxt ""
1135
+ "(especially in electronic communication) used to express elation, "
1136
+ "enthusiasm, or triumph."
1137
+ msgid "W00t"
1138
+ msgstr "Forte"
1139
+
1140
+ #: includes/i18n.php:306
1141
+ msgctxt "a positive response"
1142
+ msgid "Right on"
1143
+ msgstr "Sì"
1144
+
1145
+ #: includes/i18n.php:307
1146
+ msgctxt ""
1147
+ "something somebody says when they are thinking about what you have just "
1148
+ "said. "
1149
+ msgid "Hmm"
1150
+ msgstr "Uhm"
1151
+
1152
+ #: includes/i18n.php:309
1153
+ msgid "O.K"
1154
+ msgstr "OK"
1155
+
1156
+ #: includes/i18n.php:310
1157
+ msgctxt "exclamation"
1158
+ msgid "Hey"
1159
+ msgstr "Hey"
1160
+
1161
+ #: includes/i18n.php:311
1162
+ msgctxt "advance notice of something that will need attention."
1163
+ msgid "Heads up"
1164
+ msgstr "Attenzione"
1165
+
1166
+ #: includes/i18n.php:316
1167
+ msgid "Seems like you got the latest release."
1168
+ msgstr "Sembra che tu abbia la versione più recente."
1169
+
1170
+ #: includes/i18n.php:317
1171
+ msgid "You are all good!"
1172
+ msgstr "Sei fantastico!"
1173
+
1174
+ #: includes/i18n.php:318
1175
+ msgid ""
1176
+ "Sorry, we could not complete the email update. Another user with the same "
1177
+ "email is already registered."
1178
+ msgstr "Siamo spiacenti, non siamo riusciti a completare l'aggiornamento via email. Un altro utente con lo stesso indirizzo email è già registrato."
1179
+
1180
+ #: includes/i18n.php:319
1181
+ msgid ""
1182
+ "If you would like to give up the ownership of the plugin's account to %s "
1183
+ "click the Change Ownership button."
1184
+ msgstr "Se vuoi cedere la proprietá dell'account del plugin a %s clicca su Cambia Proprietà."
1185
+
1186
+ #: includes/i18n.php:320
1187
+ msgid ""
1188
+ "Your email was successfully updated. You should receive an email with "
1189
+ "confirmation instructions in few moments."
1190
+ msgstr "Il tuo indirizzo email è stato aggiornato correttamente. Riceverai un'email con le istruzioni di conferma in pochi istanti."
1191
+
1192
+ #: includes/i18n.php:321
1193
+ msgid "Your name was successfully updated."
1194
+ msgstr "Il tuo nome è stato aggiornato correttamente."
1195
+
1196
+ #: includes/i18n.php:322
1197
+ msgid "You have successfully updated your %s."
1198
+ msgstr "Hai aggiornato con successo il tuo %s."
1199
+
1200
+ #: includes/i18n.php:323
1201
+ msgid "Please provide your full name."
1202
+ msgstr "Per favore inserisci il tuo nome completo."
1203
+
1204
+ #: includes/i18n.php:324
1205
+ msgid ""
1206
+ "Verification mail was just sent to %s. If you can't find it after 5 min, "
1207
+ "please check your spam box."
1208
+ 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."
1209
+
1210
+ #: includes/i18n.php:325
1211
+ msgid ""
1212
+ "Just letting you know that the add-ons information of %s is being pulled "
1213
+ "from an external server."
1214
+ msgstr "Le informazioni sugli add-on di %s vengono scaricate da un server esterno."
1215
+
1216
+ #: includes/i18n.php:326
1217
+ msgid "No credit card required"
1218
+ msgstr "Nessuna carta di credito richiesta"
1219
+
1220
+ #: includes/i18n.php:327
1221
+ msgid "Premium plugin version was successfully activated."
1222
+ msgstr "La versione Premium del plugin è stata attivata correttamente."
1223
+
1224
+ #: includes/i18n.php:328
1225
+ msgid "The upgrade of %s was successfully completed."
1226
+ msgstr "L'aggiornamento di %s è stato completato con successo."
1227
+
1228
+ #: includes/i18n.php:329
1229
+ msgid "Your account was successfully activated with the %s plan."
1230
+ msgstr "Il tuo account è stato attivato correttamente con il piano %s."
1231
+
1232
+ #: includes/i18n.php:330
1233
+ msgid "Download the latest %s version now"
1234
+ msgstr "Scarica l'ultima versione di %s"
1235
+
1236
+ #: includes/i18n.php:331
1237
+ msgid "Please follow these steps to complete the upgrade"
1238
+ msgstr "Segui i passi seguenti per completare l'aggiornamento"
1239
+
1240
+ #: includes/i18n.php:332
1241
+ msgid "Download the latest %s version"
1242
+ msgstr "Scarica l'ultima versione di %s"
1243
+
1244
+ #: includes/i18n.php:333
1245
+ msgid "Download the latest version"
1246
+ msgstr "Scarica l'ultima versione"
1247
+
1248
+ #: includes/i18n.php:334
1249
+ msgid "Deactivate the free version"
1250
+ msgstr "Disattiva la versione gratuita"
1251
+
1252
+ #: includes/i18n.php:335
1253
+ msgid "Upload and activate the downloaded version"
1254
+ msgstr "Carica e attiva la versione scaricata"
1255
+
1256
+ #: includes/i18n.php:336
1257
+ msgid "How to upload and activate?"
1258
+ msgstr "Come faccio a caricare ed attivare?"
1259
+
1260
+ #: includes/i18n.php:337
1261
+ msgctxt "%s - product name, e.g. Facebook add-on was successfully..."
1262
+ msgid "%s Add-on was successfully purchased."
1263
+ msgstr "L' add-on %s è stato acquistato con successo."
1264
+
1265
+ #: includes/i18n.php:339
1266
+ msgid "Your %s Add-on plan was successfully upgraded."
1267
+ msgstr "Il piano del tuo add-on %s è stato aggiornato con successo."
1268
+
1269
+ #: includes/i18n.php:340
1270
+ msgid "Your email has been successfully verified - you are AWESOME!"
1271
+ msgstr "Il tuo indirizzo email è stato verificato con successo - SEI UN GRANDE!"
1272
+
1273
+ #: includes/i18n.php:341
1274
+ msgid "Your plan was successfully upgraded."
1275
+ msgstr "Il piano è stato aggiornato con successo."
1276
+
1277
+ #: includes/i18n.php:342
1278
+ msgid "Your plan was successfully changed to %s."
1279
+ msgstr "Il piano è stato cambiato con successo a %s."
1280
+
1281
+ #: includes/i18n.php:343
1282
+ msgid ""
1283
+ "Your license has expired. You can still continue using the free plugin "
1284
+ "forever."
1285
+ msgstr "La licenza è scaduta. È comunque possibile continuare ad utilizzare il plugin gratuito per sempre."
1286
+
1287
+ #: includes/i18n.php:344
1288
+ msgid ""
1289
+ "Your license has been cancelled. If you think it's a mistake, please contact"
1290
+ " support."
1291
+ msgstr "La tua licenza è stata cancellata. Se credi sia un errore, per favore contatta il supporto."
1292
+
1293
+ #: includes/i18n.php:345
1294
+ msgid "Your trial has been successfully started."
1295
+ msgstr "La versione di prova è stata avviata correttamente."
1296
+
1297
+ #: includes/i18n.php:346
1298
+ msgid "Your license was successfully activated."
1299
+ msgstr "La tua licenza è stata attivata correttamente."
1300
+
1301
+ #: includes/i18n.php:347
1302
+ msgid "It looks like your site currently doesn't have an active license."
1303
+ msgstr "Sembra che il tuo sito non disponga di alcuna licenza attiva."
1304
+
1305
+ #: includes/i18n.php:348
1306
+ msgid ""
1307
+ "Your license was successfully deactivated, you are back to the %s plan."
1308
+ msgstr "La tua licenza é stata disattivata con successo, sei tornato al piano %s."
1309
+
1310
+ #: includes/i18n.php:349
1311
+ msgid "It looks like the license deactivation failed."
1312
+ msgstr "Sembra che la disattivazione della licenza non sia riuscita."
1313
+
1314
+ #: includes/i18n.php:350
1315
+ msgid "It looks like the license could not be activated."
1316
+ msgstr "Sembra che la licenza non possa essere attivata."
1317
+
1318
+ #: includes/i18n.php:351
1319
+ msgid "Error received from the server:"
1320
+ msgstr "Errore ricevuto dal server:"
1321
+
1322
+ #: includes/i18n.php:352
1323
+ msgid ""
1324
+ "Your trial has expired. You can still continue using all our free features."
1325
+ msgstr "La versione di prova è scaduta. Si può comunque continuare a utilizzare tutte le nostre funzioni gratuite."
1326
+
1327
+ #: includes/i18n.php:353
1328
+ msgid ""
1329
+ "Your plan was successfully downgraded. Your %s plan license will expire in "
1330
+ "%s."
1331
+ msgstr "Il tuo piano è stato declassato con successo. La licenza del piano %s scadrà in %s."
1332
+
1333
+ #: includes/i18n.php:354
1334
+ msgid ""
1335
+ "Seems like we are having some temporary issue with your plan downgrade. "
1336
+ "Please try again in few minutes."
1337
+ msgstr "Stiamo avendo qualche problema temporaneo con il downgrade del piano. Riprova tra qualche minuto."
1338
+
1339
+ #: includes/i18n.php:355
1340
+ msgid ""
1341
+ "It looks like you are not in trial mode anymore so there's nothing to cancel"
1342
+ " :)"
1343
+ msgstr "Sembra che tu non stia più usando la prova gratuita, quindi non c'è niente che tu debba annullare :)"
1344
+
1345
+ #: includes/i18n.php:356
1346
+ msgid "Your %s free trial was successfully cancelled."
1347
+ msgstr "Il tuo periodo di prova gratuito %s è stato annullato con successo."
1348
+
1349
+ #: includes/i18n.php:357
1350
+ msgctxt "%s - numeric version number"
1351
+ msgid "Version %s was released."
1352
+ msgstr "La versione %s é stata rilasciata."
1353
+
1354
+ #: includes/i18n.php:358
1355
+ msgid "Please download %s."
1356
+ msgstr "Scarica %s."
1357
+
1358
+ #: includes/i18n.php:359
1359
+ msgctxt "%s - plan name, as the latest professional version here"
1360
+ msgid "the latest %s version here"
1361
+ msgstr "l'ultima versione %s é quì"
1362
+
1363
+ #: includes/i18n.php:361
1364
+ msgid ""
1365
+ "How do you like %s so far? Test all our %s premium features with a %d-day "
1366
+ "free trial."
1367
+ msgstr "Come sta andando con %s? Prova tutte le funzionalità premium di %s con una prova gratuita di %d giorni."
1368
+
1369
+ #: includes/i18n.php:362
1370
+ msgctxt "call to action"
1371
+ msgid "Start free trial"
1372
+ msgstr "Inizia il periodo di prova gratuito"
1373
+
1374
+ #: includes/i18n.php:363
1375
+ msgid "Starting trial"
1376
+ msgstr "Inizio del periodo di prova gratuito"
1377
+
1378
+ #: includes/i18n.php:364
1379
+ msgid "Please wait"
1380
+ msgstr "Attendere"
1381
+
1382
+ #: includes/i18n.php:365
1383
+ msgid ""
1384
+ "Seems like we are having some temporary issue with your trial cancellation. "
1385
+ "Please try again in few minutes."
1386
+ msgstr "Stiamo avendo qualche problema temporaneo con l'annullamento del periodo di prova. Riprova tra qualche minuto."
1387
+
1388
+ #: includes/i18n.php:366
1389
+ msgid "You already utilized a trial before."
1390
+ msgstr "Hai già utilizzato una prova gratuita in passato."
1391
+
1392
+ #: includes/i18n.php:367
1393
+ msgid "You are already running the plugin in a trial mode."
1394
+ msgstr "Stai già usando il plugin in modalità di prova gratuita."
1395
+
1396
+ #: includes/i18n.php:368
1397
+ msgid "Plan %s do not exist, therefore, can't start a trial."
1398
+ msgstr "Il piano %s non esiste, per questo motivo non è possibile iniziare il periodo di prova."
1399
+
1400
+ #: includes/i18n.php:369
1401
+ msgid "Plan %s does not support a trial period."
1402
+ msgstr "Il piano %s non supporta il periodo di prova."
1403
+
1404
+ #: includes/i18n.php:370
1405
+ msgid "None of the plugin's plans supports a trial period."
1406
+ msgstr "Non esiste alcun piano del plugin che offra il periodo di prova."
1407
+
1408
+ #: includes/i18n.php:371
1409
+ msgid ""
1410
+ "Unexpected API error. Please contact the plugin's author with the following "
1411
+ "error."
1412
+ msgstr "Errore inaspettato dell'API. Per favore contatta l'autore del plugin riportando il seguente errore."
1413
+
1414
+ #: includes/i18n.php:372
1415
+ msgid "No commitment for %s days - cancel anytime!"
1416
+ msgstr "Nessun impegno per %s giorni - puoi annullare in qualsiasi momento!"
1417
+
1418
+ #: includes/i18n.php:373
1419
+ msgid ""
1420
+ "Your license has expired. You can still continue using all the %s features, "
1421
+ "but you'll need to renew your license to continue getting updates and "
1422
+ "support."
1423
+ 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."
1424
+
1425
+ #: includes/i18n.php:374
1426
+ msgid "Couldn't activate %s."
1427
+ msgstr "Non é stato possibile attivare %s."
1428
+
1429
+ #: includes/i18n.php:375
1430
+ msgid "Please contact us with the following message:"
1431
+ msgstr "Contattaci con il seguente messaggio:"
1432
+
1433
+ #: includes/i18n.php:376
1434
+ msgid ""
1435
+ "It looks like you are still on the %s plan. If you did upgrade or change "
1436
+ "your plan, it's probably an issue on our side - sorry."
1437
+ 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."
1438
+
1439
+ #: includes/i18n.php:377
1440
+ msgid "Please contact us here"
1441
+ msgstr "Contattaci qui"
1442
+
1443
+ #: includes/i18n.php:378
1444
+ msgid ""
1445
+ "I have upgraded my account but when I try to Sync the License, the plan "
1446
+ "remains %s."
1447
+ msgstr "Ho aggiornato il mio account, ma quando cerco di sincronizzare la licenza, il piano rimane %s."
1448
+
1449
+ #: includes/i18n.php:381
1450
+ msgid "From unknown reason, the API connectivity test failed."
1451
+ msgstr "Il test di connettività dell'API ha fallito per motivi sconosciuti."
1452
+
1453
+ #: includes/i18n.php:382
1454
+ msgid ""
1455
+ "It's probably a temporary issue on our end. Just to be sure, with your "
1456
+ "permission, would it be o.k to run another connectivity test?"
1457
+ msgstr "Si tratta probabilmente di un problema nei nostri sistemi. Per esserne sicuri, potresti darci il permesso di effettuare un ulteriore test della connettività? "
1458
+
1459
+ #: includes/i18n.php:383
1460
+ msgid ""
1461
+ "We use PHP cURL library for the API calls, which is a very common library "
1462
+ "and usually installed out of the box. Unfortunately, cURL is not installed "
1463
+ "on your server."
1464
+ msgstr "Utilizziamo la libreria PHP cURL per le chiamate alla nostra API. Questa libreria è molto comune ed è installata di base. Sfortunatamente cURL non è presente nel tuo server."
1465
+
1466
+ #: includes/i18n.php:384
1467
+ msgid ""
1468
+ "From unknown reason, CloudFlare, the firewall we use, blocks the connection."
1469
+ msgstr "Per un motivo sconosciuto, CloudFlare, il firewall che utilizziamo, blocca la connessione."
1470
+
1471
+ #: includes/i18n.php:385
1472
+ msgctxt "as pluginX requires an access to our API"
1473
+ msgid "%s requires an access to our API."
1474
+ msgstr "%s richiede un accesso alla nostra API."
1475
+
1476
+ #: includes/i18n.php:387
1477
+ msgid ""
1478
+ "It looks like your server is using Squid ACL (access control lists), which "
1479
+ "blocks the connection."
1480
+ msgstr "Sembra che il tuo server stia usando Squid ACL (lista per il controllo degli accessi) il quale blocca la connessione."
1481
+
1482
+ #: includes/i18n.php:388
1483
+ msgid "I don't know what is Squid or ACL, help me!"
1484
+ msgstr "Non ho idea di cosa sia Squid o ACL, aiutami!"
1485
+
1486
+ #: includes/i18n.php389, includes/i18n.php:393
1487
+ msgid ""
1488
+ "We'll make sure to contact your hosting company and resolve the issue. You "
1489
+ "will get a follow-up email to %s once we have an update."
1490
+ msgstr "Contatteremo il tuo hosting e risolveremo il problema. Riceverai un' email a %s non appena ci saranno aggiornamenti."
1491
+
1492
+ #: includes/i18n.php:390
1493
+ msgid "I'm a system administrator"
1494
+ msgstr "Sono un sistemista"
1495
+
1496
+ #: includes/i18n.php:391
1497
+ msgid ""
1498
+ "Great, please whitelist the following domains: %s. Once you are done, "
1499
+ "deactivate the plugin and activate it again."
1500
+ msgstr "Perfetto, ora per favore aggiungi alla whitelist i seguenti domini: %s. Quando hai fatto, disattiva il plugin e riattivalo di nuovo."
1501
+
1502
+ #: includes/i18n.php:392
1503
+ msgid "I don't know what is cURL or how to install it, help me!"
1504
+ msgstr "Non ho idea di cosa sia cURL o come installarlo, aiutami!"
1505
+
1506
+ #: includes/i18n.php:394
1507
+ msgid ""
1508
+ "Great, please install cURL and enable it in your php.ini file. To make sure "
1509
+ "it was successfully activated, use 'phpinfo()'. Once activated, deactivate "
1510
+ "the plugin and reactivate it back again."
1511
+ msgstr "Perfetto, installa cURL ed attivalo nel tuo file php.ini. Per essere sicuro di averlo attivato con successo, usa \"phpinfo()\". Una volta attivato disattva il plugin e attivalo di nuovo."
1512
+
1513
+ #: includes/i18n.php:395
1514
+ msgid ""
1515
+ "We are sure it's an issue on our side and more than happy to resolve it for "
1516
+ "you ASAP if you give us a chance."
1517
+ 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."
1518
+
1519
+ #: includes/i18n.php:396
1520
+ msgid ""
1521
+ "Sorry for the inconvenience and we are here to help if you give us a chance."
1522
+ msgstr "Siamo spiacenti per l'inconveniente e siamo qui per aiutarti con il tuo permesso."
1523
+
1524
+ #: includes/i18n.php:397
1525
+ msgid "Yes - I'm giving you a chance to fix it"
1526
+ msgstr "Sì - sto dandovi la possibilità di risolvere il problema"
1527
+
1528
+ #: includes/i18n.php:398
1529
+ msgid ""
1530
+ "We will do our best to whitelist your server and resolve this issue ASAP. "
1531
+ "You will get a follow-up email to %s once we have an update."
1532
+ 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."
1533
+
1534
+ #: includes/i18n.php:399
1535
+ msgid "Let's try your previous version"
1536
+ msgstr "Proviamo con la versione precedente"
1537
+
1538
+ #: includes/i18n.php:400
1539
+ msgid "Uninstall this version and install the previous one."
1540
+ msgstr "Disinstalla questa versione e installa quella precedente."
1541
+
1542
+ #: includes/i18n.php:401
1543
+ msgid "That's exhausting, please deactivate"
1544
+ msgstr "È estenuante, disattivalo"
1545
+
1546
+ #: includes/i18n.php:402
1547
+ msgid ""
1548
+ "We feel your frustration and sincerely apologize for the inconvenience. Hope"
1549
+ " to see you again in the future."
1550
+ msgstr "Capiamo la tua frustrazione e ci scusiamo per l'inconveniente. Speriamo di rivederti nuovamente in futuro."
1551
+
1552
+ #: includes/i18n.php:403
1553
+ msgid ""
1554
+ "Thank for giving us the chance to fix it! A message was just sent to our "
1555
+ "technical staff. We will get back to you as soon as we have an update to %s."
1556
+ " Appreciate your patience."
1557
+ 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."
1558
+
1559
+ #: includes/i18n.php:404
1560
+ msgctxt "%1s - plugin title, %2s - API domain"
1561
+ msgid ""
1562
+ "Your server is blocking the access to Freemius' API, which is crucial for "
1563
+ "%1s synchronization. Please contact your host to whitelist %2s"
1564
+ 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."
1565
+
1566
+ #: includes/i18n.php:406
1567
+ msgid ""
1568
+ "It seems like one of the authentication parameters is wrong. Update your "
1569
+ "Public Key, Secret Key & User ID, and try again."
1570
+ msgstr "Sembra che uno dei parametri di autenticazione sia sbagliato. Aggiorna la tua chiave pubblica, Secret Key & User ID e riprova."
1571
+
1572
+ #: includes/i18n.php:409
1573
+ msgid ""
1574
+ "Please check your mailbox, you should receive an email via %s to confirm the"
1575
+ " ownership change. From security reasons, you must confirm the change within"
1576
+ " the next 15 min. If you cannot find the email, please check your spam "
1577
+ "folder."
1578
+ 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."
1579
+
1580
+ #: includes/i18n.php:410
1581
+ msgid ""
1582
+ "Thanks for confirming the ownership change. An email was just sent to %s for"
1583
+ " final approval."
1584
+ msgstr "Grazie per aver confermato il cambiamento del proprietario. Un' email è stata appena inviata a %s per la conferma finale."
1585
+
1586
+ #: includes/i18n.php:411
1587
+ msgid "%s is the new owner of the account."
1588
+ msgstr "%s è il nuovo proprietario dell'account."
1589
+
1590
+ #: includes/i18n.php:413
1591
+ msgctxt "addonX cannot run without pluginY"
1592
+ msgid "%s cannot run without %s."
1593
+ msgstr "%s non può funzionare senza %s."
1594
+
1595
+ #: includes/i18n.php:415
1596
+ msgctxt "addonX cannot run..."
1597
+ msgid "%s cannot run without the plugin."
1598
+ msgstr "%s non può funzionare senza il plugin."
1599
+
1600
+ #: includes/i18n.php:416
1601
+ msgctxt "pluginX activation was successfully..."
1602
+ msgid "%s activation was successfully completed."
1603
+ msgstr "%s è stato attivato con successo."
1604
+
1605
+ #: includes/i18n.php:418
1606
+ msgctxt "Plugin installer section title"
1607
+ msgid "Features & Pricing"
1608
+ msgstr "Caratteristiche & prezzi"
1609
+
1610
+ #: includes/i18n.php:419
1611
+ msgid "Add-on must be deployed to WordPress.org or Freemius."
1612
+ msgstr "L'add-on dev'essere distribuito da WordPress.org o Freemius."
1613
+
1614
+ #: includes/i18n.php:420
1615
+ msgid "Paid add-on must be deployed to Freemius."
1616
+ msgstr "Gli add-on a pagamento devono essere distribuiti da Freemius."
1617
+
1618
+ #: includes/i18n.php:424
1619
+ msgid ""
1620
+ "%s is a premium only add-on. You have to purchase a license first before "
1621
+ "activating the plugin."
1622
+ msgstr "%s è un add-on premium. Devi comprare una licenza prima di poter attivare il plugin."
1623
+
1624
+ #: includes/i18n.php:425
1625
+ msgid ""
1626
+ "%s free trial was successfully cancelled. Since the add-on is premium only "
1627
+ "it was automatically deactivated. If you like to use it in the future, "
1628
+ "you'll have to purchase a license."
1629
+ 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."
1630
+
1631
+ #: includes/i18n.php:430
1632
+ msgctxt "as every month"
1633
+ msgid "Monthly"
1634
+ msgstr "Mensilmente"
1635
+
1636
+ #: includes/i18n.php:431
1637
+ msgctxt "as monthly period"
1638
+ msgid "mo"
1639
+ msgstr "mese"
1640
+
1641
+ #: includes/i18n.php:432
1642
+ msgctxt "as once a year"
1643
+ msgid "Annual"
1644
+ msgstr "Annuale"
1645
+
1646
+ #: includes/i18n.php:433
1647
+ msgctxt "as once a year"
1648
+ msgid "Annually"
1649
+ msgstr "Annualmente"
1650
+
1651
+ #: includes/i18n.php:434
1652
+ msgctxt "as once a year"
1653
+ msgid "Once"
1654
+ msgstr "Una volta"
1655
+
1656
+ #: includes/i18n.php:435
1657
+ msgctxt "as annual period"
1658
+ msgid "year"
1659
+ msgstr "anno"
1660
+
1661
+ #: includes/i18n.php:436
1662
+ msgid "Lifetime"
1663
+ msgstr "Tutta la vita"
1664
+
1665
+ #: includes/i18n.php:437
1666
+ msgctxt "e.g. the best product"
1667
+ msgid "Best"
1668
+ msgstr "Migliore"
1669
+
1670
+ #: includes/i18n.php:438
1671
+ msgctxt "e.g. billed monthly"
1672
+ msgid "Billed %s"
1673
+ msgstr "Fatturato %s"
1674
+
1675
+ #: includes/i18n.php:439
1676
+ msgctxt "as a discount of $5 or 10%"
1677
+ msgid "Save %s"
1678
+ msgstr "Risparmia %s"
1679
+
1680
+ #: includes/i18n.php:441
1681
+ msgid "View details"
1682
+ msgstr "Visualizza dettagli"
1683
+
1684
+ #: includes/i18n.php:445
1685
+ msgctxt "button label"
1686
+ msgid "Approve & Start Trial"
1687
+ msgstr "Approva e inizia il periodo di prova gratuito"
1688
+
1689
+ #: includes/i18n.php:447
1690
+ msgid ""
1691
+ "You are 1-click away from starting your %1$s-day free trial of the %2$s "
1692
+ "plan."
1693
+ msgstr "Sei a un clic di distanza dall'iniziare il tuo periodo di prova gratuito di %1$s giorni per il piano %2$s."
1694
+
1695
+ #: includes/i18n.php:449
1696
+ msgid ""
1697
+ "For compliance with the WordPress.org guidelines, before we start the trial "
1698
+ "we ask that you opt-in with your user and non-sensitive site information, "
1699
+ "allowing the plugin to periodically send data to %s to check for version "
1700
+ "updates and to validate your trial."
1701
+ 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."
1702
+
1703
+ #: includes/i18n.php:455
1704
+ msgid "Business name"
1705
+ msgstr "Nome della compagnia"
1706
+
1707
+ #: includes/i18n.php:456
1708
+ msgid "Tax / VAT ID"
1709
+ msgstr "Numero Partita Iva o VAT"
1710
+
1711
+ #: includes/i18n.php:457
1712
+ msgid "Address Line %d"
1713
+ msgstr "Riga indirizzo %d"
1714
+
1715
+ #: includes/i18n.php:458
1716
+ msgid "Country"
1717
+ msgstr "Nazione"
1718
+
1719
+ #: includes/i18n.php:459
1720
+ msgid "Select Country"
1721
+ msgstr "Seleziona Nazione"
1722
+
1723
+ #: includes/i18n.php:460
1724
+ msgid "City"
1725
+ msgstr "Città"
1726
+
1727
+ #: includes/i18n.php:461
1728
+ msgid "Town"
1729
+ msgstr "Cittadina"
1730
+
1731
+ #: includes/i18n.php:462
1732
+ msgid "State"
1733
+ msgstr "Stato"
1734
+
1735
+ #: includes/i18n.php:463
1736
+ msgid "Province"
1737
+ msgstr "Provincia"
1738
+
1739
+ #: includes/i18n.php:464
1740
+ msgid "ZIP / Postal Code"
1741
+ msgstr "CAP"
1742
+
1743
+ #: includes/i18n.php:479
1744
+ msgctxt "Plugin installer section title"
1745
+ msgid "Description"
1746
+ msgstr "Descrizione"
1747
+
1748
+ #: includes/i18n.php:480
1749
+ msgctxt "Plugin installer section title"
1750
+ msgid "Installation"
1751
+ msgstr "Installazione"
1752
+
1753
+ #: includes/i18n.php:481
1754
+ msgctxt "Plugin installer section title"
1755
+ msgid "FAQ"
1756
+ msgstr "FAQ"
1757
+
1758
+ #: includes/i18n.php:482
1759
+ msgctxt "Plugin installer section title"
1760
+ msgid "Changelog"
1761
+ msgstr "Changelog"
1762
+
1763
+ #: includes/i18n.php:483
1764
+ msgctxt "Plugin installer section title"
1765
+ msgid "Reviews"
1766
+ msgstr "Recensioni"
1767
+
1768
+ #: includes/i18n.php:484
1769
+ msgctxt "Plugin installer section title"
1770
+ msgid "Other Notes"
1771
+ msgstr "Altre note"
1772
+
1773
+ #: includes/i18n.php:486
1774
+ msgid "%s star"
1775
+ msgstr "%s stella"
1776
+
1777
+ #: includes/i18n.php:488
1778
+ msgid "%s stars"
1779
+ msgstr "%s stelle"
1780
+
1781
+ #: includes/i18n.php:490
1782
+ msgid "%s rating"
1783
+ msgstr "%s valutazione"
1784
+
1785
+ #: includes/i18n.php:492
1786
+ msgid "%s ratings"
1787
+ msgstr "%s valutazioni"
1788
+
1789
+ #: includes/i18n.php:494
1790
+ msgid "%s time"
1791
+ msgstr "% volta"
1792
+
1793
+ #: includes/i18n.php:496
1794
+ msgid "%s times"
1795
+ msgstr "%s volte"
1796
+
1797
+ #: includes/i18n.php:498
1798
+ msgid "Click to see reviews that provided a rating of %s"
1799
+ msgstr "Fai clic per vedere le recensioni che hanno fornito una valutazione di %s"
1800
+
1801
+ #: includes/i18n.php:499
1802
+ msgid "Last Updated"
1803
+ msgstr "Ultimo aggiornamento"
1804
+
1805
+ #: includes/i18n.php:500
1806
+ msgid "Requires WordPress Version:"
1807
+ msgstr "Richiede la versione di WordPress:"
1808
+
1809
+ #: includes/i18n.php:501
1810
+ msgctxt "as the plugin author"
1811
+ msgid "Author:"
1812
+ msgstr "Autore:"
1813
+
1814
+ #: includes/i18n.php:502
1815
+ msgid "Compatible up to:"
1816
+ msgstr "Compatibile fino a:"
1817
+
1818
+ #: includes/i18n.php:503
1819
+ msgid "Downloaded:"
1820
+ msgstr "Scaricato:"
1821
+
1822
+ #: includes/i18n.php:504
1823
+ msgid "WordPress.org Plugin Page"
1824
+ msgstr "Pagina dei plugin di WordPress.org"
1825
+
1826
+ #: includes/i18n.php:505
1827
+ msgid "Plugin Homepage"
1828
+ msgstr "Homepage del plugin"
1829
+
1830
+ #: includes/i18n.php:506
1831
+ msgid "Donate to this plugin"
1832
+ msgstr "Fai una donazione a questo plugin"
1833
+
1834
+ #: includes/i18n.php:507
1835
+ msgid "Average Rating"
1836
+ msgstr "Valutazione media"
1837
+
1838
+ #: includes/i18n.php:508
1839
+ msgid "based on %s"
1840
+ msgstr "basato su %s"
1841
+
1842
+ #: includes/i18n.php:509
1843
+ msgid "Warning:"
1844
+ msgstr "Avviso:"
1845
+
1846
+ #: includes/i18n.php:510
1847
+ msgid "Contributors"
1848
+ msgstr "Contributori"
1849
+
1850
+ #: includes/i18n.php:511
1851
+ msgid "Plugin Install"
1852
+ msgstr "Installazione del plugin"
1853
+
1854
+ #: includes/i18n.php:512
1855
+ msgid ""
1856
+ "This plugin has not been tested with your current version of WordPress."
1857
+ msgstr "Questo plugin non è stato testato con la versione corrente di WordPress."
1858
+
1859
+ #: includes/i18n.php:513
1860
+ msgid ""
1861
+ "This plugin has not been marked as compatible with your version of "
1862
+ "WordPress."
1863
+ msgstr "Questo plugin non è stato segnato come compatibile con la tua versione di WordPress."
1864
+
1865
+ #: includes/i18n.php:514
1866
+ msgid "Newer Version (%s) Installed"
1867
+ msgstr "Versione più recente (%s) installata"
1868
+
1869
+ #: includes/i18n.php:515
1870
+ msgid "Latest Version Installed"
1871
+ msgstr "Versione più recente installata"
freemius/languages/freemius-ja_JP.mo ADDED
Binary file
freemius/languages/freemius-ja_JP.po ADDED
@@ -0,0 +1,1662 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #
2
+ # Translators:
3
+ # Odyssey <8bitodyssey+github@gmail.com>, 2016
4
+ # Takayuki Miyauchi <miya0001@users.noreply.github.com>, 2016
5
+ msgid ""
6
+ msgstr ""
7
+ "Project-Id-Version: WordPress SDK\n"
8
+ "Report-Msgid-Bugs-To: \n"
9
+ "POT-Creation-Date: \n"
10
+ "PO-Revision-Date: 2017-02-28 03:42+0000\n"
11
+ "Last-Translator: Vova Feldman <vova@freemius.com>\n"
12
+ "Language-Team: Japanese (Japan) (http://www.transifex.com/freemius/wordpress-sdk/language/ja_JP/)\n"
13
+ "Content-Type: text/plain; charset=UTF-8\n"
14
+ "Content-Transfer-Encoding: \n"
15
+ "Language: ja_JP\n"
16
+ "Plural-Forms: nplurals=1; plural=0;\n"
17
+
18
+ # Copyright (C) 2017 freemius
19
+ # This file is distributed under the same license as the freemius package.
20
+ #: includes/i18n.php41, includes/i18n.php:55
21
+ msgid "Yes - I'm in!"
22
+ msgstr "加入します"
23
+
24
+ #: includes/i18n.php43, includes/i18n.php:57
25
+ msgid "Not today"
26
+ msgstr "今日はやめておく"
27
+
28
+ #: includes/i18n.php:69
29
+ msgid "Account"
30
+ msgstr "アカウント"
31
+
32
+ #: includes/i18n.php:71
33
+ msgid "Add On"
34
+ msgstr "アドオン"
35
+
36
+ #: includes/i18n.php:73
37
+ msgid "Contact Us"
38
+ msgstr "連絡"
39
+
40
+ #: includes/i18n.php:75
41
+ msgid "Contact Support"
42
+ msgstr "サポートに連絡"
43
+
44
+ #: includes/i18n.php:77
45
+ msgid "Change Ownership"
46
+ msgstr "オーナーを変更"
47
+
48
+ #: includes/i18n.php:79
49
+ msgid "Support"
50
+ msgstr "サポート"
51
+
52
+ #: includes/i18n.php:81
53
+ msgid "Support Forum"
54
+ msgstr "サポートフォーラム"
55
+
56
+ #: includes/i18n.php:83
57
+ msgid "Add Ons"
58
+ msgstr "アドオン"
59
+
60
+ #: includes/i18n.php:85
61
+ msgctxt "verb"
62
+ msgid "Upgrade"
63
+ msgstr "アップグレード"
64
+
65
+ #: includes/i18n.php:87
66
+ msgid "Awesome"
67
+ msgstr "すごい!"
68
+
69
+ #: includes/i18n.php:89
70
+ msgctxt "noun"
71
+ msgid "Pricing"
72
+ msgstr "料金表"
73
+
74
+ #: includes/i18n.php:91
75
+ msgctxt "noun"
76
+ msgid "Price"
77
+ msgstr "料金"
78
+
79
+ #: includes/i18n.php:93
80
+ msgid "Unlimited Updates"
81
+ msgstr "無制限のアップデート"
82
+
83
+ #: includes/i18n.php:95
84
+ msgctxt "verb"
85
+ msgid "Downgrade"
86
+ msgstr "ダウングレード"
87
+
88
+ #: includes/i18n.php:97
89
+ msgid "Cancel Trial"
90
+ msgstr "トライアルをキャンセル"
91
+
92
+ #: includes/i18n.php:99
93
+ msgid "Free Trial"
94
+ msgstr "フリートライアル"
95
+
96
+ #: includes/i18n.php:101
97
+ msgid "Start my free %s"
98
+ msgstr "無料の %s を開始"
99
+
100
+ #: includes/i18n.php:103
101
+ msgid "No commitment for %s - cancel anytime"
102
+ msgstr "%s の拘束はありません。いつでもキャンセルできます。"
103
+
104
+ #: includes/i18n.php:105
105
+ msgid "After your free %s, pay as little as %s"
106
+ msgstr "無料の %s の後は、わずか %s だけお支払ください。"
107
+
108
+ #: includes/i18n.php:107
109
+ msgid "Details"
110
+ msgstr "詳細"
111
+
112
+ #: includes/i18n.php:109
113
+ msgid "Account Details"
114
+ msgstr "アカウント詳細"
115
+
116
+ #: includes/i18n.php:111
117
+ msgctxt "verb"
118
+ msgid "Delete"
119
+ msgstr "削除"
120
+
121
+ #: includes/i18n.php:113
122
+ msgctxt "verb"
123
+ msgid "Show"
124
+ msgstr "表示"
125
+
126
+ #: includes/i18n.php:115
127
+ msgctxt "verb"
128
+ msgid "Hide"
129
+ msgstr "非表示"
130
+
131
+ #: includes/i18n.php:117
132
+ msgctxt "verb"
133
+ msgid "Edit"
134
+ msgstr "編集"
135
+
136
+ #: includes/i18n.php:119
137
+ msgctxt "verb"
138
+ msgid "Update"
139
+ msgstr "更新"
140
+
141
+ #: includes/i18n.php:121
142
+ msgid "Date"
143
+ msgstr "日付"
144
+
145
+ #: includes/i18n.php:123
146
+ msgid "Amount"
147
+ msgstr "総額"
148
+
149
+ #: includes/i18n.php:125
150
+ msgid "Invoice"
151
+ msgstr "請求書"
152
+
153
+ #: includes/i18n.php:127
154
+ msgid "Billing"
155
+ msgstr "請求書"
156
+
157
+ #: includes/i18n.php:129
158
+ msgid "Payments"
159
+ msgstr "支払い"
160
+
161
+ #: includes/i18n.php:131
162
+ msgid "Delete Account"
163
+ msgstr "アカウントを削除"
164
+
165
+ #: includes/i18n.php:133
166
+ msgctxt "as close a window"
167
+ msgid "Dismiss"
168
+ msgstr "却下"
169
+
170
+ #: includes/i18n.php:135
171
+ msgctxt "as product pricing plan"
172
+ msgid "Plan"
173
+ msgstr "プラン"
174
+
175
+ #: includes/i18n.php:137
176
+ msgid "Change Plan"
177
+ msgstr "プラン変更"
178
+
179
+ #: includes/i18n.php:139
180
+ msgctxt "as download professional version"
181
+ msgid "Download %s Version"
182
+ msgstr "%s バージョンをダウンロード"
183
+
184
+ #: includes/i18n.php:141
185
+ msgctxt "as download professional version now"
186
+ msgid "Download %s version now"
187
+ msgstr "%s バージョンを今すぐダウンロード"
188
+
189
+ #: includes/i18n.php:145
190
+ msgctxt "as download latest version"
191
+ msgid "Download Latest"
192
+ msgstr "最新版をダウンロード"
193
+
194
+ #: includes/i18n.php:147
195
+ msgctxt "E.g. you have a professional license."
196
+ msgid "You have a %s license."
197
+ msgstr "%s ライセンスを持っています。"
198
+
199
+ #: includes/i18n.php:151
200
+ msgid "New"
201
+ msgstr "新規"
202
+
203
+ #: includes/i18n.php:153
204
+ msgid "Free"
205
+ msgstr "無料"
206
+
207
+ #: includes/i18n.php:155
208
+ msgctxt "as trial plan"
209
+ msgid "Trial"
210
+ msgstr "トライアル"
211
+
212
+ #: includes/i18n.php:157
213
+ msgctxt "as starting a trial plan"
214
+ msgid "Start Trial"
215
+ msgstr "トライアルを開始"
216
+
217
+ #: includes/i18n.php:159
218
+ msgctxt "verb"
219
+ msgid "Purchase"
220
+ msgstr "購入"
221
+
222
+ #: includes/i18n.php:161
223
+ msgid "Purchase License"
224
+ msgstr "ライセンスを購入"
225
+
226
+ #: includes/i18n.php:163
227
+ msgctxt "verb"
228
+ msgid "Buy"
229
+ msgstr "買う"
230
+
231
+ #: includes/i18n.php:165
232
+ msgid "Buy License"
233
+ msgstr "ライセンスを買う"
234
+
235
+ #: includes/i18n.php:167
236
+ msgid "Single Site License"
237
+ msgstr "シングルサイトライセンス"
238
+
239
+ #: includes/i18n.php:169
240
+ msgid "Unlimited Licenses"
241
+ msgstr "無制限ライセンス"
242
+
243
+ #: includes/i18n.php:171
244
+ msgid "Up to %s Sites"
245
+ msgstr "%sサイトまで"
246
+
247
+ #: includes/i18n.php:173
248
+ msgid "%sRenew your license now%s to access version %s features and support."
249
+ msgstr "%sいますぐライセンスを更新して%s バージョン %s の機能とサポートにアクセスする"
250
+
251
+ #: includes/i18n.php:177
252
+ msgid ""
253
+ "Enter the email address you've used for the upgrade below and we will resend"
254
+ " you the license key."
255
+ msgstr "アップグレードに使用したメールアドレスを下に入力してください。そうすれば、ライセンスキーをお送りします。"
256
+
257
+ #: includes/i18n.php:181
258
+ msgctxt "e.g. Professional Plan"
259
+ msgid "%s Plan"
260
+ msgstr "%s プラン"
261
+
262
+ #: includes/i18n.php:183
263
+ msgid "You are just one step away - %s"
264
+ msgstr "もうあとわずかです - %s"
265
+
266
+ #: includes/i18n.php:185
267
+ msgctxt "%s - plugin name. As complete \"Jetpack\" activation now"
268
+ msgid "Complete \"%s\" Activation Now"
269
+ msgstr "すぐに \"%s\" 有効化を完了してください"
270
+
271
+ #: includes/i18n.php:189
272
+ msgid "We made a few tweaks to the plugin, %s"
273
+ msgstr "プラグインを微調整します, %s"
274
+
275
+ #: includes/i18n.php:191
276
+ msgid "Opt-in to make \"%s\" Better!"
277
+ msgstr "\"%s\" をより良くするためにオプトインしてください!"
278
+
279
+ #: includes/i18n.php:193
280
+ msgid "Error"
281
+ msgstr "エラー"
282
+
283
+ #: includes/i18n.php:195
284
+ msgid ""
285
+ "Freemius SDK couldn't find the plugin's main file. Please contact "
286
+ "sdk@freemius.com with the current error."
287
+ msgstr "Freemius SDK がプラグインのメインファイルを見つけることができませんでした。現在のエラーを添えて sdk@freemius.com に連絡してください。"
288
+
289
+ #: includes/i18n.php:203
290
+ msgctxt "as expiration date"
291
+ msgid "Expiration"
292
+ msgstr "期限切れ"
293
+
294
+ #: includes/i18n.php:205
295
+ msgctxt "as software license"
296
+ msgid "License"
297
+ msgstr "ライセンス"
298
+
299
+ #: includes/i18n.php:207
300
+ msgid "not verified"
301
+ msgstr "未認証"
302
+
303
+ #: includes/i18n.php:209
304
+ msgid "Verify Email"
305
+ msgstr "認証メール"
306
+
307
+ #: includes/i18n.php:211
308
+ msgctxt "e.g. expires in 2 months"
309
+ msgid "Expires in %s"
310
+ msgstr "%s で期間終了"
311
+
312
+ #: includes/i18n.php:213
313
+ msgctxt "e.g. auto renews in 2 months"
314
+ msgid "Auto renews in %s"
315
+ msgstr "%s に自動更新"
316
+
317
+ #: includes/i18n.php:215
318
+ msgid "No expiration"
319
+ msgstr "有効期限なし"
320
+
321
+ #: includes/i18n.php:217
322
+ msgid "Expired"
323
+ msgstr "期限切れ"
324
+
325
+ #: includes/i18n.php:219
326
+ msgid "Cancelled"
327
+ msgstr "キャンセル"
328
+
329
+ #: includes/i18n.php:221
330
+ msgctxt "e.g. In 2 hours"
331
+ msgid "In %s"
332
+ msgstr "%s 内"
333
+
334
+ #: includes/i18n.php:223
335
+ msgctxt "e.g. 2 min ago"
336
+ msgid "%s ago"
337
+ msgstr "%s 前"
338
+
339
+ #: includes/i18n.php:225
340
+ msgctxt "as plugin version"
341
+ msgid "Version"
342
+ msgstr "バージョン"
343
+
344
+ #: includes/i18n.php:227
345
+ msgid "Name"
346
+ msgstr "名前"
347
+
348
+ #: includes/i18n.php:229
349
+ msgid "Email"
350
+ msgstr "Email"
351
+
352
+ #: includes/i18n.php:231
353
+ msgid "Email address"
354
+ msgstr "メールアドレス"
355
+
356
+ #: includes/i18n.php:233
357
+ msgid "Verified"
358
+ msgstr "認証済み"
359
+
360
+ #: includes/i18n.php:235
361
+ msgid "Plugin"
362
+ msgstr "プラグイン"
363
+
364
+ #: includes/i18n.php:237
365
+ msgid "Plugins"
366
+ msgstr "プラグイン"
367
+
368
+ #: includes/i18n.php:239
369
+ msgid "Themes"
370
+ msgstr "テーマ"
371
+
372
+ #: includes/i18n.php:241
373
+ msgctxt "as file/folder path"
374
+ msgid "Path"
375
+ msgstr "パス"
376
+
377
+ #: includes/i18n.php:243
378
+ msgid "Title"
379
+ msgstr "タイトル"
380
+
381
+ #: includes/i18n.php:245
382
+ msgid "Free version"
383
+ msgstr "フリーバージョン"
384
+
385
+ #: includes/i18n.php:247
386
+ msgid "Premium version"
387
+ msgstr "プレミアムバージョン"
388
+
389
+ #: includes/i18n.php:249
390
+ msgctxt "as WP plugin slug"
391
+ msgid "Slug"
392
+ msgstr "スラッグ"
393
+
394
+ #: includes/i18n.php:251
395
+ msgid "ID"
396
+ msgstr "ID"
397
+
398
+ #: includes/i18n.php:253
399
+ msgid "Users"
400
+ msgstr "ユーザー"
401
+
402
+ #: includes/i18n.php:255
403
+ msgid "Plugin Installs"
404
+ msgstr "プラグインインストール数"
405
+
406
+ #: includes/i18n.php:257
407
+ msgctxt "like websites"
408
+ msgid "Sites"
409
+ msgstr "サイト数"
410
+
411
+ #: includes/i18n.php:259
412
+ msgid "User ID"
413
+ msgstr "ユーザー ID"
414
+
415
+ #: includes/i18n.php:261
416
+ msgid "Site ID"
417
+ msgstr "サイト ID"
418
+
419
+ #: includes/i18n.php:263
420
+ msgid "Public Key"
421
+ msgstr "公開鍵"
422
+
423
+ #: includes/i18n.php:265
424
+ msgid "Secret Key"
425
+ msgstr "秘密鍵"
426
+
427
+ #: includes/i18n.php:267
428
+ msgctxt "as secret encryption key missing"
429
+ msgid "No Secret"
430
+ msgstr "秘密鍵がありません"
431
+
432
+ #: includes/i18n.php:269
433
+ msgid "No ID"
434
+ msgstr "ID がありません"
435
+
436
+ #: includes/i18n.php:271
437
+ msgctxt "as synchronize license"
438
+ msgid "Sync License"
439
+ msgstr "ライセンスを同期"
440
+
441
+ #: includes/i18n.php:273
442
+ msgctxt "as synchronize"
443
+ msgid "Sync"
444
+ msgstr "同期"
445
+
446
+ #: includes/i18n.php:275
447
+ msgid "Activate License"
448
+ msgstr "ライセンスを有効化"
449
+
450
+ #: includes/i18n.php:277
451
+ msgid "Activate Free Version"
452
+ msgstr "フリーバージョンを有効化"
453
+
454
+ #: includes/i18n.php:279
455
+ msgid ""
456
+ "Please enter the license key that you received in the email right after the "
457
+ "purchase:"
458
+ msgstr "購入後すぐにメールで受け取ったライセンスキーを入力してください:"
459
+
460
+ #: includes/i18n.php:283
461
+ msgid "Activating license..."
462
+ msgstr "ライセンスを有効化中…"
463
+
464
+ #: includes/i18n.php:285
465
+ msgid "Change License"
466
+ msgstr "ライセンスを変更"
467
+
468
+ #: includes/i18n.php:287
469
+ msgid "Update License"
470
+ msgstr "ライセンスを更新"
471
+
472
+ #: includes/i18n.php:289
473
+ msgid "Deactivate License"
474
+ msgstr "ライセンスを無効化"
475
+
476
+ #: includes/i18n.php:291
477
+ msgid "Activate"
478
+ msgstr "有効化"
479
+
480
+ #: includes/i18n.php:293
481
+ msgid "Deactivate"
482
+ msgstr "無効化"
483
+
484
+ #: includes/i18n.php:295
485
+ msgid "Skip & Deactivate"
486
+ msgstr "スキップし、無効化"
487
+
488
+ #: includes/i18n.php:297
489
+ msgid "No - just deactivate"
490
+ msgstr "いいえ - すぐに無効化"
491
+
492
+ #: includes/i18n.php:299
493
+ msgid "Yes - do your thing"
494
+ msgstr "はい - お構いなく"
495
+
496
+ #: includes/i18n.php:301
497
+ msgctxt "active mode"
498
+ msgid "Active"
499
+ msgstr "有効"
500
+
501
+ #: includes/i18n.php:303
502
+ msgctxt "is active mode?"
503
+ msgid "Is Active"
504
+ msgstr "有効"
505
+
506
+ #: includes/i18n.php:305
507
+ msgid "Install Now"
508
+ msgstr "今すぐインストール"
509
+
510
+ #: includes/i18n.php:307
511
+ msgid "Install Update Now"
512
+ msgstr "今すぐ更新をインストール"
513
+
514
+ #: includes/i18n.php:309
515
+ msgid "More information about %s"
516
+ msgstr "%s に関する詳細情報"
517
+
518
+ #: includes/i18n.php:311
519
+ msgid "Localhost"
520
+ msgstr "localhost"
521
+
522
+ #: includes/i18n.php:313
523
+ msgctxt "as activate Professional plan"
524
+ msgid "Activate %s Plan"
525
+ msgstr "%s プランを有効化"
526
+
527
+ #: includes/i18n.php:315
528
+ msgctxt "as 5 licenses left"
529
+ msgid "%s left"
530
+ msgstr "あと %s"
531
+
532
+ #: includes/i18n.php:317
533
+ msgid "Last license"
534
+ msgstr "最新のライセンス"
535
+
536
+ #: includes/i18n.php:319
537
+ msgid "What is your %s?"
538
+ msgstr "自分の %s はなんですか?"
539
+
540
+ #: includes/i18n.php:321
541
+ msgid "Activate this add-on"
542
+ msgstr "このアドオンを有効化"
543
+
544
+ #: includes/i18n.php:323
545
+ msgid ""
546
+ "Deactivating your license will block all premium features, but will enable "
547
+ "you to activate the license on another site. Are you sure you want to "
548
+ "proceed?"
549
+ msgstr "ライセンスを無効化するとすべてのプレミアム機能が使えなくなりますが、他のサイトでライセンスを有効にすることができるようになります。本当に実行しますか?"
550
+
551
+ #: includes/i18n.php:327
552
+ msgid ""
553
+ "Deleting the account will automatically deactivate your %s plan license so "
554
+ "you can use it on other sites. If you want to terminate the recurring "
555
+ "payments as well, click the \"Cancel\" button, and first \"Downgrade\" your "
556
+ "account. Are you sure you would like to continue with the deletion?"
557
+ msgstr "アカウントを削除すると自動的に %s プランライセンスが無効になり、他のサイトで使うことができます。定期の支払いも終了したい場合は、\"キャンセル\"ボタンをクリックし、まずアカウントを\"ダウングレード\"してください。本当に削除を続行してもいいですか?"
558
+
559
+ #: includes/i18n.php:331
560
+ msgid ""
561
+ "Deletion is not temporary. Only delete if you no longer want to use this "
562
+ "plugin anymore. Are you sure you would like to continue with the deletion?"
563
+ msgstr "削除は一時的なものではありません。このプラグインを今後使いたくない場合にだけ削除してください。本当に削除を続行してもいいですか?"
564
+
565
+ #: includes/i18n.php:335
566
+ msgid ""
567
+ "Downgrading your plan will immediately stop all future recurring payments "
568
+ "and your %s plan license will expire in %s."
569
+ msgstr "プランをダウングレードするとすぐに将来の定期の支払いはすべて停止し、%s プランライセンスは %s で期限切れとなります。"
570
+
571
+ #: includes/i18n.php:339
572
+ msgid ""
573
+ "Cancelling the trial will immediately block access to all premium features. "
574
+ "Are you sure?"
575
+ msgstr "トライアルをキャンセルするとすぐにすべてのプレミアム機能へのアクセスができなくなります。本当に実行しますか?"
576
+
577
+ #: includes/i18n.php:343
578
+ msgid ""
579
+ "You can still enjoy all %s features but you will not have access to plugin "
580
+ "updates and support."
581
+ msgstr "すべての %s 機能をまだ楽しむことができますが、プラグインの更新とサポートにアクセスすることはできなくなります。"
582
+
583
+ #: includes/i18n.php:347
584
+ msgid ""
585
+ "Once your license expire you can still use the Free version but you will NOT"
586
+ " have access to the %s features."
587
+ msgstr "ライセンスが期限切れになるとフリーバージョンを使うことはできますが、%s 機能にアクセスすることはできなくなります。"
588
+
589
+ #: includes/i18n.php:351
590
+ msgid "Are you sure you want to proceed?"
591
+ msgstr "本当に続行していいですか?"
592
+
593
+ #: includes/i18n.php:357
594
+ msgid "Add Ons for %s"
595
+ msgstr "%s のアドオン"
596
+
597
+ #: includes/i18n.php:359
598
+ msgid ""
599
+ "We could'nt load the add-ons list. It's probably an issue on our side, "
600
+ "please try to come back in few minutes."
601
+ msgstr "アドオンリストを読み込むことができませんでした。おそらく運営側の問題になりますので、しばらくしてからお試しください。"
602
+
603
+ #: includes/i18n.php:365
604
+ msgid "Anonymous feedback"
605
+ msgstr "匿名のフィードバック"
606
+
607
+ #: includes/i18n.php:367
608
+ msgid "Quick feedback"
609
+ msgstr "クイックフィードバック"
610
+
611
+ #: includes/i18n.php:369
612
+ msgid "If you have a moment, please let us know why you are deactivating"
613
+ msgstr "お時間があれば、なぜ無効化するのか理由を教えてください。"
614
+
615
+ #: includes/i18n.php:373
616
+ msgid "Yes - Deactivate"
617
+ msgstr "はい - 無効化します"
618
+
619
+ #: includes/i18n.php:375
620
+ msgid "Submit & Deactivate"
621
+ msgstr "送信し無効化"
622
+
623
+ #: includes/i18n.php:377
624
+ msgid "Cancel"
625
+ msgstr "キャンセル"
626
+
627
+ #: includes/i18n.php:379
628
+ msgid "I no longer need the plugin"
629
+ msgstr "もうプラグインを必要としていません"
630
+
631
+ #: includes/i18n.php:381
632
+ msgid "I found a better plugin"
633
+ msgstr "もっと良いプラグインを見つけました"
634
+
635
+ #: includes/i18n.php:383
636
+ msgid "I only needed the plugin for a short period"
637
+ msgstr "短期間プラグインを必要としていただけです"
638
+
639
+ #: includes/i18n.php:385
640
+ msgid "The plugin broke my site"
641
+ msgstr "プラグインのせいでサイトが壊れました"
642
+
643
+ #: includes/i18n.php:387
644
+ msgid "The plugin suddenly stopped working"
645
+ msgstr "プラグインはすぐに動かなくなりました"
646
+
647
+ #: includes/i18n.php:389
648
+ msgid "I can't pay for it anymore"
649
+ msgstr "もう払うことができません"
650
+
651
+ #: includes/i18n.php:391
652
+ msgid "It's a temporary deactivation. I'm just debugging an issue."
653
+ msgstr "一時的な無効化です。問題をデバッグしているだけです。"
654
+
655
+ #: includes/i18n.php:395
656
+ msgctxt ""
657
+ "the text of the \"other\" reason for deactivating the plugin that is shown "
658
+ "in the modal box."
659
+ msgid "Other"
660
+ msgstr "その他"
661
+
662
+ #: includes/i18n.php:399
663
+ msgid "Kindly tell us the reason so we can improve."
664
+ msgstr "改善できるよう、どうか理由を教えてください。"
665
+
666
+ #: includes/i18n.php:401
667
+ msgid "What's the plugin's name?"
668
+ msgstr "プラグイン名は何ですか?"
669
+
670
+ #: includes/i18n.php:403
671
+ msgid "What price would you feel comfortable paying?"
672
+ msgstr " 支払ってもよいと思う価格はいくらですか?"
673
+
674
+ #: includes/i18n.php:405
675
+ msgid "I couldn't understand how to make it work"
676
+ msgstr "どうしたら動作するか分かりませんでした。"
677
+
678
+ #: includes/i18n.php:407
679
+ msgid ""
680
+ "The plugin is great, but I need specific feature that you don't support"
681
+ msgstr "プラグインは素晴らしいけれど、サポートしていないある機能を必要としています"
682
+
683
+ #: includes/i18n.php:411
684
+ msgid "The plugin is not working"
685
+ msgstr "プラグインが動いていません"
686
+
687
+ #: includes/i18n.php:413
688
+ msgid "It's not what I was looking for"
689
+ msgstr "探していたものではありません"
690
+
691
+ #: includes/i18n.php:415
692
+ msgid "The plugin didn't work as expected"
693
+ msgstr "プラグインは期待通りには動きませんでした"
694
+
695
+ #: includes/i18n.php:417
696
+ msgid "What feature?"
697
+ msgstr "何の機能ですか?"
698
+
699
+ #: includes/i18n.php:419
700
+ msgid "Kindly share what didn't work so we can fix it for future users..."
701
+ msgstr "将来のユーザーのために修正できるよう、何が動作しなかったのかどうか共有してください…"
702
+
703
+ #: includes/i18n.php:423
704
+ msgid "What you've been looking for?"
705
+ msgstr "探していたのは何ですか?"
706
+
707
+ #: includes/i18n.php:425
708
+ msgid "What did you expect?"
709
+ msgstr "何を期待していましたか?"
710
+
711
+ #: includes/i18n.php:427
712
+ msgid "The plugin didn't work"
713
+ msgstr "プラグインが動作しませんでした"
714
+
715
+ #: includes/i18n.php:429
716
+ msgid "I don't like to share my information with you"
717
+ msgstr "自分の情報を共有したくありません"
718
+
719
+ #: includes/i18n.php:431
720
+ msgid ""
721
+ "You might have missed it, but you don't have to share any data and can just "
722
+ "%s the opt-in."
723
+ msgstr "見逃していたかもしれませんが、どんな情報も共有する必要はなく、オプトインを $s することができます。 "
724
+
725
+ #: includes/i18n.php:441
726
+ msgctxt "greeting"
727
+ msgid "Hey %s,"
728
+ msgstr "おおい %s さん、"
729
+
730
+ #: includes/i18n.php:443
731
+ msgctxt "a greeting. E.g. Thanks John!"
732
+ msgid "Thanks %s!"
733
+ msgstr "ありがとう $s さん!"
734
+
735
+ #: includes/i18n.php:445
736
+ msgid ""
737
+ "Never miss an important update - opt-in to our security and feature updates "
738
+ "notifications, and non-sensitive diagnostic tracking with %4$s."
739
+ msgstr "重要な更新を逃さないように - セキュリティとおすすめの更新通知、%4$s とセンシティブではない診断トラッキングをオプトイン"
740
+
741
+ #: includes/i18n.php:449
742
+ msgid ""
743
+ "Please help us improve %1$s! If you opt-in, some data about your usage of "
744
+ "%1$s will be sent to %4$s. If you skip this, that's okay! %1$s will still "
745
+ "work just fine."
746
+ msgstr "%1$s を改善するのを手伝ってください。オプトインすれば、あなたの %1$s の使用に関するデータが %4$s へと送られます。これをスキップしても大丈夫です! %1$s は今でも素晴らしいでしょう。"
747
+
748
+ #: includes/i18n.php:453
749
+ msgid ""
750
+ "You should receive an activation email for %s to your mailbox at %s. Please "
751
+ "make sure you click the activation button in that email to %s."
752
+ msgstr "%s のメールボックスに %s の有効化のメールを受け取っているはずです。%s のメールに記載された有効化ボタンをクリックしてください。"
753
+
754
+ #: includes/i18n.php:455
755
+ msgid "complete the install"
756
+ msgstr "インストールを完了"
757
+
758
+ #: includes/i18n.php:457
759
+ msgid "start the trial"
760
+ msgstr "トライアルを開始"
761
+
762
+ #: includes/i18n.php:459
763
+ msgid ""
764
+ "Thanks for purchasing %s! To get started, please enter your license key:"
765
+ msgstr "%s を購入いただきありがとうございます。はじめにライセンスキーを入力してください:"
766
+
767
+ #: includes/i18n.php:463
768
+ msgid ""
769
+ "The plugin will be periodically sending data to %s to check for plugin "
770
+ "updates and verify the validity of your license."
771
+ msgstr "プラグインはプラグインの更新をチェックし、ライセンスが有効か確認するために、%s に周期的にデータを送信します。"
772
+
773
+ #: includes/i18n.php:467
774
+ msgid "What permissions are being granted?"
775
+ msgstr "付与されているパーミッションは何ですか?"
776
+
777
+ #: includes/i18n.php:469
778
+ msgid "Your Profile Overview"
779
+ msgstr "プロフィール概要"
780
+
781
+ #: includes/i18n.php:471
782
+ msgid "Name and email address"
783
+ msgstr "名前とメールアドレス"
784
+
785
+ #: includes/i18n.php:473
786
+ msgid "Your Site Overview"
787
+ msgstr "サイト概要"
788
+
789
+ #: includes/i18n.php:475
790
+ msgid "Site URL, WP version, PHP info, plugins & themes"
791
+ msgstr "サイト URL、WP バージョン、PHP info、プラグインとテーマ"
792
+
793
+ #: includes/i18n.php:479
794
+ msgid "Current Plugin Events"
795
+ msgstr "現在のプラグインイベント"
796
+
797
+ #: includes/i18n.php:481
798
+ msgid "Activation, deactivation and uninstall"
799
+ msgstr "有効化、無効化、アンインストール"
800
+
801
+ #: includes/i18n.php:483
802
+ msgid "Plugins & Themes"
803
+ msgstr "プラグインとテーマ"
804
+
805
+ #: includes/i18n.php:485
806
+ msgid "Titles, versions and state."
807
+ msgstr "タイトル、バージョン、状態"
808
+
809
+ #: includes/i18n.php:487
810
+ msgid "Admin Notices"
811
+ msgstr "管理者通知"
812
+
813
+ #: includes/i18n.php:489
814
+ msgid "Newsletter"
815
+ msgstr "ニュースレター"
816
+
817
+ #: includes/i18n.php:491
818
+ msgid "Updates, announcements, marketing, no spam"
819
+ msgstr "更新、発表、マーケティング、スパムなし"
820
+
821
+ #: includes/i18n.php:493
822
+ msgid "Privacy Policy"
823
+ msgstr "プライバシーポリシー"
824
+
825
+ #: includes/i18n.php:495
826
+ msgid "Terms of Service"
827
+ msgstr "利用規約"
828
+
829
+ #: includes/i18n.php:497
830
+ msgctxt "as activating plugin"
831
+ msgid "Activating"
832
+ msgstr "有効化中"
833
+
834
+ #: includes/i18n.php:499
835
+ msgctxt "as in the process of sending an email"
836
+ msgid "Sending email"
837
+ msgstr "メール送信中"
838
+
839
+ #: includes/i18n.php:503
840
+ msgctxt "button label"
841
+ msgid "Allow & Continue"
842
+ msgstr "許可して続ける"
843
+
844
+ #: includes/i18n.php:505
845
+ msgctxt "button label"
846
+ msgid "Agree & Activate License"
847
+ msgstr "同意してライセンスを有効化"
848
+
849
+ #: includes/i18n.php:507
850
+ msgctxt "verb"
851
+ msgid "Skip"
852
+ msgstr "スキップ"
853
+
854
+ #: includes/i18n.php:509
855
+ msgid "Click here to use the plugin anonymously"
856
+ msgstr "匿名でプラグインを使用するにはこちらをクリック"
857
+
858
+ #: includes/i18n.php:511
859
+ msgid "Re-send activation email"
860
+ msgstr "有効化メールを再送信"
861
+
862
+ #: includes/i18n.php:513
863
+ msgid "License key"
864
+ msgstr "ライセンスキー"
865
+
866
+ #: includes/i18n.php:515
867
+ msgid "Send License Key"
868
+ msgstr "ライセンスキーを送信"
869
+
870
+ #: includes/i18n.php:517
871
+ msgid "Sending license key"
872
+ msgstr "ライセンスキーを送信中"
873
+
874
+ #: includes/i18n.php:519
875
+ msgid "Have a license key?"
876
+ msgstr "ライセンスキーはお持ちですか?"
877
+
878
+ #: includes/i18n.php:521
879
+ msgid "Don't have a license key?"
880
+ msgstr "ライセンスキーをお持ちではありませんか?"
881
+
882
+ #: includes/i18n.php:523
883
+ msgid "Can't find your license key?"
884
+ msgstr "ライセンスキーは見つかりませんか?"
885
+
886
+ #: includes/i18n.php:525
887
+ msgid ""
888
+ "We couldn't find your email address in the system, are you sure it's the "
889
+ "right address?"
890
+ msgstr "システムではメールアドレスを見つけることができませんでした。メールアドレスが正しいか確認してください。"
891
+
892
+ #: includes/i18n.php:529
893
+ msgid ""
894
+ "We can't see any active licenses associated with that email address, are you"
895
+ " sure it's the right address?"
896
+ msgstr "メールアドレスに関連付けられた有効なライセンスが見つかりません。メールアドレスが正しいか確認してください。"
897
+
898
+ #: includes/i18n.php:533
899
+ msgid "Opt In"
900
+ msgstr "オプトイン"
901
+
902
+ #: includes/i18n.php:535
903
+ msgid "Opt Out"
904
+ msgstr "オプトアウト"
905
+
906
+ #: includes/i18n.php:537
907
+ msgid "On second thought - I want to continue helping"
908
+ msgstr "第二の考えで - 手伝い続けたいです"
909
+
910
+ #: includes/i18n.php:541
911
+ msgid "Opting out..."
912
+ msgstr "オプトアウト中…"
913
+
914
+ #: includes/i18n.php:543
915
+ msgid "Opting in..."
916
+ msgstr "オプトイン中…"
917
+
918
+ #: includes/i18n.php:545
919
+ msgid ""
920
+ "We appreciate your help in making the %s better by letting us track some "
921
+ "usage data."
922
+ msgstr "使用データを追跡できるよう許可してくれたことで、%s をより良くするための手助けに感謝致します。"
923
+
924
+ #: includes/i18n.php:549
925
+ msgid ""
926
+ "Usage tracking is done in the name of making %s better. Making a better user"
927
+ " experience, prioritizing new features, and more good things. We'd really "
928
+ "appreciate if you'll reconsider letting us continue with the tracking."
929
+ msgstr "使用の追跡は %s をより良くする名目の下に行われています。ユーザー体験をより良くし、新機能に優先順位をつけるためなどに使います。追跡を続けてもよいと再考してくれるなら本当に感謝致します。"
930
+
931
+ #: includes/i18n.php:553
932
+ msgid ""
933
+ "By clicking \"Opt Out\", we will no longer be sending any data from %s to "
934
+ "%s."
935
+ msgstr "\"オプトアウト\"をクリックすることで、もう %s から %s へのデータの送信は行いません。"
936
+
937
+ #: includes/i18n.php:563
938
+ msgid "Screenshots"
939
+ msgstr "スクリーンショット"
940
+
941
+ #: includes/i18n.php:565
942
+ msgid "Click to view full-size screenshot %d"
943
+ msgstr "クリックしてフルサイズのスクリーンショットを見る %d"
944
+
945
+ #: includes/i18n.php:573
946
+ msgid "Freemius Debug"
947
+ msgstr "Freemius デバッグ"
948
+
949
+ #: includes/i18n.php:575
950
+ msgctxt "as turned on"
951
+ msgid "On"
952
+ msgstr "オン"
953
+
954
+ #: includes/i18n.php:577
955
+ msgctxt "as turned off"
956
+ msgid "Off"
957
+ msgstr "オフ"
958
+
959
+ #: includes/i18n.php:579
960
+ msgctxt "as code debugging"
961
+ msgid "Debugging"
962
+ msgstr "デバッグ"
963
+
964
+ #: includes/i18n.php:581
965
+ msgid "Freemius State"
966
+ msgstr "Freemius ステータス"
967
+
968
+ #: includes/i18n.php:583
969
+ msgctxt "as connection was successful"
970
+ msgid "Connected"
971
+ msgstr "接続"
972
+
973
+ #: includes/i18n.php:585
974
+ msgctxt "as connection blocked"
975
+ msgid "Blocked"
976
+ msgstr "ブロック"
977
+
978
+ #: includes/i18n.php:587
979
+ msgctxt "as application program interface"
980
+ msgid "API"
981
+ msgstr "API"
982
+
983
+ #: includes/i18n.php:589
984
+ msgctxt "as software development kit versions"
985
+ msgid "SDK"
986
+ msgstr "SDK"
987
+
988
+ #: includes/i18n.php:591
989
+ msgctxt "as software development kit versions"
990
+ msgid "SDK Versions"
991
+ msgstr "SDK バージョン"
992
+
993
+ #: includes/i18n.php:595
994
+ msgctxt "as plugin folder path"
995
+ msgid "Plugin Path"
996
+ msgstr "プラグインのパス"
997
+
998
+ #: includes/i18n.php:597
999
+ msgctxt "as sdk path"
1000
+ msgid "SDK Path"
1001
+ msgstr "SDK のパス"
1002
+
1003
+ #: includes/i18n.php:599
1004
+ msgid "Add Ons of Plugin %s"
1005
+ msgstr "プラグインのアドオン %s"
1006
+
1007
+ #: includes/i18n.php:601
1008
+ msgid "Are you sure you want to delete all Freemius data?"
1009
+ msgstr "ほんとうに全ての Freemius データを削除しますか?"
1010
+
1011
+ #: includes/i18n.php:605
1012
+ msgid "Actions"
1013
+ msgstr "アクション"
1014
+
1015
+ #: includes/i18n.php:607
1016
+ msgid "Delete All Accounts"
1017
+ msgstr "全てのアカウントを削除"
1018
+
1019
+ #: includes/i18n.php:609
1020
+ msgid "Start Fresh"
1021
+ msgstr "初期化を開始"
1022
+
1023
+ #: includes/i18n.php:611
1024
+ msgid "Clear API Cache"
1025
+ msgstr "API キャッシュをクリア"
1026
+
1027
+ #: includes/i18n.php:613
1028
+ msgid "Sync Data From Server"
1029
+ msgstr "サーバーからのデータを同期"
1030
+
1031
+ #: includes/i18n.php:615
1032
+ msgid "Scheduled Crons"
1033
+ msgstr "スケジュール Cron"
1034
+
1035
+ #: includes/i18n.php:617
1036
+ msgid "Plugins & Themes Sync"
1037
+ msgstr "プラグインとテーマを同期"
1038
+
1039
+ #: includes/i18n.php:625
1040
+ msgctxt "as congratulations"
1041
+ msgid "Congrats"
1042
+ msgstr "おめでとう"
1043
+
1044
+ #: includes/i18n.php:627
1045
+ msgctxt "exclamation"
1046
+ msgid "Oops"
1047
+ msgstr "おっと"
1048
+
1049
+ #: includes/i18n.php:629
1050
+ msgctxt "interjection expressing joy or exuberance"
1051
+ msgid "Yee-haw"
1052
+ msgstr "ヤッホー"
1053
+
1054
+ #: includes/i18n.php:633
1055
+ msgctxt ""
1056
+ "(especially in electronic communication) used to express elation, "
1057
+ "enthusiasm, or triumph."
1058
+ msgid "W00t"
1059
+ msgstr "やったー"
1060
+
1061
+ #: includes/i18n.php:637
1062
+ msgctxt "a positive response"
1063
+ msgid "Right on"
1064
+ msgstr "そうだ"
1065
+
1066
+ #: includes/i18n.php:639
1067
+ msgctxt ""
1068
+ "something somebody says when they are thinking about what you have just "
1069
+ "said. "
1070
+ msgid "Hmm"
1071
+ msgstr "ふむ"
1072
+
1073
+ #: includes/i18n.php:643
1074
+ msgid "O.K"
1075
+ msgstr "O.K"
1076
+
1077
+ #: includes/i18n.php:645
1078
+ msgctxt "exclamation"
1079
+ msgid "Hey"
1080
+ msgstr "ヘイ"
1081
+
1082
+ #: includes/i18n.php:647
1083
+ msgctxt "advance notice of something that will need attention."
1084
+ msgid "Heads up"
1085
+ msgstr "警告"
1086
+
1087
+ #: includes/i18n.php:657
1088
+ msgid "Seems like you got the latest release."
1089
+ msgstr "最新版を取得できました。"
1090
+
1091
+ #: includes/i18n.php:659
1092
+ msgid "You are all good!"
1093
+ msgstr "すべて完璧です!"
1094
+
1095
+ #: includes/i18n.php:661
1096
+ msgid ""
1097
+ "Sorry, we could not complete the email update. Another user with the same "
1098
+ "email is already registered."
1099
+ msgstr "メールアドレスのアップデートを完了できませんでした。他のユーザーがすでに同じメールアドレスで登録しているようです。"
1100
+
1101
+ #: includes/i18n.php:665
1102
+ msgid ""
1103
+ "If you would like to give up the ownership of the plugin's account to %s "
1104
+ "click the Change Ownership button."
1105
+ msgstr "もし%s にプラグインの所有権を譲りたいなら、所有権を変更ボタンをクリックしてください。"
1106
+
1107
+ #: includes/i18n.php:669
1108
+ msgid ""
1109
+ "Your email was successfully updated. You should receive an email with "
1110
+ "confirmation instructions in few moments."
1111
+ msgstr "メールアドレスのアップデートが完了しました。まもなく確認メールが届きます。"
1112
+
1113
+ #: includes/i18n.php:673
1114
+ msgid "Your name was successfully updated."
1115
+ msgstr "名前のアップデートが成功しました。"
1116
+
1117
+ #: includes/i18n.php:675
1118
+ msgid "You have successfully updated your %s."
1119
+ msgstr "%s のアップデートが成功しました。"
1120
+
1121
+ #: includes/i18n.php:677
1122
+ msgid "Please provide your full name."
1123
+ msgstr "フルネームを入力してください。"
1124
+
1125
+ #: includes/i18n.php:679
1126
+ msgid ""
1127
+ "Verification mail was just sent to %s. If you can't find it after 5 min, "
1128
+ "please check your spam box."
1129
+ msgstr "%s に確認メールを送信しました。もし5分以内にそれが届かない場合、迷惑メールボックスを確認してください。"
1130
+
1131
+ #: includes/i18n.php:683
1132
+ msgid ""
1133
+ "Just letting you know that the add-ons information of %s is being pulled "
1134
+ "from an external server."
1135
+ msgstr "%s のアドオンに関する情報は、外部サーバーから取得されます。"
1136
+
1137
+ #: includes/i18n.php:687
1138
+ msgid "No credit card required"
1139
+ msgstr "クレジットカードは必要ありません。"
1140
+
1141
+ #: includes/i18n.php:689
1142
+ msgid "Premium plugin version was successfully activated."
1143
+ msgstr "プレミアムプラグインのバージョンの有効化に成功しました。"
1144
+
1145
+ #: includes/i18n.php:693
1146
+ msgid "The upgrade of %s was successfully completed."
1147
+ msgstr "%s のアップグレードが完了しました。"
1148
+
1149
+ #: includes/i18n.php:695
1150
+ msgid "Your account was successfully activated with the %s plan."
1151
+ msgstr "アカウントが %s プランで有効化できました。"
1152
+
1153
+ #: includes/i18n.php:699
1154
+ msgid "Download the latest %s version now"
1155
+ msgstr "%s の最新版をダウンロードする"
1156
+
1157
+ #: includes/i18n.php:701
1158
+ msgid "Please follow these steps to complete the upgrade"
1159
+ msgstr "アップグレードを完了するには以下の手順を完了させてください。"
1160
+
1161
+ #: includes/i18n.php:705
1162
+ msgid "Download the latest %s version"
1163
+ msgstr "最新の %s をダウンロード"
1164
+
1165
+ #: includes/i18n.php:707
1166
+ msgid "Download the latest version"
1167
+ msgstr "最新版をダウンロード"
1168
+
1169
+ #: includes/i18n.php:709
1170
+ msgid "Deactivate the free version"
1171
+ msgstr "無料バージョンを無効化"
1172
+
1173
+ #: includes/i18n.php:711
1174
+ msgid "Upload and activate the downloaded version"
1175
+ msgstr "ダウンロードしたバージョンをアップロードして有効化"
1176
+
1177
+ #: includes/i18n.php:713
1178
+ msgid "How to upload and activate?"
1179
+ msgstr "アップロードと有効化の方法"
1180
+
1181
+ #: includes/i18n.php:715
1182
+ msgctxt "%s - product name, e.g. Facebook add-on was successfully..."
1183
+ msgid "%s Add-on was successfully purchased."
1184
+ msgstr "%s のアドオンの支払いが完了しました。"
1185
+
1186
+ #: includes/i18n.php:719
1187
+ msgid "Your %s Add-on plan was successfully upgraded."
1188
+ msgstr "%s のアドオンのプランのアップグレードが完了しました。"
1189
+
1190
+ #: includes/i18n.php:723
1191
+ msgid "Your email has been successfully verified - you are AWESOME!"
1192
+ msgstr "あなたのメールアドレスの承認が完了しました。すごい!"
1193
+
1194
+ #: includes/i18n.php:727
1195
+ msgid "Your plan was successfully upgraded."
1196
+ msgstr "プランのアップグレードが成功しました。"
1197
+
1198
+ #: includes/i18n.php:729
1199
+ msgid "Your plan was successfully changed to %s."
1200
+ msgstr "プランの %s への変更が成功しました。"
1201
+
1202
+ #: includes/i18n.php:731
1203
+ msgid ""
1204
+ "Your license has expired. You can still continue using the free plugin "
1205
+ "forever."
1206
+ msgstr "ライセンスの有効期限が切れました。無料バージョンの利用を継続することができます。"
1207
+
1208
+ #: includes/i18n.php:735
1209
+ msgid ""
1210
+ "Your license has been cancelled. If you think it's a mistake, please contact"
1211
+ " support."
1212
+ msgstr "ライセンスはキャンセルされました。もしそれが間違いだと思うならサポートに連絡してください。"
1213
+
1214
+ #: includes/i18n.php:739
1215
+ msgid "Your trial has been successfully started."
1216
+ msgstr "トライアル版の利用を開始しました。"
1217
+
1218
+ #: includes/i18n.php:741
1219
+ msgid "Your license was successfully activated."
1220
+ msgstr "ライセンスの有効化が成功しました。"
1221
+
1222
+ #: includes/i18n.php:743
1223
+ msgid "It looks like your site currently doesn't have an active license."
1224
+ msgstr "サイトは有効なライセンスを持っていないようです。"
1225
+
1226
+ #: includes/i18n.php:747
1227
+ msgid ""
1228
+ "Your license was successfully deactivated, you are back to the %s plan."
1229
+ msgstr "ライセンスの無効化が完了しました。%s プランに戻りました。"
1230
+
1231
+ #: includes/i18n.php:751
1232
+ msgid "It looks like the license deactivation failed."
1233
+ msgstr "ライセンスの無効化ができませんでした。"
1234
+
1235
+ #: includes/i18n.php:755
1236
+ msgid "It looks like the license could not be activated."
1237
+ msgstr "ライセンスの有効化ができませんでした。"
1238
+
1239
+ #: includes/i18n.php:759
1240
+ msgid "Error received from the server:"
1241
+ msgstr "サーバーからエラーを受信しました。"
1242
+
1243
+ #: includes/i18n.php:761
1244
+ msgid ""
1245
+ "Your trial has expired. You can still continue using all our free features."
1246
+ msgstr "トライアルの有効期限が切れました。引き続き無料の機能の利用を続けることができます。"
1247
+
1248
+ #: includes/i18n.php:765
1249
+ msgid ""
1250
+ "Your plan was successfully downgraded. Your %s plan license will expire in "
1251
+ "%s."
1252
+ msgstr "プランのダウングレードが完了しました。%s プランは %s に有効期限が切れます。"
1253
+
1254
+ #: includes/i18n.php:769
1255
+ msgid ""
1256
+ "Seems like we are having some temporary issue with your plan downgrade. "
1257
+ "Please try again in few minutes."
1258
+ msgstr "プランのダウングレードの際に一時的な問題が発生したようです。数分後に再度操作してください。"
1259
+
1260
+ #: includes/i18n.php:773
1261
+ msgid ""
1262
+ "It looks like you are not in trial mode anymore so there's nothing to cancel"
1263
+ " :)"
1264
+ msgstr "すでにトライアルモードではないようなので、キャンセルする必要はありません :)"
1265
+
1266
+ #: includes/i18n.php:777
1267
+ msgid "Your %s free trial was successfully cancelled."
1268
+ msgstr "%s のフリートライアルはキャンセルされました。"
1269
+
1270
+ #: includes/i18n.php:781
1271
+ msgctxt "%s - numeric version number"
1272
+ msgid "Version %s was released."
1273
+ msgstr "バージョン %s をリリースしました。"
1274
+
1275
+ #: includes/i18n.php:785
1276
+ msgid "Please download %s."
1277
+ msgstr "%s をダウンロードしてください。"
1278
+
1279
+ #: includes/i18n.php:787
1280
+ msgctxt "%s - plan name, as the latest professional version here"
1281
+ msgid "the latest %s version here"
1282
+ msgstr "最新の %s バージョンはこちらです。"
1283
+
1284
+ #: includes/i18n.php:791
1285
+ msgid ""
1286
+ "How do you like %s so far? Test all our %s premium features with a %d-day "
1287
+ "free trial."
1288
+ msgstr "%s はどうですか? 私たちの全ての %s のプレミアム機能をお試しください。"
1289
+
1290
+ #: includes/i18n.php:795
1291
+ msgctxt "call to action"
1292
+ msgid "Start free trial"
1293
+ msgstr "フリートライアルを開始"
1294
+
1295
+ #: includes/i18n.php:797
1296
+ msgid "Starting trial"
1297
+ msgstr "トライアルを開始"
1298
+
1299
+ #: includes/i18n.php:799
1300
+ msgid "Please wait"
1301
+ msgstr "お待ちください"
1302
+
1303
+ #: includes/i18n.php:801
1304
+ msgid ""
1305
+ "Seems like we are having some temporary issue with your trial cancellation. "
1306
+ "Please try again in few minutes."
1307
+ msgstr "トライアルのキャンセルに一時的な問題がありました。数分後に再度お試しください。"
1308
+
1309
+ #: includes/i18n.php:805
1310
+ msgid "You already utilized a trial before."
1311
+ msgstr "以前すでに試用版を利用しました。"
1312
+
1313
+ #: includes/i18n.php:807
1314
+ msgid "You are already running the plugin in a trial mode."
1315
+ msgstr "すでにトライアル版のプラグインを利用しています。"
1316
+
1317
+ #: includes/i18n.php:811
1318
+ msgid "Plan %s do not exist, therefore, can't start a trial."
1319
+ msgstr "%s プランは存在しないため、試用を開始できません。"
1320
+
1321
+ #: includes/i18n.php:815
1322
+ msgid "Plan %s does not support a trial period."
1323
+ msgstr "%s プランにはトライアル期間はありません。"
1324
+
1325
+ #: includes/i18n.php:817
1326
+ msgid "None of the plugin's plans supports a trial period."
1327
+ msgstr "トライアル期間をサポートしているプランのプラグインはありません。"
1328
+
1329
+ #: includes/i18n.php:821
1330
+ msgid ""
1331
+ "Unexpected API error. Please contact the plugin's author with the following "
1332
+ "error."
1333
+ msgstr "予期しない API のエラー。プラグイン開発者に連絡をとってください。"
1334
+
1335
+ #: includes/i18n.php:825
1336
+ msgid "No commitment for %s days - cancel anytime!"
1337
+ msgstr "%s 日以内であればいつでもキャンセルできます。"
1338
+
1339
+ #: includes/i18n.php:827
1340
+ msgid ""
1341
+ "Your license has expired. You can still continue using all the %s features, "
1342
+ "but you'll need to renew your license to continue getting updates and "
1343
+ "support."
1344
+ msgstr "ライセンスは有効期限がきれました。%s の機能を引き続き利用することができます。ただし、アップデートやサポートをうけるにはライセンスをアップデートする必要があります。"
1345
+
1346
+ #: includes/i18n.php:831
1347
+ msgid "Couldn't activate %s."
1348
+ msgstr "%s を有効化できません。"
1349
+
1350
+ #: includes/i18n.php:833
1351
+ msgid "Please contact us with the following message:"
1352
+ msgstr "以下のメッセージとともに私たちに連絡をください。"
1353
+
1354
+ #: includes/i18n.php:835
1355
+ msgid ""
1356
+ "It looks like you are still on the %s plan. If you did upgrade or change "
1357
+ "your plan, it's probably an issue on our side - sorry."
1358
+ msgstr "まだ %s プランのようです。もしアップグレードやプランの変更をしたのなら、こちらで何らかの問題が発生しているようです。申し訳ありません。"
1359
+
1360
+ #: includes/i18n.php:839
1361
+ msgid "Please contact us here"
1362
+ msgstr "こちらで私たちに連絡をとってください。"
1363
+
1364
+ #: includes/i18n.php:841
1365
+ msgid ""
1366
+ "I have upgraded my account but when I try to Sync the License, the plan "
1367
+ "remains %s."
1368
+ msgstr "アカウントをアップグレードしましたが、ライセンスを同期しようとするとプランが %s のままです。"
1369
+
1370
+ #: includes/i18n.php:849
1371
+ msgid "From unknown reason, the API connectivity test failed."
1372
+ msgstr "不明のエラーにより、API 接続ができませんでした。"
1373
+
1374
+ #: includes/i18n.php:853
1375
+ msgid ""
1376
+ "It's probably a temporary issue on our end. Just to be sure, with your "
1377
+ "permission, would it be o.k to run another connectivity test?"
1378
+ msgstr "それは私たちの一時的な問題のようです。もし許可していただけるなら他の接続テストをしてもよいですか?"
1379
+
1380
+ #: includes/i18n.php:857
1381
+ msgid ""
1382
+ "We use PHP cURL library for the API calls, which is a very common library "
1383
+ "and usually installed out of the box. Unfortunately, cURL is not installed "
1384
+ "on your server."
1385
+ msgstr "私たちは、API コールに PHP の cURL ライブラリを使用しています。これは一般的なライブラリで多くの場合インストールされていますが、あなたのサーバーにはインストールされていないようです。"
1386
+
1387
+ #: includes/i18n.php:861
1388
+ msgid ""
1389
+ "From unknown reason, CloudFlare, the firewall we use, blocks the connection."
1390
+ msgstr "不明のエラーにより私たちが使用している CloudFlare のファイヤーウォールが接続を拒否したようです。"
1391
+
1392
+ #: includes/i18n.php:865
1393
+ msgctxt "as pluginX requires an access to our API"
1394
+ msgid "%s requires an access to our API."
1395
+ msgstr "%s は、私たちの API への接続が必要です。"
1396
+
1397
+ #: includes/i18n.php:869
1398
+ msgid ""
1399
+ "It looks like your server is using Squid ACL (access control lists), which "
1400
+ "blocks the connection."
1401
+ msgstr "サーバーは Squid ACL(Access control lists) を使用しているらしく、それが接続をブロックしています。"
1402
+
1403
+ #: includes/i18n.php:873
1404
+ msgid "I don't know what is Squid or ACL, help me!"
1405
+ msgstr "Squid ACL について知りません。助けてください!"
1406
+
1407
+ #: includes/i18n.php875, includes/i18n.php:889
1408
+ msgid ""
1409
+ "We'll make sure to contact your hosting company and resolve the issue. You "
1410
+ "will get a follow-up email to %s once we have an update."
1411
+ msgstr "ホスティング会社に連絡して問題を解決してください。 更新が完了したら、 %s へのフォローアップメールが届きます。"
1412
+
1413
+ #: includes/i18n.php:879
1414
+ msgid "I'm a system administrator"
1415
+ msgstr "私はシステム管理者です"
1416
+
1417
+ #: includes/i18n.php:881
1418
+ msgid ""
1419
+ "Great, please whitelist the following domains: %s. Once you done, deactivate"
1420
+ " the plugin and activate it again."
1421
+ msgstr "以下のドメインを許可してください: %s 。それが完了したらそのプラグインを無効化して有効化してください。"
1422
+
1423
+ #: includes/i18n.php:885
1424
+ msgid "I don't know what is cURL or how to install it, help me!"
1425
+ msgstr "cURL がなにか、そのインストール方法を知りません。助けてください。"
1426
+
1427
+ #: includes/i18n.php:893
1428
+ msgid ""
1429
+ "Great, please install cURL and enable it in your php.ini file. To make sure "
1430
+ "it was successfully activated, use 'phpinfo()'. Once activated, deactivate "
1431
+ "the plugin and reactivate it back again."
1432
+ msgstr "cURLをインストールし、php.iniファイルで有効にしてください。 正常に起動されたことを確認するには、 'phpinfo()' を使用してください。 プラグインを有効化したら、プラグインを無効化して再度有効化し直してください。"
1433
+
1434
+ #: includes/i18n.php:897
1435
+ msgid ""
1436
+ "We are sure it's an issue on our side and more than happy to resolve it for "
1437
+ "you ASAP if you give us a chance."
1438
+ msgstr "それは私たちの側の問題だと確信しています。もし機会をくれるなら私たちはそれを一刻でも早く修正します。"
1439
+
1440
+ #: includes/i18n.php:901
1441
+ msgid ""
1442
+ "Sorry for the inconvenience and we are here to help if you give us a chance."
1443
+ msgstr "ご迷惑をおかけしてすいません。もし機会をいただけたらお手伝いをします。"
1444
+
1445
+ #: includes/i18n.php:905
1446
+ msgid "Yes - I'm giving you a chance to fix it"
1447
+ msgstr "はい、修正をお願いします。"
1448
+
1449
+ #: includes/i18n.php:907
1450
+ msgid ""
1451
+ "We will do our best to whitelist your server and resolve this issue ASAP. "
1452
+ "You will get a follow-up email to %s once we have an update."
1453
+ msgstr "私たちは、少しでも早くサーバーをホワイトリストに登録して問題を修正します。アップデートを行ったら、%s あてに報告を送信します。"
1454
+
1455
+ #: includes/i18n.php:911
1456
+ msgid "Let's try your previous version"
1457
+ msgstr "以前のバージョンでお試しください。"
1458
+
1459
+ #: includes/i18n.php:913
1460
+ msgid "Uninstall this version and install the previous one."
1461
+ msgstr "このバージョンをアンインストールして、以前のバージョンをインストールする。"
1462
+
1463
+ #: includes/i18n.php:917
1464
+ msgid "That's exhausting, please deactivate"
1465
+ msgstr "それは、使用できません。無効化してください。"
1466
+
1467
+ #: includes/i18n.php:919
1468
+ msgid ""
1469
+ "We feel your frustration and sincerely apologize for the inconvenience. Hope"
1470
+ " to see you again in the future."
1471
+ msgstr "ご迷惑をおかけして心からお詫び申し上げます。将来ふたたびお会いできることを楽しみにしています。"
1472
+
1473
+ #: includes/i18n.php:923
1474
+ msgid ""
1475
+ "Thank for giving us the chance to fix it! A message was just sent to our "
1476
+ "technical staff. We will get back to you as soon as we have an update to %s."
1477
+ " Appreciate your patience."
1478
+ msgstr "修正するチャンスをいただきありがとうございます! テクニカルスタッフにメッセージが送信されました。 %s への更新が行われるとすぐにあなたに連絡します。 あなたの忍耐に感謝します。"
1479
+
1480
+ #: includes/i18n.php:927
1481
+ msgctxt "%1s - plugin title, %2s - API domain"
1482
+ msgid ""
1483
+ "Your server is blocking the access to Freemius' API, which is crucial for "
1484
+ "%1s synchronization. Please contact your host to whitelist %2s"
1485
+ msgstr "サーバーは %1s の同期に不可欠な Freemius の API へのアクセスをブロックしています。 ホワイトリストに %2s を追加していただけるようあなたのホスティング会社に連絡してください。"
1486
+
1487
+ #: includes/i18n.php:931
1488
+ msgid ""
1489
+ "It seems like one of the authentication parameters is wrong. Update your "
1490
+ "Public Key, Secret Key & User ID, and try again."
1491
+ msgstr "認証パラメータの1つが間違っているようです。 公開鍵、秘密鍵、ユーザーIDを更新して、もう一度お試しください。"
1492
+
1493
+ #: includes/i18n.php:939
1494
+ msgid ""
1495
+ "Please check your mailbox, you should receive an email via %s to confirm the"
1496
+ " ownership change. From security reasons, you must confirm the change within"
1497
+ " the next 15 min. If you cannot find the email, please check your spam "
1498
+ "folder."
1499
+ msgstr "メールボックスを確認してください。所有権の変更を確認するには、%s でメールを受け取る必要があります。 セキュリティ上の理由から、次の15分以内に変更を確認する必要があります。 電子メールが見つからない場合は、迷惑メールフォルダを確認してください。"
1500
+
1501
+ #: includes/i18n.php:943
1502
+ msgid ""
1503
+ "Thanks for confirming the ownership change. An email was just sent to %s for"
1504
+ " final approval."
1505
+ msgstr "所有権の変更を確認していただきありがとうございます。 %s に承認メールが送信されました。"
1506
+
1507
+ #: includes/i18n.php:947
1508
+ msgid "%s is the new owner of the account."
1509
+ msgstr "%s は新しいオーナーです。"
1510
+
1511
+ #: includes/i18n.php:951
1512
+ msgctxt "addonX cannot run without pluginY"
1513
+ msgid "%s cannot run without %s."
1514
+ msgstr "%s は、%s が無いと実行することができません。"
1515
+
1516
+ #: includes/i18n.php:955
1517
+ msgctxt "addonX cannot run..."
1518
+ msgid "%s cannot run without the plugin."
1519
+ msgstr "%s は、プラグインが無いと実行することができません。"
1520
+
1521
+ #: includes/i18n.php:959
1522
+ msgctxt "pluginX activation was successfully..."
1523
+ msgid "%s activation was successfully completed."
1524
+ msgstr "%s の有効化が成功しました。"
1525
+
1526
+ #: includes/i18n.php:963
1527
+ msgctxt "Plugin installer section title"
1528
+ msgid "Features & Pricing"
1529
+ msgstr "機能 & 料金"
1530
+
1531
+ #: includes/i18n.php:967
1532
+ msgid "Add-on must be deployed to WordPress.org or Freemius."
1533
+ msgstr "アドオンが WordPress.org か Freemius にデプロイされている必要があります。"
1534
+
1535
+ #: includes/i18n.php:971
1536
+ msgid "Paid add-on must be deployed to Freemius."
1537
+ msgstr "有料アドオンは Freemius にデプロイされている必要があります。"
1538
+
1539
+ #: includes/i18n.php:979
1540
+ msgid ""
1541
+ "%s is a premium only add-on. You have to purchase a license first before "
1542
+ "activating the plugin."
1543
+ msgstr "%s はプレミアムのみのアドオンです。そのプラグインを有効化する前にライセンスを購入する必要があります。"
1544
+
1545
+ #: includes/i18n.php:983
1546
+ msgid ""
1547
+ "%s free trial was successfully cancelled. Since the add-on is premium only "
1548
+ "it was automatically deactivated. If you like to use it in the future, "
1549
+ "you'll have to purchase a license."
1550
+ msgstr "%s の無料試用が正常にキャンセルされました。 アドオンはプレミアムなので、自動的に無効化されました。 将来使用したい場合は、ライセンスを購入する必要があります。"
1551
+
1552
+ #: includes/i18n.php:995
1553
+ msgctxt "as every month"
1554
+ msgid "Monthly"
1555
+ msgstr "月"
1556
+
1557
+ #: includes/i18n.php:997
1558
+ msgctxt "as monthly period"
1559
+ msgid "mo"
1560
+ msgstr "月"
1561
+
1562
+ #: includes/i18n.php:999
1563
+ msgctxt "as once a year"
1564
+ msgid "Annual"
1565
+ msgstr "年次"
1566
+
1567
+ #: includes/i18n.php:1001
1568
+ msgctxt "as once a year"
1569
+ msgid "Annually"
1570
+ msgstr "毎年"
1571
+
1572
+ #: includes/i18n.php:1003
1573
+ msgctxt "as once a year"
1574
+ msgid "Once"
1575
+ msgstr "一度"
1576
+
1577
+ #: includes/i18n.php:1005
1578
+ msgctxt "as annual period"
1579
+ msgid "year"
1580
+ msgstr "年"
1581
+
1582
+ #: includes/i18n.php:1007
1583
+ msgid "Lifetime"
1584
+ msgstr "ライフタイム"
1585
+
1586
+ #: includes/i18n.php:1009
1587
+ msgctxt "e.g. the best product"
1588
+ msgid "Best"
1589
+ msgstr "ベスト"
1590
+
1591
+ #: includes/i18n.php:1011
1592
+ msgctxt "e.g. billed monthly"
1593
+ msgid "Billed %s"
1594
+ msgstr "%s への請求"
1595
+
1596
+ #: includes/i18n.php:1013
1597
+ msgctxt "as a discount of $5 or 10%"
1598
+ msgid "Save %s"
1599
+ msgstr "%s を保存"
1600
+
1601
+ #: includes/i18n.php:1017
1602
+ msgid "View details"
1603
+ msgstr "詳細を表示"
1604
+
1605
+ #: includes/i18n.php:1025
1606
+ msgctxt "button label"
1607
+ msgid "Approve & Start Trial"
1608
+ msgstr "気に入ったのでトライアルを開始"
1609
+
1610
+ #: includes/i18n.php:1029
1611
+ msgid ""
1612
+ "You are 1-click away from starting your %1$s-day free trial of the %2$s "
1613
+ "plan."
1614
+ msgstr "%2$s プランの%1$s日間のフリートライアルを開始するまであとワンクリックです。"
1615
+
1616
+ #: includes/i18n.php:1033
1617
+ msgid ""
1618
+ "For compliance with the WordPress.org guidelines, before we start the trial "
1619
+ "we ask that you opt-in with your user and non-sensitive site information, "
1620
+ "allowing the plugin to periodically send data to %s to check for version "
1621
+ "updates and to validate your trial."
1622
+ msgstr "WordPress.org ガイドラインの遵守のため、ユーザーとセンシティブでないサイト情報をオプトインすること、バージョンの更新確認のために %s へとプラグインが一時的にデータを送信することの許可、トライアルを有効にすることの3つについて、トライアルの開始前にお尋ねします。"
1623
+
1624
+ #: includes/i18n.php:1045
1625
+ msgid "Business name"
1626
+ msgstr "商号"
1627
+
1628
+ #: includes/i18n.php:1047
1629
+ msgid "Tax / VAT ID"
1630
+ msgstr "税金 / VAT ID"
1631
+
1632
+ #: includes/i18n.php:1049
1633
+ msgid "Address Line %d"
1634
+ msgstr "住所欄 %d"
1635
+
1636
+ #: includes/i18n.php:1051
1637
+ msgid "Country"
1638
+ msgstr "国"
1639
+
1640
+ #: includes/i18n.php:1053
1641
+ msgid "Select Country"
1642
+ msgstr "国を選択"
1643
+
1644
+ #: includes/i18n.php:1055
1645
+ msgid "City"
1646
+ msgstr "市"
1647
+
1648
+ #: includes/i18n.php:1057
1649
+ msgid "Town"
1650
+ msgstr "町"
1651
+
1652
+ #: includes/i18n.php:1059
1653
+ msgid "State"
1654
+ msgstr "州"
1655
+
1656
+ #: includes/i18n.php:1061
1657
+ msgid "Province"
1658
+ msgstr "県・州・省"
1659
+
1660
+ #: includes/i18n.php:1063
1661
+ msgid "ZIP / Postal Code"
1662
+ msgstr "ZIP / 郵便番号"
freemius/languages/freemius.pot ADDED
@@ -0,0 +1,1724 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "MIME-Version: 1.0\n"
7
+ "Content-Type: text/plain; charset=UTF-8\n"
8
+ "Content-Transfer-Encoding: 8bit\n"
9
+ "Language-Team: Freemius Team <admin@freemius.com>\n"
10
+ "Last-Translator: Vova Feldman <vova@freemius.com>\n"
11
+ "Report-Msgid-Bugs-To: https://github.com/Freemius/wordpress-sdk/issues\n"
12
+ "X-Poedit-Basepath: ..\n"
13
+ "X-Poedit-KeywordsList: _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"
14
+ "X-Poedit-SearchPath-0: .\n"
15
+ "X-Poedit-SearchPathExcluded-0: *.js\n"
16
+ "X-Poedit-SourceCharset: UTF-8\n"
17
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+
19
+ #: includes/i18n.php:37
20
+ msgid "Account"
21
+ msgstr ""
22
+
23
+ #: includes/i18n.php:38
24
+ msgid "Add On"
25
+ msgstr ""
26
+
27
+ #: includes/i18n.php:39
28
+ msgid "Contact Us"
29
+ msgstr ""
30
+
31
+ #: includes/i18n.php:40
32
+ msgid "Contact Support"
33
+ msgstr ""
34
+
35
+ #: includes/i18n.php:41
36
+ msgid "Change Ownership"
37
+ msgstr ""
38
+
39
+ #: includes/i18n.php:42
40
+ msgid "Support"
41
+ msgstr ""
42
+
43
+ #: includes/i18n.php:43
44
+ msgid "Support Forum"
45
+ msgstr ""
46
+
47
+ #: includes/i18n.php:44
48
+ msgid "Add Ons"
49
+ msgstr ""
50
+
51
+ #: includes/i18n.php:45
52
+ msgctxt "verb"
53
+ msgid "Upgrade"
54
+ msgstr ""
55
+
56
+ #: includes/i18n.php:46
57
+ msgid "Awesome"
58
+ msgstr ""
59
+
60
+ #: includes/i18n.php:47
61
+ msgctxt "noun"
62
+ msgid "Pricing"
63
+ msgstr ""
64
+
65
+ #: includes/i18n.php:48
66
+ msgctxt "noun"
67
+ msgid "Price"
68
+ msgstr ""
69
+
70
+ #: includes/i18n.php:49
71
+ msgid "Unlimited Updates"
72
+ msgstr ""
73
+
74
+ #: includes/i18n.php:50
75
+ msgctxt "verb"
76
+ msgid "Downgrade"
77
+ msgstr ""
78
+
79
+ #: includes/i18n.php:51
80
+ msgid "Cancel Trial"
81
+ msgstr ""
82
+
83
+ #: includes/i18n.php:52
84
+ msgid "Free Trial"
85
+ msgstr ""
86
+
87
+ #: includes/i18n.php:53
88
+ msgid "Start my free %s"
89
+ msgstr ""
90
+
91
+ #: includes/i18n.php:54
92
+ msgid "No commitment for %s - cancel anytime"
93
+ msgstr ""
94
+
95
+ #: includes/i18n.php:55
96
+ msgid "After your free %s, pay as little as %s"
97
+ msgstr ""
98
+
99
+ #: includes/i18n.php:56
100
+ msgid "Details"
101
+ msgstr ""
102
+
103
+ #: includes/i18n.php:57
104
+ msgid "Account Details"
105
+ msgstr ""
106
+
107
+ #: includes/i18n.php:58
108
+ msgctxt "verb"
109
+ msgid "Delete"
110
+ msgstr ""
111
+
112
+ #: includes/i18n.php:59
113
+ msgctxt "verb"
114
+ msgid "Show"
115
+ msgstr ""
116
+
117
+ #: includes/i18n.php:60
118
+ msgctxt "verb"
119
+ msgid "Hide"
120
+ msgstr ""
121
+
122
+ #: includes/i18n.php:61
123
+ msgctxt "verb"
124
+ msgid "Edit"
125
+ msgstr ""
126
+
127
+ #: includes/i18n.php:62
128
+ msgctxt "verb"
129
+ msgid "Update"
130
+ msgstr ""
131
+
132
+ #: includes/i18n.php:63
133
+ msgid "Date"
134
+ msgstr ""
135
+
136
+ #: includes/i18n.php:64
137
+ msgid "Amount"
138
+ msgstr ""
139
+
140
+ #: includes/i18n.php:65
141
+ msgid "Invoice"
142
+ msgstr ""
143
+
144
+ #: includes/i18n.php:66
145
+ msgid "Billing"
146
+ msgstr ""
147
+
148
+ #: includes/i18n.php:67
149
+ msgid "Payments"
150
+ msgstr ""
151
+
152
+ #: includes/i18n.php:68
153
+ msgid "Delete Account"
154
+ msgstr ""
155
+
156
+ #: includes/i18n.php:69
157
+ msgctxt "as close a window"
158
+ msgid "Dismiss"
159
+ msgstr ""
160
+
161
+ #: includes/i18n.php:70
162
+ msgctxt "as product pricing plan"
163
+ msgid "Plan"
164
+ msgstr ""
165
+
166
+ #: includes/i18n.php:71
167
+ msgid "Change Plan"
168
+ msgstr ""
169
+
170
+ #: includes/i18n.php:72
171
+ msgctxt "as download professional version"
172
+ msgid "Download %s Version"
173
+ msgstr ""
174
+
175
+ #: includes/i18n.php:73
176
+ msgctxt "as download professional version now"
177
+ msgid "Download %s version now"
178
+ msgstr ""
179
+
180
+ #: includes/i18n.php:74
181
+ msgctxt "as download latest version"
182
+ msgid "Download Latest"
183
+ msgstr ""
184
+
185
+ #: includes/i18n.php:75
186
+ msgctxt "E.g. you have a professional license."
187
+ msgid "You have a %s license."
188
+ msgstr ""
189
+
190
+ #: includes/i18n.php:76
191
+ msgid "New"
192
+ msgstr ""
193
+
194
+ #: includes/i18n.php:77
195
+ msgid "Free"
196
+ msgstr ""
197
+
198
+ #: includes/i18n.php:78
199
+ msgctxt "as trial plan"
200
+ msgid "Trial"
201
+ msgstr ""
202
+
203
+ #: includes/i18n.php:79
204
+ msgctxt "as starting a trial plan"
205
+ msgid "Start Trial"
206
+ msgstr ""
207
+
208
+ #: includes/i18n.php:80
209
+ msgctxt "verb"
210
+ msgid "Purchase"
211
+ msgstr ""
212
+
213
+ #: includes/i18n.php:81
214
+ msgid "Purchase License"
215
+ msgstr ""
216
+
217
+ #: includes/i18n.php:82
218
+ msgctxt "verb"
219
+ msgid "Buy"
220
+ msgstr ""
221
+
222
+ #: includes/i18n.php:83
223
+ msgid "Buy License"
224
+ msgstr ""
225
+
226
+ #: includes/i18n.php:84
227
+ msgid "Single Site License"
228
+ msgstr ""
229
+
230
+ #: includes/i18n.php:85
231
+ msgid "Unlimited Licenses"
232
+ msgstr ""
233
+
234
+ #: includes/i18n.php:86
235
+ msgid "Up to %s Sites"
236
+ msgstr ""
237
+
238
+ #: includes/i18n.php:87
239
+ msgid "%sRenew your license now%s to access version %s features and support."
240
+ msgstr ""
241
+
242
+ #: includes/i18n.php:88
243
+ msgid "Enter the email address you've used for the upgrade below and we will resend you the license key."
244
+ msgstr ""
245
+
246
+ #: includes/i18n.php:89
247
+ msgctxt "e.g. Professional Plan"
248
+ msgid "%s Plan"
249
+ msgstr ""
250
+
251
+ #: includes/i18n.php:90
252
+ msgid "You are just one step away - %s"
253
+ msgstr ""
254
+
255
+ #: includes/i18n.php:91
256
+ msgctxt "%s - plugin name. As complete \"Jetpack\" activation now"
257
+ msgid "Complete \"%s\" Activation Now"
258
+ msgstr ""
259
+
260
+ #: includes/i18n.php:93
261
+ msgid "We made a few tweaks to the plugin, %s"
262
+ msgstr ""
263
+
264
+ #: includes/i18n.php:94
265
+ msgid "Opt-in to make \"%s\" Better!"
266
+ msgstr ""
267
+
268
+ #: includes/i18n.php:95
269
+ msgid "Error"
270
+ msgstr ""
271
+
272
+ #: includes/i18n.php:96
273
+ msgid "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
274
+ msgstr ""
275
+
276
+ #: includes/i18n.php:99
277
+ msgctxt "as expiration date"
278
+ msgid "Expiration"
279
+ msgstr ""
280
+
281
+ #: includes/i18n.php:100
282
+ msgctxt "as software license"
283
+ msgid "License"
284
+ msgstr ""
285
+
286
+ #: includes/i18n.php:101
287
+ msgid "not verified"
288
+ msgstr ""
289
+
290
+ #: includes/i18n.php:102
291
+ msgid "Verify Email"
292
+ msgstr ""
293
+
294
+ #: includes/i18n.php:103
295
+ msgctxt "e.g. expires in 2 months"
296
+ msgid "Expires in %s"
297
+ msgstr ""
298
+
299
+ #: includes/i18n.php:104
300
+ msgctxt "e.g. auto renews in 2 months"
301
+ msgid "Auto renews in %s"
302
+ msgstr ""
303
+
304
+ #: includes/i18n.php:105
305
+ msgid "No expiration"
306
+ msgstr ""
307
+
308
+ #: includes/i18n.php:106
309
+ msgid "Expired"
310
+ msgstr ""
311
+
312
+ #: includes/i18n.php:107
313
+ msgid "Cancelled"
314
+ msgstr ""
315
+
316
+ #: includes/i18n.php:108
317
+ msgctxt "e.g. In 2 hours"
318
+ msgid "In %s"
319
+ msgstr ""
320
+
321
+ #: includes/i18n.php:109
322
+ msgctxt "e.g. 2 min ago"
323
+ msgid "%s ago"
324
+ msgstr ""
325
+
326
+ #: includes/i18n.php:111
327
+ msgid "%s or higher"
328
+ msgstr ""
329
+
330
+ #: includes/i18n.php:112
331
+ msgctxt "as plugin version"
332
+ msgid "Version"
333
+ msgstr ""
334
+
335
+ #: includes/i18n.php:113
336
+ msgid "Name"
337
+ msgstr ""
338
+
339
+ #: includes/i18n.php:114
340
+ msgid "Email"
341
+ msgstr ""
342
+
343
+ #: includes/i18n.php:115
344
+ msgid "Email address"
345
+ msgstr ""
346
+
347
+ #: includes/i18n.php:116
348
+ msgid "Verified"
349
+ msgstr ""
350
+
351
+ #: includes/i18n.php:117
352
+ msgid "Module"
353
+ msgstr ""
354
+
355
+ #: includes/i18n.php:118
356
+ msgid "Module Type"
357
+ msgstr ""
358
+
359
+ #: includes/i18n.php:119
360
+ msgid "Plugin"
361
+ msgstr ""
362
+
363
+ #: includes/i18n.php:120
364
+ msgid "Plugins"
365
+ msgstr ""
366
+
367
+ #: includes/i18n.php:121
368
+ msgid "Theme"
369
+ msgstr ""
370
+
371
+ #: includes/i18n.php:122
372
+ msgid "Themes"
373
+ msgstr ""
374
+
375
+ #: includes/i18n.php:123
376
+ msgctxt "as file/folder path"
377
+ msgid "Path"
378
+ msgstr ""
379
+
380
+ #: includes/i18n.php:124
381
+ msgid "Title"
382
+ msgstr ""
383
+
384
+ #: includes/i18n.php:125
385
+ msgid "Free version"
386
+ msgstr ""
387
+
388
+ #: includes/i18n.php:126
389
+ msgid "Premium version"
390
+ msgstr ""
391
+
392
+ #: includes/i18n.php:127
393
+ msgctxt "as WP plugin slug"
394
+ msgid "Slug"
395
+ msgstr ""
396
+
397
+ #: includes/i18n.php:128
398
+ msgid "ID"
399
+ msgstr ""
400
+
401
+ #: includes/i18n.php:129
402
+ msgid "Users"
403
+ msgstr ""
404
+
405
+ #: includes/i18n.php:130
406
+ msgid "Plugin Installs"
407
+ msgstr ""
408
+
409
+ #: includes/i18n.php:131
410
+ msgid "%s Installs"
411
+ msgstr ""
412
+
413
+ #: includes/i18n.php:132
414
+ msgctxt "like websites"
415
+ msgid "Sites"
416
+ msgstr ""
417
+
418
+ #: includes/i18n.php:133
419
+ msgid "User ID"
420
+ msgstr ""
421
+
422
+ #: includes/i18n.php:134
423
+ msgid "Site ID"
424
+ msgstr ""
425
+
426
+ #: includes/i18n.php:135
427
+ msgid "Public Key"
428
+ msgstr ""
429
+
430
+ #: includes/i18n.php:136
431
+ msgid "Secret Key"
432
+ msgstr ""
433
+
434
+ #: includes/i18n.php:137
435
+ msgctxt "as secret encryption key missing"
436
+ msgid "No Secret"
437
+ msgstr ""
438
+
439
+ #: includes/i18n.php:138
440
+ msgid "No ID"
441
+ msgstr ""
442
+
443
+ #: includes/i18n.php:139
444
+ msgctxt "as synchronize license"
445
+ msgid "Sync License"
446
+ msgstr ""
447
+
448
+ #: includes/i18n.php:140
449
+ msgctxt "as synchronize"
450
+ msgid "Sync"
451
+ msgstr ""
452
+
453
+ #: includes/i18n.php:141
454
+ msgid "Activate License"
455
+ msgstr ""
456
+
457
+ #: includes/i18n.php:142
458
+ msgid "Activate Free Version"
459
+ msgstr ""
460
+
461
+ #: includes/i18n.php:143
462
+ msgid "Please enter the license key that you received in the email right after the purchase:"
463
+ msgstr ""
464
+
465
+ #: includes/i18n.php:144
466
+ msgid "Activating license..."
467
+ msgstr ""
468
+
469
+ #: includes/i18n.php:145
470
+ msgid "Change License"
471
+ msgstr ""
472
+
473
+ #: includes/i18n.php:146
474
+ msgid "Update License"
475
+ msgstr ""
476
+
477
+ #: includes/i18n.php:147
478
+ msgid "Deactivate License"
479
+ msgstr ""
480
+
481
+ #: includes/i18n.php:148
482
+ msgid "Activate"
483
+ msgstr ""
484
+
485
+ #: includes/i18n.php:149
486
+ msgid "Deactivate"
487
+ msgstr ""
488
+
489
+ #: includes/i18n.php:150
490
+ msgid "Skip & Deactivate"
491
+ msgstr ""
492
+
493
+ #: includes/i18n.php:151
494
+ msgid "Skip & %s"
495
+ msgstr ""
496
+
497
+ #: includes/i18n.php:152
498
+ msgid "No - just deactivate"
499
+ msgstr ""
500
+
501
+ #: includes/i18n.php:153
502
+ msgid "Yes - do your thing"
503
+ msgstr ""
504
+
505
+ #: includes/i18n.php:154
506
+ msgctxt "active mode"
507
+ msgid "Active"
508
+ msgstr ""
509
+
510
+ #: includes/i18n.php:155
511
+ msgctxt "is active mode?"
512
+ msgid "Is Active"
513
+ msgstr ""
514
+
515
+ #: includes/i18n.php:156
516
+ msgid "Install Now"
517
+ msgstr ""
518
+
519
+ #: includes/i18n.php:157
520
+ msgid "Install Update Now"
521
+ msgstr ""
522
+
523
+ #: includes/i18n.php:158
524
+ msgid "More information about %s"
525
+ msgstr ""
526
+
527
+ #: includes/i18n.php:159
528
+ msgid "Localhost"
529
+ msgstr ""
530
+
531
+ #: includes/i18n.php:160
532
+ msgctxt "as activate Professional plan"
533
+ msgid "Activate %s Plan"
534
+ msgstr ""
535
+
536
+ #: includes/i18n.php:161
537
+ msgctxt "as 5 licenses left"
538
+ msgid "%s left"
539
+ msgstr ""
540
+
541
+ #: includes/i18n.php:162
542
+ msgid "Last license"
543
+ msgstr ""
544
+
545
+ #: includes/i18n.php:163
546
+ msgid "What is your %s?"
547
+ msgstr ""
548
+
549
+ #: includes/i18n.php:164
550
+ msgid "Activate this add-on"
551
+ msgstr ""
552
+
553
+ #: includes/i18n.php:165
554
+ 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?"
555
+ msgstr ""
556
+
557
+ #: includes/i18n.php:166
558
+ 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?"
559
+ msgstr ""
560
+
561
+ #: includes/i18n.php:167
562
+ 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?"
563
+ msgstr ""
564
+
565
+ #: includes/i18n.php:168
566
+ msgid "Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s."
567
+ msgstr ""
568
+
569
+ #: includes/i18n.php:169
570
+ msgid "Cancelling the trial will immediately block access to all premium features. Are you sure?"
571
+ msgstr ""
572
+
573
+ #: includes/i18n.php:170
574
+ msgid "You can still enjoy all %s features but you will not have access to plugin updates and support."
575
+ msgstr ""
576
+
577
+ #: includes/i18n.php:171
578
+ msgid "Once your license expires you can still use the Free version but you will NOT have access to the %s features."
579
+ msgstr ""
580
+
581
+ #: includes/i18n.php:172
582
+ msgid "Are you sure you want to proceed?"
583
+ msgstr ""
584
+
585
+ #: includes/i18n.php:175
586
+ msgid "Add Ons for %s"
587
+ msgstr ""
588
+
589
+ #: includes/i18n.php:176
590
+ 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."
591
+ msgstr ""
592
+
593
+ #: includes/i18n.php:178
594
+ msgid "Anonymous feedback"
595
+ msgstr ""
596
+
597
+ #: includes/i18n.php:179
598
+ msgid "Quick feedback"
599
+ msgstr ""
600
+
601
+ #: includes/i18n.php:180
602
+ msgid "If you have a moment, please let us know why you are deactivating"
603
+ msgstr ""
604
+
605
+ #: includes/i18n.php:181
606
+ msgid "Yes - Deactivate"
607
+ msgstr ""
608
+
609
+ #: includes/i18n.php:182
610
+ msgid "Submit & Deactivate"
611
+ msgstr ""
612
+
613
+ #: includes/i18n.php:183
614
+ msgid "Cancel"
615
+ msgstr ""
616
+
617
+ #: includes/i18n.php:184
618
+ msgid "I no longer need the plugin"
619
+ msgstr ""
620
+
621
+ #: includes/i18n.php:185
622
+ msgid "I found a better plugin"
623
+ msgstr ""
624
+
625
+ #: includes/i18n.php:186
626
+ msgid "I only needed the plugin for a short period"
627
+ msgstr ""
628
+
629
+ #: includes/i18n.php:187
630
+ msgid "The plugin broke my site"
631
+ msgstr ""
632
+
633
+ #: includes/i18n.php:188
634
+ msgid "The plugin suddenly stopped working"
635
+ msgstr ""
636
+
637
+ #: includes/i18n.php:189
638
+ msgid "I can't pay for it anymore"
639
+ msgstr ""
640
+
641
+ #: includes/i18n.php:190
642
+ msgid "It's a temporary deactivation. I'm just debugging an issue."
643
+ msgstr ""
644
+
645
+ #: includes/i18n.php:191
646
+ msgctxt "the text of the \"other\" reason for deactivating the plugin that is shown in the modal box."
647
+ msgid "Other"
648
+ msgstr ""
649
+
650
+ #: includes/i18n.php:193
651
+ msgid "Kindly tell us the reason so we can improve."
652
+ msgstr ""
653
+
654
+ #: includes/i18n.php:194
655
+ msgid "What's the plugin's name?"
656
+ msgstr ""
657
+
658
+ #: includes/i18n.php:195
659
+ msgid "What price would you feel comfortable paying?"
660
+ msgstr ""
661
+
662
+ #: includes/i18n.php:196
663
+ msgid "I couldn't understand how to make it work"
664
+ msgstr ""
665
+
666
+ #: includes/i18n.php:197
667
+ msgid "The plugin is great, but I need specific feature that you don't support"
668
+ msgstr ""
669
+
670
+ #: includes/i18n.php:198
671
+ msgid "The plugin is not working"
672
+ msgstr ""
673
+
674
+ #: includes/i18n.php:199
675
+ msgid "It's not what I was looking for"
676
+ msgstr ""
677
+
678
+ #: includes/i18n.php:200
679
+ msgid "The plugin didn't work as expected"
680
+ msgstr ""
681
+
682
+ #: includes/i18n.php:201
683
+ msgid "What feature?"
684
+ msgstr ""
685
+
686
+ #: includes/i18n.php:202
687
+ msgid "Kindly share what didn't work so we can fix it for future users..."
688
+ msgstr ""
689
+
690
+ #: includes/i18n.php:203
691
+ msgid "What you've been looking for?"
692
+ msgstr ""
693
+
694
+ #: includes/i18n.php:204
695
+ msgid "What did you expect?"
696
+ msgstr ""
697
+
698
+ #: includes/i18n.php:205
699
+ msgid "The plugin didn't work"
700
+ msgstr ""
701
+
702
+ #: includes/i18n.php:206
703
+ msgid "I don't like to share my information with you"
704
+ msgstr ""
705
+
706
+ #: includes/i18n.php:207
707
+ msgid "You might have missed it, but you don't have to share any data and can just %s the opt-in."
708
+ msgstr ""
709
+
710
+ #: includes/i18n.php:211
711
+ msgctxt "greeting"
712
+ msgid "Hey %s,"
713
+ msgstr ""
714
+
715
+ #: includes/i18n.php:212
716
+ msgctxt "a greeting. E.g. Thanks John!"
717
+ msgid "Thanks %s!"
718
+ msgstr ""
719
+
720
+ #: includes/i18n.php:213
721
+ msgid "Never miss an important update - opt-in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s."
722
+ msgstr ""
723
+
724
+ #: includes/i18n.php:214
725
+ 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."
726
+ msgstr ""
727
+
728
+ #: includes/i18n.php:215
729
+ 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."
730
+ msgstr ""
731
+
732
+ #: includes/i18n.php:216
733
+ msgid "complete the install"
734
+ msgstr ""
735
+
736
+ #: includes/i18n.php:217
737
+ msgid "start the trial"
738
+ msgstr ""
739
+
740
+ #: includes/i18n.php:218
741
+ msgid "Thanks for purchasing %s! To get started, please enter your license key:"
742
+ msgstr ""
743
+
744
+ #: includes/i18n.php:219
745
+ msgid "The plugin will be periodically sending data to %s to check for plugin updates and verify the validity of your license."
746
+ msgstr ""
747
+
748
+ #: includes/i18n.php:220
749
+ msgid "What permissions are being granted?"
750
+ msgstr ""
751
+
752
+ #: includes/i18n.php:221
753
+ msgid "Your Profile Overview"
754
+ msgstr ""
755
+
756
+ #: includes/i18n.php:222
757
+ msgid "Name and email address"
758
+ msgstr ""
759
+
760
+ #: includes/i18n.php:223
761
+ msgid "Your Site Overview"
762
+ msgstr ""
763
+
764
+ #: includes/i18n.php:224
765
+ msgid "Site URL, WP version, PHP info, plugins & themes"
766
+ msgstr ""
767
+
768
+ #: includes/i18n.php:225
769
+ msgid "Current Plugin Events"
770
+ msgstr ""
771
+
772
+ #: includes/i18n.php:226
773
+ msgid "Activation, deactivation and uninstall"
774
+ msgstr ""
775
+
776
+ #: includes/i18n.php:227
777
+ msgid "Plugins & Themes"
778
+ msgstr ""
779
+
780
+ #: includes/i18n.php:228
781
+ msgid "Titles, versions and state."
782
+ msgstr ""
783
+
784
+ #: includes/i18n.php:229
785
+ msgid "Admin Notices"
786
+ msgstr ""
787
+
788
+ #: includes/i18n.php:230
789
+ msgid "Newsletter"
790
+ msgstr ""
791
+
792
+ #: includes/i18n.php:231
793
+ msgid "Updates, announcements, marketing, no spam"
794
+ msgstr ""
795
+
796
+ #: includes/i18n.php:232
797
+ msgid "Privacy Policy"
798
+ msgstr ""
799
+
800
+ #: includes/i18n.php:233
801
+ msgid "Terms of Service"
802
+ msgstr ""
803
+
804
+ #: includes/i18n.php:234
805
+ msgctxt "as activating plugin"
806
+ msgid "Activating"
807
+ msgstr ""
808
+
809
+ #: includes/i18n.php:235
810
+ msgctxt "as in the process of sending an email"
811
+ msgid "Sending email"
812
+ msgstr ""
813
+
814
+ #: includes/i18n.php:236
815
+ msgctxt "button label"
816
+ msgid "Allow & Continue"
817
+ msgstr ""
818
+
819
+ #: includes/i18n.php:237
820
+ msgctxt "button label"
821
+ msgid "Agree & Activate License"
822
+ msgstr ""
823
+
824
+ #: includes/i18n.php:238
825
+ msgctxt "verb"
826
+ msgid "Skip"
827
+ msgstr ""
828
+
829
+ #: includes/i18n.php:239
830
+ msgid "Click here to use the plugin anonymously"
831
+ msgstr ""
832
+
833
+ #: includes/i18n.php:240
834
+ msgid "Re-send activation email"
835
+ msgstr ""
836
+
837
+ #: includes/i18n.php:241
838
+ msgid "License key"
839
+ msgstr ""
840
+
841
+ #: includes/i18n.php:242
842
+ msgid "Send License Key"
843
+ msgstr ""
844
+
845
+ #: includes/i18n.php:243
846
+ msgid "Sending license key"
847
+ msgstr ""
848
+
849
+ #: includes/i18n.php:244
850
+ msgid "Have a license key?"
851
+ msgstr ""
852
+
853
+ #: includes/i18n.php:245
854
+ msgid "Don't have a license key?"
855
+ msgstr ""
856
+
857
+ #: includes/i18n.php:246
858
+ msgid "Can't find your license key?"
859
+ msgstr ""
860
+
861
+ #: includes/i18n.php:247
862
+ msgid "We couldn't find your email address in the system, are you sure it's the right address?"
863
+ msgstr ""
864
+
865
+ #: includes/i18n.php:248
866
+ msgid "We can't see any active licenses associated with that email address, are you sure it's the right address?"
867
+ msgstr ""
868
+
869
+ #: includes/i18n.php:249
870
+ msgid "Opt In"
871
+ msgstr ""
872
+
873
+ #: includes/i18n.php:250
874
+ msgid "Opt Out"
875
+ msgstr ""
876
+
877
+ #: includes/i18n.php:251
878
+ msgid "On second thought - I want to continue helping"
879
+ msgstr ""
880
+
881
+ #: includes/i18n.php:252
882
+ msgid "Opting out..."
883
+ msgstr ""
884
+
885
+ #: includes/i18n.php:253
886
+ msgid "Opting in..."
887
+ msgstr ""
888
+
889
+ #: includes/i18n.php:254
890
+ msgid "We appreciate your help in making the %s better by letting us track some usage data."
891
+ msgstr ""
892
+
893
+ #: includes/i18n.php:255
894
+ 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."
895
+ msgstr ""
896
+
897
+ #: includes/i18n.php:256
898
+ msgid "By clicking \"Opt Out\", we will no longer be sending any data from %s to %s."
899
+ msgstr ""
900
+
901
+ #: includes/i18n.php:260
902
+ msgid "Screenshots"
903
+ msgstr ""
904
+
905
+ #: includes/i18n.php:261
906
+ msgid "Click to view full-size screenshot %d"
907
+ msgstr ""
908
+
909
+ #: includes/i18n.php:265
910
+ msgid "Freemius Debug"
911
+ msgstr ""
912
+
913
+ #: includes/i18n.php:266
914
+ msgctxt "as turned on"
915
+ msgid "On"
916
+ msgstr ""
917
+
918
+ #: includes/i18n.php:267
919
+ msgctxt "as turned off"
920
+ msgid "Off"
921
+ msgstr ""
922
+
923
+ #: includes/i18n.php:268
924
+ msgctxt "as code debugging"
925
+ msgid "Debugging"
926
+ msgstr ""
927
+
928
+ #: includes/i18n.php:269
929
+ msgid "Freemius State"
930
+ msgstr ""
931
+
932
+ #: includes/i18n.php:270
933
+ msgctxt "as connection was successful"
934
+ msgid "Connected"
935
+ msgstr ""
936
+
937
+ #: includes/i18n.php:271
938
+ msgctxt "as connection blocked"
939
+ msgid "Blocked"
940
+ msgstr ""
941
+
942
+ #: includes/i18n.php:272
943
+ msgctxt "as application program interface"
944
+ msgid "API"
945
+ msgstr ""
946
+
947
+ #: includes/i18n.php:273
948
+ msgctxt "as software development kit versions"
949
+ msgid "SDK"
950
+ msgstr ""
951
+
952
+ #: includes/i18n.php:274
953
+ msgctxt "as software development kit versions"
954
+ msgid "SDK Versions"
955
+ msgstr ""
956
+
957
+ #: includes/i18n.php:275
958
+ msgctxt "as plugin folder path"
959
+ msgid "Plugin Path"
960
+ msgstr ""
961
+
962
+ #: includes/i18n.php:276
963
+ msgctxt "as sdk path"
964
+ msgid "SDK Path"
965
+ msgstr ""
966
+
967
+ #: includes/i18n.php:277
968
+ msgid "Add Ons of Plugin %s"
969
+ msgstr ""
970
+
971
+ #: includes/i18n.php:278
972
+ msgid "Are you sure you want to delete all Freemius data?"
973
+ msgstr ""
974
+
975
+ #: includes/i18n.php:279
976
+ msgid "Actions"
977
+ msgstr ""
978
+
979
+ #: includes/i18n.php:280
980
+ msgid "Delete All Accounts"
981
+ msgstr ""
982
+
983
+ #: includes/i18n.php:281
984
+ msgid "Start Fresh"
985
+ msgstr ""
986
+
987
+ #: includes/i18n.php:282
988
+ msgid "Clear API Cache"
989
+ msgstr ""
990
+
991
+ #: includes/i18n.php:283
992
+ msgid "Sync Data From Server"
993
+ msgstr ""
994
+
995
+ #: includes/i18n.php:284
996
+ msgid "Scheduled Crons"
997
+ msgstr ""
998
+
999
+ #: includes/i18n.php:285
1000
+ msgid "Cron Type"
1001
+ msgstr ""
1002
+
1003
+ #: includes/i18n.php:286
1004
+ msgid "Plugins & Themes Sync"
1005
+ msgstr ""
1006
+
1007
+ #: includes/i18n.php:287
1008
+ msgid "Licenses"
1009
+ msgstr ""
1010
+
1011
+ #: includes/i18n.php:288
1012
+ msgid "Debug Log"
1013
+ msgstr ""
1014
+
1015
+ #: includes/i18n.php:289
1016
+ msgid "All"
1017
+ msgstr ""
1018
+
1019
+ #: includes/i18n.php:290
1020
+ msgid "File"
1021
+ msgstr ""
1022
+
1023
+ #: includes/i18n.php:291
1024
+ msgid "Function"
1025
+ msgstr ""
1026
+
1027
+ #: includes/i18n.php:292
1028
+ msgid "Process ID"
1029
+ msgstr ""
1030
+
1031
+ #: includes/i18n.php:293
1032
+ msgid "Logger"
1033
+ msgstr ""
1034
+
1035
+ #: includes/i18n.php:294
1036
+ msgid "Message"
1037
+ msgstr ""
1038
+
1039
+ #: includes/i18n.php:295
1040
+ msgid "Download"
1041
+ msgstr ""
1042
+
1043
+ #: includes/i18n.php:296
1044
+ msgid "Filter"
1045
+ msgstr ""
1046
+
1047
+ #: includes/i18n.php:297
1048
+ msgid "Type"
1049
+ msgstr ""
1050
+
1051
+ #: includes/i18n.php:298
1052
+ msgid "All Types"
1053
+ msgstr ""
1054
+
1055
+ #: includes/i18n.php:299
1056
+ msgid "All Requests"
1057
+ msgstr ""
1058
+
1059
+ #: includes/i18n.php:303
1060
+ msgctxt "as congratulations"
1061
+ msgid "Congrats"
1062
+ msgstr ""
1063
+
1064
+ #: includes/i18n.php:304
1065
+ msgctxt "exclamation"
1066
+ msgid "Oops"
1067
+ msgstr ""
1068
+
1069
+ #: includes/i18n.php:305
1070
+ msgctxt "interjection expressing joy or exuberance"
1071
+ msgid "Yee-haw"
1072
+ msgstr ""
1073
+
1074
+ #: includes/i18n.php:306
1075
+ msgctxt "(especially in electronic communication) used to express elation, enthusiasm, or triumph."
1076
+ msgid "W00t"
1077
+ msgstr ""
1078
+
1079
+ #: includes/i18n.php:308
1080
+ msgctxt "a positive response"
1081
+ msgid "Right on"
1082
+ msgstr ""
1083
+
1084
+ #: includes/i18n.php:309
1085
+ msgctxt "something somebody says when they are thinking about what you have just said. "
1086
+ msgid "Hmm"
1087
+ msgstr ""
1088
+
1089
+ #: includes/i18n.php:311
1090
+ msgid "O.K"
1091
+ msgstr ""
1092
+
1093
+ #: includes/i18n.php:312
1094
+ msgctxt "exclamation"
1095
+ msgid "Hey"
1096
+ msgstr ""
1097
+
1098
+ #: includes/i18n.php:313
1099
+ msgctxt "advance notice of something that will need attention."
1100
+ msgid "Heads up"
1101
+ msgstr ""
1102
+
1103
+ #: includes/i18n.php:318
1104
+ msgid "Seems like you got the latest release."
1105
+ msgstr ""
1106
+
1107
+ #: includes/i18n.php:319
1108
+ msgid "You are all good!"
1109
+ msgstr ""
1110
+
1111
+ #: includes/i18n.php:320
1112
+ msgid "Sorry, we could not complete the email update. Another user with the same email is already registered."
1113
+ msgstr ""
1114
+
1115
+ #: includes/i18n.php:321
1116
+ msgid "If you would like to give up the ownership of the plugin's account to %s click the Change Ownership button."
1117
+ msgstr ""
1118
+
1119
+ #: includes/i18n.php:322
1120
+ msgid "Your email was successfully updated. You should receive an email with confirmation instructions in few moments."
1121
+ msgstr ""
1122
+
1123
+ #: includes/i18n.php:323
1124
+ msgid "Your name was successfully updated."
1125
+ msgstr ""
1126
+
1127
+ #: includes/i18n.php:324
1128
+ msgid "You have successfully updated your %s."
1129
+ msgstr ""
1130
+
1131
+ #: includes/i18n.php:325
1132
+ msgid "Please provide your full name."
1133
+ msgstr ""
1134
+
1135
+ #: includes/i18n.php:326
1136
+ msgid "Verification mail was just sent to %s. If you can't find it after 5 min, please check your spam box."
1137
+ msgstr ""
1138
+
1139
+ #: includes/i18n.php:327
1140
+ msgid "Just letting you know that the add-ons information of %s is being pulled from an external server."
1141
+ msgstr ""
1142
+
1143
+ #: includes/i18n.php:328
1144
+ msgid "No credit card required"
1145
+ msgstr ""
1146
+
1147
+ #: includes/i18n.php:329
1148
+ msgid "Premium plugin version was successfully activated."
1149
+ msgstr ""
1150
+
1151
+ #: includes/i18n.php:330
1152
+ msgid "The upgrade of %s was successfully completed."
1153
+ msgstr ""
1154
+
1155
+ #: includes/i18n.php:331
1156
+ msgid "Your account was successfully activated with the %s plan."
1157
+ msgstr ""
1158
+
1159
+ #: includes/i18n.php:332
1160
+ msgid "Download the latest %s version now"
1161
+ msgstr ""
1162
+
1163
+ #: includes/i18n.php:333
1164
+ msgid "Please follow these steps to complete the upgrade"
1165
+ msgstr ""
1166
+
1167
+ #: includes/i18n.php:334
1168
+ msgid "Download the latest %s version"
1169
+ msgstr ""
1170
+
1171
+ #: includes/i18n.php:335
1172
+ msgid "Download the latest version"
1173
+ msgstr ""
1174
+
1175
+ #: includes/i18n.php:336
1176
+ msgid "Deactivate the free version"
1177
+ msgstr ""
1178
+
1179
+ #: includes/i18n.php:337
1180
+ msgid "Upload and activate the downloaded version"
1181
+ msgstr ""
1182
+
1183
+ #: includes/i18n.php:338
1184
+ msgid "How to upload and activate?"
1185
+ msgstr ""
1186
+
1187
+ #: includes/i18n.php:339
1188
+ msgctxt "%s - product name, e.g. Facebook add-on was successfully..."
1189
+ msgid "%s Add-on was successfully purchased."
1190
+ msgstr ""
1191
+
1192
+ #: includes/i18n.php:341
1193
+ msgid "Your %s Add-on plan was successfully upgraded."
1194
+ msgstr ""
1195
+
1196
+ #: includes/i18n.php:342
1197
+ msgid "Your email has been successfully verified - you are AWESOME!"
1198
+ msgstr ""
1199
+
1200
+ #: includes/i18n.php:343
1201
+ msgid "Your plan was successfully upgraded."
1202
+ msgstr ""
1203
+
1204
+ #: includes/i18n.php:344
1205
+ msgid "Your plan was successfully changed to %s."
1206
+ msgstr ""
1207
+
1208
+ #: includes/i18n.php:345
1209
+ msgid "Your license has expired. You can still continue using the free plugin forever."
1210
+ msgstr ""
1211
+
1212
+ #: includes/i18n.php:346
1213
+ msgid "Your license has been cancelled. If you think it's a mistake, please contact support."
1214
+ msgstr ""
1215
+
1216
+ #: includes/i18n.php:347
1217
+ msgid "Your trial has been successfully started."
1218
+ msgstr ""
1219
+
1220
+ #: includes/i18n.php:348
1221
+ msgid "Your license was successfully activated."
1222
+ msgstr ""
1223
+
1224
+ #: includes/i18n.php:349
1225
+ msgid "It looks like your site currently doesn't have an active license."
1226
+ msgstr ""
1227
+
1228
+ #: includes/i18n.php:350
1229
+ msgid "Your license was successfully deactivated, you are back to the %s plan."
1230
+ msgstr ""
1231
+
1232
+ #: includes/i18n.php:351
1233
+ msgid "It looks like the license deactivation failed."
1234
+ msgstr ""
1235
+
1236
+ #: includes/i18n.php:352
1237
+ msgid "It looks like the license could not be activated."
1238
+ msgstr ""
1239
+
1240
+ #: includes/i18n.php:353
1241
+ msgid "Error received from the server:"
1242
+ msgstr ""
1243
+
1244
+ #: includes/i18n.php:354
1245
+ msgid "Your trial has expired. You can still continue using all our free features."
1246
+ msgstr ""
1247
+
1248
+ #: includes/i18n.php:355
1249
+ msgid "Your plan was successfully downgraded. Your %s plan license will expire in %s."
1250
+ msgstr ""
1251
+
1252
+ #: includes/i18n.php:356
1253
+ msgid "Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes."
1254
+ msgstr ""
1255
+
1256
+ #: includes/i18n.php:357
1257
+ msgid "It looks like you are not in trial mode anymore so there's nothing to cancel :)"
1258
+ msgstr ""
1259
+
1260
+ #: includes/i18n.php:358
1261
+ msgid "Your %s free trial was successfully cancelled."
1262
+ msgstr ""
1263
+
1264
+ #: includes/i18n.php:359
1265
+ msgctxt "%s - numeric version number"
1266
+ msgid "Version %s was released."
1267
+ msgstr ""
1268
+
1269
+ #: includes/i18n.php:360
1270
+ msgid "Please download %s."
1271
+ msgstr ""
1272
+
1273
+ #: includes/i18n.php:361
1274
+ msgctxt "%s - plan name, as the latest professional version here"
1275
+ msgid "the latest %s version here"
1276
+ msgstr ""
1277
+
1278
+ #: includes/i18n.php:363
1279
+ msgid "How do you like %s so far? Test all our %s premium features with a %d-day free trial."
1280
+ msgstr ""
1281
+
1282
+ #: includes/i18n.php:364
1283
+ msgctxt "call to action"
1284
+ msgid "Start free trial"
1285
+ msgstr ""
1286
+
1287
+ #: includes/i18n.php:365
1288
+ msgid "Starting trial"
1289
+ msgstr ""
1290
+
1291
+ #: includes/i18n.php:366
1292
+ msgid "Please wait"
1293
+ msgstr ""
1294
+
1295
+ #: includes/i18n.php:367
1296
+ msgid "Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes."
1297
+ msgstr ""
1298
+
1299
+ #: includes/i18n.php:368
1300
+ msgid "You already utilized a trial before."
1301
+ msgstr ""
1302
+
1303
+ #: includes/i18n.php:369
1304
+ msgid "You are already running the plugin in a trial mode."
1305
+ msgstr ""
1306
+
1307
+ #: includes/i18n.php:370
1308
+ msgid "Plan %s do not exist, therefore, can't start a trial."
1309
+ msgstr ""
1310
+
1311
+ #: includes/i18n.php:371
1312
+ msgid "Plan %s does not support a trial period."
1313
+ msgstr ""
1314
+
1315
+ #: includes/i18n.php:372
1316
+ msgid "None of the plugin's plans supports a trial period."
1317
+ msgstr ""
1318
+
1319
+ #: includes/i18n.php:373
1320
+ msgid "Unexpected API error. Please contact the plugin's author with the following error."
1321
+ msgstr ""
1322
+
1323
+ #: includes/i18n.php:374
1324
+ msgid "No commitment for %s days - cancel anytime!"
1325
+ msgstr ""
1326
+
1327
+ #: includes/i18n.php:375
1328
+ 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."
1329
+ msgstr ""
1330
+
1331
+ #: includes/i18n.php:376
1332
+ msgid "Couldn't activate %s."
1333
+ msgstr ""
1334
+
1335
+ #: includes/i18n.php:377
1336
+ msgid "Please contact us with the following message:"
1337
+ msgstr ""
1338
+
1339
+ #: includes/i18n.php:378
1340
+ 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."
1341
+ msgstr ""
1342
+
1343
+ #: includes/i18n.php:379
1344
+ msgid "Please contact us here"
1345
+ msgstr ""
1346
+
1347
+ #: includes/i18n.php:380
1348
+ msgid "I have upgraded my account but when I try to Sync the License, the plan remains %s."
1349
+ msgstr ""
1350
+
1351
+ #: includes/i18n.php:383
1352
+ msgid "From unknown reason, the API connectivity test failed."
1353
+ msgstr ""
1354
+
1355
+ #: includes/i18n.php:384
1356
+ 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?"
1357
+ msgstr ""
1358
+
1359
+ #: includes/i18n.php:385
1360
+ msgid "We use PHP cURL library for the API calls, which is a very common library and usually installed out of the box. Unfortunately, cURL is not installed on your server."
1361
+ msgstr ""
1362
+
1363
+ #: includes/i18n.php:386
1364
+ msgid "From unknown reason, CloudFlare, the firewall we use, blocks the connection."
1365
+ msgstr ""
1366
+
1367
+ #: includes/i18n.php:387
1368
+ msgctxt "as pluginX requires an access to our API"
1369
+ msgid "%s requires an access to our API."
1370
+ msgstr ""
1371
+
1372
+ #: includes/i18n.php:389
1373
+ msgid "It looks like your server is using Squid ACL (access control lists), which blocks the connection."
1374
+ msgstr ""
1375
+
1376
+ #: includes/i18n.php:390
1377
+ msgid "I don't know what is Squid or ACL, help me!"
1378
+ msgstr ""
1379
+
1380
+ #: includes/i18n.php:391, includes/i18n.php:395
1381
+ 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."
1382
+ msgstr ""
1383
+
1384
+ #: includes/i18n.php:392
1385
+ msgid "I'm a system administrator"
1386
+ msgstr ""
1387
+
1388
+ #: includes/i18n.php:393
1389
+ msgid "Great, please whitelist the following domains: %s. Once you are done, deactivate the plugin and activate it again."
1390
+ msgstr ""
1391
+
1392
+ #: includes/i18n.php:394
1393
+ msgid "I don't know what is cURL or how to install it, help me!"
1394
+ msgstr ""
1395
+
1396
+ #: includes/i18n.php:396
1397
+ msgid "Great, please install cURL and enable it in your php.ini file. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the plugin and reactivate it back again."
1398
+ msgstr ""
1399
+
1400
+ #: includes/i18n.php:397
1401
+ 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."
1402
+ msgstr ""
1403
+
1404
+ #: includes/i18n.php:398
1405
+ msgid "Sorry for the inconvenience and we are here to help if you give us a chance."
1406
+ msgstr ""
1407
+
1408
+ #: includes/i18n.php:399
1409
+ msgid "Yes - I'm giving you a chance to fix it"
1410
+ msgstr ""
1411
+
1412
+ #: includes/i18n.php:400
1413
+ 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."
1414
+ msgstr ""
1415
+
1416
+ #: includes/i18n.php:401
1417
+ msgid "Let's try your previous version"
1418
+ msgstr ""
1419
+
1420
+ #: includes/i18n.php:402
1421
+ msgid "Uninstall this version and install the previous one."
1422
+ msgstr ""
1423
+
1424
+ #: includes/i18n.php:403
1425
+ msgid "That's exhausting, please deactivate"
1426
+ msgstr ""
1427
+
1428
+ #: includes/i18n.php:404
1429
+ msgid "We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future."
1430
+ msgstr ""
1431
+
1432
+ #: includes/i18n.php:405
1433
+ 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."
1434
+ msgstr ""
1435
+
1436
+ #: includes/i18n.php:406
1437
+ msgctxt "%1s - plugin title, %2s - API domain"
1438
+ msgid "Your server is blocking the access to Freemius' API, which is crucial for %1s synchronization. Please contact your host to whitelist %2s"
1439
+ msgstr ""
1440
+
1441
+ #: includes/i18n.php:408
1442
+ msgid "It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again."
1443
+ msgstr ""
1444
+
1445
+ #: includes/i18n.php:411
1446
+ 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."
1447
+ msgstr ""
1448
+
1449
+ #: includes/i18n.php:412
1450
+ msgid "Thanks for confirming the ownership change. An email was just sent to %s for final approval."
1451
+ msgstr ""
1452
+
1453
+ #: includes/i18n.php:413
1454
+ msgid "%s is the new owner of the account."
1455
+ msgstr ""
1456
+
1457
+ #: includes/i18n.php:415
1458
+ msgctxt "addonX cannot run without pluginY"
1459
+ msgid "%s cannot run without %s."
1460
+ msgstr ""
1461
+
1462
+ #: includes/i18n.php:417
1463
+ msgctxt "addonX cannot run..."
1464
+ msgid "%s cannot run without the plugin."
1465
+ msgstr ""
1466
+
1467
+ #: includes/i18n.php:418
1468
+ msgctxt "pluginX activation was successfully..."
1469
+ msgid "%s activation was successfully completed."
1470
+ msgstr ""
1471
+
1472
+ #: includes/i18n.php:420
1473
+ msgctxt "Plugin installer section title"
1474
+ msgid "Features & Pricing"
1475
+ msgstr ""
1476
+
1477
+ #: includes/i18n.php:421
1478
+ msgid "Add-on must be deployed to WordPress.org or Freemius."
1479
+ msgstr ""
1480
+
1481
+ #: includes/i18n.php:422
1482
+ msgid "Paid add-on must be deployed to Freemius."
1483
+ msgstr ""
1484
+
1485
+ #: includes/i18n.php:426
1486
+ msgid "%s is a premium only add-on. You have to purchase a license first before activating the plugin."
1487
+ msgstr ""
1488
+
1489
+ #: includes/i18n.php:427
1490
+ 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."
1491
+ msgstr ""
1492
+
1493
+ #: includes/i18n.php:432
1494
+ msgctxt "as every month"
1495
+ msgid "Monthly"
1496
+ msgstr ""
1497
+
1498
+ #: includes/i18n.php:433
1499
+ msgctxt "as monthly period"
1500
+ msgid "mo"
1501
+ msgstr ""
1502
+
1503
+ #: includes/i18n.php:434
1504
+ msgctxt "as once a year"
1505
+ msgid "Annual"
1506
+ msgstr ""
1507
+
1508
+ #: includes/i18n.php:435
1509
+ msgctxt "as once a year"
1510
+ msgid "Annually"
1511
+ msgstr ""
1512
+
1513
+ #: includes/i18n.php:436
1514
+ msgctxt "as once a year"
1515
+ msgid "Once"
1516
+ msgstr ""
1517
+
1518
+ #: includes/i18n.php:437
1519
+ msgctxt "as annual period"
1520
+ msgid "year"
1521
+ msgstr ""
1522
+
1523
+ #: includes/i18n.php:438
1524
+ msgid "Lifetime"
1525
+ msgstr ""
1526
+
1527
+ #: includes/i18n.php:439
1528
+ msgctxt "e.g. the best product"
1529
+ msgid "Best"
1530
+ msgstr ""
1531
+
1532
+ #: includes/i18n.php:44