: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
'desc' => esc_html__('Switch this on to enable advertising on Instant Article pages.', 'accelerated-mobile-pages'),
'required' => array('fb-instant-article-switch', '=', 1)
'id' => 'fb-instant-article-ad-type',
'title' => esc_html__('Select Advertisement Format', 'accelerated-mobile-pages'),
'desc' => esc_html__('Select the type of advertising on Instant Article pages you want to display.', 'accelerated-mobile-pages'),
'1' => 'Facebook Audience Network',
'2' => 'Custom iframe URL',
'3' => 'Custom Embed Code'
'required' => array('fb-instant-article-ads', '=', 1)
'id' => 'fb-instant-article-ad-id',
'title' => esc_html__('Enter your Audience Network Placement ID', 'accelerated-mobile-pages'),
'tooltip-subtitle' => sprintf('%s <a href="%s">%s</a>.', esc_html__('You can find out more about this','accelerated-mobile-pages'), esc_url('https://developers.facebook.com/docs/instant-articles/monetization/audience-network'),esc_html__('here','accelerated-mobile-pages') ),
'desc' => sprintf('<a href="%s" target="_blank">%s</a> %s', esc_url('https://ampforwp.com/tutorials/article/how-to-enter-audience-network-placement-id-of-advertisement-in-the-instant-article/'), esc_html__('Click here','accelerated-mobile-pages'), esc_html__('on how to get Audience Network Placement Id.','accelerated-mobile-pages')),
'required' => array('fb-instant-article-ad-type', '=', '1')
'id' => 'fb-instant-article-custom-iframe-ad',
'placeholder'=> 'https://www.adserver.com/ss',
'title' => esc_html__('Enter your Custom iframe ad source URL'),
'required' => array('fb-instant-article-ad-type', '=', '2')
'id' => 'fb-instant-article-custom-embed-ad',
'title' => esc_html__('Enter your Custom Embed ad code'),
'required' => array('fb-instant-article-ad-type', '=', '3')
'id' => 'fb-instant-article-ad-density-setup',
'title' => esc_html__('How often should ads show in Instant Article pages', 'accelerated-mobile-pages'),
'default' => esc_html__('Every 250 words', 'accelerated-mobile-pages' ),
'medium' => esc_html__('Every 350 words', 'accelerated-mobile-pages' ),
'low' => esc_html__('Every 500 words', 'accelerated-mobile-pages' ),
'required' => array('fb-instant-article-ads', '=', 1),
'id' => 'fb-instant-article-analytics',
'title' => esc_html__('Analytics', 'accelerated-mobile-pages'),
'desc' => esc_html__('Switch this on to enable analytics on Instant Article pages.', 'accelerated-mobile-pages'),
'required' => array('fb-instant-article-switch', '=', 1)
'id' => 'fb-instant-article-analytics-code',
'title' => esc_html__('Enter your Analytics script code', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Do not enter iframe tag. Find out more about support <a href="https://developers.facebook.com/docs/instant-articles/analytics">here</a> ', 'accelerated-mobile-pages'),
'required' => array('fb-instant-article-analytics', '=', 1)
'id' => 'fb-instant-crawler-ingestion',
'title' => esc_html__('Crawler Ingestion', 'accelerated-mobile-pages'),
'tooltip-subtitle' => sprintf('%s <a href="%s" target="_blank">%s</a>',
esc_html__('Add ia:markup meta tag. Find out more about', 'accelerated-mobile-pages'), esc_url('https://developers.facebook.com/docs/instant-articles/crawler-ingestion'), esc_html__('here','accelerated-mobile-pages')),
'required' => array('fb-instant-article-switch', '=', 1)
'id' => 'fb-instant-feedback',
'title' => esc_html__('Feedback for Media', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Allow like and comment for media', 'accelerated-mobile-pages'),
'required' => array('fb-instant-article-switch', '=', 1)
'id' =>'hide-amp-ia-categories',
'title' => esc_html__('Select Categories to Hide in IA'),
'tooltip-subtitle' => esc_html__( 'Hide IA from all the posts of a selected category.', 'accelerated-mobile-pages' ),
'data-action' => 'ampforwp_categories',
'options' => ampforwp_get_categories('hide-amp-ia-categories'),
'required' => array('fb-instant-article-switch', '=', 1)
'id' => 'fbia-header-text-area',
'title' => esc_html__('Custom HTML in Head Tag', 'accelerated-mobile-pages'),
'desc' => esc_html__('Add custom HTML in Head Tag in Instant Articles Markup. Click','accelerated-mobile-pages').' <a href="https://developers.facebook.com/docs/instant-articles/guides/articlecreate" target="_blank">'.esc_html__('here', 'accelerated-mobile-pages').'</a>'. esc_html__(' for more info on Instant Articles Markup', 'accelerated-mobile-pages'),
'required' => array('fb-instant-article-switch', '=', 1)
'id' => 'fbia-body-text-area',
'title' => esc_html__('Custom HTML in Body Tag', 'accelerated-mobile-pages'),
'desc' => esc_html__('Add custom HTML in Body Tag in Instant Articles Markup. Click','accelerated-mobile-pages').' <a href="https://developers.facebook.com/docs/instant-articles/guides/articlecreate" target="_blank">'.esc_html__('here', 'accelerated-mobile-pages').'</a>'. esc_html__(' for more info on Instant Articles Markup', 'accelerated-mobile-pages'),
'required' => array('fb-instant-article-switch', '=', 1)
'id' => 'fbia-footer-text-area',
'title' => esc_html__('Custom HTML in Footer Tag', 'accelerated-mobile-pages'),
'desc' => esc_html__('Add custom HTML in Footer Tag in Instant Articles Markup. Click','accelerated-mobile-pages').' <a href="https://developers.facebook.com/docs/instant-articles/guides/articlecreate" target="_blank">'.esc_html__('here', 'accelerated-mobile-pages').'</a>'. esc_html__(' for more info on Instant Articles Markup', 'accelerated-mobile-pages'),
'required' => array('fb-instant-article-switch', '=', 1)
function ampforwp_get_post_percent(){
$total_post = $post_count = $post_percent = '';
'ignore_sticky_posts'=>1,
'has_password' => false ,
'post_status'=> 'publish',
'key' => 'ampforwp-amp-on-off',
'compare' => 'NOT EXISTS',
$my_query = new wp_query( $args );
$post_count = $my_query->post_count;
$count_posts = wp_count_posts();
$total_post = $count_posts->publish;
$post_count = $total_post-$post_count;
$post_percent = ($post_count/$total_post)*100;
$post_percent = $post_percent - 24;
return round($post_percent);
$current_page = ampforwp_get_admin_current_page();
$refresh_text = esc_html__('All post metas are upto date.', 'accelerated-mobile-pages'); ;
if($current_page=="amp_options"){
$post_percent = ampforwp_get_post_percent();
if ($post_percent != 100) {
$refresh_btn = "<span class='button button-primary button-small' id='ampforwp-refersh-related-post' target='_blank' data-id='".intval($post_percent)."' data-nonce='".wp_create_nonce( 'ampforwp_refresh_related_poost')."'><i class='el el-refresh'></i> Refresh</span>";
$refresh_text = esc_html__('It will refresh only 30 records at once, please try refreshing until it will complete to 100%', 'accelerated-mobile-pages');
Redux::setSection( $opt_name, array(
'title' => esc_html__( 'Tools', 'accelerated-mobile-pages' ),
'id' => 'hide-amp-section',
'id' => 'hide-amp-bulk-tools',
'title' => esc_html__('Hide AMP Bulk Tools', 'accelerated-mobile-pages'),
'layout_type' => 'accordion',
'id' => 'amp-pages-meta-default',
'title' => esc_html__( 'Individual AMP Page (Bulk Edit)', 'accelerated-mobile-pages' ),
'tooltip-subtitle' => esc_html__( 'Allows you to Show or Hide AMP from All pages, so it can be changed individually later. This option will change the Default value of AMP metabox in Pages', 'accelerated-mobile-pages' ),
'desc' => esc_html__( 'NOTE: Changes will overwrite the previous settings.', 'accelerated-mobile-pages' ),
'show' => esc_html__('Show by Default', 'accelerated-mobile-pages' ),
'hide' => esc_html__('Hide by default', 'accelerated-mobile-pages' ),
'required'=>array('amp-on-off-for-all-pages','=','1'),
'id' =>'hide-amp-categories2',
'title' => esc_html__('Select Categories to Hide AMP posts'),
'tooltip-subtitle' => esc_html__( 'Hide AMP from all the posts of a selected category.', 'accelerated-mobile-pages' ),
'options' => ampforwp_get_categories('hide-amp-categories2'),
'data-action' => 'ampforwp_categories',
'id' =>'hide-amp-tags-bulk-option2',
'title' => esc_html__('Select Tags to Hide AMP posts'),
'tooltip-subtitle' => esc_html__( 'Hide AMP from all the posts of a selected tags.', 'accelerated-mobile-pages' ),
'options' => ampforwp_get_all_tags('hide-amp-tags-bulk-option2'),
'data-action' => 'ampforwp_tags',
'id' => 'amp-other-tools',
'title' => esc_html__('Others', 'accelerated-mobile-pages'),
'layout_type' => 'accordion',
'id' => 'ampforwp-query-monitor',
'title' => esc_html__('Show Query Monitor data in AMP', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Enable/Disable Query Monitor for amp when logged in as admin and Query Monitor Plugin installed', 'accelerated-mobile-pages'),
'id' => 'ampforwp-refersh-related-post',
'title' => esc_html__('Refresh Related Post', 'accelerated-mobile-pages'),
'content' => $refresh_btn /* XXS OK */."
<div class='ref-rel-bar-cont'>
<div id='ref_rel_post_bar' class='ref-rel-post-bar' style='width:".intval($post_percent)."%;'>".intval($post_percent)."%</div>
'tooltip-subtitle' => esc_html__('If related post is not showing up properly, please refresh it and check it once again.', 'accelerated-mobile-pages'),
'description' => $refresh_text, /* XXS OK */
// Advance Settings SECTION
function ampforwp_featured_video_default(){
if(function_exists( 'csco_setup' )){
$default = 'csco_post_embed';
Redux::setSection( $opt_name, array(
'title' => esc_html__( 'Advance Settings', 'accelerated-mobile-pages' ),
'desc' => esc_html__( 'This section has some advanced settings, please use it with care','accelerated-mobile-pages'),
'id' => 'amp-mobile-redirection',
'title' => esc_html__('Mobile Redirection', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('
Enable AMP for your mobile users. Give your visitors a Faster mobile User Experience.','accelerated-mobile-pages'),
'id' => 'amp-mob-redirection-pres-link',
'class' => 'child_opt child_opt_arrow',
'title' => esc_html__('Preserve Original Permalinks', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Enable/Disable Mobile redirection for preserve original permalinks.','accelerated-mobile-pages'),
'required' => array( 'amp-mobile-redirection', '=' , 1 )
'id' => 'amp-tablet-redirection',
'class' => 'child_opt child_opt_arrow',
'title' => esc_html__('Tablets', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Enable/Disable Mobile redirection for Tablets.','accelerated-mobile-pages'),
'required' => array( 'amp-mobile-redirection', '=' , 1 )
'id' => 'amp-server-side-rendering',
'title' => esc_html__('Server Side Rendering', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Improve the Google Page Speed and Loading time with Server Side Rendering', 'accelerated-mobile-pages'),
'id' => 'amp-redirection-search',
'title' => esc_html__('Search Result Page in AMP', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Disable this option if you want your search pages in Non-AMP.','accelerated-mobile-pages'),
'id' => 'amp-desktop-redirection',
'title' => esc_html__('Disable AMP on Desktop', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('
Enable this option to give your visitors normal version on Desktop when accessing AMP','accelerated-mobile-pages'),
'id' => 'convert-internal-nonamplinks-to-amp',
'title' => esc_html__('Change Internal Links to AMP', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Enable if you want all your links inside the article to go to /amp/. All the outbound links will remain untouched.','accelerated-mobile-pages'),
'id' => 'hide-amp-version-from-source',
'title' => esc_html__('Hide AMP Version', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Enable if you want hide AMP version in view source page(generator).','accelerated-mobile-pages'),
'id' => 'ampforwp-cat-description',
'title' => esc_html__('Category Description', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Disable this option if you dont want to show category description in AMP','accelerated-mobile-pages'),
'id' => 'ampforwp-smooth-scrolling-for-links',
'title' => esc_html__('Smooth Scrolling For Links', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Enable this option if you want smooth scrolling for jumping links','accelerated-mobile-pages'),
'id' => 'ampforwp-amp-convert-to-wp',
'title' => esc_html__('Convert AMP to WP theme (Beta)', 'accelerated-mobile-pages'),
'tooltip-subtitle' => sprintf( '%s<a href="%s" target="_blank">%s</a>%s', esc_html__("It makes your AMP & Non-AMP Same! (AMP will output AMP Compatible code, while WordPress will have the WP code but with the same design and ",'accelerated-mobile-pages'),esc_url('https://ampforwp.com/tutorials/article/how-to-convert-your-non-amp-website-to-amp/'),esc_html__('Click Here','accelerated-mobile-pages'),esc_html__(' for more info','accelerated-mobile-pages')),
'default' => ampforwp_amp2wp_default(),
array('amp-design-selector', '=', '4'),
array('ampforwp-amp-takeover', '=' , '0'),
'id' => 'ampforwp-right-click-disable',
'title' => esc_html__('Disable Right Click', 'accelerated-mobile-pages'),
'tooltip-subtitle' => sprintf('%s <a href="%s" target="_blank">%s</a> %s',
esc_html__('Enable this option if you want a disable the right click in AMP to protect your data from copying', 'accelerated-mobile-pages'), esc_url('https://ampforwp.com/tutorials/article/how-to-disable-right-click-in-amp/'),esc_html__('Click Here','accelerated-mobile-pages'), esc_html__('for more info','accelerated-mobile-pages')),
'id' => 'ampforwp-meta-viewport',
'title' => esc_html__('Full Meta Viewport', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Enable this option if you want full meta viewport','accelerated-mobile-pages'),
'id' => 'ampforwp-meta-viewport-notice',
'desc' => esc_html__('Enabling this causes a 300-350ms tap delay which can decrease FID ( First Input Delay ). Please use this with caution.', 'accelerated-mobile-pages'),
'required' => array('ampforwp-meta-viewport', '=', 1)
'id' => 'ampforwp-search-google',
'title' => esc_html__('Search Results in Google', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Enable this option if you want the search results as Google search','accelerated-mobile-pages'),
'id' => 'amp-header-text-area-for-html',
'title' => esc_html__('Enter HTML in Head', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('please enter markup that is AMP validated', 'accelerated-mobile-pages'),
'desc' => esc_html__('check your markup here (enter markup between HEAD tag) : https://validator.ampproject.org/', 'accelerated-mobile-pages'),
'id' => 'amp-body-text-area',
'title' => esc_html__('Enter HTML in Body (beginning of body tag) ', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('please enter markup that is AMP validated', 'accelerated-mobile-pages'),
'desc' => esc_html__('check your markup here (enter markup in the beginning of body tag) : https://validator.ampproject.org/', 'accelerated-mobile-pages'),
'id' => 'amp-footer-text-area-for-html',
'title' => esc_html__('Enter HTML in Footer', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('please enter markup that is AMP validated', 'accelerated-mobile-pages'),
'desc' => esc_html__('check your markup here (enter markup between BODY tag) : https://validator.ampproject.org/',
'accelerated-mobile-pages'),
'id' => 'amp-prefetch-options',
'title' => esc_html__('DNS Priority URL(s)', 'accelerated-mobile-pages'),
'tooltip-subtitle' => sprintf( '%s<a href="%s" target="_blank">%s</a>%s', esc_html__("DNS Priority ask your browser to do a DNS lookup and connection before you need any resources from that domain. ",'accelerated-mobile-pages'),esc_url('https://ampforwp.com/tutorials/article/how-to-use-dns-prefetch-urls-in-amp/'),esc_html__('Click Here','accelerated-mobile-pages'),esc_html__(' for more info','accelerated-mobile-pages')),
'id' => 'amp-dns-urls-type',
'dns-prefetch'=>'DNS-Prefetch',
'preconnect'=>'Preconnect'
'id' => 'amp-dns-urls-field',
'id' => 'ampforwp-auto-amp-menu-link',
'title' => esc_html__('Auto Add AMP in Menu URL', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Automatically add <code>AMP</code> at the end of menu url', 'accelerated-mobile-pages'),
//'required' => array('ampforwp-amp-menu', '=' , '1')
//Category Base Removal in AMP
'id' => 'ampforwp-category-base-removel-link',
'title' => esc_html__('Category base remove in AMP', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Category base removal in <code>AMP</code> from url', 'accelerated-mobile-pages'),
//Tag base Removal in AMP
'id' => 'ampforwp-tag-base-removal-link',
'title' => esc_html__('Tag base remove in AMP', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Tag base remove in <code>AMP</code> from url', 'accelerated-mobile-pages'),
// Featured Image from Custom Fields
'id' => 'ampforwp-custom-fields-featured-image-switch',
'title' => esc_html__('Featured Image from Custom Fields', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('This will allow you to add Featured Image from Custom Fields', 'accelerated-mobile-pages'),
'id' => 'ampforwp-custom-fields-featured-image',
'title' => esc_html__('Custom Field For Featured Image', 'accelerated-mobile-pages'),
'default' => esc_html__ ('','accelerated-mobile-pages'),
'placeholder'=>esc_html__('Write the Custom Field of Featured Image','accelerated-mobile-pages'),
'required' => array( 'ampforwp-custom-fields-featured-image-switch', '=' , 1 )
// Grab the First Image for Featured Image if there is none
'id' => 'ampforwp-featured-image-from-content',
'title' => esc_html__('Featured Image from The Content', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Show the first image of the content as Featured Image if there is no featured image', 'accelerated-mobile-pages'),
// Duplicate Featured Image
'id' => 'ampforwp-duplicate-featured-image',
'title' => esc_html__('Show Featured Image if already preset in content.', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Turn On the support if you want to show the Featured Image if it already exists in post content.', 'accelerated-mobile-pages'),
// DEFAULT FALLBACK IMAGE
'id' => 'ampforwp_default_fallback_image',