Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/twitter-.../admin
File: settings.php
<?php
[0] Fix | Delete
if( !defined('ABSPATH') ){ exit();}
[1] Fix | Delete
global $current_user;
[2] Fix | Delete
$auth_varble=0;
[3] Fix | Delete
wp_get_current_user();
[4] Fix | Delete
$imgpath= plugins_url()."/twitter-auto-publish/images/";
[5] Fix | Delete
$heimg=$imgpath."support.png";
[6] Fix | Delete
$domain_name=$xyz_twap_smapsoln_userid=$xyzscripts_user_id=$xyzscripts_hash_val=$xyz_twap_licence_key='';
[7] Fix | Delete
[8] Fix | Delete
[9] Fix | Delete
if(!$_POST && isset($_GET['twap_notice']) && $_GET['twap_notice'] == 'hide')
[10] Fix | Delete
{
[11] Fix | Delete
if (! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'],'twap-shw')){
[12] Fix | Delete
wp_nonce_ays( 'twap-shw');
[13] Fix | Delete
exit;
[14] Fix | Delete
}
[15] Fix | Delete
update_option('xyz_twap_dnt_shw_notice', "hide");
[16] Fix | Delete
?>
[17] Fix | Delete
<style type='text/css'>
[18] Fix | Delete
#twap_notice_td
[19] Fix | Delete
{
[20] Fix | Delete
display:none !important;
[21] Fix | Delete
}
[22] Fix | Delete
</style>
[23] Fix | Delete
<div class="system_notice_area_style1" id="system_notice_area">
[24] Fix | Delete
<?php _e('Thanks again for using the plugin. We will never show the message again.','twitter-auto-publish');?>
[25] Fix | Delete
&nbsp;&nbsp;&nbsp;<span
[26] Fix | Delete
id="system_notice_area_dismiss"><?php _e('Dismiss','twitter-auto-publish');?></span>
[27] Fix | Delete
</div>
[28] Fix | Delete
[29] Fix | Delete
<?php
[30] Fix | Delete
}
[31] Fix | Delete
[32] Fix | Delete
[33] Fix | Delete
[34] Fix | Delete
$tms1="";
[35] Fix | Delete
$tms2="";
[36] Fix | Delete
$tms3="";
[37] Fix | Delete
$tms4="";
[38] Fix | Delete
$tms5="";
[39] Fix | Delete
$tms6="";
[40] Fix | Delete
[41] Fix | Delete
$terf=0;
[42] Fix | Delete
if(isset($_POST['twit']))
[43] Fix | Delete
{
[44] Fix | Delete
if (! isset( $_REQUEST['_wpnonce'] )|| ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'xyz_twap_tw_settings_form_nonce' ))
[45] Fix | Delete
{
[46] Fix | Delete
wp_nonce_ays( 'xyz_twap_tw_settings_form_nonce' );
[47] Fix | Delete
exit();
[48] Fix | Delete
}
[49] Fix | Delete
$tappid=sanitize_text_field($_POST['xyz_twap_twconsumer_id']);
[50] Fix | Delete
$tappsecret=sanitize_text_field($_POST['xyz_twap_twconsumer_secret']);
[51] Fix | Delete
$twid=sanitize_text_field($_POST['xyz_twap_tw_id']);
[52] Fix | Delete
$taccess_token=sanitize_text_field($_POST['xyz_twap_current_twappln_token']);
[53] Fix | Delete
$taccess_token_secret=sanitize_text_field($_POST['xyz_twap_twaccestok_secret']);
[54] Fix | Delete
$tposting_permission=intval($_POST['xyz_twap_twpost_permission']);
[55] Fix | Delete
$tposting_image_permission=intval($_POST['xyz_twap_twpost_image_permission']);
[56] Fix | Delete
$tmessagetopost=$_POST['xyz_twap_twmessage'];
[57] Fix | Delete
$xyz_twap_tw_char_limit=$_POST['xyz_twap_tw_char_limit'];
[58] Fix | Delete
$xyz_twap_tw_char_limit=intval($xyz_twap_tw_char_limit);
[59] Fix | Delete
if ($xyz_twap_tw_char_limit<140)
[60] Fix | Delete
$xyz_twap_tw_char_limit=140;
[61] Fix | Delete
$xyz_twap_app_sel_mode=get_option('xyz_smap_tw_app_sel_mode');
[62] Fix | Delete
if(isset($_POST['xyz_twap_app_sel_mode']))
[63] Fix | Delete
$xyz_twap_app_sel_mode=intval($_POST['xyz_twap_app_sel_mode']);
[64] Fix | Delete
if($tappid=="" && $tposting_permission==1 && $xyz_twap_app_sel_mode ==0)
[65] Fix | Delete
{
[66] Fix | Delete
$terf=1;
[67] Fix | Delete
$tms1= __('Please fill api key.','twitter-auto-publish');
[68] Fix | Delete
[69] Fix | Delete
}
[70] Fix | Delete
elseif($tappsecret=="" && $tposting_permission==1 && $xyz_twap_app_sel_mode ==0)
[71] Fix | Delete
{
[72] Fix | Delete
$tms2= __('Please fill api secret.','twitter-auto-publish');
[73] Fix | Delete
$terf=1;
[74] Fix | Delete
}
[75] Fix | Delete
elseif($twid=="" && $tposting_permission==1 && $xyz_twap_app_sel_mode ==0)
[76] Fix | Delete
{
[77] Fix | Delete
$tms3= __('Please fill twitter username.','twitter-auto-publish');
[78] Fix | Delete
$terf=1;
[79] Fix | Delete
}
[80] Fix | Delete
elseif($taccess_token=="" && $tposting_permission==1 && $xyz_twap_app_sel_mode ==0)
[81] Fix | Delete
{
[82] Fix | Delete
$tms4= __('Please fill twitter access token.','twitter-auto-publish');
[83] Fix | Delete
$terf=1;
[84] Fix | Delete
}
[85] Fix | Delete
elseif($taccess_token_secret=="" && $tposting_permission==1 && $xyz_twap_app_sel_mode ==0)
[86] Fix | Delete
{
[87] Fix | Delete
$tms5=__('Please fill twitter access token secret.','twitter-auto-publish');
[88] Fix | Delete
$terf=1;
[89] Fix | Delete
}
[90] Fix | Delete
elseif($tmessagetopost=="" && $tposting_permission==1)
[91] Fix | Delete
{
[92] Fix | Delete
$tms6= __('Please fill message format for posting.','twitter-auto-publish');
[93] Fix | Delete
$terf=1;
[94] Fix | Delete
}
[95] Fix | Delete
else
[96] Fix | Delete
{
[97] Fix | Delete
$terf=0;
[98] Fix | Delete
if($tmessagetopost=="")
[99] Fix | Delete
{
[100] Fix | Delete
$tmessagetopost="{POST_TITLE}-{PERMALINK}";
[101] Fix | Delete
}
[102] Fix | Delete
if($xyz_twap_app_sel_mode==0)
[103] Fix | Delete
{
[104] Fix | Delete
update_option('xyz_twap_twconsumer_id',$tappid);
[105] Fix | Delete
update_option('xyz_twap_twconsumer_secret',$tappsecret);
[106] Fix | Delete
//if(empty(get_option('xyz_twap_smapsoln_userid')) && $xyz_twap_app_sel_mode==1)//do not override username if smapsolution auth entry is not deleted
[107] Fix | Delete
update_option('xyz_twap_tw_id',$twid);
[108] Fix | Delete
update_option('xyz_twap_current_twappln_token',$taccess_token);
[109] Fix | Delete
update_option('xyz_twap_twaccestok_secret',$taccess_token_secret);
[110] Fix | Delete
}
[111] Fix | Delete
update_option('xyz_twap_tw_app_sel_mode',$xyz_twap_app_sel_mode);
[112] Fix | Delete
update_option('xyz_twap_twmessage',$tmessagetopost);
[113] Fix | Delete
update_option('xyz_twap_twpost_permission',$tposting_permission);
[114] Fix | Delete
update_option('xyz_twap_twpost_image_permission',$tposting_image_permission);
[115] Fix | Delete
update_option('xyz_twap_tw_char_limit', $xyz_twap_tw_char_limit);
[116] Fix | Delete
[117] Fix | Delete
}
[118] Fix | Delete
}
[119] Fix | Delete
[120] Fix | Delete
[121] Fix | Delete
[122] Fix | Delete
if(isset($_POST['twit']) && $terf==0)
[123] Fix | Delete
{
[124] Fix | Delete
?>
[125] Fix | Delete
[126] Fix | Delete
<div class="system_notice_area_style1" id="system_notice_area">
[127] Fix | Delete
<?php _e('Settings updated successfully','twitter-auto-publish');?>. &nbsp;&nbsp;&nbsp;<span
[128] Fix | Delete
id="system_notice_area_dismiss"><?php _e('Dismiss','twitter-auto-publish');?></span>
[129] Fix | Delete
</div>
[130] Fix | Delete
<?php }
[131] Fix | Delete
if(isset($_POST['twit']) && $terf==1)
[132] Fix | Delete
{
[133] Fix | Delete
?>
[134] Fix | Delete
<div class="system_notice_area_style0" id="system_notice_area">
[135] Fix | Delete
<?php
[136] Fix | Delete
if(isset($_POST['twit']))
[137] Fix | Delete
{
[138] Fix | Delete
echo esc_html($tms1);echo esc_html($tms2);echo esc_html($tms3);echo esc_html($tms4);echo esc_html($tms5);echo esc_html($tms6);
[139] Fix | Delete
}
[140] Fix | Delete
?>
[141] Fix | Delete
&nbsp;&nbsp;&nbsp;<span id="system_notice_area_dismiss"><?php _e('Dismiss','twitter-auto-publish');?></span>
[142] Fix | Delete
</div>
[143] Fix | Delete
<?php }
[144] Fix | Delete
if(isset($_GET['msg']) && $_GET['msg']==1)
[145] Fix | Delete
{
[146] Fix | Delete
?>
[147] Fix | Delete
<div class="system_notice_area_style1" id="system_notice_area">
[148] Fix | Delete
<?php $twap_xyzscripts_name="xyzscripts";
[149] Fix | Delete
$twap_xyz_success_msg=sprintf(__('Successfully connected to %s member area','twitter-auto-publish'),$twap_xyzscripts_name);
[150] Fix | Delete
echo $twap_xyz_success_msg; ?>. &nbsp;&nbsp;&nbsp;<span
[151] Fix | Delete
id="system_notice_area_dismiss"><?php _e('Dismiss','twitter-auto-publish');?></span>
[152] Fix | Delete
</div>
[153] Fix | Delete
<?php
[154] Fix | Delete
}
[155] Fix | Delete
if(isset($_GET['msg']) && $_GET['msg']==2){
[156] Fix | Delete
?>
[157] Fix | Delete
<div class="system_notice_area_style1" id="system_notice_area">
[158] Fix | Delete
<?php _e('Account has been authenticated successfully','twitter-auto-publish');?>.&nbsp;&nbsp;&nbsp;<span
[159] Fix | Delete
id="system_notice_area_dismiss"><?php _e('Dismiss','twitter-auto-publish');?></span>
[160] Fix | Delete
</div>
[161] Fix | Delete
<?php
[162] Fix | Delete
}
[163] Fix | Delete
?>
[164] Fix | Delete
<script type="text/javascript">
[165] Fix | Delete
function detdisplay_twap(id)
[166] Fix | Delete
{
[167] Fix | Delete
document.getElementById(id).style.display='';
[168] Fix | Delete
}
[169] Fix | Delete
function dethide_twap(id)
[170] Fix | Delete
{
[171] Fix | Delete
document.getElementById(id).style.display='none';
[172] Fix | Delete
}
[173] Fix | Delete
[174] Fix | Delete
[175] Fix | Delete
</script>
[176] Fix | Delete
[177] Fix | Delete
<div style="width: 100%">
[178] Fix | Delete
[179] Fix | Delete
<div class="xyz_twap_tab">
[180] Fix | Delete
<button class="xyz_twap_tablinks" onclick="xyz_twap_open_tab(event, 'xyz_twap_twitter_settings')" id="xyz_twap_default_tab_settings"><?php _e('Twitter Settings','twitter-auto-publish');?></button>
[181] Fix | Delete
<button class="xyz_twap_tablinks" onclick="xyz_twap_open_tab(event, 'xyz_twap_basic_settings')" id="xyz_twap_basic_tab_settings"><?php _e('General Settings','twitter-auto-publish');?></button>
[182] Fix | Delete
</div>
[183] Fix | Delete
<div id="xyz_twap_twitter_settings" class="xyz_twap_tabcontent">
[184] Fix | Delete
<table class="widefat" style="width: 99%;background-color: #FFFBCC" id='xyz_twap_app_creation_note'>
[185] Fix | Delete
<tr>
[186] Fix | Delete
<td id="bottomBorderNone" style="border: 1px solid #FCC328;">
[187] Fix | Delete
<div>
[188] Fix | Delete
<b><?php _e('Note:','twitter-auto-publish');?></b> <?php _e('You have to create a Twitter application before filling in following fields.','twitter-auto-publish');?>
[189] Fix | Delete
<br><b><a href="https://developer.twitter.com/en/apps/create" target="_blank"><?php _e('Click here </a></b> to create new application. Specify the website for the application as','twitter-auto-publish');?> <span style="color: red;"><?php echo (is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST']; ?> </span>
[190] Fix | Delete
<br><?php $twap_path1="Settings > Application Type > Access";$twap_navigate=sprintf(__('In the twitter application, navigate to <b>%s</b>.','twitter-auto-publish'),$twap_path1);echo $twap_navigate; $twap_read_write="Read and Write"; $twap_select=sprintf(__('Select <b>%s</b> option.','twitter-auto-publish'),$twap_read_write); echo $twap_select; ?>
[191] Fix | Delete
<br><?php $twap_token_path="Details > Your access token"; $twap_token_create="Create my access token"; $twap_acess_token_create=sprintf(__('After updating access, navigate to <b>%s</b> in the application and click <b>%s</b> button.','twitter-auto-publish'),$twap_token_path,$twap_token_create); echo $twap_acess_token_create; ?>
[192] Fix | Delete
<br><?php $twap_create_twapp="http://help.xyzscripts.com/docs/social-media-auto-publish/faq/how-can-i-create-twitter-application/"; $twap_inst_link=sprintf(__('For detailed step by step instructions <b><a href="%s" target="_blank"> Click here','twitter-auto-publish'),$twap_create_twapp); echo $twap_inst_link; ?></a></b>
[193] Fix | Delete
[194] Fix | Delete
</div>
[195] Fix | Delete
</td>
[196] Fix | Delete
</tr>
[197] Fix | Delete
</table>
[198] Fix | Delete
[199] Fix | Delete
[200] Fix | Delete
<form method="post">
[201] Fix | Delete
<?php wp_nonce_field( 'xyz_twap_tw_settings_form_nonce' );?>
[202] Fix | Delete
<input type="hidden" value="config">
[203] Fix | Delete
[204] Fix | Delete
<div style="font-weight: bold;padding: 3px;"><?php _e('All fields given below are mandatory','twitter-auto-publish');?></div>
[205] Fix | Delete
<?php
[206] Fix | Delete
$xyz_twap_app_sel_mode=0;
[207] Fix | Delete
$xyz_twap_app_sel_mode=get_option('xyz_twap_tw_app_sel_mode');
[208] Fix | Delete
if ($xyz_twap_app_sel_mode==1){
[209] Fix | Delete
$domain_name=trim(get_option('siteurl'));
[210] Fix | Delete
$xyz_twap_smapsoln_userid=intval(trim(get_option('xyz_twap_smapsoln_userid')));
[211] Fix | Delete
$xyzscripts_hash_val=trim(get_option('xyz_twap_xyzscripts_hash_val'));
[212] Fix | Delete
$xyzscripts_user_id=trim(get_option('xyz_twap_xyzscripts_user_id'));
[213] Fix | Delete
$xyz_twap_accountId=0;
[214] Fix | Delete
$xyz_twap_licence_key='';
[215] Fix | Delete
$request_hash=md5($xyzscripts_user_id.$xyzscripts_hash_val);
[216] Fix | Delete
$auth_secret_key=md5('smapsolutions'.$domain_name.$xyz_twap_accountId.$xyz_twap_smapsoln_userid.$xyzscripts_user_id.$request_hash.$xyz_twap_licence_key.'twap');
[217] Fix | Delete
if($xyz_twap_app_sel_mode==1 && empty($xyz_twap_smapsoln_userid) )
[218] Fix | Delete
{
[219] Fix | Delete
?>
[220] Fix | Delete
<div class="xyz_twap_twitter_auth">
[221] Fix | Delete
<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>
[222] Fix | Delete
<span id="auth_message">
[223] Fix | Delete
<span style="color: red;" ><?php _e('Application needs authorisation','twitter-auto-publish');?></span> <br>
[224] Fix | Delete
<input type="hidden" value="<?php echo (is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST']; ?>" id="parent_domain">
[225] Fix | Delete
<input type="submit" class="submit_twap_new" name="tw_auth"
[226] Fix | Delete
value = <?php _e('Authorize','twitter-auto-publish'); ?> onclick="javascript:return twap_popup_tw_auth('<?php echo urlencode($domain_name);?>','<?php echo $xyz_twap_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>
[227] Fix | Delete
</span></div>
[228] Fix | Delete
<?php }
[229] Fix | Delete
else if($xyz_twap_app_sel_mode==1 && !empty($xyz_twap_smapsoln_userid) )
[230] Fix | Delete
{
[231] Fix | Delete
?>
[232] Fix | Delete
<div class="xyz_twap_twitter_auth"><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>
[233] Fix | Delete
<input type="hidden" value="<?php echo (is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST']; ?>" id="parent_domain">
[234] Fix | Delete
<input type="submit" class="submit_twap_new" name="tw_auth"
[235] Fix | Delete
value = <?php _e('Reauthorize','twitter-auto-publish'); ?> title="Reauthorize the account" onclick="javascript:return twap_popup_tw_auth('<?php echo urlencode($domain_name);?>','<?php echo $xyz_twap_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>
[236] Fix | Delete
</div>
[237] Fix | Delete
<?php }
[238] Fix | Delete
}?>
[239] Fix | Delete
<table class="widefat xyz_twap_widefat_table" style="width: 99%">
[240] Fix | Delete
<tr valign="top">
[241] Fix | Delete
<td><?php _e('Enable auto publish posts to my twitter account','twitter-auto-publish');?>
[242] Fix | Delete
</td>
[243] Fix | Delete
<td class="switch-field">
[244] Fix | Delete
<label id="xyz_twap_twpost_permission_yes"><input type="radio" name="xyz_twap_twpost_permission" value="1" <?php if(get_option('xyz_twap_twpost_permission')==1) echo 'checked';?>/> <?php _e('Yes','twitter-auto-publish'); ?> </label>
[245] Fix | Delete
<label id="xyz_twap_twpost_permission_no"><input type="radio" name="xyz_twap_twpost_permission" value="0" <?php if(get_option('xyz_twap_twpost_permission')==0) echo 'checked';?>/> <?php _e('No','twitter-auto-publish'); ?> </label>
[246] Fix | Delete
</td>
[247] Fix | Delete
</tr>
[248] Fix | Delete
<tr valign="top">
[249] Fix | Delete
<td width="50%"><?php _e('Application Selection','twitter-auto-publish');?>
[250] Fix | Delete
</td>
[251] Fix | Delete
<td>
[252] Fix | Delete
<input type="radio" name="xyz_twap_app_sel_mode" id="xyz_twap_app_sel_mode_reviewd" value="0" <?php if($xyz_twap_app_sel_mode==0) echo 'checked';?>>
[253] Fix | Delete
<span style="color: #a7a7a7;font-weight: bold;"> <?php _e('Own App','twitter-auto-publish'); ?> (<a href="http://help.xyzscripts.com/docs/social-media-auto-publish/faq/how-can-i-create-twitter-application/" style="color: #a7a7a7;text-decoration: underline; " target="_blank" > <?php _e('Help','twitter-auto-publish'); ?> </a>)</span>
[254] Fix | Delete
<?php if(get_option('xyz_twap_smapsoln_userid')>0) {?>
[255] Fix | Delete
<br>
[256] Fix | Delete
<input type="radio" name="xyz_twap_app_sel_mode" id="xyz_twap_app_sel_mode_xyzapp" value="1" <?php if($xyz_twap_app_sel_mode==1) echo 'checked';?>>
[257] Fix | Delete
<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 $twap_smap_site="SMAPsolution.com's"; $twap_ready_pub=sprintf(__('%s App (ready to publish)','twitter-auto-publish'),$twap_smap_site); echo $twap_ready_pub; ?> <i class="fa fa-star-o" aria-hidden="true" style="margin-right:5px;"></i></span><br> <span style="padding-left: 30px;"> <?php _e('Starts from 10 USD per year','twitter-auto-publish'); ?></span><br/>
[258] Fix | Delete
<span style="color: #6a364a;font-size: 13px;padding-left: 30px;">SMAPSolutions will no-longer support media uploads,please use {PERMALINK}<br/></span>
[259] Fix | Delete
<span style="color: #6a364a;font-size: 13px;padding-left: 30px;"> in message format to display preview of post</span><br>
[260] Fix | Delete
<?php if(get_option('xyz_twap_smapsoln_userid')==0)
[261] Fix | Delete
{?>
[262] Fix | Delete
<span style="color: #ff5e00;padding-left: 27px;font-size: small;"><b><?php _e('30 DAYS FREE TRIAL AVAILABLE','twitter-auto-publish');?>*</b></span>
[263] Fix | Delete
<br/>
[264] Fix | Delete
<?php }?>
[265] Fix | Delete
<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-twitter/" style="padding-left: 30px;"> <?php $twap_how_smap=sprintf(__('How to use %s application?','twitter-auto-publish'),$twap_smap_site); echo $twap_how_smap; ?></a>
[266] Fix | Delete
<?php }?>
[267] Fix | Delete
</td>
[268] Fix | Delete
</tr>
[269] Fix | Delete
<?php
[270] Fix | Delete
if( ($xyzscripts_user_id =='' || $xyzscripts_hash_val=='') && $xyz_twap_app_sel_mode==1)
[271] Fix | Delete
{ ?>
[272] Fix | Delete
<tr valign="top" id="xyz_twap_conn_to_xyzscripts">
[273] Fix | Delete
<td width="50%"> </td>
[274] Fix | Delete
<td width="50%">
[275] Fix | Delete
<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>
[276] Fix | Delete
<span id="connect_to_xyzscripts"style="background-color: #1A87B9;color: white; padding: 4px 5px;
[277] Fix | Delete
text-align: center; text-decoration: none; display: inline-block;border-radius: 4px;">
[278] Fix | Delete
<a href="javascript:twap_popup_connect_to_xyzscripts();void(0);" style="color:white !important;"><?php $twap_var_xyz="xyzscripts"; $twap_connect_xyz=sprintf(__('Connect your %s account','twitter-auto-publish'),$twap_var_xyz); echo $twap_connect_xyz; ?></a>
[279] Fix | Delete
</span>
[280] Fix | Delete
</td>
[281] Fix | Delete
</tr>
[282] Fix | Delete
<?php }?>
[283] Fix | Delete
<tr valign="top" class="xyz_twap_twitter_settings">
[284] Fix | Delete
<td width="50%"><?php _e('API key','twitter-auto-publish'); ?>
[285] Fix | Delete
</td>
[286] Fix | Delete
<td><input id="xyz_twap_twconsumer_id"
[287] Fix | Delete
name="xyz_twap_twconsumer_id" type="text"
[288] Fix | Delete
value="<?php if($tms1=="") {echo esc_html(get_option('xyz_twap_twconsumer_id'));}?>" />
[289] Fix | Delete
[290] Fix | Delete
</td>
[291] Fix | Delete
</tr>
[292] Fix | Delete
[293] Fix | Delete
<tr valign="top" class="xyz_twap_twitter_settings">
[294] Fix | Delete
<td> <?php _e('API secret','twitter-auto-publish'); ?>
[295] Fix | Delete
</td>
[296] Fix | Delete
<td><input id="xyz_twap_twconsumer_secret"
[297] Fix | Delete
name="xyz_twap_twconsumer_secret" type="text"
[298] Fix | Delete
value="<?php if($tms2=="") { echo esc_html(get_option('xyz_twap_twconsumer_secret')); }?>" />
[299] Fix | Delete
</td>
[300] Fix | Delete
</tr>
[301] Fix | Delete
<tr valign="top" class="xyz_twap_twitter_settings">
[302] Fix | Delete
<td><?php _e('Twitter username','twitter-auto-publish');?>
[303] Fix | Delete
</td>
[304] Fix | Delete
<td><input id="xyz_twap_tw_id" class="al2tw_text"
[305] Fix | Delete
name="xyz_twap_tw_id" type="text"
[306] Fix | Delete
value="<?php if($tms3=="") {echo esc_html(get_option('xyz_twap_tw_id'));}?>" />
[307] Fix | Delete
</td>
[308] Fix | Delete
</tr>
[309] Fix | Delete
<tr valign="top" class="xyz_twap_twitter_settings">
[310] Fix | Delete
<td> <?php _e('Access token','twitter-auto-publish'); ?>
[311] Fix | Delete
</td>
[312] Fix | Delete
<td><input id="xyz_twap_current_twappln_token" class="al2tw_text"
[313] Fix | Delete
name="xyz_twap_current_twappln_token" type="text"
[314] Fix | Delete
value="<?php if($tms4=="") {echo esc_html(get_option('xyz_twap_current_twappln_token'));}?>" />
[315] Fix | Delete
</td>
[316] Fix | Delete
</tr>
[317] Fix | Delete
<tr valign="top" class="xyz_twap_twitter_settings">
[318] Fix | Delete
<td> <?php _e('Access token secret','twitter-auto-publish'); ?>
[319] Fix | Delete
</td>
[320] Fix | Delete
<td><input id="xyz_twap_twaccestok_secret" class="al2tw_text"
[321] Fix | Delete
name="xyz_twap_twaccestok_secret" type="text"
[322] Fix | Delete
value="<?php if($tms5=="") {echo esc_html(get_option('xyz_twap_twaccestok_secret'));}?>" />
[323] Fix | Delete
</td>
[324] Fix | Delete
</tr>
[325] Fix | Delete
<tr valign="top">
[326] Fix | Delete
<td><?php _e('Message format for posting','twitter-auto-publish');?> <img src="<?php echo $heimg?>"
[327] Fix | Delete
onmouseover="detdisplay_twap('xyz_tw')" onmouseout="dethide_twap('xyz_tw')" style="width:13px;height:auto;">
[328] Fix | Delete
<div id="xyz_tw" class="twap_informationdiv"
[329] Fix | Delete
style="display: none; font-weight: normal;">
[330] Fix | Delete
{POST_TITLE} - <?php _e('Insert the title of your post.','twitter-auto-publish'); ?><br/>
[331] Fix | Delete
{PERMALINK} - <?php _e('Insert the URL where your post is displayed.','twitter-auto-publish'); ?><br/>
[332] Fix | Delete
{POST_EXCERPT} - <?php _e('Insert the excerpt of your post.','twitter-auto-publish'); ?><br/>
[333] Fix | Delete
{POST_CONTENT} - <?php _e('Insert the description of your post.','twitter-auto-publish'); ?><br/>
[334] Fix | Delete
{BLOG_TITLE} - <?php _e('Insert the name of your blog.','twitter-auto-publish'); ?><br/>
[335] Fix | Delete
{USER_NICENAME} - <?php _e('Insert the nicename of the author.','twitter-auto-publish'); ?><br/>
[336] Fix | Delete
{POST_ID} - <?php _e('Insert the ID of your post.','twitter-auto-publish'); ?><br/>
[337] Fix | Delete
{POST_PUBLISH_DATE} - <?php _e('Insert the publish date of your post.','twitter-auto-publish'); ?><br/>
[338] Fix | Delete
{USER_DISPLAY_NAME} - <?php _e('Insert the display name of the author.','twitter-auto-publish'); ?>
[339] Fix | Delete
</div></td>
[340] Fix | Delete
<td>
[341] Fix | Delete
<select name="xyz_twap_info" id="xyz_twap_info" onchange="xyz_twap_info_insert(this)">
[342] Fix | Delete
<option value ="0" selected="selected"> --<?php _e('Select','twitter-auto-publish'); ?>-- </option>
[343] Fix | Delete
<option value ="1">{POST_TITLE} </option>
[344] Fix | Delete
<option value ="2">{PERMALINK} </option>
[345] Fix | Delete
<option value ="3">{POST_EXCERPT} </option>
[346] Fix | Delete
<option value ="4">{POST_CONTENT} </option>
[347] Fix | Delete
<option value ="5">{BLOG_TITLE} </option>
[348] Fix | Delete
<option value ="6">{USER_NICENAME} </option>
[349] Fix | Delete
<option value ="7">{POST_ID} </option>
[350] Fix | Delete
<option value ="8">{POST_PUBLISH_DATE} </option>
[351] Fix | Delete
<option value ="9">{USER_DISPLAY_NAME} </option>
[352] Fix | Delete
</select> </td></tr><tr><td>&nbsp;</td><td>
[353] Fix | Delete
<textarea id="xyz_twap_twmessage" name="xyz_twap_twmessage" style="height:80px !important;" ><?php if($tms6=="") {
[354] Fix | Delete
echo esc_textarea(get_option('xyz_twap_twmessage'));}?></textarea>
[355] Fix | Delete
</td></tr>
[356] Fix | Delete
[357] Fix | Delete
[358] Fix | Delete
<tr valign="top">
[359] Fix | Delete
<td><?php _e('Attach image to twitter post','twitter-auto-publish');?>
[360] Fix | Delete
</td>
[361] Fix | Delete
<td class="switch-field">
[362] Fix | Delete
<label id="xyz_twap_twpost_image_permission_yes"><input type="radio" name="xyz_twap_twpost_image_permission" value="1" <?php if(get_option('xyz_twap_twpost_image_permission')==1) echo 'checked';?>/> <?php _e('Yes','twitter-auto-publish'); ?> </label>
[363] Fix | Delete
<label id="xyz_twap_twpost_image_permission_no"><input type="radio" name="xyz_twap_twpost_image_permission" value="0" <?php if(get_option('xyz_twap_twpost_image_permission')==0) echo 'checked';?>/> <?php _e('No','twitter-auto-publish'); ?> </label>
[364] Fix | Delete
</td>
[365] Fix | Delete
</tr>
[366] Fix | Delete
[367] Fix | Delete
<tr valign="top">
[368] Fix | Delete
<td><?php _e('Twitter character limit','twitter-auto-publish');?> <img src="<?php echo $heimg?>"
[369] Fix | Delete
onmouseover="detdisplay_twap('xyz_twap_tw_char_limit')" onmouseout="dethide_twap('xyz_twap_tw_char_limit')" style="width:13px;height:auto;">
[370] Fix | Delete
<div id="xyz_twap_tw_char_limit" class="twap_informationdiv" style="display: none;">
[371] Fix | Delete
<?php _e('The character limit of tweets is 280.','twitter-auto-publish'); ?><br/>
[372] Fix | Delete
<?php _e('Use 140 for languages like Chinese, Japanese and Korean <br/> which won'."'".'t get the 280 character limit.','twitter-auto-publish'); ?><br />
[373] Fix | Delete
</div></td>
[374] Fix | Delete
<td>
[375] Fix | Delete
<input id="xyz_twap_tw_char_limit" name="xyz_twap_tw_char_limit" type="text" value="<?php echo esc_html(get_option('xyz_twap_tw_char_limit'));?>" style="width: 155px">
[376] Fix | Delete
</td></tr>
[377] Fix | Delete
[378] Fix | Delete
<tr>
[379] Fix | Delete
<td id="bottomBorderNone"></td>
[380] Fix | Delete
<td id="bottomBorderNone"><div style="height: 50px;">
[381] Fix | Delete
<input type="submit" class="submit_twap_new"
[382] Fix | Delete
style=" margin-top: 10px; "
[383] Fix | Delete
name="twit" value=<?php _e('Save','twitter-auto-publish');?> /></div>
[384] Fix | Delete
</td>
[385] Fix | Delete
</tr>
[386] Fix | Delete
</table>
[387] Fix | Delete
[388] Fix | Delete
</form>
[389] Fix | Delete
</div>
[390] Fix | Delete
<?php
[391] Fix | Delete
[392] Fix | Delete
if(isset($_POST['bsettngs']))
[393] Fix | Delete
{
[394] Fix | Delete
if (! isset( $_REQUEST['_wpnonce'] )|| ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'xyz_smap_tw_basic_settings_form_nonce' ))
[395] Fix | Delete
{
[396] Fix | Delete
wp_nonce_ays( 'xyz_smap_tw_basic_settings_form_nonce' );
[397] Fix | Delete
exit();
[398] Fix | Delete
}
[399] Fix | Delete
[400] Fix | Delete
$xyz_twap_include_pages=intval($_POST['xyz_twap_include_pages']);
[401] Fix | Delete
$xyz_twap_include_posts=intval($_POST['xyz_twap_include_posts']);
[402] Fix | Delete
$xyz_smap_free_enforce_twitter_cards=intval($_POST['xyz_smap_free_enforce_twitter_cards']);
[403] Fix | Delete
$twap_category_ids='';
[404] Fix | Delete
if($_POST['xyz_twap_cat_all']=="All")
[405] Fix | Delete
$twap_category_ids=$_POST['xyz_twap_cat_all'];//redio btn name
[406] Fix | Delete
else
[407] Fix | Delete
{
[408] Fix | Delete
if(!empty($_POST['xyz_twap_catlist']))
[409] Fix | Delete
{
[410] Fix | Delete
$twap_category_ids=$_POST['xyz_twap_catlist'];//dropdown
[411] Fix | Delete
$twap_category_ids=implode(',', $twap_category_ids);
[412] Fix | Delete
}
[413] Fix | Delete
}
[414] Fix | Delete
$xyz_customtypes="";
[415] Fix | Delete
[416] Fix | Delete
if(isset($_POST['post_types']))
[417] Fix | Delete
$xyz_customtypes=$_POST['post_types'];
[418] Fix | Delete
[419] Fix | Delete
$xyz_twap_peer_verification=intval($_POST['xyz_twap_peer_verification']);
[420] Fix | Delete
$xyz_twap_premium_version_ads=intval($_POST['xyz_twap_premium_version_ads']);
[421] Fix | Delete
$xyz_twap_default_selection_edit=intval($_POST['xyz_twap_default_selection_edit']);
[422] Fix | Delete
$xyz_twap_default_selection_create=intval($_POST['xyz_twap_default_selection_create']);
[423] Fix | Delete
[424] Fix | Delete
//$xyz_twap_future_to_publish=$_POST['xyz_twap_future_to_publish'];
[425] Fix | Delete
$twap_customtype_ids="";
[426] Fix | Delete
[427] Fix | Delete
$xyz_twap_applyfilters="";
[428] Fix | Delete
if(isset($_POST['xyz_twap_applyfilters']))
[429] Fix | Delete
$xyz_twap_applyfilters=$_POST['xyz_twap_applyfilters'];
[430] Fix | Delete
[431] Fix | Delete
[432] Fix | Delete
[433] Fix | Delete
if($xyz_customtypes!="")
[434] Fix | Delete
{
[435] Fix | Delete
for($i=0;$i<count($xyz_customtypes);$i++)
[436] Fix | Delete
{
[437] Fix | Delete
$twap_customtype_ids.=$xyz_customtypes[$i].",";
[438] Fix | Delete
}
[439] Fix | Delete
[440] Fix | Delete
}
[441] Fix | Delete
$twap_customtype_ids=rtrim($twap_customtype_ids,',');
[442] Fix | Delete
[443] Fix | Delete
$xyz_twap_applyfilters_val="";
[444] Fix | Delete
if($xyz_twap_applyfilters!="")
[445] Fix | Delete
{
[446] Fix | Delete
for($i=0;$i<count($xyz_twap_applyfilters);$i++)
[447] Fix | Delete
{
[448] Fix | Delete
$xyz_twap_applyfilters_val.=$xyz_twap_applyfilters[$i].",";
[449] Fix | Delete
}
[450] Fix | Delete
}
[451] Fix | Delete
$xyz_twap_applyfilters_val=rtrim($xyz_twap_applyfilters_val,',');
[452] Fix | Delete
[453] Fix | Delete
update_option('xyz_twap_apply_filters',$xyz_twap_applyfilters_val);
[454] Fix | Delete
update_option('xyz_twap_include_pages',$xyz_twap_include_pages);
[455] Fix | Delete
update_option('xyz_twap_include_posts',$xyz_twap_include_posts);
[456] Fix | Delete
if($xyz_twap_include_posts==0)
[457] Fix | Delete
update_option('xyz_twap_include_categories',"All");
[458] Fix | Delete
else
[459] Fix | Delete
update_option('xyz_twap_include_categories',$twap_category_ids);
[460] Fix | Delete
update_option('xyz_twap_include_customposttypes',$twap_customtype_ids);
[461] Fix | Delete
update_option('xyz_twap_peer_verification',$xyz_twap_peer_verification);
[462] Fix | Delete
update_option('xyz_twap_premium_version_ads',$xyz_twap_premium_version_ads);
[463] Fix | Delete
update_option('xyz_twap_default_selection_edit',$xyz_twap_default_selection_edit);
[464] Fix | Delete
update_option('xyz_twap_default_selection_create',$xyz_twap_default_selection_create);
[465] Fix | Delete
update_option('xyz_smap_free_enforce_twitter_cards',$xyz_smap_free_enforce_twitter_cards);
[466] Fix | Delete
//update_option('xyz_twap_future_to_publish',$xyz_twap_future_to_publish);
[467] Fix | Delete
}
[468] Fix | Delete
//$xyz_twap_future_to_publish=get_option('xyz_twap_future_to_publish');
[469] Fix | Delete
$xyz_credit_link=get_option('xyz_credit_link');
[470] Fix | Delete
$xyz_twap_include_pages=get_option('xyz_twap_include_pages');
[471] Fix | Delete
$xyz_twap_include_posts=get_option('xyz_twap_include_posts');
[472] Fix | Delete
$xyz_twap_include_categories=get_option('xyz_twap_include_categories');
[473] Fix | Delete
/*if ($xyz_twap_include_categories!='All')
[474] Fix | Delete
$xyz_twap_include_categories=explode(',', $xyz_twap_include_categories);*/
[475] Fix | Delete
$xyz_twap_include_customposttypes=get_option('xyz_twap_include_customposttypes');
[476] Fix | Delete
$xyz_twap_apply_filters=get_option('xyz_twap_apply_filters');
[477] Fix | Delete
$xyz_twap_peer_verification=esc_html(get_option('xyz_twap_peer_verification'));
[478] Fix | Delete
$xyz_twap_premium_version_ads=esc_html(get_option('xyz_twap_premium_version_ads'));
[479] Fix | Delete
$xyz_twap_default_selection_edit=esc_html(get_option('xyz_twap_default_selection_edit'));
[480] Fix | Delete
$xyz_twap_default_selection_create=esc_html(get_option('xyz_twap_default_selection_create'));
[481] Fix | Delete
$xyz_smap_free_enforce_twitter_cards=get_option('xyz_smap_free_enforce_twitter_cards');
[482] Fix | Delete
?>
[483] Fix | Delete
[484] Fix | Delete
<div id="xyz_twap_basic_settings" class="xyz_twap_tabcontent">
[485] Fix | Delete
<form method="post">
[486] Fix | Delete
<?php wp_nonce_field( 'xyz_smap_tw_basic_settings_form_nonce' );?>
[487] Fix | Delete
<table class="widefat xyz_twap_widefat_table" style="width: 99%">
[488] Fix | Delete
<tr><td><h2> <?php _e('Basic Settings','twitter-auto-publish'); ?></h2></td></tr>
[489] Fix | Delete
<tr valign="top">
[490] Fix | Delete
[491] Fix | Delete
<td colspan="1" width="50%"> <?php _e('Publish wordpress `pages` to twitter','twitter-auto-publish'); ?>
[492] Fix | Delete
</td>
[493] Fix | Delete
<td class="switch-field">
[494] Fix | Delete
<label id="xyz_twap_include_pages_yes"><input type="radio" name="xyz_twap_include_pages" value="1" <?php if($xyz_twap_include_pages==1) echo 'checked';?>/> <?php _e('Yes','twitter-auto-publish'); ?> </label>
[495] Fix | Delete
<label id="xyz_twap_include_pages_no"><input type="radio" name="xyz_twap_include_pages" value="0" <?php if($xyz_twap_include_pages==0) echo 'checked';?>/> <?php _e('No','twitter-auto-publish'); ?> </label>
[496] Fix | Delete
</td>
[497] Fix | Delete
</tr>
[498] Fix | Delete
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function