Plugin Directory

Changeset 3252717


Ignore:
Timestamp:
03/09/2025 01:27:28 AM (13 months ago)
Author:
denisaleman
Message:

v1.1.0

Location:
power-captcha-recaptcha
Files:
146 added
12 edited

Legend:

Unmodified
Added
Removed
  • power-captcha-recaptcha

    • Property svn:ignore set to
      svn-commit.tmp
  • power-captcha-recaptcha/trunk

    • Property svn:ignore set to
      vendor/bin
      .git
      .gitignore
      composer.json
      composer.lock
      phpcs.xml
  • power-captcha-recaptcha/trunk/inc/admin.php

    r3121742 r3252717  
    2929
    3030                    <div class="nav-tab-wrapper pwrcap-nav-tab-wrapper">
    31                         <a href="#tab-general" class="nav-tab nav-tab-active"><?php esc_html_e( 'General', 'power-captcha-recaptcha' ); ?></a>
    32                         <a href="#tab-captchas" class="nav-tab"><?php esc_html_e( 'Captchas', 'power-captcha-recaptcha' ); ?></a>
    33                         <a href="#tab-misc" class="nav-tab"><?php esc_html_e( 'Misc', 'power-captcha-recaptcha' ); ?></a>
     31                        <?php do_action( 'pwrcap_admin_do_tab_navigation' ); ?>
    3432                    </div><!-- .tab-wrapper -->
    3533
    3634                    <div class="tabs-stage">
    37                         <div id="tab-general" style="display: block;" class="pwrcap-tab-content meta-box-sortables ui-sortable">
    38                             <div class="postbox">
    39                                 <div class="inside">
    40                                     <form class="pwrcap_settings_form" action="options.php" method="post">
    41                                         <?php settings_fields( 'pwrcap_general_group' ); ?>
    42                                         <?php do_settings_sections( 'pwrcap_general_group' ); ?>
    43                                         <?php
    44                                         submit_button(
    45                                             esc_html__( 'Save Changes', 'default' ), // phpcs:ignore WordPress.WP.I18n.TextDomainMismatch
    46                                             'primary pwrcap-sumbit-button',
    47                                             'submit',
    48                                             false
    49                                         );
    50                                         ?>
    51                                     </form>
    52                                 </div><!-- .inside -->
    53                             </div><!-- .postbox -->
    54                         </div><!-- .meta-box-sortables -->
    55 
    56                         <div id="tab-captchas" class="pwrcap-tab-content meta-box-sortables ui-sortable">
    57                             <div class="postbox">
    58                                 <div class="inside">
    59                                     <form class="pwrcap_settings_form" action="options.php" method="post">
    60                                         <?php settings_fields( 'pwrcap_captchas_group' ); ?>
    61                                         <?php do_settings_sections( 'pwrcap_captchas_group' ); ?>
    62                                         <?php
    63                                         submit_button(
    64                                             esc_html__( 'Save Changes', 'default' ), // phpcs:ignore WordPress.WP.I18n.TextDomainMismatch
    65                                             'primary pwrcap-sumbit-button',
    66                                             'submit',
    67                                             false
    68                                         );
    69                                         ?>
    70                                     </form>
    71                                 </div><!-- .inside -->
    72                             </div><!-- .postbox -->
    73                         </div><!-- .meta-box-sortables -->
    74 
    75                         <div id="tab-misc" class="pwrcap-tab-content meta-box-sortables ui-sortable">
    76                             <div class="postbox">
    77                                 <div class="inside">
    78                                     <form class="pwrcap_settings_form" action="options.php" method="post">
    79                                         <?php settings_fields( 'pwrcap_misc_group' ); ?>
    80                                         <?php do_settings_sections( 'pwrcap_misc_group' ); ?>
    81                                         <?php
    82                                         submit_button(
    83                                             esc_html__( 'Save Changes', 'default' ), // phpcs:ignore WordPress.WP.I18n.TextDomainMismatch
    84                                             'primary pwrcap-sumbit-button',
    85                                             'submit',
    86                                             false
    87                                         );
    88                                         ?>
    89                                     </form>
    90                                 </div><!-- .inside -->
    91                             </div><!-- .postbox -->
    92                         </div><!-- .meta-box-sortables -->
    93 
     35                        <?php do_action( 'pwrcap_admin_do_tab_stage' ); ?>
    9436                    </div><!-- .tabs-stage -->
    9537
     
    12062    <?php
    12163}
     64
     65/**
     66 * Print a link for the General tab in admin navigation.
     67 *
     68 * @since 1.0.11
     69 *
     70 * @return void
     71 */
     72function pwrcap_print_general_tab_link() {
     73    ?>
     74    <a href="#tab-general" class="nav-tab nav-tab-active"><?php esc_html_e( 'General', 'power-captcha-recaptcha' ); ?></a>
     75    <?php
     76}
     77add_action( 'pwrcap_admin_do_tab_navigation', 'pwrcap_print_general_tab_link', 10 );
     78
     79/**
     80 * Print content for the general tab in admin navigation.
     81 *
     82 * @since 1.0.11
     83 *
     84 * @return void
     85 */
     86function pwrcap_print_general_tab_content() {
     87    ?>
     88    <div id="tab-general" style="display: block;" class="pwrcap-tab-content meta-box-sortables ui-sortable">
     89        <div class="postbox">
     90            <div class="inside">
     91                <form class="pwrcap_settings_form" action="options.php" method="post">
     92                    <?php settings_fields( 'pwrcap_general_group' ); ?>
     93                    <?php do_settings_sections( 'pwrcap_general_group' ); ?>
     94                    <?php
     95                    submit_button(
     96                        esc_html__( 'Save Changes', 'default' ), // phpcs:ignore WordPress.WP.I18n.TextDomainMismatch
     97                        'primary pwrcap-sumbit-button',
     98                        'submit',
     99                        false
     100                    );
     101                    ?>
     102                </form>
     103            </div><!-- .inside -->
     104        </div><!-- .postbox -->
     105    </div><!-- .meta-box-sortables -->
     106    <?php
     107}
     108add_action( 'pwrcap_admin_do_tab_stage', 'pwrcap_print_general_tab_content', 10 );
     109
     110/**
     111 * Print a link for the captchas tab in admin navigation.
     112 *
     113 * @since 1.0.11
     114 *
     115 * @return void
     116 */
     117function pwrcap_print_captchas_tab_link() {
     118    ?>
     119    <a href="#tab-captchas" class="nav-tab"><?php esc_html_e( 'Captchas', 'power-captcha-recaptcha' ); ?></a>
     120    <?php
     121}
     122add_action( 'pwrcap_admin_do_tab_navigation', 'pwrcap_print_captchas_tab_link', 20 );
     123
     124/**
     125 * Print content for the captchas tab in admin navigation.
     126 *
     127 * @since 1.0.11
     128 *
     129 * @return void
     130 */
     131function pwrcap_print_captchas_tab_content() {
     132    ?>
     133    <div id="tab-captchas" class="pwrcap-tab-content meta-box-sortables ui-sortable">
     134        <div class="postbox">
     135            <div class="inside">
     136                <form class="pwrcap_settings_form" action="options.php" method="post">
     137                    <?php settings_fields( 'pwrcap_captchas_group' ); ?>
     138                    <?php do_settings_sections( 'pwrcap_captchas_group' ); ?>
     139                    <?php
     140                    submit_button(
     141                        esc_html__( 'Save Changes', 'default' ), // phpcs:ignore WordPress.WP.I18n.TextDomainMismatch
     142                        'primary pwrcap-sumbit-button',
     143                        'submit',
     144                        false
     145                    );
     146                    ?>
     147                </form>
     148            </div><!-- .inside -->
     149        </div><!-- .postbox -->
     150    </div><!-- .meta-box-sortables -->
     151    <?php
     152}
     153add_action( 'pwrcap_admin_do_tab_stage', 'pwrcap_print_captchas_tab_content', 20 );
     154
     155/**
     156 * Print a link for the captchas tab in admin navigation.
     157 *
     158 * @since 1.0.11
     159 *
     160 * @return void
     161 */
     162function pwrcap_print_misc_tab_link() {
     163    ?>
     164    <a href="#tab-misc" class="nav-tab"><?php esc_html_e( 'Misc', 'power-captcha-recaptcha' ); ?></a>
     165    <?php
     166}
     167add_action( 'pwrcap_admin_do_tab_navigation', 'pwrcap_print_misc_tab_link', 30 );
     168
     169/**
     170 * Print content for the captchas tab in admin navigation.
     171 *
     172 * @since 1.0.11
     173 *
     174 * @return void
     175 */
     176function pwrcap_print_misc_tab_content() {
     177    ?>
     178    <div id="tab-misc" class="pwrcap-tab-content meta-box-sortables ui-sortable">
     179        <div class="postbox">
     180            <div class="inside">
     181                <form class="pwrcap_settings_form" action="options.php" method="post">
     182                    <?php settings_fields( 'pwrcap_misc_group' ); ?>
     183                    <?php do_settings_sections( 'pwrcap_misc_group' ); ?>
     184                    <?php
     185                    submit_button(
     186                        esc_html__( 'Save Changes', 'default' ), // phpcs:ignore WordPress.WP.I18n.TextDomainMismatch
     187                        'primary pwrcap-sumbit-button',
     188                        'submit',
     189                        false
     190                    );
     191                    ?>
     192                </form>
     193            </div><!-- .inside -->
     194        </div><!-- .postbox -->
     195    </div><!-- .meta-box-sortables -->
     196    <?php
     197}
     198add_action( 'pwrcap_admin_do_tab_stage', 'pwrcap_print_misc_tab_content', 30 );
    122199
    123200/**
     
    374451    ?>
    375452    <fieldset>
    376         <label><input class="captcha-type-radio" type="radio" name="pwrcap_general_options[captcha_type]" value="v3" <?php checked( 'v3', $captcha_type ); ?> /><?php esc_html_e( 'Score based (v3)', 'power-captcha-recaptcha' ); ?> <p class="description"><?php _e( 'Verify requests with a score', 'power-captcha-recaptcha' ); ?></p></label>
     453        <label><input class="captcha-type-radio" type="radio" name="pwrcap_general_options[captcha_type]" value="v3" <?php checked( 'v3', $captcha_type ); ?> /><?php esc_html_e( 'Score based (v3)', 'power-captcha-recaptcha' ); ?> <p class="description"><?php esc_html_e( 'Verify requests with a score', 'power-captcha-recaptcha' ); ?></p></label>
    377454        <br>
    378         <label><input class="captcha-type-radio" type="radio" name="pwrcap_general_options[captcha_type]" value="v2" <?php checked( 'v2', $captcha_type ); ?> /><?php esc_html_e( 'Challenge (v2)', 'power-captcha-recaptcha' ); ?> <p class="description"><?php _e( 'Verify requests with a challenge', 'power-captcha-recaptcha' ); ?></p></label>
     455        <label><input class="captcha-type-radio" type="radio" name="pwrcap_general_options[captcha_type]" value="v2" <?php checked( 'v2', $captcha_type ); ?> /><?php esc_html_e( 'Challenge (v2)', 'power-captcha-recaptcha' ); ?> <p class="description"><?php esc_html_e( 'Verify requests with a challenge', 'power-captcha-recaptcha' ); ?></p></label>
    379456        <br>
    380457        <fieldset id="fieldset-captcha-v2-type" class="pwrcap-fieldset pwrcap-fieldset--sub" <?php echo ! $captcha_v2_checked ? 'style="display:none;"' : ''; ?>>
    381             <label><input class="captcha-v2-type-radio" type="radio" name="pwrcap_general_options[captcha_v2_type]" value="v2cbx" <?php checked( 'v2cbx', $captcha_v2_type ); ?> /><?php esc_html_e( '"I\'m not a robot" Checkbox', 'power-captcha-recaptcha' ); ?> <p class="description"><?php _e( 'Validate requests with the "I\'m not a robot" checkbox', 'power-captcha-recaptcha' ); ?></p> </label>
     458            <label><input class="captcha-v2-type-radio" type="radio" name="pwrcap_general_options[captcha_v2_type]" value="v2cbx" <?php checked( 'v2cbx', $captcha_v2_type ); ?> /><?php esc_html_e( '"I\'m not a robot" Checkbox', 'power-captcha-recaptcha' ); ?> <p class="description"><?php esc_html_e( 'Validate requests with the "I\'m not a robot" checkbox', 'power-captcha-recaptcha' ); ?></p> </label>
    382459            <br>
    383             <label><input class="captcha-v2-type-radio" type="radio" name="pwrcap_general_options[captcha_v2_type]" value="v2inv" <?php checked( 'v2inv', $captcha_v2_type ); ?> /><?php esc_html_e( 'Invisible reCAPTCHA badge', 'power-captcha-recaptcha' ); ?> <p class="description"><?php _e( 'Validate requests in the background', 'power-captcha-recaptcha' ); ?></p> </label>
     460            <label><input class="captcha-v2-type-radio" type="radio" name="pwrcap_general_options[captcha_v2_type]" value="v2inv" <?php checked( 'v2inv', $captcha_v2_type ); ?> /><?php esc_html_e( 'Invisible reCAPTCHA badge', 'power-captcha-recaptcha' ); ?> <p class="description"><?php esc_html_e( 'Validate requests in the background', 'power-captcha-recaptcha' ); ?></p> </label>
    384461        </fieldset>
    385462    </fieldset>
  • power-captcha-recaptcha/trunk/inc/core.php

    r3186005 r3252717  
    144144require_once PWRCAP_DIR . '/inc/cf7/cf7.php';
    145145
     146require_once PWRCAP_DIR . '/inc/activity/activity.php';
     147
    146148/**
    147149 * Register hooks.
     
    152154 */
    153155function pwrcap_init() {
     156    do_action( 'pwrcap_init' );
     157
    154158    if ( true !== pwrcap_is_setup_complete() ) {
    155159        return;
     
    197201 */
    198202function pwrcap_validate_posted_captcha() {
    199     $grecaptcha_response = pwrcap_get_posted_captcha_code();
    200 
    201     if ( ! $grecaptcha_response ) {
    202         return false;
    203     }
    204 
    205     return pwrcap_is_valid_captcha_code( $grecaptcha_response );
     203    $grecaptcha_code = pwrcap_get_posted_captcha_code();
     204
     205    return pwrcap_is_valid_captcha_code( $grecaptcha_code );
    206206}
    207207
     
    250250 */
    251251function pwrcap_is_valid_captcha_code( $captcha_code ) {
     252    if ( ! $captcha_code ) {
     253        /**
     254         * Fires if captcha code is an empty string or has not been sent through the form.
     255         *
     256         * @since 1.0.11
     257         */
     258        do_action( 'pwrcap_no_captcha_code_sent' );
     259        return false;
     260    }
     261
    252262    $server_name = null;
    253263    // phpcs:disable WordPress.Security.ValidatedSanitizedInput.InputNotValidated, WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
  • power-captcha-recaptcha/trunk/inc/wp/login.php

    r3031256 r3252717  
    4949    }
    5050
    51     add_filter( 'wp_authenticate_user', 'pwrcap_handle_login_form', 10, 1 );
     51    add_filter( 'authenticate', 'pwrcap_handle_login_form', 30, 1 );
    5252}
    5353add_action( 'pwrcap_add_captcha_handler', 'pwrcap_login_form_add_handler' );
  • power-captcha-recaptcha/trunk/inc/wp/register.php

    r3031256 r3252717  
    4949    }
    5050
    51     add_filter( 'registration_errors', 'pwrcap_handle_register_form' );
     51    add_action(
     52        'login_form_register',
     53        function() {
     54            add_filter( 'registration_errors', 'pwrcap_handle_register_form' );
     55        }
     56    );
    5257}
    5358add_action( 'pwrcap_add_captcha_handler', 'pwrcap_register_form_add_handler' );
  • power-captcha-recaptcha/trunk/power-captcha-recaptcha.php

    r3207819 r3252717  
    33 * Plugin Name:       Power Captcha reCAPTCHA
    44 * Plugin URI:        https://wordpress.org/plugins/power-captcha-recaptcha/
    5  * Version:           1.0.10
     5 * Version:           1.1.0
    66 * Description:       Google reCAPTCHA integration for WordPress and WooCommerce.
    77 * Author:            Denis Alemán
    88 * Author URI:        https://denisaleman.com/
    99 * Requires at least: 5.0
    10  * Tested up to:      6.7.1
    11  * WC tested up to:   9.4.3
     10 * Tested up to:      6.8.0
     11 * WC tested up to:   9.7.1
    1212 * Requires PHP:      5.5
    1313 * Text Domain:       power-captcha-recaptcha
     
    1717 *
    1818 * @package   PowerCaptchaReCaptcha
    19  * @version   1.0.10
     19 * @version   1.1.0
    2020 * @author    Denis Alemán
    21  * @copyright 2023-2024 Denis Alemán
     21 * @copyright 2023-2025 Denis Alemán
    2222 * @license   GPL-3.0
    2323 */
     
    2727}
    2828
    29 define( 'PWRCAP_VERSION', '1.0.10' );
     29define( 'PWRCAP_VERSION', '1.1.0' );
    3030define( 'PWRCAP_BASENAME', plugin_basename( __FILE__ ) );
    3131define( 'PWRCAP_PLUGIN_FILE', __FILE__ );
     
    3939require_once PWRCAP_DIR . '/inc/api.php';
    4040require_once PWRCAP_DIR . '/inc/admin.php';
     41require_once PWRCAP_DIR . '/inc/update.php';
    4142require_once PWRCAP_DIR . '/inc/core.php';
  • power-captcha-recaptcha/trunk/readme.txt

    r3207819 r3252717  
    44Tags: captcha, google recaptcha, comment form, login security, anti-spam security, form protection, woocommerce
    55Requires at least: 5.0
    6 Tested up to: 6.6.1
    7 Stable tag: 1.0.10
     6Tested up to: 6.8.0
     7Stable tag: 1.1.0
    88Requires PHP: 5.5
    99License: GPLv3
     
    4343
    4444As of version 1.0.7, Power Captcha reCAPTCHA integrates with Contact Form 7. You can easily add the Power Captcha reCAPTCHA field to your Contact Form 7 forms.
     45
     46== Activity Report ==
     47
     48The Activity Report feature for the plugin provides users with a detailed overview of captcha interactions. It tracks and displays the number of solved, failed, and empty captchas, offering a daily breakdown to monitor performance trends. Stay informed with clear insights into your captcha performance.
    4549
    4650== Installation ==
     
    124128* Added Russian translations.
    125129* WooCommerce tested up to 9.4.3
     130
     131= 1.1.0 (2025-03-09) =
     132* Tested up to 6.8.0
     133* WooCommerce tested up to 9.7.1
     134* Added captcha activity report feature.
     135* Fixed minor bugs.
  • power-captcha-recaptcha/trunk/vendor

    • Property svn:ignore set to
      phpcompatibility
      dealerdirect
      sirbrillig
      squizlabs
      wp-coding-standards
      bin
  • power-captcha-recaptcha/trunk/vendor/composer/autoload_classmap.php

    r3031256 r3252717  
    88return array(
    99    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
     10    'ReCaptcha\\ReCaptcha' => $vendorDir . '/google/recaptcha/src/ReCaptcha/ReCaptcha.php',
     11    'ReCaptcha\\RequestMethod' => $vendorDir . '/google/recaptcha/src/ReCaptcha/RequestMethod.php',
     12    'ReCaptcha\\RequestMethod\\Curl' => $vendorDir . '/google/recaptcha/src/ReCaptcha/RequestMethod/Curl.php',
     13    'ReCaptcha\\RequestMethod\\CurlPost' => $vendorDir . '/google/recaptcha/src/ReCaptcha/RequestMethod/CurlPost.php',
     14    'ReCaptcha\\RequestMethod\\Post' => $vendorDir . '/google/recaptcha/src/ReCaptcha/RequestMethod/Post.php',
     15    'ReCaptcha\\RequestMethod\\Socket' => $vendorDir . '/google/recaptcha/src/ReCaptcha/RequestMethod/Socket.php',
     16    'ReCaptcha\\RequestMethod\\SocketPost' => $vendorDir . '/google/recaptcha/src/ReCaptcha/RequestMethod/SocketPost.php',
     17    'ReCaptcha\\RequestParameters' => $vendorDir . '/google/recaptcha/src/ReCaptcha/RequestParameters.php',
     18    'ReCaptcha\\Response' => $vendorDir . '/google/recaptcha/src/ReCaptcha/Response.php',
    1019);
  • power-captcha-recaptcha/trunk/vendor/composer/autoload_static.php

    r3184683 r3252717  
    2323    public static $classMap = array (
    2424        'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
     25        'ReCaptcha\\ReCaptcha' => __DIR__ . '/..' . '/google/recaptcha/src/ReCaptcha/ReCaptcha.php',
     26        'ReCaptcha\\RequestMethod' => __DIR__ . '/..' . '/google/recaptcha/src/ReCaptcha/RequestMethod.php',
     27        'ReCaptcha\\RequestMethod\\Curl' => __DIR__ . '/..' . '/google/recaptcha/src/ReCaptcha/RequestMethod/Curl.php',
     28        'ReCaptcha\\RequestMethod\\CurlPost' => __DIR__ . '/..' . '/google/recaptcha/src/ReCaptcha/RequestMethod/CurlPost.php',
     29        'ReCaptcha\\RequestMethod\\Post' => __DIR__ . '/..' . '/google/recaptcha/src/ReCaptcha/RequestMethod/Post.php',
     30        'ReCaptcha\\RequestMethod\\Socket' => __DIR__ . '/..' . '/google/recaptcha/src/ReCaptcha/RequestMethod/Socket.php',
     31        'ReCaptcha\\RequestMethod\\SocketPost' => __DIR__ . '/..' . '/google/recaptcha/src/ReCaptcha/RequestMethod/SocketPost.php',
     32        'ReCaptcha\\RequestParameters' => __DIR__ . '/..' . '/google/recaptcha/src/ReCaptcha/RequestParameters.php',
     33        'ReCaptcha\\Response' => __DIR__ . '/..' . '/google/recaptcha/src/ReCaptcha/Response.php',
    2534    );
    2635
  • power-captcha-recaptcha/trunk/vendor/composer/installed.php

    r3184683 r3252717  
    22    'root' => array(
    33        'name' => 'denisaleman/pwrcap',
    4         'pretty_version' => '1.0.0+no-version-set',
    5         'version' => '1.0.0.0',
    6         'reference' => null,
     4        'pretty_version' => 'dev-master',
     5        'version' => 'dev-master',
     6        'reference' => 'e5e42262d46fb6e78e24dd286b1ed2c2f62678ec',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        'denisaleman/pwrcap' => array(
    14             'pretty_version' => '1.0.0+no-version-set',
    15             'version' => '1.0.0.0',
    16             'reference' => null,
     14            'pretty_version' => 'dev-master',
     15            'version' => 'dev-master',
     16            'reference' => 'e5e42262d46fb6e78e24dd286b1ed2c2f62678ec',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.