Payment Form for PayPal Pro - Version 1.1.56

Version Description

  • Code improvements

=

Download this release

Release Info

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

Code changes from version 1.1.55 to 1.1.56

Files changed (4) hide show
  1. README.txt +4 -1
  2. captcha/captcha.php +33 -59
  3. cp_admin_int_edition.inc.php +1 -1
  4. cp_ppp.php +1 -1
README.txt CHANGED
@@ -296,7 +296,10 @@ A: In all plugin versions you can turn off IP tracking to avoid saving that user
296
  = 1.1.55 =
297
  * Code improvements
298
 
 
 
 
299
  == Upgrade Notice ==
300
 
301
- = 1.1.55 =
302
  * Code improvements
296
  = 1.1.55 =
297
  * Code improvements
298
 
299
+ = 1.1.56 =
300
+ * Code improvements
301
+
302
  == Upgrade Notice ==
303
 
304
+ = 1.1.56 =
305
  * Code improvements
captcha/captcha.php CHANGED
@@ -4,46 +4,26 @@ PHP Captcha by Codepeople.net
4
  http://www.codepeople.net
5
  */
6
 
7
- if (!ini_get("zlib.output_compression")) ob_clean();
8
 
9
- if (!isset($_GET["ps"])) $_GET["ps"] = '';
10
 
11
- if ($_GET["hdwtest"] == "sessiontest")
12
- {
13
- session_start();
14
- session_register("tmpvar");
15
- if ($_GET["autocall"]!=1){
16
- $_SESSION["tmpvar"] = "ok";
17
- } else {
18
- if ($_SESSION["tmpvar"]!="ok") {
19
- die("Session Error");
20
- } else {
21
- die("Sessions works on your server!");
22
- }
23
- }
24
- header("Location: ".$PHP_SELF."?hdwtest=sessiontest&autocall=1" );
25
- exit;
26
- }
27
 
28
- if ($_GET["width"] == '' || !is_numeric($_GET["width"])) $_GET["width"] = "180";
29
- if ($_GET["height"] == '' || !is_numeric($_GET["height"])) $_GET["height"] = "60";
30
- if ($_GET["letter_count"] == ''|| !is_numeric($_GET["letter_count"])) $_GET["letter_count"] = "5";
31
- if ($_GET["min_size"] == ''|| !is_numeric($_GET["min_size"])) $_GET["min_size"] = "35";
32
- if ($_GET["max_size"] == ''|| !is_numeric($_GET["max_size"])) $_GET["max_size"] = "45";
33
- if ($_GET["noise"] == ''|| !is_numeric($_GET["noise"])) $_GET["noise"] = "200";
34
- if ($_GET["noiselength"] == ''|| !is_numeric($_GET["noiselength"])) $_GET["noiselength"] = "5";
35
- if ($_GET["bcolor"] == '') $_GET["bcolor"] = "FFFFFF";
36
- if ($_GET["border"] == '') $_GET["border"] = "000000";
37
 
38
  //configuration
39
- $imgX = $_GET["width"];
40
- $imgY = $_GET["height"];
41
-
42
- $letter_count = $_GET["letter_count"];
43
- $min_size = $_GET["min_size"];
44
- $max_size = $_GET["max_size"];
45
- $noise = $_GET["noise"];
46
- $noiselength = $_GET["noiselength"];
47
  $bcolor = cpcff_decodeColor($_GET["bcolor"]);
48
  $border = cpcff_decodeColor($_GET["border"]);
49
 
@@ -51,11 +31,7 @@ $noisecolor = 0xcdcdcd;
51
  $random_noise_color= true;
52
  $tcolor = cpcff_decodeColor("666666");
53
  $random_text_color= true;
54
-
55
-
56
- header("Cache-Control: no-store, no-cache, must-revalidate");
57
- header("Pragma: no-cache");
58
-
59
  function cpcff_decodeColor($hexcolor)
60
  {
61
  $color = hexdec($hexcolor);
@@ -72,10 +48,6 @@ function cpcff_similarColors($c1, $c2)
72
  return sqrt( pow($c1["r"]-$c2["r"],2) + pow($c1["g"]-$c2["g"],2) + pow($c1["b"]-$c2["b"],2)) < 125;
73
  }
74
 
75
-
76
- // USAGE
77
- // if (empty($_POST['hdcaptcha']) || $_POST['hdcaptcha'] != $_SESSION['rand_code']) header("Location: /form.html");
78
-
79
  if (function_exists('session_start')) @session_start();
80
 
81
  function cpcff_make_seed() {
@@ -122,13 +94,22 @@ for ($i=0;$i<$noise;$i++)
122
  imageline ( $image, $x1, $y1, mt_rand($x1-$noiselength,$x1+$noiselength), mt_rand($y1-$noiselength,$y1+$noiselength), $color);
123
  }
124
 
125
- $font = dirname( __FILE__ ) . "/font-1.ttf"; // font
126
- if ($_GET["font"]) $font = dirname( __FILE__ ) . "/".$_GET["font"];
127
- /**if (!file_exists($font))
128
- $font = $_SERVER["DOCUMENT_ROOT"]."/HDWFormCaptcha/".$font;
129
- if (!file_exists($font))
130
- $font = dirname(__FILE__)."/".$font;
131
- */
 
 
 
 
 
 
 
 
 
132
 
133
  $font_size = rand($min_size, $max_size);
134
 
