: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
ele.addEventListener('click', function(){
if (ele.innerText == 'Extensions') {
window.location.href = "admin.php?page=amp-extension-manager"
$(".redux-ampforwp-ext-deactivate").on("click", function(){
var currentThis = $(this);
var plugin_id = currentThis.attr("id");
var secure_nonce = currentThis.parents("li").attr('data-ext-secure');
currentThis.html("Please Wait...");
$deactivateConfirm = confirm("Are you sure you want to Deactivate ?");
data: {action: 'ampforwp_deactivate_license', ampforwp_license_deactivate:plugin_id,
verify_nonce: secure_nonce
success: function(response){
currentThis.parents("li").find('.afw-license-response-message').remove();
if(response.status=='200'){
currentThis.parents(".extension_desc").find("input[name='redux_builder_amp[amp-license][amp-ads-google-adsense][license]']").val("");
currentThis.after("<div class='afw-license-response-message'>"+response.message+'</div>');
window.location.href = window.location.href;
currentThis.html("Deactivate");
var helpSection = function(){
$('.a-f-wp-help-tear').click(function() {
$('.a-f-wp-help-tear').addClass('active');
$('.a-f-wp-help-message').addClass('active');
$('.a-f-wp-help-tear').html("<span><i class='dashicons-no-alt'></i></span>");
$('.a-f-wp-help-tear').removeClass('active');
$('.a-f-wp-help-message').removeClass('active');
$('.a-f-wp-help-message').val('');
$('.a-f-wp-help-tear').html("<span><i class='dashicons-admin-comments'></i></span>");
$('input').on('input', function(e) {
value = $("input").val();
$('.a-f-wp-help-tear').addClass('green');
$('.a-f-wp-help-tear').removeClass('active');
return $('.a-f-wp-help-tear').html("<span><i class='dashicons-admin-comments'></i></span>");
$('.a-f-wp-help-tear').removeClass('green');
$('.a-f-wp-help-tear').addClass('active');
return $('.a-f-wp-help-tear').html("<span><i class='dashicons-no-alt'></i></span>");
var redux_title_modify = function(){
$( '.redux-group-tab-link-a' ).on("click", function(){
if ( link.parent().hasClass( 'empty_section' ) && link.parent().hasClass( 'hasSubSections' ) ) {
var elements = $( this ).closest( 'ul' ).find( '.redux-group-tab-link-a' );
var index = elements.index( this );
link = elements.slice( index + 1, index + 2 );
var el = link.parents( '.redux-container:first' );
var relid = link.data( 'rel' ); // The group ID of interest
var oldid = el.find( '.redux-group-tab-link-li.active:first .redux-group-tab-link-a' ).data( 'rel' );
var panelTitle = el.find( '#' + relid + '_section_group' ).find("h2:first").hide().html();
$('.redux-main').find("#info_bar h2#newTitle").remove();
if (typeof panelTitle !== 'undefined' || panelTitle){
$('.redux-main').find("#info_bar a.expand_options").after('<h2 id="newTitle" style="float: left;margin: 0px;padding-left: 10px;">'+panelTitle+'</h2>');
$('li.active .redux-group-tab-link-a').click();
function getQueryStringValue (key) {
return decodeURIComponent(window.location.search.replace(new RegExp("^(?:.*[&\\?]" + encodeURIComponent(key).replace(/[\.\+\*]/g, "\\$&") + "(?:\\=([^&]*))?)?.*$", "i"), "$1"));
jQuery(document).ready(function($){
// Dismiss button functionlaity
$('#ampforwp-wizard-notice').on('click', 'button', function(){
'action': 'ampforwp_notice_delete',
jQuery.post(ajaxurl, notice, function(response) {
if(redux_data.ampforwp_css_tree_shaking == '0'){
jQuery('#ampforwp-clear-clearcss-data').addClass('hide');
jQuery('#ampforwp-clear-clcss-msg').html('Please Save Before Clearing Cache');
$('#ampforwp-clear-clearcss-data').click(function(e){
$('#ampforwp-clear-clcss-msg').removeClass('hide');
$('#ampforwp-clear-clcss-msg').text(' Please wait').css({'line-height':'25px'});
'action': 'ampforwp_clear_css_tree_shaking',
'nonce': $(this).attr('data-nonce')
success: function(response) {
if(response.status==200){
$('#ampforwp-clear-clcss-msg').text(' '+response.message).css({'line-height':'25px'});
// AMP FrontPage notice in Reading Settings #2348
if ( 'false' == redux_data.frontpage){
$('#page_on_front').parent('label').append('<p class="afp" style="margin-left:10px;display:none"><span>We have detected that you have not setup the FrontPage for AMP, </span><a href="'+redux_data.admin_url+'">Click here to setup</a></span>');
$('#front-static-pages input[type=radio][name=show_on_front]').on('change', function(e) {
if ( this.value == 'page') {
var sfp = $('#front-static-pages input[type=radio][checked=checked]');
if(sfp[0].value == 'page'){
});//(document).ready Closed
jQuery(window).on("YoastSEO:ready",function(){
AmpForWpYoastAnalysis = function() {
YoastSEO.app.registerPlugin( 'ampForWpYoastAnalysis', {status: 'ready'} );
* @param modification {string} The name of the filter
* @param callable {function} The callable
* @param pluginName {string} The plugin that is registering the modification.
* @param priority {number} (optional) Used to specify the order in which the callables
* associated with a particular filter are called. Lower numbers
* correspond with earlier execution.
YoastSEO.app.registerModification( 'content', this.myContentModification, 'ampForWpYoastAnalysis', 5 );
* Adds some text to the data...
* @param data The data to modify
AmpForWpYoastAnalysis.prototype.myContentModification = function(data) {
if(jQuery('#amp-page-builder-ready').length){
var pbdata = jQuery('#amp-page-builder-ready').html();
var takeover = redux_data['ampforwp-amp-takeover'];
var pb2 = jQuery('input[name="ampforwp_page_builder_enable"]:checked').val();
if ( takeover == 1 && 'yes' == pb2 ) {
new AmpForWpYoastAnalysis();
jQuery(document).ready(function($){
$("#redux_builder_amp-swift-sidebar").on( 'change', function(){
var value = $('#redux_builder_amp-swift-sidebar #swift-sidebar').val();
$("#single-design-type_2").attr('checked', true);
$("#single-design-type_1").attr('checked', true);
//Toggle Post and Page comments panel based on options
if($('#ampforwp-display-on-pages').length>0 && $('#ampforwp-display-on-posts').length>0){
var pageComments = $('#ampforwp-display-on-pages').val();
var postComments = $('#ampforwp-display-on-posts').val();
if( pageComments ==0 && postComments == 0 ){
$('#section-ampforwp-comments').hide();
$('#section-table-ampforwp-comments tbody').hide();
$("#redux_builder_amp-ampforwp-display-on-posts").on('change','input[type=checkbox]', function(){
var pageComments = $('#ampforwp-display-on-pages').val();
if($(this).is(":checked")) {
$('#section-ampforwp-comments').show();
$('#section-table-ampforwp-comments tbody').show();
$('#section-ampforwp-comments').hide();
$('#section-table-ampforwp-comments tbody').hide();
$('#section-ampforwp-comments').show();
$('#section-table-ampforwp-comments tbody').show();
$("#redux_builder_amp-ampforwp-display-on-pages").on('change','input[type=checkbox]', function(){
var postComments = $('#ampforwp-display-on-posts').val();
if($(this).is(":checked")) {
$('#section-ampforwp-comments').show();
$('#section-table-ampforwp-comments tbody').show();
$('#section-ampforwp-comments').hide();
$('#section-table-ampforwp-comments tbody').hide();
$('#section-ampforwp-comments').show();
$('#section-table-ampforwp-comments tbody').show();
jQuery(document).ready(function($) {
var cls = $('.ampforwp-new-ux' ).hasClass('active');
$('#redux-footer-sticky').hide();
$(".redux-group-tab-link-li").on("click", function(){
var this_c_val = $(this).children('a').children('span.group_title').html();
if($(this).hasClass('ampforwp-new-ux') || $(this).hasClass('opt-go-premium')){
$('#redux-footer-sticky').hide();
$('#redux-footer-sticky #redux-footer').addClass("hide");
$('#redux-footer-sticky').show();
$('#redux-footer-sticky #redux-footer').removeClass("hide");
// There is no save button in AMP "Basic setup" #4343
var selected = $(".amp-opt-change:checked").parent().find('label').attr('id');
if(!$(this).hasClass('ampforwp-new-ux') && !$(this).hasClass('opt-go-premium')){
$('#redux-footer-sticky').show();
$('#redux-footer-sticky #redux-footer').removeClass("hide");
$('#redux-footer-sticky').hide();
$('#redux-footer-sticky #redux-footer').addClass("hide");
var new_data = JSON.parse(amp_fields);
var ampforwp_saveChangesInRedux = function($current){
window.onbeforeunload = null;
if ( redux.args.ajax_save === true ) {
$.redux.ajax_save( $current, true );
var ampCheckRequired = function($current){
var current_id = self.attr('id');
var current_value = self.val();
var new_data = JSON.parse(amp_fields);
if( self.attr('type') == 'checkbox' ) {
if(self.prop("checked") == true){
else if(self.prop("checked") == false){
$.each(new_data, function(key,value) {
if (value.field_data.required ){
var required = value.field_data.required;
var child_element = $('#'+value.field_data.id);
if( required[0] == current_id){
if( required[2] == current_value){
if( value.field_type == 'checkbox' ) {
$(child_element).parent().parent('div').removeClass('hide');
$(child_element).parent('div').removeClass('hide');
if( value.field_type == 'checkbox' ) {
$(child_element).parent().parent('div').addClass('hide');
$(child_element).parent('div').addClass('hide');
if( required[0] == current_id ) {
if(required[2] != current_value){
$(child_element).parent('div').removeClass('hide');
$(child_element).parent('div').addClass('hide');
if( required[0] == current_id ){
if(jQuery.inArray(current_value,required[2]) ){
$(child_element).parent('div').removeClass('hide');
$(child_element).parent('div').addClass('hide');
$('div.amp-ux-color-container').find('input').wpColorPicker({});
if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)){
c= hex.substring(1).split('');
c= [c[0], c[0], c[1], c[1], c[2], c[2]];
return 'rgba('+[(c>>16)&255, (c>>8)&255, c&255].join(',')+',1)';
throw new Error('Bad Hex');
$('#section-table-ampforwp-ux-website-type-section').addClass('drawer');
$('div.ampforwp-new-ux').find('div.ampforwp-ux-section-right').each(function(){
var selector = 'data-id="'+$(this).attr('id').replace('section-','')+'"';
$(this).parent().find($('table['+selector+']')).addClass('drawer');
$('.redux-group-menu').find('.redux-group-tab-link-li').each(function(){
$(this).on('click', function(){
if($(this).hasClass('ampforwp-new-ux')){
$('div.sticky-footer-fixed').addClass('hide');
$('div.sticky-footer-fixed').removeClass('hide');
function ampforwp_set_ux_selected_val(){
var active_drower = localStorage.getItem('ampforwp_current_drawer_click');
if(active_drower=='ampforwp-ux-website-type-section'){
thishtml = $("#ampforwp-ux-select option:selected").text();
if(thishtml=="Select Option"){
thishtml = $("#ampforwp-website-type-other").val();
}else if(active_drower=='ampforwp-ux-need-type-section'){
$(".amp-ux-field").each(function(){
var thisid = $(this).attr('id');
if(thisid=="amp-ux-homepage" || thisid=="amp-ux-frontpage" || thisid=="amp-ux-posts" || thisid=="amp-ux-pages" || thisid=="amp-ux-archives"){
if($(this).prop('checked')){
if(thisid=="amp-ux-homepage"){
need_type_arr.push('Home');
}else if(thisid=="amp-ux-posts"){
need_type_arr.push('Posts');
}else if(thisid=="amp-ux-pages"){
need_type_arr.push('Pages');
}else if(thisid=="amp-ux-archives"){
need_type_arr.push('Archives');
thishtml = need_type_arr.toString().replace(/,/g, ", ");
}else if(active_drower=='ampforwp-ux-design-section'){
}else if(active_drower=='ampforwp-ux-analytics-section'){
var ga_field = $('#ga-feild').val();
var ga_field_gtm = $('#amp-gtm-id').val();
var amp_fb_pixel_id = $('#amp-fb-pixel-id').val();
var sa_feild = $('#sa-feild').val();
var pa_feild = $('#pa-feild').val();
var quantcast_c = $('#amp-quantcast-analytics-code').val();
var comscore_c1 = $('#amp-comscore-analytics-code-c1').val();
var comscore_c1 = $('#amp-comscore-analytics-code-c2').val();
var eam_c = $('#eam-feild').val();
var sc_c = $('#sc-feild').val();
var histats_c = $('#histats-field').val();
var yemdex_c = $('#amp-Yandex-Metrika-analytics-code').val();
var chartbeat_c = $('#amp-Chartbeat-analytics-code').val();
var alexa_c = $('#ampforwp-alexa-account').val();
var alexa_d = $('#ampforwp-alexa-domain').val();
var host = $('#ampforwp-adobe-host').val();
var adobe_orgid = $('#ampforwp-adobe-orgid').val();
var adobe_type = $('#ampforwp-adobe-type').val();
var adobe_subdomain = $('#ampforwp-adobe-subdomain').val();
var ReportSuiteId = $('#ampforwp-adobe-reportsuiteid').val();
var afs_c = $('#ampforwp-afs-siteid').val();
var clicky_side_id = $('#clicky-site-id').val();
var cr_config_url = $('#ampforwp-callrail-config-url').val();
var cr_number = $('#ampforwp-callrail-number').val();
var cr_analytics_url = $('#ampforwp-callrail-analytics-url').val();
var ppas_host = $('#ppas-host').val();
var ppas_id = $('#ppas-website-id').val();
var ppas_hash = $('#ppas-website-hash').val();
$(".ampforwp-ux-ana-sub").each(function(){
var data_href = $(this).attr('data-href');
var hasCls = $(this).hasClass('hide');
if(ga_field!="UA-XXXXX-Y" && ga_field!="" && !hasCls && data_href=='ampforwp-ga-switch'){analytic_arr.push("Google Analytics");}
if(ga_field_gtm!="" && !hasCls && data_href=='amp-use-gtm-option'){analytic_arr.push("Google Tag Manager");}
if(amp_fb_pixel_id!="" && !hasCls && data_href=='amp-fb-pixel'){analytic_arr.push("Facebook Pixel");}
if(sa_feild!="SEGMENT-WRITE-KEY" && sa_feild!="" && !hasCls && data_href=='ampforwp-Segment-switch'){analytic_arr.push("Segment Analytics");}
if(pa_feild!="#" && pa_feild!="" && !hasCls && data_href=='ampforwp-Piwik-switch'){ analytic_arr.push("Matomo Analytics");}
if(quantcast_c!="" && !hasCls && data_href=='ampforwp-Quantcast-switch'){ analytic_arr.push("Quantcast Measurement");}
if(comscore_c1!="" && comscore_c1!="" && !hasCls && data_href=='ampforwp-comScore-switch'){analytic_arr.push("comScore");}
if(eam_c!="#" && eam_c!="" && !hasCls && data_href=='ampforwp-Effective-switch'){analytic_arr.push("Effective Measure");}
if(sc_c!="#" && sc_c!="" && !hasCls && data_href=='ampforwp-StatCounter-switch'){analytic_arr.push("StatCounter");}
if(histats_c!="" && !hasCls && data_href=='ampforwp-Histats-switch'){analytic_arr.push("Histats Analytics");}
if(yemdex_c!="" && !hasCls && data_href=='ampforwp-Yandex-switch'){analytic_arr.push("Yandex Metrika");}
if(chartbeat_c!="" && !hasCls && data_href=='ampforwp-Chartbeat-switch'){analytic_arr.push("Chartbeat Analytics");}
if(alexa_c!="" && alexa_d!="" && !hasCls && data_href=='ampforwp-Alexa-switch'){analytic_arr.push("Alexa Metrics");}
if(host!="" && ReportSuiteId!="" && !hasCls && (adobe_type=='adobeanalytics_native' && adobe_orgid!="" && adobe_subdomain!="" || adobe_type=='adobeanalytics') && data_href=='ampforwp_adobe_switch'){analytic_arr.push("Adobe Analytics");}
if(afs_c!="" && !hasCls && data_href=='ampforwp-afs-analytics-switch'){analytic_arr.push("AFS Analytics");}
if(clicky_side_id!="" && !hasCls && data_href=='amp-clicky-switch'){analytic_arr.push("Clicky Analytics");}
if(cr_config_url!="" && cr_number!="" && cr_analytics_url!="" && !hasCls && data_href=='ampforwp-callrail-switch'){analytic_arr.push("Call Rail Analytics");}
if(ppas_host!="" && ppas_id!="" && ppas_hash!="" && data_href=='ampforwp-Piwik-Pro-switch'){analytic_arr.push("Piwik Pro Analytics");}
thishtml = analytic_arr.toString().replace(/,/g, ", ");
}else if(active_drower=='ampforwp-ux-privacy-section'){
var cookie_switch = $("#amp-ux-notice-switch").val();
var gdpr_switch = $("#amp-ux-gdpr-switch").val();
policy_arr.push("Cookie Consent");
thishtml = policy_arr.toString().replace(/,/g, ", ");
option = '<div class="filled-lbl-blk">'+
'<p class="msg">'+thishtml+'</p>'+
'<span class="lbl">Change</span>'+