: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
var amp_font_selector = redux_data['amp_font_selector'];
for (var i in allFonts) {
var fontDetail = allFonts[i].fontFamily;
if(amp_font_selector===fontDetail){
$('#amp_font_selector-select').append($('<option value="'+ fontDetail +'" data-font-number="'+ i +'" '+ selected +'> '+ fontDetail +' </option>'));
$('#amp_font_selector_content_single-select').append($('<option value="'+ fontDetail +'" data-font-number="'+ i +'"> '+ fontDetail +' </option>'));
$('#amp_font_selector-select').append($('<option value="sans-serif" data-font-number="'+ i +'"> sans-serif </option>'));
$('#amp_font_selector_content_single-select').append($('<option value="sans-serif" data-font-number="'+ i +'"> sans-serif </option>'));
$('#amp_font_selector-select').append($('<option value="Segoe UI" data-font-number="'+ i +'"> Segoe UI </option>'));
$('#amp_font_selector_content_single-select').append($('<option value="Segoe UI" data-font-number="'+ i +'"> Segoe UI </option>'));
$('#amp_font_selector-select, #amp_font_selector_content_single-select').on('change', function() {
var select = $('option:selected', this).attr('data-font-number');
var fontVariants = data.items[select]?data.items[select].variants:false ;
if($(this).attr("id")=='amp_font_selector-select'){
//$('.select2-search-choice').remove();
$('#amp_font_type-select').html('<option></option>').trigger('change');
//if ( data.items[select] ) {
$('#google_current_font_data').val( JSON.stringify(data.items[select]) );
for (var i in fontVariants) {
$('#amp_font_type-select').append($("<option value='"+ fontVariants[i] +"' > "+fontVariants[i]+"</option>")).trigger('change');
}else if($(this).attr("id")=='amp_font_selector_content_single-select') {
//$('.select2-search-choice').remove();
$('#amp_font_type_content_single-select').html('<option></option>').trigger('change');
$('#google_current_font_data_content_single').val( JSON.stringify(data.items[select]) );
for (var i in fontVariants) {
$('#amp_font_type_content_single-select').append($("<option value='"+ fontVariants[i] +"' > "+fontVariants[i]+"</option>")).trigger('change');
$('#redux_builder_amp-amp-design-selector select').on('change',function(){
amp_font_selector_select_change('design_change', $(this).val());
if( $(this).val() == 1 || $(this).val() == 2 || $(this).val() == 3){
$('.amp-theme-global-subsection').find('.secondary-font-selector th div').text('Secondary Font Selector');
$('.amp-theme-global-subsection').find('.secondary-font-family-selector th div').text('Secondary Font Family Selector');
$('.amp-theme-global-subsection').find('.secondary-font-family-weights th div').text('Secondary Font Family Weight Selector');
$('.amp-theme-global-subsection').find('.secondary-font-selector th div').text('Content Font Selector');
$('.amp-theme-global-subsection').find('.secondary-font-family-selector th div').text('Content Font Family Selector');
$('.amp-theme-global-subsection').find('.secondary-font-family-weights th div').text('Content Font Family Weight Selector');
function amp_font_selector_select_change(callType='', currentdesign=4){
if($('#amp_font_selector-select').length>0){
// Adding Default Font Family
$('#s2id_amp_font_selector-select a').removeClass('select2-default');
if(redux_data.amp_font_selector==''){
switch(redux_data['amp-design-selector']){
redux_data.amp_font_selector = 'Merriweather'
redux_data.amp_font_selector = 'sans-serif'
redux_data.amp_font_selector = 'Roboto Slab'
redux_data.amp_font_selector = 'Poppins'
redux_data.amp_font_selector = 'Poppins'
if(callType=='design_change'){
redux_data.amp_font_selector = 'Merriweather'
redux_data.amp_font_selector = 'sans-serif'
redux_data.amp_font_selector = 'Roboto Slab'
redux_data.amp_font_selector = 'Poppins'
redux_data.amp_font_selector = 'Poppins'
$('#s2id_amp_font_selector-select .select2-chosen').html(redux_data.amp_font_selector);
$('#amp_font_selector-select option[value="'+redux_data.amp_font_selector+'"]').attr("selected", "selected");
$('#amp_font_selector-select').val(redux_data.amp_font_selector).trigger("change");
let fontData = redux_data.google_current_font_data;
// fontData = JSON.parse(fontData);
// console.log(fontData);
if (! fontData.hasOwnProperty('variants')) {
//$('.select2-search-choice').remove();
//$('#amp_font_type-select').html('<option></option>');
for (var i in fontData.variants) {
$('#amp_font_type-select').append($("<option value='"+ fontData.variants[i] +"' > "+fontData.variants[i]+"</option>")).trigger('change');
if(redux_data.amp_font_type==''){
redux_data.amp_font_type = ['regular','500','700'];
if ( redux_data.amp_font_type ) {
$('#s2id_autogen4').remove();
for (var i in redux_data.amp_font_type) {
$('#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>');
//s2.append($('<option>').text(e));
$('#amp_font_type-select option[value='+redux_data.amp_font_type[i]+']').attr('selected','selected').trigger('change');
}//#amp_font_selector-select closed
* Content Font Selectors On load work
* amp_font_selector_content_single
if($('#amp_font_selector_content_single-select').length>0){
// Adding Default Font Family
$('#s2id_amp_font_selector_content_single-select a').removeClass('select2-default');
if(redux_data.amp_font_selector_content_single==''){
redux_data.amp_font_selector_content_single = 'Poppins'
if(redux_data.amp_font_selector_content_single==''){
switch(redux_data['amp-design-selector']){
redux_data.amp_font_selector_content_single = 'Merriweather'
redux_data.amp_font_selector_content_single = 'sans-serif'
redux_data.amp_font_selector_content_single = 'Roboto Slab'
redux_data.amp_font_selector_content_single = 'Poppins'
redux_data.amp_font_selector_content_single = 'Poppins'
if(callType=='design_change'){
redux_data.amp_font_selector_content_single = 'Segoe UI'
redux_data.amp_font_selector_content_single = 'sans-serif'
redux_data.amp_font_selector_content_single = 'PT Serif'
redux_data.amp_font_selector_content_single = 'Poppins'
redux_data.amp_font_selector_content_single = 'Poppins'
$('#s2id_amp_font_selector_content_single-select .select2-chosen').html(redux_data.amp_font_selector_content_single);
$('#amp_font_selector_content_single-select option[value="'+redux_data.amp_font_selector_content_single+'"]').attr("selected", "selected");
$('#amp_font_selector_content_single-select').val(redux_data.amp_font_selector_content_single).trigger("change");
let fontData = redux_data.google_current_font_data_content_single;
// fontData = JSON.parse(fontData);
if (! fontData.variants) {
for (var i in fontData.variants) {
$('#amp_font_selector_content_single-select').append($("<option value='"+ fontData.variants[i] +"' > "+fontData.variants[i]+"</option>")).trigger('change');
if(redux_data.amp_font_type_content_single==''){
redux_data.amp_font_type_content_single = ['regular','500','700'];
if ( redux_data.amp_font_type_content_single ) {
$('#s2id_autogen4').remove();
for (var i in redux_data.amp_font_type_content_single) {
$('#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>');
//s2.append($('<option>').text(e));
$('#amp_font_type_content_single-select option[value='+redux_data.amp_font_type_content_single[i]+']').attr('selected','selected').trigger('change');
}//#amp_font_selector_content_single-select closed
/*---------Google Fonts Ends -------*/
var dataTabRequired = function(){
$('[data-tab-required]').each(function(){
var tabRequired = $(this).attr('data-tab-required');
var currentThis = $(this);
tabRequired = JSON.parse(tabRequired);
$.each(tabRequired,function(k, value){
var currentValue = jQuery('[name="redux_builder_amp['+value[0]+']"]').val();;
if(currentValue!=value[2]){
var reduxOptionTab = function(){
$('.redux-tab-selector').on("click", function(){
var tabId = $(this).attr('data-tab');
var tabRequired = $(this).attr('data-tab-required');
$(this).parents().find('.custom-tab-container').hide();
$('#parent-section-'+ tabId ).show();
$('.redux-tabs-ul').each(function(){
$(this).find('.redux-tab-selector:first').click();
$('select').change(function(){
$( '.redux-action_bar input' ).on('click', function( e ) {
if($(".amp-ls-solve").length){
$(".amp-ls-solve").each(function(k,v){
var license = $(this).val();
var patt = new RegExp("^([A-Za-z0-9+\/]{4})*([A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{2}==)?$");
if( patt.test(window.atob(license)) ){
license = window.atob(license);
});//$(".amp-ls-solve") each closed
$(".redux-ampforwp-ext-activate").on("click", function(){
var currentThis = $(this);
var plugin_id = currentThis.attr("id");
var secure_nonce = currentThis.parents("li").attr('data-ext-secure');
var newlicense = $('#redux_builder_amp_amp-license_'+plugin_id+'_license').val();
var license = $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][license]"]').val();
if(newlicense!='' && newlicense.indexOf("**")<0){
license = window.btoa(newlicense);
$('input[name="redux_builder_amp[amp-license]['+plugin_id+'][license]"]').val(license);
var item_name = $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][item_name]"]').val();
var store_url = $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][store_url]"]').val();
var plugin_active_path = $('input[name="redux_builder_amp[amp-license]['+plugin_id+'][plugin_active_path]"]').val();
currentThis.html("Please Wait...");
data: {action: 'ampforwp_get_licence_activate_update',
ampforwp_license_activate:plugin_id,
license:window.atob(license),
plugin_active_path:plugin_active_path,
verify_nonce: secure_nonce
success: function(response){
currentThis.parents("li").find('.afw-license-response-message').remove();
if(response.status=='200'){
$('#redux_builder_amp_amp-license_'+plugin_id+'_license').remove();
currentThis.parents("li").removeClass("not-active").removeClass("invalid").addClass("active").addClass("valid");
currentThis.html("Deactivate");
currentThis.after("<div class='afw-license-response-message'>"+response.message+'</div>');
currentThis.removeClass('redux-ampforwp-ext-activate').addClass('redux-ampforwp-ext-deactivate');
$('input[name="redux_builder_amp[amp-license]['+plugin_id+'][status]"]').val("valid");
var all_data = response.other.all_data;
$('input[name="redux_builder_amp[amp-license]['+plugin_id+'][all_data][success]"]').val( all_data.success );
$('input[name="redux_builder_amp[amp-license]['+plugin_id+'][all_data][license]"]').val( all_data.license );
$('input[name="redux_builder_amp[amp-license]['+plugin_id+'][all_data][item_name]"]').val( all_data.item_name );
$('input[name="redux_builder_amp[amp-license]['+plugin_id+'][all_data][expires]"]').val( all_data.expires );
$('input[name="redux_builder_amp[amp-license]['+plugin_id+'][all_data][customer_name]"]').val( all_data.customer_name );
$('input[name="redux_builder_amp[amp-license]['+plugin_id+'][all_data][customer_email]"]').val( all_data.customer_email );
//window.location.href = window.location.href;
currentThis.after("<div class='afw-license-response-message'>"+response.message+'</div>');
currentThis.html("Activate");
function AMPforwpreadCookie(name) {
var ca = document.cookie.split(";");
for(var i=0;i < ca.length;i++) {
while (c.charAt(0)==" ") c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
function deactivatelicence(){
$(".ampforwp-ext-refresh").on("click", function(){
var currentThis = $(this);
var plugin_id = currentThis.attr("id");
var lastcheck = AMPforwpreadCookie('plugin_refresh_check');
lastcheck = new Date(lastcheck);
console.log(lastcheck+ " true");
if( typeof lastcheck != undefined){
var diffTime = Math.abs(today.getTime() - lastcheck.getTime());
var diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
var expireDate = new Date(jQuery('[name="redux_builder_amp[amp-license]['+plugin_id+'][all_data][expires]"]').val());
var diffTime = Math.abs( expireDate.getTime()-today.getTime() );
var expireDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
if(diffDays==-1 || diffDays>1 || expireDays<1){
currentThis.text("Please wait...")
document.cookie = "plugin_refresh_check="+today;
var secure_nonce = currentThis.parents("li").attr('data-ext-secure');
data: {action: 'ampforwp_get_licence_activate_update',
ampforwp_license_activate:plugin_id,
verify_nonce: secure_nonce
success: function(response){
currentThis.parents("li").find(".license-tenure").text('')
currentThis.parents("li").find('.afw-license-response-message').remove();
if(response.status=='200'){
var expireData = new Date(response.other.all_data.expires);
var diffTime = Math.abs( expireData.getTime()-today.getTime() );
var expireDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
currentThis.parents("li").find(".license-tenure").text(expireDays+" Days Remaining")
currentThis.parents("li").find('.license-tenure').text(response.message);
currentThis.html('<i class="dashicons-before dashicons-update"></i>Refresh');
$(".dashicons").addClass( 'spin' );
$(".dashicons").removeClass( 'spin' );}, 3000 );
// Start Refresh and check if user has done renewal in between 0-7 Days & when Expired
var ap = document.getElementById("active-plugins-dr");
var remainingdays = ap.getAttribute("data-days");
if ( remainingdays <= 7 ){
jQuery("#refresh_expired_addon").trigger("click");
$(".days_remain").click(function(){
var currentThis = $(this);
var plugin_id = currentThis.attr("id");
jQuery("#refresh_expired_addon").addClass( 'spin' );
var secure_nonce = currentThis.attr('data-nonce');
data: {action: 'ampforwp_get_licence_activate_update',
ampforwp_license_activate:plugin_id,
verify_nonce: secure_nonce
success: function(response){
jQuery("#refresh_expired_addon").removeClass( 'spin' );
if(response.status=='200'){
var expireData = new Date(response.other.all_data.expires);
var diffTime = Math.abs( expireData.getTime()-today.getTime() );
var expireDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
$("span.before_msg_active").text('Your License is')
$("span.lthan_0").text('Your License is')
$(".lessthan_30,.pro_warning,.dashicons-no,.renewal-license,.ampforwp-addon-alert,.ooy").css("display","none")
$("span.one_of_expired").text('Active')
$(".one_of_expired,.expiredinner_span,.lthan_0").css("color","green")
$("span.expiredinner_span").text('Active')
jQuery("#refresh_expired_addon").removeClass( 'spin' );
data: {action: 'ampforwp_set_license_transient',
verify_nonce: secure_nonce
// End Refresh to check if user has done renewal in between 0-7 Days & when Expired
// Start User Refresh when expired
$(".user_refr").click(function(){
var currentThis = $(this);
var plugin_id = currentThis.attr("id");
jQuery("#user_refr_addon").addClass( 'spin' );
var secure_nonce = currentThis.attr('data-nonce');
data: {action: 'ampforwp_get_licence_activate_update',
ampforwp_license_activate:plugin_id,
verify_nonce: secure_nonce
success: function(response){
jQuery("#user_refr_addon").removeClass( 'spin' );
if(response.status=='200'){
var expireData = new Date(response.other.all_data.expires);
var diffTime = Math.abs( expireData.getTime()-today.getTime() );
var expireDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
$("span.before_msg_active").text('Your License is')
$(".lessthan_30,.pro_warning,.dashicons-no,.renewal-license").css("display","none")
$("span.one_of_expired").text('Active')
$("span.one_of_expired").css("color","green")
jQuery("#user_refr_addon").removeClass( 'spin' );
// End User Refresh when Expired
var extmnger = document.querySelector('a[extmnger_data="1"]');
var tamp_options = document.getElementById("toplevel_page_amp_options");
let collection = tamp_options.querySelectorAll(".wp-submenu a");
collection.forEach((ele, ind) => {
let p_ind = Array.from(document.querySelectorAll('.wp-submenu')).indexOf(p);