Version Description
Release Date - 08 February 2018
- Fixed Fatal error: if $product is not WooCommerce product
- Fixed an issue when "Add to Wishlist" button didn't appear on a product details page for products without price
- Fixed text domains for some strings
- Fixed an issue with displaying SKU attribute after adding products to Wishlist from a catalog
- Added filters tinvwl_addtowishlist_login_page and tinvwl_addtowishlist_return_ajax that will be helpful to override "Require Login" popup.
- Improved variable products processing when adding to Wishlist
- Improved compatibility with WooCommerce 3.3.x
- Added support for WP Multilang plugin
- Added support for WooCommerce TM Extra Product Options plugin
Download this release
Release Info
Developer | templateinvaders |
Plugin | WooCommerce Wishlist Plugin |
Version | 1.6.0 |
Comparing to | |
See all releases |
Code changes from version 1.5.14 to 1.6.0
- admin/settings/general.class.php +715 -715
- freemius/LICENSE.txt +673 -673
- freemius/README.md +253 -253
- freemius/assets/css/admin/account.css +1 -1
- freemius/assets/css/admin/add-ons.css +2 -2
- freemius/assets/css/admin/affiliation.css +1 -0
- freemius/assets/css/admin/checkout.css +1 -1
- freemius/assets/css/admin/common.css +2 -2
- freemius/assets/css/admin/connect.css +1 -1
- freemius/assets/css/admin/deactivation-feedback.css +1 -1
- freemius/assets/css/admin/debug.css +1 -1
- freemius/assets/css/admin/dialog-boxes.css +2 -2
- freemius/assets/css/admin/index.php +3 -0
- freemius/assets/css/admin/license-activation.css +1 -1
- freemius/assets/css/common.css +0 -1
- freemius/assets/css/customizer.css +1 -1
- freemius/assets/css/index.php +3 -0
- freemius/assets/img/index.php +3 -0
- freemius/assets/index.php +2 -2
- freemius/assets/js/index.php +3 -0
- freemius/assets/js/nojquery.ba-postmessage.js +139 -139
- freemius/assets/js/nojquery.ba-postmessage.min.js +11 -11
- freemius/assets/js/postmessage.js +134 -134
- freemius/assets/scss/_colors.scss +65 -65
- freemius/assets/scss/_mixins.scss +269 -282
- freemius/assets/scss/admin/_ajax-loader.scss +48 -48
- freemius/assets/scss/admin/_auto-install.scss +32 -32
- freemius/assets/scss/admin/_deactivation-feedback.scss +54 -54
- freemius/assets/scss/admin/_license-activation.scss +6 -6
- freemius/assets/scss/admin/_license-key-resend.scss +68 -68
- freemius/assets/scss/admin/_modal-common.scss +185 -185
- freemius/assets/scss/admin/_themes.scss +20 -20
- freemius/assets/scss/admin/account.scss +255 -255
- freemius/assets/scss/admin/add-ons.scss +448 -448
- freemius/assets/scss/admin/affiliation.scss +97 -0
- freemius/assets/scss/admin/checkout.scss +4 -4
- freemius/assets/scss/admin/debug.scss +134 -134
- freemius/assets/scss/admin/dialog-boxes.scss +6 -6
- freemius/assets/scss/admin/index.php +3 -0
- freemius/assets/scss/customizer.scss +124 -124
- freemius/assets/scss/index.php +3 -0
- freemius/config.php +331 -328
- freemius/includes/class-freemius-abstract.php +596 -596
- freemius/includes/class-freemius.php +1022 -347
- freemius/includes/class-fs-logger.php +687 -687
- freemius/includes/class-fs-plugin-updater.php +12 -14
- freemius/includes/class-fs-security.php +85 -85
- freemius/includes/customizer/class-fs-customizer-support-section.php +101 -101
- freemius/includes/customizer/class-fs-customizer-upsell-control.php +156 -156
- freemius/includes/customizer/index.php +3 -0
- freemius/includes/debug/class-fs-debug-bar-panel.php +64 -64
- freemius/includes/debug/debug-bar-start.php +51 -51
- freemius/includes/debug/index.php +2 -2
- freemius/includes/entities/class-fs-affiliate-terms.php +128 -0
- freemius/includes/entities/class-fs-affiliate.php +84 -0
- freemius/includes/entities/class-fs-billing.php +94 -94
- freemius/includes/entities/class-fs-entity.php +148 -148
- freemius/includes/entities/class-fs-payment.php +93 -93
- freemius/includes/entities/class-fs-plugin-info.php +33 -33
- freemius/includes/entities/class-fs-plugin-license.php +224 -224
- freemius/includes/entities/class-fs-plugin-plan.php +144 -144
- freemius/includes/entities/class-fs-plugin-tag.php +23 -23
- freemius/includes/entities/class-fs-plugin.php +116 -95
- freemius/includes/entities/class-fs-pricing.php +140 -140
- freemius/includes/entities/class-fs-scope-entity.php +28 -28
- freemius/includes/entities/class-fs-site.php +147 -147
- freemius/includes/entities/class-fs-subscription.php +124 -124
- freemius/includes/entities/class-fs-user.php +61 -61
- freemius/includes/entities/index.php +2 -2
- freemius/includes/fs-core-functions.php +1097 -653
- freemius/includes/fs-essential-functions.php +496 -493
- freemius/includes/fs-plugin-info-dialog.php +98 -56
- freemius/includes/i18n.php +50 -2
- freemius/includes/index.php +2 -2
- freemius/includes/l10n.php +48 -268
- freemius/includes/managers/class-fs-admin-menu-manager.php +849 -848
- freemius/includes/managers/class-fs-cache-manager.php +280 -279
- freemius/includes/managers/class-fs-key-value-storage.php +327 -327
- freemius/includes/managers/class-fs-license-manager.php +103 -103
- freemius/includes/managers/class-fs-option-manager.php +352 -301
- freemius/includes/managers/class-fs-plan-manager.php +161 -161
- freemius/includes/managers/class-fs-plugin-manager.php +219 -219
- freemius/includes/managers/index.php +2 -2
- freemius/includes/sdk/Exceptions/index.php +2 -2
- freemius/includes/sdk/FreemiusWordPress.php +26 -19
- freemius/includes/sdk/LICENSE.txt +340 -340
- freemius/includes/sdk/index.php +2 -2
- freemius/includes/supplements/fs-essential-functions-1.1.7.1.php +47 -47
- freemius/includes/supplements/index.php +2 -2
- freemius/index.php +2 -2
- freemius/languages/freemius-da_DK.po +1826 -1826
- freemius/languages/freemius-en.mo +0 -0
- freemius/languages/freemius-en.po +0 -581
admin/settings/general.class.php
CHANGED
@@ -1,715 +1,715 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Admin settings class
|
4 |
-
*
|
5 |
-
* @since 1.0.0
|
6 |
-
* @package TInvWishlist\Admin
|
7 |
-
* @subpackage Settings
|
8 |
-
*/
|
9 |
-
|
10 |
-
// If this file is called directly, abort.
|
11 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
12 |
-
die;
|
13 |
-
}
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Admin settings class
|
17 |
-
*/
|
18 |
-
class TInvWL_Admin_Settings_General extends TInvWL_Admin_BaseSection {
|
19 |
-
|
20 |
-
/**
|
21 |
-
* Priority for admin menu
|
22 |
-
*
|
23 |
-
* @var integer
|
24 |
-
*/
|
25 |
-
public $priority = 20;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Menu array
|
29 |
-
*
|
30 |
-
* @return array
|
31 |
-
*/
|
32 |
-
function menu() {
|
33 |
-
return array(
|
34 |
-
'title' => __( 'General Settings', 'ti-woocommerce-wishlist' ),
|
35 |
-
'method' => array( $this, '_print_' ),
|
36 |
-
'slug' => '',
|
37 |
-
);
|
38 |
-
}
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Create sections for this settings
|
42 |
-
*
|
43 |
-
* @return array
|
44 |
-
*/
|
45 |
-
function constructor_data() {
|
46 |
-
add_action( $this->_n . '_section_general_before', array( $this, 'premium_features' ) );
|
47 |
-
$lists = get_pages( array( 'number' => 999999 ) ); // @codingStandardsIgnoreLine WordPress.VIP.RestrictedFunctions.get_pages
|
48 |
-
$page_list = array( '' => '' );
|
49 |
-
foreach ( $lists as $list ) {
|
50 |
-
$page_list[ $list->ID ] = $list->post_title;
|
51 |
-
}
|
52 |
-
|
53 |
-
return array(
|
54 |
-
array(
|
55 |
-
'id' => 'general',
|
56 |
-
'title' => __( 'General Settings', 'ti-woocommerce-wishlist' ),
|
57 |
-
'desc' => __( 'Wishlist page need to be selected so the plugin knows where it is. This page should have been created upon installation of the plugin, if not you will need to create it manually.', 'ti-woocommerce-wishlist' ),
|
58 |
-
'show_names' => true,
|
59 |
-
'fields' => array(
|
60 |
-
array(
|
61 |
-
'type' => 'text',
|
62 |
-
'name' => 'default_title',
|
63 |
-
'text' => __( 'Default Wishlist Name', 'ti-woocommerce-wishlist' ),
|
64 |
-
'std' => 'Default wishlist',
|
65 |
-
),
|
66 |
-
array(
|
67 |
-
'type' => 'select',
|
68 |
-
'name' => 'page_wishlist',
|
69 |
-
'text' => __( 'Wishlist Page', 'ti-woocommerce-wishlist' ),
|
70 |
-
'std' => '',
|
71 |
-
'options' => $page_list,
|
72 |
-
'validate' => FILTER_VALIDATE_INT,
|
73 |
-
),
|
74 |
-
array(
|
75 |
-
'type' => 'checkboxonoff',
|
76 |
-
'name' => 'require_login',
|
77 |
-
'text' => __( 'Require Login', '
|
78 |
-
'desc' => __( 'Disallows guests to use Wishlist functionality until they sign-in.', 'ti-woocommerce-wishlist' ),
|
79 |
-
'std' => false,
|
80 |
-
'extra' => array(
|
81 |
-
'tiwl-show' => '.tiwl-general-redirect-require-login',
|
82 |
-
),
|
83 |
-
),
|
84 |
-
array(
|
85 |
-
'type' => 'checkboxonoff',
|
86 |
-
'name' => 'redirect_require_login',
|
87 |
-
'text' => __( 'Redirect to Login Page', '
|
88 |
-
'desc' => '<span class="tiwl-button-show-notice-warning-popup"><strong>' . __( 'Currently this option could not be changed because "Show successful notice in popup" is disabled. Guests will be redirected automatically to a login page.', 'ti-woocommerce-wishlist' ) . '</strong></span><span class="tiwl-button-show-notice">' . __( 'If enabled, guests will be redirected to a login page once clicking the "Add to Wishlist" button or "Wishlist Products Counter" link. Otherwise a popup with login required notice will appear.', 'ti-woocommerce-wishlist' ) . '</span>',
|
89 |
-
'std' => false,
|
90 |
-
'class' => 'tiwl-general-redirect-require-login',
|
91 |
-
),
|
92 |
-
array(
|
93 |
-
'type' => 'checkboxonoff',
|
94 |
-
'name' => 'link_in_myaccount',
|
95 |
-
'text' => __( 'Show Link to Wishlist in my account', 'ti-woocommerce-wishlist' ),
|
96 |
-
'std' => true,
|
97 |
-
),
|
98 |
-
array(
|
99 |
-
'type' => 'checkboxonoff',
|
100 |
-
'name' => 'processing_autoremove',
|
101 |
-
'text' => __( 'Remove Product from Wishlist if added to cart', 'ti-woocommerce-wishlist' ),
|
102 |
-
'std' => true,
|
103 |
-
'extra' => array( 'tiwl-show' => '.tiwl-processing-autoremove-anyone' ),
|
104 |
-
),
|
105 |
-
array(
|
106 |
-
'type' => 'checkboxonoff',
|
107 |
-
'name' => 'processing_autoremove_anyone',
|
108 |
-
'text' => __( 'Remove by anyone', 'ti-woocommerce-wishlist' ),
|
109 |
-
'std' => false,
|
110 |
-
'class' => 'tiwl-processing-autoremove-anyone',
|
111 |
-
),
|
112 |
-
array(
|
113 |
-
'type' => 'checkboxonoff',
|
114 |
-
'name' => 'simple_flow',
|
115 |
-
'text' => __( 'Remove product from Wishlist on second click', 'ti-woocommerce-wishlist' ),
|
116 |
-
'std' => false,
|
117 |
-
'extra' => array(
|
118 |
-
'tiwl-show' => '.tiwl-general-simple-flow>td, .tiwl-button-simple-flow',
|
119 |
-
'tiwl-hide' => '.tiwl-general-simple-flow-hide>td',
|
120 |
-
),
|
121 |
-
),
|
122 |
-
array(
|
123 |
-
'type' => 'group',
|
124 |
-
'id' => 'show_notice',
|
125 |
-
),
|
126 |
-
array(
|
127 |
-
'type' => 'checkboxonoff',
|
128 |
-
'name' => 'show_notice',
|
129 |
-
'text' => __( 'Show successful notice in popup', 'ti-woocommerce-wishlist' ),
|
130 |
-
'desc' => __( 'This option allows to show/hide a popup with successful or error notices after addition or removing products from a Wishlist.', 'ti-woocommerce-wishlist' ),
|
131 |
-
'std' => true,
|
132 |
-
'extra' => array(
|
133 |
-
'tiwl-show' => '.tiwl-button-show-notice',
|
134 |
-
'tiwl-hide' => '.tiwl-button-show-notice-warning-popup',
|
135 |
-
),
|
136 |
-
),
|
137 |
-
array(
|
138 |
-
'type' => 'text',
|
139 |
-
'name' => 'text_browse',
|
140 |
-
'text' => __( '"View Wishlist" button Text', 'ti-woocommerce-wishlist' ),
|
141 |
-
'std' => 'View Wishlist',
|
142 |
-
'class' => 'tiwl-button-show-notice',
|
143 |
-
),
|
144 |
-
array(
|
145 |
-
'type' => 'checkboxonoff',
|
146 |
-
'name' => 'redirect',
|
147 |
-
'text' => __( 'Redirect to Wishlist', 'ti-woocommerce-wishlist' ),
|
148 |
-
'desc' => __( 'If enabled, user will be redirected to wishlist page after 5 sec from adding product to wishlist.', 'ti-woocommerce-wishlist' ),
|
149 |
-
'std' => true,
|
150 |
-
'class' => 'tiwl-button-show-notice',
|
151 |
-
),
|
152 |
-
array(
|
153 |
-
'type' => 'text',
|
154 |
-
'name' => 'text_added_to',
|
155 |
-
'text' => __( '"Product added to Wishlist" Text', 'ti-woocommerce-wishlist' ),
|
156 |
-
'std' => 'Product added to Wishlist',
|
157 |
-
'class' => 'tiwl-button-show-notice',
|
158 |
-
),
|
159 |
-
array(
|
160 |
-
'type' => 'text',
|
161 |
-
'name' => 'text_already_in',
|
162 |
-
'text' => __( '"Product already in Wishlist" Text', 'ti-woocommerce-wishlist' ),
|
163 |
-
'desc' => __( 'This notification will be shown if user will try to add a product that is already in the wishlist.', 'ti-woocommerce-wishlist' ),
|
164 |
-
'std' => 'Product already in Wishlist',
|
165 |
-
'class' => 'tiwl-button-show-notice tiwl-general-simple-flow-hide',
|
166 |
-
),
|
167 |
-
array(
|
168 |
-
'type' => 'text',
|
169 |
-
'name' => 'text_removed_from',
|
170 |
-
'text' => __( '"Product removed from Wishlist" Text', 'ti-woocommerce-wishlist' ),
|
171 |
-
'desc' => __( 'This notification will be shown once the product is removed from Wishlist on a single or a catalog page.', 'ti-woocommerce-wishlist' ),
|
172 |
-
'std' => 'Product removed from Wishlist',
|
173 |
-
'class' => 'tiwl-button-show-notice tiwl-general-simple-flow',
|
174 |
-
),
|
175 |
-
),
|
176 |
-
),
|
177 |
-
array(
|
178 |
-
'id' => 'page',
|
179 |
-
'title' => __( 'Wishlist Page Options', 'ti-woocommerce-wishlist' ),
|
180 |
-
'desc' => __( 'Coming soon', 'ti-woocommerce-wishlist' ),
|
181 |
-
'show_names' => true,
|
182 |
-
'style' => 'display:none;',
|
183 |
-
'fields' => array(
|
184 |
-
array(
|
185 |
-
'type' => 'select',
|
186 |
-
'name' => 'wishlist',
|
187 |
-
'text' => __( 'My Wishlist', 'ti-woocommerce-wishlist' ),
|
188 |
-
'std' => '',
|
189 |
-
'options' => $page_list,
|
190 |
-
'validate' => FILTER_VALIDATE_INT,
|
191 |
-
),
|
192 |
-
),
|
193 |
-
),
|
194 |
-
array(
|
195 |
-
'id' => 'processing',
|
196 |
-
'title' => __( 'Wishlist Processing Options', 'ti-woocommerce-wishlist' ),
|
197 |
-
'desc' => __( 'Coming soon', 'ti-woocommerce-wishlist' ),
|
198 |
-
'style' => 'display:none;',
|
199 |
-
'show_names' => true,
|
200 |
-
'fields' => array(
|
201 |
-
array(
|
202 |
-
'type' => 'checkboxonoff',
|
203 |
-
'name' => 'autoremove',
|
204 |
-
'text' => __( 'Automatic removal', 'ti-woocommerce-wishlist' ),
|
205 |
-
'std' => true,
|
206 |
-
'extra' => array( 'tiwl-show' => '.tiwl-processing-autoremove' ),
|
207 |
-
),
|
208 |
-
array(
|
209 |
-
'type' => 'select',
|
210 |
-
'name' => 'autoremove_status',
|
211 |
-
'text' => __( 'Remove condition', 'ti-woocommerce-wishlist' ),
|
212 |
-
'std' => 'tinvwl-addcart',
|
213 |
-
'options' => array(
|
214 |
-
'tinvwl-addcart' => __( 'Add to Cart', 'ti-woocommerce-wishlist' ),
|
215 |
-
),
|
216 |
-
'class' => 'tiwl-processing-autoremove',
|
217 |
-
),
|
218 |
-
array(
|
219 |
-
'type' => 'checkboxonoff',
|
220 |
-
'name' => 'autoremove_anyone',
|
221 |
-
'text' => __( 'Remove by anyone', 'ti-woocommerce-wishlist' ),
|
222 |
-
'std' => false,
|
223 |
-
'class' => 'tiwl-processing-autoremove',
|
224 |
-
),
|
225 |
-
),
|
226 |
-
),
|
227 |
-
array(
|
228 |
-
'id' => 'add_to_wishlist',
|
229 |
-
'title' => __( 'Product page "Add to Wishlist" Button Settings', 'ti-woocommerce-wishlist' ),
|
230 |
-
'show_names' => true,
|
231 |
-
'fields' => array(
|
232 |
-
array(
|
233 |
-
'type' => 'select',
|
234 |
-
'name' => 'position',
|
235 |
-
'text' => __( 'Button position', 'ti-woocommerce-wishlist' ),
|
236 |
-
'desc' => __( 'Add this shortcode <code>[ti_wishlists_addtowishlist]</code> anywhere on product page, if you have chosen custom position for product button. You will have to do this for each product.', 'ti-woocommerce-wishlist' ),
|
237 |
-
'std' => 'after',
|
238 |
-
'options' => array(
|
239 |
-
'after' => __( 'After "Add to Cart" button', 'ti-woocommerce-wishlist' ),
|
240 |
-
'before' => __( 'Before "Add to Cart" button', 'ti-woocommerce-wishlist' ),
|
241 |
-
'shortcode' => __( 'Custom position with code', 'ti-woocommerce-wishlist' ),
|
242 |
-
),
|
243 |
-
),
|
244 |
-
array(
|
245 |
-
'type' => 'select',
|
246 |
-
'name' => 'type',
|
247 |
-
'text' => __( 'Button type', 'ti-woocommerce-wishlist' ),
|
248 |
-
'std' => 'link',
|
249 |
-
'options' => array(
|
250 |
-
'link' => __( 'Link', 'ti-woocommerce-wishlist' ),
|
251 |
-
'button' => __( 'Button', 'ti-woocommerce-wishlist' ),
|
252 |
-
),
|
253 |
-
),
|
254 |
-
array(
|
255 |
-
'type' => 'select',
|
256 |
-
'name' => 'icon',
|
257 |
-
'text' => __( '"Add to Wishlist" Icon', 'ti-woocommerce-wishlist' ),
|
258 |
-
'desc' => __( 'You can choose from our predefined icons or upload your custom icon. Custom icon size is limited to 16x16 px.', 'ti-woocommerce-wishlist' ),
|
259 |
-
'std' => '',
|
260 |
-
'options' => array(
|
261 |
-
'' => __( 'None', 'ti-woocommerce-wishlist' ),
|
262 |
-
'heart' => __( 'Heart', 'ti-woocommerce-wishlist' ),
|
263 |
-
'heart-plus' => __( 'Heart+', 'ti-woocommerce-wishlist' ),
|
264 |
-
'custom' => __( 'Custom', 'ti-woocommerce-wishlist' ),
|
265 |
-
),
|
266 |
-
'extra' => array(
|
267 |
-
'class' => 'tiwl-button-icon',
|
268 |
-
'tiwl-show' => '.tiwl-button-icon-custom',
|
269 |
-
'tiwl-hide' => '.tiwl-button-icon-style',
|
270 |
-
'tiwl-value' => 'custom',
|
271 |
-
),
|
272 |
-
),
|
273 |
-
array(
|
274 |
-
'type' => 'uploadfile',
|
275 |
-
'name' => 'icon_upload',
|
276 |
-
'std' => '',
|
277 |
-
'text' => ' ',
|
278 |
-
'class' => 'tiwl-button-icon-custom',
|
279 |
-
'extra' => array(
|
280 |
-
'button' => array(
|
281 |
-
'value' => __( 'Upload', 'ti-woocommerce-wishlist' ),
|
282 |
-
),
|
283 |
-
'type' => array( 'image' ),
|
284 |
-
),
|
285 |
-
),
|
286 |
-
array(
|
287 |
-
'type' => 'select',
|
288 |
-
'name' => 'icon_style',
|
289 |
-
'std' => 'black',
|
290 |
-
'text' => __( '"Add to Wishlist" Icon Color', 'ti-woocommerce-wishlist' ),
|
291 |
-
'options' => array(
|
292 |
-
'black' => __( 'Black', 'ti-woocommerce-wishlist' ),
|
293 |
-
'white' => __( 'White', 'ti-woocommerce-wishlist' ),
|
294 |
-
),
|
295 |
-
'class' => 'tiwl-button-icon-style',
|
296 |
-
),
|
297 |
-
array(
|
298 |
-
'type' => 'text',
|
299 |
-
'name' => 'text',
|
300 |
-
'text' => __( '"Add to Wishlist" button Text', 'ti-woocommerce-wishlist' ),
|
301 |
-
'std' => 'Add to Wishlist',
|
302 |
-
),
|
303 |
-
array(
|
304 |
-
'type' => 'text',
|
305 |
-
'name' => 'text_remove',
|
306 |
-
'text' => __( '"Remove from Wishlist" Button Text', 'ti-woocommerce-wishlist' ),
|
307 |
-
'std' => 'Remove from Wishlist',
|
308 |
-
'class' => 'tiwl-button-simple-flow',
|
309 |
-
),
|
310 |
-
),
|
311 |
-
),
|
312 |
-
array(
|
313 |
-
'id' => 'add_to_wishlist_catalog',
|
314 |
-
'title' => __( 'Product listing Button Settings', 'ti-woocommerce-wishlist' ),
|
315 |
-
'desc' => __( 'These are separate settings for the "Add to Wishlist" button on a product listing (Shop page, categories, etc.). You can also adjust button and text colors, size, etc. in a <code>TI Wishlist > Style Options.</code>', 'ti-woocommerce-wishlist' ),
|
316 |
-
'show_names' => true,
|
317 |
-
'fields' => array(
|
318 |
-
array(
|
319 |
-
'type' => 'checkboxonoff',
|
320 |
-
'name' => 'show_in_loop',
|
321 |
-
'text' => __( 'Show in Product Listing', 'ti-woocommerce-wishlist' ),
|
322 |
-
'std' => true,
|
323 |
-
'extra' => array(
|
324 |
-
'tiwl-show' => '.tiwl-buttoncat-button',
|
325 |
-
),
|
326 |
-
),
|
327 |
-
array(
|
328 |
-
'type' => 'group',
|
329 |
-
'id' => 'add_to_wishlist_catalog',
|
330 |
-
'class' => 'tiwl-buttoncat-button',
|
331 |
-
'style' => 'border-top: 0px; padding-top: 0px;',
|
332 |
-
),
|
333 |
-
array(
|
334 |
-
'type' => 'select',
|
335 |
-
'name' => 'position',
|
336 |
-
'text' => __( 'Button position', 'ti-woocommerce-wishlist' ),
|
337 |
-
'std' => 'after',
|
338 |
-
'options' => array(
|
339 |
-
'after' => __( 'After "Add to Cart" button', 'ti-woocommerce-wishlist' ),
|
340 |
-
'before' => __( 'Before "Add to Cart" button', 'ti-woocommerce-wishlist' ),
|
341 |
-
'above_thumb' => __( 'Above Thumbnail', 'ti-woocommerce-wishlist' ),
|
342 |
-
'shortcode' => __( 'Custom position with code', 'ti-woocommerce-wishlist' ),
|
343 |
-
),
|
344 |
-
'desc' => __( 'Note: if "Custom position with code" option is applied, the "Add to Wishlist" button should be added into template using <code>do_shortcode()</code> function like this:<br /><code>do_shortcode("[ti_wishlists_addtowishlist loop=yes]")</code>', 'ti-woocommerce-wishlist' ),
|
345 |
-
),
|
346 |
-
array(
|
347 |
-
'type' => 'select',
|
348 |
-
'name' => 'type',
|
349 |
-
'text' => __( 'Button type', 'ti-woocommerce-wishlist' ),
|
350 |
-
'std' => 'button',
|
351 |
-
'options' => array(
|
352 |
-
'link' => __( 'Link', 'ti-woocommerce-wishlist' ),
|
353 |
-
'button' => __( 'Button', 'ti-woocommerce-wishlist' ),
|
354 |
-
),
|
355 |
-
),
|
356 |
-
array(
|
357 |
-
'type' => 'select',
|
358 |
-
'name' => 'icon',
|
359 |
-
'text' => __( '"Add to Wishlist" Icon', 'ti-woocommerce-wishlist' ),
|
360 |
-
'std' => '',
|
361 |
-
'options' => array(
|
362 |
-
'' => __( 'None', 'ti-woocommerce-wishlist' ),
|
363 |
-
'heart' => __( 'Heart', 'ti-woocommerce-wishlist' ),
|
364 |
-
'heart-plus' => __( 'Heart+', 'ti-woocommerce-wishlist' ),
|
365 |
-
'custom' => __( 'Custom', 'ti-woocommerce-wishlist' ),
|
366 |
-
),
|
367 |
-
'extra' => array(
|
368 |
-
'tiwl-show' => '.tiwl-buttoncat-icon-custom',
|
369 |
-
'tiwl-hide' => '.tiwl-buttoncat-icon-style',
|
370 |
-
'tiwl-value' => 'custom',
|
371 |
-
),
|
372 |
-
),
|
373 |
-
array(
|
374 |
-
'type' => 'uploadfile',
|
375 |
-
'name' => 'icon_upload',
|
376 |
-
'std' => '',
|
377 |
-
'text' => ' ',
|
378 |
-
'class' => 'tiwl-buttoncat-icon-custom',
|
379 |
-
'extra' => array(
|
380 |
-
'button' => array(
|
381 |
-
'value' => __( 'Upload', 'ti-woocommerce-wishlist' ),
|
382 |
-
),
|
383 |
-
'type' => array( 'image' ),
|
384 |
-
),
|
385 |
-
),
|
386 |
-
array(
|
387 |
-
'type' => 'select',
|
388 |
-
'name' => 'icon_style',
|
389 |
-
'std' => 'black',
|
390 |
-
'text' => __( '"Add to Wishlist" Icon Color', 'ti-woocommerce-wishlist' ),
|
391 |
-
'options' => array(
|
392 |
-
'black' => __( 'Black', 'ti-woocommerce-wishlist' ),
|
393 |
-
'white' => __( 'White', 'ti-woocommerce-wishlist' ),
|
394 |
-
),
|
395 |
-
'class' => 'tiwl-buttoncat-icon-style',
|
396 |
-
),
|
397 |
-
array(
|
398 |
-
'type' => 'text',
|
399 |
-
'name' => 'text',
|
400 |
-
'text' => __( '"Add to Wishlist" Text', 'ti-woocommerce-wishlist' ),
|
401 |
-
'std' => 'Add to Wishlist',
|
402 |
-
),
|
403 |
-
array(
|
404 |
-
'type' => 'text',
|
405 |
-
'name' => 'text_remove',
|
406 |
-
'text' => __( '"Remove from Wishlist" Button Text', 'ti-woocommerce-wishlist' ),
|
407 |
-
'std' => 'Remove from Wishlist',
|
408 |
-
'class' => 'tiwl-button-simple-flow',
|
409 |
-
),
|
410 |
-
),
|
411 |
-
),
|
412 |
-
array(
|
413 |
-
'id' => 'product_table',
|
414 |
-
'title' => __( 'Wishlist Product Settings', 'ti-woocommerce-wishlist' ),
|
415 |
-
'desc' => __( 'Following options allows you to choose what information/functionality to show/enable in wishlist table on wishlist page.', 'ti-woocommerce-wishlist' ),
|
416 |
-
'show_names' => true,
|
417 |
-
'fields' => array(
|
418 |
-
array(
|
419 |
-
'type' => 'checkboxonoff',
|
420 |
-
'name' => 'add_to_cart',
|
421 |
-
'text' => __( 'Show "Add to Cart" button', 'ti-woocommerce-wishlist' ),
|
422 |
-
'std' => true,
|
423 |
-
'extra' => array( 'tiwl-show' => '.tiwl-table-action-addcart' ),
|
424 |
-
),
|
425 |
-
array(
|
426 |
-
'type' => 'text',
|
427 |
-
'name' => 'text_add_to_cart',
|
428 |
-
'text' => __( '"Add to Cart" Text', 'ti-woocommerce-wishlist' ),
|
429 |
-
'std' => 'Add to Cart',
|
430 |
-
'class' => 'tiwl-table-action-addcart',
|
431 |
-
),
|
432 |
-
array(
|
433 |
-
'type' => 'checkboxonoff',
|
434 |
-
'name' => 'colm_price',
|
435 |
-
'text' => __( 'Show Unit price', 'ti-woocommerce-wishlist' ),
|
436 |
-
'std' => true,
|
437 |
-
),
|
438 |
-
array(
|
439 |
-
'type' => 'checkboxonoff',
|
440 |
-
'name' => 'colm_stock',
|
441 |
-
'text' => __( 'Show Stock status', 'ti-woocommerce-wishlist' ),
|
442 |
-
'std' => true,
|
443 |
-
),
|
444 |
-
array(
|
445 |
-
'type' => 'checkboxonoff',
|
446 |
-
'name' => 'colm_date',
|
447 |
-
'text' => __( 'Show Date of addition', 'ti-woocommerce-wishlist' ),
|
448 |
-
'std' => true,
|
449 |
-
),
|
450 |
-
),
|
451 |
-
),
|
452 |
-
array(
|
453 |
-
'id' => 'table',
|
454 |
-
'title' => __( 'Wishlist Table Settings', 'ti-woocommerce-wishlist' ),
|
455 |
-
'desc' => __( 'Following options will help user to manage and add products to cart from wishlist table in bulk.', 'ti-woocommerce-wishlist' ),
|
456 |
-
'show_names' => true,
|
457 |
-
'fields' => array(
|
458 |
-
array(
|
459 |
-
'type' => 'checkboxonoff',
|
460 |
-
'name' => 'colm_checkbox',
|
461 |
-
'text' => __( 'Show Checkboxes', 'ti-woocommerce-wishlist' ),
|
462 |
-
'std' => true,
|
463 |
-
'extra' => array( 'tiwl-show' => '.tiwl-table-cb-button' ),
|
464 |
-
),
|
465 |
-
array(
|
466 |
-
'type' => 'group',
|
467 |
-
'id' => 'cb_button',
|
468 |
-
'class' => 'tiwl-table-cb-button',
|
469 |
-
),
|
470 |
-
array(
|
471 |
-
'type' => 'checkboxonoff',
|
472 |
-
'name' => 'colm_actions',
|
473 |
-
'text' => __( 'Show Actions button', 'ti-woocommerce-wishlist' ),
|
474 |
-
'desc' => __( 'Bulk actions drop down at the bottom of wishlist table', 'ti-woocommerce-wishlist' ),
|
475 |
-
'std' => true,
|
476 |
-
),
|
477 |
-
array(
|
478 |
-
'type' => 'checkboxonoff',
|
479 |
-
'name' => 'add_select_to_cart',
|
480 |
-
'text' => __( 'Show "Add Selected to Cart" button', 'ti-woocommerce-wishlist' ),
|
481 |
-
'std' => true,
|
482 |
-
'extra' => array( 'tiwl-show' => '.tiwl-table-addcart-sel' ),
|
483 |
-
),
|
484 |
-
array(
|
485 |
-
'type' => 'text',
|
486 |
-
'name' => 'text_add_select_to_cart',
|
487 |
-
'text' => __( '"Add Selected to Cart" Button Text', 'ti-woocommerce-wishlist' ),
|
488 |
-
'std' => 'Add Selected to Cart',
|
489 |
-
'class' => 'tiwl-table-addcart-sel',
|
490 |
-
),
|
491 |
-
array(
|
492 |
-
'type' => 'group',
|
493 |
-
'id' => '_button',
|
494 |
-
),
|
495 |
-
array(
|
496 |
-
'type' => 'checkboxonoff',
|
497 |
-
'name' => 'add_all_to_cart',
|
498 |
-
'text' => __( 'Show "Add All to Cart" button', 'ti-woocommerce-wishlist' ),
|
499 |
-
'std' => true,
|
500 |
-
'extra' => array( 'tiwl-show' => '.tiwl-table-addcart-all' ),
|
501 |
-
),
|
502 |
-
array(
|
503 |
-
'type' => 'text',
|
504 |
-
'name' => 'text_add_all_to_cart',
|
505 |
-
'text' => __( '"Add All to Cart" Button Text', 'ti-woocommerce-wishlist' ),
|
506 |
-
'std' => 'Add All to Cart',
|
507 |
-
'class' => 'tiwl-table-addcart-all',
|
508 |
-
),
|
509 |
-
),
|
510 |
-
),
|
511 |
-
array(
|
512 |
-
'id' => 'social',
|
513 |
-
'show_names' => true,
|
514 |
-
'fields' => array(
|
515 |
-
array(
|
516 |
-
'type' => 'group',
|
517 |
-
'id' => 'social',
|
518 |
-
'desc' => __( 'Following options enable/disable Social share icons below wishlist table on wishlist page. Wishlist owner can easily share their wishlists using this button on social networks. Wishlist privacy should be set to public or shared status, private wishlists can\'t be shared.', 'ti-woocommerce-wishlist' ),
|
519 |
-
'class' => 'tinvwl-info-top',
|
520 |
-
),
|
521 |
-
array(
|
522 |
-
'type' => 'html',
|
523 |
-
'name' => 'social',
|
524 |
-
'text' => __( 'Social Networks Sharing Options', 'ti-woocommerce-wishlist' ),
|
525 |
-
'class' => 'tinvwl-header-row tinvwl-line-border',
|
526 |
-
),
|
527 |
-
array(
|
528 |
-
'type' => 'checkboxonoff',
|
529 |
-
'name' => 'facebook',
|
530 |
-
'text' => __( 'Show "Facebook" Button', 'ti-woocommerce-wishlist' ),
|
531 |
-
'std' => true,
|
532 |
-
),
|
533 |
-
array(
|
534 |
-
'type' => 'checkboxonoff',
|
535 |
-
'name' => 'twitter',
|
536 |
-
'text' => __( 'Show "Twitter" Button', 'ti-woocommerce-wishlist' ),
|
537 |
-
'std' => true,
|
538 |
-
),
|
539 |
-
array(
|
540 |
-
'type' => 'checkboxonoff',
|
541 |
-
'name' => 'pinterest',
|
542 |
-
'text' => __( 'Show "Pinterest" Button', 'ti-woocommerce-wishlist' ),
|
543 |
-
'std' => true,
|
544 |
-
),
|
545 |
-
array(
|
546 |
-
'type' => 'checkboxonoff',
|
547 |
-
'name' => 'google',
|
548 |
-
'text' => __( 'Show "Google+" Button', 'ti-woocommerce-wishlist' ),
|
549 |
-
'std' => true,
|
550 |
-
),
|
551 |
-
array(
|
552 |
-
'type' => 'checkboxonoff',
|
553 |
-
'name' => 'email',
|
554 |
-
'text' => __( 'Show "Share by Email" Button', 'ti-woocommerce-wishlist' ),
|
555 |
-
'std' => true,
|
556 |
-
),
|
557 |
-
array(
|
558 |
-
'type' => 'text',
|
559 |
-
'name' => 'share_on',
|
560 |
-
'text' => __( '"Share on" Text', 'ti-woocommerce-wishlist' ),
|
561 |
-
'std' => 'Share on',
|
562 |
-
),
|
563 |
-
array(
|
564 |
-
'type' => 'select',
|
565 |
-
'name' => 'icon_style',
|
566 |
-
'text' => __( 'Social Icons Color', 'ti-woocommerce-wishlist' ),
|
567 |
-
'options' => array(
|
568 |
-
'dark' => __( 'Dark', 'ti-woocommerce-wishlist' ),
|
569 |
-
'white' => __( 'White', 'ti-woocommerce-wishlist' ),
|
570 |
-
),
|
571 |
-
'validate' => FILTER_DEFAULT,
|
572 |
-
),
|
573 |
-
),
|
574 |
-
),
|
575 |
-
array(
|
576 |
-
'id' => 'topline',
|
577 |
-
'title' => __( 'Wishlist Products Counter', 'ti-woocommerce-wishlist' ),
|
578 |
-
'desc' => sprintf( __( 'Add this shortcode <code>[ti_wishlist_products_counter]</code> anywhere into a page content to show Wishlist Counter.<br/><br/>It can be also added as a widget <code>Wishlist Products Counter</code> under the <a href="%s">Appearance -> Widgets</a> section.', 'ti-woocommerce-wishlist' ), esc_url( admin_url( 'widgets.php' ) ) ),
|
579 |
-
'show_names' => true,
|
580 |
-
'fields' => array(
|
581 |
-
array(
|
582 |
-
'type' => 'select',
|
583 |
-
'name' => 'icon',
|
584 |
-
'text' => __( '"Wishlist" Icon', 'ti-woocommerce-wishlist' ),
|
585 |
-
'std' => '',
|
586 |
-
'options' => array(
|
587 |
-
'' => __( 'None', 'ti-woocommerce-wishlist' ),
|
588 |
-
'heart' => __( 'Heart', 'ti-woocommerce-wishlist' ),
|
589 |
-
'heart-plus' => __( 'Heart+', 'ti-woocommerce-wishlist' ),
|
590 |
-
'custom' => __( 'Custom', 'ti-woocommerce-wishlist' ),
|
591 |
-
),
|
592 |
-
'desc' => __( 'You can choose from our predefined icons or upload your custom icon. Custom icon size is limited to 16x16 px.', 'ti-woocommerce-wishlist' ),
|
593 |
-
'extra' => array(
|
594 |
-
'tiwl-show' => '.tiwl-dropdown-icon-custom',
|
595 |
-
'tiwl-hide' => '.tiwl-dropdown-icon-style',
|
596 |
-
'tiwl-value' => 'custom',
|
597 |
-
),
|
598 |
-
),
|
599 |
-
array(
|
600 |
-
'type' => 'uploadfile',
|
601 |
-
'name' => 'icon_upload',
|
602 |
-
'std' => '',
|
603 |
-
'text' => ' ',
|
604 |
-
'class' => 'tiwl-dropdown-icon-custom',
|
605 |
-
'extra' => array(
|
606 |
-
'button' => array(
|
607 |
-
'value' => __( 'Upload', 'ti-woocommerce-wishlist' ),
|
608 |
-
),
|
609 |
-
'type' => array( 'image' ),
|
610 |
-
),
|
611 |
-
),
|
612 |
-
array(
|
613 |
-
'type' => 'select',
|
614 |
-
'name' => 'icon_style',
|
615 |
-
'std' => 'black',
|
616 |
-
'text' => __( '"Wishlist" Icon Color', 'ti-woocommerce-wishlist' ),
|
617 |
-
'options' => array(
|
618 |
-
'black' => __( 'Black', 'ti-woocommerce-wishlist' ),
|
619 |
-
'white' => __( 'White', 'ti-woocommerce-wishlist' ),
|
620 |
-
),
|
621 |
-
'class' => 'tiwl-dropdown-icon-style',
|
622 |
-
),
|
623 |
-
array(
|
624 |
-
'type' => 'checkboxonoff',
|
625 |
-
'name' => 'show_text',
|
626 |
-
'text' => __( 'Show counter text', 'ti-woocommerce-wishlist' ),
|
627 |
-
'std' => true,
|
628 |
-
'extra' => array(
|
629 |
-
'tiwl-show' => '.tiwl-dropdown-text',
|
630 |
-
),
|
631 |
-
),
|
632 |
-
array(
|
633 |
-
'type' => 'text',
|
634 |
-
'name' => 'text',
|
635 |
-
'text' => __( 'Counter Text', 'ti-woocommerce-wishlist' ),
|
636 |
-
'std' => __( 'Wishlist - ', 'ti-woocommerce-wishlist' ),
|
637 |
-
'class' => 'tiwl-dropdown-text',
|
638 |
-
),
|
639 |
-
),
|
640 |
-
),
|
641 |
-
array(
|
642 |
-
'id' => 'save_buttons',
|
643 |
-
'class' => 'only-button',
|
644 |
-
'noform' => true,
|
645 |
-
'fields' => array(
|
646 |
-
array(
|
647 |
-
'type' => 'button_submit',
|
648 |
-
'name' => 'setting_save',
|
649 |
-
'std' => '<span><i class="fa fa-check"></i></span>' . __( 'Save Settings', 'ti-woocommerce-wishlist' ),
|
650 |
-
'extra' => array( 'class' => 'tinvwl-btn split status-btn-ok' ),
|
651 |
-
),
|
652 |
-
array(
|
653 |
-
'type' => 'button_submit',
|
654 |
-
'name' => 'setting_reset',
|
655 |
-
'std' => '<span><i class="fa fa-times"></i></span>' . __( 'Reset', 'ti-woocommerce-wishlist' ),
|
656 |
-
'extra' => array( 'class' => 'tinvwl-btn split status-btn-ok tinvwl-confirm-reset' ),
|
657 |
-
),
|
658 |
-
array(
|
659 |
-
'type' => 'button_submit_quick',
|
660 |
-
'name' => 'setting_save_quick',
|
661 |
-
'std' => '<span><i class="fa fa-floppy-o"></i></span>' . __( 'Save', 'ti-woocommerce-wishlist' ),
|
662 |
-
),
|
663 |
-
),
|
664 |
-
),
|
665 |
-
);
|
666 |
-
}
|
667 |
-
|
668 |
-
/**
|
669 |
-
* Load value from database
|
670 |
-
*
|
671 |
-
* @param array $sections Sections array.
|
672 |
-
*
|
673 |
-
* @return array
|
674 |
-
*/
|
675 |
-
function constructor_load( $sections ) {
|
676 |
-
$data = parent::constructor_load( $sections );
|
677 |
-
$data['general']['page_wishlist'] = $data['page']['wishlist'];
|
678 |
-
$data['general']['processing_autoremove'] = $data['processing']['autoremove'];
|
679 |
-
$data['general']['processing_autoremove_anyone'] = $data['processing']['autoremove_anyone'];
|
680 |
-
|
681 |
-
return $data;
|
682 |
-
}
|
683 |
-
|
684 |
-
/**
|
685 |
-
* Save value to database and flush rewrite.
|
686 |
-
*
|
687 |
-
* @param array $data Post section data.
|
688 |
-
*/
|
689 |
-
function constructor_save( $data ) {
|
690 |
-
parent::constructor_save( $data );
|
691 |
-
if ( empty( $data ) || ! is_array( $data ) ) {
|
692 |
-
return false;
|
693 |
-
}
|
694 |
-
tinv_update_option( 'page', 'wishlist', $data['general']['page_wishlist'] );
|
695 |
-
tinv_update_option( 'processing', 'autoremove', $data['general']['processing_autoremove'] );
|
696 |
-
tinv_update_option( 'processing', 'autoremove_anyone', $data['general']['processing_autoremove_anyone'] );
|
697 |
-
tinv_update_option( 'processing', 'autoremove_status', 'tinvwl-addcart' );
|
698 |
-
if ( filter_input( INPUT_POST, 'save_buttons-setting_reset' ) ) {
|
699 |
-
foreach ( $data as $key => $value ) {
|
700 |
-
if ( ! in_array( $key, array( 'page' ) ) ) {
|
701 |
-
$data[ $key ] = array();
|
702 |
-
}
|
703 |
-
}
|
704 |
-
parent::constructor_save( $data );
|
705 |
-
}
|
706 |
-
TInvWL_Public_TInvWL::update_rewrite_rules();
|
707 |
-
}
|
708 |
-
|
709 |
-
/**
|
710 |
-
* Show Premium Features sections
|
711 |
-
*/
|
712 |
-
function premium_features() {
|
713 |
-
TInvWL_View::view( 'premium-features' );
|
714 |
-
}
|
715 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin settings class
|
4 |
+
*
|
5 |
+
* @since 1.0.0
|
6 |
+
* @package TInvWishlist\Admin
|
7 |
+
* @subpackage Settings
|
8 |
+
*/
|
9 |
+
|
10 |
+
// If this file is called directly, abort.
|
11 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
12 |
+
die;
|
13 |
+
}
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Admin settings class
|
17 |
+
*/
|
18 |
+
class TInvWL_Admin_Settings_General extends TInvWL_Admin_BaseSection {
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Priority for admin menu
|
22 |
+
*
|
23 |
+
* @var integer
|
24 |
+
*/
|
25 |
+
public $priority = 20;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Menu array
|
29 |
+
*
|
30 |
+
* @return array
|
31 |
+
*/
|
32 |
+
function menu() {
|
33 |
+
return array(
|
34 |
+
'title' => __( 'General Settings', 'ti-woocommerce-wishlist' ),
|
35 |
+
'method' => array( $this, '_print_' ),
|
36 |
+
'slug' => '',
|
37 |
+
);
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Create sections for this settings
|
42 |
+
*
|
43 |
+
* @return array
|
44 |
+
*/
|
45 |
+
function constructor_data() {
|
46 |
+
add_action( $this->_n . '_section_general_before', array( $this, 'premium_features' ) );
|
47 |
+
$lists = get_pages( array( 'number' => 999999 ) ); // @codingStandardsIgnoreLine WordPress.VIP.RestrictedFunctions.get_pages
|
48 |
+
$page_list = array( '' => '' );
|
49 |
+
foreach ( $lists as $list ) {
|
50 |
+
$page_list[ $list->ID ] = $list->post_title;
|
51 |
+
}
|
52 |
+
|
53 |
+
return array(
|
54 |
+
array(
|
55 |
+
'id' => 'general',
|
56 |
+
'title' => __( 'General Settings', 'ti-woocommerce-wishlist' ),
|
57 |
+
'desc' => __( 'Wishlist page need to be selected so the plugin knows where it is. This page should have been created upon installation of the plugin, if not you will need to create it manually.', 'ti-woocommerce-wishlist' ),
|
58 |
+
'show_names' => true,
|
59 |
+
'fields' => array(
|
60 |
+
array(
|
61 |
+
'type' => 'text',
|
62 |
+
'name' => 'default_title',
|
63 |
+
'text' => __( 'Default Wishlist Name', 'ti-woocommerce-wishlist' ),
|
64 |
+
'std' => 'Default wishlist',
|
65 |
+
),
|
66 |
+
array(
|
67 |
+
'type' => 'select',
|
68 |
+
'name' => 'page_wishlist',
|
69 |
+
'text' => __( 'Wishlist Page', 'ti-woocommerce-wishlist' ),
|
70 |
+
'std' => '',
|
71 |
+
'options' => $page_list,
|
72 |
+
'validate' => FILTER_VALIDATE_INT,
|
73 |
+
),
|
74 |
+
array(
|
75 |
+
'type' => 'checkboxonoff',
|
76 |
+
'name' => 'require_login',
|
77 |
+
'text' => __( 'Require Login', 'ti-woocommerce-wishlist' ),
|
78 |
+
'desc' => __( 'Disallows guests to use Wishlist functionality until they sign-in.', 'ti-woocommerce-wishlist' ),
|
79 |
+
'std' => false,
|
80 |
+
'extra' => array(
|
81 |
+
'tiwl-show' => '.tiwl-general-redirect-require-login',
|
82 |
+
),
|
83 |
+
),
|
84 |
+
array(
|
85 |
+
'type' => 'checkboxonoff',
|
86 |
+
'name' => 'redirect_require_login',
|
87 |
+
'text' => __( 'Redirect to Login Page', 'ti-woocommerce-wishlist' ),
|
88 |
+
'desc' => '<span class="tiwl-button-show-notice-warning-popup"><strong>' . __( 'Currently this option could not be changed because "Show successful notice in popup" is disabled. Guests will be redirected automatically to a login page.', 'ti-woocommerce-wishlist' ) . '</strong></span><span class="tiwl-button-show-notice">' . __( 'If enabled, guests will be redirected to a login page once clicking the "Add to Wishlist" button or "Wishlist Products Counter" link. Otherwise a popup with login required notice will appear.', 'ti-woocommerce-wishlist' ) . '</span>',
|
89 |
+
'std' => false,
|
90 |
+
'class' => 'tiwl-general-redirect-require-login',
|
91 |
+
),
|
92 |
+
array(
|
93 |
+
'type' => 'checkboxonoff',
|
94 |
+
'name' => 'link_in_myaccount',
|
95 |
+
'text' => __( 'Show Link to Wishlist in my account', 'ti-woocommerce-wishlist' ),
|
96 |
+
'std' => true,
|
97 |
+
),
|
98 |
+
array(
|
99 |
+
'type' => 'checkboxonoff',
|
100 |
+
'name' => 'processing_autoremove',
|
101 |
+
'text' => __( 'Remove Product from Wishlist if added to cart', 'ti-woocommerce-wishlist' ),
|
102 |
+
'std' => true,
|
103 |
+
'extra' => array( 'tiwl-show' => '.tiwl-processing-autoremove-anyone' ),
|
104 |
+
),
|
105 |
+
array(
|
106 |
+
'type' => 'checkboxonoff',
|
107 |
+
'name' => 'processing_autoremove_anyone',
|
108 |
+
'text' => __( 'Remove by anyone', 'ti-woocommerce-wishlist' ),
|
109 |
+
'std' => false,
|
110 |
+
'class' => 'tiwl-processing-autoremove-anyone',
|
111 |
+
),
|
112 |
+
array(
|
113 |
+
'type' => 'checkboxonoff',
|
114 |
+
'name' => 'simple_flow',
|
115 |
+
'text' => __( 'Remove product from Wishlist on second click', 'ti-woocommerce-wishlist' ),
|
116 |
+
'std' => false,
|
117 |
+
'extra' => array(
|
118 |
+
'tiwl-show' => '.tiwl-general-simple-flow>td, .tiwl-button-simple-flow',
|
119 |
+
'tiwl-hide' => '.tiwl-general-simple-flow-hide>td',
|
120 |
+
),
|
121 |
+
),
|
122 |
+
array(
|
123 |
+
'type' => 'group',
|
124 |
+
'id' => 'show_notice',
|
125 |
+
),
|
126 |
+
array(
|
127 |
+
'type' => 'checkboxonoff',
|
128 |
+
'name' => 'show_notice',
|
129 |
+
'text' => __( 'Show successful notice in popup', 'ti-woocommerce-wishlist' ),
|
130 |
+
'desc' => __( 'This option allows to show/hide a popup with successful or error notices after addition or removing products from a Wishlist.', 'ti-woocommerce-wishlist' ),
|
131 |
+
'std' => true,
|
132 |
+
'extra' => array(
|
133 |
+
'tiwl-show' => '.tiwl-button-show-notice',
|
134 |
+
'tiwl-hide' => '.tiwl-button-show-notice-warning-popup',
|
135 |
+
),
|
136 |
+
),
|
137 |
+
array(
|
138 |
+
'type' => 'text',
|
139 |
+
'name' => 'text_browse',
|
140 |
+
'text' => __( '"View Wishlist" button Text', 'ti-woocommerce-wishlist' ),
|
141 |
+
'std' => 'View Wishlist',
|
142 |
+
'class' => 'tiwl-button-show-notice',
|
143 |
+
),
|
144 |
+
array(
|
145 |
+
'type' => 'checkboxonoff',
|
146 |
+
'name' => 'redirect',
|
147 |
+
'text' => __( 'Redirect to Wishlist', 'ti-woocommerce-wishlist' ),
|
148 |
+
'desc' => __( 'If enabled, user will be redirected to wishlist page after 5 sec from adding product to wishlist.', 'ti-woocommerce-wishlist' ),
|
149 |
+
'std' => true,
|
150 |
+
'class' => 'tiwl-button-show-notice',
|
151 |
+
),
|
152 |
+
array(
|
153 |
+
'type' => 'text',
|
154 |
+
'name' => 'text_added_to',
|
155 |
+
'text' => __( '"Product added to Wishlist" Text', 'ti-woocommerce-wishlist' ),
|
156 |
+
'std' => 'Product added to Wishlist',
|
157 |
+
'class' => 'tiwl-button-show-notice',
|
158 |
+
),
|
159 |
+
array(
|
160 |
+
'type' => 'text',
|
161 |
+
'name' => 'text_already_in',
|
162 |
+
'text' => __( '"Product already in Wishlist" Text', 'ti-woocommerce-wishlist' ),
|
163 |
+
'desc' => __( 'This notification will be shown if user will try to add a product that is already in the wishlist.', 'ti-woocommerce-wishlist' ),
|
164 |
+
'std' => 'Product already in Wishlist',
|
165 |
+
'class' => 'tiwl-button-show-notice tiwl-general-simple-flow-hide',
|
166 |
+
),
|
167 |
+
array(
|
168 |
+
'type' => 'text',
|
169 |
+
'name' => 'text_removed_from',
|
170 |
+
'text' => __( '"Product removed from Wishlist" Text', 'ti-woocommerce-wishlist' ),
|
171 |
+
'desc' => __( 'This notification will be shown once the product is removed from Wishlist on a single or a catalog page.', 'ti-woocommerce-wishlist' ),
|
172 |
+
'std' => 'Product removed from Wishlist',
|
173 |
+
'class' => 'tiwl-button-show-notice tiwl-general-simple-flow',
|
174 |
+
),
|
175 |
+
),
|
176 |
+
),
|
177 |
+
array(
|
178 |
+
'id' => 'page',
|
179 |
+
'title' => __( 'Wishlist Page Options', 'ti-woocommerce-wishlist' ),
|
180 |
+
'desc' => __( 'Coming soon', 'ti-woocommerce-wishlist' ),
|
181 |
+
'show_names' => true,
|
182 |
+
'style' => 'display:none;',
|
183 |
+
'fields' => array(
|
184 |
+
array(
|
185 |
+
'type' => 'select',
|
186 |
+
'name' => 'wishlist',
|
187 |
+
'text' => __( 'My Wishlist', 'ti-woocommerce-wishlist' ),
|
188 |
+
'std' => '',
|
189 |
+
'options' => $page_list,
|
190 |
+
'validate' => FILTER_VALIDATE_INT,
|
191 |
+
),
|
192 |
+
),
|
193 |
+
),
|
194 |
+
array(
|
195 |
+
'id' => 'processing',
|
196 |
+
'title' => __( 'Wishlist Processing Options', 'ti-woocommerce-wishlist' ),
|
197 |
+
'desc' => __( 'Coming soon', 'ti-woocommerce-wishlist' ),
|
198 |
+
'style' => 'display:none;',
|
199 |
+
'show_names' => true,
|
200 |
+
'fields' => array(
|
201 |
+
array(
|
202 |
+
'type' => 'checkboxonoff',
|
203 |
+
'name' => 'autoremove',
|
204 |
+
'text' => __( 'Automatic removal', 'ti-woocommerce-wishlist' ),
|
205 |
+
'std' => true,
|
206 |
+
'extra' => array( 'tiwl-show' => '.tiwl-processing-autoremove' ),
|
207 |
+
),
|
208 |
+
array(
|
209 |
+
'type' => 'select',
|
210 |
+
'name' => 'autoremove_status',
|
211 |
+
'text' => __( 'Remove condition', 'ti-woocommerce-wishlist' ),
|
212 |
+
'std' => 'tinvwl-addcart',
|
213 |
+
'options' => array(
|
214 |
+
'tinvwl-addcart' => __( 'Add to Cart', 'ti-woocommerce-wishlist' ),
|
215 |
+
),
|
216 |
+
'class' => 'tiwl-processing-autoremove',
|
217 |
+
),
|
218 |
+
array(
|
219 |
+
'type' => 'checkboxonoff',
|
220 |
+
'name' => 'autoremove_anyone',
|
221 |
+
'text' => __( 'Remove by anyone', 'ti-woocommerce-wishlist' ),
|
222 |
+
'std' => false,
|
223 |
+
'class' => 'tiwl-processing-autoremove',
|
224 |
+
),
|
225 |
+
),
|
226 |
+
),
|
227 |
+
array(
|
228 |
+
'id' => 'add_to_wishlist',
|
229 |
+
'title' => __( 'Product page "Add to Wishlist" Button Settings', 'ti-woocommerce-wishlist' ),
|
230 |
+
'show_names' => true,
|
231 |
+
'fields' => array(
|
232 |
+
array(
|
233 |
+
'type' => 'select',
|
234 |
+
'name' => 'position',
|
235 |
+
'text' => __( 'Button position', 'ti-woocommerce-wishlist' ),
|
236 |
+
'desc' => __( 'Add this shortcode <code>[ti_wishlists_addtowishlist]</code> anywhere on product page, if you have chosen custom position for product button. You will have to do this for each product.', 'ti-woocommerce-wishlist' ),
|
237 |
+
'std' => 'after',
|
238 |
+
'options' => array(
|
239 |
+
'after' => __( 'After "Add to Cart" button', 'ti-woocommerce-wishlist' ),
|
240 |
+
'before' => __( 'Before "Add to Cart" button', 'ti-woocommerce-wishlist' ),
|
241 |
+
'shortcode' => __( 'Custom position with code', 'ti-woocommerce-wishlist' ),
|
242 |
+
),
|
243 |
+
),
|
244 |
+
array(
|
245 |
+
'type' => 'select',
|
246 |
+
'name' => 'type',
|
247 |
+
'text' => __( 'Button type', 'ti-woocommerce-wishlist' ),
|
248 |
+
'std' => 'link',
|
249 |
+
'options' => array(
|
250 |
+
'link' => __( 'Link', 'ti-woocommerce-wishlist' ),
|
251 |
+
'button' => __( 'Button', 'ti-woocommerce-wishlist' ),
|
252 |
+
),
|
253 |
+
),
|
254 |
+
array(
|
255 |
+
'type' => 'select',
|
256 |
+
'name' => 'icon',
|
257 |
+
'text' => __( '"Add to Wishlist" Icon', 'ti-woocommerce-wishlist' ),
|
258 |
+
'desc' => __( 'You can choose from our predefined icons or upload your custom icon. Custom icon size is limited to 16x16 px.', 'ti-woocommerce-wishlist' ),
|
259 |
+
'std' => '',
|
260 |
+
'options' => array(
|
261 |
+
'' => __( 'None', 'ti-woocommerce-wishlist' ),
|
262 |
+
'heart' => __( 'Heart', 'ti-woocommerce-wishlist' ),
|
263 |
+
'heart-plus' => __( 'Heart+', 'ti-woocommerce-wishlist' ),
|
264 |
+
'custom' => __( 'Custom', 'ti-woocommerce-wishlist' ),
|
265 |
+
),
|
266 |
+
'extra' => array(
|
267 |
+
'class' => 'tiwl-button-icon',
|
268 |
+
'tiwl-show' => '.tiwl-button-icon-custom',
|
269 |
+
'tiwl-hide' => '.tiwl-button-icon-style',
|
270 |
+
'tiwl-value' => 'custom',
|
271 |
+
),
|
272 |
+
),
|
273 |
+
array(
|
274 |
+
'type' => 'uploadfile',
|
275 |
+
'name' => 'icon_upload',
|
276 |
+
'std' => '',
|
277 |
+
'text' => ' ',
|
278 |
+
'class' => 'tiwl-button-icon-custom',
|
279 |
+
'extra' => array(
|
280 |
+
'button' => array(
|
281 |
+
'value' => __( 'Upload', 'ti-woocommerce-wishlist' ),
|
282 |
+
),
|
283 |
+
'type' => array( 'image' ),
|
284 |
+
),
|
285 |
+
),
|
286 |
+
array(
|
287 |
+
'type' => 'select',
|
288 |
+
'name' => 'icon_style',
|
289 |
+
'std' => 'black',
|
290 |
+
'text' => __( '"Add to Wishlist" Icon Color', 'ti-woocommerce-wishlist' ),
|
291 |
+
'options' => array(
|
292 |
+
'black' => __( 'Black', 'ti-woocommerce-wishlist' ),
|
293 |
+
'white' => __( 'White', 'ti-woocommerce-wishlist' ),
|
294 |
+
),
|
295 |
+
'class' => 'tiwl-button-icon-style',
|
296 |
+
),
|
297 |
+
array(
|
298 |
+
'type' => 'text',
|
299 |
+
'name' => 'text',
|
300 |
+
'text' => __( '"Add to Wishlist" button Text', 'ti-woocommerce-wishlist' ),
|
301 |
+
'std' => 'Add to Wishlist',
|
302 |
+
),
|
303 |
+
array(
|
304 |
+
'type' => 'text',
|
305 |
+
'name' => 'text_remove',
|
306 |
+
'text' => __( '"Remove from Wishlist" Button Text', 'ti-woocommerce-wishlist' ),
|
307 |
+
'std' => 'Remove from Wishlist',
|
308 |
+
'class' => 'tiwl-button-simple-flow',
|
309 |
+
),
|
310 |
+
),
|
311 |
+
),
|
312 |
+
array(
|
313 |
+
'id' => 'add_to_wishlist_catalog',
|
314 |
+
'title' => __( 'Product listing Button Settings', 'ti-woocommerce-wishlist' ),
|
315 |
+
'desc' => __( 'These are separate settings for the "Add to Wishlist" button on a product listing (Shop page, categories, etc.). You can also adjust button and text colors, size, etc. in a <code>TI Wishlist > Style Options.</code>', 'ti-woocommerce-wishlist' ),
|
316 |
+
'show_names' => true,
|
317 |
+
'fields' => array(
|
318 |
+
array(
|
319 |
+
'type' => 'checkboxonoff',
|
320 |
+
'name' => 'show_in_loop',
|
321 |
+
'text' => __( 'Show in Product Listing', 'ti-woocommerce-wishlist' ),
|
322 |
+
'std' => true,
|
323 |
+
'extra' => array(
|
324 |
+
'tiwl-show' => '.tiwl-buttoncat-button',
|
325 |
+
),
|
326 |
+
),
|
327 |
+
array(
|
328 |
+
'type' => 'group',
|
329 |
+
'id' => 'add_to_wishlist_catalog',
|
330 |
+
'class' => 'tiwl-buttoncat-button',
|
331 |
+
'style' => 'border-top: 0px; padding-top: 0px;',
|
332 |
+
),
|
333 |
+
array(
|
334 |
+
'type' => 'select',
|
335 |
+
'name' => 'position',
|
336 |
+
'text' => __( 'Button position', 'ti-woocommerce-wishlist' ),
|
337 |
+
'std' => 'after',
|
338 |
+
'options' => array(
|
339 |
+
'after' => __( 'After "Add to Cart" button', 'ti-woocommerce-wishlist' ),
|
340 |
+
'before' => __( 'Before "Add to Cart" button', 'ti-woocommerce-wishlist' ),
|
341 |
+
'above_thumb' => __( 'Above Thumbnail', 'ti-woocommerce-wishlist' ),
|
342 |
+
'shortcode' => __( 'Custom position with code', 'ti-woocommerce-wishlist' ),
|
343 |
+
),
|
344 |
+
'desc' => __( 'Note: if "Custom position with code" option is applied, the "Add to Wishlist" button should be added into template using <code>do_shortcode()</code> function like this:<br /><code>do_shortcode("[ti_wishlists_addtowishlist loop=yes]")</code>', 'ti-woocommerce-wishlist' ),
|
345 |
+
),
|
346 |
+
array(
|
347 |
+
'type' => 'select',
|
348 |
+
'name' => 'type',
|
349 |
+
'text' => __( 'Button type', 'ti-woocommerce-wishlist' ),
|
350 |
+
'std' => 'button',
|
351 |
+
'options' => array(
|
352 |
+
'link' => __( 'Link', 'ti-woocommerce-wishlist' ),
|
353 |
+
'button' => __( 'Button', 'ti-woocommerce-wishlist' ),
|
354 |
+
),
|
355 |
+
),
|
356 |
+
array(
|
357 |
+
'type' => 'select',
|
358 |
+
'name' => 'icon',
|
359 |
+
'text' => __( '"Add to Wishlist" Icon', 'ti-woocommerce-wishlist' ),
|
360 |
+
'std' => '',
|
361 |
+
'options' => array(
|
362 |
+
'' => __( 'None', 'ti-woocommerce-wishlist' ),
|
363 |
+
'heart' => __( 'Heart', 'ti-woocommerce-wishlist' ),
|
364 |
+
'heart-plus' => __( 'Heart+', 'ti-woocommerce-wishlist' ),
|
365 |
+
'custom' => __( 'Custom', 'ti-woocommerce-wishlist' ),
|
366 |
+
),
|
367 |
+
'extra' => array(
|
368 |
+
'tiwl-show' => '.tiwl-buttoncat-icon-custom',
|
369 |
+
'tiwl-hide' => '.tiwl-buttoncat-icon-style',
|
370 |
+
'tiwl-value' => 'custom',
|
371 |
+
),
|
372 |
+
),
|
373 |
+
array(
|
374 |
+
'type' => 'uploadfile',
|
375 |
+
'name' => 'icon_upload',
|
376 |
+
'std' => '',
|
377 |
+
'text' => ' ',
|
378 |
+
'class' => 'tiwl-buttoncat-icon-custom',
|
379 |
+
'extra' => array(
|
380 |
+
'button' => array(
|
381 |
+
'value' => __( 'Upload', 'ti-woocommerce-wishlist' ),
|
382 |
+
),
|
383 |
+
'type' => array( 'image' ),
|
384 |
+
),
|
385 |
+
),
|
386 |
+
array(
|
387 |
+
'type' => 'select',
|
388 |
+
'name' => 'icon_style',
|
389 |
+
'std' => 'black',
|
390 |
+
'text' => __( '"Add to Wishlist" Icon Color', 'ti-woocommerce-wishlist' ),
|
391 |
+
'options' => array(
|
392 |
+
'black' => __( 'Black', 'ti-woocommerce-wishlist' ),
|
393 |
+
'white' => __( 'White', 'ti-woocommerce-wishlist' ),
|
394 |
+
),
|
395 |
+
'class' => 'tiwl-buttoncat-icon-style',
|
396 |
+
),
|
397 |
+
array(
|
398 |
+
'type' => 'text',
|
399 |
+
'name' => 'text',
|
400 |
+
'text' => __( '"Add to Wishlist" Text', 'ti-woocommerce-wishlist' ),
|
401 |
+
'std' => 'Add to Wishlist',
|
402 |
+
),
|
403 |
+
array(
|
404 |
+
'type' => 'text',
|
405 |
+
'name' => 'text_remove',
|
406 |
+
'text' => __( '"Remove from Wishlist" Button Text', 'ti-woocommerce-wishlist' ),
|
407 |
+
'std' => 'Remove from Wishlist',
|
408 |
+
'class' => 'tiwl-button-simple-flow',
|
409 |
+
),
|
410 |
+
),
|
411 |
+
),
|
412 |
+
array(
|
413 |
+
'id' => 'product_table',
|
414 |
+
'title' => __( 'Wishlist Product Settings', 'ti-woocommerce-wishlist' ),
|
415 |
+
'desc' => __( 'Following options allows you to choose what information/functionality to show/enable in wishlist table on wishlist page.', 'ti-woocommerce-wishlist' ),
|
416 |
+
'show_names' => true,
|
417 |
+
'fields' => array(
|
418 |
+
array(
|
419 |
+
'type' => 'checkboxonoff',
|
420 |
+
'name' => 'add_to_cart',
|
421 |
+
'text' => __( 'Show "Add to Cart" button', 'ti-woocommerce-wishlist' ),
|
422 |
+
'std' => true,
|
423 |
+
'extra' => array( 'tiwl-show' => '.tiwl-table-action-addcart' ),
|
424 |
+
),
|
425 |
+
array(
|
426 |
+
'type' => 'text',
|
427 |
+
'name' => 'text_add_to_cart',
|
428 |
+
'text' => __( '"Add to Cart" Text', 'ti-woocommerce-wishlist' ),
|
429 |
+
'std' => 'Add to Cart',
|
430 |
+
'class' => 'tiwl-table-action-addcart',
|
431 |
+
),
|
432 |
+
array(
|
433 |
+
'type' => 'checkboxonoff',
|
434 |
+
'name' => 'colm_price',
|
435 |
+
'text' => __( 'Show Unit price', 'ti-woocommerce-wishlist' ),
|
436 |
+
'std' => true,
|
437 |
+
),
|
438 |
+
array(
|
439 |
+
'type' => 'checkboxonoff',
|
440 |
+
'name' => 'colm_stock',
|
441 |
+
'text' => __( 'Show Stock status', 'ti-woocommerce-wishlist' ),
|
442 |
+
'std' => true,
|
443 |
+
),
|
444 |
+
array(
|
445 |
+
'type' => 'checkboxonoff',
|
446 |
+
'name' => 'colm_date',
|
447 |
+
'text' => __( 'Show Date of addition', 'ti-woocommerce-wishlist' ),
|
448 |
+
'std' => true,
|
449 |
+
),
|
450 |
+
),
|
451 |
+
),
|
452 |
+
array(
|
453 |
+
'id' => 'table',
|
454 |
+
'title' => __( 'Wishlist Table Settings', 'ti-woocommerce-wishlist' ),
|
455 |
+
'desc' => __( 'Following options will help user to manage and add products to cart from wishlist table in bulk.', 'ti-woocommerce-wishlist' ),
|
456 |
+
'show_names' => true,
|
457 |
+
'fields' => array(
|
458 |
+
array(
|
459 |
+
'type' => 'checkboxonoff',
|
460 |
+
'name' => 'colm_checkbox',
|
461 |
+
'text' => __( 'Show Checkboxes', 'ti-woocommerce-wishlist' ),
|
462 |
+
'std' => true,
|
463 |
+
'extra' => array( 'tiwl-show' => '.tiwl-table-cb-button' ),
|
464 |
+
),
|
465 |
+
array(
|
466 |
+
'type' => 'group',
|
467 |
+
'id' => 'cb_button',
|
468 |
+
'class' => 'tiwl-table-cb-button',
|
469 |
+
),
|
470 |
+
array(
|
471 |
+
'type' => 'checkboxonoff',
|
472 |
+
'name' => 'colm_actions',
|
473 |
+
'text' => __( 'Show Actions button', 'ti-woocommerce-wishlist' ),
|
474 |
+
'desc' => __( 'Bulk actions drop down at the bottom of wishlist table', 'ti-woocommerce-wishlist' ),
|
475 |
+
'std' => true,
|
476 |
+
),
|
477 |
+
array(
|
478 |
+
'type' => 'checkboxonoff',
|
479 |
+
'name' => 'add_select_to_cart',
|
480 |
+
'text' => __( 'Show "Add Selected to Cart" button', 'ti-woocommerce-wishlist' ),
|
481 |
+
'std' => true,
|
482 |
+
'extra' => array( 'tiwl-show' => '.tiwl-table-addcart-sel' ),
|
483 |
+
),
|
484 |
+
array(
|
485 |
+
'type' => 'text',
|
486 |
+
'name' => 'text_add_select_to_cart',
|
487 |
+
'text' => __( '"Add Selected to Cart" Button Text', 'ti-woocommerce-wishlist' ),
|
488 |
+
'std' => 'Add Selected to Cart',
|
489 |
+
'class' => 'tiwl-table-addcart-sel',
|
490 |
+
),
|
491 |
+
array(
|
492 |
+
'type' => 'group',
|
493 |
+
'id' => '_button',
|
494 |
+
),
|
495 |
+
array(
|
496 |
+
'type' => 'checkboxonoff',
|
497 |
+
'name' => 'add_all_to_cart',
|
498 |
+
'text' => __( 'Show "Add All to Cart" button', 'ti-woocommerce-wishlist' ),
|
499 |
+
'std' => true,
|
500 |
+
'extra' => array( 'tiwl-show' => '.tiwl-table-addcart-all' ),
|
501 |
+
),
|
502 |
+
array(
|
503 |
+
'type' => 'text',
|
504 |
+
'name' => 'text_add_all_to_cart',
|
505 |
+
'text' => __( '"Add All to Cart" Button Text', 'ti-woocommerce-wishlist' ),
|
506 |
+
'std' => 'Add All to Cart',
|
507 |
+
'class' => 'tiwl-table-addcart-all',
|
508 |
+
),
|
509 |
+
),
|
510 |
+
),
|
511 |
+
array(
|
512 |
+
'id' => 'social',
|
513 |
+
'show_names' => true,
|
514 |
+
'fields' => array(
|
515 |
+
array(
|
516 |
+
'type' => 'group',
|
517 |
+
'id' => 'social',
|
518 |
+
'desc' => __( 'Following options enable/disable Social share icons below wishlist table on wishlist page. Wishlist owner can easily share their wishlists using this button on social networks. Wishlist privacy should be set to public or shared status, private wishlists can\'t be shared.', 'ti-woocommerce-wishlist' ),
|
519 |
+
'class' => 'tinvwl-info-top',
|
520 |
+
),
|
521 |
+
array(
|
522 |
+
'type' => 'html',
|
523 |
+
'name' => 'social',
|
524 |
+
'text' => __( 'Social Networks Sharing Options', 'ti-woocommerce-wishlist' ),
|
525 |
+
'class' => 'tinvwl-header-row tinvwl-line-border',
|
526 |
+
),
|
527 |
+
array(
|
528 |
+
'type' => 'checkboxonoff',
|
529 |
+
'name' => 'facebook',
|
530 |
+
'text' => __( 'Show "Facebook" Button', 'ti-woocommerce-wishlist' ),
|
531 |
+
'std' => true,
|
532 |
+
),
|
533 |
+
array(
|
534 |
+
'type' => 'checkboxonoff',
|
535 |
+
'name' => 'twitter',
|
536 |
+
'text' => __( 'Show "Twitter" Button', 'ti-woocommerce-wishlist' ),
|
537 |
+
'std' => true,
|
538 |
+
),
|
539 |
+
array(
|
540 |
+
'type' => 'checkboxonoff',
|
541 |
+
'name' => 'pinterest',
|
542 |
+
'text' => __( 'Show "Pinterest" Button', 'ti-woocommerce-wishlist' ),
|
543 |
+
'std' => true,
|
544 |
+
),
|
545 |
+
array(
|
546 |
+
'type' => 'checkboxonoff',
|
547 |
+
'name' => 'google',
|
548 |
+
'text' => __( 'Show "Google+" Button', 'ti-woocommerce-wishlist' ),
|
549 |
+
'std' => true,
|
550 |
+
),
|
551 |
+
array(
|
552 |
+
'type' => 'checkboxonoff',
|
553 |
+
'name' => 'email',
|
554 |
+
'text' => __( 'Show "Share by Email" Button', 'ti-woocommerce-wishlist' ),
|
555 |
+
'std' => true,
|
556 |
+
),
|
557 |
+
array(
|
558 |
+
'type' => 'text',
|
559 |
+
'name' => 'share_on',
|
560 |
+
'text' => __( '"Share on" Text', 'ti-woocommerce-wishlist' ),
|
561 |
+
'std' => 'Share on',
|
562 |
+
),
|
563 |
+
array(
|
564 |
+
'type' => 'select',
|
565 |
+
'name' => 'icon_style',
|
566 |
+
'text' => __( 'Social Icons Color', 'ti-woocommerce-wishlist' ),
|
567 |
+
'options' => array(
|
568 |
+
'dark' => __( 'Dark', 'ti-woocommerce-wishlist' ),
|
569 |
+
'white' => __( 'White', 'ti-woocommerce-wishlist' ),
|
570 |
+
),
|
571 |
+
'validate' => FILTER_DEFAULT,
|
572 |
+
),
|
573 |
+
),
|
574 |
+
),
|
575 |
+
array(
|
576 |
+
'id' => 'topline',
|
577 |
+
'title' => __( 'Wishlist Products Counter', 'ti-woocommerce-wishlist' ),
|
578 |
+
'desc' => sprintf( __( 'Add this shortcode <code>[ti_wishlist_products_counter]</code> anywhere into a page content to show Wishlist Counter.<br/><br/>It can be also added as a widget <code>Wishlist Products Counter</code> under the <a href="%s">Appearance -> Widgets</a> section.', 'ti-woocommerce-wishlist' ), esc_url( admin_url( 'widgets.php' ) ) ),
|
579 |
+
'show_names' => true,
|
580 |
+
'fields' => array(
|
581 |
+
array(
|
582 |
+
'type' => 'select',
|
583 |
+
'name' => 'icon',
|
584 |
+
'text' => __( '"Wishlist" Icon', 'ti-woocommerce-wishlist' ),
|
585 |
+
'std' => '',
|
586 |
+
'options' => array(
|
587 |
+
'' => __( 'None', 'ti-woocommerce-wishlist' ),
|
588 |
+
'heart' => __( 'Heart', 'ti-woocommerce-wishlist' ),
|
589 |
+
'heart-plus' => __( 'Heart+', 'ti-woocommerce-wishlist' ),
|
590 |
+
'custom' => __( 'Custom', 'ti-woocommerce-wishlist' ),
|
591 |
+
),
|
592 |
+
'desc' => __( 'You can choose from our predefined icons or upload your custom icon. Custom icon size is limited to 16x16 px.', 'ti-woocommerce-wishlist' ),
|
593 |
+
'extra' => array(
|
594 |
+
'tiwl-show' => '.tiwl-dropdown-icon-custom',
|
595 |
+
'tiwl-hide' => '.tiwl-dropdown-icon-style',
|
596 |
+
'tiwl-value' => 'custom',
|
597 |
+
),
|
598 |
+
),
|
599 |
+
array(
|
600 |
+
'type' => 'uploadfile',
|
601 |
+
'name' => 'icon_upload',
|
602 |
+
'std' => '',
|
603 |
+
'text' => ' ',
|
604 |
+
'class' => 'tiwl-dropdown-icon-custom',
|
605 |
+
'extra' => array(
|
606 |
+
'button' => array(
|
607 |
+
'value' => __( 'Upload', 'ti-woocommerce-wishlist' ),
|
608 |
+
),
|
609 |
+
'type' => array( 'image' ),
|
610 |
+
),
|
611 |
+
),
|
612 |
+
array(
|
613 |
+
'type' => 'select',
|
614 |
+
'name' => 'icon_style',
|
615 |
+
'std' => 'black',
|
616 |
+
'text' => __( '"Wishlist" Icon Color', 'ti-woocommerce-wishlist' ),
|
617 |
+
'options' => array(
|
618 |
+
'black' => __( 'Black', 'ti-woocommerce-wishlist' ),
|
619 |
+
'white' => __( 'White', 'ti-woocommerce-wishlist' ),
|
620 |
+
),
|
621 |
+
'class' => 'tiwl-dropdown-icon-style',
|
622 |
+
),
|
623 |
+
array(
|
624 |
+
'type' => 'checkboxonoff',
|
625 |
+
'name' => 'show_text',
|
626 |
+
'text' => __( 'Show counter text', 'ti-woocommerce-wishlist' ),
|
627 |
+
'std' => true,
|
628 |
+
'extra' => array(
|
629 |
+
'tiwl-show' => '.tiwl-dropdown-text',
|
630 |
+
),
|
631 |
+
),
|
632 |
+
array(
|
633 |
+
'type' => 'text',
|
634 |
+
'name' => 'text',
|
635 |
+
'text' => __( 'Counter Text', 'ti-woocommerce-wishlist' ),
|
636 |
+
'std' => __( 'Wishlist - ', 'ti-woocommerce-wishlist' ),
|
637 |
+
'class' => 'tiwl-dropdown-text',
|
638 |
+
),
|
639 |
+
),
|
640 |
+
),
|
641 |
+
array(
|
642 |
+
'id' => 'save_buttons',
|
643 |
+
'class' => 'only-button',
|
644 |
+
'noform' => true,
|
645 |
+
'fields' => array(
|
646 |
+
array(
|
647 |
+
'type' => 'button_submit',
|
648 |
+
'name' => 'setting_save',
|
649 |
+
'std' => '<span><i class="fa fa-check"></i></span>' . __( 'Save Settings', 'ti-woocommerce-wishlist' ),
|
650 |
+
'extra' => array( 'class' => 'tinvwl-btn split status-btn-ok' ),
|
651 |
+
),
|
652 |
+
array(
|
653 |
+
'type' => 'button_submit',
|
654 |
+
'name' => 'setting_reset',
|
655 |
+
'std' => '<span><i class="fa fa-times"></i></span>' . __( 'Reset', 'ti-woocommerce-wishlist' ),
|
656 |
+
'extra' => array( 'class' => 'tinvwl-btn split status-btn-ok tinvwl-confirm-reset' ),
|
657 |
+
),
|
658 |
+
array(
|
659 |
+
'type' => 'button_submit_quick',
|
660 |
+
'name' => 'setting_save_quick',
|
661 |
+
'std' => '<span><i class="fa fa-floppy-o"></i></span>' . __( 'Save', 'ti-woocommerce-wishlist' ),
|
662 |
+
),
|
663 |
+
),
|
664 |
+
),
|
665 |
+
);
|
666 |
+
}
|
667 |
+
|
668 |
+
/**
|
669 |
+
* Load value from database
|
670 |
+
*
|
671 |
+
* @param array $sections Sections array.
|
672 |
+
*
|
673 |
+
* @return array
|
674 |
+
*/
|
675 |
+
function constructor_load( $sections ) {
|
676 |
+
$data = parent::constructor_load( $sections );
|
677 |
+
$data['general']['page_wishlist'] = $data['page']['wishlist'];
|
678 |
+
$data['general']['processing_autoremove'] = $data['processing']['autoremove'];
|
679 |
+
$data['general']['processing_autoremove_anyone'] = $data['processing']['autoremove_anyone'];
|
680 |
+
|
681 |
+
return $data;
|
682 |
+
}
|
683 |
+
|
684 |
+
/**
|
685 |
+
* Save value to database and flush rewrite.
|
686 |
+
*
|
687 |
+
* @param array $data Post section data.
|
688 |
+
*/
|
689 |
+
function constructor_save( $data ) {
|
690 |
+
parent::constructor_save( $data );
|
691 |
+
if ( empty( $data ) || ! is_array( $data ) ) {
|
692 |
+
return false;
|
693 |
+
}
|
694 |
+
tinv_update_option( 'page', 'wishlist', $data['general']['page_wishlist'] );
|
695 |
+
tinv_update_option( 'processing', 'autoremove', $data['general']['processing_autoremove'] );
|
696 |
+
tinv_update_option( 'processing', 'autoremove_anyone', $data['general']['processing_autoremove_anyone'] );
|
697 |
+
tinv_update_option( 'processing', 'autoremove_status', 'tinvwl-addcart' );
|
698 |
+
if ( filter_input( INPUT_POST, 'save_buttons-setting_reset' ) ) {
|
699 |
+
foreach ( $data as $key => $value ) {
|
700 |
+
if ( ! in_array( $key, array( 'page' ) ) ) {
|
701 |
+
$data[ $key ] = array();
|
702 |
+
}
|
703 |
+
}
|
704 |
+
parent::constructor_save( $data );
|
705 |
+
}
|
706 |
+
TInvWL_Public_TInvWL::update_rewrite_rules();
|
707 |
+
}
|
708 |
+
|
709 |
+
/**
|
710 |
+
* Show Premium Features sections
|
711 |
+
*/
|
712 |
+
function premium_features() {
|
713 |
+
TInvWL_View::view( 'premium-features' );
|
714 |
+
}
|
715 |
+
}
|
freemius/LICENSE.txt
CHANGED
@@ -1,674 +1,674 @@
|
|
1 |
-
GNU GENERAL PUBLIC LICENSE
|
2 |
-
Version 3, 29 June 2007
|
3 |
-
|
4 |
-
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
5 |
-
Everyone is permitted to copy and distribute verbatim copies
|
6 |
-
of this license document, but changing it is not allowed.
|
7 |
-
|
8 |
-
Preamble
|
9 |
-
|
10 |
-
The GNU General Public License is a free, copyleft license for
|
11 |
-
software and other kinds of works.
|
12 |
-
|
13 |
-
The licenses for most software and other practical works are designed
|
14 |
-
to take away your freedom to share and change the works. By contrast,
|
15 |
-
the GNU General Public License is intended to guarantee your freedom to
|
16 |
-
share and change all versions of a program--to make sure it remains free
|
17 |
-
software for all its users. We, the Free Software Foundation, use the
|
18 |
-
GNU General Public License for most of our software; it applies also to
|
19 |
-
any other work released this way by its authors. You can apply it to
|
20 |
-
your programs, too.
|
21 |
-
|
22 |
-
When we speak of free software, we are referring to freedom, not
|
23 |
-
price. Our General Public Licenses are designed to make sure that you
|
24 |
-
have the freedom to distribute copies of free software (and charge for
|
25 |
-
them if you wish), that you receive source code or can get it if you
|
26 |
-
want it, that you can change the software or use pieces of it in new
|
27 |
-
free programs, and that you know you can do these things.
|
28 |
-
|
29 |
-
To protect your rights, we need to prevent others from denying you
|
30 |
-
these rights or asking you to surrender the rights. Therefore, you have
|
31 |
-
certain responsibilities if you distribute copies of the software, or if
|
32 |
-
you modify it: responsibilities to respect the freedom of others.
|
33 |
-
|
34 |
-
For example, if you distribute copies of such a program, whether
|
35 |
-
gratis or for a fee, you must pass on to the recipients the same
|
36 |
-
freedoms that you received. You must make sure that they, too, receive
|
37 |
-
or can get the source code. And you must show them these terms so they
|
38 |
-
know their rights.
|
39 |
-
|
40 |
-
Developers that use the GNU GPL protect your rights with two steps:
|
41 |
-
(1) assert copyright on the software, and (2) offer you this License
|
42 |
-
giving you legal permission to copy, distribute and/or modify it.
|
43 |
-
|
44 |
-
For the developers' and authors' protection, the GPL clearly explains
|
45 |
-
that there is no warranty for this free software. For both users' and
|
46 |
-
authors' sake, the GPL requires that modified versions be marked as
|
47 |
-
changed, so that their problems will not be attributed erroneously to
|
48 |
-
authors of previous versions.
|
49 |
-
|
50 |
-
Some devices are designed to deny users access to install or run
|
51 |
-
modified versions of the software inside them, although the manufacturer
|
52 |
-
can do so. This is fundamentally incompatible with the aim of
|
53 |
-
protecting users' freedom to change the software. The systematic
|
54 |
-
pattern of such abuse occurs in the area of products for individuals to
|
55 |
-
use, which is precisely where it is most unacceptable. Therefore, we
|
56 |
-
have designed this version of the GPL to prohibit the practice for those
|
57 |
-
products. If such problems arise substantially in other domains, we
|
58 |
-
stand ready to extend this provision to those domains in future versions
|
59 |
-
of the GPL, as needed to protect the freedom of users.
|
60 |
-
|
61 |
-
Finally, every program is threatened constantly by software patents.
|
62 |
-
States should not allow patents to restrict development and use of
|
63 |
-
software on general-purpose computers, but in those that do, we wish to
|
64 |
-
avoid the special danger that patents applied to a free program could
|
65 |
-
make it effectively proprietary. To prevent this, the GPL assures that
|
66 |
-
patents cannot be used to render the program non-free.
|
67 |
-
|
68 |
-
The precise terms and conditions for copying, distribution and
|
69 |
-
modification follow.
|
70 |
-
|
71 |
-
TERMS AND CONDITIONS
|
72 |
-
|
73 |
-
0. Definitions.
|
74 |
-
|
75 |
-
"This License" refers to version 3 of the GNU General Public License.
|
76 |
-
|
77 |
-
"Copyright" also means copyright-like laws that apply to other kinds of
|
78 |
-
works, such as semiconductor masks.
|
79 |
-
|
80 |
-
"The Program" refers to any copyrightable work licensed under this
|
81 |
-
License. Each licensee is addressed as "you". "Licensees" and
|
82 |
-
"recipients" may be individuals or organizations.
|
83 |
-
|
84 |
-
To "modify" a work means to copy from or adapt all or part of the work
|
85 |
-
in a fashion requiring copyright permission, other than the making of an
|
86 |
-
exact copy. The resulting work is called a "modified version" of the
|
87 |
-
earlier work or a work "based on" the earlier work.
|
88 |
-
|
89 |
-
A "covered work" means either the unmodified Program or a work based
|
90 |
-
on the Program.
|
91 |
-
|
92 |
-
To "propagate" a work means to do anything with it that, without
|
93 |
-
permission, would make you directly or secondarily liable for
|
94 |
-
infringement under applicable copyright law, except executing it on a
|
95 |
-
computer or modifying a private copy. Propagation includes copying,
|
96 |
-
distribution (with or without modification), making available to the
|
97 |
-
public, and in some countries other activities as well.
|
98 |
-
|
99 |
-
To "convey" a work means any kind of propagation that enables other
|
100 |
-
parties to make or receive copies. Mere interaction with a user through
|
101 |
-
a computer network, with no transfer of a copy, is not conveying.
|
102 |
-
|
103 |
-
An interactive user interface displays "Appropriate Legal Notices"
|
104 |
-
to the extent that it includes a convenient and prominently visible
|
105 |
-
feature that (1) displays an appropriate copyright notice, and (2)
|
106 |
-
tells the user that there is no warranty for the work (except to the
|
107 |
-
extent that warranties are provided), that licensees may convey the
|
108 |
-
work under this License, and how to view a copy of this License. If
|
109 |
-
the interface presents a list of user commands or options, such as a
|
110 |
-
menu, a prominent item in the list meets this criterion.
|
111 |
-
|
112 |
-
1. Source Code.
|
113 |
-
|
114 |
-
The "source code" for a work means the preferred form of the work
|
115 |
-
for making modifications to it. "Object code" means any non-source
|
116 |
-
form of a work.
|
117 |
-
|
118 |
-
A "Standard Interface" means an interface that either is an official
|
119 |
-
standard defined by a recognized standards body, or, in the case of
|
120 |
-
interfaces specified for a particular programming language, one that
|
121 |
-
is widely used among developers working in that language.
|
122 |
-
|
123 |
-
The "System Libraries" of an executable work include anything, other
|
124 |
-
than the work as a whole, that (a) is included in the normal form of
|
125 |
-
packaging a Major Component, but which is not part of that Major
|
126 |
-
Component, and (b) serves only to enable use of the work with that
|
127 |
-
Major Component, or to implement a Standard Interface for which an
|
128 |
-
implementation is available to the public in source code form. A
|
129 |
-
"Major Component", in this context, means a major essential component
|
130 |
-
(kernel, window system, and so on) of the specific operating system
|
131 |
-
(if any) on which the executable work runs, or a compiler used to
|
132 |
-
produce the work, or an object code interpreter used to run it.
|
133 |
-
|
134 |
-
The "Corresponding Source" for a work in object code form means all
|
135 |
-
the source code needed to generate, install, and (for an executable
|
136 |
-
work) run the object code and to modify the work, including scripts to
|
137 |
-
control those activities. However, it does not include the work's
|
138 |
-
System Libraries, or general-purpose tools or generally available free
|
139 |
-
programs which are used unmodified in performing those activities but
|
140 |
-
which are not part of the work. For example, Corresponding Source
|
141 |
-
includes interface definition files associated with source files for
|
142 |
-
the work, and the source code for shared libraries and dynamically
|
143 |
-
linked subprograms that the work is specifically designed to require,
|
144 |
-
such as by intimate data communication or control flow between those
|
145 |
-
subprograms and other parts of the work.
|
146 |
-
|
147 |
-
The Corresponding Source need not include anything that users
|
148 |
-
can regenerate automatically from other parts of the Corresponding
|
149 |
-
Source.
|
150 |
-
|
151 |
-
The Corresponding Source for a work in source code form is that
|
152 |
-
same work.
|
153 |
-
|
154 |
-
2. Basic Permissions.
|
155 |
-
|
156 |
-
All rights granted under this License are granted for the term of
|
157 |
-
copyright on the Program, and are irrevocable provided the stated
|
158 |
-
conditions are met. This License explicitly affirms your unlimited
|
159 |
-
permission to run the unmodified Program. The output from running a
|
160 |
-
covered work is covered by this License only if the output, given its
|
161 |
-
content, constitutes a covered work. This License acknowledges your
|
162 |
-
rights of fair use or other equivalent, as provided by copyright law.
|
163 |
-
|
164 |
-
You may make, run and propagate covered works that you do not
|
165 |
-
convey, without conditions so long as your license otherwise remains
|
166 |
-
in force. You may convey covered works to others for the sole purpose
|
167 |
-
of having them make modifications exclusively for you, or provide you
|
168 |
-
with facilities for running those works, provided that you comply with
|
169 |
-
the terms of this License in conveying all material for which you do
|
170 |
-
not control copyright. Those thus making or running the covered works
|
171 |
-
for you must do so exclusively on your behalf, under your direction
|
172 |
-
and control, on terms that prohibit them from making any copies of
|
173 |
-
your copyrighted material outside their relationship with you.
|
174 |
-
|
175 |
-
Conveying under any other circumstances is permitted solely under
|
176 |
-
the conditions stated below. Sublicensing is not allowed; section 10
|
177 |
-
makes it unnecessary.
|
178 |
-
|
179 |
-
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
180 |
-
|
181 |
-
No covered work shall be deemed part of an effective technological
|
182 |
-
measure under any applicable law fulfilling obligations under article
|
183 |
-
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
184 |
-
similar laws prohibiting or restricting circumvention of such
|
185 |
-
measures.
|
186 |
-
|
187 |
-
When you convey a covered work, you waive any legal power to forbid
|
188 |
-
circumvention of technological measures to the extent such circumvention
|
189 |
-
is effected by exercising rights under this License with respect to
|
190 |
-
the covered work, and you disclaim any intention to limit operation or
|
191 |
-
modification of the work as a means of enforcing, against the work's
|
192 |
-
users, your or third parties' legal rights to forbid circumvention of
|
193 |
-
technological measures.
|
194 |
-
|
195 |
-
4. Conveying Verbatim Copies.
|
196 |
-
|
197 |
-
You may convey verbatim copies of the Program's source code as you
|
198 |
-
receive it, in any medium, provided that you conspicuously and
|
199 |
-
appropriately publish on each copy an appropriate copyright notice;
|
200 |
-
keep intact all notices stating that this License and any
|
201 |
-
non-permissive terms added in accord with section 7 apply to the code;
|
202 |
-
keep intact all notices of the absence of any warranty; and give all
|
203 |
-
recipients a copy of this License along with the Program.
|
204 |
-
|
205 |
-
You may charge any price or no price for each copy that you convey,
|
206 |
-
and you may offer support or warranty protection for a fee.
|
207 |
-
|
208 |
-
5. Conveying Modified Source Versions.
|
209 |
-
|
210 |
-
You may convey a work based on the Program, or the modifications to
|
211 |
-
produce it from the Program, in the form of source code under the
|
212 |
-
terms of section 4, provided that you also meet all of these conditions:
|
213 |
-
|
214 |
-
a) The work must carry prominent notices stating that you modified
|
215 |
-
it, and giving a relevant date.
|
216 |
-
|
217 |
-
b) The work must carry prominent notices stating that it is
|
218 |
-
released under this License and any conditions added under section
|
219 |
-
7. This requirement modifies the requirement in section 4 to
|
220 |
-
"keep intact all notices".
|
221 |
-
|
222 |
-
c) You must license the entire work, as a whole, under this
|
223 |
-
License to anyone who comes into possession of a copy. This
|
224 |
-
License will therefore apply, along with any applicable section 7
|
225 |
-
additional terms, to the whole of the work, and all its parts,
|
226 |
-
regardless of how they are packaged. This License gives no
|
227 |
-
permission to license the work in any other way, but it does not
|
228 |
-
invalidate such permission if you have separately received it.
|
229 |
-
|
230 |
-
d) If the work has interactive user interfaces, each must display
|
231 |
-
Appropriate Legal Notices; however, if the Program has interactive
|
232 |
-
interfaces that do not display Appropriate Legal Notices, your
|
233 |
-
work need not make them do so.
|
234 |
-
|
235 |
-
A compilation of a covered work with other separate and independent
|
236 |
-
works, which are not by their nature extensions of the covered work,
|
237 |
-
and which are not combined with it such as to form a larger program,
|
238 |
-
in or on a volume of a storage or distribution medium, is called an
|
239 |
-
"aggregate" if the compilation and its resulting copyright are not
|
240 |
-
used to limit the access or legal rights of the compilation's users
|
241 |
-
beyond what the individual works permit. Inclusion of a covered work
|
242 |
-
in an aggregate does not cause this License to apply to the other
|
243 |
-
parts of the aggregate.
|
244 |
-
|
245 |
-
6. Conveying Non-Source Forms.
|
246 |
-
|
247 |
-
You may convey a covered work in object code form under the terms
|
248 |
-
of sections 4 and 5, provided that you also convey the
|
249 |
-
machine-readable Corresponding Source under the terms of this License,
|
250 |
-
in one of these ways:
|
251 |
-
|
252 |
-
a) Convey the object code in, or embodied in, a physical product
|
253 |
-
(including a physical distribution medium), accompanied by the
|
254 |
-
Corresponding Source fixed on a durable physical medium
|
255 |
-
customarily used for software interchange.
|
256 |
-
|
257 |
-
b) Convey the object code in, or embodied in, a physical product
|
258 |
-
(including a physical distribution medium), accompanied by a
|
259 |
-
written offer, valid for at least three years and valid for as
|
260 |
-
long as you offer spare parts or customer support for that product
|
261 |
-
model, to give anyone who possesses the object code either (1) a
|
262 |
-
copy of the Corresponding Source for all the software in the
|
263 |
-
product that is covered by this License, on a durable physical
|
264 |
-
medium customarily used for software interchange, for a price no
|
265 |
-
more than your reasonable cost of physically performing this
|
266 |
-
conveying of source, or (2) access to copy the
|
267 |
-
Corresponding Source from a network server at no charge.
|
268 |
-
|
269 |
-
c) Convey individual copies of the object code with a copy of the
|
270 |
-
written offer to provide the Corresponding Source. This
|
271 |
-
alternative is allowed only occasionally and noncommercially, and
|
272 |
-
only if you received the object code with such an offer, in accord
|
273 |
-
with subsection 6b.
|
274 |
-
|
275 |
-
d) Convey the object code by offering access from a designated
|
276 |
-
place (gratis or for a charge), and offer equivalent access to the
|
277 |
-
Corresponding Source in the same way through the same place at no
|
278 |
-
further charge. You need not require recipients to copy the
|
279 |
-
Corresponding Source along with the object code. If the place to
|
280 |
-
copy the object code is a network server, the Corresponding Source
|
281 |
-
may be on a different server (operated by you or a third party)
|
282 |
-
that supports equivalent copying facilities, provided you maintain
|
283 |
-
clear directions next to the object code saying where to find the
|
284 |
-
Corresponding Source. Regardless of what server hosts the
|
285 |
-
Corresponding Source, you remain obligated to ensure that it is
|
286 |
-
available for as long as needed to satisfy these requirements.
|
287 |
-
|
288 |
-
e) Convey the object code using peer-to-peer transmission, provided
|
289 |
-
you inform other peers where the object code and Corresponding
|
290 |
-
Source of the work are being offered to the general public at no
|
291 |
-
charge under subsection 6d.
|
292 |
-
|
293 |
-
A separable portion of the object code, whose source code is excluded
|
294 |
-
from the Corresponding Source as a System Library, need not be
|
295 |
-
included in conveying the object code work.
|
296 |
-
|
297 |
-
A "User Product" is either (1) a "consumer product", which means any
|
298 |
-
tangible personal property which is normally used for personal, family,
|
299 |
-
or household purposes, or (2) anything designed or sold for incorporation
|
300 |
-
into a dwelling. In determining whether a product is a consumer product,
|
301 |
-
doubtful cases shall be resolved in favor of coverage. For a particular
|
302 |
-
product received by a particular user, "normally used" refers to a
|
303 |
-
typical or common use of that class of product, regardless of the status
|
304 |
-
of the particular user or of the way in which the particular user
|
305 |
-
actually uses, or expects or is expected to use, the product. A product
|
306 |
-
is a consumer product regardless of whether the product has substantial
|
307 |
-
commercial, industrial or non-consumer uses, unless such uses represent
|
308 |
-
the only significant mode of use of the product.
|
309 |
-
|
310 |
-
"Installation Information" for a User Product means any methods,
|
311 |
-
procedures, authorization keys, or other information required to install
|
312 |
-
and execute modified versions of a covered work in that User Product from
|
313 |
-
a modified version of its Corresponding Source. The information must
|
314 |
-
suffice to ensure that the continued functioning of the modified object
|
315 |
-
code is in no case prevented or interfered with solely because
|
316 |
-
modification has been made.
|
317 |
-
|
318 |
-
If you convey an object code work under this section in, or with, or
|
319 |
-
specifically for use in, a User Product, and the conveying occurs as
|
320 |
-
part of a transaction in which the right of possession and use of the
|
321 |
-
User Product is transferred to the recipient in perpetuity or for a
|
322 |
-
fixed term (regardless of how the transaction is characterized), the
|
323 |
-
Corresponding Source conveyed under this section must be accompanied
|
324 |
-
by the Installation Information. But this requirement does not apply
|
325 |
-
if neither you nor any third party retains the ability to install
|
326 |
-
modified object code on the User Product (for example, the work has
|
327 |
-
been installed in ROM).
|
328 |
-
|
329 |
-
The requirement to provide Installation Information does not include a
|
330 |
-
requirement to continue to provide support service, warranty, or updates
|
331 |
-
for a work that has been modified or installed by the recipient, or for
|
332 |
-
the User Product in which it has been modified or installed. Access to a
|
333 |
-
network may be denied when the modification itself materially and
|
334 |
-
adversely affects the operation of the network or violates the rules and
|
335 |
-
protocols for communication across the network.
|
336 |
-
|
337 |
-
Corresponding Source conveyed, and Installation Information provided,
|
338 |
-
in accord with this section must be in a format that is publicly
|
339 |
-
documented (and with an implementation available to the public in
|
340 |
-
source code form), and must require no special password or key for
|
341 |
-
unpacking, reading or copying.
|
342 |
-
|
343 |
-
7. Additional Terms.
|
344 |
-
|
345 |
-
"Additional permissions" are terms that supplement the terms of this
|
346 |
-
License by making exceptions from one or more of its conditions.
|
347 |
-
Additional permissions that are applicable to the entire Program shall
|
348 |
-
be treated as though they were included in this License, to the extent
|
349 |
-
that they are valid under applicable law. If additional permissions
|
350 |
-
apply only to part of the Program, that part may be used separately
|
351 |
-
under those permissions, but the entire Program remains governed by
|
352 |
-
this License without regard to the additional permissions.
|
353 |
-
|
354 |
-
When you convey a copy of a covered work, you may at your option
|
355 |
-
remove any additional permissions from that copy, or from any part of
|
356 |
-
it. (Additional permissions may be written to require their own
|
357 |
-
removal in certain cases when you modify the work.) You may place
|
358 |
-
additional permissions on material, added by you to a covered work,
|
359 |
-
for which you have or can give appropriate copyright permission.
|
360 |
-
|
361 |
-
Notwithstanding any other provision of this License, for material you
|
362 |
-
add to a covered work, you may (if authorized by the copyright holders of
|
363 |
-
that material) supplement the terms of this License with terms:
|
364 |
-
|
365 |
-
a) Disclaiming warranty or limiting liability differently from the
|
366 |
-
terms of sections 15 and 16 of this License; or
|
367 |
-
|
368 |
-
b) Requiring preservation of specified reasonable legal notices or
|
369 |
-
author attributions in that material or in the Appropriate Legal
|
370 |
-
Notices displayed by works containing it; or
|
371 |
-
|
372 |
-
c) Prohibiting misrepresentation of the origin of that material, or
|
373 |
-
requiring that modified versions of such material be marked in
|
374 |
-
reasonable ways as different from the original version; or
|
375 |
-
|
376 |
-
d) Limiting the use for publicity purposes of names of licensors or
|
377 |
-
authors of the material; or
|
378 |
-
|
379 |
-
e) Declining to grant rights under trademark law for use of some
|
380 |
-
trade names, trademarks, or service marks; or
|
381 |
-
|
382 |
-
f) Requiring indemnification of licensors and authors of that
|
383 |
-
material by anyone who conveys the material (or modified versions of
|
384 |
-
it) with contractual assumptions of liability to the recipient, for
|
385 |
-
any liability that these contractual assumptions directly impose on
|
386 |
-
those licensors and authors.
|
387 |
-
|
388 |
-
All other non-permissive additional terms are considered "further
|
389 |
-
restrictions" within the meaning of section 10. If the Program as you
|
390 |
-
received it, or any part of it, contains a notice stating that it is
|
391 |
-
governed by this License along with a term that is a further
|
392 |
-
restriction, you may remove that term. If a license document contains
|
393 |
-
a further restriction but permits relicensing or conveying under this
|
394 |
-
License, you may add to a covered work material governed by the terms
|
395 |
-
of that license document, provided that the further restriction does
|
396 |
-
not survive such relicensing or conveying.
|
397 |
-
|
398 |
-
If you add terms to a covered work in accord with this section, you
|
399 |
-
must place, in the relevant source files, a statement of the
|
400 |
-
additional terms that apply to those files, or a notice indicating
|
401 |
-
where to find the applicable terms.
|
402 |
-
|
403 |
-
Additional terms, permissive or non-permissive, may be stated in the
|
404 |
-
form of a separately written license, or stated as exceptions;
|
405 |
-
the above requirements apply either way.
|
406 |
-
|
407 |
-
8. Termination.
|
408 |
-
|
409 |
-
You may not propagate or modify a covered work except as expressly
|
410 |
-
provided under this License. Any attempt otherwise to propagate or
|
411 |
-
modify it is void, and will automatically terminate your rights under
|
412 |
-
this License (including any patent licenses granted under the third
|
413 |
-
paragraph of section 11).
|
414 |
-
|
415 |
-
However, if you cease all violation of this License, then your
|
416 |
-
license from a particular copyright holder is reinstated (a)
|
417 |
-
provisionally, unless and until the copyright holder explicitly and
|
418 |
-
finally terminates your license, and (b) permanently, if the copyright
|
419 |
-
holder fails to notify you of the violation by some reasonable means
|
420 |
-
prior to 60 days after the cessation.
|
421 |
-
|
422 |
-
Moreover, your license from a particular copyright holder is
|
423 |
-
reinstated permanently if the copyright holder notifies you of the
|
424 |
-
violation by some reasonable means, this is the first time you have
|
425 |
-
received notice of violation of this License (for any work) from that
|
426 |
-
copyright holder, and you cure the violation prior to 30 days after
|
427 |
-
your receipt of the notice.
|
428 |
-
|
429 |
-
Termination of your rights under this section does not terminate the
|
430 |
-
licenses of parties who have received copies or rights from you under
|
431 |
-
this License. If your rights have been terminated and not permanently
|
432 |
-
reinstated, you do not qualify to receive new licenses for the same
|
433 |
-
material under section 10.
|
434 |
-
|
435 |
-
9. Acceptance Not Required for Having Copies.
|
436 |
-
|
437 |
-
You are not required to accept this License in order to receive or
|
438 |
-
run a copy of the Program. Ancillary propagation of a covered work
|
439 |
-
occurring solely as a consequence of using peer-to-peer transmission
|
440 |
-
to receive a copy likewise does not require acceptance. However,
|
441 |
-
nothing other than this License grants you permission to propagate or
|
442 |
-
modify any covered work. These actions infringe copyright if you do
|
443 |
-
not accept this License. Therefore, by modifying or propagating a
|
444 |
-
covered work, you indicate your acceptance of this License to do so.
|
445 |
-
|
446 |
-
10. Automatic Licensing of Downstream Recipients.
|
447 |
-
|
448 |
-
Each time you convey a covered work, the recipient automatically
|
449 |
-
receives a license from the original licensors, to run, modify and
|
450 |
-
propagate that work, subject to this License. You are not responsible
|
451 |
-
for enforcing compliance by third parties with this License.
|
452 |
-
|
453 |
-
An "entity transaction" is a transaction transferring control of an
|
454 |
-
organization, or substantially all assets of one, or subdividing an
|
455 |
-
organization, or merging organizations. If propagation of a covered
|
456 |
-
work results from an entity transaction, each party to that
|
457 |
-
transaction who receives a copy of the work also receives whatever
|
458 |
-
licenses to the work the party's predecessor in interest had or could
|
459 |
-
give under the previous paragraph, plus a right to possession of the
|
460 |
-
Corresponding Source of the work from the predecessor in interest, if
|
461 |
-
the predecessor has it or can get it with reasonable efforts.
|
462 |
-
|
463 |
-
You may not impose any further restrictions on the exercise of the
|
464 |
-
rights granted or affirmed under this License. For example, you may
|
465 |
-
not impose a license fee, royalty, or other charge for exercise of
|
466 |
-
rights granted under this License, and you may not initiate litigation
|
467 |
-
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
468 |
-
any patent claim is infringed by making, using, selling, offering for
|
469 |
-
sale, or importing the Program or any portion of it.
|
470 |
-
|
471 |
-
11. Patents.
|
472 |
-
|
473 |
-
A "contributor" is a copyright holder who authorizes use under this
|
474 |
-
License of the Program or a work on which the Program is based. The
|
475 |
-
work thus licensed is called the contributor's "contributor version".
|
476 |
-
|
477 |
-
A contributor's "essential patent claims" are all patent claims
|
478 |
-
owned or controlled by the contributor, whether already acquired or
|
479 |
-
hereafter acquired, that would be infringed by some manner, permitted
|
480 |
-
by this License, of making, using, or selling its contributor version,
|
481 |
-
but do not include claims that would be infringed only as a
|
482 |
-
consequence of further modification of the contributor version. For
|
483 |
-
purposes of this definition, "control" includes the right to grant
|
484 |
-
patent sublicenses in a manner consistent with the requirements of
|
485 |
-
this License.
|
486 |
-
|
487 |
-
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
488 |
-
patent license under the contributor's essential patent claims, to
|
489 |
-
make, use, sell, offer for sale, import and otherwise run, modify and
|
490 |
-
propagate the contents of its contributor version.
|
491 |
-
|
492 |
-
In the following three paragraphs, a "patent license" is any express
|
493 |
-
agreement or commitment, however denominated, not to enforce a patent
|
494 |
-
(such as an express permission to practice a patent or covenant not to
|
495 |
-
sue for patent infringement). To "grant" such a patent license to a
|
496 |
-
party means to make such an agreement or commitment not to enforce a
|
497 |
-
patent against the party.
|
498 |
-
|
499 |
-
If you convey a covered work, knowingly relying on a patent license,
|
500 |
-
and the Corresponding Source of the work is not available for anyone
|
501 |
-
to copy, free of charge and under the terms of this License, through a
|
502 |
-
publicly available network server or other readily accessible means,
|
503 |
-
then you must either (1) cause the Corresponding Source to be so
|
504 |
-
available, or (2) arrange to deprive yourself of the benefit of the
|
505 |
-
patent license for this particular work, or (3) arrange, in a manner
|
506 |
-
consistent with the requirements of this License, to extend the patent
|
507 |
-
license to downstream recipients. "Knowingly relying" means you have
|
508 |
-
actual knowledge that, but for the patent license, your conveying the
|
509 |
-
covered work in a country, or your recipient's use of the covered work
|
510 |
-
in a country, would infringe one or more identifiable patents in that
|
511 |
-
country that you have reason to believe are valid.
|
512 |
-
|
513 |
-
If, pursuant to or in connection with a single transaction or
|
514 |
-
arrangement, you convey, or propagate by procuring conveyance of, a
|
515 |
-
covered work, and grant a patent license to some of the parties
|
516 |
-
receiving the covered work authorizing them to use, propagate, modify
|
517 |
-
or convey a specific copy of the covered work, then the patent license
|
518 |
-
you grant is automatically extended to all recipients of the covered
|
519 |
-
work and works based on it.
|
520 |
-
|
521 |
-
A patent license is "discriminatory" if it does not include within
|
522 |
-
the scope of its coverage, prohibits the exercise of, or is
|
523 |
-
conditioned on the non-exercise of one or more of the rights that are
|
524 |
-
specifically granted under this License. You may not convey a covered
|
525 |
-
work if you are a party to an arrangement with a third party that is
|
526 |
-
in the business of distributing software, under which you make payment
|
527 |
-
to the third party based on the extent of your activity of conveying
|
528 |
-
the work, and under which the third party grants, to any of the
|
529 |
-
parties who would receive the covered work from you, a discriminatory
|
530 |
-
patent license (a) in connection with copies of the covered work
|
531 |
-
conveyed by you (or copies made from those copies), or (b) primarily
|
532 |
-
for and in connection with specific products or compilations that
|
533 |
-
contain the covered work, unless you entered into that arrangement,
|
534 |
-
or that patent license was granted, prior to 28 March 2007.
|
535 |
-
|
536 |
-
Nothing in this License shall be construed as excluding or limiting
|
537 |
-
any implied license or other defenses to infringement that may
|
538 |
-
otherwise be available to you under applicable patent law.
|
539 |
-
|
540 |
-
12. No Surrender of Others' Freedom.
|
541 |
-
|
542 |
-
If conditions are imposed on you (whether by court order, agreement or
|
543 |
-
otherwise) that contradict the conditions of this License, they do not
|
544 |
-
excuse you from the conditions of this License. If you cannot convey a
|
545 |
-
covered work so as to satisfy simultaneously your obligations under this
|
546 |
-
License and any other pertinent obligations, then as a consequence you may
|
547 |
-
not convey it at all. For example, if you agree to terms that obligate you
|
548 |
-
to collect a royalty for further conveying from those to whom you convey
|
549 |
-
the Program, the only way you could satisfy both those terms and this
|
550 |
-
License would be to refrain entirely from conveying the Program.
|
551 |
-
|
552 |
-
13. Use with the GNU Affero General Public License.
|
553 |
-
|
554 |
-
Notwithstanding any other provision of this License, you have
|
555 |
-
permission to link or combine any covered work with a work licensed
|
556 |
-
under version 3 of the GNU Affero General Public License into a single
|
557 |
-
combined work, and to convey the resulting work. The terms of this
|
558 |
-
License will continue to apply to the part which is the covered work,
|
559 |
-
but the special requirements of the GNU Affero General Public License,
|
560 |
-
section 13, concerning interaction through a network will apply to the
|
561 |
-
combination as such.
|
562 |
-
|
563 |
-
14. Revised Versions of this License.
|
564 |
-
|
565 |
-
The Free Software Foundation may publish revised and/or new versions of
|
566 |
-
the GNU General Public License from time to time. Such new versions will
|
567 |
-
be similar in spirit to the present version, but may differ in detail to
|
568 |
-
address new problems or concerns.
|
569 |
-
|
570 |
-
Each version is given a distinguishing version number. If the
|
571 |
-
Program specifies that a certain numbered version of the GNU General
|
572 |
-
Public License "or any later version" applies to it, you have the
|
573 |
-
option of following the terms and conditions either of that numbered
|
574 |
-
version or of any later version published by the Free Software
|
575 |
-
Foundation. If the Program does not specify a version number of the
|
576 |
-
GNU General Public License, you may choose any version ever published
|
577 |
-
by the Free Software Foundation.
|
578 |
-
|
579 |
-
If the Program specifies that a proxy can decide which future
|
580 |
-
versions of the GNU General Public License can be used, that proxy's
|
581 |
-
public statement of acceptance of a version permanently authorizes you
|
582 |
-
to choose that version for the Program.
|
583 |
-
|
584 |
-
Later license versions may give you additional or different
|
585 |
-
permissions. However, no additional obligations are imposed on any
|
586 |
-
author or copyright holder as a result of your choosing to follow a
|
587 |
-
later version.
|
588 |
-
|
589 |
-
15. Disclaimer of Warranty.
|
590 |
-
|
591 |
-
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
592 |
-
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
593 |
-
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
594 |
-
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
595 |
-
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
596 |
-
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
597 |
-
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
598 |
-
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
599 |
-
|
600 |
-
16. Limitation of Liability.
|
601 |
-
|
602 |
-
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
603 |
-
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
604 |
-
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
605 |
-
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
606 |
-
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
607 |
-
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
608 |
-
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
609 |
-
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
610 |
-
SUCH DAMAGES.
|
611 |
-
|
612 |
-
17. Interpretation of Sections 15 and 16.
|
613 |
-
|
614 |
-
If the disclaimer of warranty and limitation of liability provided
|
615 |
-
above cannot be given local legal effect according to their terms,
|
616 |
-
reviewing courts shall apply local law that most closely approximates
|
617 |
-
an absolute waiver of all civil liability in connection with the
|
618 |
-
Program, unless a warranty or assumption of liability accompanies a
|
619 |
-
copy of the Program in return for a fee.
|
620 |
-
|
621 |
-
END OF TERMS AND CONDITIONS
|
622 |
-
|
623 |
-
How to Apply These Terms to Your New Programs
|
624 |
-
|
625 |
-
If you develop a new program, and you want it to be of the greatest
|
626 |
-
possible use to the public, the best way to achieve this is to make it
|
627 |
-
free software which everyone can redistribute and change under these terms.
|
628 |
-
|
629 |
-
To do so, attach the following notices to the program. It is safest
|
630 |
-
to attach them to the start of each source file to most effectively
|
631 |
-
state the exclusion of warranty; and each file should have at least
|
632 |
-
the "copyright" line and a pointer to where the full notice is found.
|
633 |
-
|
634 |
-
{one line to give the program's name and a brief idea of what it does.}
|
635 |
-
Copyright (C) {year} {name of author}
|
636 |
-
|
637 |
-
This program is free software: you can redistribute it and/or modify
|
638 |
-
it under the terms of the GNU General Public License as published by
|
639 |
-
the Free Software Foundation, either version 3 of the License, or
|
640 |
-
(at your option) any later version.
|
641 |
-
|
642 |
-
This program is distributed in the hope that it will be useful,
|
643 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
644 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
645 |
-
GNU General Public License for more details.
|
646 |
-
|
647 |
-
You should have received a copy of the GNU General Public License
|
648 |
-
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
649 |
-
|
650 |
-
Also add information on how to contact you by electronic and paper mail.
|
651 |
-
|
652 |
-
If the program does terminal interaction, make it output a short
|
653 |
-
notice like this when it starts in an interactive mode:
|
654 |
-
|
655 |
-
{project} Copyright (C) {year} {fullname}
|
656 |
-
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
657 |
-
This is free software, and you are welcome to redistribute it
|
658 |
-
under certain conditions; type `show c' for details.
|
659 |
-
|
660 |
-
The hypothetical commands `show w' and `show c' should show the appropriate
|
661 |
-
parts of the General Public License. Of course, your program's commands
|
662 |
-
might be different; for a GUI interface, you would use an "about box".
|
663 |
-
|
664 |
-
You should also get your employer (if you work as a programmer) or school,
|
665 |
-
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
666 |
-
For more information on this, and how to apply and follow the GNU GPL, see
|
667 |
-
<http://www.gnu.org/licenses/>.
|
668 |
-
|
669 |
-
The GNU General Public License does not permit incorporating your program
|
670 |
-
into proprietary programs. If your program is a subroutine library, you
|
671 |
-
may consider it more useful to permit linking proprietary applications with
|
672 |
-
the library. If this is what you want to do, use the GNU Lesser General
|
673 |
-
Public License instead of this License. But first, please read
|
674 |
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
1 |
+
GNU GENERAL PUBLIC LICENSE
|
2 |
+
Version 3, 29 June 2007
|
3 |
+
|
4 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
5 |
+
Everyone is permitted to copy and distribute verbatim copies
|
6 |
+
of this license document, but changing it is not allowed.
|
7 |
+
|
8 |
+
Preamble
|
9 |
+
|
10 |
+
The GNU General Public License is a free, copyleft license for
|
11 |
+
software and other kinds of works.
|
12 |
+
|
13 |
+
The licenses for most software and other practical works are designed
|
14 |
+
to take away your freedom to share and change the works. By contrast,
|
15 |
+
the GNU General Public License is intended to guarantee your freedom to
|
16 |
+
share and change all versions of a program--to make sure it remains free
|
17 |
+
software for all its users. We, the Free Software Foundation, use the
|
18 |
+
GNU General Public License for most of our software; it applies also to
|
19 |
+
any other work released this way by its authors. You can apply it to
|
20 |
+
your programs, too.
|
21 |
+
|
22 |
+
When we speak of free software, we are referring to freedom, not
|
23 |
+
price. Our General Public Licenses are designed to make sure that you
|
24 |
+
have the freedom to distribute copies of free software (and charge for
|
25 |
+
them if you wish), that you receive source code or can get it if you
|
26 |
+
want it, that you can change the software or use pieces of it in new
|
27 |
+
free programs, and that you know you can do these things.
|
28 |
+
|
29 |
+
To protect your rights, we need to prevent others from denying you
|
30 |
+
these rights or asking you to surrender the rights. Therefore, you have
|
31 |
+
certain responsibilities if you distribute copies of the software, or if
|
32 |
+
you modify it: responsibilities to respect the freedom of others.
|
33 |
+
|
34 |
+
For example, if you distribute copies of such a program, whether
|
35 |
+
gratis or for a fee, you must pass on to the recipients the same
|
36 |
+
freedoms that you received. You must make sure that they, too, receive
|
37 |
+
or can get the source code. And you must show them these terms so they
|
38 |
+
know their rights.
|
39 |
+
|
40 |
+
Developers that use the GNU GPL protect your rights with two steps:
|
41 |
+
(1) assert copyright on the software, and (2) offer you this License
|
42 |
+
giving you legal permission to copy, distribute and/or modify it.
|
43 |
+
|
44 |
+
For the developers' and authors' protection, the GPL clearly explains
|
45 |
+
that there is no warranty for this free software. For both users' and
|
46 |
+
authors' sake, the GPL requires that modified versions be marked as
|
47 |
+
changed, so that their problems will not be attributed erroneously to
|
48 |
+
authors of previous versions.
|
49 |
+
|
50 |
+
Some devices are designed to deny users access to install or run
|
51 |
+
modified versions of the software inside them, although the manufacturer
|
52 |
+
can do so. This is fundamentally incompatible with the aim of
|
53 |
+
protecting users' freedom to change the software. The systematic
|
54 |
+
pattern of such abuse occurs in the area of products for individuals to
|
55 |
+
use, which is precisely where it is most unacceptable. Therefore, we
|
56 |
+
have designed this version of the GPL to prohibit the practice for those
|
57 |
+
products. If such problems arise substantially in other domains, we
|
58 |
+
stand ready to extend this provision to those domains in future versions
|
59 |
+
of the GPL, as needed to protect the freedom of users.
|
60 |
+
|
61 |
+
Finally, every program is threatened constantly by software patents.
|
62 |
+
States should not allow patents to restrict development and use of
|
63 |
+
software on general-purpose computers, but in those that do, we wish to
|
64 |
+
avoid the special danger that patents applied to a free program could
|
65 |
+
make it effectively proprietary. To prevent this, the GPL assures that
|
66 |
+
patents cannot be used to render the program non-free.
|
67 |
+
|
68 |
+
The precise terms and conditions for copying, distribution and
|
69 |
+
modification follow.
|
70 |
+
|
71 |
+
TERMS AND CONDITIONS
|
72 |
+
|
73 |
+
0. Definitions.
|
74 |
+
|
75 |
+
"This License" refers to version 3 of the GNU General Public License.
|
76 |
+
|
77 |
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
78 |
+
works, such as semiconductor masks.
|
79 |
+
|
80 |
+
"The Program" refers to any copyrightable work licensed under this
|
81 |
+
License. Each licensee is addressed as "you". "Licensees" and
|
82 |
+
"recipients" may be individuals or organizations.
|
83 |
+
|
84 |
+
To "modify" a work means to copy from or adapt all or part of the work
|
85 |
+
in a fashion requiring copyright permission, other than the making of an
|
86 |
+
exact copy. The resulting work is called a "modified version" of the
|
87 |
+
earlier work or a work "based on" the earlier work.
|
88 |
+
|
89 |
+
A "covered work" means either the unmodified Program or a work based
|
90 |
+
on the Program.
|
91 |
+
|
92 |
+
To "propagate" a work means to do anything with it that, without
|
93 |
+
permission, would make you directly or secondarily liable for
|
94 |
+
infringement under applicable copyright law, except executing it on a
|
95 |
+
computer or modifying a private copy. Propagation includes copying,
|
96 |
+
distribution (with or without modification), making available to the
|
97 |
+
public, and in some countries other activities as well.
|
98 |
+
|
99 |
+
To "convey" a work means any kind of propagation that enables other
|
100 |
+
parties to make or receive copies. Mere interaction with a user through
|
101 |
+
a computer network, with no transfer of a copy, is not conveying.
|
102 |
+
|
103 |
+
An interactive user interface displays "Appropriate Legal Notices"
|
104 |
+
to the extent that it includes a convenient and prominently visible
|
105 |
+
feature that (1) displays an appropriate copyright notice, and (2)
|
106 |
+
tells the user that there is no warranty for the work (except to the
|
107 |
+
extent that warranties are provided), that licensees may convey the
|
108 |
+
work under this License, and how to view a copy of this License. If
|
109 |
+
the interface presents a list of user commands or options, such as a
|
110 |
+
menu, a prominent item in the list meets this criterion.
|
111 |
+
|
112 |
+
1. Source Code.
|
113 |
+
|
114 |
+
The "source code" for a work means the preferred form of the work
|
115 |
+
for making modifications to it. "Object code" means any non-source
|
116 |
+
form of a work.
|
117 |
+
|
118 |
+
A "Standard Interface" means an interface that either is an official
|
119 |
+
standard defined by a recognized standards body, or, in the case of
|
120 |
+
interfaces specified for a particular programming language, one that
|
121 |
+
is widely used among developers working in that language.
|
122 |
+
|
123 |
+
The "System Libraries" of an executable work include anything, other
|
124 |
+
than the work as a whole, that (a) is included in the normal form of
|
125 |
+
packaging a Major Component, but which is not part of that Major
|
126 |
+
Component, and (b) serves only to enable use of the work with that
|
127 |
+
Major Component, or to implement a Standard Interface for which an
|
128 |
+
implementation is available to the public in source code form. A
|
129 |
+
"Major Component", in this context, means a major essential component
|
130 |
+
(kernel, window system, and so on) of the specific operating system
|
131 |
+
(if any) on which the executable work runs, or a compiler used to
|
132 |
+
produce the work, or an object code interpreter used to run it.
|
133 |
+
|
134 |
+
The "Corresponding Source" for a work in object code form means all
|
135 |
+
the source code needed to generate, install, and (for an executable
|
136 |
+
work) run the object code and to modify the work, including scripts to
|
137 |
+
control those activities. However, it does not include the work's
|
138 |
+
System Libraries, or general-purpose tools or generally available free
|
139 |
+
programs which are used unmodified in performing those activities but
|
140 |
+
which are not part of the work. For example, Corresponding Source
|
141 |
+
includes interface definition files associated with source files for
|
142 |
+
the work, and the source code for shared libraries and dynamically
|
143 |
+
linked subprograms that the work is specifically designed to require,
|
144 |
+
such as by intimate data communication or control flow between those
|
145 |
+
subprograms and other parts of the work.
|
146 |
+
|
147 |
+
The Corresponding Source need not include anything that users
|
148 |
+
can regenerate automatically from other parts of the Corresponding
|
149 |
+
Source.
|
150 |
+
|
151 |
+
The Corresponding Source for a work in source code form is that
|
152 |
+
same work.
|
153 |
+
|
154 |
+
2. Basic Permissions.
|
155 |
+
|
156 |
+
All rights granted under this License are granted for the term of
|
157 |
+
copyright on the Program, and are irrevocable provided the stated
|
158 |
+
conditions are met. This License explicitly affirms your unlimited
|
159 |
+
permission to run the unmodified Program. The output from running a
|
160 |
+
covered work is covered by this License only if the output, given its
|
161 |
+
content, constitutes a covered work. This License acknowledges your
|
162 |
+
rights of fair use or other equivalent, as provided by copyright law.
|
163 |
+
|
164 |
+
You may make, run and propagate covered works that you do not
|
165 |
+
convey, without conditions so long as your license otherwise remains
|
166 |
+
in force. You may convey covered works to others for the sole purpose
|
167 |
+
of having them make modifications exclusively for you, or provide you
|
168 |
+
with facilities for running those works, provided that you comply with
|
169 |
+
the terms of this License in conveying all material for which you do
|
170 |
+
not control copyright. Those thus making or running the covered works
|
171 |
+
for you must do so exclusively on your behalf, under your direction
|
172 |
+
and control, on terms that prohibit them from making any copies of
|
173 |
+
your copyrighted material outside their relationship with you.
|
174 |
+
|
175 |
+
Conveying under any other circumstances is permitted solely under
|
176 |
+
the conditions stated below. Sublicensing is not allowed; section 10
|
177 |
+
makes it unnecessary.
|
178 |
+
|
179 |
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
180 |
+
|
181 |
+
No covered work shall be deemed part of an effective technological
|
182 |
+
measure under any applicable law fulfilling obligations under article
|
183 |
+
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
184 |
+
similar laws prohibiting or restricting circumvention of such
|
185 |
+
measures.
|
186 |
+
|
187 |
+
When you convey a covered work, you waive any legal power to forbid
|
188 |
+
circumvention of technological measures to the extent such circumvention
|
189 |
+
is effected by exercising rights under this License with respect to
|
190 |
+
the covered work, and you disclaim any intention to limit operation or
|
191 |
+
modification of the work as a means of enforcing, against the work's
|
192 |
+
users, your or third parties' legal rights to forbid circumvention of
|
193 |
+
technological measures.
|
194 |
+
|
195 |
+
4. Conveying Verbatim Copies.
|
196 |
+
|
197 |
+
You may convey verbatim copies of the Program's source code as you
|
198 |
+
receive it, in any medium, provided that you conspicuously and
|
199 |
+
appropriately publish on each copy an appropriate copyright notice;
|
200 |
+
keep intact all notices stating that this License and any
|
201 |
+
non-permissive terms added in accord with section 7 apply to the code;
|
202 |
+
keep intact all notices of the absence of any warranty; and give all
|
203 |
+
recipients a copy of this License along with the Program.
|
204 |
+
|
205 |
+
You may charge any price or no price for each copy that you convey,
|
206 |
+
and you may offer support or warranty protection for a fee.
|
207 |
+
|
208 |
+
5. Conveying Modified Source Versions.
|
209 |
+
|
210 |
+
You may convey a work based on the Program, or the modifications to
|
211 |
+
produce it from the Program, in the form of source code under the
|
212 |
+
terms of section 4, provided that you also meet all of these conditions:
|
213 |
+
|
214 |
+
a) The work must carry prominent notices stating that you modified
|
215 |
+
it, and giving a relevant date.
|
216 |
+
|
217 |
+
b) The work must carry prominent notices stating that it is
|
218 |
+
released under this License and any conditions added under section
|
219 |
+
7. This requirement modifies the requirement in section 4 to
|
220 |
+
"keep intact all notices".
|
221 |
+
|
222 |
+
c) You must license the entire work, as a whole, under this
|
223 |
+
License to anyone who comes into possession of a copy. This
|
224 |
+
License will therefore apply, along with any applicable section 7
|
225 |
+
additional terms, to the whole of the work, and all its parts,
|
226 |
+
regardless of how they are packaged. This License gives no
|
227 |
+
permission to license the work in any other way, but it does not
|
228 |
+
invalidate such permission if you have separately received it.
|
229 |
+
|
230 |
+
d) If the work has interactive user interfaces, each must display
|
231 |
+
Appropriate Legal Notices; however, if the Program has interactive
|
232 |
+
interfaces that do not display Appropriate Legal Notices, your
|
233 |
+
work need not make them do so.
|
234 |
+
|
235 |
+
A compilation of a covered work with other separate and independent
|
236 |
+
works, which are not by their nature extensions of the covered work,
|
237 |
+
and which are not combined with it such as to form a larger program,
|
238 |
+
in or on a volume of a storage or distribution medium, is called an
|
239 |
+
"aggregate" if the compilation and its resulting copyright are not
|
240 |
+
used to limit the access or legal rights of the compilation's users
|
241 |
+
beyond what the individual works permit. Inclusion of a covered work
|
242 |
+
in an aggregate does not cause this License to apply to the other
|
243 |
+
parts of the aggregate.
|
244 |
+
|
245 |
+
6. Conveying Non-Source Forms.
|
246 |
+
|
247 |
+
You may convey a covered work in object code form under the terms
|
248 |
+
of sections 4 and 5, provided that you also convey the
|
249 |
+
machine-readable Corresponding Source under the terms of this License,
|
250 |
+
in one of these ways:
|
251 |
+
|
252 |
+
a) Convey the object code in, or embodied in, a physical product
|
253 |
+
(including a physical distribution medium), accompanied by the
|
254 |
+
Corresponding Source fixed on a durable physical medium
|
255 |
+
customarily used for software interchange.
|
256 |
+
|
257 |
+
b) Convey the object code in, or embodied in, a physical product
|
258 |
+
(including a physical distribution medium), accompanied by a
|
259 |
+
written offer, valid for at least three years and valid for as
|
260 |
+
long as you offer spare parts or customer support for that product
|
261 |
+
model, to give anyone who possesses the object code either (1) a
|
262 |
+
copy of the Corresponding Source for all the software in the
|
263 |
+
product that is covered by this License, on a durable physical
|
264 |
+
medium customarily used for software interchange, for a price no
|
265 |
+
more than your reasonable cost of physically performing this
|
266 |
+
conveying of source, or (2) access to copy the
|
267 |
+
Corresponding Source from a network server at no charge.
|
268 |
+
|
269 |
+
c) Convey individual copies of the object code with a copy of the
|
270 |
+
written offer to provide the Corresponding Source. This
|
271 |
+
alternative is allowed only occasionally and noncommercially, and
|
272 |
+
only if you received the object code with such an offer, in accord
|
273 |
+
with subsection 6b.
|
274 |
+
|
275 |
+
d) Convey the object code by offering access from a designated
|
276 |
+
place (gratis or for a charge), and offer equivalent access to the
|
277 |
+
Corresponding Source in the same way through the same place at no
|
278 |
+
further charge. You need not require recipients to copy the
|
279 |
+
Corresponding Source along with the object code. If the place to
|
280 |
+
copy the object code is a network server, the Corresponding Source
|
281 |
+
may be on a different server (operated by you or a third party)
|
282 |
+
that supports equivalent copying facilities, provided you maintain
|
283 |
+
clear directions next to the object code saying where to find the
|
284 |
+
Corresponding Source. Regardless of what server hosts the
|
285 |
+
Corresponding Source, you remain obligated to ensure that it is
|
286 |
+
available for as long as needed to satisfy these requirements.
|
287 |
+
|
288 |
+
e) Convey the object code using peer-to-peer transmission, provided
|
289 |
+
you inform other peers where the object code and Corresponding
|
290 |
+
Source of the work are being offered to the general public at no
|
291 |
+
charge under subsection 6d.
|
292 |
+
|
293 |
+
A separable portion of the object code, whose source code is excluded
|
294 |
+
from the Corresponding Source as a System Library, need not be
|
295 |
+
included in conveying the object code work.
|
296 |
+
|
297 |
+
A "User Product" is either (1) a "consumer product", which means any
|
298 |
+
tangible personal property which is normally used for personal, family,
|
299 |
+
or household purposes, or (2) anything designed or sold for incorporation
|
300 |
+
into a dwelling. In determining whether a product is a consumer product,
|
301 |
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
302 |
+
product received by a particular user, "normally used" refers to a
|
303 |
+
typical or common use of that class of product, regardless of the status
|
304 |
+
of the particular user or of the way in which the particular user
|
305 |
+
actually uses, or expects or is expected to use, the product. A product
|
306 |
+
is a consumer product regardless of whether the product has substantial
|
307 |
+
commercial, industrial or non-consumer uses, unless such uses represent
|
308 |
+
the only significant mode of use of the product.
|
309 |
+
|
310 |
+
"Installation Information" for a User Product means any methods,
|
311 |
+
procedures, authorization keys, or other information required to install
|
312 |
+
and execute modified versions of a covered work in that User Product from
|
313 |
+
a modified version of its Corresponding Source. The information must
|
314 |
+
suffice to ensure that the continued functioning of the modified object
|
315 |
+
code is in no case prevented or interfered with solely because
|
316 |
+
modification has been made.
|
317 |
+
|
318 |
+
If you convey an object code work under this section in, or with, or
|
319 |
+
specifically for use in, a User Product, and the conveying occurs as
|
320 |
+
part of a transaction in which the right of possession and use of the
|
321 |
+
User Product is transferred to the recipient in perpetuity or for a
|
322 |
+
fixed term (regardless of how the transaction is characterized), the
|
323 |
+
Corresponding Source conveyed under this section must be accompanied
|
324 |
+
by the Installation Information. But this requirement does not apply
|
325 |
+
if neither you nor any third party retains the ability to install
|
326 |
+
modified object code on the User Product (for example, the work has
|
327 |
+
been installed in ROM).
|
328 |
+
|
329 |
+
The requirement to provide Installation Information does not include a
|
330 |
+
requirement to continue to provide support service, warranty, or updates
|
331 |
+
for a work that has been modified or installed by the recipient, or for
|
332 |
+
the User Product in which it has been modified or installed. Access to a
|
333 |
+
network may be denied when the modification itself materially and
|
334 |
+
adversely affects the operation of the network or violates the rules and
|
335 |
+
protocols for communication across the network.
|
336 |
+
|
337 |
+
Corresponding Source conveyed, and Installation Information provided,
|
338 |
+
in accord with this section must be in a format that is publicly
|
339 |
+
documented (and with an implementation available to the public in
|
340 |
+
source code form), and must require no special password or key for
|
341 |
+
unpacking, reading or copying.
|
342 |
+
|
343 |
+
7. Additional Terms.
|
344 |
+
|
345 |
+
"Additional permissions" are terms that supplement the terms of this
|
346 |
+
License by making exceptions from one or more of its conditions.
|
347 |
+
Additional permissions that are applicable to the entire Program shall
|
348 |
+
be treated as though they were included in this License, to the extent
|
349 |
+
that they are valid under applicable law. If additional permissions
|
350 |
+
apply only to part of the Program, that part may be used separately
|
351 |
+
under those permissions, but the entire Program remains governed by
|
352 |
+
this License without regard to the additional permissions.
|
353 |
+
|
354 |
+
When you convey a copy of a covered work, you may at your option
|
355 |
+
remove any additional permissions from that copy, or from any part of
|
356 |
+
it. (Additional permissions may be written to require their own
|
357 |
+
removal in certain cases when you modify the work.) You may place
|
358 |
+
additional permissions on material, added by you to a covered work,
|
359 |
+
for which you have or can give appropriate copyright permission.
|
360 |
+
|
361 |
+
Notwithstanding any other provision of this License, for material you
|
362 |
+
add to a covered work, you may (if authorized by the copyright holders of
|
363 |
+
that material) supplement the terms of this License with terms:
|
364 |
+
|
365 |
+
a) Disclaiming warranty or limiting liability differently from the
|
366 |
+
terms of sections 15 and 16 of this License; or
|
367 |
+
|
368 |
+
b) Requiring preservation of specified reasonable legal notices or
|
369 |
+
author attributions in that material or in the Appropriate Legal
|
370 |
+
Notices displayed by works containing it; or
|
371 |
+
|
372 |
+
c) Prohibiting misrepresentation of the origin of that material, or
|
373 |
+
requiring that modified versions of such material be marked in
|
374 |
+
reasonable ways as different from the original version; or
|
375 |
+
|
376 |
+
d) Limiting the use for publicity purposes of names of licensors or
|
377 |
+
authors of the material; or
|
378 |
+
|
379 |
+
e) Declining to grant rights under trademark law for use of some
|
380 |
+
trade names, trademarks, or service marks; or
|
381 |
+
|
382 |
+
f) Requiring indemnification of licensors and authors of that
|
383 |
+
material by anyone who conveys the material (or modified versions of
|
384 |
+
it) with contractual assumptions of liability to the recipient, for
|
385 |
+
any liability that these contractual assumptions directly impose on
|
386 |
+
those licensors and authors.
|
387 |
+
|
388 |
+
All other non-permissive additional terms are considered "further
|
389 |
+
restrictions" within the meaning of section 10. If the Program as you
|
390 |
+
received it, or any part of it, contains a notice stating that it is
|
391 |
+
governed by this License along with a term that is a further
|
392 |
+
restriction, you may remove that term. If a license document contains
|
393 |
+
a further restriction but permits relicensing or conveying under this
|
394 |
+
License, you may add to a covered work material governed by the terms
|
395 |
+
of that license document, provided that the further restriction does
|
396 |
+
not survive such relicensing or conveying.
|
397 |
+
|
398 |
+
If you add terms to a covered work in accord with this section, you
|
399 |
+
must place, in the relevant source files, a statement of the
|
400 |
+
additional terms that apply to those files, or a notice indicating
|
401 |
+
where to find the applicable terms.
|
402 |
+
|
403 |
+
Additional terms, permissive or non-permissive, may be stated in the
|
404 |
+
form of a separately written license, or stated as exceptions;
|
405 |
+
the above requirements apply either way.
|
406 |
+
|
407 |
+
8. Termination.
|
408 |
+
|
409 |
+
You may not propagate or modify a covered work except as expressly
|
410 |
+
provided under this License. Any attempt otherwise to propagate or
|
411 |
+
modify it is void, and will automatically terminate your rights under
|
412 |
+
this License (including any patent licenses granted under the third
|
413 |
+
paragraph of section 11).
|
414 |
+
|
415 |
+
However, if you cease all violation of this License, then your
|
416 |
+
license from a particular copyright holder is reinstated (a)
|
417 |
+
provisionally, unless and until the copyright holder explicitly and
|
418 |
+
finally terminates your license, and (b) permanently, if the copyright
|
419 |
+
holder fails to notify you of the violation by some reasonable means
|
420 |
+
prior to 60 days after the cessation.
|
421 |
+
|
422 |
+
Moreover, your license from a particular copyright holder is
|
423 |
+
reinstated permanently if the copyright holder notifies you of the
|
424 |
+
violation by some reasonable means, this is the first time you have
|
425 |
+
received notice of violation of this License (for any work) from that
|
426 |
+
copyright holder, and you cure the violation prior to 30 days after
|
427 |
+
your receipt of the notice.
|
428 |
+
|
429 |
+
Termination of your rights under this section does not terminate the
|
430 |
+
licenses of parties who have received copies or rights from you under
|
431 |
+
this License. If your rights have been terminated and not permanently
|
432 |
+
reinstated, you do not qualify to receive new licenses for the same
|
433 |
+
material under section 10.
|
434 |
+
|
435 |
+
9. Acceptance Not Required for Having Copies.
|
436 |
+
|
437 |
+
You are not required to accept this License in order to receive or
|
438 |
+
run a copy of the Program. Ancillary propagation of a covered work
|
439 |
+
occurring solely as a consequence of using peer-to-peer transmission
|
440 |
+
to receive a copy likewise does not require acceptance. However,
|
441 |
+
nothing other than this License grants you permission to propagate or
|
442 |
+
modify any covered work. These actions infringe copyright if you do
|
443 |
+
not accept this License. Therefore, by modifying or propagating a
|
444 |
+
covered work, you indicate your acceptance of this License to do so.
|
445 |
+
|
446 |
+
10. Automatic Licensing of Downstream Recipients.
|
447 |
+
|
448 |
+
Each time you convey a covered work, the recipient automatically
|
449 |
+
receives a license from the original licensors, to run, modify and
|
450 |
+
propagate that work, subject to this License. You are not responsible
|
451 |
+
for enforcing compliance by third parties with this License.
|
452 |
+
|
453 |
+
An "entity transaction" is a transaction transferring control of an
|
454 |
+
organization, or substantially all assets of one, or subdividing an
|
455 |
+
organization, or merging organizations. If propagation of a covered
|
456 |
+
work results from an entity transaction, each party to that
|
457 |
+
transaction who receives a copy of the work also receives whatever
|
458 |
+
licenses to the work the party's predecessor in interest had or could
|
459 |
+
give under the previous paragraph, plus a right to possession of the
|
460 |
+
Corresponding Source of the work from the predecessor in interest, if
|
461 |
+
the predecessor has it or can get it with reasonable efforts.
|
462 |
+
|
463 |
+
You may not impose any further restrictions on the exercise of the
|
464 |
+
rights granted or affirmed under this License. For example, you may
|
465 |
+
not impose a license fee, royalty, or other charge for exercise of
|
466 |
+
rights granted under this License, and you may not initiate litigation
|
467 |
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
468 |
+
any patent claim is infringed by making, using, selling, offering for
|
469 |
+
sale, or importing the Program or any portion of it.
|
470 |
+
|
471 |
+
11. Patents.
|
472 |
+
|
473 |
+
A "contributor" is a copyright holder who authorizes use under this
|
474 |
+
License of the Program or a work on which the Program is based. The
|
475 |
+
work thus licensed is called the contributor's "contributor version".
|
476 |
+
|
477 |
+
A contributor's "essential patent claims" are all patent claims
|
478 |
+
owned or controlled by the contributor, whether already acquired or
|
479 |
+
hereafter acquired, that would be infringed by some manner, permitted
|
480 |
+
by this License, of making, using, or selling its contributor version,
|
481 |
+
but do not include claims that would be infringed only as a
|
482 |
+
consequence of further modification of the contributor version. For
|
483 |
+
purposes of this definition, "control" includes the right to grant
|
484 |
+
patent sublicenses in a manner consistent with the requirements of
|
485 |
+
this License.
|
486 |
+
|
487 |
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
488 |
+
patent license under the contributor's essential patent claims, to
|
489 |
+
make, use, sell, offer for sale, import and otherwise run, modify and
|
490 |
+
propagate the contents of its contributor version.
|
491 |
+
|
492 |
+
In the following three paragraphs, a "patent license" is any express
|
493 |
+
agreement or commitment, however denominated, not to enforce a patent
|
494 |
+
(such as an express permission to practice a patent or covenant not to
|
495 |
+
sue for patent infringement). To "grant" such a patent license to a
|
496 |
+
party means to make such an agreement or commitment not to enforce a
|
497 |
+
patent against the party.
|
498 |
+
|
499 |
+
If you convey a covered work, knowingly relying on a patent license,
|
500 |
+
and the Corresponding Source of the work is not available for anyone
|
501 |
+
to copy, free of charge and under the terms of this License, through a
|
502 |
+
publicly available network server or other readily accessible means,
|
503 |
+
then you must either (1) cause the Corresponding Source to be so
|
504 |
+
available, or (2) arrange to deprive yourself of the benefit of the
|
505 |
+
patent license for this particular work, or (3) arrange, in a manner
|
506 |
+
consistent with the requirements of this License, to extend the patent
|
507 |
+
license to downstream recipients. "Knowingly relying" means you have
|
508 |
+
actual knowledge that, but for the patent license, your conveying the
|
509 |
+
covered work in a country, or your recipient's use of the covered work
|
510 |
+
in a country, would infringe one or more identifiable patents in that
|
511 |
+
country that you have reason to believe are valid.
|
512 |
+
|
513 |
+
If, pursuant to or in connection with a single transaction or
|
514 |
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
515 |
+
covered work, and grant a patent license to some of the parties
|
516 |
+
receiving the covered work authorizing them to use, propagate, modify
|
517 |
+
or convey a specific copy of the covered work, then the patent license
|
518 |
+
you grant is automatically extended to all recipients of the covered
|
519 |
+
work and works based on it.
|
520 |
+
|
521 |
+
A patent license is "discriminatory" if it does not include within
|
522 |
+
the scope of its coverage, prohibits the exercise of, or is
|
523 |
+
conditioned on the non-exercise of one or more of the rights that are
|
524 |
+
specifically granted under this License. You may not convey a covered
|
525 |
+
work if you are a party to an arrangement with a third party that is
|
526 |
+
in the business of distributing software, under which you make payment
|
527 |
+
to the third party based on the extent of your activity of conveying
|
528 |
+
the work, and under which the third party grants, to any of the
|
529 |
+
parties who would receive the covered work from you, a discriminatory
|
530 |
+
patent license (a) in connection with copies of the covered work
|
531 |
+
conveyed by you (or copies made from those copies), or (b) primarily
|
532 |
+
for and in connection with specific products or compilations that
|
533 |
+
contain the covered work, unless you entered into that arrangement,
|
534 |
+
or that patent license was granted, prior to 28 March 2007.
|
535 |
+
|
536 |
+
Nothing in this License shall be construed as excluding or limiting
|
537 |
+
any implied license or other defenses to infringement that may
|
538 |
+
otherwise be available to you under applicable patent law.
|
539 |
+
|
540 |
+
12. No Surrender of Others' Freedom.
|
541 |
+
|
542 |
+
If conditions are imposed on you (whether by court order, agreement or
|
543 |
+
otherwise) that contradict the conditions of this License, they do not
|
544 |
+
excuse you from the conditions of this License. If you cannot convey a
|
545 |
+
covered work so as to satisfy simultaneously your obligations under this
|
546 |
+
License and any other pertinent obligations, then as a consequence you may
|
547 |
+
not convey it at all. For example, if you agree to terms that obligate you
|
548 |
+
to collect a royalty for further conveying from those to whom you convey
|
549 |
+
the Program, the only way you could satisfy both those terms and this
|
550 |
+
License would be to refrain entirely from conveying the Program.
|
551 |
+
|
552 |
+
13. Use with the GNU Affero General Public License.
|
553 |
+
|
554 |
+
Notwithstanding any other provision of this License, you have
|
555 |
+
permission to link or combine any covered work with a work licensed
|
556 |
+
under version 3 of the GNU Affero General Public License into a single
|
557 |
+
combined work, and to convey the resulting work. The terms of this
|
558 |
+
License will continue to apply to the part which is the covered work,
|
559 |
+
but the special requirements of the GNU Affero General Public License,
|
560 |
+
section 13, concerning interaction through a network will apply to the
|
561 |
+
combination as such.
|
562 |
+
|
563 |
+
14. Revised Versions of this License.
|
564 |
+
|
565 |
+
The Free Software Foundation may publish revised and/or new versions of
|
566 |
+
the GNU General Public License from time to time. Such new versions will
|
567 |
+
be similar in spirit to the present version, but may differ in detail to
|
568 |
+
address new problems or concerns.
|
569 |
+
|
570 |
+
Each version is given a distinguishing version number. If the
|
571 |
+
Program specifies that a certain numbered version of the GNU General
|
572 |
+
Public License "or any later version" applies to it, you have the
|
573 |
+
option of following the terms and conditions either of that numbered
|
574 |
+
version or of any later version published by the Free Software
|
575 |
+
Foundation. If the Program does not specify a version number of the
|
576 |
+
GNU General Public License, you may choose any version ever published
|
577 |
+
by the Free Software Foundation.
|
578 |
+
|
579 |
+
If the Program specifies that a proxy can decide which future
|
580 |
+
versions of the GNU General Public License can be used, that proxy's
|
581 |
+
public statement of acceptance of a version permanently authorizes you
|
582 |
+
to choose that version for the Program.
|
583 |
+
|
584 |
+
Later license versions may give you additional or different
|
585 |
+
permissions. However, no additional obligations are imposed on any
|
586 |
+
author or copyright holder as a result of your choosing to follow a
|
587 |
+
later version.
|
588 |
+
|
589 |
+
15. Disclaimer of Warranty.
|
590 |
+
|
591 |
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
592 |
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
593 |
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
594 |
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
595 |
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
596 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
597 |
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
598 |
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
599 |
+
|
600 |
+
16. Limitation of Liability.
|
601 |
+
|
602 |
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
603 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
604 |
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
605 |
+
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
606 |
+
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
607 |
+
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
608 |
+
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
609 |
+
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
610 |
+
SUCH DAMAGES.
|
611 |
+
|
612 |
+
17. Interpretation of Sections 15 and 16.
|
613 |
+
|
614 |
+
If the disclaimer of warranty and limitation of liability provided
|
615 |
+
above cannot be given local legal effect according to their terms,
|
616 |
+
reviewing courts shall apply local law that most closely approximates
|
617 |
+
an absolute waiver of all civil liability in connection with the
|
618 |
+
Program, unless a warranty or assumption of liability accompanies a
|
619 |
+
copy of the Program in return for a fee.
|
620 |
+
|
621 |
+
END OF TERMS AND CONDITIONS
|
622 |
+
|
623 |
+
How to Apply These Terms to Your New Programs
|
624 |
+
|
625 |
+
If you develop a new program, and you want it to be of the greatest
|
626 |
+
possible use to the public, the best way to achieve this is to make it
|
627 |
+
free software which everyone can redistribute and change under these terms.
|
628 |
+
|
629 |
+
To do so, attach the following notices to the program. It is safest
|
630 |
+
to attach them to the start of each source file to most effectively
|
631 |
+
state the exclusion of warranty; and each file should have at least
|
632 |
+
the "copyright" line and a pointer to where the full notice is found.
|
633 |
+
|
634 |
+
{one line to give the program's name and a brief idea of what it does.}
|
635 |
+
Copyright (C) {year} {name of author}
|
636 |
+
|
637 |
+
This program is free software: you can redistribute it and/or modify
|
638 |
+
it under the terms of the GNU General Public License as published by
|
639 |
+
the Free Software Foundation, either version 3 of the License, or
|
640 |
+
(at your option) any later version.
|
641 |
+
|
642 |
+
This program is distributed in the hope that it will be useful,
|
643 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
644 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
645 |
+
GNU General Public License for more details.
|
646 |
+
|
647 |
+
You should have received a copy of the GNU General Public License
|
648 |
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
649 |
+
|
650 |
+
Also add information on how to contact you by electronic and paper mail.
|
651 |
+
|
652 |
+
If the program does terminal interaction, make it output a short
|
653 |
+
notice like this when it starts in an interactive mode:
|
654 |
+
|
655 |
+
{project} Copyright (C) {year} {fullname}
|
656 |
+
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
657 |
+
This is free software, and you are welcome to redistribute it
|
658 |
+
under certain conditions; type `show c' for details.
|
659 |
+
|
660 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
661 |
+
parts of the General Public License. Of course, your program's commands
|
662 |
+
might be different; for a GUI interface, you would use an "about box".
|
663 |
+
|
664 |
+
You should also get your employer (if you work as a programmer) or school,
|
665 |
+
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
666 |
+
For more information on this, and how to apply and follow the GNU GPL, see
|
667 |
+
<http://www.gnu.org/licenses/>.
|
668 |
+
|
669 |
+
The GNU General Public License does not permit incorporating your program
|
670 |
+
into proprietary programs. If your program is a subroutine library, you
|
671 |
+
may consider it more useful to permit linking proprietary applications with
|
672 |
+
the library. If this is what you want to do, use the GNU Lesser General
|
673 |
+
Public License instead of this License. But first, please read
|
674 |
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
freemius/README.md
CHANGED
@@ -1,253 +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.
|
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
CHANGED
@@ -1 +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 h3 .dashicons{width:26px;height:26px;font-size:1.3em}#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%}
|
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 h3 .dashicons{width:26px;height:26px;font-size:1.3em}#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
CHANGED
@@ -1,2 +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}}
|
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/affiliation.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
@charset "UTF-8";#fs_affiliation_content_wrapper #messages{margin-top:25px}#fs_affiliation_content_wrapper h3{font-size:24px;padding:0;margin-left:0}#fs_affiliation_content_wrapper ul li{box-sizing:border-box;list-style-type:none}#fs_affiliation_content_wrapper ul li:before{content:'✓';margin-right:10px;font-weight:bold}#fs_affiliation_content_wrapper p:not(.description),#fs_affiliation_content_wrapper li,#fs_affiliation_content_wrapper label{font-size:16px !important;line-height:26px !important}#fs_affiliation_content_wrapper .button{margin-top:20px;margin-bottom:7px;line-height:35px;height:40px;font-size:16px}#fs_affiliation_content_wrapper .button#cancel_button{margin-right:5px}#fs_affiliation_content_wrapper form .input-container{margin-bottom:15px}#fs_affiliation_content_wrapper form .input-container .input-label{font-weight:bold;display:block;width:100%}#fs_affiliation_content_wrapper form .input-container.input-container-text label,#fs_affiliation_content_wrapper form .input-container.input-container-text input,#fs_affiliation_content_wrapper form .input-container.input-container-text textarea{display:block}#fs_affiliation_content_wrapper form .input-container #add_domain,#fs_affiliation_content_wrapper form .input-container .remove-domain{text-decoration:none;display:inline-block;margin-top:3px}#fs_affiliation_content_wrapper form .input-container #add_domain:focus,#fs_affiliation_content_wrapper form .input-container .remove-domain:focus{box-shadow:none}#fs_affiliation_content_wrapper form .input-container #add_domain.disabled,#fs_affiliation_content_wrapper form .input-container .remove-domain.disabled{color:#aaa;cursor:default}#fs_affiliation_content_wrapper form #extra_domains_container .description{margin-top:0;position:relative;top:-4px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container{margin-bottom:15px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container .domain{display:inline-block;margin-right:5px}#fs_affiliation_content_wrapper form #extra_domains_container .extra-domain-input-container .domain:last-of-type{margin-bottom:0}
|
freemius/assets/css/admin/checkout.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
@media screen and (max-width: 782px){#wpbody-content{padding-bottom:0 !important}}
|
1 |
+
@media screen and (max-width: 782px){#wpbody-content{padding-bottom:0 !important}}
|
freemius/assets/css/admin/common.css
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
.theme-browser .theme .fs-premium-theme-badge{position:absolute;top:10px;right:0;background:#71ae00;color:#fff;text-transform:uppercase;padding:5px 10px;-moz-border-radius:3px 0 0 3px;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;font-weight:bold;border-right:0;-moz-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);-webkit-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);font-size:1.1em}#iframe{line-height:0;font-size:0}.fs-full-size-wrapper{margin:40px 0 -65px -20px}@media (max-width: 600px){.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}div.fs-notice.updated,div.fs-notice.success,div.fs-notice.promotion{display:block !important}.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;-moz-box-shadow:0 2px 2px rgba(6,113,6,0.3);-webkit-box-shadow:0 2px 2px rgba(6,113,6,0.3);box-shadow:0 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)}.fs-secure-notice a.fs-security-proof{color:green;text-decoration:none}@media screen and (max-width: 960px){.fs-secure-notice{left:36px}}@media screen and (max-width: 600px){.fs-secure-notice{display:none}}@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}.fs-ajax-spinner{border:0;width:20px;height:20px;margin-right:5px;vertical-align:sub;display:inline-block;background:url("../../../../../../../wp-admin/images/wpspin_light-2x.gif");background-size:contain}.wrap.fs-section h2{text-align:left}
|
1 |
+
.theme-browser .theme .fs-premium-theme-badge{position:absolute;top:10px;right:0;background:#71ae00;color:#fff;text-transform:uppercase;padding:5px 10px;-moz-border-radius:3px 0 0 3px;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;font-weight:bold;border-right:0;-moz-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);-webkit-box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);box-shadow:0 2px 1px -1px rgba(0,0,0,0.3);font-size:1.1em}#iframe{line-height:0;font-size:0}.fs-full-size-wrapper{margin:40px 0 -65px -20px}@media (max-width: 600px){.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}div.fs-notice.updated,div.fs-notice.success,div.fs-notice.promotion{display:block !important}.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;-moz-box-shadow:0 2px 2px rgba(6,113,6,0.3);-webkit-box-shadow:0 2px 2px rgba(6,113,6,0.3);box-shadow:0 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)}.fs-secure-notice a.fs-security-proof{color:green;text-decoration:none}@media screen and (max-width: 960px){.fs-secure-notice{left:36px}}@media screen and (max-width: 600px){.fs-secure-notice{display:none}}@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}.fs-ajax-spinner{border:0;width:20px;height:20px;margin-right:5px;vertical-align:sub;display:inline-block;background:url("../../../../../../../wp-admin/images/wpspin_light-2x.gif");background-size:contain}.wrap.fs-section h2{text-align:left}
|
freemius/assets/css/admin/connect.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
#fs_connect{width:480px;-moz-box-shadow:0px 1px 2px rgba(0,0,0,0.3);-webkit-box-shadow:0px 1px 2px rgba(0,0,0,0.3);box-shadow:0px 1px 2px rgba(0,0,0,0.3);margin:20px 0}@media screen and (max-width: 479px){#fs_connect{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;width:auto;margin:0 0 0 -10px}}#fs_connect .fs-content{background:#fff;padding:15px 20px}#fs_connect .fs-content .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}#fs_theme_connect_wrapper{position:fixed;top:0;height:100%;width:100%;z-index:99990;background:rgba(0,0,0,0.75);text-align:center;overflow-y:auto}#fs_theme_connect_wrapper:before{content:"";display:inline-block;vertical-align:middle;height:100%}#fs_theme_connect_wrapper>button.close{color:white;cursor:pointer;height:40px;width:40px;position:absolute;right:0;border:0;background-color:transparent;top:32px}#fs_theme_connect_wrapper #fs_connect{top:0;text-align:left;display:inline-block;vertical-align:middle;margin-top:52px;margin-bottom:20px}#fs_theme_connect_wrapper #fs_connect .fs-terms{background:rgba(140,140,140,0.64)}#fs_theme_connect_wrapper #fs_connect .fs-terms,#fs_theme_connect_wrapper #fs_connect .fs-terms a{color:#c5c5c5}.wp-pointer-content #fs_connect{margin:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.fs-opt-in-pointer .wp-pointer-content{padding:0}.fs-opt-in-pointer.wp-pointer-top .wp-pointer-arrow{border-bottom-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-top .wp-pointer-arrow-inner{border-bottom-color:#fafafa}.fs-opt-in-pointer.wp-pointer-bottom .wp-pointer-arrow{border-top-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-bottom .wp-pointer-arrow-inner{border-top-color:#fafafa}.fs-opt-in-pointer.wp-pointer-left .wp-pointer-arrow{border-right-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-left .wp-pointer-arrow-inner{border-right-color:#fafafa}.fs-opt-in-pointer.wp-pointer-right .wp-pointer-arrow{border-left-color:#dfdfdf}.fs-opt-in-pointer.wp-pointer-right .wp-pointer-arrow-inner{border-left-color:#fafafa}
|
1 |
+
#fs_connect{width:480px;-moz-box-shadow:0px 1px 2px rgba(0,0,0,0.3);-webkit-box-shadow:0px 1px 2px rgba(0,0,0,0.3);box-shadow:0px 1px 2px rgba(0,0,0,0.3);margin:20px 0}@media screen and (max-width: 479px){#fs_connect{-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;width:auto;margin:0 0 0 -10px}}#fs_connect .fs-content{background:#fff;padding:15px 20px}#fs_connect .fs-content .fs-error{background:snow;color:#d3135a;border:1px solid #d3135a;-moz-box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);-webkit-box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);box-shadow:0 1px 1px 0 rgba(0,0,0,0.1);text-align:center;padding:5px;margin-bottom:10px}#fs_connect .fs-content p{margin:0;padding:0;font-size:1.2em}#fs_connect .fs-license-key-container{position:relative;width:280px;margin:10px auto 0 auto}#fs_connect .fs-license-key-container input{width:100%}#fs_connect .fs-license-key-container .dashicons{position:absolute;top:5px;right:5px}#fs_connect .fs-actions{padding:10px 20px;background:#C0C7CA}#fs_connect .fs-actions .button{padding:0 10px 1px;line-height:35px;height:37px;font-size:16px;margin-bottom:0}#fs_connect .fs-actions .button .dashicons{font-size:37px;margin-left:-8px;margin-right:12px}#fs_connect .fs-actions .button.button-primary{padding-right:15px;padding-left:15px}#fs_connect .fs-actions .button.button-primary:after{content:' \279C'}#fs_connect .fs-actions .button.button-primary.fs-loading:after{content:''}#fs_connect .fs-actions .button.button-secondary{float:right}#fs_connect.fs-anonymous-disabled .fs-actions .button.button-primary{width:100%}#fs_connect .fs-permissions{padding:10px 20px;background:#FEFEFE;-moz-transition:background 0.5s ease;-o-transition:background 0.5s ease;-ms-transition:background 0.5s ease;-webkit-transition:background 0.5s ease;transition:background 0.5s ease}#fs_connect .fs-permissions .fs-license-sync-disclaimer{text-align:center;margin-top:0}#fs_connect .fs-permissions .fs-trigger{font-size:0.9em;text-decoration:none;text-align:center;display:block}#fs_connect .fs-permissions ul{height:0;overflow:hidden;margin:0}#fs_connect .fs-permissions ul li{margin-bottom:12px}#fs_connect .fs-permissions ul li:last-child{margin-bottom:0}#fs_connect .fs-permissions ul li i.dashicons{float:left;font-size:40px;width:40px;height:40px}#fs_connect .fs-permissions ul li div{margin-left:55px}#fs_connect .fs-permissions ul li div span{font-weight:bold;text-transform:uppercase;color:#23282d}#fs_connect .fs-permissions ul li div p{margin:2px 0 0 0}#fs_connect .fs-permissions.fs-open{background:#fff}#fs_connect .fs-permissions.fs-open ul{height:auto;margin:20px 20px 10px 20px}@media screen and (max-width: 479px){#fs_connect .fs-permissions{background:#fff}#fs_connect .fs-permissions .fs-trigger{display:none}#fs_connect .fs-permissions ul{height:auto;margin:20px}}#fs_connect .fs-freemium-licensing{padding:8px;background:#777;color:#fff}#fs_connect .fs-freemium-licensing p{text-align:center;display:block;margin:0;padding:0}#fs_connect .fs-freemium-licensing a{color:#C2EEFF;text-decoration:underline}#fs_connect .fs-visual{padding:12px;line-height:0;background:#fafafa;height:80px;position:relative}#fs_connect .fs-visual .fs-site-icon{position:absolute;left:20px;top:10px}#fs_connect .fs-visual .fs-connect-logo{position:absolute;right:20px;top:10px}#fs_connect .fs-visual .fs-plugin-icon{position:absolute;top:10px;left:50%;margin-left:-40px}#fs_connect .fs-visual .fs-plugin-icon,#fs_connect .fs-visual .fs-site-icon,#fs_connect .fs-visual img,#fs_connect .fs-visual object{width:80px;height:80px}#fs_connect .fs-visual .dashicons-wordpress{font-size:64px;background:#01749a;color:#fff;width:64px;height:64px;padding:8px}#fs_connect .fs-visual .dashicons-plus{position:absolute;top:50%;font-size:30px;margin-top:-10px;color:#bbb}#fs_connect .fs-visual .dashicons-plus.fs-first{left:28%}#fs_connect .fs-visual .dashicons-plus.fs-second{left:65%}#fs_connect .fs-visual .fs-plugin-icon,#fs_connect .fs-visual .fs-connect-logo,#fs_connect .fs-visual .fs-site-icon{border:1px solid #ccc;padding:1px;background:#fff}#fs_connect .fs-terms{text-align:center;font-size:0.85em;padding:5px;background:rgba(0,0,0,0.05)}#fs_connect .fs-terms,#fs_connect .fs-terms a{color:#999}#fs_connect .fs-terms a{text-decoration:none}.rtl #fs_connect .fs-actions{padding:10px 20px;background:#C0C7CA}.rtl #fs_connect .fs-actions .button .dashicons{font-size:37px;margin-left:-8px;margin-right:12px}.rtl #fs_connect .fs-actions .button.button-primary:after{content:' \000bb'}.rtl #fs_connect .fs-actions .button.button-primary.fs-loading:after{content:''}.rtl #fs_connect .fs-actions .button.button-secondary{float:left}.rtl #fs_connect .fs-permissions ul li div{margin-right:55px;margin-left:0}.rtl #fs_connect .fs-permissions ul li i.dashicons{float:right}.rtl #fs_connect .fs-visual .fs-site-icon{right:20px;left:auto}.rtl #fs_connect .fs-visual .fs-connect-logo{right:auto;left:20px}#fs_theme_connect_wrapper{position:fixed;top:0;height:100%;width:100%;z-index:99990;background:rgba(0,0,0,0.75);text-align:center;overflow-y:auto}#fs_theme_connect_wrapper:before{content:"";display:inline-block;vertical-align:middle;height:100%}#fs_theme_connect_wrapper>button.close{color:white;cursor:pointer;height:40px;width:40px;position:absolute;right:0;border:0;background-color:transparent;top:32px}#fs_theme_connect_wrapper #fs_connect{top:0;text-align:left;display:inline-block;vertical-align:middle;margin-top:52px;margin-bottom:20px}#fs_theme_connect_wrapper #fs_connect .fs-terms{background:rgba(140,140,140,0.64)}#fs_theme_connect_wrapper #fs_connect .fs-terms,#fs_theme_connect_wrapper #fs_connect .fs-terms a{color:#c5c5c5}.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
CHANGED
@@ -1 +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}
|
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
CHANGED
@@ -1 +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}
|
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
CHANGED
@@ -1,2 +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-success .fs-modal-header{border-bottom-color:#46b450}.fs-modal.fs-success .fs-modal-body{background-color:#f7fff7}.fs-modal.fs-warn .fs-modal-header{border-bottom-color:#ffb900}.fs-modal.fs-warn .fs-modal-body{background-color:#fff8e5}.fs-modal.fs-error .fs-modal-header{border-bottom-color:#dc3232}.fs-modal.fs-error .fs-modal-body{background-color:#ffeaea}.fs-modal .fs-modal-body,.fs-modal .fs-modal-footer{border:0;background:#fefefe;padding:20px}.fs-modal .fs-modal-header{border-bottom:#eeeeee solid 1px;background:#fbfbfb;padding:15px 20px;position:relative;margin-bottom:-10px}.fs-modal .fs-modal-header h4{margin:0;padding:0;text-transform:uppercase;font-size:1.2em;font-weight:bold;color:#cacaca;text-shadow:1px 1px 1px #fff;letter-spacing:0.6px;-webkit-font-smoothing:antialiased}.fs-modal .fs-modal-header .fs-close{position:absolute;right:10px;top:12px;cursor:pointer;color:#bbb;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;padding:3px;-moz-transition:all 0.2s ease-in-out;-o-transition:all 0.2s ease-in-out;-ms-transition:all 0.2s ease-in-out;-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}.fs-modal .fs-modal-header .fs-close:hover{color:#fff;background:#aaa}.fs-modal .fs-modal-body{border-bottom:0}.fs-modal .fs-modal-body p{font-size:14px}.fs-modal .fs-modal-body h2{font-size:20px;line-height:1.5em}.fs-modal .fs-modal-body>div{margin-top:10px}.fs-modal .fs-modal-body>div h2{font-weight:bold;font-size:20px;margin-top:0}.fs-modal .fs-modal-footer{border-top:#eeeeee solid 1px;text-align:right}.fs-modal .fs-modal-footer>.button{margin:0 7px}.fs-modal .fs-modal-footer>.button:first-child{margin:0}.fs-modal .fs-modal-panel>.notice.inline{margin:0;display:none}.fs-modal .fs-modal-panel:not(.active){display:none}.rtl .fs-modal .fs-modal-header .fs-close{right:auto;left:20px}body.has-fs-modal{overflow:hidden}.fs-modal.fs-modal-deactivation-feedback .reason-input,.fs-modal.fs-modal-deactivation-feedback .internal-message{margin:3px 0 3px 22px}.fs-modal.fs-modal-deactivation-feedback .reason-input input,.fs-modal.fs-modal-deactivation-feedback .reason-input textarea,.fs-modal.fs-modal-deactivation-feedback .internal-message input,.fs-modal.fs-modal-deactivation-feedback .internal-message textarea{width:100%}.fs-modal.fs-modal-deactivation-feedback li.reason.has-internal-message .internal-message{border:1px solid #ccc;padding:7px;display:none}@media (max-width: 650px){.fs-modal.fs-modal-deactivation-feedback li.reason li.reason{margin-bottom:10px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .reason-input,.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .internal-message{margin-left:29px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label{display:table}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label>span{display:table-cell;font-size:1.3em}}.fs-modal.fs-modal-deactivation-feedback .anonymous-feedback-label{float:left}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel{margin-top:0 !important}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel h3{margin-top:0;line-height:1.5em}#the-list .deactivate>.fs-slug{display:none}.fs-modal.fs-modal-license-activation .fs-modal-body input.license_key{width:100%}.fs-modal.fs-modal-license-key-resend .email-address-container{overflow:hidden;padding-right:2px}.fs-modal.fs-modal-license-key-resend.fs-freemium input.email-address{width:300px}.fs-modal.fs-modal-license-key-resend.fs-freemium label{display:block;margin-bottom:10px}.fs-modal.fs-modal-license-key-resend.fs-premium input.email-address{width:100%}.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{float:right;margin-left:7px}@media (max-width: 650px){.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{margin-top:2px}}
|
2 |
-
.rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .input-container>.email-address-container{padding-left:2px;padding-right:0}.rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .button-container{float:left;margin-right:7px;margin-left:0}a.show-license-resend-modal{margin-top:4px;display:inline-block}.fs-ajax-loader{position:relative;width:170px;height:20px;margin:auto}.fs-ajax-loader .fs-ajax-loader-bar{position:absolute;top:0;background-color:#0074a3;width:20px;height:20px;-webkit-animation-name:bounce_ajaxLoader;-moz-animation-name:bounce_ajaxLoader;-ms-animation-name:bounce_ajaxLoader;-o-animation-name:bounce_ajaxLoader;animation-name:bounce_ajaxLoader;-webkit-animation-duration:1.5s;-moz-animation-duration:1.5s;-ms-animation-duration:1.5s;-o-animation-duration:1.5s;animation-duration:1.5s;animation-iteration-count:infinite;-o-animation-iteration-count:infinite;-ms-animation-iteration-count:infinite;-webkit-animation-iteration-count:infinite;-moz-animation-iteration-count:infinite;-webkit-animation-direction:normal;-moz-animation-direction:normal;-ms-animation-direction:normal;-o-animation-direction:normal;animation-direction:normal;-moz-transform:0.3;-o-transform:0.3;-ms-transform:0.3;-webkit-transform:0.3;transform:0.3}.fs-ajax-loader .fs-ajax-loader-bar-1{left:0px;animation-delay:0.6s;-o-animation-delay:0.6s;-ms-animation-delay:0.6s;-webkit-animation-delay:0.6s;-moz-animation-delay:0.6s}.fs-ajax-loader .fs-ajax-loader-bar-2{left:19px;animation-delay:0.75s;-o-animation-delay:0.75s;-ms-animation-delay:0.75s;-webkit-animation-delay:0.75s;-moz-animation-delay:0.75s}.fs-ajax-loader .fs-ajax-loader-bar-3{left:38px;animation-delay:0.9s;-o-animation-delay:0.9s;-ms-animation-delay:0.9s;-webkit-animation-delay:0.9s;-moz-animation-delay:0.9s}.fs-ajax-loader .fs-ajax-loader-bar-4{left:57px;animation-delay:1.05s;-o-animation-delay:1.05s;-ms-animation-delay:1.05s;-webkit-animation-delay:1.05s;-moz-animation-delay:1.05s}.fs-ajax-loader .fs-ajax-loader-bar-5{left:76px;animation-delay:1.2s;-o-animation-delay:1.2s;-ms-animation-delay:1.2s;-webkit-animation-delay:1.2s;-moz-animation-delay:1.2s}.fs-ajax-loader .fs-ajax-loader-bar-6{left:95px;animation-delay:1.35s;-o-animation-delay:1.35s;-ms-animation-delay:1.35s;-webkit-animation-delay:1.35s;-moz-animation-delay:1.35s}.fs-ajax-loader .fs-ajax-loader-bar-7{left:114px;animation-delay:1.5s;-o-animation-delay:1.5s;-ms-animation-delay:1.5s;-webkit-animation-delay:1.5s;-moz-animation-delay:1.5s}.fs-ajax-loader .fs-ajax-loader-bar-8{left:133px;animation-delay:1.65s;-o-animation-delay:1.65s;-ms-animation-delay:1.65s;-webkit-animation-delay:1.65s;-moz-animation-delay:1.65s}@-moz-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-ms-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-o-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-webkit-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}.fs-modal-auto-install #request-filesystem-credentials-form h2,.fs-modal-auto-install #request-filesystem-credentials-form .request-filesystem-credentials-action-buttons{display:none}.fs-modal-auto-install #request-filesystem-credentials-form input[type=password],.fs-modal-auto-install #request-filesystem-credentials-form input[type=email],.fs-modal-auto-install #request-filesystem-credentials-form input[type=text]{-webkit-appearance:none;padding:10px 10px 5px 10px;width:300px;max-width:100%}.fs-modal-auto-install #request-filesystem-credentials-form>div,.fs-modal-auto-install #request-filesystem-credentials-form label,.fs-modal-auto-install #request-filesystem-credentials-form fieldset{width:300px;max-width:100%;margin:0 auto;display:block}
|
1 |
+
.fs-modal{position:fixed;overflow:auto;height:100%;width:100%;top:0;z-index:100000;display:none;background:rgba(0,0,0,0.6)}.fs-modal .fs-modal-dialog{background:transparent;position:absolute;left:50%;margin-left:-298px;padding-bottom:30px;top:-100%;z-index:100001;width:596px}@media (max-width: 650px){.fs-modal .fs-modal-dialog{margin-left:-50%;box-sizing:border-box;padding-left:10px;padding-right:10px;width:100%}.fs-modal .fs-modal-dialog .fs-modal-panel>h3>strong{font-size:1.3em}}.fs-modal.active{display:block}.fs-modal.active:before{display:block}.fs-modal.active .fs-modal-dialog{top:10%}.fs-modal.fs-success .fs-modal-header{border-bottom-color:#46b450}.fs-modal.fs-success .fs-modal-body{background-color:#f7fff7}.fs-modal.fs-warn .fs-modal-header{border-bottom-color:#ffb900}.fs-modal.fs-warn .fs-modal-body{background-color:#fff8e5}.fs-modal.fs-error .fs-modal-header{border-bottom-color:#dc3232}.fs-modal.fs-error .fs-modal-body{background-color:#ffeaea}.fs-modal .fs-modal-body,.fs-modal .fs-modal-footer{border:0;background:#fefefe;padding:20px}.fs-modal .fs-modal-header{border-bottom:#eeeeee solid 1px;background:#fbfbfb;padding:15px 20px;position:relative;margin-bottom:-10px}.fs-modal .fs-modal-header h4{margin:0;padding:0;text-transform:uppercase;font-size:1.2em;font-weight:bold;color:#cacaca;text-shadow:1px 1px 1px #fff;letter-spacing:0.6px;-webkit-font-smoothing:antialiased}.fs-modal .fs-modal-header .fs-close{position:absolute;right:10px;top:12px;cursor:pointer;color:#bbb;-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;padding:3px;-moz-transition:all 0.2s ease-in-out;-o-transition:all 0.2s ease-in-out;-ms-transition:all 0.2s ease-in-out;-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}.fs-modal .fs-modal-header .fs-close:hover{color:#fff;background:#aaa}.fs-modal .fs-modal-body{border-bottom:0}.fs-modal .fs-modal-body p{font-size:14px}.fs-modal .fs-modal-body h2{font-size:20px;line-height:1.5em}.fs-modal .fs-modal-body>div{margin-top:10px}.fs-modal .fs-modal-body>div h2{font-weight:bold;font-size:20px;margin-top:0}.fs-modal .fs-modal-footer{border-top:#eeeeee solid 1px;text-align:right}.fs-modal .fs-modal-footer>.button{margin:0 7px}.fs-modal .fs-modal-footer>.button:first-child{margin:0}.fs-modal .fs-modal-panel>.notice.inline{margin:0;display:none}.fs-modal .fs-modal-panel:not(.active){display:none}.rtl .fs-modal .fs-modal-header .fs-close{right:auto;left:20px}body.has-fs-modal{overflow:hidden}.fs-modal.fs-modal-deactivation-feedback .reason-input,.fs-modal.fs-modal-deactivation-feedback .internal-message{margin:3px 0 3px 22px}.fs-modal.fs-modal-deactivation-feedback .reason-input input,.fs-modal.fs-modal-deactivation-feedback .reason-input textarea,.fs-modal.fs-modal-deactivation-feedback .internal-message input,.fs-modal.fs-modal-deactivation-feedback .internal-message textarea{width:100%}.fs-modal.fs-modal-deactivation-feedback li.reason.has-internal-message .internal-message{border:1px solid #ccc;padding:7px;display:none}@media (max-width: 650px){.fs-modal.fs-modal-deactivation-feedback li.reason li.reason{margin-bottom:10px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .reason-input,.fs-modal.fs-modal-deactivation-feedback li.reason li.reason .internal-message{margin-left:29px}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label{display:table}.fs-modal.fs-modal-deactivation-feedback li.reason li.reason label>span{display:table-cell;font-size:1.3em}}.fs-modal.fs-modal-deactivation-feedback .anonymous-feedback-label{float:left}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel{margin-top:0 !important}.fs-modal.fs-modal-deactivation-feedback .fs-modal-panel h3{margin-top:0;line-height:1.5em}#the-list .deactivate>.fs-slug{display:none}.fs-modal.fs-modal-license-activation .fs-modal-body input.license_key{width:100%}.fs-modal.fs-modal-license-key-resend .email-address-container{overflow:hidden;padding-right:2px}.fs-modal.fs-modal-license-key-resend.fs-freemium input.email-address{width:300px}.fs-modal.fs-modal-license-key-resend.fs-freemium label{display:block;margin-bottom:10px}.fs-modal.fs-modal-license-key-resend.fs-premium input.email-address{width:100%}.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{float:right;margin-left:7px}@media (max-width: 650px){.fs-modal.fs-modal-license-key-resend.fs-premium .button-container{margin-top:2px}}
|
2 |
+
.rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .input-container>.email-address-container{padding-left:2px;padding-right:0}.rtl .fs-modal.fs-modal-license-key-resend .fs-modal-body .button-container{float:left;margin-right:7px;margin-left:0}a.show-license-resend-modal{margin-top:4px;display:inline-block}.fs-ajax-loader{position:relative;width:170px;height:20px;margin:auto}.fs-ajax-loader .fs-ajax-loader-bar{position:absolute;top:0;background-color:#0074a3;width:20px;height:20px;-webkit-animation-name:bounce_ajaxLoader;-moz-animation-name:bounce_ajaxLoader;-ms-animation-name:bounce_ajaxLoader;-o-animation-name:bounce_ajaxLoader;animation-name:bounce_ajaxLoader;-webkit-animation-duration:1.5s;-moz-animation-duration:1.5s;-ms-animation-duration:1.5s;-o-animation-duration:1.5s;animation-duration:1.5s;animation-iteration-count:infinite;-o-animation-iteration-count:infinite;-ms-animation-iteration-count:infinite;-webkit-animation-iteration-count:infinite;-moz-animation-iteration-count:infinite;-webkit-animation-direction:normal;-moz-animation-direction:normal;-ms-animation-direction:normal;-o-animation-direction:normal;animation-direction:normal;-moz-transform:0.3;-o-transform:0.3;-ms-transform:0.3;-webkit-transform:0.3;transform:0.3}.fs-ajax-loader .fs-ajax-loader-bar-1{left:0px;animation-delay:0.6s;-o-animation-delay:0.6s;-ms-animation-delay:0.6s;-webkit-animation-delay:0.6s;-moz-animation-delay:0.6s}.fs-ajax-loader .fs-ajax-loader-bar-2{left:19px;animation-delay:0.75s;-o-animation-delay:0.75s;-ms-animation-delay:0.75s;-webkit-animation-delay:0.75s;-moz-animation-delay:0.75s}.fs-ajax-loader .fs-ajax-loader-bar-3{left:38px;animation-delay:0.9s;-o-animation-delay:0.9s;-ms-animation-delay:0.9s;-webkit-animation-delay:0.9s;-moz-animation-delay:0.9s}.fs-ajax-loader .fs-ajax-loader-bar-4{left:57px;animation-delay:1.05s;-o-animation-delay:1.05s;-ms-animation-delay:1.05s;-webkit-animation-delay:1.05s;-moz-animation-delay:1.05s}.fs-ajax-loader .fs-ajax-loader-bar-5{left:76px;animation-delay:1.2s;-o-animation-delay:1.2s;-ms-animation-delay:1.2s;-webkit-animation-delay:1.2s;-moz-animation-delay:1.2s}.fs-ajax-loader .fs-ajax-loader-bar-6{left:95px;animation-delay:1.35s;-o-animation-delay:1.35s;-ms-animation-delay:1.35s;-webkit-animation-delay:1.35s;-moz-animation-delay:1.35s}.fs-ajax-loader .fs-ajax-loader-bar-7{left:114px;animation-delay:1.5s;-o-animation-delay:1.5s;-ms-animation-delay:1.5s;-webkit-animation-delay:1.5s;-moz-animation-delay:1.5s}.fs-ajax-loader .fs-ajax-loader-bar-8{left:133px;animation-delay:1.65s;-o-animation-delay:1.65s;-ms-animation-delay:1.65s;-webkit-animation-delay:1.65s;-moz-animation-delay:1.65s}@-moz-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-ms-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-o-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@-webkit-keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}@keyframes bounce_ajaxLoader{0%{-moz-transform:scale(1);-o-transform:scale(1);-ms-transform:scale(1);-webkit-transform:scale(1);transform:scale(1);background-color:#0074a3}100%{-moz-transform:scale(0.3);-o-transform:scale(0.3);-ms-transform:scale(0.3);-webkit-transform:scale(0.3);transform:scale(0.3);background-color:#fff}}.fs-modal-auto-install #request-filesystem-credentials-form h2,.fs-modal-auto-install #request-filesystem-credentials-form .request-filesystem-credentials-action-buttons{display:none}.fs-modal-auto-install #request-filesystem-credentials-form input[type=password],.fs-modal-auto-install #request-filesystem-credentials-form input[type=email],.fs-modal-auto-install #request-filesystem-credentials-form input[type=text]{-webkit-appearance:none;padding:10px 10px 5px 10px;width:300px;max-width:100%}.fs-modal-auto-install #request-filesystem-credentials-form>div,.fs-modal-auto-install #request-filesystem-credentials-form label,.fs-modal-auto-install #request-filesystem-credentials-form fieldset{width:300px;max-width:100%;margin:0 auto;display:block}
|
freemius/assets/css/admin/index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
3 |
+
// Hide file structure from users on unprotected servers.
|
freemius/assets/css/admin/license-activation.css
CHANGED
@@ -1 +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}
|
1 |
+
.fs-modal{position:fixed;overflow:auto;height:100%;width:100%;top:0;z-index:100000;display:none;background:rgba(0,0,0,0.6)}.fs-modal .fs-modal-dialog{background:transparent;position:absolute;left:50%;margin-left:-298px;padding-bottom:30px;top:-100%;z-index:100001;width:596px}@media (max-width: 650px){.fs-modal .fs-modal-dialog{margin-left:-50%;box-sizing:border-box;padding-left:10px;padding-right:10px;width:100%}.fs-modal .fs-modal-dialog .fs-modal-panel>h3>strong{font-size:1.3em}}.fs-modal.active{display:block}.fs-modal.active:before{display:block}.fs-modal.active .fs-modal-dialog{top:10%}.fs-modal .fs-modal-body,.fs-modal .fs-modal-footer{border:0;background:#fefefe;padding:20px}.fs-modal .fs-modal-body{border-bottom:0}.fs-modal .fs-modal-body .license-activation-message{margin:0;display:none}.fs-modal .fs-modal-body input.license_key{width:100%}.fs-modal .fs-modal-body p{font-size:14px}.fs-modal .fs-modal-body h2{font-size:20px}.fs-modal .fs-modal-body>div{margin-top:10px}.fs-modal .fs-modal-body>div h2{font-weight:bold;font-size:20px;margin-top:0}.fs-modal .fs-modal-footer{border-top:#eeeeee solid 1px;text-align:right}.fs-modal .fs-modal-footer>.button{margin:0 7px}.fs-modal .fs-modal-footer>.button:first-child{margin:0}.fs-modal .fs-modal-panel:not(.active){display:none}body.has-fs-modal{overflow:hidden}
|
freemius/assets/css/common.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
.fs-notice.success{color:green;font-weight:700}
|
|
freemius/assets/css/customizer.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
#fs_customizer_upsell .fs-customizer-plan{padding:10px 20px 20px 20px;border-radius:3px;background:#fff}#fs_customizer_upsell .fs-customizer-plan h2{position:relative;margin:0;line-height:2em;text-transform:uppercase}#fs_customizer_upsell .fs-customizer-plan h2 .button-link{top:-2px}#fs_customizer_upsell .fs-feature{position:relative}#fs_customizer_upsell .dashicons-yes{color:#0085ba;font-size:2em;vertical-align:bottom;margin-left:-7px;margin-right:10px}.rtl #fs_customizer_upsell .dashicons-yes{margin-left:10px;margin-right:-7px}#fs_customizer_upsell .dashicons-editor-help{color:#bbb;cursor:help}#fs_customizer_upsell .dashicons-editor-help .fs-feature-desc{opacity:0;visibility:hidden;-moz-transition:opacity 0.3s ease-in-out;-o-transition:opacity 0.3s ease-in-out;-ms-transition:opacity 0.3s ease-in-out;-webkit-transition:opacity 0.3s ease-in-out;transition:opacity 0.3s ease-in-out;position:absolute;background:#000;color:#fff;font-family:'arial', serif;font-size:12px;padding:10px;z-index:999999;bottom:100%;margin-bottom:5px;left:0;right:0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;-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);line-height:1.3em;font-weight:bold;text-align:left}.rtl #fs_customizer_upsell .dashicons-editor-help .fs-feature-desc{text-align:right}#fs_customizer_upsell .dashicons-editor-help .fs-feature-desc::after{content:' ';display:block;width:0;height:0;border-style:solid;border-width:5px 5px 0 5px;border-color:#000 transparent transparent transparent;position:absolute;top:100%;left:21px}.rtl #fs_customizer_upsell .dashicons-editor-help .fs-feature-desc::after{right:21px;left:auto}#fs_customizer_upsell .dashicons-editor-help:hover .fs-feature-desc{visibility:visible;opacity:1}#fs_customizer_upsell .button-primary{display:block;text-align:center;margin-top:10px}#fs_customizer_support{display:block !important}#fs_customizer_support .button{float:right}#fs_customizer_support .button-group{width:100%;display:block;margin-top:10px}#fs_customizer_support .button-group .button{float:none;width:50%;text-align:center}
|
1 |
+
#fs_customizer_upsell .fs-customizer-plan{padding:10px 20px 20px 20px;border-radius:3px;background:#fff}#fs_customizer_upsell .fs-customizer-plan h2{position:relative;margin:0;line-height:2em;text-transform:uppercase}#fs_customizer_upsell .fs-customizer-plan h2 .button-link{top:-2px}#fs_customizer_upsell .fs-feature{position:relative}#fs_customizer_upsell .dashicons-yes{color:#0085ba;font-size:2em;vertical-align:bottom;margin-left:-7px;margin-right:10px}.rtl #fs_customizer_upsell .dashicons-yes{margin-left:10px;margin-right:-7px}#fs_customizer_upsell .dashicons-editor-help{color:#bbb;cursor:help}#fs_customizer_upsell .dashicons-editor-help .fs-feature-desc{opacity:0;visibility:hidden;-moz-transition:opacity 0.3s ease-in-out;-o-transition:opacity 0.3s ease-in-out;-ms-transition:opacity 0.3s ease-in-out;-webkit-transition:opacity 0.3s ease-in-out;transition:opacity 0.3s ease-in-out;position:absolute;background:#000;color:#fff;font-family:'arial', serif;font-size:12px;padding:10px;z-index:999999;bottom:100%;margin-bottom:5px;left:0;right:0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;-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);line-height:1.3em;font-weight:bold;text-align:left}.rtl #fs_customizer_upsell .dashicons-editor-help .fs-feature-desc{text-align:right}#fs_customizer_upsell .dashicons-editor-help .fs-feature-desc::after{content:' ';display:block;width:0;height:0;border-style:solid;border-width:5px 5px 0 5px;border-color:#000 transparent transparent transparent;position:absolute;top:100%;left:21px}.rtl #fs_customizer_upsell .dashicons-editor-help .fs-feature-desc::after{right:21px;left:auto}#fs_customizer_upsell .dashicons-editor-help:hover .fs-feature-desc{visibility:visible;opacity:1}#fs_customizer_upsell .button-primary{display:block;text-align:center;margin-top:10px}#fs_customizer_support{display:block !important}#fs_customizer_support .button{float:right}#fs_customizer_support .button-group{width:100%;display:block;margin-top:10px}#fs_customizer_support .button-group .button{float:none;width:50%;text-align:center}
|
freemius/assets/css/index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
3 |
+
// Hide file structure from users on unprotected servers.
|
freemius/assets/img/index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
3 |
+
// Hide file structure from users on unprotected servers.
|
freemius/assets/index.php
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
<?php
|
2 |
-
// Silence is golden.
|
3 |
// Hide file structure from users on unprotected servers.
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
3 |
// Hide file structure from users on unprotected servers.
|
freemius/assets/js/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
CHANGED
@@ -1,140 +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 |
}
|
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
CHANGED
@@ -1,12 +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};
|
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
CHANGED
@@ -1,135 +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);
|
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
CHANGED
@@ -1,65 +1,65 @@
|
|
1 |
-
$menu-hover-color: #333;
|
2 |
-
$darkest-color: #000;
|
3 |
-
$fms-live-color: #71ae00;
|
4 |
-
$fms-test-color: #f7941d;
|
5 |
-
$fms-link-color: #29abe1;
|
6 |
-
$fms-link-hover-color: darken(#29abe1, 10%);
|
7 |
-
$body-bkg: #111;
|
8 |
-
$special-color: #d3135a;
|
9 |
-
$body-color: #f1f1f1;
|
10 |
-
$fms-white: #f1f1f1;
|
11 |
-
$container-bkg: #222;
|
12 |
-
$container-bkg-odd: #262626;
|
13 |
-
$container-border-color: #333;
|
14 |
-
$table-head-bkg: #333;
|
15 |
-
$table-head-color: #999;
|
16 |
-
$info-color: #999;
|
17 |
-
$error-color: #ff0000;
|
18 |
-
|
19 |
-
$fs-logo-blue-color: #29abe1;
|
20 |
-
$fs-logo-green-color: #71ae00;
|
21 |
-
$fs-logo-magenta-color: #d3135a;
|
22 |
-
|
23 |
-
// WordPress colors.
|
24 |
-
$page-header-bkg: #333;
|
25 |
-
$page-header-color: $fms-white;
|
26 |
-
$text-dark-color: #333;
|
27 |
-
$text-light-color: #666;
|
28 |
-
$text-lightest-color: #999;
|
29 |
-
|
30 |
-
// Notices.
|
31 |
-
$wp-notice-success-color: #f7fff7;
|
32 |
-
$wp-notice-success-dark-color: #46b450;
|
33 |
-
$wp-notice-error-color: #ffeaea;
|
34 |
-
$wp-notice-error-dark-color: #dc3232;
|
35 |
-
$wp-notice-warn-color: #fff8e5;
|
36 |
-
$wp-notice-warn-dark-color: #ffb900;
|
37 |
-
$fs-notice-promotion-border-color: #00a0d2;
|
38 |
-
$fs-notice-promotion-bkg: #f2fcff;
|
39 |
-
|
40 |
-
// WP Buttons.
|
41 |
-
$button-primary-bkg: #6bc406;
|
42 |
-
$button-primary-color: $fms-white;
|
43 |
-
$button-secondary-bkg: #333;
|
44 |
-
$button-secondary-color: $fms-white;
|
45 |
-
$featured-color: #6bc406;
|
46 |
-
$wp-selected-color: #0074a3;
|
47 |
-
|
48 |
-
$wordpress_color: #01749A;
|
49 |
-
$blogger_color: #ff8100;
|
50 |
-
$wix_color: #fac102;
|
51 |
-
$shopify_color: #80d100;
|
52 |
-
$addthis_color: #fe6d4e;
|
53 |
-
$tumblr_color: #34506b;
|
54 |
-
$zepo_color: #00baf2;
|
55 |
-
$jquery_color: #000919;
|
56 |
-
$javascript_color: #00baf2;
|
57 |
-
$squarespace_color: #000;
|
58 |
-
|
59 |
-
$blog_color: #ff6600;
|
60 |
-
$facebook_color: #3b5998;
|
61 |
-
$twitter_color: #4099ff;
|
62 |
-
$linkedin_color: #4875b4;
|
63 |
-
$youtube_color: #ff3333;
|
64 |
-
$gplus_color: #c63d2d;
|
65 |
-
|
1 |
+
$menu-hover-color: #333;
|
2 |
+
$darkest-color: #000;
|
3 |
+
$fms-live-color: #71ae00;
|
4 |
+
$fms-test-color: #f7941d;
|
5 |
+
$fms-link-color: #29abe1;
|
6 |
+
$fms-link-hover-color: darken(#29abe1, 10%);
|
7 |
+
$body-bkg: #111;
|
8 |
+
$special-color: #d3135a;
|
9 |
+
$body-color: #f1f1f1;
|
10 |
+
$fms-white: #f1f1f1;
|
11 |
+
$container-bkg: #222;
|
12 |
+
$container-bkg-odd: #262626;
|
13 |
+
$container-border-color: #333;
|
14 |
+
$table-head-bkg: #333;
|
15 |
+
$table-head-color: #999;
|
16 |
+
$info-color: #999;
|
17 |
+
$error-color: #ff0000;
|
18 |
+
|
19 |
+
$fs-logo-blue-color: #29abe1;
|
20 |
+
$fs-logo-green-color: #71ae00;
|
21 |
+
$fs-logo-magenta-color: #d3135a;
|
22 |
+
|
23 |
+
// WordPress colors.
|
24 |
+
$page-header-bkg: #333;
|
25 |
+
$page-header-color: $fms-white;
|
26 |
+
$text-dark-color: #333;
|
27 |
+
$text-light-color: #666;
|
28 |
+
$text-lightest-color: #999;
|
29 |
+
|
30 |
+
// Notices.
|
31 |
+
$wp-notice-success-color: #f7fff7;
|
32 |
+
$wp-notice-success-dark-color: #46b450;
|
33 |
+
$wp-notice-error-color: #ffeaea;
|
34 |
+
$wp-notice-error-dark-color: #dc3232;
|
35 |
+
$wp-notice-warn-color: #fff8e5;
|
36 |
+
$wp-notice-warn-dark-color: #ffb900;
|
37 |
+
$fs-notice-promotion-border-color: #00a0d2;
|
38 |
+
$fs-notice-promotion-bkg: #f2fcff;
|
39 |
+
|
40 |
+
// WP Buttons.
|
41 |
+
$button-primary-bkg: #6bc406;
|
42 |
+
$button-primary-color: $fms-white;
|
43 |
+
$button-secondary-bkg: #333;
|
44 |
+
$button-secondary-color: $fms-white;
|
45 |
+
$featured-color: #6bc406;
|
46 |
+
$wp-selected-color: #0074a3;
|
47 |
+
|
48 |
+
$wordpress_color: #01749A;
|
49 |
+
$blogger_color: #ff8100;
|
50 |
+
$wix_color: #fac102;
|
51 |
+
$shopify_color: #80d100;
|
52 |
+
$addthis_color: #fe6d4e;
|
53 |
+
$tumblr_color: #34506b;
|
54 |
+
$zepo_color: #00baf2;
|
55 |
+
$jquery_color: #000919;
|
56 |
+
$javascript_color: #00baf2;
|
57 |
+
$squarespace_color: #000;
|
58 |
+
|
59 |
+
$blog_color: #ff6600;
|
60 |
+
$facebook_color: #3b5998;
|
61 |
+
$twitter_color: #4099ff;
|
62 |
+
$linkedin_color: #4875b4;
|
63 |
+
$youtube_color: #ff3333;
|
64 |
+
$gplus_color: #c63d2d;
|
65 |
+
|
freemius/assets/scss/_mixins.scss
CHANGED
@@ -1,283 +1,270 @@
|
|
1 |
-
// ---- CSS3 SASS MIXINS ----
|
2 |
-
// https://github.com/madr/css3-sass-mixins
|
3 |
-
//
|
4 |
-
// Copyright (C) 2011 by Anders Ytterström
|
5 |
-
//
|
6 |
-
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 |
-
// of this software and associated documentation files (the "Software"), to deal
|
8 |
-
// in the Software without restriction, including without limitation the rights
|
9 |
-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10 |
-
// copies of the Software, and to permit persons to whom the Software is
|
11 |
-
// furnished to do so, subject to the following conditions:
|
12 |
-
//
|
13 |
-
// The above copyright notice and this permission notice shall be included in
|
14 |
-
// all copies or substantial portions of the Software.
|
15 |
-
//
|
16 |
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17 |
-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18 |
-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19 |
-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20 |
-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21 |
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22 |
-
// THE SOFTWARE.
|
23 |
-
//
|
24 |
-
|
25 |
-
// ---- LEGACY IE SUPPORT USING FILTERS ----
|
26 |
-
// Should IE filters be used or not?
|
27 |
-
// PROS: gradients, drop shadows etc will be handled by css.
|
28 |
-
// CONS: will harm the site performance badly,
|
29 |
-
// especially on sites with heavy rendering and scripting.
|
30 |
-
$useIEFilters: 0;
|
31 |
-
// might be 0 or 1. disabled by default.
|
32 |
-
// ---- /LEGACY IE SUPPORT USING FILTERS ----
|
33 |
-
|
34 |
-
|
35 |
-
@mixin background-size ($value) {
|
36 |
-
-webkit-background-size: $value;
|
37 |
-
background-size: $value;
|
38 |
-
}
|
39 |
-
|
40 |
-
@mixin border-image ($path, $offsets, $repeats) {
|
41 |
-
-moz-border-image: $path $offsets $repeats;
|
42 |
-
-o-border-image: $path $offsets $repeats;
|
43 |
-
-webkit-border-image: $path $offsets $repeats;
|
44 |
-
border-image: $path $offsets $repeats;
|
45 |
-
}
|
46 |
-
|
47 |
-
@mixin border-radius ($values...) {
|
48 |
-
-moz-border-radius: $values;
|
49 |
-
-webkit-border-radius: $values;
|
50 |
-
border-radius: $values;
|
51 |
-
/*-moz-background-clip: padding;
|
52 |
-
-webkit-background-clip: padding-box;
|
53 |
-
background-clip: padding-box;*/
|
54 |
-
}
|
55 |
-
|
56 |
-
@mixin box-shadow ($values...) {
|
57 |
-
-moz-box-shadow: $values;
|
58 |
-
-webkit-box-shadow: $values;
|
59 |
-
box-shadow: $values;
|
60 |
-
}
|
61 |
-
|
62 |
-
//@mixin box-shadow ($x, $y, $offset, $hex, $ie: $useIEFilters, $inset: null, $spread:null) {
|
63 |
-
// -moz-box-shadow: $x $y $offset $spread $hex $inset;
|
64 |
-
// -webkit-box-shadow: $x $y $offset $spread $hex $inset;
|
65 |
-
// box-shadow: $x $y $offset $spread $hex $inset;
|
66 |
-
//
|
67 |
-
// @if $ie == 1 {
|
68 |
-
// $iecolor: '#' + red($hex) + green($hex) + blue($hex);
|
69 |
-
// filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=#{$x}, OffY=#{$y}, Color='#{$iecolor}');
|
70 |
-
// -ms-filter: quote(progid:DXImageTransform.Microsoft.dropshadow(OffX=#{$x}, OffY=#{$y}, Color='#{$iecolor}'));
|
71 |
-
// }
|
72 |
-
//}
|
73 |
-
|
74 |
-
@mixin box-sizing($value) {
|
75 |
-
-moz-box-sizing: $value;
|
76 |
-
-webkit-box-sizing: $value;
|
77 |
-
box-sizing: $value;
|
78 |
-
}
|
79 |
-
|
80 |
-
// requires sass 3.2
|
81 |
-
@mixin keyframes($name){
|
82 |
-
@-moz-keyframes #{$name} { @content; }
|
83 |
-
@-ms-keyframes #{$name} { @content; }
|
84 |
-
@-o-keyframes #{$name} { @content; }
|
85 |
-
@-webkit-keyframes #{$name} { @content; }
|
86 |
-
@keyframes #{$name} { @content; }
|
87 |
-
}
|
88 |
-
|
89 |
-
@mixin linear-gradient($from, $to, $ie: $useIEFilters) {
|
90 |
-
@if $ie != 1 { background-color: $to; }
|
91 |
-
|
92 |
-
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, $from),color-stop(1, $to));
|
93 |
-
background-image: -webkit-linear-gradient(top, $from, $to);
|
94 |
-
background-image: -moz-linear-gradient(top, $from, $to);
|
95 |
-
background-image: -ms-linear-gradient(top, $from, $to);
|
96 |
-
background-image: -o-linear-gradient(top, $from, $to);
|
97 |
-
background-image: linear-gradient(top, bottom, $from, $to);
|
98 |
-
|
99 |
-
@if $ie == 1 {
|
100 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$from}', endColorstr='#{$to}');
|
101 |
-
}
|
102 |
-
}
|
103 |
-
|
104 |
-
@mixin horizontal-gradient($startColor: #555, $endColor: #333, $ie: $useIEFilters) {
|
105 |
-
@if $ie != 1 { background-color: $endColor; }
|
106 |
-
|
107 |
-
background-color: $endColor;
|
108 |
-
background-image: -webkit-gradient(linear, 0 0, 100% 0, from($startColor), to($endColor)); // Safari 4+, Chrome 2+
|
109 |
-
background-image: -webkit-linear-gradient(left, $startColor, $endColor); // Safari 5.1+, Chrome 10+
|
110 |
-
background-image: -moz-linear-gradient(left, $startColor, $endColor); // FF 3.6+
|
111 |
-
background-image: -o-linear-gradient(left, $startColor, $endColor); // Opera 11.10
|
112 |
-
background-image: linear-gradient(to right, $startColor, $endColor); // Standard, IE10
|
113 |
-
background-repeat: repeat-x;
|
114 |
-
@if $ie == 1 {
|
115 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$startColor}', endColorstr='#{$endColor}', GradientType=1);
|
116 |
-
}
|
117 |
-
}
|
118 |
-
|
119 |
-
@mixin radial-gradient($from, $to, $ie: $useIEFilters) {
|
120 |
-
@if $ie != 1 { background-color: $to; }
|
121 |
-
|
122 |
-
background: -moz-radial-gradient(center, circle cover, $from 0%, $to 100%);
|
123 |
-
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, $from), color-stop(100%, $to));
|
124 |
-
background: -webkit-radial-gradient(center, circle cover, $from 0%, $to 100%);
|
125 |
-
background: -o-radial-gradient(center, circle cover, $from 0%, $to 100%);
|
126 |
-
background: -ms-radial-gradient(center, circle cover, $from 0%, $to 100%);
|
127 |
-
background: radial-gradient(center, circle cover, $from 0%, $to 100%);
|
128 |
-
background-color: $from;
|
129 |
-
|
130 |
-
@if $ie == 1 {
|
131 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$from}', endColorstr='#{$to}', GradientType=1); /* IE6-9 fallback on horizontal gradient */
|
132 |
-
}
|
133 |
-
}
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
}
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
}
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
-
|
200 |
-
animation: #{$str};
|
201 |
-
}
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
-
|
208 |
-
animation-
|
209 |
-
}
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
animation-
|
217 |
-
}
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
-
|
224 |
-
animation-
|
225 |
-
}
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
-webkit-animation-
|
232 |
-
-moz-animation-
|
233 |
-
}
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
clear: both;
|
271 |
-
}
|
272 |
-
}
|
273 |
-
|
274 |
-
// Placeholder text
|
275 |
-
@mixin placeholder($color: $input-color-placeholder) {
|
276 |
-
// Firefox
|
277 |
-
&::-moz-placeholder {
|
278 |
-
color: $color;
|
279 |
-
opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
|
280 |
-
}
|
281 |
-
&:-ms-input-placeholder { color: $color; } // Internet Explorer 10+
|
282 |
-
&::-webkit-input-placeholder { color: $color; } // Safari and Chrome
|
283 |
}
|
1 |
+
// ---- CSS3 SASS MIXINS ----
|
2 |
+
// https://github.com/madr/css3-sass-mixins
|
3 |
+
//
|
4 |
+
// Copyright (C) 2011 by Anders Ytterström
|
5 |
+
//
|
6 |
+
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 |
+
// of this software and associated documentation files (the "Software"), to deal
|
8 |
+
// in the Software without restriction, including without limitation the rights
|
9 |
+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10 |
+
// copies of the Software, and to permit persons to whom the Software is
|
11 |
+
// furnished to do so, subject to the following conditions:
|
12 |
+
//
|
13 |
+
// The above copyright notice and this permission notice shall be included in
|
14 |
+
// all copies or substantial portions of the Software.
|
15 |
+
//
|
16 |
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17 |
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18 |
+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19 |
+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20 |
+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21 |
+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22 |
+
// THE SOFTWARE.
|
23 |
+
//
|
24 |
+
|
25 |
+
// ---- LEGACY IE SUPPORT USING FILTERS ----
|
26 |
+
// Should IE filters be used or not?
|
27 |
+
// PROS: gradients, drop shadows etc will be handled by css.
|
28 |
+
// CONS: will harm the site performance badly,
|
29 |
+
// especially on sites with heavy rendering and scripting.
|
30 |
+
$useIEFilters: 0;
|
31 |
+
// might be 0 or 1. disabled by default.
|
32 |
+
// ---- /LEGACY IE SUPPORT USING FILTERS ----
|
33 |
+
|
34 |
+
|
35 |
+
@mixin background-size ($value) {
|
36 |
+
-webkit-background-size: $value;
|
37 |
+
background-size: $value;
|
38 |
+
}
|
39 |
+
|
40 |
+
@mixin border-image ($path, $offsets, $repeats) {
|
41 |
+
-moz-border-image: $path $offsets $repeats;
|
42 |
+
-o-border-image: $path $offsets $repeats;
|
43 |
+
-webkit-border-image: $path $offsets $repeats;
|
44 |
+
border-image: $path $offsets $repeats;
|
45 |
+
}
|
46 |
+
|
47 |
+
@mixin border-radius ($values...) {
|
48 |
+
-moz-border-radius: $values;
|
49 |
+
-webkit-border-radius: $values;
|
50 |
+
border-radius: $values;
|
51 |
+
/*-moz-background-clip: padding;
|
52 |
+
-webkit-background-clip: padding-box;
|
53 |
+
background-clip: padding-box;*/
|
54 |
+
}
|
55 |
+
|
56 |
+
@mixin box-shadow ($values...) {
|
57 |
+
-moz-box-shadow: $values;
|
58 |
+
-webkit-box-shadow: $values;
|
59 |
+
box-shadow: $values;
|
60 |
+
}
|
61 |
+
|
62 |
+
//@mixin box-shadow ($x, $y, $offset, $hex, $ie: $useIEFilters, $inset: null, $spread:null) {
|
63 |
+
// -moz-box-shadow: $x $y $offset $spread $hex $inset;
|
64 |
+
// -webkit-box-shadow: $x $y $offset $spread $hex $inset;
|
65 |
+
// box-shadow: $x $y $offset $spread $hex $inset;
|
66 |
+
//
|
67 |
+
// @if $ie == 1 {
|
68 |
+
// $iecolor: '#' + red($hex) + green($hex) + blue($hex);
|
69 |
+
// filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=#{$x}, OffY=#{$y}, Color='#{$iecolor}');
|
70 |
+
// -ms-filter: quote(progid:DXImageTransform.Microsoft.dropshadow(OffX=#{$x}, OffY=#{$y}, Color='#{$iecolor}'));
|
71 |
+
// }
|
72 |
+
//}
|
73 |
+
|
74 |
+
@mixin box-sizing($value) {
|
75 |
+
-moz-box-sizing: $value;
|
76 |
+
-webkit-box-sizing: $value;
|
77 |
+
box-sizing: $value;
|
78 |
+
}
|
79 |
+
|
80 |
+
// requires sass 3.2
|
81 |
+
@mixin keyframes($name){
|
82 |
+
@-moz-keyframes #{$name} { @content; }
|
83 |
+
@-ms-keyframes #{$name} { @content; }
|
84 |
+
@-o-keyframes #{$name} { @content; }
|
85 |
+
@-webkit-keyframes #{$name} { @content; }
|
86 |
+
@keyframes #{$name} { @content; }
|
87 |
+
}
|
88 |
+
|
89 |
+
@mixin linear-gradient($from, $to, $ie: $useIEFilters) {
|
90 |
+
@if $ie != 1 { background-color: $to; }
|
91 |
+
|
92 |
+
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, $from),color-stop(1, $to));
|
93 |
+
background-image: -webkit-linear-gradient(top, $from, $to);
|
94 |
+
background-image: -moz-linear-gradient(top, $from, $to);
|
95 |
+
background-image: -ms-linear-gradient(top, $from, $to);
|
96 |
+
background-image: -o-linear-gradient(top, $from, $to);
|
97 |
+
background-image: linear-gradient(top, bottom, $from, $to);
|
98 |
+
|
99 |
+
@if $ie == 1 {
|
100 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$from}', endColorstr='#{$to}');
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
@mixin horizontal-gradient($startColor: #555, $endColor: #333, $ie: $useIEFilters) {
|
105 |
+
@if $ie != 1 { background-color: $endColor; }
|
106 |
+
|
107 |
+
background-color: $endColor;
|
108 |
+
background-image: -webkit-gradient(linear, 0 0, 100% 0, from($startColor), to($endColor)); // Safari 4+, Chrome 2+
|
109 |
+
background-image: -webkit-linear-gradient(left, $startColor, $endColor); // Safari 5.1+, Chrome 10+
|
110 |
+
background-image: -moz-linear-gradient(left, $startColor, $endColor); // FF 3.6+
|
111 |
+
background-image: -o-linear-gradient(left, $startColor, $endColor); // Opera 11.10
|
112 |
+
background-image: linear-gradient(to right, $startColor, $endColor); // Standard, IE10
|
113 |
+
background-repeat: repeat-x;
|
114 |
+
@if $ie == 1 {
|
115 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$startColor}', endColorstr='#{$endColor}', GradientType=1);
|
116 |
+
}
|
117 |
+
}
|
118 |
+
|
119 |
+
@mixin radial-gradient($from, $to, $ie: $useIEFilters) {
|
120 |
+
@if $ie != 1 { background-color: $to; }
|
121 |
+
|
122 |
+
background: -moz-radial-gradient(center, circle cover, $from 0%, $to 100%);
|
123 |
+
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, $from), color-stop(100%, $to));
|
124 |
+
background: -webkit-radial-gradient(center, circle cover, $from 0%, $to 100%);
|
125 |
+
background: -o-radial-gradient(center, circle cover, $from 0%, $to 100%);
|
126 |
+
background: -ms-radial-gradient(center, circle cover, $from 0%, $to 100%);
|
127 |
+
background: radial-gradient(center, circle cover, $from 0%, $to 100%);
|
128 |
+
background-color: $from;
|
129 |
+
|
130 |
+
@if $ie == 1 {
|
131 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$from}', endColorstr='#{$to}', GradientType=1); /* IE6-9 fallback on horizontal gradient */
|
132 |
+
}
|
133 |
+
}
|
134 |
+
|
135 |
+
@mixin perspective($perspective) {
|
136 |
+
-moz-perspective: $perspective;
|
137 |
+
-ms-perspective: $perspective;
|
138 |
+
-webkit-perspective: $perspective;
|
139 |
+
perspective: $perspective;
|
140 |
+
-moz-transform-style: preserve-3d;
|
141 |
+
-ms-transform-style: preserve-3d;
|
142 |
+
-webkit-transform-style: preserve-3d;
|
143 |
+
transform-style: preserve-3d;
|
144 |
+
}
|
145 |
+
|
146 |
+
@mixin transform ($transforms) {
|
147 |
+
-moz-transform: $transforms;
|
148 |
+
-o-transform: $transforms;
|
149 |
+
-ms-transform: $transforms;
|
150 |
+
-webkit-transform: $transforms;
|
151 |
+
transform: $transforms;
|
152 |
+
}
|
153 |
+
|
154 |
+
@mixin matrix ($a, $b, $c, $d, $e, $f) {
|
155 |
+
-moz-transform: matrix($a, $b, $c, $d, #{$e}px, #{$f}px);
|
156 |
+
-o-transform: matrix($a, $b, $c, $d, $e, $f);
|
157 |
+
-ms-transform: matrix($a, $b, $c, $d, $e, $f);
|
158 |
+
-webkit-transform: matrix($a, $b, $c, $d, $e, $f);
|
159 |
+
transform: matrix($a, $b, $c, $d, $e, $f);
|
160 |
+
}
|
161 |
+
|
162 |
+
@mixin rotate ($deg) {
|
163 |
+
@include transform(rotate(#{$deg}deg));
|
164 |
+
}
|
165 |
+
|
166 |
+
@mixin scale ($size) {
|
167 |
+
@include transform(scale(#{$size}));
|
168 |
+
}
|
169 |
+
|
170 |
+
@mixin translate ($x, $y) {
|
171 |
+
@include transform(translate($x, $y));
|
172 |
+
}
|
173 |
+
|
174 |
+
@mixin transition ($value...) {
|
175 |
+
-moz-transition: $value;
|
176 |
+
-o-transition: $value;
|
177 |
+
-ms-transition: $value;
|
178 |
+
-webkit-transition: $value;
|
179 |
+
transition: $value;
|
180 |
+
}
|
181 |
+
|
182 |
+
@mixin animation($str) {
|
183 |
+
-webkit-animation: #{$str};
|
184 |
+
-moz-animation: #{$str};
|
185 |
+
-ms-animation: #{$str};
|
186 |
+
-o-animation: #{$str};
|
187 |
+
animation: #{$str};
|
188 |
+
}
|
189 |
+
|
190 |
+
@mixin animation-name($str) {
|
191 |
+
-webkit-animation-name: #{$str};
|
192 |
+
-moz-animation-name: #{$str};
|
193 |
+
-ms-animation-name: #{$str};
|
194 |
+
-o-animation-name: #{$str};
|
195 |
+
animation-name: #{$str};
|
196 |
+
}
|
197 |
+
|
198 |
+
@mixin animation-duration($str) {
|
199 |
+
-webkit-animation-duration: #{$str};
|
200 |
+
-moz-animation-duration: #{$str};
|
201 |
+
-ms-animation-duration: #{$str};
|
202 |
+
-o-animation-duration: #{$str};
|
203 |
+
animation-duration: #{$str};
|
204 |
+
}
|
205 |
+
|
206 |
+
@mixin animation-direction($str) {
|
207 |
+
-webkit-animation-direction: #{$str};
|
208 |
+
-moz-animation-direction: #{$str};
|
209 |
+
-ms-animation-direction: #{$str};
|
210 |
+
-o-animation-direction: #{$str};
|
211 |
+
animation-direction: #{$str};
|
212 |
+
}
|
213 |
+
|
214 |
+
@mixin animation-delay($str) {
|
215 |
+
animation-delay:#{$str};
|
216 |
+
-o-animation-delay:#{$str};
|
217 |
+
-ms-animation-delay:#{$str};
|
218 |
+
-webkit-animation-delay:#{$str};
|
219 |
+
-moz-animation-delay:#{$str};
|
220 |
+
}
|
221 |
+
|
222 |
+
@mixin animation-iteration-count($str) {
|
223 |
+
animation-iteration-count:#{$str};
|
224 |
+
-o-animation-iteration-count:#{$str};
|
225 |
+
-ms-animation-iteration-count:#{$str};
|
226 |
+
-webkit-animation-iteration-count:#{$str};
|
227 |
+
-moz-animation-iteration-count:#{$str};
|
228 |
+
}
|
229 |
+
|
230 |
+
@mixin animation-timing-function($str) {
|
231 |
+
-webkit-animation-timing-function: #{$str};
|
232 |
+
-moz-animation-timing-function: #{$str};
|
233 |
+
-ms-animation-timing-function: #{$str};
|
234 |
+
-o-animation-timing-function: #{$str};
|
235 |
+
animation-timing-function: #{$str};
|
236 |
+
}
|
237 |
+
|
238 |
+
// ==== /CSS3 SASS MIXINS ====
|
239 |
+
|
240 |
+
@mixin opacity($opacity) {
|
241 |
+
opacity: $opacity;
|
242 |
+
$opacity-ie: $opacity * 100;
|
243 |
+
filter: alpha(opacity=$opacity-ie); //IE8
|
244 |
+
}
|
245 |
+
|
246 |
+
@mixin size($width, $height: $width)
|
247 |
+
{
|
248 |
+
width: $width;
|
249 |
+
height: $height;
|
250 |
+
}
|
251 |
+
|
252 |
+
@mixin clearfix
|
253 |
+
{
|
254 |
+
&:after {
|
255 |
+
content: "";
|
256 |
+
display: table;
|
257 |
+
clear: both;
|
258 |
+
}
|
259 |
+
}
|
260 |
+
|
261 |
+
// Placeholder text
|
262 |
+
@mixin placeholder($color: $input-color-placeholder) {
|
263 |
+
// Firefox
|
264 |
+
&::-moz-placeholder {
|
265 |
+
color: $color;
|
266 |
+
opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
|
267 |
+
}
|
268 |
+
&:-ms-input-placeholder { color: $color; } // Internet Explorer 10+
|
269 |
+
&::-webkit-input-placeholder { color: $color; } // Safari and Chrome
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
}
|
freemius/assets/scss/admin/_ajax-loader.scss
CHANGED
@@ -1,49 +1,49 @@
|
|
1 |
-
$color: $wp-selected-color;
|
2 |
-
$bkg-color: #fff;
|
3 |
-
$size: 20;
|
4 |
-
|
5 |
-
.fs-ajax-loader
|
6 |
-
{
|
7 |
-
position: relative;
|
8 |
-
width: #{8*$size + 10}px;
|
9 |
-
height: #{$size}px;
|
10 |
-
margin: auto;
|
11 |
-
|
12 |
-
.fs-ajax-loader-bar
|
13 |
-
{
|
14 |
-
position: absolute;
|
15 |
-
top: 0;
|
16 |
-
background-color: $color;
|
17 |
-
width: #{$size}px;
|
18 |
-
height: #{$size}px;
|
19 |
-
@include animation-name(bounce_ajaxLoader);
|
20 |
-
@include animation-duration(1.5s);
|
21 |
-
@include animation-iteration-count(infinite);
|
22 |
-
@include animation-direction(normal);
|
23 |
-
@include transform(.3);
|
24 |
-
}
|
25 |
-
|
26 |
-
@for $i from 0 through 7
|
27 |
-
{
|
28 |
-
.fs-ajax-loader-bar-#{$i + 1}
|
29 |
-
{
|
30 |
-
left: #{$i*($size - 1)}px;
|
31 |
-
@include animation-delay(#{0.6 + $i*0.15}s);
|
32 |
-
}
|
33 |
-
}
|
34 |
-
}
|
35 |
-
|
36 |
-
@include keyframes(bounce_ajaxLoader)
|
37 |
-
{
|
38 |
-
0%
|
39 |
-
{
|
40 |
-
@include transform(scale(1));
|
41 |
-
background-color: $color;
|
42 |
-
}
|
43 |
-
|
44 |
-
100%
|
45 |
-
{
|
46 |
-
@include transform(scale(.3));
|
47 |
-
background-color: $bkg-color;
|
48 |
-
}
|
49 |
}
|
1 |
+
$color: $wp-selected-color;
|
2 |
+
$bkg-color: #fff;
|
3 |
+
$size: 20;
|
4 |
+
|
5 |
+
.fs-ajax-loader
|
6 |
+
{
|
7 |
+
position: relative;
|
8 |
+
width: #{8*$size + 10}px;
|
9 |
+
height: #{$size}px;
|
10 |
+
margin: auto;
|
11 |
+
|
12 |
+
.fs-ajax-loader-bar
|
13 |
+
{
|
14 |
+
position: absolute;
|
15 |
+
top: 0;
|
16 |
+
background-color: $color;
|
17 |
+
width: #{$size}px;
|
18 |
+
height: #{$size}px;
|
19 |
+
@include animation-name(bounce_ajaxLoader);
|
20 |
+
@include animation-duration(1.5s);
|
21 |
+
@include animation-iteration-count(infinite);
|
22 |
+
@include animation-direction(normal);
|
23 |
+
@include transform(.3);
|
24 |
+
}
|
25 |
+
|
26 |
+
@for $i from 0 through 7
|
27 |
+
{
|
28 |
+
.fs-ajax-loader-bar-#{$i + 1}
|
29 |
+
{
|
30 |
+
left: #{$i*($size - 1)}px;
|
31 |
+
@include animation-delay(#{0.6 + $i*0.15}s);
|
32 |
+
}
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
@include keyframes(bounce_ajaxLoader)
|
37 |
+
{
|
38 |
+
0%
|
39 |
+
{
|
40 |
+
@include transform(scale(1));
|
41 |
+
background-color: $color;
|
42 |
+
}
|
43 |
+
|
44 |
+
100%
|
45 |
+
{
|
46 |
+
@include transform(scale(.3));
|
47 |
+
background-color: $bkg-color;
|
48 |
+
}
|
49 |
}
|
freemius/assets/scss/admin/_auto-install.scss
CHANGED
@@ -1,33 +1,33 @@
|
|
1 |
-
.fs-modal-auto-install
|
2 |
-
{
|
3 |
-
$max-width: 300px;
|
4 |
-
|
5 |
-
#request-filesystem-credentials-form
|
6 |
-
{
|
7 |
-
h2,
|
8 |
-
.request-filesystem-credentials-action-buttons
|
9 |
-
{
|
10 |
-
display: none;
|
11 |
-
}
|
12 |
-
|
13 |
-
input[type=password],
|
14 |
-
input[type=email],
|
15 |
-
input[type=text]
|
16 |
-
{
|
17 |
-
-webkit-appearance: none;
|
18 |
-
padding: 10px 10px 5px 10px;
|
19 |
-
width: $max-width;
|
20 |
-
max-width: 100%;
|
21 |
-
}
|
22 |
-
|
23 |
-
> div,
|
24 |
-
label,
|
25 |
-
fieldset
|
26 |
-
{
|
27 |
-
width: $max-width;
|
28 |
-
max-width: 100%;
|
29 |
-
margin: 0 auto;
|
30 |
-
display: block;
|
31 |
-
}
|
32 |
-
}
|
33 |
}
|
1 |
+
.fs-modal-auto-install
|
2 |
+
{
|
3 |
+
$max-width: 300px;
|
4 |
+
|
5 |
+
#request-filesystem-credentials-form
|
6 |
+
{
|
7 |
+
h2,
|
8 |
+
.request-filesystem-credentials-action-buttons
|
9 |
+
{
|
10 |
+
display: none;
|
11 |
+
}
|
12 |
+
|
13 |
+
input[type=password],
|
14 |
+
input[type=email],
|
15 |
+
input[type=text]
|
16 |
+
{
|
17 |
+
-webkit-appearance: none;
|
18 |
+
padding: 10px 10px 5px 10px;
|
19 |
+
width: $max-width;
|
20 |
+
max-width: 100%;
|
21 |
+
}
|
22 |
+
|
23 |
+
> div,
|
24 |
+
label,
|
25 |
+
fieldset
|
26 |
+
{
|
27 |
+
width: $max-width;
|
28 |
+
max-width: 100%;
|
29 |
+
margin: 0 auto;
|
30 |
+
display: block;
|
31 |
+
}
|
32 |
+
}
|
33 |
}
|
freemius/assets/scss/admin/_deactivation-feedback.scss
CHANGED
@@ -1,55 +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 |
}
|
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
-
.fs-modal.fs-modal-license-activation {
|
2 |
-
.fs-modal-body {
|
3 |
-
input.license_key {
|
4 |
-
width: 100%;
|
5 |
-
}
|
6 |
-
}
|
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
CHANGED
@@ -1,68 +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 |
-
}
|
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
CHANGED
@@ -1,186 +1,186 @@
|
|
1 |
-
@import "../colors";
|
2 |
-
@import "../mixins";
|
3 |
-
|
4 |
-
.fs-modal {
|
5 |
-
position: fixed;
|
6 |
-
overflow: auto;
|
7 |
-
height: 100%;
|
8 |
-
width: 100%;
|
9 |
-
top: 0;
|
10 |
-
z-index: 100000;
|
11 |
-
display: none;
|
12 |
-
background: rgba(0, 0, 0, 0.6);
|
13 |
-
|
14 |
-
.fs-modal-dialog {
|
15 |
-
background: transparent;
|
16 |
-
position: absolute;
|
17 |
-
left: 50%;
|
18 |
-
margin-left: -298px;
|
19 |
-
padding-bottom: 30px;
|
20 |
-
top: -100%;
|
21 |
-
z-index: 100001;
|
22 |
-
width: 596px;
|
23 |
-
|
24 |
-
@media (max-width: 650px) {
|
25 |
-
margin-left: -50%;
|
26 |
-
box-sizing: border-box;
|
27 |
-
padding-left: 10px;
|
28 |
-
padding-right: 10px;
|
29 |
-
width: 100%;
|
30 |
-
|
31 |
-
.fs-modal-panel > h3 > strong {
|
32 |
-
font-size: 1.3em;
|
33 |
-
}
|
34 |
-
}
|
35 |
-
}
|
36 |
-
|
37 |
-
&.active {
|
38 |
-
display: block;
|
39 |
-
|
40 |
-
&:before {
|
41 |
-
display: block;
|
42 |
-
}
|
43 |
-
|
44 |
-
.fs-modal-dialog {
|
45 |
-
top: 10%;
|
46 |
-
}
|
47 |
-
}
|
48 |
-
|
49 |
-
&.fs-success {
|
50 |
-
.fs-modal-header {
|
51 |
-
border-bottom-color: $wp-notice-success-dark-color;
|
52 |
-
}
|
53 |
-
|
54 |
-
.fs-modal-body {
|
55 |
-
background-color: $wp-notice-success-color;
|
56 |
-
}
|
57 |
-
}
|
58 |
-
|
59 |
-
&.fs-warn {
|
60 |
-
.fs-modal-header {
|
61 |
-
border-bottom-color: $wp-notice-warn-dark-color;
|
62 |
-
}
|
63 |
-
|
64 |
-
.fs-modal-body {
|
65 |
-
background-color: $wp-notice-warn-color;
|
66 |
-
}
|
67 |
-
}
|
68 |
-
|
69 |
-
&.fs-error {
|
70 |
-
.fs-modal-header {
|
71 |
-
border-bottom-color: $wp-notice-error-dark-color;
|
72 |
-
}
|
73 |
-
|
74 |
-
.fs-modal-body {
|
75 |
-
background-color: $wp-notice-error-color;
|
76 |
-
}
|
77 |
-
}
|
78 |
-
|
79 |
-
|
80 |
-
.fs-modal-body,
|
81 |
-
.fs-modal-footer {
|
82 |
-
border: 0;
|
83 |
-
background: #fefefe;
|
84 |
-
padding: 20px;
|
85 |
-
}
|
86 |
-
|
87 |
-
.fs-modal-header {
|
88 |
-
border-bottom: #eeeeee solid 1px;
|
89 |
-
background: #fbfbfb;
|
90 |
-
padding: 15px 20px;
|
91 |
-
position: relative;
|
92 |
-
margin-bottom: -10px;
|
93 |
-
// z-index: 2;
|
94 |
-
|
95 |
-
h4 {
|
96 |
-
margin: 0;
|
97 |
-
padding: 0;
|
98 |
-
text-transform: uppercase;
|
99 |
-
font-size: 1.2em;
|
100 |
-
font-weight: bold;
|
101 |
-
color: #cacaca;
|
102 |
-
text-shadow: 1px 1px 1px #fff;
|
103 |
-
letter-spacing: 0.6px;
|
104 |
-
-webkit-font-smoothing: antialiased;
|
105 |
-
}
|
106 |
-
|
107 |
-
.fs-close {
|
108 |
-
position: absolute;
|
109 |
-
right: 10px;
|
110 |
-
top: 12px;
|
111 |
-
cursor: pointer;
|
112 |
-
color: #bbb;
|
113 |
-
@include border-radius(20px);
|
114 |
-
padding: 3px;
|
115 |
-
@include transition(all 0.2s ease-in-out);
|
116 |
-
|
117 |
-
&:hover {
|
118 |
-
color: #fff;
|
119 |
-
background: #aaa;
|
120 |
-
}
|
121 |
-
}
|
122 |
-
}
|
123 |
-
|
124 |
-
.fs-modal-body {
|
125 |
-
border-bottom: 0;
|
126 |
-
|
127 |
-
p {
|
128 |
-
font-size: 14px;
|
129 |
-
}
|
130 |
-
|
131 |
-
h2 {
|
132 |
-
font-size: 20px;
|
133 |
-
line-height: 1.5em;
|
134 |
-
}
|
135 |
-
|
136 |
-
> div {
|
137 |
-
margin-top: 10px;
|
138 |
-
|
139 |
-
h2 {
|
140 |
-
font-weight: bold;
|
141 |
-
font-size: 20px;
|
142 |
-
margin-top: 0;
|
143 |
-
}
|
144 |
-
}
|
145 |
-
}
|
146 |
-
|
147 |
-
.fs-modal-footer {
|
148 |
-
border-top: #eeeeee solid 1px;
|
149 |
-
text-align: right;
|
150 |
-
|
151 |
-
> .button {
|
152 |
-
margin: 0 7px;
|
153 |
-
|
154 |
-
&:first-child {
|
155 |
-
margin: 0;
|
156 |
-
}
|
157 |
-
}
|
158 |
-
}
|
159 |
-
|
160 |
-
.fs-modal-panel {
|
161 |
-
> .notice.inline {
|
162 |
-
margin: 0;
|
163 |
-
display: none;
|
164 |
-
}
|
165 |
-
|
166 |
-
&:not(.active) {
|
167 |
-
display: none;
|
168 |
-
}
|
169 |
-
}
|
170 |
-
}
|
171 |
-
|
172 |
-
.rtl
|
173 |
-
{
|
174 |
-
.fs-modal {
|
175 |
-
.fs-modal-header {
|
176 |
-
.fs-close {
|
177 |
-
right: auto;
|
178 |
-
left: 20px;
|
179 |
-
}
|
180 |
-
}
|
181 |
-
}
|
182 |
-
}
|
183 |
-
|
184 |
-
body.has-fs-modal {
|
185 |
-
overflow: hidden;
|
186 |
}
|
1 |
+
@import "../colors";
|
2 |
+
@import "../mixins";
|
3 |
+
|
4 |
+
.fs-modal {
|
5 |
+
position: fixed;
|
6 |
+
overflow: auto;
|
7 |
+
height: 100%;
|
8 |
+
width: 100%;
|
9 |
+
top: 0;
|
10 |
+
z-index: 100000;
|
11 |
+
display: none;
|
12 |
+
background: rgba(0, 0, 0, 0.6);
|
13 |
+
|
14 |
+
.fs-modal-dialog {
|
15 |
+
background: transparent;
|
16 |
+
position: absolute;
|
17 |
+
left: 50%;
|
18 |
+
margin-left: -298px;
|
19 |
+
padding-bottom: 30px;
|
20 |
+
top: -100%;
|
21 |
+
z-index: 100001;
|
22 |
+
width: 596px;
|
23 |
+
|
24 |
+
@media (max-width: 650px) {
|
25 |
+
margin-left: -50%;
|
26 |
+
box-sizing: border-box;
|
27 |
+
padding-left: 10px;
|
28 |
+
padding-right: 10px;
|
29 |
+
width: 100%;
|
30 |
+
|
31 |
+
.fs-modal-panel > h3 > strong {
|
32 |
+
font-size: 1.3em;
|
33 |
+
}
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
&.active {
|
38 |
+
display: block;
|
39 |
+
|
40 |
+
&:before {
|
41 |
+
display: block;
|
42 |
+
}
|
43 |
+
|
44 |
+
.fs-modal-dialog {
|
45 |
+
top: 10%;
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
&.fs-success {
|
50 |
+
.fs-modal-header {
|
51 |
+
border-bottom-color: $wp-notice-success-dark-color;
|
52 |
+
}
|
53 |
+
|
54 |
+
.fs-modal-body {
|
55 |
+
background-color: $wp-notice-success-color;
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
&.fs-warn {
|
60 |
+
.fs-modal-header {
|
61 |
+
border-bottom-color: $wp-notice-warn-dark-color;
|
62 |
+
}
|
63 |
+
|
64 |
+
.fs-modal-body {
|
65 |
+
background-color: $wp-notice-warn-color;
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
&.fs-error {
|
70 |
+
.fs-modal-header {
|
71 |
+
border-bottom-color: $wp-notice-error-dark-color;
|
72 |
+
}
|
73 |
+
|
74 |
+
.fs-modal-body {
|
75 |
+
background-color: $wp-notice-error-color;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
|
80 |
+
.fs-modal-body,
|
81 |
+
.fs-modal-footer {
|
82 |
+
border: 0;
|
83 |
+
background: #fefefe;
|
84 |
+
padding: 20px;
|
85 |
+
}
|
86 |
+
|
87 |
+
.fs-modal-header {
|
88 |
+
border-bottom: #eeeeee solid 1px;
|
89 |
+
background: #fbfbfb;
|
90 |
+
padding: 15px 20px;
|
91 |
+
position: relative;
|
92 |
+
margin-bottom: -10px;
|
93 |
+
// z-index: 2;
|
94 |
+
|
95 |
+
h4 {
|
96 |
+
margin: 0;
|
97 |
+
padding: 0;
|
98 |
+
text-transform: uppercase;
|
99 |
+
font-size: 1.2em;
|
100 |
+
font-weight: bold;
|
101 |
+
color: #cacaca;
|
102 |
+
text-shadow: 1px 1px 1px #fff;
|
103 |
+
letter-spacing: 0.6px;
|
104 |
+
-webkit-font-smoothing: antialiased;
|
105 |
+
}
|
106 |
+
|
107 |
+
.fs-close {
|
108 |
+
position: absolute;
|
109 |
+
right: 10px;
|
110 |
+
top: 12px;
|
111 |
+
cursor: pointer;
|
112 |
+
color: #bbb;
|
113 |
+
@include border-radius(20px);
|
114 |
+
padding: 3px;
|
115 |
+
@include transition(all 0.2s ease-in-out);
|
116 |
+
|
117 |
+
&:hover {
|
118 |
+
color: #fff;
|
119 |
+
background: #aaa;
|
120 |
+
}
|
121 |
+
}
|
122 |
+
}
|
123 |
+
|
124 |
+
.fs-modal-body {
|
125 |
+
border-bottom: 0;
|
126 |
+
|
127 |
+
p {
|
128 |
+
font-size: 14px;
|
129 |
+
}
|
130 |
+
|
131 |
+
h2 {
|
132 |
+
font-size: 20px;
|
133 |
+
line-height: 1.5em;
|
134 |
+
}
|
135 |
+
|
136 |
+
> div {
|
137 |
+
margin-top: 10px;
|
138 |
+
|
139 |
+
h2 {
|
140 |
+
font-weight: bold;
|
141 |
+
font-size: 20px;
|
142 |
+
margin-top: 0;
|
143 |
+
}
|
144 |
+
}
|
145 |
+
}
|
146 |
+
|
147 |
+
.fs-modal-footer {
|
148 |
+
border-top: #eeeeee solid 1px;
|
149 |
+
text-align: right;
|
150 |
+
|
151 |
+
> .button {
|
152 |
+
margin: 0 7px;
|
153 |
+
|
154 |
+
&:first-child {
|
155 |
+
margin: 0;
|
156 |
+
}
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
.fs-modal-panel {
|
161 |
+
> .notice.inline {
|
162 |
+
margin: 0;
|
163 |
+
display: none;
|
164 |
+
}
|
165 |
+
|
166 |
+
&:not(.active) {
|
167 |
+
display: none;
|
168 |
+
}
|
169 |
+
}
|
170 |
+
}
|
171 |
+
|
172 |
+
.rtl
|
173 |
+
{
|
174 |
+
.fs-modal {
|
175 |
+
.fs-modal-header {
|
176 |
+
.fs-close {
|
177 |
+
right: auto;
|
178 |
+
left: 20px;
|
179 |
+
}
|
180 |
+
}
|
181 |
+
}
|
182 |
+
}
|
183 |
+
|
184 |
+
body.has-fs-modal {
|
185 |
+
overflow: hidden;
|
186 |
}
|
freemius/assets/scss/admin/_themes.scss
CHANGED
@@ -1,21 +1,21 @@
|
|
1 |
-
.theme-browser
|
2 |
-
{
|
3 |
-
.theme
|
4 |
-
{
|
5 |
-
.fs-premium-theme-badge
|
6 |
-
{
|
7 |
-
position: absolute;
|
8 |
-
top: 10px;
|
9 |
-
right: 0;
|
10 |
-
background: $fs-logo-green-color;
|
11 |
-
color: #fff;
|
12 |
-
text-transform: uppercase;
|
13 |
-
padding: 5px 10px;
|
14 |
-
@include border-radius(3px 0 0 3px);
|
15 |
-
font-weight: bold;
|
16 |
-
border-right: 0;
|
17 |
-
@include box-shadow(0 2px 1px -1px rgba(0, 0, 0, .3));
|
18 |
-
font-size: 1.1em;
|
19 |
-
}
|
20 |
-
}
|
21 |
}
|
1 |
+
.theme-browser
|
2 |
+
{
|
3 |
+
.theme
|
4 |
+
{
|
5 |
+
.fs-premium-theme-badge
|
6 |
+
{
|
7 |
+
position: absolute;
|
8 |
+
top: 10px;
|
9 |
+
right: 0;
|
10 |
+
background: $fs-logo-green-color;
|
11 |
+
color: #fff;
|
12 |
+
text-transform: uppercase;
|
13 |
+
padding: 5px 10px;
|
14 |
+
@include border-radius(3px 0 0 3px);
|
15 |
+
font-weight: bold;
|
16 |
+
border-right: 0;
|
17 |
+
@include box-shadow(0 2px 1px -1px rgba(0, 0, 0, .3));
|
18 |
+
font-size: 1.1em;
|
19 |
+
}
|
20 |
+
}
|
21 |
}
|
freemius/assets/scss/admin/account.scss
CHANGED
@@ -1,256 +1,256 @@
|
|
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 |
-
.dashicons {
|
20 |
-
width: 26px;
|
21 |
-
height: 26px;
|
22 |
-
font-size: 1.3em;
|
23 |
-
}
|
24 |
-
}
|
25 |
-
|
26 |
-
i.dashicons
|
27 |
-
{
|
28 |
-
font-size: 1.2em;
|
29 |
-
height: 1.2em;
|
30 |
-
width: 1.2em;
|
31 |
-
}
|
32 |
-
|
33 |
-
.button
|
34 |
-
{
|
35 |
-
i.dashicons
|
36 |
-
{
|
37 |
-
vertical-align: middle;
|
38 |
-
}
|
39 |
-
}
|
40 |
-
|
41 |
-
.fs-header-actions
|
42 |
-
{
|
43 |
-
position: absolute;
|
44 |
-
top: 17px;
|
45 |
-
right: 15px;
|
46 |
-
font-size: 0.9em;
|
47 |
-
|
48 |
-
ul
|
49 |
-
{
|
50 |
-
margin: 0;
|
51 |
-
}
|
52 |
-
|
53 |
-
li
|
54 |
-
{
|
55 |
-
form
|
56 |
-
{
|
57 |
-
display: inline-block;
|
58 |
-
}
|
59 |
-
|
60 |
-
float: left;
|
61 |
-
a
|
62 |
-
{
|
63 |
-
text-decoration: none;
|
64 |
-
}
|
65 |
-
}
|
66 |
-
}
|
67 |
-
}
|
68 |
-
|
69 |
-
#fs_account_details .button-group {
|
70 |
-
float: right;
|
71 |
-
}
|
72 |
-
|
73 |
-
.rtl #fs_account .fs-header-actions
|
74 |
-
{
|
75 |
-
left: 15px;
|
76 |
-
right: auto;
|
77 |
-
}
|
78 |
-
|
79 |
-
.fs-key-value-table
|
80 |
-
{
|
81 |
-
width: 100%;
|
82 |
-
|
83 |
-
form
|
84 |
-
{
|
85 |
-
display: inline-block;
|
86 |
-
}
|
87 |
-
|
88 |
-
tr
|
89 |
-
{
|
90 |
-
td:first-child
|
91 |
-
{
|
92 |
-
nobr
|
93 |
-
{
|
94 |
-
font-weight: bold;
|
95 |
-
}
|
96 |
-
|
97 |
-
text-align: right;
|
98 |
-
|
99 |
-
form
|
100 |
-
{
|
101 |
-
display: block;
|
102 |
-
}
|
103 |
-
}
|
104 |
-
|
105 |
-
td.fs-right
|
106 |
-
{
|
107 |
-
text-align: right;
|
108 |
-
}
|
109 |
-
|
110 |
-
&.fs-odd
|
111 |
-
{
|
112 |
-
background: #ebebeb;
|
113 |
-
}
|
114 |
-
}
|
115 |
-
|
116 |
-
td, th
|
117 |
-
{
|
118 |
-
padding: 10px;
|
119 |
-
}
|
120 |
-
|
121 |
-
code {
|
122 |
-
line-height: 28px;
|
123 |
-
}
|
124 |
-
|
125 |
-
var, code, input[type="text"]
|
126 |
-
{
|
127 |
-
color: #0073AA;
|
128 |
-
font-size: 16px;
|
129 |
-
background: none;
|
130 |
-
}
|
131 |
-
|
132 |
-
input[type="text"] {
|
133 |
-
width: 100%;
|
134 |
-
font-weight: bold;
|
135 |
-
}
|
136 |
-
}
|
137 |
-
|
138 |
-
label.fs-tag
|
139 |
-
{
|
140 |
-
background: #ffba00;
|
141 |
-
color: #fff;
|
142 |
-
display: inline-block;
|
143 |
-
border-radius: 3px;
|
144 |
-
padding: 5px;
|
145 |
-
font-size: 11px;
|
146 |
-
line-height: 11px;
|
147 |
-
vertical-align: baseline;
|
148 |
-
|
149 |
-
&.fs-warn
|
150 |
-
{
|
151 |
-
background: #ffba00;
|
152 |
-
}
|
153 |
-
&.fs-success
|
154 |
-
{
|
155 |
-
background: #46b450;
|
156 |
-
}
|
157 |
-
&.fs-error
|
158 |
-
{
|
159 |
-
background: #dc3232;
|
160 |
-
}
|
161 |
-
}
|
162 |
-
|
163 |
-
#fs_addons
|
164 |
-
{
|
165 |
-
h3
|
166 |
-
{
|
167 |
-
border: none;
|
168 |
-
margin-bottom: 0;
|
169 |
-
padding: 4px 5px;
|
170 |
-
}
|
171 |
-
|
172 |
-
td
|
173 |
-
{
|
174 |
-
vertical-align: middle;
|
175 |
-
}
|
176 |
-
|
177 |
-
thead {
|
178 |
-
white-space: nowrap;
|
179 |
-
}
|
180 |
-
|
181 |
-
td:first-child,
|
182 |
-
th:first-child
|
183 |
-
{
|
184 |
-
text-align: left;
|
185 |
-
font-weight: bold;
|
186 |
-
}
|
187 |
-
td:last-child,
|
188 |
-
th:last-child
|
189 |
-
{
|
190 |
-
text-align: right;
|
191 |
-
}
|
192 |
-
th
|
193 |
-
{
|
194 |
-
font-weight: bold;
|
195 |
-
}
|
196 |
-
}
|
197 |
-
|
198 |
-
#fs_billing_address {
|
199 |
-
width: 100%;
|
200 |
-
|
201 |
-
tr {
|
202 |
-
td {
|
203 |
-
width: 50%;
|
204 |
-
padding: 5px;
|
205 |
-
}
|
206 |
-
|
207 |
-
&:first-of-type {
|
208 |
-
td {
|
209 |
-
padding-top: 0;
|
210 |
-
}
|
211 |
-
}
|
212 |
-
}
|
213 |
-
|
214 |
-
@mixin read-mode {
|
215 |
-
border-color: transparent;
|
216 |
-
color: #777;
|
217 |
-
border-bottom: 1px dashed #ccc;
|
218 |
-
padding-left: 0;
|
219 |
-
background: none;
|
220 |
-
}
|
221 |
-
|
222 |
-
span {
|
223 |
-
font-weight: bold;
|
224 |
-
}
|
225 |
-
|
226 |
-
input, select {
|
227 |
-
@include placeholder(transparent);
|
228 |
-
|
229 |
-
display: block;
|
230 |
-
width: 100%;
|
231 |
-
margin-top: 5px;
|
232 |
-
|
233 |
-
&.fs-read-mode {
|
234 |
-
@include read-mode();
|
235 |
-
}
|
236 |
-
}
|
237 |
-
|
238 |
-
|
239 |
-
&.fs-read-mode {
|
240 |
-
td span {
|
241 |
-
display: none;
|
242 |
-
}
|
243 |
-
|
244 |
-
input, select
|
245 |
-
{
|
246 |
-
@include read-mode();
|
247 |
-
@include placeholder(#ccc);
|
248 |
-
}
|
249 |
-
}
|
250 |
-
|
251 |
-
|
252 |
-
button {
|
253 |
-
display: block;
|
254 |
-
width: 100%;
|
255 |
-
}
|
256 |
}
|
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 |
+
.dashicons {
|
20 |
+
width: 26px;
|
21 |
+
height: 26px;
|
22 |
+
font-size: 1.3em;
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
i.dashicons
|
27 |
+
{
|
28 |
+
font-size: 1.2em;
|
29 |
+
height: 1.2em;
|
30 |
+
width: 1.2em;
|
31 |
+
}
|
32 |
+
|
33 |
+
.button
|
34 |
+
{
|
35 |
+
i.dashicons
|
36 |
+
{
|
37 |
+
vertical-align: middle;
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
.fs-header-actions
|
42 |
+
{
|
43 |
+
position: absolute;
|
44 |
+
top: 17px;
|
45 |
+
right: 15px;
|
46 |
+
font-size: 0.9em;
|
47 |
+
|
48 |
+
ul
|
49 |
+
{
|
50 |
+
margin: 0;
|
51 |
+
}
|
52 |
+
|
53 |
+
li
|
54 |
+
{
|
55 |
+
form
|
56 |
+
{
|
57 |
+
display: inline-block;
|
58 |
+
}
|
59 |
+
|
60 |
+
float: left;
|
61 |
+
a
|
62 |
+
{
|
63 |
+
text-decoration: none;
|
64 |
+
}
|
65 |
+
}
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
#fs_account_details .button-group {
|
70 |
+
float: right;
|
71 |
+
}
|
72 |
+
|
73 |
+
.rtl #fs_account .fs-header-actions
|
74 |
+
{
|
75 |
+
left: 15px;
|
76 |
+
right: auto;
|
77 |
+
}
|
78 |
+
|
79 |
+
.fs-key-value-table
|
80 |
+
{
|
81 |
+
width: 100%;
|
82 |
+
|
83 |
+
form
|
84 |
+
{
|
85 |
+
display: inline-block;
|
86 |
+
}
|
87 |
+
|
88 |
+
tr
|
89 |
+
{
|
90 |
+
td:first-child
|
91 |
+
{
|
92 |
+
nobr
|
93 |
+
{
|
94 |
+
font-weight: bold;
|
95 |
+
}
|
96 |
+
|
97 |
+
text-align: right;
|
98 |
+
|
99 |
+
form
|
100 |
+
{
|
101 |
+
display: block;
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
td.fs-right
|
106 |
+
{
|
107 |
+
text-align: right;
|
108 |
+
}
|
109 |
+
|
110 |
+
&.fs-odd
|
111 |
+
{
|
112 |
+
background: #ebebeb;
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
td, th
|
117 |
+
{
|
118 |
+
padding: 10px;
|
119 |
+
}
|
120 |
+
|
121 |
+
code {
|
122 |
+
line-height: 28px;
|
123 |
+
}
|
124 |
+
|
125 |
+
var, code, input[type="text"]
|
126 |
+
{
|
127 |
+
color: #0073AA;
|
128 |
+
font-size: 16px;
|
129 |
+
background: none;
|
130 |
+
}
|
131 |
+
|
132 |
+
input[type="text"] {
|
133 |
+
width: 100%;
|
134 |
+
font-weight: bold;
|
135 |
+
}
|
136 |
+
}
|
137 |
+
|
138 |
+
label.fs-tag
|
139 |
+
{
|
140 |
+
background: #ffba00;
|
141 |
+
color: #fff;
|
142 |
+
display: inline-block;
|
143 |
+
border-radius: 3px;
|
144 |
+
padding: 5px;
|
145 |
+
font-size: 11px;
|
146 |
+
line-height: 11px;
|
147 |
+
vertical-align: baseline;
|
148 |
+
|
149 |
+
&.fs-warn
|
150 |
+
{
|
151 |
+
background: #ffba00;
|
152 |
+
}
|
153 |
+
&.fs-success
|
154 |
+
{
|
155 |
+
background: #46b450;
|
156 |
+
}
|
157 |
+
&.fs-error
|
158 |
+
{
|
159 |
+
background: #dc3232;
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
#fs_addons
|
164 |
+
{
|
165 |
+
h3
|
166 |
+
{
|
167 |
+
border: none;
|
168 |
+
margin-bottom: 0;
|
169 |
+
padding: 4px 5px;
|
170 |
+
}
|
171 |
+
|
172 |
+
td
|
173 |
+
{
|
174 |
+
vertical-align: middle;
|
175 |
+
}
|
176 |
+
|
177 |
+
thead {
|
178 |
+
white-space: nowrap;
|
179 |
+
}
|
180 |
+
|
181 |
+
td:first-child,
|
182 |
+
th:first-child
|
183 |
+
{
|
184 |
+
text-align: left;
|
185 |
+
font-weight: bold;
|
186 |
+
}
|
187 |
+
td:last-child,
|
188 |
+
th:last-child
|
189 |
+
{
|
190 |
+
text-align: right;
|
191 |
+
}
|
192 |
+
th
|
193 |
+
{
|
194 |
+
font-weight: bold;
|
195 |
+
}
|
196 |
+
}
|
197 |
+
|
198 |
+
#fs_billing_address {
|
199 |
+
width: 100%;
|
200 |
+
|
201 |
+
tr {
|
202 |
+
td {
|
203 |
+
width: 50%;
|
204 |
+
padding: 5px;
|
205 |
+
}
|
206 |
+
|
207 |
+
&:first-of-type {
|
208 |
+
td {
|
209 |
+
padding-top: 0;
|
210 |
+
}
|
211 |
+
}
|
212 |
+
}
|
213 |
+
|
214 |
+
@mixin read-mode {
|
215 |
+
border-color: transparent;
|
216 |
+
color: #777;
|
217 |
+
border-bottom: 1px dashed #ccc;
|
218 |
+
padding-left: 0;
|
219 |
+
background: none;
|
220 |
+
}
|
221 |
+
|
222 |
+
span {
|
223 |
+
font-weight: bold;
|
224 |
+
}
|
225 |
+
|
226 |
+
input, select {
|
227 |
+
@include placeholder(transparent);
|
228 |
+
|
229 |
+
display: block;
|
230 |
+
width: 100%;
|
231 |
+
margin-top: 5px;
|
232 |
+
|
233 |
+
&.fs-read-mode {
|
234 |
+
@include read-mode();
|
235 |
+
}
|
236 |
+
}
|
237 |
+
|
238 |
+
|
239 |
+
&.fs-read-mode {
|
240 |
+
td span {
|
241 |
+
display: none;
|
242 |
+
}
|
243 |
+
|
244 |
+
input, select
|
245 |
+
{
|
246 |
+
@include read-mode();
|
247 |
+
@include placeholder(#ccc);
|
248 |
+
}
|
249 |
+
}
|
250 |
+
|
251 |
+
|
252 |
+
button {
|
253 |
+
display: block;
|
254 |
+
width: 100%;
|
255 |
+
}
|
256 |
}
|
freemius/assets/scss/admin/add-ons.scss
CHANGED
@@ -1,449 +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 |
}
|
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/affiliation.scss
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@import "../start";
|
2 |
+
|
3 |
+
#fs_affiliation_content_wrapper {
|
4 |
+
#messages {
|
5 |
+
margin-top: 25px;
|
6 |
+
}
|
7 |
+
|
8 |
+
h3 {
|
9 |
+
font-size: 24px;
|
10 |
+
padding: 0;
|
11 |
+
margin-left: 0;
|
12 |
+
}
|
13 |
+
|
14 |
+
ul {
|
15 |
+
li {
|
16 |
+
@include box-sizing(border-box);
|
17 |
+
list-style-type: none;
|
18 |
+
|
19 |
+
&:before {
|
20 |
+
content: '✓';
|
21 |
+
margin-right: 10px;
|
22 |
+
font-weight: bold;
|
23 |
+
}
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
27 |
+
p:not(.description), li, label {
|
28 |
+
font-size: 16px !important;
|
29 |
+
line-height: 26px !important;
|
30 |
+
}
|
31 |
+
|
32 |
+
.button {
|
33 |
+
margin-top: 20px;
|
34 |
+
margin-bottom: 7px;
|
35 |
+
line-height: 35px;
|
36 |
+
height: 40px;
|
37 |
+
font-size: 16px;
|
38 |
+
|
39 |
+
&#cancel_button {
|
40 |
+
margin-right: 5px;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
form {
|
45 |
+
.input-container {
|
46 |
+
.input-label {
|
47 |
+
font-weight: bold;
|
48 |
+
display: block;
|
49 |
+
width: 100%;
|
50 |
+
}
|
51 |
+
|
52 |
+
&.input-container-text {
|
53 |
+
label, input, textarea {
|
54 |
+
display: block;
|
55 |
+
}
|
56 |
+
}
|
57 |
+
|
58 |
+
margin-bottom: 15px;
|
59 |
+
|
60 |
+
#add_domain, .remove-domain {
|
61 |
+
text-decoration: none;
|
62 |
+
display: inline-block;
|
63 |
+
margin-top: 3px;
|
64 |
+
|
65 |
+
&:focus {
|
66 |
+
box-shadow: none;
|
67 |
+
}
|
68 |
+
|
69 |
+
&.disabled {
|
70 |
+
color: #aaa;
|
71 |
+
cursor: default;
|
72 |
+
}
|
73 |
+
}
|
74 |
+
}
|
75 |
+
|
76 |
+
#extra_domains_container {
|
77 |
+
.description {
|
78 |
+
margin-top: 0;
|
79 |
+
position: relative;
|
80 |
+
top: -4px;
|
81 |
+
}
|
82 |
+
|
83 |
+
.extra-domain-input-container {
|
84 |
+
margin-bottom: 15px;
|
85 |
+
|
86 |
+
.domain {
|
87 |
+
display: inline-block;
|
88 |
+
margin-right: 5px;
|
89 |
+
|
90 |
+
&:last-of-type {
|
91 |
+
margin-bottom: 0;
|
92 |
+
}
|
93 |
+
}
|
94 |
+
}
|
95 |
+
}
|
96 |
+
}
|
97 |
+
}
|
freemius/assets/scss/admin/checkout.scss
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
-
@media screen and (max-width: 782px) {
|
2 |
-
#wpbody-content {
|
3 |
-
padding-bottom: 0 !important;
|
4 |
-
}
|
5 |
}
|
1 |
+
@media screen and (max-width: 782px) {
|
2 |
+
#wpbody-content {
|
3 |
+
padding-bottom: 0 !important;
|
4 |
+
}
|
5 |
}
|
freemius/assets/scss/admin/debug.scss
CHANGED
@@ -1,135 +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 |
}
|
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
-
@import "../start";
|
2 |
-
@import "modal-common";
|
3 |
-
@import "deactivation-feedback";
|
4 |
-
@import "license-activation";
|
5 |
-
@import "license-key-resend";
|
6 |
-
@import "ajax-loader";
|
7 |
@import "auto-install";
|
1 |
+
@import "../start";
|
2 |
+
@import "modal-common";
|
3 |
+
@import "deactivation-feedback";
|
4 |
+
@import "license-activation";
|
5 |
+
@import "license-key-resend";
|
6 |
+
@import "ajax-loader";
|
7 |
@import "auto-install";
|
freemius/assets/scss/admin/index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
3 |
+
// Hide file structure from users on unprotected servers.
|
freemius/assets/scss/customizer.scss
CHANGED
@@ -1,125 +1,125 @@
|
|
1 |
-
@import "start";
|
2 |
-
|
3 |
-
#fs_customizer_upsell {
|
4 |
-
.fs-customizer-plan {
|
5 |
-
padding: 10px 20px 20px 20px;
|
6 |
-
border-radius: 3px;
|
7 |
-
background: #fff;
|
8 |
-
|
9 |
-
h2 {
|
10 |
-
position: relative;
|
11 |
-
margin: 0;
|
12 |
-
line-height: 2em;
|
13 |
-
text-transform: uppercase;
|
14 |
-
|
15 |
-
.button-link {
|
16 |
-
top: -2px;
|
17 |
-
}
|
18 |
-
}
|
19 |
-
}
|
20 |
-
|
21 |
-
.fs-feature {
|
22 |
-
position: relative;
|
23 |
-
}
|
24 |
-
|
25 |
-
.dashicons-yes {
|
26 |
-
color: #0085ba;
|
27 |
-
font-size: 2em;
|
28 |
-
vertical-align: bottom;
|
29 |
-
margin-left: -7px;
|
30 |
-
margin-right: 10px;
|
31 |
-
|
32 |
-
.rtl & {
|
33 |
-
margin-left: 10px;
|
34 |
-
margin-right: -7px;
|
35 |
-
}
|
36 |
-
}
|
37 |
-
|
38 |
-
.dashicons-editor-help
|
39 |
-
{
|
40 |
-
color: #bbb;
|
41 |
-
cursor: help;
|
42 |
-
|
43 |
-
$tooltip-color: #000;
|
44 |
-
|
45 |
-
.fs-feature-desc {
|
46 |
-
opacity: 0;
|
47 |
-
visibility: hidden;
|
48 |
-
@include transition(opacity 0.3s ease-in-out);
|
49 |
-
|
50 |
-
position: absolute;
|
51 |
-
background: $tooltip-color;
|
52 |
-
color: #fff;
|
53 |
-
font-family: 'arial', serif;
|
54 |
-
font-size: 12px;
|
55 |
-
padding: 10px;
|
56 |
-
z-index: 999999;
|
57 |
-
bottom: 100%;
|
58 |
-
margin-bottom: 5px;
|
59 |
-
left: 0;
|
60 |
-
right: 0;
|
61 |
-
@include border-radius(5px);
|
62 |
-
@include box-shadow(1px 1px 1px rgba(0,0,0,0.2));
|
63 |
-
line-height: 1.3em;
|
64 |
-
font-weight: bold;
|
65 |
-
text-align: left;
|
66 |
-
|
67 |
-
.rtl &
|
68 |
-
{
|
69 |
-
text-align: right;
|
70 |
-
}
|
71 |
-
|
72 |
-
&::after {
|
73 |
-
content: ' ';
|
74 |
-
display: block;
|
75 |
-
width: 0;
|
76 |
-
height: 0;
|
77 |
-
border-style: solid;
|
78 |
-
border-width: 5px 5px 0 5px;
|
79 |
-
border-color: $tooltip-color transparent transparent transparent;
|
80 |
-
position: absolute;
|
81 |
-
top: 100%;
|
82 |
-
left: 21px;
|
83 |
-
|
84 |
-
.rtl & {
|
85 |
-
right: 21px;
|
86 |
-
left: auto;
|
87 |
-
}
|
88 |
-
}
|
89 |
-
}
|
90 |
-
|
91 |
-
&:hover {
|
92 |
-
.fs-feature-desc {
|
93 |
-
visibility: visible;
|
94 |
-
opacity: 1;
|
95 |
-
}
|
96 |
-
}
|
97 |
-
}
|
98 |
-
|
99 |
-
.button-primary {
|
100 |
-
display: block;
|
101 |
-
text-align: center;
|
102 |
-
margin-top: 10px;
|
103 |
-
}
|
104 |
-
}
|
105 |
-
|
106 |
-
#fs_customizer_support
|
107 |
-
{
|
108 |
-
display: block !important;
|
109 |
-
|
110 |
-
.button {
|
111 |
-
float: right;
|
112 |
-
}
|
113 |
-
|
114 |
-
.button-group {
|
115 |
-
width: 100%;
|
116 |
-
display: block;
|
117 |
-
margin-top: 10px;
|
118 |
-
|
119 |
-
.button {
|
120 |
-
float: none;
|
121 |
-
width: 50%;
|
122 |
-
text-align: center;
|
123 |
-
}
|
124 |
-
}
|
125 |
}
|
1 |
+
@import "start";
|
2 |
+
|
3 |
+
#fs_customizer_upsell {
|
4 |
+
.fs-customizer-plan {
|
5 |
+
padding: 10px 20px 20px 20px;
|
6 |
+
border-radius: 3px;
|
7 |
+
background: #fff;
|
8 |
+
|
9 |
+
h2 {
|
10 |
+
position: relative;
|
11 |
+
margin: 0;
|
12 |
+
line-height: 2em;
|
13 |
+
text-transform: uppercase;
|
14 |
+
|
15 |
+
.button-link {
|
16 |
+
top: -2px;
|
17 |
+
}
|
18 |
+
}
|
19 |
+
}
|
20 |
+
|
21 |
+
.fs-feature {
|
22 |
+
position: relative;
|
23 |
+
}
|
24 |
+
|
25 |
+
.dashicons-yes {
|
26 |
+
color: #0085ba;
|
27 |
+
font-size: 2em;
|
28 |
+
vertical-align: bottom;
|
29 |
+
margin-left: -7px;
|
30 |
+
margin-right: 10px;
|
31 |
+
|
32 |
+
.rtl & {
|
33 |
+
margin-left: 10px;
|
34 |
+
margin-right: -7px;
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
+
.dashicons-editor-help
|
39 |
+
{
|
40 |
+
color: #bbb;
|
41 |
+
cursor: help;
|
42 |
+
|
43 |
+
$tooltip-color: #000;
|
44 |
+
|
45 |
+
.fs-feature-desc {
|
46 |
+
opacity: 0;
|
47 |
+
visibility: hidden;
|
48 |
+
@include transition(opacity 0.3s ease-in-out);
|
49 |
+
|
50 |
+
position: absolute;
|
51 |
+
background: $tooltip-color;
|
52 |
+
color: #fff;
|
53 |
+
font-family: 'arial', serif;
|
54 |
+
font-size: 12px;
|
55 |
+
padding: 10px;
|
56 |
+
z-index: 999999;
|
57 |
+
bottom: 100%;
|
58 |
+
margin-bottom: 5px;
|
59 |
+
left: 0;
|
60 |
+
right: 0;
|
61 |
+
@include border-radius(5px);
|
62 |
+
@include box-shadow(1px 1px 1px rgba(0,0,0,0.2));
|
63 |
+
line-height: 1.3em;
|
64 |
+
font-weight: bold;
|
65 |
+
text-align: left;
|
66 |
+
|
67 |
+
.rtl &
|
68 |
+
{
|
69 |
+
text-align: right;
|
70 |
+
}
|
71 |
+
|
72 |
+
&::after {
|
73 |
+
content: ' ';
|
74 |
+
display: block;
|
75 |
+
width: 0;
|
76 |
+
height: 0;
|
77 |
+
border-style: solid;
|
78 |
+
border-width: 5px 5px 0 5px;
|
79 |
+
border-color: $tooltip-color transparent transparent transparent;
|
80 |
+
position: absolute;
|
81 |
+
top: 100%;
|
82 |
+
left: 21px;
|
83 |
+
|
84 |
+
.rtl & {
|
85 |
+
right: 21px;
|
86 |
+
left: auto;
|
87 |
+
}
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
&:hover {
|
92 |
+
.fs-feature-desc {
|
93 |
+
visibility: visible;
|
94 |
+
opacity: 1;
|
95 |
+
}
|
96 |
+
}
|
97 |
+
}
|
98 |
+
|
99 |
+
.button-primary {
|
100 |
+
display: block;
|
101 |
+
text-align: center;
|
102 |
+
margin-top: 10px;
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
#fs_customizer_support
|
107 |
+
{
|
108 |
+
display: block !important;
|
109 |
+
|
110 |
+
.button {
|
111 |
+
float: right;
|
112 |
+
}
|
113 |
+
|
114 |
+
.button-group {
|
115 |
+
width: 100%;
|
116 |
+
display: block;
|
117 |
+
margin-top: 10px;
|
118 |
+
|
119 |
+
.button {
|
120 |
+
float: none;
|
121 |
+
width: 50%;
|
122 |
+
text-align: center;
|
123 |
+
}
|
124 |
+
}
|
125 |
}
|
freemius/assets/scss/index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
3 |
+
// Hide file structure from users on unprotected servers.
|
freemius/config.php
CHANGED
@@ -1,328 +1,331 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.0.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__ROOT_DOMAIN_PRODUCTION', 'freemius.com' );
|
130 |
-
define( 'WP_FS__DOMAIN_PRODUCTION', 'wp.freemius.com' );
|
131 |
-
define( 'WP_FS__ADDRESS_PRODUCTION', 'https://' . WP_FS__DOMAIN_PRODUCTION );
|
132 |
-
|
133 |
-
if ( ! defined( 'WP_FS__DOMAIN_LOCALHOST' ) ) {
|
134 |
-
define( 'WP_FS__DOMAIN_LOCALHOST', 'wp.freemius' );
|
135 |
-
}
|
136 |
-
if ( ! defined( 'WP_FS__ADDRESS_LOCALHOST' ) ) {
|
137 |
-
define( 'WP_FS__ADDRESS_LOCALHOST', 'http://' . WP_FS__DOMAIN_LOCALHOST . ':8080' );
|
138 |
-
}
|
139 |
-
|
140 |
-
if ( ! defined( 'WP_FS__TESTING_DOMAIN' ) ) {
|
141 |
-
define( 'WP_FS__TESTING_DOMAIN', 'fswp' );
|
142 |
-
}
|
143 |
-
|
144 |
-
#--------------------------------------------------------------------------------
|
145 |
-
#region HTTP
|
146 |
-
#--------------------------------------------------------------------------------
|
147 |
-
|
148 |
-
if ( ! defined( 'WP_FS__IS_HTTP_REQUEST' ) ) {
|
149 |
-
define( 'WP_FS__IS_HTTP_REQUEST', isset( $_SERVER['HTTP_HOST'] ) );
|
150 |
-
}
|
151 |
-
|
152 |
-
if ( ! defined( 'WP_FS__IS_HTTPS' ) ) {
|
153 |
-
define( 'WP_FS__IS_HTTPS', ( WP_FS__IS_HTTP_REQUEST &&
|
154 |
-
// Checks if CloudFlare's HTTPS (Flexible SSL support).
|
155 |
-
isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) &&
|
156 |
-
'https' === strtolower( $_SERVER['HTTP_X_FORWARDED_PROTO'] )
|
157 |
-
) ||
|
158 |
-
// Check if HTTPS request.
|
159 |
-
( isset( $_SERVER['HTTPS'] ) && 'on' == $_SERVER['HTTPS'] ) ||
|
160 |
-
( isset( $_SERVER['SERVER_PORT'] ) && 443 == $_SERVER['SERVER_PORT'] )
|
161 |
-
);
|
162 |
-
}
|
163 |
-
|
164 |
-
if ( ! defined( 'WP_FS__IS_POST_REQUEST' ) ) {
|
165 |
-
define( 'WP_FS__IS_POST_REQUEST', ( WP_FS__IS_HTTP_REQUEST &&
|
166 |
-
strtoupper( $_SERVER['REQUEST_METHOD'] ) == 'POST' ) );
|
167 |
-
}
|
168 |
-
|
169 |
-
if ( ! defined( 'WP_FS__REMOTE_ADDR' ) ) {
|
170 |
-
define( 'WP_FS__REMOTE_ADDR', fs_get_ip() );
|
171 |
-
}
|
172 |
-
|
173 |
-
if ( ! defined( 'WP_FS__IS_LOCALHOST' ) ) {
|
174 |
-
if ( defined( 'WP_FS__LOCALHOST_IP' ) ) {
|
175 |
-
define( 'WP_FS__IS_LOCALHOST', ( WP_FS__LOCALHOST_IP === WP_FS__REMOTE_ADDR ) );
|
176 |
-
} else {
|
177 |
-
define( 'WP_FS__IS_LOCALHOST', WP_FS__IS_HTTP_REQUEST &&
|
178 |
-
is_string( WP_FS__REMOTE_ADDR ) &&
|
179 |
-
( substr( WP_FS__REMOTE_ADDR, 0, 4 ) === '127.' ||
|
180 |
-
WP_FS__REMOTE_ADDR === '::1' )
|
181 |
-
);
|
182 |
-
}
|
183 |
-
}
|
184 |
-
|
185 |
-
if ( ! defined( 'WP_FS__IS_LOCALHOST_FOR_SERVER' ) ) {
|
186 |
-
define( 'WP_FS__IS_LOCALHOST_FOR_SERVER', ( ! WP_FS__IS_HTTP_REQUEST ||
|
187 |
-
false !== strpos( $_SERVER['HTTP_HOST'], 'localhost' ) ) );
|
188 |
-
}
|
189 |
-
|
190 |
-
#endregion
|
191 |
-
|
192 |
-
if ( ! defined( 'WP_FS__IS_PRODUCTION_MODE' ) ) {
|
193 |
-
// By default, run with Freemius production servers.
|
194 |
-
define( 'WP_FS__IS_PRODUCTION_MODE', true );
|
195 |
-
}
|
196 |
-
|
197 |
-
if ( ! defined( 'WP_FS__ADDRESS' ) ) {
|
198 |
-
define( 'WP_FS__ADDRESS', ( WP_FS__IS_PRODUCTION_MODE ? WP_FS__ADDRESS_PRODUCTION : WP_FS__ADDRESS_LOCALHOST ) );
|
199 |
-
}
|
200 |
-
|
201 |
-
|
202 |
-
#--------------------------------------------------------------------------------
|
203 |
-
#region API
|
204 |
-
#--------------------------------------------------------------------------------
|
205 |
-
|
206 |
-
if ( ! defined( 'WP_FS__API_ADDRESS_LOCALHOST' ) ) {
|
207 |
-
define( 'WP_FS__API_ADDRESS_LOCALHOST', 'http://api.freemius:8080' );
|
208 |
-
}
|
209 |
-
if ( ! defined( 'WP_FS__API_SANDBOX_ADDRESS_LOCALHOST' ) ) {
|
210 |
-
define( 'WP_FS__API_SANDBOX_ADDRESS_LOCALHOST', 'http://sandbox-api.freemius:8080' );
|
211 |
-
}
|
212 |
-
|
213 |
-
// Set API address for local testing.
|
214 |
-
if ( ! WP_FS__IS_PRODUCTION_MODE ) {
|
215 |
-
if ( ! defined( 'FS_API__ADDRESS' ) ) {
|
216 |
-
define( 'FS_API__ADDRESS', WP_FS__API_ADDRESS_LOCALHOST );
|
217 |
-
}
|
218 |
-
if ( ! defined( 'FS_API__SANDBOX_ADDRESS' ) ) {
|
219 |
-
define( 'FS_API__SANDBOX_ADDRESS', WP_FS__API_SANDBOX_ADDRESS_LOCALHOST );
|
220 |
-
}
|
221 |
-
}
|
222 |
-
|
223 |
-
#endregion
|
224 |
-
|
225 |
-
#--------------------------------------------------------------------------------
|
226 |
-
#region Checkout
|
227 |
-
#--------------------------------------------------------------------------------
|
228 |
-
|
229 |
-
if ( ! defined( 'FS_CHECKOUT__ADDRESS_PRODUCTION' ) ) {
|
230 |
-
define( 'FS_CHECKOUT__ADDRESS_PRODUCTION', 'https://checkout.freemius.com' );
|
231 |
-
}
|
232 |
-
|
233 |
-
if ( ! defined( 'FS_CHECKOUT__ADDRESS_LOCALHOST' ) ) {
|
234 |
-
define( 'FS_CHECKOUT__ADDRESS_LOCALHOST', 'http://checkout.freemius:8080' );
|
235 |
-
}
|
236 |
-
|
237 |
-
if ( ! defined( 'FS_CHECKOUT__ADDRESS' ) ) {
|
238 |
-
define( 'FS_CHECKOUT__ADDRESS', ( WP_FS__IS_PRODUCTION_MODE ? FS_CHECKOUT__ADDRESS_PRODUCTION : FS_CHECKOUT__ADDRESS_LOCALHOST ) );
|
239 |
-
}
|
240 |
-
|
241 |
-
#endregion
|
242 |
-
|
243 |
-
define( 'WP_FS___OPTION_PREFIX', 'fs' . ( WP_FS__IS_PRODUCTION_MODE ? '' : '_dbg' ) . '_' );
|
244 |
-
|
245 |
-
if ( ! defined( 'WP_FS__ACCOUNTS_OPTION_NAME' ) ) {
|
246 |
-
define( 'WP_FS__ACCOUNTS_OPTION_NAME', WP_FS___OPTION_PREFIX . 'accounts' );
|
247 |
-
}
|
248 |
-
if ( ! defined( 'WP_FS__API_CACHE_OPTION_NAME' ) ) {
|
249 |
-
define( 'WP_FS__API_CACHE_OPTION_NAME', WP_FS___OPTION_PREFIX . 'api_cache' );
|
250 |
-
}
|
251 |
-
define( 'WP_FS__OPTIONS_OPTION_NAME', WP_FS___OPTION_PREFIX . 'options' );
|
252 |
-
|
253 |
-
/**
|
254 |
-
* Module types
|
255 |
-
*
|
256 |
-
* @since 1.2.2
|
257 |
-
*/
|
258 |
-
define( 'WP_FS__MODULE_TYPE_PLUGIN', 'plugin' );
|
259 |
-
define( 'WP_FS__MODULE_TYPE_THEME', 'theme' );
|
260 |
-
|
261 |
-
/**
|
262 |
-
* Billing Frequencies
|
263 |
-
*/
|
264 |
-
define( 'WP_FS__PERIOD_ANNUALLY', 'annual' );
|
265 |
-
define( 'WP_FS__PERIOD_MONTHLY', 'monthly' );
|
266 |
-
define( 'WP_FS__PERIOD_LIFETIME', 'lifetime' );
|
267 |
-
|
268 |
-
/**
|
269 |
-
* Plans
|
270 |
-
*/
|
271 |
-
define( 'WP_FS__PLAN_DEFAULT_PAID', false );
|
272 |
-
define( 'WP_FS__PLAN_FREE', 'free' );
|
273 |
-
define( 'WP_FS__PLAN_TRIAL', 'trial' );
|
274 |
-
|
275 |
-
/**
|
276 |
-
* Times in seconds
|
277 |
-
*/
|
278 |
-
if ( ! defined( 'WP_FS__TIME_5_MIN_IN_SEC' ) ) {
|
279 |
-
define( 'WP_FS__TIME_5_MIN_IN_SEC', 300 );
|
280 |
-
}
|
281 |
-
if ( ! defined( 'WP_FS__TIME_10_MIN_IN_SEC' ) ) {
|
282 |
-
define( 'WP_FS__TIME_10_MIN_IN_SEC', 600 );
|
283 |
-
}
|
284 |
-
// define( 'WP_FS__TIME_15_MIN_IN_SEC', 900 );
|
285 |
-
if ( ! defined( 'WP_FS__TIME_24_HOURS_IN_SEC' ) ) {
|
286 |
-
define( 'WP_FS__TIME_24_HOURS_IN_SEC', 86400 );
|
287 |
-
}
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
if ( ! defined( '
|
308 |
-
define( '
|
309 |
-
}
|
310 |
-
if ( ! defined( '
|
311 |
-
define( '
|
312 |
-
}
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
if ( ! defined( '
|
324 |
-
define( '
|
325 |
-
}
|
326 |
-
if ( ! defined( '
|
327 |
-
define( '
|
328 |
-
}
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.0.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__ROOT_DOMAIN_PRODUCTION', 'freemius.com' );
|
130 |
+
define( 'WP_FS__DOMAIN_PRODUCTION', 'wp.freemius.com' );
|
131 |
+
define( 'WP_FS__ADDRESS_PRODUCTION', 'https://' . WP_FS__DOMAIN_PRODUCTION );
|
132 |
+
|
133 |
+
if ( ! defined( 'WP_FS__DOMAIN_LOCALHOST' ) ) {
|
134 |
+
define( 'WP_FS__DOMAIN_LOCALHOST', 'wp.freemius' );
|
135 |
+
}
|
136 |
+
if ( ! defined( 'WP_FS__ADDRESS_LOCALHOST' ) ) {
|
137 |
+
define( 'WP_FS__ADDRESS_LOCALHOST', 'http://' . WP_FS__DOMAIN_LOCALHOST . ':8080' );
|
138 |
+
}
|
139 |
+
|
140 |
+
if ( ! defined( 'WP_FS__TESTING_DOMAIN' ) ) {
|
141 |
+
define( 'WP_FS__TESTING_DOMAIN', 'fswp' );
|
142 |
+
}
|
143 |
+
|
144 |
+
#--------------------------------------------------------------------------------
|
145 |
+
#region HTTP
|
146 |
+
#--------------------------------------------------------------------------------
|
147 |
+
|
148 |
+
if ( ! defined( 'WP_FS__IS_HTTP_REQUEST' ) ) {
|
149 |
+
define( 'WP_FS__IS_HTTP_REQUEST', isset( $_SERVER['HTTP_HOST'] ) );
|
150 |
+
}
|
151 |
+
|
152 |
+
if ( ! defined( 'WP_FS__IS_HTTPS' ) ) {
|
153 |
+
define( 'WP_FS__IS_HTTPS', ( WP_FS__IS_HTTP_REQUEST &&
|
154 |
+
// Checks if CloudFlare's HTTPS (Flexible SSL support).
|
155 |
+
isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) &&
|
156 |
+
'https' === strtolower( $_SERVER['HTTP_X_FORWARDED_PROTO'] )
|
157 |
+
) ||
|
158 |
+
// Check if HTTPS request.
|
159 |
+
( isset( $_SERVER['HTTPS'] ) && 'on' == $_SERVER['HTTPS'] ) ||
|
160 |
+
( isset( $_SERVER['SERVER_PORT'] ) && 443 == $_SERVER['SERVER_PORT'] )
|
161 |
+
);
|
162 |
+
}
|
163 |
+
|
164 |
+
if ( ! defined( 'WP_FS__IS_POST_REQUEST' ) ) {
|
165 |
+
define( 'WP_FS__IS_POST_REQUEST', ( WP_FS__IS_HTTP_REQUEST &&
|
166 |
+
strtoupper( $_SERVER['REQUEST_METHOD'] ) == 'POST' ) );
|
167 |
+
}
|
168 |
+
|
169 |
+
if ( ! defined( 'WP_FS__REMOTE_ADDR' ) ) {
|
170 |
+
define( 'WP_FS__REMOTE_ADDR', fs_get_ip() );
|
171 |
+
}
|
172 |
+
|
173 |
+
if ( ! defined( 'WP_FS__IS_LOCALHOST' ) ) {
|
174 |
+
if ( defined( 'WP_FS__LOCALHOST_IP' ) ) {
|
175 |
+
define( 'WP_FS__IS_LOCALHOST', ( WP_FS__LOCALHOST_IP === WP_FS__REMOTE_ADDR ) );
|
176 |
+
} else {
|
177 |
+
define( 'WP_FS__IS_LOCALHOST', WP_FS__IS_HTTP_REQUEST &&
|
178 |
+
is_string( WP_FS__REMOTE_ADDR ) &&
|
179 |
+
( substr( WP_FS__REMOTE_ADDR, 0, 4 ) === '127.' ||
|
180 |
+
WP_FS__REMOTE_ADDR === '::1' )
|
181 |
+
);
|
182 |
+
}
|
183 |
+
}
|
184 |
+
|
185 |
+
if ( ! defined( 'WP_FS__IS_LOCALHOST_FOR_SERVER' ) ) {
|
186 |
+
define( 'WP_FS__IS_LOCALHOST_FOR_SERVER', ( ! WP_FS__IS_HTTP_REQUEST ||
|
187 |
+
false !== strpos( $_SERVER['HTTP_HOST'], 'localhost' ) ) );
|
188 |
+
}
|
189 |
+
|
190 |
+
#endregion
|
191 |
+
|
192 |
+
if ( ! defined( 'WP_FS__IS_PRODUCTION_MODE' ) ) {
|
193 |
+
// By default, run with Freemius production servers.
|
194 |
+
define( 'WP_FS__IS_PRODUCTION_MODE', true );
|
195 |
+
}
|
196 |
+
|
197 |
+
if ( ! defined( 'WP_FS__ADDRESS' ) ) {
|
198 |
+
define( 'WP_FS__ADDRESS', ( WP_FS__IS_PRODUCTION_MODE ? WP_FS__ADDRESS_PRODUCTION : WP_FS__ADDRESS_LOCALHOST ) );
|
199 |
+
}
|
200 |
+
|
201 |
+
|
202 |
+
#--------------------------------------------------------------------------------
|
203 |
+
#region API
|
204 |
+
#--------------------------------------------------------------------------------
|
205 |
+
|
206 |
+
if ( ! defined( 'WP_FS__API_ADDRESS_LOCALHOST' ) ) {
|
207 |
+
define( 'WP_FS__API_ADDRESS_LOCALHOST', 'http://api.freemius:8080' );
|
208 |
+
}
|
209 |
+
if ( ! defined( 'WP_FS__API_SANDBOX_ADDRESS_LOCALHOST' ) ) {
|
210 |
+
define( 'WP_FS__API_SANDBOX_ADDRESS_LOCALHOST', 'http://sandbox-api.freemius:8080' );
|
211 |
+
}
|
212 |
+
|
213 |
+
// Set API address for local testing.
|
214 |
+
if ( ! WP_FS__IS_PRODUCTION_MODE ) {
|
215 |
+
if ( ! defined( 'FS_API__ADDRESS' ) ) {
|
216 |
+
define( 'FS_API__ADDRESS', WP_FS__API_ADDRESS_LOCALHOST );
|
217 |
+
}
|
218 |
+
if ( ! defined( 'FS_API__SANDBOX_ADDRESS' ) ) {
|
219 |
+
define( 'FS_API__SANDBOX_ADDRESS', WP_FS__API_SANDBOX_ADDRESS_LOCALHOST );
|
220 |
+
}
|
221 |
+
}
|
222 |
+
|
223 |
+
#endregion
|
224 |
+
|
225 |
+
#--------------------------------------------------------------------------------
|
226 |
+
#region Checkout
|
227 |
+
#--------------------------------------------------------------------------------
|
228 |
+
|
229 |
+
if ( ! defined( 'FS_CHECKOUT__ADDRESS_PRODUCTION' ) ) {
|
230 |
+
define( 'FS_CHECKOUT__ADDRESS_PRODUCTION', 'https://checkout.freemius.com' );
|
231 |
+
}
|
232 |
+
|
233 |
+
if ( ! defined( 'FS_CHECKOUT__ADDRESS_LOCALHOST' ) ) {
|
234 |
+
define( 'FS_CHECKOUT__ADDRESS_LOCALHOST', 'http://checkout.freemius-local.com:8080' );
|
235 |
+
}
|
236 |
+
|
237 |
+
if ( ! defined( 'FS_CHECKOUT__ADDRESS' ) ) {
|
238 |
+
define( 'FS_CHECKOUT__ADDRESS', ( WP_FS__IS_PRODUCTION_MODE ? FS_CHECKOUT__ADDRESS_PRODUCTION : FS_CHECKOUT__ADDRESS_LOCALHOST ) );
|
239 |
+
}
|
240 |
+
|
241 |
+
#endregion
|
242 |
+
|
243 |
+
define( 'WP_FS___OPTION_PREFIX', 'fs' . ( WP_FS__IS_PRODUCTION_MODE ? '' : '_dbg' ) . '_' );
|
244 |
+
|
245 |
+
if ( ! defined( 'WP_FS__ACCOUNTS_OPTION_NAME' ) ) {
|
246 |
+
define( 'WP_FS__ACCOUNTS_OPTION_NAME', WP_FS___OPTION_PREFIX . 'accounts' );
|
247 |
+
}
|
248 |
+
if ( ! defined( 'WP_FS__API_CACHE_OPTION_NAME' ) ) {
|
249 |
+
define( 'WP_FS__API_CACHE_OPTION_NAME', WP_FS___OPTION_PREFIX . 'api_cache' );
|
250 |
+
}
|
251 |
+
define( 'WP_FS__OPTIONS_OPTION_NAME', WP_FS___OPTION_PREFIX . 'options' );
|
252 |
+
|
253 |
+
/**
|
254 |
+
* Module types
|
255 |
+
*
|
256 |
+
* @since 1.2.2
|
257 |
+
*/
|
258 |
+
define( 'WP_FS__MODULE_TYPE_PLUGIN', 'plugin' );
|
259 |
+
define( 'WP_FS__MODULE_TYPE_THEME', 'theme' );
|
260 |
+
|
261 |
+
/**
|
262 |
+
* Billing Frequencies
|
263 |
+
*/
|
264 |
+
define( 'WP_FS__PERIOD_ANNUALLY', 'annual' );
|
265 |
+
define( 'WP_FS__PERIOD_MONTHLY', 'monthly' );
|
266 |
+
define( 'WP_FS__PERIOD_LIFETIME', 'lifetime' );
|
267 |
+
|
268 |
+
/**
|
269 |
+
* Plans
|
270 |
+
*/
|
271 |
+
define( 'WP_FS__PLAN_DEFAULT_PAID', false );
|
272 |
+
define( 'WP_FS__PLAN_FREE', 'free' );
|
273 |
+
define( 'WP_FS__PLAN_TRIAL', 'trial' );
|
274 |
+
|
275 |
+
/**
|
276 |
+
* Times in seconds
|
277 |
+
*/
|
278 |
+
if ( ! defined( 'WP_FS__TIME_5_MIN_IN_SEC' ) ) {
|
279 |
+
define( 'WP_FS__TIME_5_MIN_IN_SEC', 300 );
|
280 |
+
}
|
281 |
+
if ( ! defined( 'WP_FS__TIME_10_MIN_IN_SEC' ) ) {
|
282 |
+
define( 'WP_FS__TIME_10_MIN_IN_SEC', 600 );
|
283 |
+
}
|
284 |
+
// define( 'WP_FS__TIME_15_MIN_IN_SEC', 900 );
|
285 |
+
if ( ! defined( 'WP_FS__TIME_24_HOURS_IN_SEC' ) ) {
|
286 |
+
define( 'WP_FS__TIME_24_HOURS_IN_SEC', 86400 );
|
287 |
+
}
|
288 |
+
if ( ! defined( 'WP_FS__TIME_WEEK_IN_SEC' ) ) {
|
289 |
+
define( 'WP_FS__TIME_WEEK_IN_SEC', 7 * WP_FS__TIME_24_HOURS_IN_SEC );
|
290 |
+
}
|
291 |
+
|
292 |
+
#--------------------------------------------------------------------------------
|
293 |
+
#region Debugging
|
294 |
+
#--------------------------------------------------------------------------------
|
295 |
+
|
296 |
+
if ( ! defined( 'WP_FS__DEBUG_SDK' ) ) {
|
297 |
+
$debug_mode = get_option( 'fs_debug_mode', null );
|
298 |
+
|
299 |
+
if ( $debug_mode === null ) {
|
300 |
+
$debug_mode = false;
|
301 |
+
add_option( 'fs_debug_mode', $debug_mode );
|
302 |
+
}
|
303 |
+
|
304 |
+
define( 'WP_FS__DEBUG_SDK', is_numeric( $debug_mode ) ? ( 0 < $debug_mode ) : WP_FS__DEV_MODE );
|
305 |
+
}
|
306 |
+
|
307 |
+
if ( ! defined( 'WP_FS__ECHO_DEBUG_SDK' ) ) {
|
308 |
+
define( 'WP_FS__ECHO_DEBUG_SDK', WP_FS__DEV_MODE && ! empty( $_GET['fs_dbg_echo'] ) );
|
309 |
+
}
|
310 |
+
if ( ! defined( 'WP_FS__LOG_DATETIME_FORMAT' ) ) {
|
311 |
+
define( 'WP_FS__LOG_DATETIME_FORMAT', 'Y-m-d H:i:s' );
|
312 |
+
}
|
313 |
+
if ( ! defined( 'FS_API__LOGGER_ON' ) ) {
|
314 |
+
define( 'FS_API__LOGGER_ON', WP_FS__DEBUG_SDK );
|
315 |
+
}
|
316 |
+
|
317 |
+
if ( WP_FS__ECHO_DEBUG_SDK ) {
|
318 |
+
error_reporting( E_ALL );
|
319 |
+
}
|
320 |
+
|
321 |
+
#endregion
|
322 |
+
|
323 |
+
if ( ! defined( 'WP_FS__SCRIPT_START_TIME' ) ) {
|
324 |
+
define( 'WP_FS__SCRIPT_START_TIME', time() );
|
325 |
+
}
|
326 |
+
if ( ! defined( 'WP_FS__DEFAULT_PRIORITY' ) ) {
|
327 |
+
define( 'WP_FS__DEFAULT_PRIORITY', 10 );
|
328 |
+
}
|
329 |
+
if ( ! defined( 'WP_FS__LOWEST_PRIORITY' ) ) {
|
330 |
+
define( 'WP_FS__LOWEST_PRIORITY', 999999999 );
|
331 |
+
}
|
freemius/includes/class-freemius-abstract.php
CHANGED
@@ -1,597 +1,597 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.0.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 has connected his account (opted-in).
|
32 |
-
*
|
33 |
-
* Note:
|
34 |
-
* If the user opted-in and opted-out on a later stage,
|
35 |
-
* this will still return true. If you want to check if the
|
36 |
-
* user is currently opted-in, use:
|
37 |
-
* `$fs->is_registered() && $fs->is_tracking_allowed()`
|
38 |
-
*
|
39 |
-
* @since 1.0.1
|
40 |
-
* @return bool
|
41 |
-
*/
|
42 |
-
abstract function is_registered();
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Check if the user skipped connecting the account with Freemius.
|
46 |
-
*
|
47 |
-
* @since 1.0.7
|
48 |
-
*
|
49 |
-
* @return bool
|
50 |
-
*/
|
51 |
-
abstract function is_anonymous();
|
52 |
-
|
53 |
-
/**
|
54 |
-
* Check if the user currently in activation mode.
|
55 |
-
*
|
56 |
-
* @since 1.0.7
|
57 |
-
*
|
58 |
-
* @return bool
|
59 |
-
*/
|
60 |
-
abstract function is_activation_mode();
|
61 |
-
|
62 |
-
#endregion
|
63 |
-
|
64 |
-
#----------------------------------------------------------------------------------
|
65 |
-
#region Usage Tracking
|
66 |
-
#----------------------------------------------------------------------------------
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Returns TRUE if the user opted-in and didn't disconnect (opt-out).
|
70 |
-
*
|
71 |
-
* @author Leo Fajardo (@leorw)
|
72 |
-
* @since 1.2.1.5
|
73 |
-
*
|
74 |
-
* @return bool
|
75 |
-
*/
|
76 |
-
abstract function is_tracking_allowed();
|
77 |
-
|
78 |
-
/**
|
79 |
-
* Returns TRUE if the user never opted-in or manually opted-out.
|
80 |
-
*
|
81 |
-
* @author Vova Feldman (@svovaf)
|
82 |
-
* @since 1.2.1.5
|
83 |
-
*
|
84 |
-
* @return bool
|
85 |
-
*/
|
86 |
-
function is_tracking_prohibited() {
|
87 |
-
return ! $this->is_registered() || ! $this->is_tracking_allowed();
|
88 |
-
}
|
89 |
-
|
90 |
-
/**
|
91 |
-
* Opt-out from usage tracking.
|
92 |
-
*
|
93 |
-
* Note: This will not delete the account information but will stop all tracking.
|
94 |
-
*
|
95 |
-
* Returns:
|
96 |
-
* 1. FALSE - If the user never opted-in.
|
97 |
-
* 2. TRUE - If successfully opted-out.
|
98 |
-
* 3. object - API Result on failure.
|
99 |
-
*
|
100 |
-
* @author Leo Fajardo (@leorw)
|
101 |
-
* @since 1.2.1.5
|
102 |
-
*
|
103 |
-
* @return bool|object
|
104 |
-
*/
|
105 |
-
abstract function stop_tracking();
|
106 |
-
|
107 |
-
/**
|
108 |
-
* Opt-in back into usage tracking.
|
109 |
-
*
|
110 |
-
* Note: This will only work if the user opted-in previously.
|
111 |
-
*
|
112 |
-
* Returns:
|
113 |
-
* 1. FALSE - If the user never opted-in.
|
114 |
-
* 2. TRUE - If successfully opted-in back to usage tracking.
|
115 |
-
* 3. object - API result on failure.
|
116 |
-
*
|
117 |
-
* @author Leo Fajardo (@leorw)
|
118 |
-
* @since 1.2.1.5
|
119 |
-
*
|
120 |
-
* @return bool|object
|
121 |
-
*/
|
122 |
-
abstract function allow_tracking();
|
123 |
-
|
124 |
-
#endregion
|
125 |
-
|
126 |
-
#----------------------------------------------------------------------------------
|
127 |
-
#region Module Type
|
128 |
-
#----------------------------------------------------------------------------------
|
129 |
-
|
130 |
-
/**
|
131 |
-
* Checks if the plugin's type is "plugin". The other type is "theme".
|
132 |
-
*
|
133 |
-
* @author Leo Fajardo (@leorw)
|
134 |
-
* @since 1.2.2
|
135 |
-
*
|
136 |
-
* @return bool
|
137 |
-
*/
|
138 |
-
abstract function is_plugin();
|
139 |
-
|
140 |
-
/**
|
141 |
-
* Checks if the module type is "theme". The other type is "plugin".
|
142 |
-
*
|
143 |
-
* @author Leo Fajardo (@leorw)
|
144 |
-
* @since 1.2.2
|
145 |
-
*
|
146 |
-
* @return bool
|
147 |
-
*/
|
148 |
-
function is_theme() {
|
149 |
-
return ( ! $this->is_plugin() );
|
150 |
-
}
|
151 |
-
|
152 |
-
#endregion
|
153 |
-
|
154 |
-
#----------------------------------------------------------------------------------
|
155 |
-
#region Permissions
|
156 |
-
#----------------------------------------------------------------------------------
|
157 |
-
|
158 |
-
/**
|
159 |
-
* Check if plugin must be WordPress.org compliant.
|
160 |
-
*
|
161 |
-
* @since 1.0.7
|
162 |
-
*
|
163 |
-
* @return bool
|
164 |
-
*/
|
165 |
-
abstract function is_org_repo_compliant();
|
166 |
-
|
167 |
-
/**
|
168 |
-
* Check if plugin is allowed to install executable files.
|
169 |
-
*
|
170 |
-
* @author Vova Feldman (@svovaf)
|
171 |
-
* @since 1.0.5
|
172 |
-
*
|
173 |
-
* @return bool
|
174 |
-
*/
|
175 |
-
function is_allowed_to_install() {
|
176 |
-
return ( $this->is_premium() || ! $this->is_org_repo_compliant() );
|
177 |
-
}
|
178 |
-
|
179 |
-
#endregion
|
180 |
-
|
181 |
-
/**
|
182 |
-
* Check if user in trial or in free plan (not paying).
|
183 |
-
*
|
184 |
-
* @author Vova Feldman (@svovaf)
|
185 |
-
* @since 1.0.4
|
186 |
-
*
|
187 |
-
* @return bool
|
188 |
-
*/
|
189 |
-
function is_not_paying() {
|
190 |
-
return ( $this->is_trial() || $this->is_free_plan() );
|
191 |
-
}
|
192 |
-
|
193 |
-
/**
|
194 |
-
* Check if the user has an activated and valid paid license on current plugin's install.
|
195 |
-
*
|
196 |
-
* @since 1.0.9
|
197 |
-
*
|
198 |
-
* @return bool
|
199 |
-
*/
|
200 |
-
abstract function is_paying();
|
201 |
-
|
202 |
-
/**
|
203 |
-
* Check if the user is paying or in trial.
|
204 |
-
*
|
205 |
-
* @since 1.0.9
|
206 |
-
*
|
207 |
-
* @return bool
|
208 |
-
*/
|
209 |
-
function is_paying_or_trial() {
|
210 |
-
return ( $this->is_paying() || $this->is_trial() );
|
211 |
-
}
|
212 |
-
|
213 |
-
/**
|
214 |
-
* Check if user in a trial or have feature enabled license.
|
215 |
-
*
|
216 |
-
* @author Vova Feldman (@svovaf)
|
217 |
-
* @since 1.1.7
|
218 |
-
*
|
219 |
-
* @return bool
|
220 |
-
*/
|
221 |
-
abstract function can_use_premium_code();
|
222 |
-
|
223 |
-
#----------------------------------------------------------------------------------
|
224 |
-
#region Premium Only
|
225 |
-
#----------------------------------------------------------------------------------
|
226 |
-
|
227 |
-
/**
|
228 |
-
* All logic wrapped in methods with "__premium_only()" suffix will be only
|
229 |
-
* included in the premium code.
|
230 |
-
*
|
231 |
-
* Example:
|
232 |
-
* if ( freemius()->is__premium_only() ) {
|
233 |
-
* ...
|
234 |
-
* }
|
235 |
-
*/
|
236 |
-
|
237 |
-
/**
|
238 |
-
* Returns true when running premium plugin code.
|
239 |
-
*
|
240 |
-
* @since 1.0.9
|
241 |
-
*
|
242 |
-
* @return bool
|
243 |
-
*/
|
244 |
-
function is__premium_only() {
|
245 |
-
return $this->is_premium();
|
246 |
-
}
|
247 |
-
|
248 |
-
/**
|
249 |
-
* Check if the user has an activated and valid paid license on current plugin's install.
|
250 |
-
*
|
251 |
-
* @since 1.0.9
|
252 |
-
*
|
253 |
-
* @return bool
|
254 |
-
*
|
255 |
-
*/
|
256 |
-
function is_paying__premium_only() {
|
257 |
-
return ( $this->is__premium_only() && $this->is_paying() );
|
258 |
-
}
|
259 |
-
|
260 |
-
/**
|
261 |
-
* All code wrapped in this statement will be only included in the premium code.
|
262 |
-
*
|
263 |
-
* @since 1.0.9
|
264 |
-
*
|
265 |
-
* @param string $plan Plan name.
|
266 |
-
* @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
|
267 |
-
*
|
268 |
-
* @return bool
|
269 |
-
*/
|
270 |
-
function is_plan__premium_only( $plan, $exact = false ) {
|
271 |
-
return ( $this->is_premium() && $this->is_plan( $plan, $exact ) );
|
272 |
-
}
|
273 |
-
|
274 |
-
/**
|
275 |
-
* Check if plan matches active license' plan or active trial license' plan.
|
276 |
-
*
|
277 |
-
* All code wrapped in this statement will be only included in the premium code.
|
278 |
-
*
|
279 |
-
* @since 1.0.9
|
280 |
-
*
|
281 |
-
* @param string $plan Plan name.
|
282 |
-
* @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
|
283 |
-
*
|
284 |
-
* @return bool
|
285 |
-
*/
|
286 |
-
function is_plan_or_trial__premium_only( $plan, $exact = false ) {
|
287 |
-
return ( $this->is_premium() && $this->is_plan_or_trial( $plan, $exact ) );
|
288 |
-
}
|
289 |
-
|
290 |
-
/**
|
291 |
-
* Check if the user is paying or in trial.
|
292 |
-
*
|
293 |
-
* All code wrapped in this statement will be only included in the premium code.
|
294 |
-
*
|
295 |
-
* @since 1.0.9
|
296 |
-
*
|
297 |
-
* @return bool
|
298 |
-
*/
|
299 |
-
function is_paying_or_trial__premium_only() {
|
300 |
-
return $this->is_premium() && $this->is_paying_or_trial();
|
301 |
-
}
|
302 |
-
|
303 |
-
/**
|
304 |
-
* Check if the user has an activated and valid paid license on current plugin's install.
|
305 |
-
*
|
306 |
-
* @since 1.0.4
|
307 |
-
*
|
308 |
-
* @return bool
|
309 |
-
*
|
310 |
-
* @deprecated Method name is confusing since it's not clear from the name the code will be removed.
|
311 |
-
* @using Alias to is_paying__premium_only()
|
312 |
-
*/
|
313 |
-
function is_paying__fs__() {
|
314 |
-
return $this->is_paying__premium_only();
|
315 |
-
}
|
316 |
-
|
317 |
-
/**
|
318 |
-
* Check if user in a trial or have feature enabled license.
|
319 |
-
*
|
320 |
-
* All code wrapped in this statement will be only included in the premium code.
|
321 |
-
*
|
322 |
-
* @author Vova Feldman (@svovaf)
|
323 |
-
* @since 1.1.9
|
324 |
-
*
|
325 |
-
* @return bool
|
326 |
-
*/
|
327 |
-
function can_use_premium_code__premium_only() {
|
328 |
-
return $this->is_premium() && $this->can_use_premium_code();
|
329 |
-
}
|
330 |
-
|
331 |
-
#endregion
|
332 |
-
|
333 |
-
#----------------------------------------------------------------------------------
|
334 |
-
#region Trial
|
335 |
-
#----------------------------------------------------------------------------------
|
336 |
-
|
337 |
-
/**
|
338 |
-
* Check if the user in a trial.
|
339 |
-
*
|
340 |
-
* @since 1.0.3
|
341 |
-
*
|
342 |
-
* @return bool
|
343 |
-
*/
|
344 |
-
abstract function is_trial();
|
345 |
-
|
346 |
-
/**
|
347 |
-
* Check if trial already utilized.
|
348 |
-
*
|
349 |
-
* @since 1.0.9
|
350 |
-
*
|
351 |
-
* @return bool
|
352 |
-
*/
|
353 |
-
abstract function is_trial_utilized();
|
354 |
-
|
355 |
-
#endregion
|
356 |
-
|
357 |
-
#----------------------------------------------------------------------------------
|
358 |
-
#region Plans
|
359 |
-
#----------------------------------------------------------------------------------
|
360 |
-
|
361 |
-
/**
|
362 |
-
* Check if plugin using the free plan.
|
363 |
-
*
|
364 |
-
* @since 1.0.4
|
365 |
-
*
|
366 |
-
* @return bool
|
367 |
-
*/
|
368 |
-
abstract function is_free_plan();
|
369 |
-
|
370 |
-
/**
|
371 |
-
* @since 1.0.2
|
372 |
-
*
|
373 |
-
* @param string $plan Plan name.
|
374 |
-
* @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
|
375 |
-
*
|
376 |
-
* @return bool
|
377 |
-
*/
|
378 |
-
abstract function is_plan( $plan, $exact = false );
|
379 |
-
|
380 |
-
/**
|
381 |
-
* Check if plan based on trial. If not in trial mode, should return false.
|
382 |
-
*
|
383 |
-
* @since 1.0.9
|
384 |
-
*
|
385 |
-
* @param string $plan Plan name.
|
386 |
-
* @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
|
387 |
-
*
|
388 |
-
* @return bool
|
389 |
-
*/
|
390 |
-
abstract function is_trial_plan( $plan, $exact = false );
|
391 |
-
|
392 |
-
/**
|
393 |
-
* Check if plan matches active license' plan or active trial license' plan.
|
394 |
-
*
|
395 |
-
* @since 1.0.9
|
396 |
-
*
|
397 |
-
* @param string $plan Plan name.
|
398 |
-
* @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
|
399 |
-
*
|
400 |
-
* @return bool
|
401 |
-
*/
|
402 |
-
function is_plan_or_trial( $plan, $exact = false ) {
|
403 |
-
return $this->is_plan( $plan, $exact ) ||
|
404 |
-
$this->is_trial_plan( $plan, $exact );
|
405 |
-
}
|
406 |
-
|
407 |
-
/**
|
408 |
-
* Check if plugin has any paid plans.
|
409 |
-
*
|
410 |
-
* @author Vova Feldman (@svovaf)
|
411 |
-
* @since 1.0.7
|
412 |
-
*
|
413 |
-
* @return bool
|
414 |
-
*/
|
415 |
-
abstract function has_paid_plan();
|
416 |
-
|
417 |
-
/**
|
418 |
-
* Check if plugin has any free plan, or is it premium only.
|
419 |
-
*
|
420 |
-
* Note: If no plans configured, assume plugin is free.
|
421 |
-
*
|
422 |
-
* @author Vova Feldman (@svovaf)
|
423 |
-
* @since 1.0.7
|
424 |
-
*
|
425 |
-
* @return bool
|
426 |
-
*/
|
427 |
-
abstract function has_free_plan();
|
428 |
-
|
429 |
-
/**
|
430 |
-
* Check if plugin is premium only (no free plans).
|
431 |
-
*
|
432 |
-
* NOTE: is__premium_only() is very different method, don't get confused.
|
433 |
-
*
|
434 |
-
* @author Vova Feldman (@svovaf)
|
435 |
-
* @since 1.1.9
|
436 |
-
*
|
437 |
-
* @return bool
|
438 |
-
*/
|
439 |
-
abstract function is_only_premium();
|
440 |
-
|
441 |
-
/**
|
442 |
-
* Check if module has a premium code version.
|
443 |
-
*
|
444 |
-
* Serviceware module might be freemium without any
|
445 |
-
* premium code version, where the paid features
|
446 |
-
* are all part of the service.
|
447 |
-
*
|
448 |
-
* @author Vova Feldman (@svovaf)
|
449 |
-
* @since 1.2.1.6
|
450 |
-
*
|
451 |
-
* @return bool
|
452 |
-
*/
|
453 |
-
abstract function has_premium_version();
|
454 |
-
|
455 |
-
/**
|
456 |
-
* Check if module has any release on Freemius,
|
457 |
-
* or all plugin's code is on WordPress.org (Serviceware).
|
458 |
-
*
|
459 |
-
* @return bool
|
460 |
-
*/
|
461 |
-
function has_release_on_freemius() {
|
462 |
-
return ! $this->is_org_repo_compliant() ||
|
463 |
-
$this->has_premium_version();
|
464 |
-
}
|
465 |
-
|
466 |
-
/**
|
467 |
-
* Checks if it's a freemium plugin.
|
468 |
-
*
|
469 |
-
* @author Vova Feldman (@svovaf)
|
470 |
-
* @since 1.1.9
|
471 |
-
*
|
472 |
-
* @return bool
|
473 |
-
*/
|
474 |
-
function is_freemium() {
|
475 |
-
return $this->has_paid_plan() &&
|
476 |
-
$this->has_free_plan();
|
477 |
-
}
|
478 |
-
|
479 |
-
/**
|
480 |
-
* Check if module has only one plan.
|
481 |
-
*
|
482 |
-
* @author Vova Feldman (@svovaf)
|
483 |
-
* @since 1.2.1.7
|
484 |
-
*
|
485 |
-
* @return bool
|
486 |
-
*/
|
487 |
-
abstract function is_single_plan();
|
488 |
-
|
489 |
-
#endregion
|
490 |
-
|
491 |
-
/**
|
492 |
-
* Check if running payments in sandbox mode.
|
493 |
-
*
|
494 |
-
* @since 1.0.4
|
495 |
-
*
|
496 |
-
* @return bool
|
497 |
-
*/
|
498 |
-
abstract function is_payments_sandbox();
|
499 |
-
|
500 |
-
/**
|
501 |
-
* Check if running test vs. live plugin.
|
502 |
-
*
|
503 |
-
* @since 1.0.5
|
504 |
-
*
|
505 |
-
* @return bool
|
506 |
-
*/
|
507 |
-
abstract function is_live();
|
508 |
-
|
509 |
-
/**
|
510 |
-
* Check if running premium plugin code.
|
511 |
-
*
|
512 |
-
* @since 1.0.5
|
513 |
-
*
|
514 |
-
* @return bool
|
515 |
-
*/
|
516 |
-
abstract function is_premium();
|
517 |
-
|
518 |
-
/**
|
519 |
-
* Get upgrade URL.
|
520 |
-
*
|
521 |
-
* @author Vova Feldman (@svovaf)
|
522 |
-
* @since 1.0.2
|
523 |
-
*
|
524 |
-
* @param string $period Billing cycle.
|
525 |
-
*
|
526 |
-
* @return string
|
527 |
-
*/
|
528 |
-
abstract function get_upgrade_url( $period = WP_FS__PERIOD_ANNUALLY );
|
529 |
-
|
530 |
-
/**
|
531 |
-
* Check if Freemius was first added in a plugin update.
|
532 |
-
*
|
533 |
-
* @author Vova Feldman (@svovaf)
|
534 |
-
* @since 1.1.5
|
535 |
-
*
|
536 |
-
* @return bool
|
537 |
-
*/
|
538 |
-
function is_plugin_update() {
|
539 |
-
return ! $this->is_plugin_new_install();
|
540 |
-
}
|
541 |
-
|
542 |
-
/**
|
543 |
-
* Check if Freemius was part of the plugin when the user installed it first.
|
544 |
-
*
|
545 |
-
* @author Vova Feldman (@svovaf)
|
546 |
-
* @since 1.1.5
|
547 |
-
*
|
548 |
-
* @return bool
|
549 |
-
*/
|
550 |
-
abstract function is_plugin_new_install();
|
551 |
-
|
552 |
-
#----------------------------------------------------------------------------------
|
553 |
-
#region Marketing
|
554 |
-
#----------------------------------------------------------------------------------
|
555 |
-
|
556 |
-
/**
|
557 |
-
* Check if current user purchased any other plugins before.
|
558 |
-
*
|
559 |
-
* @author Vova Feldman (@svovaf)
|
560 |
-
* @since 1.0.9
|
561 |
-
*
|
562 |
-
* @return bool
|
563 |
-
*/
|
564 |
-
abstract function has_purchased_before();
|
565 |
-
|
566 |
-
/**
|
567 |
-
* Check if current user classified as an agency.
|
568 |
-
*
|
569 |
-
* @author Vova Feldman (@svovaf)
|
570 |
-
* @since 1.0.9
|
571 |
-
*
|
572 |
-
* @return bool
|
573 |
-
*/
|
574 |
-
abstract function is_agency();
|
575 |
-
|
576 |
-
/**
|
577 |
-
* Check if current user classified as a developer.
|
578 |
-
*
|
579 |
-
* @author Vova Feldman (@svovaf)
|
580 |
-
* @since 1.0.9
|
581 |
-
*
|
582 |
-
* @return bool
|
583 |
-
*/
|
584 |
-
abstract function is_developer();
|
585 |
-
|
586 |
-
/**
|
587 |
-
* Check if current user classified as a business.
|
588 |
-
*
|
589 |
-
* @author Vova Feldman (@svovaf)
|
590 |
-
* @since 1.0.9
|
591 |
-
*
|
592 |
-
* @return bool
|
593 |
-
*/
|
594 |
-
abstract function is_business();
|
595 |
-
|
596 |
-
#endregion
|
597 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.0.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 has connected his account (opted-in).
|
32 |
+
*
|
33 |
+
* Note:
|
34 |
+
* If the user opted-in and opted-out on a later stage,
|
35 |
+
* this will still return true. If you want to check if the
|
36 |
+
* user is currently opted-in, use:
|
37 |
+
* `$fs->is_registered() && $fs->is_tracking_allowed()`
|
38 |
+
*
|
39 |
+
* @since 1.0.1
|
40 |
+
* @return bool
|
41 |
+
*/
|
42 |
+
abstract function is_registered();
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Check if the user skipped connecting the account with Freemius.
|
46 |
+
*
|
47 |
+
* @since 1.0.7
|
48 |
+
*
|
49 |
+
* @return bool
|
50 |
+
*/
|
51 |
+
abstract function is_anonymous();
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Check if the user currently in activation mode.
|
55 |
+
*
|
56 |
+
* @since 1.0.7
|
57 |
+
*
|
58 |
+
* @return bool
|
59 |
+
*/
|
60 |
+
abstract function is_activation_mode();
|
61 |
+
|
62 |
+
#endregion
|
63 |
+
|
64 |
+
#----------------------------------------------------------------------------------
|
65 |
+
#region Usage Tracking
|
66 |
+
#----------------------------------------------------------------------------------
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Returns TRUE if the user opted-in and didn't disconnect (opt-out).
|
70 |
+
*
|
71 |
+
* @author Leo Fajardo (@leorw)
|
72 |
+
* @since 1.2.1.5
|
73 |
+
*
|
74 |
+
* @return bool
|
75 |
+
*/
|
76 |
+
abstract function is_tracking_allowed();
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Returns TRUE if the user never opted-in or manually opted-out.
|
80 |
+
*
|
81 |
+
* @author Vova Feldman (@svovaf)
|
82 |
+
* @since 1.2.1.5
|
83 |
+
*
|
84 |
+
* @return bool
|
85 |
+
*/
|
86 |
+
function is_tracking_prohibited() {
|
87 |
+
return ! $this->is_registered() || ! $this->is_tracking_allowed();
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Opt-out from usage tracking.
|
92 |
+
*
|
93 |
+
* Note: This will not delete the account information but will stop all tracking.
|
94 |
+
*
|
95 |
+
* Returns:
|
96 |
+
* 1. FALSE - If the user never opted-in.
|
97 |
+
* 2. TRUE - If successfully opted-out.
|
98 |
+
* 3. object - API Result on failure.
|
99 |
+
*
|
100 |
+
* @author Leo Fajardo (@leorw)
|
101 |
+
* @since 1.2.1.5
|
102 |
+
*
|
103 |
+
* @return bool|object
|
104 |
+
*/
|
105 |
+
abstract function stop_tracking();
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Opt-in back into usage tracking.
|
109 |
+
*
|
110 |
+
* Note: This will only work if the user opted-in previously.
|
111 |
+
*
|
112 |
+
* Returns:
|
113 |
+
* 1. FALSE - If the user never opted-in.
|
114 |
+
* 2. TRUE - If successfully opted-in back to usage tracking.
|
115 |
+
* 3. object - API result on failure.
|
116 |
+
*
|
117 |
+
* @author Leo Fajardo (@leorw)
|
118 |
+
* @since 1.2.1.5
|
119 |
+
*
|
120 |
+
* @return bool|object
|
121 |
+
*/
|
122 |
+
abstract function allow_tracking();
|
123 |
+
|
124 |
+
#endregion
|
125 |
+
|
126 |
+
#----------------------------------------------------------------------------------
|
127 |
+
#region Module Type
|
128 |
+
#----------------------------------------------------------------------------------
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Checks if the plugin's type is "plugin". The other type is "theme".
|
132 |
+
*
|
133 |
+
* @author Leo Fajardo (@leorw)
|
134 |
+
* @since 1.2.2
|
135 |
+
*
|
136 |
+
* @return bool
|
137 |
+
*/
|
138 |
+
abstract function is_plugin();
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Checks if the module type is "theme". The other type is "plugin".
|
142 |
+
*
|
143 |
+
* @author Leo Fajardo (@leorw)
|
144 |
+
* @since 1.2.2
|
145 |
+
*
|
146 |
+
* @return bool
|
147 |
+
*/
|
148 |
+
function is_theme() {
|
149 |
+
return ( ! $this->is_plugin() );
|
150 |
+
}
|
151 |
+
|
152 |
+
#endregion
|
153 |
+
|
154 |
+
#----------------------------------------------------------------------------------
|
155 |
+
#region Permissions
|
156 |
+
#----------------------------------------------------------------------------------
|
157 |
+
|
158 |
+
/**
|
159 |
+
* Check if plugin must be WordPress.org compliant.
|
160 |
+
*
|
161 |
+
* @since 1.0.7
|
162 |
+
*
|
163 |
+
* @return bool
|
164 |
+
*/
|
165 |
+
abstract function is_org_repo_compliant();
|
166 |
+
|
167 |
+
/**
|
168 |
+
* Check if plugin is allowed to install executable files.
|
169 |
+
*
|
170 |
+
* @author Vova Feldman (@svovaf)
|
171 |
+
* @since 1.0.5
|
172 |
+
*
|
173 |
+
* @return bool
|
174 |
+
*/
|
175 |
+
function is_allowed_to_install() {
|
176 |
+
return ( $this->is_premium() || ! $this->is_org_repo_compliant() );
|
177 |
+
}
|
178 |
+
|
179 |
+
#endregion
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Check if user in trial or in free plan (not paying).
|
183 |
+
*
|
184 |
+
* @author Vova Feldman (@svovaf)
|
185 |
+
* @since 1.0.4
|
186 |
+
*
|
187 |
+
* @return bool
|
188 |
+
*/
|
189 |
+
function is_not_paying() {
|
190 |
+
return ( $this->is_trial() || $this->is_free_plan() );
|
191 |
+
}
|
192 |
+
|
193 |
+
/**
|
194 |
+
* Check if the user has an activated and valid paid license on current plugin's install.
|
195 |
+
*
|
196 |
+
* @since 1.0.9
|
197 |
+
*
|
198 |
+
* @return bool
|
199 |
+
*/
|
200 |
+
abstract function is_paying();
|
201 |
+
|
202 |
+
/**
|
203 |
+
* Check if the user is paying or in trial.
|
204 |
+
*
|
205 |
+
* @since 1.0.9
|
206 |
+
*
|
207 |
+
* @return bool
|
208 |
+
*/
|
209 |
+
function is_paying_or_trial() {
|
210 |
+
return ( $this->is_paying() || $this->is_trial() );
|
211 |
+
}
|
212 |
+
|
213 |
+
/**
|
214 |
+
* Check if user in a trial or have feature enabled license.
|
215 |
+
*
|
216 |
+
* @author Vova Feldman (@svovaf)
|
217 |
+
* @since 1.1.7
|
218 |
+
*
|
219 |
+
* @return bool
|
220 |
+
*/
|
221 |
+
abstract function can_use_premium_code();
|
222 |
+
|
223 |
+
#----------------------------------------------------------------------------------
|
224 |
+
#region Premium Only
|
225 |
+
#----------------------------------------------------------------------------------
|
226 |
+
|
227 |
+
/**
|
228 |
+
* All logic wrapped in methods with "__premium_only()" suffix will be only
|
229 |
+
* included in the premium code.
|
230 |
+
*
|
231 |
+
* Example:
|
232 |
+
* if ( freemius()->is__premium_only() ) {
|
233 |
+
* ...
|
234 |
+
* }
|
235 |
+
*/
|
236 |
+
|
237 |
+
/**
|
238 |
+
* Returns true when running premium plugin code.
|
239 |
+
*
|
240 |
+
* @since 1.0.9
|
241 |
+
*
|
242 |
+
* @return bool
|
243 |
+
*/
|
244 |
+
function is__premium_only() {
|
245 |
+
return $this->is_premium();
|
246 |
+
}
|
247 |
+
|
248 |
+
/**
|
249 |
+
* Check if the user has an activated and valid paid license on current plugin's install.
|
250 |
+
*
|
251 |
+
* @since 1.0.9
|
252 |
+
*
|
253 |
+
* @return bool
|
254 |
+
*
|
255 |
+
*/
|
256 |
+
function is_paying__premium_only() {
|
257 |
+
return ( $this->is__premium_only() && $this->is_paying() );
|
258 |
+
}
|
259 |
+
|
260 |
+
/**
|
261 |
+
* All code wrapped in this statement will be only included in the premium code.
|
262 |
+
*
|
263 |
+
* @since 1.0.9
|
264 |
+
*
|
265 |
+
* @param string $plan Plan name.
|
266 |
+
* @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
|
267 |
+
*
|
268 |
+
* @return bool
|
269 |
+
*/
|
270 |
+
function is_plan__premium_only( $plan, $exact = false ) {
|
271 |
+
return ( $this->is_premium() && $this->is_plan( $plan, $exact ) );
|
272 |
+
}
|
273 |
+
|
274 |
+
/**
|
275 |
+
* Check if plan matches active license' plan or active trial license' plan.
|
276 |
+
*
|
277 |
+
* All code wrapped in this statement will be only included in the premium code.
|
278 |
+
*
|
279 |
+
* @since 1.0.9
|
280 |
+
*
|
281 |
+
* @param string $plan Plan name.
|
282 |
+
* @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
|
283 |
+
*
|
284 |
+
* @return bool
|
285 |
+
*/
|
286 |
+
function is_plan_or_trial__premium_only( $plan, $exact = false ) {
|
287 |
+
return ( $this->is_premium() && $this->is_plan_or_trial( $plan, $exact ) );
|
288 |
+
}
|
289 |
+
|
290 |
+
/**
|
291 |
+
* Check if the user is paying or in trial.
|
292 |
+
*
|
293 |
+
* All code wrapped in this statement will be only included in the premium code.
|
294 |
+
*
|
295 |
+
* @since 1.0.9
|
296 |
+
*
|
297 |
+
* @return bool
|
298 |
+
*/
|
299 |
+
function is_paying_or_trial__premium_only() {
|
300 |
+
return $this->is_premium() && $this->is_paying_or_trial();
|
301 |
+
}
|
302 |
+
|
303 |
+
/**
|
304 |
+
* Check if the user has an activated and valid paid license on current plugin's install.
|
305 |
+
*
|
306 |
+
* @since 1.0.4
|
307 |
+
*
|
308 |
+
* @return bool
|
309 |
+
*
|
310 |
+
* @deprecated Method name is confusing since it's not clear from the name the code will be removed.
|
311 |
+
* @using Alias to is_paying__premium_only()
|
312 |
+
*/
|
313 |
+
function is_paying__fs__() {
|
314 |
+
return $this->is_paying__premium_only();
|
315 |
+
}
|
316 |
+
|
317 |
+
/**
|
318 |
+
* Check if user in a trial or have feature enabled license.
|
319 |
+
*
|
320 |
+
* All code wrapped in this statement will be only included in the premium code.
|
321 |
+
*
|
322 |
+
* @author Vova Feldman (@svovaf)
|
323 |
+
* @since 1.1.9
|
324 |
+
*
|
325 |
+
* @return bool
|
326 |
+
*/
|
327 |
+
function can_use_premium_code__premium_only() {
|
328 |
+
return $this->is_premium() && $this->can_use_premium_code();
|
329 |
+
}
|
330 |
+
|
331 |
+
#endregion
|
332 |
+
|
333 |
+
#----------------------------------------------------------------------------------
|
334 |
+
#region Trial
|
335 |
+
#----------------------------------------------------------------------------------
|
336 |
+
|
337 |
+
/**
|
338 |
+
* Check if the user in a trial.
|
339 |
+
*
|
340 |
+
* @since 1.0.3
|
341 |
+
*
|
342 |
+
* @return bool
|
343 |
+
*/
|
344 |
+
abstract function is_trial();
|
345 |
+
|
346 |
+
/**
|
347 |
+
* Check if trial already utilized.
|
348 |
+
*
|
349 |
+
* @since 1.0.9
|
350 |
+
*
|
351 |
+
* @return bool
|
352 |
+
*/
|
353 |
+
abstract function is_trial_utilized();
|
354 |
+
|
355 |
+
#endregion
|
356 |
+
|
357 |
+
#----------------------------------------------------------------------------------
|
358 |
+
#region Plans
|
359 |
+
#----------------------------------------------------------------------------------
|
360 |
+
|
361 |
+
/**
|
362 |
+
* Check if plugin using the free plan.
|
363 |
+
*
|
364 |
+
* @since 1.0.4
|
365 |
+
*
|
366 |
+
* @return bool
|
367 |
+
*/
|
368 |
+
abstract function is_free_plan();
|
369 |
+
|
370 |
+
/**
|
371 |
+
* @since 1.0.2
|
372 |
+
*
|
373 |
+
* @param string $plan Plan name.
|
374 |
+
* @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
|
375 |
+
*
|
376 |
+
* @return bool
|
377 |
+
*/
|
378 |
+
abstract function is_plan( $plan, $exact = false );
|
379 |
+
|
380 |
+
/**
|
381 |
+
* Check if plan based on trial. If not in trial mode, should return false.
|
382 |
+
*
|
383 |
+
* @since 1.0.9
|
384 |
+
*
|
385 |
+
* @param string $plan Plan name.
|
386 |
+
* @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
|
387 |
+
*
|
388 |
+
* @return bool
|
389 |
+
*/
|
390 |
+
abstract function is_trial_plan( $plan, $exact = false );
|
391 |
+
|
392 |
+
/**
|
393 |
+
* Check if plan matches active license' plan or active trial license' plan.
|
394 |
+
*
|
395 |
+
* @since 1.0.9
|
396 |
+
*
|
397 |
+
* @param string $plan Plan name.
|
398 |
+
* @param bool $exact If true, looks for exact plan. If false, also check "higher" plans.
|
399 |
+
*
|
400 |
+
* @return bool
|
401 |
+
*/
|
402 |
+
function is_plan_or_trial( $plan, $exact = false ) {
|
403 |
+
return $this->is_plan( $plan, $exact ) ||
|
404 |
+
$this->is_trial_plan( $plan, $exact );
|
405 |
+
}
|
406 |
+
|
407 |
+
/**
|
408 |
+
* Check if plugin has any paid plans.
|
409 |
+
*
|
410 |
+
* @author Vova Feldman (@svovaf)
|
411 |
+
* @since 1.0.7
|
412 |
+
*
|
413 |
+
* @return bool
|
414 |
+
*/
|
415 |
+
abstract function has_paid_plan();
|
416 |
+
|
417 |
+
/**
|
418 |
+
* Check if plugin has any free plan, or is it premium only.
|
419 |
+
*
|
420 |
+
* Note: If no plans configured, assume plugin is free.
|
421 |
+
*
|
422 |
+
* @author Vova Feldman (@svovaf)
|
423 |
+
* @since 1.0.7
|
424 |
+
*
|
425 |
+
* @return bool
|
426 |
+
*/
|
427 |
+
abstract function has_free_plan();
|
428 |
+
|
429 |
+
/**
|
430 |
+
* Check if plugin is premium only (no free plans).
|
431 |
+
*
|
432 |
+
* NOTE: is__premium_only() is very different method, don't get confused.
|
433 |
+
*
|
434 |
+
* @author Vova Feldman (@svovaf)
|
435 |
+
* @since 1.1.9
|
436 |
+
*
|
437 |
+
* @return bool
|
438 |
+
*/
|
439 |
+
abstract function is_only_premium();
|
440 |
+
|
441 |
+
/**
|
442 |
+
* Check if module has a premium code version.
|
443 |
+
*
|
444 |
+
* Serviceware module might be freemium without any
|
445 |
+
* premium code version, where the paid features
|
446 |
+
* are all part of the service.
|
447 |
+
*
|
448 |
+
* @author Vova Feldman (@svovaf)
|
449 |
+
* @since 1.2.1.6
|
450 |
+
*
|
451 |
+
* @return bool
|
452 |
+
*/
|
453 |
+
abstract function has_premium_version();
|
454 |
+
|
455 |
+
/**
|
456 |
+
* Check if module has any release on Freemius,
|
457 |
+
* or all plugin's code is on WordPress.org (Serviceware).
|
458 |
+
*
|
459 |
+
* @return bool
|
460 |
+
*/
|
461 |
+
function has_release_on_freemius() {
|
462 |
+
return ! $this->is_org_repo_compliant() ||
|
463 |
+
$this->has_premium_version();
|
464 |
+
}
|
465 |
+
|
466 |
+
/**
|
467 |
+
* Checks if it's a freemium plugin.
|
468 |
+
*
|
469 |
+
* @author Vova Feldman (@svovaf)
|
470 |
+
* @since 1.1.9
|
471 |
+
*
|
472 |
+
* @return bool
|
473 |
+
*/
|
474 |
+
function is_freemium() {
|
475 |
+
return $this->has_paid_plan() &&
|
476 |
+
$this->has_free_plan();
|
477 |
+
}
|
478 |
+
|
479 |
+
/**
|
480 |
+
* Check if module has only one plan.
|
481 |
+
*
|
482 |
+
* @author Vova Feldman (@svovaf)
|
483 |
+
* @since 1.2.1.7
|
484 |
+
*
|
485 |
+
* @return bool
|
486 |
+
*/
|
487 |
+
abstract function is_single_plan();
|
488 |
+
|
489 |
+
#endregion
|
490 |
+
|
491 |
+
/**
|
492 |
+
* Check if running payments in sandbox mode.
|
493 |
+
*
|
494 |
+
* @since 1.0.4
|
495 |
+
*
|
496 |
+
* @return bool
|
497 |
+
*/
|
498 |
+
abstract function is_payments_sandbox();
|
499 |
+
|
500 |
+
/**
|
501 |
+
* Check if running test vs. live plugin.
|
502 |
+
*
|
503 |
+
* @since 1.0.5
|
504 |
+
*
|
505 |
+
* @return bool
|
506 |
+
*/
|
507 |
+
abstract function is_live();
|
508 |
+
|
509 |
+
/**
|
510 |
+
* Check if running premium plugin code.
|
511 |
+
*
|
512 |
+
* @since 1.0.5
|
513 |
+
*
|
514 |
+
* @return bool
|
515 |
+
*/
|
516 |
+
abstract function is_premium();
|
517 |
+
|
518 |
+
/**
|
519 |
+
* Get upgrade URL.
|
520 |
+
*
|
521 |
+
* @author Vova Feldman (@svovaf)
|
522 |
+
* @since 1.0.2
|
523 |
+
*
|
524 |
+
* @param string $period Billing cycle.
|
525 |
+
*
|
526 |
+
* @return string
|
527 |
+
*/
|
528 |
+
abstract function get_upgrade_url( $period = WP_FS__PERIOD_ANNUALLY );
|
529 |
+
|
530 |
+
/**
|
531 |
+
* Check if Freemius was first added in a plugin update.
|
532 |
+
*
|
533 |
+
* @author Vova Feldman (@svovaf)
|
534 |
+
* @since 1.1.5
|
535 |
+
*
|
536 |
+
* @return bool
|
537 |
+
*/
|
538 |
+
function is_plugin_update() {
|
539 |
+
return ! $this->is_plugin_new_install();
|
540 |
+
}
|
541 |
+
|
542 |
+
/**
|
543 |
+
* Check if Freemius was part of the plugin when the user installed it first.
|
544 |
+
*
|
545 |
+
* @author Vova Feldman (@svovaf)
|
546 |
+
* @since 1.1.5
|
547 |
+
*
|
548 |
+
* @return bool
|
549 |
+
*/
|
550 |
+
abstract function is_plugin_new_install();
|
551 |
+
|
552 |
+
#----------------------------------------------------------------------------------
|
553 |
+
#region Marketing
|
554 |
+
#----------------------------------------------------------------------------------
|
555 |
+
|
556 |
+
/**
|
557 |
+
* Check if current user purchased any other plugins before.
|
558 |
+
*
|
559 |
+
* @author Vova Feldman (@svovaf)
|
560 |
+
* @since 1.0.9
|
561 |
+
*
|
562 |
+
* @return bool
|
563 |
+
*/
|
564 |
+
abstract function has_purchased_before();
|
565 |
+
|
566 |
+
/**
|
567 |
+
* Check if current user classified as an agency.
|
568 |
+
*
|
569 |
+
* @author Vova Feldman (@svovaf)
|
570 |
+
* @since 1.0.9
|
571 |
+
*
|
572 |
+
* @return bool
|
573 |
+
*/
|
574 |
+
abstract function is_agency();
|
575 |
+
|
576 |
+
/**
|
577 |
+
* Check if current user classified as a developer.
|
578 |
+
*
|
579 |
+
* @author Vova Feldman (@svovaf)
|
580 |
+
* @since 1.0.9
|
581 |
+
*
|
582 |
+
* @return bool
|
583 |
+
*/
|
584 |
+
abstract function is_developer();
|
585 |
+
|
586 |
+
/**
|
587 |
+
* Check if current user classified as a business.
|
588 |
+
*
|
589 |
+
* @author Vova Feldman (@svovaf)
|
590 |
+
* @since 1.0.9
|
591 |
+
*
|
592 |
+
* @return bool
|
593 |
+
*/
|
594 |
+
abstract function is_business();
|
595 |
+
|
596 |
+
#endregion
|
597 |
}
|
freemius/includes/class-freemius.php
CHANGED
@@ -271,6 +271,33 @@
|
|
271 |
*/
|
272 |
private static $_instances = array();
|
273 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
#region Uninstall Reasons IDs
|
275 |
|
276 |
const REASON_NO_LONGER_NEEDED = 1;
|
@@ -528,6 +555,18 @@
|
|
528 |
return;
|
529 |
}
|
530 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
531 |
if ( version_compare( $sdk_prev_version, '1.1.5', '<' ) &&
|
532 |
version_compare( $sdk_version, '1.1.5', '>=' )
|
533 |
) {
|
@@ -551,6 +590,46 @@
|
|
551 |
}
|
552 |
}
|
553 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
554 |
/**
|
555 |
* @author Vova Feldman (@svovaf)
|
556 |
* @since 1.2.2.7
|
@@ -732,6 +811,8 @@
|
|
732 |
'_install_premium_version_ajax_action'
|
733 |
) );
|
734 |
|
|
|
|
|
735 |
$this->add_action( 'after_plans_sync', array( &$this, '_check_for_trial_plans' ) );
|
736 |
|
737 |
$this->add_action( 'sdk_version_update', array( &$this, '_data_migration' ), WP_FS__DEFAULT_PRIORITY, 2 );
|
@@ -739,6 +820,7 @@
|
|
739 |
$this->add_filter( 'after_code_type_change', array( &$this, '_after_code_type_change' ) );
|
740 |
|
741 |
add_action( 'admin_init', array( &$this, '_add_trial_notice' ) );
|
|
|
742 |
add_action( 'admin_init', array( &$this, '_enqueue_common_css' ) );
|
743 |
|
744 |
/**
|
@@ -844,8 +926,11 @@
|
|
844 |
// Try to load the cached value of the file path.
|
845 |
if ( isset( $this->_storage->plugin_main_file ) ) {
|
846 |
$plugin_main_file = $this->_storage->plugin_main_file;
|
847 |
-
|
848 |
-
|
|
|
|
|
|
|
849 |
}
|
850 |
}
|
851 |
|
@@ -864,20 +949,20 @@
|
|
864 |
if ( isset( $this->_storage->plugin_main_file ) &&
|
865 |
isset( $this->_storage->plugin_main_file->prev_path )
|
866 |
) {
|
867 |
-
|
868 |
-
|
|
|
869 |
}
|
870 |
}
|
871 |
|
872 |
wp_die(
|
873 |
-
$this->
|
874 |
" Module: {$this->_slug}; SDK: " . WP_FS__SDK_VERSION . ";",
|
875 |
-
$this->
|
876 |
array( 'back_link' => true )
|
877 |
);
|
878 |
}
|
879 |
|
880 |
-
|
881 |
//Fix for migration issues.
|
882 |
if ('ti-woocommerce-wishlist' === $this->_slug) {
|
883 |
return TINVWL_PATH . 'ti-woocommerce-wishlist.php';
|
@@ -894,8 +979,61 @@
|
|
894 |
'path' => $id_slug_type_path_map[ $this->_module_id ]['path'],
|
895 |
);
|
896 |
|
897 |
-
return $id_slug_type_path_map[ $this->_module_id ]['path'];
|
898 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
899 |
|
900 |
/**
|
901 |
* @author Leo Fajardo (@leorw)
|
@@ -918,7 +1056,19 @@
|
|
918 |
$store_option = true;
|
919 |
}
|
920 |
|
921 |
-
if ( ! isset( $id_slug_type_path_map[ $module_id ]['path'] )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
922 |
$caller_main_file_and_type = $this->get_caller_main_file_and_type();
|
923 |
|
924 |
$id_slug_type_path_map[ $module_id ]['type'] = $caller_main_file_and_type->module_type;
|
@@ -1008,8 +1158,18 @@
|
|
1008 |
*/
|
1009 |
|
1010 |
if ( $caller_file_path == fs_normalize_path( realpath( trailingslashit( $themes_dir ) . basename( dirname( $caller_file_path ) ) . '/' . basename( $caller_file_path ) ) ) ) {
|
1011 |
-
$module_type
|
1012 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1013 |
continue;
|
1014 |
}
|
1015 |
}
|
@@ -1027,7 +1187,7 @@
|
|
1027 |
|
1028 |
if ( isset( $caller_map[ $caller_file_hash ] ) ) {
|
1029 |
$module_type = WP_FS__MODULE_TYPE_PLUGIN;
|
1030 |
-
$caller_file_candidate = $caller_map[ $caller_file_hash ];
|
1031 |
}
|
1032 |
}
|
1033 |
|
@@ -1119,18 +1279,18 @@
|
|
1119 |
|
1120 |
$reason_found_better_plugin = array(
|
1121 |
'id' => self::REASON_FOUND_A_BETTER_PLUGIN,
|
1122 |
-
'text' => sprintf( $this->
|
1123 |
'input_type' => 'textfield',
|
1124 |
-
'input_placeholder' => sprintf( $this->
|
1125 |
);
|
1126 |
|
1127 |
$reason_temporary_deactivation = array(
|
1128 |
'id' => self::REASON_TEMPORARY_DEACTIVATION,
|
1129 |
'text' => sprintf(
|
1130 |
-
$this->
|
1131 |
strtolower( $this->is_plugin() ?
|
1132 |
-
$this->
|
1133 |
-
$this->
|
1134 |
)
|
1135 |
),
|
1136 |
'input_type' => '',
|
@@ -1139,7 +1299,7 @@
|
|
1139 |
|
1140 |
$reason_other = array(
|
1141 |
'id' => self::REASON_OTHER,
|
1142 |
-
'text' => $this->
|
1143 |
'input_type' => 'textfield',
|
1144 |
'input_placeholder' => ''
|
1145 |
);
|
@@ -1147,27 +1307,27 @@
|
|
1147 |
$long_term_user_reasons = array(
|
1148 |
array(
|
1149 |
'id' => self::REASON_NO_LONGER_NEEDED,
|
1150 |
-
'text' => sprintf( $this->
|
1151 |
'input_type' => '',
|
1152 |
'input_placeholder' => ''
|
1153 |
),
|
1154 |
$reason_found_better_plugin,
|
1155 |
array(
|
1156 |
'id' => self::REASON_NEEDED_FOR_A_SHORT_PERIOD,
|
1157 |
-
'text' => sprintf( $this->
|
1158 |
'input_type' => '',
|
1159 |
'input_placeholder' => ''
|
1160 |
),
|
1161 |
array(
|
1162 |
'id' => self::REASON_BROKE_MY_SITE,
|
1163 |
-
'text' => sprintf( $this->
|
1164 |
'input_type' => '',
|
1165 |
'input_placeholder' => '',
|
1166 |
'internal_message' => $contact_support_template
|
1167 |
),
|
1168 |
array(
|
1169 |
'id' => self::REASON_SUDDENLY_STOPPED_WORKING,
|
1170 |
-
'text' => sprintf( $this->
|
1171 |
'input_type' => '',
|
1172 |
'input_placeholder' => '',
|
1173 |
'internal_message' => $contact_support_template
|
@@ -1177,15 +1337,15 @@
|
|
1177 |
if ( $this->is_paying() ) {
|
1178 |
$long_term_user_reasons[] = array(
|
1179 |
'id' => self::REASON_CANT_PAY_ANYMORE,
|
1180 |
-
'text' => $this->
|
1181 |
'input_type' => 'textfield',
|
1182 |
-
'input_placeholder' => $this->
|
1183 |
);
|
1184 |
}
|
1185 |
|
1186 |
$reason_dont_share_info = array(
|
1187 |
'id' => self::REASON_DONT_LIKE_TO_SHARE_MY_INFORMATION,
|
1188 |
-
'text' => $this->
|
1189 |
'input_type' => '',
|
1190 |
'input_placeholder' => ''
|
1191 |
);
|
@@ -1206,7 +1366,7 @@
|
|
1206 |
'non-registered-and-non-anonymous-short-term' => array(
|
1207 |
array(
|
1208 |
'id' => self::REASON_DIDNT_WORK,
|
1209 |
-
'text' => sprintf( $this->
|
1210 |
'input_type' => '',
|
1211 |
'input_placeholder' => ''
|
1212 |
),
|
@@ -1216,7 +1376,7 @@
|
|
1216 |
'short-term' => array(
|
1217 |
array(
|
1218 |
'id' => self::REASON_COULDNT_MAKE_IT_WORK,
|
1219 |
-
'text' => $this->
|
1220 |
'input_type' => '',
|
1221 |
'input_placeholder' => '',
|
1222 |
'internal_message' => $contact_support_template
|
@@ -1224,27 +1384,27 @@
|
|
1224 |
$reason_found_better_plugin,
|
1225 |
array(
|
1226 |
'id' => self::REASON_GREAT_BUT_NEED_SPECIFIC_FEATURE,
|
1227 |
-
'text' => sprintf( $this->
|
1228 |
'input_type' => 'textarea',
|
1229 |
-
'input_placeholder' => $this->
|
1230 |
),
|
1231 |
array(
|
1232 |
'id' => self::REASON_NOT_WORKING,
|
1233 |
-
'text' => sprintf( $this->
|
1234 |
'input_type' => 'textarea',
|
1235 |
-
'input_placeholder' => $this->
|
1236 |
),
|
1237 |
array(
|
1238 |
'id' => self::REASON_NOT_WHAT_I_WAS_LOOKING_FOR,
|
1239 |
-
'text' => $this->
|
1240 |
'input_type' => 'textarea',
|
1241 |
-
'input_placeholder' => $this->
|
1242 |
),
|
1243 |
array(
|
1244 |
'id' => self::REASON_DIDNT_WORK_AS_EXPECTED,
|
1245 |
-
'text' => sprintf( $this->
|
1246 |
'input_type' => 'textarea',
|
1247 |
-
'input_placeholder' => $this->
|
1248 |
)
|
1249 |
)
|
1250 |
);
|
@@ -1780,7 +1940,7 @@
|
|
1780 |
|
1781 |
self::$_static_logger->entrance();
|
1782 |
|
1783 |
-
$title = sprintf( '%s [v.%s]',
|
1784 |
|
1785 |
if ( WP_FS__DEV_MODE ) {
|
1786 |
// Add top-level debug menu item.
|
@@ -2187,29 +2347,36 @@
|
|
2187 |
*
|
2188 |
* @return string
|
2189 |
*/
|
2190 |
-
|
2191 |
-
|
2192 |
|
2193 |
-
|
2194 |
-
|
2195 |
|
2196 |
-
|
2197 |
-
|
2198 |
-
|
2199 |
-
|
2200 |
-
|
2201 |
-
|
2202 |
-
|
2203 |
|
2204 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2205 |
|
2206 |
-
|
2207 |
-
|
2208 |
|
2209 |
-
|
2210 |
|
2211 |
-
|
2212 |
-
|
2213 |
|
2214 |
/**
|
2215 |
* @author Vova Feldman (@svovaf)
|
@@ -2289,6 +2456,18 @@
|
|
2289 |
// $admin_email = get_option( 'admin_email' );
|
2290 |
$admin_email = $current_user->user_email;
|
2291 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2292 |
$message = false;
|
2293 |
if ( is_object( $api_result ) &&
|
2294 |
isset( $api_result->error ) &&
|
@@ -2315,15 +2494,15 @@
|
|
2315 |
if ( ! empty( $missing_methods ) ) {
|
2316 |
$missing_methods = sprintf(
|
2317 |
'<br><br><b>%s</b> %s',
|
2318 |
-
$this->
|
2319 |
$missing_methods
|
2320 |
);
|
2321 |
}
|
2322 |
}
|
2323 |
|
2324 |
$message = sprintf(
|
2325 |
-
|
2326 |
-
$this->
|
2327 |
$missing_methods .
|
2328 |
' %s',
|
2329 |
'<b>' . $this->get_plugin_name() . '</b>',
|
@@ -2331,95 +2510,95 @@
|
|
2331 |
'<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
|
2332 |
sprintf(
|
2333 |
'<a class="fs-resolve" data-type="curl" href="#"><b>%s</b></a>%s',
|
2334 |
-
$this->
|
2335 |
' - ' . sprintf(
|
2336 |
-
$this->
|
2337 |
'<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
|
2338 |
)
|
2339 |
),
|
2340 |
sprintf(
|
2341 |
'<b>%s</b> - %s',
|
2342 |
-
|
2343 |
-
sprintf( $this->
|
2344 |
),
|
2345 |
sprintf(
|
2346 |
-
'<a href="%s"><b>%s</b></a
|
2347 |
-
wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=
|
2348 |
-
$
|
2349 |
-
|
2350 |
)
|
2351 |
)
|
2352 |
);
|
2353 |
break;
|
2354 |
case 'cloudflare_ddos_protection':
|
2355 |
$message = sprintf(
|
2356 |
-
|
2357 |
-
$this->
|
2358 |
-
|
2359 |
' %s',
|
2360 |
'<b>' . $this->get_plugin_name() . '</b>',
|
2361 |
sprintf(
|
2362 |
'<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
|
2363 |
sprintf(
|
2364 |
'<a class="fs-resolve" data-type="cloudflare" href="#"><b>%s</b></a>%s',
|
2365 |
-
$
|
2366 |
' - ' . sprintf(
|
2367 |
-
$
|
2368 |
'<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
|
2369 |
)
|
2370 |
),
|
2371 |
sprintf(
|
2372 |
-
'<a href="%s" target="_blank"><b>%s</b></a
|
2373 |
sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ),
|
2374 |
-
$
|
2375 |
-
|
2376 |
),
|
2377 |
sprintf(
|
2378 |
-
'<a href="%s"><b>%s</b></a
|
2379 |
-
wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=
|
2380 |
-
$
|
2381 |
-
|
2382 |
)
|
2383 |
)
|
2384 |
);
|
2385 |
break;
|
2386 |
case 'squid_cache_block':
|
2387 |
$message = sprintf(
|
2388 |
-
|
2389 |
-
$this->
|
2390 |
' %s',
|
2391 |
'<b>' . $this->get_plugin_name() . '</b>',
|
2392 |
sprintf(
|
2393 |
'<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
|
2394 |
sprintf(
|
2395 |
-
'<a class="fs-resolve" data-type="squid" href="#"><b>%s</b></a
|
2396 |
-
$this->
|
2397 |
-
|
2398 |
-
$this->
|
2399 |
'<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
|
2400 |
)
|
2401 |
),
|
2402 |
sprintf(
|
2403 |
'<b>%s</b> - %s',
|
2404 |
-
|
2405 |
sprintf(
|
2406 |
-
$this->
|
2407 |
// We use a filter since the plugin might require additional API connectivity.
|
2408 |
'<b>' . implode( ', ', $this->apply_filters( 'api_domains', array( 'api.freemius.com', 'wp.freemius.com' ) ) ) . '</b>',
|
2409 |
$this->_module_type
|
2410 |
)
|
2411 |
),
|
2412 |
sprintf(
|
2413 |
-
'<a href="%s"><b>%s</b></a
|
2414 |
-
wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=
|
2415 |
-
$
|
2416 |
-
|
2417 |
)
|
2418 |
)
|
2419 |
);
|
2420 |
break;
|
2421 |
// default:
|
2422 |
-
// $message = $this->
|
2423 |
// break;
|
2424 |
}
|
2425 |
}
|
@@ -2427,25 +2606,27 @@
|
|
2427 |
$message_id = 'failed_connect_api';
|
2428 |
$type = 'error';
|
2429 |
|
|
|
|
|
2430 |
if ( false === $message ) {
|
2431 |
if ( $is_first_failure ) {
|
2432 |
// First attempt failed.
|
2433 |
$message = sprintf(
|
2434 |
-
|
2435 |
-
|
2436 |
-
$this->
|
2437 |
'%s',
|
2438 |
'<b>' . $this->get_plugin_name() . '</b>',
|
2439 |
sprintf(
|
2440 |
'<div id="fs_firewall_issue_options">%s %s</div>',
|
2441 |
sprintf(
|
2442 |
'<a class="button button-primary fs-resolve" data-type="retry_ping" href="#">%s</a>',
|
2443 |
-
$this->
|
2444 |
),
|
2445 |
sprintf(
|
2446 |
'<a href="%s" class="button">%s</a>',
|
2447 |
-
wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=
|
2448 |
-
$this->
|
2449 |
)
|
2450 |
)
|
2451 |
);
|
@@ -2455,32 +2636,32 @@
|
|
2455 |
} else {
|
2456 |
// Second connectivity attempt failed.
|
2457 |
$message = sprintf(
|
2458 |
-
|
2459 |
-
|
2460 |
-
|
2461 |
' %s',
|
2462 |
'<b>' . $this->get_plugin_name() . '</b>',
|
2463 |
sprintf(
|
2464 |
'<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
|
2465 |
sprintf(
|
2466 |
'<a class="fs-resolve" data-type="general" href="#"><b>%s</b></a>%s',
|
2467 |
-
$
|
2468 |
' - ' . sprintf(
|
2469 |
-
$
|
2470 |
'<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
|
2471 |
)
|
2472 |
),
|
2473 |
sprintf(
|
2474 |
-
'<a href="%s" target="_blank"><b>%s</b></a
|
2475 |
sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ),
|
2476 |
-
$
|
2477 |
-
|
2478 |
),
|
2479 |
sprintf(
|
2480 |
-
'<a href="%s"><b>%s</b></a
|
2481 |
-
wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=
|
2482 |
-
$
|
2483 |
-
|
2484 |
)
|
2485 |
)
|
2486 |
);
|
@@ -2490,7 +2671,7 @@
|
|
2490 |
$this->_admin_notices->add_sticky(
|
2491 |
$message,
|
2492 |
$message_id,
|
2493 |
-
$this->
|
2494 |
$type
|
2495 |
);
|
2496 |
}
|
@@ -2557,7 +2738,7 @@
|
|
2557 |
|
2558 |
$this->_admin_notices->add_sticky(
|
2559 |
sprintf(
|
2560 |
-
$this->
|
2561 |
'<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
|
2562 |
),
|
2563 |
'server_details_sent'
|
@@ -2948,10 +3129,10 @@
|
|
2948 |
|
2949 |
$this->_admin_notices->add(
|
2950 |
( ! empty( $parent_name ) ?
|
2951 |
-
sprintf( $this->
|
2952 |
-
sprintf( $this->
|
2953 |
),
|
2954 |
-
$this->
|
2955 |
'error'
|
2956 |
);
|
2957 |
|
@@ -3070,7 +3251,7 @@
|
|
3070 |
$this->_logger->api_error( $result );
|
3071 |
|
3072 |
self::shoot_ajax_failure(
|
3073 |
-
$this->
|
3074 |
( $this->is_api_error( $result ) && isset( $result->error ) ?
|
3075 |
$result->error->message :
|
3076 |
var_export( $result, true ) )
|
@@ -3095,7 +3276,7 @@
|
|
3095 |
$this->_logger->api_error( $result );
|
3096 |
|
3097 |
self::shoot_ajax_failure(
|
3098 |
-
$this->
|
3099 |
( $this->is_api_error( $result ) && isset( $result->error ) ?
|
3100 |
$result->error->message :
|
3101 |
var_export( $result, true ) )
|
@@ -3282,17 +3463,17 @@
|
|
3282 |
new FS_Plugin();
|
3283 |
|
3284 |
$plugin->update( array(
|
3285 |
-
'id'
|
3286 |
-
'
|
3287 |
-
'
|
3288 |
-
'
|
3289 |
-
'
|
3290 |
-
'
|
3291 |
-
'
|
3292 |
-
'
|
3293 |
-
'
|
3294 |
-
'
|
3295 |
-
|
3296 |
) );
|
3297 |
|
3298 |
if ( $plugin->is_updated() ) {
|
@@ -3501,11 +3682,14 @@
|
|
3501 |
'license_activated',
|
3502 |
) );
|
3503 |
|
3504 |
-
$this->
|
3505 |
-
|
3506 |
-
|
3507 |
-
|
3508 |
-
|
|
|
|
|
|
|
3509 |
} else {
|
3510 |
// Remove sticky message related to premium code activation.
|
3511 |
$this->_admin_notices->remove_sticky( 'premium_activated' );
|
@@ -3516,11 +3700,12 @@
|
|
3516 |
if ( $this->is_paying() && ! $this->is_premium() ) {
|
3517 |
$this->_admin_notices->add_sticky(
|
3518 |
sprintf(
|
3519 |
-
|
|
|
3520 |
$this->_site->plan->title
|
3521 |
) . $this->get_complete_upgrade_instructions(),
|
3522 |
'plan_upgraded',
|
3523 |
-
$this->
|
3524 |
);
|
3525 |
}
|
3526 |
}
|
@@ -3783,19 +3968,25 @@
|
|
3783 |
|
3784 |
$this->_parent->_admin_notices->add_sticky(
|
3785 |
sprintf(
|
3786 |
-
|
3787 |
-
|
3788 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
3789 |
),
|
3790 |
'<b>' . $this->_plugin->title . '</b>'
|
3791 |
) . ' ' . sprintf(
|
3792 |
'<a href="%s" aria-label="%s" class="button button-primary" style="margin-left: 10px; vertical-align: middle;">%s ➜</a>',
|
3793 |
$this->_parent->addon_url( $this->_slug ),
|
3794 |
-
esc_attr( sprintf( $this->_parent->
|
3795 |
-
$this->_parent->
|
3796 |
),
|
3797 |
'no_addon_license_' . $this->_slug,
|
3798 |
-
( $is_after_trial_cancel ? '' : $this->_parent->
|
3799 |
( $is_after_trial_cancel ? 'success' : 'error' )
|
3800 |
);
|
3801 |
|
@@ -4229,10 +4420,12 @@
|
|
4229 |
|
4230 |
$this->_admin_notices->add_sticky(
|
4231 |
sprintf(
|
4232 |
-
$this->
|
4233 |
'<b>' . $this->get_plugin_name() . '</b>',
|
4234 |
'<b>' . $email . '</b>',
|
4235 |
-
|
|
|
|
|
4236 |
),
|
4237 |
'activation_pending',
|
4238 |
'Thanks!'
|
@@ -4311,10 +4504,11 @@
|
|
4311 |
// Show notice for new plugin installations.
|
4312 |
$this->_admin_notices->add(
|
4313 |
sprintf(
|
4314 |
-
$this->
|
4315 |
sprintf( '<b><a href="%s">%s</a></b>',
|
4316 |
$this->get_activation_url(),
|
4317 |
-
sprintf( $this->
|
|
|
4318 |
)
|
4319 |
),
|
4320 |
'',
|
@@ -4327,11 +4521,11 @@
|
|
4327 |
// Show notice for new plugin installations.
|
4328 |
$this->_admin_notices->add_sticky(
|
4329 |
sprintf(
|
4330 |
-
$this->
|
4331 |
$this->_module_type,
|
4332 |
sprintf( '<b><a href="%s">%s</a></b>',
|
4333 |
$this->get_activation_url(),
|
4334 |
-
sprintf( $this->
|
4335 |
)
|
4336 |
),
|
4337 |
'connect_account',
|
@@ -4716,8 +4910,9 @@
|
|
4716 |
// If activating the premium module version, add an admin notice to congratulate for an upgrade completion.
|
4717 |
if ( $is_premium_version_activation ) {
|
4718 |
$this->_admin_notices->add(
|
4719 |
-
sprintf( $this->
|
4720 |
-
$this->
|
|
|
4721 |
);
|
4722 |
}
|
4723 |
} else if ( $this->is_anonymous() ) {
|
@@ -5800,13 +5995,13 @@
|
|
5800 |
*/
|
5801 |
function get_module_label( $lowercase = false ) {
|
5802 |
$label = $this->is_addon() ?
|
5803 |
-
$this->
|
5804 |
( $this->is_plugin() ?
|
5805 |
-
$this->
|
5806 |
-
$this->
|
5807 |
|
5808 |
if ( $lowercase ) {
|
5809 |
-
$label = strtolower( $
|
5810 |
}
|
5811 |
|
5812 |
return $label;
|
@@ -6927,13 +7122,13 @@
|
|
6927 |
if ( isset( $install->error ) ) {
|
6928 |
$error = $install->error->message;
|
6929 |
} else {
|
6930 |
-
|
6931 |
-
$fs->get_parent_instance() :
|
6932 |
-
$fs;
|
6933 |
|
6934 |
-
|
|
|
|
|
6935 |
|
6936 |
-
|
6937 |
}
|
6938 |
} else {
|
6939 |
$next_page = $fs->opt_in( false, false, false, $license_key );
|
@@ -7060,9 +7255,9 @@
|
|
7060 |
$error = $result->error;
|
7061 |
|
7062 |
if ( in_array( $error->code, array( 'invalid_email', 'no_user' ) ) ) {
|
7063 |
-
$error = $this->
|
7064 |
} else if ( 'no_license' === $error->code ) {
|
7065 |
-
$error = $this->
|
7066 |
} else {
|
7067 |
$error = $error->message;
|
7068 |
}
|
@@ -7073,7 +7268,7 @@
|
|
7073 |
);
|
7074 |
|
7075 |
if ( false !== $error ) {
|
7076 |
-
$licenses['error'] = sprintf( '%s... %s', $this->
|
7077 |
}
|
7078 |
|
7079 |
echo json_encode( $licenses );
|
@@ -7106,7 +7301,7 @@
|
|
7106 |
if ( self::is_ajax() &&
|
7107 |
'admin-ajax.php' === $pagenow
|
7108 |
) {
|
7109 |
-
$referer =
|
7110 |
|
7111 |
if ( is_string( $referer ) ) {
|
7112 |
$parts = explode( '?', $referer );
|
@@ -7143,6 +7338,222 @@
|
|
7143 |
return ( 'themes.php' === self::get_current_page() );
|
7144 |
}
|
7145 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7146 |
#----------------------------------------------------------------------------------
|
7147 |
#region URL Generators
|
7148 |
#----------------------------------------------------------------------------------
|
@@ -7592,7 +8003,10 @@
|
|
7592 |
) ), admin_url( 'admin.php', 'admin' ) );
|
7593 |
} else {
|
7594 |
// Plugin without a settings page.
|
7595 |
-
|
|
|
|
|
|
|
7596 |
}
|
7597 |
}
|
7598 |
}
|
@@ -8013,8 +8427,19 @@
|
|
8013 |
$this->_site = clone $site;
|
8014 |
$this->_site->plan = self::decrypt_entity( $this->_site->plan );
|
8015 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8016 |
// Load relevant user.
|
8017 |
-
$this->_user = clone $users[ $
|
8018 |
|
8019 |
// Load plans.
|
8020 |
$this->_plans = $plans[ $this->_slug ];
|
@@ -8162,6 +8587,7 @@
|
|
8162 |
* In this case, the user and site info will be sent to the server but no
|
8163 |
* data will be saved to the WP installation's database.
|
8164 |
* @param number|bool $trial_plan_id
|
|
|
8165 |
*
|
8166 |
* @return string|object
|
8167 |
* @use WP_Error
|
@@ -8172,7 +8598,8 @@
|
|
8172 |
$last = false,
|
8173 |
$license_key = false,
|
8174 |
$is_uninstall = false,
|
8175 |
-
$trial_plan_id = false
|
|
|
8176 |
) {
|
8177 |
$this->_logger->entrance();
|
8178 |
|
@@ -8225,7 +8652,28 @@
|
|
8225 |
);
|
8226 |
}
|
8227 |
|
8228 |
-
$params['
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8229 |
|
8230 |
$url = WP_FS__ADDRESS . '/action/service/user/install/';
|
8231 |
if ( isset( $_COOKIE['XDEBUG_SESSION'] ) ) {
|
@@ -8282,7 +8730,19 @@
|
|
8282 |
return true;
|
8283 |
}
|
8284 |
|
8285 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8286 |
|
8287 |
if ( empty( $decoded ) ) {
|
8288 |
return false;
|
@@ -8300,7 +8760,9 @@
|
|
8300 |
} else if ( isset( $decoded->pending_activation ) && $decoded->pending_activation ) {
|
8301 |
// Pending activation, add message.
|
8302 |
return $this->set_pending_confirmation(
|
8303 |
-
|
|
|
|
|
8304 |
false,
|
8305 |
$filtered_license_key,
|
8306 |
! empty( $params['trial_plan_id'] )
|
@@ -8366,7 +8828,7 @@
|
|
8366 |
|
8367 |
$this->_admin_notices->remove_sticky( 'connect_account' );
|
8368 |
|
8369 |
-
if ( $this->is_pending_activation() ) {
|
8370 |
// Remove pending activation sticky notice (if still exist).
|
8371 |
$this->_admin_notices->remove_sticky( 'activation_pending' );
|
8372 |
|
@@ -8375,31 +8837,32 @@
|
|
8375 |
|
8376 |
if ( ! $this->is_paying_or_trial() ) {
|
8377 |
$this->_admin_notices->add_sticky(
|
8378 |
-
sprintf( $this->
|
|
|
8379 |
'activation_complete'
|
8380 |
);
|
8381 |
}
|
8382 |
}
|
8383 |
|
8384 |
if ( $this->is_paying_or_trial() ) {
|
8385 |
-
if ( ! $this->is_premium() || ! $this->has_premium_version() ) {
|
8386 |
if ( $this->is_paying() ) {
|
8387 |
$this->_admin_notices->add_sticky(
|
8388 |
sprintf(
|
8389 |
-
$this->
|
8390 |
$this->_site->plan->title
|
8391 |
) . $this->get_complete_upgrade_instructions(),
|
8392 |
'plan_upgraded',
|
8393 |
-
$this->
|
8394 |
);
|
8395 |
} else {
|
8396 |
$this->_admin_notices->add_sticky(
|
8397 |
sprintf(
|
8398 |
-
$this->
|
8399 |
'<i>' . $this->get_plugin_name() . '</i>'
|
8400 |
) . $this->get_complete_upgrade_instructions( $this->_storage->trial_plan->title ),
|
8401 |
'trial_started',
|
8402 |
-
$this->
|
8403 |
);
|
8404 |
}
|
8405 |
}
|
@@ -8684,14 +9147,26 @@
|
|
8684 |
$install = $this->apply_filters( 'after_install_failure', $install, $args );
|
8685 |
|
8686 |
$this->_admin_notices->add(
|
8687 |
-
sprintf( $this->
|
8688 |
-
$this->
|
8689 |
-
$this->
|
8690 |
'error'
|
8691 |
);
|
8692 |
|
8693 |
if ( $redirect ) {
|
8694 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8695 |
}
|
8696 |
|
8697 |
return $install;
|
@@ -8728,9 +9203,9 @@
|
|
8728 |
|
8729 |
if ( isset( $addon_install->error ) ) {
|
8730 |
$this->_admin_notices->add(
|
8731 |
-
sprintf( $this->
|
8732 |
-
$this->
|
8733 |
-
$this->
|
8734 |
'error'
|
8735 |
);
|
8736 |
|
@@ -8789,15 +9264,23 @@
|
|
8789 |
|
8790 |
if ( isset( $parent_install->error ) ) {
|
8791 |
$this->_admin_notices->add(
|
8792 |
-
sprintf( $this->
|
8793 |
-
$this->
|
8794 |
-
$this->
|
8795 |
'error'
|
8796 |
);
|
8797 |
|
8798 |
return;
|
8799 |
}
|
8800 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8801 |
// First of all, set site info - otherwise we won't
|
8802 |
// be able to invoke API calls.
|
8803 |
$parent_fs->_site = new FS_Site( $parent_install );
|
@@ -8990,9 +9473,9 @@
|
|
8990 |
|
8991 |
if ( false !== $hook ) {
|
8992 |
if ( fs_request_is_action( $this->get_unique_affix() . '_activate_existing' ) ) {
|
8993 |
-
|
8994 |
} else if ( fs_request_is_action( $this->get_unique_affix() . '_activate_new' ) ) {
|
8995 |
-
|
8996 |
}
|
8997 |
}
|
8998 |
}
|
@@ -9040,15 +9523,15 @@
|
|
9040 |
* @return string
|
9041 |
*/
|
9042 |
function get_pricing_cta_label() {
|
9043 |
-
$label = 'upgrade';
|
9044 |
|
9045 |
if ( $this->is_in_trial_promotion() &&
|
9046 |
! $this->is_paying_or_trial()
|
9047 |
) {
|
9048 |
// If running a trial promotion, modify the pricing to load the trial.
|
9049 |
-
$label = 'start-trial';
|
9050 |
} else if ( $this->is_paying() ) {
|
9051 |
-
$label = 'pricing';
|
9052 |
}
|
9053 |
|
9054 |
return $label;
|
@@ -9085,6 +9568,20 @@
|
|
9085 |
* @since 1.2.2.7 Also add submenu items when running in a free .org theme so the tabs will be visible.
|
9086 |
*/
|
9087 |
if ( ! $this->is_activation_mode() || $this->is_free_wp_org_theme() ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9088 |
if ( $this->is_registered() ) {
|
9089 |
$show_account = (
|
9090 |
$this->is_submenu_item_visible( 'account' ) &&
|
@@ -9096,9 +9593,9 @@
|
|
9096 |
|
9097 |
// Add user account page.
|
9098 |
$this->add_submenu_item(
|
9099 |
-
$this->
|
9100 |
array( &$this, '_account_page_render' ),
|
9101 |
-
$this->get_plugin_name() . ' – ' . $this->
|
9102 |
'manage_options',
|
9103 |
'account',
|
9104 |
array( &$this, '_account_page_load' ),
|
@@ -9109,9 +9606,9 @@
|
|
9109 |
|
9110 |
// Add contact page.
|
9111 |
$this->add_submenu_item(
|
9112 |
-
$this->
|
9113 |
array( &$this, '_contact_page_render' ),
|
9114 |
-
$this->get_plugin_name() . ' – ' . $this->
|
9115 |
'manage_options',
|
9116 |
'contact',
|
9117 |
'Freemius::_clean_admin_content_section',
|
@@ -9121,9 +9618,9 @@
|
|
9121 |
|
9122 |
if ( $this->has_addons() ) {
|
9123 |
$this->add_submenu_item(
|
9124 |
-
$this->
|
9125 |
array( &$this, '_addons_page_render' ),
|
9126 |
-
$this->get_plugin_name() . ' – ' . $this->
|
9127 |
'manage_options',
|
9128 |
'addons',
|
9129 |
array( &$this, '_addons_page_load' ),
|
@@ -9137,7 +9634,7 @@
|
|
9137 |
$this->is_pricing_page_visible()
|
9138 |
);
|
9139 |
|
9140 |
-
$
|
9141 |
$pricing_class = 'upgrade-mode';
|
9142 |
if ( $show_pricing ) {
|
9143 |
if ( $this->is_in_trial_promotion() &&
|
@@ -9152,9 +9649,9 @@
|
|
9152 |
|
9153 |
// Add upgrade/pricing page.
|
9154 |
$this->add_submenu_item(
|
9155 |
-
|
9156 |
array( &$this, '_pricing_page_render' ),
|
9157 |
-
$this->get_plugin_name() . ' – ' . $this->
|
9158 |
'manage_options',
|
9159 |
'pricing',
|
9160 |
'Freemius::_clean_admin_content_section',
|
@@ -9334,7 +9831,7 @@
|
|
9334 |
|
9335 |
if ( ! $this->is_activation_mode() ) {
|
9336 |
$this->add_submenu_link_item(
|
9337 |
-
$this->apply_filters( 'support_forum_submenu', $this->
|
9338 |
$this->get_support_forum_url(),
|
9339 |
'wp-support-forum',
|
9340 |
null,
|
@@ -9846,7 +10343,23 @@
|
|
9846 |
$encrypted_site = clone $this->_site;
|
9847 |
$encrypted_site->plan = self::_encrypt_entity( $this->_site->plan );
|
9848 |
|
9849 |
-
$sites
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9850 |
$sites[ $this->_slug ] = $encrypted_site;
|
9851 |
|
9852 |
$this->set_account_option( 'sites', $sites, $store );
|
@@ -10058,8 +10571,8 @@
|
|
10058 |
$this->do_action( 'account_email_verified', $user->email );
|
10059 |
|
10060 |
$this->_admin_notices->add(
|
10061 |
-
$this->
|
10062 |
-
$this->
|
10063 |
'success',
|
10064 |
// Make admin sticky if account menu item is invisible,
|
10065 |
// since the page will be auto redirected to the plugin's
|
@@ -10191,21 +10704,24 @@
|
|
10191 |
* @return FS_Plugin_Plan[]|object
|
10192 |
*/
|
10193 |
private function _fetch_plugin_plans() {
|
10194 |
-
|
10195 |
-
|
10196 |
|
10197 |
-
|
|
|
|
|
|
|
10198 |
|
10199 |
-
|
10200 |
-
|
10201 |
-
|
10202 |
-
|
10203 |
|
10204 |
-
|
10205 |
-
|
10206 |
|
10207 |
-
|
10208 |
-
|
10209 |
|
10210 |
/**
|
10211 |
* @author Vova Feldman (@svovaf)
|
@@ -10590,24 +11106,18 @@
|
|
10590 |
}
|
10591 |
|
10592 |
$this->_admin_notices->add_sticky(
|
10593 |
-
|
10594 |
-
|
10595 |
-
$this->
|
10596 |
-
|
10597 |
-
|
10598 |
-
|
10599 |
-
|
10600 |
-
)
|
10601 |
-
|
10602 |
-
|
10603 |
-
$this->get_text( 'addon-successfully-purchased-message' ),
|
10604 |
-
$addon->title
|
10605 |
-
) . ' ' . $this->get_latest_download_link(
|
10606 |
-
$this->get_text( 'download-latest-version' ),
|
10607 |
-
$addon_id
|
10608 |
-
),
|
10609 |
'addon_plan_upgraded_' . $addon->slug,
|
10610 |
-
$this->
|
10611 |
);
|
10612 |
}
|
10613 |
}
|
@@ -10652,11 +11162,11 @@
|
|
10652 |
if ( ! self::$_global_admin_notices->has_sticky( 'api_blocked' ) ) {
|
10653 |
self::$_global_admin_notices->add(
|
10654 |
sprintf(
|
10655 |
-
$this->
|
10656 |
$this->get_plugin_name(),
|
10657 |
'<a href="' . $api->get_url() . '" target="_blank">' . $api->get_url() . '</a>'
|
10658 |
-
) . '<br> ' . $this->
|
10659 |
-
$this->
|
10660 |
'error',
|
10661 |
$background,
|
10662 |
false,
|
@@ -10666,8 +11176,8 @@
|
|
10666 |
} else {
|
10667 |
// Authentication params are broken.
|
10668 |
$this->_admin_notices->add(
|
10669 |
-
$this->
|
10670 |
-
$this->
|
10671 |
'error'
|
10672 |
);
|
10673 |
}
|
@@ -10783,6 +11293,8 @@
|
|
10783 |
}
|
10784 |
}
|
10785 |
|
|
|
|
|
10786 |
if ( $this->has_paid_plan() ) {
|
10787 |
switch ( $plan_change ) {
|
10788 |
case 'none':
|
@@ -10794,19 +11306,19 @@
|
|
10794 |
if ( $plan->is_free() ) {
|
10795 |
$this->_admin_notices->add(
|
10796 |
sprintf(
|
10797 |
-
$this->
|
10798 |
-
'<i><b>' . $plan->title . ( $this->is_trial() ? ' ' . $this->
|
10799 |
) . ' ' . sprintf(
|
10800 |
'<a href="%s">%s</a>',
|
10801 |
$this->contact_url(
|
10802 |
'bug',
|
10803 |
-
sprintf( $this->
|
10804 |
strtoupper( $plan->name )
|
10805 |
)
|
10806 |
),
|
10807 |
-
$this->
|
10808 |
),
|
10809 |
-
$
|
10810 |
);
|
10811 |
}
|
10812 |
}
|
@@ -10814,11 +11326,11 @@
|
|
10814 |
case 'upgraded':
|
10815 |
$this->_admin_notices->add_sticky(
|
10816 |
sprintf(
|
10817 |
-
$this->
|
10818 |
'<i>' . $this->get_plugin_name() . '</i>'
|
10819 |
) . $this->get_complete_upgrade_instructions(),
|
10820 |
'plan_upgraded',
|
10821 |
-
$this->
|
10822 |
);
|
10823 |
|
10824 |
$this->_admin_notices->remove_sticky( array(
|
@@ -10831,7 +11343,7 @@
|
|
10831 |
case 'changed':
|
10832 |
$this->_admin_notices->add_sticky(
|
10833 |
sprintf(
|
10834 |
-
$this->
|
10835 |
$this->_site->plan->title
|
10836 |
),
|
10837 |
'plan_changed'
|
@@ -10846,41 +11358,41 @@
|
|
10846 |
break;
|
10847 |
case 'downgraded':
|
10848 |
$this->_admin_notices->add_sticky(
|
10849 |
-
sprintf( $this->
|
10850 |
'license_expired',
|
10851 |
-
$
|
10852 |
);
|
10853 |
$this->_admin_notices->remove_sticky( 'plan_upgraded' );
|
10854 |
break;
|
10855 |
case 'cancelled':
|
10856 |
$this->_admin_notices->add(
|
10857 |
-
$this->
|
10858 |
sprintf(
|
10859 |
'<a href="%s">%s</a>',
|
10860 |
$this->contact_url( 'bug' ),
|
10861 |
-
$this->
|
10862 |
),
|
10863 |
-
$
|
10864 |
'error'
|
10865 |
);
|
10866 |
$this->_admin_notices->remove_sticky( 'plan_upgraded' );
|
10867 |
break;
|
10868 |
case 'expired':
|
10869 |
$this->_admin_notices->add_sticky(
|
10870 |
-
sprintf( $this->
|
10871 |
'license_expired',
|
10872 |
-
$
|
10873 |
);
|
10874 |
$this->_admin_notices->remove_sticky( 'plan_upgraded' );
|
10875 |
break;
|
10876 |
case 'trial_started':
|
10877 |
$this->_admin_notices->add_sticky(
|
10878 |
sprintf(
|
10879 |
-
$this->
|
10880 |
'<i>' . $this->get_plugin_name() . '</i>'
|
10881 |
) . $this->get_complete_upgrade_instructions( $this->_storage->trial_plan->title ),
|
10882 |
'trial_started',
|
10883 |
-
$this->
|
10884 |
);
|
10885 |
|
10886 |
$this->_admin_notices->remove_sticky( array(
|
@@ -10889,9 +11401,9 @@
|
|
10889 |
break;
|
10890 |
case 'trial_expired':
|
10891 |
$this->_admin_notices->add_sticky(
|
10892 |
-
$this->
|
10893 |
'trial_expired',
|
10894 |
-
$
|
10895 |
);
|
10896 |
$this->_admin_notices->remove_sticky( array(
|
10897 |
'trial_started',
|
@@ -10959,23 +11471,22 @@
|
|
10959 |
if ( ! $background ) {
|
10960 |
$this->_admin_notices->add( sprintf(
|
10961 |
'%s %s',
|
10962 |
-
$this->
|
10963 |
( is_object( $license ) && isset( $license->error ) ?
|
10964 |
$license->error->message :
|
10965 |
sprintf( '%s<br><code>%s</code>',
|
10966 |
-
$this->
|
10967 |
var_export( $license, true )
|
10968 |
)
|
10969 |
)
|
10970 |
),
|
10971 |
-
$this->
|
10972 |
'error'
|
10973 |
);
|
10974 |
}
|
10975 |
|
10976 |
return;
|
10977 |
}
|
10978 |
-
|
10979 |
$premium_license = new FS_Plugin_License( $license );
|
10980 |
|
10981 |
// Updated site plan.
|
@@ -10990,10 +11501,10 @@
|
|
10990 |
|
10991 |
if ( ! $background ) {
|
10992 |
$this->_admin_notices->add_sticky(
|
10993 |
-
$this->
|
10994 |
$this->get_complete_upgrade_instructions(),
|
10995 |
'license_activated',
|
10996 |
-
$this->
|
10997 |
);
|
10998 |
}
|
10999 |
|
@@ -11012,10 +11523,12 @@
|
|
11012 |
protected function _deactivate_license( $show_notice = true ) {
|
11013 |
$this->_logger->entrance();
|
11014 |
|
|
|
|
|
11015 |
if ( ! is_object( $this->_license ) ) {
|
11016 |
$this->_admin_notices->add(
|
11017 |
-
sprintf( $this->
|
11018 |
-
$
|
11019 |
);
|
11020 |
|
11021 |
return;
|
@@ -11026,9 +11539,9 @@
|
|
11026 |
|
11027 |
if ( isset( $license->error ) ) {
|
11028 |
$this->_admin_notices->add(
|
11029 |
-
$this->
|
11030 |
-
$this->
|
11031 |
-
$
|
11032 |
'error'
|
11033 |
);
|
11034 |
|
@@ -11053,8 +11566,8 @@
|
|
11053 |
|
11054 |
if ( $show_notice ) {
|
11055 |
$this->_admin_notices->add(
|
11056 |
-
sprintf( $this->
|
11057 |
-
$this->
|
11058 |
);
|
11059 |
}
|
11060 |
|
@@ -11102,7 +11615,7 @@
|
|
11102 |
$this->_admin_notices->remove_sticky( 'plan_upgraded' );
|
11103 |
|
11104 |
$this->_admin_notices->add(
|
11105 |
-
sprintf( $this->
|
11106 |
$plan->title,
|
11107 |
human_time_diff( time(), strtotime( $this->_license->expiration ) )
|
11108 |
)
|
@@ -11112,8 +11625,8 @@
|
|
11112 |
$this->_store_site();
|
11113 |
} else {
|
11114 |
$this->_admin_notices->add(
|
11115 |
-
$this->
|
11116 |
-
$this->
|
11117 |
'error'
|
11118 |
);
|
11119 |
}
|
@@ -11130,11 +11643,14 @@
|
|
11130 |
function start_trial( $plan_name = false ) {
|
11131 |
$this->_logger->entrance();
|
11132 |
|
|
|
|
|
|
|
11133 |
if ( $this->is_trial() ) {
|
11134 |
// Already in trial mode.
|
11135 |
$this->_admin_notices->add(
|
11136 |
-
sprintf( $this->
|
11137 |
-
$
|
11138 |
'error'
|
11139 |
);
|
11140 |
|
@@ -11144,8 +11660,8 @@
|
|
11144 |
if ( $this->_site->is_trial_utilized() ) {
|
11145 |
// Trial was already utilized.
|
11146 |
$this->_admin_notices->add(
|
11147 |
-
$this->
|
11148 |
-
$
|
11149 |
'error'
|
11150 |
);
|
11151 |
|
@@ -11158,8 +11674,8 @@
|
|
11158 |
if ( false === $plan ) {
|
11159 |
// Plan doesn't exist.
|
11160 |
$this->_admin_notices->add(
|
11161 |
-
sprintf( $this->
|
11162 |
-
$
|
11163 |
'error'
|
11164 |
);
|
11165 |
|
@@ -11169,8 +11685,8 @@
|
|
11169 |
if ( ! $plan->has_trial() ) {
|
11170 |
// Plan doesn't exist.
|
11171 |
$this->_admin_notices->add(
|
11172 |
-
sprintf( $this->
|
11173 |
-
$
|
11174 |
'error'
|
11175 |
);
|
11176 |
|
@@ -11180,8 +11696,8 @@
|
|
11180 |
if ( ! $this->has_trial_plan() ) {
|
11181 |
// None of the plans have a trial.
|
11182 |
$this->_admin_notices->add(
|
11183 |
-
sprintf( $this->
|
11184 |
-
$
|
11185 |
'error'
|
11186 |
);
|
11187 |
|
@@ -11199,9 +11715,9 @@
|
|
11199 |
if ( ! $this->is_api_result_entity( $plan ) ) {
|
11200 |
// Some API error while trying to start the trial.
|
11201 |
$this->_admin_notices->add(
|
11202 |
-
sprintf( $this->
|
11203 |
. ' ' . var_export( $plan, true ),
|
11204 |
-
$
|
11205 |
'error'
|
11206 |
);
|
11207 |
|
@@ -11225,10 +11741,13 @@
|
|
11225 |
private function _cancel_trial() {
|
11226 |
$this->_logger->entrance();
|
11227 |
|
|
|
|
|
|
|
11228 |
if ( ! $this->is_trial() ) {
|
11229 |
$this->_admin_notices->add(
|
11230 |
-
$this->
|
11231 |
-
$
|
11232 |
'error'
|
11233 |
);
|
11234 |
|
@@ -11278,7 +11797,7 @@
|
|
11278 |
! $this->deactivate_premium_only_addon_without_license( true )
|
11279 |
) {
|
11280 |
$this->_admin_notices->add(
|
11281 |
-
sprintf( $this->
|
11282 |
);
|
11283 |
}
|
11284 |
|
@@ -11286,8 +11805,8 @@
|
|
11286 |
unset( $this->_storage->trial_plan );
|
11287 |
} else {
|
11288 |
$this->_admin_notices->add(
|
11289 |
-
$this->
|
11290 |
-
$
|
11291 |
'error'
|
11292 |
);
|
11293 |
}
|
@@ -11524,21 +12043,26 @@
|
|
11524 |
if ( ! $background ) {
|
11525 |
$this->_admin_notices->add(
|
11526 |
sprintf(
|
11527 |
-
|
|
|
11528 |
$update->version,
|
11529 |
sprintf(
|
11530 |
'<a href="%s" target="_blank">%s</a>',
|
11531 |
$this->get_account_url( 'download_latest' ),
|
11532 |
-
sprintf(
|
|
|
|
|
|
|
|
|
11533 |
)
|
11534 |
),
|
11535 |
-
$this->
|
11536 |
);
|
11537 |
}
|
11538 |
} else if ( false === $new_version && ! $background ) {
|
11539 |
$this->_admin_notices->add(
|
11540 |
-
$this->
|
11541 |
-
$this->
|
11542 |
);
|
11543 |
}
|
11544 |
|
@@ -11804,7 +12328,7 @@
|
|
11804 |
|
11805 |
if ( ! isset( $result->error ) ) {
|
11806 |
$this->_admin_notices->add( sprintf(
|
11807 |
-
$this->
|
11808 |
sprintf( '<a href="mailto:%1s">%2s</a>', esc_url( $this->_user->email ), $this->_user->email )
|
11809 |
) );
|
11810 |
} else {
|
@@ -11892,6 +12416,9 @@
|
|
11892 |
$plugin_id = fs_request_get( 'plugin_id', $this->get_id() );
|
11893 |
$action = fs_get_action();
|
11894 |
|
|
|
|
|
|
|
11895 |
switch ( $action ) {
|
11896 |
case 'delete_account':
|
11897 |
check_admin_referer( $action );
|
@@ -11946,6 +12473,14 @@
|
|
11946 |
|
11947 |
if ( $plugin_id == $this->get_id() ) {
|
11948 |
$this->_deactivate_license();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11949 |
} else {
|
11950 |
if ( $this->is_addon_activated( $plugin_id ) ) {
|
11951 |
$fs_addon = self::get_instance_by_id( $plugin_id );
|
@@ -11968,20 +12503,20 @@
|
|
11968 |
$candidate_email = fs_request_get( 'candidate_email', '' );
|
11969 |
|
11970 |
if ( $this->init_change_owner( $candidate_email ) ) {
|
11971 |
-
$this->_admin_notices->add( sprintf( $this->
|
11972 |
}
|
11973 |
break;
|
11974 |
case 'owner_confirmed':
|
11975 |
$candidate_email = fs_request_get( 'candidate_email', '' );
|
11976 |
|
11977 |
-
$this->_admin_notices->add( sprintf( $this->
|
11978 |
break;
|
11979 |
case 'candidate_confirmed':
|
11980 |
if ( $this->complete_change_owner() ) {
|
11981 |
$this->_admin_notices->add_sticky(
|
11982 |
-
sprintf( $this->
|
11983 |
'ownership_changed',
|
11984 |
-
$this->
|
11985 |
);
|
11986 |
} else {
|
11987 |
// @todo Handle failed ownership change message.
|
@@ -12001,23 +12536,23 @@
|
|
12001 |
switch ( $result->error->code ) {
|
12002 |
case 'user_exist':
|
12003 |
$this->_admin_notices->add(
|
12004 |
-
$this->
|
12005 |
-
sprintf( $this->
|
12006 |
sprintf(
|
12007 |
'<a style="margin-left: 10px;" href="%s"><button class="button button-primary">%s ➜</button></a>',
|
12008 |
$this->get_account_url( 'change_owner', array(
|
12009 |
'state' => 'init',
|
12010 |
'candidate_email' => $new_email
|
12011 |
) ),
|
12012 |
-
$this->
|
12013 |
),
|
12014 |
-
$
|
12015 |
'error'
|
12016 |
);
|
12017 |
break;
|
12018 |
}
|
12019 |
} else {
|
12020 |
-
$this->_admin_notices->add( $this->
|
12021 |
}
|
12022 |
|
12023 |
return;
|
@@ -12029,12 +12564,12 @@
|
|
12029 |
|
12030 |
if ( isset( $result->error ) ) {
|
12031 |
$this->_admin_notices->add(
|
12032 |
-
$this->
|
12033 |
-
$
|
12034 |
'error'
|
12035 |
);
|
12036 |
} else {
|
12037 |
-
$this->_admin_notices->add( $this->
|
12038 |
}
|
12039 |
|
12040 |
return;
|
@@ -12094,8 +12629,10 @@
|
|
12094 |
$this->do_action( 'account_property_edit', 'site', $site_property, $site_property_value );
|
12095 |
|
12096 |
$this->_admin_notices->add( sprintf(
|
12097 |
-
|
12098 |
-
|
|
|
|
|
12099 |
|
12100 |
return;
|
12101 |
}
|
@@ -12148,6 +12685,24 @@
|
|
12148 |
$this->do_action( 'account_page_load_before_departure' );
|
12149 |
}
|
12150 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12151 |
/**
|
12152 |
* Render account page.
|
12153 |
*
|
@@ -12158,11 +12713,7 @@
|
|
12158 |
$this->_logger->entrance();
|
12159 |
|
12160 |
$template = 'account.php';
|
12161 |
-
|
12162 |
-
$template = 'billing.php';
|
12163 |
-
}
|
12164 |
-
|
12165 |
-
$vars = array( 'id' => $this->_module_id );
|
12166 |
|
12167 |
/**
|
12168 |
* Added filter to the template to allow developers wrapping the template
|
@@ -12219,8 +12770,8 @@
|
|
12219 |
|
12220 |
if ( ! $this->is_registered() && $this->is_org_repo_compliant() ) {
|
12221 |
$this->_admin_notices->add(
|
12222 |
-
sprintf( $this->
|
12223 |
-
$this->
|
12224 |
'update-nag'
|
12225 |
);
|
12226 |
}
|
@@ -12538,7 +13089,7 @@
|
|
12538 |
$trial_period = $this->_trial_days;
|
12539 |
$require_payment = $this->_is_trial_require_payment;
|
12540 |
$trial_url = $this->get_trial_url();
|
12541 |
-
$plans_string = strtolower( $this->
|
12542 |
|
12543 |
if ( $this->is_registered() ) {
|
12544 |
// If opted-in, override trial with up to date data from API.
|
@@ -12578,7 +13129,7 @@
|
|
12578 |
}
|
12579 |
|
12580 |
$message = sprintf(
|
12581 |
-
$this->
|
12582 |
sprintf( '<b>%s</b>', $this->get_plugin_name() ),
|
12583 |
$plans_string,
|
12584 |
$trial_period
|
@@ -12586,15 +13137,15 @@
|
|
12586 |
|
12587 |
// "No Credit-Card Required" or "No Commitment for N Days".
|
12588 |
$cc_string = $require_payment ?
|
12589 |
-
sprintf( $this->
|
12590 |
-
$this->
|
12591 |
|
12592 |
|
12593 |
// Start trial button.
|
12594 |
$button = ' ' . sprintf(
|
12595 |
'<a style="margin-left: 10px; vertical-align: super;" href="%s"><button class="button button-primary">%s ➜</button></a>',
|
12596 |
$trial_url,
|
12597 |
-
$this->
|
12598 |
);
|
12599 |
|
12600 |
$this->_admin_notices->add_sticky(
|
@@ -12609,6 +13160,90 @@
|
|
12609 |
return true;
|
12610 |
}
|
12611 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12612 |
/**
|
12613 |
* @author Vova Feldman (@svovaf)
|
12614 |
* @since 1.2.1.5
|
@@ -12711,7 +13346,7 @@
|
|
12711 |
if ( $this->is_registered() ) {
|
12712 |
if ( ! $this->is_paying() && $this->has_paid_plan() ) {
|
12713 |
$this->add_plugin_action_link(
|
12714 |
-
$this->
|
12715 |
$this->get_upgrade_url(),
|
12716 |
false,
|
12717 |
7,
|
@@ -12721,7 +13356,7 @@
|
|
12721 |
|
12722 |
if ( $this->has_addons() ) {
|
12723 |
$this->add_plugin_action_link(
|
12724 |
-
$this->
|
12725 |
$this->_get_admin_page_url( 'addons' ),
|
12726 |
false,
|
12727 |
9,
|
@@ -12749,11 +13384,9 @@
|
|
12749 |
add_action( 'admin_footer', array( &$this, '_add_license_activation_dialog_box' ) );
|
12750 |
}
|
12751 |
|
12752 |
-
$link_text = $this->
|
12753 |
-
$this->
|
12754 |
-
|
12755 |
-
'change-license'
|
12756 |
-
);
|
12757 |
|
12758 |
$this->add_plugin_action_link(
|
12759 |
$link_text,
|
@@ -12814,14 +13447,14 @@
|
|
12814 |
|
12815 |
if ( $this->is_registered() ) {
|
12816 |
if ( $this->is_tracking_allowed() ) {
|
12817 |
-
$link_text_id = 'opt-out';
|
12818 |
} else {
|
12819 |
-
$link_text_id = 'opt-in';
|
12820 |
}
|
12821 |
|
12822 |
add_action( 'admin_footer', array( &$this, '_add_optout_dialog' ) );
|
12823 |
} else {
|
12824 |
-
$link_text_id = 'opt-in';
|
12825 |
|
12826 |
$params = ! $this->is_anonymous() ?
|
12827 |
array() :
|
@@ -12835,7 +13468,7 @@
|
|
12835 |
|
12836 |
if ( $this->is_plugin() && self::is_plugins_page() ) {
|
12837 |
$this->add_plugin_action_link(
|
12838 |
-
|
12839 |
$url,
|
12840 |
false,
|
12841 |
13,
|
@@ -13004,20 +13637,21 @@
|
|
13004 |
|
13005 |
// @since 1.2.1.5 The free version is auto deactivated.
|
13006 |
$deactivation_step = version_compare( $this->version, '1.2.1.5', '<' ) ?
|
13007 |
-
( '<li>' . $this->
|
13008 |
'';
|
13009 |
|
13010 |
return sprintf(
|
13011 |
' %s: <ol><li>%s.</li>%s<li>%s (<a href="%s" target="_blank">%s</a>).</li></ol>',
|
13012 |
-
$this->
|
13013 |
$this->get_latest_download_link( sprintf(
|
13014 |
-
|
|
|
13015 |
$plan_title
|
13016 |
) ),
|
13017 |
$deactivation_step,
|
13018 |
-
$this->
|
13019 |
'//bit.ly/upload-wp-' . $this->_module_type . 's',
|
13020 |
-
$this->
|
13021 |
);
|
13022 |
}
|
13023 |
|
@@ -13033,6 +13667,46 @@
|
|
13033 |
return fs_text( $key, $this->_slug );
|
13034 |
}
|
13035 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13036 |
#----------------------------------------------------------------------------------
|
13037 |
#region Versioning
|
13038 |
#----------------------------------------------------------------------------------
|
@@ -13136,17 +13810,17 @@
|
|
13136 |
if ( ! $this->is_registered() ) {
|
13137 |
// Not registered.
|
13138 |
self::shoot_ajax_failure( array(
|
13139 |
-
'message' => $this->
|
13140 |
'code' => 'premium_installed',
|
13141 |
) );
|
13142 |
}
|
13143 |
|
13144 |
-
$plugin_id = fs_request_get( '
|
13145 |
|
13146 |
if ( ! FS_Plugin::is_valid_id( $plugin_id ) ) {
|
13147 |
// Invalid ID.
|
13148 |
self::shoot_ajax_failure( array(
|
13149 |
-
'message' => $this->
|
13150 |
'code' => 'invalid_module_id',
|
13151 |
) );
|
13152 |
}
|
@@ -13155,21 +13829,21 @@
|
|
13155 |
if ( $this->is_premium() ) {
|
13156 |
// Already using the premium code version.
|
13157 |
self::shoot_ajax_failure( array(
|
13158 |
-
'message' => $this->
|
13159 |
'code' => 'premium_installed',
|
13160 |
) );
|
13161 |
}
|
13162 |
if ( ! $this->can_use_premium_code() ) {
|
13163 |
// Don't have access to the premium code.
|
13164 |
self::shoot_ajax_failure( array(
|
13165 |
-
'message' => $this->
|
13166 |
'code' => 'invalid_license',
|
13167 |
) );
|
13168 |
}
|
13169 |
if ( ! $this->has_release_on_freemius() ) {
|
13170 |
// Plugin is a serviceware, no premium code version.
|
13171 |
self::shoot_ajax_failure( array(
|
13172 |
-
'message' => $this->
|
13173 |
'code' => 'premium_version_missing',
|
13174 |
) );
|
13175 |
}
|
@@ -13179,7 +13853,7 @@
|
|
13179 |
if ( ! is_object( $addon ) ) {
|
13180 |
// Invalid add-on ID.
|
13181 |
self::shoot_ajax_failure( array(
|
13182 |
-
'message' => $this->
|
13183 |
'code' => 'invalid_module_id',
|
13184 |
) );
|
13185 |
}
|
@@ -13187,7 +13861,7 @@
|
|
13187 |
if ( $this->is_addon_activated( $plugin_id, true ) ) {
|
13188 |
// Premium add-on version is already activated.
|
13189 |
self::shoot_ajax_failure( array(
|
13190 |
-
'message' => $this->
|
13191 |
'code' => 'premium_installed',
|
13192 |
) );
|
13193 |
}
|
@@ -13259,10 +13933,11 @@
|
|
13259 |
}
|
13260 |
}
|
13261 |
|
13262 |
-
|
13263 |
-
|
13264 |
-
|
13265 |
-
|
|
|
13266 |
|
13267 |
fs_require_template( 'auto-installation.php', $vars );
|
13268 |
}
|
@@ -13532,7 +14207,7 @@
|
|
13532 |
require_once WP_FS__DIR_INCLUDES . '/customizer/class-fs-customizer-upsell-control.php';
|
13533 |
|
13534 |
$customizer->add_section( 'freemius_upsell', array(
|
13535 |
-
'title' => '★ ' . $this->
|
13536 |
'priority' => 1,
|
13537 |
) );
|
13538 |
$customizer->add_setting( 'freemius_upsell', array(
|
271 |
*/
|
272 |
private static $_instances = array();
|
273 |
|
274 |
+
/**
|
275 |
+
* @author Leo Fajardo (@leorw)
|
276 |
+
*
|
277 |
+
* @since 1.2.3
|
278 |
+
*
|
279 |
+
* @var FS_Affiliate
|
280 |
+
*/
|
281 |
+
private $affiliate = null;
|
282 |
+
|
283 |
+
/**
|
284 |
+
* @author Leo Fajardo (@leorw)
|
285 |
+
*
|
286 |
+
* @since 1.2.3
|
287 |
+
*
|
288 |
+
* @var FS_AffiliateTerms
|
289 |
+
*/
|
290 |
+
private $plugin_affiliate_terms = null;
|
291 |
+
|
292 |
+
/**
|
293 |
+
* @author Leo Fajardo (@leorw)
|
294 |
+
*
|
295 |
+
* @since 1.2.3
|
296 |
+
*
|
297 |
+
* @var FS_AffiliateTerms
|
298 |
+
*/
|
299 |
+
private $custom_affiliate_terms = null;
|
300 |
+
|
301 |
#region Uninstall Reasons IDs
|
302 |
|
303 |
const REASON_NO_LONGER_NEEDED = 1;
|
555 |
return;
|
556 |
}
|
557 |
|
558 |
+
if ( version_compare( $sdk_prev_version, '1.2.3', '<' ) &&
|
559 |
+
version_compare( $sdk_version, '1.2.3', '>=' )
|
560 |
+
) {
|
561 |
+
/**
|
562 |
+
* Starting from version 1.2.3, paths are stored as relative paths and not absolute paths; so when
|
563 |
+
* upgrading to 1.2.3, make paths relative.
|
564 |
+
*
|
565 |
+
* @author Leo Fajardo (@leorw)
|
566 |
+
*/
|
567 |
+
$this->make_paths_relative();
|
568 |
+
}
|
569 |
+
|
570 |
if ( version_compare( $sdk_prev_version, '1.1.5', '<' ) &&
|
571 |
version_compare( $sdk_version, '1.1.5', '>=' )
|
572 |
) {
|
590 |
}
|
591 |
}
|
592 |
|
593 |
+
/**
|
594 |
+
* Makes paths relative.
|
595 |
+
*
|
596 |
+
* @author Leo Fajardo
|
597 |
+
* @since 1.2.3
|
598 |
+
*/
|
599 |
+
private function make_paths_relative() {
|
600 |
+
$id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array() );
|
601 |
+
|
602 |
+
if ( isset( $id_slug_type_path_map[ $this->_module_id ]['path'] ) ) {
|
603 |
+
$id_slug_type_path_map[ $this->_module_id ]['path'] = $this->get_relative_path( $id_slug_type_path_map[ $this->_module_id ]['path'] );
|
604 |
+
|
605 |
+
self::$_accounts->set_option( 'id_slug_type_path_map', $id_slug_type_path_map, true );
|
606 |
+
}
|
607 |
+
|
608 |
+
if ( isset( $this->_storage->plugin_main_file ) ) {
|
609 |
+
$plugin_main_file = $this->_storage->plugin_main_file;
|
610 |
+
|
611 |
+
if ( isset( $plugin_main_file->path ) ) {
|
612 |
+
$this->_storage->plugin_main_file->path = $this->get_relative_path( $this->_storage->plugin_main_file->path );
|
613 |
+
} else if ( isset( $plugin_main_file->prev_path ) ) {
|
614 |
+
$this->_storage->plugin_main_file->prev_path = $this->get_relative_path( $this->_storage->plugin_main_file->prev_path );
|
615 |
+
}
|
616 |
+
}
|
617 |
+
|
618 |
+
// Remove invalid path that is still associated with the current slug if there's any.
|
619 |
+
$file_slug_map = self::$_accounts->get_option( 'file_slug_map', array() );
|
620 |
+
foreach ( $file_slug_map as $plugin_basename => $slug ) {
|
621 |
+
if ( $slug === $this->_slug &&
|
622 |
+
$plugin_basename !== $this->_plugin_basename &&
|
623 |
+
! file_exists( $this->get_absolute_path( $plugin_basename ) )
|
624 |
+
) {
|
625 |
+
unset( $file_slug_map[ $plugin_basename ] );
|
626 |
+
self::$_accounts->set_option( 'file_slug_map', $file_slug_map, true );
|
627 |
+
|
628 |
+
break;
|
629 |
+
}
|
630 |
+
}
|
631 |
+
}
|
632 |
+
|
633 |
/**
|
634 |
* @author Vova Feldman (@svovaf)
|
635 |
* @since 1.2.2.7
|
811 |
'_install_premium_version_ajax_action'
|
812 |
) );
|
813 |
|
814 |
+
$this->add_ajax_action( 'submit_affiliate_application', array( &$this, '_submit_affiliate_application' ) );
|
815 |
+
|
816 |
$this->add_action( 'after_plans_sync', array( &$this, '_check_for_trial_plans' ) );
|
817 |
|
818 |
$this->add_action( 'sdk_version_update', array( &$this, '_data_migration' ), WP_FS__DEFAULT_PRIORITY, 2 );
|
820 |
$this->add_filter( 'after_code_type_change', array( &$this, '_after_code_type_change' ) );
|
821 |
|
822 |
add_action( 'admin_init', array( &$this, '_add_trial_notice' ) );
|
823 |
+
add_action( 'admin_init', array( &$this, '_add_affiliate_program_notice' ) );
|
824 |
add_action( 'admin_init', array( &$this, '_enqueue_common_css' ) );
|
825 |
|
826 |
/**
|
926 |
// Try to load the cached value of the file path.
|
927 |
if ( isset( $this->_storage->plugin_main_file ) ) {
|
928 |
$plugin_main_file = $this->_storage->plugin_main_file;
|
929 |
+
if ( isset( $plugin_main_file->path ) ) {
|
930 |
+
$absolute_path = $this->get_absolute_path( $plugin_main_file->path );
|
931 |
+
if ( file_exists( $absolute_path ) ) {
|
932 |
+
return $absolute_path;
|
933 |
+
}
|
934 |
}
|
935 |
}
|
936 |
|
949 |
if ( isset( $this->_storage->plugin_main_file ) &&
|
950 |
isset( $this->_storage->plugin_main_file->prev_path )
|
951 |
) {
|
952 |
+
$absolute_path = $this->get_absolute_path( $this->_storage->plugin_main_file->prev_path );
|
953 |
+
if ( file_exists( $absolute_path ) ) {
|
954 |
+
return $absolute_path;
|
955 |
}
|
956 |
}
|
957 |
|
958 |
wp_die(
|
959 |
+
$this->get_text_inline( 'Freemius SDK couldn\'t find the plugin\'s main file. Please contact sdk@freemius.com with the current error.', 'failed-finding-main-path' ) .
|
960 |
" Module: {$this->_slug}; SDK: " . WP_FS__SDK_VERSION . ";",
|
961 |
+
$this->get_text_inline( 'Error', 'error' ),
|
962 |
array( 'back_link' => true )
|
963 |
);
|
964 |
}
|
965 |
|
|
|
966 |
//Fix for migration issues.
|
967 |
if ('ti-woocommerce-wishlist' === $this->_slug) {
|
968 |
return TINVWL_PATH . 'ti-woocommerce-wishlist.php';
|
979 |
'path' => $id_slug_type_path_map[ $this->_module_id ]['path'],
|
980 |
);
|
981 |
|
982 |
+
return $this->get_absolute_path( $id_slug_type_path_map[ $this->_module_id ]['path'] );
|
983 |
+
}
|
984 |
+
|
985 |
+
/**
|
986 |
+
* @author Leo Fajardo (@leorw)
|
987 |
+
* @since 1.2.3
|
988 |
+
*
|
989 |
+
* @param string $path
|
990 |
+
*
|
991 |
+
* @return string
|
992 |
+
*/
|
993 |
+
private function get_relative_path( $path ) {
|
994 |
+
$module_root_dir = $this->get_module_root_dir_path();
|
995 |
+
if ( 0 === strpos( $path, $module_root_dir ) ) {
|
996 |
+
$path = substr( $path, strlen( $module_root_dir ) );
|
997 |
+
}
|
998 |
+
|
999 |
+
return $path;
|
1000 |
+
}
|
1001 |
+
|
1002 |
+
/**
|
1003 |
+
* @author Leo Fajardo (@leorw)
|
1004 |
+
* @since 1.2.3
|
1005 |
+
*
|
1006 |
+
* @param string $path
|
1007 |
+
* @param string|bool $module_type
|
1008 |
+
*
|
1009 |
+
* @return string
|
1010 |
+
*/
|
1011 |
+
private function get_absolute_path( $path, $module_type = false ) {
|
1012 |
+
$module_root_dir = $this->get_module_root_dir_path( $module_type );
|
1013 |
+
if ( 0 !== strpos( $path, $module_root_dir ) ) {
|
1014 |
+
$path = fs_normalize_path( $module_root_dir . $path );
|
1015 |
+
}
|
1016 |
+
|
1017 |
+
return $path;
|
1018 |
+
}
|
1019 |
+
|
1020 |
+
/**
|
1021 |
+
* @author Leo Fajardo (@leorw)
|
1022 |
+
* @since 1.2.3
|
1023 |
+
*
|
1024 |
+
* @param string|bool $module_type
|
1025 |
+
*
|
1026 |
+
* @return string
|
1027 |
+
*/
|
1028 |
+
private function get_module_root_dir_path( $module_type = false ) {
|
1029 |
+
$is_plugin = empty( $module_type ) ?
|
1030 |
+
$this->is_plugin() :
|
1031 |
+
( WP_FS__MODULE_TYPE_PLUGIN === $module_type );
|
1032 |
+
|
1033 |
+
return fs_normalize_path( trailingslashit( $is_plugin ?
|
1034 |
+
WP_PLUGIN_DIR :
|
1035 |
+
get_theme_root() ) );
|
1036 |
+
}
|
1037 |
|
1038 |
/**
|
1039 |
* @author Leo Fajardo (@leorw)
|
1056 |
$store_option = true;
|
1057 |
}
|
1058 |
|
1059 |
+
if ( ! isset( $id_slug_type_path_map[ $module_id ]['path'] ) ||
|
1060 |
+
/**
|
1061 |
+
* This verification is for cases when suddenly the same module
|
1062 |
+
* is installed but with a different folder name.
|
1063 |
+
*
|
1064 |
+
* @author Vova Feldman (@svovaf)
|
1065 |
+
* @since 1.2.3
|
1066 |
+
*/
|
1067 |
+
! file_exists( $this->get_absolute_path(
|
1068 |
+
$id_slug_type_path_map[ $module_id ]['path'],
|
1069 |
+
$id_slug_type_path_map[ $module_id ]['type']
|
1070 |
+
) )
|
1071 |
+
) {
|
1072 |
$caller_main_file_and_type = $this->get_caller_main_file_and_type();
|
1073 |
|
1074 |
$id_slug_type_path_map[ $module_id ]['type'] = $caller_main_file_and_type->module_type;
|
1158 |
*/
|
1159 |
|
1160 |
if ( $caller_file_path == fs_normalize_path( realpath( trailingslashit( $themes_dir ) . basename( dirname( $caller_file_path ) ) . '/' . basename( $caller_file_path ) ) ) ) {
|
1161 |
+
$module_type = WP_FS__MODULE_TYPE_THEME;
|
1162 |
+
|
1163 |
+
/**
|
1164 |
+
* Relative path of the theme, e.g.:
|
1165 |
+
* `my-theme/functions.php`
|
1166 |
+
*
|
1167 |
+
* @author Leo Fajardo (@leorw)
|
1168 |
+
*/
|
1169 |
+
$caller_file_candidate = basename( dirname( $caller_file_path ) ) .
|
1170 |
+
'/' .
|
1171 |
+
basename( $caller_file_path );
|
1172 |
+
|
1173 |
continue;
|
1174 |
}
|
1175 |
}
|
1187 |
|
1188 |
if ( isset( $caller_map[ $caller_file_hash ] ) ) {
|
1189 |
$module_type = WP_FS__MODULE_TYPE_PLUGIN;
|
1190 |
+
$caller_file_candidate = plugin_basename( $caller_map[ $caller_file_hash ] );
|
1191 |
}
|
1192 |
}
|
1193 |
|
1279 |
|
1280 |
$reason_found_better_plugin = array(
|
1281 |
'id' => self::REASON_FOUND_A_BETTER_PLUGIN,
|
1282 |
+
'text' => sprintf( $this->get_text_inline( 'I found a better %s', 'reason-found-a-better-plugin' ), $module_type ),
|
1283 |
'input_type' => 'textfield',
|
1284 |
+
'input_placeholder' => sprintf( $this->get_text_inline( "What's the %s's name?", 'placeholder-plugin-name' ), $module_type ),
|
1285 |
);
|
1286 |
|
1287 |
$reason_temporary_deactivation = array(
|
1288 |
'id' => self::REASON_TEMPORARY_DEACTIVATION,
|
1289 |
'text' => sprintf(
|
1290 |
+
$this->get_text_inline( "It's a temporary %s. I'm just debugging an issue.", 'reason-temporary-x' ),
|
1291 |
strtolower( $this->is_plugin() ?
|
1292 |
+
$this->get_text_inline( 'Deactivation', 'deactivation' ) :
|
1293 |
+
$this->get_text_inline( 'Theme Switch', 'theme-switch' )
|
1294 |
)
|
1295 |
),
|
1296 |
'input_type' => '',
|
1299 |
|
1300 |
$reason_other = array(
|
1301 |
'id' => self::REASON_OTHER,
|
1302 |
+
'text' => $this->get_text_inline( 'Other', 'reason-other' ),
|
1303 |
'input_type' => 'textfield',
|
1304 |
'input_placeholder' => ''
|
1305 |
);
|
1307 |
$long_term_user_reasons = array(
|
1308 |
array(
|
1309 |
'id' => self::REASON_NO_LONGER_NEEDED,
|
1310 |
+
'text' => sprintf( $this->get_text_inline( 'I no longer need the %s', 'reason-no-longer-needed' ), $module_type ),
|
1311 |
'input_type' => '',
|
1312 |
'input_placeholder' => ''
|
1313 |
),
|
1314 |
$reason_found_better_plugin,
|
1315 |
array(
|
1316 |
'id' => self::REASON_NEEDED_FOR_A_SHORT_PERIOD,
|
1317 |
+
'text' => sprintf( $this->get_text_inline( 'I only needed the %s for a short period', 'reason-needed-for-a-short-period' ), $module_type ),
|
1318 |
'input_type' => '',
|
1319 |
'input_placeholder' => ''
|
1320 |
),
|
1321 |
array(
|
1322 |
'id' => self::REASON_BROKE_MY_SITE,
|
1323 |
+
'text' => sprintf( $this->get_text_inline( 'The %s broke my site', 'reason-broke-my-site' ), $module_type ),
|
1324 |
'input_type' => '',
|
1325 |
'input_placeholder' => '',
|
1326 |
'internal_message' => $contact_support_template
|
1327 |
),
|
1328 |
array(
|
1329 |
'id' => self::REASON_SUDDENLY_STOPPED_WORKING,
|
1330 |
+
'text' => sprintf( $this->get_text_inline( 'The %s suddenly stopped working', 'reason-suddenly-stopped-working' ), $module_type ),
|
1331 |
'input_type' => '',
|
1332 |
'input_placeholder' => '',
|
1333 |
'internal_message' => $contact_support_template
|
1337 |
if ( $this->is_paying() ) {
|
1338 |
$long_term_user_reasons[] = array(
|
1339 |
'id' => self::REASON_CANT_PAY_ANYMORE,
|
1340 |
+
'text' => $this->get_text_inline( "I can't pay for it anymore", 'reason-cant-pay-anymore' ),
|
1341 |
'input_type' => 'textfield',
|
1342 |
+
'input_placeholder' => $this->get_text_inline( 'What price would you feel comfortable paying?', 'placeholder-comfortable-price' )
|
1343 |
);
|
1344 |
}
|
1345 |
|
1346 |
$reason_dont_share_info = array(
|
1347 |
'id' => self::REASON_DONT_LIKE_TO_SHARE_MY_INFORMATION,
|
1348 |
+
'text' => $this->get_text_inline( "I don't like to share my information with you", 'reason-dont-like-to-share-my-information' ),
|
1349 |
'input_type' => '',
|
1350 |
'input_placeholder' => ''
|
1351 |
);
|
1366 |
'non-registered-and-non-anonymous-short-term' => array(
|
1367 |
array(
|
1368 |
'id' => self::REASON_DIDNT_WORK,
|
1369 |
+
'text' => sprintf( $this->get_text_inline( "The %s didn't work", 'reason-didnt-work' ), $module_type ),
|
1370 |
'input_type' => '',
|
1371 |
'input_placeholder' => ''
|
1372 |
),
|
1376 |
'short-term' => array(
|
1377 |
array(
|
1378 |
'id' => self::REASON_COULDNT_MAKE_IT_WORK,
|
1379 |
+
'text' => $this->get_text_inline( "I couldn't understand how to make it work", 'reason-couldnt-make-it-work' ),
|
1380 |
'input_type' => '',
|
1381 |
'input_placeholder' => '',
|
1382 |
'internal_message' => $contact_support_template
|
1384 |
$reason_found_better_plugin,
|
1385 |
array(
|
1386 |
'id' => self::REASON_GREAT_BUT_NEED_SPECIFIC_FEATURE,
|
1387 |
+
'text' => sprintf( $this->get_text_inline( "The %s is great, but I need specific feature that you don't support", 'reason-great-but-need-specific-feature' ), $module_type ),
|
1388 |
'input_type' => 'textarea',
|
1389 |
+
'input_placeholder' => $this->get_text_inline( 'What feature?', 'placeholder-feature' )
|
1390 |
),
|
1391 |
array(
|
1392 |
'id' => self::REASON_NOT_WORKING,
|
1393 |
+
'text' => sprintf( $this->get_text_inline( 'The %s is not working', 'reason-not-working' ), $module_type ),
|
1394 |
'input_type' => 'textarea',
|
1395 |
+
'input_placeholder' => $this->get_text_inline( "Kindly share what didn't work so we can fix it for future users...", 'placeholder-share-what-didnt-work' )
|
1396 |
),
|
1397 |
array(
|
1398 |
'id' => self::REASON_NOT_WHAT_I_WAS_LOOKING_FOR,
|
1399 |
+
'text' => $this->get_text_inline( "It's not what I was looking for", 'reason-not-what-i-was-looking-for' ),
|
1400 |
'input_type' => 'textarea',
|
1401 |
+
'input_placeholder' => $this->get_text_inline( "What you've been looking for?", 'placeholder-what-youve-been-looking-for' )
|
1402 |
),
|
1403 |
array(
|
1404 |
'id' => self::REASON_DIDNT_WORK_AS_EXPECTED,
|
1405 |
+
'text' => sprintf( $this->get_text_inline( "The %s didn't work as expected", 'reason-didnt-work-as-expected' ), $module_type ),
|
1406 |
'input_type' => 'textarea',
|
1407 |
+
'input_placeholder' => $this->get_text_inline( 'What did you expect?', 'placeholder-what-did-you-expect' )
|
1408 |
)
|
1409 |
)
|
1410 |
);
|
1940 |
|
1941 |
self::$_static_logger->entrance();
|
1942 |
|
1943 |
+
$title = sprintf( '%s [v.%s]', fs_text_inline( 'Freemius Debug' ), WP_FS__SDK_VERSION );
|
1944 |
|
1945 |
if ( WP_FS__DEV_MODE ) {
|
1946 |
// Add top-level debug menu item.
|
2347 |
*
|
2348 |
* @return string
|
2349 |
*/
|
2350 |
+
function get_anonymous_id() {
|
2351 |
+
$unique_id = self::$_accounts->get_option( 'unique_id' );
|
2352 |
|
2353 |
+
if ( empty( $unique_id ) || ! is_string( $unique_id ) ) {
|
2354 |
+
$key = get_site_url();
|
2355 |
|
2356 |
+
// If localhost, assign microtime instead of domain.
|
2357 |
+
if ( WP_FS__IS_LOCALHOST ||
|
2358 |
+
false !== strpos( $key, 'localhost' ) ||
|
2359 |
+
false === strpos( $key, '.' )
|
2360 |
+
) {
|
2361 |
+
$key = microtime();
|
2362 |
+
}
|
2363 |
|
2364 |
+
/**
|
2365 |
+
* Base the unique identifier on the WP secure authentication key. Which
|
2366 |
+
* turns the key into a secret anonymous identifier.
|
2367 |
+
*
|
2368 |
+
* @author Vova Feldman (@svovaf)
|
2369 |
+
* @since 1.2.3
|
2370 |
+
*/
|
2371 |
+
$unique_id = md5( $key . SECURE_AUTH_KEY );
|
2372 |
|
2373 |
+
self::$_accounts->set_option( 'unique_id', $unique_id, true );
|
2374 |
+
}
|
2375 |
|
2376 |
+
$this->_logger->departure( $unique_id );
|
2377 |
|
2378 |
+
return $unique_id;
|
2379 |
+
}
|
2380 |
|
2381 |
/**
|
2382 |
* @author Vova Feldman (@svovaf)
|
2456 |
// $admin_email = get_option( 'admin_email' );
|
2457 |
$admin_email = $current_user->user_email;
|
2458 |
|
2459 |
+
// Aliases.
|
2460 |
+
$deactivate_plugin_title = $this->esc_html_inline( 'That\'s exhausting, please deactivate', 'deactivate-plugin-title' );
|
2461 |
+
$deactivate_plugin_desc = $this->esc_html_inline( 'We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future.', 'deactivate-plugin-desc' );
|
2462 |
+
$install_previous_title = $this->esc_html_inline( 'Let\'s try your previous version', 'install-previous-title' );
|
2463 |
+
$install_previous_desc = $this->esc_html_inline( 'Uninstall this version and install the previous one.', 'install-previous-desc' );
|
2464 |
+
$fix_issue_title = $this->esc_html_inline( 'Yes - I\'m giving you a chance to fix it', 'fix-issue-title' );
|
2465 |
+
$fix_issue_desc = $this->esc_html_inline( '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.', 'fix-issue-desc' );
|
2466 |
+
/* translators: %s: product title (e.g. "Awesome Plugin" requires an access to...) */
|
2467 |
+
$x_requires_access_to_api = $this->esc_html_inline( '%s requires an access to our API.', 'x-requires-access-to-api' );
|
2468 |
+
$sysadmin_title = $this->esc_html_inline( 'I\'m a system administrator', 'sysadmin-title' );
|
2469 |
+
$happy_to_resolve_issue_asap = $this->esc_html_inline( '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.', 'happy-to-resolve-issue-asap' );
|
2470 |
+
|
2471 |
$message = false;
|
2472 |
if ( is_object( $api_result ) &&
|
2473 |
isset( $api_result->error ) &&
|
2494 |
if ( ! empty( $missing_methods ) ) {
|
2495 |
$missing_methods = sprintf(
|
2496 |
'<br><br><b>%s</b> %s',
|
2497 |
+
$this->esc_html_inline( 'Disabled method(s):', 'curl-disabled-methods' ),
|
2498 |
$missing_methods
|
2499 |
);
|
2500 |
}
|
2501 |
}
|
2502 |
|
2503 |
$message = sprintf(
|
2504 |
+
$x_requires_access_to_api . ' ' .
|
2505 |
+
$this->esc_html_inline( 'We use PHP cURL library for the API calls, which is a very common library and usually installed and activated out of the box. Unfortunately, cURL is not activated (or disabled) on your server.', 'curl-missing-message' ) . ' ' .
|
2506 |
$missing_methods .
|
2507 |
' %s',
|
2508 |
'<b>' . $this->get_plugin_name() . '</b>',
|
2510 |
'<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
|
2511 |
sprintf(
|
2512 |
'<a class="fs-resolve" data-type="curl" href="#"><b>%s</b></a>%s',
|
2513 |
+
$this->get_text_inline( 'I don\'t know what is cURL or how to install it, help me!', 'curl-missing-no-clue-title' ),
|
2514 |
' - ' . sprintf(
|
2515 |
+
$this->get_text_inline( '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.', 'curl-missing-no-clue-desc' ),
|
2516 |
'<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
|
2517 |
)
|
2518 |
),
|
2519 |
sprintf(
|
2520 |
'<b>%s</b> - %s',
|
2521 |
+
$sysadmin_title,
|
2522 |
+
esc_html( sprintf( $this->get_text_inline( 'Great, please install cURL and enable it in your php.ini file. In addition, search for the \'disable_functions\' directive in your php.ini file and remove any disabled methods starting with \'curl_\'. To make sure it was successfully activated, use \'phpinfo()\'. Once activated, deactivate the %s and reactivate it back again.', 'curl-missing-sysadmin-desc' ), $this->get_module_label( true ) ) )
|
2523 |
),
|
2524 |
sprintf(
|
2525 |
+
'<a href="%s"><b>%s</b></a> - %s',
|
2526 |
+
wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=all&paged=1&s=', 'deactivate-plugin_' . $this->_plugin_basename ),
|
2527 |
+
$deactivate_plugin_title,
|
2528 |
+
$deactivate_plugin_desc
|
2529 |
)
|
2530 |
)
|
2531 |
);
|
2532 |
break;
|
2533 |
case 'cloudflare_ddos_protection':
|
2534 |
$message = sprintf(
|
2535 |
+
$x_requires_access_to_api . ' ' .
|
2536 |
+
$this->esc_html_inline( 'From unknown reason, CloudFlare, the firewall we use, blocks the connection.', 'cloudflare-blocks-connection-message' ) . ' ' .
|
2537 |
+
$happy_to_resolve_issue_asap .
|
2538 |
' %s',
|
2539 |
'<b>' . $this->get_plugin_name() . '</b>',
|
2540 |
sprintf(
|
2541 |
'<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
|
2542 |
sprintf(
|
2543 |
'<a class="fs-resolve" data-type="cloudflare" href="#"><b>%s</b></a>%s',
|
2544 |
+
$fix_issue_title,
|
2545 |
' - ' . sprintf(
|
2546 |
+
$fix_issue_desc,
|
2547 |
'<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
|
2548 |
)
|
2549 |
),
|
2550 |
sprintf(
|
2551 |
+
'<a href="%s" target="_blank"><b>%s</b></a> - %s',
|
2552 |
sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ),
|
2553 |
+
$install_previous_title,
|
2554 |
+
$install_previous_desc
|
2555 |
),
|
2556 |
sprintf(
|
2557 |
+
'<a href="%s"><b>%s</b></a> - %s',
|
2558 |
+
wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=all&paged=1&s=' . '', 'deactivate-plugin_' . $this->_plugin_basename ),
|
2559 |
+
$deactivate_plugin_title,
|
2560 |
+
$deactivate_plugin_desc
|
2561 |
)
|
2562 |
)
|
2563 |
);
|
2564 |
break;
|
2565 |
case 'squid_cache_block':
|
2566 |
$message = sprintf(
|
2567 |
+
$x_requires_access_to_api . ' ' .
|
2568 |
+
$this->esc_html_inline( 'It looks like your server is using Squid ACL (access control lists), which blocks the connection.', 'squid-blocks-connection-message' ) .
|
2569 |
' %s',
|
2570 |
'<b>' . $this->get_plugin_name() . '</b>',
|
2571 |
sprintf(
|
2572 |
'<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
|
2573 |
sprintf(
|
2574 |
+
'<a class="fs-resolve" data-type="squid" href="#"><b>%s</b></a> - %s',
|
2575 |
+
$this->esc_html_inline( 'I don\'t know what is Squid or ACL, help me!', 'squid-no-clue-title' ),
|
2576 |
+
sprintf(
|
2577 |
+
$this->esc_html_inline( '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.', 'squid-no-clue-desc' ),
|
2578 |
'<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
|
2579 |
)
|
2580 |
),
|
2581 |
sprintf(
|
2582 |
'<b>%s</b> - %s',
|
2583 |
+
$sysadmin_title,
|
2584 |
sprintf(
|
2585 |
+
$this->esc_html_inline( 'Great, please whitelist the following domains: %s. Once you are done, deactivate the %s and activate it again.', 'squid-sysadmin-desc' ),
|
2586 |
// We use a filter since the plugin might require additional API connectivity.
|
2587 |
'<b>' . implode( ', ', $this->apply_filters( 'api_domains', array( 'api.freemius.com', 'wp.freemius.com' ) ) ) . '</b>',
|
2588 |
$this->_module_type
|
2589 |
)
|
2590 |
),
|
2591 |
sprintf(
|
2592 |
+
'<a href="%s"><b>%s</b></a> - %s',
|
2593 |
+
wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=all&paged=1&s=', 'deactivate-plugin_' . $this->_plugin_basename ),
|
2594 |
+
$deactivate_plugin_title,
|
2595 |
+
$deactivate_plugin_desc
|
2596 |
)
|
2597 |
)
|
2598 |
);
|
2599 |
break;
|
2600 |
// default:
|
2601 |
+
// $message = $this->get_text_inline( 'connectivity-test-fails-message' );
|
2602 |
// break;
|
2603 |
}
|
2604 |
}
|
2606 |
$message_id = 'failed_connect_api';
|
2607 |
$type = 'error';
|
2608 |
|
2609 |
+
$connectivity_test_fails_message = $this->esc_html_inline( 'From unknown reason, the API connectivity test failed.', 'connectivity-test-fails-message' );
|
2610 |
+
|
2611 |
if ( false === $message ) {
|
2612 |
if ( $is_first_failure ) {
|
2613 |
// First attempt failed.
|
2614 |
$message = sprintf(
|
2615 |
+
$x_requires_access_to_api . ' ' .
|
2616 |
+
$connectivity_test_fails_message . ' ' .
|
2617 |
+
$this->esc_html_inline( '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?', 'connectivity-test-maybe-temporary' ) . '<br><br>' .
|
2618 |
'%s',
|
2619 |
'<b>' . $this->get_plugin_name() . '</b>',
|
2620 |
sprintf(
|
2621 |
'<div id="fs_firewall_issue_options">%s %s</div>',
|
2622 |
sprintf(
|
2623 |
'<a class="button button-primary fs-resolve" data-type="retry_ping" href="#">%s</a>',
|
2624 |
+
$this->get_text_inline( 'Yes - do your thing', 'yes-do-your-thing' )
|
2625 |
),
|
2626 |
sprintf(
|
2627 |
'<a href="%s" class="button">%s</a>',
|
2628 |
+
wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=all&paged=1&s=', 'deactivate-plugin_' . $this->_plugin_basename ),
|
2629 |
+
$this->get_text_inline( 'No - just deactivate', 'no-deactivate' )
|
2630 |
)
|
2631 |
)
|
2632 |
);
|
2636 |
} else {
|
2637 |
// Second connectivity attempt failed.
|
2638 |
$message = sprintf(
|
2639 |
+
$x_requires_access_to_api . ' ' .
|
2640 |
+
$connectivity_test_fails_message . ' ' .
|
2641 |
+
$happy_to_resolve_issue_asap .
|
2642 |
' %s',
|
2643 |
'<b>' . $this->get_plugin_name() . '</b>',
|
2644 |
sprintf(
|
2645 |
'<ol id="fs_firewall_issue_options"><li>%s</li><li>%s</li><li>%s</li></ol>',
|
2646 |
sprintf(
|
2647 |
'<a class="fs-resolve" data-type="general" href="#"><b>%s</b></a>%s',
|
2648 |
+
$fix_issue_title,
|
2649 |
' - ' . sprintf(
|
2650 |
+
$fix_issue_desc,
|
2651 |
'<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
|
2652 |
)
|
2653 |
),
|
2654 |
sprintf(
|
2655 |
+
'<a href="%s" target="_blank"><b>%s</b></a> - %s',
|
2656 |
sprintf( 'https://wordpress.org/plugins/%s/download/', $this->_slug ),
|
2657 |
+
$install_previous_title,
|
2658 |
+
$install_previous_desc
|
2659 |
),
|
2660 |
sprintf(
|
2661 |
+
'<a href="%s"><b>%s</b></a> - %s',
|
2662 |
+
wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . $this->_plugin_basename . '&plugin_status=all&paged=1&s=', 'deactivate-plugin_' . $this->_plugin_basename ),
|
2663 |
+
$deactivate_plugin_title,
|
2664 |
+
$deactivate_plugin_desc
|
2665 |
)
|
2666 |
)
|
2667 |
);
|
2671 |
$this->_admin_notices->add_sticky(
|
2672 |
$message,
|
2673 |
$message_id,
|
2674 |
+
$this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...',
|
2675 |
$type
|
2676 |
);
|
2677 |
}
|
2738 |
|
2739 |
$this->_admin_notices->add_sticky(
|
2740 |
sprintf(
|
2741 |
+
$this->get_text_inline( '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.', 'fix-request-sent-message' ),
|
2742 |
'<a href="mailto:' . $admin_email . '">' . $admin_email . '</a>'
|
2743 |
),
|
2744 |
'server_details_sent'
|
3129 |
|
3130 |
$this->_admin_notices->add(
|
3131 |
( ! empty( $parent_name ) ?
|
3132 |
+
sprintf( $this->get_text_x_inline( '%s cannot run without %s.', 'addonX cannot run without pluginY', 'addon-x-cannot-run-without-y' ), $this->get_plugin_name(), $parent_name ) :
|
3133 |
+
sprintf( $this->get_text_x_inline( '%s cannot run without the plugin.', 'addonX cannot run...', 'addon-x-cannot-run-without-parent' ), $this->get_plugin_name() )
|
3134 |
),
|
3135 |
+
$this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...',
|
3136 |
'error'
|
3137 |
);
|
3138 |
|
3251 |
$this->_logger->api_error( $result );
|
3252 |
|
3253 |
self::shoot_ajax_failure(
|
3254 |
+
sprintf( $this->get_text_inline( 'Unexpected API error. Please contact the %s\'s author with the following error.', 'unexpected-api-error' ), $this->_module_type ) .
|
3255 |
( $this->is_api_error( $result ) && isset( $result->error ) ?
|
3256 |
$result->error->message :
|
3257 |
var_export( $result, true ) )
|
3276 |
$this->_logger->api_error( $result );
|
3277 |
|
3278 |
self::shoot_ajax_failure(
|
3279 |
+
sprintf( $this->get_text_inline( 'Unexpected API error. Please contact the %s\'s author with the following error.', 'unexpected-api-error' ), $this->_module_type ) .
|
3280 |
( $this->is_api_error( $result ) && isset( $result->error ) ?
|
3281 |
$result->error->message :
|
3282 |
var_export( $result, true ) )
|
3463 |
new FS_Plugin();
|
3464 |
|
3465 |
$plugin->update( array(
|
3466 |
+
'id' => $id,
|
3467 |
+
'type' => $this->get_option( $plugin_info, 'type', $this->_module_type),
|
3468 |
+
'public_key' => $public_key,
|
3469 |
+
'slug' => $this->_slug,
|
3470 |
+
'parent_plugin_id' => $parent_id,
|
3471 |
+
'version' => $this->get_plugin_version(),
|
3472 |
+
'title' => $this->get_plugin_name(),
|
3473 |
+
'file' => $this->_plugin_basename,
|
3474 |
+
'is_premium' => $this->get_bool_option( $plugin_info, 'is_premium', true ),
|
3475 |
+
'is_live' => $this->get_bool_option( $plugin_info, 'is_live', true ),
|
3476 |
+
'affiliate_moderation' => $this->get_option( $plugin_info, 'has_affiliation' ),
|
3477 |
) );
|
3478 |
|
3479 |
if ( $plugin->is_updated() ) {
|
3682 |
'license_activated',
|
3683 |
) );
|
3684 |
|
3685 |
+
if ( ! $this->is_only_premium() ) {
|
3686 |
+
$this->_admin_notices->add_sticky(
|
3687 |
+
sprintf( $this->get_text_inline( 'Premium %s version was successfully activated.', 'premium-activated-message' ), $this->_module_type ),
|
3688 |
+
'premium_activated',
|
3689 |
+
$this->get_text_x_inline( 'W00t',
|
3690 |
+
'Used to express elation, enthusiasm, or triumph (especially in electronic communication).', 'woot' ) . '!'
|
3691 |
+
);
|
3692 |
+
}
|
3693 |
} else {
|
3694 |
// Remove sticky message related to premium code activation.
|
3695 |
$this->_admin_notices->remove_sticky( 'premium_activated' );
|
3700 |
if ( $this->is_paying() && ! $this->is_premium() ) {
|
3701 |
$this->_admin_notices->add_sticky(
|
3702 |
sprintf(
|
3703 |
+
/* translators: %s: License type (e.g. you have a professional license) */
|
3704 |
+
$this->get_text_inline( 'You have a %s license.', 'you-have-x-license' ),
|
3705 |
$this->_site->plan->title
|
3706 |
) . $this->get_complete_upgrade_instructions(),
|
3707 |
'plan_upgraded',
|
3708 |
+
$this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!'
|
3709 |
);
|
3710 |
}
|
3711 |
}
|
3968 |
|
3969 |
$this->_parent->_admin_notices->add_sticky(
|
3970 |
sprintf(
|
3971 |
+
($is_after_trial_cancel ?
|
3972 |
+
$this->_parent->get_text_inline(
|
3973 |
+
'%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.',
|
3974 |
+
'addon-trial-cancelled-message'
|
3975 |
+
) :
|
3976 |
+
$this->_parent->get_text_inline(
|
3977 |
+
'%s is a premium only add-on. You have to purchase a license first before activating the plugin.',
|
3978 |
+
'addon-no-license-message'
|
3979 |
+
)
|
3980 |
),
|
3981 |
'<b>' . $this->_plugin->title . '</b>'
|
3982 |
) . ' ' . sprintf(
|
3983 |
'<a href="%s" aria-label="%s" class="button button-primary" style="margin-left: 10px; vertical-align: middle;">%s ➜</a>',
|
3984 |
$this->_parent->addon_url( $this->_slug ),
|
3985 |
+
esc_attr( sprintf( $this->_parent->get_text_inline( 'More information about %s', 'more-information-about-x' ), $this->_plugin->title ) ),
|
3986 |
+
$this->_parent->get_text_inline( 'Purchase License', 'purchase-license' )
|
3987 |
),
|
3988 |
'no_addon_license_' . $this->_slug,
|
3989 |
+
( $is_after_trial_cancel ? '' : $this->_parent->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...' ),
|
3990 |
( $is_after_trial_cancel ? 'success' : 'error' )
|
3991 |
);
|
3992 |
|
4420 |
|
4421 |
$this->_admin_notices->add_sticky(
|
4422 |
sprintf(
|
4423 |
+
$this->get_text_inline( '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.', 'pending-activation-message' ),
|
4424 |
'<b>' . $this->get_plugin_name() . '</b>',
|
4425 |
'<b>' . $email . '</b>',
|
4426 |
+
( $is_pending_trial ?
|
4427 |
+
$this->get_text_inline( 'start the trial', 'start-the-trial' ) :
|
4428 |
+
$this->get_text_inline( 'complete the install', 'complete-the-install' ) )
|
4429 |
),
|
4430 |
'activation_pending',
|
4431 |
'Thanks!'
|
4504 |
// Show notice for new plugin installations.
|
4505 |
$this->_admin_notices->add(
|
4506 |
sprintf(
|
4507 |
+
$this->get_text_inline( 'You are just one step away - %s', 'you-are-step-away' ),
|
4508 |
sprintf( '<b><a href="%s">%s</a></b>',
|
4509 |
$this->get_activation_url(),
|
4510 |
+
sprintf( $this->get_text_x_inline( 'Complete "%s" Activation Now',
|
4511 |
+
'%s - plugin name. As complete "PluginX" activation now', 'activate-x-now' ), $this->get_plugin_name() )
|
4512 |
)
|
4513 |
),
|
4514 |
'',
|
4521 |
// Show notice for new plugin installations.
|
4522 |
$this->_admin_notices->add_sticky(
|
4523 |
sprintf(
|
4524 |
+
$this->get_text_inline( 'We made a few tweaks to the %s, %s', 'few-plugin-tweaks' ),
|
4525 |
$this->_module_type,
|
4526 |
sprintf( '<b><a href="%s">%s</a></b>',
|
4527 |
$this->get_activation_url(),
|
4528 |
+
sprintf( $this->get_text_inline( 'Opt in to make "%s" Better!', 'optin-x-now' ), $this->get_plugin_name() )
|
4529 |
)
|
4530 |
),
|
4531 |
'connect_account',
|
4910 |
// If activating the premium module version, add an admin notice to congratulate for an upgrade completion.
|
4911 |
if ( $is_premium_version_activation ) {
|
4912 |
$this->_admin_notices->add(
|
4913 |
+
sprintf( $this->get_text_inline( 'The upgrade of %s was successfully completed.', 'successful-version-upgrade-message' ), sprintf( '<b>%s</b>', $this->_plugin->title ) ),
|
4914 |
+
$this->get_text_x_inline( 'W00t',
|
4915 |
+
'Used to express elation, enthusiasm, or triumph (especially in electronic communication).', 'woot' ) . '!'
|
4916 |
);
|
4917 |
}
|
4918 |
} else if ( $this->is_anonymous() ) {
|
5995 |
*/
|
5996 |
function get_module_label( $lowercase = false ) {
|
5997 |
$label = $this->is_addon() ?
|
5998 |
+
$this->get_text_inline( 'Add-On', 'addon' ) :
|
5999 |
( $this->is_plugin() ?
|
6000 |
+
$this->get_text_inline( 'Plugin', 'plugin' ) :
|
6001 |
+
$this->get_text_inline( 'Theme', 'theme' ) );
|
6002 |
|
6003 |
if ( $lowercase ) {
|
6004 |
+
$label = strtolower( $label );
|
6005 |
}
|
6006 |
|
6007 |
return $label;
|
7122 |
if ( isset( $install->error ) ) {
|
7123 |
$error = $install->error->message;
|
7124 |
} else {
|
7125 |
+
$fs->_sync_license( true );
|
|
|
|
|
7126 |
|
7127 |
+
$next_page = $fs->is_addon() ?
|
7128 |
+
$fs->get_parent_instance()->get_account_url() :
|
7129 |
+
$fs->get_account_url();
|
7130 |
|
7131 |
+
$fs->reconnect_locally();
|
7132 |
}
|
7133 |
} else {
|
7134 |
$next_page = $fs->opt_in( false, false, false, $license_key );
|
7255 |
$error = $result->error;
|
7256 |
|
7257 |
if ( in_array( $error->code, array( 'invalid_email', 'no_user' ) ) ) {
|
7258 |
+
$error = $this->get_text_inline( "We couldn't find your email address in the system, are you sure it's the right address?", 'email-not-found' );
|
7259 |
} else if ( 'no_license' === $error->code ) {
|
7260 |
+
$error = $this->get_text_inline( "We can't see any active licenses associated with that email address, are you sure it's the right address?", 'no-active-licenses' );
|
7261 |
} else {
|
7262 |
$error = $error->message;
|
7263 |
}
|
7268 |
);
|
7269 |
|
7270 |
if ( false !== $error ) {
|
7271 |
+
$licenses['error'] = sprintf( '%s... %s', $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ), strtolower( $error ) );
|
7272 |
}
|
7273 |
|
7274 |
echo json_encode( $licenses );
|
7301 |
if ( self::is_ajax() &&
|
7302 |
'admin-ajax.php' === $pagenow
|
7303 |
) {
|
7304 |
+
$referer = fs_get_raw_referer();
|
7305 |
|
7306 |
if ( is_string( $referer ) ) {
|
7307 |
$parts = explode( '?', $referer );
|
7338 |
return ( 'themes.php' === self::get_current_page() );
|
7339 |
}
|
7340 |
|
7341 |
+
#----------------------------------------------------------------------------------
|
7342 |
+
#region Affiliation
|
7343 |
+
#----------------------------------------------------------------------------------
|
7344 |
+
|
7345 |
+
/**
|
7346 |
+
* @author Leo Fajardo
|
7347 |
+
* @since 1.2.3
|
7348 |
+
*
|
7349 |
+
* @return bool
|
7350 |
+
*/
|
7351 |
+
function has_affiliate_program() {
|
7352 |
+
if ( ! is_object( $this->_plugin ) ) {
|
7353 |
+
return false;
|
7354 |
+
}
|
7355 |
+
|
7356 |
+
return $this->_plugin->has_affiliate_program();
|
7357 |
+
}
|
7358 |
+
|
7359 |
+
/**
|
7360 |
+
* @author Leo Fajardo (@leorw)
|
7361 |
+
* @since 1.2.4
|
7362 |
+
*/
|
7363 |
+
private function fetch_affiliate_terms() {
|
7364 |
+
if ( ! is_object( $this->plugin_affiliate_terms ) ) {
|
7365 |
+
$plugins_api = $this->get_api_plugin_scope();
|
7366 |
+
$affiliate_terms = $plugins_api->get( '/aff.json?type=affiliation', false, WP_FS__TIME_WEEK_IN_SEC );
|
7367 |
+
|
7368 |
+
if ( ! $this->is_api_result_entity( $affiliate_terms ) ) {
|
7369 |
+
return;
|
7370 |
+
}
|
7371 |
+
|
7372 |
+
$this->plugin_affiliate_terms = new FS_AffiliateTerms( $affiliate_terms );
|
7373 |
+
}
|
7374 |
+
}
|
7375 |
+
|
7376 |
+
/**
|
7377 |
+
* @author Leo Fajardo (@leorw)
|
7378 |
+
* @since 1.2.4
|
7379 |
+
*/
|
7380 |
+
private function fetch_affiliate_and_custom_terms() {
|
7381 |
+
if ( ! empty( $this->_storage->affiliate_application_data ) ) {
|
7382 |
+
$application_data = $this->_storage->affiliate_application_data;
|
7383 |
+
$flush = ( ! isset( $application_data['status'] ) || 'pending' === $application_data['status'] );
|
7384 |
+
|
7385 |
+
$users_api = $this->get_api_user_scope();
|
7386 |
+
$result = $users_api->get( "/plugins/{$this->_plugin->id}/aff/{$this->plugin_affiliate_terms->id}/affiliates.json", $flush, WP_FS__TIME_WEEK_IN_SEC );
|
7387 |
+
if ( $this->is_api_result_object( $result, 'affiliates' ) ) {
|
7388 |
+
if ( ! empty( $result->affiliates ) ) {
|
7389 |
+
$affiliate = new FS_Affiliate( $result->affiliates[0] );
|
7390 |
+
|
7391 |
+
if ( ! isset( $application_data['status'] ) || $application_data['status'] !== $affiliate->status ) {
|
7392 |
+
$application_data['status'] = $affiliate->status;
|
7393 |
+
$this->_storage->affiliate_application_data = $application_data;
|
7394 |
+
}
|
7395 |
+
|
7396 |
+
if ( $affiliate->is_using_custom_terms ) {
|
7397 |
+
$affiliate_terms = $users_api->get( "/plugins/{$this->_plugin->id}/affiliates/{$affiliate->id}/aff/{$affiliate->custom_affiliate_terms_id}.json", $flush, WP_FS__TIME_WEEK_IN_SEC );
|
7398 |
+
if ( $this->is_api_result_entity( $affiliate_terms ) ) {
|
7399 |
+
$this->custom_affiliate_terms = new FS_AffiliateTerms( $affiliate_terms );
|
7400 |
+
}
|
7401 |
+
}
|
7402 |
+
|
7403 |
+
$this->affiliate = $affiliate;
|
7404 |
+
}
|
7405 |
+
}
|
7406 |
+
}
|
7407 |
+
}
|
7408 |
+
|
7409 |
+
/**
|
7410 |
+
* @author Leo Fajardo (@leorw)
|
7411 |
+
* @since 1.2.3
|
7412 |
+
*/
|
7413 |
+
private function fetch_affiliate_and_terms() {
|
7414 |
+
$this->_logger->entrance();
|
7415 |
+
|
7416 |
+
$this->fetch_affiliate_terms();
|
7417 |
+
$this->fetch_affiliate_and_custom_terms();
|
7418 |
+
}
|
7419 |
+
|
7420 |
+
/**
|
7421 |
+
* @author Leo Fajardo
|
7422 |
+
* @since 1.2.3
|
7423 |
+
*
|
7424 |
+
* @return FS_Affiliate
|
7425 |
+
*/
|
7426 |
+
function get_affiliate() {
|
7427 |
+
return $this->affiliate;
|
7428 |
+
}
|
7429 |
+
|
7430 |
+
|
7431 |
+
/**
|
7432 |
+
* @author Leo Fajardo
|
7433 |
+
* @since 1.2.3
|
7434 |
+
*
|
7435 |
+
* @return FS_AffiliateTerms
|
7436 |
+
*/
|
7437 |
+
function get_affiliate_terms() {
|
7438 |
+
return is_object( $this->custom_affiliate_terms ) ?
|
7439 |
+
$this->custom_affiliate_terms :
|
7440 |
+
$this->plugin_affiliate_terms;
|
7441 |
+
}
|
7442 |
+
|
7443 |
+
/**
|
7444 |
+
* @author Leo Fajardo
|
7445 |
+
* @since 1.2.3
|
7446 |
+
*
|
7447 |
+
* @return FS_Affiliate|null
|
7448 |
+
*/
|
7449 |
+
function _submit_affiliate_application() {
|
7450 |
+
$this->_logger->entrance();
|
7451 |
+
|
7452 |
+
$this->check_ajax_referer( 'submit_affiliate_application' );
|
7453 |
+
|
7454 |
+
if ( ! $this->is_user_admin() ) {
|
7455 |
+
// Only for admins.
|
7456 |
+
self::shoot_ajax_failure();
|
7457 |
+
}
|
7458 |
+
|
7459 |
+
$affiliate = fs_request_get( 'affiliate' );
|
7460 |
+
|
7461 |
+
if ( empty( $affiliate['promotion_methods'] ) ) {
|
7462 |
+
unset( $affiliate['promotion_methods'] );
|
7463 |
+
}
|
7464 |
+
|
7465 |
+
if ( ! empty( $affiliate['additional_domains'] ) ) {
|
7466 |
+
$affiliate['additional_domains'] = array_unique( $affiliate['additional_domains'] );
|
7467 |
+
}
|
7468 |
+
|
7469 |
+
if ( ! $this->is_registered() ) {
|
7470 |
+
// Opt in but don't track usage.
|
7471 |
+
$next_page = $this->opt_in(
|
7472 |
+
false,
|
7473 |
+
false,
|
7474 |
+
false,
|
7475 |
+
false,
|
7476 |
+
false,
|
7477 |
+
false,
|
7478 |
+
true
|
7479 |
+
);
|
7480 |
+
|
7481 |
+
if ( is_object( $next_page ) && $this->is_api_error( $next_page ) ) {
|
7482 |
+
self::shoot_ajax_failure(
|
7483 |
+
isset( $next_page->error ) ?
|
7484 |
+
$next_page->error->message :
|
7485 |
+
var_export( $next_page, true )
|
7486 |
+
);
|
7487 |
+
} else if ( $this->is_pending_activation() ) {
|
7488 |
+
self::shoot_ajax_failure( $this->get_text_inline( 'Account is pending activation.', 'account-is-pending-activation' ) );
|
7489 |
+
}
|
7490 |
+
}
|
7491 |
+
|
7492 |
+
$this->fetch_affiliate_terms();
|
7493 |
+
|
7494 |
+
$api = $this->get_api_user_scope();
|
7495 |
+
$result = $api->call(
|
7496 |
+
( "/plugins/{$this->_plugin->id}/aff/{$this->plugin_affiliate_terms->id}/affiliates.json" ),
|
7497 |
+
'post',
|
7498 |
+
$affiliate
|
7499 |
+
);
|
7500 |
+
|
7501 |
+
if ( $this->is_api_error( $result ) ) {
|
7502 |
+
self::shoot_ajax_failure(
|
7503 |
+
isset( $result->error ) ?
|
7504 |
+
$result->error->message :
|
7505 |
+
var_export( $result, true )
|
7506 |
+
);
|
7507 |
+
}
|
7508 |
+
else
|
7509 |
+
{
|
7510 |
+
if ( $this->_admin_notices->has_sticky( 'affiliate_program' ) ) {
|
7511 |
+
$this->_admin_notices->remove_sticky( 'affiliate_program' );
|
7512 |
+
}
|
7513 |
+
|
7514 |
+
$affiliate_application_data = array(
|
7515 |
+
'status' => 'pending',
|
7516 |
+
'stats_description' => $affiliate['stats_description'],
|
7517 |
+
'promotion_method_description' => $affiliate['promotion_method_description'],
|
7518 |
+
);
|
7519 |
+
|
7520 |
+
if ( ! empty( $affiliate['promotion_methods'] ) ) {
|
7521 |
+
$affiliate_application_data['promotion_methods'] = $affiliate['promotion_methods'];
|
7522 |
+
}
|
7523 |
+
|
7524 |
+
if ( ! empty( $affiliate['domain'] ) ) {
|
7525 |
+
$affiliate_application_data['domain'] = $affiliate['domain'];
|
7526 |
+
}
|
7527 |
+
|
7528 |
+
if ( ! empty( $affiliate['additional_domains'] ) ) {
|
7529 |
+
$affiliate_application_data['additional_domains'] = $affiliate['additional_domains'];
|
7530 |
+
}
|
7531 |
+
|
7532 |
+
$this->_storage->affiliate_application_data = $affiliate_application_data;
|
7533 |
+
}
|
7534 |
+
|
7535 |
+
// Purge cached affiliate.
|
7536 |
+
$api->purge_cache( 'affiliate.json' );
|
7537 |
+
|
7538 |
+
self::shoot_ajax_success( $result );
|
7539 |
+
}
|
7540 |
+
|
7541 |
+
/**
|
7542 |
+
* @author Leo Fajardo
|
7543 |
+
* @since 1.2.3
|
7544 |
+
*
|
7545 |
+
* @return array|null
|
7546 |
+
*/
|
7547 |
+
function get_affiliate_application_data() {
|
7548 |
+
if ( empty( $this->_storage->affiliate_application_data ) ) {
|
7549 |
+
return null;
|
7550 |
+
}
|
7551 |
+
|
7552 |
+
return $this->_storage->affiliate_application_data;
|
7553 |
+
}
|
7554 |
+
|
7555 |
+
#endregion Affiliation ------------------------------------------------------------
|
7556 |
+
|
7557 |
#----------------------------------------------------------------------------------
|
7558 |
#region URL Generators
|
7559 |
#----------------------------------------------------------------------------------
|
8003 |
) ), admin_url( 'admin.php', 'admin' ) );
|
8004 |
} else {
|
8005 |
// Plugin without a settings page.
|
8006 |
+
return add_query_arg(
|
8007 |
+
$params,
|
8008 |
+
admin_url( 'plugins.php' )
|
8009 |
+
);
|
8010 |
}
|
8011 |
}
|
8012 |
}
|
8427 |
$this->_site = clone $site;
|
8428 |
$this->_site->plan = self::decrypt_entity( $this->_site->plan );
|
8429 |
|
8430 |
+
/**
|
8431 |
+
* If the install owner's details are not stored locally, use the previous user's details if available.
|
8432 |
+
*
|
8433 |
+
* @author Leo Fajardo (@leorw)
|
8434 |
+
*/
|
8435 |
+
if ( ! isset( $users[ $this->_site->user_id ] ) && FS_User::is_valid_id( $this->_storage->prev_user_id ) ) {
|
8436 |
+
$user_id = $this->_storage->prev_user_id;
|
8437 |
+
} else {
|
8438 |
+
$user_id = $this->_site->user_id;
|
8439 |
+
}
|
8440 |
+
|
8441 |
// Load relevant user.
|
8442 |
+
$this->_user = clone $users[ $user_id ];
|
8443 |
|
8444 |
// Load plans.
|
8445 |
$this->_plans = $plans[ $this->_slug ];
|
8587 |
* In this case, the user and site info will be sent to the server but no
|
8588 |
* data will be saved to the WP installation's database.
|
8589 |
* @param number|bool $trial_plan_id
|
8590 |
+
* @param bool $is_disconnected Whether or not to opt in without tracking.
|
8591 |
*
|
8592 |
* @return string|object
|
8593 |
* @use WP_Error
|
8598 |
$last = false,
|
8599 |
$license_key = false,
|
8600 |
$is_uninstall = false,
|
8601 |
+
$trial_plan_id = false,
|
8602 |
+
$is_disconnected = false
|
8603 |
) {
|
8604 |
$this->_logger->entrance();
|
8605 |
|
8652 |
);
|
8653 |
}
|
8654 |
|
8655 |
+
if ( isset( $params['license_key'] ) ) {
|
8656 |
+
$fs_user = Freemius::_get_user_by_email( $email );
|
8657 |
+
|
8658 |
+
if ( is_object( $fs_user ) ) {
|
8659 |
+
/**
|
8660 |
+
* If opting in with a context license and the context WP Admin user already opted in
|
8661 |
+
* before from the current site, add the user context security params to avoid the
|
8662 |
+
* unnecessry email activation when the context license is owned by the same context user.
|
8663 |
+
*
|
8664 |
+
* @author Leo Fajardo (@leorw)
|
8665 |
+
* @since 1.2.3
|
8666 |
+
*/
|
8667 |
+
$params = array_merge( $params, FS_Security::instance()->get_context_params(
|
8668 |
+
$fs_user,
|
8669 |
+
false,
|
8670 |
+
'install_with_existing_user'
|
8671 |
+
) );
|
8672 |
+
}
|
8673 |
+
}
|
8674 |
+
|
8675 |
+
$params['is_disconnected'] = $is_disconnected;
|
8676 |
+
$params['format'] = 'json';
|
8677 |
|
8678 |
$url = WP_FS__ADDRESS . '/action/service/user/install/';
|
8679 |
if ( isset( $_COOKIE['XDEBUG_SESSION'] ) ) {
|
8730 |
return true;
|
8731 |
}
|
8732 |
|
8733 |
+
/**
|
8734 |
+
* When json_decode() executed on PHP 5.2 with an invalid JSON, it will throw a PHP warning. Unfortunately, the new Theme Check doesn't allow PHP silencing and the theme review team isn't open to change that, therefore, instead of using `@json_decode()` we had to use the method without the `@` directive.
|
8735 |
+
*
|
8736 |
+
* @author Vova Feldman (@svovaf)
|
8737 |
+
* @since 1.2.3
|
8738 |
+
* @link https://themes.trac.wordpress.org/ticket/46134#comment:5
|
8739 |
+
* @link https://themes.trac.wordpress.org/ticket/46134#comment:9
|
8740 |
+
* @link https://themes.trac.wordpress.org/ticket/46134#comment:12
|
8741 |
+
* @link https://themes.trac.wordpress.org/ticket/46134#comment:14
|
8742 |
+
*/
|
8743 |
+
$decoded = is_string( $response['body'] ) ?
|
8744 |
+
json_decode( $response['body'] ) :
|
8745 |
+
null;
|
8746 |
|
8747 |
if ( empty( $decoded ) ) {
|
8748 |
return false;
|
8760 |
} else if ( isset( $decoded->pending_activation ) && $decoded->pending_activation ) {
|
8761 |
// Pending activation, add message.
|
8762 |
return $this->set_pending_confirmation(
|
8763 |
+
( isset( $decoded->email ) ?
|
8764 |
+
$decoded->email :
|
8765 |
+
true ),
|
8766 |
false,
|
8767 |
$filtered_license_key,
|
8768 |
! empty( $params['trial_plan_id'] )
|
8828 |
|
8829 |
$this->_admin_notices->remove_sticky( 'connect_account' );
|
8830 |
|
8831 |
+
if ( $this->is_pending_activation() || ! $this->has_settings_menu() ) {
|
8832 |
// Remove pending activation sticky notice (if still exist).
|
8833 |
$this->_admin_notices->remove_sticky( 'activation_pending' );
|
8834 |
|
8837 |
|
8838 |
if ( ! $this->is_paying_or_trial() ) {
|
8839 |
$this->_admin_notices->add_sticky(
|
8840 |
+
sprintf( $this->get_text_x_inline( '%s activation was successfully completed.',
|
8841 |
+
'pluginX activation was successfully...', 'plugin-x-activation-message' ), '<b>' . $this->get_plugin_name() . '</b>' ),
|
8842 |
'activation_complete'
|
8843 |
);
|
8844 |
}
|
8845 |
}
|
8846 |
|
8847 |
if ( $this->is_paying_or_trial() ) {
|
8848 |
+
if ( ! $this->is_premium() || ! $this->has_premium_version() || ! $this->has_settings_menu() ) {
|
8849 |
if ( $this->is_paying() ) {
|
8850 |
$this->_admin_notices->add_sticky(
|
8851 |
sprintf(
|
8852 |
+
$this->get_text_inline( 'Your account was successfully activated with the %s plan.', 'activation-with-plan-x-message' ),
|
8853 |
$this->_site->plan->title
|
8854 |
) . $this->get_complete_upgrade_instructions(),
|
8855 |
'plan_upgraded',
|
8856 |
+
$this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!'
|
8857 |
);
|
8858 |
} else {
|
8859 |
$this->_admin_notices->add_sticky(
|
8860 |
sprintf(
|
8861 |
+
$this->get_text_inline( 'Your trial has been successfully started.', 'trial-started-message' ),
|
8862 |
'<i>' . $this->get_plugin_name() . '</i>'
|
8863 |
) . $this->get_complete_upgrade_instructions( $this->_storage->trial_plan->title ),
|
8864 |
'trial_started',
|
8865 |
+
$this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!'
|
8866 |
);
|
8867 |
}
|
8868 |
}
|
9147 |
$install = $this->apply_filters( 'after_install_failure', $install, $args );
|
9148 |
|
9149 |
$this->_admin_notices->add(
|
9150 |
+
sprintf( $this->get_text_inline( 'Couldn\'t activate %s.', 'could-not-activate-x' ), $this->get_plugin_name() ) . ' ' .
|
9151 |
+
$this->get_text_inline( 'Please contact us with the following message:', 'contact-us-with-error-message' ) . ' ' . '<b>' . $install->error->message . '</b>',
|
9152 |
+
$this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...',
|
9153 |
'error'
|
9154 |
);
|
9155 |
|
9156 |
if ( $redirect ) {
|
9157 |
+
/**
|
9158 |
+
* We set the user before getting the user scope API handler, so the user became temporarily
|
9159 |
+
* registered (`is_registered() = true`). Since the API returned an error and we will redirect,
|
9160 |
+
* we have to set the user to `null`, otherwise, the user will be redirected to the wrong
|
9161 |
+
* activation page based on the return value of `is_registered()`. In addition, in case the
|
9162 |
+
* context plugin doesn't have a settings menu and the default page is the `Plugins` page,
|
9163 |
+
* misleading plugin activation errors will be shown on the `Plugins` page.
|
9164 |
+
*
|
9165 |
+
* @author Leo Fajardo (@leorw)
|
9166 |
+
*/
|
9167 |
+
$this->_user = null;
|
9168 |
+
|
9169 |
+
fs_redirect( $this->get_activation_url( array( 'error' => $install->error->message ) ) );
|
9170 |
}
|
9171 |
|
9172 |
return $install;
|
9203 |
|
9204 |
if ( isset( $addon_install->error ) ) {
|
9205 |
$this->_admin_notices->add(
|
9206 |
+
sprintf( $this->get_text_inline( 'Couldn\'t activate %s.', 'could-not-activate-x' ), $this->get_plugin_name() ) . ' ' .
|
9207 |
+
$this->get_text_inline( 'Please contact us with the following message:', 'contact-us-with-error-message' ) . ' ' . '<b>' . $addon_install->error->message . '</b>',
|
9208 |
+
$this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...',
|
9209 |
'error'
|
9210 |
);
|
9211 |
|
9264 |
|
9265 |
if ( isset( $parent_install->error ) ) {
|
9266 |
$this->_admin_notices->add(
|
9267 |
+
sprintf( $this->get_text_inline( 'Couldn\'t activate %s.', 'could-not-activate-x' ), $this->get_plugin_name() ) . ' ' .
|
9268 |
+
$this->get_text_inline( 'Please contact us with the following message:', 'contact-us-with-error-message' ) . ' ' . '<b>' . $parent_install->error->message . '</b>',
|
9269 |
+
$this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...',
|
9270 |
'error'
|
9271 |
);
|
9272 |
|
9273 |
return;
|
9274 |
}
|
9275 |
|
9276 |
+
$parent_fs->_admin_notices->remove_sticky( 'connect_account' );
|
9277 |
+
|
9278 |
+
if ( $parent_fs->is_pending_activation() ) {
|
9279 |
+
$parent_fs->_admin_notices->remove_sticky( 'activation_pending' );
|
9280 |
+
|
9281 |
+
unset( $parent_fs->_storage->is_pending_activation );
|
9282 |
+
}
|
9283 |
+
|
9284 |
// First of all, set site info - otherwise we won't
|
9285 |
// be able to invoke API calls.
|
9286 |
$parent_fs->_site = new FS_Site( $parent_install );
|
9473 |
|
9474 |
if ( false !== $hook ) {
|
9475 |
if ( fs_request_is_action( $this->get_unique_affix() . '_activate_existing' ) ) {
|
9476 |
+
$this->_install_with_current_user();
|
9477 |
} else if ( fs_request_is_action( $this->get_unique_affix() . '_activate_new' ) ) {
|
9478 |
+
$this->_install_with_new_user();
|
9479 |
}
|
9480 |
}
|
9481 |
}
|
9523 |
* @return string
|
9524 |
*/
|
9525 |
function get_pricing_cta_label() {
|
9526 |
+
$label = $this->get_text_inline( 'Upgrade', 'upgrade' );
|
9527 |
|
9528 |
if ( $this->is_in_trial_promotion() &&
|
9529 |
! $this->is_paying_or_trial()
|
9530 |
) {
|
9531 |
// If running a trial promotion, modify the pricing to load the trial.
|
9532 |
+
$label = $this->get_text_inline( 'Start Trial', 'start-trial' );
|
9533 |
} else if ( $this->is_paying() ) {
|
9534 |
+
$label = $this->get_text_inline( 'Pricing', 'pricing' );
|
9535 |
}
|
9536 |
|
9537 |
return $label;
|
9568 |
* @since 1.2.2.7 Also add submenu items when running in a free .org theme so the tabs will be visible.
|
9569 |
*/
|
9570 |
if ( ! $this->is_activation_mode() || $this->is_free_wp_org_theme() ) {
|
9571 |
+
if ( $this->has_affiliate_program() ) {
|
9572 |
+
// Add affiliation page.
|
9573 |
+
$this->add_submenu_item(
|
9574 |
+
$this->get_text_inline( 'Affiliation', 'affiliation' ),
|
9575 |
+
array( &$this, '_affiliation_page_render' ),
|
9576 |
+
$this->get_plugin_name() . ' – ' . $this->get_text_inline( 'Affiliation', 'affiliation' ),
|
9577 |
+
'manage_options',
|
9578 |
+
'affiliation',
|
9579 |
+
'Freemius::_clean_admin_content_section',
|
9580 |
+
WP_FS__DEFAULT_PRIORITY,
|
9581 |
+
$this->is_submenu_item_visible( 'affiliation' )
|
9582 |
+
);
|
9583 |
+
}
|
9584 |
+
|
9585 |
if ( $this->is_registered() ) {
|
9586 |
$show_account = (
|
9587 |
$this->is_submenu_item_visible( 'account' ) &&
|
9593 |
|
9594 |
// Add user account page.
|
9595 |
$this->add_submenu_item(
|
9596 |
+
$this->get_text_inline( 'Account', 'account' ),
|
9597 |
array( &$this, '_account_page_render' ),
|
9598 |
+
$this->get_plugin_name() . ' – ' . $this->get_text_inline( 'Account', 'account' ),
|
9599 |
'manage_options',
|
9600 |
'account',
|
9601 |
array( &$this, '_account_page_load' ),
|
9606 |
|
9607 |
// Add contact page.
|
9608 |
$this->add_submenu_item(
|
9609 |
+
$this->get_text_inline( 'Contact Us', 'contact-us' ),
|
9610 |
array( &$this, '_contact_page_render' ),
|
9611 |
+
$this->get_plugin_name() . ' – ' . $this->get_text_inline( 'Contact Us', 'contact-us' ),
|
9612 |
'manage_options',
|
9613 |
'contact',
|
9614 |
'Freemius::_clean_admin_content_section',
|
9618 |
|
9619 |
if ( $this->has_addons() ) {
|
9620 |
$this->add_submenu_item(
|
9621 |
+
$this->get_text_inline( 'Add-Ons', 'add-ons' ),
|
9622 |
array( &$this, '_addons_page_render' ),
|
9623 |
+
$this->get_plugin_name() . ' – ' . $this->get_text_inline( 'Add-Ons', 'add-ons' ),
|
9624 |
'manage_options',
|
9625 |
'addons',
|
9626 |
array( &$this, '_addons_page_load' ),
|
9634 |
$this->is_pricing_page_visible()
|
9635 |
);
|
9636 |
|
9637 |
+
$pricing_cta_text = $this->get_pricing_cta_label();
|
9638 |
$pricing_class = 'upgrade-mode';
|
9639 |
if ( $show_pricing ) {
|
9640 |
if ( $this->is_in_trial_promotion() &&
|
9649 |
|
9650 |
// Add upgrade/pricing page.
|
9651 |
$this->add_submenu_item(
|
9652 |
+
$pricing_cta_text . ' ' . ( is_rtl() ? '←' : '➤' ),
|
9653 |
array( &$this, '_pricing_page_render' ),
|
9654 |
+
$this->get_plugin_name() . ' – ' . $this->get_text_x_inline( 'Pricing', 'noun', 'pricing' ),
|
9655 |
'manage_options',
|
9656 |
'pricing',
|
9657 |
'Freemius::_clean_admin_content_section',
|
9831 |
|
9832 |
if ( ! $this->is_activation_mode() ) {
|
9833 |
$this->add_submenu_link_item(
|
9834 |
+
$this->apply_filters( 'support_forum_submenu', $this->get_text_inline( 'Support Forum', 'support-forum' ) ),
|
9835 |
$this->get_support_forum_url(),
|
9836 |
'wp-support-forum',
|
9837 |
null,
|
10343 |
$encrypted_site = clone $this->_site;
|
10344 |
$encrypted_site->plan = self::_encrypt_entity( $this->_site->plan );
|
10345 |
|
10346 |
+
$sites = self::get_all_sites( $this->_module_type );
|
10347 |
+
|
10348 |
+
if ( empty( $this->_storage->prev_user_id ) && $this->_user->id != $this->_site->user_id ) {
|
10349 |
+
/**
|
10350 |
+
* Store the current user ID as the previous user ID so that the previous user can be used
|
10351 |
+
* as the install's owner while the new owner's details are not yet available.
|
10352 |
+
*
|
10353 |
+
* This will be executed only in the `replica` site. For example, there are 2 sites, namely `original`
|
10354 |
+
* and `replica`, then an ownership change was initiated and completed in the `original`, the `replica`
|
10355 |
+
* will be using the previous user until it is updated again (e.g.: until the next clone of `original`
|
10356 |
+
* into `replica`.
|
10357 |
+
*
|
10358 |
+
* @author Leo Fajardo (@leorw)
|
10359 |
+
*/
|
10360 |
+
$this->_storage->prev_user_id = $sites[ $this->_slug ]->user_id;
|
10361 |
+
}
|
10362 |
+
|
10363 |
$sites[ $this->_slug ] = $encrypted_site;
|
10364 |
|
10365 |
$this->set_account_option( 'sites', $sites, $store );
|
10571 |
$this->do_action( 'account_email_verified', $user->email );
|
10572 |
|
10573 |
$this->_admin_notices->add(
|
10574 |
+
$this->get_text_inline( 'Your email has been successfully verified - you are AWESOME!', 'email-verified-message' ),
|
10575 |
+
$this->get_text_x_inline( 'Right on', 'a positive response', 'right-on' ) . '!',
|
10576 |
'success',
|
10577 |
// Make admin sticky if account menu item is invisible,
|
10578 |
// since the page will be auto redirected to the plugin's
|
10704 |
* @return FS_Plugin_Plan[]|object
|
10705 |
*/
|
10706 |
private function _fetch_plugin_plans() {
|
10707 |
+
$this->_logger->entrance();
|
10708 |
+
$api = $this->get_api_site_scope();
|
10709 |
|
10710 |
+
/**
|
10711 |
+
* @since 1.2.3 When running in DEV mode, retrieve pending plans as well.
|
10712 |
+
*/
|
10713 |
+
$result = $api->get( '/plans.json?show_pending=' . ( $this->has_secret_key() ? 'true' : 'false' ), true );
|
10714 |
|
10715 |
+
if ( $this->is_api_result_object( $result, 'plans' ) && is_array( $result->plans ) ) {
|
10716 |
+
for ( $i = 0, $len = count( $result->plans ); $i < $len; $i ++ ) {
|
10717 |
+
$result->plans[ $i ] = new FS_Plugin_Plan( $result->plans[ $i ] );
|
10718 |
+
}
|
10719 |
|
10720 |
+
$result = $result->plans;
|
10721 |
+
}
|
10722 |
|
10723 |
+
return $result;
|
10724 |
+
}
|
10725 |
|
10726 |
/**
|
10727 |
* @author Vova Feldman (@svovaf)
|
11106 |
}
|
11107 |
|
11108 |
$this->_admin_notices->add_sticky(
|
11109 |
+
sprintf(
|
11110 |
+
( FS_Plan_Manager::instance()->has_free_plan( $plans ) ?
|
11111 |
+
$this->get_text_inline( 'Your %s Add-on plan was successfully upgraded.', 'addon-successfully-upgraded-message' ) :
|
11112 |
+
/* translators: %s:product name, e.g. Facebook add-on was successfully... */
|
11113 |
+
$this->get_text_inline( '%s Add-on was successfully purchased.', 'addon-successfully-purchased-message' ) ),
|
11114 |
+
$addon->title
|
11115 |
+
) . ' ' . $this->get_latest_download_link(
|
11116 |
+
$this->get_text_inline( 'Download the latest version', 'download-latest-version' ),
|
11117 |
+
$addon_id
|
11118 |
+
),
|
|
|
|
|
|
|
|
|
|
|
|
|
11119 |
'addon_plan_upgraded_' . $addon->slug,
|
11120 |
+
$this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!'
|
11121 |
);
|
11122 |
}
|
11123 |
}
|
11162 |
if ( ! self::$_global_admin_notices->has_sticky( 'api_blocked' ) ) {
|
11163 |
self::$_global_admin_notices->add(
|
11164 |
sprintf(
|
11165 |
+
$this->get_text_x_inline( 'Your server is blocking the access to Freemius\' API, which is crucial for %1s synchronization. Please contact your host to whitelist %2s', '%1s - plugin title, %2s - API domain', 'server-blocking-access' ),
|
11166 |
$this->get_plugin_name(),
|
11167 |
'<a href="' . $api->get_url() . '" target="_blank">' . $api->get_url() . '</a>'
|
11168 |
+
) . '<br> ' . $this->get_text_inline( 'Error received from the server:', 'server-error-message' ) . var_export( $site->error, true ),
|
11169 |
+
$this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...',
|
11170 |
'error',
|
11171 |
$background,
|
11172 |
false,
|
11176 |
} else {
|
11177 |
// Authentication params are broken.
|
11178 |
$this->_admin_notices->add(
|
11179 |
+
$this->get_text_inline( 'It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again.', 'wrong-authentication-param-message' ),
|
11180 |
+
$this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...',
|
11181 |
'error'
|
11182 |
);
|
11183 |
}
|
11293 |
}
|
11294 |
}
|
11295 |
|
11296 |
+
$hmm_text = $this->get_text_x_inline( 'Hmm', 'something somebody says when they are thinking about what you have just said.', 'hmm' ) . '...';
|
11297 |
+
|
11298 |
if ( $this->has_paid_plan() ) {
|
11299 |
switch ( $plan_change ) {
|
11300 |
case 'none':
|
11306 |
if ( $plan->is_free() ) {
|
11307 |
$this->_admin_notices->add(
|
11308 |
sprintf(
|
11309 |
+
$this->get_text_inline( '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.', 'plan-did-not-change-message' ),
|
11310 |
+
'<i><b>' . $plan->title . ( $this->is_trial() ? ' ' . $this->get_text_x_inline( 'Trial', 'trial period', 'trial' ) : '' ) . '</b></i>'
|
11311 |
) . ' ' . sprintf(
|
11312 |
'<a href="%s">%s</a>',
|
11313 |
$this->contact_url(
|
11314 |
'bug',
|
11315 |
+
sprintf( $this->get_text_inline( 'I have upgraded my account but when I try to Sync the License, the plan remains %s.', 'plan-did-not-change-email-message' ),
|
11316 |
strtoupper( $plan->name )
|
11317 |
)
|
11318 |
),
|
11319 |
+
$this->get_text_inline( 'Please contact us here', 'contact-us-here' )
|
11320 |
),
|
11321 |
+
$hmm_text
|
11322 |
);
|
11323 |
}
|
11324 |
}
|
11326 |
case 'upgraded':
|
11327 |
$this->_admin_notices->add_sticky(
|
11328 |
sprintf(
|
11329 |
+
$this->get_text_inline( 'Your plan was successfully upgraded.', 'plan-upgraded-message' ),
|
11330 |
'<i>' . $this->get_plugin_name() . '</i>'
|
11331 |
) . $this->get_complete_upgrade_instructions(),
|
11332 |
'plan_upgraded',
|
11333 |
+
$this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!'
|
11334 |
);
|
11335 |
|
11336 |
$this->_admin_notices->remove_sticky( array(
|
11343 |
case 'changed':
|
11344 |
$this->_admin_notices->add_sticky(
|
11345 |
sprintf(
|
11346 |
+
$this->get_text_inline( 'Your plan was successfully changed to %s.', 'plan-changed-to-x-message' ),
|
11347 |
$this->_site->plan->title
|
11348 |
),
|
11349 |
'plan_changed'
|
11358 |
break;
|
11359 |
case 'downgraded':
|
11360 |
$this->_admin_notices->add_sticky(
|
11361 |
+
sprintf( $this->get_text_inline( 'Your license has expired. You can still continue using the free %s forever.', 'license-expired-blocking-message' ), $this->_module_type ),
|
11362 |
'license_expired',
|
11363 |
+
$hmm_text
|
11364 |
);
|
11365 |
$this->_admin_notices->remove_sticky( 'plan_upgraded' );
|
11366 |
break;
|
11367 |
case 'cancelled':
|
11368 |
$this->_admin_notices->add(
|
11369 |
+
$this->get_text_inline( 'Your license has been cancelled. If you think it\'s a mistake, please contact support.', 'license-cancelled' ) . ' ' .
|
11370 |
sprintf(
|
11371 |
'<a href="%s">%s</a>',
|
11372 |
$this->contact_url( 'bug' ),
|
11373 |
+
$this->get_text_inline( 'Please contact us here', 'contact-us-here' )
|
11374 |
),
|
11375 |
+
$hmm_text,
|
11376 |
'error'
|
11377 |
);
|
11378 |
$this->_admin_notices->remove_sticky( 'plan_upgraded' );
|
11379 |
break;
|
11380 |
case 'expired':
|
11381 |
$this->_admin_notices->add_sticky(
|
11382 |
+
sprintf( $this->get_text_inline( '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.', 'license-expired-non-blocking-message' ), $this->_site->plan->title ),
|
11383 |
'license_expired',
|
11384 |
+
$hmm_text
|
11385 |
);
|
11386 |
$this->_admin_notices->remove_sticky( 'plan_upgraded' );
|
11387 |
break;
|
11388 |
case 'trial_started':
|
11389 |
$this->_admin_notices->add_sticky(
|
11390 |
sprintf(
|
11391 |
+
$this->get_text_inline( 'Your trial has been successfully started.', 'trial-started-message' ),
|
11392 |
'<i>' . $this->get_plugin_name() . '</i>'
|
11393 |
) . $this->get_complete_upgrade_instructions( $this->_storage->trial_plan->title ),
|
11394 |
'trial_started',
|
11395 |
+
$this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!'
|
11396 |
);
|
11397 |
|
11398 |
$this->_admin_notices->remove_sticky( array(
|
11401 |
break;
|
11402 |
case 'trial_expired':
|
11403 |
$this->_admin_notices->add_sticky(
|
11404 |
+
$this->get_text_inline( 'Your trial has expired. You can still continue using all our free features.', 'trial-expired-message' ),
|
11405 |
'trial_expired',
|
11406 |
+
$hmm_text
|
11407 |
);
|
11408 |
$this->_admin_notices->remove_sticky( array(
|
11409 |
'trial_started',
|
11471 |
if ( ! $background ) {
|
11472 |
$this->_admin_notices->add( sprintf(
|
11473 |
'%s %s',
|
11474 |
+
$this->get_text_inline( 'It looks like the license could not be activated.', 'license-activation-failed-message' ),
|
11475 |
( is_object( $license ) && isset( $license->error ) ?
|
11476 |
$license->error->message :
|
11477 |
sprintf( '%s<br><code>%s</code>',
|
11478 |
+
$this->get_text_inline( 'Error received from the server:', 'server-error-message' ),
|
11479 |
var_export( $license, true )
|
11480 |
)
|
11481 |
)
|
11482 |
),
|
11483 |
+
$this->get_text_x_inline( 'Hmm', 'something somebody says when they are thinking about what you have just said.', 'hmm' ) . '...',
|
11484 |
'error'
|
11485 |
);
|
11486 |
}
|
11487 |
|
11488 |
return;
|
11489 |
}
|
|
|
11490 |
$premium_license = new FS_Plugin_License( $license );
|
11491 |
|
11492 |
// Updated site plan.
|
11501 |
|
11502 |
if ( ! $background ) {
|
11503 |
$this->_admin_notices->add_sticky(
|
11504 |
+
$this->get_text_inline( 'Your license was successfully activated.', 'license-activated-message' ) .
|
11505 |
$this->get_complete_upgrade_instructions(),
|
11506 |
'license_activated',
|
11507 |
+
$this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!'
|
11508 |
);
|
11509 |
}
|
11510 |
|
11523 |
protected function _deactivate_license( $show_notice = true ) {
|
11524 |
$this->_logger->entrance();
|
11525 |
|
11526 |
+
$hmm_text = $this->get_text_x_inline( 'Hmm', 'something somebody says when they are thinking about what you have just said.', 'hmm' ) . '...';
|
11527 |
+
|
11528 |
if ( ! is_object( $this->_license ) ) {
|
11529 |
$this->_admin_notices->add(
|
11530 |
+
sprintf( $this->get_text_inline( 'It looks like your site currently doesn\'t have an active license.', 'no-active-license-message' ), $this->_site->plan->title ),
|
11531 |
+
$hmm_text
|
11532 |
);
|
11533 |
|
11534 |
return;
|
11539 |
|
11540 |
if ( isset( $license->error ) ) {
|
11541 |
$this->_admin_notices->add(
|
11542 |
+
$this->get_text_inline( 'It looks like the license deactivation failed.', 'license-deactivation-failed-message' ) . '<br> ' .
|
11543 |
+
$this->get_text_inline( 'Error received from the server:', 'server-error-message' ) . ' ' . var_export( $license->error, true ),
|
11544 |
+
$hmm_text,
|
11545 |
'error'
|
11546 |
);
|
11547 |
|
11566 |
|
11567 |
if ( $show_notice ) {
|
11568 |
$this->_admin_notices->add(
|
11569 |
+
sprintf( $this->get_text_inline( 'Your license was successfully deactivated, you are back to the %s plan.', 'license-deactivation-message' ), $this->_site->plan->title ),
|
11570 |
+
$this->get_text_inline( 'O.K', 'ok' )
|
11571 |
);
|
11572 |
}
|
11573 |
|
11615 |
$this->_admin_notices->remove_sticky( 'plan_upgraded' );
|
11616 |
|
11617 |
$this->_admin_notices->add(
|
11618 |
+
sprintf( $this->get_text_inline( 'Your plan was successfully downgraded. Your %s plan license will expire in %s.', 'plan-x-downgraded-message' ),
|
11619 |
$plan->title,
|
11620 |
human_time_diff( time(), strtotime( $this->_license->expiration ) )
|
11621 |
)
|
11625 |
$this->_store_site();
|
11626 |
} else {
|
11627 |
$this->_admin_notices->add(
|
11628 |
+
$this->get_text_inline( 'Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes.', 'plan-downgraded-failure-message' ),
|
11629 |
+
$this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...',
|
11630 |
'error'
|
11631 |
);
|
11632 |
}
|
11643 |
function start_trial( $plan_name = false ) {
|
11644 |
$this->_logger->entrance();
|
11645 |
|
11646 |
+
// Alias.
|
11647 |
+
$oops_text = $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...';
|
11648 |
+
|
11649 |
if ( $this->is_trial() ) {
|
11650 |
// Already in trial mode.
|
11651 |
$this->_admin_notices->add(
|
11652 |
+
sprintf( $this->get_text_inline( 'You are already running the %s in a trial mode.', 'in-trial-mode' ), $this->_module_type ),
|
11653 |
+
$oops_text,
|
11654 |
'error'
|
11655 |
);
|
11656 |
|
11660 |
if ( $this->_site->is_trial_utilized() ) {
|
11661 |
// Trial was already utilized.
|
11662 |
$this->_admin_notices->add(
|
11663 |
+
$this->get_text_inline( 'You already utilized a trial before.', 'trial-utilized' ),
|
11664 |
+
$oops_text,
|
11665 |
'error'
|
11666 |
);
|
11667 |
|
11674 |
if ( false === $plan ) {
|
11675 |
// Plan doesn't exist.
|
11676 |
$this->_admin_notices->add(
|
11677 |
+
sprintf( $this->get_text_inline( 'Plan %s do not exist, therefore, can\'t start a trial.', 'trial-plan-x-not-exist' ), $plan_name ),
|
11678 |
+
$oops_text,
|
11679 |
'error'
|
11680 |
);
|
11681 |
|
11685 |
if ( ! $plan->has_trial() ) {
|
11686 |
// Plan doesn't exist.
|
11687 |
$this->_admin_notices->add(
|
11688 |
+
sprintf( $this->get_text_inline( 'Plan %s does not support a trial period.', 'plan-x-no-trial' ), $plan_name ),
|
11689 |
+
$oops_text,
|
11690 |
'error'
|
11691 |
);
|
11692 |
|
11696 |
if ( ! $this->has_trial_plan() ) {
|
11697 |
// None of the plans have a trial.
|
11698 |
$this->_admin_notices->add(
|
11699 |
+
sprintf( $this->get_text_inline( 'None of the %s\'s plans supports a trial period.', 'no-trials' ), $this->_module_type ),
|
11700 |
+
$oops_text,
|
11701 |
'error'
|
11702 |
);
|
11703 |
|
11715 |
if ( ! $this->is_api_result_entity( $plan ) ) {
|
11716 |
// Some API error while trying to start the trial.
|
11717 |
$this->_admin_notices->add(
|
11718 |
+
sprintf( $this->get_text_inline( 'Unexpected API error. Please contact the %s\'s author with the following error.', 'unexpected-api-error' ), $this->_module_type )
|
11719 |
. ' ' . var_export( $plan, true ),
|
11720 |
+
$oops_text,
|
11721 |
'error'
|
11722 |
);
|
11723 |
|
11741 |
private function _cancel_trial() {
|
11742 |
$this->_logger->entrance();
|
11743 |
|
11744 |
+
// Alias.
|
11745 |
+
$oops_text = $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...';
|
11746 |
+
|
11747 |
if ( ! $this->is_trial() ) {
|
11748 |
$this->_admin_notices->add(
|
11749 |
+
$this->get_text_inline( 'It looks like you are not in trial mode anymore so there\'s nothing to cancel :)', 'trial-cancel-no-trial-message' ),
|
11750 |
+
$oops_text,
|
11751 |
'error'
|
11752 |
);
|
11753 |
|
11797 |
! $this->deactivate_premium_only_addon_without_license( true )
|
11798 |
) {
|
11799 |
$this->_admin_notices->add(
|
11800 |
+
sprintf( $this->get_text_inline( 'Your %s free trial was successfully cancelled.', 'trial-cancel-message' ), $this->_storage->trial_plan->title )
|
11801 |
);
|
11802 |
}
|
11803 |
|
11805 |
unset( $this->_storage->trial_plan );
|
11806 |
} else {
|
11807 |
$this->_admin_notices->add(
|
11808 |
+
$this->get_text_inline( 'Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes.', 'trial-cancel-failure-message' ),
|
11809 |
+
$oops_text,
|
11810 |
'error'
|
11811 |
);
|
11812 |
}
|
12043 |
if ( ! $background ) {
|
12044 |
$this->_admin_notices->add(
|
12045 |
sprintf(
|
12046 |
+
/* translators: %s: Numeric version number (e.g. '2.1.9' */
|
12047 |
+
$this->get_text_inline( 'Version %s was released.', 'version-x-released' ) . ' ' . $this->get_text_inline( 'Please download %s.', 'please-download-x' ),
|
12048 |
$update->version,
|
12049 |
sprintf(
|
12050 |
'<a href="%s" target="_blank">%s</a>',
|
12051 |
$this->get_account_url( 'download_latest' ),
|
12052 |
+
sprintf(
|
12053 |
+
/* translators: %s: plan name (e.g. latest "Professional" version) */
|
12054 |
+
$this->get_text_inline( 'the latest %s version here', 'latest-x-version' ),
|
12055 |
+
$this->_site->plan->title
|
12056 |
+
)
|
12057 |
)
|
12058 |
),
|
12059 |
+
$this->get_text_inline( 'New', 'new' ) . '!'
|
12060 |
);
|
12061 |
}
|
12062 |
} else if ( false === $new_version && ! $background ) {
|
12063 |
$this->_admin_notices->add(
|
12064 |
+
$this->get_text_inline( 'Seems like you got the latest release.', 'you-have-latest' ),
|
12065 |
+
$this->get_text_inline( 'You are all good!', 'you-are-good' )
|
12066 |
);
|
12067 |
}
|
12068 |
|
12328 |
|
12329 |
if ( ! isset( $result->error ) ) {
|
12330 |
$this->_admin_notices->add( sprintf(
|
12331 |
+
$this->get_text_inline( 'Verification mail was just sent to %s. If you can\'t find it after 5 min, please check your spam box.', 'verification-email-sent-message' ),
|
12332 |
sprintf( '<a href="mailto:%1s">%2s</a>', esc_url( $this->_user->email ), $this->_user->email )
|
12333 |
) );
|
12334 |
} else {
|
12416 |
$plugin_id = fs_request_get( 'plugin_id', $this->get_id() );
|
12417 |
$action = fs_get_action();
|
12418 |
|
12419 |
+
// Alias.
|
12420 |
+
$oops_text = $this->get_text_x_inline( 'Oops', 'exclamation', 'oops' ) . '...';
|
12421 |
+
|
12422 |
switch ( $action ) {
|
12423 |
case 'delete_account':
|
12424 |
check_admin_referer( $action );
|
12473 |
|
12474 |
if ( $plugin_id == $this->get_id() ) {
|
12475 |
$this->_deactivate_license();
|
12476 |
+
|
12477 |
+
if ( $this->is_only_premium() ) {
|
12478 |
+
// Clear user and site.
|
12479 |
+
$this->_site = null;
|
12480 |
+
$this->_user = null;
|
12481 |
+
|
12482 |
+
fs_redirect( $this->get_activation_url() );
|
12483 |
+
}
|
12484 |
} else {
|
12485 |
if ( $this->is_addon_activated( $plugin_id ) ) {
|
12486 |
$fs_addon = self::get_instance_by_id( $plugin_id );
|
12503 |
$candidate_email = fs_request_get( 'candidate_email', '' );
|
12504 |
|
12505 |
if ( $this->init_change_owner( $candidate_email ) ) {
|
12506 |
+
$this->_admin_notices->add( sprintf( $this->get_text_inline( '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.', 'change-owner-request-sent-x' ), '<b>' . $this->_user->email . '</b>' ) );
|
12507 |
}
|
12508 |
break;
|
12509 |
case 'owner_confirmed':
|
12510 |
$candidate_email = fs_request_get( 'candidate_email', '' );
|
12511 |
|
12512 |
+
$this->_admin_notices->add( sprintf( $this->get_text_inline( 'Thanks for confirming the ownership change. An email was just sent to %s for final approval.', 'change-owner-request_owner-confirmed' ), '<b>' . $candidate_email . '</b>' ) );
|
12513 |
break;
|
12514 |
case 'candidate_confirmed':
|
12515 |
if ( $this->complete_change_owner() ) {
|
12516 |
$this->_admin_notices->add_sticky(
|
12517 |
+
sprintf( $this->get_text_inline( '%s is the new owner of the account.', 'change-owner-request_candidate-confirmed' ), '<b>' . $this->_user->email . '</b>' ),
|
12518 |
'ownership_changed',
|
12519 |
+
$this->get_text_x_inline( 'Congrats', 'as congratulations', 'congrats' ) . '!'
|
12520 |
);
|
12521 |
} else {
|
12522 |
// @todo Handle failed ownership change message.
|
12536 |
switch ( $result->error->code ) {
|
12537 |
case 'user_exist':
|
12538 |
$this->_admin_notices->add(
|
12539 |
+
$this->get_text_inline( 'Sorry, we could not complete the email update. Another user with the same email is already registered.', 'user-exist-message' ) . ' ' .
|
12540 |
+
sprintf( $this->get_text_inline( 'If you would like to give up the ownership of the %s\'s account to %s click the Change Ownership button.', 'user-exist-message_ownership' ), $this->_module_type, '<b>' . $new_email . '</b>' ) .
|
12541 |
sprintf(
|
12542 |
'<a style="margin-left: 10px;" href="%s"><button class="button button-primary">%s ➜</button></a>',
|
12543 |
$this->get_account_url( 'change_owner', array(
|
12544 |
'state' => 'init',
|
12545 |
'candidate_email' => $new_email
|
12546 |
) ),
|
12547 |
+
$this->get_text_inline( 'Change Ownership', 'change-ownership' )
|
12548 |
),
|
12549 |
+
$oops_text,
|
12550 |
'error'
|
12551 |
);
|
12552 |
break;
|
12553 |
}
|
12554 |
} else {
|
12555 |
+
$this->_admin_notices->add( $this->get_text_inline( 'Your email was successfully updated. You should receive an email with confirmation instructions in few moments.', 'email-updated-message' ) );
|
12556 |
}
|
12557 |
|
12558 |
return;
|
12564 |
|
12565 |
if ( isset( $result->error ) ) {
|
12566 |
$this->_admin_notices->add(
|
12567 |
+
$this->get_text_inline( 'Please provide your full name.', 'name-update-failed-message' ),
|
12568 |
+
$oops_text,
|
12569 |
'error'
|
12570 |
);
|
12571 |
} else {
|
12572 |
+
$this->_admin_notices->add( $this->get_text_inline( 'Your name was successfully updated.', 'name-updated-message' ) );
|
12573 |
}
|
12574 |
|
12575 |
return;
|
12629 |
$this->do_action( 'account_property_edit', 'site', $site_property, $site_property_value );
|
12630 |
|
12631 |
$this->_admin_notices->add( sprintf(
|
12632 |
+
/* translators: %s: User's account property (e.g. email address, name) */
|
12633 |
+
$this->get_text_inline( 'You have successfully updated your %s.', 'x-updated' ),
|
12634 |
+
'<b>' . str_replace( '_', ' ', $p ) . '</b>'
|
12635 |
+
) );
|
12636 |
|
12637 |
return;
|
12638 |
}
|
12685 |
$this->do_action( 'account_page_load_before_departure' );
|
12686 |
}
|
12687 |
|
12688 |
+
/**
|
12689 |
+
* Renders the "Affiliation" page.
|
12690 |
+
*
|
12691 |
+
* @author Leo Fajardo (@leorw)
|
12692 |
+
* @since 1.2.3
|
12693 |
+
*/
|
12694 |
+
function _affiliation_page_render() {
|
12695 |
+
$this->_logger->entrance();
|
12696 |
+
|
12697 |
+
$this->fetch_affiliate_and_terms();
|
12698 |
+
|
12699 |
+
fs_enqueue_local_style( 'fs_affiliation', '/admin/affiliation.css' );
|
12700 |
+
|
12701 |
+
$vars = array( 'id' => $this->_module_id );
|
12702 |
+
echo $this->apply_filters( "/forms/affiliation.php", fs_get_template( '/forms/affiliation.php', $vars ) );
|
12703 |
+
}
|
12704 |
+
|
12705 |
+
|
12706 |
/**
|
12707 |
* Render account page.
|
12708 |
*
|
12713 |
$this->_logger->entrance();
|
12714 |
|
12715 |
$template = 'account.php';
|
12716 |
+
$vars = array( 'id' => $this->_module_id );
|
|
|
|
|
|
|
|
|
12717 |
|
12718 |
/**
|
12719 |
* Added filter to the template to allow developers wrapping the template
|
12770 |
|
12771 |
if ( ! $this->is_registered() && $this->is_org_repo_compliant() ) {
|
12772 |
$this->_admin_notices->add(
|
12773 |
+
sprintf( $this->get_text_inline( 'Just letting you know that the add-ons information of %s is being pulled from an external server.', 'addons-info-external-message' ), '<b>' . $this->get_plugin_name() . '</b>' ),
|
12774 |
+
$this->get_text_x_inline( 'Heads up', 'advance notice of something that will need attention.', 'heads-up' ),
|
12775 |
'update-nag'
|
12776 |
);
|
12777 |
}
|
13089 |
$trial_period = $this->_trial_days;
|
13090 |
$require_payment = $this->_is_trial_require_payment;
|
13091 |
$trial_url = $this->get_trial_url();
|
13092 |
+
$plans_string = strtolower( $this->get_text_inline( 'Awesome', 'awesome' ) );
|
13093 |
|
13094 |
if ( $this->is_registered() ) {
|
13095 |
// If opted-in, override trial with up to date data from API.
|
13129 |
}
|
13130 |
|
13131 |
$message = sprintf(
|
13132 |
+
$this->get_text_x_inline( 'Hey', 'exclamation', 'hey' ) . '! ' . $this->get_text_inline( 'How do you like %s so far? Test all our %s premium features with a %d-day free trial.', 'trial-x-promotion-message' ),
|
13133 |
sprintf( '<b>%s</b>', $this->get_plugin_name() ),
|
13134 |
$plans_string,
|
13135 |
$trial_period
|
13137 |
|
13138 |
// "No Credit-Card Required" or "No Commitment for N Days".
|
13139 |
$cc_string = $require_payment ?
|
13140 |
+
sprintf( $this->get_text_inline( 'No commitment for %s days - cancel anytime!', 'no-commitment-for-x-days' ), $trial_period ) :
|
13141 |
+
$this->get_text_inline( 'No credit card required', 'no-cc-required' ) . '!';
|
13142 |
|
13143 |
|
13144 |
// Start trial button.
|
13145 |
$button = ' ' . sprintf(
|
13146 |
'<a style="margin-left: 10px; vertical-align: super;" href="%s"><button class="button button-primary">%s ➜</button></a>',
|
13147 |
$trial_url,
|
13148 |
+
$this->get_text_x_inline( 'Start free trial', 'call to action', 'start-free-trial' )
|
13149 |
);
|
13150 |
|
13151 |
$this->_admin_notices->add_sticky(
|
13160 |
return true;
|
13161 |
}
|
13162 |
|
13163 |
+
/**
|
13164 |
+
* Lets users/customers know that the product has an affiliate program.
|
13165 |
+
*
|
13166 |
+
* @author Leo Fajardo (@leorw)
|
13167 |
+
* @since 1.2.2.11
|
13168 |
+
*
|
13169 |
+
* @return bool Returns true if the notice has been added.
|
13170 |
+
*/
|
13171 |
+
function _add_affiliate_program_notice() {
|
13172 |
+
if ( ! $this->is_user_admin() ) {
|
13173 |
+
return false;
|
13174 |
+
}
|
13175 |
+
|
13176 |
+
if ( ! $this->is_user_in_admin() ) {
|
13177 |
+
return false;
|
13178 |
+
}
|
13179 |
+
|
13180 |
+
// Check if the notice is already shown.
|
13181 |
+
if ( $this->_admin_notices->has_sticky( 'affiliate_program' ) ) {
|
13182 |
+
return false;
|
13183 |
+
}
|
13184 |
+
|
13185 |
+
if (
|
13186 |
+
// Product has no affiliate program.
|
13187 |
+
! $this->has_affiliate_program() ||
|
13188 |
+
// User has applied for an affiliate account.
|
13189 |
+
! empty( $this->_storage->affiliate_application_data ) ) {
|
13190 |
+
return false;
|
13191 |
+
}
|
13192 |
+
|
13193 |
+
if ( ! $this->apply_filters( 'show_affiliate_program_notice', true ) ) {
|
13194 |
+
// Developer explicitly asked not to show the notice about the affiliate program.
|
13195 |
+
return false;
|
13196 |
+
}
|
13197 |
+
|
13198 |
+
if ( $this->is_activation_mode() || $this->is_pending_activation() ) {
|
13199 |
+
// If not yet opted in/skipped, or pending activation, don't show the notice.
|
13200 |
+
return false;
|
13201 |
+
}
|
13202 |
+
|
13203 |
+
$last_time_notice_was_shown = $this->_storage->get( 'affiliate_program_notice_shown', false );
|
13204 |
+
$was_notice_shown_before = ( false !== $last_time_notice_was_shown );
|
13205 |
+
|
13206 |
+
/**
|
13207 |
+
* Do not show the notice if it was already shown before or less than 30 days have passed since the initial
|
13208 |
+
* activation with FS.
|
13209 |
+
*/
|
13210 |
+
if ( $was_notice_shown_before ||
|
13211 |
+
$this->_storage->install_timestamp > ( time() - ( WP_FS__TIME_24_HOURS_IN_SEC * 30 ) )
|
13212 |
+
) {
|
13213 |
+
return false;
|
13214 |
+
}
|
13215 |
+
|
13216 |
+
if ( ! $this->is_paying() &&
|
13217 |
+
FS_Plugin::AFFILIATE_MODERATION_CUSTOMERS == $this->_plugin->affiliate_moderation ) {
|
13218 |
+
// If the user is not a customer and the affiliate program is only for customers, don't show the notice.
|
13219 |
+
return false;
|
13220 |
+
}
|
13221 |
+
|
13222 |
+
$message = sprintf(
|
13223 |
+
$this->get_text_inline( 'Hey there, did you know that %s has an affiliate program? If you like the %s you can become our ambassador and earn some cash!', 'become-an-ambassador-admin-notice' ),
|
13224 |
+
sprintf( '<strong>%s</strong>', $this->get_plugin_name() ),
|
13225 |
+
$this->get_module_label( true )
|
13226 |
+
);
|
13227 |
+
|
13228 |
+
// HTML code for the "Learn more..." button.
|
13229 |
+
$button = ' ' . sprintf(
|
13230 |
+
'<a style="display: block; margin-top: 10px;" href="%s"><button class="button button-primary">%s ➜</button></a>',
|
13231 |
+
$this->_get_admin_page_url( 'affiliation' ),
|
13232 |
+
$this->get_text_inline( 'Learn more', 'learn-more' ) . '...'
|
13233 |
+
);
|
13234 |
+
|
13235 |
+
$this->_admin_notices->add_sticky(
|
13236 |
+
$this->apply_filters( 'affiliate_program_notice', "{$message} {$button}" ),
|
13237 |
+
'affiliate_program',
|
13238 |
+
'',
|
13239 |
+
'promotion'
|
13240 |
+
);
|
13241 |
+
|
13242 |
+
$this->_storage->affiliate_program_notice_shown = WP_FS__SCRIPT_START_TIME;
|
13243 |
+
|
13244 |
+
return true;
|
13245 |
+
}
|
13246 |
+
|
13247 |
/**
|
13248 |
* @author Vova Feldman (@svovaf)
|
13249 |
* @since 1.2.1.5
|
13346 |
if ( $this->is_registered() ) {
|
13347 |
if ( ! $this->is_paying() && $this->has_paid_plan() ) {
|
13348 |
$this->add_plugin_action_link(
|
13349 |
+
$this->get_text_inline( 'Upgrade', 'upgrade' ),
|
13350 |
$this->get_upgrade_url(),
|
13351 |
false,
|
13352 |
7,
|
13356 |
|
13357 |
if ( $this->has_addons() ) {
|
13358 |
$this->add_plugin_action_link(
|
13359 |
+
$this->get_text_inline( 'Add-Ons', 'add-ons' ),
|
13360 |
$this->_get_admin_page_url( 'addons' ),
|
13361 |
false,
|
13362 |
9,
|
13384 |
add_action( 'admin_footer', array( &$this, '_add_license_activation_dialog_box' ) );
|
13385 |
}
|
13386 |
|
13387 |
+
$link_text = $this->is_free_plan() ?
|
13388 |
+
$this->get_text_inline( 'Activate License', 'activate-license' ) :
|
13389 |
+
$this->get_text_inline( 'Change License', 'change-license' );
|
|
|
|
|
13390 |
|
13391 |
$this->add_plugin_action_link(
|
13392 |
$link_text,
|
13447 |
|
13448 |
if ( $this->is_registered() ) {
|
13449 |
if ( $this->is_tracking_allowed() ) {
|
13450 |
+
$link_text_id = $this->get_text_inline( 'Opt Out', 'opt-out' );
|
13451 |
} else {
|
13452 |
+
$link_text_id = $this->get_text_inline( 'Opt In', 'opt-in' );
|
13453 |
}
|
13454 |
|
13455 |
add_action( 'admin_footer', array( &$this, '_add_optout_dialog' ) );
|
13456 |
} else {
|
13457 |
+
$link_text_id = $this->get_text_inline( 'Opt In', 'opt-in' );
|
13458 |
|
13459 |
$params = ! $this->is_anonymous() ?
|
13460 |
array() :
|
13468 |
|
13469 |
if ( $this->is_plugin() && self::is_plugins_page() ) {
|
13470 |
$this->add_plugin_action_link(
|
13471 |
+
$link_text_id,
|
13472 |
$url,
|
13473 |
false,
|
13474 |
13,
|
13637 |
|
13638 |
// @since 1.2.1.5 The free version is auto deactivated.
|
13639 |
$deactivation_step = version_compare( $this->version, '1.2.1.5', '<' ) ?
|
13640 |
+
( '<li>' . $this->esc_html_inline( 'Deactivate the free version', 'deactivate-free-version' ) . '.</li>' ) :
|
13641 |
'';
|
13642 |
|
13643 |
return sprintf(
|
13644 |
' %s: <ol><li>%s.</li>%s<li>%s (<a href="%s" target="_blank">%s</a>).</li></ol>',
|
13645 |
+
$this->get_text_inline( 'Please follow these steps to complete the upgrade', 'follow-steps-to-complete-upgrade' ),
|
13646 |
$this->get_latest_download_link( sprintf(
|
13647 |
+
/* translators: %s: Plan title */
|
13648 |
+
$this->get_text_inline( 'Download the latest %s version', 'download-latest-x-version' ),
|
13649 |
$plan_title
|
13650 |
) ),
|
13651 |
$deactivation_step,
|
13652 |
+
$this->get_text_inline( 'Upload and activate the downloaded version', 'upload-and-activate' ),
|
13653 |
'//bit.ly/upload-wp-' . $this->_module_type . 's',
|
13654 |
+
$this->get_text_inline( 'How to upload and activate?', 'howto-upload-activate' )
|
13655 |
);
|
13656 |
}
|
13657 |
|
13667 |
return fs_text( $key, $this->_slug );
|
13668 |
}
|
13669 |
|
13670 |
+
/**
|
13671 |
+
* @author Vova Feldman (@svovaf)
|
13672 |
+
* @since 1.2.3
|
13673 |
+
*
|
13674 |
+
* @param string $text Translatable string.
|
13675 |
+
* @param string $key String key for overrides.
|
13676 |
+
*
|
13677 |
+
* @return string
|
13678 |
+
*/
|
13679 |
+
function get_text_inline( $text, $key = '' ) {
|
13680 |
+
return _fs_text_inline( $text, $key, $this->_slug );
|
13681 |
+
}
|
13682 |
+
|
13683 |
+
/**
|
13684 |
+
* @author Vova Feldman (@svovaf)
|
13685 |
+
* @since 1.2.3
|
13686 |
+
*
|
13687 |
+
* @param string $text Translatable string.
|
13688 |
+
* @param string $context Context information for the translators.
|
13689 |
+
* @param string $key String key for overrides.
|
13690 |
+
*
|
13691 |
+
* @return string
|
13692 |
+
*/
|
13693 |
+
function get_text_x_inline( $text, $context, $key ) {
|
13694 |
+
return _fs_text_x_inline( $text, $context, $key, $this->_slug );
|
13695 |
+
}
|
13696 |
+
|
13697 |
+
/**
|
13698 |
+
* @author Vova Feldman (@svovaf)
|
13699 |
+
* @since 1.2.3
|
13700 |
+
*
|
13701 |
+
* @param string $text Translatable string.
|
13702 |
+
* @param string $key String key for overrides.
|
13703 |
+
*
|
13704 |
+
* @return string
|
13705 |
+
*/
|
13706 |
+
function esc_html_inline( $text, $key ) {
|
13707 |
+
return esc_html( _fs_text_inline( $text, $key, $this->_slug ) );
|
13708 |
+
}
|
13709 |
+
|
13710 |
#----------------------------------------------------------------------------------
|
13711 |
#region Versioning
|
13712 |
#----------------------------------------------------------------------------------
|
13810 |
if ( ! $this->is_registered() ) {
|
13811 |
// Not registered.
|
13812 |
self::shoot_ajax_failure( array(
|
13813 |
+
'message' => $this->get_text_inline( 'Auto installation only works for opted-in users.', 'auto-install-error-not-opted-in' ),
|
13814 |
'code' => 'premium_installed',
|
13815 |
) );
|
13816 |
}
|
13817 |
|
13818 |
+
$plugin_id = fs_request_get( 'target_module_id', $this->get_id() );
|
13819 |
|
13820 |
if ( ! FS_Plugin::is_valid_id( $plugin_id ) ) {
|
13821 |
// Invalid ID.
|
13822 |
self::shoot_ajax_failure( array(
|
13823 |
+
'message' => $this->get_text_inline( 'Invalid module ID.', 'auto-install-error-invalid-id' ),
|
13824 |
'code' => 'invalid_module_id',
|
13825 |
) );
|
13826 |
}
|
13829 |
if ( $this->is_premium() ) {
|
13830 |
// Already using the premium code version.
|
13831 |
self::shoot_ajax_failure( array(
|
13832 |
+
'message' => $this->get_text_inline( 'Premium version already active.', 'auto-install-error-premium-activated' ),
|
13833 |
'code' => 'premium_installed',
|
13834 |
) );
|
13835 |
}
|
13836 |
if ( ! $this->can_use_premium_code() ) {
|
13837 |
// Don't have access to the premium code.
|
13838 |
self::shoot_ajax_failure( array(
|
13839 |
+
'message' => $this->get_text_inline( 'You do not have a valid license to access the premium version.', 'auto-install-error-invalid-license' ),
|
13840 |
'code' => 'invalid_license',
|
13841 |
) );
|
13842 |
}
|
13843 |
if ( ! $this->has_release_on_freemius() ) {
|
13844 |
// Plugin is a serviceware, no premium code version.
|
13845 |
self::shoot_ajax_failure( array(
|
13846 |
+
'message' => $this->get_text_inline( 'Plugin is a "Serviceware" which means it does not have a premium code version.', 'auto-install-error-serviceware' ),
|
13847 |
'code' => 'premium_version_missing',
|
13848 |
) );
|
13849 |
}
|
13853 |
if ( ! is_object( $addon ) ) {
|
13854 |
// Invalid add-on ID.
|
13855 |
self::shoot_ajax_failure( array(
|
13856 |
+
'message' => $this->get_text_inline( 'Invalid module ID.', 'auto-install-error-invalid-id' ),
|
13857 |
'code' => 'invalid_module_id',
|
13858 |
) );
|
13859 |
}
|
13861 |
if ( $this->is_addon_activated( $plugin_id, true ) ) {
|
13862 |
// Premium add-on version is already activated.
|
13863 |
self::shoot_ajax_failure( array(
|
13864 |
+
'message' => $this->get_text_inline( 'Premium add-on version already installed.', 'auto-install-error-premium-addon-activated' ),
|
13865 |
'code' => 'premium_installed',
|
13866 |
) );
|
13867 |
}
|
13933 |
}
|
13934 |
}
|
13935 |
|
13936 |
+
$vars = array(
|
13937 |
+
'id' => $this->_module_id,
|
13938 |
+
'target_module_id' => $plugin_id,
|
13939 |
+
'slug' => $this->_slug,
|
13940 |
+
);
|
13941 |
|
13942 |
fs_require_template( 'auto-installation.php', $vars );
|
13943 |
}
|
14207 |
require_once WP_FS__DIR_INCLUDES . '/customizer/class-fs-customizer-upsell-control.php';
|
14208 |
|
14209 |
$customizer->add_section( 'freemius_upsell', array(
|
14210 |
+
'title' => '★ ' . $this->get_text_inline( 'View paid features', 'view-paid-features' ),
|
14211 |
'priority' => 1,
|
14212 |
) );
|
14213 |
$customizer->add_setting( 'freemius_upsell', array(
|
freemius/includes/class-fs-logger.php
CHANGED
@@ -1,688 +1,688 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.0.3
|
7 |
-
*/
|
8 |
-
|
9 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
-
exit;
|
11 |
-
}
|
12 |
-
|
13 |
-
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 = function_exists( 'get_current_user' ) ?
|
89 |
-
get_current_user() :
|
90 |
-
'unknown';
|
91 |
-
self::$_isStorageLoggingOn = ( 1 == get_option( 'fs_storage_logger', 0 ) );
|
92 |
-
self::$_abspathLength = strlen( ABSPATH );
|
93 |
-
self::$_processID = mt_rand( 0, 32000 );
|
94 |
-
|
95 |
-
// Process ID may be `false` on errors.
|
96 |
-
if ( ! is_numeric( self::$_processID ) ) {
|
97 |
-
self::$_processID = 0;
|
98 |
-
}
|
99 |
-
}
|
100 |
-
|
101 |
-
private static function hook_footer() {
|
102 |
-
if ( self::$_HOOKED_FOOTER ) {
|
103 |
-
return;
|
104 |
-
}
|
105 |
-
|
106 |
-
if ( is_admin() ) {
|
107 |
-
add_action( 'admin_footer', 'FS_Logger::dump', 100 );
|
108 |
-
} else {
|
109 |
-
add_action( 'wp_footer', 'FS_Logger::dump', 100 );
|
110 |
-
}
|
111 |
-
}
|
112 |
-
|
113 |
-
function is_on() {
|
114 |
-
return $this->_on;
|
115 |
-
}
|
116 |
-
|
117 |
-
function on() {
|
118 |
-
$this->_on = true;
|
119 |
-
|
120 |
-
if ( ! function_exists( 'dbDelta' ) ) {
|
121 |
-
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
|
122 |
-
}
|
123 |
-
|
124 |
-
self::hook_footer();
|
125 |
-
}
|
126 |
-
|
127 |
-
function echo_on() {
|
128 |
-
$this->on();
|
129 |
-
|
130 |
-
$this->_echo = true;
|
131 |
-
}
|
132 |
-
|
133 |
-
function is_echo_on() {
|
134 |
-
return $this->_echo;
|
135 |
-
}
|
136 |
-
|
137 |
-
function get_id() {
|
138 |
-
return $this->_id;
|
139 |
-
}
|
140 |
-
|
141 |
-
function get_file() {
|
142 |
-
return $this->_file_start;
|
143 |
-
}
|
144 |
-
|
145 |
-
private function _log( &$message, $type = 'log', $wrapper ) {
|
146 |
-
if ( ! $this->is_on() ) {
|
147 |
-
return;
|
148 |
-
}
|
149 |
-
|
150 |
-
$bt = debug_backtrace();
|
151 |
-
$depth = $wrapper ? 3 : 2;
|
152 |
-
while ( $depth < count( $bt ) - 1 && 'eval' === $bt[ $depth ]['function'] ) {
|
153 |
-
$depth ++;
|
154 |
-
}
|
155 |
-
|
156 |
-
$caller = $bt[ $depth ];
|
157 |
-
|
158 |
-
/**
|
159 |
-
* Retrieve the correct call file & line number from backtrace
|
160 |
-
* when logging from a wrapper method.
|
161 |
-
*
|
162 |
-
* @author Vova Feldman
|
163 |
-
* @since 1.2.1.6
|
164 |
-
*/
|
165 |
-
if ( empty( $caller['line'] ) ) {
|
166 |
-
$depth --;
|
167 |
-
|
168 |
-
while ( $depth >= 0 ) {
|
169 |
-
if ( ! empty( $bt[ $depth ]['line'] ) ) {
|
170 |
-
$caller['line'] = $bt[ $depth ]['line'];
|
171 |
-
$caller['file'] = $bt[ $depth ]['file'];
|
172 |
-
break;
|
173 |
-
}
|
174 |
-
}
|
175 |
-
}
|
176 |
-
|
177 |
-
$log = array_merge( $caller, array(
|
178 |
-
'cnt' => self::$CNT ++,
|
179 |
-
'logger' => $this,
|
180 |
-
'timestamp' => microtime( true ),
|
181 |
-
'log_type' => $type,
|
182 |
-
'msg' => $message,
|
183 |
-
) );
|
184 |
-
|
185 |
-
if ( self::$_isStorageLoggingOn ) {
|
186 |
-
$this->db_log( $type, $message, self::$CNT, $caller );
|
187 |
-
}
|
188 |
-
|
189 |
-
self::$LOG[] = $log;
|
190 |
-
|
191 |
-
if ( $this->is_echo_on() && ! Freemius::is_ajax() ) {
|
192 |
-
echo self::format_html( $log ) . "\n";
|
193 |
-
}
|
194 |
-
}
|
195 |
-
|
196 |
-
function log( $message, $wrapper = false ) {
|
197 |
-
$this->_log( $message, 'log', $wrapper );
|
198 |
-
}
|
199 |
-
|
200 |
-
function info( $message, $wrapper = false ) {
|
201 |
-
$this->_log( $message, 'info', $wrapper );
|
202 |
-
}
|
203 |
-
|
204 |
-
function warn( $message, $wrapper = false ) {
|
205 |
-
$this->_log( $message, 'warn', $wrapper );
|
206 |
-
}
|
207 |
-
|
208 |
-
function error( $message, $wrapper = false ) {
|
209 |
-
$this->_log( $message, 'error', $wrapper );
|
210 |
-
}
|
211 |
-
|
212 |
-
/**
|
213 |
-
* Log API error.
|
214 |
-
*
|
215 |
-
* @author Vova Feldman (@svovaf)
|
216 |
-
* @since 1.2.1.5
|
217 |
-
*
|
218 |
-
* @param mixed $api_result
|
219 |
-
* @param bool $wrapper
|
220 |
-
*/
|
221 |
-
function api_error( $api_result, $wrapper = false ) {
|
222 |
-
$message = '';
|
223 |
-
if ( is_object( $api_result ) && isset( $api_result->error ) ) {
|
224 |
-
$message = $api_result->error->message;
|
225 |
-
} else if ( is_object( $api_result ) ) {
|
226 |
-
$message = var_export( $api_result, true );
|
227 |
-
} else if ( is_string( $api_result ) ) {
|
228 |
-
$message = $api_result;
|
229 |
-
} else if ( empty( $api_result ) ) {
|
230 |
-
$message = 'Empty API result.';
|
231 |
-
}
|
232 |
-
|
233 |
-
$message = 'API Error: ' . $message;
|
234 |
-
|
235 |
-
$this->_log( $message, 'error', $wrapper );
|
236 |
-
}
|
237 |
-
|
238 |
-
function entrance( $message = '', $wrapper = false ) {
|
239 |
-
$msg = 'Entrance' . ( empty( $message ) ? '' : ' > ' ) . $message;
|
240 |
-
|
241 |
-
$this->_log( $msg, 'log', $wrapper );
|
242 |
-
}
|
243 |
-
|
244 |
-
function departure( $message = '', $wrapper = false ) {
|
245 |
-
$msg = 'Departure' . ( empty( $message ) ? '' : ' > ' ) . $message;
|
246 |
-
|
247 |
-
$this->_log( $msg, 'log', $wrapper );
|
248 |
-
}
|
249 |
-
|
250 |
-
#--------------------------------------------------------------------------------
|
251 |
-
#region Log Formatting
|
252 |
-
#--------------------------------------------------------------------------------
|
253 |
-
|
254 |
-
private static function format( $log, $show_type = true ) {
|
255 |
-
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'] . ']';
|
256 |
-
}
|
257 |
-
|
258 |
-
private static function format_html( $log ) {
|
259 |
-
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>';
|
260 |
-
}
|
261 |
-
|
262 |
-
#endregion
|
263 |
-
|
264 |
-
static function dump() {
|
265 |
-
?>
|
266 |
-
<!-- BEGIN: Freemius PHP Console Log -->
|
267 |
-
<script type="text/javascript">
|
268 |
-
<?php
|
269 |
-
foreach ( self::$LOG as $log ) {
|
270 |
-
echo 'console.' . $log['log_type'] . '(' . json_encode( self::format( $log, false ) ) . ')' . "\n";
|
271 |
-
}
|
272 |
-
?>
|
273 |
-
</script>
|
274 |
-
<!-- END: Freemius PHP Console Log -->
|
275 |
-
<?php
|
276 |
-
}
|
277 |
-
|
278 |
-
static function get_log() {
|
279 |
-
return self::$LOG;
|
280 |
-
}
|
281 |
-
|
282 |
-
#--------------------------------------------------------------------------------
|
283 |
-
#region Database Logging
|
284 |
-
#--------------------------------------------------------------------------------
|
285 |
-
|
286 |
-
/**
|
287 |
-
* @author Vova Feldman (@svovaf)
|
288 |
-
* @since 1.2.1.6
|
289 |
-
*
|
290 |
-
* @return bool
|
291 |
-
*/
|
292 |
-
public static function is_storage_logging_on() {
|
293 |
-
if ( ! isset( self::$_isStorageLoggingOn ) ) {
|
294 |
-
self::$_isStorageLoggingOn = ( 1 == get_option( 'fs_storage_logger', 0 ) );
|
295 |
-
}
|
296 |
-
|
297 |
-
return self::$_isStorageLoggingOn;
|
298 |
-
}
|
299 |
-
|
300 |
-
/**
|
301 |
-
* Turns on/off database persistent debugging to capture
|
302 |
-
* multi-session logs to debug complex flows like
|
303 |
-
* plugin auto-deactivate on premium version activation.
|
304 |
-
*
|
305 |
-
* @todo Check if Theme Check has issues with DB tables for themes.
|
306 |
-
*
|
307 |
-
* @author Vova Feldman (@svovaf)
|
308 |
-
* @since 1.2.1.6
|
309 |
-
*
|
310 |
-
* @param bool $is_on
|
311 |
-
*
|
312 |
-
* @return bool
|
313 |
-
*/
|
314 |
-
public static function _set_storage_logging( $is_on = true ) {
|
315 |
-
global $wpdb;
|
316 |
-
|
317 |
-
$table = "{$wpdb->prefix}fs_logger";
|
318 |
-
|
319 |
-
if ( $is_on ) {
|
320 |
-
/**
|
321 |
-
* Create logging table.
|
322 |
-
*
|
323 |
-
* NOTE:
|
324 |
-
* dbDelta must use KEY and not INDEX for indexes.
|
325 |
-
*
|
326 |
-
* @link https://core.trac.wordpress.org/ticket/2695
|
327 |
-
*/
|
328 |
-
$result = $wpdb->query( "CREATE TABLE {$table} (
|
329 |
-
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
|
330 |
-
`process_id` INT UNSIGNED NOT NULL,
|
331 |
-
`user_name` VARCHAR(64) NOT NULL,
|
332 |
-
`logger` VARCHAR(128) NOT NULL,
|
333 |
-
`log_order` INT UNSIGNED NOT NULL,
|
334 |
-
`type` ENUM('log','info','warn','error') NOT NULL DEFAULT 'log',
|
335 |
-
`message` TEXT NOT NULL,
|
336 |
-
`file` VARCHAR(256) NOT NULL,
|
337 |
-
`line` INT UNSIGNED NOT NULL,
|
338 |
-
`function` VARCHAR(256) NOT NULL,
|
339 |
-
`request_type` ENUM('call','ajax','cron') NOT NULL DEFAULT 'call',
|
340 |
-
`request_url` VARCHAR(1024) NOT NULL,
|
341 |
-
`created` DECIMAL(16, 6) NOT NULL,
|
342 |
-
PRIMARY KEY (`id`),
|
343 |
-
KEY `process_id` (`process_id` ASC),
|
344 |
-
KEY `process_logger` (`process_id` ASC, `logger` ASC),
|
345 |
-
KEY `function` (`function` ASC),
|
346 |
-
KEY `type` (`type` ASC))" );
|
347 |
-
} else {
|
348 |
-
/**
|
349 |
-
* Drop logging table.
|
350 |
-
*/
|
351 |
-
$result = $wpdb->query( "DROP TABLE IF EXISTS $table;" );
|
352 |
-
}
|
353 |
-
|
354 |
-
if ( false !== $result ) {
|
355 |
-
update_option( 'fs_storage_logger', ( $is_on ? 1 : 0 ) );
|
356 |
-
}
|
357 |
-
|
358 |
-
return ( false !== $result );
|
359 |
-
}
|
360 |
-
|
361 |
-
/**
|
362 |
-
* @author Vova Feldman (@svovaf)
|
363 |
-
* @since 1.2.1.6
|
364 |
-
*
|
365 |
-
* @param string $type
|
366 |
-
* @param string $message
|
367 |
-
* @param int $log_order
|
368 |
-
* @param array $caller
|
369 |
-
*
|
370 |
-
* @return false|int
|
371 |
-
*/
|
372 |
-
private function db_log(
|
373 |
-
&$type,
|
374 |
-
&$message,
|
375 |
-
&$log_order,
|
376 |
-
&$caller
|
377 |
-
) {
|
378 |
-
global $wpdb;
|
379 |
-
|
380 |
-
$request_type = 'call';
|
381 |
-
if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
|
382 |
-
$request_type = 'cron';
|
383 |
-
} else if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
|
384 |
-
$request_type = 'ajax';
|
385 |
-
}
|
386 |
-
|
387 |
-
$request_url = WP_FS__IS_HTTP_REQUEST ?
|
388 |
-
$_SERVER['REQUEST_URI'] :
|
389 |
-
'';
|
390 |
-
|
391 |
-
return $wpdb->insert(
|
392 |
-
"{$wpdb->prefix}fs_logger",
|
393 |
-
array(
|
394 |
-
'process_id' => self::$_processID,
|
395 |
-
'user_name' => self::$_ownerName,
|
396 |
-
'logger' => $this->_id,
|
397 |
-
'log_order' => $log_order,
|
398 |
-
'type' => $type,
|
399 |
-
'request_type' => $request_type,
|
400 |
-
'request_url' => $request_url,
|
401 |
-
'message' => $message,
|
402 |
-
'file' => isset( $caller['file'] ) ?
|
403 |
-
substr( $caller['file'], self::$_abspathLength ) :
|
404 |
-
'',
|
405 |
-
'line' => $caller['line'],
|
406 |
-
'function' => ( ! empty( $caller['class'] ) ? $caller['class'] . $caller['type'] : '' ) . $caller['function'],
|
407 |
-
'created' => microtime( true ),
|
408 |
-
)
|
409 |
-
);
|
410 |
-
}
|
411 |
-
|
412 |
-
/**
|
413 |
-
* Persistent DB logger columns.
|
414 |
-
*
|
415 |
-
* @var array
|
416 |
-
*/
|
417 |
-
private static $_log_columns = array(
|
418 |
-
'id',
|
419 |
-
'process_id',
|
420 |
-
'user_name',
|
421 |
-
'logger',
|
422 |
-
'log_order',
|
423 |
-
'type',
|
424 |
-
'message',
|
425 |
-
'file',
|
426 |
-
'line',
|
427 |
-
'function',
|
428 |
-
'request_type',
|
429 |
-
'request_url',
|
430 |
-
'created',
|
431 |
-
);
|
432 |
-
|
433 |
-
/**
|
434 |
-
* Create DB logs query.
|
435 |
-
*
|
436 |
-
* @author Vova Feldman (@svovaf)
|
437 |
-
* @since 1.2.1.6
|
438 |
-
*
|
439 |
-
* @param bool $filters
|
440 |
-
* @param int $limit
|
441 |
-
* @param int $offset
|
442 |
-
* @param bool $order
|
443 |
-
* @param bool $escape_eol
|
444 |
-
*
|
445 |
-
* @return string
|
446 |
-
*/
|
447 |
-
private static function build_db_logs_query(
|
448 |
-
$filters = false,
|
449 |
-
$limit = 200,
|
450 |
-
$offset = 0,
|
451 |
-
$order = false,
|
452 |
-
$escape_eol = false
|
453 |
-
) {
|
454 |
-
global $wpdb;
|
455 |
-
|
456 |
-
$select = '*';
|
457 |
-
|
458 |
-
if ( $escape_eol ) {
|
459 |
-
$select = '';
|
460 |
-
for ( $i = 0, $len = count( self::$_log_columns ); $i < $len; $i ++ ) {
|
461 |
-
if ( $i > 0 ) {
|
462 |
-
$select .= ', ';
|
463 |
-
}
|
464 |
-
|
465 |
-
if ( 'message' !== self::$_log_columns[ $i ] ) {
|
466 |
-
$select .= self::$_log_columns[ $i ];
|
467 |
-
} else {
|
468 |
-
$select .= 'REPLACE(message , \'\n\', \' \') AS message';
|
469 |
-
}
|
470 |
-
}
|
471 |
-
}
|
472 |
-
|
473 |
-
$query = "SELECT {$select} FROM {$wpdb->prefix}fs_logger";
|
474 |
-
if ( is_array( $filters ) ) {
|
475 |
-
$criteria = array();
|
476 |
-
|
477 |
-
if ( ! empty( $filters['type'] ) && 'all' !== $filters['type'] ) {
|
478 |
-
$filters['type'] = strtolower( $filters['type'] );
|
479 |
-
|
480 |
-
switch ( $filters['type'] ) {
|
481 |
-
case 'warn_error':
|
482 |
-
$criteria[] = array( 'col' => 'type', 'val' => array( 'warn', 'error' ) );
|
483 |
-
break;
|
484 |
-
case 'error':
|
485 |
-
case 'warn':
|
486 |
-
$criteria[] = array( 'col' => 'type', 'val' => $filters['type'] );
|
487 |
-
break;
|
488 |
-
case 'info':
|
489 |
-
default:
|
490 |
-
$criteria[] = array( 'col' => 'type', 'val' => array( 'info', 'log' ) );
|
491 |
-
break;
|
492 |
-
}
|
493 |
-
}
|
494 |
-
|
495 |
-
if ( ! empty( $filters['request_type'] ) ) {
|
496 |
-
$filters['request_type'] = strtolower( $filters['request_type'] );
|
497 |
-
|
498 |
-
if ( in_array( $filters['request_type'], array( 'call', 'ajax', 'cron' ) ) ) {
|
499 |
-
$criteria[] = array( 'col' => 'request_type', 'val' => $filters['request_type'] );
|
500 |
-
}
|
501 |
-
}
|
502 |
-
|
503 |
-
if ( ! empty( $filters['file'] ) ) {
|
504 |
-
$criteria[] = array(
|
505 |
-
'col' => 'file',
|
506 |
-
'op' => 'LIKE',
|
507 |
-
'val' => '%' . esc_sql( $filters['file'] ),
|
508 |
-
);
|
509 |
-
}
|
510 |
-
|
511 |
-
if ( ! empty( $filters['function'] ) ) {
|
512 |
-
$criteria[] = array(
|
513 |
-
'col' => 'function',
|
514 |
-
'op' => 'LIKE',
|
515 |
-
'val' => '%' . esc_sql( $filters['function'] ),
|
516 |
-
);
|
517 |
-
}
|
518 |
-
|
519 |
-
if ( ! empty( $filters['process_id'] ) && is_numeric( $filters['process_id'] ) ) {
|
520 |
-
$criteria[] = array( 'col' => 'process_id', 'val' => $filters['process_id'] );
|
521 |
-
}
|
522 |
-
|
523 |
-
if ( ! empty( $filters['logger'] ) ) {
|
524 |
-
$criteria[] = array(
|
525 |
-
'col' => 'logger',
|
526 |
-
'op' => 'LIKE',
|
527 |
-
'val' => '%' . esc_sql( $filters['logger'] ) . '%',
|
528 |
-
);
|
529 |
-
}
|
530 |
-
|
531 |
-
if ( ! empty( $filters['message'] ) ) {
|
532 |
-
$criteria[] = array(
|
533 |
-
'col' => 'message',
|
534 |
-
'op' => 'LIKE',
|
535 |
-
'val' => '%' . esc_sql( $filters['message'] ) . '%',
|
536 |
-
);
|
537 |
-
}
|
538 |
-
|
539 |
-
if ( 0 < count( $criteria ) ) {
|
540 |
-
$query .= "\nWHERE\n";
|
541 |
-
|
542 |
-
$first = true;
|
543 |
-
foreach ( $criteria as $c ) {
|
544 |
-
if ( ! $first ) {
|
545 |
-
$query .= "AND\n";
|
546 |
-
}
|
547 |
-
|
548 |
-
if ( is_array( $c['val'] ) ) {
|
549 |
-
$operator = 'IN';
|
550 |
-
|
551 |
-
for ( $i = 0, $len = count( $c['val'] ); $i < $len; $i ++ ) {
|
552 |
-
$c['val'][ $i ] = "'" . esc_sql( $c['val'][ $i ] ) . "'";
|
553 |
-
}
|
554 |
-
|
555 |
-
$val = '(' . implode( ',', $c['val'] ) . ')';
|
556 |
-
} else {
|
557 |
-
$operator = ! empty( $c['op'] ) ? $c['op'] : '=';
|
558 |
-
$val = "'" . esc_sql( $c['val'] ) . "'";
|
559 |
-
}
|
560 |
-
|
561 |
-
$query .= "`{$c['col']}` {$operator} {$val}\n";
|
562 |
-
|
563 |
-
$first = false;
|
564 |
-
}
|
565 |
-
}
|
566 |
-
}
|
567 |
-
|
568 |
-
if ( ! is_array( $order ) ) {
|
569 |
-
$order = array(
|
570 |
-
'col' => 'id',
|
571 |
-
'order' => 'desc'
|
572 |
-
);
|
573 |
-
}
|
574 |
-
|
575 |
-
$query .= " ORDER BY {$order['col']} {$order['order']} LIMIT {$offset},{$limit}";
|
576 |
-
|
577 |
-
return $query;
|
578 |
-
}
|
579 |
-
|
580 |
-
/**
|
581 |
-
* Load logs from DB.
|
582 |
-
*
|
583 |
-
* @author Vova Feldman (@svovaf)
|
584 |
-
* @since 1.2.1.6
|
585 |
-
*
|
586 |
-
* @param bool $filters
|
587 |
-
* @param int $limit
|
588 |
-
* @param int $offset
|
589 |
-
* @param bool $order
|
590 |
-
*
|
591 |
-
* @return object[]|null
|
592 |
-
*/
|
593 |
-
public static function load_db_logs(
|
594 |
-
$filters = false,
|
595 |
-
$limit = 200,
|
596 |
-
$offset = 0,
|
597 |
-
$order = false
|
598 |
-
) {
|
599 |
-
global $wpdb;
|
600 |
-
|
601 |
-
$query = self::build_db_logs_query(
|
602 |
-
$filters,
|
603 |
-
$limit,
|
604 |
-
$offset,
|
605 |
-
$order
|
606 |
-
);
|
607 |
-
|
608 |
-
return $wpdb->get_results( $query );
|
609 |
-
}
|
610 |
-
|
611 |
-
/**
|
612 |
-
* Load logs from DB.
|
613 |
-
*
|
614 |
-
* @author Vova Feldman (@svovaf)
|
615 |
-
* @since 1.2.1.6
|
616 |
-
*
|
617 |
-
* @param bool $filters
|
618 |
-
* @param string $filename
|
619 |
-
* @param int $limit
|
620 |
-
* @param int $offset
|
621 |
-
* @param bool $order
|
622 |
-
*
|
623 |
-
* @return false|string File download URL or false on failure.
|
624 |
-
*/
|
625 |
-
public static function download_db_logs(
|
626 |
-
$filters = false,
|
627 |
-
$filename = '',
|
628 |
-
$limit = 10000,
|
629 |
-
$offset = 0,
|
630 |
-
$order = false
|
631 |
-
) {
|
632 |
-
global $wpdb;
|
633 |
-
|
634 |
-
$query = self::build_db_logs_query(
|
635 |
-
$filters,
|
636 |
-
$limit,
|
637 |
-
$offset,
|
638 |
-
$order,
|
639 |
-
true
|
640 |
-
);
|
641 |
-
|
642 |
-
$upload_dir = wp_upload_dir();
|
643 |
-
if ( empty( $filename ) ) {
|
644 |
-
$filename = 'fs-logs-' . date( 'Y-m-d_H-i-s', WP_FS__SCRIPT_START_TIME ) . '.csv';
|
645 |
-
}
|
646 |
-
$filepath = rtrim( $upload_dir['path'], '/' ) . "/{$filename}";
|
647 |
-
|
648 |
-
$query .= " INTO OUTFILE '{$filepath}' FIELDS TERMINATED BY '\t' ESCAPED BY '\\\\' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\\n'";
|
649 |
-
|
650 |
-
$columns = '';
|
651 |
-
for ( $i = 0, $len = count( self::$_log_columns ); $i < $len; $i ++ ) {
|
652 |
-
if ( $i > 0 ) {
|
653 |
-
$columns .= ', ';
|
654 |
-
}
|
655 |
-
|
656 |
-
$columns .= "'" . self::$_log_columns[ $i ] . "'";
|
657 |
-
}
|
658 |
-
|
659 |
-
$query = "SELECT {$columns} UNION ALL " . $query;
|
660 |
-
|
661 |
-
$result = $wpdb->query( $query );
|
662 |
-
|
663 |
-
if ( false === $result ) {
|
664 |
-
return false;
|
665 |
-
}
|
666 |
-
|
667 |
-
return rtrim( $upload_dir['url'], '/' ) . '/' . $filename;
|
668 |
-
}
|
669 |
-
|
670 |
-
/**
|
671 |
-
* @author Vova Feldman (@svovaf)
|
672 |
-
* @since 1.2.1.6
|
673 |
-
*
|
674 |
-
* @param string $filename
|
675 |
-
*
|
676 |
-
* @return string
|
677 |
-
*/
|
678 |
-
public static function get_logs_download_url( $filename = '' ) {
|
679 |
-
$upload_dir = wp_upload_dir();
|
680 |
-
if ( empty( $filename ) ) {
|
681 |
-
$filename = 'fs-logs-' . date( 'Y-m-d_H-i-s', WP_FS__SCRIPT_START_TIME ) . '.csv';
|
682 |
-
}
|
683 |
-
|
684 |
-
return rtrim( $upload_dir['url'], '/' ) . $filename;
|
685 |
-
}
|
686 |
-
|
687 |
-
#endregion
|
688 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.0.3
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
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 = function_exists( 'get_current_user' ) ?
|
89 |
+
get_current_user() :
|
90 |
+
'unknown';
|
91 |
+
self::$_isStorageLoggingOn = ( 1 == get_option( 'fs_storage_logger', 0 ) );
|
92 |
+
self::$_abspathLength = strlen( ABSPATH );
|
93 |
+
self::$_processID = mt_rand( 0, 32000 );
|
94 |
+
|
95 |
+
// Process ID may be `false` on errors.
|
96 |
+
if ( ! is_numeric( self::$_processID ) ) {
|
97 |
+
self::$_processID = 0;
|
98 |
+
}
|
99 |
+
}
|
100 |
+
|
101 |
+
private static function hook_footer() {
|
102 |
+
if ( self::$_HOOKED_FOOTER ) {
|
103 |
+
return;
|
104 |
+
}
|
105 |
+
|
106 |
+
if ( is_admin() ) {
|
107 |
+
add_action( 'admin_footer', 'FS_Logger::dump', 100 );
|
108 |
+
} else {
|
109 |
+
add_action( 'wp_footer', 'FS_Logger::dump', 100 );
|
110 |
+
}
|
111 |
+
}
|
112 |
+
|
113 |
+
function is_on() {
|
114 |
+
return $this->_on;
|
115 |
+
}
|
116 |
+
|
117 |
+
function on() {
|
118 |
+
$this->_on = true;
|
119 |
+
|
120 |
+
if ( ! function_exists( 'dbDelta' ) ) {
|
121 |
+
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
|
122 |
+
}
|
123 |
+
|
124 |
+
self::hook_footer();
|
125 |
+
}
|
126 |
+
|
127 |
+
function echo_on() {
|
128 |
+
$this->on();
|
129 |
+
|
130 |
+
$this->_echo = true;
|
131 |
+
}
|
132 |
+
|
133 |
+
function is_echo_on() {
|
134 |
+
return $this->_echo;
|
135 |
+
}
|
136 |
+
|
137 |
+
function get_id() {
|
138 |
+
return $this->_id;
|
139 |
+
}
|
140 |
+
|
141 |
+
function get_file() {
|
142 |
+
return $this->_file_start;
|
143 |
+
}
|
144 |
+
|
145 |
+
private function _log( &$message, $type = 'log', $wrapper ) {
|
146 |
+
if ( ! $this->is_on() ) {
|
147 |
+
return;
|
148 |
+
}
|
149 |
+
|
150 |
+
$bt = debug_backtrace();
|
151 |
+
$depth = $wrapper ? 3 : 2;
|
152 |
+
while ( $depth < count( $bt ) - 1 && 'eval' === $bt[ $depth ]['function'] ) {
|
153 |
+
$depth ++;
|
154 |
+
}
|
155 |
+
|
156 |
+
$caller = $bt[ $depth ];
|
157 |
+
|
158 |
+
/**
|
159 |
+
* Retrieve the correct call file & line number from backtrace
|
160 |
+
* when logging from a wrapper method.
|
161 |
+
*
|
162 |
+
* @author Vova Feldman
|
163 |
+
* @since 1.2.1.6
|
164 |
+
*/
|
165 |
+
if ( empty( $caller['line'] ) ) {
|
166 |
+
$depth --;
|
167 |
+
|
168 |
+
while ( $depth >= 0 ) {
|
169 |
+
if ( ! empty( $bt[ $depth ]['line'] ) ) {
|
170 |
+
$caller['line'] = $bt[ $depth ]['line'];
|
171 |
+
$caller['file'] = $bt[ $depth ]['file'];
|
172 |
+
break;
|
173 |
+
}
|
174 |
+
}
|
175 |
+
}
|
176 |
+
|
177 |
+
$log = array_merge( $caller, array(
|
178 |
+
'cnt' => self::$CNT ++,
|
179 |
+
'logger' => $this,
|
180 |
+
'timestamp' => microtime( true ),
|
181 |
+
'log_type' => $type,
|
182 |
+
'msg' => $message,
|
183 |
+
) );
|
184 |
+
|
185 |
+
if ( self::$_isStorageLoggingOn ) {
|
186 |
+
$this->db_log( $type, $message, self::$CNT, $caller );
|
187 |
+
}
|
188 |
+
|
189 |
+
self::$LOG[] = $log;
|
190 |
+
|
191 |
+
if ( $this->is_echo_on() && ! Freemius::is_ajax() ) {
|
192 |
+
echo self::format_html( $log ) . "\n";
|
193 |
+
}
|
194 |
+
}
|
195 |
+
|
196 |
+
function log( $message, $wrapper = false ) {
|
197 |
+
$this->_log( $message, 'log', $wrapper );
|
198 |
+
}
|
199 |
+
|
200 |
+
function info( $message, $wrapper = false ) {
|
201 |
+
$this->_log( $message, 'info', $wrapper );
|
202 |
+
}
|
203 |
+
|
204 |
+
function warn( $message, $wrapper = false ) {
|
205 |
+
$this->_log( $message, 'warn', $wrapper );
|
206 |
+
}
|
207 |
+
|
208 |
+
function error( $message, $wrapper = false ) {
|
209 |
+
$this->_log( $message, 'error', $wrapper );
|
210 |
+
}
|
211 |
+
|
212 |
+
/**
|
213 |
+
* Log API error.
|
214 |
+
*
|
215 |
+
* @author Vova Feldman (@svovaf)
|
216 |
+
* @since 1.2.1.5
|
217 |
+
*
|
218 |
+
* @param mixed $api_result
|
219 |
+
* @param bool $wrapper
|
220 |
+
*/
|
221 |
+
function api_error( $api_result, $wrapper = false ) {
|
222 |
+
$message = '';
|
223 |
+
if ( is_object( $api_result ) && isset( $api_result->error ) ) {
|
224 |
+
$message = $api_result->error->message;
|
225 |
+
} else if ( is_object( $api_result ) ) {
|
226 |
+
$message = var_export( $api_result, true );
|
227 |
+
} else if ( is_string( $api_result ) ) {
|
228 |
+
$message = $api_result;
|
229 |
+
} else if ( empty( $api_result ) ) {
|
230 |
+
$message = 'Empty API result.';
|
231 |
+
}
|
232 |
+
|
233 |
+
$message = 'API Error: ' . $message;
|
234 |
+
|
235 |
+
$this->_log( $message, 'error', $wrapper );
|
236 |
+
}
|
237 |
+
|
238 |
+
function entrance( $message = '', $wrapper = false ) {
|
239 |
+
$msg = 'Entrance' . ( empty( $message ) ? '' : ' > ' ) . $message;
|
240 |
+
|
241 |
+
$this->_log( $msg, 'log', $wrapper );
|
242 |
+
}
|
243 |
+
|
244 |
+
function departure( $message = '', $wrapper = false ) {
|
245 |
+
$msg = 'Departure' . ( empty( $message ) ? '' : ' > ' ) . $message;
|
246 |
+
|
247 |
+
$this->_log( $msg, 'log', $wrapper );
|
248 |
+
}
|
249 |
+
|
250 |
+
#--------------------------------------------------------------------------------
|
251 |
+
#region Log Formatting
|
252 |
+
#--------------------------------------------------------------------------------
|
253 |
+
|
254 |
+
private static function format( $log, $show_type = true ) {
|
255 |
+
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'] . ']';
|
256 |
+
}
|
257 |
+
|
258 |
+
private static function format_html( $log ) {
|
259 |
+
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>';
|
260 |
+
}
|
261 |
+
|
262 |
+
#endregion
|
263 |
+
|
264 |
+
static function dump() {
|
265 |
+
?>
|
266 |
+
<!-- BEGIN: Freemius PHP Console Log -->
|
267 |
+
<script type="text/javascript">
|
268 |
+
<?php
|
269 |
+
foreach ( self::$LOG as $log ) {
|
270 |
+
echo 'console.' . $log['log_type'] . '(' . json_encode( self::format( $log, false ) ) . ')' . "\n";
|
271 |
+
}
|
272 |
+
?>
|
273 |
+
</script>
|
274 |
+
<!-- END: Freemius PHP Console Log -->
|
275 |
+
<?php
|
276 |
+
}
|
277 |
+
|
278 |
+
static function get_log() {
|
279 |
+
return self::$LOG;
|
280 |
+
}
|
281 |
+
|
282 |
+
#--------------------------------------------------------------------------------
|
283 |
+
#region Database Logging
|
284 |
+
#--------------------------------------------------------------------------------
|
285 |
+
|
286 |
+
/**
|
287 |
+
* @author Vova Feldman (@svovaf)
|
288 |
+
* @since 1.2.1.6
|
289 |
+
*
|
290 |
+
* @return bool
|
291 |
+
*/
|
292 |
+
public static function is_storage_logging_on() {
|
293 |
+
if ( ! isset( self::$_isStorageLoggingOn ) ) {
|
294 |
+
self::$_isStorageLoggingOn = ( 1 == get_option( 'fs_storage_logger', 0 ) );
|
295 |
+
}
|
296 |
+
|
297 |
+
return self::$_isStorageLoggingOn;
|
298 |
+
}
|
299 |
+
|
300 |
+
/**
|
301 |
+
* Turns on/off database persistent debugging to capture
|
302 |
+
* multi-session logs to debug complex flows like
|
303 |
+
* plugin auto-deactivate on premium version activation.
|
304 |
+
*
|
305 |
+
* @todo Check if Theme Check has issues with DB tables for themes.
|
306 |
+
*
|
307 |
+
* @author Vova Feldman (@svovaf)
|
308 |
+
* @since 1.2.1.6
|
309 |
+
*
|
310 |
+
* @param bool $is_on
|
311 |
+
*
|
312 |
+
* @return bool
|
313 |
+
*/
|
314 |
+
public static function _set_storage_logging( $is_on = true ) {
|
315 |
+
global $wpdb;
|
316 |
+
|
317 |
+
$table = "{$wpdb->prefix}fs_logger";
|
318 |
+
|
319 |
+
if ( $is_on ) {
|
320 |
+
/**
|
321 |
+
* Create logging table.
|
322 |
+
*
|
323 |
+
* NOTE:
|
324 |
+
* dbDelta must use KEY and not INDEX for indexes.
|
325 |
+
*
|
326 |
+
* @link https://core.trac.wordpress.org/ticket/2695
|
327 |
+
*/
|
328 |
+
$result = $wpdb->query( "CREATE TABLE {$table} (
|
329 |
+
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
|
330 |
+
`process_id` INT UNSIGNED NOT NULL,
|
331 |
+
`user_name` VARCHAR(64) NOT NULL,
|
332 |
+
`logger` VARCHAR(128) NOT NULL,
|
333 |
+
`log_order` INT UNSIGNED NOT NULL,
|
334 |
+
`type` ENUM('log','info','warn','error') NOT NULL DEFAULT 'log',
|
335 |
+
`message` TEXT NOT NULL,
|
336 |
+
`file` VARCHAR(256) NOT NULL,
|
337 |
+
`line` INT UNSIGNED NOT NULL,
|
338 |
+
`function` VARCHAR(256) NOT NULL,
|
339 |
+
`request_type` ENUM('call','ajax','cron') NOT NULL DEFAULT 'call',
|
340 |
+
`request_url` VARCHAR(1024) NOT NULL,
|
341 |
+
`created` DECIMAL(16, 6) NOT NULL,
|
342 |
+
PRIMARY KEY (`id`),
|
343 |
+
KEY `process_id` (`process_id` ASC),
|
344 |
+
KEY `process_logger` (`process_id` ASC, `logger` ASC),
|
345 |
+
KEY `function` (`function` ASC),
|
346 |
+
KEY `type` (`type` ASC))" );
|
347 |
+
} else {
|
348 |
+
/**
|
349 |
+
* Drop logging table.
|
350 |
+
*/
|
351 |
+
$result = $wpdb->query( "DROP TABLE IF EXISTS $table;" );
|
352 |
+
}
|
353 |
+
|
354 |
+
if ( false !== $result ) {
|
355 |
+
update_option( 'fs_storage_logger', ( $is_on ? 1 : 0 ) );
|
356 |
+
}
|
357 |
+
|
358 |
+
return ( false !== $result );
|
359 |
+
}
|
360 |
+
|
361 |
+
/**
|
362 |
+
* @author Vova Feldman (@svovaf)
|
363 |
+
* @since 1.2.1.6
|
364 |
+
*
|
365 |
+
* @param string $type
|
366 |
+
* @param string $message
|
367 |
+
* @param int $log_order
|
368 |
+
* @param array $caller
|
369 |
+
*
|
370 |
+
* @return false|int
|
371 |
+
*/
|
372 |
+
private function db_log(
|
373 |
+
&$type,
|
374 |
+
&$message,
|
375 |
+
&$log_order,
|
376 |
+
&$caller
|
377 |
+
) {
|
378 |
+
global $wpdb;
|
379 |
+
|
380 |
+
$request_type = 'call';
|
381 |
+
if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
|
382 |
+
$request_type = 'cron';
|
383 |
+
} else if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
|
384 |
+
$request_type = 'ajax';
|
385 |
+
}
|
386 |
+
|
387 |
+
$request_url = WP_FS__IS_HTTP_REQUEST ?
|
388 |
+
$_SERVER['REQUEST_URI'] :
|
389 |
+
'';
|
390 |
+
|
391 |
+
return $wpdb->insert(
|
392 |
+
"{$wpdb->prefix}fs_logger",
|
393 |
+
array(
|
394 |
+
'process_id' => self::$_processID,
|
395 |
+
'user_name' => self::$_ownerName,
|
396 |
+
'logger' => $this->_id,
|
397 |
+
'log_order' => $log_order,
|
398 |
+
'type' => $type,
|
399 |
+
'request_type' => $request_type,
|
400 |
+
'request_url' => $request_url,
|
401 |
+
'message' => $message,
|
402 |
+
'file' => isset( $caller['file'] ) ?
|
403 |
+
substr( $caller['file'], self::$_abspathLength ) :
|
404 |
+
'',
|
405 |
+
'line' => $caller['line'],
|
406 |
+
'function' => ( ! empty( $caller['class'] ) ? $caller['class'] . $caller['type'] : '' ) . $caller['function'],
|
407 |
+
'created' => microtime( true ),
|
408 |
+
)
|
409 |
+
);
|
410 |
+
}
|
411 |
+
|
412 |
+
/**
|
413 |
+
* Persistent DB logger columns.
|
414 |
+
*
|
415 |
+
* @var array
|
416 |
+
*/
|
417 |
+
private static $_log_columns = array(
|
418 |
+
'id',
|
419 |
+
'process_id',
|
420 |
+
'user_name',
|
421 |
+
'logger',
|
422 |
+
'log_order',
|
423 |
+
'type',
|
424 |
+
'message',
|
425 |
+
'file',
|
426 |
+
'line',
|
427 |
+
'function',
|
428 |
+
'request_type',
|
429 |
+
'request_url',
|
430 |
+
'created',
|
431 |
+
);
|
432 |
+
|
433 |
+
/**
|
434 |
+
* Create DB logs query.
|
435 |
+
*
|
436 |
+
* @author Vova Feldman (@svovaf)
|
437 |
+
* @since 1.2.1.6
|
438 |
+
*
|
439 |
+
* @param bool $filters
|
440 |
+
* @param int $limit
|
441 |
+
* @param int $offset
|
442 |
+
* @param bool $order
|
443 |
+
* @param bool $escape_eol
|
444 |
+
*
|
445 |
+
* @return string
|
446 |
+
*/
|
447 |
+
private static function build_db_logs_query(
|
448 |
+
$filters = false,
|
449 |
+
$limit = 200,
|
450 |
+
$offset = 0,
|
451 |
+
$order = false,
|
452 |
+
$escape_eol = false
|
453 |
+
) {
|
454 |
+
global $wpdb;
|
455 |
+
|
456 |
+
$select = '*';
|
457 |
+
|
458 |
+
if ( $escape_eol ) {
|
459 |
+
$select = '';
|
460 |
+
for ( $i = 0, $len = count( self::$_log_columns ); $i < $len; $i ++ ) {
|
461 |
+
if ( $i > 0 ) {
|
462 |
+
$select .= ', ';
|
463 |
+
}
|
464 |
+
|
465 |
+
if ( 'message' !== self::$_log_columns[ $i ] ) {
|
466 |
+
$select .= self::$_log_columns[ $i ];
|
467 |
+
} else {
|
468 |
+
$select .= 'REPLACE(message , \'\n\', \' \') AS message';
|
469 |
+
}
|
470 |
+
}
|
471 |
+
}
|
472 |
+
|
473 |
+
$query = "SELECT {$select} FROM {$wpdb->prefix}fs_logger";
|
474 |
+
if ( is_array( $filters ) ) {
|
475 |
+
$criteria = array();
|
476 |
+
|
477 |
+
if ( ! empty( $filters['type'] ) && 'all' !== $filters['type'] ) {
|
478 |
+
$filters['type'] = strtolower( $filters['type'] );
|
479 |
+
|
480 |
+
switch ( $filters['type'] ) {
|
481 |
+
case 'warn_error':
|
482 |
+
$criteria[] = array( 'col' => 'type', 'val' => array( 'warn', 'error' ) );
|
483 |
+
break;
|
484 |
+
case 'error':
|
485 |
+
case 'warn':
|
486 |
+
$criteria[] = array( 'col' => 'type', 'val' => $filters['type'] );
|
487 |
+
break;
|
488 |
+
case 'info':
|
489 |
+
default:
|
490 |
+
$criteria[] = array( 'col' => 'type', 'val' => array( 'info', 'log' ) );
|
491 |
+
break;
|
492 |
+
}
|
493 |
+
}
|
494 |
+
|
495 |
+
if ( ! empty( $filters['request_type'] ) ) {
|
496 |
+
$filters['request_type'] = strtolower( $filters['request_type'] );
|
497 |
+
|
498 |
+
if ( in_array( $filters['request_type'], array( 'call', 'ajax', 'cron' ) ) ) {
|
499 |
+
$criteria[] = array( 'col' => 'request_type', 'val' => $filters['request_type'] );
|
500 |
+
}
|
501 |
+
}
|
502 |
+
|
503 |
+
if ( ! empty( $filters['file'] ) ) {
|
504 |
+
$criteria[] = array(
|
505 |
+
'col' => 'file',
|
506 |
+
'op' => 'LIKE',
|
507 |
+
'val' => '%' . esc_sql( $filters['file'] ),
|
508 |
+
);
|
509 |
+
}
|
510 |
+
|
511 |
+
if ( ! empty( $filters['function'] ) ) {
|
512 |
+
$criteria[] = array(
|
513 |
+
'col' => 'function',
|
514 |
+
'op' => 'LIKE',
|
515 |
+
'val' => '%' . esc_sql( $filters['function'] ),
|
516 |
+
);
|
517 |
+
}
|
518 |
+
|
519 |
+
if ( ! empty( $filters['process_id'] ) && is_numeric( $filters['process_id'] ) ) {
|
520 |
+
$criteria[] = array( 'col' => 'process_id', 'val' => $filters['process_id'] );
|
521 |
+
}
|
522 |
+
|
523 |
+
if ( ! empty( $filters['logger'] ) ) {
|
524 |
+
$criteria[] = array(
|
525 |
+
'col' => 'logger',
|
526 |
+
'op' => 'LIKE',
|
527 |
+
'val' => '%' . esc_sql( $filters['logger'] ) . '%',
|
528 |
+
);
|
529 |
+
}
|
530 |
+
|
531 |
+
if ( ! empty( $filters['message'] ) ) {
|
532 |
+
$criteria[] = array(
|
533 |
+
'col' => 'message',
|
534 |
+
'op' => 'LIKE',
|
535 |
+
'val' => '%' . esc_sql( $filters['message'] ) . '%',
|
536 |
+
);
|
537 |
+
}
|
538 |
+
|
539 |
+
if ( 0 < count( $criteria ) ) {
|
540 |
+
$query .= "\nWHERE\n";
|
541 |
+
|
542 |
+
$first = true;
|
543 |
+
foreach ( $criteria as $c ) {
|
544 |
+
if ( ! $first ) {
|
545 |
+
$query .= "AND\n";
|
546 |
+
}
|
547 |
+
|
548 |
+
if ( is_array( $c['val'] ) ) {
|
549 |
+
$operator = 'IN';
|
550 |
+
|
551 |
+
for ( $i = 0, $len = count( $c['val'] ); $i < $len; $i ++ ) {
|
552 |
+
$c['val'][ $i ] = "'" . esc_sql( $c['val'][ $i ] ) . "'";
|
553 |
+
}
|
554 |
+
|
555 |
+
$val = '(' . implode( ',', $c['val'] ) . ')';
|
556 |
+
} else {
|
557 |
+
$operator = ! empty( $c['op'] ) ? $c['op'] : '=';
|
558 |
+
$val = "'" . esc_sql( $c['val'] ) . "'";
|
559 |
+
}
|
560 |
+
|
561 |
+
$query .= "`{$c['col']}` {$operator} {$val}\n";
|
562 |
+
|
563 |
+
$first = false;
|
564 |
+
}
|
565 |
+
}
|
566 |
+
}
|
567 |
+
|
568 |
+
if ( ! is_array( $order ) ) {
|
569 |
+
$order = array(
|
570 |
+
'col' => 'id',
|
571 |
+
'order' => 'desc'
|
572 |
+
);
|
573 |
+
}
|
574 |
+
|
575 |
+
$query .= " ORDER BY {$order['col']} {$order['order']} LIMIT {$offset},{$limit}";
|
576 |
+
|
577 |
+
return $query;
|
578 |
+
}
|
579 |
+
|
580 |
+
/**
|
581 |
+
* Load logs from DB.
|
582 |
+
*
|
583 |
+
* @author Vova Feldman (@svovaf)
|
584 |
+
* @since 1.2.1.6
|
585 |
+
*
|
586 |
+
* @param bool $filters
|
587 |
+
* @param int $limit
|
588 |
+
* @param int $offset
|
589 |
+
* @param bool $order
|
590 |
+
*
|
591 |
+
* @return object[]|null
|
592 |
+
*/
|
593 |
+
public static function load_db_logs(
|
594 |
+
$filters = false,
|
595 |
+
$limit = 200,
|
596 |
+
$offset = 0,
|
597 |
+
$order = false
|
598 |
+
) {
|
599 |
+
global $wpdb;
|
600 |
+
|
601 |
+
$query = self::build_db_logs_query(
|
602 |
+
$filters,
|
603 |
+
$limit,
|
604 |
+
$offset,
|
605 |
+
$order
|
606 |
+
);
|
607 |
+
|
608 |
+
return $wpdb->get_results( $query );
|
609 |
+
}
|
610 |
+
|
611 |
+
/**
|
612 |
+
* Load logs from DB.
|
613 |
+
*
|
614 |
+
* @author Vova Feldman (@svovaf)
|
615 |
+
* @since 1.2.1.6
|
616 |
+
*
|
617 |
+
* @param bool $filters
|
618 |
+
* @param string $filename
|
619 |
+
* @param int $limit
|
620 |
+
* @param int $offset
|
621 |
+
* @param bool $order
|
622 |
+
*
|
623 |
+
* @return false|string File download URL or false on failure.
|
624 |
+
*/
|
625 |
+
public static function download_db_logs(
|
626 |
+
$filters = false,
|
627 |
+
$filename = '',
|
628 |
+
$limit = 10000,
|
629 |
+
$offset = 0,
|
630 |
+
$order = false
|
631 |
+
) {
|
632 |
+
global $wpdb;
|
633 |
+
|
634 |
+
$query = self::build_db_logs_query(
|
635 |
+
$filters,
|
636 |
+
$limit,
|
637 |
+
$offset,
|
638 |
+
$order,
|
639 |
+
true
|
640 |
+
);
|
641 |
+
|
642 |
+
$upload_dir = wp_upload_dir();
|
643 |
+
if ( empty( $filename ) ) {
|
644 |
+
$filename = 'fs-logs-' . date( 'Y-m-d_H-i-s', WP_FS__SCRIPT_START_TIME ) . '.csv';
|
645 |
+
}
|
646 |
+
$filepath = rtrim( $upload_dir['path'], '/' ) . "/{$filename}";
|
647 |
+
|
648 |
+
$query .= " INTO OUTFILE '{$filepath}' FIELDS TERMINATED BY '\t' ESCAPED BY '\\\\' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\\n'";
|
649 |
+
|
650 |
+
$columns = '';
|
651 |
+
for ( $i = 0, $len = count( self::$_log_columns ); $i < $len; $i ++ ) {
|
652 |
+
if ( $i > 0 ) {
|
653 |
+
$columns .= ', ';
|
654 |
+
}
|
655 |
+
|
656 |
+
$columns .= "'" . self::$_log_columns[ $i ] . "'";
|
657 |
+
}
|
658 |
+
|
659 |
+
$query = "SELECT {$columns} UNION ALL " . $query;
|
660 |
+
|
661 |
+
$result = $wpdb->query( $query );
|
662 |
+
|
663 |
+
if ( false === $result ) {
|
664 |
+
return false;
|
665 |
+
}
|
666 |
+
|
667 |
+
return rtrim( $upload_dir['url'], '/' ) . '/' . $filename;
|
668 |
+
}
|
669 |
+
|
670 |
+
/**
|
671 |
+
* @author Vova Feldman (@svovaf)
|
672 |
+
* @since 1.2.1.6
|
673 |
+
*
|
674 |
+
* @param string $filename
|
675 |
+
*
|
676 |
+
* @return string
|
677 |
+
*/
|
678 |
+
public static function get_logs_download_url( $filename = '' ) {
|
679 |
+
$upload_dir = wp_upload_dir();
|
680 |
+
if ( empty( $filename ) ) {
|
681 |
+
$filename = 'fs-logs-' . date( 'Y-m-d_H-i-s', WP_FS__SCRIPT_START_TIME ) . '.csv';
|
682 |
+
}
|
683 |
+
|
684 |
+
return rtrim( $upload_dir['url'], '/' ) . $filename;
|
685 |
+
}
|
686 |
+
|
687 |
+
#endregion
|
688 |
}
|
freemius/includes/class-fs-plugin-updater.php
CHANGED
@@ -128,7 +128,7 @@
|
|
128 |
$plugin_update_row = preg_replace(
|
129 |
'/(\<div.+>)(.+)(\<a.+\<a.+)\<\/div\>/is',
|
130 |
'$1 $2 ' . sprintf(
|
131 |
-
$this->_fs->
|
132 |
'<a href="' . $this->_fs->pricing_url() . '">', '</a>',
|
133 |
$r->new_version ) .
|
134 |
'$4',
|
@@ -355,7 +355,7 @@ if ( !isset($info->error) ) {
|
|
355 |
$data->version = $this->_fs->get_plugin_version();
|
356 |
} else {
|
357 |
if ( $is_addon ) {
|
358 |
-
$data->name = $addon->title . ' ' . $this->_fs->
|
359 |
$data->slug = $addon->slug;
|
360 |
$data->url = WP_FS__ADDRESS;
|
361 |
$data->package = $new_version->url;
|
@@ -487,7 +487,7 @@ if ( !isset($info->error) ) {
|
|
487 |
if ( ! empty( $plugin_id ) && ! FS_Plugin::is_valid_id( $plugin_id ) ) {
|
488 |
// Invalid plugin ID.
|
489 |
return array(
|
490 |
-
'message' => $this->_fs->
|
491 |
'code' => 'invalid_module_id',
|
492 |
);
|
493 |
}
|
@@ -501,29 +501,27 @@ if ( !isset($info->error) ) {
|
|
501 |
if ( ! is_object( $addon ) ) {
|
502 |
// Invalid add-on ID.
|
503 |
return array(
|
504 |
-
'message' => $this->_fs->
|
505 |
'code' => 'invalid_module_id',
|
506 |
);
|
507 |
}
|
508 |
|
509 |
$slug = $addon->slug;
|
510 |
-
$title = $addon->title . ' ' . $this->_fs->
|
511 |
|
512 |
$is_addon = true;
|
513 |
} else {
|
514 |
$slug = $this->_fs->get_slug();
|
515 |
$title = $this->_fs->get_plugin_title() .
|
516 |
-
( $this->_fs->is_addon() ? ' ' . $this->_fs->
|
517 |
}
|
518 |
|
519 |
if ( $this->is_premium_plugin_active( $plugin_id ) ) {
|
520 |
// Premium version already activated.
|
521 |
return array(
|
522 |
-
'message' => $
|
523 |
-
|
524 |
-
|
525 |
-
'auto-install-error-premium-activated'
|
526 |
-
),
|
527 |
'code' => 'premium_installed',
|
528 |
);
|
529 |
}
|
@@ -552,7 +550,7 @@ if ( !isset($info->error) ) {
|
|
552 |
|
553 |
$skin_args = array(
|
554 |
'type' => 'web',
|
555 |
-
'title' => sprintf( $this->_fs->
|
556 |
'url' => esc_url_raw( $install_url ),
|
557 |
'nonce' => 'install-plugin_' . $slug,
|
558 |
'plugin' => '',
|
@@ -593,7 +591,7 @@ if ( !isset($info->error) ) {
|
|
593 |
global $wp_filesystem;
|
594 |
|
595 |
$error_code = 'unable_to_connect_to_filesystem';
|
596 |
-
$error_message = $this->_fs->
|
597 |
|
598 |
// Pass through the error from WP_Filesystem if one was raised.
|
599 |
if ( $wp_filesystem instanceof WP_Filesystem_Base &&
|
@@ -699,7 +697,7 @@ if ( !isset($info->error) ) {
|
|
699 |
} else {
|
700 |
return new WP_Error(
|
701 |
'rename_failed',
|
702 |
-
$this->_fs->
|
703 |
array(
|
704 |
'found' => $subdir_name,
|
705 |
'expected' => $desired_slug
|
128 |
$plugin_update_row = preg_replace(
|
129 |
'/(\<div.+>)(.+)(\<a.+\<a.+)\<\/div\>/is',
|
130 |
'$1 $2 ' . sprintf(
|
131 |
+
$this->_fs->get_text_inline( '%sRenew your license now%s to access version %s features and support.', 'renew-license-now' ),
|
132 |
'<a href="' . $this->_fs->pricing_url() . '">', '</a>',
|
133 |
$r->new_version ) .
|
134 |
'$4',
|
355 |
$data->version = $this->_fs->get_plugin_version();
|
356 |
} else {
|
357 |
if ( $is_addon ) {
|
358 |
+
$data->name = $addon->title . ' ' . $this->_fs->get_text_inline( 'Add-On', 'addon' );
|
359 |
$data->slug = $addon->slug;
|
360 |
$data->url = WP_FS__ADDRESS;
|
361 |
$data->package = $new_version->url;
|
487 |
if ( ! empty( $plugin_id ) && ! FS_Plugin::is_valid_id( $plugin_id ) ) {
|
488 |
// Invalid plugin ID.
|
489 |
return array(
|
490 |
+
'message' => $this->_fs->get_text_inline( 'Invalid module ID.', 'auto-install-error-invalid-id' ),
|
491 |
'code' => 'invalid_module_id',
|
492 |
);
|
493 |
}
|
501 |
if ( ! is_object( $addon ) ) {
|
502 |
// Invalid add-on ID.
|
503 |
return array(
|
504 |
+
'message' => $this->_fs->get_text_inline( 'Invalid module ID.', 'auto-install-error-invalid-id' ),
|
505 |
'code' => 'invalid_module_id',
|
506 |
);
|
507 |
}
|
508 |
|
509 |
$slug = $addon->slug;
|
510 |
+
$title = $addon->title . ' ' . $this->_fs->get_text_inline( 'Add-On', 'addon' );
|
511 |
|
512 |
$is_addon = true;
|
513 |
} else {
|
514 |
$slug = $this->_fs->get_slug();
|
515 |
$title = $this->_fs->get_plugin_title() .
|
516 |
+
( $this->_fs->is_addon() ? ' ' . $this->_fs->get_text_inline( 'Add-On', 'addon' ) : '' );
|
517 |
}
|
518 |
|
519 |
if ( $this->is_premium_plugin_active( $plugin_id ) ) {
|
520 |
// Premium version already activated.
|
521 |
return array(
|
522 |
+
'message' => $is_addon ?
|
523 |
+
$this->_fs->get_text_inline( 'Premium add-on version already installed.', 'auto-install-error-premium-addon-activated' ) :
|
524 |
+
$this->_fs->get_text_inline( 'Premium version already active.', 'auto-install-error-premium-activated' ),
|
|
|
|
|
525 |
'code' => 'premium_installed',
|
526 |
);
|
527 |
}
|
550 |
|
551 |
$skin_args = array(
|
552 |
'type' => 'web',
|
553 |
+
'title' => sprintf( $this->_fs->get_text_inline( 'Installing plugin: %s', 'installing-plugin-x' ), $title ),
|
554 |
'url' => esc_url_raw( $install_url ),
|
555 |
'nonce' => 'install-plugin_' . $slug,
|
556 |
'plugin' => '',
|
591 |
global $wp_filesystem;
|
592 |
|
593 |
$error_code = 'unable_to_connect_to_filesystem';
|
594 |
+
$error_message = $this->_fs->get_text_inline( 'Unable to connect to the filesystem. Please confirm your credentials.' );
|
595 |
|
596 |
// Pass through the error from WP_Filesystem if one was raised.
|
597 |
if ( $wp_filesystem instanceof WP_Filesystem_Base &&
|
697 |
} else {
|
698 |
return new WP_Error(
|
699 |
'rename_failed',
|
700 |
+
$this->_fs->get_text_inline( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', 'module-package-rename-failure' ),
|
701 |
array(
|
702 |
'found' => $subdir_name,
|
703 |
'expected' => $desired_slug
|
freemius/includes/class-fs-security.php
CHANGED
@@ -1,85 +1,85 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.0.3
|
7 |
-
*/
|
8 |
-
|
9 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
-
exit;
|
11 |
-
}
|
12 |
-
|
13 |
-
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 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.0.3
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
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/customizer/class-fs-customizer-support-section.php
CHANGED
@@ -1,102 +1,102 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.2.2.7
|
7 |
-
*/
|
8 |
-
|
9 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
-
exit;
|
11 |
-
}
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Class Zerif_Customizer_Theme_Info_Main
|
15 |
-
*
|
16 |
-
* @since 1.0.0
|
17 |
-
* @access public
|
18 |
-
*/
|
19 |
-
class FS_Customizer_Support_Section extends WP_Customize_Section {
|
20 |
-
|
21 |
-
function __construct( $manager, $id, $args = array() ) {
|
22 |
-
$manager->register_section_type( 'FS_Customizer_Support_Section' );
|
23 |
-
|
24 |
-
parent::__construct( $manager, $id, $args );
|
25 |
-
}
|
26 |
-
|
27 |
-
/**
|
28 |
-
* The type of customize section being rendered.
|
29 |
-
*
|
30 |
-
* @since 1.0.0
|
31 |
-
* @access public
|
32 |
-
* @var string
|
33 |
-
*/
|
34 |
-
public $type = 'freemius-support-section';
|
35 |
-
|
36 |
-
/**
|
37 |
-
* @var Freemius
|
38 |
-
*/
|
39 |
-
public $fs = null;
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Add custom parameters to pass to the JS via JSON.
|
43 |
-
*
|
44 |
-
* @since 1.0.0
|
45 |
-
*/
|
46 |
-
public function json() {
|
47 |
-
$json = parent::json();
|
48 |
-
|
49 |
-
$is_contact_visible = $this->fs->is_page_visible( 'contact' );
|
50 |
-
$is_support_visible = $this->fs->is_page_visible( 'support' );
|
51 |
-
|
52 |
-
$json['theme_title'] = $this->fs->get_plugin_name();
|
53 |
-
|
54 |
-
if ( $is_contact_visible && $is_support_visible ) {
|
55 |
-
$json['theme_title'] .= ' ' . $this->fs->
|
56 |
-
}
|
57 |
-
|
58 |
-
if ( $is_contact_visible ) {
|
59 |
-
$json['contact'] = array(
|
60 |
-
'label' => $this->fs->
|
61 |
-
'url' => $this->fs->contact_url(),
|
62 |
-
);
|
63 |
-
}
|
64 |
-
|
65 |
-
if ( $is_support_visible ) {
|
66 |
-
$json['support'] = array(
|
67 |
-
'label' => $this->fs->
|
68 |
-
'url' => $this->fs->get_support_forum_url()
|
69 |
-
);
|
70 |
-
}
|
71 |
-
|
72 |
-
return $json;
|
73 |
-
}
|
74 |
-
|
75 |
-
/**
|
76 |
-
* Outputs the Underscore.js template.
|
77 |
-
*
|
78 |
-
* @since 1.0.0
|
79 |
-
*/
|
80 |
-
protected function render_template() {
|
81 |
-
?>
|
82 |
-
<li id="fs_customizer_support"
|
83 |
-
class="accordion-section control-section control-section-{{ data.type }} cannot-expand">
|
84 |
-
<h3 class="accordion-section-title">
|
85 |
-
<span>{{ data.theme_title }}</span>
|
86 |
-
<# if ( data.contact && data.support ) { #>
|
87 |
-
<div class="button-group">
|
88 |
-
<# } #>
|
89 |
-
<# if ( data.contact ) { #>
|
90 |
-
<a class="button" href="{{ data.contact.url }}" target="_blank">{{ data.contact.label }} </a>
|
91 |
-
<# } #>
|
92 |
-
<# if ( data.support ) { #>
|
93 |
-
<a class="button" href="{{ data.support.url }}" target="_blank">{{ data.support.label }} </a>
|
94 |
-
<# } #>
|
95 |
-
<# if ( data.contact && data.support ) { #>
|
96 |
-
</div>
|
97 |
-
<# } #>
|
98 |
-
</h3>
|
99 |
-
</li>
|
100 |
-
<?php
|
101 |
-
}
|
102 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.2.2.7
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Class Zerif_Customizer_Theme_Info_Main
|
15 |
+
*
|
16 |
+
* @since 1.0.0
|
17 |
+
* @access public
|
18 |
+
*/
|
19 |
+
class FS_Customizer_Support_Section extends WP_Customize_Section {
|
20 |
+
|
21 |
+
function __construct( $manager, $id, $args = array() ) {
|
22 |
+
$manager->register_section_type( 'FS_Customizer_Support_Section' );
|
23 |
+
|
24 |
+
parent::__construct( $manager, $id, $args );
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* The type of customize section being rendered.
|
29 |
+
*
|
30 |
+
* @since 1.0.0
|
31 |
+
* @access public
|
32 |
+
* @var string
|
33 |
+
*/
|
34 |
+
public $type = 'freemius-support-section';
|
35 |
+
|
36 |
+
/**
|
37 |
+
* @var Freemius
|
38 |
+
*/
|
39 |
+
public $fs = null;
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Add custom parameters to pass to the JS via JSON.
|
43 |
+
*
|
44 |
+
* @since 1.0.0
|
45 |
+
*/
|
46 |
+
public function json() {
|
47 |
+
$json = parent::json();
|
48 |
+
|
49 |
+
$is_contact_visible = $this->fs->is_page_visible( 'contact' );
|
50 |
+
$is_support_visible = $this->fs->is_page_visible( 'support' );
|
51 |
+
|
52 |
+
$json['theme_title'] = $this->fs->get_plugin_name();
|
53 |
+
|
54 |
+
if ( $is_contact_visible && $is_support_visible ) {
|
55 |
+
$json['theme_title'] .= ' ' . $this->fs->get_text_inline( 'Support', 'support' );
|
56 |
+
}
|
57 |
+
|
58 |
+
if ( $is_contact_visible ) {
|
59 |
+
$json['contact'] = array(
|
60 |
+
'label' => $this->fs->get_text_inline( 'Contact Us', 'contact-us' ),
|
61 |
+
'url' => $this->fs->contact_url(),
|
62 |
+
);
|
63 |
+
}
|
64 |
+
|
65 |
+
if ( $is_support_visible ) {
|
66 |
+
$json['support'] = array(
|
67 |
+
'label' => $this->fs->get_text_inline( 'Support Forum', 'support-forum' ),
|
68 |
+
'url' => $this->fs->get_support_forum_url()
|
69 |
+
);
|
70 |
+
}
|
71 |
+
|
72 |
+
return $json;
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Outputs the Underscore.js template.
|
77 |
+
*
|
78 |
+
* @since 1.0.0
|
79 |
+
*/
|
80 |
+
protected function render_template() {
|
81 |
+
?>
|
82 |
+
<li id="fs_customizer_support"
|
83 |
+
class="accordion-section control-section control-section-{{ data.type }} cannot-expand">
|
84 |
+
<h3 class="accordion-section-title">
|
85 |
+
<span>{{ data.theme_title }}</span>
|
86 |
+
<# if ( data.contact && data.support ) { #>
|
87 |
+
<div class="button-group">
|
88 |
+
<# } #>
|
89 |
+
<# if ( data.contact ) { #>
|
90 |
+
<a class="button" href="{{ data.contact.url }}" target="_blank">{{ data.contact.label }} </a>
|
91 |
+
<# } #>
|
92 |
+
<# if ( data.support ) { #>
|
93 |
+
<a class="button" href="{{ data.support.url }}" target="_blank">{{ data.support.label }} </a>
|
94 |
+
<# } #>
|
95 |
+
<# if ( data.contact && data.support ) { #>
|
96 |
+
</div>
|
97 |
+
<# } #>
|
98 |
+
</h3>
|
99 |
+
</li>
|
100 |
+
<?php
|
101 |
+
}
|
102 |
}
|
freemius/includes/customizer/class-fs-customizer-upsell-control.php
CHANGED
@@ -1,157 +1,157 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.2.2.7
|
7 |
-
*/
|
8 |
-
|
9 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
-
exit;
|
11 |
-
}
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Class FS_Customizer_Upsell_Control
|
15 |
-
*/
|
16 |
-
class FS_Customizer_Upsell_Control extends WP_Customize_Control {
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Control type
|
20 |
-
*
|
21 |
-
* @var string control type
|
22 |
-
*/
|
23 |
-
public $type = 'freemius-upsell-control';
|
24 |
-
|
25 |
-
/**
|
26 |
-
* @var Freemius
|
27 |
-
*/
|
28 |
-
public $fs = null;
|
29 |
-
|
30 |
-
/**
|
31 |
-
* @param WP_Customize_Manager $manager the customize manager class.
|
32 |
-
* @param string $id id.
|
33 |
-
* @param array $args customizer manager parameters.
|
34 |
-
*/
|
35 |
-
public function __construct( WP_Customize_Manager $manager, $id, array $args ) {
|
36 |
-
$manager->register_control_type( 'FS_Customizer_Upsell_Control' );
|
37 |
-
|
38 |
-
parent::__construct( $manager, $id, $args );
|
39 |
-
}
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Enqueue resources for the control.
|
43 |
-
*/
|
44 |
-
public function enqueue() {
|
45 |
-
fs_enqueue_local_style( 'fs_customizer', 'customizer.css' );
|
46 |
-
}
|
47 |
-
|
48 |
-
/**
|
49 |
-
* Json conversion
|
50 |
-
*/
|
51 |
-
public function to_json() {
|
52 |
-
$pricing_cta = esc_html( $this->fs->
|
53 |
-
|
54 |
-
parent::to_json();
|
55 |
-
|
56 |
-
$this->json['button_text'] = $pricing_cta;
|
57 |
-
$this->json['button_url'] = $this->fs->is_in_trial_promotion() ?
|
58 |
-
$this->fs->get_trial_url() :
|
59 |
-
$this->fs->get_upgrade_url();
|
60 |
-
|
61 |
-
// Load features.
|
62 |
-
$pricing = $this->fs->get_api_plugin_scope()->get( 'pricing.json' );
|
63 |
-
|
64 |
-
if ( $this->fs->is_api_result_object( $pricing, 'plans' ) ) {
|
65 |
-
// Add support features.
|
66 |
-
if ( is_array( $pricing->plans ) && 0 < count( $pricing->plans ) ) {
|
67 |
-
$support_features = array(
|
68 |
-
'kb' => 'Help Center',
|
69 |
-
'forum' => 'Support Forum',
|
70 |
-
'email' => 'Priority Email Support',
|
71 |
-
'phone' => 'Phone Support',
|
72 |
-
'skype' => 'Skype Support',
|
73 |
-
'is_success_manager' => 'Personal Success Manager',
|
74 |
-
);
|
75 |
-
|
76 |
-
for ( $i = 0, $len = count( $pricing->plans ); $i < $len; $i ++ ) {
|
77 |
-
if ( 'free' == $pricing->plans[$i]->name ) {
|
78 |
-
continue;
|
79 |
-
}
|
80 |
-
|
81 |
-
if ( ! isset( $pricing->plans[ $i ]->features ) ||
|
82 |
-
! is_array( $pricing->plans[ $i ]->features ) ) {
|
83 |
-
$pricing->plans[$i]->features = array();
|
84 |
-
}
|
85 |
-
|
86 |
-
foreach ( $support_features as $key => $label ) {
|
87 |
-
$key = ( 'is_success_manager' !== $key ) ?
|
88 |
-
"support_{$key}" :
|
89 |
-
$key;
|
90 |
-
|
91 |
-
if ( ! empty( $pricing->plans[ $i ]->{$key} ) ) {
|
92 |
-
|
93 |
-
$support_feature = new stdClass();
|
94 |
-
$support_feature->title = $label;
|
95 |
-
|
96 |
-
$pricing->plans[ $i ]->features[] = $support_feature;
|
97 |
-
}
|
98 |
-
}
|
99 |
-
}
|
100 |
-
}
|
101 |
-
}
|
102 |
-
|
103 |
-
$this->json['plans'] = $pricing->plans;
|
104 |
-
|
105 |
-
$this->json['strings'] = array(
|
106 |
-
'plan' => $this->fs->
|
107 |
-
);
|
108 |
-
}
|
109 |
-
|
110 |
-
/**
|
111 |
-
* Control content
|
112 |
-
*/
|
113 |
-
public function content_template() {
|
114 |
-
?>
|
115 |
-
<div id="fs_customizer_upsell">
|
116 |
-
<# if ( data.plans ) { #>
|
117 |
-
<ul class="fs-customizer-plans">
|
118 |
-
<# for (i in data.plans) { #>
|
119 |
-
<# if ( 'free' != data.plans[i].name && (null != data.plans[i].features && 0 < data.plans[i].features.length) ) { #>
|
120 |
-
<li class="fs-customizer-plan">
|
121 |
-
<div class="fs-accordion-section-open">
|
122 |
-
<h2 class="fs-accordion-section-title menu-item">
|
123 |
-
<span>{{ data.plans[i].title }}</span>
|
124 |
-
<button type="button" class="button-link item-edit" aria-expanded="true">
|
125 |
-
<span class="screen-reader-text">Toggle section: {{ data.plans[i].title }} {{ data.strings.plan }}</span>
|
126 |
-
<span class="toggle-indicator" aria-hidden="true"></span>
|
127 |
-
</button>
|
128 |
-
</h2>
|
129 |
-
<div class="fs-accordion-section-content">
|
130 |
-
<# if ( data.plans[i].description ) { #>
|
131 |
-
<h3>{{ data.plans[i].description }}</h3>
|
132 |
-
<# } #>
|
133 |
-
<# if ( data.plans[i].features ) { #>
|
134 |
-
<ul>
|
135 |
-
<# for ( j in data.plans[i].features ) { #>
|
136 |
-
<li><div class="fs-feature">
|
137 |
-
<span class="dashicons dashicons-yes"></span><span><# if ( data.plans[i].features[j].value ) { #>{{ data.plans[i].features[j].value }} <# } #>{{ data.plans[i].features[j].title }}</span>
|
138 |
-
<# if ( data.plans[i].features[j].description ) { #>
|
139 |
-
<span class="dashicons dashicons-editor-help"><span class="fs-feature-desc">{{ data.plans[i].features[j].description }}</span></span>
|
140 |
-
<# } #>
|
141 |
-
</div></li>
|
142 |
-
<# } #>
|
143 |
-
</ul>
|
144 |
-
<# } #>
|
145 |
-
<# if ( 'free' != data.plans[i].name ) { #>
|
146 |
-
<a href="{{ data.button_url }}" class="button button-primary" target="_blank">{{{ data.button_text }}}</a>
|
147 |
-
<# } #>
|
148 |
-
</div>
|
149 |
-
</div>
|
150 |
-
</li>
|
151 |
-
<# } #>
|
152 |
-
<# } #>
|
153 |
-
</ul>
|
154 |
-
<# } #>
|
155 |
-
</div>
|
156 |
-
<?php }
|
157 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.2.2.7
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Class FS_Customizer_Upsell_Control
|
15 |
+
*/
|
16 |
+
class FS_Customizer_Upsell_Control extends WP_Customize_Control {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Control type
|
20 |
+
*
|
21 |
+
* @var string control type
|
22 |
+
*/
|
23 |
+
public $type = 'freemius-upsell-control';
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @var Freemius
|
27 |
+
*/
|
28 |
+
public $fs = null;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* @param WP_Customize_Manager $manager the customize manager class.
|
32 |
+
* @param string $id id.
|
33 |
+
* @param array $args customizer manager parameters.
|
34 |
+
*/
|
35 |
+
public function __construct( WP_Customize_Manager $manager, $id, array $args ) {
|
36 |
+
$manager->register_control_type( 'FS_Customizer_Upsell_Control' );
|
37 |
+
|
38 |
+
parent::__construct( $manager, $id, $args );
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Enqueue resources for the control.
|
43 |
+
*/
|
44 |
+
public function enqueue() {
|
45 |
+
fs_enqueue_local_style( 'fs_customizer', 'customizer.css' );
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Json conversion
|
50 |
+
*/
|
51 |
+
public function to_json() {
|
52 |
+
$pricing_cta = esc_html( $this->fs->get_pricing_cta_label() ) . ' ' . ( is_rtl() ? '←' : '➤' );
|
53 |
+
|
54 |
+
parent::to_json();
|
55 |
+
|
56 |
+
$this->json['button_text'] = $pricing_cta;
|
57 |
+
$this->json['button_url'] = $this->fs->is_in_trial_promotion() ?
|
58 |
+
$this->fs->get_trial_url() :
|
59 |
+
$this->fs->get_upgrade_url();
|
60 |
+
|
61 |
+
// Load features.
|
62 |
+
$pricing = $this->fs->get_api_plugin_scope()->get( 'pricing.json' );
|
63 |
+
|
64 |
+
if ( $this->fs->is_api_result_object( $pricing, 'plans' ) ) {
|
65 |
+
// Add support features.
|
66 |
+
if ( is_array( $pricing->plans ) && 0 < count( $pricing->plans ) ) {
|
67 |
+
$support_features = array(
|
68 |
+
'kb' => 'Help Center',
|
69 |
+
'forum' => 'Support Forum',
|
70 |
+
'email' => 'Priority Email Support',
|
71 |
+
'phone' => 'Phone Support',
|
72 |
+
'skype' => 'Skype Support',
|
73 |
+
'is_success_manager' => 'Personal Success Manager',
|
74 |
+
);
|
75 |
+
|
76 |
+
for ( $i = 0, $len = count( $pricing->plans ); $i < $len; $i ++ ) {
|
77 |
+
if ( 'free' == $pricing->plans[$i]->name ) {
|
78 |
+
continue;
|
79 |
+
}
|
80 |
+
|
81 |
+
if ( ! isset( $pricing->plans[ $i ]->features ) ||
|
82 |
+
! is_array( $pricing->plans[ $i ]->features ) ) {
|
83 |
+
$pricing->plans[$i]->features = array();
|
84 |
+
}
|
85 |
+
|
86 |
+
foreach ( $support_features as $key => $label ) {
|
87 |
+
$key = ( 'is_success_manager' !== $key ) ?
|
88 |
+
"support_{$key}" :
|
89 |
+
$key;
|
90 |
+
|
91 |
+
if ( ! empty( $pricing->plans[ $i ]->{$key} ) ) {
|
92 |
+
|
93 |
+
$support_feature = new stdClass();
|
94 |
+
$support_feature->title = $label;
|
95 |
+
|
96 |
+
$pricing->plans[ $i ]->features[] = $support_feature;
|
97 |
+
}
|
98 |
+
}
|
99 |
+
}
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
+
$this->json['plans'] = $pricing->plans;
|
104 |
+
|
105 |
+
$this->json['strings'] = array(
|
106 |
+
'plan' => $this->fs->get_text_x_inline( 'Plan', 'as product pricing plan', 'plan' ),
|
107 |
+
);
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Control content
|
112 |
+
*/
|
113 |
+
public function content_template() {
|
114 |
+
?>
|
115 |
+
<div id="fs_customizer_upsell">
|
116 |
+
<# if ( data.plans ) { #>
|
117 |
+
<ul class="fs-customizer-plans">
|
118 |
+
<# for (i in data.plans) { #>
|
119 |
+
<# if ( 'free' != data.plans[i].name && (null != data.plans[i].features && 0 < data.plans[i].features.length) ) { #>
|
120 |
+
<li class="fs-customizer-plan">
|
121 |
+
<div class="fs-accordion-section-open">
|
122 |
+
<h2 class="fs-accordion-section-title menu-item">
|
123 |
+
<span>{{ data.plans[i].title }}</span>
|
124 |
+
<button type="button" class="button-link item-edit" aria-expanded="true">
|
125 |
+
<span class="screen-reader-text">Toggle section: {{ data.plans[i].title }} {{ data.strings.plan }}</span>
|
126 |
+
<span class="toggle-indicator" aria-hidden="true"></span>
|
127 |
+
</button>
|
128 |
+
</h2>
|
129 |
+
<div class="fs-accordion-section-content">
|
130 |
+
<# if ( data.plans[i].description ) { #>
|
131 |
+
<h3>{{ data.plans[i].description }}</h3>
|
132 |
+
<# } #>
|
133 |
+
<# if ( data.plans[i].features ) { #>
|
134 |
+
<ul>
|
135 |
+
<# for ( j in data.plans[i].features ) { #>
|
136 |
+
<li><div class="fs-feature">
|
137 |
+
<span class="dashicons dashicons-yes"></span><span><# if ( data.plans[i].features[j].value ) { #>{{ data.plans[i].features[j].value }} <# } #>{{ data.plans[i].features[j].title }}</span>
|
138 |
+
<# if ( data.plans[i].features[j].description ) { #>
|
139 |
+
<span class="dashicons dashicons-editor-help"><span class="fs-feature-desc">{{ data.plans[i].features[j].description }}</span></span>
|
140 |
+
<# } #>
|
141 |
+
</div></li>
|
142 |
+
<# } #>
|
143 |
+
</ul>
|
144 |
+
<# } #>
|
145 |
+
<# if ( 'free' != data.plans[i].name ) { #>
|
146 |
+
<a href="{{ data.button_url }}" class="button button-primary" target="_blank">{{{ data.button_text }}}</a>
|
147 |
+
<# } #>
|
148 |
+
</div>
|
149 |
+
</div>
|
150 |
+
</li>
|
151 |
+
<# } #>
|
152 |
+
<# } #>
|
153 |
+
</ul>
|
154 |
+
<# } #>
|
155 |
+
</div>
|
156 |
+
<?php }
|
157 |
}
|
freemius/includes/customizer/index.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
3 |
+
// Hide file structure from users on unprotected servers.
|
freemius/includes/debug/class-fs-debug-bar-panel.php
CHANGED
@@ -1,64 +1,64 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.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_WordPress' ) ) {
|
28 |
-
$logger = Freemius_Api_WordPress::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_WordPress' ) ) {
|
38 |
-
$logger = Freemius_Api_WordPress::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 ) . ' ' .
|
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 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.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_WordPress' ) ) {
|
28 |
+
$logger = Freemius_Api_WordPress::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_WordPress' ) ) {
|
38 |
+
$logger = Freemius_Api_WordPress::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_text_x_inline( 'ms', 'milliseconds' );
|
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
CHANGED
@@ -1,52 +1,52 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.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 |
-
|
42 |
-
Freemius_Debug_Bar_Panel::requests_count() . ' ' .
|
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' );
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.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_text_inline( 'Freemius API' ),
|
42 |
+
Freemius_Debug_Bar_Panel::requests_count() . ' ' . fs_text_inline( '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
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
<?php
|
2 |
-
// Silence is golden.
|
3 |
// Hide file structure from users on unprotected servers.
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
3 |
// Hide file structure from users on unprotected servers.
|
freemius/includes/entities/class-fs-affiliate-terms.php
ADDED
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.2.3
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
class FS_AffiliateTerms extends FS_Scope_Entity {
|
14 |
+
|
15 |
+
#region Properties
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @var bool
|
19 |
+
*/
|
20 |
+
public $is_active;
|
21 |
+
/**
|
22 |
+
* @var string Enum: `affiliation` or `rewards`. Defaults to `affiliation`.
|
23 |
+
*/
|
24 |
+
public $type;
|
25 |
+
/**
|
26 |
+
* @var string Enum: `payout` or `credit`. Defaults to `payout`.
|
27 |
+
*/
|
28 |
+
public $reward_type;
|
29 |
+
/**
|
30 |
+
* If `first`, the referral will be attributed to the first visited source containing the affiliation link that
|
31 |
+
* was clicked.
|
32 |
+
*
|
33 |
+
* @var string Enum: `first` or `last`. Defaults to `first`.
|
34 |
+
*/
|
35 |
+
public $referral_attribution;
|
36 |
+
/**
|
37 |
+
* @var int Defaults to `30`, `0` for session cookie, and `null` for endless cookie (until cookies are cleaned).
|
38 |
+
*/
|
39 |
+
public $cookie_days;
|
40 |
+
/**
|
41 |
+
* @var int
|
42 |
+
*/
|
43 |
+
public $commission;
|
44 |
+
/**
|
45 |
+
* @var string Enum: `percentage` or `dollar`. Defaults to `percentage`.
|
46 |
+
*/
|
47 |
+
public $commission_type;
|
48 |
+
/**
|
49 |
+
* @var null|int Defaults to `0` (affiliate only on first payment). `null` for commission for all renewals. If
|
50 |
+
* greater than `0`, affiliate will get paid for all renewals for `commission_renewals_days` days after
|
51 |
+
* the initial upgrade/purchase.
|
52 |
+
*/
|
53 |
+
public $commission_renewals_days;
|
54 |
+
/**
|
55 |
+
* @var int Only cents and no percentage. In US cents, e.g.: 100 = $1.00. Defaults to `null`.
|
56 |
+
*/
|
57 |
+
public $install_commission;
|
58 |
+
/**
|
59 |
+
* @var string Required default target link, e.g.: pricing page.
|
60 |
+
*/
|
61 |
+
public $default_url;
|
62 |
+
/**
|
63 |
+
* @var string One of the following: 'all', 'new_customer', 'new_user'.
|
64 |
+
* If 'all' - reward for any user type.
|
65 |
+
* If 'new_customer' - reward only for new customers.
|
66 |
+
* If 'new_user' - reward only for new users.
|
67 |
+
*/
|
68 |
+
public $reward_customer_type;
|
69 |
+
/**
|
70 |
+
* @var int Defaults to `0` (affiliate only on directly affiliated links). `null` if an affiliate will get
|
71 |
+
* paid for all customers' lifetime payments. If greater than `0`, an affiliate will get paid for all
|
72 |
+
* customer payments for `future_payments_days` days after the initial payment.
|
73 |
+
*/
|
74 |
+
public $future_payments_days;
|
75 |
+
/**
|
76 |
+
* @var bool If `true`, allow referrals from social sites.
|
77 |
+
*/
|
78 |
+
public $is_social_allowed;
|
79 |
+
/**
|
80 |
+
* @var bool If `true`, allow conversions without HTTP referrer header at all.
|
81 |
+
*/
|
82 |
+
public $is_app_allowed;
|
83 |
+
/**
|
84 |
+
* @var bool If `true`, allow referrals from any site.
|
85 |
+
*/
|
86 |
+
public $is_any_site_allowed;
|
87 |
+
|
88 |
+
#endregion Properties
|
89 |
+
|
90 |
+
/**
|
91 |
+
* @author Leo Fajardo (@leorw)
|
92 |
+
*
|
93 |
+
* @return string
|
94 |
+
*/
|
95 |
+
function get_formatted_commission()
|
96 |
+
{
|
97 |
+
return ( 'dollar' === $this->commission_type ) ?
|
98 |
+
( '$' . $this->commission ) :
|
99 |
+
( $this->commission . '%' );
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* @author Leo Fajardo (@leorw)
|
104 |
+
*
|
105 |
+
* @return bool
|
106 |
+
*/
|
107 |
+
function has_lifetime_commission() {
|
108 |
+
return ( 0 !== $this->future_payments_days );
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* @author Leo Fajardo (@leorw)
|
113 |
+
*
|
114 |
+
* @return bool
|
115 |
+
*/
|
116 |
+
function is_session_cookie() {
|
117 |
+
return ( 0 == $this->cookie_days );
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* @author Leo Fajardo (@leorw)
|
122 |
+
*
|
123 |
+
* @return bool
|
124 |
+
*/
|
125 |
+
function has_renewals_commission() {
|
126 |
+
return ( is_null( $this->commission_renewals_days ) || $this->commission_renewals_days > 0 );
|
127 |
+
}
|
128 |
+
}
|
freemius/includes/entities/class-fs-affiliate.php
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.2.3
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
class FS_Affiliate extends FS_Scope_Entity {
|
14 |
+
|
15 |
+
#region Properties
|
16 |
+
|
17 |
+
/**
|
18 |
+
* @var string
|
19 |
+
*/
|
20 |
+
public $paypal_email;
|
21 |
+
/**
|
22 |
+
* @var number
|
23 |
+
*/
|
24 |
+
public $custom_affiliate_terms_id;
|
25 |
+
/**
|
26 |
+
* @var boolean
|
27 |
+
*/
|
28 |
+
public $is_using_custom_terms;
|
29 |
+
/**
|
30 |
+
* @var string status Enum: `pending`, `rejected`, `suspended`, or `active`. Defaults to `pending`.
|
31 |
+
*/
|
32 |
+
public $status;
|
33 |
+
/**
|
34 |
+
* @var string
|
35 |
+
*/
|
36 |
+
public $domain;
|
37 |
+
|
38 |
+
#endregion Properties
|
39 |
+
|
40 |
+
/**
|
41 |
+
* @author Leo Fajardo
|
42 |
+
*
|
43 |
+
* @return bool
|
44 |
+
*/
|
45 |
+
function is_active() {
|
46 |
+
return ( 'active' === $this->status );
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* @author Leo Fajardo
|
51 |
+
*
|
52 |
+
* @return bool
|
53 |
+
*/
|
54 |
+
function is_pending() {
|
55 |
+
return ( 'pending' === $this->status );
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* @author Leo Fajardo
|
60 |
+
*
|
61 |
+
* @return bool
|
62 |
+
*/
|
63 |
+
function is_suspended() {
|
64 |
+
return ( 'suspended' === $this->status );
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* @author Leo Fajardo
|
69 |
+
*
|
70 |
+
* @return bool
|
71 |
+
*/
|
72 |
+
function is_rejected() {
|
73 |
+
return ( 'rejected' === $this->status );
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* @author Leo Fajardo
|
78 |
+
*
|
79 |
+
* @return bool
|
80 |
+
*/
|
81 |
+
function is_blocked() {
|
82 |
+
return ( 'blocked' === $this->status );
|
83 |
+
}
|
84 |
+
}
|
freemius/includes/entities/class-fs-billing.php
CHANGED
@@ -1,95 +1,95 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius for EDD Add-On
|
4 |
-
* @copyright Copyright (c) 2016, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
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 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius for EDD Add-On
|
4 |
+
* @copyright Copyright (c) 2016, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
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
CHANGED
@@ -1,149 +1,149 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.0.3
|
7 |
-
*/
|
8 |
-
|
9 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
-
exit;
|
11 |
-
}
|
12 |
-
|
13 |
-
/**
|
14 |
-
* 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 |
-
|
46 |
-
|
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 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.0.3
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
/**
|
14 |
+
* 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 ) && ! ( $entity instanceof FS_Entity ) ) {
|
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
CHANGED
@@ -1,94 +1,94 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2016, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
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 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2016, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
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
CHANGED
@@ -1,34 +1,34 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.0.3
|
7 |
-
*/
|
8 |
-
|
9 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
-
exit;
|
11 |
-
}
|
12 |
-
|
13 |
-
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 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.0.3
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
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
CHANGED
@@ -1,224 +1,224 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.0.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 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.0.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
CHANGED
@@ -1,145 +1,145 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.0.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 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.0.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
CHANGED
@@ -1,24 +1,24 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.0.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 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.0.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
CHANGED
@@ -1,96 +1,117 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.0.3
|
7 |
-
*/
|
8 |
-
|
9 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
-
exit;
|
11 |
-
}
|
12 |
-
|
13 |
-
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 |
-
* @since 1.2.2
|
29 |
-
*
|
30 |
-
* @var string 'plugin' or 'theme'
|
31 |
-
*/
|
32 |
-
public $type;
|
33 |
-
|
34 |
-
#region Install Specific Properties
|
35 |
-
|
36 |
-
/**
|
37 |
-
* @var string
|
38 |
-
*/
|
39 |
-
public $file;
|
40 |
-
/**
|
41 |
-
* @var string
|
42 |
-
*/
|
43 |
-
public $version;
|
44 |
-
/**
|
45 |
-
* @var bool
|
46 |
-
*/
|
47 |
-
public $auto_update;
|
48 |
-
/**
|
49 |
-
* @var FS_Plugin_Info
|
50 |
-
*/
|
51 |
-
public $info;
|
52 |
-
/**
|
53 |
-
* @since 1.0.9
|
54 |
-
*
|
55 |
-
* @var bool
|
56 |
-
*/
|
57 |
-
public $is_premium;
|
58 |
-
/**
|
59 |
-
* @since 1.0.9
|
60 |
-
*
|
61 |
-
* @var bool
|
62 |
-
*/
|
63 |
-
public $is_live;
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
*
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.0.3
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
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 |
+
* @since 1.2.2
|
29 |
+
*
|
30 |
+
* @var string 'plugin' or 'theme'
|
31 |
+
*/
|
32 |
+
public $type;
|
33 |
+
|
34 |
+
#region Install Specific Properties
|
35 |
+
|
36 |
+
/**
|
37 |
+
* @var string
|
38 |
+
*/
|
39 |
+
public $file;
|
40 |
+
/**
|
41 |
+
* @var string
|
42 |
+
*/
|
43 |
+
public $version;
|
44 |
+
/**
|
45 |
+
* @var bool
|
46 |
+
*/
|
47 |
+
public $auto_update;
|
48 |
+
/**
|
49 |
+
* @var FS_Plugin_Info
|
50 |
+
*/
|
51 |
+
public $info;
|
52 |
+
/**
|
53 |
+
* @since 1.0.9
|
54 |
+
*
|
55 |
+
* @var bool
|
56 |
+
*/
|
57 |
+
public $is_premium;
|
58 |
+
/**
|
59 |
+
* @since 1.0.9
|
60 |
+
*
|
61 |
+
* @var bool
|
62 |
+
*/
|
63 |
+
public $is_live;
|
64 |
+
/**
|
65 |
+
* @author Leo Fajardo (@leorw)
|
66 |
+
*
|
67 |
+
* @since 1.2.3
|
68 |
+
*
|
69 |
+
* @var string|false false if the module doesn't have an affiliate program or one of the following:
|
70 |
+
* 'selected', 'customers', or 'all'.
|
71 |
+
*/
|
72 |
+
public $affiliate_moderation;
|
73 |
+
|
74 |
+
const AFFILIATE_MODERATION_CUSTOMERS = 'customers';
|
75 |
+
|
76 |
+
#endregion Install Specific Properties
|
77 |
+
|
78 |
+
/**
|
79 |
+
* @param stdClass|bool $plugin
|
80 |
+
*/
|
81 |
+
function __construct( $plugin = false ) {
|
82 |
+
parent::__construct( $plugin );
|
83 |
+
|
84 |
+
$this->is_premium = false;
|
85 |
+
$this->is_live = true;
|
86 |
+
|
87 |
+
if ( isset( $plugin->info ) && is_object( $plugin->info ) ) {
|
88 |
+
$this->info = new FS_Plugin_Info( $plugin->info );
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Check if plugin is an add-on (has parent).
|
94 |
+
*
|
95 |
+
* @author Vova Feldman (@svovaf)
|
96 |
+
* @since 1.0.6
|
97 |
+
*
|
98 |
+
* @return bool
|
99 |
+
*/
|
100 |
+
function is_addon() {
|
101 |
+
return isset( $this->parent_plugin_id ) && is_numeric( $this->parent_plugin_id );
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* @author Leo Fajardo (@leorw)
|
106 |
+
* @since 1.2.3
|
107 |
+
*
|
108 |
+
* @return bool
|
109 |
+
*/
|
110 |
+
function has_affiliate_program() {
|
111 |
+
return ( ! empty( $this->affiliate_moderation ) );
|
112 |
+
}
|
113 |
+
|
114 |
+
static function get_type() {
|
115 |
+
return 'plugin';
|
116 |
+
}
|
117 |
}
|
freemius/includes/entities/class-fs-pricing.php
CHANGED
@@ -1,141 +1,141 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius for EDD Add-On
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.0.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 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius for EDD Add-On
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.0.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
CHANGED
@@ -1,29 +1,29 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.0.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 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.0.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
CHANGED
@@ -1,148 +1,148 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.0.3
|
7 |
-
*/
|
8 |
-
|
9 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
-
exit;
|
11 |
-
}
|
12 |
-
|
13 |
-
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 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.0.3
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
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
CHANGED
@@ -1,125 +1,125 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.0.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 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.0.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
CHANGED
@@ -1,62 +1,62 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.0.3
|
7 |
-
*/
|
8 |
-
|
9 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
-
exit;
|
11 |
-
}
|
12 |
-
|
13 |
-
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 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.0.3
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
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
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
<?php
|
2 |
-
// Silence is golden.
|
3 |
// Hide file structure from users on unprotected servers.
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
3 |
// Hide file structure from users on unprotected servers.
|
freemius/includes/fs-core-functions.php
CHANGED
@@ -1,333 +1,381 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
|
332 |
// switch ($errno) {
|
333 |
// case E_USER_ERROR:
|
@@ -341,334 +389,730 @@
|
|
341 |
// default:
|
342 |
// break;
|
343 |
// }
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
|
405 |
// if ( ! isset( $parsed_url['host'] ) ) {
|
406 |
// return $url;
|
407 |
// }
|
408 |
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
673 |
|
674 |
#endregion
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.0.3
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
if ( ! function_exists( 'fs_dummy' ) ) {
|
14 |
+
function fs_dummy() {
|
15 |
+
}
|
16 |
+
}
|
17 |
+
|
18 |
+
/* Url.
|
19 |
+
--------------------------------------------------------------------------------------------*/
|
20 |
+
if ( ! function_exists( 'fs_get_url_daily_cache_killer' ) ) {
|
21 |
+
function fs_get_url_daily_cache_killer() {
|
22 |
+
return date( '\YY\Mm\Dd' );
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
/* Templates / Views.
|
27 |
+
--------------------------------------------------------------------------------------------*/
|
28 |
+
if ( ! function_exists( 'fs_get_template_path' ) ) {
|
29 |
+
function fs_get_template_path( $path ) {
|
30 |
+
return WP_FS__DIR_TEMPLATES . '/' . trim( $path, '/' );
|
31 |
+
}
|
32 |
+
|
33 |
+
function fs_include_template( $path, &$params = null ) {
|
34 |
+
$VARS = &$params;
|
35 |
+
include fs_get_template_path( $path );
|
36 |
+
}
|
37 |
+
|
38 |
+
function fs_include_once_template( $path, &$params = null ) {
|
39 |
+
$VARS = &$params;
|
40 |
+
include_once fs_get_template_path( $path );
|
41 |
+
}
|
42 |
+
|
43 |
+
function fs_require_template( $path, &$params = null ) {
|
44 |
+
$VARS = &$params;
|
45 |
+
require fs_get_template_path( $path );
|
46 |
+
}
|
47 |
+
|
48 |
+
function fs_require_once_template( $path, &$params = null ) {
|
49 |
+
$VARS = &$params;
|
50 |
+
require_once fs_get_template_path( $path );
|
51 |
+
}
|
52 |
+
|
53 |
+
function fs_get_template( $path, &$params = null ) {
|
54 |
+
ob_start();
|
55 |
+
|
56 |
+
$VARS = &$params;
|
57 |
+
require fs_get_template_path( $path );
|
58 |
+
|
59 |
+
return ob_get_clean();
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
/* Scripts and styles including.
|
64 |
+
--------------------------------------------------------------------------------------------*/
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Generates an absolute URL to the given path. This function ensures that the URL will be correct whether the asset
|
68 |
+
* is inside a plugin's folder or a theme's folder.
|
69 |
+
*
|
70 |
+
* Examples:
|
71 |
+
* 1. "themes" folder
|
72 |
+
* Path: C:/xampp/htdocs/fswp/wp-content/themes/twentytwelve/freemius/assets/css/admin/common.css
|
73 |
+
* URL: http://fswp:8080/wp-content/themes/twentytwelve/freemius/assets/css/admin/common.css
|
74 |
+
*
|
75 |
+
* 2. "plugins" folder
|
76 |
+
* Path: C:/xampp/htdocs/fswp/wp-content/plugins/rating-widget-premium/freemius/assets/css/admin/common.css
|
77 |
+
* URL: http://fswp:8080/wp-content/plugins/rating-widget-premium/freemius/assets/css/admin/common.css
|
78 |
+
*
|
79 |
+
* @author Leo Fajardo (@leorw)
|
80 |
+
* @since 1.2.2
|
81 |
+
*
|
82 |
+
* @param string $asset_abs_path Asset's absolute path.
|
83 |
+
*
|
84 |
+
* @return string Asset's URL.
|
85 |
+
*/
|
86 |
+
function fs_asset_url( $asset_abs_path ) {
|
87 |
+
$wp_content_dir = fs_normalize_path( WP_CONTENT_DIR );
|
88 |
+
$asset_abs_path = fs_normalize_path( $asset_abs_path );
|
89 |
+
$asset_rel_path = str_replace( $wp_content_dir, '', $asset_abs_path );
|
90 |
+
|
91 |
+
$asset_url = content_url( fs_normalize_path( $asset_rel_path ) );
|
92 |
+
|
93 |
+
return $asset_url;
|
94 |
+
}
|
95 |
+
|
96 |
+
function fs_enqueue_local_style( $handle, $path, $deps = array(), $ver = false, $media = 'all' ) {
|
97 |
+
wp_enqueue_style( $handle, fs_asset_url( WP_FS__DIR_CSS . '/' . trim( $path, '/' ) ), $deps, $ver, $media );
|
98 |
+
}
|
99 |
+
|
100 |
+
function fs_enqueue_local_script( $handle, $path, $deps = array(), $ver = false, $in_footer = 'all' ) {
|
101 |
+
wp_enqueue_script( $handle, fs_asset_url( WP_FS__DIR_JS . '/' . trim( $path, '/' ) ), $deps, $ver, $in_footer );
|
102 |
+
}
|
103 |
+
|
104 |
+
function fs_img_url( $path, $img_dir = WP_FS__DIR_IMG ) {
|
105 |
+
return ( fs_asset_url( $img_dir . '/' . trim( $path, '/' ) ) );
|
106 |
+
}
|
107 |
+
|
108 |
+
#--------------------------------------------------------------------------------
|
109 |
+
#region Request handlers.
|
110 |
+
#--------------------------------------------------------------------------------
|
111 |
+
|
112 |
+
if ( ! function_exists( 'fs_request_get' ) ) {
|
113 |
+
/**
|
114 |
+
* @param string $key
|
115 |
+
* @param mixed $def
|
116 |
+
* @param string|bool $type Since 1.2.1.7 - when set to 'get' will look for the value passed via querystring, when
|
117 |
+
* set to 'post' will look for the value passed via the POST request's body, otherwise,
|
118 |
+
* will check if the parameter was passed in any of the two.
|
119 |
+
*
|
120 |
+
* @return mixed
|
121 |
+
*/
|
122 |
+
function fs_request_get( $key, $def = false, $type = false ) {
|
123 |
+
if ( is_string( $type ) ) {
|
124 |
+
$type = strtolower( $type );
|
125 |
+
}
|
126 |
+
|
127 |
+
switch ( $type ) {
|
128 |
+
case 'post':
|
129 |
+
$value = isset( $_POST[ $key ] ) ? $_POST[ $key ] : $def;
|
130 |
+
break;
|
131 |
+
case 'get':
|
132 |
+
$value = isset( $_GET[ $key ] ) ? $_GET[ $key ] : $def;
|
133 |
+
break;
|
134 |
+
default:
|
135 |
+
$value = isset( $_REQUEST[ $key ] ) ? $_REQUEST[ $key ] : $def;
|
136 |
+
break;
|
137 |
+
}
|
138 |
+
|
139 |
+
return $value;
|
140 |
+
}
|
141 |
+
}
|
142 |
+
|
143 |
+
if ( ! function_exists( 'fs_request_has' ) ) {
|
144 |
+
function fs_request_has( $key ) {
|
145 |
+
return isset( $_REQUEST[ $key ] );
|
146 |
+
}
|
147 |
+
}
|
148 |
+
|
149 |
+
if ( ! function_exists( 'fs_request_get_bool' ) ) {
|
150 |
+
function fs_request_get_bool( $key, $def = false ) {
|
151 |
+
if ( ! isset( $_REQUEST[ $key ] ) ) {
|
152 |
+
return $def;
|
153 |
+
}
|
154 |
+
|
155 |
+
if ( 1 == $_REQUEST[ $key ] || 'true' === strtolower( $_REQUEST[ $key ] ) ) {
|
156 |
+
return true;
|
157 |
+
}
|
158 |
+
|
159 |
+
if ( 0 == $_REQUEST[ $key ] || 'false' === strtolower( $_REQUEST[ $key ] ) ) {
|
160 |
+
return false;
|
161 |
+
}
|
162 |
+
|
163 |
+
return $def;
|
164 |
+
}
|
165 |
+
}
|
166 |
+
|
167 |
+
if ( ! function_exists( 'fs_request_is_post' ) ) {
|
168 |
+
function fs_request_is_post() {
|
169 |
+
return ( 'post' === strtolower( $_SERVER['REQUEST_METHOD'] ) );
|
170 |
+
}
|
171 |
+
}
|
172 |
+
|
173 |
+
if ( ! function_exists( 'fs_request_is_get' ) ) {
|
174 |
+
function fs_request_is_get() {
|
175 |
+
return ( 'get' === strtolower( $_SERVER['REQUEST_METHOD'] ) );
|
176 |
+
}
|
177 |
+
}
|
178 |
+
|
179 |
+
if ( ! function_exists( 'fs_get_action' ) ) {
|
180 |
+
function fs_get_action( $action_key = 'action' ) {
|
181 |
+
if ( ! empty( $_REQUEST[ $action_key ] ) && is_string( $_REQUEST[ $action_key ] ) ) {
|
182 |
+
return strtolower( $_REQUEST[ $action_key ] );
|
183 |
+
}
|
184 |
+
|
185 |
+
if ( 'action' == $action_key ) {
|
186 |
+
$action_key = 'fs_action';
|
187 |
+
|
188 |
+
if ( ! empty( $_REQUEST[ $action_key ] ) && is_string( $_REQUEST[ $action_key ] ) ) {
|
189 |
+
return strtolower( $_REQUEST[ $action_key ] );
|
190 |
+
}
|
191 |
+
}
|
192 |
+
|
193 |
+
return false;
|
194 |
+
}
|
195 |
+
}
|
196 |
+
|
197 |
+
if ( ! function_exists( 'fs_request_is_action' ) ) {
|
198 |
+
function fs_request_is_action( $action, $action_key = 'action' ) {
|
199 |
+
return ( strtolower( $action ) === fs_get_action( $action_key ) );
|
200 |
+
}
|
201 |
+
}
|
202 |
+
|
203 |
+
if ( ! function_exists( 'fs_request_is_action_secure' ) ) {
|
204 |
+
/**
|
205 |
+
* @author Vova Feldman (@svovaf)
|
206 |
+
* @since 1.0.0
|
207 |
+
*
|
208 |
+
* @since 1.2.1.5 Allow nonce verification.
|
209 |
+
*
|
210 |
+
* @param string $action
|
211 |
+
* @param string $action_key
|
212 |
+
* @param string $nonce_key
|
213 |
+
*
|
214 |
+
* @return bool
|
215 |
+
*/
|
216 |
+
function fs_request_is_action_secure(
|
217 |
+
$action,
|
218 |
+
$action_key = 'action',
|
219 |
+
$nonce_key = 'nonce'
|
220 |
+
) {
|
221 |
+
if ( strtolower( $action ) !== fs_get_action( $action_key ) ) {
|
222 |
+
return false;
|
223 |
+
}
|
224 |
+
|
225 |
+
$nonce = ! empty( $_REQUEST[ $nonce_key ] ) ?
|
226 |
+
$_REQUEST[ $nonce_key ] :
|
227 |
+
'';
|
228 |
+
|
229 |
+
if ( empty( $nonce ) ||
|
230 |
+
( false === wp_verify_nonce( $nonce, $action ) )
|
231 |
+
) {
|
232 |
+
return false;
|
233 |
+
}
|
234 |
+
|
235 |
+
return true;
|
236 |
+
}
|
237 |
+
}
|
238 |
+
|
239 |
+
#endregion
|
240 |
+
|
241 |
+
if ( ! function_exists( 'fs_is_plugin_page' ) ) {
|
242 |
+
function fs_is_plugin_page( $page_slug ) {
|
243 |
+
return ( is_admin() && $page_slug === fs_request_get( 'page' ) );
|
244 |
+
}
|
245 |
+
}
|
246 |
+
|
247 |
+
if ( ! function_exists( 'fs_get_raw_referer' ) ) {
|
248 |
+
/**
|
249 |
+
* Retrieves unvalidated referer from '_wp_http_referer' or HTTP referer.
|
250 |
+
*
|
251 |
+
* Do not use for redirects, use {@see wp_get_referer()} instead.
|
252 |
+
*
|
253 |
+
* @since 1.2.3
|
254 |
+
*
|
255 |
+
* @return string|false Referer URL on success, false on failure.
|
256 |
+
*/
|
257 |
+
function fs_get_raw_referer() {
|
258 |
+
if ( function_exists( 'wp_get_raw_referer' ) ) {
|
259 |
+
return wp_get_raw_referer();
|
260 |
+
}
|
261 |
+
if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {
|
262 |
+
return wp_unslash( $_REQUEST['_wp_http_referer'] );
|
263 |
+
} else if ( ! empty( $_SERVER['HTTP_REFERER'] ) ) {
|
264 |
+
return wp_unslash( $_SERVER['HTTP_REFERER'] );
|
265 |
+
}
|
266 |
+
|
267 |
+
return false;
|
268 |
+
}
|
269 |
+
}
|
270 |
+
|
271 |
+
/* Core UI.
|
272 |
+
--------------------------------------------------------------------------------------------*/
|
273 |
+
/**
|
274 |
+
* @param number $module_id
|
275 |
+
* @param string $page
|
276 |
+
* @param string $action
|
277 |
+
* @param string $title
|
278 |
+
* @param array $params
|
279 |
+
* @param bool $is_primary
|
280 |
+
* @param string|bool $icon_class Optional class for an icon (since 1.1.7).
|
281 |
+
* @param string|bool $confirmation Optional confirmation message before submit (since 1.1.7).
|
282 |
+
* @param string $method Since 1.1.7
|
283 |
+
*
|
284 |
+
* @uses fs_ui_get_action_button()
|
285 |
+
*/
|
286 |
+
function fs_ui_action_button(
|
287 |
+
$module_id,
|
288 |
+
$page,
|
289 |
+
$action,
|
290 |
+
$title,
|
291 |
+
$params = array(),
|
292 |
+
$is_primary = true,
|
293 |
+
$icon_class = false,
|
294 |
+
$confirmation = false,
|
295 |
+
$method = 'GET'
|
296 |
+
) {
|
297 |
+
echo fs_ui_get_action_button(
|
298 |
+
$module_id,
|
299 |
+
$page,
|
300 |
+
$action,
|
301 |
+
$title,
|
302 |
+
$params,
|
303 |
+
$is_primary,
|
304 |
+
$icon_class,
|
305 |
+
$confirmation,
|
306 |
+
$method
|
307 |
+
);
|
308 |
+
}
|
309 |
+
|
310 |
+
/**
|
311 |
+
* @author Vova Feldman (@svovaf)
|
312 |
+
* @since 1.1.7
|
313 |
+
*
|
314 |
+
* @param number $module_id
|
315 |
+
* @param string $page
|
316 |
+
* @param string $action
|
317 |
+
* @param string $title
|
318 |
+
* @param array $params
|
319 |
+
* @param bool $is_primary
|
320 |
+
* @param string|bool $icon_class Optional class for an icon.
|
321 |
+
* @param string|bool $confirmation Optional confirmation message before submit.
|
322 |
+
* @param string $method
|
323 |
+
*
|
324 |
+
* @return string
|
325 |
+
*/
|
326 |
+
function fs_ui_get_action_button(
|
327 |
+
$module_id,
|
328 |
+
$page,
|
329 |
+
$action,
|
330 |
+
$title,
|
331 |
+
$params = array(),
|
332 |
+
$is_primary = true,
|
333 |
+
$icon_class = false,
|
334 |
+
$confirmation = false,
|
335 |
+
$method = 'GET'
|
336 |
+
) {
|
337 |
+
// Prepend icon (if set).
|
338 |
+
$title = ( is_string( $icon_class ) ? '<i class="' . $icon_class . '"></i> ' : '' ) . $title;
|
339 |
+
|
340 |
+
if ( is_string( $confirmation ) ) {
|
341 |
+
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>',
|
342 |
+
freemius( $module_id )->_get_admin_page_url( $page, $params ),
|
343 |
+
$method,
|
344 |
+
$action,
|
345 |
+
wp_nonce_field( $action, '_wpnonce', true, false ),
|
346 |
+
'button' . ( $is_primary ? ' button-primary' : '' ),
|
347 |
+
$confirmation,
|
348 |
+
$title
|
349 |
+
);
|
350 |
+
} else if ( 'GET' !== strtoupper( $method ) ) {
|
351 |
+
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>',
|
352 |
+
freemius( $module_id )->_get_admin_page_url( $page, $params ),
|
353 |
+
$method,
|
354 |
+
$action,
|
355 |
+
wp_nonce_field( $action, '_wpnonce', true, false ),
|
356 |
+
'button' . ( $is_primary ? ' button-primary' : '' ),
|
357 |
+
$title
|
358 |
+
);
|
359 |
+
} else {
|
360 |
+
return sprintf( '<a href="%s" class="%s">%s</a></form>',
|
361 |
+
wp_nonce_url( freemius( $module_id )->_get_admin_page_url( $page, array_merge( $params, array( 'fs_action' => $action ) ) ), $action ),
|
362 |
+
'button' . ( $is_primary ? ' button-primary' : '' ),
|
363 |
+
$title
|
364 |
+
);
|
365 |
+
}
|
366 |
+
}
|
367 |
+
|
368 |
+
function fs_ui_action_link( $module_id, $page, $action, $title, $params = array() ) {
|
369 |
+
?><a class=""
|
370 |
+
href="<?php echo wp_nonce_url( freemius( $module_id )->_get_admin_page_url( $page, array_merge( $params, array( 'fs_action' => $action ) ) ), $action ) ?>"><?php echo $title ?></a><?php
|
371 |
+
}
|
372 |
+
|
373 |
+
/*function fs_error_handler($errno, $errstr, $errfile, $errline)
|
374 |
+
{
|
375 |
+
if (false === strpos($errfile, 'freemius/'))
|
376 |
+
{
|
377 |
+
// @todo Dump Freemius errors to local log.
|
378 |
+
}
|
379 |
|
380 |
// switch ($errno) {
|
381 |
// case E_USER_ERROR:
|
389 |
// default:
|
390 |
// break;
|
391 |
// }
|
392 |
+
}
|
393 |
+
|
394 |
+
set_error_handler('fs_error_handler');*/
|
395 |
+
|
396 |
+
if ( ! function_exists( 'fs_nonce_url' ) ) {
|
397 |
+
/**
|
398 |
+
* Retrieve URL with nonce added to URL query.
|
399 |
+
*
|
400 |
+
* Originally was using `wp_nonce_url()` but the new version
|
401 |
+
* changed the return value to escaped URL, that's not the expected
|
402 |
+
* behaviour.
|
403 |
+
*
|
404 |
+
* @author Vova Feldman (@svovaf)
|
405 |
+
* @since ~1.1.3
|
406 |
+
*
|
407 |
+
* @param string $actionurl URL to add nonce action.
|
408 |
+
* @param int|string $action Optional. Nonce action name. Default -1.
|
409 |
+
* @param string $name Optional. Nonce name. Default '_wpnonce'.
|
410 |
+
*
|
411 |
+
* @return string Escaped URL with nonce action added.
|
412 |
+
*/
|
413 |
+
function fs_nonce_url( $actionurl, $action = - 1, $name = '_wpnonce' ) {
|
414 |
+
return add_query_arg( $name, wp_create_nonce( $action ), $actionurl );
|
415 |
+
}
|
416 |
+
}
|
417 |
+
|
418 |
+
if ( ! function_exists( 'fs_starts_with' ) ) {
|
419 |
+
/**
|
420 |
+
* Check if string starts with.
|
421 |
+
*
|
422 |
+
* @author Vova Feldman (@svovaf)
|
423 |
+
* @since 1.1.3
|
424 |
+
*
|
425 |
+
* @param string $haystack
|
426 |
+
* @param string $needle
|
427 |
+
*
|
428 |
+
* @return bool
|
429 |
+
*/
|
430 |
+
function fs_starts_with( $haystack, $needle ) {
|
431 |
+
$length = strlen( $needle );
|
432 |
+
|
433 |
+
return ( substr( $haystack, 0, $length ) === $needle );
|
434 |
+
}
|
435 |
+
}
|
436 |
+
|
437 |
+
#region Url Canonization ------------------------------------------------------------------
|
438 |
+
|
439 |
+
if ( ! function_exists( 'fs_canonize_url' ) ) {
|
440 |
+
/**
|
441 |
+
* @author Vova Feldman (@svovaf)
|
442 |
+
* @since 1.1.3
|
443 |
+
*
|
444 |
+
* @param string $url
|
445 |
+
* @param bool $omit_host
|
446 |
+
* @param array $ignore_params
|
447 |
+
*
|
448 |
+
* @return string
|
449 |
+
*/
|
450 |
+
function fs_canonize_url( $url, $omit_host = false, $ignore_params = array() ) {
|
451 |
+
$parsed_url = parse_url( strtolower( $url ) );
|
452 |
|
453 |
// if ( ! isset( $parsed_url['host'] ) ) {
|
454 |
// return $url;
|
455 |
// }
|
456 |
|
457 |
+
$canonical = ( ( $omit_host || ! isset( $parsed_url['host'] ) ) ? '' : $parsed_url['host'] ) . $parsed_url['path'];
|
458 |
+
|
459 |
+
if ( isset( $parsed_url['query'] ) ) {
|
460 |
+
parse_str( $parsed_url['query'], $queryString );
|
461 |
+
$canonical .= '?' . fs_canonize_query_string( $queryString, $ignore_params );
|
462 |
+
}
|
463 |
+
|
464 |
+
return $canonical;
|
465 |
+
}
|
466 |
+
}
|
467 |
+
|
468 |
+
if ( ! function_exists( 'fs_canonize_query_string' ) ) {
|
469 |
+
/**
|
470 |
+
* @author Vova Feldman (@svovaf)
|
471 |
+
* @since 1.1.3
|
472 |
+
*
|
473 |
+
* @param array $params
|
474 |
+
* @param array $ignore_params
|
475 |
+
* @param bool $params_prefix
|
476 |
+
*
|
477 |
+
* @return string
|
478 |
+
*/
|
479 |
+
function fs_canonize_query_string( array $params, array &$ignore_params, $params_prefix = false ) {
|
480 |
+
if ( ! is_array( $params ) || 0 === count( $params ) ) {
|
481 |
+
return '';
|
482 |
+
}
|
483 |
+
|
484 |
+
// Url encode both keys and values
|
485 |
+
$keys = fs_urlencode_rfc3986( array_keys( $params ) );
|
486 |
+
$values = fs_urlencode_rfc3986( array_values( $params ) );
|
487 |
+
$params = array_combine( $keys, $values );
|
488 |
+
|
489 |
+
// Parameters are sorted by name, using lexicographical byte value ordering.
|
490 |
+
// Ref: Spec: 9.1.1 (1)
|
491 |
+
uksort( $params, 'strcmp' );
|
492 |
+
|
493 |
+
$pairs = array();
|
494 |
+
foreach ( $params as $parameter => $value ) {
|
495 |
+
$lower_param = strtolower( $parameter );
|
496 |
+
|
497 |
+
// Skip ignore params.
|
498 |
+
if ( in_array( $lower_param, $ignore_params ) ||
|
499 |
+
( false !== $params_prefix && fs_starts_with( $lower_param, $params_prefix ) )
|
500 |
+
) {
|
501 |
+
continue;
|
502 |
+
}
|
503 |
+
|
504 |
+
if ( is_array( $value ) ) {
|
505 |
+
// If two or more parameters share the same name, they are sorted by their value
|
506 |
+
// Ref: Spec: 9.1.1 (1)
|
507 |
+
natsort( $value );
|
508 |
+
foreach ( $value as $duplicate_value ) {
|
509 |
+
$pairs[] = $lower_param . '=' . $duplicate_value;
|
510 |
+
}
|
511 |
+
} else {
|
512 |
+
$pairs[] = $lower_param . '=' . $value;
|
513 |
+
}
|
514 |
+
}
|
515 |
+
|
516 |
+
if ( 0 === count( $pairs ) ) {
|
517 |
+
return '';
|
518 |
+
}
|
519 |
+
|
520 |
+
return implode( "&", $pairs );
|
521 |
+
}
|
522 |
+
}
|
523 |
+
|
524 |
+
if ( ! function_exists( 'fs_urlencode_rfc3986' ) ) {
|
525 |
+
/**
|
526 |
+
* @author Vova Feldman (@svovaf)
|
527 |
+
* @since 1.1.3
|
528 |
+
*
|
529 |
+
* @param string|string[] $input
|
530 |
+
*
|
531 |
+
* @return array|mixed|string
|
532 |
+
*/
|
533 |
+
function fs_urlencode_rfc3986( $input ) {
|
534 |
+
if ( is_array( $input ) ) {
|
535 |
+
return array_map( 'fs_urlencode_rfc3986', $input );
|
536 |
+
} else if ( is_scalar( $input ) ) {
|
537 |
+
return str_replace( '+', ' ', str_replace( '%7E', '~', rawurlencode( $input ) ) );
|
538 |
+
}
|
539 |
+
|
540 |
+
return '';
|
541 |
+
}
|
542 |
+
}
|
543 |
+
|
544 |
+
#endregion Url Canonization ------------------------------------------------------------------
|
545 |
+
|
546 |
+
/**
|
547 |
+
* @author Vova Feldman (@svovaf)
|
548 |
+
*
|
549 |
+
* @since 1.2.2 Changed to usage of WP_Filesystem_Direct.
|
550 |
+
*
|
551 |
+
* @param string $from URL
|
552 |
+
* @param string $to File path.
|
553 |
+
*
|
554 |
+
* @return bool Is successfully downloaded.
|
555 |
+
*/
|
556 |
+
function fs_download_image( $from, $to ) {
|
557 |
+
$dir = dirname( $to );
|
558 |
+
|
559 |
+
if ( 'direct' !== get_filesystem_method( array(), $dir ) ) {
|
560 |
+
return false;
|
561 |
+
}
|
562 |
+
|
563 |
+
if ( ! class_exists( 'WP_Filesystem_Direct' ) ) {
|
564 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php';
|
565 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php';
|
566 |
+
}
|
567 |
+
|
568 |
+
$fs = new WP_Filesystem_Direct( '' );
|
569 |
+
$tmpfile = download_url( $from );
|
570 |
+
|
571 |
+
if ( $tmpfile instanceof WP_Error ) {
|
572 |
+
// Issue downloading the file.
|
573 |
+
return false;
|
574 |
+
}
|
575 |
+
|
576 |
+
$fs->copy( $tmpfile, $to );
|
577 |
+
$fs->delete( $tmpfile );
|
578 |
+
|
579 |
+
return true;
|
580 |
+
}
|
581 |
+
|
582 |
+
/* General Utilities
|
583 |
+
--------------------------------------------------------------------------------------------*/
|
584 |
+
|
585 |
+
/**
|
586 |
+
* Sorts an array by the value of the priority key.
|
587 |
+
*
|
588 |
+
* @author Daniel Iser (@danieliser)
|
589 |
+
* @since 1.1.7
|
590 |
+
*
|
591 |
+
* @param $a
|
592 |
+
* @param $b
|
593 |
+
*
|
594 |
+
* @return int
|
595 |
+
*/
|
596 |
+
function fs_sort_by_priority( $a, $b ) {
|
597 |
+
|
598 |
+
// If b has a priority and a does not, b wins.
|
599 |
+
if ( ! isset( $a['priority'] ) && isset( $b['priority'] ) ) {
|
600 |
+
return 1;
|
601 |
+
} // If b has a priority and a does not, b wins.
|
602 |
+
elseif ( isset( $a['priority'] ) && ! isset( $b['priority'] ) ) {
|
603 |
+
return - 1;
|
604 |
+
} // If neither has a priority or both priorities are equal its a tie.
|
605 |
+
elseif ( ( ! isset( $a['priority'] ) && ! isset( $b['priority'] ) ) || $a['priority'] === $b['priority'] ) {
|
606 |
+
return 0;
|
607 |
+
}
|
608 |
+
|
609 |
+
// If both have priority return the winner.
|
610 |
+
return ( $a['priority'] < $b['priority'] ) ? - 1 : 1;
|
611 |
+
}
|
612 |
+
|
613 |
+
#--------------------------------------------------------------------------------
|
614 |
+
#region Localization
|
615 |
+
#--------------------------------------------------------------------------------
|
616 |
+
|
617 |
+
if ( ! function_exists( 'fs_text' ) ) {
|
618 |
+
/**
|
619 |
+
* Retrieve a translated text by key.
|
620 |
+
*
|
621 |
+
* @author Vova Feldman (@svovaf)
|
622 |
+
* @since 1.2.1.7
|
623 |
+
*
|
624 |
+
* @param string $key
|
625 |
+
* @param string $slug
|
626 |
+
*
|
627 |
+
* @return string
|
628 |
+
*
|
629 |
+
* @global $fs_text , $fs_text_overrides
|
630 |
+
*/
|
631 |
+
function fs_text( $key, $slug = 'freemius' ) {
|
632 |
+
return __fs( $key, $slug );
|
633 |
+
}
|
634 |
+
|
635 |
+
/**
|
636 |
+
* Get a translatable text override if exists, or `false`.
|
637 |
+
*
|
638 |
+
* @author Vova Feldman (@svovaf)
|
639 |
+
* @since 1.2.1.7
|
640 |
+
*
|
641 |
+
* @param string $text Translatable string.
|
642 |
+
* @param string $key String key for overrides.
|
643 |
+
* @param string $slug Module slug for overrides.
|
644 |
+
*
|
645 |
+
* @return string|false
|
646 |
+
*/
|
647 |
+
function fs_text_override( $text, $key, $slug ) {
|
648 |
+
global $fs_text_overrides;
|
649 |
+
|
650 |
+
/**
|
651 |
+
* Check if string is overridden.
|
652 |
+
*/
|
653 |
+
if ( ! isset( $fs_text_overrides[ $slug ] ) ) {
|
654 |
+
return false;
|
655 |
+
}
|
656 |
+
|
657 |
+
if ( empty( $key ) ) {
|
658 |
+
$key = strtolower( str_replace( ' ', '-', $text ) );
|
659 |
+
}
|
660 |
+
|
661 |
+
if ( isset( $fs_text_overrides[ $slug ][ $key ] ) ) {
|
662 |
+
return $fs_text_overrides[ $slug ][ $key ];
|
663 |
+
}
|
664 |
+
|
665 |
+
$lower_key = strtolower( $key );
|
666 |
+
if ( isset( $fs_text_overrides[ $slug ][ $lower_key ] ) ) {
|
667 |
+
return $fs_text_overrides[ $slug ][ $lower_key ];
|
668 |
+
}
|
669 |
+
|
670 |
+
return false;
|
671 |
+
}
|
672 |
+
|
673 |
+
/**
|
674 |
+
* Get a translatable text and its text domain.
|
675 |
+
*
|
676 |
+
* When the text is overridden by the module, returns the overridden text and the text domain of the module. Otherwise, returns the original text and 'freemius' as the text domain.
|
677 |
+
*
|
678 |
+
* @author Vova Feldman (@svovaf)
|
679 |
+
* @since 1.2.1.7
|
680 |
+
*
|
681 |
+
* @param string $text Translatable string.
|
682 |
+
* @param string $key String key for overrides.
|
683 |
+
* @param string $slug Module slug for overrides.
|
684 |
+
*
|
685 |
+
* @return string[]
|
686 |
+
*/
|
687 |
+
function fs_text_and_domain( $text, $key, $slug ) {
|
688 |
+
$override = fs_text_override( $text, $key, $slug );
|
689 |
+
|
690 |
+
if ( false === $override ) {
|
691 |
+
// No override, use FS text domain.
|
692 |
+
$text_domain = 'freemius';
|
693 |
+
} else {
|
694 |
+
// Found an override.
|
695 |
+
$text = $override;
|
696 |
+
// Use the module's text domain.
|
697 |
+
$text_domain = $slug;
|
698 |
+
}
|
699 |
+
|
700 |
+
return array( $text, $text_domain );
|
701 |
+
}
|
702 |
+
|
703 |
+
#region Private
|
704 |
+
|
705 |
+
/**
|
706 |
+
* Retrieve an inline translated text by key.
|
707 |
+
*
|
708 |
+
* @author Vova Feldman (@svovaf)
|
709 |
+
* @since 1.2.3
|
710 |
+
*
|
711 |
+
* @param string $text Translatable string.
|
712 |
+
* @param string $key String key for overrides.
|
713 |
+
* @param string $slug Module slug for overrides.
|
714 |
+
*
|
715 |
+
* @return string
|
716 |
+
*
|
717 |
+
* @global $fs_text_overrides
|
718 |
+
*/
|
719 |
+
function _fs_text_inline( $text, $key = '', $slug = 'freemius' ) {
|
720 |
+
list( $text, $text_domain ) = fs_text_and_domain( $text, $key, $slug );
|
721 |
+
|
722 |
+
// Avoid misleading Theme Check warning.
|
723 |
+
$fn = 'translate';
|
724 |
+
|
725 |
+
return $fn( $text, $text_domain );
|
726 |
+
}
|
727 |
+
|
728 |
+
/**
|
729 |
+
* Retrieve an inline translated text by key with a context.
|
730 |
+
*
|
731 |
+
* @author Vova Feldman (@svovaf)
|
732 |
+
* @since 1.2.3
|
733 |
+
*
|
734 |
+
* @param string $text Translatable string.
|
735 |
+
* @param string $context Context information for the translators.
|
736 |
+
* @param string $key String key for overrides.
|
737 |
+
* @param string $slug Module slug for overrides.
|
738 |
+
*
|
739 |
+
* @return string
|
740 |
+
*
|
741 |
+
* @global $fs_text_overrides
|
742 |
+
*/
|
743 |
+
function _fs_text_x_inline( $text, $context, $key = '', $slug = 'freemius' ) {
|
744 |
+
list( $text, $text_domain ) = fs_text_and_domain( $text, $key, $slug );
|
745 |
+
|
746 |
+
// Avoid misleading Theme Check warning.
|
747 |
+
$fn = 'translate_with_gettext_context';
|
748 |
+
|
749 |
+
return $fn( $text, $context, $text_domain );
|
750 |
+
}
|
751 |
+
|
752 |
+
#endregion
|
753 |
+
|
754 |
+
/**
|
755 |
+
* Retrieve an inline translated text by key.
|
756 |
+
*
|
757 |
+
* @author Vova Feldman (@svovaf)
|
758 |
+
* @since 1.2.3
|
759 |
+
*
|
760 |
+
* @param string $text Translatable string.
|
761 |
+
* @param string $key String key for overrides.
|
762 |
+
* @param string $slug Module slug for overrides.
|
763 |
+
*
|
764 |
+
* @return string
|
765 |
+
*
|
766 |
+
* @global $fs_text_overrides
|
767 |
+
*/
|
768 |
+
function fs_text_inline( $text, $key = '', $slug = 'freemius' ) {
|
769 |
+
return _fs_text_inline( $text, $key, $slug );
|
770 |
+
}
|
771 |
+
|
772 |
+
/**
|
773 |
+
* Retrieve an inline translated text by key with a context.
|
774 |
+
*
|
775 |
+
* @author Vova Feldman (@svovaf)
|
776 |
+
* @since 1.2.3
|
777 |
+
*
|
778 |
+
* @param string $text Translatable string.
|
779 |
+
* @param string $context Context information for the translators.
|
780 |
+
* @param string $key String key for overrides.
|
781 |
+
* @param string $slug Module slug for overrides.
|
782 |
+
*
|
783 |
+
* @return string
|
784 |
+
*
|
785 |
+
* @global $fs_text_overrides
|
786 |
+
*/
|
787 |
+
function fs_text_x_inline( $text, $context, $key = '', $slug = 'freemius' ) {
|
788 |
+
return _fs_text_x_inline( $text, $context, $key, $slug );
|
789 |
+
}
|
790 |
+
|
791 |
+
/**
|
792 |
+
* Output a translated text by key.
|
793 |
+
*
|
794 |
+
* @author Vova Feldman (@svovaf)
|
795 |
+
* @since 1.2.1.7
|
796 |
+
*
|
797 |
+
* @param string $key
|
798 |
+
* @param string $slug
|
799 |
+
*/
|
800 |
+
function fs_echo( $key, $slug = 'freemius' ) {
|
801 |
+
echo fs_text( $key, $slug );
|
802 |
+
}
|
803 |
+
|
804 |
+
/**
|
805 |
+
* Output an inline translated text.
|
806 |
+
*
|
807 |
+
* @author Vova Feldman (@svovaf)
|
808 |
+
* @since 1.2.3
|
809 |
+
*
|
810 |
+
* @param string $text Translatable string.
|
811 |
+
* @param string $key String key for overrides.
|
812 |
+
* @param string $slug Module slug for overrides.
|
813 |
+
*/
|
814 |
+
function fs_echo_inline( $text, $key = '', $slug = 'freemius' ) {
|
815 |
+
echo _fs_text_inline( $text, $key, $slug );
|
816 |
+
}
|
817 |
+
|
818 |
+
/**
|
819 |
+
* Output an inline translated text with a context.
|
820 |
+
*
|
821 |
+
* @author Vova Feldman (@svovaf)
|
822 |
+
* @since 1.2.3
|
823 |
+
*
|
824 |
+
* @param string $text Translatable string.
|
825 |
+
* @param string $context Context information for the translators.
|
826 |
+
* @param string $key String key for overrides.
|
827 |
+
* @param string $slug Module slug for overrides.
|
828 |
+
*/
|
829 |
+
function fs_echo_x_inline( $text, $context, $key = '', $slug = 'freemius' ) {
|
830 |
+
echo _fs_text_x_inline( $text, $context, $key, $slug );
|
831 |
+
}
|
832 |
+
}
|
833 |
+
|
834 |
+
if ( ! function_exists( 'fs_esc_attr' ) ) {
|
835 |
+
/**
|
836 |
+
* @author Vova Feldman
|
837 |
+
* @since 1.2.1.6
|
838 |
+
*
|
839 |
+
* @param string $key
|
840 |
+
* @param string $slug
|
841 |
+
*
|
842 |
+
* @return string
|
843 |
+
*/
|
844 |
+
function fs_esc_attr( $key, $slug ) {
|
845 |
+
return esc_attr( fs_text( $key, $slug ) );
|
846 |
+
}
|
847 |
+
}
|
848 |
+
|
849 |
+
if ( ! function_exists( 'fs_esc_attr_inline' ) ) {
|
850 |
+
/**
|
851 |
+
* @author Vova Feldman (@svovaf)
|
852 |
+
* @since 1.2.3
|
853 |
+
*
|
854 |
+
* @param string $text Translatable string.
|
855 |
+
* @param string $key String key for overrides.
|
856 |
+
* @param string $slug Module slug for overrides.
|
857 |
+
*
|
858 |
+
* @return string
|
859 |
+
*/
|
860 |
+
function fs_esc_attr_inline( $text, $key = '', $slug = 'freemius' ) {
|
861 |
+
return esc_attr( _fs_text_inline( $text, $key, $slug ) );
|
862 |
+
}
|
863 |
+
}
|
864 |
+
|
865 |
+
if ( ! function_exists( 'fs_esc_attr_x_inline' ) ) {
|
866 |
+
/**
|
867 |
+
* @author Vova Feldman (@svovaf)
|
868 |
+
* @since 1.2.3
|
869 |
+
*
|
870 |
+
* @param string $text Translatable string.
|
871 |
+
* @param string $context Context information for the translators.
|
872 |
+
* @param string $key String key for overrides.
|
873 |
+
* @param string $slug Module slug for overrides.
|
874 |
+
*
|
875 |
+
* @return string
|
876 |
+
*/
|
877 |
+
function fs_esc_attr_x_inline( $text, $context, $key = '', $slug = 'freemius' ) {
|
878 |
+
return esc_attr( _fs_text_x_inline( $text, $context, $key, $slug ) );
|
879 |
+
}
|
880 |
+
}
|
881 |
+
|
882 |
+
if ( ! function_exists( 'fs_esc_attr_echo' ) ) {
|
883 |
+
/**
|
884 |
+
* @author Vova Feldman
|
885 |
+
* @since 1.2.1.6
|
886 |
+
*
|
887 |
+
* @param string $key
|
888 |
+
* @param string $slug
|
889 |
+
*/
|
890 |
+
function fs_esc_attr_echo( $key, $slug ) {
|
891 |
+
echo esc_attr( fs_text( $key, $slug ) );
|
892 |
+
}
|
893 |
+
}
|
894 |
+
|
895 |
+
if ( ! function_exists( 'fs_esc_attr_echo_inline' ) ) {
|
896 |
+
/**
|
897 |
+
* @author Vova Feldman (@svovaf)
|
898 |
+
* @since 1.2.3
|
899 |
+
*
|
900 |
+
* @param string $text Translatable string.
|
901 |
+
* @param string $key String key for overrides.
|
902 |
+
* @param string $slug Module slug for overrides.
|
903 |
+
*/
|
904 |
+
function fs_esc_attr_echo_inline( $text, $key = '', $slug = 'freemius' ) {
|
905 |
+
echo esc_attr( _fs_text_inline( $text, $key, $slug ) );
|
906 |
+
}
|
907 |
+
}
|
908 |
+
|
909 |
+
if ( ! function_exists( 'fs_esc_js' ) ) {
|
910 |
+
/**
|
911 |
+
* @author Vova Feldman
|
912 |
+
* @since 1.2.1.6
|
913 |
+
*
|
914 |
+
* @param string $key
|
915 |
+
* @param string $slug
|
916 |
+
*
|
917 |
+
* @return string
|
918 |
+
*/
|
919 |
+
function fs_esc_js( $key, $slug ) {
|
920 |
+
return esc_js( fs_text( $key, $slug ) );
|
921 |
+
}
|
922 |
+
}
|
923 |
+
|
924 |
+
if ( ! function_exists( 'fs_esc_js_inline' ) ) {
|
925 |
+
/**
|
926 |
+
* @author Vova Feldman (@svovaf)
|
927 |
+
* @since 1.2.3
|
928 |
+
*
|
929 |
+
* @param string $text Translatable string.
|
930 |
+
* @param string $key String key for overrides.
|
931 |
+
* @param string $slug Module slug for overrides.
|
932 |
+
*
|
933 |
+
* @return string
|
934 |
+
*/
|
935 |
+
function fs_esc_js_inline( $text, $key = '', $slug = 'freemius' ) {
|
936 |
+
return esc_js( _fs_text_inline( $text, $key, $slug ) );
|
937 |
+
}
|
938 |
+
}
|
939 |
+
|
940 |
+
if ( ! function_exists( 'fs_esc_js_x_inline' ) ) {
|
941 |
+
/**
|
942 |
+
* @author Vova Feldman (@svovaf)
|
943 |
+
* @since 1.2.3
|
944 |
+
*
|
945 |
+
* @param string $text Translatable string.
|
946 |
+
* @param string $context Context information for the translators.
|
947 |
+
* @param string $key String key for overrides.
|
948 |
+
* @param string $slug Module slug for overrides.
|
949 |
+
*
|
950 |
+
* @return string
|
951 |
+
*/
|
952 |
+
function fs_esc_js_x_inline( $text, $context, $key = '', $slug = 'freemius' ) {
|
953 |
+
return esc_js( _fs_text_x_inline( $text, $context, $key, $slug ) );
|
954 |
+
}
|
955 |
+
}
|
956 |
+
|
957 |
+
if ( ! function_exists( 'fs_esc_js_echo_x_inline' ) ) {
|
958 |
+
/**
|
959 |
+
* @author Vova Feldman (@svovaf)
|
960 |
+
* @since 1.2.3
|
961 |
+
*
|
962 |
+
* @param string $text Translatable string.
|
963 |
+
* @param string $context Context information for the translators.
|
964 |
+
* @param string $key String key for overrides.
|
965 |
+
* @param string $slug Module slug for overrides.
|
966 |
+
*
|
967 |
+
* @return string
|
968 |
+
*/
|
969 |
+
function fs_esc_js_echo_x_inline( $text, $context, $key = '', $slug = 'freemius' ) {
|
970 |
+
echo esc_js( _fs_text_x_inline( $text, $context, $key, $slug ) );
|
971 |
+
}
|
972 |
+
}
|
973 |
+
|
974 |
+
if ( ! function_exists( 'fs_esc_js_echo' ) ) {
|
975 |
+
/**
|
976 |
+
* @author Vova Feldman
|
977 |
+
* @since 1.2.1.6
|
978 |
+
*
|
979 |
+
* @param string $key
|
980 |
+
* @param string $slug
|
981 |
+
*/
|
982 |
+
function fs_esc_js_echo( $key, $slug ) {
|
983 |
+
echo esc_js( fs_text( $key, $slug ) );
|
984 |
+
}
|
985 |
+
}
|
986 |
+
|
987 |
+
if ( ! function_exists( 'fs_esc_js_echo_inline' ) ) {
|
988 |
+
/**
|
989 |
+
* @author Vova Feldman (@svovaf)
|
990 |
+
* @since 1.2.3
|
991 |
+
*
|
992 |
+
* @param string $text Translatable string.
|
993 |
+
* @param string $key String key for overrides.
|
994 |
+
* @param string $slug Module slug for overrides.
|
995 |
+
*/
|
996 |
+
function fs_esc_js_echo_inline( $text, $key = '', $slug = 'freemius' ) {
|
997 |
+
echo esc_js( _fs_text_inline( $text, $key, $slug ) );
|
998 |
+
}
|
999 |
+
}
|
1000 |
+
|
1001 |
+
if ( ! function_exists( 'fs_json_encode_echo' ) ) {
|
1002 |
+
/**
|
1003 |
+
* @author Vova Feldman
|
1004 |
+
* @since 1.2.1.6
|
1005 |
+
*
|
1006 |
+
* @param string $key
|
1007 |
+
* @param string $slug
|
1008 |
+
*/
|
1009 |
+
function fs_json_encode_echo( $key, $slug ) {
|
1010 |
+
echo json_encode( fs_text( $key, $slug ) );
|
1011 |
+
}
|
1012 |
+
}
|
1013 |
+
|
1014 |
+
if ( ! function_exists( 'fs_json_encode_echo_inline' ) ) {
|
1015 |
+
/**
|
1016 |
+
* @author Vova Feldman (@svovaf)
|
1017 |
+
* @since 1.2.3
|
1018 |
+
*
|
1019 |
+
* @param string $text Translatable string.
|
1020 |
+
* @param string $key String key for overrides.
|
1021 |
+
* @param string $slug Module slug for overrides.
|
1022 |
+
*/
|
1023 |
+
function fs_json_encode_echo_inline( $text, $key = '', $slug = 'freemius' ) {
|
1024 |
+
echo json_encode( _fs_text_inline( $text, $key, $slug ) );
|
1025 |
+
}
|
1026 |
+
}
|
1027 |
+
|
1028 |
+
if ( ! function_exists( 'fs_esc_html' ) ) {
|
1029 |
+
/**
|
1030 |
+
* @author Vova Feldman
|
1031 |
+
* @since 1.2.1.6
|
1032 |
+
*
|
1033 |
+
* @param string $key
|
1034 |
+
* @param string $slug
|
1035 |
+
*
|
1036 |
+
* @return string
|
1037 |
+
*/
|
1038 |
+
function fs_esc_html( $key, $slug ) {
|
1039 |
+
return esc_html( fs_text( $key, $slug ) );
|
1040 |
+
}
|
1041 |
+
}
|
1042 |
+
|
1043 |
+
if ( ! function_exists( 'fs_esc_html_inline' ) ) {
|
1044 |
+
/**
|
1045 |
+
* @author Vova Feldman (@svovaf)
|
1046 |
+
* @since 1.2.3
|
1047 |
+
*
|
1048 |
+
* @param string $text Translatable string.
|
1049 |
+
* @param string $key String key for overrides.
|
1050 |
+
* @param string $slug Module slug for overrides.
|
1051 |
+
*
|
1052 |
+
* @return string
|
1053 |
+
*/
|
1054 |
+
function fs_esc_html_inline( $text, $key = '', $slug = 'freemius' ) {
|
1055 |
+
return esc_html( _fs_text_inline( $text, $key, $slug ) );
|
1056 |
+
}
|
1057 |
+
}
|
1058 |
+
|
1059 |
+
if ( ! function_exists( 'fs_esc_html_x_inline' ) ) {
|
1060 |
+
/**
|
1061 |
+
* @author Vova Feldman (@svovaf)
|
1062 |
+
* @since 1.2.3
|
1063 |
+
*
|
1064 |
+
* @param string $text Translatable string.
|
1065 |
+
* @param string $context Context information for the translators.
|
1066 |
+
* @param string $key String key for overrides.
|
1067 |
+
* @param string $slug Module slug for overrides.
|
1068 |
+
*
|
1069 |
+
* @return string
|
1070 |
+
*/
|
1071 |
+
function fs_esc_html_x_inline( $text, $context, $key = '', $slug = 'freemius' ) {
|
1072 |
+
return esc_html( _fs_text_x_inline( $text, $context, $key, $slug ) );
|
1073 |
+
}
|
1074 |
+
}
|
1075 |
+
|
1076 |
+
if ( ! function_exists( 'fs_esc_html_echo_x_inline' ) ) {
|
1077 |
+
/**
|
1078 |
+
* @author Vova Feldman (@svovaf)
|
1079 |
+
* @since 1.2.3
|
1080 |
+
*
|
1081 |
+
* @param string $text Translatable string.
|
1082 |
+
* @param string $context Context information for the translators.
|
1083 |
+
* @param string $key String key for overrides.
|
1084 |
+
* @param string $slug Module slug for overrides.
|
1085 |
+
*/
|
1086 |
+
function fs_esc_html_echo_x_inline( $text, $context, $key = '', $slug = 'freemius' ) {
|
1087 |
+
echo esc_html( _fs_text_x_inline( $text, $context, $key, $slug ) );
|
1088 |
+
}
|
1089 |
+
}
|
1090 |
+
|
1091 |
+
if ( ! function_exists( 'fs_esc_html_echo' ) ) {
|
1092 |
+
/**
|
1093 |
+
* @author Vova Feldman
|
1094 |
+
* @since 1.2.1.6
|
1095 |
+
*
|
1096 |
+
* @param string $key
|
1097 |
+
* @param string $slug
|
1098 |
+
*/
|
1099 |
+
function fs_esc_html_echo( $key, $slug ) {
|
1100 |
+
echo esc_html( fs_text( $key, $slug ) );
|
1101 |
+
}
|
1102 |
+
}
|
1103 |
+
|
1104 |
+
if ( ! function_exists( 'fs_esc_html_echo_inline' ) ) {
|
1105 |
+
/**
|
1106 |
+
* @author Vova Feldman (@svovaf)
|
1107 |
+
* @since 1.2.3
|
1108 |
+
*
|
1109 |
+
* @param string $text Translatable string.
|
1110 |
+
* @param string $key String key for overrides.
|
1111 |
+
* @param string $slug Module slug for overrides.
|
1112 |
+
*/
|
1113 |
+
function fs_esc_html_echo_inline( $text, $key = '', $slug = 'freemius' ) {
|
1114 |
+
echo esc_html( _fs_text_inline( $text, $key, $slug ) );
|
1115 |
+
}
|
1116 |
+
}
|
1117 |
|
1118 |
#endregion
|
freemius/includes/fs-essential-functions.php
CHANGED
@@ -1,494 +1,497 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* IMPORTANT:
|
4 |
-
* This file will be loaded based on the order of the plugins/themes load.
|
5 |
-
* If there's a theme and a plugin using Freemius, the plugin's essential
|
6 |
-
* file will always load first.
|
7 |
-
*
|
8 |
-
* @package Freemius
|
9 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
10 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
11 |
-
* @since 1.1.5
|
12 |
-
*/
|
13 |
-
|
14 |
-
if ( ! function_exists( 'fs_normalize_path' ) ) {
|
15 |
-
if ( function_exists( 'wp_normalize_path' ) ) {
|
16 |
-
/**
|
17 |
-
* Normalize a filesystem path.
|
18 |
-
*
|
19 |
-
* Replaces backslashes with forward slashes for Windows systems, and ensures
|
20 |
-
* no duplicate slashes exist.
|
21 |
-
*
|
22 |
-
* @param string $path Path to normalize.
|
23 |
-
*
|
24 |
-
* @return string Normalized path.
|
25 |
-
*/
|
26 |
-
function fs_normalize_path( $path ) {
|
27 |
-
return wp_normalize_path( $path );
|
28 |
-
}
|
29 |
-
} else {
|
30 |
-
function fs_normalize_path( $path ) {
|
31 |
-
$path = str_replace( '\\', '/', $path );
|
32 |
-
$path = preg_replace( '|/+|', '/', $path );
|
33 |
-
|
34 |
-
return $path;
|
35 |
-
}
|
36 |
-
}
|
37 |
-
}
|
38 |
-
|
39 |
-
#region Core Redirect (copied from BuddyPress) -----------------------------------------
|
40 |
-
|
41 |
-
if ( ! function_exists( 'fs_redirect' ) ) {
|
42 |
-
/**
|
43 |
-
* Redirects to another page, with a workaround for the IIS Set-Cookie bug.
|
44 |
-
*
|
45 |
-
* @link http://support.microsoft.com/kb/q176113/
|
46 |
-
* @since 1.5.1
|
47 |
-
* @uses apply_filters() Calls 'wp_redirect' hook on $location and $status.
|
48 |
-
*
|
49 |
-
* @param string $location The path to redirect to.
|
50 |
-
* @param bool $exit If true, exit after redirect (Since 1.2.1.5).
|
51 |
-
* @param int $status Status code to use.
|
52 |
-
*
|
53 |
-
* @return bool False if $location is not set
|
54 |
-
*/
|
55 |
-
function fs_redirect( $location, $exit = true, $status = 302 ) {
|
56 |
-
global $is_IIS;
|
57 |
-
|
58 |
-
$file = '';
|
59 |
-
$line = '';
|
60 |
-
if ( headers_sent($file, $line) ) {
|
61 |
-
if ( WP_FS__DEBUG_SDK && class_exists( 'FS_Admin_Notice_Manager' ) ) {
|
62 |
-
$notices = FS_Admin_Notice_Manager::instance( 'global' );
|
63 |
-
|
64 |
-
$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' );
|
65 |
-
}
|
66 |
-
|
67 |
-
return false;
|
68 |
-
}
|
69 |
-
|
70 |
-
if ( defined( 'DOING_AJAX' ) ) {
|
71 |
-
// Don't redirect on AJAX calls.
|
72 |
-
return false;
|
73 |
-
}
|
74 |
-
|
75 |
-
if ( ! $location ) // allows the wp_redirect filter to cancel a redirect
|
76 |
-
{
|
77 |
-
return false;
|
78 |
-
}
|
79 |
-
|
80 |
-
$location = fs_sanitize_redirect( $location );
|
81 |
-
|
82 |
-
if ( $is_IIS ) {
|
83 |
-
header( "Refresh: 0;url=$location" );
|
84 |
-
} else {
|
85 |
-
if ( php_sapi_name() != 'cgi-fcgi' ) {
|
86 |
-
status_header( $status );
|
87 |
-
} // This causes problems on IIS and some FastCGI setups
|
88 |
-
header( "Location: $location" );
|
89 |
-
}
|
90 |
-
|
91 |
-
if ( $exit ) {
|
92 |
-
exit();
|
93 |
-
}
|
94 |
-
|
95 |
-
return true;
|
96 |
-
}
|
97 |
-
|
98 |
-
if ( ! function_exists( 'fs_sanitize_redirect' ) ) {
|
99 |
-
/**
|
100 |
-
* Sanitizes a URL for use in a redirect.
|
101 |
-
*
|
102 |
-
* @since 2.3
|
103 |
-
*
|
104 |
-
* @param string $location
|
105 |
-
*
|
106 |
-
* @return string redirect-sanitized URL
|
107 |
-
*/
|
108 |
-
function fs_sanitize_redirect( $location ) {
|
109 |
-
$location = preg_replace( '|[^a-z0-9-~+_.?#=&;,/:%!]|i', '', $location );
|
110 |
-
$location = fs_kses_no_null( $location );
|
111 |
-
|
112 |
-
// remove %0d and %0a from location
|
113 |
-
$strip = array( '%0d', '%0a' );
|
114 |
-
$found = true;
|
115 |
-
while ( $found ) {
|
116 |
-
$found = false;
|
117 |
-
foreach ( (array) $strip as $val ) {
|
118 |
-
while ( strpos( $location, $val ) !== false ) {
|
119 |
-
$found = true;
|
120 |
-
$location = str_replace( $val, '', $location );
|
121 |
-
}
|
122 |
-
}
|
123 |
-
}
|
124 |
-
|
125 |
-
return $location;
|
126 |
-
}
|
127 |
-
}
|
128 |
-
|
129 |
-
if ( ! function_exists( 'fs_kses_no_null' ) ) {
|
130 |
-
/**
|
131 |
-
* Removes any NULL characters in $string.
|
132 |
-
*
|
133 |
-
* @since 1.0.0
|
134 |
-
*
|
135 |
-
* @param string $string
|
136 |
-
*
|
137 |
-
* @return string
|
138 |
-
*/
|
139 |
-
function fs_kses_no_null( $string ) {
|
140 |
-
$string = preg_replace( '/\0+/', '', $string );
|
141 |
-
$string = preg_replace( '/(\\\\0)+/', '', $string );
|
142 |
-
|
143 |
-
return $string;
|
144 |
-
}
|
145 |
-
}
|
146 |
-
}
|
147 |
-
|
148 |
-
#endregion Core Redirect (copied from BuddyPress) -----------------------------------------
|
149 |
-
|
150 |
-
if ( ! function_exists( '__fs' ) ) {
|
151 |
-
global $fs_text_overrides;
|
152 |
-
|
153 |
-
if ( ! isset( $fs_text_overrides ) ) {
|
154 |
-
$fs_text_overrides = array();
|
155 |
-
}
|
156 |
-
|
157 |
-
/**
|
158 |
-
* Retrieve a translated text by key.
|
159 |
-
*
|
160 |
-
* @deprecated Use `fs_text()` instead since methods starting with `__` trigger warnings in Php 7.
|
161 |
-
|
162 |
-
*
|
163 |
-
* @
|
164 |
-
*
|
165 |
-
*
|
166 |
-
* @param string $
|
167 |
-
*
|
168 |
-
*
|
169 |
-
*
|
170 |
-
*
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
$
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
*
|
210 |
-
*
|
211 |
-
*
|
212 |
-
*
|
213 |
-
|
214 |
-
|
215 |
-
* @
|
216 |
-
* @
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
*
|
229 |
-
*
|
230 |
-
* @
|
231 |
-
* @
|
232 |
-
*
|
233 |
-
* @
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
*
|
254 |
-
*
|
255 |
-
* @
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
'
|
263 |
-
'
|
264 |
-
'
|
265 |
-
'
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
*
|
283 |
-
*
|
284 |
-
* @
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
*
|
335 |
-
*
|
336 |
-
* @
|
337 |
-
* @
|
338 |
-
*
|
339 |
-
* @
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
*
|
347 |
-
*
|
348 |
-
*
|
349 |
-
*
|
350 |
-
* `
|
351 |
-
*
|
352 |
-
*
|
353 |
-
*
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
$in_activation = (
|
369 |
-
}
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
'
|
376 |
-
'
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
*
|
388 |
-
*
|
389 |
-
* @
|
390 |
-
*
|
391 |
-
*
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
$
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
*
|
422 |
-
*
|
423 |
-
*
|
424 |
-
* @
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
$is_module_active = ( $data->plugin_path
|
444 |
-
}
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
}
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
*
|
476 |
-
*
|
477 |
-
* @
|
478 |
-
* @
|
479 |
-
*
|
480 |
-
*
|
481 |
-
* @
|
482 |
-
*
|
483 |
-
*
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
|
|
|
|
|
|
494 |
#endregion Actions / Filters -----------------------------------------
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* IMPORTANT:
|
4 |
+
* This file will be loaded based on the order of the plugins/themes load.
|
5 |
+
* If there's a theme and a plugin using Freemius, the plugin's essential
|
6 |
+
* file will always load first.
|
7 |
+
*
|
8 |
+
* @package Freemius
|
9 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
10 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
11 |
+
* @since 1.1.5
|
12 |
+
*/
|
13 |
+
|
14 |
+
if ( ! function_exists( 'fs_normalize_path' ) ) {
|
15 |
+
if ( function_exists( 'wp_normalize_path' ) ) {
|
16 |
+
/**
|
17 |
+
* Normalize a filesystem path.
|
18 |
+
*
|
19 |
+
* Replaces backslashes with forward slashes for Windows systems, and ensures
|
20 |
+
* no duplicate slashes exist.
|
21 |
+
*
|
22 |
+
* @param string $path Path to normalize.
|
23 |
+
*
|
24 |
+
* @return string Normalized path.
|
25 |
+
*/
|
26 |
+
function fs_normalize_path( $path ) {
|
27 |
+
return wp_normalize_path( $path );
|
28 |
+
}
|
29 |
+
} else {
|
30 |
+
function fs_normalize_path( $path ) {
|
31 |
+
$path = str_replace( '\\', '/', $path );
|
32 |
+
$path = preg_replace( '|/+|', '/', $path );
|
33 |
+
|
34 |
+
return $path;
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
#region Core Redirect (copied from BuddyPress) -----------------------------------------
|
40 |
+
|
41 |
+
if ( ! function_exists( 'fs_redirect' ) ) {
|
42 |
+
/**
|
43 |
+
* Redirects to another page, with a workaround for the IIS Set-Cookie bug.
|
44 |
+
*
|
45 |
+
* @link http://support.microsoft.com/kb/q176113/
|
46 |
+
* @since 1.5.1
|
47 |
+
* @uses apply_filters() Calls 'wp_redirect' hook on $location and $status.
|
48 |
+
*
|
49 |
+
* @param string $location The path to redirect to.
|
50 |
+
* @param bool $exit If true, exit after redirect (Since 1.2.1.5).
|
51 |
+
* @param int $status Status code to use.
|
52 |
+
*
|
53 |
+
* @return bool False if $location is not set
|
54 |
+
*/
|
55 |
+
function fs_redirect( $location, $exit = true, $status = 302 ) {
|
56 |
+
global $is_IIS;
|
57 |
+
|
58 |
+
$file = '';
|
59 |
+
$line = '';
|
60 |
+
if ( headers_sent($file, $line) ) {
|
61 |
+
if ( WP_FS__DEBUG_SDK && class_exists( 'FS_Admin_Notice_Manager' ) ) {
|
62 |
+
$notices = FS_Admin_Notice_Manager::instance( 'global' );
|
63 |
+
|
64 |
+
$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' );
|
65 |
+
}
|
66 |
+
|
67 |
+
return false;
|
68 |
+
}
|
69 |
+
|
70 |
+
if ( defined( 'DOING_AJAX' ) ) {
|
71 |
+
// Don't redirect on AJAX calls.
|
72 |
+
return false;
|
73 |
+
}
|
74 |
+
|
75 |
+
if ( ! $location ) // allows the wp_redirect filter to cancel a redirect
|
76 |
+
{
|
77 |
+
return false;
|
78 |
+
}
|
79 |
+
|
80 |
+
$location = fs_sanitize_redirect( $location );
|
81 |
+
|
82 |
+
if ( $is_IIS ) {
|
83 |
+
header( "Refresh: 0;url=$location" );
|
84 |
+
} else {
|
85 |
+
if ( php_sapi_name() != 'cgi-fcgi' ) {
|
86 |
+
status_header( $status );
|
87 |
+
} // This causes problems on IIS and some FastCGI setups
|
88 |
+
header( "Location: $location" );
|
89 |
+
}
|
90 |
+
|
91 |
+
if ( $exit ) {
|
92 |
+
exit();
|
93 |
+
}
|
94 |
+
|
95 |
+
return true;
|
96 |
+
}
|
97 |
+
|
98 |
+
if ( ! function_exists( 'fs_sanitize_redirect' ) ) {
|
99 |
+
/**
|
100 |
+
* Sanitizes a URL for use in a redirect.
|
101 |
+
*
|
102 |
+
* @since 2.3
|
103 |
+
*
|
104 |
+
* @param string $location
|
105 |
+
*
|
106 |
+
* @return string redirect-sanitized URL
|
107 |
+
*/
|
108 |
+
function fs_sanitize_redirect( $location ) {
|
109 |
+
$location = preg_replace( '|[^a-z0-9-~+_.?#=&;,/:%!]|i', '', $location );
|
110 |
+
$location = fs_kses_no_null( $location );
|
111 |
+
|
112 |
+
// remove %0d and %0a from location
|
113 |
+
$strip = array( '%0d', '%0a' );
|
114 |
+
$found = true;
|
115 |
+
while ( $found ) {
|
116 |
+
$found = false;
|
117 |
+
foreach ( (array) $strip as $val ) {
|
118 |
+
while ( strpos( $location, $val ) !== false ) {
|
119 |
+
$found = true;
|
120 |
+
$location = str_replace( $val, '', $location );
|
121 |
+
}
|
122 |
+
}
|
123 |
+
}
|
124 |
+
|
125 |
+
return $location;
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
+
if ( ! function_exists( 'fs_kses_no_null' ) ) {
|
130 |
+
/**
|
131 |
+
* Removes any NULL characters in $string.
|
132 |
+
*
|
133 |
+
* @since 1.0.0
|
134 |
+
*
|
135 |
+
* @param string $string
|
136 |
+
*
|
137 |
+
* @return string
|
138 |
+
*/
|
139 |
+
function fs_kses_no_null( $string ) {
|
140 |
+
$string = preg_replace( '/\0+/', '', $string );
|
141 |
+
$string = preg_replace( '/(\\\\0)+/', '', $string );
|
142 |
+
|
143 |
+
return $string;
|
144 |
+
}
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
#endregion Core Redirect (copied from BuddyPress) -----------------------------------------
|
149 |
+
|
150 |
+
if ( ! function_exists( '__fs' ) ) {
|
151 |
+
global $fs_text_overrides;
|
152 |
+
|
153 |
+
if ( ! isset( $fs_text_overrides ) ) {
|
154 |
+
$fs_text_overrides = array();
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Retrieve a translated text by key.
|
159 |
+
*
|
160 |
+
* @deprecated Use `fs_text()` instead since methods starting with `__` trigger warnings in Php 7.
|
161 |
+
* @todo Remove this method in the future.
|
162 |
+
*
|
163 |
+
* @author Vova Feldman (@svovaf)
|
164 |
+
* @since 1.1.4
|
165 |
+
*
|
166 |
+
* @param string $key
|
167 |
+
* @param string $slug
|
168 |
+
*
|
169 |
+
* @return string
|
170 |
+
*
|
171 |
+
* @global $fs_text, $fs_text_overrides
|
172 |
+
*/
|
173 |
+
function __fs( $key, $slug = 'freemius' ) {
|
174 |
+
global $fs_text,
|
175 |
+
$fs_module_info_text,
|
176 |
+
$fs_text_overrides;
|
177 |
+
|
178 |
+
if ( isset( $fs_text_overrides[ $slug ] ) ) {
|
179 |
+
if ( isset( $fs_text_overrides[ $slug ][ $key ] ) ) {
|
180 |
+
return $fs_text_overrides[ $slug ][ $key ];
|
181 |
+
}
|
182 |
+
|
183 |
+
$lower_key = strtolower( $key );
|
184 |
+
if ( isset( $fs_text_overrides[ $slug ][ $lower_key ] ) ) {
|
185 |
+
return $fs_text_overrides[ $slug ][ $lower_key ];
|
186 |
+
}
|
187 |
+
}
|
188 |
+
|
189 |
+
if ( ! isset( $fs_text ) ) {
|
190 |
+
$dir = defined( 'WP_FS__DIR_INCLUDES' ) ?
|
191 |
+
WP_FS__DIR_INCLUDES :
|
192 |
+
dirname( __FILE__ );
|
193 |
+
|
194 |
+
require_once $dir . '/i18n.php';
|
195 |
+
}
|
196 |
+
|
197 |
+
if ( isset( $fs_text[ $key ] ) ) {
|
198 |
+
return $fs_text[ $key ];
|
199 |
+
}
|
200 |
+
|
201 |
+
if ( isset( $fs_module_info_text[ $key ] ) ) {
|
202 |
+
return $fs_module_info_text[ $key ];
|
203 |
+
}
|
204 |
+
|
205 |
+
return $key;
|
206 |
+
}
|
207 |
+
|
208 |
+
/**
|
209 |
+
* Output a translated text by key.
|
210 |
+
*
|
211 |
+
* @deprecated Use `fs_echo()` instead for consistency with `fs_text()`.
|
212 |
+
*
|
213 |
+
* @todo Remove this method in the future.
|
214 |
+
*
|
215 |
+
* @author Vova Feldman (@svovaf)
|
216 |
+
* @since 1.1.4
|
217 |
+
*
|
218 |
+
* @param string $key
|
219 |
+
* @param string $slug
|
220 |
+
*/
|
221 |
+
function _efs( $key, $slug = 'freemius' ) {
|
222 |
+
fs_echo( $key, $slug );
|
223 |
+
}
|
224 |
+
}
|
225 |
+
|
226 |
+
if ( ! function_exists( 'fs_override_i18n' ) ) {
|
227 |
+
/**
|
228 |
+
* Override default i18n text phrases.
|
229 |
+
*
|
230 |
+
* @author Vova Feldman (@svovaf)
|
231 |
+
* @since 1.1.6
|
232 |
+
*
|
233 |
+
* @param string[] $key_value
|
234 |
+
* @param string $slug
|
235 |
+
*
|
236 |
+
* @global $fs_text_overrides
|
237 |
+
*/
|
238 |
+
function fs_override_i18n( array $key_value, $slug = 'freemius' ) {
|
239 |
+
global $fs_text_overrides;
|
240 |
+
|
241 |
+
if ( ! isset( $fs_text_overrides[ $slug ] ) ) {
|
242 |
+
$fs_text_overrides[ $slug ] = array();
|
243 |
+
}
|
244 |
+
|
245 |
+
foreach ( $key_value as $key => $value ) {
|
246 |
+
$fs_text_overrides[ $slug ][ $key ] = $value;
|
247 |
+
}
|
248 |
+
}
|
249 |
+
}
|
250 |
+
|
251 |
+
if ( ! function_exists( 'fs_get_ip' ) ) {
|
252 |
+
/**
|
253 |
+
* Get client IP.
|
254 |
+
*
|
255 |
+
* @author Vova Feldman (@svovaf)
|
256 |
+
* @since 1.1.2
|
257 |
+
*
|
258 |
+
* @return string|null
|
259 |
+
*/
|
260 |
+
function fs_get_ip() {
|
261 |
+
$fields = array(
|
262 |
+
'HTTP_CF_CONNECTING_IP',
|
263 |
+
'HTTP_CLIENT_IP',
|
264 |
+
'HTTP_X_FORWARDED_FOR',
|
265 |
+
'HTTP_X_FORWARDED',
|
266 |
+
'HTTP_FORWARDED_FOR',
|
267 |
+
'HTTP_FORWARDED',
|
268 |
+
'REMOTE_ADDR',
|
269 |
+
);
|
270 |
+
|
271 |
+
foreach ( $fields as $ip_field ) {
|
272 |
+
if ( ! empty( $_SERVER[ $ip_field ] ) ) {
|
273 |
+
return $_SERVER[ $ip_field ];
|
274 |
+
}
|
275 |
+
}
|
276 |
+
|
277 |
+
return null;
|
278 |
+
}
|
279 |
+
}
|
280 |
+
|
281 |
+
/**
|
282 |
+
* Leverage backtrace to find caller plugin main file path.
|
283 |
+
*
|
284 |
+
* @author Vova Feldman (@svovaf)
|
285 |
+
* @since 1.0.6
|
286 |
+
*
|
287 |
+
* @return string
|
288 |
+
*/
|
289 |
+
function fs_find_caller_plugin_file() {
|
290 |
+
/**
|
291 |
+
* All the code below will be executed once on activation.
|
292 |
+
* If the user changes the main plugin's file name, the file_exists()
|
293 |
+
* will catch it.
|
294 |
+
*/
|
295 |
+
if ( ! function_exists( 'get_plugins' ) ) {
|
296 |
+
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
297 |
+
}
|
298 |
+
|
299 |
+
$all_plugins = get_plugins();
|
300 |
+
$all_plugins_paths = array();
|
301 |
+
|
302 |
+
// Get active plugin's main files real full names (might be symlinks).
|
303 |
+
foreach ( $all_plugins as $relative_path => &$data ) {
|
304 |
+
$all_plugins_paths[] = fs_normalize_path( realpath( WP_PLUGIN_DIR . '/' . $relative_path ) );
|
305 |
+
}
|
306 |
+
|
307 |
+
$plugin_file = null;
|
308 |
+
for ( $i = 1, $bt = debug_backtrace(), $len = count( $bt ); $i < $len; $i ++ ) {
|
309 |
+
if ( empty( $bt[ $i ]['file'] ) ) {
|
310 |
+
continue;
|
311 |
+
}
|
312 |
+
|
313 |
+
if ( in_array( fs_normalize_path( $bt[ $i ]['file'] ), $all_plugins_paths ) ) {
|
314 |
+
$plugin_file = $bt[ $i ]['file'];
|
315 |
+
break;
|
316 |
+
}
|
317 |
+
}
|
318 |
+
|
319 |
+
if ( is_null( $plugin_file ) ) {
|
320 |
+
// Throw an error to the developer in case of some edge case dev environment.
|
321 |
+
wp_die(
|
322 |
+
'Freemius SDK couldn\'t find the plugin\'s main file. Please contact sdk@freemius.com with the current error.',
|
323 |
+
'Error',
|
324 |
+
array( 'back_link' => true )
|
325 |
+
);
|
326 |
+
}
|
327 |
+
|
328 |
+
return $plugin_file;
|
329 |
+
}
|
330 |
+
|
331 |
+
require_once dirname( __FILE__ ) . '/supplements/fs-essential-functions-1.1.7.1.php';
|
332 |
+
|
333 |
+
/**
|
334 |
+
* Update SDK newest version reference.
|
335 |
+
*
|
336 |
+
* @author Vova Feldman (@svovaf)
|
337 |
+
* @since 1.1.6
|
338 |
+
*
|
339 |
+
* @param string $sdk_relative_path
|
340 |
+
* @param string|bool $plugin_file
|
341 |
+
*
|
342 |
+
* @global $fs_active_plugins
|
343 |
+
*/
|
344 |
+
function fs_update_sdk_newest_version( $sdk_relative_path, $plugin_file = false ) {
|
345 |
+
/**
|
346 |
+
* If there is a plugin running an older version of FS (1.2.1 or below), the `fs_update_sdk_newest_version()`
|
347 |
+
* function in the older version will be used instead of this one. But since the older version is using
|
348 |
+
* the `is_plugin_active` function to check if a plugin is active, passing the theme's `plugin_path` to the
|
349 |
+
* `is_plugin_active` function will return false since the path is not a plugin path, so `in_activation` will be
|
350 |
+
* `true` for theme modules and the upgrading of the SDK version to 1.2.2 or newer version will work fine.
|
351 |
+
*
|
352 |
+
* Future versions that will call this function will use the proper logic here instead of just relying on the
|
353 |
+
* `is_plugin_active` function to fail for themes.
|
354 |
+
*
|
355 |
+
* @author Leo Fajardo (@leorw)
|
356 |
+
* @since 1.2.2
|
357 |
+
*/
|
358 |
+
|
359 |
+
global $fs_active_plugins;
|
360 |
+
|
361 |
+
$newest_sdk = $fs_active_plugins->plugins[ $sdk_relative_path ];
|
362 |
+
|
363 |
+
if ( ! is_string( $plugin_file ) ) {
|
364 |
+
$plugin_file = plugin_basename( fs_find_caller_plugin_file() );
|
365 |
+
}
|
366 |
+
|
367 |
+
if ( ! isset( $newest_sdk->type ) || 'theme' !== $newest_sdk->type ) {
|
368 |
+
$in_activation = ( ! is_plugin_active( $plugin_file ) );
|
369 |
+
} else {
|
370 |
+
$theme = wp_get_theme();
|
371 |
+
$in_activation = ( $newest_sdk->plugin_path == $theme->stylesheet );
|
372 |
+
}
|
373 |
+
|
374 |
+
$fs_active_plugins->newest = (object) array(
|
375 |
+
'plugin_path' => $plugin_file,
|
376 |
+
'sdk_path' => $sdk_relative_path,
|
377 |
+
'version' => $newest_sdk->version,
|
378 |
+
'in_activation' => $in_activation,
|
379 |
+
'timestamp' => time(),
|
380 |
+
);
|
381 |
+
|
382 |
+
// Update DB with latest SDK version and path.
|
383 |
+
update_option( 'fs_active_plugins', $fs_active_plugins );
|
384 |
+
}
|
385 |
+
|
386 |
+
/**
|
387 |
+
* Reorder the plugins load order so the plugin with the newest Freemius SDK is loaded first.
|
388 |
+
*
|
389 |
+
* @author Vova Feldman (@svovaf)
|
390 |
+
* @since 1.1.6
|
391 |
+
*
|
392 |
+
* @return bool Was plugin order changed. Return false if plugin was loaded first anyways.
|
393 |
+
*
|
394 |
+
* @global $fs_active_plugins
|
395 |
+
*/
|
396 |
+
function fs_newest_sdk_plugin_first() {
|
397 |
+
global $fs_active_plugins;
|
398 |
+
|
399 |
+
/**
|
400 |
+
* @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).
|
401 |
+
*
|
402 |
+
* @link https://github.com/Freemius/wordpress-sdk/issues/26
|
403 |
+
*/
|
404 |
+
// $active_sitewide_plugins = get_site_option( 'active_sitewide_plugins' );
|
405 |
+
|
406 |
+
$active_plugins = get_option( 'active_plugins' );
|
407 |
+
$newest_sdk_plugin_key = array_search( $fs_active_plugins->newest->plugin_path, $active_plugins );
|
408 |
+
if ( 0 == $newest_sdk_plugin_key ) {
|
409 |
+
// if it's 0 it's the first plugin already, no need to continue
|
410 |
+
return false;
|
411 |
+
}
|
412 |
+
|
413 |
+
array_splice( $active_plugins, $newest_sdk_plugin_key, 1 );
|
414 |
+
array_unshift( $active_plugins, $fs_active_plugins->newest->plugin_path );
|
415 |
+
update_option( 'active_plugins', $active_plugins );
|
416 |
+
|
417 |
+
return true;
|
418 |
+
}
|
419 |
+
|
420 |
+
/**
|
421 |
+
* Go over all Freemius SDKs in the system and find and "remember"
|
422 |
+
* the newest SDK which is associated with an active plugin.
|
423 |
+
*
|
424 |
+
* @author Vova Feldman (@svovaf)
|
425 |
+
* @since 1.1.6
|
426 |
+
*
|
427 |
+
* @global $fs_active_plugins
|
428 |
+
*/
|
429 |
+
function fs_fallback_to_newest_active_sdk() {
|
430 |
+
global $fs_active_plugins;
|
431 |
+
|
432 |
+
/**
|
433 |
+
* @var object $newest_sdk_data
|
434 |
+
*/
|
435 |
+
$newest_sdk_data = null;
|
436 |
+
$newest_sdk_path = null;
|
437 |
+
|
438 |
+
foreach ( $fs_active_plugins->plugins as $sdk_relative_path => $data ) {
|
439 |
+
if ( is_null( $newest_sdk_data ) || version_compare( $data->version, $newest_sdk_data->version, '>' )
|
440 |
+
) {
|
441 |
+
// If plugin inactive or SDK starter file doesn't exist, remove SDK reference.
|
442 |
+
if ( 'plugin' === $data->type ) {
|
443 |
+
$is_module_active = is_plugin_active( $data->plugin_path );
|
444 |
+
} else {
|
445 |
+
$active_theme = wp_get_theme();
|
446 |
+
$is_module_active = ( $data->plugin_path === $active_theme->get_template() );
|
447 |
+
}
|
448 |
+
|
449 |
+
$is_sdk_exists = file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $sdk_relative_path . '/start.php' ) );
|
450 |
+
|
451 |
+
if ( ! $is_module_active || ! $is_sdk_exists ) {
|
452 |
+
unset( $fs_active_plugins->plugins[ $sdk_relative_path ] );
|
453 |
+
|
454 |
+
// No need to store the data since it will be stored in fs_update_sdk_newest_version()
|
455 |
+
// or explicitly with update_option().
|
456 |
+
} else {
|
457 |
+
$newest_sdk_data = $data;
|
458 |
+
$newest_sdk_path = $sdk_relative_path;
|
459 |
+
}
|
460 |
+
}
|
461 |
+
}
|
462 |
+
|
463 |
+
if ( is_null( $newest_sdk_data ) ) {
|
464 |
+
// Couldn't find any SDK reference.
|
465 |
+
$fs_active_plugins = new stdClass();
|
466 |
+
update_option( 'fs_active_plugins', $fs_active_plugins );
|
467 |
+
} else {
|
468 |
+
fs_update_sdk_newest_version( $newest_sdk_path, $newest_sdk_data->plugin_path );
|
469 |
+
}
|
470 |
+
}
|
471 |
+
|
472 |
+
#region Actions / Filters -----------------------------------------
|
473 |
+
|
474 |
+
/**
|
475 |
+
* Apply filter for specific plugin.
|
476 |
+
*
|
477 |
+
* @author Vova Feldman (@svovaf)
|
478 |
+
* @since 1.0.9
|
479 |
+
*
|
480 |
+
* @param string $module_unique_affix Module's unique affix.
|
481 |
+
* @param string $tag The name of the filter hook.
|
482 |
+
* @param mixed $value The value on which the filters hooked to `$tag` are applied on.
|
483 |
+
*
|
484 |
+
* @return mixed The filtered value after all hooked functions are applied to it.
|
485 |
+
*
|
486 |
+
* @uses apply_filters()
|
487 |
+
*/
|
488 |
+
function fs_apply_filter( $module_unique_affix, $tag, $value ) {
|
489 |
+
$args = func_get_args();
|
490 |
+
|
491 |
+
return call_user_func_array( 'apply_filters', array_merge(
|
492 |
+
array( "fs_{$tag}_{$module_unique_affix}" ),
|
493 |
+
array_slice( $args, 2 ) )
|
494 |
+
);
|
495 |
+
}
|
496 |
+
|
497 |
#endregion Actions / Filters -----------------------------------------
|
freemius/includes/fs-plugin-info-dialog.php
CHANGED
@@ -325,8 +325,12 @@
|
|
325 |
$plan->has_trial()
|
326 |
) . '" target="_parent">' .
|
327 |
( ! $plan->has_trial() ?
|
328 |
-
|
329 |
-
sprintf(
|
|
|
|
|
|
|
|
|
330 |
) .
|
331 |
'</a>';
|
332 |
|
@@ -348,23 +352,23 @@
|
|
348 |
* plugin is wordpress.org compliant. Therefore, require a download
|
349 |
* since installing external plugins is not allowed by the wp.org guidelines.
|
350 |
*/
|
351 |
-
return ' <a class="button button-primary right" href="' . esc_url( $api->download_link ) . '" target="_blank">' .
|
352 |
} else {
|
353 |
if ( $status['url'] ) {
|
354 |
-
return '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' .
|
355 |
}
|
356 |
}
|
357 |
break;
|
358 |
case 'update_available':
|
359 |
if ( $status['url'] ) {
|
360 |
-
return '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' .
|
361 |
}
|
362 |
break;
|
363 |
case 'newer_installed':
|
364 |
-
return '<a class="button button-primary right disabled">' . sprintf(
|
365 |
break;
|
366 |
case 'latest_installed':
|
367 |
-
return '<a class="button button-primary right disabled">' .
|
368 |
break;
|
369 |
}
|
370 |
|
@@ -477,13 +481,13 @@
|
|
477 |
);
|
478 |
|
479 |
$plugins_section_titles = array(
|
480 |
-
'description' =>
|
481 |
-
'installation' =>
|
482 |
-
'faq' =>
|
483 |
-
'screenshots' =>
|
484 |
-
'changelog' =>
|
485 |
-
'reviews' =>
|
486 |
-
'other_notes' =>
|
487 |
);
|
488 |
|
489 |
// Sanitize HTML
|
@@ -498,7 +502,7 @@
|
|
498 |
}
|
499 |
|
500 |
// Add after $api->slug is ready.
|
501 |
-
$plugins_section_titles['features'] =
|
502 |
|
503 |
$_tab = esc_attr( $tab );
|
504 |
|
@@ -508,7 +512,7 @@
|
|
508 |
$section = array_shift( $section_titles );
|
509 |
}
|
510 |
|
511 |
-
iframe_header(
|
512 |
|
513 |
$_with_banner = '';
|
514 |
|
@@ -580,7 +584,7 @@
|
|
580 |
<div class="fs-plan<?php if ( ! $is_multi_cycle ) {
|
581 |
echo ' fs-single-cycle';
|
582 |
} ?>" data-plan-id="<?php echo $plan->id ?>">
|
583 |
-
<h3 data-plan="<?php echo $plan->id ?>"><?php
|
584 |
<?php $has_annual = $first_pricing->has_annual() ?>
|
585 |
<?php $has_monthly = $first_pricing->has_monthly() ?>
|
586 |
<div class="nav-tab-wrapper">
|
@@ -605,9 +609,22 @@
|
|
605 |
<a class="nav-tab" data-billing-cycle="<?php echo $cycle ?>"
|
606 |
data-pricing="<?php echo esc_attr( json_encode( $prices ) ) ?>">
|
607 |
<?php if ( $is_featured ) : ?>
|
608 |
-
<label>★ <?php
|
609 |
<?php endif ?>
|
610 |
-
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
611 |
</a>
|
612 |
<?php endif ?>
|
613 |
<?php $i ++; endforeach ?>
|
@@ -618,21 +635,21 @@
|
|
618 |
_formatBillingFrequency = function (cycle) {
|
619 |
switch (cycle) {
|
620 |
case 'monthly':
|
621 |
-
return '<?php printf(
|
622 |
case 'annual':
|
623 |
-
return '<?php printf(
|
624 |
case 'lifetime':
|
625 |
-
return '<?php printf(
|
626 |
}
|
627 |
},
|
628 |
_formatLicensesTitle = function (pricing) {
|
629 |
switch (pricing.licenses) {
|
630 |
case 1:
|
631 |
-
return '<?php
|
632 |
case null:
|
633 |
-
return '<?php
|
634 |
default:
|
635 |
-
return '<?php
|
636 |
}
|
637 |
},
|
638 |
_formatPrice = function (pricing, cycle, multipleLicenses) {
|
@@ -642,14 +659,14 @@
|
|
642 |
var priceCycle;
|
643 |
switch (cycle) {
|
644 |
case 'monthly':
|
645 |
-
priceCycle = ' / <?php
|
646 |
break;
|
647 |
case 'lifetime':
|
648 |
priceCycle = '';
|
649 |
break;
|
650 |
case 'annual':
|
651 |
default:
|
652 |
-
priceCycle = ' / <?php
|
653 |
break;
|
654 |
}
|
655 |
|
@@ -701,7 +718,7 @@
|
|
701 |
|
702 |
// Render licenses prices.
|
703 |
if (1 == pricing.length) {
|
704 |
-
html = '<li><label><?php
|
705 |
} else {
|
706 |
for (var i = 0; i < pricing.length; i++) {
|
707 |
html += '<li><label><input name="pricing-<?php echo $plan->id ?>" type="radio" value="' + pricing[i].id + '">' + _formatPrice(pricing[i], billingCycle) + '</label></li>';
|
@@ -747,7 +764,7 @@
|
|
747 |
<?php $annual_discount = ( $has_annual && $has_monthly ) ? $plan->pricing[0]->annual_discount_percentage() : 0 ?>
|
748 |
<?php if ( $annual_discount > 0 ) : ?>
|
749 |
<span
|
750 |
-
class="fs-annual-discount"><?php printf(
|
751 |
<?php endif ?>
|
752 |
<ul class="fs-licenses">
|
753 |
</ul>
|
@@ -757,10 +774,10 @@
|
|
757 |
<?php $trial_period = $this->get_trial_period( $plan ) ?>
|
758 |
<ul class="fs-trial-terms">
|
759 |
<li>
|
760 |
-
<i class="dashicons dashicons-yes"></i><?php
|
761 |
</li>
|
762 |
<li>
|
763 |
-
<i class="dashicons dashicons-yes"></i><?php printf(
|
764 |
</li>
|
765 |
</ul>
|
766 |
<?php endif ?>
|
@@ -771,85 +788,99 @@
|
|
771 |
<?php endif ?>
|
772 |
<?php endif ?>
|
773 |
<div>
|
774 |
-
<h3><?php
|
775 |
<ul>
|
776 |
<?php if ( ! empty( $api->version ) ) { ?>
|
777 |
-
<li><strong><?php
|
778 |
<?php
|
779 |
}
|
780 |
if ( ! empty( $api->author ) ) {
|
781 |
?>
|
782 |
<li>
|
783 |
-
<strong><?php
|
784 |
</li>
|
785 |
<?php
|
786 |
}
|
787 |
if ( ! empty( $api->last_updated ) ) {
|
788 |
?>
|
789 |
-
<li><strong><?php
|
790 |
title="<?php echo $api->last_updated; ?>">
|
791 |
-
<?php
|
|
|
|
|
|
|
|
|
792 |
</span></li>
|
793 |
<?php
|
794 |
}
|
795 |
if ( ! empty( $api->requires ) ) {
|
796 |
?>
|
797 |
<li>
|
798 |
-
<strong><?php
|
799 |
</li>
|
800 |
<?php
|
801 |
}
|
802 |
if ( ! empty( $api->tested ) ) {
|
803 |
?>
|
804 |
-
<li><strong><?php
|
805 |
</li>
|
806 |
<?php
|
807 |
}
|
808 |
if ( ! empty( $api->downloaded ) ) {
|
809 |
?>
|
810 |
<li>
|
811 |
-
<strong><?php
|
812 |
-
|
|
|
|
|
|
|
|
|
|
|
813 |
number_format_i18n( $api->downloaded )
|
814 |
-
); ?>
|
815 |
</li>
|
816 |
<?php
|
817 |
}
|
818 |
if ( ! empty( $api->slug ) && empty( $api->external ) ) {
|
819 |
?>
|
820 |
<li><a target="_blank"
|
821 |
-
href="https://wordpress.org/plugins/<?php echo $api->slug; ?>/"><?php
|
822 |
</li>
|
823 |
<?php
|
824 |
}
|
825 |
if ( ! empty( $api->homepage ) ) {
|
826 |
?>
|
827 |
<li><a target="_blank"
|
828 |
-
href="<?php echo esc_url( $api->homepage ); ?>"><?php
|
829 |
</li>
|
830 |
<?php
|
831 |
}
|
832 |
if ( ! empty( $api->donate_link ) && empty( $api->contributors ) ) {
|
833 |
?>
|
834 |
<li><a target="_blank"
|
835 |
-
href="<?php echo esc_url( $api->donate_link ); ?>"><?php
|
836 |
</li>
|
837 |
<?php } ?>
|
838 |
</ul>
|
839 |
</div>
|
840 |
<?php if ( ! empty( $api->rating ) ) { ?>
|
841 |
-
<h3><?php
|
842 |
<?php wp_star_rating( array(
|
843 |
'rating' => $api->rating,
|
844 |
'type' => 'percent',
|
845 |
'number' => $api->num_ratings
|
846 |
) ); ?>
|
847 |
-
<small>(<?php
|
848 |
-
|
849 |
sprintf(
|
850 |
-
|
|
|
|
|
|
|
|
|
|
|
851 |
number_format_i18n( $api->num_ratings )
|
852 |
-
) )
|
853 |
<?php
|
854 |
}
|
855 |
|
@@ -858,7 +889,12 @@
|
|
858 |
// Avoid div-by-zero.
|
859 |
$_rating = $api->num_ratings ? ( $ratecount / $api->num_ratings ) : 0;
|
860 |
$stars_label = sprintf(
|
861 |
-
|
|
|
|
|
|
|
|
|
|
|
862 |
number_format_i18n( $key )
|
863 |
);
|
864 |
?>
|
@@ -866,7 +902,11 @@
|
|
866 |
<span class="counter-label"><a
|
867 |
href="https://wordpress.org/support/view/plugin-reviews/<?php echo $api->slug; ?>?filter=<?php echo $key; ?>"
|
868 |
target="_blank"
|
869 |
-
title="<?php echo esc_attr( sprintf(
|
|
|
|
|
|
|
|
|
870 |
<span class="counter-back">
|
871 |
<span class="counter-bar" style="width: <?php echo 92 * $_rating; ?>px;"></span>
|
872 |
</span>
|
@@ -877,7 +917,7 @@
|
|
877 |
}
|
878 |
if ( ! empty( $api->contributors ) ) {
|
879 |
?>
|
880 |
-
<h3><?php
|
881 |
<ul class="contributors">
|
882 |
<?php
|
883 |
foreach ( (array) $api->contributors as $contrib_username => $contrib_profile ) {
|
@@ -898,16 +938,16 @@
|
|
898 |
</ul>
|
899 |
<?php if ( ! empty( $api->donate_link ) ) { ?>
|
900 |
<a target="_blank"
|
901 |
-
href="<?php echo esc_url( $api->donate_link ); ?>"><?php
|
902 |
<?php } ?>
|
903 |
<?php } ?>
|
904 |
</div>
|
905 |
<div id="section-holder" class="wrap">
|
906 |
<?php
|
907 |
if ( ! empty( $api->tested ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->tested ) ), $api->tested, '>' ) ) {
|
908 |
-
echo '<div class="notice notice-warning"><p>' . '<strong>' .
|
909 |
} else if ( ! empty( $api->requires ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->requires ) ), $api->requires, '<' ) ) {
|
910 |
-
echo '<div class="notice notice-warning"><p>' . '<strong>' .
|
911 |
}
|
912 |
|
913 |
foreach ( (array) $api->sections as $section_name => $content ) {
|
@@ -925,7 +965,9 @@
|
|
925 |
$missing_notice = array(
|
926 |
'type' => 'error',
|
927 |
'id' => md5( microtime() ),
|
928 |
-
'message' =>
|
|
|
|
|
929 |
);
|
930 |
fs_require_template( 'admin-notice.php', $missing_notice );
|
931 |
}
|
325 |
$plan->has_trial()
|
326 |
) . '" target="_parent">' .
|
327 |
( ! $plan->has_trial() ?
|
328 |
+
fs_text_x_inline( 'Purchase', 'verb', 'purchase', $api->slug ) :
|
329 |
+
sprintf(
|
330 |
+
/* translators: %s: N-days trial */
|
331 |
+
fs_text_inline( 'Start my free %s', 'start-free-x', $api->slug ),
|
332 |
+
$this->get_trial_period( $plan )
|
333 |
+
)
|
334 |
) .
|
335 |
'</a>';
|
336 |
|
352 |
* plugin is wordpress.org compliant. Therefore, require a download
|
353 |
* since installing external plugins is not allowed by the wp.org guidelines.
|
354 |
*/
|
355 |
+
return ' <a class="button button-primary right" href="' . esc_url( $api->download_link ) . '" target="_blank">' . fs_esc_html_x_inline( 'Download Latest', 'as download latest version', 'download-latest', $api->slug ) . '</a>';
|
356 |
} else {
|
357 |
if ( $status['url'] ) {
|
358 |
+
return '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . fs_esc_html_inline( 'Install Now', 'install-now', $api->slug ) . '</a>';
|
359 |
}
|
360 |
}
|
361 |
break;
|
362 |
case 'update_available':
|
363 |
if ( $status['url'] ) {
|
364 |
+
return '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . fs_text_inline( 'Install Update Now', 'install-update-now', $api->slug ) . '</a>';
|
365 |
}
|
366 |
break;
|
367 |
case 'newer_installed':
|
368 |
+
return '<a class="button button-primary right disabled">' . sprintf( fs_text_inline( 'Newer Version (%s) Installed', 'newer-installed', $api->slug ), $status['version'] ) . '</a>';
|
369 |
break;
|
370 |
case 'latest_installed':
|
371 |
+
return '<a class="button button-primary right disabled">' . fs_text_inline( 'Latest Version Installed', 'latest-installed', $api->slug ) . '</a>';
|
372 |
break;
|
373 |
}
|
374 |
|
481 |
);
|
482 |
|
483 |
$plugins_section_titles = array(
|
484 |
+
'description' => fs_text_x_inline( 'Description', 'Plugin installer section title', 'description', $api->slug ),
|
485 |
+
'installation' => fs_text_x_inline( 'Installation', 'Plugin installer section title', 'installation', $api->slug ),
|
486 |
+
'faq' => fs_text_x_inline( 'FAQ', 'Plugin installer section title', 'faq', $api->slug ),
|
487 |
+
'screenshots' => fs_text_inline( 'Screenshots', 'screenshots', $api->slug ),
|
488 |
+
'changelog' => fs_text_x_inline( 'Changelog', 'Plugin installer section title', 'changelog', $api->slug ),
|
489 |
+
'reviews' => fs_text_x_inline( 'Reviews', 'Plugin installer section title', 'reviews', $api->slug ),
|
490 |
+
'other_notes' => fs_text_x_inline( 'Other Notes', 'Plugin installer section title', 'other-notes', $api->slug ),
|
491 |
);
|
492 |
|
493 |
// Sanitize HTML
|
502 |
}
|
503 |
|
504 |
// Add after $api->slug is ready.
|
505 |
+
$plugins_section_titles['features'] = fs_text_x_inline( 'Features & Pricing', 'Plugin installer section title', 'features-and-pricing', $api->slug );
|
506 |
|
507 |
$_tab = esc_attr( $tab );
|
508 |
|
512 |
$section = array_shift( $section_titles );
|
513 |
}
|
514 |
|
515 |
+
iframe_header( fs_text_inline( 'Plugin Install', 'plugin-install', $api->slug ) );
|
516 |
|
517 |
$_with_banner = '';
|
518 |
|
584 |
<div class="fs-plan<?php if ( ! $is_multi_cycle ) {
|
585 |
echo ' fs-single-cycle';
|
586 |
} ?>" data-plan-id="<?php echo $plan->id ?>">
|
587 |
+
<h3 data-plan="<?php echo $plan->id ?>"><?php echo esc_html( sprintf( fs_text_x_inline( '%s Plan', 'e.g. Professional Plan', 'x-plan', $api->slug ), $plan->title ) ) ?></h3>
|
588 |
<?php $has_annual = $first_pricing->has_annual() ?>
|
589 |
<?php $has_monthly = $first_pricing->has_monthly() ?>
|
590 |
<div class="nav-tab-wrapper">
|
609 |
<a class="nav-tab" data-billing-cycle="<?php echo $cycle ?>"
|
610 |
data-pricing="<?php echo esc_attr( json_encode( $prices ) ) ?>">
|
611 |
<?php if ( $is_featured ) : ?>
|
612 |
+
<label>★ <?php fs_esc_html_echo_x_inline( 'Best', 'e.g. the best product', 'best', $api->slug ) ?> ★</label>
|
613 |
<?php endif ?>
|
614 |
+
<?php
|
615 |
+
switch ($cycle)
|
616 |
+
{
|
617 |
+
case 'monthly':
|
618 |
+
fs_esc_html_echo_x_inline( 'Monthly', 'as every month', 'monthly', $api->slug );
|
619 |
+
break;
|
620 |
+
case 'annual':
|
621 |
+
fs_esc_html_echo_x_inline( 'Annual', 'as once a year', 'annual', $api->slug );
|
622 |
+
break;
|
623 |
+
case 'lifetime':
|
624 |
+
fs_esc_html_echo_inline( 'Lifetime', 'lifetime', $api->slug );
|
625 |
+
break;
|
626 |
+
}
|
627 |
+
?>
|
628 |
</a>
|
629 |
<?php endif ?>
|
630 |
<?php $i ++; endforeach ?>
|
635 |
_formatBillingFrequency = function (cycle) {
|
636 |
switch (cycle) {
|
637 |
case 'monthly':
|
638 |
+
return '<?php printf( fs_text_x_inline( 'Billed %s', 'e.g. billed monthly', 'billed-x', $api->slug), fs_text_x_inline( 'Monthly', 'as every month', 'monthly', $api->slug ) ) ?>';
|
639 |
case 'annual':
|
640 |
+
return '<?php printf( fs_text_x_inline( 'Billed %s', 'e.g. billed monthly', 'billed-x', $api->slug), fs_text_x_inline( 'Annually', 'as once a year', 'annually', $api->slug ) ) ?>';
|
641 |
case 'lifetime':
|
642 |
+
return '<?php printf( fs_text_x_inline( 'Billed %s', 'e.g. billed monthly', 'billed-x', $api->slug), fs_text_x_inline( 'Once', 'as once a year', 'once', $api->slug ) ) ?>';
|
643 |
}
|
644 |
},
|
645 |
_formatLicensesTitle = function (pricing) {
|
646 |
switch (pricing.licenses) {
|
647 |
case 1:
|
648 |
+
return '<?php fs_esc_attr_echo_inline( 'Single Site License', 'license-single-site', $api->slug ) ?>';
|
649 |
case null:
|
650 |
+
return '<?php fs_esc_attr_echo_inline( 'Unlimited Licenses', 'license-unlimited', $api->slug ) ?>';
|
651 |
default:
|
652 |
+
return '<?php fs_esc_attr_echo_inline( 'Up to %s Sites', 'license-x-sites', $api->slug ) ?>'.replace('%s', pricing.licenses);
|
653 |
}
|
654 |
},
|
655 |
_formatPrice = function (pricing, cycle, multipleLicenses) {
|
659 |
var priceCycle;
|
660 |
switch (cycle) {
|
661 |
case 'monthly':
|
662 |
+
priceCycle = ' / <?php fs_echo_x_inline( 'mo', 'as monthly period', 'mo', $api->slug ) ?>';
|
663 |
break;
|
664 |
case 'lifetime':
|
665 |
priceCycle = '';
|
666 |
break;
|
667 |
case 'annual':
|
668 |
default:
|
669 |
+
priceCycle = ' / <?php fs_echo_x_inline('year', 'as annual period', 'year', $api->slug) ?>';
|
670 |
break;
|
671 |
}
|
672 |
|
718 |
|
719 |
// Render licenses prices.
|
720 |
if (1 == pricing.length) {
|
721 |
+
html = '<li><label><?php echo fs_esc_attr_x_inline( 'Price', 'noun', 'price', $api->slug ) ?>: ' + _formatPrice(pricing[0], billingCycle, false) + '</label></li>';
|
722 |
} else {
|
723 |
for (var i = 0; i < pricing.length; i++) {
|
724 |
html += '<li><label><input name="pricing-<?php echo $plan->id ?>" type="radio" value="' + pricing[i].id + '">' + _formatPrice(pricing[i], billingCycle) + '</label></li>';
|
764 |
<?php $annual_discount = ( $has_annual && $has_monthly ) ? $plan->pricing[0]->annual_discount_percentage() : 0 ?>
|
765 |
<?php if ( $annual_discount > 0 ) : ?>
|
766 |
<span
|
767 |
+
class="fs-annual-discount"><?php printf( fs_esc_html_x_inline( 'Save %s', 'as a discount of $5 or 10%', 'save-x', $api->slug ), $annual_discount . '%' ) ?></span>
|
768 |
<?php endif ?>
|
769 |
<ul class="fs-licenses">
|
770 |
</ul>
|
774 |
<?php $trial_period = $this->get_trial_period( $plan ) ?>
|
775 |
<ul class="fs-trial-terms">
|
776 |
<li>
|
777 |
+
<i class="dashicons dashicons-yes"></i><?php echo esc_html( sprintf( fs_text_inline( 'No commitment for %s - cancel anytime', 'no-commitment-x', $api->slug ), $trial_period ) ) ?>
|
778 |
</li>
|
779 |
<li>
|
780 |
+
<i class="dashicons dashicons-yes"></i><?php printf( esc_html( fs_text_inline( 'After your free %s, pay as little as %s', 'after-x-pay-as-little-y', $api->slug ) ), $trial_period, '<var class="fs-price">' . $this->get_price_tag( $plan, $plan->pricing[0] ) . '</var>' ) ?>
|
781 |
</li>
|
782 |
</ul>
|
783 |
<?php endif ?>
|
788 |
<?php endif ?>
|
789 |
<?php endif ?>
|
790 |
<div>
|
791 |
+
<h3><?php fs_echo_inline( 'Details', 'details', $api->slug ) ?></h3>
|
792 |
<ul>
|
793 |
<?php if ( ! empty( $api->version ) ) { ?>
|
794 |
+
<li><strong><?php fs_esc_html_echo_x_inline( 'Version', 'product version', 'version', $api->slug ); ?>:</strong> <?php echo $api->version; ?></li>
|
795 |
<?php
|
796 |
}
|
797 |
if ( ! empty( $api->author ) ) {
|
798 |
?>
|
799 |
<li>
|
800 |
+
<strong><?php fs_echo_x_inline( 'Author', 'as the plugin author', 'author', $api->slug ); ?>:</strong> <?php echo links_add_target( $api->author, '_blank' ); ?>
|
801 |
</li>
|
802 |
<?php
|
803 |
}
|
804 |
if ( ! empty( $api->last_updated ) ) {
|
805 |
?>
|
806 |
+
<li><strong><?php fs_echo_inline( 'Last Updated', 'last-updated', $api->slug ); ?>:</strong> <span
|
807 |
title="<?php echo $api->last_updated; ?>">
|
808 |
+
<?php echo esc_html( sprintf(
|
809 |
+
/* translators: %s: time period (e.g. "2 hours" ago) */
|
810 |
+
fs_text_x_inline( '%s ago', 'x-ago', $api->slug ),
|
811 |
+
human_time_diff( strtotime( $api->last_updated ) )
|
812 |
+
) ) ?>
|
813 |
</span></li>
|
814 |
<?php
|
815 |
}
|
816 |
if ( ! empty( $api->requires ) ) {
|
817 |
?>
|
818 |
<li>
|
819 |
+
<strong><?php fs_esc_html_echo_inline( 'Requires WordPress Version', 'requires-wordpress-version', $api->slug ) ?>:</strong> <?php echo esc_html( sprintf( fs_text_inline( '%s or higher', 'x-or-higher', $api->slug ), $api->requires ) ) ?>
|
820 |
</li>
|
821 |
<?php
|
822 |
}
|
823 |
if ( ! empty( $api->tested ) ) {
|
824 |
?>
|
825 |
+
<li><strong><?php fs_esc_html_echo_inline( 'Compatible up to', 'compatible-up-to', $api->slug ); ?>:</strong> <?php echo $api->tested; ?>
|
826 |
</li>
|
827 |
<?php
|
828 |
}
|
829 |
if ( ! empty( $api->downloaded ) ) {
|
830 |
?>
|
831 |
<li>
|
832 |
+
<strong><?php fs_esc_html_echo_inline( 'Downloaded', 'downloaded', $api->slug ) ?>:</strong> <?php echo esc_html( sprintf(
|
833 |
+
( ( 1 == $api->downloaded ) ?
|
834 |
+
/* translators: %s: 1 or One (Number of times downloaded) */
|
835 |
+
fs_text_inline( '%s time', 'x-time', $api->slug ) :
|
836 |
+
/* translators: %s: Number of times downloaded */
|
837 |
+
fs_text_inline( '%s times', 'x-times', $api->slug )
|
838 |
+
),
|
839 |
number_format_i18n( $api->downloaded )
|
840 |
+
) ); ?>
|
841 |
</li>
|
842 |
<?php
|
843 |
}
|
844 |
if ( ! empty( $api->slug ) && empty( $api->external ) ) {
|
845 |
?>
|
846 |
<li><a target="_blank"
|
847 |
+
href="https://wordpress.org/plugins/<?php echo $api->slug; ?>/"><?php fs_esc_html_echo_inline( 'WordPress.org Plugin Page', 'wp-org-plugin-page', $api->slug ) ?> »</a>
|
848 |
</li>
|
849 |
<?php
|
850 |
}
|
851 |
if ( ! empty( $api->homepage ) ) {
|
852 |
?>
|
853 |
<li><a target="_blank"
|
854 |
+
href="<?php echo esc_url( $api->homepage ); ?>"><?php fs_esc_html_echo_inline( 'Plugin Homepage', 'plugin-homepage', $api->slug ) ?> »</a>
|
855 |
</li>
|
856 |
<?php
|
857 |
}
|
858 |
if ( ! empty( $api->donate_link ) && empty( $api->contributors ) ) {
|
859 |
?>
|
860 |
<li><a target="_blank"
|
861 |
+
href="<?php echo esc_url( $api->donate_link ); ?>"><?php fs_esc_html_echo_inline( 'Donate to this plugin', 'donate-to-plugin', $api->slug ) ?> »</a>
|
862 |
</li>
|
863 |
<?php } ?>
|
864 |
</ul>
|
865 |
</div>
|
866 |
<?php if ( ! empty( $api->rating ) ) { ?>
|
867 |
+
<h3><?php fs_echo_inline( 'Average Rating', 'average-rating', $api->slug ); ?></h3>
|
868 |
<?php wp_star_rating( array(
|
869 |
'rating' => $api->rating,
|
870 |
'type' => 'percent',
|
871 |
'number' => $api->num_ratings
|
872 |
) ); ?>
|
873 |
+
<small>(<?php echo esc_html( sprintf(
|
874 |
+
fs_text_inline( 'based on %s', 'based-on-x', $api->slug ),
|
875 |
sprintf(
|
876 |
+
( ( 1 == $api->num_ratings ) ?
|
877 |
+
/* translators: %s: 1 or One */
|
878 |
+
fs_text_inline( '%s rating', 'x-rating', $api->slug ) :
|
879 |
+
/* translators: %s: Number larger than 1 */
|
880 |
+
fs_text_inline( '%s ratings', 'x-ratings', $api->slug )
|
881 |
+
),
|
882 |
number_format_i18n( $api->num_ratings )
|
883 |
+
) ) ) ?>)</small>
|
884 |
<?php
|
885 |
}
|
886 |
|
889 |
// Avoid div-by-zero.
|
890 |
$_rating = $api->num_ratings ? ( $ratecount / $api->num_ratings ) : 0;
|
891 |
$stars_label = sprintf(
|
892 |
+
( ( 1 == $key ) ?
|
893 |
+
/* translators: %s: 1 or One */
|
894 |
+
fs_text_inline( '%s star', 'x-star', $api->slug ) :
|
895 |
+
/* translators: %s: Number larger than 1 */
|
896 |
+
fs_text_inline( '%s stars', 'x-stars', $api->slug )
|
897 |
+
),
|
898 |
number_format_i18n( $key )
|
899 |
);
|
900 |
?>
|
902 |
<span class="counter-label"><a
|
903 |
href="https://wordpress.org/support/view/plugin-reviews/<?php echo $api->slug; ?>?filter=<?php echo $key; ?>"
|
904 |
target="_blank"
|
905 |
+
title="<?php echo esc_attr( sprintf(
|
906 |
+
/* translators: %s: # of stars (e.g. 5 stars) */
|
907 |
+
fs_text_inline( 'Click to see reviews that provided a rating of %s', 'click-to-reviews', $api->slug ),
|
908 |
+
$stars_label
|
909 |
+
) ) ?>"><?php echo $stars_label ?></a></span>
|
910 |
<span class="counter-back">
|
911 |
<span class="counter-bar" style="width: <?php echo 92 * $_rating; ?>px;"></span>
|
912 |
</span>
|
917 |
}
|
918 |
if ( ! empty( $api->contributors ) ) {
|
919 |
?>
|
920 |
+
<h3><?php fs_echo_inline( 'Contributors', 'contributors', $api->slug ); ?></h3>
|
921 |
<ul class="contributors">
|
922 |
<?php
|
923 |
foreach ( (array) $api->contributors as $contrib_username => $contrib_profile ) {
|
938 |
</ul>
|
939 |
<?php if ( ! empty( $api->donate_link ) ) { ?>
|
940 |
<a target="_blank"
|
941 |
+
href="<?php echo esc_url( $api->donate_link ); ?>"><?php fs_echo_inline( 'Donate to this plugin', 'donate-to-plugin', $api->slug ) ?> »</a>
|
942 |
<?php } ?>
|
943 |
<?php } ?>
|
944 |
</div>
|
945 |
<div id="section-holder" class="wrap">
|
946 |
<?php
|
947 |
if ( ! empty( $api->tested ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->tested ) ), $api->tested, '>' ) ) {
|
948 |
+
echo '<div class="notice notice-warning"><p>' . '<strong>' . fs_text_inline( 'Warning', 'warning', $api->slug ) . ':</strong> ' . fs_text_inline( 'This plugin has not been tested with your current version of WordPress.', 'not-tested-warning', $api->slug ) . '</p></div>';
|
949 |
} else if ( ! empty( $api->requires ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->requires ) ), $api->requires, '<' ) ) {
|
950 |
+
echo '<div class="notice notice-warning"><p>' . '<strong>' . fs_text_inline( 'Warning', 'warning', $api->slug ) . ':</strong> ' . fs_text_inline( 'This plugin has not been marked as compatible with your version of WordPress.', 'not-compatible-warning', $api->slug ) . '</p></div>';
|
951 |
}
|
952 |
|
953 |
foreach ( (array) $api->sections as $section_name => $content ) {
|
965 |
$missing_notice = array(
|
966 |
'type' => 'error',
|
967 |
'id' => md5( microtime() ),
|
968 |
+
'message' => $api->is_paid ?
|
969 |
+
fs_text_inline( 'Paid add-on must be deployed to Freemius.', 'paid-addon-not-deployed', $api->slug ) :
|
970 |
+
fs_text_inline( 'Add-on must be deployed to WordPress.org or Freemius.', 'free-addon-not-deployed', $api->slug ),
|
971 |
);
|
972 |
fs_require_template( 'admin-notice.php', $missing_notice );
|
973 |
}
|
freemius/includes/i18n.php
CHANGED
@@ -4,6 +4,8 @@
|
|
4 |
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
* @since 1.1.4
|
|
|
|
|
7 |
*/
|
8 |
|
9 |
if ( ! defined( 'ABSPATH' ) ) {
|
@@ -29,7 +31,7 @@
|
|
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 |
|
@@ -95,8 +97,54 @@
|
|
95 |
'optin-x-now' => _fs_text( 'Opt in to make "%s" Better!' ),
|
96 |
'error' => _fs_text( 'Error' ),
|
97 |
'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.' ),
|
98 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
|
|
|
100 |
'expiration' => _fs_x( 'Expiration', 'as expiration date' ),
|
101 |
'license' => _fs_x( 'License', 'as software license' ),
|
102 |
'not-verified' => _fs_text( 'not verified' ),
|
4 |
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
* @since 1.1.4
|
7 |
+
*
|
8 |
+
* @deprecated This file is no longer in use. It's still in the project for backward compatibility.
|
9 |
*/
|
10 |
|
11 |
if ( ! defined( 'ABSPATH' ) ) {
|
31 |
* my_freemius->override_i18n( array(
|
32 |
* 'opt-in-connect' => __( "Yes - I'm in!", '{your-text_domain}' ),
|
33 |
* 'skip' => __( 'Not today', '{your-text_domain}' ),
|
34 |
+
* ) );
|
35 |
*/
|
36 |
global $fs_text;
|
37 |
|
97 |
'optin-x-now' => _fs_text( 'Opt in to make "%s" Better!' ),
|
98 |
'error' => _fs_text( 'Error' ),
|
99 |
'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.' ),
|
100 |
+
'learn-more' => _fs_text( 'Learn more' ),
|
101 |
+
|
102 |
+
#region Affiliation
|
103 |
+
'affiliation' => _fs_text( 'Affiliation' ),
|
104 |
+
'affiliate' => _fs_text( 'Affiliate' ),
|
105 |
+
'affiliate-tracking' => _fs_text( '%s tracking cookie after the first visit to maximize earnings potential.' ),
|
106 |
+
'renewals-commission' => _fs_text( 'Get commission for automated subscription renewals.' ),
|
107 |
+
'affiliate-application-accepted' => _fs_text( "Your affiliate application for %s has been accepted! Log in to your affiliate area at: %s." ),
|
108 |
+
'affiliate-application-thank-you' => _fs_text( "Thank you for applying for our affiliate program, we'll review your details during the next 14 days and will get back to you with further information." ),
|
109 |
+
'affiliate-application-rejected' => _fs_text( "Thank you for applying for our affiliate program, unfortunately, we've decided at this point to reject your application. Please try again in 30 days." ),
|
110 |
+
'affiliate-account-suspended' => _fs_text( 'Your affiliation account was temporarily suspended.' ),
|
111 |
+
'affiliate-account-blocked' => _fs_text( 'Due to violation of our affiliation terms, we decided to temporarily block your affiliation account. If you have any questions, please contact support.' ),
|
112 |
+
'become-an-ambassador' => _fs_text( 'Like the %s? Become our ambassador and earn cash ;-)' ),
|
113 |
+
'become-an-ambassador-admin-notice' => _fs_text( 'Hey there, did you know that %s has an affiliate program? If you like the %s you can become our ambassador and earn some cash!' ),
|
114 |
+
'refer-new-customers' => _fs_text( 'Refer new customers to our %s and earn %s commission on each successful sale you refer!' ),
|
115 |
+
'program-summary' => _fs_text( 'Program Summary' ),
|
116 |
+
'commission-on-new-license-purchase' => _fs_text( '%s commission when a customer purchases a new license.' ),
|
117 |
+
'unlimited-commissions' => _fs_text( 'Unlimited commissions.' ),
|
118 |
+
'minimum-payout-amount' => _fs_text( '%s minimum payout amount.' ),
|
119 |
+
'payouts-unit-and-processing' => _fs_text( 'Payouts are in USD and processed monthly via PayPal.' ),
|
120 |
+
'commission-payment' => _fs_text( 'As we reserve 30 days for potential refunds, we only pay commissions that are older than 30 days.' ),
|
121 |
+
'become-an-affiliate' => _fs_text( 'Become an affiliate' ),
|
122 |
+
'apply-to-become-an-affiliate' => _fs_text( 'Apply to become an affiliate' ),
|
123 |
+
'full-name' => _fs_text( 'Full name' ),
|
124 |
+
'paypal-account-email-address' => _fs_text( 'PayPal account email address' ),
|
125 |
+
'promotion-methods' => _fs_text( 'Promotion methods' ),
|
126 |
+
'social-media' => _fs_text( 'Social media (Facebook, Twitter, etc.)' ),
|
127 |
+
'mobile-apps' => _fs_text( 'Mobile apps' ),
|
128 |
+
'statistics-information-field-label' => _fs_text( 'Website, email, and social media statistics (optional)' ),
|
129 |
+
'statistics-information-field-desc' => _fs_text( 'Please feel free to provide any relevant website or social media statistics, e.g. monthly unique site visits, number of email subscribers, followers, etc. (we will keep this information confidential).' ),
|
130 |
+
'promotion-method-desc-field-label' => _fs_text( 'How will you promote us?' ),
|
131 |
+
'promotion-method-desc-field-desc' => _fs_text( 'Please provide details on how you intend to promote %s (please be as specific as possible).' ),
|
132 |
+
'domain-field-label' => _fs_text( 'Where are you going to promote the %s?' ),
|
133 |
+
'domain-field-desc' => _fs_text( 'Enter the domain of your website or other websites from where you plan to promote the %s.' ),
|
134 |
+
'extra-domain-fields-label' => _fs_text( 'Extra Domains' ),
|
135 |
+
'extra-domain-fields-desc' => _fs_text( 'Extra domains where you will be marketing the product from.' ),
|
136 |
+
'add-another-domain' => _fs_text( 'Add another domain' ),
|
137 |
+
'remove' => _fs_x( 'Remove', 'Remove domain' ),
|
138 |
+
'email-address-is-required' => _fs_text( 'Email address is required.' ),
|
139 |
+
'domain-is-required' => _fs_text( 'Domain is required.' ),
|
140 |
+
'invalid-domain' => _fs_text( 'Invalid domain' ),
|
141 |
+
'paypal-email-address-is-required' => _fs_text( 'PayPal email address is required.' ),
|
142 |
+
'processing' => _fs_text( 'Processing...' ),
|
143 |
+
'non-expiring' => _fs_text( 'Non-expiring' ),
|
144 |
+
'account-is-pending-activation' => _fs_text( 'Account is pending activation.' ),
|
145 |
+
#endregion Affiliation
|
146 |
|
147 |
+
#region Account
|
148 |
'expiration' => _fs_x( 'Expiration', 'as expiration date' ),
|
149 |
'license' => _fs_x( 'License', 'as software license' ),
|
150 |
'not-verified' => _fs_text( 'not verified' ),
|
freemius/includes/index.php
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
<?php
|
2 |
-
// Silence is golden.
|
3 |
// Hide file structure from users on unprotected servers.
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
3 |
// Hide file structure from users on unprotected servers.
|
freemius/includes/l10n.php
CHANGED
@@ -1,268 +1,48 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.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 |
-
// Avoid misleading Theme Check warning.
|
24 |
-
$fn = 'translate';
|
25 |
-
return $fn( $text, 'freemius' );
|
26 |
-
}
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Retrieve
|
30 |
-
*
|
31 |
-
*
|
32 |
-
*
|
33 |
-
*
|
34 |
-
*
|
35 |
-
*
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
*
|
50 |
-
* @return string
|
51 |
-
*/
|
52 |
-
function _fs_esc_html( $text ) {
|
53 |
-
// Avoid misleading Theme Check warning.
|
54 |
-
$fn = 'translate';
|
55 |
-
return esc_html( $fn( $text, 'freemius' ) );
|
56 |
-
}
|
57 |
-
|
58 |
-
/**
|
59 |
-
* Display translated text.
|
60 |
-
*
|
61 |
-
* @since 1.2.0
|
62 |
-
*
|
63 |
-
* @param string $text
|
64 |
-
*/
|
65 |
-
function _fs_echo( $text ) {
|
66 |
-
// Avoid misleading Theme Check warning.
|
67 |
-
$fn = 'translate';
|
68 |
-
echo $fn( $text, 'freemius' );
|
69 |
-
}
|
70 |
-
|
71 |
-
/**
|
72 |
-
* Display translated text that has been escaped for safe use in an attribute.
|
73 |
-
*
|
74 |
-
* @since 1.2.1.6
|
75 |
-
*
|
76 |
-
* @param string $text
|
77 |
-
*/
|
78 |
-
function _fs_esc_attr_echo( $text ) {
|
79 |
-
// Avoid misleading Theme Check warning.
|
80 |
-
$fn = 'translate';
|
81 |
-
echo esc_attr( $fn( $text, 'freemius' ) );
|
82 |
-
}
|
83 |
-
|
84 |
-
/**
|
85 |
-
* Display translated text that has been escaped for safe use in HTML output.
|
86 |
-
*
|
87 |
-
* @since 1.2.1.6
|
88 |
-
*
|
89 |
-
* @param string $text
|
90 |
-
*/
|
91 |
-
function _fs_esc_html_echo( $text ) {
|
92 |
-
// Avoid misleading Theme Check warning.
|
93 |
-
$fn = 'translate';
|
94 |
-
echo esc_html( $fn( $text, 'freemius' ) );
|
95 |
-
}
|
96 |
-
|
97 |
-
/**
|
98 |
-
* Retrieve translated string with gettext context.
|
99 |
-
*
|
100 |
-
* Quite a few times, there will be collisions with similar translatable text
|
101 |
-
* found in more than two places, but with different translated context.
|
102 |
-
*
|
103 |
-
* By including the context in the pot file, translators can translate the two
|
104 |
-
* strings differently.
|
105 |
-
*
|
106 |
-
* @since 1.2.1.6
|
107 |
-
*
|
108 |
-
* @param string $text
|
109 |
-
* @param string $context
|
110 |
-
*
|
111 |
-
* @return string
|
112 |
-
*/
|
113 |
-
function _fs_x( $text, $context ) {
|
114 |
-
// Avoid misleading Theme Check warning.
|
115 |
-
$fn = 'translate_with_gettext_context';
|
116 |
-
return $fn( $text, $context, 'freemius' );
|
117 |
-
}
|
118 |
-
|
119 |
-
/**
|
120 |
-
* Display translated string with gettext context.
|
121 |
-
*
|
122 |
-
* @since 1.2.1.6
|
123 |
-
*
|
124 |
-
* @param string $text
|
125 |
-
* @param string $context
|
126 |
-
*/
|
127 |
-
function _fs_ex( $text, $context ) {
|
128 |
-
// Avoid misleading Theme Check warning.
|
129 |
-
$fn = '_x';
|
130 |
-
echo $fn( $text, $context, 'freemius' );
|
131 |
-
}
|
132 |
-
|
133 |
-
/**
|
134 |
-
* Translate string with gettext context, and escapes it for safe use in an attribute.
|
135 |
-
*
|
136 |
-
* @since 1.2.1.6
|
137 |
-
*
|
138 |
-
* @param string $text
|
139 |
-
* @param string $context
|
140 |
-
*
|
141 |
-
* @return string
|
142 |
-
*/
|
143 |
-
function _fs_esc_attr_x( $text, $context ) {
|
144 |
-
// Avoid misleading Theme Check warning.
|
145 |
-
$fn = 'translate_with_gettext_context';
|
146 |
-
return esc_attr( $fn( $text, $context, 'freemius' ) );
|
147 |
-
}
|
148 |
-
|
149 |
-
/**
|
150 |
-
* Translate string with gettext context, and escapes it for safe use in HTML output.
|
151 |
-
*
|
152 |
-
* @since 2.9.0
|
153 |
-
*
|
154 |
-
* @param string $text
|
155 |
-
* @param string $context
|
156 |
-
*
|
157 |
-
* @return string
|
158 |
-
*/
|
159 |
-
function _fs_esc_html_x( $text, $context ) {
|
160 |
-
// Avoid misleading Theme Check warning.
|
161 |
-
$fn = 'translate_with_gettext_context';
|
162 |
-
return esc_html( $fn( $text, $context, 'freemius' ) );
|
163 |
-
}
|
164 |
-
|
165 |
-
/**
|
166 |
-
* Translates and retrieves the singular or plural form based on the supplied number.
|
167 |
-
*
|
168 |
-
* @since 1.2.1.6
|
169 |
-
*
|
170 |
-
* @param string $single
|
171 |
-
* @param string $plural
|
172 |
-
* @param int $number
|
173 |
-
*
|
174 |
-
* @return string
|
175 |
-
*/
|
176 |
-
function _fs_n( $single, $plural, $number ) {
|
177 |
-
$translations = get_translations_for_domain( 'freemius' );
|
178 |
-
$translation = $translations->translate_plural( $single, $plural, $number );
|
179 |
-
|
180 |
-
/**
|
181 |
-
* Filters the singular or plural form of a string.
|
182 |
-
*
|
183 |
-
* @since WP 2.2.0
|
184 |
-
*
|
185 |
-
* @param string $translation
|
186 |
-
* @param string $single
|
187 |
-
* @param string $plural
|
188 |
-
* @param string $number
|
189 |
-
* @param string $domain
|
190 |
-
*/
|
191 |
-
return apply_filters( 'ngettext', $translation, $single, $plural, $number, 'freemius' );
|
192 |
-
}
|
193 |
-
|
194 |
-
/**
|
195 |
-
* Translates and retrieves the singular or plural form based on the supplied number, with gettext context.
|
196 |
-
*
|
197 |
-
* @since 1.2.1.6
|
198 |
-
*
|
199 |
-
* @param string $single
|
200 |
-
* @param string $plural
|
201 |
-
* @param int $number
|
202 |
-
* @param string $context
|
203 |
-
*
|
204 |
-
* @return string
|
205 |
-
*/
|
206 |
-
function _fs_nx($single, $plural, $number, $context ) {
|
207 |
-
$translations = get_translations_for_domain( 'freemius' );
|
208 |
-
$translation = $translations->translate_plural( $single, $plural, $number, $context );
|
209 |
-
|
210 |
-
/**
|
211 |
-
* Filters the singular or plural form of a string with gettext context.
|
212 |
-
*
|
213 |
-
* @since WP 3.0
|
214 |
-
*
|
215 |
-
* @param string $translation
|
216 |
-
* @param string $single
|
217 |
-
* @param string $plural
|
218 |
-
* @param string $number
|
219 |
-
* @param string $context
|
220 |
-
* @param string $domain
|
221 |
-
*/
|
222 |
-
return apply_filters( 'ngettext_with_context', $translation, $single, $plural, $number, $context, 'freemius' );
|
223 |
-
}
|
224 |
-
|
225 |
-
/**
|
226 |
-
* Registers plural strings in POT file, but does not translate them.
|
227 |
-
*
|
228 |
-
* Used when you want to keep structures with translatable plural
|
229 |
-
* strings and use them later when the number is known.
|
230 |
-
*
|
231 |
-
* @since 1.2.1.6
|
232 |
-
*
|
233 |
-
* @param string $singular
|
234 |
-
* @param string $plural
|
235 |
-
*
|
236 |
-
* @return array
|
237 |
-
*/
|
238 |
-
function _fs_n_noop( $singular, $plural ) {
|
239 |
-
return array(
|
240 |
-
'singular' => $singular,
|
241 |
-
'plural' => $plural,
|
242 |
-
'context' => null,
|
243 |
-
'domain' => 'freemius'
|
244 |
-
);
|
245 |
-
}
|
246 |
-
|
247 |
-
/**
|
248 |
-
* Registers plural strings with gettext context in POT file, but does not translate them.
|
249 |
-
*
|
250 |
-
* Used when you want to keep structures with translatable plural
|
251 |
-
* strings and use them later when the number is known.
|
252 |
-
*
|
253 |
-
* @since 1.2.1.6
|
254 |
-
*
|
255 |
-
* @param string $singular
|
256 |
-
* @param string $plural
|
257 |
-
* @param string $context
|
258 |
-
*
|
259 |
-
* @return array
|
260 |
-
*/
|
261 |
-
function _fs_nx_noop( $singular, $plural, $context ) {
|
262 |
-
return array(
|
263 |
-
'singular' => $singular,
|
264 |
-
'plural' => $plural,
|
265 |
-
'context' => $context,
|
266 |
-
'domain' => 'freemius'
|
267 |
-
);
|
268 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.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 |
+
// Avoid misleading Theme Check warning.
|
24 |
+
$fn = 'translate';
|
25 |
+
return $fn( $text, 'freemius' );
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Retrieve translated string with gettext context.
|
30 |
+
*
|
31 |
+
* Quite a few times, there will be collisions with similar translatable text
|
32 |
+
* found in more than two places, but with different translated context.
|
33 |
+
*
|
34 |
+
* By including the context in the pot file, translators can translate the two
|
35 |
+
* strings differently.
|
36 |
+
*
|
37 |
+
* @since 1.2.1.6
|
38 |
+
*
|
39 |
+
* @param string $text
|
40 |
+
* @param string $context
|
41 |
+
*
|
42 |
+
* @return string
|
43 |
+
*/
|
44 |
+
function _fs_x( $text, $context ) {
|
45 |
+
// Avoid misleading Theme Check warning.
|
46 |
+
$fn = 'translate_with_gettext_context';
|
47 |
+
return $fn( $text, $context, 'freemius' );
|
48 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
freemius/includes/managers/class-fs-admin-menu-manager.php
CHANGED
@@ -1,849 +1,850 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.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 |
-
* @since 1.2.2
|
19 |
-
*
|
20 |
-
* @var string
|
21 |
-
*/
|
22 |
-
protected $_module_unique_affix;
|
23 |
-
|
24 |
-
/**
|
25 |
-
* @since 1.2.2
|
26 |
-
*
|
27 |
-
* @var number
|
28 |
-
*/
|
29 |
-
protected $_module_id;
|
30 |
-
|
31 |
-
/**
|
32 |
-
* @since 1.2.2
|
33 |
-
*
|
34 |
-
* @var string
|
35 |
-
*/
|
36 |
-
protected $_module_type;
|
37 |
-
|
38 |
-
/**
|
39 |
-
* @since 1.0.6
|
40 |
-
*
|
41 |
-
* @var string
|
42 |
-
*/
|
43 |
-
private $_menu_slug;
|
44 |
-
/**
|
45 |
-
* @since 1.1.3
|
46 |
-
*
|
47 |
-
* @var string
|
48 |
-
*/
|
49 |
-
private $_parent_slug;
|
50 |
-
/**
|
51 |
-
* @since 1.1.3
|
52 |
-
*
|
53 |
-
* @var string
|
54 |
-
*/
|
55 |
-
private $_parent_type;
|
56 |
-
/**
|
57 |
-
* @since 1.1.3
|
58 |
-
*
|
59 |
-
* @var string
|
60 |
-
*/
|
61 |
-
private $_type;
|
62 |
-
/**
|
63 |
-
* @since 1.1.3
|
64 |
-
*
|
65 |
-
* @var bool
|
66 |
-
*/
|
67 |
-
private $_is_top_level;
|
68 |
-
/**
|
69 |
-
* @since 1.1.3
|
70 |
-
*
|
71 |
-
* @var bool
|
72 |
-
*/
|
73 |
-
private $_is_override_exact;
|
74 |
-
/**
|
75 |
-
* @since 1.1.3
|
76 |
-
*
|
77 |
-
* @var array<string,bool>
|
78 |
-
*/
|
79 |
-
private $_default_submenu_items;
|
80 |
-
/**
|
81 |
-
* @since 1.1.3
|
82 |
-
*
|
83 |
-
* @var string
|
84 |
-
*/
|
85 |
-
private $_first_time_path;
|
86 |
-
/**
|
87 |
-
* @since 1.2.2
|
88 |
-
*
|
89 |
-
* @var bool
|
90 |
-
*/
|
91 |
-
private $_menu_exists;
|
92 |
-
|
93 |
-
#endregion Properties
|
94 |
-
|
95 |
-
/**
|
96 |
-
* @var FS_Logger
|
97 |
-
*/
|
98 |
-
protected $_logger;
|
99 |
-
|
100 |
-
#region Singleton
|
101 |
-
|
102 |
-
/**
|
103 |
-
* @var FS_Admin_Menu_Manager[]
|
104 |
-
*/
|
105 |
-
private static $_instances = array();
|
106 |
-
|
107 |
-
/**
|
108 |
-
* @param number $module_id
|
109 |
-
* @param string $module_type
|
110 |
-
* @param string $module_unique_affix
|
111 |
-
*
|
112 |
-
* @return FS_Admin_Menu_Manager
|
113 |
-
*/
|
114 |
-
static function instance( $module_id, $module_type, $module_unique_affix ) {
|
115 |
-
$key = 'm_' . $module_id;
|
116 |
-
|
117 |
-
if ( ! isset( self::$_instances[ $key ] ) ) {
|
118 |
-
self::$_instances[ $key ] = new FS_Admin_Menu_Manager( $module_id, $module_type, $module_unique_affix );
|
119 |
-
}
|
120 |
-
|
121 |
-
return self::$_instances[ $key ];
|
122 |
-
}
|
123 |
-
|
124 |
-
protected function __construct( $module_id, $module_type, $module_unique_affix ) {
|
125 |
-
$this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $module_id . '_admin_menu', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
|
126 |
-
|
127 |
-
$this->_module_id = $module_id;
|
128 |
-
$this->_module_type = $module_type;
|
129 |
-
$this->_module_unique_affix = $module_unique_affix;
|
130 |
-
}
|
131 |
-
|
132 |
-
#endregion Singleton
|
133 |
-
|
134 |
-
#region Helpers
|
135 |
-
|
136 |
-
private function get_option( &$options, $key, $default = false ) {
|
137 |
-
return ! empty( $options[ $key ] ) ? $options[ $key ] : $default;
|
138 |
-
}
|
139 |
-
|
140 |
-
private function get_bool_option( &$options, $key, $default = false ) {
|
141 |
-
return isset( $options[ $key ] ) && is_bool( $options[ $key ] ) ? $options[ $key ] : $default;
|
142 |
-
}
|
143 |
-
|
144 |
-
#endregion Helpers
|
145 |
-
|
146 |
-
/**
|
147 |
-
* @param array $menu
|
148 |
-
* @param bool $is_addon
|
149 |
-
*/
|
150 |
-
function init( $menu, $is_addon = false ) {
|
151 |
-
$this->_menu_exists = ( isset( $menu['slug'] ) && ! empty( $menu['slug'] ) );
|
152 |
-
|
153 |
-
$this->_menu_slug = ( $this->_menu_exists ? $menu['slug'] : $this->_module_unique_affix );
|
154 |
-
|
155 |
-
$this->_default_submenu_items = array();
|
156 |
-
// @deprecated
|
157 |
-
$this->_type = 'page';
|
158 |
-
$this->_is_top_level = true;
|
159 |
-
$this->_is_override_exact = false;
|
160 |
-
$this->_parent_slug = false;
|
161 |
-
// @deprecated
|
162 |
-
$this->_parent_type = 'page';
|
163 |
-
|
164 |
-
if ( ! $is_addon && isset( $menu ) ) {
|
165 |
-
$this->_default_submenu_items = array(
|
166 |
-
'contact'
|
167 |
-
'support'
|
168 |
-
|
169 |
-
'
|
170 |
-
'
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
$this->
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
*
|
188 |
-
* -
|
189 |
-
|
190 |
-
|
191 |
-
//
|
192 |
-
// '
|
193 |
-
//
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
*
|
206 |
-
*
|
207 |
-
* @
|
208 |
-
*
|
209 |
-
*
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
*
|
218 |
-
*
|
219 |
-
* @
|
220 |
-
*
|
221 |
-
*
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
*
|
231 |
-
*
|
232 |
-
* @
|
233 |
-
*
|
234 |
-
*
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
*
|
243 |
-
*
|
244 |
-
* @
|
245 |
-
*
|
246 |
-
*
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
* @
|
255 |
-
*
|
256 |
-
*
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
* @
|
265 |
-
*
|
266 |
-
*
|
267 |
-
* @param
|
268 |
-
* @param bool $
|
269 |
-
*
|
270 |
-
*
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
$id
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
*
|
288 |
-
*
|
289 |
-
*
|
290 |
-
* @
|
291 |
-
*
|
292 |
-
*
|
293 |
-
*
|
294 |
-
*
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
$this->
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
* @
|
305 |
-
*
|
306 |
-
*
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
* @
|
315 |
-
*
|
316 |
-
*
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
* @
|
325 |
-
*
|
326 |
-
*
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
* @
|
338 |
-
*
|
339 |
-
*
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
* @
|
348 |
-
*
|
349 |
-
*
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
*
|
358 |
-
*
|
359 |
-
* @
|
360 |
-
*
|
361 |
-
*
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
* @
|
380 |
-
*
|
381 |
-
*
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
$this->
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
*
|
392 |
-
*
|
393 |
-
* @
|
394 |
-
*
|
395 |
-
*
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
*
|
404 |
-
*
|
405 |
-
*
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
*
|
415 |
-
*
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
*
|
428 |
-
*
|
429 |
-
* @
|
430 |
-
*
|
431 |
-
*
|
432 |
-
* @param string $
|
433 |
-
* @param
|
434 |
-
*
|
435 |
-
*
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
$
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
*
|
478 |
-
*
|
479 |
-
* @
|
480 |
-
*
|
481 |
-
*
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
$
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
$
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
'
|
507 |
-
'
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
*
|
514 |
-
*
|
515 |
-
* @
|
516 |
-
*
|
517 |
-
*
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
$
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
$
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
'
|
549 |
-
'
|
550 |
-
'
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
*
|
557 |
-
*
|
558 |
-
* @
|
559 |
-
*
|
560 |
-
*
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
*
|
574 |
-
*
|
575 |
-
*
|
576 |
-
*
|
577 |
-
* @
|
578 |
-
|
579 |
-
|
580 |
-
$submenu_ref
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
*
|
588 |
-
* @
|
589 |
-
*
|
590 |
-
*
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
*
|
614 |
-
*
|
615 |
-
*
|
616 |
-
*
|
617 |
-
* @
|
618 |
-
*
|
619 |
-
*
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
'
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
* @
|
640 |
-
*
|
641 |
-
*
|
642 |
-
*
|
643 |
-
*
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
$found_menu['menu'][
|
669 |
-
'
|
670 |
-
|
671 |
-
$
|
672 |
-
$
|
673 |
-
$found_menu['
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
*
|
683 |
-
*
|
684 |
-
* @
|
685 |
-
*
|
686 |
-
*
|
687 |
-
* @param
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
*
|
697 |
-
*
|
698 |
-
*
|
699 |
-
*
|
700 |
-
* @
|
701 |
-
|
702 |
-
|
703 |
-
$
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
$
|
714 |
-
$
|
715 |
-
$
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
$
|
726 |
-
$
|
727 |
-
$
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
*
|
738 |
-
*
|
739 |
-
*
|
740 |
-
*
|
741 |
-
*
|
742 |
-
*
|
743 |
-
*
|
744 |
-
*
|
745 |
-
*
|
746 |
-
*
|
747 |
-
*
|
748 |
-
*
|
749 |
-
*
|
750 |
-
*
|
751 |
-
*
|
752 |
-
*
|
753 |
-
*
|
754 |
-
*
|
755 |
-
* @
|
756 |
-
*
|
757 |
-
*
|
758 |
-
*
|
759 |
-
*
|
760 |
-
* @param string $
|
761 |
-
* @param string $
|
762 |
-
* @param
|
763 |
-
* @param string
|
764 |
-
*
|
765 |
-
*
|
766 |
-
*
|
767 |
-
*
|
768 |
-
*
|
769 |
-
*
|
770 |
-
*
|
771 |
-
*
|
772 |
-
*
|
773 |
-
*
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
$
|
778 |
-
$
|
779 |
-
$
|
780 |
-
$
|
781 |
-
$
|
782 |
-
$
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
$
|
789 |
-
$
|
790 |
-
$
|
791 |
-
$
|
792 |
-
$
|
793 |
-
$
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
*
|
800 |
-
*
|
801 |
-
*
|
802 |
-
*
|
803 |
-
*
|
804 |
-
*
|
805 |
-
*
|
806 |
-
*
|
807 |
-
*
|
808 |
-
*
|
809 |
-
*
|
810 |
-
*
|
811 |
-
*
|
812 |
-
*
|
813 |
-
*
|
814 |
-
*
|
815 |
-
*
|
816 |
-
*
|
817 |
-
* @
|
818 |
-
*
|
819 |
-
*
|
820 |
-
*
|
821 |
-
*
|
822 |
-
*
|
823 |
-
*
|
824 |
-
* @param string $
|
825 |
-
* @param string $
|
826 |
-
* @param
|
827 |
-
*
|
828 |
-
*
|
829 |
-
*
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
$
|
834 |
-
$
|
835 |
-
$
|
836 |
-
$
|
837 |
-
$
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
$
|
844 |
-
$
|
845 |
-
$
|
846 |
-
$
|
847 |
-
|
848 |
-
|
|
|
849 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.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 |
+
* @since 1.2.2
|
19 |
+
*
|
20 |
+
* @var string
|
21 |
+
*/
|
22 |
+
protected $_module_unique_affix;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* @since 1.2.2
|
26 |
+
*
|
27 |
+
* @var number
|
28 |
+
*/
|
29 |
+
protected $_module_id;
|
30 |
+
|
31 |
+
/**
|
32 |
+
* @since 1.2.2
|
33 |
+
*
|
34 |
+
* @var string
|
35 |
+
*/
|
36 |
+
protected $_module_type;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* @since 1.0.6
|
40 |
+
*
|
41 |
+
* @var string
|
42 |
+
*/
|
43 |
+
private $_menu_slug;
|
44 |
+
/**
|
45 |
+
* @since 1.1.3
|
46 |
+
*
|
47 |
+
* @var string
|
48 |
+
*/
|
49 |
+
private $_parent_slug;
|
50 |
+
/**
|
51 |
+
* @since 1.1.3
|
52 |
+
*
|
53 |
+
* @var string
|
54 |
+
*/
|
55 |
+
private $_parent_type;
|
56 |
+
/**
|
57 |
+
* @since 1.1.3
|
58 |
+
*
|
59 |
+
* @var string
|
60 |
+
*/
|
61 |
+
private $_type;
|
62 |
+
/**
|
63 |
+
* @since 1.1.3
|
64 |
+
*
|
65 |
+
* @var bool
|
66 |
+
*/
|
67 |
+
private $_is_top_level;
|
68 |
+
/**
|
69 |
+
* @since 1.1.3
|
70 |
+
*
|
71 |
+
* @var bool
|
72 |
+
*/
|
73 |
+
private $_is_override_exact;
|
74 |
+
/**
|
75 |
+
* @since 1.1.3
|
76 |
+
*
|
77 |
+
* @var array<string,bool>
|
78 |
+
*/
|
79 |
+
private $_default_submenu_items;
|
80 |
+
/**
|
81 |
+
* @since 1.1.3
|
82 |
+
*
|
83 |
+
* @var string
|
84 |
+
*/
|
85 |
+
private $_first_time_path;
|
86 |
+
/**
|
87 |
+
* @since 1.2.2
|
88 |
+
*
|
89 |
+
* @var bool
|
90 |
+
*/
|
91 |
+
private $_menu_exists;
|
92 |
+
|
93 |
+
#endregion Properties
|
94 |
+
|
95 |
+
/**
|
96 |
+
* @var FS_Logger
|
97 |
+
*/
|
98 |
+
protected $_logger;
|
99 |
+
|
100 |
+
#region Singleton
|
101 |
+
|
102 |
+
/**
|
103 |
+
* @var FS_Admin_Menu_Manager[]
|
104 |
+
*/
|
105 |
+
private static $_instances = array();
|
106 |
+
|
107 |
+
/**
|
108 |
+
* @param number $module_id
|
109 |
+
* @param string $module_type
|
110 |
+
* @param string $module_unique_affix
|
111 |
+
*
|
112 |
+
* @return FS_Admin_Menu_Manager
|
113 |
+
*/
|
114 |
+
static function instance( $module_id, $module_type, $module_unique_affix ) {
|
115 |
+
$key = 'm_' . $module_id;
|
116 |
+
|
117 |
+
if ( ! isset( self::$_instances[ $key ] ) ) {
|
118 |
+
self::$_instances[ $key ] = new FS_Admin_Menu_Manager( $module_id, $module_type, $module_unique_affix );
|
119 |
+
}
|
120 |
+
|
121 |
+
return self::$_instances[ $key ];
|
122 |
+
}
|
123 |
+
|
124 |
+
protected function __construct( $module_id, $module_type, $module_unique_affix ) {
|
125 |
+
$this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $module_id . '_admin_menu', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
|
126 |
+
|
127 |
+
$this->_module_id = $module_id;
|
128 |
+
$this->_module_type = $module_type;
|
129 |
+
$this->_module_unique_affix = $module_unique_affix;
|
130 |
+
}
|
131 |
+
|
132 |
+
#endregion Singleton
|
133 |
+
|
134 |
+
#region Helpers
|
135 |
+
|
136 |
+
private function get_option( &$options, $key, $default = false ) {
|
137 |
+
return ! empty( $options[ $key ] ) ? $options[ $key ] : $default;
|
138 |
+
}
|
139 |
+
|
140 |
+
private function get_bool_option( &$options, $key, $default = false ) {
|
141 |
+
return isset( $options[ $key ] ) && is_bool( $options[ $key ] ) ? $options[ $key ] : $default;
|
142 |
+
}
|
143 |
+
|
144 |
+
#endregion Helpers
|
145 |
+
|
146 |
+
/**
|
147 |
+
* @param array $menu
|
148 |
+
* @param bool $is_addon
|
149 |
+
*/
|
150 |
+
function init( $menu, $is_addon = false ) {
|
151 |
+
$this->_menu_exists = ( isset( $menu['slug'] ) && ! empty( $menu['slug'] ) );
|
152 |
+
|
153 |
+
$this->_menu_slug = ( $this->_menu_exists ? $menu['slug'] : $this->_module_unique_affix );
|
154 |
+
|
155 |
+
$this->_default_submenu_items = array();
|
156 |
+
// @deprecated
|
157 |
+
$this->_type = 'page';
|
158 |
+
$this->_is_top_level = true;
|
159 |
+
$this->_is_override_exact = false;
|
160 |
+
$this->_parent_slug = false;
|
161 |
+
// @deprecated
|
162 |
+
$this->_parent_type = 'page';
|
163 |
+
|
164 |
+
if ( ! $is_addon && isset( $menu ) ) {
|
165 |
+
$this->_default_submenu_items = array(
|
166 |
+
'contact' => $this->get_bool_option( $menu, 'contact', true ),
|
167 |
+
'support' => $this->get_bool_option( $menu, 'support', true ),
|
168 |
+
'affiliation' => $this->get_bool_option( $menu, 'affiliation', true ),
|
169 |
+
'account' => $this->get_bool_option( $menu, 'account', true ),
|
170 |
+
'pricing' => $this->get_bool_option( $menu, 'pricing', true ),
|
171 |
+
'addons' => $this->get_bool_option( $menu, 'addons', true ),
|
172 |
+
);
|
173 |
+
|
174 |
+
// @deprecated
|
175 |
+
$this->_type = $this->get_option( $menu, 'type', 'page' );
|
176 |
+
$this->_is_override_exact = $this->get_bool_option( $menu, 'override_exact' );
|
177 |
+
|
178 |
+
if ( isset( $menu['parent'] ) ) {
|
179 |
+
$this->_parent_slug = $this->get_option( $menu['parent'], 'slug' );
|
180 |
+
// @deprecated
|
181 |
+
$this->_parent_type = $this->get_option( $menu['parent'], 'type', 'page' );
|
182 |
+
|
183 |
+
// If parent's slug is different, then it's NOT a top level menu item.
|
184 |
+
$this->_is_top_level = ( $this->_parent_slug === $this->_menu_slug );
|
185 |
+
} else {
|
186 |
+
/**
|
187 |
+
* If no parent then top level if:
|
188 |
+
* - Has custom admin menu ('page')
|
189 |
+
* - CPT menu type ('cpt')
|
190 |
+
*/
|
191 |
+
// $this->_is_top_level = in_array( $this->_type, array(
|
192 |
+
// 'cpt',
|
193 |
+
// 'page'
|
194 |
+
// ) );
|
195 |
+
}
|
196 |
+
|
197 |
+
$this->_first_time_path = $this->get_option( $menu, 'first-path', false );
|
198 |
+
if ( ! empty( $this->_first_time_path ) && is_string( $this->_first_time_path ) ) {
|
199 |
+
$this->_first_time_path = admin_url( $this->_first_time_path, 'admin' );
|
200 |
+
}
|
201 |
+
}
|
202 |
+
}
|
203 |
+
|
204 |
+
/**
|
205 |
+
* Check if top level menu.
|
206 |
+
*
|
207 |
+
* @author Vova Feldman (@svovaf)
|
208 |
+
* @since 1.1.3
|
209 |
+
*
|
210 |
+
* @return bool False if submenu item.
|
211 |
+
*/
|
212 |
+
function is_top_level() {
|
213 |
+
return $this->_is_top_level;
|
214 |
+
}
|
215 |
+
|
216 |
+
/**
|
217 |
+
* Check if the page should be override on exact URL match.
|
218 |
+
*
|
219 |
+
* @author Vova Feldman (@svovaf)
|
220 |
+
* @since 1.1.3
|
221 |
+
*
|
222 |
+
* @return bool False if submenu item.
|
223 |
+
*/
|
224 |
+
function is_override_exact() {
|
225 |
+
return $this->_is_override_exact;
|
226 |
+
}
|
227 |
+
|
228 |
+
|
229 |
+
/**
|
230 |
+
* Get the path of the page the user should be forwarded to after first activation.
|
231 |
+
*
|
232 |
+
* @author Vova Feldman (@svovaf)
|
233 |
+
* @since 1.1.3
|
234 |
+
*
|
235 |
+
* @return string
|
236 |
+
*/
|
237 |
+
function get_first_time_path() {
|
238 |
+
return $this->_first_time_path;
|
239 |
+
}
|
240 |
+
|
241 |
+
/**
|
242 |
+
* Check if plugin's menu item is part of a custom top level menu.
|
243 |
+
*
|
244 |
+
* @author Vova Feldman (@svovaf)
|
245 |
+
* @since 1.1.3
|
246 |
+
*
|
247 |
+
* @return bool
|
248 |
+
*/
|
249 |
+
function has_custom_parent() {
|
250 |
+
return ! $this->_is_top_level && is_string( $this->_parent_slug );
|
251 |
+
}
|
252 |
+
|
253 |
+
/**
|
254 |
+
* @author Leo Fajardo (@leorw)
|
255 |
+
* @since 1.2.2
|
256 |
+
*
|
257 |
+
* @return bool
|
258 |
+
*/
|
259 |
+
function has_menu() {
|
260 |
+
return $this->_menu_exists;
|
261 |
+
}
|
262 |
+
|
263 |
+
/**
|
264 |
+
* @author Vova Feldman (@svovaf)
|
265 |
+
* @since 1.1.3
|
266 |
+
*
|
267 |
+
* @param string $id
|
268 |
+
* @param bool $default
|
269 |
+
* @param bool $ignore_menu_existence Since 1.2.2.7 If true, check if the submenu item visible even if there's no parent menu.
|
270 |
+
*
|
271 |
+
* @return bool
|
272 |
+
*/
|
273 |
+
function is_submenu_item_visible( $id, $default = true, $ignore_menu_existence = false ) {
|
274 |
+
if ( ! $ignore_menu_existence && ! $this->has_menu() ) {
|
275 |
+
return false;
|
276 |
+
}
|
277 |
+
|
278 |
+
return fs_apply_filter(
|
279 |
+
$this->_module_unique_affix,
|
280 |
+
'is_submenu_visible',
|
281 |
+
$this->get_bool_option( $this->_default_submenu_items, $id, $default ),
|
282 |
+
$id
|
283 |
+
);
|
284 |
+
}
|
285 |
+
|
286 |
+
/**
|
287 |
+
* Calculates admin settings menu slug.
|
288 |
+
* If plugin's menu slug is a file (e.g. CPT), uses plugin's slug as the menu slug.
|
289 |
+
*
|
290 |
+
* @author Vova Feldman (@svovaf)
|
291 |
+
* @since 1.1.3
|
292 |
+
*
|
293 |
+
* @param string $page
|
294 |
+
*
|
295 |
+
* @return string
|
296 |
+
*/
|
297 |
+
function get_slug( $page = '' ) {
|
298 |
+
return ( ( false === strpos( $this->_menu_slug, '.php?' ) ) ?
|
299 |
+
$this->_menu_slug :
|
300 |
+
$this->_module_unique_affix ) . ( empty( $page ) ? '' : ( '-' . $page ) );
|
301 |
+
}
|
302 |
+
|
303 |
+
/**
|
304 |
+
* @author Vova Feldman (@svovaf)
|
305 |
+
* @since 1.1.3
|
306 |
+
*
|
307 |
+
* @return string
|
308 |
+
*/
|
309 |
+
function get_parent_slug() {
|
310 |
+
return $this->_parent_slug;
|
311 |
+
}
|
312 |
+
|
313 |
+
/**
|
314 |
+
* @author Vova Feldman (@svovaf)
|
315 |
+
* @since 1.1.3
|
316 |
+
*
|
317 |
+
* @return string
|
318 |
+
*/
|
319 |
+
function get_type() {
|
320 |
+
return $this->_type;
|
321 |
+
}
|
322 |
+
|
323 |
+
/**
|
324 |
+
* @author Vova Feldman (@svovaf)
|
325 |
+
* @since 1.1.3
|
326 |
+
*
|
327 |
+
* @return bool
|
328 |
+
*/
|
329 |
+
function is_cpt() {
|
330 |
+
return ( 0 === strpos( $this->_menu_slug, 'edit.php?post_type=' ) ||
|
331 |
+
// Back compatibility.
|
332 |
+
'cpt' === $this->_type
|
333 |
+
);
|
334 |
+
}
|
335 |
+
|
336 |
+
/**
|
337 |
+
* @author Vova Feldman (@svovaf)
|
338 |
+
* @since 1.1.3
|
339 |
+
*
|
340 |
+
* @return string
|
341 |
+
*/
|
342 |
+
function get_parent_type() {
|
343 |
+
return $this->_parent_type;
|
344 |
+
}
|
345 |
+
|
346 |
+
/**
|
347 |
+
* @author Vova Feldman (@svovaf)
|
348 |
+
* @since 1.1.3
|
349 |
+
*
|
350 |
+
* @return string
|
351 |
+
*/
|
352 |
+
function get_raw_slug() {
|
353 |
+
return $this->_menu_slug;
|
354 |
+
}
|
355 |
+
|
356 |
+
/**
|
357 |
+
* Get plugin's original menu slug.
|
358 |
+
*
|
359 |
+
* @author Vova Feldman (@svovaf)
|
360 |
+
* @since 1.1.3
|
361 |
+
*
|
362 |
+
* @return string
|
363 |
+
*/
|
364 |
+
function get_original_menu_slug() {
|
365 |
+
if ( 'cpt' === $this->_type ) {
|
366 |
+
return add_query_arg( array(
|
367 |
+
'post_type' => $this->_menu_slug
|
368 |
+
), 'edit.php' );
|
369 |
+
}
|
370 |
+
|
371 |
+
if ( false === strpos( $this->_menu_slug, '.php?' ) ) {
|
372 |
+
return $this->_menu_slug;
|
373 |
+
} else {
|
374 |
+
return $this->_module_unique_affix;
|
375 |
+
}
|
376 |
+
}
|
377 |
+
|
378 |
+
/**
|
379 |
+
* @author Vova Feldman (@svovaf)
|
380 |
+
* @since 1.1.3
|
381 |
+
*
|
382 |
+
* @return string
|
383 |
+
*/
|
384 |
+
function get_top_level_menu_slug() {
|
385 |
+
return $this->has_custom_parent() ?
|
386 |
+
$this->get_parent_slug() :
|
387 |
+
$this->get_raw_slug();
|
388 |
+
}
|
389 |
+
|
390 |
+
/**
|
391 |
+
* Is user on plugin's admin activation page.
|
392 |
+
*
|
393 |
+
* @author Vova Feldman (@svovaf)
|
394 |
+
* @since 1.0.8
|
395 |
+
*
|
396 |
+
* @return bool
|
397 |
+
*/
|
398 |
+
function is_main_settings_page() {
|
399 |
+
if ( $this->_menu_exists &&
|
400 |
+
( fs_is_plugin_page( $this->_menu_slug ) || fs_is_plugin_page( $this->_module_unique_affix ) )
|
401 |
+
) {
|
402 |
+
/**
|
403 |
+
* Module has a settings menu and the context page is the main settings page, so assume it's in
|
404 |
+
* activation (doesn't really check if already opted-in/skipped or not).
|
405 |
+
*
|
406 |
+
* @since 1.2.2
|
407 |
+
*/
|
408 |
+
return true;
|
409 |
+
}
|
410 |
+
|
411 |
+
global $pagenow;
|
412 |
+
if ( ( WP_FS__MODULE_TYPE_THEME === $this->_module_type ) && Freemius::is_themes_page() ) {
|
413 |
+
/**
|
414 |
+
* In activation only when show_optin query string param is given.
|
415 |
+
*
|
416 |
+
* @since 1.2.2
|
417 |
+
*/
|
418 |
+
return fs_request_get_bool( $this->_module_unique_affix . '_show_optin' );
|
419 |
+
}
|
420 |
+
|
421 |
+
return false;
|
422 |
+
}
|
423 |
+
|
424 |
+
#region Submenu Override
|
425 |
+
|
426 |
+
/**
|
427 |
+
* Override submenu's action.
|
428 |
+
*
|
429 |
+
* @author Vova Feldman (@svovaf)
|
430 |
+
* @since 1.1.0
|
431 |
+
*
|
432 |
+
* @param string $parent_slug
|
433 |
+
* @param string $menu_slug
|
434 |
+
* @param callable $function
|
435 |
+
*
|
436 |
+
* @return false|string If submenu exist, will return the hook name.
|
437 |
+
*/
|
438 |
+
function override_submenu_action( $parent_slug, $menu_slug, $function ) {
|
439 |
+
global $submenu;
|
440 |
+
|
441 |
+
$menu_slug = plugin_basename( $menu_slug );
|
442 |
+
$parent_slug = plugin_basename( $parent_slug );
|
443 |
+
|
444 |
+
if ( ! isset( $submenu[ $parent_slug ] ) ) {
|
445 |
+
// Parent menu not exist.
|
446 |
+
return false;
|
447 |
+
}
|
448 |
+
|
449 |
+
$found_submenu_item = false;
|
450 |
+
foreach ( $submenu[ $parent_slug ] as $submenu_item ) {
|
451 |
+
if ( $menu_slug === $submenu_item[2] ) {
|
452 |
+
$found_submenu_item = $submenu_item;
|
453 |
+
break;
|
454 |
+
}
|
455 |
+
}
|
456 |
+
|
457 |
+
if ( false === $found_submenu_item ) {
|
458 |
+
// Submenu item not found.
|
459 |
+
return false;
|
460 |
+
}
|
461 |
+
|
462 |
+
// Remove current function.
|
463 |
+
$hookname = get_plugin_page_hookname( $menu_slug, $parent_slug );
|
464 |
+
remove_all_actions( $hookname );
|
465 |
+
|
466 |
+
// Attach new action.
|
467 |
+
add_action( $hookname, $function );
|
468 |
+
|
469 |
+
return $hookname;
|
470 |
+
}
|
471 |
+
|
472 |
+
#endregion Submenu Override
|
473 |
+
|
474 |
+
#region Top level menu Override
|
475 |
+
|
476 |
+
/**
|
477 |
+
* Find plugin's admin dashboard main menu item.
|
478 |
+
*
|
479 |
+
* @author Vova Feldman (@svovaf)
|
480 |
+
* @since 1.0.2
|
481 |
+
*
|
482 |
+
* @return string[]|false
|
483 |
+
*/
|
484 |
+
private function find_top_level_menu() {
|
485 |
+
global $menu;
|
486 |
+
|
487 |
+
$position = - 1;
|
488 |
+
$found_menu = false;
|
489 |
+
|
490 |
+
$menu_slug = $this->get_raw_slug();
|
491 |
+
|
492 |
+
$hook_name = get_plugin_page_hookname( $menu_slug, '' );
|
493 |
+
foreach ( $menu as $pos => $m ) {
|
494 |
+
if ( $menu_slug === $m[2] ) {
|
495 |
+
$position = $pos;
|
496 |
+
$found_menu = $m;
|
497 |
+
break;
|
498 |
+
}
|
499 |
+
}
|
500 |
+
|
501 |
+
if ( false === $found_menu ) {
|
502 |
+
return false;
|
503 |
+
}
|
504 |
+
|
505 |
+
return array(
|
506 |
+
'menu' => $found_menu,
|
507 |
+
'position' => $position,
|
508 |
+
'hook_name' => $hook_name
|
509 |
+
);
|
510 |
+
}
|
511 |
+
|
512 |
+
/**
|
513 |
+
* Find plugin's admin dashboard main submenu item.
|
514 |
+
*
|
515 |
+
* @author Vova Feldman (@svovaf)
|
516 |
+
* @since 1.2.1.6
|
517 |
+
*
|
518 |
+
* @return array|false
|
519 |
+
*/
|
520 |
+
private function find_main_submenu() {
|
521 |
+
global $submenu;
|
522 |
+
|
523 |
+
$top_level_menu_slug = $this->get_top_level_menu_slug();
|
524 |
+
|
525 |
+
if ( ! isset( $submenu[ $top_level_menu_slug ] ) ) {
|
526 |
+
return false;
|
527 |
+
}
|
528 |
+
|
529 |
+
$submenu_slug = $this->get_raw_slug();
|
530 |
+
|
531 |
+
$position = - 1;
|
532 |
+
$found_submenu = false;
|
533 |
+
|
534 |
+
$hook_name = get_plugin_page_hookname( $submenu_slug, '' );
|
535 |
+
|
536 |
+
foreach ( $submenu[ $top_level_menu_slug ] as $pos => $sub ) {
|
537 |
+
if ( $submenu_slug === $sub[2] ) {
|
538 |
+
$position = $pos;
|
539 |
+
$found_submenu = $sub;
|
540 |
+
}
|
541 |
+
}
|
542 |
+
|
543 |
+
if ( false === $found_submenu ) {
|
544 |
+
return false;
|
545 |
+
}
|
546 |
+
|
547 |
+
return array(
|
548 |
+
'menu' => $found_submenu,
|
549 |
+
'parent_slug' => $top_level_menu_slug,
|
550 |
+
'position' => $position,
|
551 |
+
'hook_name' => $hook_name
|
552 |
+
);
|
553 |
+
}
|
554 |
+
|
555 |
+
/**
|
556 |
+
* Remove all sub-menu items.
|
557 |
+
*
|
558 |
+
* @author Vova Feldman (@svovaf)
|
559 |
+
* @since 1.0.7
|
560 |
+
*
|
561 |
+
* @return bool If submenu with plugin's menu slug was found.
|
562 |
+
*/
|
563 |
+
private function remove_all_submenu_items() {
|
564 |
+
global $submenu;
|
565 |
+
|
566 |
+
$menu_slug = $this->get_raw_slug();
|
567 |
+
|
568 |
+
if ( ! isset( $submenu[ $menu_slug ] ) ) {
|
569 |
+
return false;
|
570 |
+
}
|
571 |
+
|
572 |
+
/**
|
573 |
+
* This method is NOT executed for WordPress.org themes.
|
574 |
+
* Since we maintain only one version of the SDK we added this small
|
575 |
+
* hack to avoid the error from Theme Check since it's a false-positive.
|
576 |
+
*
|
577 |
+
* @author Vova Feldman (@svovaf)
|
578 |
+
* @since 1.2.2.7
|
579 |
+
*/
|
580 |
+
$submenu_ref = &$submenu;
|
581 |
+
$submenu_ref[ $menu_slug ] = array();
|
582 |
+
|
583 |
+
return true;
|
584 |
+
}
|
585 |
+
|
586 |
+
/**
|
587 |
+
*
|
588 |
+
* @author Vova Feldman (@svovaf)
|
589 |
+
* @since 1.0.9
|
590 |
+
*
|
591 |
+
* @return false|array[string]mixed
|
592 |
+
*/
|
593 |
+
function remove_menu_item() {
|
594 |
+
$this->_logger->entrance();
|
595 |
+
|
596 |
+
// Find main menu item.
|
597 |
+
$menu = $this->find_top_level_menu();
|
598 |
+
|
599 |
+
if ( false === $menu ) {
|
600 |
+
return false;
|
601 |
+
}
|
602 |
+
|
603 |
+
// Remove it with its actions.
|
604 |
+
remove_all_actions( $menu['hook_name'] );
|
605 |
+
|
606 |
+
// Remove all submenu items.
|
607 |
+
$this->remove_all_submenu_items();
|
608 |
+
|
609 |
+
return $menu;
|
610 |
+
}
|
611 |
+
|
612 |
+
/**
|
613 |
+
* Get module's main admin setting page URL.
|
614 |
+
*
|
615 |
+
* @todo This method was only tested for wp.org compliant themes with a submenu item. Need to test for plugins with top level, submenu, and CPT top level, menu items.
|
616 |
+
*
|
617 |
+
* @author Vova Feldman (@svovaf)
|
618 |
+
* @since 1.2.2.7
|
619 |
+
*
|
620 |
+
* @return string
|
621 |
+
*/
|
622 |
+
function main_menu_url() {
|
623 |
+
$this->_logger->entrance();
|
624 |
+
|
625 |
+
if ( $this->_is_top_level ) {
|
626 |
+
$menu = $this->find_top_level_menu();
|
627 |
+
} else {
|
628 |
+
$menu = $this->find_main_submenu();
|
629 |
+
}
|
630 |
+
|
631 |
+
$parent_slug = isset( $menu['parent_slug'] ) ?
|
632 |
+
$menu['parent_slug'] :
|
633 |
+
'admin.php';
|
634 |
+
|
635 |
+
return admin_url( $parent_slug . '?page=' . $menu['menu'][2] );
|
636 |
+
}
|
637 |
+
|
638 |
+
/**
|
639 |
+
* @author Vova Feldman (@svovaf)
|
640 |
+
* @since 1.1.4
|
641 |
+
*
|
642 |
+
* @param callable $function
|
643 |
+
*
|
644 |
+
* @return false|array[string]mixed
|
645 |
+
*/
|
646 |
+
function override_menu_item( $function ) {
|
647 |
+
$found_menu = $this->remove_menu_item();
|
648 |
+
|
649 |
+
if ( false === $found_menu ) {
|
650 |
+
return false;
|
651 |
+
}
|
652 |
+
|
653 |
+
if ( ! $this->is_top_level() || ! $this->is_cpt() ) {
|
654 |
+
$menu_slug = plugin_basename( $this->get_slug() );
|
655 |
+
|
656 |
+
$hookname = get_plugin_page_hookname( $menu_slug, '' );
|
657 |
+
|
658 |
+
// Override menu action.
|
659 |
+
add_action( $hookname, $function );
|
660 |
+
} else {
|
661 |
+
global $menu;
|
662 |
+
|
663 |
+
// Remove original CPT menu.
|
664 |
+
unset( $menu[ $found_menu['position'] ] );
|
665 |
+
|
666 |
+
// Create new top-level menu action.
|
667 |
+
$hookname = self::add_page(
|
668 |
+
$found_menu['menu'][3],
|
669 |
+
$found_menu['menu'][0],
|
670 |
+
'manage_options',
|
671 |
+
$this->get_slug(),
|
672 |
+
$function,
|
673 |
+
$found_menu['menu'][6],
|
674 |
+
$found_menu['position']
|
675 |
+
);
|
676 |
+
}
|
677 |
+
|
678 |
+
return $hookname;
|
679 |
+
}
|
680 |
+
|
681 |
+
/**
|
682 |
+
* Adds a counter to the module's top level menu item.
|
683 |
+
*
|
684 |
+
* @author Vova Feldman (@svovaf)
|
685 |
+
* @since 1.2.1.5
|
686 |
+
*
|
687 |
+
* @param int $counter
|
688 |
+
* @param string $class
|
689 |
+
*/
|
690 |
+
function add_counter_to_menu_item( $counter = 1, $class = '' ) {
|
691 |
+
global $menu, $submenu;
|
692 |
+
|
693 |
+
$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>';
|
694 |
+
|
695 |
+
/**
|
696 |
+
* This method is NOT executed for WordPress.org themes.
|
697 |
+
* Since we maintain only one version of the SDK we added this small
|
698 |
+
* hack to avoid the error from Theme Check since it's a false-positive.
|
699 |
+
*
|
700 |
+
* @author Vova Feldman (@svovaf)
|
701 |
+
* @since 1.2.2.7
|
702 |
+
*/
|
703 |
+
$menu_ref = &$menu;
|
704 |
+
$submenu_ref = &$submenu;
|
705 |
+
|
706 |
+
if ( $this->_is_top_level ) {
|
707 |
+
// Find main menu item.
|
708 |
+
$found_menu = $this->find_top_level_menu();
|
709 |
+
|
710 |
+
if ( false !== $found_menu ) {
|
711 |
+
// Override menu label.
|
712 |
+
$menu_ref[ $found_menu['position'] ][0] = sprintf(
|
713 |
+
$mask,
|
714 |
+
$found_menu['menu'][0],
|
715 |
+
$class,
|
716 |
+
$counter
|
717 |
+
);
|
718 |
+
}
|
719 |
+
} else {
|
720 |
+
$found_submenu = $this->find_main_submenu();
|
721 |
+
|
722 |
+
if ( false !== $found_submenu ) {
|
723 |
+
// Override menu label.
|
724 |
+
$submenu_ref[ $found_submenu['parent_slug'] ][ $found_submenu['position'] ][0] = sprintf(
|
725 |
+
$mask,
|
726 |
+
$found_submenu['menu'][0],
|
727 |
+
$class,
|
728 |
+
$counter
|
729 |
+
);
|
730 |
+
}
|
731 |
+
}
|
732 |
+
}
|
733 |
+
|
734 |
+
#endregion Top level menu Override
|
735 |
+
|
736 |
+
/**
|
737 |
+
* Add a top-level menu page.
|
738 |
+
*
|
739 |
+
* Note for WordPress.org Theme/Plugin reviewer:
|
740 |
+
*
|
741 |
+
* This is a replication of `add_menu_page()` to avoid Theme Check warning.
|
742 |
+
*
|
743 |
+
* Why?
|
744 |
+
* ====
|
745 |
+
* Freemius is an SDK for plugin and theme developers. Since the core
|
746 |
+
* of the SDK is relevant both for plugins and themes, for obvious reasons,
|
747 |
+
* we only develop and maintain one code base.
|
748 |
+
*
|
749 |
+
* This method will not run for wp.org themes (only plugins) since theme
|
750 |
+
* admin settings/options are now only allowed in the customizer.
|
751 |
+
*
|
752 |
+
* If you have any questions or need clarifications, please don't hesitate
|
753 |
+
* pinging me on slack, my username is @svovaf.
|
754 |
+
*
|
755 |
+
* @author Vova Feldman (@svovaf)
|
756 |
+
* @since 1.2.2
|
757 |
+
*
|
758 |
+
* @param string $page_title The text to be displayed in the title tags of the page when the menu is
|
759 |
+
* selected.
|
760 |
+
* @param string $menu_title The text to be used for the menu.
|
761 |
+
* @param string $capability The capability required for this menu to be displayed to the user.
|
762 |
+
* @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
|
763 |
+
* @param callable|string $function The function to be called to output the content for this page.
|
764 |
+
* @param string $icon_url The URL to the icon to be used for this menu.
|
765 |
+
* * Pass a base64-encoded SVG using a data URI, which will be colored to
|
766 |
+
* match the color scheme. This should begin with
|
767 |
+
* 'data:image/svg+xml;base64,'.
|
768 |
+
* * Pass the name of a Dashicons helper class to use a font icon,
|
769 |
+
* e.g. 'dashicons-chart-pie'.
|
770 |
+
* * Pass 'none' to leave div.wp-menu-image empty so an icon can be added
|
771 |
+
* via CSS.
|
772 |
+
* @param int $position The position in the menu order this one should appear.
|
773 |
+
*
|
774 |
+
* @return string The resulting page's hook_suffix.
|
775 |
+
*/
|
776 |
+
static function add_page(
|
777 |
+
$page_title,
|
778 |
+
$menu_title,
|
779 |
+
$capability,
|
780 |
+
$menu_slug,
|
781 |
+
$function = '',
|
782 |
+
$icon_url = '',
|
783 |
+
$position = null
|
784 |
+
) {
|
785 |
+
$fn = 'add_menu' . '_page';
|
786 |
+
|
787 |
+
return $fn(
|
788 |
+
$page_title,
|
789 |
+
$menu_title,
|
790 |
+
$capability,
|
791 |
+
$menu_slug,
|
792 |
+
$function,
|
793 |
+
$icon_url,
|
794 |
+
$position
|
795 |
+
);
|
796 |
+
}
|
797 |
+
|
798 |
+
/**
|
799 |
+
* Add a submenu page.
|
800 |
+
*
|
801 |
+
* Note for WordPress.org Theme/Plugin reviewer:
|
802 |
+
*
|
803 |
+
* This is a replication of `add_submenu_page()` to avoid Theme Check warning.
|
804 |
+
*
|
805 |
+
* Why?
|
806 |
+
* ====
|
807 |
+
* Freemius is an SDK for plugin and theme developers. Since the core
|
808 |
+
* of the SDK is relevant both for plugins and themes, for obvious reasons,
|
809 |
+
* we only develop and maintain one code base.
|
810 |
+
*
|
811 |
+
* This method will not run for wp.org themes (only plugins) since theme
|
812 |
+
* admin settings/options are now only allowed in the customizer.
|
813 |
+
*
|
814 |
+
* If you have any questions or need clarifications, please don't hesitate
|
815 |
+
* pinging me on slack, my username is @svovaf.
|
816 |
+
*
|
817 |
+
* @author Vova Feldman (@svovaf)
|
818 |
+
* @since 1.2.2
|
819 |
+
*
|
820 |
+
* @param string $parent_slug The slug name for the parent menu (or the file name of a standard
|
821 |
+
* WordPress admin page).
|
822 |
+
* @param string $page_title The text to be displayed in the title tags of the page when the menu is
|
823 |
+
* selected.
|
824 |
+
* @param string $menu_title The text to be used for the menu.
|
825 |
+
* @param string $capability The capability required for this menu to be displayed to the user.
|
826 |
+
* @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
|
827 |
+
* @param callable|string $function The function to be called to output the content for this page.
|
828 |
+
*
|
829 |
+
* @return false|string The resulting page's hook_suffix, or false if the user does not have the capability
|
830 |
+
* required.
|
831 |
+
*/
|
832 |
+
static function add_subpage(
|
833 |
+
$parent_slug,
|
834 |
+
$page_title,
|
835 |
+
$menu_title,
|
836 |
+
$capability,
|
837 |
+
$menu_slug,
|
838 |
+
$function = ''
|
839 |
+
) {
|
840 |
+
$fn = 'add_submenu' . '_page';
|
841 |
+
|
842 |
+
return $fn( $parent_slug,
|
843 |
+
$page_title,
|
844 |
+
$menu_title,
|
845 |
+
$capability,
|
846 |
+
$menu_slug,
|
847 |
+
$function
|
848 |
+
);
|
849 |
+
}
|
850 |
}
|
freemius/includes/managers/class-fs-cache-manager.php
CHANGED
@@ -1,280 +1,281 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.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 |
-
* @param null|int $expiration Since 1.2.2.7
|
120 |
-
*
|
121 |
-
* @return bool
|
122 |
-
*/
|
123 |
-
function has_valid( $key, $expiration = null ) {
|
124 |
-
$cache_entry = $this->_options->get_option( $key, false );
|
125 |
-
|
126 |
-
$is_valid = ( is_object( $cache_entry ) &&
|
127 |
-
isset( $cache_entry->timestamp ) &&
|
128 |
-
is_numeric( $cache_entry->timestamp ) &&
|
129 |
-
$cache_entry->timestamp > WP_FS__SCRIPT_START_TIME
|
130 |
-
);
|
131 |
-
|
132 |
-
if ( $is_valid &&
|
133 |
-
is_numeric( $expiration ) &&
|
134 |
-
isset( $cache_entry->created ) &&
|
135 |
-
is_numeric( $cache_entry->created ) &&
|
136 |
-
$cache_entry->created + $expiration < WP_FS__SCRIPT_START_TIME
|
137 |
-
) {
|
138 |
-
/**
|
139 |
-
* Even if the cache is still valid, since we are checking for validity
|
140 |
-
* with an explicit expiration period, if the period has past, return
|
141 |
-
* `false` as if the cache is invalid.
|
142 |
-
*
|
143 |
-
* @since 1.2.2.7
|
144 |
-
*/
|
145 |
-
$is_valid = false;
|
146 |
-
}
|
147 |
-
|
148 |
-
return $is_valid;
|
149 |
-
}
|
150 |
-
|
151 |
-
/**
|
152 |
-
* @author Vova Feldman (@svovaf)
|
153 |
-
* @since 1.1.6
|
154 |
-
*
|
155 |
-
* @param string $key
|
156 |
-
* @param mixed $default
|
157 |
-
*
|
158 |
-
* @return mixed
|
159 |
-
*/
|
160 |
-
function get( $key, $default = null ) {
|
161 |
-
$this->_logger->entrance( 'key = ' . $key );
|
162 |
-
|
163 |
-
$cache_entry = $this->_options->get_option( $key, false );
|
164 |
-
|
165 |
-
if ( is_object( $cache_entry ) &&
|
166 |
-
isset( $cache_entry->timestamp ) &&
|
167 |
-
is_numeric( $cache_entry->timestamp )
|
168 |
-
) {
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
return $default;
|
173 |
-
}
|
174 |
-
|
175 |
-
/**
|
176 |
-
* @author Vova Feldman (@svovaf)
|
177 |
-
* @since 1.1.6
|
178 |
-
*
|
179 |
-
* @param string $key
|
180 |
-
* @param mixed $default
|
181 |
-
*
|
182 |
-
* @return mixed
|
183 |
-
*/
|
184 |
-
function get_valid( $key, $default = null ) {
|
185 |
-
$this->_logger->entrance( 'key = ' . $key );
|
186 |
-
|
187 |
-
$cache_entry = $this->_options->get_option( $key, false );
|
188 |
-
|
189 |
-
if ( is_object( $cache_entry ) &&
|
190 |
-
isset( $cache_entry->timestamp ) &&
|
191 |
-
is_numeric( $cache_entry->timestamp ) &&
|
192 |
-
$cache_entry->timestamp > WP_FS__SCRIPT_START_TIME
|
193 |
-
) {
|
194 |
-
return $cache_entry->result;
|
195 |
-
}
|
196 |
-
|
197 |
-
|
198 |
-
}
|
199 |
-
|
200 |
-
/**
|
201 |
-
* @author Vova Feldman (@svovaf)
|
202 |
-
* @since 1.1.6
|
203 |
-
*
|
204 |
-
* @param string $key
|
205 |
-
* @param mixed $value
|
206 |
-
* @param int $expiration
|
207 |
-
*/
|
208 |
-
function set( $key, $value, $expiration = WP_FS__TIME_24_HOURS_IN_SEC ) {
|
209 |
-
$this->_logger->entrance( 'key = ' . $key );
|
210 |
-
|
211 |
-
$cache_entry
|
212 |
-
|
213 |
-
$cache_entry->
|
214 |
-
$cache_entry->
|
215 |
-
$
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
*
|
221 |
-
*
|
222 |
-
* @
|
223 |
-
*
|
224 |
-
*
|
225 |
-
*
|
226 |
-
*
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
$cache_entry->timestamp
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
*
|
247 |
-
*
|
248 |
-
* @
|
249 |
-
*
|
250 |
-
*
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
*
|
261 |
-
*
|
262 |
-
* @
|
263 |
-
*
|
264 |
-
*
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
$
|
278 |
-
|
279 |
-
|
|
|
280 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.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 |
+
* @param null|int $expiration Since 1.2.2.7
|
120 |
+
*
|
121 |
+
* @return bool
|
122 |
+
*/
|
123 |
+
function has_valid( $key, $expiration = null ) {
|
124 |
+
$cache_entry = $this->_options->get_option( $key, false );
|
125 |
+
|
126 |
+
$is_valid = ( is_object( $cache_entry ) &&
|
127 |
+
isset( $cache_entry->timestamp ) &&
|
128 |
+
is_numeric( $cache_entry->timestamp ) &&
|
129 |
+
$cache_entry->timestamp > WP_FS__SCRIPT_START_TIME
|
130 |
+
);
|
131 |
+
|
132 |
+
if ( $is_valid &&
|
133 |
+
is_numeric( $expiration ) &&
|
134 |
+
isset( $cache_entry->created ) &&
|
135 |
+
is_numeric( $cache_entry->created ) &&
|
136 |
+
$cache_entry->created + $expiration < WP_FS__SCRIPT_START_TIME
|
137 |
+
) {
|
138 |
+
/**
|
139 |
+
* Even if the cache is still valid, since we are checking for validity
|
140 |
+
* with an explicit expiration period, if the period has past, return
|
141 |
+
* `false` as if the cache is invalid.
|
142 |
+
*
|
143 |
+
* @since 1.2.2.7
|
144 |
+
*/
|
145 |
+
$is_valid = false;
|
146 |
+
}
|
147 |
+
|
148 |
+
return $is_valid;
|
149 |
+
}
|
150 |
+
|
151 |
+
/**
|
152 |
+
* @author Vova Feldman (@svovaf)
|
153 |
+
* @since 1.1.6
|
154 |
+
*
|
155 |
+
* @param string $key
|
156 |
+
* @param mixed $default
|
157 |
+
*
|
158 |
+
* @return mixed
|
159 |
+
*/
|
160 |
+
function get( $key, $default = null ) {
|
161 |
+
$this->_logger->entrance( 'key = ' . $key );
|
162 |
+
|
163 |
+
$cache_entry = $this->_options->get_option( $key, false );
|
164 |
+
|
165 |
+
if ( is_object( $cache_entry ) &&
|
166 |
+
isset( $cache_entry->timestamp ) &&
|
167 |
+
is_numeric( $cache_entry->timestamp )
|
168 |
+
) {
|
169 |
+
return $cache_entry->result;
|
170 |
+
}
|
171 |
+
|
172 |
+
return is_object($default) ? clone $default : $default;
|
173 |
+
}
|
174 |
+
|
175 |
+
/**
|
176 |
+
* @author Vova Feldman (@svovaf)
|
177 |
+
* @since 1.1.6
|
178 |
+
*
|
179 |
+
* @param string $key
|
180 |
+
* @param mixed $default
|
181 |
+
*
|
182 |
+
* @return mixed
|
183 |
+
*/
|
184 |
+
function get_valid( $key, $default = null ) {
|
185 |
+
$this->_logger->entrance( 'key = ' . $key );
|
186 |
+
|
187 |
+
$cache_entry = $this->_options->get_option( $key, false );
|
188 |
+
|
189 |
+
if ( is_object( $cache_entry ) &&
|
190 |
+
isset( $cache_entry->timestamp ) &&
|
191 |
+
is_numeric( $cache_entry->timestamp ) &&
|
192 |
+
$cache_entry->timestamp > WP_FS__SCRIPT_START_TIME
|
193 |
+
) {
|
194 |
+
return $cache_entry->result;
|
195 |
+
}
|
196 |
+
|
197 |
+
return is_object($default) ? clone $default : $default;
|
198 |
+
}
|
199 |
+
|
200 |
+
/**
|
201 |
+
* @author Vova Feldman (@svovaf)
|
202 |
+
* @since 1.1.6
|
203 |
+
*
|
204 |
+
* @param string $key
|
205 |
+
* @param mixed $value
|
206 |
+
* @param int $expiration
|
207 |
+
*/
|
208 |
+
function set( $key, $value, $expiration = WP_FS__TIME_24_HOURS_IN_SEC ) {
|
209 |
+
$this->_logger->entrance( 'key = ' . $key );
|
210 |
+
|
211 |
+
$cache_entry = new stdClass();
|
212 |
+
|
213 |
+
$cache_entry->result = $value;
|
214 |
+
$cache_entry->created = WP_FS__SCRIPT_START_TIME;
|
215 |
+
$cache_entry->timestamp = WP_FS__SCRIPT_START_TIME + $expiration;
|
216 |
+
$this->_options->set_option( $key, $cache_entry, true );
|
217 |
+
}
|
218 |
+
|
219 |
+
/**
|
220 |
+
* Get cached record expiration, or false if not cached or expired.
|
221 |
+
*
|
222 |
+
* @author Vova Feldman (@svovaf)
|
223 |
+
* @since 1.1.7.3
|
224 |
+
*
|
225 |
+
* @param string $key
|
226 |
+
*
|
227 |
+
* @return bool|int
|
228 |
+
*/
|
229 |
+
function get_record_expiration( $key ) {
|
230 |
+
$this->_logger->entrance( 'key = ' . $key );
|
231 |
+
|
232 |
+
$cache_entry = $this->_options->get_option( $key, false );
|
233 |
+
|
234 |
+
if ( is_object( $cache_entry ) &&
|
235 |
+
isset( $cache_entry->timestamp ) &&
|
236 |
+
is_numeric( $cache_entry->timestamp ) &&
|
237 |
+
$cache_entry->timestamp > WP_FS__SCRIPT_START_TIME
|
238 |
+
) {
|
239 |
+
return $cache_entry->timestamp;
|
240 |
+
}
|
241 |
+
|
242 |
+
return false;
|
243 |
+
}
|
244 |
+
|
245 |
+
/**
|
246 |
+
* Purge cached item.
|
247 |
+
*
|
248 |
+
* @author Vova Feldman (@svovaf)
|
249 |
+
* @since 1.1.6
|
250 |
+
*
|
251 |
+
* @param string $key
|
252 |
+
*/
|
253 |
+
function purge( $key ) {
|
254 |
+
$this->_logger->entrance( 'key = ' . $key );
|
255 |
+
|
256 |
+
$this->_options->unset_option( $key, true );
|
257 |
+
}
|
258 |
+
|
259 |
+
/**
|
260 |
+
* Set cached item as expired.
|
261 |
+
*
|
262 |
+
* @author Vova Feldman (@svovaf)
|
263 |
+
* @since 1.2.2.7
|
264 |
+
*
|
265 |
+
* @param string $key
|
266 |
+
*/
|
267 |
+
function expire( $key ) {
|
268 |
+
$this->_logger->entrance( 'key = ' . $key );
|
269 |
+
|
270 |
+
$cache_entry = $this->_options->get_option( $key, false );
|
271 |
+
|
272 |
+
if ( is_object( $cache_entry ) &&
|
273 |
+
isset( $cache_entry->timestamp ) &&
|
274 |
+
is_numeric( $cache_entry->timestamp ))
|
275 |
+
{
|
276 |
+
// Set to expired.
|
277 |
+
$cache_entry->timestamp = WP_FS__SCRIPT_START_TIME;
|
278 |
+
$this->_options->set_option( $key, $cache_entry, true );
|
279 |
+
}
|
280 |
+
}
|
281 |
}
|
freemius/includes/managers/class-fs-key-value-storage.php
CHANGED
@@ -1,328 +1,328 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.0.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 |
-
* @since 1.2.2
|
51 |
-
*
|
52 |
-
* @var string
|
53 |
-
*/
|
54 |
-
protected $_secondary_id;
|
55 |
-
/**
|
56 |
-
* @var array
|
57 |
-
*/
|
58 |
-
protected $_data;
|
59 |
-
|
60 |
-
/**
|
61 |
-
* @var FS_Plugin_Manager[]
|
62 |
-
*/
|
63 |
-
private static $_instances = array();
|
64 |
-
/**
|
65 |
-
* @var FS_Logger
|
66 |
-
*/
|
67 |
-
protected $_logger;
|
68 |
-
|
69 |
-
/**
|
70 |
-
* @param string $id
|
71 |
-
* @param string $secondary_id
|
72 |
-
*
|
73 |
-
* @return FS_Key_Value_Storage
|
74 |
-
*/
|
75 |
-
static function instance( $id, $secondary_id ) {
|
76 |
-
$key = $id . ':' . $secondary_id;
|
77 |
-
if ( ! isset( self::$_instances[ $key ] ) ) {
|
78 |
-
self::$_instances[ $key ] = new FS_Key_Value_Storage( $id, $secondary_id );
|
79 |
-
}
|
80 |
-
|
81 |
-
return self::$_instances[ $key ];
|
82 |
-
}
|
83 |
-
|
84 |
-
protected function __construct( $id, $secondary_id ) {
|
85 |
-
$this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $secondary_id . '_' . $id, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
|
86 |
-
|
87 |
-
$this->_secondary_id = $secondary_id;
|
88 |
-
$this->_id = $id;
|
89 |
-
$this->load();
|
90 |
-
}
|
91 |
-
|
92 |
-
protected function get_option_manager() {
|
93 |
-
return FS_Option_Manager::get_manager( WP_FS__ACCOUNTS_OPTION_NAME, true );
|
94 |
-
}
|
95 |
-
|
96 |
-
protected function get_all_data() {
|
97 |
-
return $this->get_option_manager()->get_option( $this->_id, array() );
|
98 |
-
}
|
99 |
-
|
100 |
-
/**
|
101 |
-
* Load plugin data from local DB.
|
102 |
-
*
|
103 |
-
* @author Vova Feldman (@svovaf)
|
104 |
-
* @since 1.0.7
|
105 |
-
*/
|
106 |
-
function load() {
|
107 |
-
$all_plugins_data = $this->get_all_data();
|
108 |
-
$this->_data = isset( $all_plugins_data[ $this->_secondary_id ] ) ?
|
109 |
-
$all_plugins_data[ $this->_secondary_id ] :
|
110 |
-
array();
|
111 |
-
}
|
112 |
-
|
113 |
-
/**
|
114 |
-
* @author Vova Feldman (@svovaf)
|
115 |
-
* @since 1.0.7
|
116 |
-
*
|
117 |
-
* @param string $key
|
118 |
-
* @param mixed $value
|
119 |
-
* @param bool $flush
|
120 |
-
*/
|
121 |
-
function store( $key, $value, $flush = true ) {
|
122 |
-
if ( $this->_logger->is_on() ) {
|
123 |
-
$this->_logger->entrance( $key . ' = ' . var_export( $value, true ) );
|
124 |
-
}
|
125 |
-
|
126 |
-
if ( array_key_exists( $key, $this->_data ) && $value === $this->_data[ $key ] ) {
|
127 |
-
// No need to store data if the value wasn't changed.
|
128 |
-
return;
|
129 |
-
}
|
130 |
-
|
131 |
-
$all_data = $this->get_all_data();
|
132 |
-
|
133 |
-
$this->_data[ $key ] = $value;
|
134 |
-
|
135 |
-
$all_data[ $this->_secondary_id ] = $this->_data;
|
136 |
-
|
137 |
-
$options_manager = $this->get_option_manager();
|
138 |
-
$options_manager->set_option( $this->_id, $all_data, $flush );
|
139 |
-
}
|
140 |
-
|
141 |
-
/**
|
142 |
-
* @author Vova Feldman (@svovaf)
|
143 |
-
* @since 1.0.7
|
144 |
-
*
|
145 |
-
* @param bool $store
|
146 |
-
* @param string[] $exceptions Set of keys to keep and not clear.
|
147 |
-
*/
|
148 |
-
function clear_all( $store = true, $exceptions = array() ) {
|
149 |
-
$new_data = array();
|
150 |
-
foreach ( $exceptions as $key ) {
|
151 |
-
if ( isset( $this->_data[ $key ] ) ) {
|
152 |
-
$new_data[ $key ] = $this->_data[ $key ];
|
153 |
-
}
|
154 |
-
}
|
155 |
-
|
156 |
-
$this->_data = $new_data;
|
157 |
-
|
158 |
-
if ( $store ) {
|
159 |
-
$all_data = $this->get_all_data();
|
160 |
-
$all_data[ $this->_secondary_id ] = $this->_data;
|
161 |
-
$options_manager = $this->get_option_manager();
|
162 |
-
$options_manager->set_option( $this->_id, $all_data, true );
|
163 |
-
}
|
164 |
-
}
|
165 |
-
|
166 |
-
/**
|
167 |
-
* Delete key-value storage.
|
168 |
-
*
|
169 |
-
* @author Vova Feldman (@svovaf)
|
170 |
-
* @since 1.0.9
|
171 |
-
*/
|
172 |
-
function delete() {
|
173 |
-
$this->_data = array();
|
174 |
-
|
175 |
-
$all_data = $this->get_all_data();
|
176 |
-
unset( $all_data[ $this->_secondary_id ] );
|
177 |
-
$options_manager = $this->get_option_manager();
|
178 |
-
$options_manager->set_option( $this->_id, $all_data, true );
|
179 |
-
}
|
180 |
-
|
181 |
-
/**
|
182 |
-
* @author Vova Feldman (@svovaf)
|
183 |
-
* @since 1.0.7
|
184 |
-
*
|
185 |
-
* @param string $key
|
186 |
-
* @param bool $store
|
187 |
-
*/
|
188 |
-
function remove( $key, $store = true ) {
|
189 |
-
if ( ! array_key_exists( $key, $this->_data ) ) {
|
190 |
-
return;
|
191 |
-
}
|
192 |
-
|
193 |
-
unset( $this->_data[ $key ] );
|
194 |
-
|
195 |
-
if ( $store ) {
|
196 |
-
$all_data = $this->get_all_data();
|
197 |
-
$all_data[ $this->_secondary_id ] = $this->_data;
|
198 |
-
$options_manager = $this->get_option_manager();
|
199 |
-
$options_manager->set_option( $this->_id, $all_data, true );
|
200 |
-
}
|
201 |
-
}
|
202 |
-
|
203 |
-
/**
|
204 |
-
* @author Vova Feldman (@svovaf)
|
205 |
-
* @since 1.0.7
|
206 |
-
*
|
207 |
-
* @param string $key
|
208 |
-
* @param mixed $default
|
209 |
-
*
|
210 |
-
* @return bool|\FS_Plugin
|
211 |
-
*/
|
212 |
-
function get( $key, $default = false ) {
|
213 |
-
return array_key_exists( $key, $this->_data ) ?
|
214 |
-
$this->_data[ $key ] :
|
215 |
-
$default;
|
216 |
-
}
|
217 |
-
|
218 |
-
|
219 |
-
/* ArrayAccess + Magic Access (better for refactoring)
|
220 |
-
-----------------------------------------------------------------------------------*/
|
221 |
-
function __set( $k, $v ) {
|
222 |
-
$this->store( $k, $v );
|
223 |
-
}
|
224 |
-
|
225 |
-
function __isset( $k ) {
|
226 |
-
return array_key_exists( $k, $this->_data );
|
227 |
-
}
|
228 |
-
|
229 |
-
function __unset( $k ) {
|
230 |
-
$this->remove( $k );
|
231 |
-
}
|
232 |
-
|
233 |
-
function __get( $k ) {
|
234 |
-
return $this->get( $k, null );
|
235 |
-
}
|
236 |
-
|
237 |
-
function offsetSet( $k, $v ) {
|
238 |
-
if ( is_null( $k ) ) {
|
239 |
-
throw new Exception( 'Can\'t append value to request params.' );
|
240 |
-
} else {
|
241 |
-
$this->{$k} = $v;
|
242 |
-
}
|
243 |
-
}
|
244 |
-
|
245 |
-
function offsetExists( $k ) {
|
246 |
-
return array_key_exists( $k, $this->_data );
|
247 |
-
}
|
248 |
-
|
249 |
-
function offsetUnset( $k ) {
|
250 |
-
unset( $this->$k );
|
251 |
-
}
|
252 |
-
|
253 |
-
function offsetGet( $k ) {
|
254 |
-
return $this->get( $k, null );
|
255 |
-
}
|
256 |
-
|
257 |
-
/**
|
258 |
-
* (PHP 5 >= 5.0.0)<br/>
|
259 |
-
* Return the current element
|
260 |
-
*
|
261 |
-
* @link http://php.net/manual/en/iterator.current.php
|
262 |
-
* @return mixed Can return any type.
|
263 |
-
*/
|
264 |
-
public function current() {
|
265 |
-
return current( $this->_data );
|
266 |
-
}
|
267 |
-
|
268 |
-
/**
|
269 |
-
* (PHP 5 >= 5.0.0)<br/>
|
270 |
-
* Move forward to next element
|
271 |
-
*
|
272 |
-
* @link http://php.net/manual/en/iterator.next.php
|
273 |
-
* @return void Any returned value is ignored.
|
274 |
-
*/
|
275 |
-
public function next() {
|
276 |
-
next( $this->_data );
|
277 |
-
}
|
278 |
-
|
279 |
-
/**
|
280 |
-
* (PHP 5 >= 5.0.0)<br/>
|
281 |
-
* Return the key of the current element
|
282 |
-
*
|
283 |
-
* @link http://php.net/manual/en/iterator.key.php
|
284 |
-
* @return mixed scalar on success, or null on failure.
|
285 |
-
*/
|
286 |
-
public function key() {
|
287 |
-
return key( $this->_data );
|
288 |
-
}
|
289 |
-
|
290 |
-
/**
|
291 |
-
* (PHP 5 >= 5.0.0)<br/>
|
292 |
-
* Checks if current position is valid
|
293 |
-
*
|
294 |
-
* @link http://php.net/manual/en/iterator.valid.php
|
295 |
-
* @return boolean The return value will be casted to boolean and then evaluated.
|
296 |
-
* Returns true on success or false on failure.
|
297 |
-
*/
|
298 |
-
public function valid() {
|
299 |
-
$key = key( $this->_data );
|
300 |
-
|
301 |
-
return ( $key !== null && $key !== false );
|
302 |
-
}
|
303 |
-
|
304 |
-
/**
|
305 |
-
* (PHP 5 >= 5.0.0)<br/>
|
306 |
-
* Rewind the Iterator to the first element
|
307 |
-
*
|
308 |
-
* @link http://php.net/manual/en/iterator.rewind.php
|
309 |
-
* @return void Any returned value is ignored.
|
310 |
-
*/
|
311 |
-
public function rewind() {
|
312 |
-
reset( $this->_data );
|
313 |
-
}
|
314 |
-
|
315 |
-
/**
|
316 |
-
* (PHP 5 >= 5.1.0)<br/>
|
317 |
-
* Count elements of an object
|
318 |
-
*
|
319 |
-
* @link http://php.net/manual/en/countable.count.php
|
320 |
-
* @return int The custom count as an integer.
|
321 |
-
* </p>
|
322 |
-
* <p>
|
323 |
-
* The return value is cast to an integer.
|
324 |
-
*/
|
325 |
-
public function count() {
|
326 |
-
return count( $this->_data );
|
327 |
-
}
|
328 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.0.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 |
+
* @since 1.2.2
|
51 |
+
*
|
52 |
+
* @var string
|
53 |
+
*/
|
54 |
+
protected $_secondary_id;
|
55 |
+
/**
|
56 |
+
* @var array
|
57 |
+
*/
|
58 |
+
protected $_data;
|
59 |
+
|
60 |
+
/**
|
61 |
+
* @var FS_Plugin_Manager[]
|
62 |
+
*/
|
63 |
+
private static $_instances = array();
|
64 |
+
/**
|
65 |
+
* @var FS_Logger
|
66 |
+
*/
|
67 |
+
protected $_logger;
|
68 |
+
|
69 |
+
/**
|
70 |
+
* @param string $id
|
71 |
+
* @param string $secondary_id
|
72 |
+
*
|
73 |
+
* @return FS_Key_Value_Storage
|
74 |
+
*/
|
75 |
+
static function instance( $id, $secondary_id ) {
|
76 |
+
$key = $id . ':' . $secondary_id;
|
77 |
+
if ( ! isset( self::$_instances[ $key ] ) ) {
|
78 |
+
self::$_instances[ $key ] = new FS_Key_Value_Storage( $id, $secondary_id );
|
79 |
+
}
|
80 |
+
|
81 |
+
return self::$_instances[ $key ];
|
82 |
+
}
|
83 |
+
|
84 |
+
protected function __construct( $id, $secondary_id ) {
|
85 |
+
$this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $secondary_id . '_' . $id, WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
|
86 |
+
|
87 |
+
$this->_secondary_id = $secondary_id;
|
88 |
+
$this->_id = $id;
|
89 |
+
$this->load();
|
90 |
+
}
|
91 |
+
|
92 |
+
protected function get_option_manager() {
|
93 |
+
return FS_Option_Manager::get_manager( WP_FS__ACCOUNTS_OPTION_NAME, true );
|
94 |
+
}
|
95 |
+
|
96 |
+
protected function get_all_data() {
|
97 |
+
return $this->get_option_manager()->get_option( $this->_id, array() );
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Load plugin data from local DB.
|
102 |
+
*
|
103 |
+
* @author Vova Feldman (@svovaf)
|
104 |
+
* @since 1.0.7
|
105 |
+
*/
|
106 |
+
function load() {
|
107 |
+
$all_plugins_data = $this->get_all_data();
|
108 |
+
$this->_data = isset( $all_plugins_data[ $this->_secondary_id ] ) ?
|
109 |
+
$all_plugins_data[ $this->_secondary_id ] :
|
110 |
+
array();
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* @author Vova Feldman (@svovaf)
|
115 |
+
* @since 1.0.7
|
116 |
+
*
|
117 |
+
* @param string $key
|
118 |
+
* @param mixed $value
|
119 |
+
* @param bool $flush
|
120 |
+
*/
|
121 |
+
function store( $key, $value, $flush = true ) {
|
122 |
+
if ( $this->_logger->is_on() ) {
|
123 |
+
$this->_logger->entrance( $key . ' = ' . var_export( $value, true ) );
|
124 |
+
}
|
125 |
+
|
126 |
+
if ( array_key_exists( $key, $this->_data ) && $value === $this->_data[ $key ] ) {
|
127 |
+
// No need to store data if the value wasn't changed.
|
128 |
+
return;
|
129 |
+
}
|
130 |
+
|
131 |
+
$all_data = $this->get_all_data();
|
132 |
+
|
133 |
+
$this->_data[ $key ] = $value;
|
134 |
+
|
135 |
+
$all_data[ $this->_secondary_id ] = $this->_data;
|
136 |
+
|
137 |
+
$options_manager = $this->get_option_manager();
|
138 |
+
$options_manager->set_option( $this->_id, $all_data, $flush );
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* @author Vova Feldman (@svovaf)
|
143 |
+
* @since 1.0.7
|
144 |
+
*
|
145 |
+
* @param bool $store
|
146 |
+
* @param string[] $exceptions Set of keys to keep and not clear.
|
147 |
+
*/
|
148 |
+
function clear_all( $store = true, $exceptions = array() ) {
|
149 |
+
$new_data = array();
|
150 |
+
foreach ( $exceptions as $key ) {
|
151 |
+
if ( isset( $this->_data[ $key ] ) ) {
|
152 |
+
$new_data[ $key ] = $this->_data[ $key ];
|
153 |
+
}
|
154 |
+
}
|
155 |
+
|
156 |
+
$this->_data = $new_data;
|
157 |
+
|
158 |
+
if ( $store ) {
|
159 |
+
$all_data = $this->get_all_data();
|
160 |
+
$all_data[ $this->_secondary_id ] = $this->_data;
|
161 |
+
$options_manager = $this->get_option_manager();
|
162 |
+
$options_manager->set_option( $this->_id, $all_data, true );
|
163 |
+
}
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Delete key-value storage.
|
168 |
+
*
|
169 |
+
* @author Vova Feldman (@svovaf)
|
170 |
+
* @since 1.0.9
|
171 |
+
*/
|
172 |
+
function delete() {
|
173 |
+
$this->_data = array();
|
174 |
+
|
175 |
+
$all_data = $this->get_all_data();
|
176 |
+
unset( $all_data[ $this->_secondary_id ] );
|
177 |
+
$options_manager = $this->get_option_manager();
|
178 |
+
$options_manager->set_option( $this->_id, $all_data, true );
|
179 |
+
}
|
180 |
+
|
181 |
+
/**
|
182 |
+
* @author Vova Feldman (@svovaf)
|
183 |
+
* @since 1.0.7
|
184 |
+
*
|
185 |
+
* @param string $key
|
186 |
+
* @param bool $store
|
187 |
+
*/
|
188 |
+
function remove( $key, $store = true ) {
|
189 |
+
if ( ! array_key_exists( $key, $this->_data ) ) {
|
190 |
+
return;
|
191 |
+
}
|
192 |
+
|
193 |
+
unset( $this->_data[ $key ] );
|
194 |
+
|
195 |
+
if ( $store ) {
|
196 |
+
$all_data = $this->get_all_data();
|
197 |
+
$all_data[ $this->_secondary_id ] = $this->_data;
|
198 |
+
$options_manager = $this->get_option_manager();
|
199 |
+
$options_manager->set_option( $this->_id, $all_data, true );
|
200 |
+
}
|
201 |
+
}
|
202 |
+
|
203 |
+
/**
|
204 |
+
* @author Vova Feldman (@svovaf)
|
205 |
+
* @since 1.0.7
|
206 |
+
*
|
207 |
+
* @param string $key
|
208 |
+
* @param mixed $default
|
209 |
+
*
|
210 |
+
* @return bool|\FS_Plugin
|
211 |
+
*/
|
212 |
+
function get( $key, $default = false ) {
|
213 |
+
return array_key_exists( $key, $this->_data ) ?
|
214 |
+
$this->_data[ $key ] :
|
215 |
+
$default;
|
216 |
+
}
|
217 |
+
|
218 |
+
|
219 |
+
/* ArrayAccess + Magic Access (better for refactoring)
|
220 |
+
-----------------------------------------------------------------------------------*/
|
221 |
+
function __set( $k, $v ) {
|
222 |
+
$this->store( $k, $v );
|
223 |
+
}
|
224 |
+
|
225 |
+
function __isset( $k ) {
|
226 |
+
return array_key_exists( $k, $this->_data );
|
227 |
+
}
|
228 |
+
|
229 |
+
function __unset( $k ) {
|
230 |
+
$this->remove( $k );
|
231 |
+
}
|
232 |
+
|
233 |
+
function __get( $k ) {
|
234 |
+
return $this->get( $k, null );
|
235 |
+
}
|
236 |
+
|
237 |
+
function offsetSet( $k, $v ) {
|
238 |
+
if ( is_null( $k ) ) {
|
239 |
+
throw new Exception( 'Can\'t append value to request params.' );
|
240 |
+
} else {
|
241 |
+
$this->{$k} = $v;
|
242 |
+
}
|
243 |
+
}
|
244 |
+
|
245 |
+
function offsetExists( $k ) {
|
246 |
+
return array_key_exists( $k, $this->_data );
|
247 |
+
}
|
248 |
+
|
249 |
+
function offsetUnset( $k ) {
|
250 |
+
unset( $this->$k );
|
251 |
+
}
|
252 |
+
|
253 |
+
function offsetGet( $k ) {
|
254 |
+
return $this->get( $k, null );
|
255 |
+
}
|
256 |
+
|
257 |
+
/**
|
258 |
+
* (PHP 5 >= 5.0.0)<br/>
|
259 |
+
* Return the current element
|
260 |
+
*
|
261 |
+
* @link http://php.net/manual/en/iterator.current.php
|
262 |
+
* @return mixed Can return any type.
|
263 |
+
*/
|
264 |
+
public function current() {
|
265 |
+
return current( $this->_data );
|
266 |
+
}
|
267 |
+
|
268 |
+
/**
|
269 |
+
* (PHP 5 >= 5.0.0)<br/>
|
270 |
+
* Move forward to next element
|
271 |
+
*
|
272 |
+
* @link http://php.net/manual/en/iterator.next.php
|
273 |
+
* @return void Any returned value is ignored.
|
274 |
+
*/
|
275 |
+
public function next() {
|
276 |
+
next( $this->_data );
|
277 |
+
}
|
278 |
+
|
279 |
+
/**
|
280 |
+
* (PHP 5 >= 5.0.0)<br/>
|
281 |
+
* Return the key of the current element
|
282 |
+
*
|
283 |
+
* @link http://php.net/manual/en/iterator.key.php
|
284 |
+
* @return mixed scalar on success, or null on failure.
|
285 |
+
*/
|
286 |
+
public function key() {
|
287 |
+
return key( $this->_data );
|
288 |
+
}
|
289 |
+
|
290 |
+
/**
|
291 |
+
* (PHP 5 >= 5.0.0)<br/>
|
292 |
+
* Checks if current position is valid
|
293 |
+
*
|
294 |
+
* @link http://php.net/manual/en/iterator.valid.php
|
295 |
+
* @return boolean The return value will be casted to boolean and then evaluated.
|
296 |
+
* Returns true on success or false on failure.
|
297 |
+
*/
|
298 |
+
public function valid() {
|
299 |
+
$key = key( $this->_data );
|
300 |
+
|
301 |
+
return ( $key !== null && $key !== false );
|
302 |
+
}
|
303 |
+
|
304 |
+
/**
|
305 |
+
* (PHP 5 >= 5.0.0)<br/>
|
306 |
+
* Rewind the Iterator to the first element
|
307 |
+
*
|
308 |
+
* @link http://php.net/manual/en/iterator.rewind.php
|
309 |
+
* @return void Any returned value is ignored.
|
310 |
+
*/
|
311 |
+
public function rewind() {
|
312 |
+
reset( $this->_data );
|
313 |
+
}
|
314 |
+
|
315 |
+
/**
|
316 |
+
* (PHP 5 >= 5.1.0)<br/>
|
317 |
+
* Count elements of an object
|
318 |
+
*
|
319 |
+
* @link http://php.net/manual/en/countable.count.php
|
320 |
+
* @return int The custom count as an integer.
|
321 |
+
* </p>
|
322 |
+
* <p>
|
323 |
+
* The return value is cast to an integer.
|
324 |
+
*/
|
325 |
+
public function count() {
|
326 |
+
return count( $this->_data );
|
327 |
+
}
|
328 |
}
|
freemius/includes/managers/class-fs-license-manager.php
CHANGED
@@ -1,104 +1,104 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.0.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 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.0.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
CHANGED
@@ -1,302 +1,353 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.0.3
|
7 |
-
*/
|
8 |
-
|
9 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
-
exit;
|
11 |
-
}
|
12 |
-
|
13 |
-
/**
|
14 |
-
* 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 |
-
|
215 |
-
|
216 |
-
|
217 |
-
}
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
*
|
251 |
-
* @
|
252 |
-
*
|
253 |
-
*
|
254 |
-
* @param
|
255 |
-
* @param bool $flush
|
256 |
-
*/
|
257 |
-
function
|
258 |
-
$this->_logger->entrance( 'option = ' . $option );
|
259 |
-
|
260 |
-
if (
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
302 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.0.3
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
/**
|
14 |
+
* 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 |
+
$value = isset( $this->_options[ $option ] ) ?
|
215 |
+
$this->_options[ $option ] :
|
216 |
+
$default;
|
217 |
+
} else if ( is_object( $this->_options ) ) {
|
218 |
+
$value = isset( $this->_options->{$option} ) ?
|
219 |
+
$this->_options->{$option} :
|
220 |
+
$default;
|
221 |
+
} else {
|
222 |
+
$value = $default;
|
223 |
+
}
|
224 |
+
|
225 |
+
/**
|
226 |
+
* If it's an object, return a clone of the object, otherwise,
|
227 |
+
* external changes of the object will actually change the value
|
228 |
+
* of the object in the options manager which may lead to an unexpected
|
229 |
+
* behaviour and data integrity when a store() call is triggered.
|
230 |
+
*
|
231 |
+
* Example:
|
232 |
+
* $object1 = $options->get_option( 'object1' );
|
233 |
+
* $object1->x = 123;
|
234 |
+
*
|
235 |
+
* $object2 = $options->get_option( 'object2' );
|
236 |
+
* $object2->y = 'dummy';
|
237 |
+
*
|
238 |
+
* $options->set_option( 'object2', $object2, true );
|
239 |
+
*
|
240 |
+
* If we don't return a clone of option 'object1', setting 'object2'
|
241 |
+
* will also store the updated value of 'object1' which is quite not
|
242 |
+
* an expected behaviour.
|
243 |
+
*
|
244 |
+
* @author Vova Feldman
|
245 |
+
*/
|
246 |
+
return is_object($value) ? clone $value : $value;
|
247 |
+
}
|
248 |
+
|
249 |
+
/**
|
250 |
+
* @author Vova Feldman (@svovaf)
|
251 |
+
* @since 1.0.3
|
252 |
+
*
|
253 |
+
* @param string $option
|
254 |
+
* @param mixed $value
|
255 |
+
* @param bool $flush
|
256 |
+
*/
|
257 |
+
function set_option( $option, $value, $flush = false ) {
|
258 |
+
$this->_logger->entrance( 'option = ' . $option );
|
259 |
+
|
260 |
+
if ( ! $this->is_loaded() ) {
|
261 |
+
$this->clear();
|
262 |
+
}
|
263 |
+
|
264 |
+
/**
|
265 |
+
* If it's an object, store a clone of the object, otherwise,
|
266 |
+
* external changes of the object will actually change the value
|
267 |
+
* of the object in the options manager which may lead to an unexpected
|
268 |
+
* behaviour and data integrity when a store() call is triggered.
|
269 |
+
*
|
270 |
+
* Example:
|
271 |
+
* $object1 = new stdClass();
|
272 |
+
* $object1->x = 123;
|
273 |
+
*
|
274 |
+
* $options->set_option( 'object1', $object1 );
|
275 |
+
*
|
276 |
+
* $object1->x = 456;
|
277 |
+
*
|
278 |
+
* $options->set_option( 'object2', $object2, true );
|
279 |
+
*
|
280 |
+
* If we don't set the option as a clone of option 'object1', setting 'object2'
|
281 |
+
* will also store the updated value of 'object1' ($object1->x = 456 instead of
|
282 |
+
* $object1->x = 123) which is quite not an expected behaviour.
|
283 |
+
*
|
284 |
+
* @author Vova Feldman
|
285 |
+
*/
|
286 |
+
$copy = is_object($value) ? clone $value : $value;
|
287 |
+
|
288 |
+
if ( is_array( $this->_options ) ) {
|
289 |
+
$this->_options[ $option ] = $copy;
|
290 |
+
} else if ( is_object( $this->_options ) ) {
|
291 |
+
$this->_options->{$option} = $copy;
|
292 |
+
}
|
293 |
+
|
294 |
+
if ( $flush ) {
|
295 |
+
$this->store();
|
296 |
+
}
|
297 |
+
}
|
298 |
+
|
299 |
+
/**
|
300 |
+
* Unset option.
|
301 |
+
*
|
302 |
+
* @author Vova Feldman (@svovaf)
|
303 |
+
* @since 1.0.3
|
304 |
+
*
|
305 |
+
* @param string $option
|
306 |
+
* @param bool $flush
|
307 |
+
*/
|
308 |
+
function unset_option( $option, $flush = false ) {
|
309 |
+
$this->_logger->entrance( 'option = ' . $option );
|
310 |
+
|
311 |
+
if ( is_array( $this->_options ) ) {
|
312 |
+
if ( ! isset( $this->_options[ $option ] ) ) {
|
313 |
+
return;
|
314 |
+
}
|
315 |
+
|
316 |
+
unset( $this->_options[ $option ] );
|
317 |
+
|
318 |
+
} else if ( is_object( $this->_options ) ) {
|
319 |
+
if ( ! isset( $this->_options->{$option} ) ) {
|
320 |
+
return;
|
321 |
+
}
|
322 |
+
|
323 |
+
unset( $this->_options->{$option} );
|
324 |
+
}
|
325 |
+
|
326 |
+
if ( $flush ) {
|
327 |
+
$this->store();
|
328 |
+
}
|
329 |
+
}
|
330 |
+
|
331 |
+
/**
|
332 |
+
* Dump options to database.
|
333 |
+
*
|
334 |
+
* @author Vova Feldman (@svovaf)
|
335 |
+
* @since 1.0.3
|
336 |
+
*/
|
337 |
+
function store() {
|
338 |
+
$this->_logger->entrance();
|
339 |
+
|
340 |
+
$option_name = $this->_get_option_manager_name();
|
341 |
+
|
342 |
+
if ( $this->_logger->is_on() ) {
|
343 |
+
$this->_logger->info( $option_name . ' = ' . var_export( $this->_options, true ) );
|
344 |
+
}
|
345 |
+
|
346 |
+
// Update DB.
|
347 |
+
update_option( $option_name, $this->_options );
|
348 |
+
|
349 |
+
if ( ! WP_FS__DEBUG_SDK ) {
|
350 |
+
wp_cache_set( $option_name, $this->_options, WP_FS__SLUG );
|
351 |
+
}
|
352 |
+
}
|
353 |
}
|
freemius/includes/managers/class-fs-plan-manager.php
CHANGED
@@ -1,162 +1,162 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.0.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 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.0.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
CHANGED
@@ -1,220 +1,220 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.0.6
|
7 |
-
*/
|
8 |
-
|
9 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
-
exit;
|
11 |
-
}
|
12 |
-
|
13 |
-
class FS_Plugin_Manager {
|
14 |
-
/**
|
15 |
-
* @since 1.2.2
|
16 |
-
*
|
17 |
-
* @var string|number
|
18 |
-
*/
|
19 |
-
protected $_module_id;
|
20 |
-
/**
|
21 |
-
* @since 1.2.2
|
22 |
-
*
|
23 |
-
* @var FS_Plugin
|
24 |
-
*/
|
25 |
-
protected $_module;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* @var FS_Plugin_Manager[]
|
29 |
-
*/
|
30 |
-
private static $_instances = array();
|
31 |
-
/**
|
32 |
-
* @var FS_Logger
|
33 |
-
*/
|
34 |
-
protected $_logger;
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Option names
|
38 |
-
*
|
39 |
-
* @author Leo Fajardo (@leorw)
|
40 |
-
* @since 1.2.2
|
41 |
-
*/
|
42 |
-
const OPTION_NAME_PLUGINS = 'plugins';
|
43 |
-
const OPTION_NAME_THEMES = 'themes';
|
44 |
-
|
45 |
-
/**
|
46 |
-
* @param string|number $module_id
|
47 |
-
*
|
48 |
-
* @return FS_Plugin_Manager
|
49 |
-
*/
|
50 |
-
static function instance( $module_id ) {
|
51 |
-
$key = 'm_' . $module_id;
|
52 |
-
|
53 |
-
if ( ! isset( self::$_instances[ $key ] ) ) {
|
54 |
-
self::$_instances[ $key ] = new FS_Plugin_Manager( $module_id );
|
55 |
-
}
|
56 |
-
|
57 |
-
return self::$_instances[ $key ];
|
58 |
-
}
|
59 |
-
|
60 |
-
/**
|
61 |
-
* @param string|number $module_id
|
62 |
-
*/
|
63 |
-
protected function __construct( $module_id ) {
|
64 |
-
$this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $module_id . '_' . 'plugins', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
|
65 |
-
$this->_module_id = $module_id;
|
66 |
-
|
67 |
-
$this->load();
|
68 |
-
}
|
69 |
-
|
70 |
-
protected function get_option_manager() {
|
71 |
-
return FS_Option_Manager::get_manager( WP_FS__ACCOUNTS_OPTION_NAME, true );
|
72 |
-
}
|
73 |
-
|
74 |
-
/**
|
75 |
-
* @author Leo Fajardo (@leorw)
|
76 |
-
* @since 1.2.2
|
77 |
-
*
|
78 |
-
* @param string|false $module_type "plugin", "theme", or "false" for all modules.
|
79 |
-
*
|
80 |
-
* @return array
|
81 |
-
*/
|
82 |
-
protected function get_all_modules( $module_type = false ) {
|
83 |
-
$option_manager = $this->get_option_manager();
|
84 |
-
|
85 |
-
if ( false !== $module_type ) {
|
86 |
-
return $option_manager->get_option( $module_type . 's', array() );
|
87 |
-
}
|
88 |
-
|
89 |
-
return array(
|
90 |
-
self::OPTION_NAME_PLUGINS => $option_manager->get_option( self::OPTION_NAME_PLUGINS, array() ),
|
91 |
-
self::OPTION_NAME_THEMES => $option_manager->get_option( self::OPTION_NAME_THEMES, array() ),
|
92 |
-
);
|
93 |
-
}
|
94 |
-
|
95 |
-
/**
|
96 |
-
* Load plugin data from local DB.
|
97 |
-
*
|
98 |
-
* @author Vova Feldman (@svovaf)
|
99 |
-
* @since 1.0.6
|
100 |
-
*/
|
101 |
-
function load() {
|
102 |
-
$all_modules = $this->get_all_modules();
|
103 |
-
|
104 |
-
if ( ! is_numeric( $this->_module_id ) ) {
|
105 |
-
unset( $all_modules[ self::OPTION_NAME_THEMES ] );
|
106 |
-
}
|
107 |
-
|
108 |
-
foreach ( $all_modules as $modules ) {
|
109 |
-
/**
|
110 |
-
* @since 1.2.2
|
111 |
-
*
|
112 |
-
* @var $modules FS_Plugin[]
|
113 |
-
*/
|
114 |
-
foreach ( $modules as $module ) {
|
115 |
-
$found_module = false;
|
116 |
-
|
117 |
-
/**
|
118 |
-
* If module ID is not numeric, it must be a plugin's slug.
|
119 |
-
*
|
120 |
-
* @author Leo Fajardo (@leorw)
|
121 |
-
* @since 1.2.2
|
122 |
-
*/
|
123 |
-
if ( ! is_numeric( $this->_module_id ) ) {
|
124 |
-
if ( $this->_module_id === $module->slug ) {
|
125 |
-
$this->_module_id = $module->id;
|
126 |
-
$found_module = true;
|
127 |
-
}
|
128 |
-
} else if ( $this->_module_id == $module->id ) {
|
129 |
-
$found_module = true;
|
130 |
-
}
|
131 |
-
|
132 |
-
if ( $found_module ) {
|
133 |
-
$this->_module = $module;
|
134 |
-
break;
|
135 |
-
}
|
136 |
-
}
|
137 |
-
}
|
138 |
-
}
|
139 |
-
|
140 |
-
/**
|
141 |
-
* Store plugin on local DB.
|
142 |
-
*
|
143 |
-
* @author Vova Feldman (@svovaf)
|
144 |
-
* @since 1.0.6
|
145 |
-
*
|
146 |
-
* @param bool|FS_Plugin $module
|
147 |
-
* @param bool $flush
|
148 |
-
*
|
149 |
-
* @return bool|\FS_Plugin
|
150 |
-
*/
|
151 |
-
function store( $module = false, $flush = true ) {
|
152 |
-
if ( false !== $module ) {
|
153 |
-
$this->_module = $module;
|
154 |
-
}
|
155 |
-
|
156 |
-
$all_modules = $this->get_all_modules( $this->_module->type );
|
157 |
-
$all_modules[ $this->_module->slug ] = $this->_module;
|
158 |
-
|
159 |
-
$options_manager = $this->get_option_manager();
|
160 |
-
$options_manager->set_option( $this->_module->type . 's', $all_modules, $flush );
|
161 |
-
|
162 |
-
return $this->_module;
|
163 |
-
}
|
164 |
-
|
165 |
-
/**
|
166 |
-
* Update local plugin data if different.
|
167 |
-
*
|
168 |
-
* @author Vova Feldman (@svovaf)
|
169 |
-
* @since 1.0.6
|
170 |
-
*
|
171 |
-
* @param \FS_Plugin $plugin
|
172 |
-
* @param bool $store
|
173 |
-
*
|
174 |
-
* @return bool True if plugin was updated.
|
175 |
-
*/
|
176 |
-
function update( FS_Plugin $plugin, $store = true ) {
|
177 |
-
if ( ! ($this->_module instanceof FS_Plugin ) ||
|
178 |
-
$this->_module->slug != $plugin->slug ||
|
179 |
-
$this->_module->public_key != $plugin->public_key ||
|
180 |
-
$this->_module->secret_key != $plugin->secret_key ||
|
181 |
-
$this->_module->parent_plugin_id != $plugin->parent_plugin_id ||
|
182 |
-
$this->_module->title != $plugin->title
|
183 |
-
) {
|
184 |
-
$this->store( $plugin, $store );
|
185 |
-
|
186 |
-
return true;
|
187 |
-
}
|
188 |
-
|
189 |
-
return false;
|
190 |
-
}
|
191 |
-
|
192 |
-
/**
|
193 |
-
* @author Vova Feldman (@svovaf)
|
194 |
-
* @since 1.0.6
|
195 |
-
*
|
196 |
-
* @param FS_Plugin $plugin
|
197 |
-
* @param bool $store
|
198 |
-
*/
|
199 |
-
function set( FS_Plugin $plugin, $store = false ) {
|
200 |
-
$this->_module = $plugin;
|
201 |
-
|
202 |
-
if ( $store ) {
|
203 |
-
$this->store();
|
204 |
-
}
|
205 |
-
}
|
206 |
-
|
207 |
-
/**
|
208 |
-
* @author Vova Feldman (@svovaf)
|
209 |
-
* @since 1.0.6
|
210 |
-
*
|
211 |
-
* @return bool|\FS_Plugin
|
212 |
-
*/
|
213 |
-
function get() {
|
214 |
-
return isset( $this->_module ) ?
|
215 |
-
$this->_module :
|
216 |
-
false;
|
217 |
-
}
|
218 |
-
|
219 |
-
|
220 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.0.6
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
class FS_Plugin_Manager {
|
14 |
+
/**
|
15 |
+
* @since 1.2.2
|
16 |
+
*
|
17 |
+
* @var string|number
|
18 |
+
*/
|
19 |
+
protected $_module_id;
|
20 |
+
/**
|
21 |
+
* @since 1.2.2
|
22 |
+
*
|
23 |
+
* @var FS_Plugin
|
24 |
+
*/
|
25 |
+
protected $_module;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @var FS_Plugin_Manager[]
|
29 |
+
*/
|
30 |
+
private static $_instances = array();
|
31 |
+
/**
|
32 |
+
* @var FS_Logger
|
33 |
+
*/
|
34 |
+
protected $_logger;
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Option names
|
38 |
+
*
|
39 |
+
* @author Leo Fajardo (@leorw)
|
40 |
+
* @since 1.2.2
|
41 |
+
*/
|
42 |
+
const OPTION_NAME_PLUGINS = 'plugins';
|
43 |
+
const OPTION_NAME_THEMES = 'themes';
|
44 |
+
|
45 |
+
/**
|
46 |
+
* @param string|number $module_id
|
47 |
+
*
|
48 |
+
* @return FS_Plugin_Manager
|
49 |
+
*/
|
50 |
+
static function instance( $module_id ) {
|
51 |
+
$key = 'm_' . $module_id;
|
52 |
+
|
53 |
+
if ( ! isset( self::$_instances[ $key ] ) ) {
|
54 |
+
self::$_instances[ $key ] = new FS_Plugin_Manager( $module_id );
|
55 |
+
}
|
56 |
+
|
57 |
+
return self::$_instances[ $key ];
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* @param string|number $module_id
|
62 |
+
*/
|
63 |
+
protected function __construct( $module_id ) {
|
64 |
+
$this->_logger = FS_Logger::get_logger( WP_FS__SLUG . '_' . $module_id . '_' . 'plugins', WP_FS__DEBUG_SDK, WP_FS__ECHO_DEBUG_SDK );
|
65 |
+
$this->_module_id = $module_id;
|
66 |
+
|
67 |
+
$this->load();
|
68 |
+
}
|
69 |
+
|
70 |
+
protected function get_option_manager() {
|
71 |
+
return FS_Option_Manager::get_manager( WP_FS__ACCOUNTS_OPTION_NAME, true );
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* @author Leo Fajardo (@leorw)
|
76 |
+
* @since 1.2.2
|
77 |
+
*
|
78 |
+
* @param string|false $module_type "plugin", "theme", or "false" for all modules.
|
79 |
+
*
|
80 |
+
* @return array
|
81 |
+
*/
|
82 |
+
protected function get_all_modules( $module_type = false ) {
|
83 |
+
$option_manager = $this->get_option_manager();
|
84 |
+
|
85 |
+
if ( false !== $module_type ) {
|
86 |
+
return $option_manager->get_option( $module_type . 's', array() );
|
87 |
+
}
|
88 |
+
|
89 |
+
return array(
|
90 |
+
self::OPTION_NAME_PLUGINS => $option_manager->get_option( self::OPTION_NAME_PLUGINS, array() ),
|
91 |
+
self::OPTION_NAME_THEMES => $option_manager->get_option( self::OPTION_NAME_THEMES, array() ),
|
92 |
+
);
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Load plugin data from local DB.
|
97 |
+
*
|
98 |
+
* @author Vova Feldman (@svovaf)
|
99 |
+
* @since 1.0.6
|
100 |
+
*/
|
101 |
+
function load() {
|
102 |
+
$all_modules = $this->get_all_modules();
|
103 |
+
|
104 |
+
if ( ! is_numeric( $this->_module_id ) ) {
|
105 |
+
unset( $all_modules[ self::OPTION_NAME_THEMES ] );
|
106 |
+
}
|
107 |
+
|
108 |
+
foreach ( $all_modules as $modules ) {
|
109 |
+
/**
|
110 |
+
* @since 1.2.2
|
111 |
+
*
|
112 |
+
* @var $modules FS_Plugin[]
|
113 |
+
*/
|
114 |
+
foreach ( $modules as $module ) {
|
115 |
+
$found_module = false;
|
116 |
+
|
117 |
+
/**
|
118 |
+
* If module ID is not numeric, it must be a plugin's slug.
|
119 |
+
*
|
120 |
+
* @author Leo Fajardo (@leorw)
|
121 |
+
* @since 1.2.2
|
122 |
+
*/
|
123 |
+
if ( ! is_numeric( $this->_module_id ) ) {
|
124 |
+
if ( $this->_module_id === $module->slug ) {
|
125 |
+
$this->_module_id = $module->id;
|
126 |
+
$found_module = true;
|
127 |
+
}
|
128 |
+
} else if ( $this->_module_id == $module->id ) {
|
129 |
+
$found_module = true;
|
130 |
+
}
|
131 |
+
|
132 |
+
if ( $found_module ) {
|
133 |
+
$this->_module = $module;
|
134 |
+
break;
|
135 |
+
}
|
136 |
+
}
|
137 |
+
}
|
138 |
+
}
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Store plugin on local DB.
|
142 |
+
*
|
143 |
+
* @author Vova Feldman (@svovaf)
|
144 |
+
* @since 1.0.6
|
145 |
+
*
|
146 |
+
* @param bool|FS_Plugin $module
|
147 |
+
* @param bool $flush
|
148 |
+
*
|
149 |
+
* @return bool|\FS_Plugin
|
150 |
+
*/
|
151 |
+
function store( $module = false, $flush = true ) {
|
152 |
+
if ( false !== $module ) {
|
153 |
+
$this->_module = $module;
|
154 |
+
}
|
155 |
+
|
156 |
+
$all_modules = $this->get_all_modules( $this->_module->type );
|
157 |
+
$all_modules[ $this->_module->slug ] = $this->_module;
|
158 |
+
|
159 |
+
$options_manager = $this->get_option_manager();
|
160 |
+
$options_manager->set_option( $this->_module->type . 's', $all_modules, $flush );
|
161 |
+
|
162 |
+
return $this->_module;
|
163 |
+
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* Update local plugin data if different.
|
167 |
+
*
|
168 |
+
* @author Vova Feldman (@svovaf)
|
169 |
+
* @since 1.0.6
|
170 |
+
*
|
171 |
+
* @param \FS_Plugin $plugin
|
172 |
+
* @param bool $store
|
173 |
+
*
|
174 |
+
* @return bool True if plugin was updated.
|
175 |
+
*/
|
176 |
+
function update( FS_Plugin $plugin, $store = true ) {
|
177 |
+
if ( ! ($this->_module instanceof FS_Plugin ) ||
|
178 |
+
$this->_module->slug != $plugin->slug ||
|
179 |
+
$this->_module->public_key != $plugin->public_key ||
|
180 |
+
$this->_module->secret_key != $plugin->secret_key ||
|
181 |
+
$this->_module->parent_plugin_id != $plugin->parent_plugin_id ||
|
182 |
+
$this->_module->title != $plugin->title
|
183 |
+
) {
|
184 |
+
$this->store( $plugin, $store );
|
185 |
+
|
186 |
+
return true;
|
187 |
+
}
|
188 |
+
|
189 |
+
return false;
|
190 |
+
}
|
191 |
+
|
192 |
+
/**
|
193 |
+
* @author Vova Feldman (@svovaf)
|
194 |
+
* @since 1.0.6
|
195 |
+
*
|
196 |
+
* @param FS_Plugin $plugin
|
197 |
+
* @param bool $store
|
198 |
+
*/
|
199 |
+
function set( FS_Plugin $plugin, $store = false ) {
|
200 |
+
$this->_module = $plugin;
|
201 |
+
|
202 |
+
if ( $store ) {
|
203 |
+
$this->store();
|
204 |
+
}
|
205 |
+
}
|
206 |
+
|
207 |
+
/**
|
208 |
+
* @author Vova Feldman (@svovaf)
|
209 |
+
* @since 1.0.6
|
210 |
+
*
|
211 |
+
* @return bool|\FS_Plugin
|
212 |
+
*/
|
213 |
+
function get() {
|
214 |
+
return isset( $this->_module ) ?
|
215 |
+
$this->_module :
|
216 |
+
false;
|
217 |
+
}
|
218 |
+
|
219 |
+
|
220 |
}
|
freemius/includes/managers/index.php
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
<?php
|
2 |
-
// Silence is golden.
|
3 |
// Hide file structure from users on unprotected servers.
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
3 |
// Hide file structure from users on unprotected servers.
|
freemius/includes/sdk/Exceptions/index.php
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
<?php
|
2 |
-
// Silence is golden.
|
3 |
// Hide file structure from users on unprotected servers.
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
3 |
// Hide file structure from users on unprotected servers.
|
freemius/includes/sdk/FreemiusWordPress.php
CHANGED
@@ -263,6 +263,8 @@
|
|
263 |
|
264 |
/**
|
265 |
* Get API request URL signed via query string.
|
|
|
|
|
266 |
*
|
267 |
* @param string $pPath
|
268 |
*
|
@@ -270,20 +272,19 @@
|
|
270 |
*
|
271 |
* @return string
|
272 |
*/
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
}
|
287 |
|
288 |
/**
|
289 |
* @author Vova Feldman
|
@@ -420,13 +421,19 @@
|
|
420 |
$matches = array();
|
421 |
$regex = '/Failed to connect to ([^:].*): Network is unreachable/';
|
422 |
if ( preg_match( $regex, $result->get_error_message( 'http_request_failed' ), $matches ) ) {
|
423 |
-
|
|
|
|
|
|
|
|
|
|
|
424 |
// error_log('Invalid IPv6 configuration on server, Please disable or get native IPv6 on your server.');
|
425 |
-
|
426 |
-
|
427 |
|
428 |
-
|
429 |
-
|
|
|
430 |
}
|
431 |
}
|
432 |
}
|
263 |
|
264 |
/**
|
265 |
* Get API request URL signed via query string.
|
266 |
+
*
|
267 |
+
* @since 1.2.3 Stopped using http_build_query(). Instead, use urlencode(). In some environments the encoding of http_build_query() can generate a URL that once used with a redirect, the `&` querystring separator is escaped to `&` which breaks the URL (Added by @svovaf).
|
268 |
*
|
269 |
* @param string $pPath
|
270 |
*
|
272 |
*
|
273 |
* @return string
|
274 |
*/
|
275 |
+
function GetSignedUrl( $pPath ) {
|
276 |
+
$resource = explode( '?', $this->CanonizePath( $pPath ) );
|
277 |
+
$pResourceUrl = $resource[0];
|
278 |
+
|
279 |
+
$auth = $this->GenerateAuthorizationParams( $pResourceUrl );
|
280 |
+
|
281 |
+
return Freemius_Api_WordPress::GetUrl(
|
282 |
+
$pResourceUrl . '?' .
|
283 |
+
( 1 < count( $resource ) && ! empty( $resource[1] ) ? $resource[1] . '&' : '' ) .
|
284 |
+
'authorization=' . urlencode( $auth['authorization'] ) .
|
285 |
+
'&auth_date=' . urlencode( $auth['date'] )
|
286 |
+
, $this->_isSandbox );
|
287 |
+
}
|
|
|
288 |
|
289 |
/**
|
290 |
* @author Vova Feldman
|
421 |
$matches = array();
|
422 |
$regex = '/Failed to connect to ([^:].*): Network is unreachable/';
|
423 |
if ( preg_match( $regex, $result->get_error_message( 'http_request_failed' ), $matches ) ) {
|
424 |
+
/**
|
425 |
+
* Validate IP before calling `inet_pton()` to avoid PHP un-catchable warning.
|
426 |
+
* @author Vova Feldman (@svovaf)
|
427 |
+
*/
|
428 |
+
if ( filter_var( $matches[1], FILTER_VALIDATE_IP ) ) {
|
429 |
+
if ( strlen( inet_pton( $matches[1] ) ) === 16 ) {
|
430 |
// error_log('Invalid IPv6 configuration on server, Please disable or get native IPv6 on your server.');
|
431 |
+
// Hook to an action triggered just before cURL is executed to resolve the IP version to v4.
|
432 |
+
add_action( 'http_api_curl', 'Freemius_Api_WordPress::CurlResolveToIPv4', 10, 1 );
|
433 |
|
434 |
+
// Re-run request.
|
435 |
+
$result = self::ExecuteRequest( $request_url, $pWPRemoteArgs );
|
436 |
+
}
|
437 |
}
|
438 |
}
|
439 |
}
|
freemius/includes/sdk/LICENSE.txt
CHANGED
@@ -1,340 +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 |
-
|
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
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
<?php
|
2 |
-
// Silence is golden.
|
3 |
// Hide file structure from users on unprotected servers.
|
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
CHANGED
@@ -1,47 +1,47 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* @package Freemius
|
4 |
-
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
-
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
-
* @since 1.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 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Freemius
|
4 |
+
* @copyright Copyright (c) 2015, Freemius, Inc.
|
5 |
+
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
|
6 |
+
* @since 1.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
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
<?php
|
2 |
-
// Silence is golden.
|
3 |
// Hide file structure from users on unprotected servers.
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
3 |
// Hide file structure from users on unprotected servers.
|
freemius/index.php
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
<?php
|
2 |
-
// Silence is golden.
|
3 |
// Hide file structure from users on unprotected servers.
|
1 |
+
<?php
|
2 |
+
// Silence is golden.
|
3 |
// Hide file structure from users on unprotected servers.
|
freemius/languages/freemius-da_DK.po
CHANGED
@@ -1,1826 +1,1826 @@
|
|
1 |
-
# Copyright (C) 2017 freemius
|
2 |
-
# This file is distributed under the same license as the freemius package.
|
3 |
-
# Translators:
|
4 |
-
# Joachim Jensen <jv@intox.dk>, 2016-2017
|
5 |
-
msgid ""
|
6 |
-
msgstr ""
|
7 |
-
"Project-Id-Version: WordPress SDK\n"
|
8 |
-
"Report-Msgid-Bugs-To: https://github.com/Freemius/wordpress-sdk/issues\n"
|
9 |
-
"POT-Creation-Date: \n"
|
10 |
-
"PO-Revision-Date: 2017-08-24 12:32+0000\n"
|
11 |
-
"Last-Translator: Vova Feldman <vova@freemius.com>\n"
|
12 |
-
"Language: da_DK\n"
|
13 |
-
"Language-Team: Danish (Denmark) (http://www.transifex.com/freemius/wordpress-sdk/language/da_DK/)\n"
|
14 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
15 |
-
"Content-Transfer-Encoding: 8bit\n"
|
16 |
-
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
17 |
-
"MIME-Version: 1.0\n"
|
18 |
-
"X-Poedit-Basepath: ..\n"
|
19 |
-
"X-Poedit-KeywordsList: _fs_text;_fs_echo;_fs_esc_attr;_fs_esc_attr_echo;_fs_esc_html;_fs_esc_html_echo;_fs_x:1,2c;_fs_ex:1,2c;_fs_esc_attr_x:1,2c;_fs_esc_html_x:1,2c;_fs_n:1,2;_fs_n_noop:1,2;_fs_nx:1,2,4c;_fs_nx_noop:1,2,3c\n"
|
20 |
-
"X-Poedit-SearchPath-0: .\n"
|
21 |
-
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
22 |
-
"X-Poedit-SourceCharset: UTF-8\n"
|
23 |
-
|
24 |
-
#: includes/i18n.php:37
|
25 |
-
msgid "Account"
|
26 |
-
msgstr "Konto"
|
27 |
-
|
28 |
-
#: includes/i18n.php:38
|
29 |
-
msgid "Add-On"
|
30 |
-
msgstr "Add-On"
|
31 |
-
|
32 |
-
#: includes/i18n.php:39
|
33 |
-
msgid "Contact Us"
|
34 |
-
msgstr "Kontakt os"
|
35 |
-
|
36 |
-
#: includes/i18n.php:40
|
37 |
-
msgid "Contact Support"
|
38 |
-
msgstr "Kontakt support"
|
39 |
-
|
40 |
-
#: includes/i18n.php:41
|
41 |
-
msgid "Change Ownership"
|
42 |
-
msgstr "Skift ejerskab"
|
43 |
-
|
44 |
-
#: includes/i18n.php:42
|
45 |
-
msgid "Support"
|
46 |
-
msgstr "Support"
|
47 |
-
|
48 |
-
#: includes/i18n.php:43
|
49 |
-
msgid "Support Forum"
|
50 |
-
msgstr "Supportforum"
|
51 |
-
|
52 |
-
#: includes/i18n.php:44
|
53 |
-
msgid "Add-Ons"
|
54 |
-
msgstr "Add-Ons"
|
55 |
-
|
56 |
-
#: includes/i18n.php:45
|
57 |
-
msgctxt "verb"
|
58 |
-
msgid "Upgrade"
|
59 |
-
msgstr "Opgrader"
|
60 |
-
|
61 |
-
#: includes/i18n.php:46
|
62 |
-
msgid "Awesome"
|
63 |
-
msgstr "Sejt"
|
64 |
-
|
65 |
-
#: includes/i18n.php:47
|
66 |
-
msgctxt "noun"
|
67 |
-
msgid "Pricing"
|
68 |
-
msgstr "Priser"
|
69 |
-
|
70 |
-
#: includes/i18n.php:48
|
71 |
-
msgctxt "noun"
|
72 |
-
msgid "Price"
|
73 |
-
msgstr "Pris"
|
74 |
-
|
75 |
-
#: includes/i18n.php:49
|
76 |
-
msgid "Unlimited Updates"
|
77 |
-
msgstr "Ubegrænsede opdateringer"
|
78 |
-
|
79 |
-
#: includes/i18n.php:50
|
80 |
-
msgctxt "verb"
|
81 |
-
msgid "Downgrade"
|
82 |
-
msgstr "Nedgrader"
|
83 |
-
|
84 |
-
#: includes/i18n.php:51
|
85 |
-
msgctxt "verb"
|
86 |
-
msgid "Cancel Subscription"
|
87 |
-
msgstr "Annuller abonnement"
|
88 |
-
|
89 |
-
#: includes/i18n.php:52
|
90 |
-
msgid "Cancel Trial"
|
91 |
-
msgstr "Annuller prøveperiode"
|
92 |
-
|
93 |
-
#: includes/i18n.php:53
|
94 |
-
msgid "Free Trial"
|
95 |
-
msgstr "Gratis prøveperiode"
|
96 |
-
|
97 |
-
#: includes/i18n.php:54
|
98 |
-
msgid "Start my free %s"
|
99 |
-
msgstr "Start min gratis %s"
|
100 |
-
|
101 |
-
#: includes/i18n.php:55
|
102 |
-
msgid "No commitment for %s - cancel anytime"
|
103 |
-
msgstr "Ingen bindinger ved %s - annuller når som helst"
|
104 |
-
|
105 |
-
#: includes/i18n.php:56
|
106 |
-
msgid "After your free %s, pay as little as %s"
|
107 |
-
msgstr "Efter din gratis %s er prisen kun %s"
|
108 |
-
|
109 |
-
#: includes/i18n.php:57
|
110 |
-
msgid "Details"
|
111 |
-
msgstr "Detaljer"
|
112 |
-
|
113 |
-
#: includes/i18n.php:58
|
114 |
-
msgid "Account Details"
|
115 |
-
msgstr "Kontodetaljer"
|
116 |
-
|
117 |
-
#: includes/i18n.php:59
|
118 |
-
msgctxt "verb"
|
119 |
-
msgid "Delete"
|
120 |
-
msgstr "Slet"
|
121 |
-
|
122 |
-
#: includes/i18n.php:60
|
123 |
-
msgctxt "verb"
|
124 |
-
msgid "Show"
|
125 |
-
msgstr "Vis"
|
126 |
-
|
127 |
-
#: includes/i18n.php:61
|
128 |
-
msgctxt "verb"
|
129 |
-
msgid "Hide"
|
130 |
-
msgstr "Skjul"
|
131 |
-
|
132 |
-
#: includes/i18n.php:62
|
133 |
-
msgctxt "verb"
|
134 |
-
msgid "Edit"
|
135 |
-
msgstr "Rediger"
|
136 |
-
|
137 |
-
#: includes/i18n.php:63
|
138 |
-
msgctxt "verb"
|
139 |
-
msgid "Update"
|
140 |
-
msgstr "Opdater"
|
141 |
-
|
142 |
-
#: includes/i18n.php:64
|
143 |
-
msgid "Date"
|
144 |
-
msgstr "Dato"
|
145 |
-
|
146 |
-
#: includes/i18n.php:65
|
147 |
-
msgid "Amount"
|
148 |
-
msgstr "Beløb"
|
149 |
-
|
150 |
-
#: includes/i18n.php:66
|
151 |
-
msgid "Invoice"
|
152 |
-
msgstr "Faktura"
|
153 |
-
|
154 |
-
#: includes/i18n.php:67
|
155 |
-
msgid "Billing"
|
156 |
-
msgstr "Betaling"
|
157 |
-
|
158 |
-
#: includes/i18n.php:68
|
159 |
-
msgid "Payments"
|
160 |
-
msgstr "Betalinger"
|
161 |
-
|
162 |
-
#: includes/i18n.php:69
|
163 |
-
msgid "Delete Account"
|
164 |
-
msgstr "Slet konto"
|
165 |
-
|
166 |
-
#: includes/i18n.php:70
|
167 |
-
msgctxt "as close a window"
|
168 |
-
msgid "Dismiss"
|
169 |
-
msgstr "Fjern"
|
170 |
-
|
171 |
-
#: includes/i18n.php:71
|
172 |
-
msgctxt "as product pricing plan"
|
173 |
-
msgid "Plan"
|
174 |
-
msgstr "Plan"
|
175 |
-
|
176 |
-
#: includes/i18n.php:72
|
177 |
-
msgid "Change Plan"
|
178 |
-
msgstr "Skift plan"
|
179 |
-
|
180 |
-
#: includes/i18n.php:73
|
181 |
-
msgctxt "as download professional version"
|
182 |
-
msgid "Download %s Version"
|
183 |
-
msgstr "Download %s Version"
|
184 |
-
|
185 |
-
#: includes/i18n.php:74
|
186 |
-
msgctxt "as download professional version now"
|
187 |
-
msgid "Download %s version now"
|
188 |
-
msgstr "Download %s version now"
|
189 |
-
|
190 |
-
#: includes/i18n.php:75
|
191 |
-
msgctxt "as download latest version"
|
192 |
-
msgid "Download Latest"
|
193 |
-
msgstr "Download seneste"
|
194 |
-
|
195 |
-
#: includes/i18n.php:76
|
196 |
-
msgctxt "E.g. you have a professional license."
|
197 |
-
msgid "You have a %s license."
|
198 |
-
msgstr "Du har en %s licens."
|
199 |
-
|
200 |
-
#: includes/i18n.php:77
|
201 |
-
msgid "New"
|
202 |
-
msgstr "Ny"
|
203 |
-
|
204 |
-
#: includes/i18n.php:78
|
205 |
-
msgid "Free"
|
206 |
-
msgstr "Gratis"
|
207 |
-
|
208 |
-
#: includes/i18n.php:79
|
209 |
-
msgctxt "as trial plan"
|
210 |
-
msgid "Trial"
|
211 |
-
msgstr "Prøveperiode"
|
212 |
-
|
213 |
-
#: includes/i18n.php:80
|
214 |
-
msgctxt "as starting a trial plan"
|
215 |
-
msgid "Start Trial"
|
216 |
-
msgstr "Start prøveperiode"
|
217 |
-
|
218 |
-
#: includes/i18n.php:81
|
219 |
-
msgctxt "verb"
|
220 |
-
msgid "Purchase"
|
221 |
-
msgstr "Køb"
|
222 |
-
|
223 |
-
#: includes/i18n.php:82
|
224 |
-
msgid "Purchase License"
|
225 |
-
msgstr "Køb licens"
|
226 |
-
|
227 |
-
#: includes/i18n.php:83
|
228 |
-
msgctxt "verb"
|
229 |
-
msgid "Buy"
|
230 |
-
msgstr "Køb"
|
231 |
-
|
232 |
-
#: includes/i18n.php:84
|
233 |
-
msgid "Buy License"
|
234 |
-
msgstr "Køb licens"
|
235 |
-
|
236 |
-
#: includes/i18n.php:85
|
237 |
-
msgid "Single Site License"
|
238 |
-
msgstr "Single Site License"
|
239 |
-
|
240 |
-
#: includes/i18n.php:86
|
241 |
-
msgid "Unlimited Licenses"
|
242 |
-
msgstr "Ubegrænsede licenser"
|
243 |
-
|
244 |
-
#: includes/i18n.php:87
|
245 |
-
msgid "Up to %s Sites"
|
246 |
-
msgstr "Op til %s websteder"
|
247 |
-
|
248 |
-
#: includes/i18n.php:88
|
249 |
-
msgid "%sRenew your license now%s to access version %s features and support."
|
250 |
-
msgstr "%sRenew your license now%s to access version %s features and support."
|
251 |
-
|
252 |
-
#: includes/i18n.php:89
|
253 |
-
msgid "Enter the email address you've used for the upgrade below and we will resend you the license key."
|
254 |
-
msgstr "Enter the email address you've used for the upgrade below and we will resend you the license key."
|
255 |
-
|
256 |
-
#: includes/i18n.php:90
|
257 |
-
msgctxt "e.g. Professional Plan"
|
258 |
-
msgid "%s Plan"
|
259 |
-
msgstr "%s Plan"
|
260 |
-
|
261 |
-
#: includes/i18n.php:91
|
262 |
-
msgid "You are just one step away - %s"
|
263 |
-
msgstr "Du mangler kun ét skridt - %s"
|
264 |
-
|
265 |
-
#: includes/i18n.php:92
|
266 |
-
msgctxt "%s - plugin name. As complete \"Jetpack\" activation now"
|
267 |
-
msgid "Complete \"%s\" Activation Now"
|
268 |
-
msgstr "Færdiggør aktivering af \"%s\" nu"
|
269 |
-
|
270 |
-
#: includes/i18n.php:94
|
271 |
-
msgid "We made a few tweaks to the %s, %s"
|
272 |
-
msgstr "We made a few tweaks to the %s, %s"
|
273 |
-
|
274 |
-
#: includes/i18n.php:95
|
275 |
-
msgid "Opt-in to make \"%s\" Better!"
|
276 |
-
msgstr "Tilmeld for at gøre \"%s\" bedre!"
|
277 |
-
|
278 |
-
#: includes/i18n.php:96
|
279 |
-
msgid "Error"
|
280 |
-
msgstr "Fejl"
|
281 |
-
|
282 |
-
#: includes/i18n.php:97
|
283 |
-
msgid "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
|
284 |
-
msgstr "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
|
285 |
-
|
286 |
-
#: includes/i18n.php:100
|
287 |
-
msgctxt "as expiration date"
|
288 |
-
msgid "Expiration"
|
289 |
-
msgstr "Expiration"
|
290 |
-
|
291 |
-
#: includes/i18n.php:101
|
292 |
-
msgctxt "as software license"
|
293 |
-
msgid "License"
|
294 |
-
msgstr "Licens"
|
295 |
-
|
296 |
-
#: includes/i18n.php:102
|
297 |
-
msgid "not verified"
|
298 |
-
msgstr "ikke verificeret"
|
299 |
-
|
300 |
-
#: includes/i18n.php:103
|
301 |
-
msgid "Verify Email"
|
302 |
-
msgstr "Verificer e-mail"
|
303 |
-
|
304 |
-
#: includes/i18n.php:104
|
305 |
-
msgctxt "e.g. expires in 2 months"
|
306 |
-
msgid "Expires in %s"
|
307 |
-
msgstr "Udløber om %s"
|
308 |
-
|
309 |
-
#: includes/i18n.php:105
|
310 |
-
msgctxt "e.g. auto renews in 2 months"
|
311 |
-
msgid "Auto renews in %s"
|
312 |
-
msgstr "Auto-fornyer om %s"
|
313 |
-
|
314 |
-
#: includes/i18n.php:106
|
315 |
-
msgid "No expiration"
|
316 |
-
msgstr "Udløber ikke"
|
317 |
-
|
318 |
-
#: includes/i18n.php:107
|
319 |
-
msgid "Expired"
|
320 |
-
msgstr "Udløbet"
|
321 |
-
|
322 |
-
#: includes/i18n.php:108
|
323 |
-
msgid "Cancelled"
|
324 |
-
msgstr "Annulleret"
|
325 |
-
|
326 |
-
#: includes/i18n.php:109
|
327 |
-
msgctxt "e.g. In 2 hours"
|
328 |
-
msgid "In %s"
|
329 |
-
msgstr "Om %s"
|
330 |
-
|
331 |
-
#: includes/i18n.php:110
|
332 |
-
msgctxt "e.g. 2 min ago"
|
333 |
-
msgid "%s ago"
|
334 |
-
msgstr "%s siden"
|
335 |
-
|
336 |
-
#: includes/i18n.php:112
|
337 |
-
msgid "%s or higher"
|
338 |
-
msgstr "%s eller højere"
|
339 |
-
|
340 |
-
#: includes/i18n.php:113
|
341 |
-
msgctxt "as plugin version"
|
342 |
-
msgid "Version"
|
343 |
-
msgstr "Version"
|
344 |
-
|
345 |
-
#: includes/i18n.php:114
|
346 |
-
msgid "Name"
|
347 |
-
msgstr "Navn"
|
348 |
-
|
349 |
-
#: includes/i18n.php:115
|
350 |
-
msgid "Email"
|
351 |
-
msgstr "E-mail"
|
352 |
-
|
353 |
-
#: includes/i18n.php:116
|
354 |
-
msgid "Email address"
|
355 |
-
msgstr "E-mailadresse"
|
356 |
-
|
357 |
-
#: includes/i18n.php:117
|
358 |
-
msgid "Verified"
|
359 |
-
msgstr "Verificeret"
|
360 |
-
|
361 |
-
#: includes/i18n.php:118
|
362 |
-
msgid "Module"
|
363 |
-
msgstr "Modul"
|
364 |
-
|
365 |
-
#: includes/i18n.php:119
|
366 |
-
msgid "Module Type"
|
367 |
-
msgstr "Modultype"
|
368 |
-
|
369 |
-
#: includes/i18n.php:120
|
370 |
-
msgid "Plugin"
|
371 |
-
msgstr "Plugin"
|
372 |
-
|
373 |
-
#: includes/i18n.php:121
|
374 |
-
msgid "Plugins"
|
375 |
-
msgstr "Plugins"
|
376 |
-
|
377 |
-
#: includes/i18n.php:122
|
378 |
-
msgid "Theme"
|
379 |
-
msgstr "Tema"
|
380 |
-
|
381 |
-
#: includes/i18n.php:123
|
382 |
-
msgid "Themes"
|
383 |
-
msgstr "Temaer"
|
384 |
-
|
385 |
-
#: includes/i18n.php:124
|
386 |
-
msgctxt "as file/folder path"
|
387 |
-
msgid "Path"
|
388 |
-
msgstr "Sti"
|
389 |
-
|
390 |
-
#: includes/i18n.php:125
|
391 |
-
msgid "Title"
|
392 |
-
msgstr "Titel"
|
393 |
-
|
394 |
-
#: includes/i18n.php:126
|
395 |
-
msgid "Free version"
|
396 |
-
msgstr "Gratis version"
|
397 |
-
|
398 |
-
#: includes/i18n.php:127
|
399 |
-
msgid "Premium version"
|
400 |
-
msgstr "Premium version"
|
401 |
-
|
402 |
-
#: includes/i18n.php:128
|
403 |
-
msgctxt "as WP plugin slug"
|
404 |
-
msgid "Slug"
|
405 |
-
msgstr "Kortnavn"
|
406 |
-
|
407 |
-
#: includes/i18n.php:129
|
408 |
-
msgid "ID"
|
409 |
-
msgstr "ID"
|
410 |
-
|
411 |
-
#: includes/i18n.php:130
|
412 |
-
msgid "Users"
|
413 |
-
msgstr "Brugere"
|
414 |
-
|
415 |
-
#: includes/i18n.php:131
|
416 |
-
msgid "%s Installs"
|
417 |
-
msgstr "%s installeringer"
|
418 |
-
|
419 |
-
#: includes/i18n.php:132
|
420 |
-
msgctxt "like websites"
|
421 |
-
msgid "Sites"
|
422 |
-
msgstr "Websteder"
|
423 |
-
|
424 |
-
#: includes/i18n.php:133
|
425 |
-
msgid "User ID"
|
426 |
-
msgstr "Bruger-ID"
|
427 |
-
|
428 |
-
#: includes/i18n.php:134
|
429 |
-
msgid "Site ID"
|
430 |
-
msgstr "Websteds-ID"
|
431 |
-
|
432 |
-
#: includes/i18n.php:135
|
433 |
-
msgid "Public Key"
|
434 |
-
msgstr "Offentlig nøgle"
|
435 |
-
|
436 |
-
#: includes/i18n.php:136
|
437 |
-
msgid "Secret Key"
|
438 |
-
msgstr "Privat nøgle"
|
439 |
-
|
440 |
-
#: includes/i18n.php:137
|
441 |
-
msgctxt "as secret encryption key missing"
|
442 |
-
msgid "No Secret"
|
443 |
-
msgstr "Ingen privat nøgle"
|
444 |
-
|
445 |
-
#: includes/i18n.php:138
|
446 |
-
msgid "No ID"
|
447 |
-
msgstr "Intet ID"
|
448 |
-
|
449 |
-
#: includes/i18n.php:139
|
450 |
-
msgctxt "as synchronize license"
|
451 |
-
msgid "Sync License"
|
452 |
-
msgstr "Synkroniser licens"
|
453 |
-
|
454 |
-
#: includes/i18n.php:140
|
455 |
-
msgctxt "as synchronize"
|
456 |
-
msgid "Sync"
|
457 |
-
msgstr "Synkroniser"
|
458 |
-
|
459 |
-
#: includes/i18n.php:141
|
460 |
-
msgid "Activate License"
|
461 |
-
msgstr "Aktiver licens"
|
462 |
-
|
463 |
-
#: includes/i18n.php:142
|
464 |
-
msgid "Activate Free Version"
|
465 |
-
msgstr "Aktiver gratis version"
|
466 |
-
|
467 |
-
#: includes/i18n.php:143
|
468 |
-
msgid "Please enter the license key that you received in the email right after the purchase:"
|
469 |
-
msgstr "Please enter the license key that you received in the email right after the purchase:"
|
470 |
-
|
471 |
-
#: includes/i18n.php:144
|
472 |
-
msgid "Activating license..."
|
473 |
-
msgstr "Aktiverer licens..."
|
474 |
-
|
475 |
-
#: includes/i18n.php:145
|
476 |
-
msgid "Change License"
|
477 |
-
msgstr "Skift licens"
|
478 |
-
|
479 |
-
#: includes/i18n.php:146
|
480 |
-
msgid "Update License"
|
481 |
-
msgstr "Opdater licens"
|
482 |
-
|
483 |
-
#: includes/i18n.php:147
|
484 |
-
msgid "Deactivate License"
|
485 |
-
msgstr "Deaktiver licens"
|
486 |
-
|
487 |
-
#: includes/i18n.php:148
|
488 |
-
msgid "Activate"
|
489 |
-
msgstr "Aktiver"
|
490 |
-
|
491 |
-
#: includes/i18n.php:149
|
492 |
-
msgid "Deactivate"
|
493 |
-
msgstr "Deaktiver"
|
494 |
-
|
495 |
-
#: includes/i18n.php:150
|
496 |
-
msgid "Skip & Deactivate"
|
497 |
-
msgstr "Spring over & deaktiver"
|
498 |
-
|
499 |
-
#: includes/i18n.php:151
|
500 |
-
msgid "Skip & %s"
|
501 |
-
msgstr "Spring over & %s"
|
502 |
-
|
503 |
-
#: includes/i18n.php:152
|
504 |
-
msgid "No - just deactivate"
|
505 |
-
msgstr "Nej - bare deaktiver"
|
506 |
-
|
507 |
-
#: includes/i18n.php:153
|
508 |
-
msgid "Yes - do your thing"
|
509 |
-
msgstr "Yes - do your thing"
|
510 |
-
|
511 |
-
#: includes/i18n.php:154
|
512 |
-
msgctxt "active mode"
|
513 |
-
msgid "Active"
|
514 |
-
msgstr "Aktiv"
|
515 |
-
|
516 |
-
#: includes/i18n.php:155
|
517 |
-
msgctxt "is active mode?"
|
518 |
-
msgid "Is Active"
|
519 |
-
msgstr "Er aktiv"
|
520 |
-
|
521 |
-
#: includes/i18n.php:156
|
522 |
-
msgid "Install Now"
|
523 |
-
msgstr "Installer nu"
|
524 |
-
|
525 |
-
#: includes/i18n.php:157
|
526 |
-
msgid "Install Update Now"
|
527 |
-
msgstr "Installer opdatering nu"
|
528 |
-
|
529 |
-
#: includes/i18n.php:158
|
530 |
-
msgid "More information about %s"
|
531 |
-
msgstr "Mere information om %s"
|
532 |
-
|
533 |
-
#: includes/i18n.php:159
|
534 |
-
msgid "Localhost"
|
535 |
-
msgstr "Localhost"
|
536 |
-
|
537 |
-
#: includes/i18n.php:160
|
538 |
-
msgctxt "as activate Professional plan"
|
539 |
-
msgid "Activate %s Plan"
|
540 |
-
msgstr "Aktiver %s plan"
|
541 |
-
|
542 |
-
#: includes/i18n.php:161
|
543 |
-
msgctxt "as 5 licenses left"
|
544 |
-
msgid "%s left"
|
545 |
-
msgstr "%s tilbage"
|
546 |
-
|
547 |
-
#: includes/i18n.php:162
|
548 |
-
msgid "Last license"
|
549 |
-
msgstr "Seneste license"
|
550 |
-
|
551 |
-
#: includes/i18n.php:163
|
552 |
-
msgid "What is your %s?"
|
553 |
-
msgstr "What is your %s?"
|
554 |
-
|
555 |
-
#: includes/i18n.php:164
|
556 |
-
msgid "Activate this add-on"
|
557 |
-
msgstr "Aktiver denne tilføjelse"
|
558 |
-
|
559 |
-
#: includes/i18n.php:165
|
560 |
-
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?"
|
561 |
-
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?"
|
562 |
-
|
563 |
-
#: includes/i18n.php:166
|
564 |
-
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?"
|
565 |
-
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?"
|
566 |
-
|
567 |
-
#: includes/i18n.php:167
|
568 |
-
msgid "Deletion is not temporary. Only delete if you no longer want to use this %s anymore. Are you sure you would like to continue with the deletion?"
|
569 |
-
msgstr "Deletion is not temporary. Only delete if you no longer want to use this %s anymore. Are you sure you would like to continue with the deletion?"
|
570 |
-
|
571 |
-
#: includes/i18n.php:168
|
572 |
-
msgid "Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s."
|
573 |
-
msgstr "Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s."
|
574 |
-
|
575 |
-
#: includes/i18n.php:169
|
576 |
-
msgid "Cancelling the trial will immediately block access to all premium features. Are you sure?"
|
577 |
-
msgstr "Cancelling the trial will immediately block access to all premium features. Are you sure?"
|
578 |
-
|
579 |
-
#: includes/i18n.php:170
|
580 |
-
msgid "You can still enjoy all %s features but you will not have access to %s updates and support."
|
581 |
-
msgstr "You can still enjoy all %s features but you will not have access to %s updates and support."
|
582 |
-
|
583 |
-
#: includes/i18n.php:171
|
584 |
-
msgid "Once your license expires you can still use the Free version but you will NOT have access to the %s features."
|
585 |
-
msgstr "Once your license expires you can still use the Free version but you will NOT have access to the %s features."
|
586 |
-
|
587 |
-
#: includes/i18n.php:172
|
588 |
-
msgid "Are you sure you want to proceed?"
|
589 |
-
msgstr "Er du sikker på, du vil fortsætte?"
|
590 |
-
|
591 |
-
#: includes/i18n.php:175
|
592 |
-
msgid "Add Ons for %s"
|
593 |
-
msgstr "Tilføjelser til %s"
|
594 |
-
|
595 |
-
#: includes/i18n.php:176
|
596 |
-
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."
|
597 |
-
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."
|
598 |
-
|
599 |
-
#: includes/i18n.php:178
|
600 |
-
msgid "Anonymous feedback"
|
601 |
-
msgstr "Anonym feedback"
|
602 |
-
|
603 |
-
#: includes/i18n.php:179
|
604 |
-
msgid "Quick feedback"
|
605 |
-
msgstr "Hurtig feedback"
|
606 |
-
|
607 |
-
#: includes/i18n.php:180
|
608 |
-
msgid "If you have a moment, please let us know why you are %s"
|
609 |
-
msgstr "If you have a moment, please let us know why you are %s"
|
610 |
-
|
611 |
-
#: includes/i18n.php:181
|
612 |
-
msgid "deactivating"
|
613 |
-
msgstr "deactivating"
|
614 |
-
|
615 |
-
#: includes/i18n.php:182
|
616 |
-
msgid "Deactivation"
|
617 |
-
msgstr "Deactivation"
|
618 |
-
|
619 |
-
#: includes/i18n.php:183
|
620 |
-
msgid "Theme Switch"
|
621 |
-
msgstr "Theme Switch"
|
622 |
-
|
623 |
-
#: includes/i18n.php:184
|
624 |
-
msgid "switching"
|
625 |
-
msgstr "switching"
|
626 |
-
|
627 |
-
#: includes/i18n.php:185
|
628 |
-
msgid "Switch"
|
629 |
-
msgstr "Switch"
|
630 |
-
|
631 |
-
#: includes/i18n.php:186
|
632 |
-
msgid "Activate %s"
|
633 |
-
msgstr "Activate %s"
|
634 |
-
|
635 |
-
#: includes/i18n.php:187
|
636 |
-
msgid "Yes - %s"
|
637 |
-
msgstr "Yes - %s"
|
638 |
-
|
639 |
-
#: includes/i18n.php:188
|
640 |
-
msgid "Submit & %s"
|
641 |
-
msgstr "Submit & %s"
|
642 |
-
|
643 |
-
#: includes/i18n.php:189
|
644 |
-
msgid "Cancel"
|
645 |
-
msgstr "Annuller"
|
646 |
-
|
647 |
-
#: includes/i18n.php:190
|
648 |
-
msgid "I no longer need the %s"
|
649 |
-
msgstr "I no longer need the %s"
|
650 |
-
|
651 |
-
#: includes/i18n.php:191
|
652 |
-
msgid "I found a better %s"
|
653 |
-
msgstr "I found a better %s"
|
654 |
-
|
655 |
-
#: includes/i18n.php:192
|
656 |
-
msgid "I only needed the %s for a short period"
|
657 |
-
msgstr "I only needed the %s for a short period"
|
658 |
-
|
659 |
-
#: includes/i18n.php:193
|
660 |
-
msgid "The %s broke my site"
|
661 |
-
msgstr "The %s broke my site"
|
662 |
-
|
663 |
-
#: includes/i18n.php:194
|
664 |
-
msgid "The %s suddenly stopped working"
|
665 |
-
msgstr "The %s suddenly stopped working"
|
666 |
-
|
667 |
-
#: includes/i18n.php:195
|
668 |
-
msgid "I can't pay for it anymore"
|
669 |
-
msgstr "Jeg kan ikke længere betale for det"
|
670 |
-
|
671 |
-
#: includes/i18n.php:196
|
672 |
-
msgid "It's a temporary deactivation. I'm just debugging an issue."
|
673 |
-
msgstr "Det er en midlertidig deaktivering. Jeg prøver at fejlfinde et problem."
|
674 |
-
|
675 |
-
#: includes/i18n.php:197
|
676 |
-
msgid "It's a temporary %s. I'm just debugging an issue."
|
677 |
-
msgstr "It's a temporary %s. I'm just debugging an issue."
|
678 |
-
|
679 |
-
#: includes/i18n.php:198
|
680 |
-
msgctxt ""
|
681 |
-
msgid "Other"
|
682 |
-
msgstr "Other"
|
683 |
-
|
684 |
-
#: includes/i18n.php:200
|
685 |
-
msgid "Kindly tell us the reason so we can improve."
|
686 |
-
msgstr "Fortæl os venligst årsagen, så vi kan forbedre det."
|
687 |
-
|
688 |
-
#: includes/i18n.php:201
|
689 |
-
msgid "What's the %s's name?"
|
690 |
-
msgstr "What's the %s's name?"
|
691 |
-
|
692 |
-
#: includes/i18n.php:202
|
693 |
-
msgid "What price would you feel comfortable paying?"
|
694 |
-
msgstr "What price would you feel comfortable paying?"
|
695 |
-
|
696 |
-
#: includes/i18n.php:203
|
697 |
-
msgid "I couldn't understand how to make it work"
|
698 |
-
msgstr "Jeg forstod ikke, hvordan jeg skulle få det til at fungere."
|
699 |
-
|
700 |
-
#: includes/i18n.php:204
|
701 |
-
msgid "The %s is great, but I need specific feature that you don't support"
|
702 |
-
msgstr "The %s is great, but I need specific feature that you don't support"
|
703 |
-
|
704 |
-
#: includes/i18n.php:205
|
705 |
-
msgid "The %s is not working"
|
706 |
-
msgstr "The %s is not working"
|
707 |
-
|
708 |
-
#: includes/i18n.php:206
|
709 |
-
msgid "It's not what I was looking for"
|
710 |
-
msgstr "Det er ikke, hvad jeg søgte"
|
711 |
-
|
712 |
-
#: includes/i18n.php:207
|
713 |
-
msgid "The %s didn't work as expected"
|
714 |
-
msgstr "The %s didn't work as expected"
|
715 |
-
|
716 |
-
#: includes/i18n.php:208
|
717 |
-
msgid "What feature?"
|
718 |
-
msgstr "Hvilken feature?"
|
719 |
-
|
720 |
-
#: includes/i18n.php:209
|
721 |
-
msgid "Kindly share what didn't work so we can fix it for future users..."
|
722 |
-
msgstr "Kindly share what didn't work so we can fix it for future users..."
|
723 |
-
|
724 |
-
#: includes/i18n.php:210
|
725 |
-
msgid "What you've been looking for?"
|
726 |
-
msgstr "What you've been looking for?"
|
727 |
-
|
728 |
-
#: includes/i18n.php:211
|
729 |
-
msgid "What did you expect?"
|
730 |
-
msgstr "Hvad forventede du?"
|
731 |
-
|
732 |
-
#: includes/i18n.php:212
|
733 |
-
msgid "The %s didn't work"
|
734 |
-
msgstr "The %s didn't work"
|
735 |
-
|
736 |
-
#: includes/i18n.php:213
|
737 |
-
msgid "I don't like to share my information with you"
|
738 |
-
msgstr "I don't like to share my information with you"
|
739 |
-
|
740 |
-
#: includes/i18n.php:214
|
741 |
-
msgid "You might have missed it, but you don't have to share any data and can just %s the opt-in."
|
742 |
-
msgstr "You might have missed it, but you don't have to share any data and can just %s the opt-in."
|
743 |
-
|
744 |
-
#: includes/i18n.php:218
|
745 |
-
msgctxt "greeting"
|
746 |
-
msgid "Hey %s,"
|
747 |
-
msgstr "Hey %s,"
|
748 |
-
|
749 |
-
#: includes/i18n.php:219
|
750 |
-
msgctxt "a greeting. E.g. Thanks John!"
|
751 |
-
msgid "Thanks %s!"
|
752 |
-
msgstr "Tak %s!"
|
753 |
-
|
754 |
-
#: includes/i18n.php:220
|
755 |
-
msgid "Never miss an important update - opt-in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s."
|
756 |
-
msgstr "Never miss an important update - opt-in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s."
|
757 |
-
|
758 |
-
#: includes/i18n.php:221
|
759 |
-
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."
|
760 |
-
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."
|
761 |
-
|
762 |
-
#: includes/i18n.php:222
|
763 |
-
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."
|
764 |
-
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."
|
765 |
-
|
766 |
-
#: includes/i18n.php:223
|
767 |
-
msgid "complete the install"
|
768 |
-
msgstr "færdiggør installeringen"
|
769 |
-
|
770 |
-
#: includes/i18n.php:224
|
771 |
-
msgid "start the trial"
|
772 |
-
msgstr "start prøveperioden"
|
773 |
-
|
774 |
-
#: includes/i18n.php:225
|
775 |
-
msgid "Thanks for purchasing %s! To get started, please enter your license key:"
|
776 |
-
msgstr "Thanks for purchasing %s! To get started, please enter your license key:"
|
777 |
-
|
778 |
-
#: includes/i18n.php:226
|
779 |
-
msgid "The %1$s will be periodically sending data to %2$s to check for security and feature updates, and verify the validity of your license."
|
780 |
-
msgstr "The %1$s will be periodically sending data to %2$s to check for security and feature updates, and verify the validity of your license."
|
781 |
-
|
782 |
-
#: includes/i18n.php:227
|
783 |
-
msgid "What permissions are being granted?"
|
784 |
-
msgstr "Hvilke tilladelser bliver givet?"
|
785 |
-
|
786 |
-
#: includes/i18n.php:228
|
787 |
-
msgid "Your Profile Overview"
|
788 |
-
msgstr "Overblik af din profil"
|
789 |
-
|
790 |
-
#: includes/i18n.php:229
|
791 |
-
msgid "Name and email address"
|
792 |
-
msgstr "Navn og e-mailadresse"
|
793 |
-
|
794 |
-
#: includes/i18n.php:230
|
795 |
-
msgid "Your Site Overview"
|
796 |
-
msgstr "Overblik af dit websted"
|
797 |
-
|
798 |
-
#: includes/i18n.php:231
|
799 |
-
msgid "Site URL, WP version, PHP info, plugins & themes"
|
800 |
-
msgstr "Websteds-URL, WP version, PHP info, plugins og temaer"
|
801 |
-
|
802 |
-
#: includes/i18n.php:232
|
803 |
-
msgid "Current %s Events"
|
804 |
-
msgstr "Current %s Events"
|
805 |
-
|
806 |
-
#: includes/i18n.php:233
|
807 |
-
msgid "Activation, deactivation and uninstall"
|
808 |
-
msgstr "Aktivering, deaktivering og afinstallering"
|
809 |
-
|
810 |
-
#: includes/i18n.php:234
|
811 |
-
msgid "Plugins & Themes"
|
812 |
-
msgstr "Plugins & Temaer"
|
813 |
-
|
814 |
-
#: includes/i18n.php:235
|
815 |
-
msgid "Titles, versions and state."
|
816 |
-
msgstr "Titler, versioner og tilstand."
|
817 |
-
|
818 |
-
#: includes/i18n.php:236
|
819 |
-
msgid "Admin Notices"
|
820 |
-
msgstr "Admin Notices"
|
821 |
-
|
822 |
-
#: includes/i18n.php:237
|
823 |
-
msgid "Newsletter"
|
824 |
-
msgstr "Nyhedsbrev"
|
825 |
-
|
826 |
-
#: includes/i18n.php:238
|
827 |
-
msgid "Updates, announcements, marketing, no spam"
|
828 |
-
msgstr "Updates, announcements, marketing, no spam"
|
829 |
-
|
830 |
-
#: includes/i18n.php:239
|
831 |
-
msgid "Privacy Policy"
|
832 |
-
msgstr "Privatlivspolitik"
|
833 |
-
|
834 |
-
#: includes/i18n.php:240
|
835 |
-
msgid "Terms of Service"
|
836 |
-
msgstr "Servicevilkår"
|
837 |
-
|
838 |
-
#: includes/i18n.php:241
|
839 |
-
msgctxt "as activating plugin"
|
840 |
-
msgid "Activating"
|
841 |
-
msgstr "Aktiverer"
|
842 |
-
|
843 |
-
#: includes/i18n.php:242
|
844 |
-
msgctxt "as in the process of sending an email"
|
845 |
-
msgid "Sending email"
|
846 |
-
msgstr "Sender e-mail"
|
847 |
-
|
848 |
-
#: includes/i18n.php:243
|
849 |
-
msgctxt "button label"
|
850 |
-
msgid "Allow & Continue"
|
851 |
-
msgstr "Tillad & Fortsæt"
|
852 |
-
|
853 |
-
#: includes/i18n.php:244
|
854 |
-
msgctxt "button label"
|
855 |
-
msgid "Agree & Activate License"
|
856 |
-
msgstr "Accepter & aktiver licens"
|
857 |
-
|
858 |
-
#: includes/i18n.php:245
|
859 |
-
msgctxt "verb"
|
860 |
-
msgid "Skip"
|
861 |
-
msgstr "Spring over"
|
862 |
-
|
863 |
-
#: includes/i18n.php:246
|
864 |
-
msgid "Click here to use the plugin anonymously"
|
865 |
-
msgstr "Klik her for at benytte pluginnet anonymt"
|
866 |
-
|
867 |
-
#: includes/i18n.php:247
|
868 |
-
msgid "Re-send activation email"
|
869 |
-
msgstr "Gensend e-mail om aktivering"
|
870 |
-
|
871 |
-
#: includes/i18n.php:248
|
872 |
-
msgid "License key"
|
873 |
-
msgstr "Licensnøgle"
|
874 |
-
|
875 |
-
#: includes/i18n.php:249
|
876 |
-
msgid "Send License Key"
|
877 |
-
msgstr "Send licensnøgle"
|
878 |
-
|
879 |
-
#: includes/i18n.php:250
|
880 |
-
msgid "Sending license key"
|
881 |
-
msgstr "Sender licensnøgle"
|
882 |
-
|
883 |
-
#: includes/i18n.php:251
|
884 |
-
msgid "Have a license key?"
|
885 |
-
msgstr "Har du en licensnøgle?"
|
886 |
-
|
887 |
-
#: includes/i18n.php:252
|
888 |
-
msgid "Don't have a license key?"
|
889 |
-
msgstr "Har du ikke en licensnøgle?"
|
890 |
-
|
891 |
-
#: includes/i18n.php:253
|
892 |
-
msgid "Can't find your license key?"
|
893 |
-
msgstr "Kan du ikke finde din licensnøgle?"
|
894 |
-
|
895 |
-
#: includes/i18n.php:254
|
896 |
-
msgid "We couldn't find your email address in the system, are you sure it's the right address?"
|
897 |
-
msgstr "We couldn't find your email address in the system, are you sure it's the right address?"
|
898 |
-
|
899 |
-
#: includes/i18n.php:255
|
900 |
-
msgid "We can't see any active licenses associated with that email address, are you sure it's the right address?"
|
901 |
-
msgstr "We can't see any active licenses associated with that email address, are you sure it's the right address?"
|
902 |
-
|
903 |
-
#: includes/i18n.php:256
|
904 |
-
msgid "Opt In"
|
905 |
-
msgstr "Tilmeld"
|
906 |
-
|
907 |
-
#: includes/i18n.php:257
|
908 |
-
msgid "Opt Out"
|
909 |
-
msgstr "Frameld"
|
910 |
-
|
911 |
-
#: includes/i18n.php:258
|
912 |
-
msgid "On second thought - I want to continue helping"
|
913 |
-
msgstr "Ved nærmere eftertanke - Jeg vil fortsætte med at hjælpe"
|
914 |
-
|
915 |
-
#: includes/i18n.php:259
|
916 |
-
msgid "Opting out..."
|
917 |
-
msgstr "Framelder..."
|
918 |
-
|
919 |
-
#: includes/i18n.php:260
|
920 |
-
msgid "Opting in..."
|
921 |
-
msgstr "Tilmelder..."
|
922 |
-
|
923 |
-
#: includes/i18n.php:261
|
924 |
-
msgid "We appreciate your help in making the %s better by letting us track some usage data."
|
925 |
-
msgstr "We appreciate your help in making the %s better by letting us track some usage data."
|
926 |
-
|
927 |
-
#: includes/i18n.php:262
|
928 |
-
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."
|
929 |
-
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."
|
930 |
-
|
931 |
-
#: includes/i18n.php:263
|
932 |
-
msgid "By clicking \"Opt Out\", we will no longer be sending any data from %s to %s."
|
933 |
-
msgstr "Ved at klikke \"Frameld\" vil vi ikke længere sende data fra %s til %s."
|
934 |
-
|
935 |
-
#: includes/i18n.php:267
|
936 |
-
msgid "Screenshots"
|
937 |
-
msgstr "Skærmbilleder"
|
938 |
-
|
939 |
-
#: includes/i18n.php:268
|
940 |
-
msgid "Click to view full-size screenshot %d"
|
941 |
-
msgstr "Click to view full-size screenshot %d"
|
942 |
-
|
943 |
-
#: includes/i18n.php:272
|
944 |
-
msgid "Freemius Debug"
|
945 |
-
msgstr "Freemius Debug"
|
946 |
-
|
947 |
-
#: includes/i18n.php:273
|
948 |
-
msgctxt "as turned on"
|
949 |
-
msgid "On"
|
950 |
-
msgstr "Til"
|
951 |
-
|
952 |
-
#: includes/i18n.php:274
|
953 |
-
msgctxt "as turned off"
|
954 |
-
msgid "Off"
|
955 |
-
msgstr "Fra"
|
956 |
-
|
957 |
-
#: includes/i18n.php:275
|
958 |
-
msgctxt "as code debugging"
|
959 |
-
msgid "Debugging"
|
960 |
-
msgstr "Fejlfinding"
|
961 |
-
|
962 |
-
#: includes/i18n.php:276
|
963 |
-
msgid "Freemius State"
|
964 |
-
msgstr "Freemius tilstand"
|
965 |
-
|
966 |
-
#: includes/i18n.php:277
|
967 |
-
msgctxt "as connection was successful"
|
968 |
-
msgid "Connected"
|
969 |
-
msgstr "Forbundet"
|
970 |
-
|
971 |
-
#: includes/i18n.php:278
|
972 |
-
msgctxt "as connection blocked"
|
973 |
-
msgid "Blocked"
|
974 |
-
msgstr "Blokeret"
|
975 |
-
|
976 |
-
#: includes/i18n.php:279
|
977 |
-
msgctxt "as application program interface"
|
978 |
-
msgid "API"
|
979 |
-
msgstr "API"
|
980 |
-
|
981 |
-
#: includes/i18n.php:280
|
982 |
-
msgctxt "as software development kit versions"
|
983 |
-
msgid "SDK"
|
984 |
-
msgstr "SDK"
|
985 |
-
|
986 |
-
#: includes/i18n.php:281
|
987 |
-
msgctxt "as software development kit versions"
|
988 |
-
msgid "SDK Versions"
|
989 |
-
msgstr "SDK-versioner"
|
990 |
-
|
991 |
-
#: includes/i18n.php:282
|
992 |
-
msgctxt "as plugin folder path"
|
993 |
-
msgid "Plugin Path"
|
994 |
-
msgstr "Plugin-sti"
|
995 |
-
|
996 |
-
#: includes/i18n.php:283
|
997 |
-
msgctxt "as sdk path"
|
998 |
-
msgid "SDK Path"
|
999 |
-
msgstr "SDK-sti"
|
1000 |
-
|
1001 |
-
#: includes/i18n.php:284
|
1002 |
-
msgid "Add Ons of Plugin %s"
|
1003 |
-
msgstr "Tilføjelser til plugin %s"
|
1004 |
-
|
1005 |
-
#: includes/i18n.php:285
|
1006 |
-
msgid "Are you sure you want to delete all Freemius data?"
|
1007 |
-
msgstr "Er du sikker på, du vil slette al Freemius data?"
|
1008 |
-
|
1009 |
-
#: includes/i18n.php:286
|
1010 |
-
msgid "Actions"
|
1011 |
-
msgstr "Handlinger"
|
1012 |
-
|
1013 |
-
#: includes/i18n.php:287
|
1014 |
-
msgid "Delete All Accounts"
|
1015 |
-
msgstr "Slet alle konti"
|
1016 |
-
|
1017 |
-
#: includes/i18n.php:288
|
1018 |
-
msgid "Start Fresh"
|
1019 |
-
msgstr "Start forfra"
|
1020 |
-
|
1021 |
-
#: includes/i18n.php:289
|
1022 |
-
msgid "Clear API Cache"
|
1023 |
-
msgstr "Ryd API-cache"
|
1024 |
-
|
1025 |
-
#: includes/i18n.php:290
|
1026 |
-
msgid "Sync Data From Server"
|
1027 |
-
msgstr "Synkroniser data fra server"
|
1028 |
-
|
1029 |
-
#: includes/i18n.php:291
|
1030 |
-
msgid "Scheduled Crons"
|
1031 |
-
msgstr "Planlagte cron jobs"
|
1032 |
-
|
1033 |
-
#: includes/i18n.php:292
|
1034 |
-
msgid "Cron Type"
|
1035 |
-
msgstr "Cron Type"
|
1036 |
-
|
1037 |
-
#: includes/i18n.php:293
|
1038 |
-
msgid "Plugins & Themes Sync"
|
1039 |
-
msgstr "Synkronisering af plugins og temaer"
|
1040 |
-
|
1041 |
-
#: includes/i18n.php:294
|
1042 |
-
msgid "%s Licenses"
|
1043 |
-
msgstr "%s Licenses"
|
1044 |
-
|
1045 |
-
#: includes/i18n.php:295
|
1046 |
-
msgid "Debug Log"
|
1047 |
-
msgstr "Fejlfindingslog"
|
1048 |
-
|
1049 |
-
#: includes/i18n.php:296
|
1050 |
-
msgid "All"
|
1051 |
-
msgstr "Alle"
|
1052 |
-
|
1053 |
-
#: includes/i18n.php:297
|
1054 |
-
msgid "File"
|
1055 |
-
msgstr "Fil"
|
1056 |
-
|
1057 |
-
#: includes/i18n.php:298
|
1058 |
-
msgid "Function"
|
1059 |
-
msgstr "Funktion"
|
1060 |
-
|
1061 |
-
#: includes/i18n.php:299
|
1062 |
-
msgid "Process ID"
|
1063 |
-
msgstr "Proces-ID"
|
1064 |
-
|
1065 |
-
#: includes/i18n.php:300
|
1066 |
-
msgid "Logger"
|
1067 |
-
msgstr "Logger"
|
1068 |
-
|
1069 |
-
#: includes/i18n.php:301
|
1070 |
-
msgid "Message"
|
1071 |
-
msgstr "Besked"
|
1072 |
-
|
1073 |
-
#: includes/i18n.php:302
|
1074 |
-
msgid "Download"
|
1075 |
-
msgstr "Download"
|
1076 |
-
|
1077 |
-
#: includes/i18n.php:303
|
1078 |
-
msgid "Filter"
|
1079 |
-
msgstr "Filter"
|
1080 |
-
|
1081 |
-
#: includes/i18n.php:304
|
1082 |
-
msgid "Type"
|
1083 |
-
msgstr "Type"
|
1084 |
-
|
1085 |
-
#: includes/i18n.php:305
|
1086 |
-
msgid "All Types"
|
1087 |
-
msgstr "Alle typer"
|
1088 |
-
|
1089 |
-
#: includes/i18n.php:306
|
1090 |
-
msgid "All Requests"
|
1091 |
-
msgstr "Alle forespørgsler"
|
1092 |
-
|
1093 |
-
#: includes/i18n.php:310
|
1094 |
-
msgctxt "as congratulations"
|
1095 |
-
msgid "Congrats"
|
1096 |
-
msgstr "Tillykke"
|
1097 |
-
|
1098 |
-
#: includes/i18n.php:311
|
1099 |
-
msgctxt "exclamation"
|
1100 |
-
msgid "Oops"
|
1101 |
-
msgstr "Ups"
|
1102 |
-
|
1103 |
-
#: includes/i18n.php:312
|
1104 |
-
msgctxt "interjection expressing joy or exuberance"
|
1105 |
-
msgid "Yee-haw"
|
1106 |
-
msgstr "Yee-haw"
|
1107 |
-
|
1108 |
-
#: includes/i18n.php:313
|
1109 |
-
msgctxt ""
|
1110 |
-
msgid "W00t"
|
1111 |
-
msgstr "W00t"
|
1112 |
-
|
1113 |
-
#: includes/i18n.php:315
|
1114 |
-
msgctxt "a positive response"
|
1115 |
-
msgid "Right on"
|
1116 |
-
msgstr "Sådan"
|
1117 |
-
|
1118 |
-
#: includes/i18n.php:316
|
1119 |
-
msgctxt ""
|
1120 |
-
msgid "Hmm"
|
1121 |
-
msgstr "Hmm"
|
1122 |
-
|
1123 |
-
#: includes/i18n.php:318
|
1124 |
-
msgid "O.K"
|
1125 |
-
msgstr "O.K"
|
1126 |
-
|
1127 |
-
#: includes/i18n.php:319
|
1128 |
-
msgctxt "exclamation"
|
1129 |
-
msgid "Hey"
|
1130 |
-
msgstr "Hey"
|
1131 |
-
|
1132 |
-
#: includes/i18n.php:320
|
1133 |
-
msgctxt "advance notice of something that will need attention."
|
1134 |
-
msgid "Heads up"
|
1135 |
-
msgstr "Se her"
|
1136 |
-
|
1137 |
-
#: includes/i18n.php:325
|
1138 |
-
msgid "Seems like you got the latest release."
|
1139 |
-
msgstr "Det ser ud til, at du har den seneste udgivelse."
|
1140 |
-
|
1141 |
-
#: includes/i18n.php:326
|
1142 |
-
msgid "You are all good!"
|
1143 |
-
msgstr "Det var det!"
|
1144 |
-
|
1145 |
-
#: includes/i18n.php:327
|
1146 |
-
msgid "Sorry, we could not complete the email update. Another user with the same email is already registered."
|
1147 |
-
msgstr "Sorry, we could not complete the email update. Another user with the same email is already registered."
|
1148 |
-
|
1149 |
-
#: includes/i18n.php:328
|
1150 |
-
msgid "If you would like to give up the ownership of the %s's account to %s click the Change Ownership button."
|
1151 |
-
msgstr "If you would like to give up the ownership of the %s's account to %s click the Change Ownership button."
|
1152 |
-
|
1153 |
-
#: includes/i18n.php:329
|
1154 |
-
msgid "Your email was successfully updated. You should receive an email with confirmation instructions in few moments."
|
1155 |
-
msgstr "Your email was successfully updated. You should receive an email with confirmation instructions in few moments."
|
1156 |
-
|
1157 |
-
#: includes/i18n.php:330
|
1158 |
-
msgid "Your name was successfully updated."
|
1159 |
-
msgstr "Dit navn er blevet opdateret."
|
1160 |
-
|
1161 |
-
#: includes/i18n.php:331
|
1162 |
-
msgid "You have successfully updated your %s."
|
1163 |
-
msgstr "Opdatering af %s blev gennemført."
|
1164 |
-
|
1165 |
-
#: includes/i18n.php:332
|
1166 |
-
msgid "Please provide your full name."
|
1167 |
-
msgstr "Indtast venligst dit fulde navn."
|
1168 |
-
|
1169 |
-
#: includes/i18n.php:333
|
1170 |
-
msgid "Verification mail was just sent to %s. If you can't find it after 5 min, please check your spam box."
|
1171 |
-
msgstr "Verification mail was just sent to %s. If you can't find it after 5 min, please check your spam box."
|
1172 |
-
|
1173 |
-
#: includes/i18n.php:334
|
1174 |
-
msgid "Just letting you know that the add-ons information of %s is being pulled from an external server."
|
1175 |
-
msgstr "Just letting you know that the add-ons information of %s is being pulled from an external server."
|
1176 |
-
|
1177 |
-
#: includes/i18n.php:335
|
1178 |
-
msgid "No credit card required"
|
1179 |
-
msgstr "Betalingskort ikke påkrævet"
|
1180 |
-
|
1181 |
-
#: includes/i18n.php:336
|
1182 |
-
msgid "Premium %s version was successfully activated."
|
1183 |
-
msgstr "Premium %s version was successfully activated."
|
1184 |
-
|
1185 |
-
#: includes/i18n.php:337
|
1186 |
-
msgid "The upgrade of %s was successfully completed."
|
1187 |
-
msgstr "Opgraderingen af %s blev fuldendt."
|
1188 |
-
|
1189 |
-
#: includes/i18n.php:338
|
1190 |
-
msgid "Your account was successfully activated with the %s plan."
|
1191 |
-
msgstr "Din konto blev aktiveret med planen %s."
|
1192 |
-
|
1193 |
-
#: includes/i18n.php:339
|
1194 |
-
msgid "Download the latest %s version now"
|
1195 |
-
msgstr "Download den seneste version af %s nu"
|
1196 |
-
|
1197 |
-
#: includes/i18n.php:340
|
1198 |
-
msgid "Please follow these steps to complete the upgrade"
|
1199 |
-
msgstr "Følg venligst disse trin for at færdiggøre opgraderingen"
|
1200 |
-
|
1201 |
-
#: includes/i18n.php:341
|
1202 |
-
msgid "Download the latest %s version"
|
1203 |
-
msgstr "Download den seneste version af %s"
|
1204 |
-
|
1205 |
-
#: includes/i18n.php:342
|
1206 |
-
msgid "Download the latest version"
|
1207 |
-
msgstr "Download den seneste version"
|
1208 |
-
|
1209 |
-
#: includes/i18n.php:343
|
1210 |
-
msgid "Deactivate the free version"
|
1211 |
-
msgstr "Deaktiver den gratis version"
|
1212 |
-
|
1213 |
-
#: includes/i18n.php:344
|
1214 |
-
msgid "Upload and activate the downloaded version"
|
1215 |
-
msgstr "Upload og aktiver den downloadede version"
|
1216 |
-
|
1217 |
-
#: includes/i18n.php:345
|
1218 |
-
msgid "How to upload and activate?"
|
1219 |
-
msgstr "Upload og aktivering, hvordan?"
|
1220 |
-
|
1221 |
-
#: includes/i18n.php:346
|
1222 |
-
msgctxt "%s - product name, e.g. Facebook add-on was successfully..."
|
1223 |
-
msgid "%s Add-on was successfully purchased."
|
1224 |
-
msgstr "Betalingen for tilføjelsen %s blev gennemført."
|
1225 |
-
|
1226 |
-
#: includes/i18n.php:348
|
1227 |
-
msgid "Your %s Add-on plan was successfully upgraded."
|
1228 |
-
msgstr "Your %s Add-on plan was successfully upgraded."
|
1229 |
-
|
1230 |
-
#: includes/i18n.php:349
|
1231 |
-
msgid "Your email has been successfully verified - you are AWESOME!"
|
1232 |
-
msgstr "Your email has been successfully verified - you are AWESOME!"
|
1233 |
-
|
1234 |
-
#: includes/i18n.php:350
|
1235 |
-
msgid "Your plan was successfully upgraded."
|
1236 |
-
msgstr "Din plan er blevet opgraderet."
|
1237 |
-
|
1238 |
-
#: includes/i18n.php:351
|
1239 |
-
msgid "Your plan was successfully changed to %s."
|
1240 |
-
msgstr "Din plan er blevet ændret til %s."
|
1241 |
-
|
1242 |
-
#: includes/i18n.php:352
|
1243 |
-
msgid "Your license has expired. You can still continue using the free %s forever."
|
1244 |
-
msgstr "Your license has expired. You can still continue using the free %s forever."
|
1245 |
-
|
1246 |
-
#: includes/i18n.php:353
|
1247 |
-
msgid "Your license has been cancelled. If you think it's a mistake, please contact support."
|
1248 |
-
msgstr "Din licens er blevet annulleret. Hvis du mener, dette er en fejl, så kontakt venligst support."
|
1249 |
-
|
1250 |
-
#: includes/i18n.php:354
|
1251 |
-
msgid "Your trial has been successfully started."
|
1252 |
-
msgstr "Din prøveperiode er begyndt."
|
1253 |
-
|
1254 |
-
#: includes/i18n.php:355
|
1255 |
-
msgid "Your license was successfully activated."
|
1256 |
-
msgstr "Din licens er blevet aktiveret."
|
1257 |
-
|
1258 |
-
#: includes/i18n.php:356
|
1259 |
-
msgid "It looks like your site currently doesn't have an active license."
|
1260 |
-
msgstr "Det ser ud til, at dit websted endnu ikke har en aktiv licens."
|
1261 |
-
|
1262 |
-
#: includes/i18n.php:357
|
1263 |
-
msgid "Your license was successfully deactivated, you are back to the %s plan."
|
1264 |
-
msgstr "Din licens blev deaktiveret, du er tilbage på planen %s."
|
1265 |
-
|
1266 |
-
#: includes/i18n.php:358
|
1267 |
-
msgid "It looks like the license deactivation failed."
|
1268 |
-
msgstr "Det ser ud til, at licens-deaktiveringen mislykkedes."
|
1269 |
-
|
1270 |
-
#: includes/i18n.php:359
|
1271 |
-
msgid "It looks like the license could not be activated."
|
1272 |
-
msgstr "Det ser ud til, at licensen ikke kunne aktiveres."
|
1273 |
-
|
1274 |
-
#: includes/i18n.php:360
|
1275 |
-
msgid "Error received from the server:"
|
1276 |
-
msgstr "Fejl modtager fra serveren:"
|
1277 |
-
|
1278 |
-
#: includes/i18n.php:361
|
1279 |
-
msgid "Your trial has expired. You can still continue using all our free features."
|
1280 |
-
msgstr "Din prøveperiode er udløbet. Du kan fortsat bruge alle vores gratis funktioner."
|
1281 |
-
|
1282 |
-
#: includes/i18n.php:362
|
1283 |
-
msgid "Your plan was successfully downgraded. Your %s plan license will expire in %s."
|
1284 |
-
msgstr "Din plan blev nedgraderet. Licensen til din %s plan vil udløbe om %s."
|
1285 |
-
|
1286 |
-
#: includes/i18n.php:363
|
1287 |
-
msgid "Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes."
|
1288 |
-
msgstr "Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes."
|
1289 |
-
|
1290 |
-
#: includes/i18n.php:364
|
1291 |
-
msgid "It looks like you are not in trial mode anymore so there's nothing to cancel :)"
|
1292 |
-
msgstr "It looks like you are not in trial mode anymore so there's nothing to cancel :)"
|
1293 |
-
|
1294 |
-
#: includes/i18n.php:365
|
1295 |
-
msgid "Your %s free trial was successfully cancelled."
|
1296 |
-
msgstr "Din gratis prøveperiode for %s er blevet annulleret."
|
1297 |
-
|
1298 |
-
#: includes/i18n.php:366
|
1299 |
-
msgctxt "%s - numeric version number"
|
1300 |
-
msgid "Version %s was released."
|
1301 |
-
msgstr "Version %s er blevet udgivet."
|
1302 |
-
|
1303 |
-
#: includes/i18n.php:367
|
1304 |
-
msgid "Please download %s."
|
1305 |
-
msgstr "Download venligst %s."
|
1306 |
-
|
1307 |
-
#: includes/i18n.php:368
|
1308 |
-
msgctxt "%s - plan name, as the latest professional version here"
|
1309 |
-
msgid "the latest %s version here"
|
1310 |
-
msgstr "den seneste version af %s her"
|
1311 |
-
|
1312 |
-
#: includes/i18n.php:370
|
1313 |
-
msgid "How do you like %s so far? Test all our %s premium features with a %d-day free trial."
|
1314 |
-
msgstr "How do you like %s so far? Test all our %s premium features with a %d-day free trial."
|
1315 |
-
|
1316 |
-
#: includes/i18n.php:371
|
1317 |
-
msgctxt "call to action"
|
1318 |
-
msgid "Start free trial"
|
1319 |
-
msgstr "Start gratis prøveperiode"
|
1320 |
-
|
1321 |
-
#: includes/i18n.php:372
|
1322 |
-
msgid "Starting trial"
|
1323 |
-
msgstr "Starter prøveperiode"
|
1324 |
-
|
1325 |
-
#: includes/i18n.php:373
|
1326 |
-
msgid "Please wait"
|
1327 |
-
msgstr "Vent venligst"
|
1328 |
-
|
1329 |
-
#: includes/i18n.php:374
|
1330 |
-
msgid "Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes."
|
1331 |
-
msgstr "Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes."
|
1332 |
-
|
1333 |
-
#: includes/i18n.php:375
|
1334 |
-
msgid "You already utilized a trial before."
|
1335 |
-
msgstr "Du har allerede brugt din prøveperiode."
|
1336 |
-
|
1337 |
-
#: includes/i18n.php:376
|
1338 |
-
msgid "You are already running the %s in a trial mode."
|
1339 |
-
msgstr "You are already running the %s in a trial mode."
|
1340 |
-
|
1341 |
-
#: includes/i18n.php:377
|
1342 |
-
msgid "Plan %s do not exist, therefore, can't start a trial."
|
1343 |
-
msgstr "Plan %s eksisterer ikke og kan derfor ikke starte prøveperiode."
|
1344 |
-
|
1345 |
-
#: includes/i18n.php:378
|
1346 |
-
msgid "Plan %s does not support a trial period."
|
1347 |
-
msgstr "Plan %s understøtter ikke en prøveperiode."
|
1348 |
-
|
1349 |
-
#: includes/i18n.php:379
|
1350 |
-
msgid "None of the %s's plans supports a trial period."
|
1351 |
-
msgstr "None of the %s's plans supports a trial period."
|
1352 |
-
|
1353 |
-
#: includes/i18n.php:380
|
1354 |
-
msgid "Unexpected API error. Please contact the %s's author with the following error."
|
1355 |
-
msgstr "Unexpected API error. Please contact the %s's author with the following error."
|
1356 |
-
|
1357 |
-
#: includes/i18n.php:381
|
1358 |
-
msgid "No commitment for %s days - cancel anytime!"
|
1359 |
-
msgstr "Ingen bindinger i %s dage - annuller når som helst!"
|
1360 |
-
|
1361 |
-
#: includes/i18n.php:382
|
1362 |
-
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."
|
1363 |
-
msgstr "Din licens er udløbet. Du kan stadig benytte alle funktionerne i %s, men du bliver nødt til at fornye din licens for at få opdateringer og support."
|
1364 |
-
|
1365 |
-
#: includes/i18n.php:383
|
1366 |
-
msgid "Couldn't activate %s."
|
1367 |
-
msgstr "Kunne ikke aktivere %s."
|
1368 |
-
|
1369 |
-
#: includes/i18n.php:384
|
1370 |
-
msgid "Please contact us with the following message:"
|
1371 |
-
msgstr "Kontakt os venligst med følgende besked:"
|
1372 |
-
|
1373 |
-
#: includes/i18n.php:385
|
1374 |
-
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."
|
1375 |
-
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."
|
1376 |
-
|
1377 |
-
#: includes/i18n.php:386
|
1378 |
-
msgid "Please contact us here"
|
1379 |
-
msgstr "Kontakt os her"
|
1380 |
-
|
1381 |
-
#: includes/i18n.php:387
|
1382 |
-
msgid "I have upgraded my account but when I try to Sync the License, the plan remains %s."
|
1383 |
-
msgstr "I have upgraded my account but when I try to Sync the License, the plan remains %s."
|
1384 |
-
|
1385 |
-
#: includes/i18n.php:390
|
1386 |
-
msgid "From unknown reason, the API connectivity test failed."
|
1387 |
-
msgstr "From unknown reason, the API connectivity test failed."
|
1388 |
-
|
1389 |
-
#: includes/i18n.php:391
|
1390 |
-
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?"
|
1391 |
-
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?"
|
1392 |
-
|
1393 |
-
#: includes/i18n.php:392
|
1394 |
-
msgid "We use PHP cURL library for the API calls, which is a very common library and usually installed and activated out of the box. Unfortunately, cURL is not activated (or disabled) on your server."
|
1395 |
-
msgstr "We use PHP cURL library for the API calls, which is a very common library and usually installed and activated out of the box. Unfortunately, cURL is not activated (or disabled) on your server."
|
1396 |
-
|
1397 |
-
#: includes/i18n.php:393
|
1398 |
-
msgid "Disabled method(s):"
|
1399 |
-
msgstr "Disabled method(s):"
|
1400 |
-
|
1401 |
-
#: includes/i18n.php:394
|
1402 |
-
msgid "From unknown reason, CloudFlare, the firewall we use, blocks the connection."
|
1403 |
-
msgstr "Af en ukendt årsag blokerer CloudFlare, vores firewall, forbindelsen."
|
1404 |
-
|
1405 |
-
#: includes/i18n.php:395
|
1406 |
-
msgctxt "as pluginX requires an access to our API"
|
1407 |
-
msgid "%s requires an access to our API."
|
1408 |
-
msgstr "%s påkræver adgang til vores API."
|
1409 |
-
|
1410 |
-
#: includes/i18n.php:397
|
1411 |
-
msgid "It looks like your server is using Squid ACL (access control lists), which blocks the connection."
|
1412 |
-
msgstr "Det ser ud til, at din server benytter Squid ACL (access control lists), som blokerer forbindelsen."
|
1413 |
-
|
1414 |
-
#: includes/i18n.php:398
|
1415 |
-
msgid "I don't know what is Squid or ACL, help me!"
|
1416 |
-
msgstr "Jeg ved ikke hvad Squid eller ACL er. Hjælp mig!"
|
1417 |
-
|
1418 |
-
#: includes/i18n.php399, includes/i18n.php:403
|
1419 |
-
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."
|
1420 |
-
msgstr "Vi vil kontakte din udbyder og løse problemet. Når vi har opdatinger i sagen, vil vi følge op med en email til dig på %s."
|
1421 |
-
|
1422 |
-
#: includes/i18n.php:400
|
1423 |
-
msgid "I'm a system administrator"
|
1424 |
-
msgstr "Jeg er en system-administrator"
|
1425 |
-
|
1426 |
-
#: includes/i18n.php:401
|
1427 |
-
msgid "Great, please whitelist the following domains: %s. Once you are done, deactivate the %s and activate it again."
|
1428 |
-
msgstr "Great, please whitelist the following domains: %s. Once you are done, deactivate the %s and activate it again."
|
1429 |
-
|
1430 |
-
#: includes/i18n.php:402
|
1431 |
-
msgid "I don't know what is cURL or how to install it, help me!"
|
1432 |
-
msgstr "Jeg ved ikke hvad cURL er, eller hvordan jeg installerer det. Hjælp mig!"
|
1433 |
-
|
1434 |
-
#: includes/i18n.php:404
|
1435 |
-
msgid "Great, please install cURL and enable it in your php.ini file. In addition, search for the 'disable_functions' directive in your php.ini file and remove any disabled methods starting with 'curl_'. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the %s and reactivate it back again."
|
1436 |
-
msgstr "Great, please install cURL and enable it in your php.ini file. In addition, search for the 'disable_functions' directive in your php.ini file and remove any disabled methods starting with 'curl_'. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the %s and reactivate it back again."
|
1437 |
-
|
1438 |
-
#: includes/i18n.php:405
|
1439 |
-
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."
|
1440 |
-
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."
|
1441 |
-
|
1442 |
-
#: includes/i18n.php:406
|
1443 |
-
msgid "Sorry for the inconvenience and we are here to help if you give us a chance."
|
1444 |
-
msgstr "Vi beklager ulejligheden, og vi er her for at hjælpe, hvis du giver os chancen."
|
1445 |
-
|
1446 |
-
#: includes/i18n.php:407
|
1447 |
-
msgid "Yes - I'm giving you a chance to fix it"
|
1448 |
-
msgstr "Ja - jeg giver jer en chance for at rette det"
|
1449 |
-
|
1450 |
-
#: includes/i18n.php:408
|
1451 |
-
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."
|
1452 |
-
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."
|
1453 |
-
|
1454 |
-
#: includes/i18n.php:409
|
1455 |
-
msgid "Let's try your previous version"
|
1456 |
-
msgstr "Lad os prøve din forrige version"
|
1457 |
-
|
1458 |
-
#: includes/i18n.php:410
|
1459 |
-
msgid "Uninstall this version and install the previous one."
|
1460 |
-
msgstr "Afinstaller denne version og installer den forrige."
|
1461 |
-
|
1462 |
-
#: includes/i18n.php:411
|
1463 |
-
msgid "That's exhausting, please deactivate"
|
1464 |
-
msgstr "Det er udmattende, deaktiver venligst"
|
1465 |
-
|
1466 |
-
#: includes/i18n.php:412
|
1467 |
-
msgid "We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future."
|
1468 |
-
msgstr "We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future."
|
1469 |
-
|
1470 |
-
#: includes/i18n.php:413
|
1471 |
-
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."
|
1472 |
-
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."
|
1473 |
-
|
1474 |
-
#: includes/i18n.php:414
|
1475 |
-
msgctxt "%1s - plugin title, %2s - API domain"
|
1476 |
-
msgid "Your server is blocking the access to Freemius' API, which is crucial for %1s synchronization. Please contact your host to whitelist %2s"
|
1477 |
-
msgstr "Your server is blocking the access to Freemius' API, which is crucial for %1s synchronization. Please contact your host to whitelist %2s"
|
1478 |
-
|
1479 |
-
#: includes/i18n.php:416
|
1480 |
-
msgid "It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again."
|
1481 |
-
msgstr "It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again."
|
1482 |
-
|
1483 |
-
#: includes/i18n.php:419
|
1484 |
-
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."
|
1485 |
-
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."
|
1486 |
-
|
1487 |
-
#: includes/i18n.php:420
|
1488 |
-
msgid "Thanks for confirming the ownership change. An email was just sent to %s for final approval."
|
1489 |
-
msgstr "Thanks for confirming the ownership change. An email was just sent to %s for final approval."
|
1490 |
-
|
1491 |
-
#: includes/i18n.php:421
|
1492 |
-
msgid "%s is the new owner of the account."
|
1493 |
-
msgstr "%s er den nye ejer af kontoen."
|
1494 |
-
|
1495 |
-
#: includes/i18n.php:423
|
1496 |
-
msgctxt "addonX cannot run without pluginY"
|
1497 |
-
msgid "%s cannot run without %s."
|
1498 |
-
msgstr "%s virker ikke uden %s."
|
1499 |
-
|
1500 |
-
#: includes/i18n.php:425
|
1501 |
-
msgctxt "addonX cannot run..."
|
1502 |
-
msgid "%s cannot run without the plugin."
|
1503 |
-
msgstr "%s virker ikke uden pluginnet."
|
1504 |
-
|
1505 |
-
#: includes/i18n.php:426
|
1506 |
-
msgctxt "pluginX activation was successfully..."
|
1507 |
-
msgid "%s activation was successfully completed."
|
1508 |
-
msgstr "Aktivering af %s blev gennemført."
|
1509 |
-
|
1510 |
-
#: includes/i18n.php:428
|
1511 |
-
msgctxt "Plugin installer section title"
|
1512 |
-
msgid "Features & Pricing"
|
1513 |
-
msgstr "Funktioner og priser"
|
1514 |
-
|
1515 |
-
#: includes/i18n.php:429
|
1516 |
-
msgid "Add-on must be deployed to WordPress.org or Freemius."
|
1517 |
-
msgstr "Add-on must be deployed to WordPress.org or Freemius."
|
1518 |
-
|
1519 |
-
#: includes/i18n.php:430
|
1520 |
-
msgid "Paid add-on must be deployed to Freemius."
|
1521 |
-
msgstr "Paid add-on must be deployed to Freemius."
|
1522 |
-
|
1523 |
-
#: includes/i18n.php:434
|
1524 |
-
msgid "%s is a premium only add-on. You have to purchase a license first before activating the plugin."
|
1525 |
-
msgstr "%s is a premium only add-on. You have to purchase a license first before activating the plugin."
|
1526 |
-
|
1527 |
-
#: includes/i18n.php:435
|
1528 |
-
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."
|
1529 |
-
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."
|
1530 |
-
|
1531 |
-
#: includes/i18n.php:440
|
1532 |
-
msgctxt "as every month"
|
1533 |
-
msgid "Monthly"
|
1534 |
-
msgstr "Månedligt"
|
1535 |
-
|
1536 |
-
#: includes/i18n.php:441
|
1537 |
-
msgctxt "as monthly period"
|
1538 |
-
msgid "mo"
|
1539 |
-
msgstr "md"
|
1540 |
-
|
1541 |
-
#: includes/i18n.php:442
|
1542 |
-
msgctxt "as once a year"
|
1543 |
-
msgid "Annual"
|
1544 |
-
msgstr "Årligt"
|
1545 |
-
|
1546 |
-
#: includes/i18n.php:443
|
1547 |
-
msgctxt "as once a year"
|
1548 |
-
msgid "Annually"
|
1549 |
-
msgstr "Årligt"
|
1550 |
-
|
1551 |
-
#: includes/i18n.php:444
|
1552 |
-
msgctxt "as once a year"
|
1553 |
-
msgid "Once"
|
1554 |
-
msgstr "Engangsbeløb"
|
1555 |
-
|
1556 |
-
#: includes/i18n.php:445
|
1557 |
-
msgctxt "as annual period"
|
1558 |
-
msgid "year"
|
1559 |
-
msgstr "år"
|
1560 |
-
|
1561 |
-
#: includes/i18n.php:446
|
1562 |
-
msgid "Lifetime"
|
1563 |
-
msgstr "Livstid"
|
1564 |
-
|
1565 |
-
#: includes/i18n.php:447
|
1566 |
-
msgctxt "e.g. the best product"
|
1567 |
-
msgid "Best"
|
1568 |
-
msgstr "Bedste"
|
1569 |
-
|
1570 |
-
#: includes/i18n.php:448
|
1571 |
-
msgctxt "e.g. billed monthly"
|
1572 |
-
msgid "Billed %s"
|
1573 |
-
msgstr "Faktureret %s"
|
1574 |
-
|
1575 |
-
#: includes/i18n.php:449
|
1576 |
-
msgctxt "as a discount of $5 or 10%"
|
1577 |
-
msgid "Save %s"
|
1578 |
-
msgstr "Spar %s"
|
1579 |
-
|
1580 |
-
#: includes/i18n.php:451
|
1581 |
-
msgid "View details"
|
1582 |
-
msgstr "Vis detaljer"
|
1583 |
-
|
1584 |
-
#: includes/i18n.php:455
|
1585 |
-
msgctxt "button label"
|
1586 |
-
msgid "Approve & Start Trial"
|
1587 |
-
msgstr "Godkend & start prøveperiode"
|
1588 |
-
|
1589 |
-
#: includes/i18n.php:457
|
1590 |
-
msgid "You are 1-click away from starting your %1$s-day free trial of the %2$s plan."
|
1591 |
-
msgstr "Du er 1 klik fra at begynde din %1$s dages gratis prøveperiode af planen %2$s."
|
1592 |
-
|
1593 |
-
#: includes/i18n.php:459
|
1594 |
-
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 %s to periodically send data to %s to check for version updates and to validate your trial."
|
1595 |
-
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 %s to periodically send data to %s to check for version updates and to validate your trial."
|
1596 |
-
|
1597 |
-
#: includes/i18n.php:465
|
1598 |
-
msgid "Business name"
|
1599 |
-
msgstr "Firmanavn"
|
1600 |
-
|
1601 |
-
#: includes/i18n.php:466
|
1602 |
-
msgid "Tax / VAT ID"
|
1603 |
-
msgstr "Moms / VAT ID"
|
1604 |
-
|
1605 |
-
#: includes/i18n.php:467
|
1606 |
-
msgid "Address Line %d"
|
1607 |
-
msgstr "Adresselinje %d"
|
1608 |
-
|
1609 |
-
#: includes/i18n.php:468
|
1610 |
-
msgid "Country"
|
1611 |
-
msgstr "Land"
|
1612 |
-
|
1613 |
-
#: includes/i18n.php:469
|
1614 |
-
msgid "Select Country"
|
1615 |
-
msgstr "Vælg land"
|
1616 |
-
|
1617 |
-
#: includes/i18n.php:470
|
1618 |
-
msgid "City"
|
1619 |
-
msgstr "By"
|
1620 |
-
|
1621 |
-
#: includes/i18n.php:471
|
1622 |
-
msgid "Town"
|
1623 |
-
msgstr "By"
|
1624 |
-
|
1625 |
-
#: includes/i18n.php:472
|
1626 |
-
msgid "State"
|
1627 |
-
msgstr "Stat"
|
1628 |
-
|
1629 |
-
#: includes/i18n.php:473
|
1630 |
-
msgid "Province"
|
1631 |
-
msgstr "Provins"
|
1632 |
-
|
1633 |
-
#: includes/i18n.php:474
|
1634 |
-
msgid "ZIP / Postal Code"
|
1635 |
-
msgstr "ZIP / Postnummer"
|
1636 |
-
|
1637 |
-
#: includes/i18n.php:479
|
1638 |
-
msgid "Installing plugin: %s"
|
1639 |
-
msgstr "Installing plugin: %s"
|
1640 |
-
|
1641 |
-
#: includes/i18n.php:480
|
1642 |
-
msgid "Automatic Installation"
|
1643 |
-
msgstr "Automatic Installation"
|
1644 |
-
|
1645 |
-
#: includes/i18n.php:482
|
1646 |
-
msgid "%s sec"
|
1647 |
-
msgstr "%s sec"
|
1648 |
-
|
1649 |
-
#: includes/i18n.php:483
|
1650 |
-
msgid "An automated download and installation of %s (paid version) from %s will start in %s. If you would like to do it manually - click the cancellation button now."
|
1651 |
-
msgstr "An automated download and installation of %s (paid version) from %s will start in %s. If you would like to do it manually - click the cancellation button now."
|
1652 |
-
|
1653 |
-
#: includes/i18n.php:484
|
1654 |
-
msgid "The installation process has started and may take a few minutes to complete. Please wait until it is done - do not refresh this page."
|
1655 |
-
msgstr "The installation process has started and may take a few minutes to complete. Please wait until it is done - do not refresh this page."
|
1656 |
-
|
1657 |
-
#: includes/i18n.php:485
|
1658 |
-
msgid "Cancel Installation"
|
1659 |
-
msgstr "Cancel Installation"
|
1660 |
-
|
1661 |
-
#: includes/i18n.php:486
|
1662 |
-
msgid "The remote plugin package does not contain a folder with the desired slug and renaming did not work."
|
1663 |
-
msgstr "The remote plugin package does not contain a folder with the desired slug and renaming did not work."
|
1664 |
-
|
1665 |
-
#: includes/i18n.php:487
|
1666 |
-
msgid "Invalid module ID."
|
1667 |
-
msgstr "Invalid module ID."
|
1668 |
-
|
1669 |
-
#: includes/i18n.php:488
|
1670 |
-
msgid "Auto installation only works for opted-in users."
|
1671 |
-
msgstr "Auto installation only works for opted-in users."
|
1672 |
-
|
1673 |
-
#: includes/i18n.php:489
|
1674 |
-
msgid "Premium version already active."
|
1675 |
-
msgstr "Premium version already active."
|
1676 |
-
|
1677 |
-
#: includes/i18n.php:490
|
1678 |
-
msgid "Premium add-on version already installed."
|
1679 |
-
msgstr "Premium add-on version already installed."
|
1680 |
-
|
1681 |
-
#: includes/i18n.php:491
|
1682 |
-
msgid "You do not have a valid license to access the premium version."
|
1683 |
-
msgstr "You do not have a valid license to access the premium version."
|
1684 |
-
|
1685 |
-
#: includes/i18n.php:492
|
1686 |
-
msgid "Plugin is a \"Serviceware\" which means it does not have a premium code version."
|
1687 |
-
msgstr "Plugin is a \"Serviceware\" which means it does not have a premium code version."
|
1688 |
-
|
1689 |
-
#: includes/i18n.php:496
|
1690 |
-
msgid "Secure HTTPS %s page, running from an external domain"
|
1691 |
-
msgstr "Secure HTTPS %s page, running from an external domain"
|
1692 |
-
|
1693 |
-
#: includes/i18n.php:497
|
1694 |
-
msgid "PCI compliant"
|
1695 |
-
msgstr "PCI compliant"
|
1696 |
-
|
1697 |
-
#: includes/i18n.php:498
|
1698 |
-
msgid "View paid features"
|
1699 |
-
msgstr "View paid features"
|
1700 |
-
|
1701 |
-
#: includes/i18n.php:512
|
1702 |
-
msgctxt "Plugin installer section title"
|
1703 |
-
msgid "Description"
|
1704 |
-
msgstr "Beskrivelse"
|
1705 |
-
|
1706 |
-
#: includes/i18n.php:513
|
1707 |
-
msgctxt "Plugin installer section title"
|
1708 |
-
msgid "Installation"
|
1709 |
-
msgstr "Installering"
|
1710 |
-
|
1711 |
-
#: includes/i18n.php:514
|
1712 |
-
msgctxt "Plugin installer section title"
|
1713 |
-
msgid "FAQ"
|
1714 |
-
msgstr "FAQ"
|
1715 |
-
|
1716 |
-
#: includes/i18n.php:515
|
1717 |
-
msgctxt "Plugin installer section title"
|
1718 |
-
msgid "Changelog"
|
1719 |
-
msgstr "Ændringslog"
|
1720 |
-
|
1721 |
-
#: includes/i18n.php:516
|
1722 |
-
msgctxt "Plugin installer section title"
|
1723 |
-
msgid "Reviews"
|
1724 |
-
msgstr "Anmeldelser"
|
1725 |
-
|
1726 |
-
#: includes/i18n.php:517
|
1727 |
-
msgctxt "Plugin installer section title"
|
1728 |
-
msgid "Other Notes"
|
1729 |
-
msgstr "Andre noter"
|
1730 |
-
|
1731 |
-
#: includes/i18n.php:519
|
1732 |
-
msgid "%s star"
|
1733 |
-
msgstr "%s stjerne"
|
1734 |
-
|
1735 |
-
#: includes/i18n.php:521
|
1736 |
-
msgid "%s stars"
|
1737 |
-
msgstr "%s stjerner"
|
1738 |
-
|
1739 |
-
#: includes/i18n.php:523
|
1740 |
-
msgid "%s rating"
|
1741 |
-
msgstr "%s vurdering"
|
1742 |
-
|
1743 |
-
#: includes/i18n.php:525
|
1744 |
-
msgid "%s ratings"
|
1745 |
-
msgstr "%s vurderinger"
|
1746 |
-
|
1747 |
-
#: includes/i18n.php:527
|
1748 |
-
msgid "%s time"
|
1749 |
-
msgstr "%s gang"
|
1750 |
-
|
1751 |
-
#: includes/i18n.php:529
|
1752 |
-
msgid "%s times"
|
1753 |
-
msgstr "%s gange"
|
1754 |
-
|
1755 |
-
#: includes/i18n.php:531
|
1756 |
-
msgid "Click to see reviews that provided a rating of %s"
|
1757 |
-
msgstr "Click to see reviews that provided a rating of %s"
|
1758 |
-
|
1759 |
-
#: includes/i18n.php:532
|
1760 |
-
msgid "Last Updated"
|
1761 |
-
msgstr "Senest opdateret"
|
1762 |
-
|
1763 |
-
#: includes/i18n.php:533
|
1764 |
-
msgid "Requires WordPress Version:"
|
1765 |
-
msgstr "Kræver WordPress-version:"
|
1766 |
-
|
1767 |
-
#: includes/i18n.php:534
|
1768 |
-
msgctxt "as the plugin author"
|
1769 |
-
msgid "Author:"
|
1770 |
-
msgstr "Forfatter:"
|
1771 |
-
|
1772 |
-
#: includes/i18n.php:535
|
1773 |
-
msgid "Compatible up to:"
|
1774 |
-
msgstr "Kompatibel op til:"
|
1775 |
-
|
1776 |
-
#: includes/i18n.php:536
|
1777 |
-
msgid "Downloaded:"
|
1778 |
-
msgstr "Hentet:"
|
1779 |
-
|
1780 |
-
#: includes/i18n.php:537
|
1781 |
-
msgid "WordPress.org Plugin Page"
|
1782 |
-
msgstr "WordPress.org Plugin-side"
|
1783 |
-
|
1784 |
-
#: includes/i18n.php:538
|
1785 |
-
msgid "Plugin Homepage"
|
1786 |
-
msgstr "Plugin-websted"
|
1787 |
-
|
1788 |
-
#: includes/i18n.php:539
|
1789 |
-
msgid "Donate to this plugin"
|
1790 |
-
msgstr "Donér til dette plugin"
|
1791 |
-
|
1792 |
-
#: includes/i18n.php:540
|
1793 |
-
msgid "Average Rating"
|
1794 |
-
msgstr "Gennemsnitlig vurdering"
|
1795 |
-
|
1796 |
-
#: includes/i18n.php:541
|
1797 |
-
msgid "based on %s"
|
1798 |
-
msgstr "baseret på %s"
|
1799 |
-
|
1800 |
-
#: includes/i18n.php:542
|
1801 |
-
msgid "Warning:"
|
1802 |
-
msgstr "Advarsel:"
|
1803 |
-
|
1804 |
-
#: includes/i18n.php:543
|
1805 |
-
msgid "Contributors"
|
1806 |
-
msgstr "Bidragsydere"
|
1807 |
-
|
1808 |
-
#: includes/i18n.php:544
|
1809 |
-
msgid "Plugin Install"
|
1810 |
-
msgstr "Plugin Install"
|
1811 |
-
|
1812 |
-
#: includes/i18n.php:545
|
1813 |
-
msgid "This plugin has not been tested with your current version of WordPress."
|
1814 |
-
msgstr "This plugin has not been tested with your current version of WordPress."
|
1815 |
-
|
1816 |
-
#: includes/i18n.php:546
|
1817 |
-
msgid "This plugin has not been marked as compatible with your version of WordPress."
|
1818 |
-
msgstr "This plugin has not been marked as compatible with your version of WordPress."
|
1819 |
-
|
1820 |
-
#: includes/i18n.php:547
|
1821 |
-
msgid "Newer Version (%s) Installed"
|
1822 |
-
msgstr "Nyere version (%s) installeret"
|
1823 |
-
|
1824 |
-
#: includes/i18n.php:548
|
1825 |
-
msgid "Latest Version Installed"
|
1826 |
-
msgstr "Seneste version installeret"
|
1 |
+
# Copyright (C) 2017 freemius
|
2 |
+
# This file is distributed under the same license as the freemius package.
|
3 |
+
# Translators:
|
4 |
+
# Joachim Jensen <jv@intox.dk>, 2016-2017
|
5 |
+
msgid ""
|
6 |
+
msgstr ""
|
7 |
+
"Project-Id-Version: WordPress SDK\n"
|
8 |
+
"Report-Msgid-Bugs-To: https://github.com/Freemius/wordpress-sdk/issues\n"
|
9 |
+
"POT-Creation-Date: \n"
|
10 |
+
"PO-Revision-Date: 2017-08-24 12:32+0000\n"
|
11 |
+
"Last-Translator: Vova Feldman <vova@freemius.com>\n"
|
12 |
+
"Language: da_DK\n"
|
13 |
+
"Language-Team: Danish (Denmark) (http://www.transifex.com/freemius/wordpress-sdk/language/da_DK/)\n"
|
14 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
15 |
+
"Content-Transfer-Encoding: 8bit\n"
|
16 |
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
17 |
+
"MIME-Version: 1.0\n"
|
18 |
+
"X-Poedit-Basepath: ..\n"
|
19 |
+
"X-Poedit-KeywordsList: _fs_text;_fs_echo;_fs_esc_attr;_fs_esc_attr_echo;_fs_esc_html;_fs_esc_html_echo;_fs_x:1,2c;_fs_ex:1,2c;_fs_esc_attr_x:1,2c;_fs_esc_html_x:1,2c;_fs_n:1,2;_fs_n_noop:1,2;_fs_nx:1,2,4c;_fs_nx_noop:1,2,3c\n"
|
20 |
+
"X-Poedit-SearchPath-0: .\n"
|
21 |
+
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
22 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
23 |
+
|
24 |
+
#: includes/i18n.php:37
|
25 |
+
msgid "Account"
|
26 |
+
msgstr "Konto"
|
27 |
+
|
28 |
+
#: includes/i18n.php:38
|
29 |
+
msgid "Add-On"
|
30 |
+
msgstr "Add-On"
|
31 |
+
|
32 |
+
#: includes/i18n.php:39
|
33 |
+
msgid "Contact Us"
|
34 |
+
msgstr "Kontakt os"
|
35 |
+
|
36 |
+
#: includes/i18n.php:40
|
37 |
+
msgid "Contact Support"
|
38 |
+
msgstr "Kontakt support"
|
39 |
+
|
40 |
+
#: includes/i18n.php:41
|
41 |
+
msgid "Change Ownership"
|
42 |
+
msgstr "Skift ejerskab"
|
43 |
+
|
44 |
+
#: includes/i18n.php:42
|
45 |
+
msgid "Support"
|
46 |
+
msgstr "Support"
|
47 |
+
|
48 |
+
#: includes/i18n.php:43
|
49 |
+
msgid "Support Forum"
|
50 |
+
msgstr "Supportforum"
|
51 |
+
|
52 |
+
#: includes/i18n.php:44
|
53 |
+
msgid "Add-Ons"
|
54 |
+
msgstr "Add-Ons"
|
55 |
+
|
56 |
+
#: includes/i18n.php:45
|
57 |
+
msgctxt "verb"
|
58 |
+
msgid "Upgrade"
|
59 |
+
msgstr "Opgrader"
|
60 |
+
|
61 |
+
#: includes/i18n.php:46
|
62 |
+
msgid "Awesome"
|
63 |
+
msgstr "Sejt"
|
64 |
+
|
65 |
+
#: includes/i18n.php:47
|
66 |
+
msgctxt "noun"
|
67 |
+
msgid "Pricing"
|
68 |
+
msgstr "Priser"
|
69 |
+
|
70 |
+
#: includes/i18n.php:48
|
71 |
+
msgctxt "noun"
|
72 |
+
msgid "Price"
|
73 |
+
msgstr "Pris"
|
74 |
+
|
75 |
+
#: includes/i18n.php:49
|
76 |
+
msgid "Unlimited Updates"
|
77 |
+
msgstr "Ubegrænsede opdateringer"
|
78 |
+
|
79 |
+
#: includes/i18n.php:50
|
80 |
+
msgctxt "verb"
|
81 |
+
msgid "Downgrade"
|
82 |
+
msgstr "Nedgrader"
|
83 |
+
|
84 |
+
#: includes/i18n.php:51
|
85 |
+
msgctxt "verb"
|
86 |
+
msgid "Cancel Subscription"
|
87 |
+
msgstr "Annuller abonnement"
|
88 |
+
|
89 |
+
#: includes/i18n.php:52
|
90 |
+
msgid "Cancel Trial"
|
91 |
+
msgstr "Annuller prøveperiode"
|
92 |
+
|
93 |
+
#: includes/i18n.php:53
|
94 |
+
msgid "Free Trial"
|
95 |
+
msgstr "Gratis prøveperiode"
|
96 |
+
|
97 |
+
#: includes/i18n.php:54
|
98 |
+
msgid "Start my free %s"
|
99 |
+
msgstr "Start min gratis %s"
|
100 |
+
|
101 |
+
#: includes/i18n.php:55
|
102 |
+
msgid "No commitment for %s - cancel anytime"
|
103 |
+
msgstr "Ingen bindinger ved %s - annuller når som helst"
|
104 |
+
|
105 |
+
#: includes/i18n.php:56
|
106 |
+
msgid "After your free %s, pay as little as %s"
|
107 |
+
msgstr "Efter din gratis %s er prisen kun %s"
|
108 |
+
|
109 |
+
#: includes/i18n.php:57
|
110 |
+
msgid "Details"
|
111 |
+
msgstr "Detaljer"
|
112 |
+
|
113 |
+
#: includes/i18n.php:58
|
114 |
+
msgid "Account Details"
|
115 |
+
msgstr "Kontodetaljer"
|
116 |
+
|
117 |
+
#: includes/i18n.php:59
|
118 |
+
msgctxt "verb"
|
119 |
+
msgid "Delete"
|
120 |
+
msgstr "Slet"
|
121 |
+
|
122 |
+
#: includes/i18n.php:60
|
123 |
+
msgctxt "verb"
|
124 |
+
msgid "Show"
|
125 |
+
msgstr "Vis"
|
126 |
+
|
127 |
+
#: includes/i18n.php:61
|
128 |
+
msgctxt "verb"
|
129 |
+
msgid "Hide"
|
130 |
+
msgstr "Skjul"
|
131 |
+
|
132 |
+
#: includes/i18n.php:62
|
133 |
+
msgctxt "verb"
|
134 |
+
msgid "Edit"
|
135 |
+
msgstr "Rediger"
|
136 |
+
|
137 |
+
#: includes/i18n.php:63
|
138 |
+
msgctxt "verb"
|
139 |
+
msgid "Update"
|
140 |
+
msgstr "Opdater"
|
141 |
+
|
142 |
+
#: includes/i18n.php:64
|
143 |
+
msgid "Date"
|
144 |
+
msgstr "Dato"
|
145 |
+
|
146 |
+
#: includes/i18n.php:65
|
147 |
+
msgid "Amount"
|
148 |
+
msgstr "Beløb"
|
149 |
+
|
150 |
+
#: includes/i18n.php:66
|
151 |
+
msgid "Invoice"
|
152 |
+
msgstr "Faktura"
|
153 |
+
|
154 |
+
#: includes/i18n.php:67
|
155 |
+
msgid "Billing"
|
156 |
+
msgstr "Betaling"
|
157 |
+
|
158 |
+
#: includes/i18n.php:68
|
159 |
+
msgid "Payments"
|
160 |
+
msgstr "Betalinger"
|
161 |
+
|
162 |
+
#: includes/i18n.php:69
|
163 |
+
msgid "Delete Account"
|
164 |
+
msgstr "Slet konto"
|
165 |
+
|
166 |
+
#: includes/i18n.php:70
|
167 |
+
msgctxt "as close a window"
|
168 |
+
msgid "Dismiss"
|
169 |
+
msgstr "Fjern"
|
170 |
+
|
171 |
+
#: includes/i18n.php:71
|
172 |
+
msgctxt "as product pricing plan"
|
173 |
+
msgid "Plan"
|
174 |
+
msgstr "Plan"
|
175 |
+
|
176 |
+
#: includes/i18n.php:72
|
177 |
+
msgid "Change Plan"
|
178 |
+
msgstr "Skift plan"
|
179 |
+
|
180 |
+
#: includes/i18n.php:73
|
181 |
+
msgctxt "as download professional version"
|
182 |
+
msgid "Download %s Version"
|
183 |
+
msgstr "Download %s Version"
|
184 |
+
|
185 |
+
#: includes/i18n.php:74
|
186 |
+
msgctxt "as download professional version now"
|
187 |
+
msgid "Download %s version now"
|
188 |
+
msgstr "Download %s version now"
|
189 |
+
|
190 |
+
#: includes/i18n.php:75
|
191 |
+
msgctxt "as download latest version"
|
192 |
+
msgid "Download Latest"
|
193 |
+
msgstr "Download seneste"
|
194 |
+
|
195 |
+
#: includes/i18n.php:76
|
196 |
+
msgctxt "E.g. you have a professional license."
|
197 |
+
msgid "You have a %s license."
|
198 |
+
msgstr "Du har en %s licens."
|
199 |
+
|
200 |
+
#: includes/i18n.php:77
|
201 |
+
msgid "New"
|
202 |
+
msgstr "Ny"
|
203 |
+
|
204 |
+
#: includes/i18n.php:78
|
205 |
+
msgid "Free"
|
206 |
+
msgstr "Gratis"
|
207 |
+
|
208 |
+
#: includes/i18n.php:79
|
209 |
+
msgctxt "as trial plan"
|
210 |
+
msgid "Trial"
|
211 |
+
msgstr "Prøveperiode"
|
212 |
+
|
213 |
+
#: includes/i18n.php:80
|
214 |
+
msgctxt "as starting a trial plan"
|
215 |
+
msgid "Start Trial"
|
216 |
+
msgstr "Start prøveperiode"
|
217 |
+
|
218 |
+
#: includes/i18n.php:81
|
219 |
+
msgctxt "verb"
|
220 |
+
msgid "Purchase"
|
221 |
+
msgstr "Køb"
|
222 |
+
|
223 |
+
#: includes/i18n.php:82
|
224 |
+
msgid "Purchase License"
|
225 |
+
msgstr "Køb licens"
|
226 |
+
|
227 |
+
#: includes/i18n.php:83
|
228 |
+
msgctxt "verb"
|
229 |
+
msgid "Buy"
|
230 |
+
msgstr "Køb"
|
231 |
+
|
232 |
+
#: includes/i18n.php:84
|
233 |
+
msgid "Buy License"
|
234 |
+
msgstr "Køb licens"
|
235 |
+
|
236 |
+
#: includes/i18n.php:85
|
237 |
+
msgid "Single Site License"
|
238 |
+
msgstr "Single Site License"
|
239 |
+
|
240 |
+
#: includes/i18n.php:86
|
241 |
+
msgid "Unlimited Licenses"
|
242 |
+
msgstr "Ubegrænsede licenser"
|
243 |
+
|
244 |
+
#: includes/i18n.php:87
|
245 |
+
msgid "Up to %s Sites"
|
246 |
+
msgstr "Op til %s websteder"
|
247 |
+
|
248 |
+
#: includes/i18n.php:88
|
249 |
+
msgid "%sRenew your license now%s to access version %s features and support."
|
250 |
+
msgstr "%sRenew your license now%s to access version %s features and support."
|
251 |
+
|
252 |
+
#: includes/i18n.php:89
|
253 |
+
msgid "Enter the email address you've used for the upgrade below and we will resend you the license key."
|
254 |
+
msgstr "Enter the email address you've used for the upgrade below and we will resend you the license key."
|
255 |
+
|
256 |
+
#: includes/i18n.php:90
|
257 |
+
msgctxt "e.g. Professional Plan"
|
258 |
+
msgid "%s Plan"
|
259 |
+
msgstr "%s Plan"
|
260 |
+
|
261 |
+
#: includes/i18n.php:91
|
262 |
+
msgid "You are just one step away - %s"
|
263 |
+
msgstr "Du mangler kun ét skridt - %s"
|
264 |
+
|
265 |
+
#: includes/i18n.php:92
|
266 |
+
msgctxt "%s - plugin name. As complete \"Jetpack\" activation now"
|
267 |
+
msgid "Complete \"%s\" Activation Now"
|
268 |
+
msgstr "Færdiggør aktivering af \"%s\" nu"
|
269 |
+
|
270 |
+
#: includes/i18n.php:94
|
271 |
+
msgid "We made a few tweaks to the %s, %s"
|
272 |
+
msgstr "We made a few tweaks to the %s, %s"
|
273 |
+
|
274 |
+
#: includes/i18n.php:95
|
275 |
+
msgid "Opt-in to make \"%s\" Better!"
|
276 |
+
msgstr "Tilmeld for at gøre \"%s\" bedre!"
|
277 |
+
|
278 |
+
#: includes/i18n.php:96
|
279 |
+
msgid "Error"
|
280 |
+
msgstr "Fejl"
|
281 |
+
|
282 |
+
#: includes/i18n.php:97
|
283 |
+
msgid "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
|
284 |
+
msgstr "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
|
285 |
+
|
286 |
+
#: includes/i18n.php:100
|
287 |
+
msgctxt "as expiration date"
|
288 |
+
msgid "Expiration"
|
289 |
+
msgstr "Expiration"
|
290 |
+
|
291 |
+
#: includes/i18n.php:101
|
292 |
+
msgctxt "as software license"
|
293 |
+
msgid "License"
|
294 |
+
msgstr "Licens"
|
295 |
+
|
296 |
+
#: includes/i18n.php:102
|
297 |
+
msgid "not verified"
|
298 |
+
msgstr "ikke verificeret"
|
299 |
+
|
300 |
+
#: includes/i18n.php:103
|
301 |
+
msgid "Verify Email"
|
302 |
+
msgstr "Verificer e-mail"
|
303 |
+
|
304 |
+
#: includes/i18n.php:104
|
305 |
+
msgctxt "e.g. expires in 2 months"
|
306 |
+
msgid "Expires in %s"
|
307 |
+
msgstr "Udløber om %s"
|
308 |
+
|
309 |
+
#: includes/i18n.php:105
|
310 |
+
msgctxt "e.g. auto renews in 2 months"
|
311 |
+
msgid "Auto renews in %s"
|
312 |
+
msgstr "Auto-fornyer om %s"
|
313 |
+
|
314 |
+
#: includes/i18n.php:106
|
315 |
+
msgid "No expiration"
|
316 |
+
msgstr "Udløber ikke"
|
317 |
+
|
318 |
+
#: includes/i18n.php:107
|
319 |
+
msgid "Expired"
|
320 |
+
msgstr "Udløbet"
|
321 |
+
|
322 |
+
#: includes/i18n.php:108
|
323 |
+
msgid "Cancelled"
|
324 |
+
msgstr "Annulleret"
|
325 |
+
|
326 |
+
#: includes/i18n.php:109
|
327 |
+
msgctxt "e.g. In 2 hours"
|
328 |
+
msgid "In %s"
|
329 |
+
msgstr "Om %s"
|
330 |
+
|
331 |
+
#: includes/i18n.php:110
|
332 |
+
msgctxt "e.g. 2 min ago"
|
333 |
+
msgid "%s ago"
|
334 |
+
msgstr "%s siden"
|
335 |
+
|
336 |
+
#: includes/i18n.php:112
|
337 |
+
msgid "%s or higher"
|
338 |
+
msgstr "%s eller højere"
|
339 |
+
|
340 |
+
#: includes/i18n.php:113
|
341 |
+
msgctxt "as plugin version"
|
342 |
+
msgid "Version"
|
343 |
+
msgstr "Version"
|
344 |
+
|
345 |
+
#: includes/i18n.php:114
|
346 |
+
msgid "Name"
|
347 |
+
msgstr "Navn"
|
348 |
+
|
349 |
+
#: includes/i18n.php:115
|
350 |
+
msgid "Email"
|
351 |
+
msgstr "E-mail"
|
352 |
+
|
353 |
+
#: includes/i18n.php:116
|
354 |
+
msgid "Email address"
|
355 |
+
msgstr "E-mailadresse"
|
356 |
+
|
357 |
+
#: includes/i18n.php:117
|
358 |
+
msgid "Verified"
|
359 |
+
msgstr "Verificeret"
|
360 |
+
|
361 |
+
#: includes/i18n.php:118
|
362 |
+
msgid "Module"
|
363 |
+
msgstr "Modul"
|
364 |
+
|
365 |
+
#: includes/i18n.php:119
|
366 |
+
msgid "Module Type"
|
367 |
+
msgstr "Modultype"
|
368 |
+
|
369 |
+
#: includes/i18n.php:120
|
370 |
+
msgid "Plugin"
|
371 |
+
msgstr "Plugin"
|
372 |
+
|
373 |
+
#: includes/i18n.php:121
|
374 |
+
msgid "Plugins"
|
375 |
+
msgstr "Plugins"
|
376 |
+
|
377 |
+
#: includes/i18n.php:122
|
378 |
+
msgid "Theme"
|
379 |
+
msgstr "Tema"
|
380 |
+
|
381 |
+
#: includes/i18n.php:123
|
382 |
+
msgid "Themes"
|
383 |
+
msgstr "Temaer"
|
384 |
+
|
385 |
+
#: includes/i18n.php:124
|
386 |
+
msgctxt "as file/folder path"
|
387 |
+
msgid "Path"
|
388 |
+
msgstr "Sti"
|
389 |
+
|
390 |
+
#: includes/i18n.php:125
|
391 |
+
msgid "Title"
|
392 |
+
msgstr "Titel"
|
393 |
+
|
394 |
+
#: includes/i18n.php:126
|
395 |
+
msgid "Free version"
|
396 |
+
msgstr "Gratis version"
|
397 |
+
|
398 |
+
#: includes/i18n.php:127
|
399 |
+
msgid "Premium version"
|
400 |
+
msgstr "Premium version"
|
401 |
+
|
402 |
+
#: includes/i18n.php:128
|
403 |
+
msgctxt "as WP plugin slug"
|
404 |
+
msgid "Slug"
|
405 |
+
msgstr "Kortnavn"
|
406 |
+
|
407 |
+
#: includes/i18n.php:129
|
408 |
+
msgid "ID"
|
409 |
+
msgstr "ID"
|
410 |
+
|
411 |
+
#: includes/i18n.php:130
|
412 |
+
msgid "Users"
|
413 |
+
msgstr "Brugere"
|
414 |
+
|
415 |
+
#: includes/i18n.php:131
|
416 |
+
msgid "%s Installs"
|
417 |
+
msgstr "%s installeringer"
|
418 |
+
|
419 |
+
#: includes/i18n.php:132
|
420 |
+
msgctxt "like websites"
|
421 |
+
msgid "Sites"
|
422 |
+
msgstr "Websteder"
|
423 |
+
|
424 |
+
#: includes/i18n.php:133
|
425 |
+
msgid "User ID"
|
426 |
+
msgstr "Bruger-ID"
|
427 |
+
|
428 |
+
#: includes/i18n.php:134
|
429 |
+
msgid "Site ID"
|
430 |
+
msgstr "Websteds-ID"
|
431 |
+
|
432 |
+
#: includes/i18n.php:135
|
433 |
+
msgid "Public Key"
|
434 |
+
msgstr "Offentlig nøgle"
|
435 |
+
|
436 |
+
#: includes/i18n.php:136
|
437 |
+
msgid "Secret Key"
|
438 |
+
msgstr "Privat nøgle"
|
439 |
+
|
440 |
+
#: includes/i18n.php:137
|
441 |
+
msgctxt "as secret encryption key missing"
|
442 |
+
msgid "No Secret"
|
443 |
+
msgstr "Ingen privat nøgle"
|
444 |
+
|
445 |
+
#: includes/i18n.php:138
|
446 |
+
msgid "No ID"
|
447 |
+
msgstr "Intet ID"
|
448 |
+
|
449 |
+
#: includes/i18n.php:139
|
450 |
+
msgctxt "as synchronize license"
|
451 |
+
msgid "Sync License"
|
452 |
+
msgstr "Synkroniser licens"
|
453 |
+
|
454 |
+
#: includes/i18n.php:140
|
455 |
+
msgctxt "as synchronize"
|
456 |
+
msgid "Sync"
|
457 |
+
msgstr "Synkroniser"
|
458 |
+
|
459 |
+
#: includes/i18n.php:141
|
460 |
+
msgid "Activate License"
|
461 |
+
msgstr "Aktiver licens"
|
462 |
+
|
463 |
+
#: includes/i18n.php:142
|
464 |
+
msgid "Activate Free Version"
|
465 |
+
msgstr "Aktiver gratis version"
|
466 |
+
|
467 |
+
#: includes/i18n.php:143
|
468 |
+
msgid "Please enter the license key that you received in the email right after the purchase:"
|
469 |
+
msgstr "Please enter the license key that you received in the email right after the purchase:"
|
470 |
+
|
471 |
+
#: includes/i18n.php:144
|
472 |
+
msgid "Activating license..."
|
473 |
+
msgstr "Aktiverer licens..."
|
474 |
+
|
475 |
+
#: includes/i18n.php:145
|
476 |
+
msgid "Change License"
|
477 |
+
msgstr "Skift licens"
|
478 |
+
|
479 |
+
#: includes/i18n.php:146
|
480 |
+
msgid "Update License"
|
481 |
+
msgstr "Opdater licens"
|
482 |
+
|
483 |
+
#: includes/i18n.php:147
|
484 |
+
msgid "Deactivate License"
|
485 |
+
msgstr "Deaktiver licens"
|
486 |
+
|
487 |
+
#: includes/i18n.php:148
|
488 |
+
msgid "Activate"
|
489 |
+
msgstr "Aktiver"
|
490 |
+
|
491 |
+
#: includes/i18n.php:149
|
492 |
+
msgid "Deactivate"
|
493 |
+
msgstr "Deaktiver"
|
494 |
+
|
495 |
+
#: includes/i18n.php:150
|
496 |
+
msgid "Skip & Deactivate"
|
497 |
+
msgstr "Spring over & deaktiver"
|
498 |
+
|
499 |
+
#: includes/i18n.php:151
|
500 |
+
msgid "Skip & %s"
|
501 |
+
msgstr "Spring over & %s"
|
502 |
+
|
503 |
+
#: includes/i18n.php:152
|
504 |
+
msgid "No - just deactivate"
|
505 |
+
msgstr "Nej - bare deaktiver"
|
506 |
+
|
507 |
+
#: includes/i18n.php:153
|
508 |
+
msgid "Yes - do your thing"
|
509 |
+
msgstr "Yes - do your thing"
|
510 |
+
|
511 |
+
#: includes/i18n.php:154
|
512 |
+
msgctxt "active mode"
|
513 |
+
msgid "Active"
|
514 |
+
msgstr "Aktiv"
|
515 |
+
|
516 |
+
#: includes/i18n.php:155
|
517 |
+
msgctxt "is active mode?"
|
518 |
+
msgid "Is Active"
|
519 |
+
msgstr "Er aktiv"
|
520 |
+
|
521 |
+
#: includes/i18n.php:156
|
522 |
+
msgid "Install Now"
|
523 |
+
msgstr "Installer nu"
|
524 |
+
|
525 |
+
#: includes/i18n.php:157
|
526 |
+
msgid "Install Update Now"
|
527 |
+
msgstr "Installer opdatering nu"
|
528 |
+
|
529 |
+
#: includes/i18n.php:158
|
530 |
+
msgid "More information about %s"
|
531 |
+
msgstr "Mere information om %s"
|
532 |
+
|
533 |
+
#: includes/i18n.php:159
|
534 |
+
msgid "Localhost"
|
535 |
+
msgstr "Localhost"
|
536 |
+
|
537 |
+
#: includes/i18n.php:160
|
538 |
+
msgctxt "as activate Professional plan"
|
539 |
+
msgid "Activate %s Plan"
|
540 |
+
msgstr "Aktiver %s plan"
|
541 |
+
|
542 |
+
#: includes/i18n.php:161
|
543 |
+
msgctxt "as 5 licenses left"
|
544 |
+
msgid "%s left"
|
545 |
+
msgstr "%s tilbage"
|
546 |
+
|
547 |
+
#: includes/i18n.php:162
|
548 |
+
msgid "Last license"
|
549 |
+
msgstr "Seneste license"
|
550 |
+
|
551 |
+
#: includes/i18n.php:163
|
552 |
+
msgid "What is your %s?"
|
553 |
+
msgstr "What is your %s?"
|
554 |
+
|
555 |
+
#: includes/i18n.php:164
|
556 |
+
msgid "Activate this add-on"
|
557 |
+
msgstr "Aktiver denne tilføjelse"
|
558 |
+
|
559 |
+
#: includes/i18n.php:165
|
560 |
+
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?"
|
561 |
+
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?"
|
562 |
+
|
563 |
+
#: includes/i18n.php:166
|
564 |
+
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?"
|
565 |
+
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?"
|
566 |
+
|
567 |
+
#: includes/i18n.php:167
|
568 |
+
msgid "Deletion is not temporary. Only delete if you no longer want to use this %s anymore. Are you sure you would like to continue with the deletion?"
|
569 |
+
msgstr "Deletion is not temporary. Only delete if you no longer want to use this %s anymore. Are you sure you would like to continue with the deletion?"
|
570 |
+
|
571 |
+
#: includes/i18n.php:168
|
572 |
+
msgid "Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s."
|
573 |
+
msgstr "Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s."
|
574 |
+
|
575 |
+
#: includes/i18n.php:169
|
576 |
+
msgid "Cancelling the trial will immediately block access to all premium features. Are you sure?"
|
577 |
+
msgstr "Cancelling the trial will immediately block access to all premium features. Are you sure?"
|
578 |
+
|
579 |
+
#: includes/i18n.php:170
|
580 |
+
msgid "You can still enjoy all %s features but you will not have access to %s updates and support."
|
581 |
+
msgstr "You can still enjoy all %s features but you will not have access to %s updates and support."
|
582 |
+
|
583 |
+
#: includes/i18n.php:171
|
584 |
+
msgid "Once your license expires you can still use the Free version but you will NOT have access to the %s features."
|
585 |
+
msgstr "Once your license expires you can still use the Free version but you will NOT have access to the %s features."
|
586 |
+
|
587 |
+
#: includes/i18n.php:172
|
588 |
+
msgid "Are you sure you want to proceed?"
|
589 |
+
msgstr "Er du sikker på, du vil fortsætte?"
|
590 |
+
|
591 |
+
#: includes/i18n.php:175
|
592 |
+
msgid "Add Ons for %s"
|
593 |
+
msgstr "Tilføjelser til %s"
|
594 |
+
|
595 |
+
#: includes/i18n.php:176
|
596 |
+
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."
|
597 |
+
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."
|
598 |
+
|
599 |
+
#: includes/i18n.php:178
|
600 |
+
msgid "Anonymous feedback"
|
601 |
+
msgstr "Anonym feedback"
|
602 |
+
|
603 |
+
#: includes/i18n.php:179
|
604 |
+
msgid "Quick feedback"
|
605 |
+
msgstr "Hurtig feedback"
|
606 |
+
|
607 |
+
#: includes/i18n.php:180
|
608 |
+
msgid "If you have a moment, please let us know why you are %s"
|
609 |
+
msgstr "If you have a moment, please let us know why you are %s"
|
610 |
+
|
611 |
+
#: includes/i18n.php:181
|
612 |
+
msgid "deactivating"
|
613 |
+
msgstr "deactivating"
|
614 |
+
|
615 |
+
#: includes/i18n.php:182
|
616 |
+
msgid "Deactivation"
|
617 |
+
msgstr "Deactivation"
|
618 |
+
|
619 |
+
#: includes/i18n.php:183
|
620 |
+
msgid "Theme Switch"
|
621 |
+
msgstr "Theme Switch"
|
622 |
+
|
623 |
+
#: includes/i18n.php:184
|
624 |
+
msgid "switching"
|
625 |
+
msgstr "switching"
|
626 |
+
|
627 |
+
#: includes/i18n.php:185
|
628 |
+
msgid "Switch"
|
629 |
+
msgstr "Switch"
|
630 |
+
|
631 |
+
#: includes/i18n.php:186
|
632 |
+
msgid "Activate %s"
|
633 |
+
msgstr "Activate %s"
|
634 |
+
|
635 |
+
#: includes/i18n.php:187
|
636 |
+
msgid "Yes - %s"
|
637 |
+
msgstr "Yes - %s"
|
638 |
+
|
639 |
+
#: includes/i18n.php:188
|
640 |
+
msgid "Submit & %s"
|
641 |
+
msgstr "Submit & %s"
|
642 |
+
|
643 |
+
#: includes/i18n.php:189
|
644 |
+
msgid "Cancel"
|
645 |
+
msgstr "Annuller"
|
646 |
+
|
647 |
+
#: includes/i18n.php:190
|
648 |
+
msgid "I no longer need the %s"
|
649 |
+
msgstr "I no longer need the %s"
|
650 |
+
|
651 |
+
#: includes/i18n.php:191
|
652 |
+
msgid "I found a better %s"
|
653 |
+
msgstr "I found a better %s"
|
654 |
+
|
655 |
+
#: includes/i18n.php:192
|
656 |
+
msgid "I only needed the %s for a short period"
|
657 |
+
msgstr "I only needed the %s for a short period"
|
658 |
+
|
659 |
+
#: includes/i18n.php:193
|
660 |
+
msgid "The %s broke my site"
|
661 |
+
msgstr "The %s broke my site"
|
662 |
+
|
663 |
+
#: includes/i18n.php:194
|
664 |
+
msgid "The %s suddenly stopped working"
|
665 |
+
msgstr "The %s suddenly stopped working"
|
666 |
+
|
667 |
+
#: includes/i18n.php:195
|
668 |
+
msgid "I can't pay for it anymore"
|
669 |
+
msgstr "Jeg kan ikke længere betale for det"
|
670 |
+
|
671 |
+
#: includes/i18n.php:196
|
672 |
+
msgid "It's a temporary deactivation. I'm just debugging an issue."
|
673 |
+
msgstr "Det er en midlertidig deaktivering. Jeg prøver at fejlfinde et problem."
|
674 |
+
|
675 |
+
#: includes/i18n.php:197
|
676 |
+
msgid "It's a temporary %s. I'm just debugging an issue."
|
677 |
+
msgstr "It's a temporary %s. I'm just debugging an issue."
|
678 |
+
|
679 |
+
#: includes/i18n.php:198
|
680 |
+
msgctxt ""
|
681 |
+
msgid "Other"
|
682 |
+
msgstr "Other"
|
683 |
+
|
684 |
+
#: includes/i18n.php:200
|
685 |
+
msgid "Kindly tell us the reason so we can improve."
|
686 |
+
msgstr "Fortæl os venligst årsagen, så vi kan forbedre det."
|
687 |
+
|
688 |
+
#: includes/i18n.php:201
|
689 |
+
msgid "What's the %s's name?"
|
690 |
+
msgstr "What's the %s's name?"
|
691 |
+
|
692 |
+
#: includes/i18n.php:202
|
693 |
+
msgid "What price would you feel comfortable paying?"
|
694 |
+
msgstr "What price would you feel comfortable paying?"
|
695 |
+
|
696 |
+
#: includes/i18n.php:203
|
697 |
+
msgid "I couldn't understand how to make it work"
|
698 |
+
msgstr "Jeg forstod ikke, hvordan jeg skulle få det til at fungere."
|
699 |
+
|
700 |
+
#: includes/i18n.php:204
|
701 |
+
msgid "The %s is great, but I need specific feature that you don't support"
|
702 |
+
msgstr "The %s is great, but I need specific feature that you don't support"
|
703 |
+
|
704 |
+
#: includes/i18n.php:205
|
705 |
+
msgid "The %s is not working"
|
706 |
+
msgstr "The %s is not working"
|
707 |
+
|
708 |
+
#: includes/i18n.php:206
|
709 |
+
msgid "It's not what I was looking for"
|
710 |
+
msgstr "Det er ikke, hvad jeg søgte"
|
711 |
+
|
712 |
+
#: includes/i18n.php:207
|
713 |
+
msgid "The %s didn't work as expected"
|
714 |
+
msgstr "The %s didn't work as expected"
|
715 |
+
|
716 |
+
#: includes/i18n.php:208
|
717 |
+
msgid "What feature?"
|
718 |
+
msgstr "Hvilken feature?"
|
719 |
+
|
720 |
+
#: includes/i18n.php:209
|
721 |
+
msgid "Kindly share what didn't work so we can fix it for future users..."
|
722 |
+
msgstr "Kindly share what didn't work so we can fix it for future users..."
|
723 |
+
|
724 |
+
#: includes/i18n.php:210
|
725 |
+
msgid "What you've been looking for?"
|
726 |
+
msgstr "What you've been looking for?"
|
727 |
+
|
728 |
+
#: includes/i18n.php:211
|
729 |
+
msgid "What did you expect?"
|
730 |
+
msgstr "Hvad forventede du?"
|
731 |
+
|
732 |
+
#: includes/i18n.php:212
|
733 |
+
msgid "The %s didn't work"
|
734 |
+
msgstr "The %s didn't work"
|
735 |
+
|
736 |
+
#: includes/i18n.php:213
|
737 |
+
msgid "I don't like to share my information with you"
|
738 |
+
msgstr "I don't like to share my information with you"
|
739 |
+
|
740 |
+
#: includes/i18n.php:214
|
741 |
+
msgid "You might have missed it, but you don't have to share any data and can just %s the opt-in."
|
742 |
+
msgstr "You might have missed it, but you don't have to share any data and can just %s the opt-in."
|
743 |
+
|
744 |
+
#: includes/i18n.php:218
|
745 |
+
msgctxt "greeting"
|
746 |
+
msgid "Hey %s,"
|
747 |
+
msgstr "Hey %s,"
|
748 |
+
|
749 |
+
#: includes/i18n.php:219
|
750 |
+
msgctxt "a greeting. E.g. Thanks John!"
|
751 |
+
msgid "Thanks %s!"
|
752 |
+
msgstr "Tak %s!"
|
753 |
+
|
754 |
+
#: includes/i18n.php:220
|
755 |
+
msgid "Never miss an important update - opt-in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s."
|
756 |
+
msgstr "Never miss an important update - opt-in to our security and feature updates notifications, and non-sensitive diagnostic tracking with %4$s."
|
757 |
+
|
758 |
+
#: includes/i18n.php:221
|
759 |
+
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."
|
760 |
+
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."
|
761 |
+
|
762 |
+
#: includes/i18n.php:222
|
763 |
+
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."
|
764 |
+
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."
|
765 |
+
|
766 |
+
#: includes/i18n.php:223
|
767 |
+
msgid "complete the install"
|
768 |
+
msgstr "færdiggør installeringen"
|
769 |
+
|
770 |
+
#: includes/i18n.php:224
|
771 |
+
msgid "start the trial"
|
772 |
+
msgstr "start prøveperioden"
|
773 |
+
|
774 |
+
#: includes/i18n.php:225
|
775 |
+
msgid "Thanks for purchasing %s! To get started, please enter your license key:"
|
776 |
+
msgstr "Thanks for purchasing %s! To get started, please enter your license key:"
|
777 |
+
|
778 |
+
#: includes/i18n.php:226
|
779 |
+
msgid "The %1$s will be periodically sending data to %2$s to check for security and feature updates, and verify the validity of your license."
|
780 |
+
msgstr "The %1$s will be periodically sending data to %2$s to check for security and feature updates, and verify the validity of your license."
|
781 |
+
|
782 |
+
#: includes/i18n.php:227
|
783 |
+
msgid "What permissions are being granted?"
|
784 |
+
msgstr "Hvilke tilladelser bliver givet?"
|
785 |
+
|
786 |
+
#: includes/i18n.php:228
|
787 |
+
msgid "Your Profile Overview"
|
788 |
+
msgstr "Overblik af din profil"
|
789 |
+
|
790 |
+
#: includes/i18n.php:229
|
791 |
+
msgid "Name and email address"
|
792 |
+
msgstr "Navn og e-mailadresse"
|
793 |
+
|
794 |
+
#: includes/i18n.php:230
|
795 |
+
msgid "Your Site Overview"
|
796 |
+
msgstr "Overblik af dit websted"
|
797 |
+
|
798 |
+
#: includes/i18n.php:231
|
799 |
+
msgid "Site URL, WP version, PHP info, plugins & themes"
|
800 |
+
msgstr "Websteds-URL, WP version, PHP info, plugins og temaer"
|
801 |
+
|
802 |
+
#: includes/i18n.php:232
|
803 |
+
msgid "Current %s Events"
|
804 |
+
msgstr "Current %s Events"
|
805 |
+
|
806 |
+
#: includes/i18n.php:233
|
807 |
+
msgid "Activation, deactivation and uninstall"
|
808 |
+
msgstr "Aktivering, deaktivering og afinstallering"
|
809 |
+
|
810 |
+
#: includes/i18n.php:234
|
811 |
+
msgid "Plugins & Themes"
|
812 |
+
msgstr "Plugins & Temaer"
|
813 |
+
|
814 |
+
#: includes/i18n.php:235
|
815 |
+
msgid "Titles, versions and state."
|
816 |
+
msgstr "Titler, versioner og tilstand."
|
817 |
+
|
818 |
+
#: includes/i18n.php:236
|
819 |
+
msgid "Admin Notices"
|
820 |
+
msgstr "Admin Notices"
|
821 |
+
|
822 |
+
#: includes/i18n.php:237
|
823 |
+
msgid "Newsletter"
|
824 |
+
msgstr "Nyhedsbrev"
|
825 |
+
|
826 |
+
#: includes/i18n.php:238
|
827 |
+
msgid "Updates, announcements, marketing, no spam"
|
828 |
+
msgstr "Updates, announcements, marketing, no spam"
|
829 |
+
|
830 |
+
#: includes/i18n.php:239
|
831 |
+
msgid "Privacy Policy"
|
832 |
+
msgstr "Privatlivspolitik"
|
833 |
+
|
834 |
+
#: includes/i18n.php:240
|
835 |
+
msgid "Terms of Service"
|
836 |
+
msgstr "Servicevilkår"
|
837 |
+
|
838 |
+
#: includes/i18n.php:241
|
839 |
+
msgctxt "as activating plugin"
|
840 |
+
msgid "Activating"
|
841 |
+
msgstr "Aktiverer"
|
842 |
+
|
843 |
+
#: includes/i18n.php:242
|
844 |
+
msgctxt "as in the process of sending an email"
|
845 |
+
msgid "Sending email"
|
846 |
+
msgstr "Sender e-mail"
|
847 |
+
|
848 |
+
#: includes/i18n.php:243
|
849 |
+
msgctxt "button label"
|
850 |
+
msgid "Allow & Continue"
|
851 |
+
msgstr "Tillad & Fortsæt"
|
852 |
+
|
853 |
+
#: includes/i18n.php:244
|
854 |
+
msgctxt "button label"
|
855 |
+
msgid "Agree & Activate License"
|
856 |
+
msgstr "Accepter & aktiver licens"
|
857 |
+
|
858 |
+
#: includes/i18n.php:245
|
859 |
+
msgctxt "verb"
|
860 |
+
msgid "Skip"
|
861 |
+
msgstr "Spring over"
|
862 |
+
|
863 |
+
#: includes/i18n.php:246
|
864 |
+
msgid "Click here to use the plugin anonymously"
|
865 |
+
msgstr "Klik her for at benytte pluginnet anonymt"
|
866 |
+
|
867 |
+
#: includes/i18n.php:247
|
868 |
+
msgid "Re-send activation email"
|
869 |
+
msgstr "Gensend e-mail om aktivering"
|
870 |
+
|
871 |
+
#: includes/i18n.php:248
|
872 |
+
msgid "License key"
|
873 |
+
msgstr "Licensnøgle"
|
874 |
+
|
875 |
+
#: includes/i18n.php:249
|
876 |
+
msgid "Send License Key"
|
877 |
+
msgstr "Send licensnøgle"
|
878 |
+
|
879 |
+
#: includes/i18n.php:250
|
880 |
+
msgid "Sending license key"
|
881 |
+
msgstr "Sender licensnøgle"
|
882 |
+
|
883 |
+
#: includes/i18n.php:251
|
884 |
+
msgid "Have a license key?"
|
885 |
+
msgstr "Har du en licensnøgle?"
|
886 |
+
|
887 |
+
#: includes/i18n.php:252
|
888 |
+
msgid "Don't have a license key?"
|
889 |
+
msgstr "Har du ikke en licensnøgle?"
|
890 |
+
|
891 |
+
#: includes/i18n.php:253
|
892 |
+
msgid "Can't find your license key?"
|
893 |
+
msgstr "Kan du ikke finde din licensnøgle?"
|
894 |
+
|
895 |
+
#: includes/i18n.php:254
|
896 |
+
msgid "We couldn't find your email address in the system, are you sure it's the right address?"
|
897 |
+
msgstr "We couldn't find your email address in the system, are you sure it's the right address?"
|
898 |
+
|
899 |
+
#: includes/i18n.php:255
|
900 |
+
msgid "We can't see any active licenses associated with that email address, are you sure it's the right address?"
|
901 |
+
msgstr "We can't see any active licenses associated with that email address, are you sure it's the right address?"
|
902 |
+
|
903 |
+
#: includes/i18n.php:256
|
904 |
+
msgid "Opt In"
|
905 |
+
msgstr "Tilmeld"
|
906 |
+
|
907 |
+
#: includes/i18n.php:257
|
908 |
+
msgid "Opt Out"
|
909 |
+
msgstr "Frameld"
|
910 |
+
|
911 |
+
#: includes/i18n.php:258
|
912 |
+
msgid "On second thought - I want to continue helping"
|
913 |
+
msgstr "Ved nærmere eftertanke - Jeg vil fortsætte med at hjælpe"
|
914 |
+
|
915 |
+
#: includes/i18n.php:259
|
916 |
+
msgid "Opting out..."
|
917 |
+
msgstr "Framelder..."
|
918 |
+
|
919 |
+
#: includes/i18n.php:260
|
920 |
+
msgid "Opting in..."
|
921 |
+
msgstr "Tilmelder..."
|
922 |
+
|
923 |
+
#: includes/i18n.php:261
|
924 |
+
msgid "We appreciate your help in making the %s better by letting us track some usage data."
|
925 |
+
msgstr "We appreciate your help in making the %s better by letting us track some usage data."
|
926 |
+
|
927 |
+
#: includes/i18n.php:262
|
928 |
+
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."
|
929 |
+
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."
|
930 |
+
|
931 |
+
#: includes/i18n.php:263
|
932 |
+
msgid "By clicking \"Opt Out\", we will no longer be sending any data from %s to %s."
|
933 |
+
msgstr "Ved at klikke \"Frameld\" vil vi ikke længere sende data fra %s til %s."
|
934 |
+
|
935 |
+
#: includes/i18n.php:267
|
936 |
+
msgid "Screenshots"
|
937 |
+
msgstr "Skærmbilleder"
|
938 |
+
|
939 |
+
#: includes/i18n.php:268
|
940 |
+
msgid "Click to view full-size screenshot %d"
|
941 |
+
msgstr "Click to view full-size screenshot %d"
|
942 |
+
|
943 |
+
#: includes/i18n.php:272
|
944 |
+
msgid "Freemius Debug"
|
945 |
+
msgstr "Freemius Debug"
|
946 |
+
|
947 |
+
#: includes/i18n.php:273
|
948 |
+
msgctxt "as turned on"
|
949 |
+
msgid "On"
|
950 |
+
msgstr "Til"
|
951 |
+
|
952 |
+
#: includes/i18n.php:274
|
953 |
+
msgctxt "as turned off"
|
954 |
+
msgid "Off"
|
955 |
+
msgstr "Fra"
|
956 |
+
|
957 |
+
#: includes/i18n.php:275
|
958 |
+
msgctxt "as code debugging"
|
959 |
+
msgid "Debugging"
|
960 |
+
msgstr "Fejlfinding"
|
961 |
+
|
962 |
+
#: includes/i18n.php:276
|
963 |
+
msgid "Freemius State"
|
964 |
+
msgstr "Freemius tilstand"
|
965 |
+
|
966 |
+
#: includes/i18n.php:277
|
967 |
+
msgctxt "as connection was successful"
|
968 |
+
msgid "Connected"
|
969 |
+
msgstr "Forbundet"
|
970 |
+
|
971 |
+
#: includes/i18n.php:278
|
972 |
+
msgctxt "as connection blocked"
|
973 |
+
msgid "Blocked"
|
974 |
+
msgstr "Blokeret"
|
975 |
+
|
976 |
+
#: includes/i18n.php:279
|
977 |
+
msgctxt "as application program interface"
|
978 |
+
msgid "API"
|
979 |
+
msgstr "API"
|
980 |
+
|
981 |
+
#: includes/i18n.php:280
|
982 |
+
msgctxt "as software development kit versions"
|
983 |
+
msgid "SDK"
|
984 |
+
msgstr "SDK"
|
985 |
+
|
986 |
+
#: includes/i18n.php:281
|
987 |
+
msgctxt "as software development kit versions"
|
988 |
+
msgid "SDK Versions"
|
989 |
+
msgstr "SDK-versioner"
|
990 |
+
|
991 |
+
#: includes/i18n.php:282
|
992 |
+
msgctxt "as plugin folder path"
|
993 |
+
msgid "Plugin Path"
|
994 |
+
msgstr "Plugin-sti"
|
995 |
+
|
996 |
+
#: includes/i18n.php:283
|
997 |
+
msgctxt "as sdk path"
|
998 |
+
msgid "SDK Path"
|
999 |
+
msgstr "SDK-sti"
|
1000 |
+
|
1001 |
+
#: includes/i18n.php:284
|
1002 |
+
msgid "Add Ons of Plugin %s"
|
1003 |
+
msgstr "Tilføjelser til plugin %s"
|
1004 |
+
|
1005 |
+
#: includes/i18n.php:285
|
1006 |
+
msgid "Are you sure you want to delete all Freemius data?"
|
1007 |
+
msgstr "Er du sikker på, du vil slette al Freemius data?"
|
1008 |
+
|
1009 |
+
#: includes/i18n.php:286
|
1010 |
+
msgid "Actions"
|
1011 |
+
msgstr "Handlinger"
|
1012 |
+
|
1013 |
+
#: includes/i18n.php:287
|
1014 |
+
msgid "Delete All Accounts"
|
1015 |
+
msgstr "Slet alle konti"
|
1016 |
+
|
1017 |
+
#: includes/i18n.php:288
|
1018 |
+
msgid "Start Fresh"
|
1019 |
+
msgstr "Start forfra"
|
1020 |
+
|
1021 |
+
#: includes/i18n.php:289
|
1022 |
+
msgid "Clear API Cache"
|
1023 |
+
msgstr "Ryd API-cache"
|
1024 |
+
|
1025 |
+
#: includes/i18n.php:290
|
1026 |
+
msgid "Sync Data From Server"
|
1027 |
+
msgstr "Synkroniser data fra server"
|
1028 |
+
|
1029 |
+
#: includes/i18n.php:291
|
1030 |
+
msgid "Scheduled Crons"
|
1031 |
+
msgstr "Planlagte cron jobs"
|
1032 |
+
|
1033 |
+
#: includes/i18n.php:292
|
1034 |
+
msgid "Cron Type"
|
1035 |
+
msgstr "Cron Type"
|
1036 |
+
|
1037 |
+
#: includes/i18n.php:293
|
1038 |
+
msgid "Plugins & Themes Sync"
|
1039 |
+
msgstr "Synkronisering af plugins og temaer"
|
1040 |
+
|
1041 |
+
#: includes/i18n.php:294
|
1042 |
+
msgid "%s Licenses"
|
1043 |
+
msgstr "%s Licenses"
|
1044 |
+
|
1045 |
+
#: includes/i18n.php:295
|
1046 |
+
msgid "Debug Log"
|
1047 |
+
msgstr "Fejlfindingslog"
|
1048 |
+
|
1049 |
+
#: includes/i18n.php:296
|
1050 |
+
msgid "All"
|
1051 |
+
msgstr "Alle"
|
1052 |
+
|
1053 |
+
#: includes/i18n.php:297
|
1054 |
+
msgid "File"
|
1055 |
+
msgstr "Fil"
|
1056 |
+
|
1057 |
+
#: includes/i18n.php:298
|
1058 |
+
msgid "Function"
|
1059 |
+
msgstr "Funktion"
|
1060 |
+
|
1061 |
+
#: includes/i18n.php:299
|
1062 |
+
msgid "Process ID"
|
1063 |
+
msgstr "Proces-ID"
|
1064 |
+
|
1065 |
+
#: includes/i18n.php:300
|
1066 |
+
msgid "Logger"
|
1067 |
+
msgstr "Logger"
|
1068 |
+
|
1069 |
+
#: includes/i18n.php:301
|
1070 |
+
msgid "Message"
|
1071 |
+
msgstr "Besked"
|
1072 |
+
|
1073 |
+
#: includes/i18n.php:302
|
1074 |
+
msgid "Download"
|
1075 |
+
msgstr "Download"
|
1076 |
+
|
1077 |
+
#: includes/i18n.php:303
|
1078 |
+
msgid "Filter"
|
1079 |
+
msgstr "Filter"
|
1080 |
+
|
1081 |
+
#: includes/i18n.php:304
|
1082 |
+
msgid "Type"
|
1083 |
+
msgstr "Type"
|
1084 |
+
|
1085 |
+
#: includes/i18n.php:305
|
1086 |
+
msgid "All Types"
|
1087 |
+
msgstr "Alle typer"
|
1088 |
+
|
1089 |
+
#: includes/i18n.php:306
|
1090 |
+
msgid "All Requests"
|
1091 |
+
msgstr "Alle forespørgsler"
|
1092 |
+
|
1093 |
+
#: includes/i18n.php:310
|
1094 |
+
msgctxt "as congratulations"
|
1095 |
+
msgid "Congrats"
|
1096 |
+
msgstr "Tillykke"
|
1097 |
+
|
1098 |
+
#: includes/i18n.php:311
|
1099 |
+
msgctxt "exclamation"
|
1100 |
+
msgid "Oops"
|
1101 |
+
msgstr "Ups"
|
1102 |
+
|
1103 |
+
#: includes/i18n.php:312
|
1104 |
+
msgctxt "interjection expressing joy or exuberance"
|
1105 |
+
msgid "Yee-haw"
|
1106 |
+
msgstr "Yee-haw"
|
1107 |
+
|
1108 |
+
#: includes/i18n.php:313
|
1109 |
+
msgctxt ""
|
1110 |
+
msgid "W00t"
|
1111 |
+
msgstr "W00t"
|
1112 |
+
|
1113 |
+
#: includes/i18n.php:315
|
1114 |
+
msgctxt "a positive response"
|
1115 |
+
msgid "Right on"
|
1116 |
+
msgstr "Sådan"
|
1117 |
+
|
1118 |
+
#: includes/i18n.php:316
|
1119 |
+
msgctxt ""
|
1120 |
+
msgid "Hmm"
|
1121 |
+
msgstr "Hmm"
|
1122 |
+
|
1123 |
+
#: includes/i18n.php:318
|
1124 |
+
msgid "O.K"
|
1125 |
+
msgstr "O.K"
|
1126 |
+
|
1127 |
+
#: includes/i18n.php:319
|
1128 |
+
msgctxt "exclamation"
|
1129 |
+
msgid "Hey"
|
1130 |
+
msgstr "Hey"
|
1131 |
+
|
1132 |
+
#: includes/i18n.php:320
|
1133 |
+
msgctxt "advance notice of something that will need attention."
|
1134 |
+
msgid "Heads up"
|
1135 |
+
msgstr "Se her"
|
1136 |
+
|
1137 |
+
#: includes/i18n.php:325
|
1138 |
+
msgid "Seems like you got the latest release."
|
1139 |
+
msgstr "Det ser ud til, at du har den seneste udgivelse."
|
1140 |
+
|
1141 |
+
#: includes/i18n.php:326
|
1142 |
+
msgid "You are all good!"
|
1143 |
+
msgstr "Det var det!"
|
1144 |
+
|
1145 |
+
#: includes/i18n.php:327
|
1146 |
+
msgid "Sorry, we could not complete the email update. Another user with the same email is already registered."
|
1147 |
+
msgstr "Sorry, we could not complete the email update. Another user with the same email is already registered."
|
1148 |
+
|
1149 |
+
#: includes/i18n.php:328
|
1150 |
+
msgid "If you would like to give up the ownership of the %s's account to %s click the Change Ownership button."
|
1151 |
+
msgstr "If you would like to give up the ownership of the %s's account to %s click the Change Ownership button."
|
1152 |
+
|
1153 |
+
#: includes/i18n.php:329
|
1154 |
+
msgid "Your email was successfully updated. You should receive an email with confirmation instructions in few moments."
|
1155 |
+
msgstr "Your email was successfully updated. You should receive an email with confirmation instructions in few moments."
|
1156 |
+
|
1157 |
+
#: includes/i18n.php:330
|
1158 |
+
msgid "Your name was successfully updated."
|
1159 |
+
msgstr "Dit navn er blevet opdateret."
|
1160 |
+
|
1161 |
+
#: includes/i18n.php:331
|
1162 |
+
msgid "You have successfully updated your %s."
|
1163 |
+
msgstr "Opdatering af %s blev gennemført."
|
1164 |
+
|
1165 |
+
#: includes/i18n.php:332
|
1166 |
+
msgid "Please provide your full name."
|
1167 |
+
msgstr "Indtast venligst dit fulde navn."
|
1168 |
+
|
1169 |
+
#: includes/i18n.php:333
|
1170 |
+
msgid "Verification mail was just sent to %s. If you can't find it after 5 min, please check your spam box."
|
1171 |
+
msgstr "Verification mail was just sent to %s. If you can't find it after 5 min, please check your spam box."
|
1172 |
+
|
1173 |
+
#: includes/i18n.php:334
|
1174 |
+
msgid "Just letting you know that the add-ons information of %s is being pulled from an external server."
|
1175 |
+
msgstr "Just letting you know that the add-ons information of %s is being pulled from an external server."
|
1176 |
+
|
1177 |
+
#: includes/i18n.php:335
|
1178 |
+
msgid "No credit card required"
|
1179 |
+
msgstr "Betalingskort ikke påkrævet"
|
1180 |
+
|
1181 |
+
#: includes/i18n.php:336
|
1182 |
+
msgid "Premium %s version was successfully activated."
|
1183 |
+
msgstr "Premium %s version was successfully activated."
|
1184 |
+
|
1185 |
+
#: includes/i18n.php:337
|
1186 |
+
msgid "The upgrade of %s was successfully completed."
|
1187 |
+
msgstr "Opgraderingen af %s blev fuldendt."
|
1188 |
+
|
1189 |
+
#: includes/i18n.php:338
|
1190 |
+
msgid "Your account was successfully activated with the %s plan."
|
1191 |
+
msgstr "Din konto blev aktiveret med planen %s."
|
1192 |
+
|
1193 |
+
#: includes/i18n.php:339
|
1194 |
+
msgid "Download the latest %s version now"
|
1195 |
+
msgstr "Download den seneste version af %s nu"
|
1196 |
+
|
1197 |
+
#: includes/i18n.php:340
|
1198 |
+
msgid "Please follow these steps to complete the upgrade"
|
1199 |
+
msgstr "Følg venligst disse trin for at færdiggøre opgraderingen"
|
1200 |
+
|
1201 |
+
#: includes/i18n.php:341
|
1202 |
+
msgid "Download the latest %s version"
|
1203 |
+
msgstr "Download den seneste version af %s"
|
1204 |
+
|
1205 |
+
#: includes/i18n.php:342
|
1206 |
+
msgid "Download the latest version"
|
1207 |
+
msgstr "Download den seneste version"
|
1208 |
+
|
1209 |
+
#: includes/i18n.php:343
|
1210 |
+
msgid "Deactivate the free version"
|
1211 |
+
msgstr "Deaktiver den gratis version"
|
1212 |
+
|
1213 |
+
#: includes/i18n.php:344
|
1214 |
+
msgid "Upload and activate the downloaded version"
|
1215 |
+
msgstr "Upload og aktiver den downloadede version"
|
1216 |
+
|
1217 |
+
#: includes/i18n.php:345
|
1218 |
+
msgid "How to upload and activate?"
|
1219 |
+
msgstr "Upload og aktivering, hvordan?"
|
1220 |
+
|
1221 |
+
#: includes/i18n.php:346
|
1222 |
+
msgctxt "%s - product name, e.g. Facebook add-on was successfully..."
|
1223 |
+
msgid "%s Add-on was successfully purchased."
|
1224 |
+
msgstr "Betalingen for tilføjelsen %s blev gennemført."
|
1225 |
+
|
1226 |
+
#: includes/i18n.php:348
|
1227 |
+
msgid "Your %s Add-on plan was successfully upgraded."
|
1228 |
+
msgstr "Your %s Add-on plan was successfully upgraded."
|
1229 |
+
|
1230 |
+
#: includes/i18n.php:349
|
1231 |
+
msgid "Your email has been successfully verified - you are AWESOME!"
|
1232 |
+
msgstr "Your email has been successfully verified - you are AWESOME!"
|
1233 |
+
|
1234 |
+
#: includes/i18n.php:350
|
1235 |
+
msgid "Your plan was successfully upgraded."
|
1236 |
+
msgstr "Din plan er blevet opgraderet."
|
1237 |
+
|
1238 |
+
#: includes/i18n.php:351
|
1239 |
+
msgid "Your plan was successfully changed to %s."
|
1240 |
+
msgstr "Din plan er blevet ændret til %s."
|
1241 |
+
|
1242 |
+
#: includes/i18n.php:352
|
1243 |
+
msgid "Your license has expired. You can still continue using the free %s forever."
|
1244 |
+
msgstr "Your license has expired. You can still continue using the free %s forever."
|
1245 |
+
|
1246 |
+
#: includes/i18n.php:353
|
1247 |
+
msgid "Your license has been cancelled. If you think it's a mistake, please contact support."
|
1248 |
+
msgstr "Din licens er blevet annulleret. Hvis du mener, dette er en fejl, så kontakt venligst support."
|
1249 |
+
|
1250 |
+
#: includes/i18n.php:354
|
1251 |
+
msgid "Your trial has been successfully started."
|
1252 |
+
msgstr "Din prøveperiode er begyndt."
|
1253 |
+
|
1254 |
+
#: includes/i18n.php:355
|
1255 |
+
msgid "Your license was successfully activated."
|
1256 |
+
msgstr "Din licens er blevet aktiveret."
|
1257 |
+
|
1258 |
+
#: includes/i18n.php:356
|
1259 |
+
msgid "It looks like your site currently doesn't have an active license."
|
1260 |
+
msgstr "Det ser ud til, at dit websted endnu ikke har en aktiv licens."
|
1261 |
+
|
1262 |
+
#: includes/i18n.php:357
|
1263 |
+
msgid "Your license was successfully deactivated, you are back to the %s plan."
|
1264 |
+
msgstr "Din licens blev deaktiveret, du er tilbage på planen %s."
|
1265 |
+
|
1266 |
+
#: includes/i18n.php:358
|
1267 |
+
msgid "It looks like the license deactivation failed."
|
1268 |
+
msgstr "Det ser ud til, at licens-deaktiveringen mislykkedes."
|
1269 |
+
|
1270 |
+
#: includes/i18n.php:359
|
1271 |
+
msgid "It looks like the license could not be activated."
|
1272 |
+
msgstr "Det ser ud til, at licensen ikke kunne aktiveres."
|
1273 |
+
|
1274 |
+
#: includes/i18n.php:360
|
1275 |
+
msgid "Error received from the server:"
|
1276 |
+
msgstr "Fejl modtager fra serveren:"
|
1277 |
+
|
1278 |
+
#: includes/i18n.php:361
|
1279 |
+
msgid "Your trial has expired. You can still continue using all our free features."
|
1280 |
+
msgstr "Din prøveperiode er udløbet. Du kan fortsat bruge alle vores gratis funktioner."
|
1281 |
+
|
1282 |
+
#: includes/i18n.php:362
|
1283 |
+
msgid "Your plan was successfully downgraded. Your %s plan license will expire in %s."
|
1284 |
+
msgstr "Din plan blev nedgraderet. Licensen til din %s plan vil udløbe om %s."
|
1285 |
+
|
1286 |
+
#: includes/i18n.php:363
|
1287 |
+
msgid "Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes."
|
1288 |
+
msgstr "Seems like we are having some temporary issue with your plan downgrade. Please try again in few minutes."
|
1289 |
+
|
1290 |
+
#: includes/i18n.php:364
|
1291 |
+
msgid "It looks like you are not in trial mode anymore so there's nothing to cancel :)"
|
1292 |
+
msgstr "It looks like you are not in trial mode anymore so there's nothing to cancel :)"
|
1293 |
+
|
1294 |
+
#: includes/i18n.php:365
|
1295 |
+
msgid "Your %s free trial was successfully cancelled."
|
1296 |
+
msgstr "Din gratis prøveperiode for %s er blevet annulleret."
|
1297 |
+
|
1298 |
+
#: includes/i18n.php:366
|
1299 |
+
msgctxt "%s - numeric version number"
|
1300 |
+
msgid "Version %s was released."
|
1301 |
+
msgstr "Version %s er blevet udgivet."
|
1302 |
+
|
1303 |
+
#: includes/i18n.php:367
|
1304 |
+
msgid "Please download %s."
|
1305 |
+
msgstr "Download venligst %s."
|
1306 |
+
|
1307 |
+
#: includes/i18n.php:368
|
1308 |
+
msgctxt "%s - plan name, as the latest professional version here"
|
1309 |
+
msgid "the latest %s version here"
|
1310 |
+
msgstr "den seneste version af %s her"
|
1311 |
+
|
1312 |
+
#: includes/i18n.php:370
|
1313 |
+
msgid "How do you like %s so far? Test all our %s premium features with a %d-day free trial."
|
1314 |
+
msgstr "How do you like %s so far? Test all our %s premium features with a %d-day free trial."
|
1315 |
+
|
1316 |
+
#: includes/i18n.php:371
|
1317 |
+
msgctxt "call to action"
|
1318 |
+
msgid "Start free trial"
|
1319 |
+
msgstr "Start gratis prøveperiode"
|
1320 |
+
|
1321 |
+
#: includes/i18n.php:372
|
1322 |
+
msgid "Starting trial"
|
1323 |
+
msgstr "Starter prøveperiode"
|
1324 |
+
|
1325 |
+
#: includes/i18n.php:373
|
1326 |
+
msgid "Please wait"
|
1327 |
+
msgstr "Vent venligst"
|
1328 |
+
|
1329 |
+
#: includes/i18n.php:374
|
1330 |
+
msgid "Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes."
|
1331 |
+
msgstr "Seems like we are having some temporary issue with your trial cancellation. Please try again in few minutes."
|
1332 |
+
|
1333 |
+
#: includes/i18n.php:375
|
1334 |
+
msgid "You already utilized a trial before."
|
1335 |
+
msgstr "Du har allerede brugt din prøveperiode."
|
1336 |
+
|
1337 |
+
#: includes/i18n.php:376
|
1338 |
+
msgid "You are already running the %s in a trial mode."
|
1339 |
+
msgstr "You are already running the %s in a trial mode."
|
1340 |
+
|
1341 |
+
#: includes/i18n.php:377
|
1342 |
+
msgid "Plan %s do not exist, therefore, can't start a trial."
|
1343 |
+
msgstr "Plan %s eksisterer ikke og kan derfor ikke starte prøveperiode."
|
1344 |
+
|
1345 |
+
#: includes/i18n.php:378
|
1346 |
+
msgid "Plan %s does not support a trial period."
|
1347 |
+
msgstr "Plan %s understøtter ikke en prøveperiode."
|
1348 |
+
|
1349 |
+
#: includes/i18n.php:379
|
1350 |
+
msgid "None of the %s's plans supports a trial period."
|
1351 |
+
msgstr "None of the %s's plans supports a trial period."
|
1352 |
+
|
1353 |
+
#: includes/i18n.php:380
|
1354 |
+
msgid "Unexpected API error. Please contact the %s's author with the following error."
|
1355 |
+
msgstr "Unexpected API error. Please contact the %s's author with the following error."
|
1356 |
+
|
1357 |
+
#: includes/i18n.php:381
|
1358 |
+
msgid "No commitment for %s days - cancel anytime!"
|
1359 |
+
msgstr "Ingen bindinger i %s dage - annuller når som helst!"
|
1360 |
+
|
1361 |
+
#: includes/i18n.php:382
|
1362 |
+
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."
|
1363 |
+
msgstr "Din licens er udløbet. Du kan stadig benytte alle funktionerne i %s, men du bliver nødt til at fornye din licens for at få opdateringer og support."
|
1364 |
+
|
1365 |
+
#: includes/i18n.php:383
|
1366 |
+
msgid "Couldn't activate %s."
|
1367 |
+
msgstr "Kunne ikke aktivere %s."
|
1368 |
+
|
1369 |
+
#: includes/i18n.php:384
|
1370 |
+
msgid "Please contact us with the following message:"
|
1371 |
+
msgstr "Kontakt os venligst med følgende besked:"
|
1372 |
+
|
1373 |
+
#: includes/i18n.php:385
|
1374 |
+
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."
|
1375 |
+
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."
|
1376 |
+
|
1377 |
+
#: includes/i18n.php:386
|
1378 |
+
msgid "Please contact us here"
|
1379 |
+
msgstr "Kontakt os her"
|
1380 |
+
|
1381 |
+
#: includes/i18n.php:387
|
1382 |
+
msgid "I have upgraded my account but when I try to Sync the License, the plan remains %s."
|
1383 |
+
msgstr "I have upgraded my account but when I try to Sync the License, the plan remains %s."
|
1384 |
+
|
1385 |
+
#: includes/i18n.php:390
|
1386 |
+
msgid "From unknown reason, the API connectivity test failed."
|
1387 |
+
msgstr "From unknown reason, the API connectivity test failed."
|
1388 |
+
|
1389 |
+
#: includes/i18n.php:391
|
1390 |
+
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?"
|
1391 |
+
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?"
|
1392 |
+
|
1393 |
+
#: includes/i18n.php:392
|
1394 |
+
msgid "We use PHP cURL library for the API calls, which is a very common library and usually installed and activated out of the box. Unfortunately, cURL is not activated (or disabled) on your server."
|
1395 |
+
msgstr "We use PHP cURL library for the API calls, which is a very common library and usually installed and activated out of the box. Unfortunately, cURL is not activated (or disabled) on your server."
|
1396 |
+
|
1397 |
+
#: includes/i18n.php:393
|
1398 |
+
msgid "Disabled method(s):"
|
1399 |
+
msgstr "Disabled method(s):"
|
1400 |
+
|
1401 |
+
#: includes/i18n.php:394
|
1402 |
+
msgid "From unknown reason, CloudFlare, the firewall we use, blocks the connection."
|
1403 |
+
msgstr "Af en ukendt årsag blokerer CloudFlare, vores firewall, forbindelsen."
|
1404 |
+
|
1405 |
+
#: includes/i18n.php:395
|
1406 |
+
msgctxt "as pluginX requires an access to our API"
|
1407 |
+
msgid "%s requires an access to our API."
|
1408 |
+
msgstr "%s påkræver adgang til vores API."
|
1409 |
+
|
1410 |
+
#: includes/i18n.php:397
|
1411 |
+
msgid "It looks like your server is using Squid ACL (access control lists), which blocks the connection."
|
1412 |
+
msgstr "Det ser ud til, at din server benytter Squid ACL (access control lists), som blokerer forbindelsen."
|
1413 |
+
|
1414 |
+
#: includes/i18n.php:398
|
1415 |
+
msgid "I don't know what is Squid or ACL, help me!"
|
1416 |
+
msgstr "Jeg ved ikke hvad Squid eller ACL er. Hjælp mig!"
|
1417 |
+
|
1418 |
+
#: includes/i18n.php399, includes/i18n.php:403
|
1419 |
+
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."
|
1420 |
+
msgstr "Vi vil kontakte din udbyder og løse problemet. Når vi har opdatinger i sagen, vil vi følge op med en email til dig på %s."
|
1421 |
+
|
1422 |
+
#: includes/i18n.php:400
|
1423 |
+
msgid "I'm a system administrator"
|
1424 |
+
msgstr "Jeg er en system-administrator"
|
1425 |
+
|
1426 |
+
#: includes/i18n.php:401
|
1427 |
+
msgid "Great, please whitelist the following domains: %s. Once you are done, deactivate the %s and activate it again."
|
1428 |
+
msgstr "Great, please whitelist the following domains: %s. Once you are done, deactivate the %s and activate it again."
|
1429 |
+
|
1430 |
+
#: includes/i18n.php:402
|
1431 |
+
msgid "I don't know what is cURL or how to install it, help me!"
|
1432 |
+
msgstr "Jeg ved ikke hvad cURL er, eller hvordan jeg installerer det. Hjælp mig!"
|
1433 |
+
|
1434 |
+
#: includes/i18n.php:404
|
1435 |
+
msgid "Great, please install cURL and enable it in your php.ini file. In addition, search for the 'disable_functions' directive in your php.ini file and remove any disabled methods starting with 'curl_'. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the %s and reactivate it back again."
|
1436 |
+
msgstr "Great, please install cURL and enable it in your php.ini file. In addition, search for the 'disable_functions' directive in your php.ini file and remove any disabled methods starting with 'curl_'. To make sure it was successfully activated, use 'phpinfo()'. Once activated, deactivate the %s and reactivate it back again."
|
1437 |
+
|
1438 |
+
#: includes/i18n.php:405
|
1439 |
+
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."
|
1440 |
+
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."
|
1441 |
+
|
1442 |
+
#: includes/i18n.php:406
|
1443 |
+
msgid "Sorry for the inconvenience and we are here to help if you give us a chance."
|
1444 |
+
msgstr "Vi beklager ulejligheden, og vi er her for at hjælpe, hvis du giver os chancen."
|
1445 |
+
|
1446 |
+
#: includes/i18n.php:407
|
1447 |
+
msgid "Yes - I'm giving you a chance to fix it"
|
1448 |
+
msgstr "Ja - jeg giver jer en chance for at rette det"
|
1449 |
+
|
1450 |
+
#: includes/i18n.php:408
|
1451 |
+
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."
|
1452 |
+
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."
|
1453 |
+
|
1454 |
+
#: includes/i18n.php:409
|
1455 |
+
msgid "Let's try your previous version"
|
1456 |
+
msgstr "Lad os prøve din forrige version"
|
1457 |
+
|
1458 |
+
#: includes/i18n.php:410
|
1459 |
+
msgid "Uninstall this version and install the previous one."
|
1460 |
+
msgstr "Afinstaller denne version og installer den forrige."
|
1461 |
+
|
1462 |
+
#: includes/i18n.php:411
|
1463 |
+
msgid "That's exhausting, please deactivate"
|
1464 |
+
msgstr "Det er udmattende, deaktiver venligst"
|
1465 |
+
|
1466 |
+
#: includes/i18n.php:412
|
1467 |
+
msgid "We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future."
|
1468 |
+
msgstr "We feel your frustration and sincerely apologize for the inconvenience. Hope to see you again in the future."
|
1469 |
+
|
1470 |
+
#: includes/i18n.php:413
|
1471 |
+
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."
|
1472 |
+
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."
|
1473 |
+
|
1474 |
+
#: includes/i18n.php:414
|
1475 |
+
msgctxt "%1s - plugin title, %2s - API domain"
|
1476 |
+
msgid "Your server is blocking the access to Freemius' API, which is crucial for %1s synchronization. Please contact your host to whitelist %2s"
|
1477 |
+
msgstr "Your server is blocking the access to Freemius' API, which is crucial for %1s synchronization. Please contact your host to whitelist %2s"
|
1478 |
+
|
1479 |
+
#: includes/i18n.php:416
|
1480 |
+
msgid "It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again."
|
1481 |
+
msgstr "It seems like one of the authentication parameters is wrong. Update your Public Key, Secret Key & User ID, and try again."
|
1482 |
+
|
1483 |
+
#: includes/i18n.php:419
|
1484 |
+
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."
|
1485 |
+
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."
|
1486 |
+
|
1487 |
+
#: includes/i18n.php:420
|
1488 |
+
msgid "Thanks for confirming the ownership change. An email was just sent to %s for final approval."
|
1489 |
+
msgstr "Thanks for confirming the ownership change. An email was just sent to %s for final approval."
|
1490 |
+
|
1491 |
+
#: includes/i18n.php:421
|
1492 |
+
msgid "%s is the new owner of the account."
|
1493 |
+
msgstr "%s er den nye ejer af kontoen."
|
1494 |
+
|
1495 |
+
#: includes/i18n.php:423
|
1496 |
+
msgctxt "addonX cannot run without pluginY"
|
1497 |
+
msgid "%s cannot run without %s."
|
1498 |
+
msgstr "%s virker ikke uden %s."
|
1499 |
+
|
1500 |
+
#: includes/i18n.php:425
|
1501 |
+
msgctxt "addonX cannot run..."
|
1502 |
+
msgid "%s cannot run without the plugin."
|
1503 |
+
msgstr "%s virker ikke uden pluginnet."
|
1504 |
+
|
1505 |
+
#: includes/i18n.php:426
|
1506 |
+
msgctxt "pluginX activation was successfully..."
|
1507 |
+
msgid "%s activation was successfully completed."
|
1508 |
+
msgstr "Aktivering af %s blev gennemført."
|
1509 |
+
|
1510 |
+
#: includes/i18n.php:428
|
1511 |
+
msgctxt "Plugin installer section title"
|
1512 |
+
msgid "Features & Pricing"
|
1513 |
+
msgstr "Funktioner og priser"
|
1514 |
+
|
1515 |
+
#: includes/i18n.php:429
|
1516 |
+
msgid "Add-on must be deployed to WordPress.org or Freemius."
|
1517 |
+
msgstr "Add-on must be deployed to WordPress.org or Freemius."
|
1518 |
+
|
1519 |
+
#: includes/i18n.php:430
|
1520 |
+
msgid "Paid add-on must be deployed to Freemius."
|
1521 |
+
msgstr "Paid add-on must be deployed to Freemius."
|
1522 |
+
|
1523 |
+
#: includes/i18n.php:434
|
1524 |
+
msgid "%s is a premium only add-on. You have to purchase a license first before activating the plugin."
|
1525 |
+
msgstr "%s is a premium only add-on. You have to purchase a license first before activating the plugin."
|
1526 |
+
|
1527 |
+
#: includes/i18n.php:435
|
1528 |
+
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."
|
1529 |
+
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."
|
1530 |
+
|
1531 |
+
#: includes/i18n.php:440
|
1532 |
+
msgctxt "as every month"
|
1533 |
+
msgid "Monthly"
|
1534 |
+
msgstr "Månedligt"
|
1535 |
+
|
1536 |
+
#: includes/i18n.php:441
|
1537 |
+
msgctxt "as monthly period"
|
1538 |
+
msgid "mo"
|
1539 |
+
msgstr "md"
|
1540 |
+
|
1541 |
+
#: includes/i18n.php:442
|
1542 |
+
msgctxt "as once a year"
|
1543 |
+
msgid "Annual"
|
1544 |
+
msgstr "Årligt"
|
1545 |
+
|
1546 |
+
#: includes/i18n.php:443
|
1547 |
+
msgctxt "as once a year"
|
1548 |
+
msgid "Annually"
|
1549 |
+
msgstr "Årligt"
|
1550 |
+
|
1551 |
+
#: includes/i18n.php:444
|
1552 |
+
msgctxt "as once a year"
|
1553 |
+
msgid "Once"
|
1554 |
+
msgstr "Engangsbeløb"
|
1555 |
+
|
1556 |
+
#: includes/i18n.php:445
|
1557 |
+
msgctxt "as annual period"
|
1558 |
+
msgid "year"
|
1559 |
+
msgstr "år"
|
1560 |
+
|
1561 |
+
#: includes/i18n.php:446
|
1562 |
+
msgid "Lifetime"
|
1563 |
+
msgstr "Livstid"
|
1564 |
+
|
1565 |
+
#: includes/i18n.php:447
|
1566 |
+
msgctxt "e.g. the best product"
|
1567 |
+
msgid "Best"
|
1568 |
+
msgstr "Bedste"
|
1569 |
+
|
1570 |
+
#: includes/i18n.php:448
|
1571 |
+
msgctxt "e.g. billed monthly"
|
1572 |
+
msgid "Billed %s"
|
1573 |
+
msgstr "Faktureret %s"
|
1574 |
+
|
1575 |
+
#: includes/i18n.php:449
|
1576 |
+
msgctxt "as a discount of $5 or 10%"
|
1577 |
+
msgid "Save %s"
|
1578 |
+
msgstr "Spar %s"
|
1579 |
+
|
1580 |
+
#: includes/i18n.php:451
|
1581 |
+
msgid "View details"
|
1582 |
+
msgstr "Vis detaljer"
|
1583 |
+
|
1584 |
+
#: includes/i18n.php:455
|
1585 |
+
msgctxt "button label"
|
1586 |
+
msgid "Approve & Start Trial"
|
1587 |
+
msgstr "Godkend & start prøveperiode"
|
1588 |
+
|
1589 |
+
#: includes/i18n.php:457
|
1590 |
+
msgid "You are 1-click away from starting your %1$s-day free trial of the %2$s plan."
|
1591 |
+
msgstr "Du er 1 klik fra at begynde din %1$s dages gratis prøveperiode af planen %2$s."
|
1592 |
+
|
1593 |
+
#: includes/i18n.php:459
|
1594 |
+
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 %s to periodically send data to %s to check for version updates and to validate your trial."
|
1595 |
+
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 %s to periodically send data to %s to check for version updates and to validate your trial."
|
1596 |
+
|
1597 |
+
#: includes/i18n.php:465
|
1598 |
+
msgid "Business name"
|
1599 |
+
msgstr "Firmanavn"
|
1600 |
+
|
1601 |
+
#: includes/i18n.php:466
|
1602 |
+
msgid "Tax / VAT ID"
|
1603 |
+
msgstr "Moms / VAT ID"
|
1604 |
+
|
1605 |
+
#: includes/i18n.php:467
|
1606 |
+
msgid "Address Line %d"
|
1607 |
+
msgstr "Adresselinje %d"
|
1608 |
+
|
1609 |
+
#: includes/i18n.php:468
|
1610 |
+
msgid "Country"
|
1611 |
+
msgstr "Land"
|
1612 |
+
|
1613 |
+
#: includes/i18n.php:469
|
1614 |
+
msgid "Select Country"
|
1615 |
+
msgstr "Vælg land"
|
1616 |
+
|
1617 |
+
#: includes/i18n.php:470
|
1618 |
+
msgid "City"
|
1619 |
+
msgstr "By"
|
1620 |
+
|
1621 |
+
#: includes/i18n.php:471
|
1622 |
+
msgid "Town"
|
1623 |
+
msgstr "By"
|
1624 |
+
|
1625 |
+
#: includes/i18n.php:472
|
1626 |
+
msgid "State"
|
1627 |
+
msgstr "Stat"
|
1628 |
+
|
1629 |
+
#: includes/i18n.php:473
|
1630 |
+
msgid "Province"
|
1631 |
+
msgstr "Provins"
|
1632 |
+
|
1633 |
+
#: includes/i18n.php:474
|
1634 |
+
msgid "ZIP / Postal Code"
|
1635 |
+
msgstr "ZIP / Postnummer"
|
1636 |
+
|
1637 |
+
#: includes/i18n.php:479
|
1638 |
+
msgid "Installing plugin: %s"
|
1639 |
+
msgstr "Installing plugin: %s"
|
1640 |
+
|
1641 |
+
#: includes/i18n.php:480
|
1642 |
+
msgid "Automatic Installation"
|
1643 |
+
msgstr "Automatic Installation"
|
1644 |
+
|
1645 |
+
#: includes/i18n.php:482
|
1646 |
+
msgid "%s sec"
|
1647 |
+
msgstr "%s sec"
|
1648 |
+
|
1649 |
+
#: includes/i18n.php:483
|
1650 |
+
msgid "An automated download and installation of %s (paid version) from %s will start in %s. If you would like to do it manually - click the cancellation button now."
|
1651 |
+
msgstr "An automated download and installation of %s (paid version) from %s will start in %s. If you would like to do it manually - click the cancellation button now."
|
1652 |
+
|
1653 |
+
#: includes/i18n.php:484
|
1654 |
+
msgid "The installation process has started and may take a few minutes to complete. Please wait until it is done - do not refresh this page."
|
1655 |
+
msgstr "The installation process has started and may take a few minutes to complete. Please wait until it is done - do not refresh this page."
|
1656 |
+
|
1657 |
+
#: includes/i18n.php:485
|
1658 |
+
msgid "Cancel Installation"
|
1659 |
+
msgstr "Cancel Installation"
|
1660 |
+
|
1661 |
+
#: includes/i18n.php:486
|
1662 |
+
msgid "The remote plugin package does not contain a folder with the desired slug and renaming did not work."
|
1663 |
+
msgstr "The remote plugin package does not contain a folder with the desired slug and renaming did not work."
|
1664 |
+
|
1665 |
+
#: includes/i18n.php:487
|
1666 |
+
msgid "Invalid module ID."
|
1667 |
+
msgstr "Invalid module ID."
|
1668 |
+
|
1669 |
+
#: includes/i18n.php:488
|
1670 |
+
msgid "Auto installation only works for opted-in users."
|
1671 |
+
msgstr "Auto installation only works for opted-in users."
|
1672 |
+
|
1673 |
+
#: includes/i18n.php:489
|
1674 |
+
msgid "Premium version already active."
|
1675 |
+
msgstr "Premium version already active."
|
1676 |
+
|
1677 |
+
#: includes/i18n.php:490
|
1678 |
+
msgid "Premium add-on version already installed."
|
1679 |
+
msgstr "Premium add-on version already installed."
|
1680 |
+
|
1681 |
+
#: includes/i18n.php:491
|
1682 |
+
msgid "You do not have a valid license to access the premium version."
|
1683 |
+
msgstr "You do not have a valid license to access the premium version."
|
1684 |
+
|
1685 |
+
#: includes/i18n.php:492
|
1686 |
+
msgid "Plugin is a \"Serviceware\" which means it does not have a premium code version."
|
1687 |
+
msgstr "Plugin is a \"Serviceware\" which means it does not have a premium code version."
|
1688 |
+
|
1689 |
+
#: includes/i18n.php:496
|
1690 |
+
msgid "Secure HTTPS %s page, running from an external domain"
|
1691 |
+
msgstr "Secure HTTPS %s page, running from an external domain"
|
1692 |
+
|
1693 |
+
#: includes/i18n.php:497
|
1694 |
+
msgid "PCI compliant"
|
1695 |
+
msgstr "PCI compliant"
|
1696 |
+
|
1697 |
+
#: includes/i18n.php:498
|
1698 |
+
msgid "View paid features"
|
1699 |
+
msgstr "View paid features"
|
1700 |
+
|
1701 |
+
#: includes/i18n.php:512
|
1702 |
+
msgctxt "Plugin installer section title"
|
1703 |
+
msgid "Description"
|
1704 |
+
msgstr "Beskrivelse"
|
1705 |
+
|
1706 |
+
#: includes/i18n.php:513
|
1707 |
+
msgctxt "Plugin installer section title"
|
1708 |
+
msgid "Installation"
|
1709 |
+
msgstr "Installering"
|
1710 |
+
|
1711 |
+
#: includes/i18n.php:514
|
1712 |
+
msgctxt "Plugin installer section title"
|
1713 |
+
msgid "FAQ"
|
1714 |
+
msgstr "FAQ"
|
1715 |
+
|
1716 |
+
#: includes/i18n.php:515
|
1717 |
+
msgctxt "Plugin installer section title"
|
1718 |
+
msgid "Changelog"
|
1719 |
+
msgstr "Ændringslog"
|
1720 |
+
|
1721 |
+
#: includes/i18n.php:516
|
1722 |
+
msgctxt "Plugin installer section title"
|
1723 |
+
msgid "Reviews"
|
1724 |
+
msgstr "Anmeldelser"
|
1725 |
+
|
1726 |
+
#: includes/i18n.php:517
|
1727 |
+
msgctxt "Plugin installer section title"
|
1728 |
+
msgid "Other Notes"
|
1729 |
+
msgstr "Andre noter"
|
1730 |
+
|
1731 |
+
#: includes/i18n.php:519
|
1732 |
+
msgid "%s star"
|
1733 |
+
msgstr "%s stjerne"
|
1734 |
+
|
1735 |
+
#: includes/i18n.php:521
|
1736 |
+
msgid "%s stars"
|
1737 |
+
msgstr "%s stjerner"
|
1738 |
+
|
1739 |
+
#: includes/i18n.php:523
|
1740 |
+
msgid "%s rating"
|
1741 |
+
msgstr "%s vurdering"
|
1742 |
+
|
1743 |
+
#: includes/i18n.php:525
|
1744 |
+
msgid "%s ratings"
|
1745 |
+
msgstr "%s vurderinger"
|
1746 |
+
|
1747 |
+
#: includes/i18n.php:527
|
1748 |
+
msgid "%s time"
|
1749 |
+
msgstr "%s gang"
|
1750 |
+
|
1751 |
+
#: includes/i18n.php:529
|
1752 |
+
msgid "%s times"
|
1753 |
+
msgstr "%s gange"
|
1754 |
+
|
1755 |
+
#: includes/i18n.php:531
|
1756 |
+
msgid "Click to see reviews that provided a rating of %s"
|
1757 |
+
msgstr "Click to see reviews that provided a rating of %s"
|
1758 |
+
|
1759 |
+
#: includes/i18n.php:532
|
1760 |
+
msgid "Last Updated"
|
1761 |
+
msgstr "Senest opdateret"
|
1762 |
+
|
1763 |
+
#: includes/i18n.php:533
|
1764 |
+
msgid "Requires WordPress Version:"
|
1765 |
+
msgstr "Kræver WordPress-version:"
|
1766 |
+
|
1767 |
+
#: includes/i18n.php:534
|
1768 |
+
msgctxt "as the plugin author"
|
1769 |
+
msgid "Author:"
|
1770 |
+
msgstr "Forfatter:"
|
1771 |
+
|
1772 |
+
#: includes/i18n.php:535
|
1773 |
+
msgid "Compatible up to:"
|
1774 |
+
msgstr "Kompatibel op til:"
|
1775 |
+
|
1776 |
+
#: includes/i18n.php:536
|
1777 |
+
msgid "Downloaded:"
|
1778 |
+
msgstr "Hentet:"
|
1779 |
+
|
1780 |
+
#: includes/i18n.php:537
|
1781 |
+
msgid "WordPress.org Plugin Page"
|
1782 |
+
msgstr "WordPress.org Plugin-side"
|
1783 |
+
|
1784 |
+
#: includes/i18n.php:538
|
1785 |
+
msgid "Plugin Homepage"
|
1786 |
+
msgstr "Plugin-websted"
|
1787 |
+
|
1788 |
+
#: includes/i18n.php:539
|
1789 |
+
msgid "Donate to this plugin"
|
1790 |
+
msgstr "Donér til dette plugin"
|
1791 |
+
|
1792 |
+
#: includes/i18n.php:540
|
1793 |
+
msgid "Average Rating"
|
1794 |
+
msgstr "Gennemsnitlig vurdering"
|
1795 |
+
|
1796 |
+
#: includes/i18n.php:541
|
1797 |
+
msgid "based on %s"
|
1798 |
+
msgstr "baseret på %s"
|
1799 |
+
|
1800 |
+
#: includes/i18n.php:542
|
1801 |
+
msgid "Warning:"
|
1802 |
+
msgstr "Advarsel:"
|
1803 |
+
|
1804 |
+
#: includes/i18n.php:543
|
1805 |
+
msgid "Contributors"
|
1806 |
+
msgstr "Bidragsydere"
|
1807 |
+
|
1808 |
+
#: includes/i18n.php:544
|
1809 |
+
msgid "Plugin Install"
|
1810 |
+
msgstr "Plugin Install"
|
1811 |
+
|
1812 |
+
#: includes/i18n.php:545
|
1813 |
+
msgid "This plugin has not been tested with your current version of WordPress."
|
1814 |
+
msgstr "This plugin has not been tested with your current version of WordPress."
|
1815 |
+
|
1816 |
+
#: includes/i18n.php:546
|
1817 |
+
msgid "This plugin has not been marked as compatible with your version of WordPress."
|
1818 |
+
msgstr "This plugin has not been marked as compatible with your version of WordPress."
|
1819 |
+
|
1820 |
+
#: includes/i18n.php:547
|
1821 |
+
msgid "Newer Version (%s) Installed"
|
1822 |
+
msgstr "Nyere version (%s) installeret"
|
1823 |
+
|
1824 |
+
#: includes/i18n.php:548
|
1825 |
+
msgid "Latest Version Installed"
|
1826 |
+
msgstr "Seneste version installeret"
|
freemius/languages/freemius-en.mo
CHANGED
Binary file
|
freemius/languages/freemius-en.po
CHANGED
@@ -1,1824 +1,1976 @@
|
|
1 |
-
# Copyright (C) 2017 freemius
|
2 |
-
# This file is distributed under the same license as the freemius package.
|
3 |
-
msgid ""
|
4 |
-
msgstr ""
|
5 |
-
"Project-Id-Version: freemius\n"
|
6 |
-
"Report-Msgid-Bugs-To: https://github.com/Freemius/wordpress-sdk/issues\n"
|
7 |
-
"POT-Creation-Date: \n"
|
8 |
-
"PO-Revision-Date: \n"
|
9 |
-
"Last-Translator: Vova Feldman <vova@freemius.com>\n"
|
10 |
-
"Language: \n"
|
11 |
-
"Language-Team: Freemius Team <admin@freemius.com>\n"
|
12 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
13 |
-
"Content-Transfer-Encoding: 8bit\n"
|
14 |
-
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
15 |
-
"MIME-Version: 1.0\n"
|
16 |
-
"X-Poedit-Basepath: ..\n"
|
17 |
-
"X-Poedit-KeywordsList: _fs_text;_fs_echo;_fs_esc_attr;_fs_esc_attr_echo;_fs_esc_html;_fs_esc_html_echo;_fs_x:1,2c;_fs_ex:1,2c;_fs_esc_attr_x:1,2c;_fs_esc_html_x:1,2c;_fs_n:1,2;_fs_n_noop:1,2;_fs_nx:1,2,4c;_fs_nx_noop:1,2,3c\n"
|
18 |
-
"X-Poedit-SearchPath-0: .\n"
|
19 |
-
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
20 |
-
"X-Poedit-SourceCharset: UTF-8\n"
|
21 |
-
|
22 |
-
#: includes/i18n.php:37
|
23 |
-
msgid "Account"
|
24 |
-
msgstr "Account"
|
25 |
-
|
26 |
-
#: includes/i18n.php:38
|
27 |
-
msgid "Add-On"
|
28 |
-
msgstr "Add-On"
|
29 |
-
|
30 |
-
#: includes/i18n.php:39
|
31 |
-
msgid "Contact Us"
|
32 |
-
msgstr "Contact Us"
|
33 |
-
|
34 |
-
#: includes/i18n.php:40
|
35 |
-
msgid "Contact Support"
|
36 |
-
msgstr "Contact Support"
|
37 |
-
|
38 |
-
#: includes/i18n.php:41
|
39 |
-
msgid "Change Ownership"
|
40 |
-
msgstr "Change Ownership"
|
41 |
-
|
42 |
-
#: includes/i18n.php:42
|
43 |
-
msgid "Support"
|
44 |
-
msgstr "Support"
|
45 |
-
|
46 |
-
#: includes/i18n.php:43
|
47 |
-
msgid "Support Forum"
|
48 |
-
msgstr "Support Forum"
|
49 |
-
|
50 |
-
#: includes/i18n.php:44
|
51 |
-
msgid "Add-Ons"
|
52 |
-
msgstr "Add-Ons"
|
53 |
-
|
54 |
-
#: includes/i18n.php:45
|
55 |
-
msgctxt "verb"
|
56 |
-
msgid "Upgrade"
|
57 |
-
msgstr "Upgrade"
|
58 |
-
|
59 |
-
#: includes/i18n.php:46
|
60 |
-
msgid "Awesome"
|
61 |
-
msgstr "Awesome"
|
62 |
-
|
63 |
-
#: includes/i18n.php:47
|
64 |
-
msgctxt "noun"
|
65 |
-
msgid "Pricing"
|
66 |
-
msgstr "Pricing"
|
67 |
-
|
68 |
-
#: includes/i18n.php:48
|
69 |
-
msgctxt "noun"
|
70 |
-
msgid "Price"
|
71 |
-
msgstr "Price"
|
72 |
-
|
73 |
-
#: includes/i18n.php:49
|
74 |
-
msgid "Unlimited Updates"
|
75 |
-
msgstr "Unlimited Updates"
|
76 |
-
|
77 |
-
#: includes/i18n.php:50
|
78 |
-
msgctxt "verb"
|
79 |
-
msgid "Downgrade"
|
80 |
-
msgstr "Downgrade"
|
81 |
-
|
82 |
-
#: includes/i18n.php:51
|
83 |
-
msgctxt "verb"
|
84 |
-
msgid "Cancel Subscription"
|
85 |
-
msgstr "Cancel Subscription"
|
86 |
-
|
87 |
-
#: includes/i18n.php:52
|
88 |
-
msgid "Cancel Trial"
|
89 |
-
msgstr "Cancel Trial"
|
90 |
-
|
91 |
-
#: includes/i18n.php:53
|
92 |
-
msgid "Free Trial"
|
93 |
-
msgstr "Free Trial"
|
94 |
-
|
95 |
-
#: includes/i18n.php:54
|
96 |
-
msgid "Start my free %s"
|
97 |
-
msgstr "Start my free %s"
|
98 |
-
|
99 |
-
#: includes/i18n.php:55
|
100 |
-
msgid "No commitment for %s - cancel anytime"
|
101 |
-
msgstr "No commitment for %s - cancel anytime"
|
102 |
-
|
103 |
-
#: includes/i18n.php:56
|
104 |
-
msgid "After your free %s, pay as little as %s"
|
105 |
-
msgstr "After your free %s, pay as little as %s"
|
106 |
-
|
107 |
-
#: includes/i18n.php:57
|
108 |
-
msgid "Details"
|
109 |
-
msgstr "Details"
|
110 |
-
|
111 |
-
#: includes/i18n.php:58
|
112 |
-
msgid "Account Details"
|
113 |
-
msgstr "Account Details"
|
114 |
-
|
115 |
-
#: includes/i18n.php:59
|
116 |
-
msgctxt "verb"
|
117 |
-
msgid "Delete"
|
118 |
-
msgstr "Delete"
|
119 |
-
|
120 |
-
#: includes/i18n.php:60
|
121 |
-
msgctxt "verb"
|
122 |
-
msgid "Show"
|
123 |
-
msgstr "Show"
|
124 |
-
|
125 |
-
#: includes/i18n.php:61
|
126 |
-
msgctxt "verb"
|
127 |
-
msgid "Hide"
|
128 |
-
msgstr "Hide"
|
129 |
-
|
130 |
-
#: includes/i18n.php:62
|
131 |
-
msgctxt "verb"
|
132 |
-
msgid "Edit"
|
133 |
-
msgstr "Edit"
|
134 |
-
|
135 |
-
#: includes/i18n.php:63
|
136 |
-
msgctxt "verb"
|
137 |
-
msgid "Update"
|
138 |
-
msgstr "Update"
|
139 |
-
|
140 |
-
#: includes/i18n.php:64
|
141 |
-
msgid "Date"
|
142 |
-
msgstr "Date"
|
143 |
-
|
144 |
-
#: includes/i18n.php:65
|
145 |
-
msgid "Amount"
|
146 |
-
msgstr "Amount"
|
147 |
-
|
148 |
-
#: includes/i18n.php:66
|
149 |
-
msgid "Invoice"
|
150 |
-
msgstr "Invoice"
|
151 |
-
|
152 |
-
#: includes/i18n.php:67
|
153 |
-
msgid "Billing"
|
154 |
-
msgstr "Billing"
|
155 |
-
|
156 |
-
#: includes/i18n.php:68
|
157 |
-
msgid "Payments"
|
158 |
-
msgstr "Payments"
|
159 |
-
|
160 |
-
#: includes/i18n.php:69
|
161 |
-
msgid "Delete Account"
|
162 |
-
msgstr "Delete Account"
|
163 |
-
|
164 |
-
#: includes/i18n.php:70
|
165 |
-
msgctxt "as close a window"
|
166 |
-
msgid "Dismiss"
|
167 |
-
msgstr "Dismiss"
|
168 |
-
|
169 |
-
#: includes/i18n.php:71
|
170 |
-
msgctxt "as product pricing plan"
|
171 |
-
msgid "Plan"
|
172 |
-
msgstr "Plan"
|
173 |
-
|
174 |
-
#: includes/i18n.php:72
|
175 |
-
msgid "Change Plan"
|
176 |
-
msgstr "Change Plan"
|
177 |
-
|
178 |
-
#: includes/i18n.php:73
|
179 |
-
msgctxt "as download professional version"
|
180 |
-
msgid "Download %s Version"
|
181 |
-
msgstr "Download %s Version"
|
182 |
-
|
183 |
-
#: includes/i18n.php:74
|
184 |
-
msgctxt "as download professional version now"
|
185 |
-
msgid "Download %s version now"
|
186 |
-
msgstr "Download %s version now"
|
187 |
-
|
188 |
-
#: includes/i18n.php:75
|
189 |
-
msgctxt "as download latest version"
|
190 |
-
msgid "Download Latest"
|
191 |
-
msgstr "Download Latest"
|
192 |
-
|
193 |
-
#: includes/i18n.php:76
|
194 |
-
msgctxt "E.g. you have a professional license."
|
195 |
-
msgid "You have a %s license."
|
196 |
-
msgstr "You have a %s license."
|
197 |
-
|
198 |
-
#: includes/i18n.php:77
|
199 |
-
msgid "New"
|
200 |
-
msgstr "New"
|
201 |
-
|
202 |
-
#: includes/i18n.php:78
|
203 |
-
msgid "Free"
|
204 |
-
msgstr "Free"
|
205 |
-
|
206 |
-
#: includes/i18n.php:79
|
207 |
-
msgctxt "as trial plan"
|
208 |
-
msgid "Trial"
|
209 |
-
msgstr "Trial"
|
210 |
-
|
211 |
-
#: includes/i18n.php:80
|
212 |
-
msgctxt "as starting a trial plan"
|
213 |
-
msgid "Start Trial"
|
214 |
-
msgstr "Start Trial"
|
215 |
-
|
216 |
-
#: includes/i18n.php:81
|
217 |
-
msgctxt "verb"
|
218 |
-
msgid "Purchase"
|
219 |
-
msgstr "Purchase"
|
220 |
-
|
221 |
-
#: includes/i18n.php:82
|
222 |
-
msgid "Purchase License"
|
223 |
-
msgstr "Purchase License"
|
224 |
-
|
225 |
-
#: includes/i18n.php:83
|
226 |
-
msgctxt "verb"
|
227 |
-
msgid "Buy"
|
228 |
-
msgstr "Buy"
|
229 |
-
|
230 |
-
#: includes/i18n.php:84
|
231 |
-
msgid "Buy License"
|
232 |
-
msgstr "Buy License"
|
233 |
-
|
234 |
-
#: includes/i18n.php:85
|
235 |
-
msgid "Single Site License"
|
236 |
-
msgstr "Single Site License"
|
237 |
-
|
238 |
-
#: includes/i18n.php:86
|
239 |
-
msgid "Unlimited Licenses"
|
240 |
-
msgstr "Unlimited Licenses"
|
241 |
-
|
242 |
-
#: includes/i18n.php:87
|
243 |
-
msgid "Up to %s Sites"
|
244 |
-
msgstr "Up to %s Sites"
|
245 |
-
|
246 |
-
#: includes/i18n.php:88
|
247 |
-
msgid "%sRenew your license now%s to access version %s features and support."
|
248 |
-
msgstr "%sRenew your license now%s to access version %s features and support."
|
249 |
-
|
250 |
-
#: includes/i18n.php:89
|
251 |
-
msgid "Enter the email address you've used for the upgrade below and we will resend you the license key."
|
252 |
-
msgstr "Enter the email address you've used for the upgrade below and we will resend you the license key."
|
253 |
-
|
254 |
-
#: includes/i18n.php:90
|
255 |
-
msgctxt "e.g. Professional Plan"
|
256 |
-
msgid "%s Plan"
|
257 |
-
msgstr "%s Plan"
|
258 |
-
|
259 |
-
#: includes/i18n.php:91
|
260 |
-
msgid "You are just one step away - %s"
|
261 |
-
msgstr "You are just one step away - %s"
|
262 |
-
|
263 |
-
#: includes/i18n.php:92
|
264 |
-
msgctxt "%s - plugin name. As complete \"Jetpack\" activation now"
|
265 |
-
msgid "Complete \"%s\" Activation Now"
|
266 |
-
msgstr "Complete \"%s\" Activation Now"
|
267 |
-
|
268 |
-
#: includes/i18n.php:94
|
269 |
-
msgid "We made a few tweaks to the %s, %s"
|
270 |
-
msgstr "We made a few tweaks to the %s, %s"
|
271 |
-
|
272 |
-
#: includes/i18n.php:95
|
273 |
-
msgid "Opt-in to make \"%s\" Better!"
|
274 |
-
msgstr "Opt-in to make \"%s\" Better!"
|
275 |
-
|
276 |
-
#: includes/i18n.php:96
|
277 |
-
msgid "Error"
|
278 |
-
msgstr "Error"
|
279 |
-
|
280 |
-
#: includes/i18n.php:97
|
281 |
-
msgid "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
|
282 |
-
msgstr "Freemius SDK couldn't find the plugin's main file. Please contact sdk@freemius.com with the current error."
|
283 |
-
|
284 |
-
#: includes/i18n.php:100
|
285 |
-
msgctxt "as expiration date"
|
286 |
-
msgid "Expiration"
|
287 |
-
msgstr "Expiration"
|
288 |
-
|
289 |
-
#: includes/i18n.php:101
|
290 |
-
msgctxt "as software license"
|
291 |
-
msgid "License"
|
292 |
-
msgstr "License"
|
293 |
-
|
294 |
-
#: includes/i18n.php:102
|
295 |
-
msgid "not verified"
|
296 |
-
msgstr "not verified"
|
297 |
-
|
298 |
-
#: includes/i18n.php:103
|
299 |
-
msgid "Verify Email"
|
300 |
-
msgstr "Verify Email"
|
301 |
-
|
302 |
-
#: includes/i18n.php:104
|
303 |
-
msgctxt "e.g. expires in 2 months"
|
304 |
-
msgid "Expires in %s"
|
305 |
-
msgstr "Expires in %s"
|
306 |
-
|
307 |
-
#: includes/i18n.php:105
|
308 |
-
msgctxt "e.g. auto renews in 2 months"
|
309 |
-
msgid "Auto renews in %s"
|
310 |
-
msgstr "Auto renews in %s"
|
311 |
-
|
312 |
-
#: includes/i18n.php:106
|
313 |
-
msgid "No expiration"
|
314 |
-
msgstr "No expiration"
|
315 |
-
|
316 |
-
#: includes/i18n.php:107
|
317 |
-
msgid "Expired"
|
318 |
-
msgstr "Expired"
|
319 |
-
|
320 |
-
#: includes/i18n.php:108
|
321 |
-
msgid "Cancelled"
|
322 |
-
msgstr "Cancelled"
|
323 |
-
|
324 |
-
#: includes/i18n.php:109
|
325 |
-
msgctxt "e.g. In 2 hours"
|
326 |
-
msgid "In %s"
|
327 |
-
msgstr "In %s"
|
328 |
-
|
329 |
-
#: includes/i18n.php:110
|
330 |
-
msgctxt "e.g. 2 min ago"
|
331 |
-
msgid "%s ago"
|
332 |
-
msgstr "%s ago"
|
333 |
-
|
334 |
-
#: includes/i18n.php:112
|
335 |
-
msgid "%s or higher"
|
336 |
-
msgstr "%s or higher"
|
337 |
-
|
338 |
-
#: includes/i18n.php:113
|
339 |
-
msgctxt "as plugin version"
|
340 |
-
msgid "Version"
|
341 |
-
msgstr "Version"
|
342 |
-
|
343 |
-
#: includes/i18n.php:114
|
344 |
-
msgid "Name"
|
345 |
-
msgstr "Name"
|
346 |
-
|
347 |
-
#: includes/i18n.php:115
|
348 |
-
msgid "Email"
|
349 |
-
msgstr "Email"
|
350 |
-
|
351 |
-
#: includes/i18n.php:116
|
352 |
-
msgid "Email address"
|
353 |
-
msgstr "Email address"
|
354 |
-
|
355 |
-
#: includes/i18n.php:117
|
356 |
-
msgid "Verified"
|
357 |
-
msgstr "Verified"
|
358 |
-
|
359 |
-
#: includes/i18n.php:118
|
360 |
-
msgid "Module"
|
361 |
-
msgstr "Module"
|
362 |
-
|
363 |
-
#: includes/i18n.php:119
|
364 |
-
msgid "Module Type"
|
365 |
-
msgstr "Module Type"
|
366 |
-
|
367 |
-
#: includes/i18n.php:120
|
368 |
-
msgid "Plugin"
|
369 |
-
msgstr "Plugin"
|
370 |
-
|
371 |
-
#: includes/i18n.php:121
|
372 |
-
msgid "Plugins"
|
373 |
-
msgstr "Plugins"
|
374 |
-
|
375 |
-
#: includes/i18n.php:122
|
376 |
-
msgid "Theme"
|
377 |
-
msgstr "Theme"
|
378 |
-
|
379 |
-
#: includes/i18n.php:123
|
380 |
-
msgid "Themes"
|
381 |
-
msgstr "Themes"
|
382 |
-
|
383 |
-
#: includes/i18n.php:124
|
384 |
-
msgctxt "as file/folder path"
|
385 |
-
msgid "Path"
|
386 |
-
msgstr "Path"
|
387 |
-
|
388 |
-
#: includes/i18n.php:125
|
389 |
-
msgid "Title"
|
390 |
-
msgstr "Title"
|
391 |
-
|
392 |
-
#: includes/i18n.php:126
|
393 |
-
msgid "Free version"
|
394 |
-
msgstr "Free version"
|
395 |
-
|
396 |
-
#: includes/i18n.php:127
|
397 |
-
msgid "Premium version"
|
398 |
-
msgstr "Premium version"
|
399 |
-
|
400 |
-
#: includes/i18n.php:128
|
401 |
-
msgctxt "as WP plugin slug"
|
402 |
-
msgid "Slug"
|
403 |
-
msgstr "Slug"
|
404 |
-
|
405 |
-
#: includes/i18n.php:129
|
406 |
-
msgid "ID"
|
407 |
-
msgstr "ID"
|
408 |
-
|
409 |
-
#: includes/i18n.php:130
|
410 |
-
msgid "Users"
|
411 |
-
msgstr "Users"
|
412 |
-
|
413 |
-
#: includes/i18n.php:131
|
414 |
-
msgid "%s Installs"
|
415 |
-
msgstr "%s Installs"
|
416 |
-
|
417 |
-
#: includes/i18n.php:132
|
418 |
-
msgctxt "like websites"
|
419 |
-
msgid "Sites"
|
420 |
-
msgstr "Sites"
|
421 |
-
|
422 |
-
#: includes/i18n.php:133
|
423 |
-
msgid "User ID"
|
424 |
-
msgstr "User ID"
|
425 |
-
|
426 |
-
#: includes/i18n.php:134
|
427 |
-
msgid "Site ID"
|
428 |
-
msgstr "Site ID"
|
429 |
-
|
430 |
-
#: includes/i18n.php:135
|
431 |
-
msgid "Public Key"
|
432 |
-
msgstr "Public Key"
|
433 |
-
|
434 |
-
#: includes/i18n.php:136
|
435 |
-
msgid "Secret Key"
|
436 |
-
msgstr "Secret Key"
|
437 |
-
|
438 |
-
#: includes/i18n.php:137
|
439 |
-
msgctxt "as secret encryption key missing"
|
440 |
-
msgid "No Secret"
|
441 |
-
msgstr "No Secret"
|
442 |
-
|
443 |
-
#: includes/i18n.php:138
|
444 |
-
msgid "No ID"
|
445 |
-
msgstr "No ID"
|
446 |
-
|
447 |
-
#: includes/i18n.php:139
|
448 |
-
msgctxt "as synchronize license"
|
449 |
-
msgid "Sync License"
|
450 |
-
msgstr "Sync License"
|
451 |
-
|
452 |
-
#: includes/i18n.php:140
|
453 |
-
msgctxt "as synchronize"
|
454 |
-
msgid "Sync"
|
455 |
-
msgstr "Sync"
|
456 |
-
|
457 |
-
#: includes/i18n.php:141
|
458 |
-
msgid "Activate License"
|
459 |
-
msgstr "Activate License"
|
460 |
-
|
461 |
-
#: includes/i18n.php:142
|
462 |
-
msgid "Activate Free Version"
|
463 |
-
msgstr "Activate Free Version"
|
464 |
-
|
465 |
-
#: includes/i18n.php:143
|
466 |
-
msgid "Please enter the license key that you received in the email right after the purchase:"
|
467 |
-
msgstr "Please enter the license key that you received in the email right after the purchase:"
|
468 |
-
|
469 |
-
#: includes/i18n.php:144
|
470 |
-
msgid "Activating license..."
|
471 |
-
msgstr "Activating license..."
|
472 |
-
|
473 |
-
#: includes/i18n.php:145
|
474 |
-
msgid "Change License"
|
475 |
-
msgstr "Change License"
|
476 |
-
|
477 |
-
#: includes/i18n.php:146
|
478 |
-
msgid "Update License"
|
479 |
-
msgstr "Update License"
|
480 |
-
|
481 |
-
#: includes/i18n.php:147
|
482 |
-
msgid "Deactivate License"
|
483 |
-
msgstr "Deactivate License"
|
484 |
-
|
485 |
-
#: includes/i18n.php:148
|
486 |
-
msgid "Activate"
|
487 |
-
msgstr "Activate"
|
488 |
-
|
489 |
-
#: includes/i18n.php:149
|
490 |
-
msgid "Deactivate"
|
491 |
-
msgstr "Deactivate"
|
492 |
-
|
493 |
-
#: includes/i18n.php:150
|
494 |
-
msgid "Skip & Deactivate"
|
495 |
-
msgstr "Skip & Deactivate"
|
496 |
-
|
497 |
-
#: includes/i18n.php:151
|
498 |
-
msgid "Skip & %s"
|
499 |
-
msgstr "Skip & %s"
|
500 |
-
|
501 |
-
#: includes/i18n.php:152
|
502 |
-
msgid "No - just deactivate"
|
503 |
-
msgstr "No - just deactivate"
|
504 |
-
|
505 |
-
#: includes/i18n.php:153
|
506 |
-
msgid "Yes - do your thing"
|
507 |
-
msgstr "Yes - do your thing"
|
508 |
-
|
509 |
-
#: includes/i18n.php:154
|
510 |
-
msgctxt "active mode"
|
511 |
-
msgid "Active"
|
512 |
-
msgstr "Active"
|
513 |
-
|
514 |
-
#: includes/i18n.php:155
|
515 |
-
msgctxt "is active mode?"
|
516 |
-
msgid "Is Active"
|
517 |
-
msgstr "Is Active"
|
518 |
-
|
519 |
-
#: includes/i18n.php:156
|
520 |
-
msgid "Install Now"
|
521 |
-
msgstr "Install Now"
|
522 |
-
|
523 |
-
#: includes/i18n.php:157
|
524 |
-
msgid "Install Update Now"
|
525 |
-
msgstr "Install Update Now"
|
526 |
-
|
527 |
-
#: includes/i18n.php:158
|
528 |
-
msgid "More information about %s"
|
529 |
-
msgstr "More information about %s"
|
530 |
-
|
531 |
-
#: includes/i18n.php:159
|
532 |
-
msgid "Localhost"
|
533 |
-
msgstr "Localhost"
|
534 |
-
|
535 |
-
#: includes/i18n.php:160
|
536 |
-
msgctxt "as activate Professional plan"
|
537 |
-
msgid "Activate %s Plan"
|
538 |
-
msgstr "Activate %s Plan"
|
539 |
-
|
540 |
-
#: includes/i18n.php:161
|
541 |
-
msgctxt "as 5 licenses left"
|
542 |
-
msgid "%s left"
|
543 |
-
msgstr "%s left"
|
544 |
-
|
545 |
-
#: includes/i18n.php:162
|
546 |
-
msgid "Last license"
|
547 |
-
msgstr "Last license"
|
548 |
-
|
549 |
-
#: includes/i18n.php:163
|
550 |
-
msgid "What is your %s?"
|
551 |
-
msgstr "What is your %s?"
|
552 |
-
|
553 |
-
#: includes/i18n.php:164
|
554 |
-
msgid "Activate this add-on"
|
555 |
-
msgstr "Activate this add-on"
|
556 |
-
|
557 |
-
#: includes/i18n.php:165
|
558 |
-
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?"
|
559 |
-
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?"
|
560 |
-
|
561 |
-
#: includes/i18n.php:166
|
562 |
-
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?"
|
563 |
-
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?"
|
564 |
-
|
565 |
-
#: includes/i18n.php:167
|
566 |
-
msgid "Deletion is not temporary. Only delete if you no longer want to use this %s anymore. Are you sure you would like to continue with the deletion?"
|
567 |
-
msgstr "Deletion is not temporary. Only delete if you no longer want to use this %s anymore. Are you sure you would like to continue with the deletion?"
|
568 |
-
|
569 |
-
#: includes/i18n.php:168
|
570 |
-
msgid "Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s."
|
571 |
-
msgstr "Downgrading your plan will immediately stop all future recurring payments and your %s plan license will expire in %s."
|
572 |
-
|
573 |
-
#: includes/i18n.php:169
|
574 |
-
msgid "Cancelling the trial will immediately block access to all premium features. Are you sure?"
|
575 |
-
msgstr "Cancelling the trial will immediately block access to all premium features. Are you sure?"
|
576 |
-
|
577 |
-
#: includes/i18n.php:170
|
578 |
-
msgid "You can still enjoy all %s features but you will not have access to %s updates and support."
|
579 |
-
msgstr "You can still enjoy all %s features but you will not have access to %s updates and support."
|
580 |
-
|
581 |
-
#: includes/i18n.p
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|