Plugin Directory

Changeset 1589192


Ignore:
Timestamp:
02/05/2017 05:28:55 AM (9 years ago)
Author:
irvinlim
Message:

Preparing for 1.0.5 release

Location:
advanced-custom-fields-recaptcha-field/trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • advanced-custom-fields-recaptcha-field/trunk/README.md

    r1534754 r1589192  
    1717
    1818### 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).
    2119
    22201. Copy the `acf-recaptcha` folder into your `wp-content/plugins` folder
     
    4745## About
    4846
    49 Version 1.0.4
     47Version 1.0.5
    5048
    5149Written by Irvin Lim. If you encounter any issues, do open [one](https://github.com/irvinlim/acf-recaptcha/issues/new).
    5250
    53 If you have any other questions, contact me [here](http://services.irvinlim.com/contact.php)!
     51If 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  
    11<?php
    22
    3 require("lib/autoload.php");
     3require("lib/autoload.php"); // External libraries/vendors
     4require('WP_requestmethod.php'); // Our library
    45
    56class acf_field_recaptcha extends acf_field {
     
    5960               
    6061        // do not delete!
    61         parent::__construct();
     62            parent::__construct();
    6263       
    6364    }
     
    232233    *  @return  $valid
    233234    */
    234    
    235    
    236    
    237235    function validate_value( $valid, $value, $field, $input ){
    238236        if (!strlen($value))
    239237            return false;
    240238
    241         $api = new \ReCaptcha\ReCaptcha($field['secret_key']);
     239        $api = new \ReCaptcha\ReCaptcha($field['secret_key'], new \ReCaptcha\RequestMethod\WP_remote());
    242240        $response = $api->verify($value, $_SERVER['REMOTE_ADDR']);
    243241     
    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;
    255252    }
    256253   
  • advanced-custom-fields-recaptcha-field/trunk/acf-recaptcha.php

    r1534754 r1589192  
    55Plugin URI: https://github.com/irvinlim/acf-recaptcha/
    66Description: 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.4
     7Version: 1.0.5
    88Author: Irvin Lim
    99Author URI: http://irvinlim.com
  • advanced-custom-fields-recaptcha-field/trunk/readme.txt

    r1534754 r1589192  
    55Requires at least: 3.0.1
    66Tested up to: 4.6.1
    7 Stable tag: 1.0.4
     7Stable tag: 1.0.5
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1616You can find more information on Google's No-CAPTCHA reCAPTCHA [here](https://www.google.com/recaptcha/intro/index.html).
    1717
    18 Requires cURL to be enabled on your server.
     18This plugin does not require cURL to be enabled on your server (from version 1.0.5 onwards).
    1919
    2020= Compatibility =
     
    4040
    4141== 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
    4245= 1.0.4 =
    4346* Fix WSOD errors
Note: See TracChangeset for help on using the changeset viewer.