Changeset 1589192
- Timestamp:
- 02/05/2017 05:28:55 AM (9 years ago)
- Location:
- advanced-custom-fields-recaptcha-field/trunk
- Files:
-
- 2 added
- 4 edited
-
README.md (modified) (2 diffs)
-
WP_requestmethod.php (added)
-
acf-recaptcha-v5.php (modified) (3 diffs)
-
acf-recaptcha.php (modified) (1 diff)
-
composer.json (added)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
advanced-custom-fields-recaptcha-field/trunk/README.md
r1534754 r1589192 17 17 18 18 ### Installation and Usage 19 20 This plugin requires cURL to be enabled on your server, as it makes use of Google's [PHP library](https://github.com/google/recaptcha).21 19 22 20 1. Copy the `acf-recaptcha` folder into your `wp-content/plugins` folder … … 47 45 ## About 48 46 49 Version 1.0. 447 Version 1.0.5 50 48 51 49 Written by Irvin Lim. If you encounter any issues, do open [one](https://github.com/irvinlim/acf-recaptcha/issues/new). 52 50 53 If you have any other questions, contact me [here](http://services.irvinlim.com/contact.php)! 51 If you have any other questions, contact me [here](https://irvinlim.com/contact/)! 52 53 ## Contributors 54 - **[Irvin Lim](https://irvinlim.com)**: Plugin author 55 - **[Sam Scholfield](https://github.com/samscholfield)**: Bugfix ([#4](https://github.com/irvinlim/acf-recaptcha/pull/4)) 56 - **[Matteo Tagliatti](https://github.com/puntonero)**: Added more render parameters ([#5](https://github.com/irvinlim/acf-recaptcha/pull/5)) 57 - **[Ramon Fincken](https://github.com/ramonfincken)**: `wp_remote_post` support added (v1.0.5) -
advanced-custom-fields-recaptcha-field/trunk/acf-recaptcha-v5.php
r1534754 r1589192 1 1 <?php 2 2 3 require("lib/autoload.php"); 3 require("lib/autoload.php"); // External libraries/vendors 4 require('WP_requestmethod.php'); // Our library 4 5 5 6 class acf_field_recaptcha extends acf_field { … … 59 60 60 61 // do not delete! 61 parent::__construct();62 parent::__construct(); 62 63 63 64 } … … 232 233 * @return $valid 233 234 */ 234 235 236 237 235 function validate_value( $valid, $value, $field, $input ){ 238 236 if (!strlen($value)) 239 237 return false; 240 238 241 $api = new \ReCaptcha\ReCaptcha($field['secret_key'] );239 $api = new \ReCaptcha\ReCaptcha($field['secret_key'], new \ReCaptcha\RequestMethod\WP_remote()); 242 240 $response = $api->verify($value, $_SERVER['REMOTE_ADDR']); 243 241 244 if ( $response->isSuccess() ) 245 return $valid; 246 247 $errors = $response->getErrorCodes(); 248 249 if ( empty( $errors ) ) 250 return $valid; 251 252 $valid = 'Invalid reCaptcha value ' . $value . ' response isSuccess(): ' . ( $response->isSuccess() ? 'true' : 'false' ) . ' errors: ' . json_encode($errors); 253 254 return $valid; 242 if ( $response->isSuccess() ) 243 return $valid; 244 245 $errors = $response->getErrorCodes(); 246 247 if ( empty( $errors ) ) 248 return $valid; 249 250 $valid = 'Invalid reCaptcha value ' . $value . ' response isSuccess(): ' . ( $response->isSuccess() ? 'true' : 'false' ) . ' errors: ' . json_encode($errors); 251 return $valid; 255 252 } 256 253 -
advanced-custom-fields-recaptcha-field/trunk/acf-recaptcha.php
r1534754 r1589192 5 5 Plugin URI: https://github.com/irvinlim/acf-recaptcha/ 6 6 Description: Google reCAPTCHA Field for Advanced Custom Fields. See <a href="https://www.google.com/recaptcha/">https://www.google.com/recaptcha/</a> for an account. 7 Version: 1.0. 47 Version: 1.0.5 8 8 Author: Irvin Lim 9 9 Author URI: http://irvinlim.com -
advanced-custom-fields-recaptcha-field/trunk/readme.txt
r1534754 r1589192 5 5 Requires at least: 3.0.1 6 6 Tested up to: 4.6.1 7 Stable tag: 1.0. 47 Stable tag: 1.0.5 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 16 16 You can find more information on Google's No-CAPTCHA reCAPTCHA [here](https://www.google.com/recaptcha/intro/index.html). 17 17 18 Requires cURL to be enabled on your server.18 This plugin does not require cURL to be enabled on your server (from version 1.0.5 onwards). 19 19 20 20 = Compatibility = … … 40 40 41 41 == Changelog == 42 = 1.0.5 = 43 * Uses `wp_remote_post` method for the reCAPTCHA POST request. This removes the need for cURL on your server. 44 42 45 = 1.0.4 = 43 46 * Fix WSOD errors
Note: See TracChangeset
for help on using the changeset viewer.