: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
$addons = $VARS['addons'];
<?php foreach ( $addons as $plugin_id => $plugin_addons ) : ?>
<h2><?php echo esc_html( sprintf( fs_text_inline( 'Add Ons of module %s', 'addons-of-x' ), $plugin_id ) ) ?></h2>
<table id="fs_addons" class="widefat">
<th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th>
<th><?php fs_esc_html_echo_inline( 'Title' ) ?></th>
<th><?php fs_esc_html_echo_inline( 'Slug' ) ?></th>
<th><?php fs_esc_html_echo_x_inline( 'Version', 'product version' ) ?></th>
<th><?php fs_esc_html_echo_inline( 'Public Key' ) ?></th>
<th><?php fs_esc_html_echo_inline( 'Secret Key' ) ?></th>
* @var FS_Plugin[] $plugin_addons
foreach ( $plugin_addons as $addon ) : ?>
<td><?php echo $addon->id ?></td>
<td><?php echo $addon->title ?></td>
<td><?php echo $addon->slug ?></td>
<td><?php echo $addon->version ?></td>
<td><?php echo $addon->public_key ?></td>
<td><?php echo esc_html( $addon->secret_key ) ?></td>
$users_with_developer_license_by_id = array();
if ( is_array( $users ) && ! empty( $users ) ) {
foreach ( $users as $user ) {
$user_ids_map[ $user->id ] = true;
foreach ( $module_types as $module_type ) {
* @var FS_Plugin_License[] $licenses
$licenses = $VARS[ $module_type . '_licenses' ];
foreach ( $licenses as $license ) {
if ( $license->is_whitelabeled ) {
$users_with_developer_license_by_id[ $license->user_id ] = true;
<?php if ( is_array( $users ) && 0 < count( $users ) ) : ?>
<h2><?php fs_esc_html_echo_inline( 'Users' ) ?></h2>
<table id="fs_users" class="widefat">
<th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th>
<th><?php fs_esc_html_echo_inline( 'Name' ) ?></th>
<th><?php fs_esc_html_echo_inline( 'Email' ) ?></th>
<th><?php fs_esc_html_echo_inline( 'Verified' ) ?></th>
<th><?php fs_esc_html_echo_inline( 'Public Key' ) ?></th>
<th><?php fs_esc_html_echo_inline( 'Secret Key' ) ?></th>
<th><?php fs_esc_html_echo_inline( 'Actions' ) ?></th>
<?php foreach ( $users as $user_id => $user ) : ?>
<?php $has_developer_license = isset( $users_with_developer_license_by_id[ $user_id ] ) ?>
<td><?php echo $user->id ?></td>
<td><?php echo $has_developer_license ? '' : $user->get_name() ?></td>
<?php if ( ! $has_developer_license ) : ?>
<a href="mailto:<?php echo esc_attr( $user->email ) ?>"><?php echo $user->email ?></a>
<td><?php echo $has_developer_license ? '' : json_encode( $user->is_verified ) ?></td>
<td><?php echo $user->public_key ?></td>
<td><?php echo $has_developer_license ? FS_Plugin_License::mask_secret_key_for_html($user->secret_key) : esc_html( $user->secret_key ) ?></td>
<?php if ( ! $has_developer_license ) : ?>
<form action="" method="POST">
<input type="hidden" name="fs_action" value="delete_user">
<?php wp_nonce_field( 'delete_user' ) ?>
<input type="hidden" name="user_id" value="<?php echo $user->id ?>">
<button type="submit" class="button"><?php fs_esc_html_echo_x_inline( 'Delete', 'verb', 'delete' ) ?></button>
<?php foreach ( $module_types as $module_type ) : ?>
* @var FS_Plugin_License[] $licenses
$licenses = $VARS[ $module_type . '_licenses' ] ?>
<?php if ( is_array( $licenses ) && count( $licenses ) > 0 ) : ?>
<h2><?php echo esc_html( sprintf( fs_text_inline( '%s Licenses', 'module-licenses' ), ( WP_FS__MODULE_TYPE_PLUGIN === $module_type ? fs_text_inline( 'Plugin', 'plugin' ) : fs_text_inline( 'Theme', 'theme' ) ) ) ) ?></h2>
<table id="fs_<?php echo $module_type ?>_licenses" class="widefat">
<th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th>
<th><?php fs_esc_html_echo_inline( 'Plugin ID' ) ?></th>
<th><?php fs_esc_html_echo_inline( 'User ID' ) ?></th>
<th><?php fs_esc_html_echo_inline( 'Plan ID' ) ?></th>
<th><?php fs_esc_html_echo_inline( 'Quota' ) ?></th>
<th><?php fs_esc_html_echo_inline( 'Activated' ) ?></th>
<th><?php fs_esc_html_echo_inline( 'Blocking' ) ?></th>
<th><?php fs_esc_html_echo_inline( 'Type' ) ?></th>
<th><?php fs_esc_html_echo_inline( 'License Key' ) ?></th>
<th><?php fs_esc_html_echo_x_inline( 'Expiration', 'as expiration date' ) ?></th>
<?php foreach ( $licenses as $license ) : ?>
<td><?php echo $license->id ?></td>
<td><?php echo $license->plugin_id ?></td>
<td><?php echo $license->user_id ?></td>
<td><?php echo $license->plan_id ?></td>
<td><?php echo $license->is_unlimited() ? 'Unlimited' : ( $license->is_single_site() ? 'Single Site' : $license->quota ) ?></td>
<td><?php echo $license->activated ?></td>
<td><?php echo $license->is_block_features ? 'Blocking' : 'Flexible' ?></td>
<td><?php echo $license->is_whitelabeled ? 'Whitelabeled' : 'Normal' ?></td>
echo ( $license->is_whitelabeled || ! isset( $user_ids_map[ $license->user_id ] ) ) ?
$license->get_html_escaped_masked_secret_key() :
esc_html( $license->secret_key );
<td><?php echo $license->expiration ?></td>
<?php if ( FS_Logger::is_storage_logging_on() ) : ?>
<h2><?php fs_esc_html_echo_inline( 'Debug Log', 'debug-log' ) ?></h2>
<div id="fs_debug_filters">
<option value="" selected="selected"><?php fs_esc_html_echo_inline( 'All Types', 'all-types' ) ?></option>
<option value="warn_error">Warnings & Errors</option>
<option value="error">Errors</option>
<option value="warn">Warnings</option>
<option value="info">Info</option>
<select name="request_type">
<option value="" selected="selected"><?php fs_esc_html_echo_inline( 'All Requests', 'all-requests' ) ?></option>
<option value="call">Sync</option>
<option value="ajax">AJAX</option>
<option value="cron">WP Cron</option>
<input name="file" type="text" placeholder="<?php fs_esc_attr_echo_inline( 'File' ) ?>"/>
<input name="function" type="text" placeholder="<?php fs_esc_attr_echo_inline( 'Function' ) ?>"/>
<input name="process_id" type="text" placeholder="<?php fs_esc_attr_echo_inline( 'Process ID' ) ?>"/>
<input name="logger" type="text" placeholder="<?php fs_esc_attr_echo_inline( 'Logger' ) ?>"/>
<input name="message" type="text" placeholder="<?php fs_esc_attr_echo_inline( 'Message' ) ?>"/>
<div style="margin: 10px 0">
<button id="fs_filter" class="button" style="float: left"><i class="dashicons dashicons-filter"></i> <?php fs_esc_html_echo_inline( 'Filter', 'filter' ) ?>
<form action="" method="POST" style="float: left; margin-left: 10px;">
<input type="hidden" name="fs_action" value="download_logs">
<?php wp_nonce_field( 'download_logs' ) ?>
<div class="fs-filters"></div>
<button id="fs_download" class="button" type="submit"><i
class="dashicons dashicons-download"></i> <?php fs_esc_html_echo_inline( 'Download' ) ?></button>
<div style="clear: both"></div>
<div id="fs_log_book" style="height: 300px; overflow: auto;">
<th><?php fs_esc_html_echo_inline( 'Type' ) ?></th>
<th><?php fs_esc_html_echo_inline( 'ID', 'id' ) ?></th>
<th><?php fs_esc_html_echo_inline( 'Function' ) ?></th>
<th><?php fs_esc_html_echo_inline( 'Message' ) ?></th>
<th><?php fs_esc_html_echo_inline( 'File' ) ?></th>
<th><?php fs_esc_html_echo_inline( 'Timestamp' ) ?></th>
<tr style="display: none">
<td>{$log.log_order}.</td>
<td class="fs-col--type">{$log.type}</td>
<td class="fs-col--logger">{$log.logger}</td>
<td class="fs-col--function">{$log.function}</td>
<td class="fs-col--message">
<a href="#" onclick="jQuery(this).parent().find('div').toggle(); return false;">
<nobr>{$log.message_short}</nobr>
<div style="display: none;">{$log.message}</div>
<td class="fs-col--file">{$log.file}:{$log.line}</td>
<td class="fs-col--timestamp">{$log.created}</td>
<script type="text/javascript">
jQuery(document).ready(function ($) {
var filtersChanged = false,
prevFiltersSignature = null;
var getFilters = function () {
$('#fs_debug_filters').find('select, input').each(function (i, e) {
if ('hidden' === $element.attr('type'))
var val = $element.val();
var name = $(e).attr('name');
signature += name + '=' + val + '~';
if (signature != prevFiltersSignature) {
prevFiltersSignature = signature;
$('#fs_download').parent().submit(function () {
var filters = getFilters(),
if (filters.hasOwnProperty(f)) {
hiddenFields += '<input type="hidden" name="filters[' + f + ']" value="' + filters[f] + '" />';
$(this).find('.fs-filters').html(hiddenFields);
var loadLogs = function () {
var $tbody = $('#fs_log_book tbody'),
template = $tbody.find('tr:first-child').html(),
// Cleanup table for new filter (only keep template row).
$tbody.find('tr').each(function (i, e) {
$.post(<?php echo Freemius::ajax_url() ?>, {
action : 'fs_get_debug_log',
// As such we don't need to use `wp_json_encode` method but using it to follow wp.org guideline.
_wpnonce : <?php echo wp_json_encode( wp_create_nonce( 'fs_get_debug_log' ) ); ?>,
for (var i = 0; i < response.data.length; i++) {
var templateCopy = template;
response.data[i].message_short = (response.data[i].message.length > 32) ?
response.data[i].message.substr(0, 32) + '...' :
response.data[i].message;
for (var p in response.data[i]) {
if (response.data[i].hasOwnProperty(p)) {
templateCopy = templateCopy.replace('{$log.' + p + '}', response.data[i][p]);
$tbody.append('<tr' + (i % 2 ? ' class="alternate"' : '') + '>' + templateCopy + '</tr>');
$('#fs_filter').click(function () {