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: auto-installation.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.2.1.5
[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
/**
[12] Fix | Delete
* @var array $VARS
[13] Fix | Delete
* @var Freemius $fs
[14] Fix | Delete
*/
[15] Fix | Delete
$slug = $VARS['slug'];
[16] Fix | Delete
$plugin_id = $VARS['target_module_id'];
[17] Fix | Delete
[18] Fix | Delete
$fs = freemius( $VARS['id'] );
[19] Fix | Delete
[20] Fix | Delete
$action = $fs->is_tracking_allowed() ?
[21] Fix | Delete
'stop_tracking' :
[22] Fix | Delete
'allow_tracking';
[23] Fix | Delete
[24] Fix | Delete
$title = $fs->get_plugin_title();
[25] Fix | Delete
[26] Fix | Delete
if ( $plugin_id != $fs->get_id() ) {
[27] Fix | Delete
$addon = $fs->get_addon( $plugin_id );
[28] Fix | Delete
[29] Fix | Delete
if ( is_object( $addon ) ) {
[30] Fix | Delete
$title = $addon->title . ' ' . fs_text_inline( 'Add-On', 'addon', $slug );
[31] Fix | Delete
}
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
$plugin_title = sprintf(
[35] Fix | Delete
'<strong>%s</strong>',
[36] Fix | Delete
esc_html( $title )
[37] Fix | Delete
);
[38] Fix | Delete
[39] Fix | Delete
$sec_countdown = 30;
[40] Fix | Delete
$countdown_html = sprintf(
[41] Fix | Delete
esc_js(
[42] Fix | Delete
/* translators: %s: Number of seconds */
[43] Fix | Delete
fs_text_inline( '%s sec', 'x-sec', $slug )
[44] Fix | Delete
),
[45] Fix | Delete
sprintf( '<span class="fs-countdown">%s</span>', $sec_countdown )
[46] Fix | Delete
);
[47] Fix | Delete
[48] Fix | Delete
fs_enqueue_local_style( 'fs_dialog_boxes', '/admin/dialog-boxes.css' );
[49] Fix | Delete
fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
[50] Fix | Delete
[51] Fix | Delete
$params = array();
[52] Fix | Delete
$loader_html = fs_get_template( 'ajax-loader.php', $params );
[53] Fix | Delete
[54] Fix | Delete
// Pass unique auto installation URL if WP_Filesystem is needed.
[55] Fix | Delete
$install_url = $fs->_get_sync_license_url(
[56] Fix | Delete
$plugin_id,
[57] Fix | Delete
true,
[58] Fix | Delete
array( 'auto_install' => 'true' )
[59] Fix | Delete
);
[60] Fix | Delete
[61] Fix | Delete
[62] Fix | Delete
ob_start();
[63] Fix | Delete
[64] Fix | Delete
$method = ''; // Leave blank so WP_Filesystem can populate it as necessary.
[65] Fix | Delete
[66] Fix | Delete
$credentials = request_filesystem_credentials(
[67] Fix | Delete
esc_url_raw( $install_url ),
[68] Fix | Delete
$method,
[69] Fix | Delete
false,
[70] Fix | Delete
WP_PLUGIN_DIR,
[71] Fix | Delete
array()
[72] Fix | Delete
);
[73] Fix | Delete
[74] Fix | Delete
$credentials_form = ob_get_clean();
[75] Fix | Delete
[76] Fix | Delete
$require_credentials = ! empty( $credentials_form );
[77] Fix | Delete
?>
[78] Fix | Delete
<div class="fs-modal fs-modal-auto-install">
[79] Fix | Delete
<div class="fs-modal-dialog">
[80] Fix | Delete
<div class="fs-modal-header">
[81] Fix | Delete
<h4><?php echo esc_js( fs_text_inline( 'Automatic Installation', 'auto-installation', $slug ) ) ?></h4>
[82] Fix | Delete
</div>
[83] Fix | Delete
<div class="fs-modal-body">
[84] Fix | Delete
<div class="fs-notice-error" style="display: none"><p></p></div>
[85] Fix | Delete
<?php if ( $require_credentials ) : ?>
[86] Fix | Delete
<div id="request-filesystem-credentials-dialog">
[87] Fix | Delete
<?php echo $credentials_form ?>
[88] Fix | Delete
</div>
[89] Fix | Delete
<?php else : ?>
[90] Fix | Delete
<p class="fs-installation-notice"><?php echo sprintf(
[91] Fix | Delete
fs_esc_html_inline( 'An automated download and installation of %s (paid version) from %s will start in %s. If you would like to do it manually - click the cancellation button now.', 'installing-in-n', $slug ),
[92] Fix | Delete
$plugin_title,
[93] Fix | Delete
sprintf(
[94] Fix | Delete
'<a href="%s" target="_blank" rel="noopener">%s</a>',
[95] Fix | Delete
'https://freemius.com',
[96] Fix | Delete
'freemius.com'
[97] Fix | Delete
),
[98] Fix | Delete
$countdown_html
[99] Fix | Delete
) ?></p>
[100] Fix | Delete
<?php endif ?>
[101] Fix | Delete
<p class="fs-installing"
[102] Fix | Delete
style="display: none"><?php echo sprintf( fs_esc_html_inline( 'The installation process has started and may take a few minutes to complete. Please wait until it is done - do not refresh this page.', 'installing-module-x', $slug ), $plugin_title ) ?></p>
[103] Fix | Delete
</div>
[104] Fix | Delete
<div class="fs-modal-footer">
[105] Fix | Delete
<?php echo $loader_html ?>
[106] Fix | Delete
<button
[107] Fix | Delete
class="button button-secondary button-cancel"><?php fs_esc_html_echo_inline( 'Cancel Installation', 'cancel-installation', $slug ) ?><?php if ( ! $require_credentials ) : ?> (<?php echo $countdown_html ?>)<?php endif ?></button>
[108] Fix | Delete
<button
[109] Fix | Delete
class="button button-primary"><?php fs_esc_html_echo_inline( 'Install Now', 'install-now', $slug ) ?></button>
[110] Fix | Delete
</div>
[111] Fix | Delete
</div>
[112] Fix | Delete
</div>'
[113] Fix | Delete
[114] Fix | Delete
<script type="text/javascript">
[115] Fix | Delete
(function ($) {
[116] Fix | Delete
$(document).ready(function () {
[117] Fix | Delete
var $modal = $('.fs-modal-auto-install'),
[118] Fix | Delete
$body = $('body'),
[119] Fix | Delete
$countdown = $modal.find('.fs-countdown'),
[120] Fix | Delete
requireCredentials = <?php echo json_encode( $require_credentials ) ?>,
[121] Fix | Delete
$credentialsForm = $('#request-filesystem-credentials-dialog'),
[122] Fix | Delete
$errorNotice = $modal.find('.fs-notice-error'),
[123] Fix | Delete
installing = false;
[124] Fix | Delete
[125] Fix | Delete
$modal.appendTo($body);
[126] Fix | Delete
[127] Fix | Delete
var startAutoInstall = function () {
[128] Fix | Delete
if (installing)
[129] Fix | Delete
return;
[130] Fix | Delete
[131] Fix | Delete
installing = true;
[132] Fix | Delete
[133] Fix | Delete
// Start auto-install.
[134] Fix | Delete
$modal.addClass('fs-warn');
[135] Fix | Delete
if (requireCredentials) {
[136] Fix | Delete
$credentialsForm.hide();
[137] Fix | Delete
} else {
[138] Fix | Delete
$modal.find('.fs-installation-notice').hide();
[139] Fix | Delete
}
[140] Fix | Delete
[141] Fix | Delete
$errorNotice.hide();
[142] Fix | Delete
$modal.find('.fs-installing').show();
[143] Fix | Delete
$modal.find('button').hide();
[144] Fix | Delete
$modal.find('.fs-ajax-loader').show();
[145] Fix | Delete
[146] Fix | Delete
var data = {
[147] Fix | Delete
action : '<?php echo $fs->get_ajax_action( 'install_premium_version' ) ?>',
[148] Fix | Delete
security : '<?php echo $fs->get_ajax_security( 'install_premium_version' ) ?>',
[149] Fix | Delete
slug : '<?php echo $slug ?>',
[150] Fix | Delete
module_id : '<?php echo $fs->get_id() ?>',
[151] Fix | Delete
target_module_id: '<?php echo $plugin_id ?>'
[152] Fix | Delete
};
[153] Fix | Delete
[154] Fix | Delete
if (requireCredentials) {
[155] Fix | Delete
// Add filesystem credentials.
[156] Fix | Delete
data.hostname = $('#hostname').val();
[157] Fix | Delete
data.username = $('#username').val();
[158] Fix | Delete
data.password = $('#password').val();
[159] Fix | Delete
data.connection_type = $('input[name="connection_type"]:checked').val();
[160] Fix | Delete
data.public_key = $('#public_key').val();
[161] Fix | Delete
data.private_key = $('#private_key').val();
[162] Fix | Delete
}
[163] Fix | Delete
[164] Fix | Delete
$.ajax({
[165] Fix | Delete
url : <?php echo Freemius::ajax_url() ?>,
[166] Fix | Delete
method : 'POST',
[167] Fix | Delete
data : data,
[168] Fix | Delete
success: function (resultObj) {
[169] Fix | Delete
var reloadAccount = false;
[170] Fix | Delete
[171] Fix | Delete
if (resultObj.success) {
[172] Fix | Delete
// Reload account page to show new data.
[173] Fix | Delete
reloadAccount = true;
[174] Fix | Delete
} else {
[175] Fix | Delete
switch (resultObj.error.code) {
[176] Fix | Delete
case 'invalid_module_id':
[177] Fix | Delete
case 'premium_installed':
[178] Fix | Delete
reloadAccount = true;
[179] Fix | Delete
break;
[180] Fix | Delete
case 'invalid_license':
[181] Fix | Delete
case 'premium_version_missing':
[182] Fix | Delete
case 'unable_to_connect_to_filesystem':
[183] Fix | Delete
default:
[184] Fix | Delete
$modal.removeClass('fs-warn');
[185] Fix | Delete
$modal.find('.fs-installing').hide();
[186] Fix | Delete
$modal.find('.fs-ajax-loader').hide();
[187] Fix | Delete
$modal.find('.button-cancel').html(<?php fs_json_encode_echo_inline( 'Cancel Installation', 'cancel-installation', $slug ) ?>);
[188] Fix | Delete
$modal.find('button').show();
[189] Fix | Delete
[190] Fix | Delete
$errorNotice.find('p').text(resultObj.error.message);
[191] Fix | Delete
$errorNotice.addClass('notice notice-alt notice-error').show();
[192] Fix | Delete
if (requireCredentials) {
[193] Fix | Delete
$credentialsForm.show();
[194] Fix | Delete
}
[195] Fix | Delete
break;
[196] Fix | Delete
}
[197] Fix | Delete
}
[198] Fix | Delete
[199] Fix | Delete
if (reloadAccount) {
[200] Fix | Delete
window.location = '<?php echo $fs->get_account_url() ?>';
[201] Fix | Delete
}
[202] Fix | Delete
[203] Fix | Delete
installing = false;
[204] Fix | Delete
}
[205] Fix | Delete
});
[206] Fix | Delete
};
[207] Fix | Delete
[208] Fix | Delete
var clearCountdown = function () {
[209] Fix | Delete
clearInterval(countdownInterval);
[210] Fix | Delete
countdownInterval = null;
[211] Fix | Delete
};
[212] Fix | Delete
[213] Fix | Delete
var cancelAutoInstall = function () {
[214] Fix | Delete
$modal.fadeOut(function () {
[215] Fix | Delete
$modal.remove();
[216] Fix | Delete
$body.removeClass('has-fs-modal');
[217] Fix | Delete
});
[218] Fix | Delete
};
[219] Fix | Delete
[220] Fix | Delete
var countdown = <?php echo $sec_countdown ?>,
[221] Fix | Delete
countdownInterval = requireCredentials ? null : setInterval(function () {
[222] Fix | Delete
$countdown.html(--countdown);
[223] Fix | Delete
if (0 == countdown) {
[224] Fix | Delete
clearCountdown();
[225] Fix | Delete
startAutoInstall();
[226] Fix | Delete
}
[227] Fix | Delete
}, 1000);
[228] Fix | Delete
[229] Fix | Delete
$modal.addClass('active');
[230] Fix | Delete
$body.addClass('has-fs-modal');
[231] Fix | Delete
[232] Fix | Delete
$modal.find('.button-primary').click(function () {
[233] Fix | Delete
clearCountdown();
[234] Fix | Delete
startAutoInstall();
[235] Fix | Delete
});
[236] Fix | Delete
[237] Fix | Delete
$modal.find('.button-cancel').click(function () {
[238] Fix | Delete
clearCountdown();
[239] Fix | Delete
cancelAutoInstall();
[240] Fix | Delete
});
[241] Fix | Delete
[242] Fix | Delete
if (requireCredentials) {
[243] Fix | Delete
[244] Fix | Delete
}
[245] Fix | Delete
});
[246] Fix | Delete
})(jQuery);
[247] Fix | Delete
</script>
[248] Fix | Delete
[249] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function