| 1 |
<?php |
| 2 |
if( !defined('ABSPATH') ){ exit();} |
| 3 |
global $wpdb;$xyz_ips_message=''; |
| 4 |
if(isset($_GET['xyz_ips_msg'])) |
| 5 |
$xyz_ips_message = $_GET['xyz_ips_msg']; |
| 6 |
if($xyz_ips_message == 1){ |
| 7 |
?> |
| 8 |
<div class="xyz_ips_system_notice_area_style1" id="xyz_ips_system_notice_area"> |
| 9 |
Thank you for the suggestion. <span |
| 10 |
id="xyz_ips_system_notice_area_dismiss">Dismiss</span> |
| 11 |
</div> |
| 12 |
<?php |
| 13 |
} |
| 14 |
else if($xyz_ips_message == 2){ |
| 15 |
?> |
| 16 |
<div class="xyz_ips_system_notice_area_style0" id="xyz_ips_system_notice_area"> |
| 17 |
wp_mail not able to process the request. <span |
| 18 |
id="xyz_ips_system_notice_area_dismiss">Dismiss</span> |
| 19 |
</div> |
| 20 |
<?php |
| 21 |
} |
| 22 |
else if($xyz_ips_message == 3){ |
| 23 |
?> |
| 24 |
<div class="xyz_ips_system_notice_area_style0" id="xyz_ips_system_notice_area"> |
| 25 |
Please suggest a feature. <span |
| 26 |
id="xyz_ips_system_notice_area_dismiss">Dismiss</span> |
| 27 |
</div> |
| 28 |
<?php |
| 29 |
} |
| 30 |
if (isset($_POST) && isset($_POST['xyz_ips_send_mail'])) |
| 31 |
{ |
| 32 |
|
| 33 |
if (! isset( $_REQUEST['_wpnonce'] )|| ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'xyz_ips_suggest_feature_form_nonce' )) |
| 34 |
{ |
| 35 |
wp_nonce_ays( 'xyz_ips_suggest_feature_form_nonce' ); |
| 36 |
exit(); |
| 37 |
} |
| 38 |
if (isset($_POST['xyz_ips_suggested_feature']) && $_POST['xyz_ips_suggested_feature']!='') |
| 39 |
{ |
| 40 |
|
| 41 |
$xyz_ips_feature_content=$_POST['xyz_ips_suggested_feature']; |
| 42 |
$xyz_ips_sender_email = get_option('admin_email'); |
| 43 |
$entries0 = $wpdb->get_results( $wpdb->prepare( 'SELECT display_name FROM '.$wpdb->base_prefix.'users WHERE user_email=%s',array($xyz_ips_sender_email))); |
| 44 |
foreach( $entries0 as $entry ) { |
| 45 |
$xyz_ips_admin_username=$entry->display_name; |
| 46 |
} |
| 47 |
$xyz_ips_recv_email='support@xyzscripts.com'; |
| 48 |
$xyz_ips_mail_subject="INSERT PHP CODE SNIPPET - FEATURE SUGGESTION"; |
| 49 |
$xyz_ips_headers = array('From: '.$xyz_ips_admin_username.' <'. $xyz_ips_sender_email .'>' ,'Content-Type: text/html; charset=UTF-8'); |
| 50 |
$wp_mail_processed=wp_mail( $xyz_ips_recv_email, $xyz_ips_mail_subject, $xyz_ips_feature_content, $xyz_ips_headers ); |
| 51 |
if ($wp_mail_processed==true){ |
| 52 |
wp_safe_redirect(admin_url('admin.php?page=insert-php-code-snippet-suggest-features&xyz_ips_msg=1')); |
| 53 |
exit(); |
| 54 |
} |
| 55 |
else |
| 56 |
{ |
| 57 |
wp_safe_redirect(admin_url('admin.php?page=insert-php-code-snippet-suggest-features&xyz_ips_msg=2'));exit(); |
| 58 |
} |
| 59 |
} |
| 60 |
else { |
| 61 |
wp_safe_redirect(admin_url('admin.php?page=insert-php-code-snippet-suggest-features&xyz_ips_msg=3'));exit(); |
| 62 |
} |
| 63 |
}?> |
| 64 |
<form method="post" > |
| 65 |
<?php wp_nonce_field( 'xyz_ips_suggest_feature_form_nonce' );?> |
| 66 |
<h3>Contribute And Get Rewarded</h3> |
| 67 |
<span style="color: #1A87B9;font-size:13px;padding-left: 10px;" >* Suggest a feature for this plugin and stand a chance to get a free copy of premium version of this plugin.</span> |
| 68 |
<table class="widefat" style="width:98%;padding-top: 10px;"> |
| 69 |
<tr><td> |
| 70 |
<textarea name="xyz_ips_suggested_feature" id="xyz_ips_suggested_feature" style="width:750px;height:250px !important;"></textarea> |
| 71 |
</td></tr> |
| 72 |
<tr> |
| 73 |
<td><input name="xyz_ips_send_mail" class="button-primary" style="color:#FFFFFF;border-radius:4px;margin-bottom:10px;" type="submit" value="Send Mail To Us"> |
| 74 |
</td></tr> |
| 75 |
</table> |
| 76 |
</form> |