: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
foreach ( $profile as $p ) : ?>
if ( 'plan' === $p['id'] && ! $has_paid_plan ) {
// If plugin don't have any paid plans, there's no reason
<tr class="fs-field-<?php echo esc_attr( $p['id'] ) ?><?php if ( $odd ) : ?> alternate<?php endif ?>">
<nobr><?php echo esc_attr( $p['title'] ) ?><?php echo ( ! empty( $p['title'] ) ) ? ':' : '' ?></nobr>
<td<?php if ( 'plan' === $p['id'] || 'bundle_plan' === $p['id'] ) { echo ' colspan="2"'; }?>>
<?php if ( in_array( $p['id'], array( 'license_key', 'site_secret_key' ) ) ) : ?>
<code><?php echo FS_Plugin_License::mask_secret_key_for_html( $p['value'] ) ?></code>
<?php if ( ! $is_whitelabeled ) : ?>
<input type="text" value="<?php echo htmlspecialchars( $p['value'] ) ?>" style="display: none"
<?php elseif ( 'beta_program' === $p['id'] ) : ?>
<input type="checkbox" class="fs-toggle-beta-mode" <?php checked( true, $p['value'] ) ?>/><span><?php
fs_esc_html_echo_inline( 'Join the Beta program', 'join-beta', $slug )
<code><?php echo htmlspecialchars( $p['value'] ) ?></code>
<?php if ( 'email' === $p['id'] && ! $user->is_verified() ) : ?>
<label class="fs-tag fs-warn"><?php fs_esc_html_echo_inline( 'not verified', 'not-verified', $slug ) ?></label>
<?php if ( 'plan' === $p['id'] ) : ?>
<?php if ( $fs->is_trial() ) : ?>
<label class="fs-tag fs-success"><?php echo esc_html( $trial_text ) ?></label>
<?php if ( is_object( $license ) && ! $license->is_lifetime() ) : ?>
<?php if ( ! $is_active_subscription && ! $is_active_bundle_subscription && ! $license->is_first_payment_pending() ) : ?>
<?php $is_license_expired = $license->is_expired() ?>
<?php $expired_ago_text = ( fs_text_inline( 'Expired', 'expired', $slug ) . ' ' . fs_text_x_inline( '%s ago', 'x-ago', $slug ) ) ?>
class="fs-tag <?php echo $is_license_expired ? 'fs-error' : 'fs-warn' ?>"><?php
echo esc_html( sprintf( $is_license_expired ? $expired_ago_text : $expires_in_text, human_time_diff( time(), strtotime( $license->expiration ) ) ) )
<?php elseif ( $is_active_subscription && ! $subscription->is_first_payment_pending() ) : ?>
<label class="fs-tag fs-success"><?php echo esc_html( sprintf( $renews_in_text, human_time_diff( time(), strtotime( $subscription->next_payment ) ) ) ) ?></label>
<?php elseif ( $fs->is_trial() ) : ?>
<label class="fs-tag fs-warn"><?php echo esc_html( sprintf( $expires_in_text, human_time_diff( time(), strtotime( $site->trial_ends ) ) ) ) ?></label>
<?php if ( ! $is_whitelabeled ) : ?>
<div class="button-group">
<?php if ( is_object( $available_license ) ) : ?>
'license' => $available_license,
'plan' => $available_license_paid_plan,
'is_localhost' => $site->is_localhost(),
'install_id' => $site->id,
'class' => 'button-primary',
fs_require_template( 'account/partials/activate-license-button.php', $view_params ); ?>
<form action="<?php echo esc_url( $fs->_get_admin_page_url( 'account' ) ) ?>"
method="POST" class="button-group">
<?php if ( $show_upgrade && $is_premium ) : ?>
<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>
<input type="submit" class="button"
value="<?php echo esc_attr( $sync_license_text ) ?>">
<input type="hidden" name="fs_action"
value="<?php echo esc_attr( $fs->get_unique_affix() ) ?>_sync_license">
<?php wp_nonce_field( $fs->get_unique_affix() . '_sync_license' ) ?>
<?php if ( $show_upgrade || $is_plan_change_supported ) : ?>
<a href="<?php echo esc_url( $fs->get_upgrade_url() ) ?>"
' button-primary fs-upgrade' :
' fs-change-plan'; ?> button-upgrade"><i
class="dashicons dashicons-cart"></i> <?php echo esc_html( $show_upgrade ? $upgrade_text : $change_plan_text ) ?></a>
<?php elseif ( 'bundle_plan' === $p['id'] ) : ?>
<?php if ( is_object( $bundle_subscription ) ) : ?>
<?php if ( $is_active_bundle_subscription && ! $is_bundle_first_payment_pending ) : ?>
<label class="fs-tag fs-success"><?php echo esc_html( sprintf( $renews_in_text, human_time_diff( time(), strtotime( $bundle_subscription->next_payment ) ) ) ) ?></label>
<?php elseif ( 'version' === $p['id'] && $has_paid_plan ) : ?>
<?php if ( $fs->has_premium_version() ) : ?>
<?php if ( $is_premium ) : ?>
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>
<?php elseif ( $fs->can_use_premium_code() ) : ?>
<label class="fs-tag fs-warn"><?php fs_esc_html_echo_inline( 'Free version', 'free-version', $slug ) ?></label>
<?php if ( 'plan' !== $p['id'] && 'bundle_plan' !== $p['id'] ) : ?>
<?php if ( 'email' === $p['id'] && ! $user->is_verified() ) : ?>
<form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST">
<input type="hidden" name="fs_action" value="verify_email">
<?php wp_nonce_field( 'verify_email' ) ?>
<input type="submit" class="button button-small"
value="<?php fs_esc_attr_echo_inline( 'Verify Email', 'verify-email', $slug ) ?>">
<?php if ( 'version' === $p['id'] ) : ?>
<?php if ( $fs->has_release_on_freemius() ) : ?>
<div class="button-group">
<?php if ( $is_paying || $fs->is_trial() ) : ?>
<?php if ( ! $fs->is_allowed_to_install() ) : ?>
<a target="_blank" rel="noopener" class="button button-primary"
href="<?php echo $fs->_get_latest_download_local_url() ?>"><?php
$download_version_text_suffix = ( is_object( $update ) ? ' [' . $update->version . ']' : '' );
$download_version_text = sprintf(
/* translators: %s: plan name (e.g. Download "Professional" Version) */
fs_text_inline( 'Download %s Version', 'download-x-version', $slug ),
( $fs->is_trial() ? $trial_plan->title : $plan->title )
$download_version_text_suffix;
$download_version_text_length = function_exists( 'mb_strlen' ) ?
mb_strlen( $download_version_text ) :
strlen( $download_version_text );
if ( $download_version_text_length > 31 ) {
* Try to limit the number of characters to 31 for now.
* @author Leo Fajardo (@leorw)
$download_version_text = fs_text_inline( 'Download Paid Version', 'download-paid-version', $slug ) . $download_version_text_suffix;
echo $download_version_text;
<?php elseif ( is_object( $update ) ) : ?>
$module_type = $fs->get_module_type();
<a class="button button-primary"
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>
elseif ( in_array( $p['id'], array( 'license_key', 'site_secret_key' ) ) ) : ?>
<?php if ( ! $is_whitelabeled && ( 'site_secret_key' === $p['id'] || ! $is_license_foreign ) ) : ?>
<button class="button button-small fs-toggle-visibility"><?php fs_esc_html_echo_x_inline( 'Show', 'verb', 'show', $slug ) ?></button>
<?php if ('license_key' === $p['id']) : ?>
<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>
elseif (/*in_array($p['id'], array('site_secret_key', 'site_id', 'site_public_key')) ||*/
( is_string( $user->secret_key ) && in_array( $p['id'], array(
<?php if ( 'email' !== $p['id'] || ! fs_is_network_admin() ) : ?>
<form action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST"
onsubmit="var val = prompt('<?php echo esc_attr( sprintf(
/* translators: %s: User's account property (e.g. name, email) */
fs_text_inline( 'What is your %s?', 'what-is-your-x', $slug ),
) ) ?>', '<?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;">
<input type="hidden" name="fs_action" value="update_<?php echo $p['id'] ?>">
<input type="hidden" name="fs_<?php echo $p['id'] ?>_<?php echo $fs->get_unique_affix() ?>"
<?php wp_nonce_field( 'update_' . $p['id'] ) ?>
<input type="submit" class="button button-small <?php if ( 'email' === $p['id'] ) echo 'button-edit-email-address' ?>"
value="<?php echo fs_esc_attr_x_inline( 'Edit', 'verb', 'edit', $slug ) ?>">
<?php elseif ( 'user_id' === $p['id'] && ! empty( $ids_of_installs_activated_with_foreign_licenses ) ) : ?>
<input id="fs_change_user" type="submit" class="button button-small"
value="<?php echo fs_esc_attr_inline( 'Change User', 'change-user', $slug ) ?>">
if ( 'version' === $p['id'] && $is_premium ) {
* If there's a row for the beta program, keep its background color
* the same as the version info row.
* @author Leo Fajardo (@leorw)
<?php if ( fs_is_network_admin() ) : ?>
<div id="fs_sites" class="postbox">
<h3><span class="dashicons dashicons-networking"></span> <?php fs_esc_html_echo_inline( 'Sites', 'sites', $slug ) ?></h3>
<div class="fs-header-actions">
<?php if ( ! $is_whitelabeled ) : ?>
<?php $has_license = is_object( $license ) ?>
<?php if ( $has_license || ( $show_upgrade && $is_premium ) ) : ?>
$activate_license_button_text = $has_license ?
fs_esc_html_inline( 'Change License', 'change-license', $slug ) :
fs_esc_html_inline( 'Activate License', 'activate-license', $slug );
<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>
<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>
<div id="" class="fs-scrollable-table">
<div class="fs-table-head">
<td><?php fs_esc_html_echo_inline('ID', 'id', $slug) ?></td>
<td><?php fs_esc_html_echo_inline('Address', 'address', $slug) ?></td>
<td><?php fs_esc_html_echo_inline('License', 'license', $slug) ?></td>
<td><?php fs_esc_html_echo_inline('Plan', 'plan', $slug) ?></td>
<div class="fs-table-body">
$current_blog_id = get_current_blog_id();
foreach ( $site_view_params as $view_params ) {
'account/partials/site.php',
* It's possible for the `Freemius::switch_to_blog()` method to be called within the `site.php` template and this changes the Freemius instance's context, so this check is for restoring the previous context based on the previously retrieved site.
* @author Leo Fajardo (@leorw)
$current_install = $fs->get_site();
( ! is_object( $current_install ) || $current_install->id != $site->id )
$fs->switch_to_blog( $current_blog_id, $site, true );
<?php if ( 0 < count( $addons_to_show ) ) : ?>
<!-- <div class="inside">-->
<table id="fs_addons" class="widefat">
<th><h3><?php echo esc_html( $addons_text ) ?></h3></th>
<th><?php fs_esc_html_echo_inline( 'ID', 'id', $slug ) ?></th>
<th><?php echo esc_html( $version_text ) ?></th>
<th><?php echo esc_html( $plan_text ) ?></th>
<th><?php fs_esc_html_echo_x_inline( 'License', 'as software license', 'license', $slug ) ?></th>
<?php if ( defined( 'WP_FS__DEV_MODE' ) && WP_FS__DEV_MODE ) : ?>
$installed_addons_ids_map = array_flip( $installed_addons_ids );
$addon_info_by_id = array();
$hide_all_addons_data = false;
if ( $fs->is_whitelabeled_by_flag() ) {
$hide_all_addons_data = true;
foreach ( $addons_to_show as $addon_id ) {
$is_addon_installed = isset( $installed_addons_ids_map[ $addon_id ] );
$addon_info = $fs->_get_addon_info( $addon_id, $is_addon_installed );
$is_addon_connected = $addon_info['is_connected'];
$fs_addon = ( $is_addon_connected && $is_addon_installed ) ?
$is_whitelabeled = is_object( $fs_addon ) ?
$fs_addon->is_whitelabeled( true ) :
$addon_info['is_whitelabeled'];
if ( ! $is_whitelabeled ) {
$hide_all_addons_data = false;
if ( $is_data_debug_mode ) {
$is_whitelabeled = false;
$addon_info_by_id[ $addon_id ] = $addon_info;
foreach ( $addons_to_show as $addon_id ) {
$is_addon_installed = isset( $installed_addons_ids_map[ $addon_id ] );
! file_exists( fs_normalize_path( WP_PLUGIN_DIR . '/' . $fs->get_addon_basename( $addon_id ) ) )
$addon_view_params = array(
'fs_blog_id' => $fs_blog_id,
'active_plugins_directories_map' => &$active_plugins_directories_map,
'is_addon_installed' => $is_addon_installed,
'addon_info' => isset( $addon_info_by_id[ $addon_id ] ) ?
$addon_info_by_id[ $addon_id ] :
$fs->_get_addon_info( $addon_id, $is_addon_installed ),
'is_whitelabeled' => ( $is_whitelabeled && ! $is_data_debug_mode )
'account/partials/addon.php',
<?php $fs->do_action( 'after_account_details' ) ?>
$view_params = array( 'id' => $VARS['id'], 'payments' => $payments );
fs_require_once_template( 'account/billing.php', $view_params );
fs_require_once_template( 'account/payments.php', $view_params );
$subscription_cancellation_dialog_box_template_params = $fs->_get_subscription_cancellation_dialog_box_template_params( true );
if ( ! empty( $subscription_cancellation_dialog_box_template_params ) ) {
fs_require_template( 'forms/subscription-cancellation.php', $subscription_cancellation_dialog_box_template_params );
<script type="text/javascript">
var setLoading = function ($this, label) {
$(document.body).css({'cursor': 'wait'});
$this.css({'cursor': 'wait'});
$this.attr('disabled', 'disabled');
$('.fs-toggle-visibility').click(function () {
$parent = $this.closest('tr'),
$input = $parent.find('input');
$parent.find('code').toggle();
if ($input.is(':visible')) {
$this.html('<?php fs_esc_js_echo_x_inline( 'Hide', 'verb', 'hide', $slug ) ?>');
$this.html( '<?php fs_esc_js_echo_x_inline( 'Show', 'verb', 'show', $slug ) ?>' );
$('.fs-toggle-tracking').click(function () {
($(this).data('is-disconnected') ?
'<?php fs_esc_js_echo_inline('Opting in', 'opting-in' ) ?>' :
'<?php fs_esc_js_echo_inline('Opting out', 'opting-out' ) ?>') +
$plugin_title = $fs->get_plugin_title();
$processing_text = fs_esc_js_inline( 'Processing', 'processing' );
$confirmation_message = sprintf(
sprintf( fs_esc_attr_inline( 'Get updates for bleeding edge Beta versions of %s.', 'get-beta-versions', $slug ), $plugin_title ),
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 )
$( '.fs-toggle-beta-mode' ).click( function () {
var $checkbox = $( this ),
isChecked = $checkbox.is( ':checked' );
if ( ! isChecked || confirm( '<?php echo $confirmation_message ?>' ) ) {
url : <?php echo Freemius::ajax_url() ?>,
action : '<?php echo $fs->get_ajax_action( 'set_beta_mode' ) ?>',
security : '<?php echo $fs->get_ajax_security( 'set_beta_mode' ) ?>',
module_id: <?php echo $fs->get_id() ?>
beforeSend: function () {
$checkbox.prop( 'disabled', true );
$checkbox.parent().find( 'span' ).text( '<?php echo $processing_text ?>' + '...' );
$checkbox.prop( 'disabled', false );
$checkbox.parent().find( 'span' ).text( '<?php fs_esc_js_echo_inline( 'Join the Beta Program', 'join-beta', $slug ) ?>' );
$('.fs-opt-in').click(function () {
setLoading($(this), '<?php fs_esc_js_echo_inline('Opting in', 'opting-in' ) ?>...');
$( '#fs_downgrade' ).submit(function( event ) {
setLoading( $( this ).find( '.button' ), '<?php fs_esc_js_echo_inline( 'Downgrading', 'downgrading' ) ?>...' );
$('.fs-activate-license').click(function () {
setLoading($(this), '<?php fs_esc_js_echo_inline('Activating', 'activating' ) ?>...');
var $deactivateLicenseOrCancelTrial = $( '.fs-deactivate-license, .fs-cancel-trial' ),
$subscriptionCancellationModal = $( '.fs-modal-subscription-cancellation-<?php echo $fs->get_id() ?>' );
if ( 0 !== $subscriptionCancellationModal.length ) {
$subscriptionCancellationModal.on( '<?php echo $fs->get_action_tag( 'subscription_cancellation_action' ) ?>', function( evt, cancelSubscription ) {
$deactivateLicenseOrCancelTrial,
( ! $deactivateLicenseOrCancelTrial.hasClass( 'fs-cancel-trial' ) ?
'<?php fs_esc_js_echo_inline( 'Deactivating', 'deactivating', $slug ) ?>' :
'<?php echo esc_html( sprintf( fs_text_inline( 'Cancelling %s', 'cancelling-x', $slug ), fs_text_inline( 'trial', 'trial', $slug ) ) ) ?>' ) + '...'