Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/content-.../inc/freemius/template...
File: debug.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* @package Freemius
[2] Fix | Delete
* @copyright Copyright (c) 2015, Freemius, Inc.
[3] Fix | Delete
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
[4] Fix | Delete
* @since 1.1.1
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[8] Fix | Delete
exit;
[9] Fix | Delete
}
[10] Fix | Delete
[11] Fix | Delete
global $fs_active_plugins;
[12] Fix | Delete
[13] Fix | Delete
$fs_options = FS_Options::instance( WP_FS__ACCOUNTS_OPTION_NAME, true );
[14] Fix | Delete
[15] Fix | Delete
$off_text = fs_text_x_inline( 'Off', 'as turned off' );
[16] Fix | Delete
$on_text = fs_text_x_inline( 'On', 'as turned on' );
[17] Fix | Delete
[18] Fix | Delete
$has_any_active_clone = false;
[19] Fix | Delete
[20] Fix | Delete
$is_multisite = is_multisite();
[21] Fix | Delete
?>
[22] Fix | Delete
<h1><?php echo fs_text_inline( 'Freemius Debug' ) . ' - ' . fs_text_inline( 'SDK' ) . ' v.' . $fs_active_plugins->newest->version ?></h1>
[23] Fix | Delete
<div>
[24] Fix | Delete
<!-- Debugging Switch -->
[25] Fix | Delete
<?php //$debug_mode = get_option( 'fs_debug_mode', null ) ?>
[26] Fix | Delete
<span class="fs-switch-label"><?php fs_esc_html_echo_x_inline( 'Debugging', 'as code debugging' ) ?></span>
[27] Fix | Delete
[28] Fix | Delete
<div class="fs-switch fs-round <?php echo WP_FS__DEBUG_SDK ? 'fs-on' : 'fs-off' ?>">
[29] Fix | Delete
<div class="fs-toggle"></div>
[30] Fix | Delete
</div>
[31] Fix | Delete
<script type="text/javascript">
[32] Fix | Delete
(function ($) {
[33] Fix | Delete
$(document).ready(function () {
[34] Fix | Delete
// Switch toggle
[35] Fix | Delete
$( '.fs-switch' ).click( function () {
[36] Fix | Delete
$( this )
[37] Fix | Delete
.toggleClass( 'fs-on' )
[38] Fix | Delete
.toggleClass( 'fs-off' );
[39] Fix | Delete
[40] Fix | Delete
$.post( <?php echo Freemius::ajax_url() ?>, {
[41] Fix | Delete
action: 'fs_toggle_debug_mode',
[42] Fix | Delete
// As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
[43] Fix | Delete
_wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_toggle_debug_mode' ) ); ?>,
[44] Fix | Delete
is_on : ($(this).hasClass( 'fs-on' ) ? 1 : 0)
[45] Fix | Delete
}, function ( response ) {
[46] Fix | Delete
if ( 1 == response ) {
[47] Fix | Delete
// Refresh page on success.
[48] Fix | Delete
location.reload();
[49] Fix | Delete
}
[50] Fix | Delete
});
[51] Fix | Delete
});
[52] Fix | Delete
});
[53] Fix | Delete
}(jQuery));
[54] Fix | Delete
</script>
[55] Fix | Delete
</div>
[56] Fix | Delete
<h2><?php fs_esc_html_echo_inline( 'Actions', 'actions' ) ?></h2>
[57] Fix | Delete
<table>
[58] Fix | Delete
<tbody>
[59] Fix | Delete
<tr>
[60] Fix | Delete
<td>
[61] Fix | Delete
<!-- Delete All Accounts -->
[62] Fix | Delete
<form action="" method="POST">
[63] Fix | Delete
<input type="hidden" name="fs_action" value="restart_freemius">
[64] Fix | Delete
<?php wp_nonce_field( 'restart_freemius' ) ?>
[65] Fix | Delete
<button class="button button-primary"
[66] Fix | Delete
onclick="if (confirm('<?php fs_esc_attr_echo_inline( 'Are you sure you want to delete all Freemius data?', 'delete-all-confirm' ) ?>')) this.parentNode.submit(); return false;"><?php fs_esc_html_echo_inline( 'Delete All Accounts' ) ?></button>
[67] Fix | Delete
</form>
[68] Fix | Delete
</td>
[69] Fix | Delete
<td>
[70] Fix | Delete
<!-- Clear API Cache -->
[71] Fix | Delete
<form action="" method="POST">
[72] Fix | Delete
<input type="hidden" name="fs_clear_api_cache" value="true">
[73] Fix | Delete
<button class="button button-primary"><?php fs_esc_html_echo_inline( 'Clear API Cache' ) ?></button>
[74] Fix | Delete
</form>
[75] Fix | Delete
</td>
[76] Fix | Delete
<td>
[77] Fix | Delete
<!-- Clear Updates Transients -->
[78] Fix | Delete
<form action="" method="POST">
[79] Fix | Delete
<input type="hidden" name="fs_action" value="clear_updates_data">
[80] Fix | Delete
<?php wp_nonce_field( 'clear_updates_data' ) ?>
[81] Fix | Delete
<button class="button"><?php fs_esc_html_echo_inline( 'Clear Updates Transients' ) ?></button>
[82] Fix | Delete
</form>
[83] Fix | Delete
</td>
[84] Fix | Delete
<?php if ( Freemius::is_deactivation_snoozed() ) : ?>
[85] Fix | Delete
<td>
[86] Fix | Delete
<!-- Reset Deactivation Snoozing -->
[87] Fix | Delete
<form action="" method="POST">
[88] Fix | Delete
<input type="hidden" name="fs_action" value="reset_deactivation_snoozing">
[89] Fix | Delete
<?php wp_nonce_field( 'reset_deactivation_snoozing' ) ?>
[90] Fix | Delete
<button class="button"><?php fs_esc_html_echo_inline( 'Reset Deactivation Snoozing' ) ?> (Expires in <?php echo ( Freemius::deactivation_snooze_expires_at() - time() ) ?> sec)</button>
[91] Fix | Delete
</form>
[92] Fix | Delete
</td>
[93] Fix | Delete
<?php endif ?>
[94] Fix | Delete
<td>
[95] Fix | Delete
<!-- Sync Data with Server -->
[96] Fix | Delete
<form action="" method="POST">
[97] Fix | Delete
<input type="hidden" name="background_sync" value="true">
[98] Fix | Delete
<button class="button button-primary"><?php fs_esc_html_echo_inline( 'Sync Data From Server' ) ?></button>
[99] Fix | Delete
</form>
[100] Fix | Delete
</td>
[101] Fix | Delete
<?php if ( fs_is_network_admin() && true !== $fs_options->get_option( 'ms_migration_complete', false, true ) ) : ?>
[102] Fix | Delete
<td>
[103] Fix | Delete
<!-- Migrate Options to Network -->
[104] Fix | Delete
<form action="" method="POST">
[105] Fix | Delete
<input type="hidden" name="fs_action" value="migrate_options_to_network">
[106] Fix | Delete
<?php wp_nonce_field( 'migrate_options_to_network' ) ?>
[107] Fix | Delete
<button class="button button-primary"><?php fs_esc_html_echo_inline( 'Migrate Options to Network' ) ?></button>
[108] Fix | Delete
</form>
[109] Fix | Delete
</td>
[110] Fix | Delete
<?php endif ?>
[111] Fix | Delete
<td>
[112] Fix | Delete
<button id="fs_load_db_option" class="button"><?php fs_esc_html_echo_inline( 'Load DB Option' ) ?></button>
[113] Fix | Delete
</td>
[114] Fix | Delete
<td>
[115] Fix | Delete
<button id="fs_set_db_option" class="button"><?php fs_esc_html_echo_inline( 'Set DB Option' ) ?></button>
[116] Fix | Delete
</td>
[117] Fix | Delete
<td>
[118] Fix | Delete
<?php
[119] Fix | Delete
$fs_debug_page_url = 'admin.php?page=freemius&fs_action=allow_clone_resolution_notice';
[120] Fix | Delete
$fs_debug_page_url = fs_is_network_admin() ?
[121] Fix | Delete
network_admin_url( $fs_debug_page_url ) :
[122] Fix | Delete
admin_url( $fs_debug_page_url );
[123] Fix | Delete
?>
[124] Fix | Delete
<a href="<?php echo wp_nonce_url( $fs_debug_page_url, 'fs_allow_clone_resolution_notice' ) ?>" class="button button-primary">Resolve Clone(s)</a>
[125] Fix | Delete
</td>
[126] Fix | Delete
</tr>
[127] Fix | Delete
</tbody>
[128] Fix | Delete
</table>
[129] Fix | Delete
<script type="text/javascript">
[130] Fix | Delete
(function ($) {
[131] Fix | Delete
$('#fs_load_db_option').click(function () {
[132] Fix | Delete
var optionName = prompt('Please enter the option name:');
[133] Fix | Delete
[134] Fix | Delete
if (optionName) {
[135] Fix | Delete
$.post(<?php echo Freemius::ajax_url() ?>, {
[136] Fix | Delete
action : 'fs_get_db_option',
[137] Fix | Delete
// As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
[138] Fix | Delete
_wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_get_db_option' ) ); ?>,
[139] Fix | Delete
option_name: optionName
[140] Fix | Delete
}, function (response) {
[141] Fix | Delete
if (response.data.value)
[142] Fix | Delete
prompt('The option value is:', response.data.value);
[143] Fix | Delete
else
[144] Fix | Delete
alert('Oops... Option does not exist in the DB.');
[145] Fix | Delete
});
[146] Fix | Delete
}
[147] Fix | Delete
});
[148] Fix | Delete
[149] Fix | Delete
$('#fs_set_db_option').click(function () {
[150] Fix | Delete
var optionName = prompt('Please enter the option name:');
[151] Fix | Delete
[152] Fix | Delete
if (optionName) {
[153] Fix | Delete
var optionValue = prompt('Please enter the option value:');
[154] Fix | Delete
[155] Fix | Delete
if (optionValue) {
[156] Fix | Delete
$.post(<?php echo Freemius::ajax_url() ?>, {
[157] Fix | Delete
action : 'fs_set_db_option',
[158] Fix | Delete
// As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
[159] Fix | Delete
_wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_set_db_option' ) ); ?>,
[160] Fix | Delete
option_name : optionName,
[161] Fix | Delete
option_value: optionValue
[162] Fix | Delete
}, function () {
[163] Fix | Delete
alert('Option was successfully set.');
[164] Fix | Delete
});
[165] Fix | Delete
}
[166] Fix | Delete
}
[167] Fix | Delete
});
[168] Fix | Delete
})(jQuery);
[169] Fix | Delete
</script>
[170] Fix | Delete
<?php
[171] Fix | Delete
if ( ! defined( 'FS_API__ADDRESS' ) ) {
[172] Fix | Delete
define( 'FS_API__ADDRESS', '://api.freemius.com' );
[173] Fix | Delete
}
[174] Fix | Delete
if ( ! defined( 'FS_API__SANDBOX_ADDRESS' ) ) {
[175] Fix | Delete
define( 'FS_API__SANDBOX_ADDRESS', '://sandbox-api.freemius.com' );
[176] Fix | Delete
}
[177] Fix | Delete
[178] Fix | Delete
$defines = array(
[179] Fix | Delete
array(
[180] Fix | Delete
'key' => 'WP_FS__REMOTE_ADDR',
[181] Fix | Delete
'val' => WP_FS__REMOTE_ADDR,
[182] Fix | Delete
),
[183] Fix | Delete
array(
[184] Fix | Delete
'key' => 'WP_FS__ADDRESS_PRODUCTION',
[185] Fix | Delete
'val' => WP_FS__ADDRESS_PRODUCTION,
[186] Fix | Delete
),
[187] Fix | Delete
array(
[188] Fix | Delete
'key' => 'FS_API__ADDRESS',
[189] Fix | Delete
'val' => FS_API__ADDRESS,
[190] Fix | Delete
),
[191] Fix | Delete
array(
[192] Fix | Delete
'key' => 'FS_API__SANDBOX_ADDRESS',
[193] Fix | Delete
'val' => FS_API__SANDBOX_ADDRESS,
[194] Fix | Delete
),
[195] Fix | Delete
array(
[196] Fix | Delete
'key' => 'WP_FS__DIR',
[197] Fix | Delete
'val' => WP_FS__DIR,
[198] Fix | Delete
),
[199] Fix | Delete
array(
[200] Fix | Delete
'key' => 'wp_using_ext_object_cache()',
[201] Fix | Delete
'val' => wp_using_ext_object_cache() ? 'true' : 'false',
[202] Fix | Delete
),
[203] Fix | Delete
)
[204] Fix | Delete
?>
[205] Fix | Delete
<br>
[206] Fix | Delete
<table class="widefat">
[207] Fix | Delete
<thead>
[208] Fix | Delete
<tr>
[209] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Key', 'key' ) ?></th>
[210] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Value', 'value' ) ?></th>
[211] Fix | Delete
</tr>
[212] Fix | Delete
</thead>
[213] Fix | Delete
<tbody>
[214] Fix | Delete
<?php $alternate = false;
[215] Fix | Delete
foreach ( $defines as $p ) : ?>
[216] Fix | Delete
<tr<?php if ( $alternate ) {
[217] Fix | Delete
echo ' class="alternate"';
[218] Fix | Delete
} ?>>
[219] Fix | Delete
<td><?php echo $p['key'] ?></td>
[220] Fix | Delete
<td><?php echo $p['val'] ?></td>
[221] Fix | Delete
</tr>
[222] Fix | Delete
<?php $alternate = ! $alternate ?>
[223] Fix | Delete
<?php endforeach ?>
[224] Fix | Delete
</tbody>
[225] Fix | Delete
</table>
[226] Fix | Delete
<h2><?php fs_esc_html_echo_x_inline( 'SDK Versions', 'as software development kit versions', 'sdk-versions' ) ?></h2>
[227] Fix | Delete
<table id="fs_sdks" class="widefat">
[228] Fix | Delete
<thead>
[229] Fix | Delete
<tr>
[230] Fix | Delete
<th><?php fs_esc_html_echo_x_inline( 'Version', 'product version' ) ?></th>
[231] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'SDK Path' ) ?></th>
[232] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Module Path' ) ?></th>
[233] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Is Active' ) ?></th>
[234] Fix | Delete
</tr>
[235] Fix | Delete
</thead>
[236] Fix | Delete
<tbody>
[237] Fix | Delete
<?php foreach ( $fs_active_plugins->plugins as $sdk_path => $data ) : ?>
[238] Fix | Delete
<?php $is_active = ( WP_FS__SDK_VERSION == $data->version ) ?>
[239] Fix | Delete
<tr<?php if ( $is_active ) {
[240] Fix | Delete
echo ' style="background: #E6FFE6; font-weight: bold"';
[241] Fix | Delete
} ?>>
[242] Fix | Delete
<td><?php echo $data->version ?></td>
[243] Fix | Delete
<td><?php echo $sdk_path ?></td>
[244] Fix | Delete
<td><?php echo $data->plugin_path ?></td>
[245] Fix | Delete
<td><?php echo ( $is_active ) ? 'Active' : 'Inactive' ?></td>
[246] Fix | Delete
</tr>
[247] Fix | Delete
<?php endforeach ?>
[248] Fix | Delete
</tbody>
[249] Fix | Delete
</table>
[250] Fix | Delete
[251] Fix | Delete
<?php
[252] Fix | Delete
$module_types = array(
[253] Fix | Delete
WP_FS__MODULE_TYPE_PLUGIN,
[254] Fix | Delete
WP_FS__MODULE_TYPE_THEME
[255] Fix | Delete
);
[256] Fix | Delete
?>
[257] Fix | Delete
<?php $active_modules_by_id = array() ?>
[258] Fix | Delete
<?php foreach ( $module_types as $module_type ) : ?>
[259] Fix | Delete
<?php $modules = fs_get_entities( $fs_options->get_option( $module_type . 's' ), FS_Plugin::get_class_name() ) ?>
[260] Fix | Delete
<?php if ( is_array( $modules ) && count( $modules ) > 0 ) : ?>
[261] Fix | Delete
<h2><?php echo esc_html( ( WP_FS__MODULE_TYPE_PLUGIN == $module_type ) ? fs_text_inline( 'Plugins', 'plugins' ) : fs_text_inline( 'Themes', 'themes' ) ) ?></h2>
[262] Fix | Delete
<table id="fs_<?php echo $module_type ?>" class="widefat">
[263] Fix | Delete
<thead>
[264] Fix | Delete
<tr>
[265] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th>
[266] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Slug' ) ?></th>
[267] Fix | Delete
<th><?php fs_esc_html_echo_x_inline( 'Version', 'product version' ) ?></th>
[268] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Title' ) ?></th>
[269] Fix | Delete
<th><?php fs_esc_html_echo_x_inline( 'API', 'as application program interface' ) ?></th>
[270] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Freemius State' ) ?></th>
[271] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Module Path' ) ?></th>
[272] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Public Key' ) ?></th>
[273] Fix | Delete
<?php if ( $is_multisite ) : ?>
[274] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Network Blog' ) ?></th>
[275] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Network User' ) ?></th>
[276] Fix | Delete
<?php endif ?>
[277] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Actions' ) ?></th>
[278] Fix | Delete
</tr>
[279] Fix | Delete
</thead>
[280] Fix | Delete
<tbody>
[281] Fix | Delete
<?php foreach ( $modules as $slug => $data ) : ?>
[282] Fix | Delete
<?php
[283] Fix | Delete
if ( WP_FS__MODULE_TYPE_THEME !== $module_type ) {
[284] Fix | Delete
$is_active = is_plugin_active( $data->file );
[285] Fix | Delete
} else {
[286] Fix | Delete
$current_theme = wp_get_theme();
[287] Fix | Delete
$is_active = ( $current_theme->stylesheet === $data->file );
[288] Fix | Delete
[289] Fix | Delete
if ( ! $is_active && is_child_theme() ) {
[290] Fix | Delete
$parent_theme = $current_theme->parent();
[291] Fix | Delete
[292] Fix | Delete
$is_active = ( ( $parent_theme instanceof WP_Theme ) && $parent_theme->stylesheet === $data->file );
[293] Fix | Delete
}
[294] Fix | Delete
}
[295] Fix | Delete
?>
[296] Fix | Delete
<?php
[297] Fix | Delete
$fs = null;
[298] Fix | Delete
if ( $is_active ) {
[299] Fix | Delete
$fs = freemius( $data->id );
[300] Fix | Delete
[301] Fix | Delete
$active_modules_by_id[ $data->id ] = true;
[302] Fix | Delete
}
[303] Fix | Delete
?>
[304] Fix | Delete
<tr<?php if ( $is_active ) {
[305] Fix | Delete
$has_api_connectivity = $fs->has_api_connectivity();
[306] Fix | Delete
[307] Fix | Delete
if ( true === $has_api_connectivity && $fs->is_on() ) {
[308] Fix | Delete
echo ' style="background: #E6FFE6; font-weight: bold"';
[309] Fix | Delete
} else {
[310] Fix | Delete
echo ' style="background: #ffd0d0; font-weight: bold"';
[311] Fix | Delete
}
[312] Fix | Delete
} ?>>
[313] Fix | Delete
<td><?php echo $data->id ?></td>
[314] Fix | Delete
<td><?php echo $slug ?></td>
[315] Fix | Delete
<td><?php echo $data->version ?></td>
[316] Fix | Delete
<td><?php echo $data->title ?></td>
[317] Fix | Delete
<td<?php if ( $is_active && true !== $has_api_connectivity ) {
[318] Fix | Delete
echo ' style="color: red; text-transform: uppercase;"';
[319] Fix | Delete
} ?>><?php if ( $is_active ) {
[320] Fix | Delete
echo esc_html( true === $has_api_connectivity ?
[321] Fix | Delete
fs_text_x_inline( 'Connected', 'as connection was successful' ) :
[322] Fix | Delete
( false === $has_api_connectivity ?
[323] Fix | Delete
fs_text_x_inline( 'Blocked', 'as connection blocked' ) :
[324] Fix | Delete
fs_text_x_inline( 'Unknown', 'API connectivity state is unknown' ) )
[325] Fix | Delete
);
[326] Fix | Delete
} ?></td>
[327] Fix | Delete
<td<?php if ( $is_active && ! $fs->is_on() ) {
[328] Fix | Delete
echo ' style="color: red; text-transform: uppercase;"';
[329] Fix | Delete
} ?>><?php if ( $is_active ) {
[330] Fix | Delete
echo esc_html( $fs->is_on() ?
[331] Fix | Delete
$on_text :
[332] Fix | Delete
$off_text
[333] Fix | Delete
);
[334] Fix | Delete
} ?></td>
[335] Fix | Delete
<td><?php echo $data->file ?></td>
[336] Fix | Delete
<td><?php echo $data->public_key ?></td>
[337] Fix | Delete
<?php if ( $is_multisite ) : ?>
[338] Fix | Delete
<?php
[339] Fix | Delete
$network_blog_id = null;
[340] Fix | Delete
$network_user = null;
[341] Fix | Delete
[342] Fix | Delete
if ( is_object( $fs ) ) {
[343] Fix | Delete
$network_blog_id = $fs->get_network_install_blog_id();
[344] Fix | Delete
$network_user = $fs->get_network_user();
[345] Fix | Delete
}
[346] Fix | Delete
?>
[347] Fix | Delete
<td><?php echo is_numeric( $network_blog_id ) ? $network_blog_id : '' ?></td>
[348] Fix | Delete
<td><?php if ( is_object( $network_user ) ) {
[349] Fix | Delete
echo $network_user->email;
[350] Fix | Delete
} ?></td>
[351] Fix | Delete
<?php endif ?>
[352] Fix | Delete
<td>
[353] Fix | Delete
<?php if ( $is_active ) : ?>
[354] Fix | Delete
<?php if ( $fs->has_trial_plan() ) : ?>
[355] Fix | Delete
<form action="" method="POST">
[356] Fix | Delete
<input type="hidden" name="fs_action" value="simulate_trial">
[357] Fix | Delete
<input type="hidden" name="module_id" value="<?php echo $fs->get_id() ?>">
[358] Fix | Delete
<?php wp_nonce_field( 'simulate_trial' ) ?>
[359] Fix | Delete
[360] Fix | Delete
<button type="submit" class="button button-primary simulate-trial"><?php fs_esc_html_echo_inline( 'Simulate Trial Promotion' ) ?></button>
[361] Fix | Delete
</form>
[362] Fix | Delete
<?php endif ?>
[363] Fix | Delete
<?php if ( $fs->is_registered() ) : ?>
[364] Fix | Delete
<a class="button" href="<?php echo $fs->get_account_url() ?>"><?php fs_esc_html_echo_inline( 'Account', 'account' ) ?></a>
[365] Fix | Delete
<?php endif ?>
[366] Fix | Delete
<?php if ( fs_is_network_admin() && ! $fs->is_network_upgrade_mode() ) : ?>
[367] Fix | Delete
<form action="" method="POST">
[368] Fix | Delete
<input type="hidden" name="fs_action" value="simulate_network_upgrade">
[369] Fix | Delete
<input type="hidden" name="module_id" value="<?php echo $fs->get_id() ?>">
[370] Fix | Delete
<?php wp_nonce_field( 'simulate_network_upgrade' ) ?>
[371] Fix | Delete
[372] Fix | Delete
<button type="submit" class="button button-small"><?php fs_esc_html_echo_inline( 'Simulate Network Upgrade' ) ?></button>
[373] Fix | Delete
</form>
[374] Fix | Delete
<?php endif ?>
[375] Fix | Delete
<?php endif ?>
[376] Fix | Delete
</td>
[377] Fix | Delete
</tr>
[378] Fix | Delete
<?php endforeach ?>
[379] Fix | Delete
</tbody>
[380] Fix | Delete
</table>
[381] Fix | Delete
<?php endif ?>
[382] Fix | Delete
<?php endforeach ?>
[383] Fix | Delete
<?php foreach ( $module_types as $module_type ) : ?>
[384] Fix | Delete
<?php
[385] Fix | Delete
/**
[386] Fix | Delete
* @var array $VARS
[387] Fix | Delete
* @var array[string]FS_Site|array[string]FS_Site[] $sites_map
[388] Fix | Delete
*/
[389] Fix | Delete
$sites_map = $VARS[ $module_type . '_sites' ];
[390] Fix | Delete
[391] Fix | Delete
$all_plans = false;
[392] Fix | Delete
?>
[393] Fix | Delete
<?php if ( is_array( $sites_map ) && count( $sites_map ) > 0 ) : ?>
[394] Fix | Delete
<h2><?php echo esc_html( sprintf(
[395] Fix | Delete
/* translators: %s: 'plugin' or 'theme' */
[396] Fix | Delete
fs_text_inline( '%s Installs', 'module-installs' ),
[397] Fix | Delete
( WP_FS__MODULE_TYPE_PLUGIN === $module_type ? fs_text_inline( 'Plugin', 'plugin' ) : fs_text_inline( 'Theme', 'theme' ) )
[398] Fix | Delete
) ) ?> / <?php fs_esc_html_echo_x_inline( 'Sites', 'like websites', 'sites' ) ?></h2>
[399] Fix | Delete
<table id="fs_<?php echo $module_type ?>_installs" class="widefat">
[400] Fix | Delete
<thead>
[401] Fix | Delete
<tr>
[402] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th>
[403] Fix | Delete
<?php if ( $is_multisite ) : ?>
[404] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Blog ID' ) ?></th>
[405] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Address' ) ?></th>
[406] Fix | Delete
<?php endif ?>
[407] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Slug' ) ?></th>
[408] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'User ID' ) ?></th>
[409] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'License ID' ) ?></th>
[410] Fix | Delete
<th><?php fs_esc_html_echo_x_inline( 'Plan', 'as product pricing plan', 'plan' ) ?></th>
[411] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Public Key' ) ?></th>
[412] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Secret Key' ) ?></th>
[413] Fix | Delete
<th><?php fs_esc_html_echo_inline( 'Actions' ) ?></th>
[414] Fix | Delete
</tr>
[415] Fix | Delete
</thead>
[416] Fix | Delete
<tbody>
[417] Fix | Delete
<?php $site_url = null ?>
[418] Fix | Delete
<?php foreach ( $sites_map as $slug => $sites ) : ?>
[419] Fix | Delete
<?php foreach ( $sites as $site ) : ?>
[420] Fix | Delete
<?php
[421] Fix | Delete
$blog_id = $is_multisite ?
[422] Fix | Delete
$site->blog_id :
[423] Fix | Delete
null;
[424] Fix | Delete
[425] Fix | Delete
if ( is_null( $site_url ) || $is_multisite ) {
[426] Fix | Delete
$site_url = Freemius::get_unfiltered_site_url(
[427] Fix | Delete
$blog_id,
[428] Fix | Delete
true,
[429] Fix | Delete
true
[430] Fix | Delete
);
[431] Fix | Delete
}
[432] Fix | Delete
[433] Fix | Delete
$is_active_clone = ( $site->is_clone( $site_url ) && isset( $active_modules_by_id[ $site->plugin_id ] ) );
[434] Fix | Delete
[435] Fix | Delete
if ( $is_active_clone ) {
[436] Fix | Delete
$has_any_active_clone = true;
[437] Fix | Delete
}
[438] Fix | Delete
?>
[439] Fix | Delete
<tr>
[440] Fix | Delete
<td>
[441] Fix | Delete
<?php echo $site->id ?>
[442] Fix | Delete
<?php if ( $is_active_clone ) : ?>
[443] Fix | Delete
<label class="fs-tag fs-warn">Clone</label>
[444] Fix | Delete
<?php endif ?>
[445] Fix | Delete
</td>
[446] Fix | Delete
<?php if ( $is_multisite ) : ?>
[447] Fix | Delete
<td><?php echo $blog_id ?></td>
[448] Fix | Delete
<td><?php echo fs_strip_url_protocol( $site->url ) ?></td>
[449] Fix | Delete
<?php endif ?>
[450] Fix | Delete
<td><?php echo $slug ?></td>
[451] Fix | Delete
<td><?php echo $site->user_id ?></td>
[452] Fix | Delete
<td><?php echo !empty($site->license_id) ? $site->license_id : '' ?></td>
[453] Fix | Delete
<td><?php
[454] Fix | Delete
$plan_name = '';
[455] Fix | Delete
if ( FS_Plugin_Plan::is_valid_id( $site->plan_id ) ) {
[456] Fix | Delete
if ( false === $all_plans ) {
[457] Fix | Delete
$option_name = 'plans';
[458] Fix | Delete
if ( WP_FS__MODULE_TYPE_PLUGIN !== $module_type ) {
[459] Fix | Delete
$option_name = $module_type . '_' . $option_name;
[460] Fix | Delete
}
[461] Fix | Delete
[462] Fix | Delete
$all_plans = fs_get_entities( $fs_options->get_option( $option_name, array() ), FS_Plugin_Plan::get_class_name() );
[463] Fix | Delete
}
[464] Fix | Delete
[465] Fix | Delete
foreach ( $all_plans[ $slug ] as $plan ) {
[466] Fix | Delete
$plan_id = Freemius::_decrypt( $plan->id );
[467] Fix | Delete
[468] Fix | Delete
if ( $site->plan_id == $plan_id ) {
[469] Fix | Delete
$plan_name = Freemius::_decrypt( $plan->name );
[470] Fix | Delete
break;
[471] Fix | Delete
}
[472] Fix | Delete
}
[473] Fix | Delete
}
[474] Fix | Delete
[475] Fix | Delete
echo $plan_name;
[476] Fix | Delete
?></td>
[477] Fix | Delete
<td><?php echo $site->public_key ?></td>
[478] Fix | Delete
<td><?php
[479] Fix | Delete
$plugin_storage = FS_Storage::instance( $module_type, $slug );
[480] Fix | Delete
[481] Fix | Delete
echo $plugin_storage->is_whitelabeled ?
[482] Fix | Delete
FS_Plugin_License::mask_secret_key_for_html( $site->secret_key ) :
[483] Fix | Delete
esc_html( $site->secret_key );
[484] Fix | Delete
?></td>
[485] Fix | Delete
<td>
[486] Fix | Delete
<form action="" method="POST">
[487] Fix | Delete
<input type="hidden" name="fs_action" value="delete_install">
[488] Fix | Delete
<?php wp_nonce_field( 'delete_install' ) ?>
[489] Fix | Delete
<input type="hidden" name="module_id" value="<?php echo $site->plugin_id ?>">
[490] Fix | Delete
<?php if ( $is_multisite ) : ?>
[491] Fix | Delete
<input type="hidden" name="blog_id" value="<?php echo $site->blog_id ?>">
[492] Fix | Delete
<?php endif ?>
[493] Fix | Delete
<input type="hidden" name="module_type" value="<?php echo $module_type ?>">
[494] Fix | Delete
<input type="hidden" name="slug" value="<?php echo $slug ?>">
[495] Fix | Delete
<button type="submit" class="button"><?php fs_esc_html_echo_x_inline( 'Delete', 'verb', 'delete' ) ?></button>
[496] Fix | Delete
</form>
[497] Fix | Delete
</td>
[498] Fix | Delete
</tr>
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function