: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
if( !defined('ABSPATH') ){ exit();}
$imgpath= plugins_url()."/facebook-auto-publish/images/";
$heimg=$imgpath."support.png";
$redirecturl=admin_url('admin.php?page=facebook-auto-publish-settings&auth=1');
$domain_name=$xyzscripts_hash_val=$xyz_fbap_smapsoln_userid=$xyzscripts_user_id=$xyz_smap_licence_key='';
require( dirname( __FILE__ ) . '/authorization.php' );
if(!$_POST && isset($_GET['fbap_notice'])&& $_GET['fbap_notice'] == 'hide')
if (! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'],'fbap-shw')){
wp_nonce_ays( 'fbap-shw');
update_option('xyz_fbap_dnt_shw_notice', "hide");
<div class="system_notice_area_style1" id="system_notice_area">
<?php _e('Thanks again for using the plugin. We will never show the message again.','facebook-auto-publish');?>
id="system_notice_area_dismiss"> <?php _e('Dismiss','facebook-auto-publish');?> </span>
if (! isset( $_REQUEST['_wpnonce'] )
|| ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'xyz_fbap_fb_settings_form_nonce' )
wp_nonce_ays( 'xyz_fbap_fb_settings_form_nonce' );
if(isset($_POST['fbap_pages_list']))
$ss=$_POST['fbap_pages_list'];
$fbap_pages_list_ids="";$xyz_fbap_enforce_og_tags=$xyz_fbap_clear_fb_cache=0;
if(!empty($ss))//$ss!="" && count($ss)>0
for($i=0;$i<count($ss);$i++)
$fbap_pages_list_ids.=$ss[$i].",";
$fbap_pages_list_ids.=-1;
$fbap_pages_list_ids=rtrim($fbap_pages_list_ids,',');
update_option('xyz_fbap_pages_ids',$fbap_pages_list_ids);
$applidold=get_option('xyz_fbap_application_id');
$applsecretold=get_option('xyz_fbap_application_secret');
$posting_method=intval($_POST['xyz_fbap_po_method']);
$posting_permission=intval($_POST['xyz_fbap_post_permission']);
$app_name=sanitize_text_field($_POST['xyz_fbap_application_name']);
$xyz_fbap_app_sel_mode=intval($_POST['xyz_fbap_app_sel_mode']);
$xyz_fbap_app_sel_mode_old=get_option('xyz_fbap_app_sel_mode');
if ($xyz_fbap_app_sel_mode==0){
$appid=sanitize_text_field($_POST['xyz_fbap_application_id']);
$appsecret=sanitize_text_field($_POST['xyz_fbap_application_secret']);
$xyz_fbap_enforce_og_tags=intval($_POST['xyz_fbap_enforce_og_tags']);
$xyz_fbap_clear_fb_cache=intval($_POST['xyz_fbap_clear_fb_cache']);
$messagetopost=$_POST['xyz_fbap_message'];
if($app_name=="" && $posting_permission==1)
$ms0= __('Please fill facebook application name.','facebook-auto-publish');
else if($appid=="" && $posting_permission==1 && $xyz_fbap_app_sel_mode==0)
$ms1= __('Please fill facebook application id.','facebook-auto-publish');
elseif($appsecret=="" && $posting_permission==1 && $xyz_fbap_app_sel_mode==0)
$ms2= __('Please fill facebook application secret.','facebook-auto-publish');
if(($appid!=$applidold || $appsecret!=$applsecretold)&& $xyz_fbap_app_sel_mode==0)
update_option('xyz_fbap_af',1);
update_option('xyz_fbap_fb_token','');
else if ($xyz_fbap_app_sel_mode_old != $xyz_fbap_app_sel_mode)
update_option('xyz_fbap_af',1);
update_option('xyz_fbap_fb_token','');
// update_option('xyz_fbap_secret_key','');
update_option('xyz_fbap_page_names','');
update_option('xyz_fbap_application_name',$app_name);
if ($xyz_fbap_app_sel_mode==0){
update_option('xyz_fbap_application_id',$appid);
update_option('xyz_fbap_application_secret',$appsecret);
update_option('xyz_fbap_post_permission',$posting_permission);
update_option('xyz_fbap_app_sel_mode',$xyz_fbap_app_sel_mode);
update_option('xyz_fbap_po_method',$posting_method);
update_option('xyz_fbap_message',$messagetopost);
update_option('xyz_fbap_enforce_og_tags', $xyz_fbap_enforce_og_tags);
update_option('xyz_fbap_clear_fb_cache', $xyz_fbap_clear_fb_cache);
if(isset($_POST['fb']) && $erf==0)
<div class="system_notice_area_style1" id="system_notice_area">
<?php _e('Settings updated successfully.','facebook-auto-publish');?> <span
id="system_notice_area_dismiss"> <?php _e('Dismiss','facebook-auto-publish');?> </span>
if(isset($_GET['msg']) && $_GET['msg']==2)
<div class="system_notice_area_style0" id="system_notice_area">
<?php _e('The state does not match. You may be a victim of CSRF.','facebook-auto-publish');?> <span
id="system_notice_area_dismiss"> <?php _e('Dismiss','facebook-auto-publish');?> </span>
if(isset($_GET['msg']) && $_GET['msg']==3)
<div class="system_notice_area_style0" id="system_notice_area">
<?php _e('Unable to authorize the facebook application. Please check your curl/fopen and firewall settings.','facebook-auto-publish');?> <span
id="system_notice_area_dismiss"> <?php _e('Dismiss','facebook-auto-publish');?> </span>
if(isset($_GET['msg']) && $_GET['msg']==4)
<div class="system_notice_area_style1" id="system_notice_area">
<?php $fbap_xyzscripts_name="xyzscripts";
$fbap_xyz_success_msg=sprintf(__('Successfully connected to %s member area','facebook-auto-publish'),$fbap_xyzscripts_name);
echo $fbap_xyz_success_msg; ?>. <span
id="system_notice_area_dismiss"><?php _e('Dismiss','facebook-auto-publish');?></span>
if(isset($_GET['msg']) && $_GET['msg']==5)
<div class="system_notice_area_style1" id="system_notice_area">
<?php _e('Selected pages saved successfully.','facebook-auto-publish');?> <span
id="system_notice_area_dismiss"> <?php _e('Dismiss','facebook-auto-publish');?> </span>
if(isset($_POST['fb']) && $erf==1)
<div class="system_notice_area_style0" id="system_notice_area">
echo esc_html($ms0);echo esc_html($ms1);echo esc_html($ms2);echo esc_html($ms3);
<span id="system_notice_area_dismiss"> <?php _e('Dismiss','facebook-auto-publish');?> </span>
<script type="text/javascript">
function detdisplay_fbap(id)
document.getElementById(id).style.display='';
function dethide_fbap(id)
document.getElementById(id).style.display='none';
<div style="width: 100%">
<div class="xyz_fbap_tab">
<button class="xyz_fbap_tablinks" onclick="xyz_fbap_open_tab(event, 'xyz_fbap_facebook_settings')" id="xyz_fbap_default_tab_settings"> <?php _e('Facebook Settings','facebook-auto-publish');?> </button>
<button class="xyz_fbap_tablinks" onclick="xyz_fbap_open_tab(event, 'xyz_fbap_basic_settings')" id="xyz_fbap_basic_tab_settings"> <?php _e('General Settings','facebook-auto-publish');?> </button>
<div id="xyz_fbap_facebook_settings" class="xyz_fbap_tabcontent">
$af=get_option('xyz_fbap_af');
$appid=get_option('xyz_fbap_application_id');
$appsecret=get_option('xyz_fbap_application_secret');
//$fbid=esc_html(get_option('xyz_fbap_fb_id'));
$posting_method=get_option('xyz_fbap_po_method');
$posting_message=esc_textarea(get_option('xyz_fbap_message'));
if(get_option('xyz_fbap_app_sel_mode')==0)
if($af==1 && $appid!="" && $appsecret!="")
<span style="color: red;" id="auth_message" > <?php _e('Application needs authorisation','facebook-auto-publish');?> </span> <br>
<?php wp_nonce_field( 'xyz_fbap_fb_auth_nonce' );?>
<input type="submit" class="submit_fbap_new" name="fb_auth"
value="<?php _e('Authorize','facebook-auto-publish');?>" /><br><br>
else if($af==0 && $appid!="" && $appsecret!="")
<?php wp_nonce_field( 'xyz_fbap_fb_auth_nonce' );?>
<input type="submit" class="submit_fbap_new" name="fb_auth"
value="<?php _e('Reauthorize','facebook-auto-publish');?>" title="Reauthorize the account" /><br><br>
elseif (get_option('xyz_fbap_app_sel_mode')==1){//add trim
$domain_name=trim(get_option('siteurl'));
$xyz_fbap_smapsoln_userid=intval(trim(get_option('xyz_fbap_smapsoln_userid')));
$xyzscripts_hash_val=trim(get_option('xyz_fbap_xyzscripts_hash_val'));
$xyzscripts_user_id=trim(get_option('xyz_fbap_xyzscripts_user_id'));
$xyz_smap_licence_key='';
$request_hash=md5($xyzscripts_user_id.$xyzscripts_hash_val);
$auth_secret_key=md5('smapsolutions'.$domain_name.$xyz_smap_accountId.$xyz_fbap_smapsoln_userid.$xyzscripts_user_id.$request_hash.$xyz_smap_licence_key.'fbap');
<span id='ajax-save' style="display:none;"><img class="img" title="Saving details" src="<?php echo plugins_url('../images/ajax-loader.gif',__FILE__);?>" style="width:65px;height:70px; "></span>
<span style="color: red;" > <?php _e('Application needs authorisation','facebook-auto-publish');?> </span> <br>
<?php wp_nonce_field( 'xyz_fbap_fb_auth_nonce' );?>
<input type="hidden" value="<?php echo (is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST']; ?>" id="parent_domain">
<input type="submit" class="submit_fbap_new" name="fb_auth"
value="<?php _e('Authorize','facebook-auto-publish');?>" onclick="javascript:return fbap_popup_fb_auth('<?php echo urlencode($domain_name);?>','<?php echo $xyz_fbap_smapsoln_userid;?>','<?php echo $xyzscripts_user_id;?>','<?php echo $xyzscripts_hash_val;?>','<?php echo $auth_secret_key;?>','<?php echo $request_hash;?>');void(0);"/><br><br>
<span id='ajax-save' style="display:none;"><img class="img" title="Saving details" src="<?php echo plugins_url('../images/ajax-loader.gif',__FILE__);?>" style="width:65px;height:70px; "></span>
<form method="post" id="re_auth_message">
<?php wp_nonce_field( 'xyz_fbap_fb_auth_nonce' );?>
<input type="hidden" value="<?php echo (is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST']; ?>" id="parent_domain">
<input type="submit" class="submit_fbap_new" name="fb_auth"
value="<?php _e('Reauthorize','facebook-auto-publish');?>" title="Reauthorize the account" onclick="javascript:return fbap_popup_fb_auth('<?php echo urlencode($domain_name);?>','<?php echo $xyz_fbap_smapsoln_userid;?>','<?php echo $xyzscripts_user_id;?>','<?php echo $xyzscripts_hash_val;?>','<?php echo $auth_secret_key;?>','<?php echo $request_hash;?>');void(0);"/><br><br>
if(isset($_GET['auth']) && $_GET['auth']==1 && get_option("xyz_fbap_fb_token")!="")
<span style="color: green;"> <?php _e('Application is authorized, go posting.','facebook-auto-publish');?>
<table class="widefat" style="width: 99%;background-color: #FFFBCC" id="xyz_fbap_app_creation_note">
<td id="bottomBorderNone" style="border: 1px solid #FCC328;">
<b> <?php _e('Note:','facebook-auto-publish'); ?></b> <?php _e('You have to create a Facebook application before filling the following details.','facebook-auto-publish'); ?>
<b><a href="https://developers.facebook.com/apps" target="_blank"> <?php _e('Click here </a></b> to create new Facebook application.','facebook-auto-publish'); ?>
<br> <?php $fbap_path1="Apps >Add Product > Facebook Login >Quickstart >Web > Site URL"; $fbap_navigate1=sprintf(__('In the application page in facebook, navigate to <b> %s </b>.','facebook-auto-publish'),$fbap_path1);echo $fbap_navigate1; _e('Set the site url as:','facebook-auto-publish'); ?>
<span style="color: red;"><?php echo (is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST']; ?></span>
<br> <?php $fbap_path2="Apps > Facebook Login > Settings"; $fbap_navigate2=sprintf(__('And then navigate to <b> %s </b>.','facebook-auto-publish'),$fbap_path2); echo $fbap_navigate2; _e('Set the Valid OAuth redirect URIs as:','facebook-auto-publish'); ?><br>
<span style="color: red;"><?php echo $redirecturl; ?></span>
<br> <?php $fbap_create_fbapp="http://help.xyzscripts.com/docs/social-media-auto-publish/faq/how-can-i-create-facebook-application/"; $fbap_inst_link=sprintf(__('For detailed step by step instructions <b><a href="%s" target="_blank"> Click here.','facebook-auto-publish'),$fbap_create_fbapp); echo $fbap_inst_link; ?> </a></b>
<?php wp_nonce_field( 'xyz_fbap_fb_settings_form_nonce' );?>
<input type="hidden" value="config">
<div style="font-weight: bold;padding: 3px;"> <?php _e('All fields given below are mandatory','facebook-auto-publish'); ?> </div>
<table class="widefat xyz_fbap_widefat_table" style="width: 99%">
<td> <?php _e('Enable auto publish post to my facebook account','facebook-auto-publish'); ?>
<td class="switch-field">
<label id="xyz_fbap_post_permission_yes"><input type="radio" name="xyz_fbap_post_permission" value="1" <?php if(get_option('xyz_fbap_post_permission')==1) echo 'checked';?>/> <?php _e('Yes','facebook-auto-publish'); ?> </label>
<label id="xyz_fbap_post_permission_no"><input type="radio" name="xyz_fbap_post_permission" value="0" <?php if(get_option('xyz_fbap_post_permission')==0) echo 'checked';?>/> <?php _e('No','facebook-auto-publish'); ?> </label>
<td width="50%"> <?php _e('Application name','facebook-auto-publish'); ?>
<br/><span style="color: #0073aa;">[<?php _e('This is for tracking purpose','facebook-auto-publish'); ?>]</span>
<td><input id="xyz_fbap_application_name"
name="xyz_fbap_application_name" type="text"
value="<?php if($ms0=="") {echo esc_html(get_option('xyz_fbap_application_name'));}?>" />
<td width="50%"> <?php _e('Application Selection','facebook-auto-publish'); ?>
<input type="radio" name="xyz_fbap_app_sel_mode" id="xyz_fbap_app_sel_mode_reviewd" value="0" <?php if(get_option('xyz_fbap_app_sel_mode')==0) echo 'checked';?>>
<span style="color: #a7a7a7;font-weight: bold;"> <?php _e('Own App','facebook-auto-publish'); ?>(<?php _e('requires app submission and Facebook review','facebook-auto-publish'); ?>)-<a href="http://help.xyzscripts.com/docs/social-media-auto-publish/faq/how-can-i-create-facebook-application/" style="color: #a7a7a7;text-decoration: underline; " target="_blank" > <?php _e('Help','facebook-auto-publish'); ?> </a>)</span>
<div class="xyz_fbap_facebook_settings" style="display: none;" onmouseover="detdisplay_fbap('xyz_fbap_app_review')" onmouseout="dethide_fbap('xyz_fbap_app_review')"><span style="padding-left: 25px;color: #0073aa;"> <?php _e('App approval service available for 50 USD','facebook-auto-publish'); ?>
<div id="xyz_fbap_app_review" class="fbap_informationdiv" style="display: none;width: 400px;">
<b> <?php _e('Expected time frame','facebook-auto-publish'); ?>:</b><br/> <?php _e('30 days','facebook-auto-publish'); ?> <br/>
<b> <?php _e('Required details','facebook-auto-publish'); ?>:</b><br/> <?php _e('1. WordPress login','facebook-auto-publish'); ?> <br/>
<?php _e('2. Admin access to Facebook developer app for review submission (temporary).','facebook-auto-publish'); ?><br/>
<?php $fbap_details_link="https://xyzscripts.com/support/"; $fbap_details_contact=sprintf(__('For more details contact <a href="%s" target="_blank" > Support Desk','facebook-auto-publish'),$fbap_details_link); echo $fbap_details_contact; ?></a>.
<input type="radio" name="xyz_fbap_app_sel_mode" id="xyz_fbap_app_sel_mode_xyzapp" value="1" <?php if(get_option('xyz_fbap_app_sel_mode')==1) echo 'checked';?>>
<span style="color: #000000;font-size: 13px;background-color: #f7a676;font-weight: 500;padding: 3px 5px;"><i class="fa fa-star-o" aria-hidden="true" style="margin-right:5px;"></i> <?php $fbap_smap_site="SMAPsolution.com's"; $fbap_ready_pub=sprintf(__('%s App ( ready to publish )','facebook-auto-publish'),$fbap_smap_site); echo $fbap_ready_pub; ?> <i class="fa fa-star-o" aria-hidden="true" style="margin-right:5px;"></i></span><br> <span style="padding-left: 25px;">
<?php _e('Starts from 10 USD per year','facebook-auto-publish'); ?> </span><br>
<?php if(get_option('xyz_fbap_smapsoln_userid')==0)
<span style="color: #ff5e00;padding-left: 27px;font-size: small;"><b> <?php _e('30 DAYS FREE TRIAL AVAILABLE','facebook-auto-publish'); ?>*</b></span>
<a target="_blank" href="https://help.xyzscripts.com/docs/social-media-auto-publish/faq/how-can-i-use-the-alternate-solution-for-publishing-posts-to-facebook/" style="padding-left: 30px;"> <?php $fbap_how_smap=sprintf(__('How to use %s application?','facebook-auto-publish'),$fbap_smap_site); echo $fbap_how_smap; ?></a>
if($xyzscripts_user_id =='' || $xyzscripts_hash_val=='' && $xyz_fbap_app_sel_mode==1)
<tr valign="top" id="xyz_fbap_conn_to_xyzscripts">
<span id='ajax-save-xyzscript_acc' style="display:none;"><img class="img" title="Saving details" src="<?php echo plugins_url('../images/ajax-loader.gif',__FILE__);?>" style="width:65px;height:70px; "></span>
<span id="connect_to_xyzscripts"style="background-color: #1A87B9;color: white; padding: 4px 5px;text-align: center; text-decoration: none; display: inline-block;border-radius: 4px;">
<a href="javascript:fbap_popup_connect_to_xyzscripts();void(0);" style="color:white !important;"> <?php $fbap_var_xyz="xyzscripts"; $fbap_connect_xyz=sprintf(__('Connect your %s account','facebook-auto-publish'),$fbap_var_xyz); echo $fbap_connect_xyz; ?> </a>
<tr valign="top" class="xyz_fbap_facebook_settings">
<td width="50%"> <?php _e('Application id','facebook-auto-publish'); ?>
<td><input id="xyz_fbap_application_id"
name="xyz_fbap_application_id" type="text"
value="<?php if($ms1=="") {echo esc_html(get_option('xyz_fbap_application_id'));}?>" />
<tr valign="top" class="xyz_fbap_facebook_settings">
<td> <?php _e('Application secret','facebook-auto-publish'); ?> <?php $apsecret=esc_html(get_option('xyz_fbap_application_secret'));?>
<td><input id="xyz_fbap_application_secret"
name="xyz_fbap_application_secret" type="text"
value="<?php if($ms2=="") {echo $apsecret; }?>" />
<td> <?php _e('Posting method','facebook-auto-publish'); ?>
<br/><span style="color: #0073aa;">[ <?php _e('Create app album (with <b> Application name </b>) in the Facebook pages, <br/> if you are using the posting method <b> Upload image to app album','facebook-auto-publish'); ?> </b>]</span>
<select id="xyz_fbap_po_method" name="xyz_fbap_po_method">
<?php if(get_option('xyz_fbap_po_method')==3) echo 'selected';?>> <?php _e('Simple text message','facebook-auto-publish'); ?> </option>
<optgroup label="<?php _e('Text message with image','facebook-auto-publish');?>">
<?php if(get_option('xyz_fbap_po_method')==4) echo 'selected';?>> <?php _e('Upload image to app album','facebook-auto-publish'); ?> </option>
<?php if(get_option('xyz_fbap_po_method')==5) echo 'selected';?>> <?php _e('Upload image to timeline album','facebook-auto-publish'); ?> </option>
<optgroup label="<?php _e('Text message with attached link','facebook-auto-publish');?>">
<?php if(get_option('xyz_fbap_po_method')==1) echo 'selected';?>> <?php _e('Attach your blog post','facebook-auto-publish'); ?> </option>
<?php if(get_option('xyz_fbap_po_method')==2) echo 'selected';?>>
<?php _e('Share a link to your blog post','facebook-auto-publish'); ?> </option>
<td> <?php _e('Enforce og tags for Facebook','facebook-auto-publish');?> <img src="<?php echo $heimg?>" onmouseover="detdisplay_fbap('xyz_fbap_enforce_og')" onmouseout="dethide_fbap('xyz_fbap_enforce_og')" style="width:13px;height:auto;">
<div id="xyz_fbap_enforce_og" class="fbap_informationdiv" style="display: none;width: 400px;">
<?php _e('If you enable, Open Graph tags will be generated while posting to Facebook, when using the posting method <b> Share a link to your blog post </b> or <b> Attach your blog post.','facebook-auto-publish'); ?> </b>
<td class="switch-field">
<label id="xyz_fbap_enforce_og_tags_yes" class="xyz_fbap_toggle_off"><input type="radio" name="xyz_fbap_enforce_og_tags" value="1" <?php if(get_option('xyz_fbap_enforce_og_tags')==1) echo 'checked';?>/> <?php _e('Yes','facebook-auto-publish'); ?> </label>
<label id="xyz_fbap_enforce_og_tags_no" class="xyz_fbap_toggle_on"><input type="radio" name="xyz_fbap_enforce_og_tags" value="0" <?php if(get_option('xyz_fbap_enforce_og_tags')==0) echo 'checked';?>/> <?php _e('No','facebook-auto-publish'); ?> </label>
<td> <?php _e('Clear facebook cache before publishing to facebook','facebook-auto-publish'); ?> </td>
<td class="switch-field">
<label id="xyz_fbap_clear_fb_cache_yes" class="xyz_fbap_toggle_off"><input type="radio" name="xyz_fbap_clear_fb_cache" value="1" <?php if(get_option('xyz_fbap_clear_fb_cache')==1) echo 'checked';?>/> <?php _e('Yes','facebook-auto-publish'); ?> </label>
<label id="xyz_fbap_clear_fb_cache_no" class="xyz_fbap_toggle_on"><input type="radio" name="xyz_fbap_clear_fb_cache" value="0" <?php if(get_option('xyz_fbap_clear_fb_cache')==0) echo 'checked';?>/> <?php _e('No','facebook-auto-publish'); ?> </label>
<td> <?php _e('Message format for posting','facebook-auto-publish'); ?> <img src="<?php echo $heimg?>"
onmouseover="detdisplay_fbap('xyz_fb')" onmouseout="dethide_fbap('xyz_fb')" style="width:13px;height:auto;">
<div id="xyz_fb" class="fbap_informationdiv" style="display: none;">
{POST_TITLE} - <?php _e('Insert the title of your post.','facebook-auto-publish'); ?><br/>
{PERMALINK} - <?php _e('Insert the URL where your post is displayed.','facebook-auto-publish'); ?><br/>
{POST_EXCERPT} - <?php _e('Insert the excerpt of your post.','facebook-auto-publish'); ?><br/>
{POST_CONTENT} - <?php _e('Insert the description of your post.','facebook-auto-publish'); ?><br/>
{BLOG_TITLE} - <?php _e('Insert the name of your blog.','facebook-auto-publish'); ?><br/>
{USER_NICENAME} - <?php _e('Insert the nicename of the author.','facebook-auto-publish'); ?><br/>
{POST_ID} - <?php _e('Insert the ID of your post.','facebook-auto-publish'); ?><br/>
{POST_PUBLISH_DATE} - <?php _e('Insert the publish date of your post.','facebook-auto-publish'); ?><br/>
{USER_DISPLAY_NAME} - <?php _e('Insert the display name of the author.','facebook-auto-publish'); ?>
</div><br/><span style="color: #0073aa;">[ <?php _e('Optional in the case of <b>Text message with attached link </b><br/>or<b> Text message with image </b>posting methods','facebook-auto-publish'); ?> ]</span></td>
<select name="xyz_fbap_info" id="xyz_fbap_info" onchange="xyz_fbap_info_insert(this)">
<option value ="0" selected="selected"> --<?php _e('Select','facebook-auto-publish'); ?>-- </option>
<option value ="1">{POST_TITLE} </option>
<option value ="2">{PERMALINK} </option>
<option value ="3">{POST_EXCERPT} </option>
<option value ="4">{POST_CONTENT} </option>
<option value ="5">{BLOG_TITLE} </option>
<option value ="6">{USER_NICENAME} </option>
<option value ="7">{POST_ID} </option>
<option value ="8">{POST_PUBLISH_DATE} </option>
<option value= "9">{USER_DISPLAY_NAME}</option>
</select> </td></tr><tr><td> </td><td>
<textarea id="xyz_fbap_message" name="xyz_fbap_message" style="height:80px !important;" ><?php
echo esc_textarea(get_option('xyz_fbap_message'));?></textarea>
$xyz_acces_token=get_option('xyz_fbap_fb_token');
if($xyz_acces_token!="" && get_option('xyz_fbap_app_sel_mode')==0){
$offset=0;$limit=100;$data=array();
$result1="";$pagearray1="";
$pp=wp_remote_get("https://graph.facebook.com/".XYZ_FBAP_FB_API_VERSION."/me/accounts?access_token=$xyz_acces_token&limit=$limit&offset=$offset",array('sslverify'=> (get_option('xyz_fbap_peer_verification')=='1') ? true : false));
$pagearray1 = json_decode($result1);
if(isset($pagearray1->data) && is_array($pagearray1->data))
$data = array_merge($data, $pagearray1->data);
// if(!is_array($pagearray1->paging))
// }while(array_key_exists("next", $pagearray1->paging));
}while(isset($pagearray1->paging->next));
$fbap_pages_ids1=get_option('xyz_fbap_pages_ids');
$fbap_pages_ids0=array();
$fbap_pages_ids0=explode(",",$fbap_pages_ids1);
if (!empty($fbap_pages_ids0)){
for($i=0;$i<count($fbap_pages_ids0);$i++)
if($fbap_pages_ids0[$i]!="-1")
$fbap_pages_ids[$i]=trim(substr($fbap_pages_ids0[$i],0,strpos($fbap_pages_ids0[$i],"-")));
$fbap_pages_ids[$i]=$fbap_pages_ids0[$i];
//$data[$i]->id."-".$data[$i]->access_token
<?php _e('Select facebook pages for auto publish','facebook-auto-publish'); ?>