: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
if( !defined('ABSPATH') ){ exit();}
add_action('admin_menu', 'xyz_fbap_menu');
function xyz_fbap_add_admin_scripts()
wp_enqueue_script('jquery');
wp_register_script( 'xyz_notice_script_fbap', plugins_url('facebook-auto-publish/js/notice.js') );
wp_enqueue_script( 'xyz_notice_script_fbap' );
wp_register_style( 'xyz_fbap_font_style',plugins_url("css/font-awesome.min.css",XYZ_FBAP_PLUGIN_FILE));
$fbap_smapsolution_var="SMAPSolutions";
$fbap_xyzscripts_var="xyzscripts";
wp_localize_script('xyz_notice_script_fbap','xyz_script_fbap_var',array(
'alert1' => __('Please check whether the email is correct.','facebook-auto-publish'),
'alert2' => __('Select atleast one list.','facebook-auto-publish'),
'alert3' => __('You do not have sufficient permissions','facebook-auto-publish'),
'html1' => sprintf(__('Account details successfully deleted from %s','facebook-auto-publish'),$fbap_smapsolution_var),
'html2' => __('Thank you for enabling backlink !','facebook-auto-publish'),
'html3' => sprintf(__('Please connect your %s member account','facebook-auto-publish'),$fbap_xyzscripts_var)
wp_enqueue_style('xyz_fbap_font_style');
wp_register_style('xyz_fbap_style', plugins_url('facebook-auto-publish/css/style.css'));
wp_enqueue_style('xyz_fbap_style');
add_action("admin_enqueue_scripts","xyz_fbap_add_admin_scripts");
add_menu_page('Facebook Auto Publish - Manage settings', 'WP2Social Auto Publish', 'manage_options', 'facebook-auto-publish-settings', 'xyz_fbap_settings',plugin_dir_url( XYZ_FBAP_PLUGIN_FILE ) . 'images/fbap.png');
add_submenu_page('facebook-auto-publish-settings', 'Facebook Auto Publish - Manage settings', __('Settings','facebook-auto-publish'), 'manage_options', 'facebook-auto-publish-settings' ,'xyz_fbap_settings'); // 8 for admin
if(get_option('xyz_fbap_xyzscripts_hash_val')!=''&& get_option('xyz_fbap_xyzscripts_user_id')!='')
add_submenu_page('facebook-auto-publish-settings', 'Facebook Auto Publish - Manage Authorizations',__('Manage Authorizations','facebook-auto-publish'), 'manage_options', 'facebook-auto-publish-manage-authorizations' ,'xyz_fbap_manage_authorizations');
add_submenu_page('facebook-auto-publish-settings', 'Facebook Auto Publish - Logs', __('Logs','facebook-auto-publish'), 'manage_options', 'facebook-auto-publish-log' ,'xyz_fbap_logs');
add_submenu_page('facebook-auto-publish-settings', 'Facebook Auto Publish - About', __('About','facebook-auto-publish'), 'manage_options', 'facebook-auto-publish-about' ,'xyz_fbap_about'); // 8 for admin
add_submenu_page('facebook-auto-publish-settings', 'Facebook Auto Publish - Suggest Feature', __('Suggest a Feature','facebook-auto-publish'), 'manage_options', 'facebook-auto-publish-suggest-feature' ,'xyz_fbap_suggest_feature');
function xyz_fbap_settings()
$_POST = stripslashes_deep($_POST);
$_GET = stripslashes_deep($_GET);
$_POST = xyz_trim_deep($_POST);
$_GET = xyz_trim_deep($_GET);
require( dirname( __FILE__ ) . '/header.php' );
require( dirname( __FILE__ ) . '/settings.php' );
require( dirname( __FILE__ ) . '/footer.php' );
function xyz_fbap_about()
require( dirname( __FILE__ ) . '/header.php' );
require( dirname( __FILE__ ) . '/about.php' );
require( dirname( __FILE__ ) . '/footer.php' );
$_POST = stripslashes_deep($_POST);
$_GET = stripslashes_deep($_GET);
$_POST = xyz_trim_deep($_POST);
$_GET = xyz_trim_deep($_GET);
require( dirname( __FILE__ ) . '/header.php' );
require( dirname( __FILE__ ) . '/logs.php' );
require( dirname( __FILE__ ) . '/footer.php' );
function xyz_fbap_suggest_feature()
require( dirname( __FILE__ ) . '/header.php' );
require( dirname( __FILE__ ) . '/fbap-suggest-feature.php' );
require( dirname( __FILE__ ) . '/footer.php' );
function xyz_fbap_manage_authorizations()
require( dirname( __FILE__ ) . '/header.php' );
require( dirname( __FILE__ ) . '/manage-authorizations.php' );
require( dirname( __FILE__ ) . '/footer.php' );
add_action('wp_head', 'xyz_fbap_insert_og_image_for_fb');
function xyz_fbap_insert_og_image_for_fb(){
if (!empty($post) && get_option('xyz_fbap_enforce_og_tags')==1){
if(isset($postid ) && $postid>0)
$xyz_fbap_apply_filters=get_option('xyz_fbap_apply_filters');
$get_post_meta_insert_og=0;
$get_post_meta_insert_og=get_post_meta($postid,"xyz_fbap_insert_og",true);
if (($get_post_meta_insert_og==1)&&(strpos($_SERVER["HTTP_USER_AGENT"], "facebookexternalhit/") !== false || strpos($_SERVER["HTTP_USER_AGENT"], "Facebot") !== false))
$ar2=explode(",",$xyz_fbap_apply_filters);
$excerpt = $post->post_excerpt;
$excerpt = apply_filters('the_excerpt', $excerpt);
$excerpt = html_entity_decode($excerpt, ENT_QUOTES, get_bloginfo('charset'));
$excerpt = preg_replace('/<script\b[^>]*>(.*?)<\/script>/is', "", $excerpt);
$content = $post->post_content;
$content = apply_filters('the_content', $content);
$content1=strip_tags($content1);
$content1=strip_shortcodes($content1);
$content1 = preg_replace('/<script\b[^>]*>(.*?)<\/script>/is', "", $content1);
$content1= preg_replace("/\\[caption.*?\\].*?\\[.caption\\]/is", "", $content1);
$content1 = preg_replace('/\[.+?\]/', '', $content1);
$excerpt=implode(' ', array_slice(explode(' ', $content1), 0, 50));
$excerpt=strip_tags($excerpt);
$excerpt=strip_shortcodes($excerpt);
$excerpt=str_replace(" ","",$excerpt);
$name = $post->post_title;
$name = apply_filters('the_title', $name,$postid);
$name = html_entity_decode($name, ENT_QUOTES, get_bloginfo('charset'));
$name=strip_shortcodes($name);
$attachmenturl=xyz_fbap_getimage($postid, $post->post_content);
echo '<meta property="og:title" content="'.$name.'" />';
echo '<meta property="og:description" content="'.$excerpt.'" />';
if(!empty($attachmenturl))
echo '<meta property="og:image" content="'.$attachmenturl.'" />';
update_post_meta($postid, "xyz_fbap_insert_og", "0");