Plugin Directory

Changeset 3068714


Ignore:
Timestamp:
04/11/2024 01:23:41 AM (2 years ago)
Author:
kanakogi
Message:

1.1.3

Location:
recaptcha-for-mw-wp-form
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • recaptcha-for-mw-wp-form/tags/1.1.3/controllers/EnqueueController.php

    r2709496 r3068714  
    2424            $data = <<< EOL
    2525grecaptcha.ready(function() {
    26     grecaptcha.execute('$site_key', {
     26    jQuery('form').on('submit', function(e) {
     27        e.preventDefault();
     28        grecaptcha.execute('$site_key', {
    2729            action: 'homepage'
    2830        }).then(function(token) {
    2931            var recaptchaResponse = jQuery('input[name="recaptcha-v3"]');
    3032            recaptchaResponse.val(token);
     33            let form = e.target;
     34            if (form.querySelector("[name=submitConfirm]")) {
     35                const confirmButtonValue = form.querySelector("[name=submitConfirm]").value;
     36                const confirmButton = document.createElement("input");
     37                confirmButton.type = "hidden";
     38                confirmButton.value = confirmButtonValue;
     39                confirmButton.name = "submitConfirm";
     40                form.appendChild(confirmButton);
     41            }
     42            form.submit();
    3143        });
    3244    });
     45});
    3346EOL;
    3447            wp_add_inline_script('recaptcha-script', $data);
  • recaptcha-for-mw-wp-form/tags/1.1.3/readme.txt

    r2982383 r3068714  
    44Tags: : form, mail, MW WP Form, reCAPTCHA
    55Requires at least: 4.0 or higher
    6 Tested up to: 6.3.2
    7 Stable tag: 1.1.2
     6Tested up to: 6.5.2
     7Stable tag: 1.1.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • recaptcha-for-mw-wp-form/tags/1.1.3/recaptcha-for-mw-wp-form.php

    r2982383 r3068714  
    44Description: You can use reCAPTCHA v3 on the MW WP Form.
    55Author: Nakashima Masahiro
    6 Version: 1.1.2
     6Version: 1.1.3
    77Plugin URI: https://github.com/kanakogi/recaptcha-for-mw-wp-form
    88License: GPLv2 or later
  • recaptcha-for-mw-wp-form/tags/1.1.3/views/admin.php

    r2982383 r3068714  
    3838                <th>Site Key</th>
    3939                <td>
    40                     <input type="text" name="site_key" class="regular-text" value="<?= $option['site_key'] ?>">
     40                    <input type="text" name="site_key" class="regular-text" value="<?= $option['site_key'] ?? '' ?>">
    4141                </td>
    4242            </tr>
     
    4545                <td>
    4646                    <input type="text" name="secret_key" class="regular-text" value="">
    47                     <?php if ($option['secret_key'] != '') : ?>
     47                    <?php if (isset($option['secret_key']) && $option['secret_key'] != '') : ?>
    4848                        <p class="description"><?php _e('Secret Key has been saved.', Config::TEXTDOMAIN) ?></p>
    4949                    <?php endif; ?>
     
    5353                <th>Threshold score (0.00 - 1.00)</th>
    5454                <td>
    55                     <input type="number" name="threshold_score" min="0" max="1" step="0.01" class="regular-text" value="<?= $option['threshold_score']?>">
     55                    <input type="number" name="threshold_score" min="0" max="1" step="0.01" class="regular-text" value="<?= $option['threshold_score'] ?? '' ?>">
    5656                </td>
    5757            </tr>
  • recaptcha-for-mw-wp-form/trunk/controllers/EnqueueController.php

    r2709496 r3068714  
    2424            $data = <<< EOL
    2525grecaptcha.ready(function() {
    26     grecaptcha.execute('$site_key', {
     26    jQuery('form').on('submit', function(e) {
     27        e.preventDefault();
     28        grecaptcha.execute('$site_key', {
    2729            action: 'homepage'
    2830        }).then(function(token) {
    2931            var recaptchaResponse = jQuery('input[name="recaptcha-v3"]');
    3032            recaptchaResponse.val(token);
     33            let form = e.target;
     34            if (form.querySelector("[name=submitConfirm]")) {
     35                const confirmButtonValue = form.querySelector("[name=submitConfirm]").value;
     36                const confirmButton = document.createElement("input");
     37                confirmButton.type = "hidden";
     38                confirmButton.value = confirmButtonValue;
     39                confirmButton.name = "submitConfirm";
     40                form.appendChild(confirmButton);
     41            }
     42            form.submit();
    3143        });
    3244    });
     45});
    3346EOL;
    3447            wp_add_inline_script('recaptcha-script', $data);
  • recaptcha-for-mw-wp-form/trunk/readme.txt

    r2982383 r3068714  
    44Tags: : form, mail, MW WP Form, reCAPTCHA
    55Requires at least: 4.0 or higher
    6 Tested up to: 6.3.2
    7 Stable tag: 1.1.2
     6Tested up to: 6.5.2
     7Stable tag: 1.1.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • recaptcha-for-mw-wp-form/trunk/recaptcha-for-mw-wp-form.php

    r2982383 r3068714  
    44Description: You can use reCAPTCHA v3 on the MW WP Form.
    55Author: Nakashima Masahiro
    6 Version: 1.1.2
     6Version: 1.1.3
    77Plugin URI: https://github.com/kanakogi/recaptcha-for-mw-wp-form
    88License: GPLv2 or later
  • recaptcha-for-mw-wp-form/trunk/views/admin.php

    r2982383 r3068714  
    3838                <th>Site Key</th>
    3939                <td>
    40                     <input type="text" name="site_key" class="regular-text" value="<?= $option['site_key'] ?>">
     40                    <input type="text" name="site_key" class="regular-text" value="<?= $option['site_key'] ?? '' ?>">
    4141                </td>
    4242            </tr>
     
    4545                <td>
    4646                    <input type="text" name="secret_key" class="regular-text" value="">
    47                     <?php if ($option['secret_key'] != '') : ?>
     47                    <?php if (isset($option['secret_key']) && $option['secret_key'] != '') : ?>
    4848                        <p class="description"><?php _e('Secret Key has been saved.', Config::TEXTDOMAIN) ?></p>
    4949                    <?php endif; ?>
     
    5353                <th>Threshold score (0.00 - 1.00)</th>
    5454                <td>
    55                     <input type="number" name="threshold_score" min="0" max="1" step="0.01" class="regular-text" value="<?= $option['threshold_score']?>">
     55                    <input type="number" name="threshold_score" min="0" max="1" step="0.01" class="regular-text" value="<?= $option['threshold_score'] ?? '' ?>">
    5656                </td>
    5757            </tr>
Note: See TracChangeset for help on using the changeset viewer.