Payment Form for PayPal Pro - Version 1.1.47

Version Description

  • Removed use of CURL

=

Download this release

Release Info

Developer codepeople
Plugin Icon 128x128 Payment Form for PayPal Pro
Version 1.1.47
Comparing to
See all releases

Code changes from version 1.1.46 to 1.1.47

Files changed (4) hide show
  1. README.txt +5 -2
  2. cp-feedback.php +15 -28
  3. cp_ppp.php +22 -25
  4. js/fbuilder-pro-admin.jquery.js +1 -1
README.txt CHANGED
@@ -269,7 +269,10 @@ A: In all plugin versions you can turn off IP tracking to avoid saving that user
269
= 1.1.46 =
270
* New Gutemberg block
271
272
== Upgrade Notice ==
273
274
- = 1.1.46 =
275
- * New Gutemberg block
269
= 1.1.46 =
270
* New Gutemberg block
271
272
+ = 1.1.47 =
273
+ * Removed use of CURL
274
+
275
== Upgrade Notice ==
276
277
+ = 1.1.47 =
278
+ * Removed use of CURL
cp-feedback.php CHANGED
@@ -28,21 +28,21 @@ function cppffppp_feedback() {
28
$cppffppp_plugin_version = $cppffppp_plugin_data['Version'];
29
$time = time() - get_option('installed_'.$cppffppp_plugslug, '');
30
$data = array(
31
- 'answer' => urlencode(@$_POST["answer"]),
32
- 'otherplugin' => urlencode(@$_POST["opinfo"]),
33
- 'otherinfo' => urlencode(@$_POST["oinfo"]),
34
- 'plugin' => urlencode($cppffppp_plugin_data['Name']),
35
- 'pluginv' => urlencode($cppffppp_plugin_version),
36
- 'wordpress' => urlencode(get_bloginfo( 'version' )),
37
- 'itime' => urlencode($time),
38
- 'phpversion' => urlencode(phpversion ())
39
);
40
if (@$_POST["onymous"] == 'false') // send this data only if explicitly accepted
41
{
42
$current_user = wp_get_current_user();
43
- $data['email'] = urlencode($current_user->user_email);
44
- $data['website'] = urlencode($_SERVER['HTTP_HOST']);
45
- $data['url'] = urlencode(get_site_url());
46
}
47
48
//extract data from the post
@@ -50,23 +50,10 @@ function cppffppp_feedback() {
50
$url = 'https://wordpress.dwbooster.com/licensesystem/debug-data.php';
51
$fields = $data;
52
53
- //url-ify the data for the POST
54
- foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
55
- rtrim($fields_string, '&');
56
-
57
- //open connection
58
- $ch = curl_init();
59
-
60
- //set the url, number of POST vars, POST data
61
- curl_setopt($ch,CURLOPT_URL, $url);
62
- curl_setopt($ch,CURLOPT_POST, count($fields));
63
- curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
64
-
65
- //execute post
66
- $result = curl_exec($ch);
67
-
68
- //close connection
69
- curl_close($ch);
70
71
wp_die(); // this is required to terminate immediately and return a proper response
72
}
28
$cppffppp_plugin_version = $cppffppp_plugin_data['Version'];
29
$time = time() - get_option('installed_'.$cppffppp_plugslug, '');
30
$data = array(
31
+ 'answer' => (@$_POST["answer"]),
32
+ 'otherplugin' => (@$_POST["opinfo"]),
33
+ 'otherinfo' => (@$_POST["oinfo"]),
34
+ 'plugin' => ($cppffppp_plugin_data['Name']),
35
+ 'pluginv' => ($cppffppp_plugin_version),
36
+ 'wordpress' => (get_bloginfo( 'version' )),
37
+ 'itime' => ($time),
38
+ 'phpversion' => (phpversion ())
39
);
40
if (@$_POST["onymous"] == 'false') // send this data only if explicitly accepted
41
{
42
$current_user = wp_get_current_user();
43
+ $data['email'] = ($current_user->user_email);
44
+ $data['website'] = ($_SERVER['HTTP_HOST']);
45
+ $data['url'] = (get_site_url());
46
}
47
48
//extract data from the post
50
$url = 'https://wordpress.dwbooster.com/licensesystem/debug-data.php';
51
$fields = $data;
52
53
+ wp_remote_post(
54
+ $url,
55
+ array ( 'body' => $fields )
56
+ );
57
58
wp_die(); // this is required to terminate immediately and return a proper response
59
}
cp_ppp.php CHANGED
@@ -3,7 +3,7 @@
3
Plugin Name: Payment Form for PayPal Pro
4
Plugin URI: https://wordpress.dwbooster.com/forms/paypal-payment-pro-form
5
Description: Payment Form for PayPal Pro to accept credit cards directly into your website. Official PayPal Partner.
6
- Version: 1.1.46
7
Author: CodePeople
8
Author URI: https://wordpress.dwbooster.com/forms/payment-form-for-paypal-pro
9
License: GPL
@@ -1084,33 +1084,30 @@ function cp_ppp_payments_pro_POST($methodName_, $nvpStr_) {
1084
$API_Endpoint = "https://api-3t.paypal.com/nvp";
1085
$version = urlencode('51.0');
1086
1087
- // Set the curl parameters.
1088
- $ch = curl_init();
1089
- curl_setopt($ch, CURLOPT_URL, $API_Endpoint);
1090
- curl_setopt($ch, CURLOPT_VERBOSE, 1);
1091
-
1092
- // Turn off the server and peer verification (TrustManager Concept).
1093
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
1094
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
1095
-
1096
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
1097
- curl_setopt($ch, CURLOPT_POST, 1);
1098
-
1099
- // Set the API operation, version, and API signature in the request.
1100
- $nvpreq = "METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_";
1101
-
1102
- // Set the request as a POST FIELD for curl.
1103
- curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);
1104
-
1105
- // Get response from the server.
1106
- $httpResponse = curl_exec($ch);
1107
-
1108
- if(!$httpResponse) {
1109
- exit("$methodName_ failed: ".curl_error($ch).'('.curl_errno($ch).')');
1110
}
1111
1112
// Extract the response details.
1113
- $httpResponseAr = explode("&", $httpResponse);
1114
1115
$httpParsedResponseAr = array();
1116
foreach ($httpResponseAr as $i => $value) {
3
Plugin Name: Payment Form for PayPal Pro
4
Plugin URI: https://wordpress.dwbooster.com/forms/paypal-payment-pro-form
5
Description: Payment Form for PayPal Pro to accept credit cards directly into your website. Official PayPal Partner.
6
+ Version: 1.1.47
7
Author: CodePeople
8
Author URI: https://wordpress.dwbooster.com/forms/payment-form-for-paypal-pro
9
License: GPL
1084
$API_Endpoint = "https://api-3t.paypal.com/nvp";
1085
$version = urlencode('51.0');
1086
1087
+ // Set the parameters.
1088
+ $ppparams = array();
1089
+ $ppparams['METHOD'] = $methodName_;
1090
+ $ppparams['VERSION'] = $version;
1091
+ $ppparams['PWD'] = $API_Password;
1092
+ $ppparams['USER'] = $API_UserName;
1093
+ $ppparams['SIGNATURE'] = $API_Signature;
1094
+ parse_str(substr($nvpStr_,1), $fields);
1095
+ foreach ($fields as $item => $value)
1096
+ $fields[$item] = urldecode($value);
1097
+ $ppparams = array_merge ($ppparams, $fields);
1098
+
1099
+ $response = wp_remote_post(
1100
+ $API_Endpoint,
1101
+
1102
+ array ( 'timeout' => 45, 'body' => $ppparams )
1103
+ );
1104
+
1105
+ if ( !is_array( $response ) || is_wp_error( $response ) ) {
1106
+ exit("$methodName_ failed.");
1107
}
1108
1109
// Extract the response details.
1110
+ $httpResponseAr = explode("&", $response['body']);
1111
1112
$httpParsedResponseAr = array();
1113
foreach ($httpResponseAr as $i => $value) {
js/fbuilder-pro-admin.jquery.js CHANGED
@@ -686,7 +686,7 @@ var ppp_started=false;
686
},
687
showCsslayout: function(v)
688
{
689
- return '<label>Add Css Layout Keywords</label><input class="large" name="sCsslayout" id="sCsslayout" value="'+v+'" />';
690
}
691
};
692
686
},
687
showCsslayout: function(v)
688
{
689
+ return '<label>Additional CSS Class</label><input class="large" name="sCsslayout" id="sCsslayout" value="'+v+'" />';
690
}
691
};
692