Plugin Directory

Changeset 2985152


Ignore:
Timestamp:
10/27/2023 07:44:00 PM (2 years ago)
Author:
captchaeu
Message:

Update to version v1.0.26 from GitLab (http://gitlab.krone.at/CAPTCHA/wp-plugin; http://gitlab.krone.at/CAPTCHA/wp-plugin/-/jobs/397673)

Location:
captcha-eu
Files:
38 edited
1 copied

Legend:

Unmodified
Added
Removed
  • captcha-eu/tags/v1.0.26/.php-cs-fixer.php

    r2906129 r2985152  
    33use PhpCsFixer\Config;
    44
    5 final class Php73 extends Config {
    6     public function __construct() {
     5final class Php73 extends Config
     6{
     7    public function __construct()
     8    {
    79        parent::__construct('KRNStyle');
    810        $this->setRiskyAllowed(true);
    911    }
    1012
    11     public function getRules(): array {
     13    public function getRules(): array
     14    {
    1215        $rules = [
    1316        '@Symfony' => true,
     
    5356                'self_accessor' => true,
    5457                'short_scalar_cast' => true,
    55                 'single_blank_line_before_namespace' => true,
    5658                'single_class_element_per_statement' => true,
    5759                'single_quote' => true,
  • captcha-eu/tags/v1.0.26/assets/login.js

    r2906129 r2985152  
    44    KROT.KROT_HOST = captchaAt.host;
    55
     6    var skipByException = false;
    67    // Login
    7     if(captchaAt.plugins.indexOf('_wp-login') > -1) {
    8         if(jQuery('#loginform').length > 0) {
    9             KROT.interceptForm(jQuery('#loginform')[0]);
     8    if(window.WFLSVars) {
     9        skipByException = true;
     10    }   
     11
     12    if(!skipByException) {
     13        if(captchaAt.plugins.indexOf('_wp-login') > -1) {
     14            if(jQuery('#loginform').length > 0) {
     15                KROT.interceptForm(jQuery('#loginform')[0]);
     16            }
    1017        }
    1118    }
     
    1724        }
    1825    }
    19 
    2026    // Register
    2127    if(captchaAt.plugins.indexOf('_wp-registration') > -1) {
     
    2430        }
    2531    }
     32
    2633});
    2734
  • captcha-eu/tags/v1.0.26/composer.lock

    r2962567 r2985152  
    162162        {
    163163            "name": "composer/pcre",
    164             "version": "3.1.0",
     164            "version": "3.1.1",
    165165            "source": {
    166166                "type": "git",
    167167                "url": "https://github.com/composer/pcre.git",
    168                 "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2"
    169             },
    170             "dist": {
    171                 "type": "zip",
    172                 "url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2",
    173                 "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2",
     168                "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9"
     169            },
     170            "dist": {
     171                "type": "zip",
     172                "url": "https://api.github.com/repos/composer/pcre/zipball/00104306927c7a0919b4ced2aaa6782c1e61a3c9",
     173                "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9",
    174174                "shasum": ""
    175175            },
     
    213213            "support": {
    214214                "issues": "https://github.com/composer/pcre/issues",
    215                 "source": "https://github.com/composer/pcre/tree/3.1.0"
     215                "source": "https://github.com/composer/pcre/tree/3.1.1"
    216216            },
    217217            "funding": [
     
    229229                }
    230230            ],
    231             "time": "2022-11-17T09:50:14+00:00"
     231            "time": "2023-10-11T07:11:09+00:00"
    232232        },
    233233        {
     
    456456        {
    457457            "name": "doctrine/deprecations",
    458             "version": "v1.1.1",
     458            "version": "1.1.2",
    459459            "source": {
    460460                "type": "git",
    461461                "url": "https://github.com/doctrine/deprecations.git",
    462                 "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3"
    463             },
    464             "dist": {
    465                 "type": "zip",
    466                 "url": "https://api.github.com/repos/doctrine/deprecations/zipball/612a3ee5ab0d5dd97b7cf3874a6efe24325efac3",
    467                 "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3",
     462                "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931"
     463            },
     464            "dist": {
     465                "type": "zip",
     466                "url": "https://api.github.com/repos/doctrine/deprecations/zipball/4f2d4f2836e7ec4e7a8625e75c6aa916004db931",
     467                "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931",
    468468                "shasum": ""
    469469            },
     
    497497            "support": {
    498498                "issues": "https://github.com/doctrine/deprecations/issues",
    499                 "source": "https://github.com/doctrine/deprecations/tree/v1.1.1"
    500             },
    501             "time": "2023-06-03T09:27:29+00:00"
     499                "source": "https://github.com/doctrine/deprecations/tree/1.1.2"
     500            },
     501            "time": "2023-09-27T20:04:15+00:00"
    502502        },
    503503        {
     
    651651        {
    652652            "name": "friendsofphp/php-cs-fixer",
    653             "version": "v3.25.1",
     653            "version": "v3.36.0",
    654654            "source": {
    655655                "type": "git",
    656656                "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
    657                 "reference": "8e21d69801de6b5ecb0dbe0bcdf967b335b1260b"
    658             },
    659             "dist": {
    660                 "type": "zip",
    661                 "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/8e21d69801de6b5ecb0dbe0bcdf967b335b1260b",
    662                 "reference": "8e21d69801de6b5ecb0dbe0bcdf967b335b1260b",
     657                "reference": "e889301f276c6ce2c391d6aafae9a162e785b064"
     658            },
     659            "dist": {
     660                "type": "zip",
     661                "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/e889301f276c6ce2c391d6aafae9a162e785b064",
     662                "reference": "e889301f276c6ce2c391d6aafae9a162e785b064",
    663663                "shasum": ""
    664664            },
     
    693693                "phpspec/prophecy-phpunit": "^2.0",
    694694                "phpunit/phpunit": "^9.5",
    695                 "phpunitgoodpractices/polyfill": "^1.6",
    696                 "phpunitgoodpractices/traits": "^1.9.2",
    697695                "symfony/phpunit-bridge": "^6.2.3",
    698696                "symfony/yaml": "^5.4 || ^6.0"
     
    734732            "support": {
    735733                "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
    736                 "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.25.1"
     734                "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.36.0"
    737735            },
    738736            "funding": [
     
    742740                }
    743741            ],
    744             "time": "2023-09-04T01:22:52+00:00"
     742            "time": "2023-10-27T10:12:29+00:00"
    745743        },
    746744        {
     
    16081606        {
    16091607            "name": "phpstan/phpdoc-parser",
    1610             "version": "1.23.1",
     1608            "version": "1.24.2",
    16111609            "source": {
    16121610                "type": "git",
    16131611                "url": "https://github.com/phpstan/phpdoc-parser.git",
    1614                 "reference": "846ae76eef31c6d7790fac9bc399ecee45160b26"
    1615             },
    1616             "dist": {
    1617                 "type": "zip",
    1618                 "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/846ae76eef31c6d7790fac9bc399ecee45160b26",
    1619                 "reference": "846ae76eef31c6d7790fac9bc399ecee45160b26",
     1612                "reference": "bcad8d995980440892759db0c32acae7c8e79442"
     1613            },
     1614            "dist": {
     1615                "type": "zip",
     1616                "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/bcad8d995980440892759db0c32acae7c8e79442",
     1617                "reference": "bcad8d995980440892759db0c32acae7c8e79442",
    16201618                "shasum": ""
    16211619            },
     
    16491647            "support": {
    16501648                "issues": "https://github.com/phpstan/phpdoc-parser/issues",
    1651                 "source": "https://github.com/phpstan/phpdoc-parser/tree/1.23.1"
    1652             },
    1653             "time": "2023-08-03T16:32:59+00:00"
     1649                "source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.2"
     1650            },
     1651            "time": "2023-09-26T12:28:12+00:00"
    16541652        },
    16551653        {
    16561654            "name": "phpunit/php-code-coverage",
    1657             "version": "9.2.27",
     1655            "version": "9.2.29",
    16581656            "source": {
    16591657                "type": "git",
    16601658                "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
    1661                 "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1"
    1662             },
    1663             "dist": {
    1664                 "type": "zip",
    1665                 "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/b0a88255cb70d52653d80c890bd7f38740ea50d1",
    1666                 "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1",
     1659                "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76"
     1660            },
     1661            "dist": {
     1662                "type": "zip",
     1663                "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6a3a87ac2bbe33b25042753df8195ba4aa534c76",
     1664                "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76",
    16671665                "shasum": ""
    16681666            },
     
    17211719                "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
    17221720                "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
    1723                 "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.27"
     1721                "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.29"
    17241722            },
    17251723            "funding": [
     
    17291727                }
    17301728            ],
    1731             "time": "2023-07-26T13:44:30+00:00"
     1729            "time": "2023-09-19T04:57:46+00:00"
    17321730        },
    17331731        {
     
    19741972        {
    19751973            "name": "phpunit/phpunit",
    1976             "version": "9.6.11",
     1974            "version": "9.6.13",
    19771975            "source": {
    19781976                "type": "git",
    19791977                "url": "https://github.com/sebastianbergmann/phpunit.git",
    1980                 "reference": "810500e92855eba8a7a5319ae913be2da6f957b0"
    1981             },
    1982             "dist": {
    1983                 "type": "zip",
    1984                 "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/810500e92855eba8a7a5319ae913be2da6f957b0",
    1985                 "reference": "810500e92855eba8a7a5319ae913be2da6f957b0",
     1978                "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be"
     1979            },
     1980            "dist": {
     1981                "type": "zip",
     1982                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f3d767f7f9e191eab4189abe41ab37797e30b1be",
     1983                "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be",
    19861984                "shasum": ""
    19871985            },
     
    19981996                "phar-io/version": "^3.0.2",
    19991997                "php": ">=7.3",
    2000                 "phpunit/php-code-coverage": "^9.2.13",
     1998                "phpunit/php-code-coverage": "^9.2.28",
    20011999                "phpunit/php-file-iterator": "^3.0.5",
    20022000                "phpunit/php-invoker": "^3.1.1",
     
    20572055                "issues": "https://github.com/sebastianbergmann/phpunit/issues",
    20582056                "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
    2059                 "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.11"
     2057                "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.13"
    20602058            },
    20612059            "funding": [
     
    20732071                }
    20742072            ],
    2075             "time": "2023-08-19T07:10:56+00:00"
     2073            "time": "2023-09-19T05:39:22+00:00"
    20762074        },
    20772075        {
     
    22242222        {
    22252223            "name": "psr/http-client",
    2226             "version": "1.0.2",
     2224            "version": "1.0.3",
    22272225            "source": {
    22282226                "type": "git",
    22292227                "url": "https://github.com/php-fig/http-client.git",
    2230                 "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31"
    2231             },
    2232             "dist": {
    2233                 "type": "zip",
    2234                 "url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31",
    2235                 "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31",
     2228                "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90"
     2229            },
     2230            "dist": {
     2231                "type": "zip",
     2232                "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90",
     2233                "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90",
    22362234                "shasum": ""
    22372235            },
     
    22702268            ],
    22712269            "support": {
    2272                 "source": "https://github.com/php-fig/http-client/tree/1.0.2"
    2273             },
    2274             "time": "2023-04-10T20:12:12+00:00"
     2270                "source": "https://github.com/php-fig/http-client"
     2271            },
     2272            "time": "2023-09-23T14:17:50+00:00"
    22752273        },
    22762274        {
     
    47914789        {
    47924790            "name": "symfony/string",
    4793             "version": "v5.4.26",
     4791            "version": "v5.4.29",
    47944792            "source": {
    47954793                "type": "git",
    47964794                "url": "https://github.com/symfony/string.git",
    4797                 "reference": "1181fe9270e373537475e826873b5867b863883c"
    4798             },
    4799             "dist": {
    4800                 "type": "zip",
    4801                 "url": "https://api.github.com/repos/symfony/string/zipball/1181fe9270e373537475e826873b5867b863883c",
    4802                 "reference": "1181fe9270e373537475e826873b5867b863883c",
     4795                "reference": "e41bdc93def20eaf3bfc1537c4e0a2b0680a152d"
     4796            },
     4797            "dist": {
     4798                "type": "zip",
     4799                "url": "https://api.github.com/repos/symfony/string/zipball/e41bdc93def20eaf3bfc1537c4e0a2b0680a152d",
     4800                "reference": "e41bdc93def20eaf3bfc1537c4e0a2b0680a152d",
    48034801                "shasum": ""
    48044802            },
     
    48574855            ],
    48584856            "support": {
    4859                 "source": "https://github.com/symfony/string/tree/v5.4.26"
     4857                "source": "https://github.com/symfony/string/tree/v5.4.29"
    48604858            },
    48614859            "funding": [
     
    48734871                }
    48744872            ],
    4875             "time": "2023-06-28T12:46:07+00:00"
     4873            "time": "2023-09-13T11:47:41+00:00"
    48764874        },
    48774875        {
  • captcha-eu/tags/v1.0.26/readme.txt

    r2962567 r2985152  
    55Tested up to: 6.2
    66Requires PHP: 7.0
    7 Stable tag: 1.0.25
     7Stable tag: 1.0.26
    88License: GPL
    99License URI: https://opensource.org/license/gpl/
     
    6161
    6262== Changelog ==
     63= 1.0.26 =
     64* add support for (patched) WordFence Login Security see documentation -> https://docs.captcha.eu/wordpress-install?id=-wordfence-login-security
    6365= 1.0.25 =
    6466* update readme.txt - add video
  • captcha-eu/tags/v1.0.26/src/Admin.php

    r2941141 r2985152  
    33namespace CAPTCHA\Plugin;
    44
    5 class Admin {
     5class Admin
     6{
    67    private $plugin_dir;
    78    private $plugin_dir_url;
     
    1213    private $urls;
    1314    private $sdkVersion;
    14 
    15     public function __construct($core) {
     15    private $hasWordFence;
     16
     17    public function __construct($core)
     18    {
    1619        global $wpdb;
     20        $this->hasWordFence = false;
    1721        $this->wpdb = $wpdb;
    1822        $this->core = $core;
     
    3640    }
    3741
    38     public function init() {
     42    public function init()
     43    {
    3944        $this->options();
    4045    }
    4146
    42     public function enque_scripts() {
     47    public function enque_scripts()
     48    {
    4349        // no captcha-eu plugins activated => skip sdk.js load
    4450        $plugins = get_option('captcha_at_plugin');
     
    6874    }
    6975
    70     public function enqueue_sdk_script() {
     76    public function enqueue_sdk_script()
     77    {
    7178        // check if proxy enabled
    7279        if (get_option('captcha_at_proxy_enabled')) {
     
    8390    }
    8491
    85     public function login_scripts() {
     92    public function login_scripts()
     93    {
    8694        // handle sdk.js loading
    8795        $this->enqueue_sdk_script();
     
    117125    }
    118126
    119     public function handleActivationTransient() {
     127    public function handleActivationTransient()
     128    {
    120129        // check if update transient is set
    121130        $isActivation = get_transient('captcha-at-notice-activation');
     
    127136    }
    128137
    129     public function handleEndpoint() {
     138    public function handleEndpoint()
     139    {
    130140        // if host is not set or empty => use default
    131141        if (get_option('captcha_at_host') && '' != get_option('captcha_at_host')) {
     
    136146    }
    137147
    138     public function handleSDKVersion() {
     148    public function handleSDKVersion()
     149    {
    139150        // if host is not set or empty => use default
    140151        $optKey = 'captcha_at_version_sdk';
     
    151162    }
    152163
    153     public function sdkVersionCheckUpdate($proxyForce = false) {
     164    public function sdkVersionCheckUpdate($proxyForce = false)
     165    {
    154166        // use host from options (no proxy)
    155167        $restKey = get_option('captcha_at_rest_key');
     
    207219    }
    208220
    209     private function concatInterceptors() {
     221    private function concatInterceptors()
     222    {
    210223        // get all selected plugins to add the interceptor's to
    211224        $plugins = get_option('captcha_at_plugin');
     
    245258    }
    246259
    247     private function localize_script_data($scriptData) {
     260    private function localize_script_data($scriptData)
     261    {
    248262        // localize scriptData to captchaAt variable
    249263        wp_localize_script('captcha-eu-wp', 'captchaAt', $scriptData);
    250264    }
    251265
    252     public function options() {
     266    public function options()
     267    {
    253268        register_setting('captcha-at_settings', 'captcha_at_rest_key');
    254269        register_setting('captcha-at_settings', 'captcha_at_host', ['default' => 'https://w19.captcha.at']);
     
    260275    }
    261276
    262     public function menu() {
     277    public function menu()
     278    {
    263279        $settings_page = add_menu_page(
    264280            __('Captcha.eu', 'captcha-eu'),
     
    288304    }
    289305
    290     public function pre_comment_on_post($comment_post_ID) {
     306    public function pre_comment_on_post($comment_post_ID)
     307    {
    291308        $go_back = sprintf('<br><a href="javascript:history.go(-1)">' . __('Back to', 'captcha-eu') . ' "%s"</a>', get_the_title($comment_post_ID));
    292309        $error = '<strong>' . __('ERROR', 'captcha-eu') . '</strong>:' . __('Captcha.eu failed to validate.', 'captcha-eu') . $go_back;
     
    302319    }
    303320
    304     public function authenticate($user, $username, $password) {
     321    public function authenticate($user, $username, $password)
     322    {
    305323        $error = new \WP_Error('captcha_failed', __('Captcha.eu failed', 'captcha-eu'));
    306324
     
    308326            return $user;
    309327        }
     328        $skip_by_exception = false;
     329
     330        $active_plugins = get_option('active_plugins');
     331        $wordfence_plugin = 'wordfence-login-security/wordfence-login-security.php';
     332        if (in_array($wordfence_plugin, $active_plugins)) {
     333            $this->hasWordFence = true;
     334        }
     335
     336        if ($this->hasWordFence && isset($_POST['wfls-token'])) {
     337            $skip_by_exception = true;
     338        }
     339
     340        if ($skip_by_exception) {
     341            return $user;
     342        }
     343
    310344        if (! isset($_POST['captcha_at_solution'])) {
    311345            return $error;
     
    319353    }
    320354
    321     public function allow_password_reset($allow, $user_id) {
     355    public function allow_password_reset($allow, $user_id)
     356    {
    322357        if (! isset($_POST['captcha_at_solution'])) {
    323358            return false;
     
    331366    }
    332367
    333     public function wpcf7_spam($spam, $submission) {
     368    public function wpcf7_spam($spam, $submission)
     369    {
    334370        if ($spam) {
    335371            return $spam;
     
    350386    }
    351387
    352     public function wpforms_process($fields, $entry, $form_data) {
     388    public function wpforms_process($fields, $entry, $form_data)
     389    {
    353390        if (! isset($_POST['captcha_at_solution'])) {
    354391            wpforms()->process->errors[$form_data['id']]['footer'] = esc_html__('Captcha.eu failed', 'captcha-eu');
     
    360397    }
    361398
    362     public function gform_abort_submission_with_confirmation($do_abort, $form) {
     399    public function gform_abort_submission_with_confirmation($do_abort, $form)
     400    {
    363401        if ($do_abort) {
    364402            return $do_abort;
     
    376414    }
    377415
    378     public function ninja_forms_submit_data($formData) {
     416    public function ninja_forms_submit_data($formData)
     417    {
    379418        // formData not set => exit
    380419        if (! isset($formData) || empty($formData)) {
     
    405444    }
    406445
    407     public function registration_errors($errors, $login_sanitized, $email) {
     446    public function registration_errors($errors, $login_sanitized, $email)
     447    {
    408448        // check if captcha solution supplied
    409449        if (! isset($_POST['captcha_at_solution'])) {
     
    422462    }
    423463
    424     public function mc4wp_form_errors($errors, $form) {
     464    public function mc4wp_form_errors($errors, $form)
     465    {
    425466        // no solution supplied
    426467        if (! isset($form->raw_data['captcha_at_solution'])) {
     
    439480    }
    440481
    441     public function admin_notices() {
     482    public function admin_notices()
     483    {
    442484        // only disable for captcha-eu pages
    443485        $screen = get_current_screen();
     
    472514
    473515    // check if current screen should show captcha-nag's
    474     private function nagEnabledOnPage() {
     516    private function nagEnabledOnPage()
     517    {
    475518        // get pagenow & screen
    476519        global $pagenow;
     
    480523    }
    481524
    482     public function captchaNagValidateErrors() {
     525    public function captchaNagValidateErrors()
     526    {
    483527        global $pagenow;
    484528        $screen = get_current_screen();
     
    537581    }
    538582
    539     public function captchaNagSetup($force = false) {
     583    public function captchaNagSetup($force = false)
     584    {
    540585        // SHOW NAG/NOTICE AFTER INSTALLING
    541586        global $pagenow;
     
    568613    }
    569614
    570     public function captchaNagDeactivated() {
     615    public function captchaNagDeactivated()
     616    {
    571617        // SHOW NAG/NOTICE AFTER INSTALLING
    572618        echo '<div class="update-nag captcha-at-nag">';
     
    581627    }
    582628
    583     public function plugin_deactivated() {
     629    public function plugin_deactivated()
     630    {
    584631        // clear update schedules/crons
    585632        wp_clear_scheduled_hook('captcha_at_sched_sdk_version');
     
    599646    }
    600647
    601     public function addError($error = '') {
     648    public function addError($error = '')
     649    {
    602650        // if error empty => skip
    603651        if ('' == $error) {
     
    633681    }
    634682
    635     private function options_delete_proxy() {
     683    private function options_delete_proxy()
     684    {
    636685        // delete all proxy options
    637686        delete_option('captcha_at_proxy_enabled');
     
    640689    }
    641690
    642     public function admin_scripts($hook) {
     691    public function admin_scripts($hook)
     692    {
    643693        $screen = get_current_screen();
    644694
     
    649699    }
    650700
    651     public function captcha_at_check_settings() {
     701    public function captcha_at_check_settings()
     702    {
    652703        // get values from POST
    653704        $postHost = isset($_POST['host']) ? sanitize_url($_POST['host']) : false;
     
    696747    }
    697748
    698     public function woocommerce_login_form($content = '') {
     749    public function woocommerce_login_form($content = '')
     750    {
    699751        echo '<input type="hidden" name="login" value="Login">';
    700752
     
    702754    }
    703755
    704     public function woocommerce_process_login_errors($validation_error, $login, $pass) {
     756    public function woocommerce_process_login_errors($validation_error, $login, $pass)
     757    {
    705758        if (! isset($_POST['captcha_at_solution'])) {
    706759            // no solution supplied
     
    722775    }
    723776
    724     public function woocommerce_register_form($content = '') {
     777    public function woocommerce_register_form($content = '')
     778    {
    725779        echo '<input type="hidden" name="register" value="Register">';
    726780
     
    728782    }
    729783
    730     public function woocommerce_process_registration_errors($validation_error, $user, $password, $email) {
     784    public function woocommerce_process_registration_errors($validation_error, $user, $password, $email)
     785    {
    731786        if (! isset($_POST['captcha_at_solution'])) {
    732787            // no solution supplied
     
    748803    }
    749804
    750     public function woocommerce_lostpassword_form($content = '') {
     805    public function woocommerce_lostpassword_form($content = '')
     806    {
    751807        return $content;
    752808    }
    753809
    754     public function woocommerce_after_checkout_billing_form($checkout) {
     810    public function woocommerce_after_checkout_billing_form($checkout)
     811    {
    755812        echo '<input type="hidden" name="captcha_at_solution" class="captcha_at_hidden_field" value="test">';
    756813    }
    757814
    758     public function woocommerce_after_checkout_validation($fields, $errors) {
     815    public function woocommerce_after_checkout_validation($fields, $errors)
     816    {
    759817        if (! isset($_POST['captcha_at_solution'])) {
    760818            // no solution supplied
     
    772830    }
    773831
    774     public function elementor_pro_forms_validation($record, $ajax_handler) {
     832    public function elementor_pro_forms_validation($record, $ajax_handler)
     833    {
    775834        $msgErr = __('Captcha.eu failed', 'captcha-eu');
    776835
     
    793852    }
    794853
    795     public function et_pb_contact_form_submit($processed_fields_values, $et_contact_error, $contact_form_info) {
     854    public function et_pb_contact_form_submit($processed_fields_values, $et_contact_error, $contact_form_info)
     855    {
    796856        if (! isset($_POST['captcha_at_solution'])) {
    797857            echo __('Captcha.eu failed', 'captcha-eu');
     
    807867    }
    808868
    809     public function pre_update_option_captcha_at_proxy_enabled($valueNew, $valueOld) {
     869    public function pre_update_option_captcha_at_proxy_enabled($valueNew, $valueOld)
     870    {
    810871        // option has been updated => check
    811872        $proxyEnable = $valueNew;
     
    822883    }
    823884
    824     public function rest_get_sdkjs() {
     885    public function rest_get_sdkjs()
     886    {
    825887        // set content type header to javascript
    826888        header('Content-Type: application/javascript');
     
    832894    }
    833895
    834     public function rest_challenge(\WP_REST_Request $request) {
     896    public function rest_challenge(\WP_REST_Request $request)
     897    {
    835898        // get param from url
    836899        $publicSecret = $request->get_param('publicSecret');
     
    884947    }
    885948
    886     public function rest_api_init() {
     949    public function rest_api_init()
     950    {
    887951        // serve sdk.js
    888952        register_rest_route('captcha-eu/v1', '/sdk.js', [
     
    900964    }
    901965
    902     public function add_filters() {
     966    public function add_filters()
     967    {
    903968        // get selected plugins from option
    904969        $selectedPlugins = get_option('captcha_at_plugin');
     
    10121077    }
    10131078
    1014     public function notice($type = '', $msg = '') {
     1079    public function notice($type = '', $msg = '')
     1080    {
    10151081        return (object) [
    10161082            'type' => $type,
     
    10191085    }
    10201086
    1021     private function apiFetchLatestVersion() {
     1087    private function apiFetchLatestVersion()
     1088    {
    10221089        // fetch asset version info route
    10231090        $data = wp_remote_get($this->endpoint . '/version?t=' . time(), [
     
    10511118    }
    10521119
    1053     private function apiFetchPersonal($host = '', $restKey = '') {
     1120    private function apiFetchPersonal($host = '', $restKey = '')
     1121    {
    10541122        // fetch personal info route
    10551123        $data = wp_remote_get($host . '/api/personal', [
     
    10761144    }
    10771145
    1078     private function getApiOptions() {
     1146    private function getApiOptions()
     1147    {
    10791148        $host = get_option('captcha_at_host');
    10801149
     
    10911160    }
    10921161
    1093     private function getPluginData() {
     1162    private function getPluginData()
     1163    {
    10941164        // ensure get_plugin_data is available
    10951165        if (! function_exists('get_plugin_data')) {
     
    11021172    }
    11031173
    1104     public function options_page() {
     1174    public function options_page()
     1175    {
    11051176        // define vars for the option page to use
    11061177
     
    12551326    }
    12561327
    1257     public function options_page_settings() {
     1328    public function options_page_settings()
     1329    {
    12581330        // configErrors => used to display errors/notices on option settings page
    12591331        $configMessages = [];
  • captcha-eu/tags/v1.0.26/src/Core.php

    r2941141 r2985152  
    33namespace CAPTCHA\Plugin;
    44
    5 class Core {
     5class Core
     6{
    67    private $plugin_dir;
    78    private $plugin_dir_url;
     
    1112    public $options;
    1213
    13     public function __construct() {
     14    public function __construct()
     15    {
    1416        global $wpdb;
    1517        $this->wpdb = $wpdb;
     
    2123    }
    2224
    23     public function getRealIP() {
     25    public function getRealIP()
     26    {
    2427        // Check if the header is present
    2528        if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
     
    4245    }
    4346
    44     public function anonymizeIP($ip) {
     47    public function anonymizeIP($ip)
     48    {
    4549        // Check if the IP address is IPv4 or IPv6
    4650        if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
     
    7175    }
    7276
    73     public function validate($solution) {
     77    public function validate($solution)
     78    {
    7479        $url  = $this->admin->endpoint;
    7580        $restKey  = get_option('captcha_at_rest_key');
    76         $url = $url . '/validate';
     81        $url .= '/validate';
    7782
    7883        // if the request is made through a proxy or load balancer
  • captcha-eu/tags/v1.0.26/src/Frontend.php

    r2941141 r2985152  
    33namespace CAPTCHA\Plugin;
    44
    5 class Frontend {
     5class Frontend
     6{
    67    private $plugin_dir;
    78    private $wpdb;
    89    private $core;
    910
    10     public function __construct($core) {
     11    public function __construct($core)
     12    {
    1113        global $wpdb;
    1214        $this->wpdb = $wpdb;
     
    1517    }
    1618
    17     public function add_filters() {
     19    public function add_filters()
     20    {
    1821    }
    1922}
  • captcha-eu/tags/v1.0.26/src/Options.php

    r2941141 r2985152  
    33namespace CAPTCHA\Plugin;
    44
    5 class Options {
     5class Options
     6{
    67    private $plugin_dir;
    78    private $plugin_dir_url;
     
    910    private $optionErrors;
    1011
    11     public function __construct($core) {
     12    public function __construct($core)
     13    {
    1214        $this->core = $core;
    1315
     
    2224    }
    2325
    24     private function add_actions() {
     26    private function add_actions()
     27    {
    2528        add_action('admin_menu', [$this, 'enqueue_styles'], 20);
    2629    }
    2730
    28     public function enqueue_styles() {
     31    public function enqueue_styles()
     32    {
    2933        wp_enqueue_style('captchaOptions', $this->plugin_dir_url . 'assets/css/options.css');
    3034    }
    3135
    3236    // render title
    33     public function fieldTitle($val = '', $icon = '') {
     37    public function fieldTitle($val = '', $icon = '')
     38    {
    3439        // empty => don't output
    3540        if ('' == $val) {
     
    5156
    5257    // render k/v table
    53     public function fieldKeyValue($arrKV = []) {
     58    public function fieldKeyValue($arrKV = [])
     59    {
    5460        if ([] == $arrKV) {
    5561            return '';
     
    7783
    7884    // wrap items in div
    79     public function wrapInDiv($class = '', $content = []) {
     85    public function wrapInDiv($class = '', $content = [])
     86    {
    8087        $out = '';
    8188
     
    94101
    95102    // render label
    96     public function fieldLabel($for = '', $val = '') {
     103    public function fieldLabel($for = '', $val = '')
     104    {
    97105        // empty => don't output
    98106        if ('' == $for || '' == $val) {
     
    104112
    105113    // render info icon with title text
    106     public function fieldInfoIcon($title = '') {
     114    public function fieldInfoIcon($title = '')
     115    {
    107116        // empty => don't output
    108117        if ('' == $title) {
     
    114123
    115124    // render input field with type text
    116     public function fieldInputText($name = '', $val = '', $placeholder = '') {
     125    public function fieldInputText($name = '', $val = '', $placeholder = '')
     126    {
    117127        // empty => don't output
    118128        if ('' == $name) {
     
    124134
    125135    // render textarea field
    126     public function fieldInputTextarea($name = '', $val = '', $placeholder = '') {
     136    public function fieldInputTextarea($name = '', $val = '', $placeholder = '')
     137    {
    127138        // empty => don't output
    128139        if ('' == $name) {
     
    134145
    135146    // render input field with type checkbox & corresponding labels
    136     public function fieldInputCheckbox($name = '', $options = [], $checked = '', $multiple = false) {
     147    public function fieldInputCheckbox($name = '', $options = [], $checked = '', $multiple = false)
     148    {
    137149        // empty => don't output
    138150        if ('' == $name || [] == $options) {
     
    170182
    171183    // render panel with message
    172     public function panelMSG($type = '', $msg = '') {
     184    public function panelMSG($type = '', $msg = '')
     185    {
    173186        // empty => don't output
    174187        if ('' == $msg) {
     
    184197
    185198    // render panel with message
    186     public function settingsPanel($fields = [], $class = '') {
     199    public function settingsPanel($fields = [], $class = '')
     200    {
    187201        // empty => don't output
    188202        if (empty($fields)) {
  • captcha-eu/tags/v1.0.26/tests/phpunit/PrettyPrinter.php

    r2906129 r2985152  
    33namespace Test;
    44
    5 class PrettyPrinter extends \PHPUnit\TextUI\ResultPrinter implements \PHPUnit\Framework\TestListener {
     5class PrettyPrinter extends \PHPUnit\TextUI\ResultPrinter implements \PHPUnit\Framework\TestListener
     6{
    67    private $headerPrinted = false;
    78
     
    1011     * unit test summary (after all tests have run).
    1112     */
    12     protected function printHeader(): void {
     13    protected function printHeader(): void
     14    {
    1315        parent::printHeader();
    1416    }
    1517
    16     protected function formatExceptionMsg($exceptionMessage) {
     18    protected function formatExceptionMsg($exceptionMessage)
     19    {
    1720        $exceptionMessage = str_replace("+++ Actual\n", '', $exceptionMessage);
    1821        $exceptionMessage = str_replace("--- Expected\n", '', $exceptionMessage);
     
    2427    }
    2528
    26     protected function printDefectTrace(\PHPUnit\Framework\TestFailure $defect): void {
     29    protected function printDefectTrace(\PHPUnit\Framework\TestFailure $defect): void
     30    {
    2731        $this->write($this->formatExceptionMsg($defect->getExceptionAsString()));
    2832        $trace = \PHPUnit\Util\Filter::getFilteredStacktrace(
     
    4953     * @param string $color   optional color (if supported by console)
    5054     */
    51     private function out($message, $color = '', $linebreak = false) {
     55    private function out($message, $color = '', $linebreak = false)
     56    {
    5257        echo($color ? $this->formatWithColor($color, $message) : $message) . ($linebreak ? "\n" : '');
    5358    }
     
    5661     * Fired prior to each individual test.
    5762     */
    58     public function startTest(\PHPUnit\Framework\Test $test): void {
     63    public function startTest(\PHPUnit\Framework\Test $test): void
     64    {
    5965        $this->out(">> RUN '" . preg_replace('/^test/', '', $test->getName()) . "'...");
    6066    }
     
    6672     * @param int time of execution
    6773     */
    68     public function endTest(\PHPUnit\Framework\Test $test, $time): void {
     74    public function endTest(\PHPUnit\Framework\Test $test, $time): void
     75    {
    6976        // copied from parent:endTest()
    7077        if ($test instanceof \PHPUnit\Framework\TestCase) {
     
    93100     * called at the initialization of each test suite.
    94101     */
    95     public function prettySuiteName($s) {
     102    public function prettySuiteName($s)
     103    {
    96104        return preg_replace("/^Tests\\\/", '', $s);
    97105    }
    98106
    99     public function startTestSuite(\PHPUnit\Framework\TestSuite $suite): void {
     107    public function startTestSuite(\PHPUnit\Framework\TestSuite $suite): void
     108    {
    100109        parent::startTestSuite($suite);
    101110        if (! $this->headerPrinted) {
     
    116125    }
    117126
    118     public function endTestSuite(\PHPUnit\Framework\TestSuite $suite): void {
     127    public function endTestSuite(\PHPUnit\Framework\TestSuite $suite): void
     128    {
    119129        if ('PHPUnit' != $suite->getName()) {
    120130            $this->out("END SUITE '" . $this->prettySuiteName($suite->getName()) . "'\n\n");
     
    128138     * @param string $progress
    129139     */
    130     protected function writeProgress($progress): void {
     140    protected function writeProgress($progress): void
     141    {
    131142        // suppress output;
    132143    }
  • captcha-eu/tags/v1.0.26/tests/phpunit/bootstrap.php

    r2906129 r2985152  
    1212define('KRN_IS_TESTING', 1);
    1313
    14 class bootstrap {
    15     public function __construct() {
     14class bootstrap
     15{
     16    public function __construct()
     17    {
    1618        $_tests_dir = getenv('WP_TESTS_DIR');
    1719        if (! $_tests_dir) {
     
    3032    }
    3133
    32     public function _manually_load_plugin() {
     34    public function _manually_load_plugin()
     35    {
    3336        require dirname(dirname(__FILE__)) . '../../kmm-flattable.php';
    3437    }
  • captcha-eu/tags/v1.0.26/tests/test-captcha.php

    r2906129 r2985152  
    11<?php
    22/**
    3 * @covers \KMM\Flattable\Core
    4 */
     3 * @covers \KMM\Flattable\Core
     4 */
    55use CAPTCHA\Plugin\Core;
    66
    7 class FlattableTestDB {
     7class FlattableTestDB
     8{
    89    public $prefix = 'wptest';
    910
    10     public function query($sql) {
     11    public function query($sql)
     12    {
    1113    }
    1214
    13     public function get_results($r) {
     15    public function get_results($r)
     16    {
    1417    }
    1518
    16     public function prepare($data) {
     19    public function prepare($data)
     20    {
    1721    }
    1822}
    1923
    20 class TestFlattable extends \WP_UnitTestCase {
    21     public function setUp(): void {
     24class TestFlattable extends \WP_UnitTestCase
     25{
     26    public function setUp(): void
     27    {
    2228        // setup a rest server
    2329        parent::setUp();
     
    2834     * @test
    2935     */
    30     public function dummy_test() {
     36    public function dummy_test()
     37    {
    3138        $this->assertNull(null);
    3239    }
    3340
    34     public function tearDown(): void {
     41    public function tearDown(): void
     42    {
    3543        parent::tearDown();
    3644    }
  • captcha-eu/tags/v1.0.26/vendor/autoload.php

    r2962567 r2985152  
    2323require_once __DIR__ . '/composer/autoload_real.php';
    2424
    25 return ComposerAutoloaderInitc6537ae706336734539418e7c25e7522::getLoader();
     25return ComposerAutoloaderInit317f193e59d41c516767761402e9a3bd::getLoader();
  • captcha-eu/tags/v1.0.26/vendor/composer/autoload_real.php

    r2962567 r2985152  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInitc6537ae706336734539418e7c25e7522
     5class ComposerAutoloaderInit317f193e59d41c516767761402e9a3bd
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInitc6537ae706336734539418e7c25e7522', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit317f193e59d41c516767761402e9a3bd', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInitc6537ae706336734539418e7c25e7522', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit317f193e59d41c516767761402e9a3bd', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInitc6537ae706336734539418e7c25e7522::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInit317f193e59d41c516767761402e9a3bd::getInitializer($loader));
    3333
    3434        $loader->register(true);
  • captcha-eu/tags/v1.0.26/vendor/composer/autoload_static.php

    r2962567 r2985152  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInitc6537ae706336734539418e7c25e7522
     7class ComposerStaticInit317f193e59d41c516767761402e9a3bd
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    3232    {
    3333        return \Closure::bind(function () use ($loader) {
    34             $loader->prefixLengthsPsr4 = ComposerStaticInitc6537ae706336734539418e7c25e7522::$prefixLengthsPsr4;
    35             $loader->prefixDirsPsr4 = ComposerStaticInitc6537ae706336734539418e7c25e7522::$prefixDirsPsr4;
    36             $loader->classMap = ComposerStaticInitc6537ae706336734539418e7c25e7522::$classMap;
     34            $loader->prefixLengthsPsr4 = ComposerStaticInit317f193e59d41c516767761402e9a3bd::$prefixLengthsPsr4;
     35            $loader->prefixDirsPsr4 = ComposerStaticInit317f193e59d41c516767761402e9a3bd::$prefixDirsPsr4;
     36            $loader->classMap = ComposerStaticInit317f193e59d41c516767761402e9a3bd::$classMap;
    3737
    3838        }, null, ClassLoader::class);
  • captcha-eu/tags/v1.0.26/vendor/composer/installers/.git/logs/HEAD

    r2962567 r2985152  
    1 0000000000000000000000000000000000000000 2a9170263fcd9cc4fd0b50917293c21d6c1a5bfe Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1693833695 +0000   clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/
    2 2a9170263fcd9cc4fd0b50917293c21d6c1a5bfe d20a64ed3c94748397ff5973488761b22f6d3f19 Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1693833695 +0000   checkout: moving from main to v1.12.0
     10000000000000000000000000000000000000000 2a9170263fcd9cc4fd0b50917293c21d6c1a5bfe Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1698435822 +0000   clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/
     22a9170263fcd9cc4fd0b50917293c21d6c1a5bfe d20a64ed3c94748397ff5973488761b22f6d3f19 Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1698435822 +0000   checkout: moving from main to v1.12.0
  • captcha-eu/tags/v1.0.26/vendor/composer/installers/.git/logs/refs/heads/main

    r2962567 r2985152  
    1 0000000000000000000000000000000000000000 2a9170263fcd9cc4fd0b50917293c21d6c1a5bfe Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1693833695 +0000   clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/
     10000000000000000000000000000000000000000 2a9170263fcd9cc4fd0b50917293c21d6c1a5bfe Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1698435822 +0000   clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/
  • captcha-eu/tags/v1.0.26/vendor/composer/installers/.git/logs/refs/remotes/origin/HEAD

    r2962567 r2985152  
    1 0000000000000000000000000000000000000000 2a9170263fcd9cc4fd0b50917293c21d6c1a5bfe Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1693833695 +0000   clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/
     10000000000000000000000000000000000000000 2a9170263fcd9cc4fd0b50917293c21d6c1a5bfe Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1698435822 +0000   clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/
  • captcha-eu/tags/v1.0.26/wp-captcha.php

    r2962567 r2985152  
    44 * Description: Captcha.eu provides a GDPR compliant protection against bots and spammers.
    55 * Plugin URI:  https://www.captcha.eu
    6  * Version:     1.0.25
     6 * Version:     1.0.26
    77 * Author:      captchaeu
    88 * Author URI:  https://profiles.wordpress.org/captchaeu/
  • captcha-eu/trunk/.php-cs-fixer.php

    r2906129 r2985152  
    33use PhpCsFixer\Config;
    44
    5 final class Php73 extends Config {
    6     public function __construct() {
     5final class Php73 extends Config
     6{
     7    public function __construct()
     8    {
    79        parent::__construct('KRNStyle');
    810        $this->setRiskyAllowed(true);
    911    }
    1012
    11     public function getRules(): array {
     13    public function getRules(): array
     14    {
    1215        $rules = [
    1316        '@Symfony' => true,
     
    5356                'self_accessor' => true,
    5457                'short_scalar_cast' => true,
    55                 'single_blank_line_before_namespace' => true,
    5658                'single_class_element_per_statement' => true,
    5759                'single_quote' => true,
  • captcha-eu/trunk/assets/login.js

    r2906129 r2985152  
    44    KROT.KROT_HOST = captchaAt.host;
    55
     6    var skipByException = false;
    67    // Login
    7     if(captchaAt.plugins.indexOf('_wp-login') > -1) {
    8         if(jQuery('#loginform').length > 0) {
    9             KROT.interceptForm(jQuery('#loginform')[0]);
     8    if(window.WFLSVars) {
     9        skipByException = true;
     10    }   
     11
     12    if(!skipByException) {
     13        if(captchaAt.plugins.indexOf('_wp-login') > -1) {
     14            if(jQuery('#loginform').length > 0) {
     15                KROT.interceptForm(jQuery('#loginform')[0]);
     16            }
    1017        }
    1118    }
     
    1724        }
    1825    }
    19 
    2026    // Register
    2127    if(captchaAt.plugins.indexOf('_wp-registration') > -1) {
     
    2430        }
    2531    }
     32
    2633});
    2734
  • captcha-eu/trunk/composer.lock

    r2962567 r2985152  
    162162        {
    163163            "name": "composer/pcre",
    164             "version": "3.1.0",
     164            "version": "3.1.1",
    165165            "source": {
    166166                "type": "git",
    167167                "url": "https://github.com/composer/pcre.git",
    168                 "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2"
    169             },
    170             "dist": {
    171                 "type": "zip",
    172                 "url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2",
    173                 "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2",
     168                "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9"
     169            },
     170            "dist": {
     171                "type": "zip",
     172                "url": "https://api.github.com/repos/composer/pcre/zipball/00104306927c7a0919b4ced2aaa6782c1e61a3c9",
     173                "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9",
    174174                "shasum": ""
    175175            },
     
    213213            "support": {
    214214                "issues": "https://github.com/composer/pcre/issues",
    215                 "source": "https://github.com/composer/pcre/tree/3.1.0"
     215                "source": "https://github.com/composer/pcre/tree/3.1.1"
    216216            },
    217217            "funding": [
     
    229229                }
    230230            ],
    231             "time": "2022-11-17T09:50:14+00:00"
     231            "time": "2023-10-11T07:11:09+00:00"
    232232        },
    233233        {
     
    456456        {
    457457            "name": "doctrine/deprecations",
    458             "version": "v1.1.1",
     458            "version": "1.1.2",
    459459            "source": {
    460460                "type": "git",
    461461                "url": "https://github.com/doctrine/deprecations.git",
    462                 "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3"
    463             },
    464             "dist": {
    465                 "type": "zip",
    466                 "url": "https://api.github.com/repos/doctrine/deprecations/zipball/612a3ee5ab0d5dd97b7cf3874a6efe24325efac3",
    467                 "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3",
     462                "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931"
     463            },
     464            "dist": {
     465                "type": "zip",
     466                "url": "https://api.github.com/repos/doctrine/deprecations/zipball/4f2d4f2836e7ec4e7a8625e75c6aa916004db931",
     467                "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931",
    468468                "shasum": ""
    469469            },
     
    497497            "support": {
    498498                "issues": "https://github.com/doctrine/deprecations/issues",
    499                 "source": "https://github.com/doctrine/deprecations/tree/v1.1.1"
    500             },
    501             "time": "2023-06-03T09:27:29+00:00"
     499                "source": "https://github.com/doctrine/deprecations/tree/1.1.2"
     500            },
     501            "time": "2023-09-27T20:04:15+00:00"
    502502        },
    503503        {
     
    651651        {
    652652            "name": "friendsofphp/php-cs-fixer",
    653             "version": "v3.25.1",
     653            "version": "v3.36.0",
    654654            "source": {
    655655                "type": "git",
    656656                "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
    657                 "reference": "8e21d69801de6b5ecb0dbe0bcdf967b335b1260b"
    658             },
    659             "dist": {
    660                 "type": "zip",
    661                 "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/8e21d69801de6b5ecb0dbe0bcdf967b335b1260b",
    662                 "reference": "8e21d69801de6b5ecb0dbe0bcdf967b335b1260b",
     657                "reference": "e889301f276c6ce2c391d6aafae9a162e785b064"
     658            },
     659            "dist": {
     660                "type": "zip",
     661                "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/e889301f276c6ce2c391d6aafae9a162e785b064",
     662                "reference": "e889301f276c6ce2c391d6aafae9a162e785b064",
    663663                "shasum": ""
    664664            },
     
    693693                "phpspec/prophecy-phpunit": "^2.0",
    694694                "phpunit/phpunit": "^9.5",
    695                 "phpunitgoodpractices/polyfill": "^1.6",
    696                 "phpunitgoodpractices/traits": "^1.9.2",
    697695                "symfony/phpunit-bridge": "^6.2.3",
    698696                "symfony/yaml": "^5.4 || ^6.0"
     
    734732            "support": {
    735733                "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
    736                 "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.25.1"
     734                "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.36.0"
    737735            },
    738736            "funding": [
     
    742740                }
    743741            ],
    744             "time": "2023-09-04T01:22:52+00:00"
     742            "time": "2023-10-27T10:12:29+00:00"
    745743        },
    746744        {
     
    16081606        {
    16091607            "name": "phpstan/phpdoc-parser",
    1610             "version": "1.23.1",
     1608            "version": "1.24.2",
    16111609            "source": {
    16121610                "type": "git",
    16131611                "url": "https://github.com/phpstan/phpdoc-parser.git",
    1614                 "reference": "846ae76eef31c6d7790fac9bc399ecee45160b26"
    1615             },
    1616             "dist": {
    1617                 "type": "zip",
    1618                 "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/846ae76eef31c6d7790fac9bc399ecee45160b26",
    1619                 "reference": "846ae76eef31c6d7790fac9bc399ecee45160b26",
     1612                "reference": "bcad8d995980440892759db0c32acae7c8e79442"
     1613            },
     1614            "dist": {
     1615                "type": "zip",
     1616                "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/bcad8d995980440892759db0c32acae7c8e79442",
     1617                "reference": "bcad8d995980440892759db0c32acae7c8e79442",
    16201618                "shasum": ""
    16211619            },
     
    16491647            "support": {
    16501648                "issues": "https://github.com/phpstan/phpdoc-parser/issues",
    1651                 "source": "https://github.com/phpstan/phpdoc-parser/tree/1.23.1"
    1652             },
    1653             "time": "2023-08-03T16:32:59+00:00"
     1649                "source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.2"
     1650            },
     1651            "time": "2023-09-26T12:28:12+00:00"
    16541652        },
    16551653        {
    16561654            "name": "phpunit/php-code-coverage",
    1657             "version": "9.2.27",
     1655            "version": "9.2.29",
    16581656            "source": {
    16591657                "type": "git",
    16601658                "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
    1661                 "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1"
    1662             },
    1663             "dist": {
    1664                 "type": "zip",
    1665                 "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/b0a88255cb70d52653d80c890bd7f38740ea50d1",
    1666                 "reference": "b0a88255cb70d52653d80c890bd7f38740ea50d1",
     1659                "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76"
     1660            },
     1661            "dist": {
     1662                "type": "zip",
     1663                "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6a3a87ac2bbe33b25042753df8195ba4aa534c76",
     1664                "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76",
    16671665                "shasum": ""
    16681666            },
     
    17211719                "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
    17221720                "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
    1723                 "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.27"
     1721                "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.29"
    17241722            },
    17251723            "funding": [
     
    17291727                }
    17301728            ],
    1731             "time": "2023-07-26T13:44:30+00:00"
     1729            "time": "2023-09-19T04:57:46+00:00"
    17321730        },
    17331731        {
     
    19741972        {
    19751973            "name": "phpunit/phpunit",
    1976             "version": "9.6.11",
     1974            "version": "9.6.13",
    19771975            "source": {
    19781976                "type": "git",
    19791977                "url": "https://github.com/sebastianbergmann/phpunit.git",
    1980                 "reference": "810500e92855eba8a7a5319ae913be2da6f957b0"
    1981             },
    1982             "dist": {
    1983                 "type": "zip",
    1984                 "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/810500e92855eba8a7a5319ae913be2da6f957b0",
    1985                 "reference": "810500e92855eba8a7a5319ae913be2da6f957b0",
     1978                "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be"
     1979            },
     1980            "dist": {
     1981                "type": "zip",
     1982                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f3d767f7f9e191eab4189abe41ab37797e30b1be",
     1983                "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be",
    19861984                "shasum": ""
    19871985            },
     
    19981996                "phar-io/version": "^3.0.2",
    19991997                "php": ">=7.3",
    2000                 "phpunit/php-code-coverage": "^9.2.13",
     1998                "phpunit/php-code-coverage": "^9.2.28",
    20011999                "phpunit/php-file-iterator": "^3.0.5",
    20022000                "phpunit/php-invoker": "^3.1.1",
     
    20572055                "issues": "https://github.com/sebastianbergmann/phpunit/issues",
    20582056                "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
    2059                 "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.11"
     2057                "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.13"
    20602058            },
    20612059            "funding": [
     
    20732071                }
    20742072            ],
    2075             "time": "2023-08-19T07:10:56+00:00"
     2073            "time": "2023-09-19T05:39:22+00:00"
    20762074        },
    20772075        {
     
    22242222        {
    22252223            "name": "psr/http-client",
    2226             "version": "1.0.2",
     2224            "version": "1.0.3",
    22272225            "source": {
    22282226                "type": "git",
    22292227                "url": "https://github.com/php-fig/http-client.git",
    2230                 "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31"
    2231             },
    2232             "dist": {
    2233                 "type": "zip",
    2234                 "url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31",
    2235                 "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31",
     2228                "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90"
     2229            },
     2230            "dist": {
     2231                "type": "zip",
     2232                "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90",
     2233                "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90",
    22362234                "shasum": ""
    22372235            },
     
    22702268            ],
    22712269            "support": {
    2272                 "source": "https://github.com/php-fig/http-client/tree/1.0.2"
    2273             },
    2274             "time": "2023-04-10T20:12:12+00:00"
     2270                "source": "https://github.com/php-fig/http-client"
     2271            },
     2272            "time": "2023-09-23T14:17:50+00:00"
    22752273        },
    22762274        {
     
    47914789        {
    47924790            "name": "symfony/string",
    4793             "version": "v5.4.26",
     4791            "version": "v5.4.29",
    47944792            "source": {
    47954793                "type": "git",
    47964794                "url": "https://github.com/symfony/string.git",
    4797                 "reference": "1181fe9270e373537475e826873b5867b863883c"
    4798             },
    4799             "dist": {
    4800                 "type": "zip",
    4801                 "url": "https://api.github.com/repos/symfony/string/zipball/1181fe9270e373537475e826873b5867b863883c",
    4802                 "reference": "1181fe9270e373537475e826873b5867b863883c",
     4795                "reference": "e41bdc93def20eaf3bfc1537c4e0a2b0680a152d"
     4796            },
     4797            "dist": {
     4798                "type": "zip",
     4799                "url": "https://api.github.com/repos/symfony/string/zipball/e41bdc93def20eaf3bfc1537c4e0a2b0680a152d",
     4800                "reference": "e41bdc93def20eaf3bfc1537c4e0a2b0680a152d",
    48034801                "shasum": ""
    48044802            },
     
    48574855            ],
    48584856            "support": {
    4859                 "source": "https://github.com/symfony/string/tree/v5.4.26"
     4857                "source": "https://github.com/symfony/string/tree/v5.4.29"
    48604858            },
    48614859            "funding": [
     
    48734871                }
    48744872            ],
    4875             "time": "2023-06-28T12:46:07+00:00"
     4873            "time": "2023-09-13T11:47:41+00:00"
    48764874        },
    48774875        {
  • captcha-eu/trunk/readme.txt

    r2962567 r2985152  
    55Tested up to: 6.2
    66Requires PHP: 7.0
    7 Stable tag: 1.0.25
     7Stable tag: 1.0.26
    88License: GPL
    99License URI: https://opensource.org/license/gpl/
     
    6161
    6262== Changelog ==
     63= 1.0.26 =
     64* add support for (patched) WordFence Login Security see documentation -> https://docs.captcha.eu/wordpress-install?id=-wordfence-login-security
    6365= 1.0.25 =
    6466* update readme.txt - add video
  • captcha-eu/trunk/src/Admin.php

    r2941141 r2985152  
    33namespace CAPTCHA\Plugin;
    44
    5 class Admin {
     5class Admin
     6{
    67    private $plugin_dir;
    78    private $plugin_dir_url;
     
    1213    private $urls;
    1314    private $sdkVersion;
    14 
    15     public function __construct($core) {
     15    private $hasWordFence;
     16
     17    public function __construct($core)
     18    {
    1619        global $wpdb;
     20        $this->hasWordFence = false;
    1721        $this->wpdb = $wpdb;
    1822        $this->core = $core;
     
    3640    }
    3741
    38     public function init() {
     42    public function init()
     43    {
    3944        $this->options();
    4045    }
    4146
    42     public function enque_scripts() {
     47    public function enque_scripts()
     48    {
    4349        // no captcha-eu plugins activated => skip sdk.js load
    4450        $plugins = get_option('captcha_at_plugin');
     
    6874    }
    6975
    70     public function enqueue_sdk_script() {
     76    public function enqueue_sdk_script()
     77    {
    7178        // check if proxy enabled
    7279        if (get_option('captcha_at_proxy_enabled')) {
     
    8390    }
    8491
    85     public function login_scripts() {
     92    public function login_scripts()
     93    {
    8694        // handle sdk.js loading
    8795        $this->enqueue_sdk_script();
     
    117125    }
    118126
    119     public function handleActivationTransient() {
     127    public function handleActivationTransient()
     128    {
    120129        // check if update transient is set
    121130        $isActivation = get_transient('captcha-at-notice-activation');
     
    127136    }
    128137
    129     public function handleEndpoint() {
     138    public function handleEndpoint()
     139    {
    130140        // if host is not set or empty => use default
    131141        if (get_option('captcha_at_host') && '' != get_option('captcha_at_host')) {
     
    136146    }
    137147
    138     public function handleSDKVersion() {
     148    public function handleSDKVersion()
     149    {
    139150        // if host is not set or empty => use default
    140151        $optKey = 'captcha_at_version_sdk';
     
    151162    }
    152163
    153     public function sdkVersionCheckUpdate($proxyForce = false) {
     164    public function sdkVersionCheckUpdate($proxyForce = false)
     165    {
    154166        // use host from options (no proxy)
    155167        $restKey = get_option('captcha_at_rest_key');
     
    207219    }
    208220
    209     private function concatInterceptors() {
     221    private function concatInterceptors()
     222    {
    210223        // get all selected plugins to add the interceptor's to
    211224        $plugins = get_option('captcha_at_plugin');
     
    245258    }
    246259
    247     private function localize_script_data($scriptData) {
     260    private function localize_script_data($scriptData)
     261    {
    248262        // localize scriptData to captchaAt variable
    249263        wp_localize_script('captcha-eu-wp', 'captchaAt', $scriptData);
    250264    }
    251265
    252     public function options() {
     266    public function options()
     267    {
    253268        register_setting('captcha-at_settings', 'captcha_at_rest_key');
    254269        register_setting('captcha-at_settings', 'captcha_at_host', ['default' => 'https://w19.captcha.at']);
     
    260275    }
    261276
    262     public function menu() {
     277    public function menu()
     278    {
    263279        $settings_page = add_menu_page(
    264280            __('Captcha.eu', 'captcha-eu'),
     
    288304    }
    289305
    290     public function pre_comment_on_post($comment_post_ID) {
     306    public function pre_comment_on_post($comment_post_ID)
     307    {
    291308        $go_back = sprintf('<br><a href="javascript:history.go(-1)">' . __('Back to', 'captcha-eu') . ' "%s"</a>', get_the_title($comment_post_ID));
    292309        $error = '<strong>' . __('ERROR', 'captcha-eu') . '</strong>:' . __('Captcha.eu failed to validate.', 'captcha-eu') . $go_back;
     
    302319    }
    303320
    304     public function authenticate($user, $username, $password) {
     321    public function authenticate($user, $username, $password)
     322    {
    305323        $error = new \WP_Error('captcha_failed', __('Captcha.eu failed', 'captcha-eu'));
    306324
     
    308326            return $user;
    309327        }
     328        $skip_by_exception = false;
     329
     330        $active_plugins = get_option('active_plugins');
     331        $wordfence_plugin = 'wordfence-login-security/wordfence-login-security.php';
     332        if (in_array($wordfence_plugin, $active_plugins)) {
     333            $this->hasWordFence = true;
     334        }
     335
     336        if ($this->hasWordFence && isset($_POST['wfls-token'])) {
     337            $skip_by_exception = true;
     338        }
     339
     340        if ($skip_by_exception) {
     341            return $user;
     342        }
     343
    310344        if (! isset($_POST['captcha_at_solution'])) {
    311345            return $error;
     
    319353    }
    320354
    321     public function allow_password_reset($allow, $user_id) {
     355    public function allow_password_reset($allow, $user_id)
     356    {
    322357        if (! isset($_POST['captcha_at_solution'])) {
    323358            return false;
     
    331366    }
    332367
    333     public function wpcf7_spam($spam, $submission) {
     368    public function wpcf7_spam($spam, $submission)
     369    {
    334370        if ($spam) {
    335371            return $spam;
     
    350386    }
    351387
    352     public function wpforms_process($fields, $entry, $form_data) {
     388    public function wpforms_process($fields, $entry, $form_data)
     389    {
    353390        if (! isset($_POST['captcha_at_solution'])) {
    354391            wpforms()->process->errors[$form_data['id']]['footer'] = esc_html__('Captcha.eu failed', 'captcha-eu');
     
    360397    }
    361398
    362     public function gform_abort_submission_with_confirmation($do_abort, $form) {
     399    public function gform_abort_submission_with_confirmation($do_abort, $form)
     400    {
    363401        if ($do_abort) {
    364402            return $do_abort;
     
    376414    }
    377415
    378     public function ninja_forms_submit_data($formData) {
     416    public function ninja_forms_submit_data($formData)
     417    {
    379418        // formData not set => exit
    380419        if (! isset($formData) || empty($formData)) {
     
    405444    }
    406445
    407     public function registration_errors($errors, $login_sanitized, $email) {
     446    public function registration_errors($errors, $login_sanitized, $email)
     447    {
    408448        // check if captcha solution supplied
    409449        if (! isset($_POST['captcha_at_solution'])) {
     
    422462    }
    423463
    424     public function mc4wp_form_errors($errors, $form) {
     464    public function mc4wp_form_errors($errors, $form)
     465    {
    425466        // no solution supplied
    426467        if (! isset($form->raw_data['captcha_at_solution'])) {
     
    439480    }
    440481
    441     public function admin_notices() {
     482    public function admin_notices()
     483    {
    442484        // only disable for captcha-eu pages
    443485        $screen = get_current_screen();
     
    472514
    473515    // check if current screen should show captcha-nag's
    474     private function nagEnabledOnPage() {
     516    private function nagEnabledOnPage()
     517    {
    475518        // get pagenow & screen
    476519        global $pagenow;
     
    480523    }
    481524
    482     public function captchaNagValidateErrors() {
     525    public function captchaNagValidateErrors()
     526    {
    483527        global $pagenow;
    484528        $screen = get_current_screen();
     
    537581    }
    538582
    539     public function captchaNagSetup($force = false) {
     583    public function captchaNagSetup($force = false)
     584    {
    540585        // SHOW NAG/NOTICE AFTER INSTALLING
    541586        global $pagenow;
     
    568613    }
    569614
    570     public function captchaNagDeactivated() {
     615    public function captchaNagDeactivated()
     616    {
    571617        // SHOW NAG/NOTICE AFTER INSTALLING
    572618        echo '<div class="update-nag captcha-at-nag">';
     
    581627    }
    582628
    583     public function plugin_deactivated() {
     629    public function plugin_deactivated()
     630    {
    584631        // clear update schedules/crons
    585632        wp_clear_scheduled_hook('captcha_at_sched_sdk_version');
     
    599646    }
    600647
    601     public function addError($error = '') {
     648    public function addError($error = '')
     649    {
    602650        // if error empty => skip
    603651        if ('' == $error) {
     
    633681    }
    634682
    635     private function options_delete_proxy() {
     683    private function options_delete_proxy()
     684    {
    636685        // delete all proxy options
    637686        delete_option('captcha_at_proxy_enabled');
     
    640689    }
    641690
    642     public function admin_scripts($hook) {
     691    public function admin_scripts($hook)
     692    {
    643693        $screen = get_current_screen();
    644694
     
    649699    }
    650700
    651     public function captcha_at_check_settings() {
     701    public function captcha_at_check_settings()
     702    {
    652703        // get values from POST
    653704        $postHost = isset($_POST['host']) ? sanitize_url($_POST['host']) : false;
     
    696747    }
    697748
    698     public function woocommerce_login_form($content = '') {
     749    public function woocommerce_login_form($content = '')
     750    {
    699751        echo '<input type="hidden" name="login" value="Login">';
    700752
     
    702754    }
    703755
    704     public function woocommerce_process_login_errors($validation_error, $login, $pass) {
     756    public function woocommerce_process_login_errors($validation_error, $login, $pass)
     757    {
    705758        if (! isset($_POST['captcha_at_solution'])) {
    706759            // no solution supplied
     
    722775    }
    723776
    724     public function woocommerce_register_form($content = '') {
     777    public function woocommerce_register_form($content = '')
     778    {
    725779        echo '<input type="hidden" name="register" value="Register">';
    726780
     
    728782    }
    729783
    730     public function woocommerce_process_registration_errors($validation_error, $user, $password, $email) {
     784    public function woocommerce_process_registration_errors($validation_error, $user, $password, $email)
     785    {
    731786        if (! isset($_POST['captcha_at_solution'])) {
    732787            // no solution supplied
     
    748803    }
    749804
    750     public function woocommerce_lostpassword_form($content = '') {
     805    public function woocommerce_lostpassword_form($content = '')
     806    {
    751807        return $content;
    752808    }
    753809
    754     public function woocommerce_after_checkout_billing_form($checkout) {
     810    public function woocommerce_after_checkout_billing_form($checkout)
     811    {
    755812        echo '<input type="hidden" name="captcha_at_solution" class="captcha_at_hidden_field" value="test">';
    756813    }
    757814
    758     public function woocommerce_after_checkout_validation($fields, $errors) {
     815    public function woocommerce_after_checkout_validation($fields, $errors)
     816    {
    759817        if (! isset($_POST['captcha_at_solution'])) {
    760818            // no solution supplied
     
    772830    }
    773831
    774     public function elementor_pro_forms_validation($record, $ajax_handler) {
     832    public function elementor_pro_forms_validation($record, $ajax_handler)
     833    {
    775834        $msgErr = __('Captcha.eu failed', 'captcha-eu');
    776835
     
    793852    }
    794853
    795     public function et_pb_contact_form_submit($processed_fields_values, $et_contact_error, $contact_form_info) {
     854    public function et_pb_contact_form_submit($processed_fields_values, $et_contact_error, $contact_form_info)
     855    {
    796856        if (! isset($_POST['captcha_at_solution'])) {
    797857            echo __('Captcha.eu failed', 'captcha-eu');
     
    807867    }
    808868
    809     public function pre_update_option_captcha_at_proxy_enabled($valueNew, $valueOld) {
     869    public function pre_update_option_captcha_at_proxy_enabled($valueNew, $valueOld)
     870    {
    810871        // option has been updated => check
    811872        $proxyEnable = $valueNew;
     
    822883    }
    823884
    824     public function rest_get_sdkjs() {
     885    public function rest_get_sdkjs()
     886    {
    825887        // set content type header to javascript
    826888        header('Content-Type: application/javascript');
     
    832894    }
    833895
    834     public function rest_challenge(\WP_REST_Request $request) {
     896    public function rest_challenge(\WP_REST_Request $request)
     897    {
    835898        // get param from url
    836899        $publicSecret = $request->get_param('publicSecret');
     
    884947    }
    885948
    886     public function rest_api_init() {
     949    public function rest_api_init()
     950    {
    887951        // serve sdk.js
    888952        register_rest_route('captcha-eu/v1', '/sdk.js', [
     
    900964    }
    901965
    902     public function add_filters() {
     966    public function add_filters()
     967    {
    903968        // get selected plugins from option
    904969        $selectedPlugins = get_option('captcha_at_plugin');
     
    10121077    }
    10131078
    1014     public function notice($type = '', $msg = '') {
     1079    public function notice($type = '', $msg = '')
     1080    {
    10151081        return (object) [
    10161082            'type' => $type,
     
    10191085    }
    10201086
    1021     private function apiFetchLatestVersion() {
     1087    private function apiFetchLatestVersion()
     1088    {
    10221089        // fetch asset version info route
    10231090        $data = wp_remote_get($this->endpoint . '/version?t=' . time(), [
     
    10511118    }
    10521119
    1053     private function apiFetchPersonal($host = '', $restKey = '') {
     1120    private function apiFetchPersonal($host = '', $restKey = '')
     1121    {
    10541122        // fetch personal info route
    10551123        $data = wp_remote_get($host . '/api/personal', [
     
    10761144    }
    10771145
    1078     private function getApiOptions() {
     1146    private function getApiOptions()
     1147    {
    10791148        $host = get_option('captcha_at_host');
    10801149
     
    10911160    }
    10921161
    1093     private function getPluginData() {
     1162    private function getPluginData()
     1163    {
    10941164        // ensure get_plugin_data is available
    10951165        if (! function_exists('get_plugin_data')) {
     
    11021172    }
    11031173
    1104     public function options_page() {
     1174    public function options_page()
     1175    {
    11051176        // define vars for the option page to use
    11061177
     
    12551326    }
    12561327
    1257     public function options_page_settings() {
     1328    public function options_page_settings()
     1329    {
    12581330        // configErrors => used to display errors/notices on option settings page
    12591331        $configMessages = [];
  • captcha-eu/trunk/src/Core.php

    r2941141 r2985152  
    33namespace CAPTCHA\Plugin;
    44
    5 class Core {
     5class Core
     6{
    67    private $plugin_dir;
    78    private $plugin_dir_url;
     
    1112    public $options;
    1213
    13     public function __construct() {
     14    public function __construct()
     15    {
    1416        global $wpdb;
    1517        $this->wpdb = $wpdb;
     
    2123    }
    2224
    23     public function getRealIP() {
     25    public function getRealIP()
     26    {
    2427        // Check if the header is present
    2528        if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
     
    4245    }
    4346
    44     public function anonymizeIP($ip) {
     47    public function anonymizeIP($ip)
     48    {
    4549        // Check if the IP address is IPv4 or IPv6
    4650        if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
     
    7175    }
    7276
    73     public function validate($solution) {
     77    public function validate($solution)
     78    {
    7479        $url  = $this->admin->endpoint;
    7580        $restKey  = get_option('captcha_at_rest_key');
    76         $url = $url . '/validate';
     81        $url .= '/validate';
    7782
    7883        // if the request is made through a proxy or load balancer
  • captcha-eu/trunk/src/Frontend.php

    r2941141 r2985152  
    33namespace CAPTCHA\Plugin;
    44
    5 class Frontend {
     5class Frontend
     6{
    67    private $plugin_dir;
    78    private $wpdb;
    89    private $core;
    910
    10     public function __construct($core) {
     11    public function __construct($core)
     12    {
    1113        global $wpdb;
    1214        $this->wpdb = $wpdb;
     
    1517    }
    1618
    17     public function add_filters() {
     19    public function add_filters()
     20    {
    1821    }
    1922}
  • captcha-eu/trunk/src/Options.php

    r2941141 r2985152  
    33namespace CAPTCHA\Plugin;
    44
    5 class Options {
     5class Options
     6{
    67    private $plugin_dir;
    78    private $plugin_dir_url;
     
    910    private $optionErrors;
    1011
    11     public function __construct($core) {
     12    public function __construct($core)
     13    {
    1214        $this->core = $core;
    1315
     
    2224    }
    2325
    24     private function add_actions() {
     26    private function add_actions()
     27    {
    2528        add_action('admin_menu', [$this, 'enqueue_styles'], 20);
    2629    }
    2730
    28     public function enqueue_styles() {
     31    public function enqueue_styles()
     32    {
    2933        wp_enqueue_style('captchaOptions', $this->plugin_dir_url . 'assets/css/options.css');
    3034    }
    3135
    3236    // render title
    33     public function fieldTitle($val = '', $icon = '') {
     37    public function fieldTitle($val = '', $icon = '')
     38    {
    3439        // empty => don't output
    3540        if ('' == $val) {
     
    5156
    5257    // render k/v table
    53     public function fieldKeyValue($arrKV = []) {
     58    public function fieldKeyValue($arrKV = [])
     59    {
    5460        if ([] == $arrKV) {
    5561            return '';
     
    7783
    7884    // wrap items in div
    79     public function wrapInDiv($class = '', $content = []) {
     85    public function wrapInDiv($class = '', $content = [])
     86    {
    8087        $out = '';
    8188
     
    94101
    95102    // render label
    96     public function fieldLabel($for = '', $val = '') {
     103    public function fieldLabel($for = '', $val = '')
     104    {
    97105        // empty => don't output
    98106        if ('' == $for || '' == $val) {
     
    104112
    105113    // render info icon with title text
    106     public function fieldInfoIcon($title = '') {
     114    public function fieldInfoIcon($title = '')
     115    {
    107116        // empty => don't output
    108117        if ('' == $title) {
     
    114123
    115124    // render input field with type text
    116     public function fieldInputText($name = '', $val = '', $placeholder = '') {
     125    public function fieldInputText($name = '', $val = '', $placeholder = '')
     126    {
    117127        // empty => don't output
    118128        if ('' == $name) {
     
    124134
    125135    // render textarea field
    126     public function fieldInputTextarea($name = '', $val = '', $placeholder = '') {
     136    public function fieldInputTextarea($name = '', $val = '', $placeholder = '')
     137    {
    127138        // empty => don't output
    128139        if ('' == $name) {
     
    134145
    135146    // render input field with type checkbox & corresponding labels
    136     public function fieldInputCheckbox($name = '', $options = [], $checked = '', $multiple = false) {
     147    public function fieldInputCheckbox($name = '', $options = [], $checked = '', $multiple = false)
     148    {
    137149        // empty => don't output
    138150        if ('' == $name || [] == $options) {
     
    170182
    171183    // render panel with message
    172     public function panelMSG($type = '', $msg = '') {
     184    public function panelMSG($type = '', $msg = '')
     185    {
    173186        // empty => don't output
    174187        if ('' == $msg) {
     
    184197
    185198    // render panel with message
    186     public function settingsPanel($fields = [], $class = '') {
     199    public function settingsPanel($fields = [], $class = '')
     200    {
    187201        // empty => don't output
    188202        if (empty($fields)) {
  • captcha-eu/trunk/tests/phpunit/PrettyPrinter.php

    r2906129 r2985152  
    33namespace Test;
    44
    5 class PrettyPrinter extends \PHPUnit\TextUI\ResultPrinter implements \PHPUnit\Framework\TestListener {
     5class PrettyPrinter extends \PHPUnit\TextUI\ResultPrinter implements \PHPUnit\Framework\TestListener
     6{
    67    private $headerPrinted = false;
    78
     
    1011     * unit test summary (after all tests have run).
    1112     */
    12     protected function printHeader(): void {
     13    protected function printHeader(): void
     14    {
    1315        parent::printHeader();
    1416    }
    1517
    16     protected function formatExceptionMsg($exceptionMessage) {
     18    protected function formatExceptionMsg($exceptionMessage)
     19    {
    1720        $exceptionMessage = str_replace("+++ Actual\n", '', $exceptionMessage);
    1821        $exceptionMessage = str_replace("--- Expected\n", '', $exceptionMessage);
     
    2427    }
    2528
    26     protected function printDefectTrace(\PHPUnit\Framework\TestFailure $defect): void {
     29    protected function printDefectTrace(\PHPUnit\Framework\TestFailure $defect): void
     30    {
    2731        $this->write($this->formatExceptionMsg($defect->getExceptionAsString()));
    2832        $trace = \PHPUnit\Util\Filter::getFilteredStacktrace(
     
    4953     * @param string $color   optional color (if supported by console)
    5054     */
    51     private function out($message, $color = '', $linebreak = false) {
     55    private function out($message, $color = '', $linebreak = false)
     56    {
    5257        echo($color ? $this->formatWithColor($color, $message) : $message) . ($linebreak ? "\n" : '');
    5358    }
     
    5661     * Fired prior to each individual test.
    5762     */
    58     public function startTest(\PHPUnit\Framework\Test $test): void {
     63    public function startTest(\PHPUnit\Framework\Test $test): void
     64    {
    5965        $this->out(">> RUN '" . preg_replace('/^test/', '', $test->getName()) . "'...");
    6066    }
     
    6672     * @param int time of execution
    6773     */
    68     public function endTest(\PHPUnit\Framework\Test $test, $time): void {
     74    public function endTest(\PHPUnit\Framework\Test $test, $time): void
     75    {
    6976        // copied from parent:endTest()
    7077        if ($test instanceof \PHPUnit\Framework\TestCase) {
     
    93100     * called at the initialization of each test suite.
    94101     */
    95     public function prettySuiteName($s) {
     102    public function prettySuiteName($s)
     103    {
    96104        return preg_replace("/^Tests\\\/", '', $s);
    97105    }
    98106
    99     public function startTestSuite(\PHPUnit\Framework\TestSuite $suite): void {
     107    public function startTestSuite(\PHPUnit\Framework\TestSuite $suite): void
     108    {
    100109        parent::startTestSuite($suite);
    101110        if (! $this->headerPrinted) {
     
    116125    }
    117126
    118     public function endTestSuite(\PHPUnit\Framework\TestSuite $suite): void {
     127    public function endTestSuite(\PHPUnit\Framework\TestSuite $suite): void
     128    {
    119129        if ('PHPUnit' != $suite->getName()) {
    120130            $this->out("END SUITE '" . $this->prettySuiteName($suite->getName()) . "'\n\n");
     
    128138     * @param string $progress
    129139     */
    130     protected function writeProgress($progress): void {
     140    protected function writeProgress($progress): void
     141    {
    131142        // suppress output;
    132143    }
  • captcha-eu/trunk/tests/phpunit/bootstrap.php

    r2906129 r2985152  
    1212define('KRN_IS_TESTING', 1);
    1313
    14 class bootstrap {
    15     public function __construct() {
     14class bootstrap
     15{
     16    public function __construct()
     17    {
    1618        $_tests_dir = getenv('WP_TESTS_DIR');
    1719        if (! $_tests_dir) {
     
    3032    }
    3133
    32     public function _manually_load_plugin() {
     34    public function _manually_load_plugin()
     35    {
    3336        require dirname(dirname(__FILE__)) . '../../kmm-flattable.php';
    3437    }
  • captcha-eu/trunk/tests/test-captcha.php

    r2906129 r2985152  
    11<?php
    22/**
    3 * @covers \KMM\Flattable\Core
    4 */
     3 * @covers \KMM\Flattable\Core
     4 */
    55use CAPTCHA\Plugin\Core;
    66
    7 class FlattableTestDB {
     7class FlattableTestDB
     8{
    89    public $prefix = 'wptest';
    910
    10     public function query($sql) {
     11    public function query($sql)
     12    {
    1113    }
    1214
    13     public function get_results($r) {
     15    public function get_results($r)
     16    {
    1417    }
    1518
    16     public function prepare($data) {
     19    public function prepare($data)
     20    {
    1721    }
    1822}
    1923
    20 class TestFlattable extends \WP_UnitTestCase {
    21     public function setUp(): void {
     24class TestFlattable extends \WP_UnitTestCase
     25{
     26    public function setUp(): void
     27    {
    2228        // setup a rest server
    2329        parent::setUp();
     
    2834     * @test
    2935     */
    30     public function dummy_test() {
     36    public function dummy_test()
     37    {
    3138        $this->assertNull(null);
    3239    }
    3340
    34     public function tearDown(): void {
     41    public function tearDown(): void
     42    {
    3543        parent::tearDown();
    3644    }
  • captcha-eu/trunk/vendor/autoload.php

    r2962567 r2985152  
    2323require_once __DIR__ . '/composer/autoload_real.php';
    2424
    25 return ComposerAutoloaderInitc6537ae706336734539418e7c25e7522::getLoader();
     25return ComposerAutoloaderInit317f193e59d41c516767761402e9a3bd::getLoader();
  • captcha-eu/trunk/vendor/composer/autoload_real.php

    r2962567 r2985152  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInitc6537ae706336734539418e7c25e7522
     5class ComposerAutoloaderInit317f193e59d41c516767761402e9a3bd
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInitc6537ae706336734539418e7c25e7522', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit317f193e59d41c516767761402e9a3bd', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInitc6537ae706336734539418e7c25e7522', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit317f193e59d41c516767761402e9a3bd', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInitc6537ae706336734539418e7c25e7522::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInit317f193e59d41c516767761402e9a3bd::getInitializer($loader));
    3333
    3434        $loader->register(true);
  • captcha-eu/trunk/vendor/composer/autoload_static.php

    r2962567 r2985152  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInitc6537ae706336734539418e7c25e7522
     7class ComposerStaticInit317f193e59d41c516767761402e9a3bd
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    3232    {
    3333        return \Closure::bind(function () use ($loader) {
    34             $loader->prefixLengthsPsr4 = ComposerStaticInitc6537ae706336734539418e7c25e7522::$prefixLengthsPsr4;
    35             $loader->prefixDirsPsr4 = ComposerStaticInitc6537ae706336734539418e7c25e7522::$prefixDirsPsr4;
    36             $loader->classMap = ComposerStaticInitc6537ae706336734539418e7c25e7522::$classMap;
     34            $loader->prefixLengthsPsr4 = ComposerStaticInit317f193e59d41c516767761402e9a3bd::$prefixLengthsPsr4;
     35            $loader->prefixDirsPsr4 = ComposerStaticInit317f193e59d41c516767761402e9a3bd::$prefixDirsPsr4;
     36            $loader->classMap = ComposerStaticInit317f193e59d41c516767761402e9a3bd::$classMap;
    3737
    3838        }, null, ClassLoader::class);
  • captcha-eu/trunk/vendor/composer/installers/.git/logs/HEAD

    r2962567 r2985152  
    1 0000000000000000000000000000000000000000 2a9170263fcd9cc4fd0b50917293c21d6c1a5bfe Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1693833695 +0000   clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/
    2 2a9170263fcd9cc4fd0b50917293c21d6c1a5bfe d20a64ed3c94748397ff5973488761b22f6d3f19 Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1693833695 +0000   checkout: moving from main to v1.12.0
     10000000000000000000000000000000000000000 2a9170263fcd9cc4fd0b50917293c21d6c1a5bfe Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1698435822 +0000   clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/
     22a9170263fcd9cc4fd0b50917293c21d6c1a5bfe d20a64ed3c94748397ff5973488761b22f6d3f19 Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1698435822 +0000   checkout: moving from main to v1.12.0
  • captcha-eu/trunk/vendor/composer/installers/.git/logs/refs/heads/main

    r2962567 r2985152  
    1 0000000000000000000000000000000000000000 2a9170263fcd9cc4fd0b50917293c21d6c1a5bfe Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1693833695 +0000   clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/
     10000000000000000000000000000000000000000 2a9170263fcd9cc4fd0b50917293c21d6c1a5bfe Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1698435822 +0000   clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/
  • captcha-eu/trunk/vendor/composer/installers/.git/logs/refs/remotes/origin/HEAD

    r2962567 r2985152  
    1 0000000000000000000000000000000000000000 2a9170263fcd9cc4fd0b50917293c21d6c1a5bfe Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1693833695 +0000   clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/
     10000000000000000000000000000000000000000 2a9170263fcd9cc4fd0b50917293c21d6c1a5bfe Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1698435822 +0000   clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/
  • captcha-eu/trunk/wp-captcha.php

    r2962567 r2985152  
    44 * Description: Captcha.eu provides a GDPR compliant protection against bots and spammers.
    55 * Plugin URI:  https://www.captcha.eu
    6  * Version:     1.0.25
     6 * Version:     1.0.26
    77 * Author:      captchaeu
    88 * Author URI:  https://profiles.wordpress.org/captchaeu/
Note: See TracChangeset for help on using the changeset viewer.