WP Easy Paypal Payment Accept - Version 4.9.8

Version Description

  • Fixed the stable tag version number.
  • Removed the use of HEREDOC or NOWDOC syntax.
Download this release

Release Info

Developer mra13
Plugin Icon 128x128 WP Easy Paypal Payment Accept
Version 4.9.8
Comparing to
See all releases

Code changes from version 4.9.1 to 4.9.8

WP_Accept_Paypal_Payment.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php
2
  /*
3
- Plugin Name: WP Easy Paypal Payment Accept
4
- Version: v4.9
5
- Plugin URI: https://www.tipsandtricks-hq.com/wordpress-easy-paypal-payment-or-donation-accept-plugin-120
6
- Author: Tips and Tricks HQ
7
- Author URI: https://www.tipsandtricks-hq.com/
8
- Description: Easy to use Wordpress plugin to accept paypal payment for a service or product or donation in one click. Can be used in the sidebar, posts and pages.
9
- License: GPL2
10
- */
11
 
12
  //Slug - wpapp
13
 
@@ -15,7 +15,7 @@ if (!defined('ABSPATH')){//Exit if accessed directly
15
  exit;
16
  }
17
 
18
- define('WP_PAYPAL_PAYMENT_ACCEPT_PLUGIN_VERSION', '4.9');
19
  define('WP_PAYPAL_PAYMENT_ACCEPT_PLUGIN_URL', plugins_url('', __FILE__));
20
 
21
  include_once('shortcode_view.php');
@@ -39,6 +39,7 @@ function wp_pp_plugin_install() {
39
  add_option('wp_pp_show_ref_box', '1');
40
  add_option('wp_pp_ref_title', 'Your Email Address');
41
  add_option('wp_pp_return_url', home_url());
 
42
  }
43
 
44
  register_activation_hook(__FILE__, 'wp_pp_plugin_install');
