: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
<td colspan="1"><?php _e('Publish wordpress `posts` to twitter','twitter-auto-publish'); ?>
<td class="switch-field">
<label id="xyz_twap_include_posts_yes"><input type="radio" name="xyz_twap_include_posts" value="1" <?php if($xyz_twap_include_posts==1) echo 'checked';?>/> <?php _e('Yes','twitter-auto-publish'); ?> </label>
<label id="xyz_twap_include_posts_no"><input type="radio" name="xyz_twap_include_posts" value="0" <?php if($xyz_twap_include_posts==0) echo 'checked';?>/> <?php _e('No','twitter-auto-publish'); ?> </label>
$xyz_twap_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_twap_include_customposttypes);
$xyz_twap_hide_custompost_settings = 'style="display: none;"';//echo 'NA';
<tr valign="top" <?php echo $xyz_twap_hide_custompost_settings;?>>
<td colspan="1"> <?php _e('Select wordpress custom post types for auto publish','twitter-auto-publish'); ?></td>
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','twitter-auto-publish'); ?></h2></td></tr>
<tr valign="top" id="selPostCat">
<td colspan="1"> <?php _e('Select post categories for auto publish','twitter-auto-publish'); ?>
<td class="switch-field">
<input type="hidden" value="<?php echo esc_html($xyz_twap_include_categories);?>" name="xyz_twap_sel_cat"
<label id="xyz_twap_include_categories_no">
<input type="radio" name="xyz_twap_cat_all" id="xyz_twap_cat_all" value="All" onchange="rd_cat_chn(1,-1)" <?php if($xyz_twap_include_categories=="All") echo "checked"?>> <?php _e('All','twitter-auto-publish'); ?><font style="padding-left: 10px;"></font></label>
<label id="xyz_twap_include_categories_yes">
<input type="radio" name="xyz_twap_cat_all" id="xyz_twap_cat_all" value="" onchange="rd_cat_chn(1,1)" <?php if($xyz_twap_include_categories!="All") echo "checked"?>> <?php _e('Specific','twitter-auto-publish'); ?></label>
<br /> <br /> <div class="scroll_checkbox" id="cat_dropdown_span">
'show_option_none' => '',
'id' => 'xyz_twap_catlist',
'taxonomy' => 'category');
if(count(get_categories($args))>0)
$xyz_twap_include_categories=explode(',', $xyz_twap_include_categories);
$twap_categories=get_categories($args);
foreach ($twap_categories as $twap_cat)
$cat_id[]=$twap_cat->cat_ID;
$cat_name[]=$twap_cat->cat_name;
<input type="checkbox" name="xyz_twap_catlist[]" value="<?php echo $twap_cat->cat_ID;?>" <?php if(is_array($xyz_twap_include_categories)) if(in_array($twap_cat->cat_ID, $xyz_twap_include_categories)) echo "checked" ?>/><?php echo $twap_cat->cat_name; ?>
_e('NIL','twitter-auto-publish');
<td> <?php _e('Add twitter cards while posting to twitter','twitter-auto-publish'); ?> <img src="<?php echo $heimg?>"
onmouseover="detdisplay_twap('xyz_smap_free_enforce_card')" onmouseout="dethide_twap('xyz_smap_free_enforce_card')" style="width:13px;height:auto;">
<div id="xyz_smap_free_enforce_card" class="twap_informationdiv" style="display: none;">* <?php _e('By crawling twitter card specific meta tags, twitter can generate a summarised preview of the tweeted link.','twitter-auto-publish'); ?><br/> * <?php _e('To generate tweet preview of post,set <b>Attach media to twitter post</b> as <b>No</b>','twitter-auto-publish'); ?> </div></td>
<td class="switch-field">
<label id="xyz_smap_free_enforce_twitter_cards_yes"><input type="radio" name="xyz_smap_free_enforce_twitter_cards" value="1" <?php if($xyz_smap_free_enforce_twitter_cards==1) echo 'checked';?>/> <?php _e('Yes','twitter-auto-publish'); ?> </label>
<label id="xyz_smap_free_enforce_twitter_cards_no"><input type="radio" name="xyz_smap_free_enforce_twitter_cards" value="0" <?php if($xyz_smap_free_enforce_twitter_cards==0) echo 'checked';?>/> <?php _e('No','twitter-auto-publish'); ?> </label>
<td scope="row" colspan="1" width="50%"> <?php _e('Auto publish on editing posts/pages/custom post types','twitter-auto-publish'); ?>
<input type="radio" name="xyz_twap_default_selection_edit" value="1" <?php if($xyz_twap_default_selection_edit==1) echo 'checked';?>/> <?php _e('Enabled','twitter-auto-publish'); ?>
<br/><input type="radio" name="xyz_twap_default_selection_edit" value="0" <?php if($xyz_twap_default_selection_edit==0) echo 'checked';?>/> <?php _e('Disabled','twitter-auto-publish'); ?>
<br/><input type="radio" name="xyz_twap_default_selection_edit" value="2" <?php if($xyz_twap_default_selection_edit==2) echo 'checked';?>/> <?php _e('Use settings from post creation or post updation','twitter-auto-publish'); ?>
<td scope="row" colspan="1" width="50%"> <?php _e('Auto publish on creating posts/pages/custom post types','twitter-auto-publish'); ?>
<input type="radio" name="xyz_twap_default_selection_create" value="1" <?php if($xyz_twap_default_selection_create==1) echo 'checked';?>/> <?php _e('Enabled','twitter-auto-publish'); ?>
<br/><input type="radio" name="xyz_twap_default_selection_create" value="0" <?php if($xyz_twap_default_selection_create==0) echo 'checked';?>/> <?php _e('Disabled','twitter-auto-publish'); ?>
<td scope="row" colspan="1" width="50%"> <?php _e('Enable SSL peer verification in remote requests','twitter-auto-publish'); ?> </td>
<td class="switch-field">
<label id="xyz_twap_peer_verification_yes"><input type="radio" name="xyz_twap_peer_verification" value="1" <?php if($xyz_twap_peer_verification==1) echo 'checked';?>/> <?php _e('Yes','twitter-auto-publish'); ?> </label>
<label id="xyz_twap_peer_verification_no"><input type="radio" name="xyz_twap_peer_verification" value="0" <?php if($xyz_twap_peer_verification==0) echo 'checked';?>/> <?php _e('No','twitter-auto-publish'); ?> </label>
<td scope="row" colspan="1"> <?php _e('Apply filters during publishing','twitter-auto-publish'); ?> </td>
$ar2=explode(",",$xyz_twap_apply_filters);
echo '<input type="checkbox" name="xyz_twap_applyfilters[]" value="'.$filVal.'" ';
if(in_array($filVal, $ar2))
echo 'checked="checked"/>';
echo '<label>'.$filName.'</label><br/>';
<tr><td><h2> <?php _e('Other Settings','twitter-auto-publish'); ?></h2></td></tr>
<td colspan="1"> <?php _e('Enable credit link to author','twitter-auto-publish'); ?>
<td class="switch-field">
<label id="xyz_credit_link_yes"><input type="radio" name="xyz_credit_link" value="twap" <?php if($xyz_credit_link=='twap') echo 'checked';?>/> <?php _e('Yes','twitter-auto-publish'); ?> </label>
<label id="xyz_credit_link_no"><input type="radio" name="xyz_credit_link" value="<?php echo $xyz_credit_link!='twap'?$xyz_credit_link:0;?>" <?php if($xyz_credit_link!='twap') echo 'checked';?>/> <?php _e('No','twitter-auto-publish'); ?> </label>
<td colspan="1"> <?php _e('Enable premium version ads','twitter-auto-publish'); ?>
<td class="switch-field">
<label id="xyz_twap_premium_version_ads_yes"><input type="radio" name="xyz_twap_premium_version_ads" value="1" <?php if($xyz_twap_premium_version_ads==1) echo 'checked';?>/> <?php _e('Yes','twitter-auto-publish'); ?> </label>
<label id="xyz_twap_premium_version_ads_no"><input type="radio" name="xyz_twap_premium_version_ads" value="0" <?php if($xyz_twap_premium_version_ads==0) echo 'checked';?>/> <?php _e('No','twitter-auto-publish'); ?> </label>
<td id="bottomBorderNone">
<td id="bottomBorderNone"><div style="height: 50px;">
<input type="submit" class="submit_twap_new" style="margin-top: 10px;" value="<?php _e('Update Settings','twitter-auto-publish'); ?>" name="bsettngs" /></div></td>
<?php if (is_array($xyz_twap_include_categories))
$xyz_twap_include_categories1=implode(',', $xyz_twap_include_categories);
$xyz_twap_include_categories1=$xyz_twap_include_categories;
<script type="text/javascript">
var catval='<?php echo esc_html($xyz_twap_include_categories1); ?>';
var custtypeval='<?php echo esc_html($xyz_twap_include_customposttypes); ?>';
var get_opt_cats='<?php echo esc_html(get_option('xyz_twap_include_posts'));?>';
jQuery(document).ready(function() {
<?php if(isset($_POST['bsettngs'])) {?>
document.getElementById("xyz_twap_basic_tab_settings").click();
document.getElementById("xyz_twap_default_tab_settings").click();
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=='twap')
XyzTwapToggleRadio(xyz_credit_link,'xyz_credit_link');
var xyz_twap_cat_all=jQuery("input[name='xyz_twap_cat_all']:checked").val();
if (xyz_twap_cat_all == 'All')
XyzTwapToggleRadio(xyz_twap_cat_all,'xyz_twap_include_categories');
var toggle_element_ids=['xyz_twap_twpost_image_permission','xyz_smap_free_enforce_twitter_cards','xyz_twap_twpost_permission','xyz_twap_include_pages','xyz_twap_include_posts','xyz_twap_peer_verification','xyz_twap_premium_version_ads'];
jQuery.each(toggle_element_ids, function( index, value ) {
checkedval= jQuery("input[name='"+value+"']:checked").val();
XyzTwapToggleRadio(checkedval,value);
var xyz_twap_app_sel_mode=jQuery("input[name='xyz_twap_app_sel_mode']:checked").val();
if(xyz_twap_app_sel_mode !=0){
jQuery('.xyz_twap_twitter_settings').hide();
jQuery('#xyz_twap_app_creation_note').hide();
jQuery('#xyz_twap_conn_to_xyzscripts').show();
jQuery('.xyz_twap_twitter_auth').show();
jQuery('.xyz_twap_twitter_settings').show();
jQuery('#xyz_twap_app_creation_note').show();
jQuery('#xyz_twap_conn_to_xyzscripts').hide();
jQuery('.xyz_twap_twitter_auth').hide();
jQuery("input[name='xyz_twap_app_sel_mode']").click(function(){
var xyz_twap_app_sel_mode=jQuery("input[name='xyz_twap_app_sel_mode']:checked").val();
if(xyz_twap_app_sel_mode !=0){
jQuery('#xyz_twap_app_creation_note').hide();
jQuery('.xyz_twap_twitter_settings').hide();
jQuery('#xyz_twap_conn_to_xyzscripts').show();
jQuery('.xyz_twap_twitter_auth').show();
jQuery('#xyz_twap_app_creation_note').show();
jQuery('.xyz_twap_twitter_settings').show();
jQuery('#xyz_twap_conn_to_xyzscripts').hide();
jQuery('.xyz_twap_twitter_auth').hide();
window.addEventListener('message', function(e) {
xyz_twap_ProcessChildMessage(e.data);
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_twap_sel_cat').value=sel_str;
//var d1='<?php // echo esc_html($xyz_twap_include_categories1);?>';
// splitText = d1.split(",");
// jQuery.each(splitText, function(k,v) {
// jQuery("#xyz_twap_catlist").children("option[value="+v+"]").attr("selected","selected");
function rd_cat_chn(val,act)
jQuery("#cat_dropdown_span").hide();
jQuery("#cat_dropdown_span").show();
function xyz_twap_info_insert(inf){
var e = document.getElementById("xyz_twap_info");
var ins_opt = e.options[e.selectedIndex].text;
var str=jQuery("textarea#xyz_twap_twmessage").val()+ins_opt;
jQuery("textarea#xyz_twap_twmessage").val(str);
jQuery('#xyz_twap_info :eq(0)').prop('selected', true);
jQuery("textarea#xyz_twap_twmessage").focus();
function xyz_twap_show_postCategory(val)
jQuery('#selPostCat').hide();
jQuery('#selPostCat').show();
var toggle_element_ids=['xyz_twap_twpost_image_permission','xyz_smap_free_enforce_twitter_cards','xyz_twap_twpost_permission','xyz_twap_include_pages','xyz_twap_include_posts','xyz_twap_peer_verification','xyz_credit_link','xyz_twap_premium_version_ads','xyz_twap_include_categories'];
jQuery.each(toggle_element_ids, function( index, value ) {
jQuery("#"+value+"_no").click(function(){
XyzTwapToggleRadio(0,value);
if(value=='xyz_twap_include_posts')
xyz_twap_show_postCategory(0);
jQuery("#"+value+"_yes").click(function(){
XyzTwapToggleRadio(1,value);
if(value=='xyz_twap_include_posts')
xyz_twap_show_postCategory(1);
function xyz_twap_open_tab(evt, xyz_twap_form_div_id) {
var i, xyz_twap_tabcontent, xyz_twap_tablinks;
tabcontent = document.getElementsByClassName("xyz_twap_tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
tablinks = document.getElementsByClassName("xyz_twap_tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
document.getElementById(xyz_twap_form_div_id).style.display = "block";
evt.currentTarget.className += " active";
function twap_popup_connect_to_xyzscripts()
var twap_xyzscripts_url='<?php echo "https://smap.xyzscripts.com/index.php?page=index/register";?>';
childWindow = window.open(twap_xyzscripts_url, "Connect to xyzscripts", "toolbar=yes,scrollbars=yes,resizable=yes,left=500,width=600,height=600");
function twap_popup_tw_auth(domain_name,xyz_twap_smapsoln_userid,xyzscripts_user_id,xyzscripts_hash_val,auth_secret_key,request_hash)
if(xyzscripts_user_id==''|| xyzscripts_hash_val=='')
if(jQuery('#system_notice_area').length==0)
jQuery('body').append('<div class="system_notice_area_style0" id="system_notice_area"></div>');
jQuery("#system_notice_area").html(xyz_script_twap_var.html3);
jQuery("#system_notice_area").append('<span id="system_notice_area_dismiss"> <?php _e('Dismiss','twitter-auto-publish'); ?> </span>');
jQuery("#system_notice_area").show();
jQuery('#system_notice_area_dismiss').click(function() {
jQuery('#system_notice_area').animate({
var smap_solution_url='<?php echo XYZ_TWAP_SMAPSOLUTION_AUTH_URL;?>';
childWindow = window.open(smap_solution_url+"authorize-twitter/twitter.php?smap_tw_auth_id="+xyz_twap_smapsoln_userid+"&account_id="+account_id+
"&domain_name="+domain_name+"&xyzscripts_user_id="+xyzscripts_user_id+"&smap_licence_key="+smap_licence_key+"&auth_secret_key="+auth_secret_key+"&free_plugin_source=twap&request_hash="+request_hash, "SmapSolutions Authorization", "toolbar=yes,scrollbars=yes,resizable=yes,left=500,width=600,height=600");
function xyz_twap_ProcessChildMessage(message) {
var messageType = message.slice(0,5);
if(messageType==="error")
message=message.substring(6);
if(jQuery('#system_notice_area').length==0)
jQuery('body').append('<div class="system_notice_area_style0" id="system_notice_area"></div>');
jQuery("#system_notice_area").html(message+' <span id="system_notice_area_dismiss"> <?php _e('Dismiss','twitter-auto-publish'); ?> </span>');
jQuery("#system_notice_area").show();
jQuery('#system_notice_area_dismiss').click(function() {
jQuery('#system_notice_area').animate({
var obj1=jQuery.parseJSON(message);
if(obj1.content && obj1.userid && obj1.xyzscripts_user)
var xyz_userid=obj1.userid;var xyz_user_hash=obj1.content;
var xyz_twap_xyzscripts_accinfo_nonce= '<?php echo wp_create_nonce('xyz_twap_xyzscripts_accinfo_nonce');?>';
action: 'xyz_twap_xyzscripts_accinfo_auto_update',
xyz_user_hash: xyz_user_hash,
_wpnonce: xyz_twap_xyzscripts_accinfo_nonce
jQuery("#connect_to_xyzscripts").hide();
jQuery("#ajax-save-xyzscript_acc").show();
jQuery.post(ajaxurl, dataString ,function(response) {
alert(xyz_script_twap_var.alert3);
var base_url = '<?php echo admin_url('admin.php?page=twitter-auto-publish-settings');?>';
window.location.href = base_url+'&msg=1';
if((obj1.xyz_tw_username) && (obj1.xyz_tw_user_id)){
var secretkey=obj1.xyz_secretkey;
var smapsoln_userid=obj1.xyz_smapsoln_userid;
var xyz_tw_user_id=obj1.xyz_tw_user_id;
var xyz_twap_xyzscripts_hash_val=obj1.xyz_smap_xyzscripts_hash_val;
var xyz_twap_xyzscripts_user_id=obj1.xyz_smap_xyzscripts_user_id;
var xyz_tw_username=obj1.xyz_tw_username;
var xyz_twap_tw_selected_pages_nonce= '<?php echo wp_create_nonce('xyz_twap_tw_account_details_nonce');?>';
action: 'xyz_twap_tw_account_details_auto_update',
twap_secretkey: secretkey,
xyz_twap_xyzscripts_user_id: xyz_twap_xyzscripts_user_id,
smapsoln_userid:smapsoln_userid,
xyz_tw_user_id:xyz_tw_user_id,
xyz_tw_username:xyz_tw_username,
xyz_twap_xyzscripts_hash_val:xyz_twap_xyzscripts_hash_val,
_wpnonce: xyz_twap_tw_selected_pages_nonce
jQuery.post(ajaxurl, dataString ,function(response)
alert(xyz_script_twap_var.alert3);
var base_url = '<?php echo admin_url('admin.php?page=twitter-auto-publish-settings');?>';//msg -
window.location.href = base_url+'&msg=2';