: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
$allResponseData = isset($selectedOption['amp-license'][$pathExploded]['all_data']) ? $selectedOption['amp-license'][$pathExploded]['all_data'] : NULL ;
if ($allResponseData!=NULL) {
$selectedOption = (array) get_option('redux_builder_amp',true);
$expiredLicensedata[$pathExploded] = $selectedOption['amp-license'][$pathExploded]['status'] == 'expired' ? 1 : 0 ;
$remainingExpiresDays = date('Y-m-d', strtotime($allResponseData['expires'])) ;
$license_info_lifetime = $allResponseData['expires'];
$exp_date = $remainingExpiresDays;
$date1 = date_create($today);
$date2 = date_create($exp_date);
$diff = date_diff($date1,$date2);
$days = $diff->format("%a");
if( $license_info_lifetime == 'lifetime' ){
if ($days == 'Lifetime') {
$expire_msg = " Your License is Valid for Lifetime ";
elseif($today > $exp_date){
$isset_Checker = isset($selectedOption['amp-license'][$pathExploded]['status']) ? $selectedOption['amp-license'][$pathExploded]['status'] : NULL;
if ($isset_Checker != NULL) {
if(isset($selectedOption['amp-license'][$pathExploded]['status']) && $selectedOption['amp-license'][$pathExploded]['status']==='valid' || $selectedOption['amp-license'][$pathExploded]['status']==='expired'){
$license_status = $selectedOption['amp-license'][$pathExploded]['status'];
$license_user_name = substr($ampforwp_nameOfUser, 0, strpos($ampforwp_nameOfUser, ' '));
$check_for_Caps = ctype_upper($license_user_name);
if ( $check_for_Caps == 1 ) {
$license_user_name = strtolower($license_user_name);
$license_user_name = ucwords($license_user_name);
$license_user_name = ucwords($license_user_name);
$currentStatus = 'active valid';
if($ampforwp_nameOfUser=="" && isset($selectedOption['amp-license'][$pathExploded]['all_data']['customer_name'])){
$ampforwp_nameOfUser = $selectedOption['amp-license'][$pathExploded]['all_data']['customer_name'];
if(isset($selectedOption['amp-license'][$pathExploded]['all_data']) && $selectedOption['amp-license'][$pathExploded]['all_data']!=""){
$allResponseData = $selectedOption['amp-license'][$pathExploded]['all_data'];
$remainingExpiresDays = date('Y-m-d', strtotime($allResponseData['expires'])) ;
$license_info_lifetime = $allResponseData['expires'];
$exp_date = $remainingExpiresDays;
$date1 = date_create($today);
$date2 = date_create($exp_date);
$diff = date_diff($date1,$date2);
$days = $diff->format("%a");
if( $license_info_lifetime == 'lifetime' ){
if ($days == 'Lifetime') {
$expire_msg = " Your License is Valid for Lifetime ";
elseif($today > $exp_date){
if(isset($selectedOption['amp-license'][$pathExploded])){
while ( strlen($selectedOption['amp-license'][$pathExploded]['license']) > 32 ) {
$selectedOption['amp-license'][$pathExploded]['license'] = base64_decode($selectedOption['amp-license'][$pathExploded]['license']);
$amplicense = $selectedOption['amp-license'][$pathExploded]['license'];}
$license_key = $selectedOption['amp-license'][$pathExploded]['license'];
$lic_status = isset($selectedOption['amp-license'][$pathExploded]['status']) ? $selectedOption['amp-license'][$pathExploded]['status'] : '';
$lic_uname = isset($selectedOption['amp-license'][$pathExploded]['all_data']['customer_name']) ? $selectedOption['amp-license'][$pathExploded]['all_data']['customer_name'] : '';
$license_user_name = substr($lic_uname, 0, strpos($lic_uname, ' '));
$check_for_Caps = ctype_upper($license_user_name);
if ( $check_for_Caps == 1 ) {
$license_user_name = strtolower($license_user_name);
$license_user_name = ucwords($license_user_name);}
else{ $license_user_name = ucwords($license_user_name); }
if ( isset( $license_user_name ) && $license_user_name!=="" && isset( $days ) ){
if ( $license_status == 'valid' || $lic_status == 'expired' ) {
if ($lic_status == 'expired') { $days = -1; }
$one_of_plugin_expired = 0;
if ( in_array( 1, $expiredLicensedata ) ){
$one_of_plugin_expired = 1;
if ( !in_array( 0, $expiredLicensedata ) ){
$one_of_plugin_expired = 0;
$ext_settings_url = 'ext_url';
$settings_url = esc_url(admin_url('edit.php?post_type=ampforwp&page=structured_data_options'));
if ( $days == 'Lifetime' ) {
$expire_msg = " ".esc_html('Valid for Lifetime')." ";
// $expire_msg = " Active ";
$expire_msg_before = '<span class="before_msg_active">'.esc_html('Your License is').'</span>';
$span_class = "ampforwp_addon_icon dashicons dashicons-yes pro_icon ampforwppro_icon";
else if( $days>=0 && $days<=30 ){
$renew_url = "https://accounts.ampforwp.com/order/?edd_license_key=".esc_attr($license_key)."&download_id=".esc_attr($allResponseData['item_name'])."";
if ($one_of_plugin_expired == 1) {
$expire_msg_before = '<span class="before_msg_active">'.esc_html('One of your').' <span class="lessthan_30" style="color:red;">'.esc_html('license key is').'</span></span>';
$spann_class = "<span class='ampforwp_addon_icon dashicons dashicons-no lttn'></span>";
$expire_msg = '<span class="one_of_expired">'.esc_html("Expired").'</span> '.$spann_class.' <a target="blank" class="renewal-license" href="'.$renew_url.'"><span class="renew-lic">'.esc_html__('Renew', 'accelerated-mobile-pages').'</span></a>';
$expire_msg_before = '<span class="before_msg">'.esc_html('Your License is').'</span> <span class="ampforwp-addon-alert">'.esc_html('expiring in').' '.$days.' '.esc_html('days').'</span><a target="blank" class="renewal-license" href="'.$renew_url.'"><span class="renew-lic">'.esc_html__('Renew', 'accelerated-mobile-pages').'</span></a>';
$alert_icon = '<span class="ampforwp_addon_icon dashicons dashicons-warning pro_warning"></span>';
$trans_check = get_transient( 'ampforwp_addon_set_transient' );
if ( $trans_check !== 'ampforwp_addon_set_transient_value' ){
$refresh_addon = '<a id='.$pathExploded.' data-nonce='.wp_create_nonce('verify_extension').' data-days="'.$days.'" class="days_remain">
<i addon-is-expired class="dashicons dashicons-update-alt" id="refresh_expired_addon"></i>
$ext_settings_url = 'ext_settings_url';
$renew_url = "https://accounts.ampforwp.com/order/?edd_license_key=".esc_attr($license_key)."&download_id=".esc_attr($allResponseData['item_name'])."";
if ($one_of_plugin_expired == 1) {
$expire_msg_before = '<span class="ampforwp_addon_inactive"><span class="ooy">'.esc_html('One of your').'</span> <span class="lthan_0" style="color:red;">'.esc_html('license key is').'</span></span>';
$expire_msg_before = '<span class="ampforwp_addon_inactive">'.esc_html('Your').' <span class="lthan_0" style="color:red;">'.esc_html('License has been').'</span></span>';
$user_refr = '<a class="user_refr" id='.$pathExploded.' data-nonce='.wp_create_nonce('verify_extension').' data-days="'.$days.'" >
<i addon-is-expired class="dashicons dashicons-update-alt" id="user_refr_addon"></i>
$expire_msg = " Expired ";
$exp_class_2 = 'renew_license_key_';
$span_class = "ampforwp_addon_icon dashicons dashicons-no ltz";
$renew_mesg = '<a target="blank" class="renewal-license" href="'.$renew_url.'"><span class="renew-lic">'.esc_html__('Renew', 'accelerated-mobile-pages').'</span></a>';
$trans_check = get_transient( 'ampforwp_addon_set_transient' );
if ( $trans_check !== 'ampforwp_addon_set_transient_value' ){
$refresh_addon = '<a id='.$pathExploded.' data-nonce='.wp_create_nonce('verify_extension').' data-days="'.$days.'" class="days_remain">
<i addon-is-expired class="dashicons dashicons-update-alt" id="refresh_expired_addon"></i>
if ($one_of_plugin_expired == 1) {
$expire_msg_before = '<span class="before_msg_active">'.esc_html('One of your').' <span class="less_than_30" style="color:red;">'.esc_html('license key is').'</span></span>';
$expire_msg_before = '<span class="before_msg_active">'.esc_html('Your License is').'</span>';
if ($one_of_plugin_expired == 1) {
$renew_url = "https://accounts.ampforwp.com/order/?edd_license_key=".esc_attr($license_key)."&download_id=".esc_attr($allResponseData['item_name'])."";
$expire_msg = " <span class='one_of_expired'>".esc_html('Expired')."</span> ";
$renew_mesg = '<a target="blank" class="renewal-license" href="'.$renew_url.'"><span class="renew-lic">'.esc_html__('Renew', 'accelerated-mobile-pages').'</span></a>';
$expire_msg = " Active ";
if ($one_of_plugin_expired == 1) {
$span_class = "ampforwp_addon_icon dashicons dashicons-no pro_icon";
$span_class = "ampforwp_addon_icon dashicons dashicons-yes pro_icon ampforwppro_icon";
if ($one_of_plugin_expired == 1) { $color = 'color:red';}
else{ $color = 'color:green'; }
if($days<0){ $exp_id = 'exp'; }
$proDetailsProvide = "<div class='ampforwp-addon-main'>
<span class='ampforwp-addon-info'>
".$alert_icon."<span class='activated-plugins'>".esc_html('Hi')." <span class='ampforwp-addon_key_user_name'>".esc_html($license_user_name)."</span>".','."
<span id='active-plugins-dr' data-days=".$days." class=".$days."> ".$expire_msg_before." </span>
<span class='expiredinner_span' data-remain-days=".$days." id=".$exp_id.">".$expire_msg."</span>
<span class='".$span_class."'></span>".$renew_mesg.$refresh_addon.$user_refr ;
$proDetailsProvide .= $ZtoS_days."
else if( $ampforwp_nameOfUser!="" && !class_exists('AMPExtensionManager') ){
$proDetailsProvide = "<span class='extension-menu-call'><span class='activated-plugins'>Hello, ".esc_html($ampforwp_nameOfUser)."</span> <a class='' href='".esc_url(admin_url('admin.php?page=amp_options&tabid=opt-go-premium'))."'><i class='dashicons-before dashicons-admin-generic'></i></a></span>";
if(function_exists('amp_activate') ){
$proDetailsProvide = "<a class='premium_features_btn_txt' href=\"#\"> AMP by Automattic compatibility has been activated</a>";
$user = wp_get_current_user();
$permissions = "manage_options";
$amp_access = ampforwp_get_setting('ampforwp-role-based-access');
if( in_array( 'administrator', $user->roles ) ) {
$permissions = "manage_options";
}elseif( in_array( 'editor', $user->roles ) && in_array('editor', $amp_access) ){
$permissions = 'edit_pages';
}elseif( in_array( 'author', $user->roles ) && in_array('author', $amp_access)){
$permissions = 'edit_posts';
if (class_exists('WPSEO_Options') && in_array( 'wpseo_manager', $user->roles ) && in_array('wpseo_manager', $amp_access)) {
$permissions = 'edit_pages';
// TYPICAL -> Change these values as you need/desire
'opt_name' => 'redux_builder_amp', // This is where your data is stored in the database and also becomes your global variable name.
'display_name' => esc_html__( 'AMPforWP Options','accelerated-mobile-pages' ), // Name that appears at the top of your panel
'menu_type' => 'menu', //Specify if the admin menu should appear or not. Options: menu or submenu (Under appearance only)
'allow_sub_menu' => true, // Show the sections below the admin menu item or not
'menu_title' => esc_html__( 'AMP', 'accelerated-mobile-pages' ),
'page_title' => esc_html__('Accelerated Mobile Pages Options','accelerated-mobile-pages'),
'display_version' => AMPFORWP_VERSION,
'update_notice' => false,
'intro_text' => $proDetailsProvide,
'global_variable' => '', // Set a different name for your global variable other than the opt_name
'dev_mode' => false, // Show the time the page took to load, etc
'customizer' => false, // Enable basic customizer support,
'async_typography' => false, // Enable async for fonts,
'disable_save_warn' => true,
'open_expanded' => false,
// OPTIONAL -> Give you extra features
'page_priority' => null, // Order where the menu appears in the admin area. If there is any conflict, something will not show. Warning.
'page_parent' => 'themes.php', // For a full list of options, visit: http://codex.wordpress.org/Function_Reference/add_submenu_page#Parameters
'page_permissions' => $permissions, // Permissions needed to access the options panel.
'last_tab' => '', // Force your panel to always open to a specific tab (by id)
'page_icon' => 'icon-themes', // Icon displayed in the admin panel next to your menu_title
'page_slug' => 'amp_options', // Page slug used to denote the panel
'save_defaults' => true, // On load save the defaults to DB before user clicks save or not
'default_show' => false, // If true, shows the default value next to each field that is not the default value.
'default_mark' => '', // What to print by the field's title if the value shown is default. Suggested: *
'admin_bar_icon' => 'dashicons-admin-generic',
// CAREFUL -> These options are for advanced use only
'output' => false, // Global shut-off for dynamic CSS output by the framework. Will also disable google fonts output
'output_tag' => false, // Allows dynamic CSS to be generated for customizer and google fonts, but stops the dynamic CSS from going to the head
//'domain' => 'redux-framework', // Translation domain key. Don't change this unless you want to retranslate all of Redux.
'footer_credit' => false, // Disable the footer credit of Redux. Please leave if you can help it.
'show_import_export' => true,
Redux::setArgs( "redux_builder_amp", $args );
'id' => 'redux-help-tab-1',
'title' => esc_html__( 'Theme Information 1', 'accelerated-mobile-pages' ),
'content' => esc_html__( '<p>This is the tab content, HTML is allowed.</p>', 'accelerated-mobile-pages' )
'id' => 'redux-help-tab-2',
'title' => esc_html__( 'Theme Information 2', 'accelerated-mobile-pages' ),
'content' => esc_html__( '<p>This is the tab content, HTML is allowed.</p>', 'accelerated-mobile-pages' )
Redux::setHelpTab( $opt_name, $tabs );
$content = esc_html__( '<p>This is the sidebar content, HTML is allowed.</p>', 'accelerated-mobile-pages' );
Redux::setHelpSidebar( $opt_name, $content );
// AMP by Automattic Compatibility
if(function_exists('amp_activate') ){
Redux::setSection( $opt_name, array(
'id' => 'automatic-amp-features',
'title' => esc_html__( 'AMP By Automattic Settings', 'accelerated-mobile-pages' ),
ampforwp_admin_advertisement_options($opt_name);
ampforwp_page_builders_support_options($opt_name);
ampforwp_admin_performance_options($opt_name);
ampforwp_analytics_options($opt_name);
ampforwp_structure_data_options($opt_name);
ampforwp_notice_bar_options($opt_name);
ampforwp_push_notification_options($opt_name);
ampforwp_admin_contact_form_options($opt_name);
if(!function_exists('ampforwp_generate_ux_admin_button')){
function ampforwp_generate_ux_admin_button($id='',$type='',$label=''){
if($id=="ampforwp-ux-website-type-section"){
$amp_website_type = ampforwp_get_setup_info('ampforwp-ux-website-type-section');
$option = '<div class="filled-lbl-blk">
<p class="msg">'.esc_attr($amp_website_type).'</p>
<span class="lbl">Change</span>
$option = '<div class="button btn-red">'.esc_attr($label).'</div>';
}else if($id=="ampforwp-ux-privacy-section"){
$setup_txt = ampforwp_get_setup_info('ampforwp-ux-privacy-section');
$option = '<div class="filled-lbl-blk">
<p class="msg">'.esc_attr($setup_txt).'</p>
<span class="lbl">Change</span>
$option = '<div class="button btn-red">'.esc_attr($label).'</div>';
}else if($id=="ampforwp-ux-need-type-section"){
$need_type=ampforwp_get_setup_info('ampforwp-ux-need-type-section');
$option = '<div class="filled-lbl-blk">
<p class="msg">'.esc_attr($need_type).'</p>
<span class="lbl">Change</span>
$option = '<div class="button btn-red">'.esc_attr($label).'</div>';
}else if($id=="ampforwp-ux-design-section"){
$opt_med_url = ampforwp_get_setup_info('ampforwp-ux-design-section');
$option = '<div class="filled-lbl-blk">
<p class="msg">Configured</p>
<span class="lbl">Change</span>
$option = '<div class="button btn-red">'.esc_attr($label).'</div>';
}else if($id=="ampforwp-ux-analytics-section"){
$analytics_txt = ampforwp_get_setup_info('ampforwp-ux-analytics-section');
$option = '<div class="filled-lbl-blk">
<p class="msg">'.esc_attr($analytics_txt).'</p>
<span class="lbl">Change</span>
$option = '<div class="button btn-red">'.esc_attr($label).'</div>';
$option = '<div class="button btn-red">'.esc_attr($label).'</div>';
$option = '<div class="button btn-list">'.esc_attr($label).'</div>';
'ampforwp-ux-website-type-section',
'ampforwp-ux-need-type-section',
'ampforwp-ux-analytics-section'
$amp_ux_icon = "amp-ux-warning-okay";
for($sid = 0; $sid < count($setup_ids); $sid++ ){
$check = ampforwp_get_setup_info($setup_ids[$sid]);
$amp_ux_icon = "amp-ux-warning";
$ampforwp_admin_url = admin_url();
$adv_data_href = 'data-href=ampforwp-ux-advertisement-section';
if(function_exists('adsforwp_check_plugin')){
$plugin_file = "ads-for-wp/ads-for-wp.php";
$aafwp_active_url = $ampforwp_admin_url.'admin.php?page=adsforwp&tab=general&reference=ampforwp';
$adfwp_a_open = '<a href="'.esc_url($aafwp_active_url).'" target="_blank">';
$adv_data_href = 'data-href=';
Redux::setSection( $opt_name, array(
'title' => esc_html__( 'Setup', 'accelerated-mobile-pages' ),
'id' => 'ampforwp-new-ux',
'icon' => "el el-warning ux-setup-icon $amp_ux_icon",
'id' => 'ampforwp-setup-ux-website-type',
'desc' => '<div class="amp-ux-section">
<h2 class="amp-section-desc">Quick & Easy Setup</h2>
<div class="amp-ux-section-fields">
<div class="amp-ux-section-field" data-id="website-type" data-href="ampforwp-ux-website-type-section">
<div class="amp-ux-elem-field">
<h4 class="amp-ux-elem-title">Website Type</h4>
<div class="amp-ux-elem-but-block amp-ux-valid-require">'.ampforwp_generate_ux_admin_button("ampforwp-ux-website-type-section","button","SELECT").'</div>
<div class="amp-ux-section-field" data-href="ampforwp-ux-need-type-section">
<div class="amp-ux-elem-field">
<h4 class="amp-ux-elem-title">
<div class="amp-ux-elem-but-block amp-ux-valid-require">'.ampforwp_generate_ux_admin_button("ampforwp-ux-need-type-section","button","CHOOSE").'</div>
<div class="amp-ux-section-field" data-href="ampforwp-ux-design-section">
<div class="amp-ux-elem-field">
<h4 class="amp-ux-elem-title">Design and Presentation</h4>
<div class="amp-ux-elem-but-block">'.ampforwp_generate_ux_admin_button("ampforwp-ux-design-section","button","SET UP").'</div>
<div class="amp-ux-section-field" data-href="ampforwp-ux-analytics-section">
<div class="amp-ux-elem-field">
<h4 class="amp-ux-elem-title">Analytics Tracking</h4>
<div class="amp-ux-elem-but-block amp-ux-valid-require">'.ampforwp_generate_ux_admin_button("ampforwp-ux-analytics-section","button","CONFIG").'</div>
<div class="amp-ux-section-field" data-href="ampforwp-ux-privacy-section">
<div class="amp-ux-elem-field">
<h4 class="amp-ux-elem-title">Privacy Settings</h4>
<div class="amp-ux-elem-but-block">'.ampforwp_generate_ux_admin_button("ampforwp-ux-privacy-section","button","CHOOSE").'</div>
'<div class="amp-ux-section-field" '.esc_attr($adv_data_href).'>
<div class="amp-ux-elem-field">
<h4 class="amp-ux-elem-title">Advertisement</h4>
<div class="amp-ux-elem-but-block stup">View Setup</div>
'<div class="amp-ux-section-field" data-href="ampforwp-ux-thirdparty-section">
<div class="amp-ux-elem-field">
<h4 class="amp-ux-elem-title">3rd Party Compatibility</h4>
<div class="amp-ux-elem-but-block">'.ampforwp_generate_ux_admin_button("ampforwp-ux-thirdparty-section","label","View List").'</div>
Redux::setSection( $opt_name, array(
'title' => esc_html__( 'Settings', 'accelerated-mobile-pages' ),
'class' =>'amp-opt-settings',
function ampforwp_default_logo_settings($param=""){
$current_page = ampforwp_get_admin_current_page();
if($current_page=="amp_options"){
$custom_logo_id = get_theme_mod( 'custom_logo' );
$image = wp_get_attachment_image_src( $custom_logo_id , 'full');
function ampforwp_custom_logo_dimensions_options(){
$opCheck = ampforwp_get_setting('ampforwp-custom-logo-dimensions');
function ampforwp_get_cpt_generated_post_types() {
$options = get_option('ampforwp_cpt_generated_post_types');