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

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/accelera.../includes
File: admin-script.js
[500] Fix | Delete
// Creating a select
[501] Fix | Delete
var s = $('<select/>');
[502] Fix | Delete
var amp_font_selector = redux_data['amp_font_selector'];
[503] Fix | Delete
for (var i in allFonts) {
[504] Fix | Delete
[505] Fix | Delete
var fontDetail = allFonts[i].fontFamily;
[506] Fix | Delete
var selected = '';
[507] Fix | Delete
if(amp_font_selector===fontDetail){
[508] Fix | Delete
selected = 'selected';
[509] Fix | Delete
}
[510] Fix | Delete
$('#amp_font_selector-select').append($('<option value="'+ fontDetail +'" data-font-number="'+ i +'" '+ selected +'> '+ fontDetail +' </option>'));
[511] Fix | Delete
$('#amp_font_selector_content_single-select').append($('<option value="'+ fontDetail +'" data-font-number="'+ i +'"> '+ fontDetail +' </option>'));
[512] Fix | Delete
}
[513] Fix | Delete
$('#amp_font_selector-select').append($('<option value="sans-serif" data-font-number="'+ i +'"> sans-serif </option>'));
[514] Fix | Delete
$('#amp_font_selector_content_single-select').append($('<option value="sans-serif" data-font-number="'+ i +'"> sans-serif </option>'));
[515] Fix | Delete
$('#amp_font_selector-select').append($('<option value="Segoe UI" data-font-number="'+ i +'"> Segoe UI </option>'));
[516] Fix | Delete
$('#amp_font_selector_content_single-select').append($('<option value="Segoe UI" data-font-number="'+ i +'"> Segoe UI </option>'));
[517] Fix | Delete
$('#amp_font_selector-select, #amp_font_selector_content_single-select').on('change', function() {
[518] Fix | Delete
var select = $('option:selected', this).attr('data-font-number');
[519] Fix | Delete
var fontVariants = data.items[select]?data.items[select].variants:false ;
[520] Fix | Delete
[521] Fix | Delete
if($(this).attr("id")=='amp_font_selector-select'){
[522] Fix | Delete
if ( fontVariants) {
[523] Fix | Delete
//$('.select2-search-choice').remove();
[524] Fix | Delete
$('#amp_font_type-select').html('<option></option>').trigger('change');
[525] Fix | Delete
}
[526] Fix | Delete
[527] Fix | Delete
[528] Fix | Delete
//if ( data.items[select] ) {
[529] Fix | Delete
$('#google_current_font_data').val( JSON.stringify(data.items[select]) );
[530] Fix | Delete
[531] Fix | Delete
for (var i in fontVariants) {
[532] Fix | Delete
$('#amp_font_type-select').append($("<option value='"+ fontVariants[i] +"' > "+fontVariants[i]+"</option>")).trigger('change');
[533] Fix | Delete
}
[534] Fix | Delete
}else if($(this).attr("id")=='amp_font_selector_content_single-select') {
[535] Fix | Delete
if ( fontVariants) {
[536] Fix | Delete
//$('.select2-search-choice').remove();
[537] Fix | Delete
$('#amp_font_type_content_single-select').html('<option></option>').trigger('change');
[538] Fix | Delete
}
[539] Fix | Delete
$('#google_current_font_data_content_single').val( JSON.stringify(data.items[select]) );
[540] Fix | Delete
[541] Fix | Delete
for (var i in fontVariants) {
[542] Fix | Delete
$('#amp_font_type_content_single-select').append($("<option value='"+ fontVariants[i] +"' > "+fontVariants[i]+"</option>")).trigger('change');
[543] Fix | Delete
}
[544] Fix | Delete
}
[545] Fix | Delete
[546] Fix | Delete
});
[547] Fix | Delete
}
[548] Fix | Delete
$('#redux_builder_amp-amp-design-selector select').on('change',function(){
[549] Fix | Delete
amp_font_selector_select_change('design_change', $(this).val());
[550] Fix | Delete
if( $(this).val() == 1 || $(this).val() == 2 || $(this).val() == 3){
[551] Fix | Delete
$('.amp-theme-global-subsection').find('.secondary-font-selector th div').text('Secondary Font Selector');
[552] Fix | Delete
$('.amp-theme-global-subsection').find('.secondary-font-family-selector th div').text('Secondary Font Family Selector');
[553] Fix | Delete
$('.amp-theme-global-subsection').find('.secondary-font-family-weights th div').text('Secondary Font Family Weight Selector');
[554] Fix | Delete
}else{
[555] Fix | Delete
$('.amp-theme-global-subsection').find('.secondary-font-selector th div').text('Content Font Selector');
[556] Fix | Delete
$('.amp-theme-global-subsection').find('.secondary-font-family-selector th div').text('Content Font Family Selector');
[557] Fix | Delete
$('.amp-theme-global-subsection').find('.secondary-font-family-weights th div').text('Content Font Family Weight Selector');
[558] Fix | Delete
}
[559] Fix | Delete
});
[560] Fix | Delete
function amp_font_selector_select_change(callType='', currentdesign=4){
[561] Fix | Delete
if($('#amp_font_selector-select').length>0){
[562] Fix | Delete
// Adding Default Font Family
[563] Fix | Delete
$('#s2id_amp_font_selector-select a').removeClass('select2-default');
[564] Fix | Delete
[565] Fix | Delete
if(redux_data.amp_font_selector==''){
[566] Fix | Delete
switch(redux_data['amp-design-selector']){
[567] Fix | Delete
case '1':
[568] Fix | Delete
redux_data.amp_font_selector = 'Merriweather'
[569] Fix | Delete
break;
[570] Fix | Delete
case '2':
[571] Fix | Delete
redux_data.amp_font_selector = 'sans-serif'
[572] Fix | Delete
break;
[573] Fix | Delete
case '3':
[574] Fix | Delete
redux_data.amp_font_selector = 'Roboto Slab'
[575] Fix | Delete
break;
[576] Fix | Delete
case '4':
[577] Fix | Delete
redux_data.amp_font_selector = 'Poppins'
[578] Fix | Delete
break;
[579] Fix | Delete
default:
[580] Fix | Delete
redux_data.amp_font_selector = 'Poppins'
[581] Fix | Delete
break;
[582] Fix | Delete
}
[583] Fix | Delete
[584] Fix | Delete
}
[585] Fix | Delete
if(callType=='design_change'){
[586] Fix | Delete
switch(currentdesign){
[587] Fix | Delete
case '1':
[588] Fix | Delete
redux_data.amp_font_selector = 'Merriweather'
[589] Fix | Delete
break;
[590] Fix | Delete
case '2':
[591] Fix | Delete
redux_data.amp_font_selector = 'sans-serif'
[592] Fix | Delete
break;
[593] Fix | Delete
case '3':
[594] Fix | Delete
redux_data.amp_font_selector = 'Roboto Slab'
[595] Fix | Delete
break;
[596] Fix | Delete
case '4':
[597] Fix | Delete
redux_data.amp_font_selector = 'Poppins'
[598] Fix | Delete
break;
[599] Fix | Delete
default:
[600] Fix | Delete
redux_data.amp_font_selector = 'Poppins'
[601] Fix | Delete
break;
[602] Fix | Delete
}
[603] Fix | Delete
}
[604] Fix | Delete
$('#s2id_amp_font_selector-select .select2-chosen').html(redux_data.amp_font_selector);
[605] Fix | Delete
[606] Fix | Delete
$('#amp_font_selector-select option[value="'+redux_data.amp_font_selector+'"]').attr("selected", "selected");
[607] Fix | Delete
$('#amp_font_selector-select').val(redux_data.amp_font_selector).trigger("change");
[608] Fix | Delete
[609] Fix | Delete
// Build select data
[610] Fix | Delete
let fontData = redux_data.google_current_font_data;
[611] Fix | Delete
// fontData = JSON.parse(fontData);
[612] Fix | Delete
// console.log(fontData);
[613] Fix | Delete
if (! fontData.hasOwnProperty('variants')) {
[614] Fix | Delete
//$('.select2-search-choice').remove();
[615] Fix | Delete
//$('#amp_font_type-select').html('<option></option>');
[616] Fix | Delete
[617] Fix | Delete
for (var i in fontData.variants) {
[618] Fix | Delete
$('#amp_font_type-select').append($("<option value='"+ fontData.variants[i] +"' > "+fontData.variants[i]+"</option>")).trigger('change');
[619] Fix | Delete
}
[620] Fix | Delete
}
[621] Fix | Delete
[622] Fix | Delete
if(redux_data.amp_font_type==''){
[623] Fix | Delete
redux_data.amp_font_type = ['regular','500','700'];
[624] Fix | Delete
}
[625] Fix | Delete
// Add Default selected
[626] Fix | Delete
if ( redux_data.amp_font_type ) {
[627] Fix | Delete
$('#s2id_autogen4').remove();
[628] Fix | Delete
for (var i in redux_data.amp_font_type) {
[629] Fix | Delete
$('#s2id_amp_font_type-select ul').append('<li class="select2-search-choice"> <div> '+redux_data.amp_font_type[i]+'</div> <a href="#" class="select2-search-choice-close" tabindex="-1"></a></li>');
[630] Fix | Delete
//s2.append($('<option>').text(e));
[631] Fix | Delete
$('#amp_font_type-select option[value='+redux_data.amp_font_type[i]+']').attr('selected','selected').trigger('change');
[632] Fix | Delete
}
[633] Fix | Delete
}
[634] Fix | Delete
}//#amp_font_selector-select closed
[635] Fix | Delete
[636] Fix | Delete
[637] Fix | Delete
/************
[638] Fix | Delete
* Content Font Selectors On load work
[639] Fix | Delete
* amp_font_selector_content_single
[640] Fix | Delete
*
[641] Fix | Delete
*********/
[642] Fix | Delete
[643] Fix | Delete
if($('#amp_font_selector_content_single-select').length>0){
[644] Fix | Delete
// Adding Default Font Family
[645] Fix | Delete
$('#s2id_amp_font_selector_content_single-select a').removeClass('select2-default');
[646] Fix | Delete
[647] Fix | Delete
if(redux_data.amp_font_selector_content_single==''){
[648] Fix | Delete
redux_data.amp_font_selector_content_single = 'Poppins'
[649] Fix | Delete
}
[650] Fix | Delete
if(redux_data.amp_font_selector_content_single==''){
[651] Fix | Delete
switch(redux_data['amp-design-selector']){
[652] Fix | Delete
case '1':
[653] Fix | Delete
redux_data.amp_font_selector_content_single = 'Merriweather'
[654] Fix | Delete
break;
[655] Fix | Delete
case '2':
[656] Fix | Delete
redux_data.amp_font_selector_content_single = 'sans-serif'
[657] Fix | Delete
break;
[658] Fix | Delete
case '3':
[659] Fix | Delete
redux_data.amp_font_selector_content_single = 'Roboto Slab'
[660] Fix | Delete
break;
[661] Fix | Delete
case '4':
[662] Fix | Delete
redux_data.amp_font_selector_content_single = 'Poppins'
[663] Fix | Delete
break;
[664] Fix | Delete
default:
[665] Fix | Delete
redux_data.amp_font_selector_content_single = 'Poppins'
[666] Fix | Delete
break;
[667] Fix | Delete
}
[668] Fix | Delete
[669] Fix | Delete
}
[670] Fix | Delete
if(callType=='design_change'){
[671] Fix | Delete
switch(currentdesign){
[672] Fix | Delete
case '1':
[673] Fix | Delete
redux_data.amp_font_selector_content_single = 'Segoe UI'
[674] Fix | Delete
break;
[675] Fix | Delete
case '2':
[676] Fix | Delete
redux_data.amp_font_selector_content_single = 'sans-serif'
[677] Fix | Delete
break;
[678] Fix | Delete
case '3':
[679] Fix | Delete
redux_data.amp_font_selector_content_single = 'PT Serif'
[680] Fix | Delete
break;
[681] Fix | Delete
case '4':
[682] Fix | Delete
redux_data.amp_font_selector_content_single = 'Poppins'
[683] Fix | Delete
break;
[684] Fix | Delete
default:
[685] Fix | Delete
redux_data.amp_font_selector_content_single = 'Poppins'
[686] Fix | Delete
break;
[687] Fix | Delete
}
[688] Fix | Delete
}
[689] Fix | Delete
$('#s2id_amp_font_selector_content_single-select .select2-chosen').html(redux_data.amp_font_selector_content_single);
[690] Fix | Delete
[691] Fix | Delete
$('#amp_font_selector_content_single-select option[value="'+redux_data.amp_font_selector_content_single+'"]').attr("selected", "selected");
[692] Fix | Delete
$('#amp_font_selector_content_single-select').val(redux_data.amp_font_selector_content_single).trigger("change");
[693] Fix | Delete
[694] Fix | Delete
[695] Fix | Delete
// Build select data
[696] Fix | Delete
let fontData = redux_data.google_current_font_data_content_single;
[697] Fix | Delete
// fontData = JSON.parse(fontData);
[698] Fix | Delete
if (! fontData.variants) {
[699] Fix | Delete
for (var i in fontData.variants) {
[700] Fix | Delete
$('#amp_font_selector_content_single-select').append($("<option value='"+ fontData.variants[i] +"' > "+fontData.variants[i]+"</option>")).trigger('change');
[701] Fix | Delete
}
[702] Fix | Delete
}
[703] Fix | Delete
[704] Fix | Delete
if(redux_data.amp_font_type_content_single==''){
[705] Fix | Delete
redux_data.amp_font_type_content_single = ['regular','500','700'];
[706] Fix | Delete
}
[707] Fix | Delete
// Add Default selected
[708] Fix | Delete
if ( redux_data.amp_font_type_content_single ) {
[709] Fix | Delete
$('#s2id_autogen4').remove();
[710] Fix | Delete
for (var i in redux_data.amp_font_type_content_single) {
[711] Fix | Delete
$('#s2id_amp_font_type_content_single-select ul').append('<li class="select2-search-choice"> <div> '+redux_data.amp_font_type_content_single[i]+'</div> <a href="#" class="select2-search-choice-close" tabindex="-1"></a></li>');
[712] Fix | Delete
//s2.append($('<option>').text(e));
[713] Fix | Delete
$('#amp_font_type_content_single-select option[value='+redux_data.amp_font_type_content_single[i]+']').attr('selected','selected').trigger('change');
[714] Fix | Delete
}
[715] Fix | Delete
}
[716] Fix | Delete
}//#amp_font_selector_content_single-select closed
[717] Fix | Delete
}
[718] Fix | Delete
[719] Fix | Delete
[720] Fix | Delete
/*---------Google Fonts Ends -------*/
[721] Fix | Delete
[722] Fix | Delete
});
[723] Fix | Delete
var dataTabRequired = function(){
[724] Fix | Delete
$('[data-tab-required]').each(function(){
[725] Fix | Delete
var tabRequired = $(this).attr('data-tab-required');
[726] Fix | Delete
var currentThis = $(this);
[727] Fix | Delete
tabRequired = JSON.parse(tabRequired);
[728] Fix | Delete
var showLi = true;
[729] Fix | Delete
$.each(tabRequired,function(k, value){
[730] Fix | Delete
var currentValue = jQuery('[name="redux_builder_amp['+value[0]+']"]').val();;
[731] Fix | Delete
if(currentValue!=value[2]){
[732] Fix | Delete
showLi = false;
[733] Fix | Delete
return false;
[734] Fix | Delete
}
[735] Fix | Delete
});
[736] Fix | Delete
if(showLi==false){
[737] Fix | Delete
currentThis.hide();
[738] Fix | Delete
}else{
[739] Fix | Delete
currentThis.show();
[740] Fix | Delete
}
[741] Fix | Delete
[742] Fix | Delete
});
[743] Fix | Delete
}
[744] Fix | Delete
var reduxOptionTab = function(){
[745] Fix | Delete
$('.redux-tab-selector').on("click", function(){
[746] Fix | Delete
var tabId = $(this).attr('data-tab');
[747] Fix | Delete
var tabRequired = $(this).attr('data-tab-required');
[748] Fix | Delete
$(this).parents().find('.custom-tab-container').hide();
[749] Fix | Delete
$('#parent-section-'+ tabId ).show();
[750] Fix | Delete
});
[751] Fix | Delete
$('.redux-tabs-ul').each(function(){
[752] Fix | Delete
$(this).find('.redux-tab-selector:first').click();
[753] Fix | Delete
});
[754] Fix | Delete
dataTabRequired();
[755] Fix | Delete
$('select').change(function(){
[756] Fix | Delete
dataTabRequired();
[757] Fix | Delete
});
[758] Fix | Delete
}
[759] Fix | Delete
//reduxOptionTab();
[760] Fix | Delete
$( '.redux-action_bar input' ).on('click', function( e ) {
[761] Fix | Delete
if($(".amp-ls-solve").length){
[762] Fix | Delete
$(".amp-ls-solve").each(function(k,v){
[763] Fix | Delete
var license = $(this).val();
[764] Fix | Delete
if(license){
[765] Fix | Delete
var patt = new RegExp("^([A-Za-z0-9+\/]{4})*([A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{2}==)?$");
[766] Fix | Delete
if( patt.test(window.atob(license)) ){
[767] Fix | Delete
license = window.atob(license);
[768] Fix | Delete
$(this).val(license);
[769] Fix | Delete
}
[770] Fix | Delete
}
[771] Fix | Delete
});//$(".amp-ls-solve") each closed
[772] Fix | Delete
}
[773] Fix | Delete
});
[774] Fix | Delete
$(".redux-ampforwp-ext-activate").on("click", function(){
[775] Fix | Delete
var currentThis = $(this);
[776] Fix | Delete
var plugin_id = currentThis.attr("id");
[777] Fix | Delete
var secure_nonce = currentThis.parents("li").attr('data-ext-secure');
[778] Fix | Delete
var newlicense = $('#redux_builder_amp_amp-license_'+plugin_id+'_license').val();
[779] Fix | Delete
var license = $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][license]"]').val();
[780] Fix | Delete
[781] Fix | Delete
if(newlicense!='' && newlicense.indexOf("**")<0){
[782] Fix | Delete
license = window.btoa(newlicense);
[783] Fix | Delete
$('input[name="redux_builder_amp[amp-license]['+plugin_id+'][license]"]').val(license);
[784] Fix | Delete
}
[785] Fix | Delete
[786] Fix | Delete
var item_name = $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][item_name]"]').val();
[787] Fix | Delete
var store_url = $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][store_url]"]').val();
[788] Fix | Delete
var plugin_active_path = $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][plugin_active_path]"]').val();
[789] Fix | Delete
currentThis.html("Please Wait...");
[790] Fix | Delete
$.ajax({
[791] Fix | Delete
url: ajaxurl,
[792] Fix | Delete
method: 'post',
[793] Fix | Delete
data: {action: 'ampforwp_get_licence_activate_update',
[794] Fix | Delete
ampforwp_license_activate:plugin_id,
[795] Fix | Delete
license:window.atob(license),
[796] Fix | Delete
item_name:item_name,
[797] Fix | Delete
store_url:store_url,
[798] Fix | Delete
plugin_active_path:plugin_active_path,
[799] Fix | Delete
verify_nonce: secure_nonce
[800] Fix | Delete
},
[801] Fix | Delete
dataType: 'json',
[802] Fix | Delete
success: function(response){
[803] Fix | Delete
currentThis.parents("li").find('.afw-license-response-message').remove();
[804] Fix | Delete
if(response.status=='200'){
[805] Fix | Delete
$('#redux_builder_amp_amp-license_'+plugin_id+'_license').remove();
[806] Fix | Delete
currentThis.parents("li").removeClass("not-active").removeClass("invalid").addClass("active").addClass("valid");
[807] Fix | Delete
currentThis.html("Deactivate");
[808] Fix | Delete
currentThis.after("<div class='afw-license-response-message'>"+response.message+'</div>');
[809] Fix | Delete
currentThis.removeClass('redux-ampforwp-ext-activate').addClass('redux-ampforwp-ext-deactivate');
[810] Fix | Delete
$('input[name="redux_builder_amp[amp-license]['+plugin_id+'][status]"]').val("valid");
[811] Fix | Delete
deactivatelicence();
[812] Fix | Delete
var all_data = response.other.all_data;
[813] Fix | Delete
$('input[name="redux_builder_amp[amp-license]['+plugin_id+'][all_data][success]"]').val( all_data.success );
[814] Fix | Delete
$('input[name="redux_builder_amp[amp-license]['+plugin_id+'][all_data][license]"]').val( all_data.license );
[815] Fix | Delete
$('input[name="redux_builder_amp[amp-license]['+plugin_id+'][all_data][item_name]"]').val( all_data.item_name );
[816] Fix | Delete
$('input[name="redux_builder_amp[amp-license]['+plugin_id+'][all_data][expires]"]').val( all_data.expires );
[817] Fix | Delete
$('input[name="redux_builder_amp[amp-license]['+plugin_id+'][all_data][customer_name]"]').val( all_data.customer_name );
[818] Fix | Delete
$('input[name="redux_builder_amp[amp-license]['+plugin_id+'][all_data][customer_email]"]').val( all_data.customer_email );
[819] Fix | Delete
//window.location.href = window.location.href;
[820] Fix | Delete
}else{
[821] Fix | Delete
currentThis.after("<div class='afw-license-response-message'>"+response.message+'</div>');
[822] Fix | Delete
currentThis.html("Activate");
[823] Fix | Delete
}
[824] Fix | Delete
}
[825] Fix | Delete
})
[826] Fix | Delete
})
[827] Fix | Delete
[828] Fix | Delete
//Deactivate License key
[829] Fix | Delete
function AMPforwpreadCookie(name) {
[830] Fix | Delete
var nameEQ = name + "=";
[831] Fix | Delete
var ca = document.cookie.split(";");
[832] Fix | Delete
for(var i=0;i < ca.length;i++) {
[833] Fix | Delete
var c = ca[i];
[834] Fix | Delete
while (c.charAt(0)==" ") c = c.substring(1,c.length);
[835] Fix | Delete
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
[836] Fix | Delete
}
[837] Fix | Delete
return null;
[838] Fix | Delete
}
[839] Fix | Delete
function deactivatelicence(){
[840] Fix | Delete
$(".ampforwp-ext-refresh").on("click", function(){
[841] Fix | Delete
var currentThis = $(this);
[842] Fix | Delete
var plugin_id = currentThis.attr("id");
[843] Fix | Delete
[844] Fix | Delete
var today = new Date();
[845] Fix | Delete
var lastcheck = AMPforwpreadCookie('plugin_refresh_check');
[846] Fix | Delete
lastcheck = new Date(lastcheck);
[847] Fix | Delete
console.log(lastcheck+ " true");
[848] Fix | Delete
var diffDays = -1;
[849] Fix | Delete
if( typeof lastcheck != undefined){
[850] Fix | Delete
var diffTime = Math.abs(today.getTime() - lastcheck.getTime());
[851] Fix | Delete
var diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
[852] Fix | Delete
}
[853] Fix | Delete
var expireDate = new Date(jQuery('[name="redux_builder_amp[amp-license]['+plugin_id+'][all_data][expires]"]').val());
[854] Fix | Delete
var diffTime = Math.abs( expireDate.getTime()-today.getTime() );
[855] Fix | Delete
var expireDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
[856] Fix | Delete
if(diffDays==-1 || diffDays>1 || expireDays<1){
[857] Fix | Delete
currentThis.text("Please wait...")
[858] Fix | Delete
document.cookie = "plugin_refresh_check="+today;
[859] Fix | Delete
var secure_nonce = currentThis.parents("li").attr('data-ext-secure');
[860] Fix | Delete
$.ajax({
[861] Fix | Delete
url: ajaxurl,
[862] Fix | Delete
method: 'post',
[863] Fix | Delete
data: {action: 'ampforwp_get_licence_activate_update',
[864] Fix | Delete
update_check: 'yes',
[865] Fix | Delete
ampforwp_license_activate:plugin_id,
[866] Fix | Delete
verify_nonce: secure_nonce
[867] Fix | Delete
},
[868] Fix | Delete
dataType: 'json',
[869] Fix | Delete
success: function(response){
[870] Fix | Delete
currentThis.parents("li").find(".license-tenure").text('')
[871] Fix | Delete
currentThis.parents("li").find('.afw-license-response-message').remove();
[872] Fix | Delete
if(response.status=='200'){
[873] Fix | Delete
var expireData = new Date(response.other.all_data.expires);
[874] Fix | Delete
var today = new Date();
[875] Fix | Delete
var diffTime = Math.abs( expireData.getTime()-today.getTime() );
[876] Fix | Delete
var expireDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
[877] Fix | Delete
currentThis.parents("li").find(".license-tenure").text(expireDays+" Days Remaining")
[878] Fix | Delete
}else{
[879] Fix | Delete
currentThis.parents("li").find('.license-tenure').text(response.message);
[880] Fix | Delete
}
[881] Fix | Delete
}
[882] Fix | Delete
})
[883] Fix | Delete
currentThis.html('<i class="dashicons-before dashicons-update"></i>Refresh');
[884] Fix | Delete
[885] Fix | Delete
}else{
[886] Fix | Delete
$(".dashicons").addClass( 'spin' );
[887] Fix | Delete
setTimeout( function() {
[888] Fix | Delete
$(".dashicons").removeClass( 'spin' );}, 3000 );
[889] Fix | Delete
}
[890] Fix | Delete
});
[891] Fix | Delete
[892] Fix | Delete
// Start Refresh and check if user has done renewal in between 0-7 Days & when Expired
[893] Fix | Delete
var ap = document.getElementById("active-plugins-dr");
[894] Fix | Delete
if (ap) {
[895] Fix | Delete
var remainingdays = ap.getAttribute("data-days");
[896] Fix | Delete
}
[897] Fix | Delete
if ( remainingdays <= 7 ){
[898] Fix | Delete
setTimeout(function () {
[899] Fix | Delete
jQuery("#refresh_expired_addon").trigger("click");
[900] Fix | Delete
}, 0);
[901] Fix | Delete
}
[902] Fix | Delete
[903] Fix | Delete
$(".days_remain").click(function(){
[904] Fix | Delete
var currentThis = $(this);
[905] Fix | Delete
var plugin_id = currentThis.attr("id");
[906] Fix | Delete
jQuery("#refresh_expired_addon").addClass( 'spin' );
[907] Fix | Delete
[908] Fix | Delete
var secure_nonce = currentThis.attr('data-nonce');
[909] Fix | Delete
$.ajax({
[910] Fix | Delete
url: ajaxurl,
[911] Fix | Delete
method: 'post',
[912] Fix | Delete
data: {action: 'ampforwp_get_licence_activate_update',
[913] Fix | Delete
update_check: 'yes',
[914] Fix | Delete
ampforwp_license_activate:plugin_id,
[915] Fix | Delete
verify_nonce: secure_nonce
[916] Fix | Delete
},
[917] Fix | Delete
dataType: 'json',
[918] Fix | Delete
success: function(response){
[919] Fix | Delete
jQuery("#refresh_expired_addon").removeClass( 'spin' );
[920] Fix | Delete
if(response.status=='200'){
[921] Fix | Delete
var expireData = new Date(response.other.all_data.expires);
[922] Fix | Delete
var today = new Date();
[923] Fix | Delete
var diffTime = Math.abs( expireData.getTime()-today.getTime() );
[924] Fix | Delete
var expireDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
[925] Fix | Delete
if (expireDays > 30) {
[926] Fix | Delete
$("span.before_msg_active").text('Your License is')
[927] Fix | Delete
$("span.lthan_0").text('Your License is')
[928] Fix | Delete
$(".lessthan_30,.pro_warning,.dashicons-no,.renewal-license,.ampforwp-addon-alert,.ooy").css("display","none")
[929] Fix | Delete
$("span.one_of_expired").text('Active')
[930] Fix | Delete
$(".one_of_expired,.expiredinner_span,.lthan_0").css("color","green")
[931] Fix | Delete
$("span.expiredinner_span").text('Active')
[932] Fix | Delete
}
[933] Fix | Delete
}else{
[934] Fix | Delete
jQuery("#refresh_expired_addon").removeClass( 'spin' );
[935] Fix | Delete
}
[936] Fix | Delete
}
[937] Fix | Delete
})
[938] Fix | Delete
[939] Fix | Delete
$.ajax({
[940] Fix | Delete
url: ajaxurl,
[941] Fix | Delete
method: 'post',
[942] Fix | Delete
data: {action: 'ampforwp_set_license_transient',
[943] Fix | Delete
update_check: 'yes',
[944] Fix | Delete
verify_nonce: secure_nonce
[945] Fix | Delete
},
[946] Fix | Delete
dataType: 'json',
[947] Fix | Delete
success: function (s) {
[948] Fix | Delete
JSON.parse(s);
[949] Fix | Delete
},
[950] Fix | Delete
});
[951] Fix | Delete
});
[952] Fix | Delete
// End Refresh to check if user has done renewal in between 0-7 Days & when Expired
[953] Fix | Delete
[954] Fix | Delete
// Start User Refresh when expired
[955] Fix | Delete
$(".user_refr").click(function(){
[956] Fix | Delete
var currentThis = $(this);
[957] Fix | Delete
var plugin_id = currentThis.attr("id");
[958] Fix | Delete
jQuery("#user_refr_addon").addClass( 'spin' );
[959] Fix | Delete
var secure_nonce = currentThis.attr('data-nonce');
[960] Fix | Delete
[961] Fix | Delete
$.ajax({
[962] Fix | Delete
url: ajaxurl,
[963] Fix | Delete
method: 'post',
[964] Fix | Delete
data: {action: 'ampforwp_get_licence_activate_update',
[965] Fix | Delete
update_check: 'yes',
[966] Fix | Delete
ampforwp_license_activate:plugin_id,
[967] Fix | Delete
verify_nonce: secure_nonce
[968] Fix | Delete
},
[969] Fix | Delete
dataType: 'json',
[970] Fix | Delete
success: function(response){
[971] Fix | Delete
jQuery("#user_refr_addon").removeClass( 'spin' );
[972] Fix | Delete
if(response.status=='200'){
[973] Fix | Delete
var expireData = new Date(response.other.all_data.expires);
[974] Fix | Delete
var today = new Date();
[975] Fix | Delete
var diffTime = Math.abs( expireData.getTime()-today.getTime() );
[976] Fix | Delete
var expireDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
[977] Fix | Delete
if (expireDays > 30) {
[978] Fix | Delete
$("span.before_msg_active").text('Your License is')
[979] Fix | Delete
$(".lessthan_30,.pro_warning,.dashicons-no,.renewal-license").css("display","none")
[980] Fix | Delete
$("span.one_of_expired").text('Active')
[981] Fix | Delete
$("span.one_of_expired").css("color","green")
[982] Fix | Delete
}
[983] Fix | Delete
}else{
[984] Fix | Delete
jQuery("#user_refr_addon").removeClass( 'spin' );
[985] Fix | Delete
}
[986] Fix | Delete
}
[987] Fix | Delete
})
[988] Fix | Delete
});
[989] Fix | Delete
// End User Refresh when Expired
[990] Fix | Delete
var extmnger = document.querySelector('a[extmnger_data="1"]');
[991] Fix | Delete
if (extmnger) {
[992] Fix | Delete
var tamp_options = document.getElementById("toplevel_page_amp_options");
[993] Fix | Delete
let collection = tamp_options.querySelectorAll(".wp-submenu a");
[994] Fix | Delete
collection.forEach((ele, ind) => {
[995] Fix | Delete
let p = ele.parentNode;
[996] Fix | Delete
let p_ind = Array.from(document.querySelectorAll('.wp-submenu')).indexOf(p);
[997] Fix | Delete
ind++;
[998] Fix | Delete
p_ind++;
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function