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/accelera.../includes
File: module-upgrade.js
[0] Fix | Delete
jQuery(document).ready(function($){
[1] Fix | Delete
[2] Fix | Delete
$('.ampforwp-activation-call-module-upgrade').click(function(e){
[3] Fix | Delete
if(pagenow == 'toplevel_page_amp_options' && $(this).hasClass('ampforwp-activation-call-module-upgrade')){// Check for current page
[4] Fix | Delete
var self = $(this);
[5] Fix | Delete
var nonce = self.attr('data-secure');
[6] Fix | Delete
self.addClass('updating-message');
[7] Fix | Delete
var currentId = self.attr('id');
[8] Fix | Delete
var activate = '';
[9] Fix | Delete
var adsforwp_is_active = "";
[10] Fix | Delete
var adsforwp_act_url = "";
[11] Fix | Delete
if(currentId=='ampforwp-pwa-activation-call'){
[12] Fix | Delete
activate = '&activate=pwa';
[13] Fix | Delete
}else if(currentId=='ampforwp-structure-data-activation-call'){
[14] Fix | Delete
activate = '&activate=structure_data';
[15] Fix | Delete
}else if(currentId=='ampforwp-adsforwp-activation-call'){
[16] Fix | Delete
activate = '&activate=adsforwp';
[17] Fix | Delete
adsforwp_is_active = $(".ampforwp-activation-url").attr('id');
[18] Fix | Delete
adsforwp_act_url = $(".ampforwp-activation-url").val();
[19] Fix | Delete
}else if(currentId=='ampforwp-wp-quads-activation-call'){
[20] Fix | Delete
activate = '&activate=wp_quads';
[21] Fix | Delete
}else if(currentId=='ampforwp-page-booster-activation-call'){
[22] Fix | Delete
activate = '&activate=cwvpsb';
[23] Fix | Delete
}
[24] Fix | Delete
self.text( wp.updates.l10n.installing );
[25] Fix | Delete
self.text( 'Installing...' );
[26] Fix | Delete
$.ajax({
[27] Fix | Delete
url: ajaxurl,
[28] Fix | Delete
type: 'post',
[29] Fix | Delete
data: 'action=ampforwp_enable_modules_upgread'+activate+'&verify_nonce='+nonce,
[30] Fix | Delete
dataType: 'json',
[31] Fix | Delete
success: function (response){
[32] Fix | Delete
if(response.status==200){
[33] Fix | Delete
//To installation
[34] Fix | Delete
if(currentId=='ampforwp-adsforwp-activation-call'){
[35] Fix | Delete
if(adsforwp_is_active=='not-exist'){
[36] Fix | Delete
wp.updates.installPlugin(
[37] Fix | Delete
{
[38] Fix | Delete
slug: response.slug,
[39] Fix | Delete
success: function(pluginresponse){
[40] Fix | Delete
//wp.updates.installPluginSuccess(pluginresponse);
[41] Fix | Delete
wpActivateModulesUpgrage(pluginresponse.activateUrl, self, response, nonce)
[42] Fix | Delete
}
[43] Fix | Delete
}
[44] Fix | Delete
);
[45] Fix | Delete
}else{
[46] Fix | Delete
wpActivateModulesUpgrage(adsforwp_act_url, self, response, nonce)
[47] Fix | Delete
}
[48] Fix | Delete
}else{
[49] Fix | Delete
wp.updates.installPlugin(
[50] Fix | Delete
{
[51] Fix | Delete
slug: response.slug,
[52] Fix | Delete
success: function(pluginresponse){
[53] Fix | Delete
//wp.updates.installPluginSuccess(pluginresponse);
[54] Fix | Delete
wpActivateModulesUpgrage(pluginresponse.activateUrl, self, response, nonce)
[55] Fix | Delete
}
[56] Fix | Delete
}
[57] Fix | Delete
);
[58] Fix | Delete
}
[59] Fix | Delete
}else{
[60] Fix | Delete
alert(response.message)
[61] Fix | Delete
}
[62] Fix | Delete
[63] Fix | Delete
}
[64] Fix | Delete
})//ajaxComplete(wpActivateModulesUpgrage(response.path, self, response));
[65] Fix | Delete
[66] Fix | Delete
}
[67] Fix | Delete
});
[68] Fix | Delete
[69] Fix | Delete
$('.ampforwp-activation-plugin').click(function(e){
[70] Fix | Delete
if(pagenow == 'toplevel_page_amp_options' && $(this).hasClass('ampforwp-activation-plugin')){// Check for current page
[71] Fix | Delete
var self = $(this);
[72] Fix | Delete
self.addClass('updating-message');
[73] Fix | Delete
var msgplug = '';
[74] Fix | Delete
var response = '';
[75] Fix | Delete
var currentId = self.attr('id');
[76] Fix | Delete
if(currentId=='ampforwp-page-booster-activate'){
[77] Fix | Delete
msgplug = 'Core Web Vitals Page Booster';
[78] Fix | Delete
response = '?page=cwvpsb';
[79] Fix | Delete
}else if(currentId=='ampforwp-structured-data-activate'){
[80] Fix | Delete
msgplug = 'Schema & Structured Data';
[81] Fix | Delete
response = '?page=structured_data_options';
[82] Fix | Delete
}else if(currentId=='ampforwp-pwa-activate'){
[83] Fix | Delete
msgplug = 'PWA';
[84] Fix | Delete
response = '?page=pwaforwp';
[85] Fix | Delete
}
[86] Fix | Delete
var activateUrl = self.attr('data-href');
[87] Fix | Delete
self.text( wp.i18n );
[88] Fix | Delete
self.text( 'Activating...' );
[89] Fix | Delete
jQuery.ajax(
[90] Fix | Delete
{
[91] Fix | Delete
async: true,
[92] Fix | Delete
type: 'GET',
[93] Fix | Delete
//data: dataString,
[94] Fix | Delete
url: activateUrl,
[95] Fix | Delete
success: function () {
[96] Fix | Delete
self.removeClass('updating-message')
[97] Fix | Delete
self.html('<a href="'+response+'" style="text-decoration: none;color: #fff;">Activated! - Let\'s Go to '+msgplug+' Settings</a>')
[98] Fix | Delete
self.removeClass('ampforwp-activation-plugin');
[99] Fix | Delete
},
[100] Fix | Delete
error: function (jqXHR, exception) {
[101] Fix | Delete
var msg = '';
[102] Fix | Delete
if (jqXHR.status === 0) {
[103] Fix | Delete
msg = 'Not connect.\n Verify Network.';
[104] Fix | Delete
} else if (jqXHR.status === 404) {
[105] Fix | Delete
msg = 'Requested page not found. [404]';
[106] Fix | Delete
} else if (jqXHR.status === 500) {
[107] Fix | Delete
msg = 'Internal Server Error [500].';
[108] Fix | Delete
} else if (exception === 'parsererror') {
[109] Fix | Delete
msg = 'Requested JSON parse failed.';
[110] Fix | Delete
} else if (exception === 'timeout') {
[111] Fix | Delete
msg = 'Time out error.';
[112] Fix | Delete
} else if (exception === 'abort') {
[113] Fix | Delete
msg = 'Ajax request aborted.';
[114] Fix | Delete
} else {
[115] Fix | Delete
msg = 'Uncaught Error.\n' + jqXHR.responseText;
[116] Fix | Delete
}
[117] Fix | Delete
console.log(msg);
[118] Fix | Delete
},
[119] Fix | Delete
}
[120] Fix | Delete
);
[121] Fix | Delete
}
[122] Fix | Delete
});
[123] Fix | Delete
[124] Fix | Delete
var wpActivateModulesUpgrage = function(url, self, response, nonce){
[125] Fix | Delete
if (typeof url === 'undefined' || !url) {
[126] Fix | Delete
return;
[127] Fix | Delete
}
[128] Fix | Delete
self.text( 'Activating...' );
[129] Fix | Delete
jQuery.ajax(
[130] Fix | Delete
{
[131] Fix | Delete
async: true,
[132] Fix | Delete
type: 'GET',
[133] Fix | Delete
//data: dataString,
[134] Fix | Delete
url: url,
[135] Fix | Delete
success: function () {
[136] Fix | Delete
self.removeClass('updating-message')
[137] Fix | Delete
var msgplug = '';
[138] Fix | Delete
if(self.attr('id')=='ampforwp-pwa-activation-call'){
[139] Fix | Delete
msgplug = 'PWA';
[140] Fix | Delete
[141] Fix | Delete
[142] Fix | Delete
self.html('<a href="'+response.redirect_url+'" style="text-decoration: none;color: #555;">Installed! - Let\'s Go to '+msgplug+' Settings</a>')
[143] Fix | Delete
self.removeClass('ampforwp-activation-call-module-upgrade');
[144] Fix | Delete
}else if(self.attr('id')=='ampforwp-structure-data-activation-call'){
[145] Fix | Delete
msgplug = 'Structure Data';
[146] Fix | Delete
self.text( 'Importing data...' );
[147] Fix | Delete
//Import Data
[148] Fix | Delete
jQuery.ajax({
[149] Fix | Delete
url: ajaxurl,
[150] Fix | Delete
type: 'post',
[151] Fix | Delete
data: 'action=ampforwp_import_modules_scema&verify_nonce='+nonce,
[152] Fix | Delete
success: function () {
[153] Fix | Delete
self.html('<a href="'+response.redirect_url+'" style="text-decoration: none;color: #555;">Installed! - Let\'s Go to '+msgplug+' Settings</a>')
[154] Fix | Delete
self.removeClass('ampforwp-activation-call-module-upgrade');
[155] Fix | Delete
}
[156] Fix | Delete
});
[157] Fix | Delete
}else if(self.attr('id')=='ampforwp-adsforwp-activation-call'){
[158] Fix | Delete
msgplug = 'Ads for WP';
[159] Fix | Delete
self.text( 'Importing data...' );
[160] Fix | Delete
//Import Data
[161] Fix | Delete
jQuery.ajax({
[162] Fix | Delete
url: ajaxurl,
[163] Fix | Delete
type: 'post',
[164] Fix | Delete
data: 'action=ampforwp_import_modules_ads&verify_nonce='+nonce,
[165] Fix | Delete
success: function () {
[166] Fix | Delete
self.html('<a href="'+response.redirect_url+'" style="text-decoration: none;">Go to Ads Settings</a>')
[167] Fix | Delete
self.removeClass('ampforwp-activation-call-module-upgrade');
[168] Fix | Delete
}
[169] Fix | Delete
});
[170] Fix | Delete
}else if(self.attr('id')=='ampforwp-wp-quads-activation-call'){
[171] Fix | Delete
msgplug = 'WP QUADS';
[172] Fix | Delete
self.html('<a href="'+response.redirect_url+'">Installed! - Let\'s Go to '+msgplug+' Settings</a>')
[173] Fix | Delete
self.removeClass('ampforwp-activation-call-module-upgrade');
[174] Fix | Delete
}else if(self.attr('id')=='ampforwp-page-booster-activation-call'){
[175] Fix | Delete
msgplug = 'Core Web Vitals Page Booster';
[176] Fix | Delete
self.html('<a href="'+response.redirect_url+'" style="text-decoration: none;color: #fff;">Installed! - Let\'s Go to '+msgplug+' Settings</a>')
[177] Fix | Delete
self.removeClass('ampforwp-activation-call-module-upgrade');
[178] Fix | Delete
}
[179] Fix | Delete
[180] Fix | Delete
},
[181] Fix | Delete
error: function (jqXHR, exception) {
[182] Fix | Delete
var msg = '';
[183] Fix | Delete
if (jqXHR.status === 0) {
[184] Fix | Delete
msg = 'Not connect.\n Verify Network.';
[185] Fix | Delete
} else if (jqXHR.status === 404) {
[186] Fix | Delete
msg = 'Requested page not found. [404]';
[187] Fix | Delete
} else if (jqXHR.status === 500) {
[188] Fix | Delete
msg = 'Internal Server Error [500].';
[189] Fix | Delete
} else if (exception === 'parsererror') {
[190] Fix | Delete
msg = 'Requested JSON parse failed.';
[191] Fix | Delete
} else if (exception === 'timeout') {
[192] Fix | Delete
msg = 'Time out error.';
[193] Fix | Delete
} else if (exception === 'abort') {
[194] Fix | Delete
msg = 'Ajax request aborted.';
[195] Fix | Delete
} else {
[196] Fix | Delete
msg = 'Uncaught Error.\n' + jqXHR.responseText;
[197] Fix | Delete
}
[198] Fix | Delete
console.log(msg);
[199] Fix | Delete
},
[200] Fix | Delete
}
[201] Fix | Delete
);
[202] Fix | Delete
}
[203] Fix | Delete
[204] Fix | Delete
});//(document).ready Closed
[205] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function