: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
// HIDE/SHOW TAG AND CATEGORY #4326
function ampforwp_get_taxonomy_meta($term_id,$type=''){
if($type=='' || $type=='data'){
$amp_taxonomy = get_term_meta( $term_id,'amp_taxonomy');
$amp_hide_tax = get_term_meta( $term_id,'amp_hide_tax');
$data = array('visible'=>$amp_taxonomy,'visible_status'=>$amp_hide_tax);
}else if($type=='status'){
$amp_taxonomy = get_term_meta( $term_id,'amp_taxonomy');
if(isset($amp_taxonomy[0]) && $amp_taxonomy[0]=='hide'){
}else if($type=='post_status'){
$term = wp_get_post_terms(ampforwp_get_the_ID(),array('category','post_tag'));
foreach ($term as $key => $value) {
$amp_taxonomy = get_term_meta( $value->term_id,'amp_taxonomy');
$amp_hide_tax = get_term_meta( $value->term_id,'amp_hide_tax');
if(isset($amp_taxonomy[0]) && $amp_taxonomy[0]=='hide' && $amp_hide_tax[0]=='hide-tax-post'){
function ampforwp_internal_feedback_notice(){
$install_date = get_option('ampforwp_plugin_info');
if (isset($install_date["activation_data"])) {
$install_date = $install_date["activation_data"];
$install_date = date("m-d-Y", $install_date);
$activation_never = get_option("ampforwp_feedback_remove_notice");
if (strtotime($install_date) < strtotime('-30 days') && $activation_never !='remove') {?>
<div class="updated notice ampforwp_remove_notice" style="box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);background-color:white;">
<?php esc_html_e('Awesome, you\'ve been using AMPforWP for more than 1 month. May I ask you to give it a 5-star rating on WordPress.org?', 'accelerated-mobile-pages'); ?></br>
<?php esc_html_e('This will help spread the word out about this plugin and will encourage us to continue the development.', 'accelerated-mobile-pages'); ?></br>
<?php esc_html_e('Much appreciated, thank you very much.', 'accelerated-mobile-pages'); ?></br></br>
<a href="https://wordpress.org/support/plugin/accelerated-mobile-pages/reviews/?rate=5#new-post" class="button-primary" target="_new" style="font-weight:bold;" title="Ok, you deserved it"> <?php echo esc_html__('Ok, You deserve it', 'accelerated-mobile-pages') ?></a>
<a class="button-primary" id="ampforwp-close-notice" style="font-weight:bold;"><?php echo esc_html__('Not Now', 'accelerated-mobile-pages') ?></a>
function ampforwp_feedback_remove_notice(){
$result = update_option( "ampforwp_feedback_remove_notice", 'remove', false);
echo wp_json_encode(array('status'=>'t'));
echo wp_json_encode(array('status'=>'f'));
add_action('wp_ajax_ampforwp_feedback_remove_notice', 'ampforwp_feedback_remove_notice');
function ampforwp_pro_extension_manager_notice(){?>
<div class="updated notice ampforwp_remove_notice" style="box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);background-color:white;">
<?php echo esc_html__('AMP Pro Extension Manager has been activated, Please enter your license key', 'accelerated-mobile-pages'); ?>
<a href="<?php echo esc_url(admin_url('admin.php?page=amp-extension-manager')) ?>" style="font-weight:bold;"> <?php echo esc_html__('here', 'accelerated-mobile-pages') ?></a>
function ampforwp_incomplate_setup_notice(){?>
<div class="updated notice ampforwp_remove_notice">
<?php esc_html_e('Your setup is not completed. Please setup for better AMP Experience', 'accelerated-mobile-pages'); ?>
function ampforwp_tpd_notice(){
$remove_notice = get_option("ampforwp_tpd_remove_notice");
if ($remove_notice !='remove' && !ampforwp_get_setting('ampforwp-ads-publisherdesk')) { ?>
<div class="updated notice ampforwp_remove_notice" style="box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);background-color:white;">
<?php echo sprintf( 'We have integrated <a href="https://www.publisherdesk.com/amp-for-wp/" target="_blank">%s</a> in our AMP plugin, it is a revenue optimization platform that helps publishers increase their ad revenue with fast fetch ad delivery and publishers can get upto 2x of the revenue compared to non-optimized pages',esc_html__('The Publisher Desk','accelerated-mobile-pages' ));?></p>
<a href="<?php echo esc_url('admin.php?page=amp_options&tab=4') ?>" class="button-primary" target="_self" style="font-weight:bold;" title="Ok, you deserved it"> <?php echo esc_html__('Setup The Publisher Desk in AMP', 'accelerated-mobile-pages') ?></a>
<a class="button-primary" id="ampforwp-close-ad-notice" style="font-weight:bold;"><?php echo esc_html__('Dismiss', 'accelerated-mobile-pages') ?></a>
add_action( 'wp_ajax_ampforwp_tpd_remove_notice', 'ampforwp_tpd_remove_notice' );
function ampforwp_tpd_remove_notice(){
if(current_user_can( 'manage_options' )){
$result = update_option( "ampforwp_tpd_remove_notice", 'remove', false);
echo wp_json_encode(array('status'=>'t'));
echo wp_json_encode(array('status'=>'f'));
* AMP Visibility Shortcode
* It is used to display or hide the page content based on parameters passed to the shortcode.
function ampforwp_visibility_shortcode($atts, $content = null) {
// Extract shortcode attributes
'mode' => 'amp', // Default mode is AMP
'visibility' => 'show' // Default visibility is show
// Check if AMP mode is enabled
if ((function_exists('is_amp_endpoint') && is_amp_endpoint()) || (function_exists('ampforwp_is_amp_endpoint') && ampforwp_is_amp_endpoint())) {
// If in AMP mode and mode attribute is set to amp, check visibility attribute
if ($atts['mode'] === 'amp') {
// If visibility attribute is set to show, return the content
if ($atts['visibility'] === 'show') {
return do_shortcode($content);
// If visibility attribute is set to hide, return an empty string
// If in AMP mode and mode attribute is set to non-amp, return an empty string
// If not in AMP mode and mode attribute is set to non-amp, check visibility attribute
if ($atts['mode'] === 'non-amp') {
// If visibility attribute is set to show, return the content
if ($atts['visibility'] === 'show') {
return do_shortcode($content);
// If visibility attribute is set to hide, return an empty string
// If not in AMP mode and mode attribute is set to amp, return an empty string
add_shortcode('ampforwp_visibility', 'ampforwp_visibility_shortcode');