@@ -159,15 +140,8 @@ else
159
  imagestring ( $image, $font, $x, $y, $str, $text_col);
160
  }
161
 
162
- function ppp_output_handler($img) {
163
- header('Content-type: image/png');
164
- header('Content-Length: ' . strlen($img));
165
- return $img;
166
- }
167
-
168
- ob_start("ppp_output_handler");
169
  imagepng($image);
170
- ob_end_flush();
171
  imagedestroy ($image);
172
  exit;
173
  ?>
4
  http://www.codepeople.net
5
  */
6
 
7
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
8
 
9
+ if (!ini_get("zlib.output_compression")) ob_clean();
10
 
11
+ header("Cache-Control: no-store, no-cache, must-revalidate");
12
+ header("Pragma: no-cache");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
+ if (!isset($_GET["ps"])) $_GET["ps"] = '';
15
+ if (!isset($_GET["bcolor"]) || $_GET["bcolor"] == '') $_GET["bcolor"] = "FFFFFF";
16
+ if (!isset($_GET["border"]) || $_GET["border"] == '') $_GET["border"] = "000000";
 
 
 
 
 
 
17
 
18
  //configuration
19
+ $imgX = ( isset($_GET["width"]) && is_numeric( $_GET["width"] ) )? $_GET["width"] : "180" ;
20
+ $imgY = ( isset($_GET["height"]) && is_numeric( $_GET["height"] ) )? $_GET["height"] : "60" ;
21
+
22
+ $letter_count = ( isset($_GET["letter_count"]) && is_numeric( $_GET["letter_count"] ) )? $_GET["letter_count"] : "5";
23
+ $min_size = ( isset($_GET["min_size"]) && is_numeric( $_GET["min_size"] ) )? $_GET["min_size"] : "35";
24
+ $max_size = ( isset($_GET["max_size"]) && is_numeric( $_GET["max_size"] ) )? $_GET["max_size"] : "45";
25
+ $noise = ( isset($_GET["noise"]) && is_numeric( $_GET["noise"] ) )? $_GET["noise"] : "200";
26
+ $noiselength = ( isset($_GET["noiselength"]) && is_numeric( $_GET["noiselength"] ) )? $_GET["noiselength"] : "5";
27
  $bcolor = cpcff_decodeColor($_GET["bcolor"]);
28
  $border = cpcff_decodeColor($_GET["border"]);
29
 
31
  $random_noise_color= true;
32
  $tcolor = cpcff_decodeColor("666666");
33
  $random_text_color= true;
34
+
 
 
 
 
35
  function cpcff_decodeColor($hexcolor)
36
  {
37
  $color = hexdec($hexcolor);
48
  return sqrt( pow($c1["r"]-$c2["r"],2) + pow($c1["g"]-$c2["g"],2) + pow($c1["b"]-$c2["b"],2)) < 125;
49
  }
50
 
 
 
 
 
51
  if (function_exists('session_start')) @session_start();
52
 
53
  function cpcff_make_seed() {
94
  imageline ( $image, $x1, $y1, mt_rand($x1-$noiselength,$x1+$noiselength), mt_rand($y1-$noiselength,$y1+$noiselength), $color);
95
  }
96
 
97
+
98
+ switch (@$_GET["font"]) {
99
+ case "font-2.ttf":
100
+ $selected_font = "font-2.ttf";
101
+ break;
102
+ case "font-3.ttf":
103
+ $selected_font = "font-3.ttf";
104
+ break;
105
+ case "font-4.ttf":
106
+ $selected_font = "font-4.ttf";
107
+ break;
108
+ default:
109
+ $selected_font = "font-1.ttf";
110
+ }
111
+
112
+ $font = dirname( __FILE__ ) . "/". $selected_font;
113
 
114
  $font_size = rand($min_size, $max_size);
115
 
140
  imagestring ( $image, $font, $x, $y, $str, $text_col);
141
  }
142
 
143
+ header("Content-type: image/png");
 
 
 
 
 
 
144
  imagepng($image);
 
145
  imagedestroy ($image);
146
  exit;
147
  ?>
cp_admin_int_edition.inc.php CHANGED
@@ -33,7 +33,7 @@ else if ($_GET["item"] == 'css')
33
  <form method="post" action="" name="cpformconf">
34
  <input name="rsave" type="hidden" value="<?php echo $nonce; ?>" />
35
  <input name="<?php echo $cpid; ?>_post_edition" type="hidden" value="1" />
36
- <input name="cfwpp_edit" type="hidden" value="<?php echo $_GET["item"]; ?>" />
37
 
38
  <div id="normal-sortables" class="meta-box-sortables">
39
 
33
  <form method="post" action="" name="cpformconf">
34
  <input name="rsave" type="hidden" value="<?php echo $nonce; ?>" />
35
  <input name="<?php echo $cpid; ?>_post_edition" type="hidden" value="1" />
36
+ <input name="cfwpp_edit" type="hidden" value="<?php echo esc_attr($_GET["item"]); ?>" />
37
 
38
  <div id="normal-sortables" class="meta-box-sortables">
39
 
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.55
7
  Author: CodePeople
8
  Author URI: https://wordpress.dwbooster.com/forms/payment-form-for-paypal-pro
9
  License: GPL
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.56
7
  Author: CodePeople
8
  Author URI: https://wordpress.dwbooster.com/forms/payment-form-for-paypal-pro
9
  License: GPL