: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
<div class="scroll_checkbox">
<input type="checkbox" id="select_all_pages" > <?php _e('Select All','facebook-auto-publish'); ?>
$page_name[$pgid]=$data[$i]->name;
<br><input type="checkbox" class="selpages" name="fbap_pages_list[]" value="<?php echo $data[$i]->id."-".$data[$i]->access_token;?>" <?php if(in_array($data[$i]->id, $fbap_pages_ids)) echo "checked" ?>><?php echo $data[$i]->name; ?>
// $page_name=base64_encode(serialize($page_name));?>
}elseif (get_option('xyz_fbap_app_sel_mode')==1)// &&pagelist frm smap solutions is not empty )
$xyz_fbap_page_names=stripslashes(get_option('xyz_fbap_page_names'));
$xyz_fbap_secret_key=get_option('xyz_fbap_secret_key');
<tr id="xyz_fbap_selected_pages_tr" style="<?php if($xyz_fbap_page_names=='')echo "display:none;";?>">
<td> <?php _e('Selected facebook pages for auto publish','facebook-auto-publish'); ?> </td>
<div class="scroll_checkbox" id="xyz_fbap_selected_pages" style="float: left;">
if($xyz_fbap_page_names!=''){
$xyz_fbap_page_names_array=json_decode($xyz_fbap_page_names);
foreach ($xyz_fbap_page_names_array as $sel_pageid=>$sel_pagename)
<input type="checkbox" class="selpages" name="fbap_pages_list[]" value="<?php echo $sel_pageid;?>" disabled checked="checked"><?php echo $sel_pagename; ?><br>
<div style="float: left;width: 10px;color: #ce5c19;font-size: 20px;">*</div>
<tr><td id="bottomBorderNone"></td>
<td id="bottomBorderNone"><div style="height: 50px;">
<input type="submit" class="submit_fbap_new"
style=" margin-top: 10px; "
name="fb" value="<?php _e('Save','facebook-auto-publish'); ?>" /></div>
<?php if(get_option('xyz_fbap_smapsoln_userid')==0){?>
<tr><td style='color: #ce5c19;padding-left:0px;'>*<?php _e('Free trial is available only for first time users','facebook-auto-publish'); ?> </td></tr>
<tr><td style='color: #ce5c19;padding-left:0px;'>*<?php _e('Use reauthorize button to change selected values','facebook-auto-publish'); ?> </td></tr>
if(isset($_POST['bsettngs']))
if (! isset( $_REQUEST['_wpnonce'] )
|| ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'xyz_fbap_basic_settings_form_nonce' )
wp_nonce_ays( 'xyz_fbap_basic_settings_form_nonce' );
$xyz_fbap_include_pages=intval($_POST['xyz_fbap_include_pages']);
$xyz_fbap_include_posts=intval($_POST['xyz_fbap_include_posts']);
if($_POST['xyz_fbap_cat_all']=="All")
$fbap_category_ids=$_POST['xyz_fbap_cat_all'];//radio btn name
else if (isset($_POST['xyz_fbap_catlist']) && !empty($_POST['xyz_fbap_catlist']))
$fbap_category_ids=$_POST['xyz_fbap_catlist'];//dropdown
$fbap_category_ids=implode(',', $fbap_category_ids);
if(isset($_POST['post_types']))
$xyz_customtypes=$_POST['post_types'];
$xyz_fbap_peer_verification=intval($_POST['xyz_fbap_peer_verification']);
$xyz_fbap_premium_version_ads=intval($_POST['xyz_fbap_premium_version_ads']);
$xyz_fbap_default_selection_edit=intval($_POST['xyz_fbap_default_selection_edit']);
$xyz_fbap_default_selection_create=intval($_POST['xyz_fbap_default_selection_create']);
// $xyz_fbap_utf_decode_enable=intval($_POST['xyz_fbap_utf_decode_enable']);
$xyz_fbap_applyfilters="";
if(isset($_POST['xyz_fbap_applyfilters']))
$xyz_fbap_applyfilters=$_POST['xyz_fbap_applyfilters'];
for($i=0;$i<count($xyz_customtypes);$i++)
$fbap_customtype_ids.=$xyz_customtypes[$i].",";
$fbap_customtype_ids=rtrim($fbap_customtype_ids,',');
$xyz_fbap_applyfilters_val="";
if($xyz_fbap_applyfilters!="")
for($i=0;$i<count($xyz_fbap_applyfilters);$i++)
$xyz_fbap_applyfilters_val.=$xyz_fbap_applyfilters[$i].",";
$xyz_fbap_applyfilters_val=rtrim($xyz_fbap_applyfilters_val,',');
update_option('xyz_fbap_apply_filters',$xyz_fbap_applyfilters_val);
update_option('xyz_fbap_include_pages',$xyz_fbap_include_pages);
update_option('xyz_fbap_include_posts',$xyz_fbap_include_posts);
if($xyz_fbap_include_posts==0)
update_option('xyz_fbap_include_categories',"All");
update_option('xyz_fbap_include_categories',$fbap_category_ids);
update_option('xyz_fbap_include_customposttypes',$fbap_customtype_ids);
update_option('xyz_fbap_peer_verification',$xyz_fbap_peer_verification);
update_option('xyz_fbap_premium_version_ads',$xyz_fbap_premium_version_ads);
update_option('xyz_fbap_default_selection_edit',$xyz_fbap_default_selection_edit);
update_option('xyz_fbap_default_selection_create',$xyz_fbap_default_selection_create);
// update_option('xyz_fbap_utf_decode_enable',$xyz_fbap_utf_decode_enable);
$xyz_credit_link=get_option('xyz_credit_link');
$xyz_fbap_include_pages=get_option('xyz_fbap_include_pages');
$xyz_fbap_include_posts=get_option('xyz_fbap_include_posts');
$xyz_fbap_include_categories=get_option('xyz_fbap_include_categories');
/*if ($xyz_fbap_include_categories!='All')
$xyz_fbap_include_categories=explode(',', $xyz_fbap_include_categories);*/
$xyz_fbap_include_customposttypes=get_option('xyz_fbap_include_customposttypes');
$xyz_fbap_apply_filters=get_option('xyz_fbap_apply_filters');
$xyz_fbap_peer_verification=get_option('xyz_fbap_peer_verification');
$xyz_fbap_premium_version_ads=get_option('xyz_fbap_premium_version_ads');
$xyz_fbap_default_selection_edit=get_option('xyz_fbap_default_selection_edit');
$xyz_fbap_default_selection_create=get_option('xyz_fbap_default_selection_create');
// $xyz_fbap_utf_decode_enable=get_option('xyz_fbap_utf_decode_enable');
<div id="xyz_fbap_basic_settings" class="xyz_fbap_tabcontent">
<?php wp_nonce_field( 'xyz_fbap_basic_settings_form_nonce' );?>
<table class="widefat xyz_fbap_widefat_table" style="width: 99%">
<tr><td><h2> <?php _e('Basic Settings','facebook-auto-publish'); ?> </h2></td></tr>
<td colspan="1"> <?php _e('Publish wordpress `posts` to facebook','facebook-auto-publish'); ?>
<td class="switch-field">
<label id="xyz_fbap_include_posts_yes"><input type="radio" name="xyz_fbap_include_posts" value="1" <?php if($xyz_fbap_include_posts==1) echo 'checked';?>/> <?php _e('Yes','facebook-auto-publish'); ?> </label>
<label id="xyz_fbap_include_posts_no"><input type="radio" name="xyz_fbap_include_posts" value="0" <?php if($xyz_fbap_include_posts==0) echo 'checked';?>/> <?php _e('No','facebook-auto-publish'); ?> </label>
<td colspan="1" width="50%"> <?php _e('Publish wordpress `pages` to facebook','facebook-auto-publish'); ?>
<td class="switch-field">
<label id="xyz_fbap_include_pages_yes"><input type="radio" name="xyz_fbap_include_pages" value="1" <?php if($xyz_fbap_include_pages==1) echo 'checked';?>/> <?php _e('Yes','facebook-auto-publish'); ?> </label>
<label id="xyz_fbap_include_pages_no"><input type="radio" name="xyz_fbap_include_pages" value="0" <?php if($xyz_fbap_include_pages==0) echo 'checked';?>/> <?php _e('No','facebook-auto-publish'); ?> </label>
$xyz_fbap_hide_custompost_settings='';
$output = 'names'; // names or objects, note names is the default
$operator = 'and'; // 'and' or 'or'
$post_types=get_post_types($args,$output,$operator);
$ar1=explode(",",$xyz_fbap_include_customposttypes);
$xyz_fbap_hide_custompost_settings = 'style="display: none;"';//echo 'NA';
<tr valign="top" <?php echo $xyz_fbap_hide_custompost_settings;?>>
<td colspan="1"> <?php _e('Select wordpress custom post types for auto publish','facebook-auto-publish'); ?> </td>
<td> <?php foreach ($post_types as $post_type ) {
echo '<input type="checkbox" name="post_types[]" value="'.$post_type.'" ';
if(in_array($post_type, $ar1))
echo 'checked="checked"/>';
<tr><td><h2> <?php _e('Advanced Settings','facebook-auto-publish'); ?> </h2> </td></tr>
<tr valign="top" id="selPostCat">
<td colspan="1"> <?php _e('Select post categories for auto publish','facebook-auto-publish'); ?>
<td class="switch-field">
<input type="hidden" value="<?php echo esc_html($xyz_fbap_include_categories);?>" name="xyz_fbap_sel_cat" id="xyz_fbap_sel_cat">
<label id="xyz_fbap_include_categories_no">
<input type="radio" name="xyz_fbap_cat_all" id="xyz_fbap_cat_all" value="All" onchange="rd_cat_chn(1,-1)" <?php if($xyz_fbap_include_categories=="All") echo "checked"?>> <?php _e('All','facebook-auto-publish'); ?> <font style="padding-left: 10px;"></font></label>
<label id="xyz_fbap_include_categories_yes">
<input type="radio" name="xyz_fbap_cat_all" id="xyz_fbap_cat_all" value="" onchange="rd_cat_chn(1,1)" <?php if($xyz_fbap_include_categories!="All") echo "checked"?>> <?php _e('Specific','facebook-auto-publish'); ?> </label>
<br /> <br /> <div class="scroll_checkbox" id="cat_dropdown_span">
'show_option_none' => '',
'id' => 'xyz_fbap_catlist',
'taxonomy' => 'category' );
if(count(get_categories($args))>0)
$xyz_fbap_include_categories=explode(',', $xyz_fbap_include_categories);
$fbap_categories=get_categories($args);
foreach ($fbap_categories as $fbap_cat)
$cat_id[]=$fbap_cat->cat_ID;
$cat_name[]=$fbap_cat->cat_name;
<input type="checkbox" name="xyz_fbap_catlist[]" value="<?php echo $fbap_cat->cat_ID;?>" <?php if(is_array($xyz_fbap_include_categories)) { if(in_array($fbap_cat->cat_ID, $xyz_fbap_include_categories)) echo "checked";} ?>/><?php echo $fbap_cat->cat_name; ?>
_e('NIL','facebook-auto-publish');
<td scope="row" colspan="1" width="50%"> <?php _e('Auto publish on editing posts/pages/custom post types','facebook-auto-publish'); ?>
<input type="radio" name="xyz_fbap_default_selection_edit" value="1" <?php if($xyz_fbap_default_selection_edit==1) echo 'checked';?>/> <?php _e('Enabled','facebook-auto-publish'); ?> <br/>
<input type="radio" name="xyz_fbap_default_selection_edit" value="0" <?php if($xyz_fbap_default_selection_edit==0) echo 'checked';?>/> <?php _e('Disabled','facebook-auto-publish'); ?> <br/>
<input type="radio" name="xyz_fbap_default_selection_edit" value="2" <?php if($xyz_fbap_default_selection_edit==2) echo 'checked';?>/> <?php _e('Use settings from post creation or post updation','facebook-auto-publish'); ?>
<td scope="row" colspan="1" width="50%"> <?php _e('Auto publish on creating posts/pages/custom post types','facebook-auto-publish'); ?>
<input type="radio" name="xyz_fbap_default_selection_create" value="1" <?php if($xyz_fbap_default_selection_create==1) echo 'checked';?>/> <?php _e('Enabled','facebook-auto-publish'); ?> <br/>
<input type="radio" name="xyz_fbap_default_selection_create" value="0" <?php if($xyz_fbap_default_selection_create==0) echo 'checked';?>/> <?php _e('Disabled','facebook-auto-publish'); ?> <br/>
<td scope="row" colspan="1" width="50%"> <?php _e('Enable SSL peer verification in remote requests','facebook-auto-publish'); ?> </td>
<td class="switch-field">
<label id="xyz_fbap_peer_verification_yes"><input type="radio" name="xyz_fbap_peer_verification" value="1" <?php if($xyz_fbap_peer_verification==1) echo 'checked';?>/> <?php _e('Yes','facebook-auto-publish'); ?> </label>
<label id="xyz_fbap_peer_verification_no"><input type="radio" name="xyz_fbap_peer_verification" value="0" <?php if($xyz_fbap_peer_verification==0) echo 'checked';?>/> <?php _e('No','facebook-auto-publish'); ?> </label>
<td scope="row" colspan="1"> <?php _e('Apply filters during publishing','facebook-auto-publish'); ?> </td>
$ar2=explode(",",$xyz_fbap_apply_filters);
echo '<input type="checkbox" name="xyz_fbap_applyfilters[]" value="'.$filVal.'" ';
if(in_array($filVal, $ar2))
echo 'checked="checked"/>';
echo '<label>'.$filName.'</label><br/>';
<td scope="row" colspan="1" width="50%">Enable utf-8 decoding before publishing </td>
<td class="switch-field">
<label id="xyz_fbap_utf_decode_enable_yes"><input type="radio" name="xyz_fbap_utf_decode_enable" value="1" <?php //if($xyz_fbap_utf_decode_enable==1) echo 'checked';?>/>Yes</label>
<label id="xyz_fbap_utf_decode_enable_no"><input type="radio" name="xyz_fbap_utf_decode_enable" value="0" <?php //if($xyz_fbap_utf_decode_enable==0) echo 'checked';?>/>No</label>
<tr><td><h2> <?php _e('Other Settings','facebook-auto-publish'); ?> </h2> </td></tr>
<td colspan="1"> <?php _e('Enable credit link to author','facebook-auto-publish'); ?>
<td class="switch-field">
<label id="xyz_credit_link_yes"><input type="radio" name="xyz_credit_link" value="fbap" <?php if($xyz_credit_link=='fbap') echo 'checked';?>/> <?php _e('Yes','facebook-auto-publish'); ?> </label>
<label id="xyz_credit_link_no"><input type="radio" name="xyz_credit_link" value="<?php echo $xyz_credit_link!='fbap'?$xyz_credit_link:0;?>" <?php if($xyz_credit_link!='fbap') echo 'checked';?>/> <?php _e('No','facebook-auto-publish'); ?> </label>
<td colspan="1"> <?php _e('Enable premium version ads','facebook-auto-publish'); ?>
<td class="switch-field">
<label id="xyz_fbap_premium_version_ads_yes"><input type="radio" name="xyz_fbap_premium_version_ads" value="1" <?php if($xyz_fbap_premium_version_ads==1) echo 'checked';?>/> <?php _e('Yes','facebook-auto-publish'); ?> </label>
<label id="xyz_fbap_premium_version_ads_no"><input type="radio" name="xyz_fbap_premium_version_ads" value="0" <?php if($xyz_fbap_premium_version_ads==0) echo 'checked';?>/> <?php _e('No','facebook-auto-publish'); ?> </label>
<td id="bottomBorderNone">
<td id="bottomBorderNone"><div style="height: 50px;">
<input type="submit" class="submit_fbap_new" style="margin-top: 10px;" value="<?php _e('Update Settings','facebook-auto-publish'); ?>" name="bsettngs" /></div></td>
<?php if (is_array($xyz_fbap_include_categories))
$xyz_fbap_include_categories1=implode(',', $xyz_fbap_include_categories);
$xyz_fbap_include_categories1=$xyz_fbap_include_categories;
<script type="text/javascript">
var xyzscripts_userid='';
xyzscripts_userid='<?php echo get_option('xyz_fbap_xyzscripts_user_id');?>';
var catval='<?php echo $xyz_fbap_include_categories1; ?>';
var custtypeval='<?php echo esc_html($xyz_fbap_include_customposttypes); ?>';
var get_opt_cats='<?php echo esc_html(get_option('xyz_fbap_include_posts'));?>';
jQuery(document).ready(function() {
if(isset($_POST['bsettngs']))
document.getElementById("xyz_fbap_basic_tab_settings").click();
document.getElementById("xyz_fbap_default_tab_settings").click();
// Get the element with id="xyz_fbap_default_tab_settings" and click on it
jQuery("#cat_dropdown_span").hide();
jQuery("#cat_dropdown_span").show();
jQuery('#selPostCat').hide();
jQuery('#selPostCat').show();
var xyz_credit_link=jQuery("input[name='xyz_credit_link']:checked").val();
if(xyz_credit_link=='fbap')
XyzFbapToggleRadio(xyz_credit_link,'xyz_credit_link');
var xyz_fbap_cat_all=jQuery("input[name='xyz_fbap_cat_all']:checked").val();
if (xyz_fbap_cat_all == 'All')
XyzFbapToggleRadio(xyz_fbap_cat_all,'xyz_fbap_include_categories');
var fbap_toggle_element_ids=['xyz_fbap_post_permission','xyz_fbap_include_pages',
'xyz_fbap_include_posts',
'xyz_fbap_peer_verification','xyz_fbap_premium_version_ads','xyz_fbap_enforce_og_tags','xyz_fbap_clear_fb_cache'];
jQuery.each(fbap_toggle_element_ids, function( index, value ) {
checkedval= jQuery("input[name='"+value+"']:checked").val();
XyzFbapToggleRadio(checkedval,value);
var xyz_fbap_app_sel_mode=jQuery("input[name='xyz_fbap_app_sel_mode']:checked").val();
if(xyz_fbap_app_sel_mode !=0){
jQuery('#xyz_fbap_conn_to_xyzscripts').show();
jQuery('.xyz_fbap_facebook_settings').hide();
jQuery('#xyz_fbap_app_creation_note').hide();
jQuery('.xyz_fbap_facebook_settings').show();
jQuery('#xyz_fbap_app_creation_note').show();
jQuery('#xyz_fbap_conn_to_xyzscripts').hide();
jQuery("input[name='xyz_fbap_app_sel_mode']").click(function(){
var xyz_fbap_app_sel_mode=jQuery("input[name='xyz_fbap_app_sel_mode']:checked").val();
if(xyz_fbap_app_sel_mode !=0){
jQuery('#xyz_fbap_app_creation_note').hide();
jQuery('.xyz_fbap_facebook_settings').hide();
if(xyzscripts_userid=='')
jQuery('#xyz_fbap_conn_to_xyzscripts').show();
jQuery('#xyz_fbap_app_creation_note').show();
jQuery('.xyz_fbap_facebook_settings').show();
jQuery('#xyz_fbap_conn_to_xyzscripts').hide();
window.addEventListener('message', function(e) {
xyz_fbap_ProcessChildMessage_2(e.data);
function toggleRadio(value,buttonId)
jQuery("#"+buttonId+"_no").css({"background-color": "#dddddd", "color": "#888888", "font-weight": "normal"});
jQuery("#"+buttonId+"_yes").css({"background-color": "#28A6A2","color":"#1e1b1b", "font-weight": "bold"});
jQuery("#"+buttonId+"_yes").css({"background-color": "#dddddd", "color": "#888888", "font-weight": "normal"});
jQuery("#"+buttonId+"_no").css({"background-color": "#28A6A2","color":"#1e1b1b", "font-weight": "bold"});
for(k=0;k<obj.options.length;k++)
if(obj.options[k].selected)
sel_str+=obj.options[k].value+",";
var lastChar = sel_str.substring(l-1, l);
sel_str = sel_str.substring(0, l-1);
document.getElementById('xyz_fbap_sel_cat').value=sel_str;
function rd_cat_chn(val,act)
jQuery("#cat_dropdown_span").hide();
jQuery("#cat_dropdown_span").show();
function xyz_fbap_info_insert(inf){
var e = document.getElementById("xyz_fbap_info");
var ins_opt = e.options[e.selectedIndex].text;
var str=jQuery("textarea#xyz_fbap_message").val()+ins_opt;
jQuery("textarea#xyz_fbap_message").val(str);
jQuery('#xyz_fbap_info :eq(0)').prop('selected', true);
jQuery("textarea#xyz_fbap_message").focus();
function xyz_fbap_show_postCategory(val)
jQuery('#selPostCat').hide();
jQuery('#selPostCat').show();
jQuery("#select_all_pages").click(function(){
jQuery(".selpages").prop("checked",jQuery("#select_all_pages").prop("checked"));