PluginProbe ʕ •ᴥ•ʔ
Code Manager / 1.0.0
Code Manager v1.0.0
1.0.48 1.0.47 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 1.0.25 1.0.26 1.0.27 1.0.28 1.0.3 1.0.30 1.0.31 1.0.32 1.0.33 1.0.34 1.0.35 1.0.36 1.0.37 1.0.38 1.0.39 1.0.4 1.0.40 1.0.41 1.0.42 1.0.43 1.0.44 1.0.45 1.0.46 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9
code-manager / freemius / templates / account.php
code-manager / freemius / templates Last commit date
account 5 years ago debug 5 years ago forms 5 years ago js 5 years ago partials 5 years ago plugin-info 5 years ago account.php 5 years ago add-ons.php 5 years ago add-trial-to-pricing.php 5 years ago admin-notice.php 5 years ago ajax-loader.php 5 years ago auto-installation.php 5 years ago checkout.php 5 years ago connect.php 5 years ago contact.php 5 years ago debug.php 5 years ago email.php 5 years ago firewall-issues-js.php 5 years ago gdpr-optin-js.php 5 years ago index.php 5 years ago plugin-icon.php 5 years ago powered-by.php 5 years ago pricing.php 5 years ago secure-https-header.php 5 years ago sticky-admin-notice-js.php 5 years ago tabs-capture-js.php 5 years ago tabs.php 5 years ago
account.php
1036 lines
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 * @var array $VARS
15 * @var Freemius $fs
16 */
17 $fs = freemius( $VARS['id'] );
18
19 $slug = $fs->get_slug();
20
21 /**
22 * @var FS_Plugin_Tag $update
23 */
24 $update = $fs->get_update( false, false, WP_FS__TIME_24_HOURS_IN_SEC / 24 );
25
26 if ( is_object($update) ) {
27 /**
28 * This logic is particularly required for multisite environment.
29 * If a module is site activated (not network) and not on the main site,
30 * the module will NOT be executed on the network level, therefore, the
31 * custom updates logic will not be executed as well, so unless we force
32 * the injection of the update into the updates transient, premium updates
33 * will not work.
34 *
35 * @author Vova Feldman (@svovaf)
36 * @since 2.0.0
37 */
38 $updater = FS_Plugin_Updater::instance( $fs );
39 $updater->set_update_data( $update );
40 }
41
42 $is_paying = $fs->is_paying();
43 $user = $fs->get_user();
44 $site = $fs->get_site();
45 $name = $user->get_name();
46 $license = $fs->_get_license();
47 $is_data_debug_mode = $fs->is_data_debug_mode();
48 $is_whitelabeled = $fs->is_whitelabeled();
49 $subscription = ( is_object( $license ) ?
50 $fs->_get_subscription( $license->id ) :
51 null );
52 $plan = $fs->get_plan();
53 $is_active_subscription = ( is_object( $subscription ) && $subscription->is_active() );
54 $is_paid_trial = $fs->is_paid_trial();
55 $has_paid_plan = $fs->apply_filters( 'has_paid_plan_account', $fs->has_paid_plan() );
56 $show_upgrade = ( ! $is_whitelabeled && $has_paid_plan && ! $is_paying && ! $is_paid_trial );
57 $trial_plan = $fs->get_trial_plan();
58
59 if ( $has_paid_plan ) {
60 $fs->_add_license_activation_dialog_box();
61 }
62
63 $ids_of_installs_activated_with_foreign_licenses = $fs->should_handle_user_change() ?
64 $fs->get_installs_ids_with_foreign_licenses() :
65 array();
66
67 if ( ! empty( $ids_of_installs_activated_with_foreign_licenses ) ) {
68 $fs->_add_user_change_dialog_box( $ids_of_installs_activated_with_foreign_licenses );
69 }
70
71 if ( $fs->is_whitelabeled( true ) || $fs->is_data_debug_mode() ) {
72 $fs->_add_data_debug_mode_dialog_box();
73 }
74
75 if ( fs_request_get_bool( 'auto_install' ) ) {
76 $fs->_add_auto_installation_dialog_box();
77 }
78
79 if ( fs_request_get_bool( 'activate_license' ) ) {
80 // Open the license activation dialog box on the account page.
81 add_action( 'admin_footer', array(
82 &$fs,
83 '_open_license_activation_dialog_box'
84 ) );
85 }
86
87 $payments = $fs->_fetch_payments();
88
89 $show_billing = ( ! $is_whitelabeled && is_array( $payments ) && 0 < count( $payments ) );
90
91
92 $has_tabs = $fs->_add_tabs_before_content();
93
94 if ( $has_tabs ) {
95 $query_params['tabs'] = 'true';
96 }
97
98 // Aliases.
99 $download_latest_text = fs_text_x_inline( 'Download Latest', 'as download latest version', 'download-latest', $slug );
100 $downgrading_plan_text = fs_text_inline( 'Downgrading your plan', 'downgrading-plan', $slug );
101 $cancelling_subscription_text = fs_text_inline( 'Cancelling the subscription', 'cancelling-subscription', $slug );
102 /* translators: %1$s: Either 'Downgrading your plan' or 'Cancelling the subscription' */
103 $downgrade_x_confirm_text = fs_text_inline( '%1$s will immediately stop all future recurring payments and your %2$s plan license will expire in %3$s.', 'downgrade-x-confirm', $slug );
104 $prices_increase_text = fs_text_inline( 'Please note that we will not be able to grandfather outdated pricing for renewals/new subscriptions after a cancellation. If you choose to renew the subscription manually in the future, after a price increase, which typically occurs once a year, you will be charged the updated price.', 'pricing-increase-warning', $slug );
105 $cancel_trial_confirm_text = fs_text_inline( 'Cancelling the trial will immediately block access to all premium features. Are you sure?', 'cancel-trial-confirm', $slug );
106 $after_downgrade_non_blocking_text = fs_text_inline( 'You can still enjoy all %s features but you will not have access to %s security & feature updates, nor support.', 'after-downgrade-non-blocking', $slug );
107 $after_downgrade_blocking_text = fs_text_inline( 'Once your license expires you can still use the Free version but you will NOT have access to the %s features.', 'after-downgrade-blocking', $slug );
108 /* translators: %s: Plan title (e.g. "Professional") */
109 $activate_plan_text = fs_text_inline( 'Activate %s Plan', 'activate-x-plan', $slug );
110 $version_text = fs_text_x_inline( 'Version', 'product version', 'version', $slug );
111 /* translators: %s: Time period (e.g. Auto renews in "2 months") */
112 $renews_in_text = fs_text_inline( 'Auto renews in %s', 'renews-in', $slug );
113 /* translators: %s: Time period (e.g. Expires in "2 months") */
114 $expires_in_text = fs_text_inline( 'Expires in %s', 'expires-in', $slug );
115 $sync_license_text = fs_text_x_inline( 'Sync License', 'as synchronize license', 'sync-license', $slug );
116 $cancel_trial_text = fs_text_inline( 'Cancel Trial', 'cancel-trial', $slug );
117 $change_plan_text = fs_text_inline( 'Change Plan', 'change-plan', $slug );
118 $upgrade_text = fs_text_x_inline( 'Upgrade', 'verb', 'upgrade', $slug );
119 $addons_text = fs_text_inline( 'Add-Ons', 'add-ons', $slug );
120 $downgrade_text = fs_text_x_inline( 'Downgrade', 'verb', 'downgrade', $slug );
121 $trial_text = fs_text_x_inline( 'Trial', 'trial period', 'trial', $slug );
122 $free_text = fs_text_inline( 'Free', 'free', $slug );
123 $activate_text = fs_text_inline( 'Activate', 'activate', $slug );
124 $plan_text = fs_text_x_inline( 'Plan', 'as product pricing plan', 'plan', $slug );
125 $bundle_plan_text = fs_text_inline( 'Bundle Plan', 'bundle-plan', $slug );
126
127 $show_plan_row = true;
128 $show_license_row = is_object( $license );
129
130 $site_view_params = array();
131
132 if ( fs_is_network_admin() ) {
133 $sites = Freemius::get_sites();
134 $all_installs_plan_id = null;
135 $all_installs_license_id = ( $show_license_row ? $license->id : null );
136 foreach ( $sites as $s ) {
137 $site_info = $fs->get_site_info( $s );
138 $install = $fs->get_install_by_blog_id( $site_info['blog_id'] );
139 $view_params = array(
140 'freemius' => $fs,
141 'license' => $license,
142 'site' => $site_info,
143 'install' => $install,
144 );
145
146 $site_view_params[] = $view_params;
147
148 if ( empty( $install ) ) {
149 continue;
150 }
151
152 if ( $show_plan_row ) {
153 if ( is_null( $all_installs_plan_id ) ) {
154 $all_installs_plan_id = $install->plan_id;
155 } else if ( $all_installs_plan_id != $install->plan_id ) {
156 $show_plan_row = false;
157 }
158 }
159
160 if ( $show_license_row && $all_installs_license_id != $install->license_id ) {
161 $show_license_row = false;
162 }
163 }
164 }
165
166 $is_child_license = ( is_object( $license ) && FS_Plugin_License::is_valid_id( $license->parent_license_id ) );
167 $bundle_subscription = null;
168
169 if (
170 $show_plan_row &&
171 is_object( $license ) &&
172 FS_Plugin_License::is_valid_id( $license->parent_license_id )
173 ) {
174 $bundle_subscription = $fs->_get_subscription( $license->parent_license_id );
175 }
176
177 $is_active_bundle_subscription = ( is_object( $bundle_subscription ) && $bundle_subscription->is_active() );
178
179 $fs_blog_id = ( is_multisite() && ! is_network_admin() ) ?
180 get_current_blog_id() :
181 0;
182
183 $active_plugins_directories_map = Freemius::get_active_plugins_directories_map( $fs_blog_id );
184
185 $is_premium = $fs->is_premium();
186 ?>
187 <div class="wrap fs-section">
188 <?php if ( ! $has_tabs && ! $fs->apply_filters( 'hide_account_tabs', false ) ) : ?>
189 <h2 class="nav-tab-wrapper">
190 <a href="<?php echo $fs->get_account_url() ?>"
191 class="nav-tab nav-tab-active"><?php fs_esc_html_echo_inline( 'Account', 'account', $slug ) ?></a>
192 <?php if ( $fs->has_addons() ) : ?>
193 <a href="<?php echo $fs->_get_admin_page_url( 'addons' ) ?>"
194 class="nav-tab"><?php echo esc_html( $addons_text ) ?></a>
195 <?php endif ?>
196 <?php if ( $show_upgrade ) : ?>
197 <a href="<?php echo $fs->get_upgrade_url() ?>" class="nav-tab"><?php echo esc_html( $upgrade_text ) ?></a>
198 <?php if ( $fs->apply_filters( 'show_trial', true ) && ! $fs->is_trial_utilized() && $fs->has_trial_plan() ) : ?>
199 <a href="<?php echo $fs->get_trial_url() ?>" class="nav-tab"><?php fs_esc_html_echo_inline( 'Free Trial', 'free-trial', $slug ) ?></a>
200 <?php endif ?>
201 <?php endif ?>
202 </h2>
203 <?php endif ?>
204
205 <div id="poststuff">
206 <div id="fs_account">
207 <div class="has-sidebar has-right-sidebar">
208 <div class="has-sidebar-content">
209 <div class="postbox">
210 <h3><span class="dashicons dashicons-businessman"></span> <?php fs_esc_html_echo_inline( 'Account Details', 'account-details', $slug ) ?></h3>
211 <div class="fs-header-actions">
212 <ul>
213 <?php if ( $fs->is_whitelabeled( true ) ) : ?>
214 <li>
215 <a href="#" class="debug-license-trigger"><i class="dashicons dashicons-<?php echo $is_whitelabeled ? 'editor-code' : 'controls-pause' ?>"></i> <span><?php
216 if ( $is_whitelabeled ) {
217 fs_esc_html_echo_inline( 'Start Debug', 'start-debug-license', $slug );
218 } else {
219 fs_esc_html_echo_inline( 'Stop Debug', 'stop-debug-license', $slug );
220 }
221 ?></span></a>
222 </li>
223 <li>&nbsp;&bull;&nbsp;</li>
224 <?php endif ?>
225 <?php if ( $show_billing ) : ?>
226 <li><a href="#fs_billing"><i class="dashicons dashicons-portfolio"></i> <?php fs_esc_html_echo_inline( 'Billing & Invoices', 'billing-invoices', $slug ) ?></li>
227 <li>&nbsp;&bull;&nbsp;</li>
228 <?php endif ?>
229 <?php if ( ! $is_whitelabeled ) : ?>
230 <?php if ( ! $is_paying ) : ?>
231 <li>
232 <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST">
233 <input type="hidden" name="fs_action" value="delete_account">
234 <?php wp_nonce_field( 'delete_account' ) ?>
235 <a class="fs-delete-account" href="#" onclick="if (confirm('<?php
236 if ( $is_active_subscription ) {
237 echo esc_attr( sprintf( fs_text_inline( '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?', 'delete-account-x-confirm', $slug ), $plan->title ) );
238 } else {
239 echo esc_attr( sprintf( fs_text_inline( '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?', 'delete-account-confirm', $slug ), $fs->get_module_label( true ) ) );
240 }
241 ?>')) this.parentNode.submit(); return false;"><i
242 class="dashicons dashicons-no"></i> <?php fs_esc_html_echo_inline( 'Delete Account', 'delete-account', $slug ) ?></a>
243 </form>
244 </li>
245 <li>&nbsp;&bull;&nbsp;</li>
246 <?php endif ?>
247 <?php if ( $is_paying ) : ?>
248 <?php if ( ! fs_is_network_admin() ) : ?>
249 <li>
250 <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST">
251 <input type="hidden" name="fs_action" value="deactivate_license">
252 <?php wp_nonce_field( 'deactivate_license' ) ?>
253 <a href="#" class="fs-deactivate-license"><i
254 class="dashicons dashicons-admin-network"></i> <?php fs_echo_inline( 'Deactivate License', 'deactivate-license', $slug ) ?>
255 </a>
256 </form>
257 </li>
258 <li>&nbsp;&bull;&nbsp;</li>
259 <?php endif ?>
260 <?php if ( ! $license->is_lifetime() &&
261 $is_active_subscription
262 ) : ?>
263 <li>
264 <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST">
265 <input type="hidden" name="fs_action" value="downgrade_account">
266 <?php wp_nonce_field( 'downgrade_account' ) ?>
267 <a href="#"
268 onclick="if ( confirm('<?php echo esc_attr( sprintf(
269 $downgrade_x_confirm_text,
270 ( $fs->is_only_premium() ? $cancelling_subscription_text : $downgrading_plan_text ),
271 $plan->title,
272 human_time_diff( time(), strtotime( $license->expiration ) )
273 ) ) ?> <?php if ( ! $license->is_block_features ) {
274 echo esc_attr( sprintf( $after_downgrade_non_blocking_text, $plan->title, $fs->get_module_label( true ) ) );
275 } else {
276 echo esc_attr( sprintf( $after_downgrade_blocking_text, $plan->title ) );
277 }?> <?php echo esc_attr( $prices_increase_text ) ?> <?php fs_esc_attr_echo_inline( 'Are you sure you want to proceed?', 'proceed-confirmation', $slug ) ?>') ) this.parentNode.submit(); return false;"><i class="dashicons dashicons-download"></i> <?php echo esc_html( $fs->is_only_premium() ? fs_text_inline( 'Cancel Subscription', 'cancel-subscription', $slug ) : $downgrade_text ) ?></a>
278 </form>
279 </li>
280 <li>&nbsp;&bull;&nbsp;</li>
281 <?php endif ?>
282 <?php if ( ! $fs->is_single_plan() ) : ?>
283 <li>
284 <a href="<?php echo $fs->get_upgrade_url() ?>"><i
285 class="dashicons dashicons-grid-view"></i> <?php echo esc_html( $change_plan_text ) ?></a>
286 </li>
287 <li>&nbsp;&bull;&nbsp;</li>
288 <?php endif ?>
289 <?php elseif ( $is_paid_trial ) : ?>
290 <li>
291 <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST">
292 <input type="hidden" name="fs_action" value="cancel_trial">
293 <?php wp_nonce_field( 'cancel_trial' ) ?>
294 <a href="#" class="fs-cancel-trial"><i
295 class="dashicons dashicons-download"></i> <?php echo esc_html( $cancel_trial_text ) ?></a>
296 </form>
297 </li>
298 <li>&nbsp;&bull;&nbsp;</li>
299 <?php endif ?>
300 <?php endif ?>
301 <li>
302 <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST">
303 <input type="hidden" name="fs_action" value="<?php echo $fs->get_unique_affix() ?>_sync_license">
304 <?php wp_nonce_field( $fs->get_unique_affix() . '_sync_license' ) ?>
305 <a href="#" onclick="this.parentNode.submit(); return false;"><i
306 class="dashicons dashicons-image-rotate"></i> <?php fs_esc_html_echo_x_inline( 'Sync', 'as synchronize', 'sync', $slug ) ?></a>
307 </form>
308 </li>
309 </ul>
310 </div>
311 <div class="inside">
312 <table id="fs_account_details" cellspacing="0" class="fs-key-value-table">
313 <?php
314 $hide_license_key = ( ! $show_license_row || $fs->apply_filters( 'hide_license_key', false ) );
315
316 $profile = array();
317
318 if ( ! $is_whitelabeled ) {
319 $profile[] = array(
320 'id' => 'user_name',
321 'title' => fs_text_inline( 'Name', 'name', $slug ),
322 'value' => $name
323 );
324 // if (isset($user->email) && false !== strpos($user->email, '@'))
325 $profile[] = array(
326 'id' => 'email',
327 'title' => fs_text_inline( 'Email', 'email', $slug ),
328 'value' => $user->email
329 );
330
331 if ( is_numeric( $user->id ) ) {
332 $profile[] = array(
333 'id' => 'user_id',
334 'title' => fs_text_inline( 'User ID', 'user-id', $slug ),
335 'value' => $user->id
336 );
337 }
338 }
339
340 $profile[] = array(
341 'id' => 'product',
342 'title' => ( $fs->is_plugin() ?
343 fs_text_inline( 'Plugin', 'plugin', $slug ) :
344 fs_text_inline( 'Theme', 'theme', $slug ) ),
345 'value' => $fs->get_plugin_title()
346 );
347
348 $profile[] = array(
349 'id' => 'product_id',
350 'title' => ( $fs->is_plugin() ?
351 fs_text_inline( 'Plugin', 'plugin', $slug ) :
352 fs_text_inline( 'Theme', 'theme', $slug ) ) . ' ' . fs_text_inline( 'ID', 'id', $slug ),
353 'value' => $fs->get_id()
354 );
355
356 if ( ! fs_is_network_admin()) {
357 $profile[] = array(
358 'id' => 'site_id',
359 'title' => fs_text_inline( 'Site ID', 'site-id', $slug ),
360 'value' => is_string( $site->id ) ?
361 $site->id :
362 fs_text_inline( 'No ID', 'no-id', $slug )
363 );
364
365 $profile[] = array(
366 'id' => 'site_public_key',
367 'title' => fs_text_inline( 'Public Key', 'public-key', $slug ),
368 'value' => $site->public_key
369 );
370
371 $profile[] = array(
372 'id' => 'site_secret_key',
373 'title' => fs_text_inline( 'Secret Key', 'secret-key', $slug ),
374 'value' => ( ( is_string( $site->secret_key ) ) ?
375 $site->secret_key :
376 fs_text_x_inline( 'No Secret', 'as secret encryption key missing', 'no-secret', $slug )
377 )
378 );
379 }
380
381 $profile[] = array(
382 'id' => 'version',
383 'title' => $version_text,
384 'value' => $fs->get_plugin_version()
385 );
386
387 if ( $is_premium && ! $is_whitelabeled ) {
388 $profile[] = array(
389 'id' => 'beta_program',
390 'title' => '',
391 'value' => $user->is_beta
392 );
393 }
394
395 if ( $has_paid_plan ) {
396 if ( $fs->is_trial() ) {
397 if ( $show_plan_row ) {
398 $profile[] = array(
399 'id' => 'plan',
400 'title' => $plan_text,
401 'value' => ( is_string( $trial_plan->name ) ?
402 strtoupper( $trial_plan->title ) :
403 fs_text_inline( 'Trial', 'trial', $slug ) )
404 );
405 }
406 } else {
407 if ( $show_plan_row ) {
408 $profile[] = array(
409 'id' => 'plan',
410 'title' => ( $is_child_license ? ucfirst( $fs->get_module_type() ) . ' ' : '' ) . $plan_text,
411 'value' => strtoupper( is_string( $plan->name ) ?
412 $plan->title :
413 strtoupper( $free_text )
414 )
415 );
416
417 if ( $is_child_license ) {
418 $profile[] = array(
419 'id' => 'bundle_plan',
420 'title' => $bundle_plan_text,
421 'value' => strtoupper( $license->parent_plan_title )
422 );
423 }
424 }
425
426 if ( is_object( $license ) ) {
427 if ( ! $hide_license_key ) {
428 $profile[] = array(
429 'id' => 'license_key',
430 'title' => fs_text_inline( 'License Key', $slug ),
431 'value' => $license->secret_key,
432 );
433 }
434 }
435 }
436 }
437 ?>
438 <?php $odd = true;
439 foreach ( $profile as $p ) : ?>
440 <?php
441 if ( 'plan' === $p['id'] && ! $has_paid_plan ) {
442 // If plugin don't have any paid plans, there's no reason
443 // to show current plan.
444 continue;
445 }
446 ?>
447 <tr class="fs-field-<?php echo $p['id'] ?><?php if ( $odd ) : ?> alternate<?php endif ?>">
448 <td>
449 <nobr><?php echo $p['title'] ?><?php echo ( ! empty( $p['title'] ) ) ? ':' : '' ?></nobr>
450 </td>
451 <td<?php if ( 'plan' === $p['id'] || 'bundle_plan' === $p['id'] ) { echo ' colspan="2"'; }?>>
452 <?php if ( in_array( $p['id'], array( 'license_key', 'site_secret_key' ) ) ) : ?>
453 <code><?php echo FS_Plugin_License::mask_secret_key_for_html( $p['value'] ) ?></code>
454 <?php if ( ! $is_whitelabeled ) : ?>
455 <input type="text" value="<?php echo htmlspecialchars( $p['value'] ) ?>" style="display: none"
456 readonly/>
457 <?php endif ?>
458 <?php elseif ( 'beta_program' === $p['id'] ) : ?>
459 <label>
460 <input type="checkbox" class="fs-toggle-beta-mode" <?php checked( true, $p['value'] ) ?>/><span><?php
461 fs_esc_html_echo_inline( 'Join the Beta program', 'join-beta', $slug )
462 ?></span></label>
463 <?php else : ?>
464 <code><?php echo htmlspecialchars( $p['value'] ) ?></code>
465 <?php endif ?>
466 <?php if ( 'email' === $p['id'] && ! $user->is_verified() ) : ?>
467 <label class="fs-tag fs-warn"><?php fs_esc_html_echo_inline( 'not verified', 'not-verified', $slug ) ?></label>
468 <?php endif ?>
469 <?php if ( 'plan' === $p['id'] ) : ?>
470 <?php if ( $fs->is_trial() ) : ?>
471 <label class="fs-tag fs-success"><?php echo esc_html( $trial_text ) ?></label>
472 <?php endif ?>
473 <?php if ( is_object( $license ) && ! $license->is_lifetime() ) : ?>
474 <?php if ( ! $is_active_subscription && ! $is_active_bundle_subscription && ! $license->is_first_payment_pending() ) : ?>
475 <?php $is_license_expired = $license->is_expired() ?>
476 <?php $expired_ago_text = ( fs_text_inline( 'Expired', 'expired', $slug ) . ' ' . fs_text_x_inline( '%s ago', 'x-ago', $slug ) ) ?>
477 <label
478 class="fs-tag <?php echo $is_license_expired ? 'fs-error' : 'fs-warn' ?>"><?php
479 echo esc_html( sprintf( $is_license_expired ? $expired_ago_text : $expires_in_text, human_time_diff( time(), strtotime( $license->expiration ) ) ) )
480 ?></label>
481 <?php elseif ( $is_active_subscription && ! $subscription->is_first_payment_pending() ) : ?>
482 <label class="fs-tag fs-success"><?php echo esc_html( sprintf( $renews_in_text, human_time_diff( time(), strtotime( $subscription->next_payment ) ) ) ) ?></label>
483 <?php endif ?>
484 <?php elseif ( $fs->is_trial() ) : ?>
485 <label class="fs-tag fs-warn"><?php echo esc_html( sprintf( $expires_in_text, human_time_diff( time(), strtotime( $site->trial_ends ) ) ) ) ?></label>
486 <?php endif ?>
487 <?php if ( ! $is_whitelabeled ) : ?>
488 <div class="button-group">
489 <?php $available_license = $fs->is_free_plan() && ! fs_is_network_admin() ? $fs->_get_available_premium_license( $site->is_localhost() ) : false ?>
490 <?php if ( is_object( $available_license ) ) : ?>
491 <?php $premium_plan = $fs->_get_plan_by_id( $available_license->plan_id ) ?>
492 <?php
493 $view_params = array(
494 'freemius' => $fs,
495 'slug' => $slug,
496 'license' => $available_license,
497 'plan' => $premium_plan,
498 'is_localhost' => $site->is_localhost(),
499 'install_id' => $site->id,
500 'class' => 'button-primary',
501 );
502 fs_require_template( 'account/partials/activate-license-button.php', $view_params ); ?>
503 <?php else : ?>
504 <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>"
505 method="POST" class="button-group">
506 <?php if ( $show_upgrade && $is_premium ) : ?>
507 <a class="button activate-license-trigger <?php echo $fs->get_unique_affix() ?>" href="#"><?php fs_esc_html_echo_inline( 'Activate License', 'activate-license', $slug ) ?></a>
508 <?php endif ?>
509 <input type="submit" class="button"
510 value="<?php echo esc_attr( $sync_license_text ) ?>">
511 <input type="hidden" name="fs_action"
512 value="<?php echo $fs->get_unique_affix() ?>_sync_license">
513 <?php wp_nonce_field( $fs->get_unique_affix() . '_sync_license' ) ?>
514 <?php if ( $show_upgrade || ! $fs->is_single_plan() ) : ?>
515 <a href="<?php echo $fs->get_upgrade_url() ?>"
516 class="button<?php
517 echo $show_upgrade ?
518 ' button-primary fs-upgrade' :
519 ' fs-change-plan'; ?> button-upgrade"><i
520 class="dashicons dashicons-cart"></i> <?php echo esc_html( $show_upgrade ? $upgrade_text : $change_plan_text ) ?></a>
521 <?php endif ?>
522 </form>
523 <?php endif ?>
524 </div>
525 <?php endif ?>
526 <?php elseif ( 'bundle_plan' === $p['id'] ) : ?>
527 <?php if ( is_object( $bundle_subscription ) ) : ?>
528 <?php if ( $is_active_bundle_subscription && ! $license->is_first_payment_pending() ) : ?>
529 <label class="fs-tag fs-success"><?php echo esc_html( sprintf( $renews_in_text, human_time_diff( time(), strtotime( $bundle_subscription->next_payment ) ) ) ) ?></label>
530 <?php endif ?>
531 <?php endif ?>
532 <?php elseif ( 'version' === $p['id'] && $has_paid_plan ) : ?>
533 <?php if ( $fs->has_premium_version() ) : ?>
534 <?php if ( $is_premium ) : ?>
535 <label
536 class="fs-tag fs-<?php echo $fs->can_use_premium_code() ? 'success' : 'warn' ?>"><?php fs_esc_html_echo_inline( 'Premium version', 'premium-version', $slug ) ?></label>
537 <?php elseif ( $fs->can_use_premium_code() ) : ?>
538 <label class="fs-tag fs-warn"><?php fs_esc_html_echo_inline( 'Free version', 'free-version', $slug ) ?></label>
539 <?php endif ?>
540 <?php endif ?>
541 <?php endif ?>
542 </td>
543 <?php if ( 'plan' !== $p['id'] && 'bundle_plan' !== $p['id'] ) : ?>
544 <td class="fs-right">
545 <?php if ( 'email' === $p['id'] && ! $user->is_verified() ) : ?>
546 <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST">
547 <input type="hidden" name="fs_action" value="verify_email">
548 <?php wp_nonce_field( 'verify_email' ) ?>
549 <input type="submit" class="button button-small"
550 value="<?php fs_esc_attr_echo_inline( 'Verify Email', 'verify-email', $slug ) ?>">
551 </form>
552 <?php endif ?>
553 <?php if ( 'version' === $p['id'] ) : ?>
554 <?php if ( $fs->has_release_on_freemius() ) : ?>
555 <div class="button-group">
556 <?php if ( $is_paying || $fs->is_trial() ) : ?>
557 <?php if ( ! $fs->is_allowed_to_install() ) : ?>
558 <a target="_blank" class="button button-primary"
559 href="<?php echo $fs->_get_latest_download_local_url() ?>"><?php
560 $download_version_text_suffix = ( is_object( $update ) ? ' [' . $update->version . ']' : '' );
561
562 $download_version_text = sprintf(
563 /* translators: %s: plan name (e.g. Download "Professional" Version) */
564 fs_text_inline( 'Download %s Version', 'download-x-version', $slug ),
565 ( $fs->is_trial() ? $trial_plan->title : $plan->title )
566 ) .
567 $download_version_text_suffix;
568
569 $download_version_text_length = function_exists( 'mb_strlen' ) ?
570 mb_strlen( $download_version_text ) :
571 strlen( $download_version_text );
572
573 if ( $download_version_text_length > 31 ) {
574 /**
575 * Try to limit the number of characters to 31 for now.
576 *
577 * @author Leo Fajardo (@leorw)
578 * @aince 2.3.2
579 */
580 $download_version_text = fs_text_inline( 'Download Paid Version', 'download-paid-version', $slug ) . $download_version_text_suffix;
581 }
582
583 echo $download_version_text;
584 ?></a>
585 <?php elseif ( is_object( $update ) ) : ?>
586 <?php
587 $module_type = $fs->get_module_type();
588 ?>
589 <a class="button button-primary"
590 href="<?php echo wp_nonce_url( self_admin_url( "update.php?action=upgrade-{$module_type}&{$module_type}=" . $fs->get_plugin_basename() ), "upgrade-{$module_type}_" . $fs->get_plugin_basename() ) ?>"><?php echo fs_esc_html_inline( 'Install Update Now', 'install-update-now', $slug ) . ' [' . $update->version . ']' ?></a>
591 <?php endif ?>
592 <?php endif; ?>
593 </div>
594 <?php endif ?>
595 <?php
596 elseif ( in_array( $p['id'], array( 'license_key', 'site_secret_key' ) ) ) : ?>
597 <?php if ( ! $is_whitelabeled ) : ?>
598 <button class="button button-small fs-toggle-visibility"><?php fs_esc_html_echo_x_inline( 'Show', 'verb', 'show', $slug ) ?></button>
599 <?php endif ?>
600 <?php if ('license_key' === $p['id']) : ?>
601 <button class="button button-small activate-license-trigger <?php echo $fs->get_unique_affix() ?>"><?php fs_esc_html_echo_inline( 'Change License', 'change-license', $slug ) ?></button>
602 <?php endif ?>
603 <?php
604 elseif (/*in_array($p['id'], array('site_secret_key', 'site_id', 'site_public_key')) ||*/
605 ( is_string( $user->secret_key ) && in_array( $p['id'], array(
606 'email',
607 'user_name'
608 ) ) )
609 ) : ?>
610 <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST"
611 onsubmit="var val = prompt('<?php echo esc_attr( sprintf(
612 /* translators: %s: User's account property (e.g. name, email) */
613 fs_text_inline( 'What is your %s?', 'what-is-your-x', $slug ),
614 $p['title']
615 ) ) ?>', '<?php echo $p['value'] ?>'); if (null == val || '' === val) return false; jQuery('input[name=fs_<?php echo $p['id'] ?>_<?php echo $fs->get_unique_affix() ?>]').val(val); return true;">
616 <input type="hidden" name="fs_action" value="update_<?php echo $p['id'] ?>">
617 <input type="hidden" name="fs_<?php echo $p['id'] ?>_<?php echo $fs->get_unique_affix() ?>"
618 value="">
619 <?php wp_nonce_field( 'update_' . $p['id'] ) ?>
620 <input type="submit" class="button button-small"
621 value="<?php echo fs_esc_attr_x_inline( 'Edit', 'verb', 'edit', $slug ) ?>">
622 </form>
623 <?php elseif ( 'user_id' === $p['id'] && ! empty( $ids_of_installs_activated_with_foreign_licenses ) ) : ?>
624 <input id="fs_change_user" type="submit" class="button button-small"
625 value="<?php echo fs_esc_attr_inline( 'Change User', 'change-user', $slug ) ?>">
626 <?php endif ?>
627 </td>
628 <?php endif ?>
629 </tr>
630 <?php
631 if ( 'version' === $p['id'] && $is_premium ) {
632 /**
633 * If there's a row for the beta program, keep its background color
634 * the same as the version info row.
635 *
636 * @author Leo Fajardo (@leorw)
637 * @since 2.3.0
638 */
639 continue;
640 }
641
642 $odd = ! $odd;
643 endforeach ?>
644 </table>
645 </div>
646 </div>
647 <?php if ( fs_is_network_admin() ) : ?>
648 <div id="fs_sites" class="postbox">
649 <h3><span class="dashicons dashicons-networking"></span> <?php fs_esc_html_echo_inline( 'Sites', 'sites', $slug ) ?></h3>
650 <div class="fs-header-actions">
651 <?php if ( ! $is_whitelabeled ) : ?>
652 <?php $has_license = is_object( $license ) ?>
653 <?php if ( $has_license || ( $show_upgrade && $is_premium ) ) : ?>
654 <?php
655 $activate_license_button_text = $has_license ?
656 fs_esc_html_inline( 'Change License', 'change-license', $slug ) :
657 fs_esc_html_inline( 'Activate License', 'activate-license', $slug );
658 ?>
659 <a class="button<?php echo ( ! $has_license ? ' button-primary' : '' ) ?> activate-license-trigger <?php echo $fs->get_unique_affix() ?>" href="#"><?php echo $activate_license_button_text ?></a>
660 <?php endif ?>
661 <?php endif ?>
662 <input class="fs-search" type="text" placeholder="<?php fs_esc_attr_echo_inline( 'Search by address', 'search-by-address', $slug ) ?>..."><span class="dashicons dashicons-search"></span>
663 </div>
664 <div class="inside">
665 <div id="" class="fs-scrollable-table">
666 <div class="fs-table-head">
667 <table class="widefat">
668 <thead>
669 <tr>
670 <td><?php fs_esc_html_echo_inline('ID', 'id', $slug) ?></td>
671 <td><?php fs_esc_html_echo_inline('Address', 'address', $slug) ?></td>
672 <td><?php fs_esc_html_echo_inline('License', 'license', $slug) ?></td>
673 <td><?php fs_esc_html_echo_inline('Plan', 'plan', $slug) ?></td>
674 <td></td>
675 </tr>
676 </thead>
677 </table>
678 </div>
679 <div class="fs-table-body">
680 <table class="widefat">
681 <?php
682 foreach ( $site_view_params as $view_params ) {
683 fs_require_template(
684 'account/partials/site.php',
685 $view_params
686 );
687 } ?>
688 </table>
689 </div>
690 </div>
691 </div>
692 </div>
693 <?php endif ?>
694
695 <?php
696 $account_addons = $fs->get_updated_account_addons();
697
698 $installed_addons = $fs->get_installed_addons();
699 $installed_addons_ids = array();
700 foreach ( $installed_addons as $fs_addon ) {
701 $installed_addons_ids[] = $fs_addon->get_id();
702 }
703
704 $addons_to_show = array_unique( array_merge( $installed_addons_ids, $account_addons ) );
705 ?>
706 <?php if ( 0 < count( $addons_to_show ) ) : ?>
707 <!-- Add-Ons -->
708 <div class="postbox">
709 <div class="">
710 <!-- <div class="inside">-->
711 <table id="fs_addons" class="widefat">
712 <thead>
713 <tr>
714 <th><h3><?php echo esc_html( $addons_text ) ?></h3></th>
715 <th><?php fs_esc_html_echo_inline( 'ID', 'id', $slug ) ?></th>
716 <th><?php echo esc_html( $version_text ) ?></th>
717 <th><?php echo esc_html( $plan_text ) ?></th>
718 <th><?php fs_esc_html_echo_x_inline( 'License', 'as software license', 'license', $slug ) ?></th>
719 <th></th>
720 <?php if ( defined( 'WP_FS__DEV_MODE' ) && WP_FS__DEV_MODE ) : ?>
721 <th></th>
722 <?php endif ?>
723 </tr>
724 </thead>
725 <tbody>
726 <?php
727 $odd = true;
728
729 $installed_addons_ids_map = array_flip( $installed_addons_ids );
730
731 $addon_info_by_id = array();
732 $hide_all_addons_data = false;
733
734 if ( $fs->is_whitelabeled_by_flag() ) {
735 $hide_all_addons_data = true;
736
737 foreach ( $addons_to_show as $addon_id ) {
738 $is_addon_installed = isset( $installed_addons_ids_map[ $addon_id ] );
739 $addon_info = $fs->_get_addon_info( $addon_id, $is_addon_installed );
740 $is_addon_connected = $addon_info['is_connected'];
741
742 $fs_addon = ( $is_addon_connected && $is_addon_installed ) ?
743 freemius( $addon_id ) :
744 null;
745
746 $is_whitelabeled = is_object( $fs_addon ) ?
747 $fs_addon->is_whitelabeled( true ) :
748 $addon_info['is_whitelabeled'];
749
750 if ( ! $is_whitelabeled ) {
751 $hide_all_addons_data = false;
752 }
753
754 if ( $is_data_debug_mode ) {
755 $is_whitelabeled = false;
756 }
757
758 $addon_info_by_id[ $addon_id ] = $addon_info;
759 }
760 }
761
762 foreach ( $addons_to_show as $addon_id ) {
763 $is_addon_installed = isset( $installed_addons_ids_map[ $addon_id ] );
764
765 if (
766 $hide_all_addons_data &&
767 ! $is_addon_installed &&
768 ! file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $fs->get_addon_basename( $addon_id ) ) )
769 ) {
770 continue;
771 }
772
773 $addon_view_params = array(
774 'parent_fs' => $fs,
775 'addon_id' => $addon_id,
776 'odd' => $odd,
777 'fs_blog_id' => $fs_blog_id,
778 'active_plugins_directories_map' => &$active_plugins_directories_map,
779 'is_addon_installed' => $is_addon_installed,
780 'addon_info' => isset( $addon_info_by_id[ $addon_id ] ) ?
781 $addon_info_by_id[ $addon_id ] :
782 $fs->_get_addon_info( $addon_id, $is_addon_installed ),
783 'is_whitelabeled' => ( $is_whitelabeled && ! $is_data_debug_mode )
784 );
785
786 fs_require_template(
787 'account/partials/addon.php',
788 $addon_view_params
789 );
790
791 $odd = ! $odd;
792 } ?>
793 </tbody>
794 </table>
795 </div>
796 </div>
797 <?php endif ?>
798
799 <?php $fs->do_action( 'after_account_details' ) ?>
800
801 <?php
802 if ( $show_billing ) {
803 $view_params = array( 'id' => $VARS['id'] );
804 fs_require_once_template( 'account/billing.php', $view_params );
805 fs_require_once_template( 'account/payments.php', $view_params );
806 }
807 ?>
808 </div>
809 </div>
810 </div>
811 </div>
812 </div>
813 <?php
814 $subscription_cancellation_dialog_box_template_params = $fs->_get_subscription_cancellation_dialog_box_template_params( true );
815 if ( ! empty( $subscription_cancellation_dialog_box_template_params ) ) {
816 fs_require_template( 'forms/subscription-cancellation.php', $subscription_cancellation_dialog_box_template_params );
817 }
818 ?>
819 <script type="text/javascript">
820 (function ($) {
821 var setLoading = function ($this, label) {
822 // Set loading mode.
823 $(document.body).css({'cursor': 'wait'});
824
825 $this.css({'cursor': 'wait'});
826
827 if ($this.is('input'))
828 $this.val(label);
829 else
830 $this.html(label);
831
832 setTimeout(function () {
833 $this.attr('disabled', 'disabled');
834 }, 200);
835 };
836
837 $('.fs-toggle-visibility').click(function () {
838 var
839 $this = $(this),
840 $parent = $this.closest('tr'),
841 $input = $parent.find('input');
842
843 $parent.find('code').toggle();
844 $input.toggle();
845
846 if ($input.is(':visible')) {
847 $this.html('<?php fs_esc_js_echo_x_inline( 'Hide', 'verb', 'hide', $slug ) ?>');
848 setTimeout(function () {
849 $input.select().focus();
850 }, 100);
851 }
852 else {
853 $this.html( '<?php fs_esc_js_echo_x_inline( 'Show', 'verb', 'show', $slug ) ?>' );
854 }
855 });
856
857 $('.fs-toggle-tracking').click(function () {
858 setLoading(
859 $(this),
860 ($(this).data('is-disconnected') ?
861 '<?php fs_esc_js_echo_inline('Opting in', 'opting-in' ) ?>' :
862 '<?php fs_esc_js_echo_inline('Opting out', 'opting-out' ) ?>') +
863 '...'
864 );
865 });
866
867 <?php
868 $plugin_title = $fs->get_plugin_title();
869 $processing_text = fs_esc_js_inline( 'Processing', 'processing' );
870 $confirmation_message = sprintf(
871 '%s %s',
872 sprintf( fs_esc_attr_inline( 'Get updates for bleeding edge Beta versions of %s.', 'get-beta-versions', $slug ), $plugin_title ),
873 sprintf( fs_esc_attr_inline( 'An update to a Beta version will replace your installed version of %s with the latest Beta release - use with caution, and not on production sites. You have been warned.', 'beta-version-update-caution', $slug ), $plugin_title )
874 );
875 ?>
876
877 $( '.fs-toggle-beta-mode' ).click( function () {
878 var $checkbox = $( this ),
879 isChecked = $checkbox.is( ':checked' );
880
881 if ( ! isChecked || confirm( '<?php echo $confirmation_message ?>' ) ) {
882 $.ajax( {
883 url : ajaxurl,
884 method: 'POST',
885 data : {
886 action : '<?php echo $fs->get_ajax_action( 'set_beta_mode' ) ?>',
887 security : '<?php echo $fs->get_ajax_security( 'set_beta_mode' ) ?>',
888 is_beta : isChecked,
889 module_id: <?php echo $fs->get_id() ?>
890 },
891 beforeSend: function () {
892 $checkbox.prop( 'disabled', true );
893 $checkbox.parent().find( 'span' ).text( '<?php echo $processing_text ?>' + '...' );
894 },
895 complete: function () {
896 $checkbox.prop( 'disabled', false );
897 $checkbox.parent().find( 'span' ).text( '<?php fs_esc_js_echo_inline( 'Join the Beta Program', 'join-beta', $slug ) ?>' );
898 }
899 } );
900
901 return true;
902 }
903
904 return false;
905 });
906
907 $('.fs-opt-in').click(function () {
908 setLoading($(this), '<?php fs_esc_js_echo_inline('Opting in', 'opting-in' ) ?>...');
909 });
910
911 $( '#fs_downgrade' ).submit(function( event ) {
912 event.preventDefault();
913
914 setLoading( $( this ).find( '.button' ), '<?php fs_esc_js_echo_inline( 'Downgrading', 'downgrading' ) ?>...' );
915 });
916
917 $('.fs-activate-license').click(function () {
918 setLoading($(this), '<?php fs_esc_js_echo_inline('Activating', 'activating' ) ?>...');
919 });
920
921 var $deactivateLicenseOrCancelTrial = $( '.fs-deactivate-license, .fs-cancel-trial' ),
922 $subscriptionCancellationModal = $( '.fs-modal-subscription-cancellation-<?php echo $fs->get_id() ?>' );
923
924 if ( 0 !== $subscriptionCancellationModal.length ) {
925 $subscriptionCancellationModal.on( '<?php echo $fs->get_action_tag( 'subscription_cancellation_action' ) ?>', function( evt, cancelSubscription ) {
926 setLoading(
927 $deactivateLicenseOrCancelTrial,
928 ( ! $deactivateLicenseOrCancelTrial.hasClass( 'fs-cancel-trial' ) ?
929 '<?php fs_esc_js_echo_inline( 'Deactivating', 'deactivating', $slug ) ?>' :
930 '<?php echo esc_html( sprintf( fs_text_inline( 'Cancelling %s', 'cancelling-x', $slug ), fs_text_inline( 'trial', 'trial', $slug ) ) ) ?>' ) + '...'
931 );
932
933 $subscriptionCancellationModal.find( '.fs-modal-footer .button' ).addClass( 'disabled' );
934 $deactivateLicenseOrCancelTrial.unbind( 'click' );
935
936 if ( false === cancelSubscription || $deactivateLicenseOrCancelTrial.hasClass( 'fs-cancel-trial' ) ) {
937 $subscriptionCancellationModal.find( '.fs-modal-footer .button-primary' ).text( $deactivateLicenseOrCancelTrial.text() );
938
939 $deactivateLicenseOrCancelTrial[0].parentNode.submit();
940 } else {
941 var $form = $( 'input[value="downgrade_account"],input[value="cancel_trial"]' ).parent();
942 $form.prepend( '<input type="hidden" name="deactivate_license" value="true" />' );
943
944 $subscriptionCancellationModal.find( '.fs-modal-footer .button-primary' ).text( '<?php echo esc_js( sprintf(
945 fs_text_inline( 'Cancelling %s...', 'cancelling-x' , $slug ),
946 $is_paid_trial ?
947 fs_text_inline( 'trial', 'trial', $slug ) :
948 fs_text_inline( 'subscription', 'subscription', $slug )
949 ) ) ?>' );
950
951 $form.submit();
952 }
953 });
954 }
955
956 $deactivateLicenseOrCancelTrial.click(function() {
957 var $this = $( this );
958 if ( $this.hasClass( 'fs-cancel-trial' ) ) {
959 $subscriptionCancellationModal.find( '.fs-modal-panel' ).find( 'ul.subscription-actions, .fs-price-increase-warning' ).remove();
960 $subscriptionCancellationModal.find( '.fs-modal-panel > p' ).text( <?php echo json_encode( $cancel_trial_confirm_text ) ?> );
961 $subscriptionCancellationModal.trigger( 'showModal' );
962 } else if (confirm('<?php fs_esc_attr_echo_inline( 'Deactivating your license will block all premium features, but will enable activating the license on another site. Are you sure you want to proceed?', 'deactivate-license-confirm', $slug ) ?>')) {
963 var $this = $(this);
964
965 if ( 0 !== $subscriptionCancellationModal.length ) {
966 $subscriptionCancellationModal.trigger( 'showModal' );
967 } else {
968 setLoading( $this, '<?php fs_esc_js_echo_inline( 'Deactivating', 'deactivating', $slug ) ?>...' );
969 $this[0].parentNode.submit();
970 }
971 }
972
973 return false;
974 });
975
976 var $sitesSection = $('#fs_sites'),
977 $sitesTable = $sitesSection.find('.fs-scrollable-table'),
978 $sitesTableRows = $sitesTable.find('.fs-site-details');
979
980 $('.fs-show-install-details').click(function(){
981 var installID = $(this).parents('.fs-site-details').attr('data-install-id');
982 $sitesSection.find('.fs-install-details[data-install-id=' + installID + ']').toggle();
983 });
984
985
986 var adjustColumnWidth = function($table) {
987 var $headerColumns = $table.find('.fs-table-head td'),
988 $bodyColumns = $table.find('.fs-table-body tr:first > td');
989
990 for (var i = 0, len = $headerColumns.length; i < len; i++) {
991 $($headerColumns[i]).width($($bodyColumns[i]).width());
992 }
993 for (i = 0, len = $headerColumns.length; i < len; i++) {
994 $($bodyColumns[i]).width($($headerColumns[i]).width());
995 }
996 };
997
998 adjustColumnWidth($sitesTable);
999
1000 $sitesSection.find('.fs-search').keyup(function(){
1001 var search = $(this).val().trim();
1002
1003 if ('' === search){
1004 // Show all.
1005 $sitesTableRows.show();
1006 return;
1007 }
1008
1009 var url;
1010
1011 $sitesTableRows.each(function(index){
1012 url = $(this).find('.fs-field-url').html();
1013
1014 if (-1 < url.indexOf(search)){
1015 $(this).show();
1016 } else {
1017 $(this).hide();
1018 }
1019 });
1020 });
1021
1022 })(jQuery);
1023 </script>
1024 <?php
1025 if ( $has_tabs ) {
1026 $fs->_add_tabs_after_content();
1027 }
1028
1029 $params = array(
1030 'page' => 'account',
1031 'module_id' => $fs->get_id(),
1032 'module_type' => $fs->get_module_type(),
1033 'module_slug' => $slug,
1034 'module_version' => $fs->get_plugin_version(),
1035 );
1036 fs_require_template( 'powered-by.php', $params );