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/sitepres.../res/js
File: orphan-comments.js
/*jslint browser: true, nomen: true, laxbreak: true*/
[0] Fix | Delete
/*global ajaxurl */
[1] Fix | Delete
[2] Fix | Delete
"use strict";
[3] Fix | Delete
[4] Fix | Delete
jQuery(document).ready(
[5] Fix | Delete
function ($) {
[6] Fix | Delete
[7] Fix | Delete
var deleted = 0;
[8] Fix | Delete
var deleting = false;
[9] Fix | Delete
var initial_orphans_count = 0;
[10] Fix | Delete
[11] Fix | Delete
var orphansCount = $('#wpml_orphans_count');
[12] Fix | Delete
var orphansCheckCount = orphansCount.find('.check-orphans');
[13] Fix | Delete
var orphansCountResults = orphansCount.find('.orphans-check-results');
[14] Fix | Delete
var orphansCountProgress = orphansCount.find('.count-in-progress');
[15] Fix | Delete
var deletingProgress = orphansCount.find('.delete-in-progress');
[16] Fix | Delete
var deletedOrphans = orphansCount.find('.deleted');
[17] Fix | Delete
var cleanOrphans = orphansCount.find('.clean-orphans');
[18] Fix | Delete
var noOrphans = orphansCount.find('.no_orphans');
[19] Fix | Delete
var orphansCheckLoader = orphansCount.find('.check_loader');
[20] Fix | Delete
[21] Fix | Delete
deletedOrphans.hide();
[22] Fix | Delete
noOrphans.hide();
[23] Fix | Delete
orphansCountProgress.hide();
[24] Fix | Delete
orphansCountResults.hide();
[25] Fix | Delete
orphansCheckLoader.hide();
[26] Fix | Delete
[27] Fix | Delete
orphansCount.show();
[28] Fix | Delete
[29] Fix | Delete
orphansCheckCount.on('click', count_orphans);
[30] Fix | Delete
cleanOrphans.on('click', delete_orphans);
[31] Fix | Delete
[32] Fix | Delete
var nonce = orphansCount.find('#wpml_orphan_comment_nonce').val();
[33] Fix | Delete
[34] Fix | Delete
function resetDeletion() {
[35] Fix | Delete
deletingProgress.fadeOut();
[36] Fix | Delete
deleted = 0;
[37] Fix | Delete
deleting = 0;
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
function count_orphans() {
[41] Fix | Delete
if(!deleting) {
[42] Fix | Delete
orphansCheckCount.fadeOut();
[43] Fix | Delete
orphansCountProgress.fadeIn();
[44] Fix | Delete
}
[45] Fix | Delete
var data = {
[46] Fix | Delete
action : 'wpml_count_orphans',
[47] Fix | Delete
_icl_nonce: nonce
[48] Fix | Delete
};
[49] Fix | Delete
[50] Fix | Delete
$.post(
[51] Fix | Delete
ajaxurl, data, function (res) {
[52] Fix | Delete
orphansCountProgress.fadeOut();
[53] Fix | Delete
var orphansCountResult = res.success ? res.data : 0;
[54] Fix | Delete
orphansCheckLoader.fadeOut();
[55] Fix | Delete
orphansCountResults.find('.count').html(orphansCountResult);
[56] Fix | Delete
if (orphansCountResult > 0) {
[57] Fix | Delete
if (initial_orphans_count == 0) {
[58] Fix | Delete
initial_orphans_count = orphansCountResult;
[59] Fix | Delete
cleanOrphans.fadeIn();
[60] Fix | Delete
}
[61] Fix | Delete
noOrphans.fadeOut();
[62] Fix | Delete
orphansCountResults.fadeIn();
[63] Fix | Delete
[64] Fix | Delete
if (deleting) {
[65] Fix | Delete
delete_orphans();
[66] Fix | Delete
} else {
[67] Fix | Delete
resetDeletion();
[68] Fix | Delete
}
[69] Fix | Delete
} else {
[70] Fix | Delete
resetDeletion();
[71] Fix | Delete
noOrphans.fadeIn();
[72] Fix | Delete
orphansCountResults.fadeOut();
[73] Fix | Delete
orphansCheckCount.fadeIn();
[74] Fix | Delete
}
[75] Fix | Delete
}
[76] Fix | Delete
);
[77] Fix | Delete
}
[78] Fix | Delete
[79] Fix | Delete
function delete_orphans() {
[80] Fix | Delete
[81] Fix | Delete
cleanOrphans.fadeOut();
[82] Fix | Delete
deletingProgress.fadeIn();
[83] Fix | Delete
deleting = true;
[84] Fix | Delete
[85] Fix | Delete
deletedOrphans.fadeIn();
[86] Fix | Delete
[87] Fix | Delete
var data = {
[88] Fix | Delete
'action' : 'wpml_delete_orphans',
[89] Fix | Delete
'data' : {how_many: Math.max(10, initial_orphans_count / 10)},
[90] Fix | Delete
_icl_nonce: nonce
[91] Fix | Delete
};
[92] Fix | Delete
$.post(
[93] Fix | Delete
ajaxurl, data, function (res) {
[94] Fix | Delete
var deletedComments = res.success ? res.data : 0;
[95] Fix | Delete
deleted += parseInt(deletedComments);
[96] Fix | Delete
deletedOrphans.html(deleted);
[97] Fix | Delete
count_orphans();
[98] Fix | Delete
}
[99] Fix | Delete
);
[100] Fix | Delete
}
[101] Fix | Delete
}
[102] Fix | Delete
);
[103] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function