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/clone/wp-conte.../plugins/content-.../inc/freemius/template.../forms
File: data-debug-mode.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 2.3.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
/**
[12] Fix | Delete
* @var array $VARS
[13] Fix | Delete
*
[14] Fix | Delete
* @var Freemius $fs
[15] Fix | Delete
*/
[16] Fix | Delete
$fs = freemius( $VARS['id'] );
[17] Fix | Delete
$slug = $fs->get_slug();
[18] Fix | Delete
$unique_affix = $fs->get_unique_affix();
[19] Fix | Delete
$last_license_user_id = $fs->get_last_license_user_id();
[20] Fix | Delete
$has_last_license_user_id = FS_User::is_valid_id( $last_license_user_id );
[21] Fix | Delete
[22] Fix | Delete
$message_above_input_field = ( ! $has_last_license_user_id ) ?
[23] Fix | Delete
fs_text_inline( 'Please enter the license key to enable the debug mode:', 'submit-developer-license-key-message', $slug ) :
[24] Fix | Delete
sprintf(
[25] Fix | Delete
fs_text_inline( 'To enter the debug mode, please enter the secret key of the license owner (UserID = %d), which you can find in your "My Profile" section of your User Dashboard:', 'submit-addon-developer-key-message', $slug ),
[26] Fix | Delete
$last_license_user_id
[27] Fix | Delete
);
[28] Fix | Delete
[29] Fix | Delete
$processing_text = ( fs_esc_js_inline( 'Processing', 'processing', $slug ) . '...' );
[30] Fix | Delete
$submit_button_text = fs_text_inline( 'Submit', 'submit', $slug );
[31] Fix | Delete
$debug_license_link_text = fs_esc_html_inline( 'Start Debug', 'start-debug-license', $slug );
[32] Fix | Delete
$license_or_user_key_text = ( ! $has_last_license_user_id ) ?
[33] Fix | Delete
fs_text_inline( 'License key', 'license-key' , $slug ) :
[34] Fix | Delete
fs_text_inline( 'User key', 'user-key' , $slug );
[35] Fix | Delete
$input_html = "<input class='fs-license-or-user-key' type='password' placeholder='{$license_or_user_key_text}' tabindex='1' />";
[36] Fix | Delete
[37] Fix | Delete
$modal_content_html = <<< HTML
[38] Fix | Delete
<div class="notice notice-error inline license-or-user-key-submission-message"><p></p></div>
[39] Fix | Delete
<p>{$message_above_input_field}</p>
[40] Fix | Delete
{$input_html}
[41] Fix | Delete
HTML;
[42] Fix | Delete
[43] Fix | Delete
fs_enqueue_local_style( 'fs_dialog_boxes', '/admin/dialog-boxes.css' );
[44] Fix | Delete
?>
[45] Fix | Delete
<script type="text/javascript">
[46] Fix | Delete
( function( $ ) {
[47] Fix | Delete
$( document ).ready( function() {
[48] Fix | Delete
var modalContentHtml = <?php echo json_encode( $modal_content_html ) ?>,
[49] Fix | Delete
modalHtml =
[50] Fix | Delete
'<div class="fs-modal fs-modal-developer-license-debug-mode fs-modal-developer-license-debug-mode-<?php echo $unique_affix ?>">'
[51] Fix | Delete
+ ' <div class="fs-modal-dialog">'
[52] Fix | Delete
+ ' <div class="fs-modal-body">'
[53] Fix | Delete
+ ' <div class="fs-modal-panel active">' + modalContentHtml + '</div>'
[54] Fix | Delete
+ ' </div>'
[55] Fix | Delete
+ ' <div class="fs-modal-footer">'
[56] Fix | Delete
+ ' <button class="button button-secondary button-close" tabindex="4"><?php fs_esc_js_echo_inline( 'Cancel', 'cancel', $slug ) ?></button>'
[57] Fix | Delete
+ ' <button class="button button-primary button-submit-license-or-user-key" tabindex="3"><?php echo esc_js( $submit_button_text ) ?></button>'
[58] Fix | Delete
+ ' </div>'
[59] Fix | Delete
+ ' </div>'
[60] Fix | Delete
+ '</div>',
[61] Fix | Delete
$modal = $( modalHtml ),
[62] Fix | Delete
$debugLicenseLink = $( '.debug-license-trigger' ),
[63] Fix | Delete
$submitKeyButton = $modal.find( '.button-submit-license-or-user-key' ),
[64] Fix | Delete
$licenseOrUserKeyInput = $modal.find( 'input.fs-license-or-user-key' ),
[65] Fix | Delete
$licenseOrUserKeySubmissionMessage = $modal.find( '.license-or-user-key-submission-message' ),
[66] Fix | Delete
isDebugMode = <?php echo $fs->is_data_debug_mode() ? 'true' : 'false' ?>;
[67] Fix | Delete
[68] Fix | Delete
$modal.appendTo( $( 'body' ) );
[69] Fix | Delete
[70] Fix | Delete
function registerEventHandlers() {
[71] Fix | Delete
$debugLicenseLink.click(function (evt) {
[72] Fix | Delete
evt.preventDefault();
[73] Fix | Delete
[74] Fix | Delete
if ( isDebugMode ) {
[75] Fix | Delete
setDeveloperLicenseDebugMode();
[76] Fix | Delete
return true;
[77] Fix | Delete
}
[78] Fix | Delete
[79] Fix | Delete
showModal( evt );
[80] Fix | Delete
});
[81] Fix | Delete
[82] Fix | Delete
$modal.on( 'input propertychange', 'input.fs-license-or-user-key', function () {
[83] Fix | Delete
var licenseOrUserKey = $( this ).val().trim();
[84] Fix | Delete
[85] Fix | Delete
/**
[86] Fix | Delete
* If license or user key is not empty, enable the submission button.
[87] Fix | Delete
*/
[88] Fix | Delete
if ( licenseOrUserKey.length > 0 ) {
[89] Fix | Delete
enableSubmitButton();
[90] Fix | Delete
}
[91] Fix | Delete
});
[92] Fix | Delete
[93] Fix | Delete
$modal.on( 'blur', 'input.fs-license-or-user-key', function () {
[94] Fix | Delete
var licenseOrUserKey = $( this ).val().trim();
[95] Fix | Delete
[96] Fix | Delete
/**
[97] Fix | Delete
* If license or user key is empty, disable the submission button.
[98] Fix | Delete
*/
[99] Fix | Delete
if ( 0 === licenseOrUserKey.length ) {
[100] Fix | Delete
disableSubmitButton();
[101] Fix | Delete
}
[102] Fix | Delete
});
[103] Fix | Delete
[104] Fix | Delete
$modal.on( 'click', '.button-submit-license-or-user-key', function ( evt ) {
[105] Fix | Delete
evt.preventDefault();
[106] Fix | Delete
[107] Fix | Delete
if ( $( this ).hasClass( 'disabled' ) ) {
[108] Fix | Delete
return;
[109] Fix | Delete
}
[110] Fix | Delete
[111] Fix | Delete
var licenseOrUserKey = $licenseOrUserKeyInput.val().trim();
[112] Fix | Delete
[113] Fix | Delete
disableSubmitButton();
[114] Fix | Delete
[115] Fix | Delete
if ( 0 === licenseOrUserKey.length ) {
[116] Fix | Delete
return;
[117] Fix | Delete
}
[118] Fix | Delete
[119] Fix | Delete
setDeveloperLicenseDebugMode( licenseOrUserKey );
[120] Fix | Delete
});
[121] Fix | Delete
[122] Fix | Delete
// If the user has clicked outside the window, close the modal.
[123] Fix | Delete
$modal.on( 'click', '.fs-close, .button-secondary', function () {
[124] Fix | Delete
closeModal();
[125] Fix | Delete
return false;
[126] Fix | Delete
} );
[127] Fix | Delete
}
[128] Fix | Delete
[129] Fix | Delete
registerEventHandlers();
[130] Fix | Delete
[131] Fix | Delete
function setDeveloperLicenseDebugMode( licenseOrUserKey ) {
[132] Fix | Delete
var data = {
[133] Fix | Delete
action : '<?php echo $fs->get_ajax_action( 'set_data_debug_mode' ) ?>',
[134] Fix | Delete
security : '<?php echo $fs->get_ajax_security( 'set_data_debug_mode' ) ?>',
[135] Fix | Delete
license_or_user_key: licenseOrUserKey,
[136] Fix | Delete
is_debug_mode : isDebugMode,
[137] Fix | Delete
module_id : '<?php echo $fs->get_id() ?>'
[138] Fix | Delete
};
[139] Fix | Delete
[140] Fix | Delete
$.ajax( {
[141] Fix | Delete
url : <?php echo Freemius::ajax_url() ?>,
[142] Fix | Delete
method : 'POST',
[143] Fix | Delete
data : data,
[144] Fix | Delete
beforeSend: function () {
[145] Fix | Delete
$debugLicenseLink.find('span').text( '<?php echo $processing_text ?>' );
[146] Fix | Delete
$submitKeyButton.text( '<?php echo $processing_text ?>' );
[147] Fix | Delete
},
[148] Fix | Delete
success : function ( result ) {
[149] Fix | Delete
if ( result.success ) {
[150] Fix | Delete
closeModal();
[151] Fix | Delete
[152] Fix | Delete
// Reload the "Account" page so that the pricing/upgrade link will be properly hidden/shown.
[153] Fix | Delete
window.location.reload();
[154] Fix | Delete
} else {
[155] Fix | Delete
showError( result.error.message ? result.error.message : result.error );
[156] Fix | Delete
resetButtons();
[157] Fix | Delete
}
[158] Fix | Delete
},
[159] Fix | Delete
error : function () {
[160] Fix | Delete
showError( <?php echo json_encode( fs_text_inline( 'An unknown error has occurred.', 'unknown-error', $slug ) ) ?> );
[161] Fix | Delete
resetButtons();
[162] Fix | Delete
}
[163] Fix | Delete
});
[164] Fix | Delete
}
[165] Fix | Delete
[166] Fix | Delete
function showModal( evt ) {
[167] Fix | Delete
resetModal();
[168] Fix | Delete
[169] Fix | Delete
// Display the dialog box.
[170] Fix | Delete
$modal.addClass( 'active' );
[171] Fix | Delete
$( 'body' ).addClass( 'has-fs-modal' );
[172] Fix | Delete
[173] Fix | Delete
$licenseOrUserKeyInput.val( '' );
[174] Fix | Delete
$licenseOrUserKeyInput.focus();
[175] Fix | Delete
}
[176] Fix | Delete
[177] Fix | Delete
function closeModal() {
[178] Fix | Delete
$modal.removeClass( 'active' );
[179] Fix | Delete
$( 'body' ).removeClass( 'has-fs-modal' );
[180] Fix | Delete
}
[181] Fix | Delete
[182] Fix | Delete
function resetButtons() {
[183] Fix | Delete
enableSubmitButton();
[184] Fix | Delete
$submitKeyButton.text( <?php echo json_encode( $submit_button_text ) ?> );
[185] Fix | Delete
$debugLicenseLink.find('span').text( <?php echo json_encode( $debug_license_link_text ) ?> );
[186] Fix | Delete
}
[187] Fix | Delete
[188] Fix | Delete
function resetModal() {
[189] Fix | Delete
hideError();
[190] Fix | Delete
resetButtons();
[191] Fix | Delete
}
[192] Fix | Delete
[193] Fix | Delete
function enableSubmitButton() {
[194] Fix | Delete
$submitKeyButton.removeClass( 'disabled' );
[195] Fix | Delete
}
[196] Fix | Delete
[197] Fix | Delete
function disableSubmitButton() {
[198] Fix | Delete
$submitKeyButton.addClass( 'disabled' );
[199] Fix | Delete
}
[200] Fix | Delete
[201] Fix | Delete
function hideError() {
[202] Fix | Delete
$licenseOrUserKeySubmissionMessage.hide();
[203] Fix | Delete
}
[204] Fix | Delete
[205] Fix | Delete
function showError( msg ) {
[206] Fix | Delete
$licenseOrUserKeySubmissionMessage.find( ' > p' ).html( msg );
[207] Fix | Delete
$licenseOrUserKeySubmissionMessage.show();
[208] Fix | Delete
}
[209] Fix | Delete
} );
[210] Fix | Delete
} )( jQuery );
[211] Fix | Delete
</script>
[212] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function