| @@ -21,9 +21,9 @@ | ||
| 21 | 21 | /** |
| 22 | 22 | * @var FS_Plugin_Tag $update |
| 23 | 23 | */ |
| 24 | 24 | $update = $fs->has_release_on_freemius() ? |
| 25 | - $fs->get_update( false, false, WP_FS__TIME_24_HOURS_IN_SEC / 24 ) : | |
| 25 | + $fs->get_update( false, false ) : | |
| 26 | 26 | null; |
| 27 | 27 | |
| 28 | 28 | if ( is_object($update) ) { |
| 29 | 29 | /** |
| @@ -105,12 +105,8 @@ | ||
| 105 | 105 | |
| 106 | 106 | |
| 107 | 107 | $has_tabs = $fs->_add_tabs_before_content(); |
| 108 | 108 | |
| 109 | - if ( $has_tabs ) { | |
| 110 | - $query_params['tabs'] = 'true'; | |
| 111 | - } | |
| 112 | - | |
| 113 | 109 | // Aliases. |
| 114 | 110 | $download_latest_text = fs_text_x_inline( 'Download Latest', 'as download latest version', 'download-latest', $slug ); |
| 115 | 111 | $downgrading_plan_text = fs_text_inline( 'Downgrading your plan', 'downgrading-plan', $slug ); |
| 116 | 112 | $cancelling_subscription_text = fs_text_inline( 'Cancelling the subscription', 'cancelling-subscription', $slug ); |
| @@ -255,22 +251,24 @@ | ||
| 255 | 251 | |
| 256 | 252 | $available_license_paid_plan = is_object( $available_license ) ? |
| 257 | 253 | $fs->_get_plan_by_id( $available_license->plan_id ) : |
| 258 | 254 | null; |
| 255 | + | |
| 256 | + $is_dev_mode = ( defined( 'WP_FS__DEV_MODE' ) && WP_FS__DEV_MODE ); | |
| 259 | 257 | ?> |
| 260 | 258 | <div class="wrap fs-section"> |
| 261 | 259 | <?php if ( ! $has_tabs && ! $fs->apply_filters( 'hide_account_tabs', false ) ) : ?> |
| 262 | 260 | <h2 class="nav-tab-wrapper"> |
| 263 | - <a href="<?php echo $fs->get_account_url() ?>" | |
| 261 | + <a href="<?php echo esc_url( $fs->get_account_url() ) ?>" | |
| 264 | 262 | class="nav-tab nav-tab-active"><?php fs_esc_html_echo_inline( 'Account', 'account', $slug ) ?></a> |
| 265 | 263 | <?php if ( $fs->has_addons() ) : ?> |
| 266 | - <a href="<?php echo $fs->_get_admin_page_url( 'addons' ) ?>" | |
| 264 | + <a href="<?php echo esc_url( $fs->_get_admin_page_url( 'addons' ) ) ?>" | |
| 267 | 265 | class="nav-tab"><?php echo esc_html( $addons_text ) ?></a> |
| 268 | 266 | <?php endif ?> |
| 269 | 267 | <?php if ( $show_upgrade ) : ?> |
| 270 | - <a href="<?php echo $fs->get_upgrade_url() ?>" class="nav-tab"><?php echo esc_html( $upgrade_text ) ?></a> | |
| 268 | + <a href="<?php echo esc_url( $fs->get_upgrade_url() ) ?>" class="nav-tab"><?php echo esc_html( $upgrade_text ) ?></a> | |
| 271 | 269 | <?php if ( $fs->apply_filters( 'show_trial', true ) && ! $fs->is_trial_utilized() && $fs->has_trial_plan() ) : ?> |
| 272 | - <a href="<?php echo $fs->get_trial_url() ?>" class="nav-tab"><?php fs_esc_html_echo_inline( 'Free Trial', 'free-trial', $slug ) ?></a> | |
| 270 | + <a href="<?php echo esc_url( $fs->get_trial_url() ) ?>" class="nav-tab"><?php fs_esc_html_echo_inline( 'Free Trial', 'free-trial', $slug ) ?></a> | |
| 273 | 271 | <?php endif ?> |
| 274 | 272 | <?php endif ?> |
| 275 | 273 | </h2> |
| 276 | 274 | <?php endif ?> |
| @@ -314,9 +312,9 @@ | ||
| 314 | 312 | <?php endif ?> |
| 315 | 313 | <?php if ( $is_paying ) : ?> |
| 316 | 314 | <?php if ( ! fs_is_network_admin() ) : ?> |
| 317 | 315 | <li> |
| 318 | - <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST"> | |
| 316 | + <form action="<?php echo esc_url( $fs->_get_admin_page_url( 'account' ) ) ?>" method="POST"> | |
| 319 | 317 | <input type="hidden" name="fs_action" value="deactivate_license"> |
| 320 | 318 | <?php wp_nonce_field( 'deactivate_license' ) ?> |
| 321 | 319 | <a href="#" class="fs-deactivate-license"><i |
| 322 | 320 | class="dashicons dashicons-admin-network"></i> <?php fs_echo_inline( 'Deactivate License', 'deactivate-license', $slug ) ?> |
| @@ -328,15 +326,15 @@ | ||
| 328 | 326 | <?php if ( ! $license->is_lifetime() && |
| 329 | 327 | $is_active_subscription |
| 330 | 328 | ) : ?> |
| 331 | 329 | <li> |
| 332 | - <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST"> | |
| 330 | + <form action="<?php echo esc_url( $fs->_get_admin_page_url( 'account' ) ) ?>" method="POST"> | |
| 333 | 331 | <input type="hidden" name="fs_action" value="downgrade_account"> |
| 334 | 332 | <?php wp_nonce_field( 'downgrade_account' ) ?> |
| 335 | 333 | <a href="#" |
| 336 | 334 | onclick="if ( confirm('<?php echo esc_attr( sprintf( |
| 337 | 335 | $downgrade_x_confirm_text, |
| 338 | - ( $fs->is_only_premium() ? $cancelling_subscription_text : $downgrading_plan_text ), | |
| 336 | + ( $fs->is_only_premium() ? $cancelling_subscription_text : $downgrading_plan_text ), | |
| 339 | 337 | $plan->title, |
| 340 | 338 | human_time_diff( time(), strtotime( $license->expiration ) ) |
| 341 | 339 | ) ) ?> <?php if ( ! $license->is_block_features ) { |
| 342 | 340 | echo esc_attr( sprintf( $after_downgrade_non_blocking_text, $plan->title, $fs->get_module_label( true ) ) ); |
| @@ -348,9 +346,9 @@ | ||
| 348 | 346 | <li> • </li> |
| 349 | 347 | <?php endif ?> |
| 350 | 348 | <?php if ( $is_plan_change_supported ) : ?> |
| 351 | 349 | <li> |
| 352 | - <a href="<?php echo $fs->get_upgrade_url() ?>"><i | |
| 350 | + <a href="<?php echo esc_url( $fs->get_upgrade_url() ) ?>"><i | |
| 353 | 351 | class="dashicons dashicons-grid-view"></i> <?php echo esc_html( $change_plan_text ) ?></a> |
| 354 | 352 | </li> |
| 355 | 353 | <li> • </li> |
| 356 | 354 | <?php endif ?> |
| @@ -355,9 +353,9 @@ | ||
| 355 | 353 | <li> • </li> |
| 356 | 354 | <?php endif ?> |
| 357 | 355 | <?php elseif ( $is_paid_trial ) : ?> |
| 358 | 356 | <li> |
| 359 | - <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST"> | |
| 357 | + <form action="<?php echo esc_url( $fs->_get_admin_page_url( 'account' ) ) ?>" method="POST"> | |
| 360 | 358 | <input type="hidden" name="fs_action" value="cancel_trial"> |
| 361 | 359 | <?php wp_nonce_field( 'cancel_trial' ) ?> |
| 362 | 360 | <a href="#" class="fs-cancel-trial"><i |
| 363 | 361 | class="dashicons dashicons-download"></i> <?php echo esc_html( $cancel_trial_text ) ?></a> |
| @@ -366,10 +364,10 @@ | ||
| 366 | 364 | <li> • </li> |
| 367 | 365 | <?php endif ?> |
| 368 | 366 | <?php endif ?> |
| 369 | 367 | <li> |
| 370 | - <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST"> | |
| 371 | - <input type="hidden" name="fs_action" value="<?php echo $fs->get_unique_affix() ?>_sync_license"> | |
| 368 | + <form action="<?php echo esc_url( $fs->_get_admin_page_url( 'account' ) ) ?>" method="POST"> | |
| 369 | + <input type="hidden" name="fs_action" value="<?php echo esc_attr( $fs->get_unique_affix() ) ?>_sync_license"> | |
| 372 | 370 | <?php wp_nonce_field( $fs->get_unique_affix() . '_sync_license' ) ?> |
| 373 | 371 | <a href="#" onclick="this.parentNode.submit(); return false;"><i |
| 374 | 372 | class="dashicons dashicons-image-rotate"></i> <?php fs_esc_html_echo_x_inline( 'Sync', 'as synchronize', 'sync', $slug ) ?></a> |
| 375 | 373 | </form> |
| @@ -511,11 +509,11 @@ | ||
| 511 | 509 | // to show current plan. |
| 512 | 510 | continue; |
| 513 | 511 | } |
| 514 | 512 | ?> |
| 515 | - <tr class="fs-field-<?php echo $p['id'] ?><?php if ( $odd ) : ?> alternate<?php endif ?>"> | |
| 513 | + <tr class="fs-field-<?php echo esc_attr( $p['id'] ) ?><?php if ( $odd ) : ?> alternate<?php endif ?>"> | |
| 516 | 514 | <td> |
| 517 | - <nobr><?php echo $p['title'] ?><?php echo ( ! empty( $p['title'] ) ) ? ':' : '' ?></nobr> | |
| 515 | + <nobr><?php echo esc_html( $p['title'] ) ?><?php echo ( ! empty( $p['title'] ) ) ? ':' : '' ?></nobr> | |
| 518 | 516 | </td> |
| 519 | 517 | <td<?php if ( 'plan' === $p['id'] || 'bundle_plan' === $p['id'] ) { echo ' colspan="2"'; }?>> |
| 520 | 518 | <?php if ( in_array( $p['id'], array( 'license_key', 'site_secret_key' ) ) ) : ?> |
| 521 | 519 | <code><?php echo FS_Plugin_License::mask_secret_key_for_html( $p['value'] ) ?></code> |
| @@ -566,20 +564,20 @@ | ||
| 566 | 564 | 'class' => 'button-primary', |
| 567 | 565 | ); |
| 568 | 566 | fs_require_template( 'account/partials/activate-license-button.php', $view_params ); ?> |
| 569 | 567 | <?php else : ?> |
| 570 | - <form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" | |
| 568 | + <form action="<?php echo esc_url( $fs->_get_admin_page_url( 'account' ) ) ?>" | |
| 571 | 569 | method="POST" class="button-group"> |
| 572 | 570 | <?php if ( $show_upgrade && $is_premium ) : ?> |
| 573 | - <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> | |
| 571 | + <a class="button activate-license-trigger <?php echo esc_attr( $fs->get_unique_affix() ) ?>" href="#"><?php fs_esc_html_echo_inline( 'Activate License', 'activate-license', $slug ) ?></a> | |
| 574 | 572 | <?php endif ?> |
| 575 | 573 | <input type="submit" class="button" |
| 576 | 574 | value="<?php echo esc_attr( $sync_license_text ) ?>"> |
| 577 | 575 | <input type="hidden" name="fs_action" |
| 578 | - value="<?php echo $fs->get_unique_affix() ?>_sync_license"> | |
| 576 | + value="<?php echo esc_attr( $fs->get_unique_affix() ) ?>_sync_license"> | |
| 579 | 577 | <?php wp_nonce_field( $fs->get_unique_affix() . '_sync_license' ) ?> |
| 580 | 578 | <?php if ( $show_upgrade || $is_plan_change_supported ) : ?> |
| 581 | - <a href="<?php echo $fs->get_upgrade_url() ?>" | |
| 579 | + <a href="<?php echo esc_url( $fs->get_upgrade_url() ) ?>" | |
| 582 | 580 | class="button<?php |
| 583 | 581 | echo $show_upgrade ? |
| 584 | 582 | ' button-primary fs-upgrade' : |
| 585 | 583 | ' fs-change-plan'; ?> button-upgrade"><i |
| @@ -726,9 +724,9 @@ | ||
| 726 | 724 | ?> |
| 727 | 725 | <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> |
| 728 | 726 | <?php endif ?> |
| 729 | 727 | <?php endif ?> |
| 730 | - <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> | |
| 728 | + <input class="fs-search" type="text" placeholder="<?php fs_esc_attr_echo_inline( 'Search by address', 'search-by-address', $slug ) ?>..." autocomplete="off"><span class="dashicons dashicons-search"></span> | |
| 731 | 729 | </div> |
| 732 | 730 | <div class="inside"> |
| 733 | 731 | <div id="" class="fs-scrollable-table"> |
| 734 | 732 | <div class="fs-table-head"> |
| @@ -790,9 +788,9 @@ | ||
| 790 | 788 | <th><?php echo esc_html( $version_text ) ?></th> |
| 791 | 789 | <th><?php echo esc_html( $plan_text ) ?></th> |
| 792 | 790 | <th><?php fs_esc_html_echo_x_inline( 'License', 'as software license', 'license', $slug ) ?></th> |
| 793 | 791 | <th></th> |
| 794 | - <?php if ( defined( 'WP_FS__DEV_MODE' ) && WP_FS__DEV_MODE ) : ?> | |
| 792 | + <?php if ( $is_dev_mode ) : ?> | |
| 795 | 793 | <th></th> |
| 796 | 794 | <?php endif ?> |
| 797 | 795 | </tr> |
| 798 | 796 | </thead> |
| @@ -856,12 +854,22 @@ | ||
| 856 | 854 | $fs->_get_addon_info( $addon_id, $is_addon_installed ), |
| 857 | 855 | 'is_whitelabeled' => ( $is_whitelabeled && ! $is_data_debug_mode ) |
| 858 | 856 | ); |
| 859 | 857 | |
| 860 | - fs_require_template( | |
| 861 | - 'account/partials/addon.php', | |
| 862 | - $addon_view_params | |
| 863 | - ); | |
| 858 | + if ( ! empty($addon_view_params['addon_info'] ) ) { | |
| 859 | + fs_require_template( | |
| 860 | + 'account/partials/addon.php', | |
| 861 | + $addon_view_params | |
| 862 | + ); | |
| 863 | + } else { | |
| 864 | + // If we are here it means there is an activation of an unreleased add-on and yet the SDK is not in development mode. | |
| 865 | + echo '<tr>'; | |
| 866 | + echo '<td style="text-align: right;">' . esc_html( $addon_id ) . '</td>'; | |
| 867 | + echo '<td colspan="' . ( $is_dev_mode ? 6 : 5 ) . '" style="text-align: left;">'; | |
| 868 | + echo 'The add-on you have activated is no longer <a href="https://freemius.com/help/documentation/wordpress/selling-add-ons-extensions/#preparing-the-add-on-for-sale" rel="noreferrer noopener" target="_blank">listed</a> by the product owner, or the SDK is not running in <a href="https://freemius.com/help/documentation/wordpress-sdk/testing/" rel="noreferrer noopener" target="_blank">test mode</a>. Please <a href="' . esc_url( $fs->contact_url() ) . '">contact support</a> if you need further assistance.'; | |
| 869 | + echo '</td>'; | |
| 870 | + echo '</tr>'; | |
| 871 | + } | |
| 864 | 872 | |
| 865 | 873 | $odd = ! $odd; |
| 866 | 874 | } ?> |
| 867 | 875 | </tbody> |
| @@ -1121,13 +1129,4 @@ | ||
| 1121 | 1129 | <?php |
| 1122 | 1130 | if ( $has_tabs ) { |
| 1123 | 1131 | $fs->_add_tabs_after_content(); |
| 1124 | 1132 | } |
| 1125 | - | |
| 1126 | - $params = array( | |
| 1127 | - 'page' => 'account', | |
| 1128 | - 'module_id' => $fs->get_id(), | |
| 1129 | - 'module_type' => $fs->get_module_type(), | |
| 1130 | - 'module_slug' => $slug, | |
| 1131 | - 'module_version' => $fs->get_plugin_version(), | |
| 1132 | - ); | |
| 1133 | - fs_require_template( 'powered-by.php', $params ); | |