: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
<?php if( !defined('ABSPATH') ){ exit();}
if(isset($_GET['msg']) && $_GET['msg']=='smap_pack_updated'){
<div class="system_notice_area_style1" id="system_notice_area">
<?php $fbap_word_smap="SMAP";
$fbap_smap_update_msg=sprintf(__('%s Package updated successfully.','facebook-auto-publish'),$fbap_word_smap);
echo $fbap_smap_update_msg; ?>
<span id="system_notice_area_dismiss"><?php _e('Dismiss','facebook-auto-publish'); ?>
$free_plugin_source='fbap';
$domain_name=trim(get_option('siteurl'));
$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='';
if ($xyzscripts_user_id=='')
<b> <?php $fbap_word_smapsolution="smapsolutions";
$fbap_smap_auth_msg=sprintf(__('Please authorize %s app under Facebook settings to access this page.','facebook-auto-publish'),$fbap_word_smapsolution);
echo $fbap_smap_auth_msg; ?> </b>
.widefat {border: 1px solid #eeeeee!important;
border-bottom: 3px solid #00a0d2 !important;
.widefat th {border:1px solid #ffffff !important; background-color:#00a0d2; color:#ffffff; margin:0px !important; padding-top: 12px;
.widefat td, .widefat th {
.widefat tr{ border: 1px solid #ddd;}
.widefat tr:nth-child(even){background-color: #dddddd !important;}
.widefat tr:hover {background-color: #cccccc;}
.delete_auth_entry,.delete_inactive_fb_entry{background-color: #00a0d2;
.delete_auth_entry:hover{background-color:#008282;}
.select_box{display: block;
background-color:#b7b6b6;
background-color: #30a0d2;
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#auth_entries_div').show();
jQuery("#show_all").attr('checked', true);
jQuery("#show_all").click(function(){
jQuery('#fbap_manage_auth_table tr:has(td.diff_domain)').show();
jQuery('#fbap_manage_auth_table tr:has(td.same_domain)').show();
jQuery("#show_same_domain").click(function(){
jQuery('#fbap_manage_auth_table tr:has(td.diff_domain)').hide();
jQuery('#fbap_manage_auth_table tr:has(td.same_domain)').show();
jQuery("#show_diff_domain").click(function(){
jQuery('#fbap_manage_auth_table tr:has(td.diff_domain)').show();
jQuery('#fbap_manage_auth_table tr:has(td.same_domain)').hide();
jQuery(".delete_auth_entry").off('click').on('click', function() {
var auth_id=jQuery(this).attr("data-id");
jQuery("#show-del-icon_"+auth_id).hide();
jQuery("#ajax-save_"+auth_id).show();
var xyzscripts_user_hash=jQuery(this).attr("data-xyzscripts_hash");
var xyzscripts_id=jQuery(this).attr("data-xyzscriptsid");
var xyz_fbap_del_entries_nonce= '<?php echo wp_create_nonce('xyz_fbap_del_entries_nonce');?>';
action: 'xyz_fbap_del_entries',
xyzscripts_id: xyzscripts_id,
xyzscripts_user_hash: xyzscripts_user_hash,
_wpnonce: xyz_fbap_del_entries_nonce
jQuery.post(ajaxurl, dataString ,function(data) {
jQuery("#ajax-save_"+auth_id).hide();
alert(xyz_script_fbap_var.alert3);
var data=jQuery.parseJSON(data);
jQuery(".tr_"+auth_id).remove();
if(jQuery('#system_notice_area').length==0)
jQuery('body').append('<div class="system_notice_area_style1" id="system_notice_area"></div>');
jQuery("#system_notice_area").html(xyz_script_fbap_var.html1);
jQuery("#system_notice_area").append('<span id="system_notice_area_dismiss"><?php _e('Dismiss','facebook-auto-publish');?></span>');
jQuery("#system_notice_area").show();
jQuery('#system_notice_area_dismiss').click(function() {
jQuery('#system_notice_area').animate({
jQuery("#show_err_"+auth_id).append(data.msg);
jQuery("input[name='domain_selection']").click(function(){//show_diff_domain
numOfVisibleRows = jQuery('#fbap_manage_auth_table tr:visible').length;
jQuery('.xyz_fbap_manage_auth_th_fb').hide();
jQuery('#xyz_fbap_no_auth_entries').show();
jQuery('.xyz_fbap_manage_auth_th_fb').show();
jQuery('#xyz_fbap_no_auth_entries').hide();
///////////////////////DELETE INACTIVE FB ACC//////////////////////////////
jQuery(".delete_inactive_fb_entry").off('click').on('click', function() {
var fb_userid=jQuery(this).attr("data-fbid");
var tr_iterationid=jQuery(this).attr("data-iterationid");
jQuery("#show-del-icon-inactive-fb_"+tr_iterationid).hide();
jQuery("#ajax-save-inactive-fb_"+tr_iterationid).show();
var xyzscripts_user_hash=jQuery(this).attr("data-xyzscripts_hash");
var xyzscripts_id=jQuery(this).attr("data-xyzscriptsid");
var xyz_fbap_del_fb_entries_nonce= '<?php echo wp_create_nonce('xyz_fbap_del_fb_entries_nonce');?>';
action: 'xyz_fbap_del_fb_entries',
tr_iterationid: tr_iterationid ,
xyzscripts_id: xyzscripts_id,
xyzscripts_user_hash: xyzscripts_user_hash,
_wpnonce: xyz_fbap_del_fb_entries_nonce
jQuery.post(ajaxurl, dataString ,function(data) {
jQuery("#ajax-save-inactive-fb_"+tr_iterationid).hide();
alert(xyz_script_fbap_var.alert3);
var data=jQuery.parseJSON(data);
jQuery(".tr_inactive"+tr_iterationid).remove();
if(jQuery('#system_notice_area').length==0)
jQuery('body').append('<div class="system_notice_area_style1" id="system_notice_area"></div>');
jQuery("#system_notice_area").html(xyz_script_fbap_var.html2);
jQuery("#system_notice_area").append('<span id="system_notice_area_dismiss"><?php _e('Dismiss','facebook-auto-publish'); ?></span>');
jQuery("#system_notice_area").show();
jQuery('#system_notice_area_dismiss').click(function() {
jQuery('#system_notice_area').animate({
jQuery("#show_err_inactive_fb_"+tr_iterationid).append(data.msg );
///////////////////////////////////////////////////////////////////
window.addEventListener('message', function(e) {
ProcessChildMessage_2(e.data);
//////////////////////////////////////////////////////////////////
function ProcessChildMessage_2(message) {
var obj1=jQuery.parseJSON(message);//console.log(message);
if(obj1.smap_api_upgrade && obj1.success_flag){
var base = '<?php echo admin_url('admin.php?page=facebook-auto-publish-manage-authorizations&msg=smap_pack_updated');?>';
window.location.href = base;
function fbap_popup_purchase_plan(auth_secret_key,request_hash)
var xyz_smap_pre_smapsoln_userid=0;
var domain_name='<?php echo urlencode($domain_name); ?>';
var smap_licence_key='<?php echo $xyz_smap_licence_key;?>';
var smap_solution_url='<?php echo XYZ_SMAP_SOLUTION_AUTH_URL;?>';
var xyzscripts_hash_val ='<?php echo $xyzscripts_hash_val;?>';
var xyzscripts_user_id='<?php echo $xyzscripts_user_id; ?>';
var smap_plugin_source='<?php echo $free_plugin_source;?>';
childWindow=window.open(smap_solution_url+"authorize/facebook.php?smap_id="+xyz_smap_pre_smapsoln_userid+"&account_id="+account_id+"&domain_name="+domain_name+"&xyzscripts_user_id="+xyzscripts_user_id+"&request_hash="+request_hash+"&smap_licence_key="+smap_licence_key+"&auth_secret_key="+auth_secret_key+"&free_plugin_source="+smap_plugin_source+"&smap_api_upgrade=1", "SmapSolutions Authorization", "toolbar=yes,scrollbars=yes,resizable=yes,left=500,width=600,height=600");
<h3> <?php _e('Manage Authorizations','facebook-auto-publish'); ?> </h3>
$manage_auth_parameters=array(
'xyzscripts_user_id'=>$xyzscripts_user_id,
'free_plugin_source'=>$free_plugin_source,
$url=XYZ_SMAP_SOLUTION_AUTH_URL.'authorize/manage-authorizations.php';
$content=xyz_fbap_post_to_smap_api($manage_auth_parameters,$url,$xyzscripts_hash_val);
$result=json_decode($content,true);
if(!empty($result) && isset($result['status']))
echo '<div style="color:red;font-size:15px;padding:3px;">'.$er_msg.'</div>';
if($result['status']==1 || isset($result['package_details'])){
$auth_entries=$result['msg'];
<div id="auth_entries_div" style="margin-bottom: 5px;">
<?php if(!empty($result) && isset($result['package_details']))
?><div class="xyz_fbap_plan_label"> <?php _e('Current Plan:','facebook-auto-publish'); ?> </div><?php
$package_details=$result['package_details']; ?>
<div class="xyz_fbap_plan_div"> <?php _e('Allowed Facebook users:','facebook-auto-publish'); ?> <?php echo $package_details['allowed_fb_user_accounts'];?> </div>
<div class="xyz_fbap_plan_div"> <?php _e('API limit per account :','facebook-auto-publish'); ?> <?php echo $package_details['allowed_api_calls'];?> <?php _e('per hour','facebook-auto-publish'); ?> </div>
<div class="xyz_fbap_plan_div"> <?php _e('Package Expiry :','facebook-auto-publish'); ?> <?php echo date('d/m/Y g:i a', $package_details['expiry_time']);?> </div>
<div class="xyz_fbap_plan_div"> <?php _e('Package Status :','facebook-auto-publish'); ?> <?php echo $package_details['package_status'];?> </div>
$xyz_smap_plug_accountId=$xyz_fbap_pre_smapsoln_userid=0;$xyz_smap_plug_licence_key='';
$request_hash=md5($xyzscripts_user_id.$xyzscripts_hash_val);
$auth_secret_key=md5('smapsolutions'.$domain_name.$xyz_smap_plug_accountId.$xyz_fbap_pre_smapsoln_userid.$xyzscripts_user_id.$request_hash.$xyz_smap_plug_licence_key.$free_plugin_source.'1');
<div class="xyz_fbap_plan_div">
<a href="javascript:fbap_popup_purchase_plan('<?php echo $auth_secret_key;?>','<?php echo $request_hash;?>');void(0);">
<i class="fa fa-shopping-cart" aria-hidden="true"></i> <?php _e('Upgrade/Renew','facebook-auto-publish'); ?>
if (is_array($auth_entries) && !empty($auth_entries)){?>
<span class="select_box" style="float: left;margin-top: 16px;">
<input type="radio" name="domain_selection" value="0" id="show_all"> <?php _e('Show all entries','facebook-auto-publish'); ?>
<input type="radio" name="domain_selection" value="1" id="show_same_domain"> <?php _e('Show entries from current wp installation','facebook-auto-publish'); ?>
<input type="radio" name="domain_selection" value="2" id="show_diff_domain"> <?php _e('Show entries from other wp installations','facebook-auto-publish'); ?>
<table cellpadding="0" cellspacing="0" class="widefat" style="width: 99%; margin: 0 auto; border-bottom:none;" id="fbap_manage_auth_table">
<tr class="xyz_fbap_manage_auth_th">
<th scope="col" width="8%"> <?php _e('Facebook username','facebook-auto-publish'); ?> </th>
<th scope="col" width="10%"> <?php _e('Selected pages','facebook-auto-publish'); ?> </th>
<th scope="col" width="10%"> <?php _e('Selected groups','facebook-auto-publish'); ?> </th>
<th scope="col" width="10%"> <?php $fbap_wp="WP";
$fbap_wp_url=sprintf(__('%s url','facebook-auto-publish'),$fbap_wp);
echo $fbap_wp_url; ?> </th>
<th scope="col" width="10%"> <?php _e('Plugin','facebook-auto-publish'); ?> </th>
<th scope="col" width="5%"> <?php $fbap_smap_premium_var="(SMAP PREMIUM)";
$fbap_smap_premium_title= sprintf(__('Account ID %s','facebook-auto-publish'),$fbap_smap_premium_var);
echo $fbap_smap_premium_title; ?> </th>
<th scope="col" width="5%"> <?php _e('Action','facebook-auto-publish'); ?> </th>
foreach ($auth_entries as $auth_entries_key => $auth_entries_val)
if (isset($auth_entries_val['auth_id']))
<tr class="tr_<?php echo $auth_entries_val['auth_id'];?>">
<td><?php echo $auth_entries_val['fb_username'];?>
<?php if(isset($auth_entries_val['pages'])&& !empty($auth_entries_val['pages'])){?>
<td> <?php echo $auth_entries_val['pages'];?> </td>
<?php }else echo "<td> NA </td>";?>
<?php if(isset($auth_entries_val['groups'])&& !empty($auth_entries_val['groups'])){?>
<td> <?php echo $auth_entries_val['groups'];?> </td>
<?php }else echo "<td> NA </td>";?>
<?php if($auth_entries_val['domain_name']==$domain_name){?>
<td class='same_domain'> <?php echo $auth_entries_val['domain_name'];?> </td>
<td class='diff_domain'> <?php echo $auth_entries_val['domain_name'];?> </td>
if($auth_entries_val['free_plugin_source']=='fbap')
echo 'WP2SOCIAL AUTO PUBLISH';
elseif ($auth_entries_val['free_plugin_source']=='smap')
echo 'SOCIAL MEDIA AUTO PUBLISH';
elseif ($auth_entries_val['free_plugin_source']=='pls')
echo 'XYZ WP SMAP PREMIUM PLUS';
<td> <?php if($auth_entries_val['smap_pre_account_id']!=0)echo $auth_entries_val['smap_pre_account_id'];
else _e('Not Applicable','facebook-auto-publish');?> </td>
<?php if ($domain_name==$auth_entries_val['domain_name'] && $free_plugin_source==$auth_entries_val['free_plugin_source'] ) {
// $md5_encrypt=md5('smapsolutions'.$xyzscripts_user_id.$xyzscripts_hash_val.$auth_entries_val['auth_id']);
<span id='ajax-save_<?php echo $auth_entries_val['auth_id'];?>' style="display:none;"><img title="Deleting entry" src="<?php echo plugins_url("images/ajax-loader.gif",XYZ_FBAP_PLUGIN_FILE);?>" style="width:20px;height:20px; "></span>
<span id='show-del-icon_<?php echo $auth_entries_val['auth_id'];?>'>
<input type="button" class="delete_auth_entry" data-id=<?php echo $auth_entries_val['auth_id'];?> data-xyzscriptsid="<?php echo $xyzscripts_user_id;?>" data-xyzscripts_hash="<?php echo $xyzscripts_hash_val;?>" name='del_entry' value="<?php _e('Delete','facebook-auto-publish');?>" >
<span id='show_err_<?php echo $auth_entries_val['auth_id'];?>' style="color:red;" ></span>
<?php //data-encrypt="<?php echo $md5_encrypt;
else if (isset($auth_entries_val['inactive_fb_userid']))
<tr class="tr_inactive<?php echo $i;?>">
<td><?php echo $auth_entries_val['inactive_fb_username'];?><br/> <?php _e('(Inactive)','facebook-auto-publish'); ?>
<span id='ajax-save-inactive-fb_<?php echo $i;?>' style="display:none;"><img title="Deleting entry" src="<?php echo plugins_url("images/ajax-loader.gif",XYZ_FBAP_PLUGIN_FILE);?>" style="width:20px;height:20px; "></span>
<span id='show-del-icon-inactive-fb_<?php echo $i;?>'>
<input type="button" class="delete_inactive_fb_entry" data-iterationid=<?php echo $i;?> data-fbid=<?php echo $auth_entries_val['inactive_fb_userid'];?> data-xyzscriptsid="<?php echo $xyzscripts_user_id;?>" data-xyzscripts_hash="<?php echo $xyzscripts_hash_val;?>" name='del_entry' value="<?php _e('Delete','facebook-auto-publish');?>" >
<span id='show_err_inactive_fb_<?php echo $i;?>' style="color:red;" ></span>
<tr id="xyz_fbap_no_auth_entries" style="display: none;"><td> <?php _e('No Authorizations','facebook-auto-publish'); ?> </td></tr>
</table><?php } ?></div><?php
<div> <?php _e('Unable to connect. Please check your curl and firewall settings','facebook-auto-publish'); ?> </div>