@@ -82,8 +83,9 @@ function Paypal_payment_accept() {
82
  $wp_pp_show_ref_box = get_option('wp_pp_show_ref_box');
83
  $wp_pp_ref_title = get_option('wp_pp_ref_title');
84
  $wp_pp_return_url = get_option('wp_pp_return_url');
 
85
 
86
- /* === Paypal form === */
87
  $output = '';
88
  $output .= '<div id="accept_paypal_payment_form">';
89
  $output .= '<form action="https://www.paypal.com/cgi-bin/webscr" method="post" class="wp_accept_pp_button_form_classic">';
@@ -91,7 +93,7 @@ function Paypal_payment_accept() {
91
  $output .= '<input type="hidden" name="business" value="'.esc_attr($paypal_email).'" />';
92
  $output .= '<input type="hidden" name="item_name" value="'.esc_attr($paypal_subject).'" />';
93
  $output .= '<input type="hidden" name="currency_code" value="'.esc_attr($payment_currency).'" />';
94
- $output .= '<span class="payment_subject"><strong>'.esc_attr($paypal_subject).'</strong></span><br /><br />';
95
  $output .= '<select id="amount" name="amount" class="">';
96
  $output .= '<option value="'.esc_attr($value1).'">'.esc_attr($itemName1).'</option>';
97
  if (!empty($value2)) {
@@ -114,53 +116,56 @@ function Paypal_payment_accept() {
114
 
115
  // Show other amount text box
116
  if ($wp_pp_show_other_amount == '1') {
117
- $output .= '<br /><br /><strong>Other Amount:</strong>';
118
- $output .= '<br /><br /><input type="number" min="1" step="any" name="other_amount" title="Other Amount" value="" style="max-width:60px;" />';
119
  }
120
 
121
  // Show the reference text box
122
  if ($wp_pp_show_ref_box == '1') {
123
- $output .= '<br /><br /><strong>'.esc_attr($wp_pp_ref_title).' :</strong>';
124
  $output .= '<input type="hidden" name="on0" value="'.apply_filters('wp_pp_button_reference_name','Reference').'" />';
125
- $output .= '<br /><input type="text" name="os0" maxlength="60" value="'.apply_filters('wp_pp_button_reference_value','').'" class="wp_pp_button_reference" />';
126
  }
127
 
128
- $output .= '<br /><br />
129
- <input type="hidden" name="no_shipping" value="0" />
130
- <input type="hidden" name="no_note" value="1" />
131
- <input type="hidden" name="bn" value="TipsandTricks_SP" />';
132
-
133
  if (!empty($wp_pp_return_url)) {
134
  $output .= '<input type="hidden" name="return" value="' . esc_url($wp_pp_return_url) . '" />';
135
  } else {
136
  $output .='<input type="hidden" name="return" value="' . home_url() . '" />';
137
  }
138
 
 
 
 
 
 
139
  $output .= '<input type="image" src="'.esc_url($payment_button).'" name="submit" alt="Make payments with payPal - it\'s fast, free and secure!" />';
 
 
140
  $output .= '</form>';
141
  $output .= '</div>';
142
- $output .= <<<EOT
143
  <script type="text/javascript">
144
  jQuery(document).ready(function($) {
145
- $('.wp_accept_pp_button_form_classic').submit(function(e){
146
  var form_obj = $(this);
147
- var other_amt = form_obj.find('input[name=other_amount]').val();
148
  if (!isNaN(other_amt) && other_amt.length > 0){
149
  options_val = other_amt;
150
  //insert the amount field in the form with the custom amount
151
- $('<input>').attr({
152
- type: 'hidden',
153
- id: 'amount',
154
- name: 'amount',
155
  value: options_val
156
  }).appendTo(form_obj);
157
- }
158
  return;
159
  });
160
  });
161
- </script>
162
- EOT;
163
- /* = end of paypal form = */
164
  return $output;
165
  }
166
 
@@ -198,7 +203,7 @@ function wp_paypal_payment_init() {
198
  $widget_options = array('classname' => 'widget_wp_paypal_payment', 'description' => __("Display WP Paypal Payment."));
199
  wp_register_sidebar_widget('wp_paypal_payment_widgets', __('WP Paypal Payment'), 'show_wp_paypal_payment_widget', $widget_options);
200
  wp_register_widget_control('wp_paypal_payment_widgets', __('WP Paypal Payment'), 'wp_paypal_payment_widget_control');
201
-
202
  //Listen for IPN and validate it
203
  if (isset($_REQUEST['wpapp_paypal_ipn']) && $_REQUEST['wpapp_paypal_ipn'] == "process") {
204
  wpapp_validate_paypl_ipn();
1
  <?php
2
  /*
3
+ Plugin Name: Easy Accept Payments for PayPal
4
+ Version: 4.9.8
5
+ Plugin URI: https://www.tipsandtricks-hq.com/wordpress-easy-paypal-payment-or-donation-accept-plugin-120
6
+ Author: Tips and Tricks HQ
7
+ Author URI: https://www.tipsandtricks-hq.com/
8
+ Description: Easy to use Wordpress plugin to accept paypal payment for a service or product or donation in one click. Can be used in the sidebar, posts and pages.
9
+ License: GPL2
10
+ */
11
 
12
  //Slug - wpapp
13
 
15
  exit;
16
  }
17
 
18
+ define('WP_PAYPAL_PAYMENT_ACCEPT_PLUGIN_VERSION', '4.9.8');
19
  define('WP_PAYPAL_PAYMENT_ACCEPT_PLUGIN_URL', plugins_url('', __FILE__));
20
 
21
  include_once('shortcode_view.php');
39
  add_option('wp_pp_show_ref_box', '1');
40
  add_option('wp_pp_ref_title', 'Your Email Address');
41
  add_option('wp_pp_return_url', home_url());
42
+ add_option('wp_pp_cancel_url', home_url());
43
  }
44
 
45
  register_activation_hook(__FILE__, 'wp_pp_plugin_install');
83
  $wp_pp_show_ref_box = get_option('wp_pp_show_ref_box');
84
  $wp_pp_ref_title = get_option('wp_pp_ref_title');
85
  $wp_pp_return_url = get_option('wp_pp_return_url');
86
+ $wp_pp_cancel_url = get_option('wp_pp_cancel_url');
87
 
88
+ /* === Start of the form === */
89
  $output = '';
90
  $output .= '<div id="accept_paypal_payment_form">';
91
  $output .= '<form action="https://www.paypal.com/cgi-bin/webscr" method="post" class="wp_accept_pp_button_form_classic">';
93
  $output .= '<input type="hidden" name="business" value="'.esc_attr($paypal_email).'" />';
94
  $output .= '<input type="hidden" name="item_name" value="'.esc_attr($paypal_subject).'" />';
95
  $output .= '<input type="hidden" name="currency_code" value="'.esc_attr($payment_currency).'" />';
96
+ $output .= '<div class="wpapp_payment_subject"><span class="payment_subject"><strong>'.esc_attr($paypal_subject).'</strong></span></div>';
97
  $output .= '<select id="amount" name="amount" class="">';
98
  $output .= '<option value="'.esc_attr($value1).'">'.esc_attr($itemName1).'</option>';
99
  if (!empty($value2)) {
116
 
117
  // Show other amount text box
118
  if ($wp_pp_show_other_amount == '1') {
119
+ $output .= '<div class="wpapp_other_amount_label"><strong>Other Amount:</strong></div>';
120
+ $output .= '<div class="wpapp_other_amount_input"><input type="number" min="1" step="any" name="other_amount" title="Other Amount" value="" class="wpapp_other_amt_input" style="max-width:80px;" /></div>';
121
  }
122
 
123
  // Show the reference text box
124
  if ($wp_pp_show_ref_box == '1') {
125
+ $output .= '<div class="wpapp_ref_title_label"><strong>'.esc_attr($wp_pp_ref_title).':</strong></div>';
126
  $output .= '<input type="hidden" name="on0" value="'.apply_filters('wp_pp_button_reference_name','Reference').'" />';
127
+ $output .= '<div class="wpapp_ref_value"><input type="text" name="os0" maxlength="60" value="'.apply_filters('wp_pp_button_reference_value','').'" class="wp_pp_button_reference" /></div>';
128
  }
129
 
130
+ $output .= '<input type="hidden" name="no_shipping" value="0" /><input type="hidden" name="no_note" value="1" /><input type="hidden" name="bn" value="TipsandTricks_SP" />';
131
+
 
 
 
132
  if (!empty($wp_pp_return_url)) {
133
  $output .= '<input type="hidden" name="return" value="' . esc_url($wp_pp_return_url) . '" />';
134
  } else {
135
  $output .='<input type="hidden" name="return" value="' . home_url() . '" />';
136
  }
137
 
138
+ if (!empty($wp_pp_cancel_url)) {
139
+ $output .= '<input type="hidden" name="cancel_return" value="' . esc_url($wp_pp_cancel_url) . '" />';
140
+ }
141
+
142
+ $output .= '<div class="wpapp_payment_button">';
143
  $output .= '<input type="image" src="'.esc_url($payment_button).'" name="submit" alt="Make payments with payPal - it\'s fast, free and secure!" />';
144
+ $output .= '</div>';
145
+
146
  $output .= '</form>';
147
  $output .= '</div>';
148
+ $output .= '
149
  <script type="text/javascript">
150
  jQuery(document).ready(function($) {
151
+ $(".wp_accept_pp_button_form_classic").submit(function(e){
152
  var form_obj = $(this);
153
+ var other_amt = form_obj.find("input[name=other_amount]").val();
154
  if (!isNaN(other_amt) && other_amt.length > 0){
155
  options_val = other_amt;
156
  //insert the amount field in the form with the custom amount
157
+ $("<input>").attr({
158
+ type: "hidden",
159
+ id: "amount",
160
+ name: "amount",
161
  value: options_val
162
  }).appendTo(form_obj);
163
+ }
164
  return;
165
  });
166
  });
167
+ </script>';
168
+ /* = end of form = */
 
169
  return $output;
170
  }
171
 
203
  $widget_options = array('classname' => 'widget_wp_paypal_payment', 'description' => __("Display WP Paypal Payment."));
204
  wp_register_sidebar_widget('wp_paypal_payment_widgets', __('WP Paypal Payment'), 'show_wp_paypal_payment_widget', $widget_options);
205
  wp_register_widget_control('wp_paypal_payment_widgets', __('WP Paypal Payment'), 'wp_paypal_payment_widget_control');
206
+
207
  //Listen for IPN and validate it
208
  if (isset($_REQUEST['wpapp_paypal_ipn']) && $_REQUEST['wpapp_paypal_ipn'] == "process") {
209
  wpapp_validate_paypl_ipn();
index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
readme.txt CHANGED
@@ -1,17 +1,17 @@
1
- === WP Easy Paypal Payment Accept ===
2
  Contributors: Tips and Tricks HQ, Ruhul Amin, mbrsolution
3
  Donate link: https://www.tipsandtricks-hq.com
4
  Tags: Paypal payment, Accept payment for services or product, PayPal donation, wordpress paypal, paypal for wordpress, paypal plugin for wordpress, paypal integration, paypal, buy now, payment, currency,
5
- Requires at least: 3.0
6
- Tested up to: 4.5
7
- Stable tag: 4.9.1
8
  License: GPLv2 or later
9
 
10
- Easy to use Wordpress plugin to accept paypal payment for a service or product or donation in one click
11
 
12
  == Description ==
13
 
14
- Easy to use Wordpress plugin to accept paypal payment for a service or product or donation in one click. Can be used in the sidebar, posts and pages of your site.
15
 
16
  For information, detailed documentation, video tutorial and updates, please visit the [WordPress PayPal Payment](https://www.tipsandtricks-hq.com/wordpress-easy-paypal-payment-or-donation-accept-plugin-120) Plugin Page
17
 
@@ -39,8 +39,15 @@ For information, detailed documentation, video tutorial and updates, please visi
39
  * Create text based or image based payment buttons.
40
  * Ability to return the user to a specific page after the payment.
41
 
 
 
 
42
  == Usage ==
43
 
 
 
 
 
44
  There are few ways you can use this plugin:
45
 
46
  1. Use the sortcode [wp_paypal_payment] to place the payment accept form.
@@ -62,6 +69,33 @@ There are few ways you can use this plugin:
62
  Visit the plugin site at https://www.tipsandtricks-hq.com/wordpress-easy-paypal-payment-or-donation-accept-plugin-120 for screenshots.
63
 
64
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  = 4.9.1 =
66
  - Added sanitization and escaping.
67
 
1
+ === Easy Accept Payments for PayPal ===
2
  Contributors: Tips and Tricks HQ, Ruhul Amin, mbrsolution
3
  Donate link: https://www.tipsandtricks-hq.com
4
  Tags: Paypal payment, Accept payment for services or product, PayPal donation, wordpress paypal, paypal for wordpress, paypal plugin for wordpress, paypal integration, paypal, buy now, payment, currency,
5
+ Requires at least: 5.5
6
+ Tested up to: 6.0
7
+ Stable tag: 4.9.8
8
  License: GPLv2 or later
9
 
10
+ Easy to use Wordpress plugin to accept PayPal payments for a service or product or donation in one click
11
 
12
  == Description ==
13
 
14
+ Easy to use WordPress plugin to accept PayPal payments for a service or product or donation in one click. Can be used in the sidebar, posts and pages of your site.
15
 
16
  For information, detailed documentation, video tutorial and updates, please visit the [WordPress PayPal Payment](https://www.tipsandtricks-hq.com/wordpress-easy-paypal-payment-or-donation-accept-plugin-120) Plugin Page
17
 
39
  * Create text based or image based payment buttons.
40
  * Ability to return the user to a specific page after the payment.
41
 
42
+ == Note ==
43
+ This is NOT an official plugin from PayPal. This plugin has been developed by an independent developer.
44
+
45
  == Usage ==
46
 
47
+ https://www.youtube.com/watch?v=Jvy5E1ea8VA
48
+
49
+ https://www.youtube.com/watch?v=XL7Q8eU9dOY
50
+
51
  There are few ways you can use this plugin:
52
 
53
  1. Use the sortcode [wp_paypal_payment] to place the payment accept form.
69
  Visit the plugin site at https://www.tipsandtricks-hq.com/wordpress-easy-paypal-payment-or-donation-accept-plugin-120 for screenshots.
70
 
71
  == Changelog ==
72
+
73
+ = 4.9.8 =
74
+ - Fixed the stable tag version number.
75
+ - Removed the use of HEREDOC or NOWDOC syntax.
76
+
77
+ = 4.9.7 =
78
+ - Updated the banner and icon graphics used in the plugin's page.
79
+ - Tested on WP6.0
80
+
81
+ = 4.9.6 =
82
+ - Added new shortcode parameters that can be used to specify placeholder value for the "reference" and "other amount" fields.
83
+
84
+ = 4.9.5 =
85
+ - Added a Cancel URL field in the settings. This can be used to specify a cancel URL for the [wp_paypal_payment_box] shortcode.
86
+
87
+ = 4.9.4 =
88
+ - Removed a warning from the settings menu of this plugin.
89
+ - Updated the settings menu header to use h2 tag.
90
+
91
+ = 4.9.3 =
92
+ - WordPress 4.7 compatibility.
93
+ - Fixed an issue with using quotation marks in Payment Subject.
94
+
95
+ = 4.9.2 =
96
+ - Added a CSS class to the other amount input field.
97
+ - Replaced the line-breaks in the default shortcode output to use CSS divs with a default margin of 10px. This should produce better output in any given WordPress theme.
98
+
99
  = 4.9.1 =
100
  - Added sanitization and escaping.
101
 
shortcode_view.php CHANGED
@@ -6,8 +6,10 @@ function wppp_render_paypal_button_with_other_amt($args) {
6
  'description' => '',
7
  'default_amount' => '',
8
  'other_amount_label' => 'Amount:',
 
9
  'currency' => 'USD',
10
  'reference' => '',
 
11
  'return' => site_url(),
12
  'cbt' => '',
13
  'country_code' => '',
@@ -43,16 +45,16 @@ function wppp_render_paypal_button_with_other_amt($args) {
43
  $window_target = 'target="_blank"';
44
  }
45
  $output .= '<div class="wp_paypal_button_widget_any_amt">';
46
- $output .= '<form name="_xclick" class="wp_accept_pp_button_form_any_amount" action="https://www.paypal.com/cgi-bin/webscr" method="post" ' . $window_target . '>';
47
 
48
- $output .= '<div class="wp_pp_button_amount_section">'.esc_attr($other_amount_label).' <input type="number" min="1" step="any" name="amount" value="' . esc_attr($default_amount) . '" style="max-width:60px;"> ' . esc_attr($currency) . '</div>';
49
 
50
  if (!empty($reference)) {
51
  $output .= '<div class="wp_pp_button_reference_section">';
52
  $output .= '<label for="wp_pp_button_reference">' . esc_attr($reference) . '</label>';
53
  $output .= '<br />';
54
  $output .= '<input type="hidden" name="on0" value="' . apply_filters('wp_pp_button_reference_name', 'Reference') . '" />';
55
- $output .= '<input type="text" name="os0" value="' . apply_filters('wp_pp_button_reference_value', '') . '" class="wp_pp_button_reference" />';
56
  $output .= '</div>';
57
  }
58
 
@@ -100,8 +102,10 @@ function wppp_render_paypal_button_form($args) {
100
  'return' => site_url(),
101
  'cbt' => '',
102
  'reference' => 'Your Email Address',
 
103
  'other_amount' => '',
104
  'other_amount_label' => 'Other Amount:',
 
105
  'country_code' => '',
106
  'payment_subject' => '',
107
  'button_image' => '',
@@ -139,17 +143,17 @@ function wppp_render_paypal_button_form($args) {
139
  }
140
  ?>
141
  <div class="wp_paypal_button_widget">
142
- <form name="_xclick" class="wp_accept_pp_button_form" action="https://www.paypal.com/cgi-bin/webscr" method="post" <?php echo $window_target; ?> >
143
  <div class="wp_pp_button_selection_section">
144
  <select class="wp_paypal_button_options">
145
- <?php echo $html_options; ?>
146
  </select>
147
  </div>
148
 
149
  <?php
150
  if (!empty($other_amount)) {
151
  echo '<div class="wp_pp_button_other_amt_section">';
152
- echo esc_attr($other_amount_label).' <input type="number" min="1" step="any" name="other_amount" value="" style="max-width:60px;"> ' . esc_attr($currency);
153
  echo '</div>';
154
  }
155
 
@@ -158,7 +162,7 @@ function wppp_render_paypal_button_form($args) {
158
  echo '<label for="wp_pp_button_reference">' . esc_attr($reference) . '</label>';
159
  echo '<br />';
160
  echo '<input type="hidden" name="on0" value="' . apply_filters('wp_pp_button_reference_name', 'Reference') . '" />';
161
- echo '<input type="text" name="os0" value="' . apply_filters('wp_pp_button_reference_value', '') . '" class="wp_pp_button_reference" />';
162
  echo '</div>';
163
  }
164
 
@@ -174,7 +178,7 @@ function wppp_render_paypal_button_form($args) {
174
  <input type="hidden" name="currency_code" value="<?php echo esc_attr($currency); ?>">
175
  <input type="hidden" name="item_name" value="">
176
  <input type="hidden" name="amount" value="">
177
- <input type="hidden" name="return" value="<?php echo esc_url($return); ?>" />
178
  <input type="hidden" name="rm" value="<?php echo esc_attr($rm); ?>" />
179
  <input type="hidden" name="email" value="" />
180
  <?php
@@ -198,13 +202,13 @@ function wppp_render_paypal_button_form($args) {
198
  echo '<div class="wp_pp_button_submit_btn">';
199
  if (!empty($button_text)) {//Use text button
200
  $button_class = apply_filters('wppp_text_button_class', '');
201
- echo '<input type="submit" name="submit" class="' . $button_class . '" value="' . esc_attr($button_text) . '" />';
202
  } else {//Use image button
203
  echo '<input type="image" id="buy_now_button" class="buy_now_button_image" src="' . esc_url($payment_button_img_src) . '" border="0" name="submit" alt="Make payments with PayPal">';
204
  }
205
  echo '</div>';
206
  ?>
207
- </form>
208
  </div>
209
 
210
  <script type="text/javascript">
6
  'description' => '',
7
  'default_amount' => '',
8
  'other_amount_label' => 'Amount:',
9
+ 'other_amount_placeholder' => '',
10
  'currency' => 'USD',
11
  'reference' => '',
12
+ 'reference_placeholder' => '',
13
  'return' => site_url(),
14
  'cbt' => '',
15
  'country_code' => '',
45
  $window_target = 'target="_blank"';
46
  }
47
  $output .= '<div class="wp_paypal_button_widget_any_amt">';
48
+ $output .= '<form name="_xclick" class="wp_accept_pp_button_form_any_amount" action="https://www.paypal.com/cgi-bin/webscr" method="post" ' . esc_attr($window_target) . '>';
49
 
50
+ $output .= '<div class="wp_pp_button_amount_section">'.esc_attr($other_amount_label).' <input type="number" min="1" step="any" name="amount" value="' . esc_attr($default_amount) . '" placeholder="'.$other_amount_placeholder.'" class="wpapp_other_amt_input" style="max-width:80px;"> ' . esc_attr($currency) . '</div>';
51
 
52
  if (!empty($reference)) {
53
  $output .= '<div class="wp_pp_button_reference_section">';
54
  $output .= '<label for="wp_pp_button_reference">' . esc_attr($reference) . '</label>';
55
  $output .= '<br />';
56
  $output .= '<input type="hidden" name="on0" value="' . apply_filters('wp_pp_button_reference_name', 'Reference') . '" />';
57
+ $output .= '<input type="text" name="os0" value="' . apply_filters('wp_pp_button_reference_value', '') . '" placeholder="'.esc_attr($reference_placeholder).'" class="wp_pp_button_reference" />';
58
  $output .= '</div>';
59
  }
60
 
102
  'return' => site_url(),
103
  'cbt' => '',
104
  'reference' => 'Your Email Address',
105
+ 'reference_placeholder' => '',
106
  'other_amount' => '',
107
  'other_amount_label' => 'Other Amount:',
108
+ 'other_amount_placeholder' => '',
109
  'country_code' => '',
110
  'payment_subject' => '',
111
  'button_image' => '',
143
  }
144
  ?>
145
  <div class="wp_paypal_button_widget">
146
+ <form name="_xclick" class="wp_accept_pp_button_form" action="https://www.paypal.com/cgi-bin/webscr" method="post" <?php echo esc_attr($window_target); ?> >
147
  <div class="wp_pp_button_selection_section">
148
  <select class="wp_paypal_button_options">
149
+ <?php echo wp_kses( $html_options, wpapp_allowed_tags() ); ?>
150
  </select>
151
  </div>
152
 
153
  <?php
154
  if (!empty($other_amount)) {
155
  echo '<div class="wp_pp_button_other_amt_section">';
156
+ echo esc_attr($other_amount_label).' <input type="number" min="1" step="any" name="other_amount" value="" placeholder="'.esc_attr($other_amount_placeholder).'" class="wpapp_other_amt_input" style="max-width:80px;"> ' . esc_attr($currency);
157
  echo '</div>';
158
  }
159
 
162
  echo '<label for="wp_pp_button_reference">' . esc_attr($reference) . '</label>';
163
  echo '<br />';
164
  echo '<input type="hidden" name="on0" value="' . apply_filters('wp_pp_button_reference_name', 'Reference') . '" />';
165
+ echo '<input type="text" name="os0" value="' . apply_filters('wp_pp_button_reference_value', '') . '" class="wp_pp_button_reference" placeholder="'.esc_attr($reference_placeholder).'" />';
166
  echo '</div>';
167
  }
168
 
178
  <input type="hidden" name="currency_code" value="<?php echo esc_attr($currency); ?>">
179
  <input type="hidden" name="item_name" value="">
180
  <input type="hidden" name="amount" value="">
181
+ <input type="hidden" name="return" value="<?php echo esc_url($return); ?>" />
182
  <input type="hidden" name="rm" value="<?php echo esc_attr($rm); ?>" />
183
  <input type="hidden" name="email" value="" />
184
  <?php
202
  echo '<div class="wp_pp_button_submit_btn">';
203
  if (!empty($button_text)) {//Use text button
204
  $button_class = apply_filters('wppp_text_button_class', '');
205
+ echo '<input type="submit" name="submit" class="' . esc_attr($button_class) . '" value="' . esc_attr($button_text) . '" />';
206
  } else {//Use image button
207
  echo '<input type="image" id="buy_now_button" class="buy_now_button_image" src="' . esc_url($payment_button_img_src) . '" border="0" name="submit" alt="Make payments with PayPal">';
208
  }
209
  echo '</div>';
210
  ?>
211
+ </form>
212
  </div>
213
 
214
  <script type="text/javascript">
wpapp-styles.css CHANGED
@@ -7,7 +7,26 @@
7
  .wp_accept_pp_button_form input{
8
  width: auto !important;
9
  }
 
 
 
 
 
 
10
 
11
  .buy_now_button_image {
12
  max-width: 100%;
13
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  .wp_accept_pp_button_form input{
8
  width: auto !important;
9
  }
10
+ .wp_accept_pp_button_form input[type="image"]{
11
+ cursor: pointer;
12
+ }
13
+ .wp_accept_pp_button_form_classic input[type="image"]{
14
+ cursor: pointer;
15
+ }
16
 
17
  .buy_now_button_image {
18
  max-width: 100%;
19
  }
20
+
21
+ .wpapp_payment_subject{
22
+ margin: 10px 0px;
23
+ }
24
+ .wpapp_other_amount_label{
25
+ margin: 10px 0px;
26
+ }
27
+ .wpapp_ref_title_label{
28
+ margin: 10px 0px;
29
+ }
30
+ .wpapp_payment_button{
31
+ margin: 10px 0px;
32
+ }
wpapp_admin_menu.php CHANGED
@@ -14,7 +14,7 @@ function paypal_payment_options_page() {
14
  if(!current_user_can('manage_options')){
15
  wp_die('You do not have permission to access this settings page.');
16
  }
17
-
18
  if (isset($_POST['info_update'])) {
19
  $nonce = $_REQUEST['_wpnonce'];
20
  if ( !wp_verify_nonce($nonce, 'wp_accept_pp_payment_settings_update')){
@@ -27,29 +27,35 @@ function paypal_payment_options_page() {
27
  $value4 = filter_input(INPUT_POST, 'wp_pp_payment_value4', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
28
  $value5 = filter_input(INPUT_POST, 'wp_pp_payment_value5', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
29
  $value6 = filter_input(INPUT_POST, 'wp_pp_payment_value6', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
30
-
31
- update_option('wp_paypal_widget_title_name', sanitize_text_field($_POST["wp_paypal_widget_title_name"]));
32
  update_option('wp_pp_payment_email', sanitize_email($_POST["wp_pp_payment_email"]));
33
  update_option('paypal_payment_currency', sanitize_text_field($_POST["paypal_payment_currency"]));
34
- update_option('wp_pp_payment_subject', sanitize_text_field($_POST["wp_pp_payment_subject"]));
35
- update_option('wp_pp_payment_item1', sanitize_text_field($_POST["wp_pp_payment_item1"]));
36
  update_option('wp_pp_payment_value1', $value1);
37
- update_option('wp_pp_payment_item2', sanitize_text_field($_POST["wp_pp_payment_item2"]));
38
  update_option('wp_pp_payment_value2', $value2);
39
- update_option('wp_pp_payment_item3', sanitize_text_field($_POST["wp_pp_payment_item3"]));
40
  update_option('wp_pp_payment_value3', $value3);
41
- update_option('wp_pp_payment_item4', sanitize_text_field($_POST["wp_pp_payment_item4"]));
42
  update_option('wp_pp_payment_value4', $value4);
43
- update_option('wp_pp_payment_item5', sanitize_text_field($_POST["wp_pp_payment_item5"]));
44
  update_option('wp_pp_payment_value5', $value5);
45
- update_option('wp_pp_payment_item6', sanitize_text_field($_POST["wp_pp_payment_item6"]));
46
  update_option('wp_pp_payment_value6', $value6);
47
  update_option('payment_button_type', sanitize_text_field($_POST["payment_button_type"]));
48
- update_option('wp_pp_show_other_amount', ($_POST['wp_pp_show_other_amount'] == '1') ? '1' : '-1' );
49
- update_option('wp_pp_show_ref_box', ($_POST['wp_pp_show_ref_box'] == '1') ? '1' : '-1' );
50
- update_option('wp_pp_ref_title', sanitize_text_field($_POST["wp_pp_ref_title"]));
51
  update_option('wp_pp_return_url', esc_url_raw(sanitize_text_field($_POST["wp_pp_return_url"])));
52
 
 
 
 
 
 
 
53
  echo '<div id="message" class="updated fade"><p><strong>';
54
  echo 'Options Updated!';
55
  echo '</strong></p></div>';
@@ -60,30 +66,30 @@ function paypal_payment_options_page() {
60
  ?>
61
 
62
  <div class=wrap>
63
- <div id="poststuff"><div id="post-body">
64
 
65
- <h2>Accept Paypal Payment Settings v<?php echo WP_PAYPAL_PAYMENT_ACCEPT_PLUGIN_VERSION; ?></h2>
66
 
67
  <div style="background: none repeat scroll 0 0 #ECECEC;border: 1px solid #CFCFCF;color: #363636;margin: 10px 0 15px;padding:15px;text-shadow: 1px 1px #FFFFFF;">
68
  For usage documentation and updates, please visit the plugin page at the following URL:<br />
69
  <a href="https://www.tipsandtricks-hq.com/wordpress-easy-paypal-payment-or-donation-accept-plugin-120" target="_blank">https://www.tipsandtricks-hq.com/wordpress-easy-paypal-payment-or-donation-accept-plugin-120</a>
70
  </div>
71
 
72
- <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
73
  <?php wp_nonce_field('wp_accept_pp_payment_settings_update'); ?>
74
-
75
  <input type="hidden" name="info_update" id="info_update" value="true" />
76
 
77
  <div class="postbox">
78
  <h3 class="hndle"><label for="title">Plugin Usage</label></h3>
79
- <div class="inside">
80
- <p>There are a few ways you can use this plugin:</p>
81
  <ol>
82
  <li>Configure the options below and then add the shortcode <strong>[wp_paypal_payment]</strong> to a post or page (where you want the payment button)</li>
 
 
83
  <li>Call the function from a template file: <strong>&lt;?php echo Paypal_payment_accept(); ?&gt;</strong></li>
84
  <li>Use the <strong>WP Paypal Payment</strong> Widget from the Widgets menu</li>
85
- <li>Use the shortcode with custom parameter options to add multiple different payment widgets in different areas of the site.
86
- <a href="https://www.tipsandtricks-hq.com/wordpress-easy-paypal-payment-or-donation-accept-plugin-120#shortcode_with_custom_parameters" target="_blank">View shortcode documentation</a></li>
87
  </ol>
88
  </div></div>
89
 
@@ -99,7 +105,7 @@ function paypal_payment_options_page() {
99
  <input name="wp_paypal_widget_title_name" type="text" size="30" value="<?php echo esc_attr(get_option('wp_paypal_widget_title_name')); ?>"/>
100
  <br /><i>This will be the title of the Widget on the Sidebar if you use it.</i><br />
101
  </td></tr>
102
-
103
  <tr valign="top"><td width="25%" align="left">
104
  <strong>Paypal Email address:</strong>
105
  </td><td align="left">
@@ -182,14 +188,14 @@ function paypal_payment_options_page() {
182
  <input name="wp_pp_payment_value6" type="text" size="10" value="<?php echo esc_attr(get_option('wp_pp_payment_value6')); ?>"/>
183
  <br /><i>Enter the name of the service or product and the price. eg. Enter "Basic service - $10" in the Payment Option text box and "10.00" in the price text box to accept a payment of $10 for "Basic service". Leave the Payment Option and Price fields empty if u don't want to use that option. For example, if you have 3 price options then fill in the top 3 and leave the rest empty.</i>
184
  </td></tr>
185
-
186
  <tr valign="top"><td width="25%" align="left">
187
  <strong>Show Other Amount:</strong>
188
  </td><td align="left">
189
  <input name="wp_pp_show_other_amount" type="checkbox"<?php if (get_option('wp_pp_show_other_amount') != '-1') echo ' checked="checked"'; ?> value="1"/>
190
- <i> Tick this checkbox if you want to show ohter amount text box to your visitors so they can enter custom amount.</i>
191
  </td></tr>
192
-
193
  <tr valign="top"><td width="25%" align="left">
194
  <strong>Show Reference Text Box:</strong>
195
  </td><td align="left">
@@ -204,13 +210,24 @@ function paypal_payment_options_page() {
204
  <br /><i>Enter a title for the Reference text box (ie. Your Web Address). The visitors will see this text.</i><br />
205
  </td></tr>
206
 
207
- <tr valign="top"><td width="25%" align="left">
 
208
  <strong>Return URL from PayPal:</strong>
209
  </td><td align="left">
210
  <input name="wp_pp_return_url" type="text" size="60" value="<?php echo esc_url(get_option('wp_pp_return_url')); ?>"/>
211
  <br /><i>Enter a return URL (could be a Thank You page). PayPal will redirect visitors to this page after Payment.</i><br />
212
- </td></tr>
213
-
 
 
 
 
 
 
 
 
 
 
214
  </table>
215
 
216
  <br /><br />
@@ -236,14 +253,18 @@ function paypal_payment_options_page() {
236
  </table>
237
 
238
  </div></div><!-- end of postbox -->
239
-
240
  <div class="submit">
241
  <input type="submit" class="button-primary" name="info_update" value="<?php _e('Update options'); ?> &raquo;" />
242
  </div>
243
  </form>
244
 
245
- <div style="background: none repeat scroll 0 0 #FFF6D5;border: 1px solid #D1B655;color: #3F2502;margin: 10px 0;padding: 5px 5px 5px 10px;text-shadow: 1px 1px #FFFFFF;">
246
- <p>If you need a feature rich and supported plugin for accepting PayPal payment then check out our <a href="https://www.tipsandtricks-hq.com/wordpress-estore-plugin-complete-solution-to-sell-digital-products-from-your-wordpress-blog-securely-1059" target="_blank">WP eStore Plugin</a> (You will love the WP eStore Plugin).
 
 
 
 
247
  </p>
248
  </div>
249
 
14
  if(!current_user_can('manage_options')){
15
  wp_die('You do not have permission to access this settings page.');
16
  }
17
+
18
  if (isset($_POST['info_update'])) {
19
  $nonce = $_REQUEST['_wpnonce'];
20
  if ( !wp_verify_nonce($nonce, 'wp_accept_pp_payment_settings_update')){
27
  $value4 = filter_input(INPUT_POST, 'wp_pp_payment_value4', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
28
  $value5 = filter_input(INPUT_POST, 'wp_pp_payment_value5', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
29
  $value6 = filter_input(INPUT_POST, 'wp_pp_payment_value6', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
30
+
31
+ update_option('wp_paypal_widget_title_name', sanitize_text_field(stripslashes($_POST["wp_paypal_widget_title_name"])));
32
  update_option('wp_pp_payment_email', sanitize_email($_POST["wp_pp_payment_email"]));
33
  update_option('paypal_payment_currency', sanitize_text_field($_POST["paypal_payment_currency"]));
34
+ update_option('wp_pp_payment_subject', sanitize_text_field(stripslashes($_POST["wp_pp_payment_subject"])));
35
+ update_option('wp_pp_payment_item1', sanitize_text_field(stripslashes($_POST["wp_pp_payment_item1"])));
36
  update_option('wp_pp_payment_value1', $value1);
37
+ update_option('wp_pp_payment_item2', sanitize_text_field(stripslashes($_POST["wp_pp_payment_item2"])));
38
  update_option('wp_pp_payment_value2', $value2);
39
+ update_option('wp_pp_payment_item3', sanitize_text_field(stripslashes($_POST["wp_pp_payment_item3"])));
40
  update_option('wp_pp_payment_value3', $value3);
41
+ update_option('wp_pp_payment_item4', sanitize_text_field(stripslashes($_POST["wp_pp_payment_item4"])));
42
  update_option('wp_pp_payment_value4', $value4);
43
+ update_option('wp_pp_payment_item5', sanitize_text_field(stripslashes($_POST["wp_pp_payment_item5"])));
44
  update_option('wp_pp_payment_value5', $value5);
45
+ update_option('wp_pp_payment_item6', sanitize_text_field(stripslashes($_POST["wp_pp_payment_item6"])));
46
  update_option('wp_pp_payment_value6', $value6);
47
  update_option('payment_button_type', sanitize_text_field($_POST["payment_button_type"]));
48
+ update_option('wp_pp_show_other_amount', isset($_POST['wp_pp_show_other_amount']) ? '1' : '-1' );
49
+ update_option('wp_pp_show_ref_box', isset($_POST['wp_pp_show_ref_box']) ? '1' : '-1' );
50
+ update_option('wp_pp_ref_title', sanitize_text_field(stripslashes($_POST["wp_pp_ref_title"])));
51
  update_option('wp_pp_return_url', esc_url_raw(sanitize_text_field($_POST["wp_pp_return_url"])));
52
 
53
+ $cancel_url = esc_url_raw(sanitize_text_field($_POST["wp_pp_cancel_url"]));
54
+ if(empty($cancel_url)){
55
+ $cancel_url = home_url();
56
+ }
57
+ update_option('wp_pp_cancel_url', $cancel_url);
58
+
59
  echo '<div id="message" class="updated fade"><p><strong>';
60
  echo 'Options Updated!';
61
  echo '</strong></p></div>';
66
  ?>
67
 
68
  <div class=wrap>
69
+ <h2>Easy Accept Payments for PayPal Settings v<?php echo WP_PAYPAL_PAYMENT_ACCEPT_PLUGIN_VERSION; ?></h2>
70
 
71
+ <div id="poststuff"><div id="post-body">
72
 
73
  <div style="background: none repeat scroll 0 0 #ECECEC;border: 1px solid #CFCFCF;color: #363636;margin: 10px 0 15px;padding:15px;text-shadow: 1px 1px #FFFFFF;">
74
  For usage documentation and updates, please visit the plugin page at the following URL:<br />
75
  <a href="https://www.tipsandtricks-hq.com/wordpress-easy-paypal-payment-or-donation-accept-plugin-120" target="_blank">https://www.tipsandtricks-hq.com/wordpress-easy-paypal-payment-or-donation-accept-plugin-120</a>
76
  </div>
77
 
78
+ <form method="post" action="">
79
  <?php wp_nonce_field('wp_accept_pp_payment_settings_update'); ?>
80
+
81
  <input type="hidden" name="info_update" id="info_update" value="true" />
82
 
83
  <div class="postbox">
84
  <h3 class="hndle"><label for="title">Plugin Usage</label></h3>
85
+ <div class="inside">
86
+ <p>There are a few different ways you can use this plugin:</p>
87
  <ol>
88
  <li>Configure the options below and then add the shortcode <strong>[wp_paypal_payment]</strong> to a post or page (where you want the payment button)</li>
89
+ <li>Use the shortcode with custom parameter options to add multiple different payment widgets with different configuration.
90
+ <a href="https://www.tipsandtricks-hq.com/wordpress-easy-paypal-payment-or-donation-accept-plugin-120#shortcode_with_custom_parameters" target="_blank">View shortcode documentation</a></li>
91
  <li>Call the function from a template file: <strong>&lt;?php echo Paypal_payment_accept(); ?&gt;</strong></li>
92
  <li>Use the <strong>WP Paypal Payment</strong> Widget from the Widgets menu</li>
 
 
93
  </ol>
94
  </div></div>
95
 
105
  <input name="wp_paypal_widget_title_name" type="text" size="30" value="<?php echo esc_attr(get_option('wp_paypal_widget_title_name')); ?>"/>
106
  <br /><i>This will be the title of the Widget on the Sidebar if you use it.</i><br />
107
  </td></tr>
108
+
109
  <tr valign="top"><td width="25%" align="left">
110
  <strong>Paypal Email address:</strong>
111
  </td><td align="left">
188
  <input name="wp_pp_payment_value6" type="text" size="10" value="<?php echo esc_attr(get_option('wp_pp_payment_value6')); ?>"/>
189
  <br /><i>Enter the name of the service or product and the price. eg. Enter "Basic service - $10" in the Payment Option text box and "10.00" in the price text box to accept a payment of $10 for "Basic service". Leave the Payment Option and Price fields empty if u don't want to use that option. For example, if you have 3 price options then fill in the top 3 and leave the rest empty.</i>
190
  </td></tr>
191
+
192
  <tr valign="top"><td width="25%" align="left">
193
  <strong>Show Other Amount:</strong>
194
  </td><td align="left">
195
  <input name="wp_pp_show_other_amount" type="checkbox"<?php if (get_option('wp_pp_show_other_amount') != '-1') echo ' checked="checked"'; ?> value="1"/>
196
+ <i> Tick this checkbox if you want to show other amount text box to your visitors so they can enter custom amount.</i>
197
  </td></tr>
198
+
199
  <tr valign="top"><td width="25%" align="left">
200
  <strong>Show Reference Text Box:</strong>
201
  </td><td align="left">
210
  <br /><i>Enter a title for the Reference text box (ie. Your Web Address). The visitors will see this text.</i><br />
211
  </td></tr>
212
 
213
+ <tr valign="top">
214
+ <td width="25%" align="left">
215
  <strong>Return URL from PayPal:</strong>
216
  </td><td align="left">
217
  <input name="wp_pp_return_url" type="text" size="60" value="<?php echo esc_url(get_option('wp_pp_return_url')); ?>"/>
218
  <br /><i>Enter a return URL (could be a Thank You page). PayPal will redirect visitors to this page after Payment.</i><br />
219
+ </td>
220
+ </tr>
221
+
222
+ <tr valign="top">
223
+ <td width="25%" align="left">
224
+ <strong>Cancel URL from PayPal:</strong>
225
+ </td><td align="left">
226
+ <input name="wp_pp_cancel_url" type="text" size="60" value="<?php echo esc_url(get_option('wp_pp_cancel_url')); ?>"/>
227
+ <br /><i>Enter a cancel URL. PayPal will redirect visitors to this page if they click on the cancel link.</i><br />
228
+ </td>
229
+ </tr>
230
+
231
  </table>
232
 
233
  <br /><br />
253
  </table>
254
 
255
  </div></div><!-- end of postbox -->
256
+
257
  <div class="submit">
258
  <input type="submit" class="button-primary" name="info_update" value="<?php _e('Update options'); ?> &raquo;" />
259
  </div>
260
  </form>
261
 
262
+ <div style="background: none repeat scroll 0 0 #FFF6D5;border: 1px solid #D1B655;color: #3F2502;margin: 10px 0;padding: 5px 5px 5px 10px;text-shadow: 1px 1px #FFFFFF;">
263
+ <p>
264
+ If you need a feature rich and supported plugin for accepting PayPal payment then check out our <a href="https://www.tipsandtricks-hq.com/wordpress-estore-plugin-complete-solution-to-sell-digital-products-from-your-wordpress-blog-securely-1059" target="_blank">WP eStore Plugin</a> (You will love the WP eStore Plugin).
265
+ </p>
266
+ <p>
267
+ Try our free <a href="https://wordpress.org/plugins/wp-express-checkout/" target="_blank">WP Express Checkout</a> plugin to sell your products using PayPal's Express Checkout API.
268
  </p>
269
  </div>
270
 
wpapp_paypal_utility.php CHANGED
@@ -3,9 +3,9 @@
3
  function wpapp_validate_paypl_ipn() {
4
 
5
  $wpapp_ipn_validated = true;
6
-
7
  // Reading POSTed data directly from POST causes serialization issues with array data in the POST.
8
- // Instead, read raw POST data from the input stream.
9
  $raw_post_data = file_get_contents('php://input');
10
  $raw_post_array = explode('&', $raw_post_data);
11
  $myPost = array();
@@ -14,7 +14,7 @@ function wpapp_validate_paypl_ipn() {
14
  if (count($keyval) == 2)
15
  $myPost[$keyval[0]] = urldecode($keyval[1]);
16
  }
17
-
18
  // read the IPN message sent from PayPal and prepend 'cmd=_notify-validate'
19
  $req = 'cmd=_notify-validate';
20
  if (function_exists('get_magic_quotes_gpc')) {
@@ -29,33 +29,27 @@ function wpapp_validate_paypl_ipn() {
29
  $req .= "&$key=$value";
30
  }
31
 
32
-
33
  // Step 2: POST IPN data back to PayPal to validate
34
- $ch = curl_init('https://www.paypal.com/cgi-bin/webscr');
35
- curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
36
- curl_setopt($ch, CURLOPT_POST, 1);
37
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
38
- curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
39
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
40
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));
 
41
 
42
- if (!($res = curl_exec($ch))) {
43
- // error_log("Got " . curl_error($ch) . " when processing IPN data");
44
- curl_close($ch);
45
- exit;
46
- }
47
- curl_close($ch);
48
 
49
- // Inspect IPN validation result and act accordingly
50
- if (strcmp ($res, "VERIFIED") == 0) {
51
  // The IPN is verified, process it
52
  $wpapp_ipn_validated = true;
53
- } else if (strcmp ($res, "INVALID") == 0) {
54
  // IPN invalid, log for manual investigation
55
  $wpapp_ipn_validated = false;
56
  }
57
 
58
-
59
  if (!$wpapp_ipn_validated) {
60
  // IPN validation failed. Email the admin to notify this event.
61
  $admin_email = get_bloginfo('admin_email');
@@ -66,3 +60,49 @@ function wpapp_validate_paypl_ipn() {
66
  exit;
67
  }
68
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  function wpapp_validate_paypl_ipn() {
4
 
5
  $wpapp_ipn_validated = true;
6
+
7
  // Reading POSTed data directly from POST causes serialization issues with array data in the POST.
8
+ // Instead, read raw POST data from the input stream.
9
  $raw_post_data = file_get_contents('php://input');
10
  $raw_post_array = explode('&', $raw_post_data);
11
  $myPost = array();
14
  if (count($keyval) == 2)
15
  $myPost[$keyval[0]] = urldecode($keyval[1]);
16
  }
17
+
18
  // read the IPN message sent from PayPal and prepend 'cmd=_notify-validate'
19
  $req = 'cmd=_notify-validate';
20
  if (function_exists('get_magic_quotes_gpc')) {
29
  $req .= "&$key=$value";
30
  }
31
 
 
32
  // Step 2: POST IPN data back to PayPal to validate
33
+ $params = array(
34
+ 'body' => $req,
35
+ 'timeout' => 60,
36
+ 'httpversion' => '1.1',
37
+ 'compress' => false,
38
+ 'decompress' => false,
39
+ 'user-agent' => 'PayPal Donations Plugin/TTHQ'
40
+ );
41
 
42
+ $connection_url = 'https://www.paypal.com/cgi-bin/webscr';
43
+ $response = wp_safe_remote_post( $connection_url, $params );
 
 
 
 
44
 
45
+ if ( ! is_wp_error( $response ) && strstr( $response[ 'body' ], 'VERIFIED' ) ) {
 
46
  // The IPN is verified, process it
47
  $wpapp_ipn_validated = true;
48
+ } else {
49
  // IPN invalid, log for manual investigation
50
  $wpapp_ipn_validated = false;
51
  }
52
 
 
53
  if (!$wpapp_ipn_validated) {
54
  // IPN validation failed. Email the admin to notify this event.
55
  $admin_email = get_bloginfo('admin_email');
60
  exit;
61
  }
62
  }
63
+
64
+ function wpapp_allowed_tags() {
65
+ $my_allowed = wp_kses_allowed_html( 'post' );
66
+
67
+ // form fields - input
68
+ $my_allowed['input'] = array(
69
+ 'class' => array(),
70
+ 'id' => array(),
71
+ 'name' => array(),
72
+ 'value' => array(),
73
+ 'type' => array(),
74
+ 'step' => array(),
75
+ 'min' => array(),
76
+ 'checked' => array(),
77
+ 'size' => array(),
78
+ 'readonly' => array(),
79
+ 'style' => array(),
80
+ );
81
+ // select
82
+ $my_allowed['select'] = array(
83
+ 'class' => array(),
84
+ 'id' => array(),
85
+ 'name' => array(),
86
+ 'value' => array(),
87
+ 'type' => array(),
88
+ );
89
+ // select options
90
+ $my_allowed['option'] = array(
91
+ 'selected' => array(),
92
+ 'value' => array(),
93
+ 'data-product_name' => array(),
94
+ );
95
+ // button
96
+ $my_allowed['button'] = array(
97
+ 'type' => array(),
98
+ 'class' => array(),
99
+ 'id' => array(),
100
+ 'style' => array(),
101
+ );
102
+ // style
103
+ $my_allowed['style'] = array(
104
+ 'types' => array(),
105
+ );
106
+
107
+ return $my_allowed;
108
+ }