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/popup-bu.../public/js
File: sgpbDetect.js
function SGPBDetect() {
[0] Fix | Delete
}
[1] Fix | Delete
[2] Fix | Delete
SGPBDetect.prototype.init = function () {
[3] Fix | Delete
this.pluginData = [];
[4] Fix | Delete
this.finishBtn = '<div class="sgpb-text-center"><button class="sgpb-btn sgpb-btn-more_extensions" id="sgpbFinishUpdatingProcess">Finish the process</button></div>';
[5] Fix | Delete
this.blockScreen();
[6] Fix | Delete
this.modalDetectionStyles();
[7] Fix | Delete
this.checkIfModalClosed();
[8] Fix | Delete
};
[9] Fix | Delete
SGPBDetect.prototype.blockScreen = function () {
[10] Fix | Delete
var body = this.generateHtml(SGPB_JS_DETECTIONS);
[11] Fix | Delete
this.modalDetection(SGPB_JS_DETECTIONS.modalData.header, SGPB_JS_DETECTIONS.modalData.logo, body);
[12] Fix | Delete
this.updateActions();
[13] Fix | Delete
};
[14] Fix | Delete
SGPBDetect.prototype.generateHtml = function (dataToGenerate) {
[15] Fix | Delete
let html = '';
[16] Fix | Delete
if (dataToGenerate.autoUpdate.length) {
[17] Fix | Delete
html = '<ul class="sgpb-plugins-list sgpb-plugins-list-auto-update">';
[18] Fix | Delete
for (let i = 0; i < dataToGenerate.autoUpdate.length; i++) {
[19] Fix | Delete
html += `<li class="sgpb-update-plugin sgpb-update-plugin-progress updateMyPlugin"
[20] Fix | Delete
data-name="${dataToGenerate.autoUpdate[i].plugin.name}"
[21] Fix | Delete
data-key="${dataToGenerate.autoUpdate[i].plugin.pluginKey}"
[22] Fix | Delete
data-slug="${dataToGenerate.autoUpdate[i].slug}">updating... ${dataToGenerate.autoUpdate[i].plugin.name}</li>`
[23] Fix | Delete
}
[24] Fix | Delete
html += '<input type="hidden" id="sgpbCanUpdateNextPlugin" /><input type="hidden" id="sgpbNextPluginIndex" value="0" /></ul>';
[25] Fix | Delete
}
[26] Fix | Delete
[27] Fix | Delete
if (dataToGenerate.manualUpdate.length) {
[28] Fix | Delete
html += dataToGenerate.modalData.manualMessage;
[29] Fix | Delete
html += '<ul class="sgpb-plugins-list"><li class="sgpb-text-center">';
[30] Fix | Delete
for (let i = 0; i < dataToGenerate.manualUpdate.length; i++) {
[31] Fix | Delete
html += `<a href="${dataToGenerate.manualUpdate[i].plugin.url}" target="_blank">${dataToGenerate.manualUpdate[i].plugin.name}</a>`;
[32] Fix | Delete
html += dataToGenerate.manualUpdate[i + 1] !== undefined ? ', ' : '';
[33] Fix | Delete
}
[34] Fix | Delete
html += '</li></ul>';
[35] Fix | Delete
html += dataToGenerate.modalData.footerMessage;
[36] Fix | Delete
}
[37] Fix | Delete
[38] Fix | Delete
return html;
[39] Fix | Delete
};
[40] Fix | Delete
[41] Fix | Delete
SGPBDetect.prototype.update = function (args) {
[42] Fix | Delete
var that = this;
[43] Fix | Delete
args = _.extend({
[44] Fix | Delete
success: that.updatePluginSuccess,
[45] Fix | Delete
error: that.updatePluginError,
[46] Fix | Delete
}, args);
[47] Fix | Delete
return wp.updates.ajax('update-plugin', args);
[48] Fix | Delete
};
[49] Fix | Delete
SGPBDetect.prototype.updatePluginSuccess = function (response) {
[50] Fix | Delete
jQuery("li[data-key='" + response.plugin + "']").removeClass('updating sgpb-update-plugin-progress');
[51] Fix | Delete
jQuery("li[data-key='" + response.plugin + "']").addClass('sgpb-update-plugin-success');
[52] Fix | Delete
jQuery("#sgpbCanUpdateNextPlugin").val(1);
[53] Fix | Delete
};
[54] Fix | Delete
SGPBDetect.prototype.updatePluginError = function (response) {
[55] Fix | Delete
jQuery("li[data-key='" + response.plugin + "']").removeClass('updating sgpb-update-plugin-progress');
[56] Fix | Delete
jQuery("li[data-key='" + response.plugin + "']").addClass('sgpb-update-plugin-failed');
[57] Fix | Delete
jQuery("#sgpbCanUpdateNextPlugin").val(0);
[58] Fix | Delete
};
[59] Fix | Delete
SGPBDetect.prototype.updateActions = function () {
[60] Fix | Delete
var that = this;
[61] Fix | Delete
jQuery('.updateMyPlugin').each(function () {
[62] Fix | Delete
that.pluginData.push({
[63] Fix | Delete
plugin: jQuery(this).data('key'),
[64] Fix | Delete
slug: jQuery(this).data('slug'),
[65] Fix | Delete
name: jQuery(this).data('name')
[66] Fix | Delete
});
[67] Fix | Delete
});
[68] Fix | Delete
this.updateRecursion();
[69] Fix | Delete
setInterval(function () {
[70] Fix | Delete
if (jQuery("#sgpbCanUpdateNextPlugin").val() === '1') {
[71] Fix | Delete
that.updateRecursion();
[72] Fix | Delete
}
[73] Fix | Delete
}, 1000);
[74] Fix | Delete
};
[75] Fix | Delete
SGPBDetect.prototype.updateRecursion = function () {
[76] Fix | Delete
jQuery("#sgpbCanUpdateNextPlugin").val(0);
[77] Fix | Delete
if (!this.pluginData[+jQuery("#sgpbNextPluginIndex").val()]) {
[78] Fix | Delete
jQuery('.sgpb-plugins-list-auto-update').empty();
[79] Fix | Delete
if (!SGPB_JS_DETECTIONS.manualUpdate.length) {
[80] Fix | Delete
jQuery('.sgpb-modal-detection .sgpb-modal-body').append(this.finishBtn);
[81] Fix | Delete
jQuery('#sgpbFinishUpdatingProcess').on('click', function () {
[82] Fix | Delete
window.location.reload();
[83] Fix | Delete
});
[84] Fix | Delete
}
[85] Fix | Delete
return;
[86] Fix | Delete
}
[87] Fix | Delete
this.singleItem = this.pluginData[+jQuery("#sgpbNextPluginIndex").val()];
[88] Fix | Delete
jQuery("li[data-slug='" + this.singleItem.slug + "']").addClass('updating');
[89] Fix | Delete
this.update({plugin: this.singleItem.plugin, slug: this.singleItem.slug});
[90] Fix | Delete
jQuery("#sgpbNextPluginIndex").val(+jQuery("#sgpbNextPluginIndex").val() + 1)
[91] Fix | Delete
};
[92] Fix | Delete
[93] Fix | Delete
SGPBDetect.prototype.modalDetectionStyles = function () {
[94] Fix | Delete
var css = '<style id="sgpb-modal-detection-styles">.sgpb-overflow-hidden{overflow: hidden!important;}.sgpb.sgpb-modal-detection {position: fixed;top: 0;bottom: 0;left: 0;right: 0;display: flex;justify-content: center;align-items: center;background: #00000082;z-index: 999;-webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);}';
[95] Fix | Delete
css += '.sgpb.sgpb-modal-detection .sgpb-modal-detection-main {max-width: calc(100vw - 42%);max-height: calc(100vh - 15%); overflow-x: auto; background: #FFFFFF 0 0 no-repeat padding-box;box-shadow: 0 3px 20px #00000029;border-radius: 12px;padding: 20px;position: relative;}';
[96] Fix | Delete
css += '.sgpb.sgpb-modal-detection .sgpb-modal-detection-header {font-size: 30px; text-align: center}';
[97] Fix | Delete
css += '.sgpb.sgpb-modal-detection .sgpb-modal-logo {width: 150px; margin: 15px auto; display: block}';
[98] Fix | Delete
css += '.sgpb.sgpb-modal-detection .sgpb-modal-body {font-size: 24px;}';
[99] Fix | Delete
css += '.sgpb.sgpb-modal-detection .sgpb-modal-body a, .sgpb.sgpb-modal-detection .sgpb-modal-body .sgpb-plugins-list .sgpb-update-plugin {font-weight: normal; font-size: 17px; color: #2873EB;}';
[100] Fix | Delete
css += '.sgpb.sgpb-modal-detection .sgpb-modal-body p{font-size: 20px;margin: 0;}';
[101] Fix | Delete
css += '.sgpb.sgpb-modal-detection .sgpb-plugins-list-auto-update {max-width: 73%; margin: 0 auto;}';
[102] Fix | Delete
css += '.sgpb.sgpb-modal-detection .sgpb-modal-body p.sgpb-modal-footer-message{font-size: 15px;}';
[103] Fix | Delete
css += '.sgpb-plugins-list {display: flex; flex-direction: column;} .sgpb-update-plugin { display: inline-flex;justify-content: space-between;color: #2873eb} .sgpb-update-plugin:after { content: "";font: normal 20px/1 dashicons;display: block;}.sgpb-update-plugin-success{color:#00ae5d}.sgpb-update-plugin-success:after { content: "\\f147";}.sgpb-update-plugin-failed{color:#c00}.sgpb-update-plugin-failed:after { content: "\\f534";}.sgpb-update-plugin-progress:after { content: "\\f463";}.sgpb-update-plugin-progress.updating:after{animation: sgpbRotation 2s infinite linear;}@keyframes sgpbRotation { 0% { transform: rotate(0deg); } 100% { transform: rotate(359deg);}}';
[104] Fix | Delete
css += '</style>';
[105] Fix | Delete
jQuery(css).appendTo(document.body);
[106] Fix | Delete
};
[107] Fix | Delete
[108] Fix | Delete
SGPBDetect.prototype.modalDetection = function (header, logo, body, url) {
[109] Fix | Delete
jQuery(document.body).addClass('sgpb-overflow-hidden');
[110] Fix | Delete
var modal = jQuery('<div/>', {
[111] Fix | Delete
"class": 'sgpb sgpb-modal-detection',
[112] Fix | Delete
html: jQuery('<div/>', {
[113] Fix | Delete
"class": 'sgpb-modal-detection-main',
[114] Fix | Delete
html:
[115] Fix | Delete
jQuery('<div/>', {
[116] Fix | Delete
"class": 'sgpb-modal-body',
[117] Fix | Delete
html: [
[118] Fix | Delete
jQuery(header),
[119] Fix | Delete
jQuery('<img />', {
[120] Fix | Delete
"class": 'sgpb-modal-logo',
[121] Fix | Delete
src: logo,
[122] Fix | Delete
alt: 'logo'
[123] Fix | Delete
}),
[124] Fix | Delete
body
[125] Fix | Delete
]
[126] Fix | Delete
})
[127] Fix | Delete
})
[128] Fix | Delete
});
[129] Fix | Delete
jQuery(modal).appendTo(document.body);
[130] Fix | Delete
};
[131] Fix | Delete
[132] Fix | Delete
SGPBDetect.prototype.checkIfModalClosed = function () {
[133] Fix | Delete
var that = this;
[134] Fix | Delete
setInterval(function () {
[135] Fix | Delete
if (!jQuery('.sgpb.sgpb-modal-detection').length || !jQuery('#sgpb-modal-detection-styles').length) {
[136] Fix | Delete
that.init();
[137] Fix | Delete
}
[138] Fix | Delete
}, 800)
[139] Fix | Delete
};
[140] Fix | Delete
[141] Fix | Delete
jQuery(document).ready(function () {
[142] Fix | Delete
sgpbDetect = new SGPBDetect();
[143] Fix | Delete
sgpbDetect.init();
[144] Fix | Delete
});
[145] Fix | Delete
[146] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function