Plugin Directory

Changeset 3080455


Ignore:
Timestamp:
05/02/2024 02:18:50 PM (22 months ago)
Author:
adcaptcha
Message:

Update to version 1.2.0 from GitHub

Location:
adcaptcha
Files:
24 added
32 edited
1 copied

Legend:

Unmodified
Added
Removed
  • adcaptcha/tags/1.2.0/adcaptcha.php

    r3077493 r3080455  
    33 * Plugin Name: adCAPTCHA for WordPress
    44 * Description: Secure your site. Elevate your brand. Boost Ad Revenue.
    5  * Version: 1.1.3
     5 * Version: 1.2.0
    66 * Requires at least: 6.4.2
    77 * Requires PHP: 7.4
     
    2323require_once plugin_dir_path(__FILE__) . 'src/Settings/General.php';
    2424require_once plugin_dir_path(__FILE__) . 'src/Settings/Plugins.php';
     25require_once plugin_dir_path(__FILE__) . 'src/Plugin/AdCaptchaPlugin.php';
    2526require_once plugin_dir_path(__FILE__) . 'src/Plugin/Login.php';
    2627require_once plugin_dir_path(__FILE__) . 'src/Plugin/Registration.php';
     
    3435require_once plugin_dir_path(__FILE__) . 'src/Plugin/ContactForm7/Forms.php';
    3536require_once plugin_dir_path(__FILE__) . 'src/Plugin/Mailchimp/Forms.php';
     37require_once plugin_dir_path(__FILE__) . 'src/Plugin/NinjaForms/Forms.php';
     38require_once plugin_dir_path(__FILE__) . 'src/Plugin/WPForms/Forms.php';
    3639
    3740use AdCaptcha\Instantiate;
    3841
    39 const PLUGIN_VERSION = '1.0.1';
     42const PLUGIN_VERSION_ADCAPTCHA = '1.2.0';
     43define('ADCAPTCHA_ERROR_MESSAGE', __( 'Please complete the I am human box.', 'adcaptcha' ));
    4044
    4145// Deletes data saved in the wp db on plugin uninstall
     
    4549    delete_option( 'adcaptcha_api_key' );
    4650    delete_option( 'adcaptcha_placement_id' );
    47     delete_option( 'adcaptcha_success_token' );
    4851    delete_option( 'adcaptcha_render_captcha' );
    4952    delete_option( 'adcaptcha_selected_plugins' );
  • adcaptcha/tags/1.2.0/readme.txt

    r3077493 r3080455  
    44Tags: spam, anti-spam, block bots, security, adCAPTCHA
    55Requires at least: 6.0
    6 Tested up to: 6.4
    7 Stable tag: 1.1.3
     6Tested up to: 6.5.2
     7Stable tag: 1.2.0
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    101101= 1.1.3 =
    102102- Minor patch: Fix to cf7 error message
     103
     104= 1.2.0 =
     105- Feature: Support for Ninja Forms
     106- Feature: Support for WPForms
     107- Test: WordPress v6.5.2
  • adcaptcha/tags/1.2.0/src/Instantiate.php

    r3064464 r3080455  
    1313use AdCaptcha\Plugin\ContactFrom7\Froms\Forms as ContactForm7;
    1414use AdCaptcha\Plugin\Mailchimp\Froms\Forms as MailchimpForms;
     15use AdCaptcha\Plugin\NinjaForms\Froms\Forms as NinjaForms;
     16use AdCaptcha\Plugin\WPForms\Froms\Forms as WPForms;
    1517
    1618class Instantiate {
    1719
    1820    public function setup() {
    19         $classes = array(
    20             'Wordpress_Login' => new Login(),
    21             'Wordpress_Register' => new Registration(),
    22             'Wordpress_ForgotPassword' => new PasswordReset(),
    23             'Wordpress_Comments' => new Comments(),
    24             'Woocommerce_Login' => new WoocommerceLogin(),
    25             'Woocommerce_ForgotPassword' => new WoocommercePasswordReset(),
    26             'Woocommerce_Register' => new WoocommerceRegistration(),
    27             'ContactForm7_Forms' => new ContactForm7(),
    28             'Mailchimp_Forms' => new MailchimpForms(),
    29         );
     21
     22        if ( ! function_exists( 'is_plugin_active' ) ) {
     23            require_once ABSPATH . 'wp-admin/includes/plugin.php';
     24        }
     25       
     26        $classes = [
     27            'Wordpress_Login' => [
     28                'instance' => Login::class,
     29                'plugin' => [],
     30            ],
     31            'Wordpress_Register' => [
     32                'instance' => Registration::class,
     33                'plugin' => [],
     34            ],
     35            'Wordpress_ForgotPassword' => [
     36                'instance' => PasswordReset::class,
     37                'plugin' => [],
     38            ],
     39            'Wordpress_Comments' => [
     40                'instance' => Comments::class,
     41                'plugin' => [],
     42            ],
     43            'Woocommerce_Login' => [
     44                'instance' => WoocommerceLogin::class,
     45                'plugin' => [ 'woocommerce/woocommerce.php' ],
     46            ],
     47            'Woocommerce_ForgotPassword' => [
     48                'instance' => WoocommercePasswordReset::class,
     49                'plugin' => [ 'woocommerce/woocommerce.php' ],
     50            ],
     51            'Woocommerce_Register' => [
     52                'instance' => WoocommerceRegistration::class,
     53                'plugin' => [ 'woocommerce/woocommerce.php' ],
     54            ],
     55            'ContactForm7_Forms' => [
     56                'instance' => ContactForm7::class,
     57                'plugin' => [ 'contact-form-7/wp-contact-form-7.php' ],
     58            ],
     59            'Mailchimp_Forms' => [
     60                'instance' => MailchimpForms::class,
     61                'plugin' => [ 'mailchimp-for-wp/mailchimp-for-wp.php' ],
     62            ],
     63            'NinjaForms_Forms' => [
     64                'instance' => NinjaForms::class,
     65                'plugin' => [ 'ninja-forms/ninja-forms.php' ],
     66            ],
     67            'WPForms_Forms' => [
     68                'instance' => WPForms::class,
     69                'plugin' => [ 'wpforms-lite/wpforms.php', 'wpforms/wpforms.php' ],
     70            ],
     71        ];
    3072
    3173        $selected_plugins = get_option('adcaptcha_selected_plugins') ? get_option('adcaptcha_selected_plugins') : array();
     
    3779            foreach ($selected_plugins as $selected_plugin) {
    3880                if (isset($classes[$selected_plugin])) {
    39                     $classes[$selected_plugin]->setup();
     81                    $className = $classes[$selected_plugin]['instance'];
     82                    if (empty($classes[$selected_plugin]['plugin'])) {
     83                        new $className();
     84                    } else {
     85                        foreach ($classes[$selected_plugin]['plugin'] as $plugin) {
     86                            if (is_plugin_active($plugin)) {
     87                                $className = $classes[$selected_plugin]['instance'];
     88                                new $className();
     89                            }
     90                        }
     91                    }
    4092                }
    4193            }
  • adcaptcha/tags/1.2.0/src/Plugin/Comments.php

    r3060548 r3080455  
    55use AdCaptcha\Widget\AdCaptcha\AdCaptcha;
    66use AdCaptcha\Widget\Verify\Verify;
     7use AdCaptcha\AdCaptchaPlugin\AdCaptchaPlugin;
    78use WP_Error;
    89
    9 class Comments {
     10class Comments extends AdCaptchaPlugin {
    1011
    1112    public function setup() {
    1213        add_action( 'comment_form', [ AdCaptcha::class, 'enqueue_scripts' ] );
     14        add_action( 'comment_form', [ Verify::class, 'get_success_token' ] );
    1315        add_filter( 'comment_form_submit_field', [ $this, 'captcha_trigger_filter' ] );
    1416        add_action( 'pre_comment_approved', [ $this, 'verify' ], 20, 2 );
     
    1618
    1719    public function verify( $approved, array $commentdata ) {
     20        $successToken = sanitize_text_field(wp_unslash($_POST['adcaptcha_successToken']));
    1821        $verify = new Verify();
    19         $response = $verify->verify_token();
     22        $response = $verify->verify_token($successToken);
    2023
    2124
  • adcaptcha/tags/1.2.0/src/Plugin/ContactForm7/Forms.php

    r3077493 r3080455  
    55use AdCaptcha\Widget\AdCaptcha\AdCaptcha;
    66use AdCaptcha\Widget\Verify\Verify;
     7use AdCaptcha\AdCaptchaPlugin\AdCaptchaPlugin;
    78
    8 class Forms {
     9class Forms extends AdCaptchaPlugin {
    910
    1011    public function setup() {
  • adcaptcha/tags/1.2.0/src/Plugin/Login.php

    r3060548 r3080455  
    55use AdCaptcha\Widget\AdCaptcha\AdCaptcha;
    66use AdCaptcha\Widget\Verify\Verify;
     7use AdCaptcha\AdCaptchaPlugin\AdCaptchaPlugin;
    78use WP_Error;
    89
    9 class Login {
     10class Login extends AdCaptchaPlugin {
    1011
    1112    public function setup() {
     
    1617            AdCaptcha::enqueue_scripts($enableSubmitButtonScript);
    1718        });
     19        add_action( 'login_enqueue_scripts', [ Verify::class, 'get_success_token' ] );
    1820        add_action( 'login_enqueue_scripts', [ $this, 'disable_safari_auto_submit' ] );
    1921        add_action( 'login_form', [ AdCaptcha::class, 'captcha_trigger' ] );
     
    2224
    2325    public function verify( $errors ) {
     26        $successToken = sanitize_text_field(wp_unslash($_POST['adcaptcha_successToken']));
    2427        $verify = new Verify();
    25         $response = $verify->verify_token();
     28        $response = $verify->verify_token($successToken);
    2629
    2730        if ( $response === false ) {
  • adcaptcha/tags/1.2.0/src/Plugin/Mailchimp/Forms.php

    r3060548 r3080455  
    55use AdCaptcha\Widget\AdCaptcha\AdCaptcha;
    66use AdCaptcha\Widget\Verify\Verify;
     7use AdCaptcha\AdCaptchaPlugin\AdCaptchaPlugin;
    78
    89use MC4WP_Form;
     10use MC4WP_Form_Element;
    911
    10 class Forms {
     12class Forms extends AdCaptchaPlugin {
    1113
    1214    public function setup() {
    1315        add_action( 'wp_enqueue_scripts', [ AdCaptcha::class, 'enqueue_scripts' ], 9 );
     16        add_action( 'wp_enqueue_scripts', [ Verify::class, 'get_success_token' ] );
     17        add_action( 'wp_enqueue_scripts', [ $this, 'block_submission' ], 9 );
     18        add_filter( 'mc4wp_form_content', [ $this, 'add_hidden_input' ], 20, 3 );
    1419        add_action( 'admin_enqueue_scripts', [ $this, 'form_preview_setup_triggers' ], 9 );
    1520        add_filter( 'mc4wp_form_errors', [ $this, 'verify' ], 10, 2 );
     
    1823            $messages['invalid_captcha'] = [
    1924                'type' => 'error',
    20                 'text' => __( 'Incomplete captcha, Please try again.', 'adCAPTCHA' ),
     25                'text' => ADCAPTCHA_ERROR_MESSAGE,
    2126            ];
    2227            return $messages;
     
    2429    }
    2530
     31    public function add_hidden_input( string $content, MC4WP_Form $form, MC4WP_Form_Element $element ): string {
     32        return preg_replace(
     33            '/(<(input|button).*?type=(["\']?)submit(["\']?))/',
     34            '<input type="hidden" class="adcaptcha_successToken" name="adcaptcha_successToken">' . '$1',
     35            $content
     36        );
     37    }
     38
    2639    public function verify( $errors, MC4WP_Form $form ) {
     40        $successToken = sanitize_text_field(wp_unslash($_POST['adcaptcha_successToken']));
    2741        $verify = new Verify();
    28         $response = $verify->verify_token();
     42        $response = $verify->verify_token($successToken);
    2943
    3044        if ( $response === false ) {
     
    3448
    3549        return  $errors;
     50    }
     51
     52    public function block_submission() {
     53        $script = '
     54            document.addEventListener("DOMContentLoaded", function() {
     55                var form = document.querySelector(".mc4wp-form");
     56                if (form) {
     57                    var submitButton =[... document.querySelectorAll("[type=\'submit\']")];
     58                    if (submitButton) {
     59                        submitButton.forEach(function(submitButton) {
     60                            submitButton.addEventListener("click", function(event) {
     61                                if (!window.adcap || !window.adcap.successToken) {
     62                                    event.preventDefault();
     63                                    var responseDiv = document.querySelector(".mc4wp-response");
     64                                    responseDiv.innerHTML = \'<div class="mc4wp-alert mc4wp-error" role="alert"><p>\' + adCaptchaErrorMessage + \'</p></div>\';
     65                                    return false;
     66                                }
     67                            });
     68                        });
     69                    }
     70                }
     71            });';
     72
     73        wp_register_script('adcaptcha-script', '', [], false, true);
     74        wp_localize_script('adcaptcha-script', 'adCaptchaErrorMessage', array(ADCAPTCHA_ERROR_MESSAGE));
     75        wp_add_inline_script('adcaptcha-script', $script);
    3676    }
    3777
  • adcaptcha/tags/1.2.0/src/Plugin/PasswordReset.php

    r3060548 r3080455  
    55use AdCaptcha\Widget\AdCaptcha\AdCaptcha;
    66use AdCaptcha\Widget\Verify\Verify;
     7use AdCaptcha\AdCaptchaPlugin\AdCaptchaPlugin;
    78use WP_Error;
    89
    9 class PasswordReset {
     10class PasswordReset extends AdCaptchaPlugin {
    1011
    1112    public function setup() {
     
    1314        $adCAPTCHAWordpressPasswordReset = $this;
    1415        add_action( 'lostpassword_form', [ AdCaptcha::class, 'enqueue_scripts' ] );
     16        add_action( 'lostpassword_form', [ Verify::class, 'get_success_token' ] );
    1517        add_action( 'lostpassword_form', [ AdCaptcha::class, 'captcha_trigger' ] );
    1618        add_action( 'lostpassword_post', [ $adCAPTCHAWordpressPasswordReset, 'verify' ], 10, 1 );
     
    1820
    1921    public function verify( $errors ) {
    20         $response = Verify::verify_token();
     22        $successToken = sanitize_text_field(wp_unslash($_POST['adcaptcha_successToken']));
     23        $verify = new Verify();
     24        $response = $verify->verify_token($successToken);
    2125
    2226        if ( !$response ) {
  • adcaptcha/tags/1.2.0/src/Plugin/Registration.php

    r3060548 r3080455  
    55use AdCaptcha\Widget\AdCaptcha\AdCaptcha;
    66use AdCaptcha\Widget\Verify\Verify;
     7use AdCaptcha\AdCaptchaPlugin\AdCaptchaPlugin;
    78use WP_Error;
    89
    9 class Registration {
     10class Registration extends AdCaptchaPlugin {
    1011
    1112    public function setup() {
     
    1314        $adCAPTCHAWordpressRegistration = $this;
    1415        add_action( 'register_form', [ AdCaptcha::class, 'enqueue_scripts' ] );
     16        add_action( 'register_form', [ Verify::class, 'get_success_token' ] );
    1517        add_action( 'register_form', [ AdCaptcha::class, 'captcha_trigger' ] );
    1618        add_action( 'registration_errors', [ $adCAPTCHAWordpressRegistration, 'verify' ], 10, 1 );
     
    1820
    1921    public function verify( $errors ) {
     22        $successToken = sanitize_text_field(wp_unslash($_POST['adcaptcha_successToken']));
    2023        $verify = new Verify();
    21         $response = $verify->verify_token();
     24        $response = $verify->verify_token($successToken);
    2225
    2326
  • adcaptcha/tags/1.2.0/src/Plugin/Woocommerce/Login.php

    r3060548 r3080455  
    55use AdCaptcha\Widget\AdCaptcha\AdCaptcha;
    66use AdCaptcha\Widget\Verify\Verify;
     7use AdCaptcha\AdCaptchaPlugin\AdCaptchaPlugin;
    78use WP_Error;
    89
    9 class Login {
     10class Login extends AdCaptchaPlugin {
    1011
    1112    public function setup() {
    1213        add_action( 'woocommerce_login_form', [ AdCaptcha::class, 'enqueue_scripts' ] );
     14        add_action( 'woocommerce_login_form', [ Verify::class, 'get_success_token' ] );
    1315        add_action( 'woocommerce_login_form', [ AdCaptcha::class, 'captcha_trigger' ] );
    1416        add_filter( 'woocommerce_process_login_errors', [ $this, 'verify' ], 10, 3 );
     
    1820        global $adCAPTCHAWordpressLogin;
    1921        remove_action( 'wp_authenticate_user', [ $adCAPTCHAWordpressLogin, 'verify' ], 10 );
    20         $response = Verify::verify_token();
     22        $successToken = sanitize_text_field(wp_unslash($_POST['adcaptcha_successToken']));
     23        $response = Verify::verify_token($successToken);
    2124
    2225        if ( $response === false ) {
  • adcaptcha/tags/1.2.0/src/Plugin/Woocommerce/PasswordReset.php

    r3060548 r3080455  
    55use AdCaptcha\Widget\AdCaptcha\AdCaptcha;
    66use AdCaptcha\Widget\Verify\Verify;
     7use AdCaptcha\AdCaptchaPlugin\AdCaptchaPlugin;
    78use WP_Error;
    89
    9 class PasswordReset {
     10class PasswordReset extends AdCaptchaPlugin {
    1011
    1112    public function setup() {
    1213        add_action( 'woocommerce_lostpassword_form', [ AdCaptcha::class, 'enqueue_scripts' ] );
     14        add_action( 'woocommerce_lostpassword_form', [ Verify::class, 'get_success_token' ] );
    1315        add_action( 'woocommerce_lostpassword_form', [ AdCaptcha::class, 'captcha_trigger' ] );
    1416        add_action( 'wp_loaded', [ $this, 'remove_wp_action' ], 10 );
     
    2224
    2325    public function verify( $error ) {
    24         $response = Verify::verify_token();
     26        $successToken = sanitize_text_field(wp_unslash($_POST['adcaptcha_successToken']));
     27        $response = Verify::verify_token($successToken);
    2528
    2629        if ( !$response ) {
  • adcaptcha/tags/1.2.0/src/Plugin/Woocommerce/Registration.php

    r3060548 r3080455  
    55use AdCaptcha\Widget\AdCaptcha\AdCaptcha;
    66use AdCaptcha\Widget\Verify\Verify;
     7use AdCaptcha\AdCaptchaPlugin\AdCaptchaPlugin;
    78use WP_Error;
    89
    9 class Registration {
     10class Registration extends AdCaptchaPlugin {
    1011
    1112    public function setup() {
    1213        add_action( 'woocommerce_register_form', [ AdCaptcha::class, 'enqueue_scripts' ] );
     14        add_action( 'woocommerce_register_form', [ Verify::class, 'get_success_token' ] );
    1315        add_action( 'woocommerce_register_form', [ AdCaptcha::class, 'captcha_trigger' ] );
    1416        add_filter( 'woocommerce_registration_errors', [ $this, 'verify' ], 10, 3 );
     
    1820        global $adCAPTCHAWordpressRegistration;
    1921        remove_action( 'registration_errors', [ $adCAPTCHAWordpressRegistration, 'verify' ], 10 );
    20         $response = Verify::verify_token();
     22        $successToken = sanitize_text_field(wp_unslash($_POST['adcaptcha_successToken']));
     23        $response = Verify::verify_token($successToken);
    2124
    2225        if ( !$response ) {
  • adcaptcha/tags/1.2.0/src/Settings/Plugins.php

    r3064464 r3080455  
    2525                'label' => 'Mailchimp',
    2626                'logo' => 'mailchimp_logo.png',
     27                'options' => array('Forms')
     28            ),
     29            array(
     30                'label' => 'NinjaForms',
     31                'logo' => 'ninjaForms_logo.png',
     32                'options' => array('Forms')
     33            ),
     34            array(
     35                'label' => 'WPForms',
     36                'logo' => 'wpforms_logo.png',
    2737                'options' => array('Forms')
    2838            ),
  • adcaptcha/tags/1.2.0/src/Settings/Settings.php

    r3077493 r3080455  
    2222
    2323    public function add_styles_to_settings() {
    24         wp_enqueue_style('adcaptcha-admin-styles', plugins_url('../styles/settings.css', __FILE__), array(), PLUGIN_VERSION);
     24        wp_enqueue_style('adcaptcha-admin-styles', plugins_url('../styles/settings.css', __FILE__), array(), PLUGIN_VERSION_ADCAPTCHA);
    2525    }
    2626     
     
    7171
    7272    public function change_admin_footer_version() {
    73         return 'Version 1.1.3';
     73        return 'Version 1.2.0';
    7474    }
    7575}
  • adcaptcha/tags/1.2.0/src/Widget/AdCaptcha.php

    r3077129 r3080455  
    66
    77    public static function enqueue_scripts($enableSubmitButton = false) {
    8         wp_enqueue_script('adcaptcha-script', 'https://widget.adcaptcha.com/index.js', array('jquery'), PLUGIN_VERSION, true);
     8        wp_enqueue_script('adcaptcha-script', 'https://widget.adcaptcha.com/index.js', array('jquery'), PLUGIN_VERSION_ADCAPTCHA, true);
    99   
    1010        $ajax_nonce = wp_create_nonce("adcaptcha_nonce");
     
    2020        }');
    2121    }
    22    
     22
    2323    public static function setupScript($enableSubmitButton = false) {
    2424        return 'window.adcap.init();
    2525        window.adcap.setupTriggers({
    2626            onComplete: () => {
    27                 jQuery.ajax({
    28                     url: adcaptcha_vars.ajax_url,
    29                     type: "POST",
    30                     data: {
    31                         action: "save_token",
    32                         successToken: window.adcap.successToken,
    33                         nonce: adcaptcha_vars.nonce,
    34                     }
    35                 });
    3627                ' . ($enableSubmitButton ? self::enable_submit_button() : '') . '
    3728                const event = new CustomEvent("adcaptcha_onSuccess", {
     
    5849
    5950    public static function captcha_trigger() {
    60         printf('<div data-adcaptcha="' . esc_attr(get_option('adcaptcha_placement_id')) . '" style="margin-bottom: 20px; max-width: 400px;"></div>');
     51        printf('<div data-adcaptcha="' . esc_attr(get_option('adcaptcha_placement_id')) . '" style="margin-bottom: 20px; max-width: 400px; outline: none !important;"></div><input type="hidden" class="adcaptcha_successToken" name="adcaptcha_successToken">');
    6152    }
    6253}
  • adcaptcha/tags/1.2.0/src/Widget/Verify.php

    r3077129 r3080455  
    44
    55class Verify {
     6    public static function verify_token($successToken) {
     7        $apiKey = get_option('adcaptcha_api_key');
    68
    7     // The actions are triggered after a post request is sent with action save_token
    8     public static function init() {
    9         add_action('wp_ajax_save_token', array(__CLASS__, 'save_token'));
    10         add_action('wp_ajax_nopriv_save_token', array(__CLASS__, 'save_token'));
    11     }
    12 
    13     // Gets the successToken from the captcha trigger post request
    14     public static function save_token() {
    15         check_ajax_referer('adcaptcha_nonce', 'nonce');
    16         $successToken = sanitize_text_field(wp_unslash($_POST['successToken']));
    17         if (isset($successToken)) {
    18             update_option('adcaptcha_success_token', $successToken);
    19             wp_send_json_success('Success');
    20         } else {
    21             wp_send_json_success('Failed');
    22         }
    23     }
    24 
    25     public static function verify_token($successToken = null) {
    26         if (empty($successToken)) {
    27             $successToken = get_option('adcaptcha_success_token');
     9        if (!$successToken || !$apiKey) {
     10            return false;
    2811        }
    2912
    30         $apiKey = get_option('adcaptcha_api_key');
    3113        $url = 'https://api.adcaptcha.com/v1/verify';
    3214        $body = wp_json_encode([
     
    4426
    4527        if (is_wp_error($response)) {
    46             update_option('adcaptcha_success_token', '');
    4728            return false;
    4829        }
     
    5132        $message = json_decode($body);
    5233        if ($message && $message->message === 'Token verified') {
    53             update_option('adcaptcha_success_token', '');
    5434            return true;
    5535        }
     
    5737        return false;
    5838    }
     39
     40    public function get_success_token() {
     41        $script = '
     42        document.addEventListener("DOMContentLoaded", function() {
     43            document.addEventListener("adcaptcha_onSuccess", function(e) {
     44                var elements = document.querySelectorAll(".adcaptcha_successToken");
     45                elements.forEach(function(element) {
     46                    element.value = e.detail.successToken;
     47                });
     48            });
     49        });';
     50   
     51        wp_add_inline_script( 'adcaptcha-script', $script );
     52    }
    5953}
    60 
    61 Verify::init();
  • adcaptcha/trunk/adcaptcha.php

    r3077493 r3080455  
    33 * Plugin Name: adCAPTCHA for WordPress
    44 * Description: Secure your site. Elevate your brand. Boost Ad Revenue.
    5  * Version: 1.1.3
     5 * Version: 1.2.0
    66 * Requires at least: 6.4.2
    77 * Requires PHP: 7.4
     
    2323require_once plugin_dir_path(__FILE__) . 'src/Settings/General.php';
    2424require_once plugin_dir_path(__FILE__) . 'src/Settings/Plugins.php';
     25require_once plugin_dir_path(__FILE__) . 'src/Plugin/AdCaptchaPlugin.php';
    2526require_once plugin_dir_path(__FILE__) . 'src/Plugin/Login.php';
    2627require_once plugin_dir_path(__FILE__) . 'src/Plugin/Registration.php';
     
    3435require_once plugin_dir_path(__FILE__) . 'src/Plugin/ContactForm7/Forms.php';
    3536require_once plugin_dir_path(__FILE__) . 'src/Plugin/Mailchimp/Forms.php';
     37require_once plugin_dir_path(__FILE__) . 'src/Plugin/NinjaForms/Forms.php';
     38require_once plugin_dir_path(__FILE__) . 'src/Plugin/WPForms/Forms.php';
    3639
    3740use AdCaptcha\Instantiate;
    3841
    39 const PLUGIN_VERSION = '1.0.1';
     42const PLUGIN_VERSION_ADCAPTCHA = '1.2.0';
     43define('ADCAPTCHA_ERROR_MESSAGE', __( 'Please complete the I am human box.', 'adcaptcha' ));
    4044
    4145// Deletes data saved in the wp db on plugin uninstall
     
    4549    delete_option( 'adcaptcha_api_key' );
    4650    delete_option( 'adcaptcha_placement_id' );
    47     delete_option( 'adcaptcha_success_token' );
    4851    delete_option( 'adcaptcha_render_captcha' );
    4952    delete_option( 'adcaptcha_selected_plugins' );
  • adcaptcha/trunk/readme.txt

    r3077493 r3080455  
    44Tags: spam, anti-spam, block bots, security, adCAPTCHA
    55Requires at least: 6.0
    6 Tested up to: 6.4
    7 Stable tag: 1.1.3
     6Tested up to: 6.5.2
     7Stable tag: 1.2.0
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    101101= 1.1.3 =
    102102- Minor patch: Fix to cf7 error message
     103
     104= 1.2.0 =
     105- Feature: Support for Ninja Forms
     106- Feature: Support for WPForms
     107- Test: WordPress v6.5.2
  • adcaptcha/trunk/src/Instantiate.php

    r3064464 r3080455  
    1313use AdCaptcha\Plugin\ContactFrom7\Froms\Forms as ContactForm7;
    1414use AdCaptcha\Plugin\Mailchimp\Froms\Forms as MailchimpForms;
     15use AdCaptcha\Plugin\NinjaForms\Froms\Forms as NinjaForms;
     16use AdCaptcha\Plugin\WPForms\Froms\Forms as WPForms;
    1517
    1618class Instantiate {
    1719
    1820    public function setup() {
    19         $classes = array(
    20             'Wordpress_Login' => new Login(),
    21             'Wordpress_Register' => new Registration(),
    22             'Wordpress_ForgotPassword' => new PasswordReset(),
    23             'Wordpress_Comments' => new Comments(),
    24             'Woocommerce_Login' => new WoocommerceLogin(),
    25             'Woocommerce_ForgotPassword' => new WoocommercePasswordReset(),
    26             'Woocommerce_Register' => new WoocommerceRegistration(),
    27             'ContactForm7_Forms' => new ContactForm7(),
    28             'Mailchimp_Forms' => new MailchimpForms(),
    29         );
     21
     22        if ( ! function_exists( 'is_plugin_active' ) ) {
     23            require_once ABSPATH . 'wp-admin/includes/plugin.php';
     24        }
     25       
     26        $classes = [
     27            'Wordpress_Login' => [
     28                'instance' => Login::class,
     29                'plugin' => [],
     30            ],
     31            'Wordpress_Register' => [
     32                'instance' => Registration::class,
     33                'plugin' => [],
     34            ],
     35            'Wordpress_ForgotPassword' => [
     36                'instance' => PasswordReset::class,
     37                'plugin' => [],
     38            ],
     39            'Wordpress_Comments' => [
     40                'instance' => Comments::class,
     41                'plugin' => [],
     42            ],
     43            'Woocommerce_Login' => [
     44                'instance' => WoocommerceLogin::class,
     45                'plugin' => [ 'woocommerce/woocommerce.php' ],
     46            ],
     47            'Woocommerce_ForgotPassword' => [
     48                'instance' => WoocommercePasswordReset::class,
     49                'plugin' => [ 'woocommerce/woocommerce.php' ],
     50            ],
     51            'Woocommerce_Register' => [
     52                'instance' => WoocommerceRegistration::class,
     53                'plugin' => [ 'woocommerce/woocommerce.php' ],
     54            ],
     55            'ContactForm7_Forms' => [
     56                'instance' => ContactForm7::class,
     57                'plugin' => [ 'contact-form-7/wp-contact-form-7.php' ],
     58            ],
     59            'Mailchimp_Forms' => [
     60                'instance' => MailchimpForms::class,
     61                'plugin' => [ 'mailchimp-for-wp/mailchimp-for-wp.php' ],
     62            ],
     63            'NinjaForms_Forms' => [
     64                'instance' => NinjaForms::class,
     65                'plugin' => [ 'ninja-forms/ninja-forms.php' ],
     66            ],
     67            'WPForms_Forms' => [
     68                'instance' => WPForms::class,
     69                'plugin' => [ 'wpforms-lite/wpforms.php', 'wpforms/wpforms.php' ],
     70            ],
     71        ];
    3072
    3173        $selected_plugins = get_option('adcaptcha_selected_plugins') ? get_option('adcaptcha_selected_plugins') : array();
     
    3779            foreach ($selected_plugins as $selected_plugin) {
    3880                if (isset($classes[$selected_plugin])) {
    39                     $classes[$selected_plugin]->setup();
     81                    $className = $classes[$selected_plugin]['instance'];
     82                    if (empty($classes[$selected_plugin]['plugin'])) {
     83                        new $className();
     84                    } else {
     85                        foreach ($classes[$selected_plugin]['plugin'] as $plugin) {
     86                            if (is_plugin_active($plugin)) {
     87                                $className = $classes[$selected_plugin]['instance'];
     88                                new $className();
     89                            }
     90                        }
     91                    }
    4092                }
    4193            }
  • adcaptcha/trunk/src/Plugin/Comments.php

    r3060548 r3080455  
    55use AdCaptcha\Widget\AdCaptcha\AdCaptcha;
    66use AdCaptcha\Widget\Verify\Verify;
     7use AdCaptcha\AdCaptchaPlugin\AdCaptchaPlugin;
    78use WP_Error;
    89
    9 class Comments {
     10class Comments extends AdCaptchaPlugin {
    1011
    1112    public function setup() {
    1213        add_action( 'comment_form', [ AdCaptcha::class, 'enqueue_scripts' ] );
     14        add_action( 'comment_form', [ Verify::class, 'get_success_token' ] );
    1315        add_filter( 'comment_form_submit_field', [ $this, 'captcha_trigger_filter' ] );
    1416        add_action( 'pre_comment_approved', [ $this, 'verify' ], 20, 2 );
     
    1618
    1719    public function verify( $approved, array $commentdata ) {
     20        $successToken = sanitize_text_field(wp_unslash($_POST['adcaptcha_successToken']));
    1821        $verify = new Verify();
    19         $response = $verify->verify_token();
     22        $response = $verify->verify_token($successToken);
    2023
    2124
  • adcaptcha/trunk/src/Plugin/ContactForm7/Forms.php

    r3077493 r3080455  
    55use AdCaptcha\Widget\AdCaptcha\AdCaptcha;
    66use AdCaptcha\Widget\Verify\Verify;
     7use AdCaptcha\AdCaptchaPlugin\AdCaptchaPlugin;
    78
    8 class Forms {
     9class Forms extends AdCaptchaPlugin {
    910
    1011    public function setup() {
  • adcaptcha/trunk/src/Plugin/Login.php

    r3060548 r3080455  
    55use AdCaptcha\Widget\AdCaptcha\AdCaptcha;
    66use AdCaptcha\Widget\Verify\Verify;
     7use AdCaptcha\AdCaptchaPlugin\AdCaptchaPlugin;
    78use WP_Error;
    89
    9 class Login {
     10class Login extends AdCaptchaPlugin {
    1011
    1112    public function setup() {
     
    1617            AdCaptcha::enqueue_scripts($enableSubmitButtonScript);
    1718        });
     19        add_action( 'login_enqueue_scripts', [ Verify::class, 'get_success_token' ] );
    1820        add_action( 'login_enqueue_scripts', [ $this, 'disable_safari_auto_submit' ] );
    1921        add_action( 'login_form', [ AdCaptcha::class, 'captcha_trigger' ] );
     
    2224
    2325    public function verify( $errors ) {
     26        $successToken = sanitize_text_field(wp_unslash($_POST['adcaptcha_successToken']));
    2427        $verify = new Verify();
    25         $response = $verify->verify_token();
     28        $response = $verify->verify_token($successToken);
    2629
    2730        if ( $response === false ) {
  • adcaptcha/trunk/src/Plugin/Mailchimp/Forms.php

    r3060548 r3080455  
    55use AdCaptcha\Widget\AdCaptcha\AdCaptcha;
    66use AdCaptcha\Widget\Verify\Verify;
     7use AdCaptcha\AdCaptchaPlugin\AdCaptchaPlugin;
    78
    89use MC4WP_Form;
     10use MC4WP_Form_Element;
    911
    10 class Forms {
     12class Forms extends AdCaptchaPlugin {
    1113
    1214    public function setup() {
    1315        add_action( 'wp_enqueue_scripts', [ AdCaptcha::class, 'enqueue_scripts' ], 9 );
     16        add_action( 'wp_enqueue_scripts', [ Verify::class, 'get_success_token' ] );
     17        add_action( 'wp_enqueue_scripts', [ $this, 'block_submission' ], 9 );
     18        add_filter( 'mc4wp_form_content', [ $this, 'add_hidden_input' ], 20, 3 );
    1419        add_action( 'admin_enqueue_scripts', [ $this, 'form_preview_setup_triggers' ], 9 );
    1520        add_filter( 'mc4wp_form_errors', [ $this, 'verify' ], 10, 2 );
     
    1823            $messages['invalid_captcha'] = [
    1924                'type' => 'error',
    20                 'text' => __( 'Incomplete captcha, Please try again.', 'adCAPTCHA' ),
     25                'text' => ADCAPTCHA_ERROR_MESSAGE,
    2126            ];
    2227            return $messages;
     
    2429    }
    2530
     31    public function add_hidden_input( string $content, MC4WP_Form $form, MC4WP_Form_Element $element ): string {
     32        return preg_replace(
     33            '/(<(input|button).*?type=(["\']?)submit(["\']?))/',
     34            '<input type="hidden" class="adcaptcha_successToken" name="adcaptcha_successToken">' . '$1',
     35            $content
     36        );
     37    }
     38
    2639    public function verify( $errors, MC4WP_Form $form ) {
     40        $successToken = sanitize_text_field(wp_unslash($_POST['adcaptcha_successToken']));
    2741        $verify = new Verify();
    28         $response = $verify->verify_token();
     42        $response = $verify->verify_token($successToken);
    2943
    3044        if ( $response === false ) {
     
    3448
    3549        return  $errors;
     50    }
     51
     52    public function block_submission() {
     53        $script = '
     54            document.addEventListener("DOMContentLoaded", function() {
     55                var form = document.querySelector(".mc4wp-form");
     56                if (form) {
     57                    var submitButton =[... document.querySelectorAll("[type=\'submit\']")];
     58                    if (submitButton) {
     59                        submitButton.forEach(function(submitButton) {
     60                            submitButton.addEventListener("click", function(event) {
     61                                if (!window.adcap || !window.adcap.successToken) {
     62                                    event.preventDefault();
     63                                    var responseDiv = document.querySelector(".mc4wp-response");
     64                                    responseDiv.innerHTML = \'<div class="mc4wp-alert mc4wp-error" role="alert"><p>\' + adCaptchaErrorMessage + \'</p></div>\';
     65                                    return false;
     66                                }
     67                            });
     68                        });
     69                    }
     70                }
     71            });';
     72
     73        wp_register_script('adcaptcha-script', '', [], false, true);
     74        wp_localize_script('adcaptcha-script', 'adCaptchaErrorMessage', array(ADCAPTCHA_ERROR_MESSAGE));
     75        wp_add_inline_script('adcaptcha-script', $script);
    3676    }
    3777
  • adcaptcha/trunk/src/Plugin/PasswordReset.php

    r3060548 r3080455  
    55use AdCaptcha\Widget\AdCaptcha\AdCaptcha;
    66use AdCaptcha\Widget\Verify\Verify;
     7use AdCaptcha\AdCaptchaPlugin\AdCaptchaPlugin;
    78use WP_Error;
    89
    9 class PasswordReset {
     10class PasswordReset extends AdCaptchaPlugin {
    1011
    1112    public function setup() {
     
    1314        $adCAPTCHAWordpressPasswordReset = $this;
    1415        add_action( 'lostpassword_form', [ AdCaptcha::class, 'enqueue_scripts' ] );
     16        add_action( 'lostpassword_form', [ Verify::class, 'get_success_token' ] );
    1517        add_action( 'lostpassword_form', [ AdCaptcha::class, 'captcha_trigger' ] );
    1618        add_action( 'lostpassword_post', [ $adCAPTCHAWordpressPasswordReset, 'verify' ], 10, 1 );
     
    1820
    1921    public function verify( $errors ) {
    20         $response = Verify::verify_token();
     22        $successToken = sanitize_text_field(wp_unslash($_POST['adcaptcha_successToken']));
     23        $verify = new Verify();
     24        $response = $verify->verify_token($successToken);
    2125
    2226        if ( !$response ) {
  • adcaptcha/trunk/src/Plugin/Registration.php

    r3060548 r3080455  
    55use AdCaptcha\Widget\AdCaptcha\AdCaptcha;
    66use AdCaptcha\Widget\Verify\Verify;
     7use AdCaptcha\AdCaptchaPlugin\AdCaptchaPlugin;
    78use WP_Error;
    89
    9 class Registration {
     10class Registration extends AdCaptchaPlugin {
    1011
    1112    public function setup() {
     
    1314        $adCAPTCHAWordpressRegistration = $this;
    1415        add_action( 'register_form', [ AdCaptcha::class, 'enqueue_scripts' ] );
     16        add_action( 'register_form', [ Verify::class, 'get_success_token' ] );
    1517        add_action( 'register_form', [ AdCaptcha::class, 'captcha_trigger' ] );
    1618        add_action( 'registration_errors', [ $adCAPTCHAWordpressRegistration, 'verify' ], 10, 1 );
     
    1820
    1921    public function verify( $errors ) {
     22        $successToken = sanitize_text_field(wp_unslash($_POST['adcaptcha_successToken']));
    2023        $verify = new Verify();
    21         $response = $verify->verify_token();
     24        $response = $verify->verify_token($successToken);
    2225
    2326
  • adcaptcha/trunk/src/Plugin/Woocommerce/Login.php

    r3060548 r3080455  
    55use AdCaptcha\Widget\AdCaptcha\AdCaptcha;
    66use AdCaptcha\Widget\Verify\Verify;
     7use AdCaptcha\AdCaptchaPlugin\AdCaptchaPlugin;
    78use WP_Error;
    89
    9 class Login {
     10class Login extends AdCaptchaPlugin {
    1011
    1112    public function setup() {
    1213        add_action( 'woocommerce_login_form', [ AdCaptcha::class, 'enqueue_scripts' ] );
     14        add_action( 'woocommerce_login_form', [ Verify::class, 'get_success_token' ] );
    1315        add_action( 'woocommerce_login_form', [ AdCaptcha::class, 'captcha_trigger' ] );
    1416        add_filter( 'woocommerce_process_login_errors', [ $this, 'verify' ], 10, 3 );
     
    1820        global $adCAPTCHAWordpressLogin;
    1921        remove_action( 'wp_authenticate_user', [ $adCAPTCHAWordpressLogin, 'verify' ], 10 );
    20         $response = Verify::verify_token();
     22        $successToken = sanitize_text_field(wp_unslash($_POST['adcaptcha_successToken']));
     23        $response = Verify::verify_token($successToken);
    2124
    2225        if ( $response === false ) {
  • adcaptcha/trunk/src/Plugin/Woocommerce/PasswordReset.php

    r3060548 r3080455  
    55use AdCaptcha\Widget\AdCaptcha\AdCaptcha;
    66use AdCaptcha\Widget\Verify\Verify;
     7use AdCaptcha\AdCaptchaPlugin\AdCaptchaPlugin;
    78use WP_Error;
    89
    9 class PasswordReset {
     10class PasswordReset extends AdCaptchaPlugin {
    1011
    1112    public function setup() {
    1213        add_action( 'woocommerce_lostpassword_form', [ AdCaptcha::class, 'enqueue_scripts' ] );
     14        add_action( 'woocommerce_lostpassword_form', [ Verify::class, 'get_success_token' ] );
    1315        add_action( 'woocommerce_lostpassword_form', [ AdCaptcha::class, 'captcha_trigger' ] );
    1416        add_action( 'wp_loaded', [ $this, 'remove_wp_action' ], 10 );
     
    2224
    2325    public function verify( $error ) {
    24         $response = Verify::verify_token();
     26        $successToken = sanitize_text_field(wp_unslash($_POST['adcaptcha_successToken']));
     27        $response = Verify::verify_token($successToken);
    2528
    2629        if ( !$response ) {
  • adcaptcha/trunk/src/Plugin/Woocommerce/Registration.php

    r3060548 r3080455  
    55use AdCaptcha\Widget\AdCaptcha\AdCaptcha;
    66use AdCaptcha\Widget\Verify\Verify;
     7use AdCaptcha\AdCaptchaPlugin\AdCaptchaPlugin;
    78use WP_Error;
    89
    9 class Registration {
     10class Registration extends AdCaptchaPlugin {
    1011
    1112    public function setup() {
    1213        add_action( 'woocommerce_register_form', [ AdCaptcha::class, 'enqueue_scripts' ] );
     14        add_action( 'woocommerce_register_form', [ Verify::class, 'get_success_token' ] );
    1315        add_action( 'woocommerce_register_form', [ AdCaptcha::class, 'captcha_trigger' ] );
    1416        add_filter( 'woocommerce_registration_errors', [ $this, 'verify' ], 10, 3 );
     
    1820        global $adCAPTCHAWordpressRegistration;
    1921        remove_action( 'registration_errors', [ $adCAPTCHAWordpressRegistration, 'verify' ], 10 );
    20         $response = Verify::verify_token();
     22        $successToken = sanitize_text_field(wp_unslash($_POST['adcaptcha_successToken']));
     23        $response = Verify::verify_token($successToken);
    2124
    2225        if ( !$response ) {
  • adcaptcha/trunk/src/Settings/Plugins.php

    r3064464 r3080455  
    2525                'label' => 'Mailchimp',
    2626                'logo' => 'mailchimp_logo.png',
     27                'options' => array('Forms')
     28            ),
     29            array(
     30                'label' => 'NinjaForms',
     31                'logo' => 'ninjaForms_logo.png',
     32                'options' => array('Forms')
     33            ),
     34            array(
     35                'label' => 'WPForms',
     36                'logo' => 'wpforms_logo.png',
    2737                'options' => array('Forms')
    2838            ),
  • adcaptcha/trunk/src/Settings/Settings.php

    r3077493 r3080455  
    2222
    2323    public function add_styles_to_settings() {
    24         wp_enqueue_style('adcaptcha-admin-styles', plugins_url('../styles/settings.css', __FILE__), array(), PLUGIN_VERSION);
     24        wp_enqueue_style('adcaptcha-admin-styles', plugins_url('../styles/settings.css', __FILE__), array(), PLUGIN_VERSION_ADCAPTCHA);
    2525    }
    2626     
     
    7171
    7272    public function change_admin_footer_version() {
    73         return 'Version 1.1.3';
     73        return 'Version 1.2.0';
    7474    }
    7575}
  • adcaptcha/trunk/src/Widget/AdCaptcha.php

    r3077129 r3080455  
    66
    77    public static function enqueue_scripts($enableSubmitButton = false) {
    8         wp_enqueue_script('adcaptcha-script', 'https://widget.adcaptcha.com/index.js', array('jquery'), PLUGIN_VERSION, true);
     8        wp_enqueue_script('adcaptcha-script', 'https://widget.adcaptcha.com/index.js', array('jquery'), PLUGIN_VERSION_ADCAPTCHA, true);
    99   
    1010        $ajax_nonce = wp_create_nonce("adcaptcha_nonce");
     
    2020        }');
    2121    }
    22    
     22
    2323    public static function setupScript($enableSubmitButton = false) {
    2424        return 'window.adcap.init();
    2525        window.adcap.setupTriggers({
    2626            onComplete: () => {
    27                 jQuery.ajax({
    28                     url: adcaptcha_vars.ajax_url,
    29                     type: "POST",
    30                     data: {
    31                         action: "save_token",
    32                         successToken: window.adcap.successToken,
    33                         nonce: adcaptcha_vars.nonce,
    34                     }
    35                 });
    3627                ' . ($enableSubmitButton ? self::enable_submit_button() : '') . '
    3728                const event = new CustomEvent("adcaptcha_onSuccess", {
     
    5849
    5950    public static function captcha_trigger() {
    60         printf('<div data-adcaptcha="' . esc_attr(get_option('adcaptcha_placement_id')) . '" style="margin-bottom: 20px; max-width: 400px;"></div>');
     51        printf('<div data-adcaptcha="' . esc_attr(get_option('adcaptcha_placement_id')) . '" style="margin-bottom: 20px; max-width: 400px; outline: none !important;"></div><input type="hidden" class="adcaptcha_successToken" name="adcaptcha_successToken">');
    6152    }
    6253}
  • adcaptcha/trunk/src/Widget/Verify.php

    r3077129 r3080455  
    44
    55class Verify {
     6    public static function verify_token($successToken) {
     7        $apiKey = get_option('adcaptcha_api_key');
    68
    7     // The actions are triggered after a post request is sent with action save_token
    8     public static function init() {
    9         add_action('wp_ajax_save_token', array(__CLASS__, 'save_token'));
    10         add_action('wp_ajax_nopriv_save_token', array(__CLASS__, 'save_token'));
    11     }
    12 
    13     // Gets the successToken from the captcha trigger post request
    14     public static function save_token() {
    15         check_ajax_referer('adcaptcha_nonce', 'nonce');
    16         $successToken = sanitize_text_field(wp_unslash($_POST['successToken']));
    17         if (isset($successToken)) {
    18             update_option('adcaptcha_success_token', $successToken);
    19             wp_send_json_success('Success');
    20         } else {
    21             wp_send_json_success('Failed');
    22         }
    23     }
    24 
    25     public static function verify_token($successToken = null) {
    26         if (empty($successToken)) {
    27             $successToken = get_option('adcaptcha_success_token');
     9        if (!$successToken || !$apiKey) {
     10            return false;
    2811        }
    2912
    30         $apiKey = get_option('adcaptcha_api_key');
    3113        $url = 'https://api.adcaptcha.com/v1/verify';
    3214        $body = wp_json_encode([
     
    4426
    4527        if (is_wp_error($response)) {
    46             update_option('adcaptcha_success_token', '');
    4728            return false;
    4829        }
     
    5132        $message = json_decode($body);
    5233        if ($message && $message->message === 'Token verified') {
    53             update_option('adcaptcha_success_token', '');
    5434            return true;
    5535        }
     
    5737        return false;
    5838    }
     39
     40    public function get_success_token() {
     41        $script = '
     42        document.addEventListener("DOMContentLoaded", function() {
     43            document.addEventListener("adcaptcha_onSuccess", function(e) {
     44                var elements = document.querySelectorAll(".adcaptcha_successToken");
     45                elements.forEach(function(element) {
     46                    element.value = e.detail.successToken;
     47                });
     48            });
     49        });';
     50   
     51        wp_add_inline_script( 'adcaptcha-script', $script );
     52    }
    5953}
    60 
    61 Verify::init();
Note: See TracChangeset for help on using the changeset viewer.