Plugin Directory

Changeset 3246269


Ignore:
Timestamp:
02/25/2025 08:53:29 AM (12 months ago)
Author:
adcaptcha
Message:

Update to version 1.6.0 from GitHub

Location:
adcaptcha
Files:
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • adcaptcha/tags/1.6.0/README.md

    r3196276 r3246269  
    4141### Fluent Forms
    4242
     43## Advance Features
     44
     45* Able to trigger adCAPTCHA on the "Place order" button.
     46* Able to disable the WooCommerce checkout endpoint. This will help prevent unauthorised request, for example stopping credit card fraud.
     47
    4348## Privacy Notices
    4449
  • adcaptcha/tags/1.6.0/adcaptcha.php

    r3219515 r3246269  
    33 * Plugin Name: adCAPTCHA for WordPress
    44 * Description: Secure your site. Elevate your brand. Boost Ad Revenue.
    5  * Version: 1.5.5
     5 * Version: 1.6.0
    66 * Requires at least: 6.4.2
    77 * Requires PHP: 7.4
     
    2222use AdCaptcha\Instantiate;
    2323
    24 const PLUGIN_VERSION_ADCAPTCHA = '1.5.5';
     24const PLUGIN_VERSION_ADCAPTCHA = '1.6.0';
    2525define('ADCAPTCHA_ERROR_MESSAGE', __( 'Please complete the I am human box.', 'adcaptcha' ));
    2626
    27 // Deletes data saved in the wp db on plugin uninstall
     27if ( ! function_exists( 'adcaptcha_uninstall' ) ) {
     28    // Deletes data saved in the wp db on plugin uninstall
     29    function adcaptcha_uninstall() {
     30        delete_option( 'adcaptcha_api_key' );
     31        delete_option( 'adcaptcha_placement_id' );
     32        delete_option( 'adcaptcha_render_captcha' );
     33        delete_option( 'adcaptcha_selected_plugins' );
     34        delete_option( 'experimental_disable_wc_checkout_endpoint' );
     35        delete_option( 'adcaptcha_wc_checkout_optional_trigger' );
     36    }
     37}
     38
    2839register_uninstall_hook( __FILE__, 'adcaptcha_uninstall' );
    29 
    30 function adcaptcha_uninstall() {
    31     delete_option( 'adcaptcha_api_key' );
    32     delete_option( 'adcaptcha_placement_id' );
    33     delete_option( 'adcaptcha_render_captcha' );
    34     delete_option( 'adcaptcha_selected_plugins' );
    35 }
    3640
    3741$instantiate = new Instantiate();
  • adcaptcha/tags/1.6.0/readme.txt

    r3219515 r3246269  
    55Requires at least: 6.0
    66Tested up to: 6.5.2
    7 Stable tag: 1.5.5
     7Stable tag: 1.6.0
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    4646
    4747**Fluent Forms**
     48
     49== Advance Features ==
     50
     51**Woocommerce**
     52
     53* Able to trigger adCAPTCHA on the "Place order" button.
     54* Able to disable the WooCommerce checkout endpoint. This will help prevent unauthorised request, for example stopping credit card fraud.
    4855
    4956== Installation ==
     
    148155- Minor update to ContactForm7: Added the ability to manually place adCAPTCHA.
    149156- If not configured manually, it will default to appearing above the submit button.
     157
     158= 1.6.0 =
     159- Added feature to disable the WooCommerce checkout endpoint.
  • adcaptcha/tags/1.6.0/src/Plugin/Woocommerce/Checkout.php

    r3219515 r3246269  
    2727        add_action('woocommerce_payment_complete', [ $this, 'reset_hasVerified' ]);
    2828        add_action( 'woocommerce_checkout_process', [ $this, 'verify' ] );
     29        if (get_option('experimental_disable_wc_checkout_endpoint')) {
     30            add_action('rest_api_init', [ $this, 'disable_wc_endpoint_v1' ]);
     31        }
    2932    }
     33
     34    public function disable_wc_endpoint_v1() {
     35        $current_url = $_SERVER['REQUEST_URI'];
     36        if (strpos($current_url, '/wp-json/wc/store/v1/checkout') !== false || strpos($current_url, '/wp-json/wc/store/checkout') !== false) {
     37            wp_redirect(home_url('/404.php'));
     38            exit;
     39        }
     40    }
     41
    3042
    3143    public function verify() {
  • adcaptcha/tags/1.6.0/src/Settings/Advanced.php

    r3219515 r3246269  
    1515            $wc_checkout = isset($_POST['adcaptcha_advance']['wc-checkout']) ? sanitize_text_field(wp_unslash($_POST['adcaptcha_advance']['wc-checkout'])) : '';
    1616            update_option('adcaptcha_wc_checkout_optional_trigger', $wc_checkout);
     17
     18            $experimental_disable_wc_checkout_endpoint = isset($_POST['adcaptcha_advance']['experimental_disable_wc_checkout_endpoint']) ? sanitize_text_field(wp_unslash($_POST['adcaptcha_advance']['experimental_disable_wc_checkout_endpoint'])) : '';
     19            update_option('experimental_disable_wc_checkout_endpoint', $experimental_disable_wc_checkout_endpoint);
    1720        }
    1821
     
    2629                                    <?php
    2730                                        $checked = get_option('adcaptcha_wc_checkout_optional_trigger') ? 'checked' : '';
     31                                        $checked_experimental = get_option('experimental_disable_wc_checkout_endpoint') ? 'checked' : '';
    2832                                    ?>
    2933                                    <h2 style="font-size:x-large;">Woocommerce</h2>
     
    3236                                        <input type="checkbox" id="wc-checkout" name="adcaptcha_advance[wc-checkout]" value="wc-checkout" <?php echo $checked; ?>>
    3337                                        <label class="checkbox-label" for="wc-checkout">Enable to trigger adCAPTCHA on the "Place order" button.</label><br>
     38                                    </div>
     39                                    <div class="checkbox-container">
     40                                        <h4 style="padding-right: 20px; font-size:medium;">Disable Checkout Endpoint:</h4>
     41                                        <input type="checkbox" id="wc-checkout" name="adcaptcha_advance[experimental_disable_wc_checkout_endpoint]" value="experimental_disable_wc_checkout_endpoint" <?php echo $checked_experimental; ?>>
     42                                        <label class="checkbox-label" for="wc-checkout">Enable to disable the WooCommerce checkout endpoint. This will help prevent unauthorised request, for example stopping credit card fraud.</label><br>
    3443                                    </div>
    3544                            </div>
  • adcaptcha/tags/1.6.0/src/Settings/Settings.php

    r3219515 r3246269  
    8282
    8383    public function change_admin_footer_version() {
    84         return 'Version 1.5.5';
     84        return 'Version 1.6.0';
    8585    }
    8686}
  • adcaptcha/tags/1.6.0/vendor/composer/InstalledVersions.php

    r3219515 r3246269  
    3232     */
    3333    private static $installed;
     34
     35    /**
     36     * @var bool
     37     */
     38    private static $installedIsLocalDir;
    3439
    3540    /**
     
    310315        self::$installed = $data;
    311316        self::$installedByVendor = array();
     317
     318        // when using reload, we disable the duplicate protection to ensure that self::$installed data is
     319        // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
     320        // so we have to assume it does not, and that may result in duplicate data being returned when listing
     321        // all installed packages for example
     322        self::$installedIsLocalDir = false;
    312323    }
    313324
     
    326337
    327338        if (self::$canGetVendors) {
     339            $selfDir = strtr(__DIR__, '\\', '/');
    328340            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
     341                $vendorDir = strtr($vendorDir, '\\', '/');
    329342                if (isset(self::$installedByVendor[$vendorDir])) {
    330343                    $installed[] = self::$installedByVendor[$vendorDir];
     
    334347                    self::$installedByVendor[$vendorDir] = $required;
    335348                    $installed[] = $required;
    336                     if (strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
     349                    if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
    337350                        self::$installed = $required;
    338                         $copiedLocalDir = true;
     351                        self::$installedIsLocalDir = true;
    339352                    }
     353                }
     354                if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
     355                    $copiedLocalDir = true;
    340356                }
    341357            }
  • adcaptcha/tags/1.6.0/vendor/composer/installed.php

    r3219515 r3246269  
    22    'root' => array(
    33        'name' => 'adcaptcha/plugin',
    4         'pretty_version' => '1.5.5',
    5         'version' => '1.5.5.0',
    6         'reference' => '7dee3f7c2ba96edd9847dd891f4b7aef77995d4f',
     4        'pretty_version' => '1.6.0',
     5        'version' => '1.6.0.0',
     6        'reference' => '9f8ef06153c6398135d1ea1b3e5c551d650fd877',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        'adcaptcha/plugin' => array(
    14             'pretty_version' => '1.5.5',
    15             'version' => '1.5.5.0',
    16             'reference' => '7dee3f7c2ba96edd9847dd891f4b7aef77995d4f',
     14            'pretty_version' => '1.6.0',
     15            'version' => '1.6.0.0',
     16            'reference' => '9f8ef06153c6398135d1ea1b3e5c551d650fd877',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
  • adcaptcha/trunk/README.md

    r3196276 r3246269  
    4141### Fluent Forms
    4242
     43## Advance Features
     44
     45* Able to trigger adCAPTCHA on the "Place order" button.
     46* Able to disable the WooCommerce checkout endpoint. This will help prevent unauthorised request, for example stopping credit card fraud.
     47
    4348## Privacy Notices
    4449
  • adcaptcha/trunk/adcaptcha.php

    r3219515 r3246269  
    33 * Plugin Name: adCAPTCHA for WordPress
    44 * Description: Secure your site. Elevate your brand. Boost Ad Revenue.
    5  * Version: 1.5.5
     5 * Version: 1.6.0
    66 * Requires at least: 6.4.2
    77 * Requires PHP: 7.4
     
    2222use AdCaptcha\Instantiate;
    2323
    24 const PLUGIN_VERSION_ADCAPTCHA = '1.5.5';
     24const PLUGIN_VERSION_ADCAPTCHA = '1.6.0';
    2525define('ADCAPTCHA_ERROR_MESSAGE', __( 'Please complete the I am human box.', 'adcaptcha' ));
    2626
    27 // Deletes data saved in the wp db on plugin uninstall
     27if ( ! function_exists( 'adcaptcha_uninstall' ) ) {
     28    // Deletes data saved in the wp db on plugin uninstall
     29    function adcaptcha_uninstall() {
     30        delete_option( 'adcaptcha_api_key' );
     31        delete_option( 'adcaptcha_placement_id' );
     32        delete_option( 'adcaptcha_render_captcha' );
     33        delete_option( 'adcaptcha_selected_plugins' );
     34        delete_option( 'experimental_disable_wc_checkout_endpoint' );
     35        delete_option( 'adcaptcha_wc_checkout_optional_trigger' );
     36    }
     37}
     38
    2839register_uninstall_hook( __FILE__, 'adcaptcha_uninstall' );
    29 
    30 function adcaptcha_uninstall() {
    31     delete_option( 'adcaptcha_api_key' );
    32     delete_option( 'adcaptcha_placement_id' );
    33     delete_option( 'adcaptcha_render_captcha' );
    34     delete_option( 'adcaptcha_selected_plugins' );
    35 }
    3640
    3741$instantiate = new Instantiate();
  • adcaptcha/trunk/readme.txt

    r3219515 r3246269  
    55Requires at least: 6.0
    66Tested up to: 6.5.2
    7 Stable tag: 1.5.5
     7Stable tag: 1.6.0
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    4646
    4747**Fluent Forms**
     48
     49== Advance Features ==
     50
     51**Woocommerce**
     52
     53* Able to trigger adCAPTCHA on the "Place order" button.
     54* Able to disable the WooCommerce checkout endpoint. This will help prevent unauthorised request, for example stopping credit card fraud.
    4855
    4956== Installation ==
     
    148155- Minor update to ContactForm7: Added the ability to manually place adCAPTCHA.
    149156- If not configured manually, it will default to appearing above the submit button.
     157
     158= 1.6.0 =
     159- Added feature to disable the WooCommerce checkout endpoint.
  • adcaptcha/trunk/src/Plugin/Woocommerce/Checkout.php

    r3219515 r3246269  
    2727        add_action('woocommerce_payment_complete', [ $this, 'reset_hasVerified' ]);
    2828        add_action( 'woocommerce_checkout_process', [ $this, 'verify' ] );
     29        if (get_option('experimental_disable_wc_checkout_endpoint')) {
     30            add_action('rest_api_init', [ $this, 'disable_wc_endpoint_v1' ]);
     31        }
    2932    }
     33
     34    public function disable_wc_endpoint_v1() {
     35        $current_url = $_SERVER['REQUEST_URI'];
     36        if (strpos($current_url, '/wp-json/wc/store/v1/checkout') !== false || strpos($current_url, '/wp-json/wc/store/checkout') !== false) {
     37            wp_redirect(home_url('/404.php'));
     38            exit;
     39        }
     40    }
     41
    3042
    3143    public function verify() {
  • adcaptcha/trunk/src/Settings/Advanced.php

    r3219515 r3246269  
    1515            $wc_checkout = isset($_POST['adcaptcha_advance']['wc-checkout']) ? sanitize_text_field(wp_unslash($_POST['adcaptcha_advance']['wc-checkout'])) : '';
    1616            update_option('adcaptcha_wc_checkout_optional_trigger', $wc_checkout);
     17
     18            $experimental_disable_wc_checkout_endpoint = isset($_POST['adcaptcha_advance']['experimental_disable_wc_checkout_endpoint']) ? sanitize_text_field(wp_unslash($_POST['adcaptcha_advance']['experimental_disable_wc_checkout_endpoint'])) : '';
     19            update_option('experimental_disable_wc_checkout_endpoint', $experimental_disable_wc_checkout_endpoint);
    1720        }
    1821
     
    2629                                    <?php
    2730                                        $checked = get_option('adcaptcha_wc_checkout_optional_trigger') ? 'checked' : '';
     31                                        $checked_experimental = get_option('experimental_disable_wc_checkout_endpoint') ? 'checked' : '';
    2832                                    ?>
    2933                                    <h2 style="font-size:x-large;">Woocommerce</h2>
     
    3236                                        <input type="checkbox" id="wc-checkout" name="adcaptcha_advance[wc-checkout]" value="wc-checkout" <?php echo $checked; ?>>
    3337                                        <label class="checkbox-label" for="wc-checkout">Enable to trigger adCAPTCHA on the "Place order" button.</label><br>
     38                                    </div>
     39                                    <div class="checkbox-container">
     40                                        <h4 style="padding-right: 20px; font-size:medium;">Disable Checkout Endpoint:</h4>
     41                                        <input type="checkbox" id="wc-checkout" name="adcaptcha_advance[experimental_disable_wc_checkout_endpoint]" value="experimental_disable_wc_checkout_endpoint" <?php echo $checked_experimental; ?>>
     42                                        <label class="checkbox-label" for="wc-checkout">Enable to disable the WooCommerce checkout endpoint. This will help prevent unauthorised request, for example stopping credit card fraud.</label><br>
    3443                                    </div>
    3544                            </div>
  • adcaptcha/trunk/src/Settings/Settings.php

    r3219515 r3246269  
    8282
    8383    public function change_admin_footer_version() {
    84         return 'Version 1.5.5';
     84        return 'Version 1.6.0';
    8585    }
    8686}
  • adcaptcha/trunk/vendor/composer/InstalledVersions.php

    r3219515 r3246269  
    3232     */
    3333    private static $installed;
     34
     35    /**
     36     * @var bool
     37     */
     38    private static $installedIsLocalDir;
    3439
    3540    /**
     
    310315        self::$installed = $data;
    311316        self::$installedByVendor = array();
     317
     318        // when using reload, we disable the duplicate protection to ensure that self::$installed data is
     319        // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
     320        // so we have to assume it does not, and that may result in duplicate data being returned when listing
     321        // all installed packages for example
     322        self::$installedIsLocalDir = false;
    312323    }
    313324
     
    326337
    327338        if (self::$canGetVendors) {
     339            $selfDir = strtr(__DIR__, '\\', '/');
    328340            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
     341                $vendorDir = strtr($vendorDir, '\\', '/');
    329342                if (isset(self::$installedByVendor[$vendorDir])) {
    330343                    $installed[] = self::$installedByVendor[$vendorDir];
     
    334347                    self::$installedByVendor[$vendorDir] = $required;
    335348                    $installed[] = $required;
    336                     if (strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
     349                    if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
    337350                        self::$installed = $required;
    338                         $copiedLocalDir = true;
     351                        self::$installedIsLocalDir = true;
    339352                    }
     353                }
     354                if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
     355                    $copiedLocalDir = true;
    340356                }
    341357            }
  • adcaptcha/trunk/vendor/composer/installed.php

    r3219515 r3246269  
    22    'root' => array(
    33        'name' => 'adcaptcha/plugin',
    4         'pretty_version' => '1.5.5',
    5         'version' => '1.5.5.0',
    6         'reference' => '7dee3f7c2ba96edd9847dd891f4b7aef77995d4f',
     4        'pretty_version' => '1.6.0',
     5        'version' => '1.6.0.0',
     6        'reference' => '9f8ef06153c6398135d1ea1b3e5c551d650fd877',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        'adcaptcha/plugin' => array(
    14             'pretty_version' => '1.5.5',
    15             'version' => '1.5.5.0',
    16             'reference' => '7dee3f7c2ba96edd9847dd891f4b7aef77995d4f',
     14            'pretty_version' => '1.6.0',
     15            'version' => '1.6.0.0',
     16            'reference' => '9f8ef06153c6398135d1ea1b3e5c551d650fd877',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.