Changeset 2985152
- Timestamp:
- 10/27/2023 07:44:00 PM (2 years ago)
- Location:
- captcha-eu
- Files:
-
- 38 edited
- 1 copied
-
tags/v1.0.26 (copied) (copied from captcha-eu/trunk)
-
tags/v1.0.26/.php-cs-fixer.php (modified) (2 diffs)
-
tags/v1.0.26/assets/login.js (modified) (3 diffs)
-
tags/v1.0.26/composer.lock (modified) (22 diffs)
-
tags/v1.0.26/readme.txt (modified) (2 diffs)
-
tags/v1.0.26/src/Admin.php (modified) (51 diffs)
-
tags/v1.0.26/src/Core.php (modified) (5 diffs)
-
tags/v1.0.26/src/Frontend.php (modified) (2 diffs)
-
tags/v1.0.26/src/Options.php (modified) (12 diffs)
-
tags/v1.0.26/tests/phpunit/PrettyPrinter.php (modified) (9 diffs)
-
tags/v1.0.26/tests/phpunit/bootstrap.php (modified) (2 diffs)
-
tags/v1.0.26/tests/test-captcha.php (modified) (2 diffs)
-
tags/v1.0.26/vendor/autoload.php (modified) (1 diff)
-
tags/v1.0.26/vendor/composer/autoload_real.php (modified) (2 diffs)
-
tags/v1.0.26/vendor/composer/autoload_static.php (modified) (2 diffs)
-
tags/v1.0.26/vendor/composer/installers/.git/index (modified) (previous)
-
tags/v1.0.26/vendor/composer/installers/.git/logs/HEAD (modified) (1 diff)
-
tags/v1.0.26/vendor/composer/installers/.git/logs/refs/heads/main (modified) (1 diff)
-
tags/v1.0.26/vendor/composer/installers/.git/logs/refs/remotes/origin/HEAD (modified) (1 diff)
-
tags/v1.0.26/wp-captcha.php (modified) (1 diff)
-
trunk/.php-cs-fixer.php (modified) (2 diffs)
-
trunk/assets/login.js (modified) (3 diffs)
-
trunk/composer.lock (modified) (22 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/Admin.php (modified) (51 diffs)
-
trunk/src/Core.php (modified) (5 diffs)
-
trunk/src/Frontend.php (modified) (2 diffs)
-
trunk/src/Options.php (modified) (12 diffs)
-
trunk/tests/phpunit/PrettyPrinter.php (modified) (9 diffs)
-
trunk/tests/phpunit/bootstrap.php (modified) (2 diffs)
-
trunk/tests/test-captcha.php (modified) (2 diffs)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_real.php (modified) (2 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/vendor/composer/installers/.git/index (modified) (previous)
-
trunk/vendor/composer/installers/.git/logs/HEAD (modified) (1 diff)
-
trunk/vendor/composer/installers/.git/logs/refs/heads/main (modified) (1 diff)
-
trunk/vendor/composer/installers/.git/logs/refs/remotes/origin/HEAD (modified) (1 diff)
-
trunk/wp-captcha.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
captcha-eu/tags/v1.0.26/.php-cs-fixer.php
r2906129 r2985152 3 3 use PhpCsFixer\Config; 4 4 5 final class Php73 extends Config { 6 public function __construct() { 5 final class Php73 extends Config 6 { 7 public function __construct() 8 { 7 9 parent::__construct('KRNStyle'); 8 10 $this->setRiskyAllowed(true); 9 11 } 10 12 11 public function getRules(): array { 13 public function getRules(): array 14 { 12 15 $rules = [ 13 16 '@Symfony' => true, … … 53 56 'self_accessor' => true, 54 57 'short_scalar_cast' => true, 55 'single_blank_line_before_namespace' => true,56 58 'single_class_element_per_statement' => true, 57 59 'single_quote' => true, -
captcha-eu/tags/v1.0.26/assets/login.js
r2906129 r2985152 4 4 KROT.KROT_HOST = captchaAt.host; 5 5 6 var skipByException = false; 6 7 // 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 } 10 17 } 11 18 } … … 17 24 } 18 25 } 19 20 26 // Register 21 27 if(captchaAt.plugins.indexOf('_wp-registration') > -1) { … … 24 30 } 25 31 } 32 26 33 }); 27 34 -
captcha-eu/tags/v1.0.26/composer.lock
r2962567 r2985152 162 162 { 163 163 "name": "composer/pcre", 164 "version": "3.1. 0",164 "version": "3.1.1", 165 165 "source": { 166 166 "type": "git", 167 167 "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", 174 174 "shasum": "" 175 175 }, … … 213 213 "support": { 214 214 "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" 216 216 }, 217 217 "funding": [ … … 229 229 } 230 230 ], 231 "time": "202 2-11-17T09:50:14+00:00"231 "time": "2023-10-11T07:11:09+00:00" 232 232 }, 233 233 { … … 456 456 { 457 457 "name": "doctrine/deprecations", 458 "version": " v1.1.1",458 "version": "1.1.2", 459 459 "source": { 460 460 "type": "git", 461 461 "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", 468 468 "shasum": "" 469 469 }, … … 497 497 "support": { 498 498 "issues": "https://github.com/doctrine/deprecations/issues", 499 "source": "https://github.com/doctrine/deprecations/tree/ v1.1.1"500 }, 501 "time": "2023-0 6-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" 502 502 }, 503 503 { … … 651 651 { 652 652 "name": "friendsofphp/php-cs-fixer", 653 "version": "v3. 25.1",653 "version": "v3.36.0", 654 654 "source": { 655 655 "type": "git", 656 656 "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", 663 663 "shasum": "" 664 664 }, … … 693 693 "phpspec/prophecy-phpunit": "^2.0", 694 694 "phpunit/phpunit": "^9.5", 695 "phpunitgoodpractices/polyfill": "^1.6",696 "phpunitgoodpractices/traits": "^1.9.2",697 695 "symfony/phpunit-bridge": "^6.2.3", 698 696 "symfony/yaml": "^5.4 || ^6.0" … … 734 732 "support": { 735 733 "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" 737 735 }, 738 736 "funding": [ … … 742 740 } 743 741 ], 744 "time": "2023- 09-04T01:22:52+00:00"742 "time": "2023-10-27T10:12:29+00:00" 745 743 }, 746 744 { … … 1608 1606 { 1609 1607 "name": "phpstan/phpdoc-parser", 1610 "version": "1.2 3.1",1608 "version": "1.24.2", 1611 1609 "source": { 1612 1610 "type": "git", 1613 1611 "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", 1620 1618 "shasum": "" 1621 1619 }, … … 1649 1647 "support": { 1650 1648 "issues": "https://github.com/phpstan/phpdoc-parser/issues", 1651 "source": "https://github.com/phpstan/phpdoc-parser/tree/1.2 3.1"1652 }, 1653 "time": "2023-0 8-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" 1654 1652 }, 1655 1653 { 1656 1654 "name": "phpunit/php-code-coverage", 1657 "version": "9.2.2 7",1655 "version": "9.2.29", 1658 1656 "source": { 1659 1657 "type": "git", 1660 1658 "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", 1667 1665 "shasum": "" 1668 1666 }, … … 1721 1719 "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", 1722 1720 "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", 1723 "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.2 7"1721 "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.29" 1724 1722 }, 1725 1723 "funding": [ … … 1729 1727 } 1730 1728 ], 1731 "time": "2023-0 7-26T13:44:30+00:00"1729 "time": "2023-09-19T04:57:46+00:00" 1732 1730 }, 1733 1731 { … … 1974 1972 { 1975 1973 "name": "phpunit/phpunit", 1976 "version": "9.6.1 1",1974 "version": "9.6.13", 1977 1975 "source": { 1978 1976 "type": "git", 1979 1977 "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", 1986 1984 "shasum": "" 1987 1985 }, … … 1998 1996 "phar-io/version": "^3.0.2", 1999 1997 "php": ">=7.3", 2000 "phpunit/php-code-coverage": "^9.2. 13",1998 "phpunit/php-code-coverage": "^9.2.28", 2001 1999 "phpunit/php-file-iterator": "^3.0.5", 2002 2000 "phpunit/php-invoker": "^3.1.1", … … 2057 2055 "issues": "https://github.com/sebastianbergmann/phpunit/issues", 2058 2056 "security": "https://github.com/sebastianbergmann/phpunit/security/policy", 2059 "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.1 1"2057 "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.13" 2060 2058 }, 2061 2059 "funding": [ … … 2073 2071 } 2074 2072 ], 2075 "time": "2023-0 8-19T07:10:56+00:00"2073 "time": "2023-09-19T05:39:22+00:00" 2076 2074 }, 2077 2075 { … … 2224 2222 { 2225 2223 "name": "psr/http-client", 2226 "version": "1.0. 2",2224 "version": "1.0.3", 2227 2225 "source": { 2228 2226 "type": "git", 2229 2227 "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", 2236 2234 "shasum": "" 2237 2235 }, … … 2270 2268 ], 2271 2269 "support": { 2272 "source": "https://github.com/php-fig/http-client /tree/1.0.2"2273 }, 2274 "time": "2023-0 4-10T20:12:12+00:00"2270 "source": "https://github.com/php-fig/http-client" 2271 }, 2272 "time": "2023-09-23T14:17:50+00:00" 2275 2273 }, 2276 2274 { … … 4791 4789 { 4792 4790 "name": "symfony/string", 4793 "version": "v5.4.2 6",4791 "version": "v5.4.29", 4794 4792 "source": { 4795 4793 "type": "git", 4796 4794 "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", 4803 4801 "shasum": "" 4804 4802 }, … … 4857 4855 ], 4858 4856 "support": { 4859 "source": "https://github.com/symfony/string/tree/v5.4.2 6"4857 "source": "https://github.com/symfony/string/tree/v5.4.29" 4860 4858 }, 4861 4859 "funding": [ … … 4873 4871 } 4874 4872 ], 4875 "time": "2023-0 6-28T12:46:07+00:00"4873 "time": "2023-09-13T11:47:41+00:00" 4876 4874 }, 4877 4875 { -
captcha-eu/tags/v1.0.26/readme.txt
r2962567 r2985152 5 5 Tested up to: 6.2 6 6 Requires PHP: 7.0 7 Stable tag: 1.0.2 57 Stable tag: 1.0.26 8 8 License: GPL 9 9 License URI: https://opensource.org/license/gpl/ … … 61 61 62 62 == 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 63 65 = 1.0.25 = 64 66 * update readme.txt - add video -
captcha-eu/tags/v1.0.26/src/Admin.php
r2941141 r2985152 3 3 namespace CAPTCHA\Plugin; 4 4 5 class Admin { 5 class Admin 6 { 6 7 private $plugin_dir; 7 8 private $plugin_dir_url; … … 12 13 private $urls; 13 14 private $sdkVersion; 14 15 public function __construct($core) { 15 private $hasWordFence; 16 17 public function __construct($core) 18 { 16 19 global $wpdb; 20 $this->hasWordFence = false; 17 21 $this->wpdb = $wpdb; 18 22 $this->core = $core; … … 36 40 } 37 41 38 public function init() { 42 public function init() 43 { 39 44 $this->options(); 40 45 } 41 46 42 public function enque_scripts() { 47 public function enque_scripts() 48 { 43 49 // no captcha-eu plugins activated => skip sdk.js load 44 50 $plugins = get_option('captcha_at_plugin'); … … 68 74 } 69 75 70 public function enqueue_sdk_script() { 76 public function enqueue_sdk_script() 77 { 71 78 // check if proxy enabled 72 79 if (get_option('captcha_at_proxy_enabled')) { … … 83 90 } 84 91 85 public function login_scripts() { 92 public function login_scripts() 93 { 86 94 // handle sdk.js loading 87 95 $this->enqueue_sdk_script(); … … 117 125 } 118 126 119 public function handleActivationTransient() { 127 public function handleActivationTransient() 128 { 120 129 // check if update transient is set 121 130 $isActivation = get_transient('captcha-at-notice-activation'); … … 127 136 } 128 137 129 public function handleEndpoint() { 138 public function handleEndpoint() 139 { 130 140 // if host is not set or empty => use default 131 141 if (get_option('captcha_at_host') && '' != get_option('captcha_at_host')) { … … 136 146 } 137 147 138 public function handleSDKVersion() { 148 public function handleSDKVersion() 149 { 139 150 // if host is not set or empty => use default 140 151 $optKey = 'captcha_at_version_sdk'; … … 151 162 } 152 163 153 public function sdkVersionCheckUpdate($proxyForce = false) { 164 public function sdkVersionCheckUpdate($proxyForce = false) 165 { 154 166 // use host from options (no proxy) 155 167 $restKey = get_option('captcha_at_rest_key'); … … 207 219 } 208 220 209 private function concatInterceptors() { 221 private function concatInterceptors() 222 { 210 223 // get all selected plugins to add the interceptor's to 211 224 $plugins = get_option('captcha_at_plugin'); … … 245 258 } 246 259 247 private function localize_script_data($scriptData) { 260 private function localize_script_data($scriptData) 261 { 248 262 // localize scriptData to captchaAt variable 249 263 wp_localize_script('captcha-eu-wp', 'captchaAt', $scriptData); 250 264 } 251 265 252 public function options() { 266 public function options() 267 { 253 268 register_setting('captcha-at_settings', 'captcha_at_rest_key'); 254 269 register_setting('captcha-at_settings', 'captcha_at_host', ['default' => 'https://w19.captcha.at']); … … 260 275 } 261 276 262 public function menu() { 277 public function menu() 278 { 263 279 $settings_page = add_menu_page( 264 280 __('Captcha.eu', 'captcha-eu'), … … 288 304 } 289 305 290 public function pre_comment_on_post($comment_post_ID) { 306 public function pre_comment_on_post($comment_post_ID) 307 { 291 308 $go_back = sprintf('<br><a href="javascript:history.go(-1)">' . __('Back to', 'captcha-eu') . ' "%s"</a>', get_the_title($comment_post_ID)); 292 309 $error = '<strong>' . __('ERROR', 'captcha-eu') . '</strong>:' . __('Captcha.eu failed to validate.', 'captcha-eu') . $go_back; … … 302 319 } 303 320 304 public function authenticate($user, $username, $password) { 321 public function authenticate($user, $username, $password) 322 { 305 323 $error = new \WP_Error('captcha_failed', __('Captcha.eu failed', 'captcha-eu')); 306 324 … … 308 326 return $user; 309 327 } 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 310 344 if (! isset($_POST['captcha_at_solution'])) { 311 345 return $error; … … 319 353 } 320 354 321 public function allow_password_reset($allow, $user_id) { 355 public function allow_password_reset($allow, $user_id) 356 { 322 357 if (! isset($_POST['captcha_at_solution'])) { 323 358 return false; … … 331 366 } 332 367 333 public function wpcf7_spam($spam, $submission) { 368 public function wpcf7_spam($spam, $submission) 369 { 334 370 if ($spam) { 335 371 return $spam; … … 350 386 } 351 387 352 public function wpforms_process($fields, $entry, $form_data) { 388 public function wpforms_process($fields, $entry, $form_data) 389 { 353 390 if (! isset($_POST['captcha_at_solution'])) { 354 391 wpforms()->process->errors[$form_data['id']]['footer'] = esc_html__('Captcha.eu failed', 'captcha-eu'); … … 360 397 } 361 398 362 public function gform_abort_submission_with_confirmation($do_abort, $form) { 399 public function gform_abort_submission_with_confirmation($do_abort, $form) 400 { 363 401 if ($do_abort) { 364 402 return $do_abort; … … 376 414 } 377 415 378 public function ninja_forms_submit_data($formData) { 416 public function ninja_forms_submit_data($formData) 417 { 379 418 // formData not set => exit 380 419 if (! isset($formData) || empty($formData)) { … … 405 444 } 406 445 407 public function registration_errors($errors, $login_sanitized, $email) { 446 public function registration_errors($errors, $login_sanitized, $email) 447 { 408 448 // check if captcha solution supplied 409 449 if (! isset($_POST['captcha_at_solution'])) { … … 422 462 } 423 463 424 public function mc4wp_form_errors($errors, $form) { 464 public function mc4wp_form_errors($errors, $form) 465 { 425 466 // no solution supplied 426 467 if (! isset($form->raw_data['captcha_at_solution'])) { … … 439 480 } 440 481 441 public function admin_notices() { 482 public function admin_notices() 483 { 442 484 // only disable for captcha-eu pages 443 485 $screen = get_current_screen(); … … 472 514 473 515 // check if current screen should show captcha-nag's 474 private function nagEnabledOnPage() { 516 private function nagEnabledOnPage() 517 { 475 518 // get pagenow & screen 476 519 global $pagenow; … … 480 523 } 481 524 482 public function captchaNagValidateErrors() { 525 public function captchaNagValidateErrors() 526 { 483 527 global $pagenow; 484 528 $screen = get_current_screen(); … … 537 581 } 538 582 539 public function captchaNagSetup($force = false) { 583 public function captchaNagSetup($force = false) 584 { 540 585 // SHOW NAG/NOTICE AFTER INSTALLING 541 586 global $pagenow; … … 568 613 } 569 614 570 public function captchaNagDeactivated() { 615 public function captchaNagDeactivated() 616 { 571 617 // SHOW NAG/NOTICE AFTER INSTALLING 572 618 echo '<div class="update-nag captcha-at-nag">'; … … 581 627 } 582 628 583 public function plugin_deactivated() { 629 public function plugin_deactivated() 630 { 584 631 // clear update schedules/crons 585 632 wp_clear_scheduled_hook('captcha_at_sched_sdk_version'); … … 599 646 } 600 647 601 public function addError($error = '') { 648 public function addError($error = '') 649 { 602 650 // if error empty => skip 603 651 if ('' == $error) { … … 633 681 } 634 682 635 private function options_delete_proxy() { 683 private function options_delete_proxy() 684 { 636 685 // delete all proxy options 637 686 delete_option('captcha_at_proxy_enabled'); … … 640 689 } 641 690 642 public function admin_scripts($hook) { 691 public function admin_scripts($hook) 692 { 643 693 $screen = get_current_screen(); 644 694 … … 649 699 } 650 700 651 public function captcha_at_check_settings() { 701 public function captcha_at_check_settings() 702 { 652 703 // get values from POST 653 704 $postHost = isset($_POST['host']) ? sanitize_url($_POST['host']) : false; … … 696 747 } 697 748 698 public function woocommerce_login_form($content = '') { 749 public function woocommerce_login_form($content = '') 750 { 699 751 echo '<input type="hidden" name="login" value="Login">'; 700 752 … … 702 754 } 703 755 704 public function woocommerce_process_login_errors($validation_error, $login, $pass) { 756 public function woocommerce_process_login_errors($validation_error, $login, $pass) 757 { 705 758 if (! isset($_POST['captcha_at_solution'])) { 706 759 // no solution supplied … … 722 775 } 723 776 724 public function woocommerce_register_form($content = '') { 777 public function woocommerce_register_form($content = '') 778 { 725 779 echo '<input type="hidden" name="register" value="Register">'; 726 780 … … 728 782 } 729 783 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 { 731 786 if (! isset($_POST['captcha_at_solution'])) { 732 787 // no solution supplied … … 748 803 } 749 804 750 public function woocommerce_lostpassword_form($content = '') { 805 public function woocommerce_lostpassword_form($content = '') 806 { 751 807 return $content; 752 808 } 753 809 754 public function woocommerce_after_checkout_billing_form($checkout) { 810 public function woocommerce_after_checkout_billing_form($checkout) 811 { 755 812 echo '<input type="hidden" name="captcha_at_solution" class="captcha_at_hidden_field" value="test">'; 756 813 } 757 814 758 public function woocommerce_after_checkout_validation($fields, $errors) { 815 public function woocommerce_after_checkout_validation($fields, $errors) 816 { 759 817 if (! isset($_POST['captcha_at_solution'])) { 760 818 // no solution supplied … … 772 830 } 773 831 774 public function elementor_pro_forms_validation($record, $ajax_handler) { 832 public function elementor_pro_forms_validation($record, $ajax_handler) 833 { 775 834 $msgErr = __('Captcha.eu failed', 'captcha-eu'); 776 835 … … 793 852 } 794 853 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 { 796 856 if (! isset($_POST['captcha_at_solution'])) { 797 857 echo __('Captcha.eu failed', 'captcha-eu'); … … 807 867 } 808 868 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 { 810 871 // option has been updated => check 811 872 $proxyEnable = $valueNew; … … 822 883 } 823 884 824 public function rest_get_sdkjs() { 885 public function rest_get_sdkjs() 886 { 825 887 // set content type header to javascript 826 888 header('Content-Type: application/javascript'); … … 832 894 } 833 895 834 public function rest_challenge(\WP_REST_Request $request) { 896 public function rest_challenge(\WP_REST_Request $request) 897 { 835 898 // get param from url 836 899 $publicSecret = $request->get_param('publicSecret'); … … 884 947 } 885 948 886 public function rest_api_init() { 949 public function rest_api_init() 950 { 887 951 // serve sdk.js 888 952 register_rest_route('captcha-eu/v1', '/sdk.js', [ … … 900 964 } 901 965 902 public function add_filters() { 966 public function add_filters() 967 { 903 968 // get selected plugins from option 904 969 $selectedPlugins = get_option('captcha_at_plugin'); … … 1012 1077 } 1013 1078 1014 public function notice($type = '', $msg = '') { 1079 public function notice($type = '', $msg = '') 1080 { 1015 1081 return (object) [ 1016 1082 'type' => $type, … … 1019 1085 } 1020 1086 1021 private function apiFetchLatestVersion() { 1087 private function apiFetchLatestVersion() 1088 { 1022 1089 // fetch asset version info route 1023 1090 $data = wp_remote_get($this->endpoint . '/version?t=' . time(), [ … … 1051 1118 } 1052 1119 1053 private function apiFetchPersonal($host = '', $restKey = '') { 1120 private function apiFetchPersonal($host = '', $restKey = '') 1121 { 1054 1122 // fetch personal info route 1055 1123 $data = wp_remote_get($host . '/api/personal', [ … … 1076 1144 } 1077 1145 1078 private function getApiOptions() { 1146 private function getApiOptions() 1147 { 1079 1148 $host = get_option('captcha_at_host'); 1080 1149 … … 1091 1160 } 1092 1161 1093 private function getPluginData() { 1162 private function getPluginData() 1163 { 1094 1164 // ensure get_plugin_data is available 1095 1165 if (! function_exists('get_plugin_data')) { … … 1102 1172 } 1103 1173 1104 public function options_page() { 1174 public function options_page() 1175 { 1105 1176 // define vars for the option page to use 1106 1177 … … 1255 1326 } 1256 1327 1257 public function options_page_settings() { 1328 public function options_page_settings() 1329 { 1258 1330 // configErrors => used to display errors/notices on option settings page 1259 1331 $configMessages = []; -
captcha-eu/tags/v1.0.26/src/Core.php
r2941141 r2985152 3 3 namespace CAPTCHA\Plugin; 4 4 5 class Core { 5 class Core 6 { 6 7 private $plugin_dir; 7 8 private $plugin_dir_url; … … 11 12 public $options; 12 13 13 public function __construct() { 14 public function __construct() 15 { 14 16 global $wpdb; 15 17 $this->wpdb = $wpdb; … … 21 23 } 22 24 23 public function getRealIP() { 25 public function getRealIP() 26 { 24 27 // Check if the header is present 25 28 if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { … … 42 45 } 43 46 44 public function anonymizeIP($ip) { 47 public function anonymizeIP($ip) 48 { 45 49 // Check if the IP address is IPv4 or IPv6 46 50 if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { … … 71 75 } 72 76 73 public function validate($solution) { 77 public function validate($solution) 78 { 74 79 $url = $this->admin->endpoint; 75 80 $restKey = get_option('captcha_at_rest_key'); 76 $url = $url .'/validate';81 $url .= '/validate'; 77 82 78 83 // if the request is made through a proxy or load balancer -
captcha-eu/tags/v1.0.26/src/Frontend.php
r2941141 r2985152 3 3 namespace CAPTCHA\Plugin; 4 4 5 class Frontend { 5 class Frontend 6 { 6 7 private $plugin_dir; 7 8 private $wpdb; 8 9 private $core; 9 10 10 public function __construct($core) { 11 public function __construct($core) 12 { 11 13 global $wpdb; 12 14 $this->wpdb = $wpdb; … … 15 17 } 16 18 17 public function add_filters() { 19 public function add_filters() 20 { 18 21 } 19 22 } -
captcha-eu/tags/v1.0.26/src/Options.php
r2941141 r2985152 3 3 namespace CAPTCHA\Plugin; 4 4 5 class Options { 5 class Options 6 { 6 7 private $plugin_dir; 7 8 private $plugin_dir_url; … … 9 10 private $optionErrors; 10 11 11 public function __construct($core) { 12 public function __construct($core) 13 { 12 14 $this->core = $core; 13 15 … … 22 24 } 23 25 24 private function add_actions() { 26 private function add_actions() 27 { 25 28 add_action('admin_menu', [$this, 'enqueue_styles'], 20); 26 29 } 27 30 28 public function enqueue_styles() { 31 public function enqueue_styles() 32 { 29 33 wp_enqueue_style('captchaOptions', $this->plugin_dir_url . 'assets/css/options.css'); 30 34 } 31 35 32 36 // render title 33 public function fieldTitle($val = '', $icon = '') { 37 public function fieldTitle($val = '', $icon = '') 38 { 34 39 // empty => don't output 35 40 if ('' == $val) { … … 51 56 52 57 // render k/v table 53 public function fieldKeyValue($arrKV = []) { 58 public function fieldKeyValue($arrKV = []) 59 { 54 60 if ([] == $arrKV) { 55 61 return ''; … … 77 83 78 84 // wrap items in div 79 public function wrapInDiv($class = '', $content = []) { 85 public function wrapInDiv($class = '', $content = []) 86 { 80 87 $out = ''; 81 88 … … 94 101 95 102 // render label 96 public function fieldLabel($for = '', $val = '') { 103 public function fieldLabel($for = '', $val = '') 104 { 97 105 // empty => don't output 98 106 if ('' == $for || '' == $val) { … … 104 112 105 113 // render info icon with title text 106 public function fieldInfoIcon($title = '') { 114 public function fieldInfoIcon($title = '') 115 { 107 116 // empty => don't output 108 117 if ('' == $title) { … … 114 123 115 124 // render input field with type text 116 public function fieldInputText($name = '', $val = '', $placeholder = '') { 125 public function fieldInputText($name = '', $val = '', $placeholder = '') 126 { 117 127 // empty => don't output 118 128 if ('' == $name) { … … 124 134 125 135 // render textarea field 126 public function fieldInputTextarea($name = '', $val = '', $placeholder = '') { 136 public function fieldInputTextarea($name = '', $val = '', $placeholder = '') 137 { 127 138 // empty => don't output 128 139 if ('' == $name) { … … 134 145 135 146 // 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 { 137 149 // empty => don't output 138 150 if ('' == $name || [] == $options) { … … 170 182 171 183 // render panel with message 172 public function panelMSG($type = '', $msg = '') { 184 public function panelMSG($type = '', $msg = '') 185 { 173 186 // empty => don't output 174 187 if ('' == $msg) { … … 184 197 185 198 // render panel with message 186 public function settingsPanel($fields = [], $class = '') { 199 public function settingsPanel($fields = [], $class = '') 200 { 187 201 // empty => don't output 188 202 if (empty($fields)) { -
captcha-eu/tags/v1.0.26/tests/phpunit/PrettyPrinter.php
r2906129 r2985152 3 3 namespace Test; 4 4 5 class PrettyPrinter extends \PHPUnit\TextUI\ResultPrinter implements \PHPUnit\Framework\TestListener { 5 class PrettyPrinter extends \PHPUnit\TextUI\ResultPrinter implements \PHPUnit\Framework\TestListener 6 { 6 7 private $headerPrinted = false; 7 8 … … 10 11 * unit test summary (after all tests have run). 11 12 */ 12 protected function printHeader(): void { 13 protected function printHeader(): void 14 { 13 15 parent::printHeader(); 14 16 } 15 17 16 protected function formatExceptionMsg($exceptionMessage) { 18 protected function formatExceptionMsg($exceptionMessage) 19 { 17 20 $exceptionMessage = str_replace("+++ Actual\n", '', $exceptionMessage); 18 21 $exceptionMessage = str_replace("--- Expected\n", '', $exceptionMessage); … … 24 27 } 25 28 26 protected function printDefectTrace(\PHPUnit\Framework\TestFailure $defect): void { 29 protected function printDefectTrace(\PHPUnit\Framework\TestFailure $defect): void 30 { 27 31 $this->write($this->formatExceptionMsg($defect->getExceptionAsString())); 28 32 $trace = \PHPUnit\Util\Filter::getFilteredStacktrace( … … 49 53 * @param string $color optional color (if supported by console) 50 54 */ 51 private function out($message, $color = '', $linebreak = false) { 55 private function out($message, $color = '', $linebreak = false) 56 { 52 57 echo($color ? $this->formatWithColor($color, $message) : $message) . ($linebreak ? "\n" : ''); 53 58 } … … 56 61 * Fired prior to each individual test. 57 62 */ 58 public function startTest(\PHPUnit\Framework\Test $test): void { 63 public function startTest(\PHPUnit\Framework\Test $test): void 64 { 59 65 $this->out(">> RUN '" . preg_replace('/^test/', '', $test->getName()) . "'..."); 60 66 } … … 66 72 * @param int time of execution 67 73 */ 68 public function endTest(\PHPUnit\Framework\Test $test, $time): void { 74 public function endTest(\PHPUnit\Framework\Test $test, $time): void 75 { 69 76 // copied from parent:endTest() 70 77 if ($test instanceof \PHPUnit\Framework\TestCase) { … … 93 100 * called at the initialization of each test suite. 94 101 */ 95 public function prettySuiteName($s) { 102 public function prettySuiteName($s) 103 { 96 104 return preg_replace("/^Tests\\\/", '', $s); 97 105 } 98 106 99 public function startTestSuite(\PHPUnit\Framework\TestSuite $suite): void { 107 public function startTestSuite(\PHPUnit\Framework\TestSuite $suite): void 108 { 100 109 parent::startTestSuite($suite); 101 110 if (! $this->headerPrinted) { … … 116 125 } 117 126 118 public function endTestSuite(\PHPUnit\Framework\TestSuite $suite): void { 127 public function endTestSuite(\PHPUnit\Framework\TestSuite $suite): void 128 { 119 129 if ('PHPUnit' != $suite->getName()) { 120 130 $this->out("END SUITE '" . $this->prettySuiteName($suite->getName()) . "'\n\n"); … … 128 138 * @param string $progress 129 139 */ 130 protected function writeProgress($progress): void { 140 protected function writeProgress($progress): void 141 { 131 142 // suppress output; 132 143 } -
captcha-eu/tags/v1.0.26/tests/phpunit/bootstrap.php
r2906129 r2985152 12 12 define('KRN_IS_TESTING', 1); 13 13 14 class bootstrap { 15 public function __construct() { 14 class bootstrap 15 { 16 public function __construct() 17 { 16 18 $_tests_dir = getenv('WP_TESTS_DIR'); 17 19 if (! $_tests_dir) { … … 30 32 } 31 33 32 public function _manually_load_plugin() { 34 public function _manually_load_plugin() 35 { 33 36 require dirname(dirname(__FILE__)) . '../../kmm-flattable.php'; 34 37 } -
captcha-eu/tags/v1.0.26/tests/test-captcha.php
r2906129 r2985152 1 1 <?php 2 2 /** 3 * @covers \KMM\Flattable\Core4 */3 * @covers \KMM\Flattable\Core 4 */ 5 5 use CAPTCHA\Plugin\Core; 6 6 7 class FlattableTestDB { 7 class FlattableTestDB 8 { 8 9 public $prefix = 'wptest'; 9 10 10 public function query($sql) { 11 public function query($sql) 12 { 11 13 } 12 14 13 public function get_results($r) { 15 public function get_results($r) 16 { 14 17 } 15 18 16 public function prepare($data) { 19 public function prepare($data) 20 { 17 21 } 18 22 } 19 23 20 class TestFlattable extends \WP_UnitTestCase { 21 public function setUp(): void { 24 class TestFlattable extends \WP_UnitTestCase 25 { 26 public function setUp(): void 27 { 22 28 // setup a rest server 23 29 parent::setUp(); … … 28 34 * @test 29 35 */ 30 public function dummy_test() { 36 public function dummy_test() 37 { 31 38 $this->assertNull(null); 32 39 } 33 40 34 public function tearDown(): void { 41 public function tearDown(): void 42 { 35 43 parent::tearDown(); 36 44 } -
captcha-eu/tags/v1.0.26/vendor/autoload.php
r2962567 r2985152 23 23 require_once __DIR__ . '/composer/autoload_real.php'; 24 24 25 return ComposerAutoloaderInit c6537ae706336734539418e7c25e7522::getLoader();25 return ComposerAutoloaderInit317f193e59d41c516767761402e9a3bd::getLoader(); -
captcha-eu/tags/v1.0.26/vendor/composer/autoload_real.php
r2962567 r2985152 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit c6537ae706336734539418e7c25e75225 class ComposerAutoloaderInit317f193e59d41c516767761402e9a3bd 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit c6537ae706336734539418e7c25e7522', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInit317f193e59d41c516767761402e9a3bd', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInit c6537ae706336734539418e7c25e7522', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInit317f193e59d41c516767761402e9a3bd', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInit c6537ae706336734539418e7c25e7522::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInit317f193e59d41c516767761402e9a3bd::getInitializer($loader)); 33 33 34 34 $loader->register(true); -
captcha-eu/tags/v1.0.26/vendor/composer/autoload_static.php
r2962567 r2985152 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit c6537ae706336734539418e7c25e75227 class ComposerStaticInit317f193e59d41c516767761402e9a3bd 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 32 32 { 33 33 return \Closure::bind(function () use ($loader) { 34 $loader->prefixLengthsPsr4 = ComposerStaticInit c6537ae706336734539418e7c25e7522::$prefixLengthsPsr4;35 $loader->prefixDirsPsr4 = ComposerStaticInit c6537ae706336734539418e7c25e7522::$prefixDirsPsr4;36 $loader->classMap = ComposerStaticInit c6537ae706336734539418e7c25e7522::$classMap;34 $loader->prefixLengthsPsr4 = ComposerStaticInit317f193e59d41c516767761402e9a3bd::$prefixLengthsPsr4; 35 $loader->prefixDirsPsr4 = ComposerStaticInit317f193e59d41c516767761402e9a3bd::$prefixDirsPsr4; 36 $loader->classMap = ComposerStaticInit317f193e59d41c516767761402e9a3bd::$classMap; 37 37 38 38 }, 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> 169 3833695+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> 169 3833695+0000 checkout: moving from main to v1.12.01 0000000000000000000000000000000000000000 2a9170263fcd9cc4fd0b50917293c21d6c1a5bfe Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1698435822 +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> 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> 169 3833695+0000 clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/1 0000000000000000000000000000000000000000 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> 169 3833695+0000 clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/1 0000000000000000000000000000000000000000 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 4 4 * Description: Captcha.eu provides a GDPR compliant protection against bots and spammers. 5 5 * Plugin URI: https://www.captcha.eu 6 * Version: 1.0.2 56 * Version: 1.0.26 7 7 * Author: captchaeu 8 8 * Author URI: https://profiles.wordpress.org/captchaeu/ -
captcha-eu/trunk/.php-cs-fixer.php
r2906129 r2985152 3 3 use PhpCsFixer\Config; 4 4 5 final class Php73 extends Config { 6 public function __construct() { 5 final class Php73 extends Config 6 { 7 public function __construct() 8 { 7 9 parent::__construct('KRNStyle'); 8 10 $this->setRiskyAllowed(true); 9 11 } 10 12 11 public function getRules(): array { 13 public function getRules(): array 14 { 12 15 $rules = [ 13 16 '@Symfony' => true, … … 53 56 'self_accessor' => true, 54 57 'short_scalar_cast' => true, 55 'single_blank_line_before_namespace' => true,56 58 'single_class_element_per_statement' => true, 57 59 'single_quote' => true, -
captcha-eu/trunk/assets/login.js
r2906129 r2985152 4 4 KROT.KROT_HOST = captchaAt.host; 5 5 6 var skipByException = false; 6 7 // 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 } 10 17 } 11 18 } … … 17 24 } 18 25 } 19 20 26 // Register 21 27 if(captchaAt.plugins.indexOf('_wp-registration') > -1) { … … 24 30 } 25 31 } 32 26 33 }); 27 34 -
captcha-eu/trunk/composer.lock
r2962567 r2985152 162 162 { 163 163 "name": "composer/pcre", 164 "version": "3.1. 0",164 "version": "3.1.1", 165 165 "source": { 166 166 "type": "git", 167 167 "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", 174 174 "shasum": "" 175 175 }, … … 213 213 "support": { 214 214 "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" 216 216 }, 217 217 "funding": [ … … 229 229 } 230 230 ], 231 "time": "202 2-11-17T09:50:14+00:00"231 "time": "2023-10-11T07:11:09+00:00" 232 232 }, 233 233 { … … 456 456 { 457 457 "name": "doctrine/deprecations", 458 "version": " v1.1.1",458 "version": "1.1.2", 459 459 "source": { 460 460 "type": "git", 461 461 "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", 468 468 "shasum": "" 469 469 }, … … 497 497 "support": { 498 498 "issues": "https://github.com/doctrine/deprecations/issues", 499 "source": "https://github.com/doctrine/deprecations/tree/ v1.1.1"500 }, 501 "time": "2023-0 6-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" 502 502 }, 503 503 { … … 651 651 { 652 652 "name": "friendsofphp/php-cs-fixer", 653 "version": "v3. 25.1",653 "version": "v3.36.0", 654 654 "source": { 655 655 "type": "git", 656 656 "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", 663 663 "shasum": "" 664 664 }, … … 693 693 "phpspec/prophecy-phpunit": "^2.0", 694 694 "phpunit/phpunit": "^9.5", 695 "phpunitgoodpractices/polyfill": "^1.6",696 "phpunitgoodpractices/traits": "^1.9.2",697 695 "symfony/phpunit-bridge": "^6.2.3", 698 696 "symfony/yaml": "^5.4 || ^6.0" … … 734 732 "support": { 735 733 "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" 737 735 }, 738 736 "funding": [ … … 742 740 } 743 741 ], 744 "time": "2023- 09-04T01:22:52+00:00"742 "time": "2023-10-27T10:12:29+00:00" 745 743 }, 746 744 { … … 1608 1606 { 1609 1607 "name": "phpstan/phpdoc-parser", 1610 "version": "1.2 3.1",1608 "version": "1.24.2", 1611 1609 "source": { 1612 1610 "type": "git", 1613 1611 "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", 1620 1618 "shasum": "" 1621 1619 }, … … 1649 1647 "support": { 1650 1648 "issues": "https://github.com/phpstan/phpdoc-parser/issues", 1651 "source": "https://github.com/phpstan/phpdoc-parser/tree/1.2 3.1"1652 }, 1653 "time": "2023-0 8-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" 1654 1652 }, 1655 1653 { 1656 1654 "name": "phpunit/php-code-coverage", 1657 "version": "9.2.2 7",1655 "version": "9.2.29", 1658 1656 "source": { 1659 1657 "type": "git", 1660 1658 "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", 1667 1665 "shasum": "" 1668 1666 }, … … 1721 1719 "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", 1722 1720 "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", 1723 "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.2 7"1721 "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.29" 1724 1722 }, 1725 1723 "funding": [ … … 1729 1727 } 1730 1728 ], 1731 "time": "2023-0 7-26T13:44:30+00:00"1729 "time": "2023-09-19T04:57:46+00:00" 1732 1730 }, 1733 1731 { … … 1974 1972 { 1975 1973 "name": "phpunit/phpunit", 1976 "version": "9.6.1 1",1974 "version": "9.6.13", 1977 1975 "source": { 1978 1976 "type": "git", 1979 1977 "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", 1986 1984 "shasum": "" 1987 1985 }, … … 1998 1996 "phar-io/version": "^3.0.2", 1999 1997 "php": ">=7.3", 2000 "phpunit/php-code-coverage": "^9.2. 13",1998 "phpunit/php-code-coverage": "^9.2.28", 2001 1999 "phpunit/php-file-iterator": "^3.0.5", 2002 2000 "phpunit/php-invoker": "^3.1.1", … … 2057 2055 "issues": "https://github.com/sebastianbergmann/phpunit/issues", 2058 2056 "security": "https://github.com/sebastianbergmann/phpunit/security/policy", 2059 "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.1 1"2057 "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.13" 2060 2058 }, 2061 2059 "funding": [ … … 2073 2071 } 2074 2072 ], 2075 "time": "2023-0 8-19T07:10:56+00:00"2073 "time": "2023-09-19T05:39:22+00:00" 2076 2074 }, 2077 2075 { … … 2224 2222 { 2225 2223 "name": "psr/http-client", 2226 "version": "1.0. 2",2224 "version": "1.0.3", 2227 2225 "source": { 2228 2226 "type": "git", 2229 2227 "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", 2236 2234 "shasum": "" 2237 2235 }, … … 2270 2268 ], 2271 2269 "support": { 2272 "source": "https://github.com/php-fig/http-client /tree/1.0.2"2273 }, 2274 "time": "2023-0 4-10T20:12:12+00:00"2270 "source": "https://github.com/php-fig/http-client" 2271 }, 2272 "time": "2023-09-23T14:17:50+00:00" 2275 2273 }, 2276 2274 { … … 4791 4789 { 4792 4790 "name": "symfony/string", 4793 "version": "v5.4.2 6",4791 "version": "v5.4.29", 4794 4792 "source": { 4795 4793 "type": "git", 4796 4794 "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", 4803 4801 "shasum": "" 4804 4802 }, … … 4857 4855 ], 4858 4856 "support": { 4859 "source": "https://github.com/symfony/string/tree/v5.4.2 6"4857 "source": "https://github.com/symfony/string/tree/v5.4.29" 4860 4858 }, 4861 4859 "funding": [ … … 4873 4871 } 4874 4872 ], 4875 "time": "2023-0 6-28T12:46:07+00:00"4873 "time": "2023-09-13T11:47:41+00:00" 4876 4874 }, 4877 4875 { -
captcha-eu/trunk/readme.txt
r2962567 r2985152 5 5 Tested up to: 6.2 6 6 Requires PHP: 7.0 7 Stable tag: 1.0.2 57 Stable tag: 1.0.26 8 8 License: GPL 9 9 License URI: https://opensource.org/license/gpl/ … … 61 61 62 62 == 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 63 65 = 1.0.25 = 64 66 * update readme.txt - add video -
captcha-eu/trunk/src/Admin.php
r2941141 r2985152 3 3 namespace CAPTCHA\Plugin; 4 4 5 class Admin { 5 class Admin 6 { 6 7 private $plugin_dir; 7 8 private $plugin_dir_url; … … 12 13 private $urls; 13 14 private $sdkVersion; 14 15 public function __construct($core) { 15 private $hasWordFence; 16 17 public function __construct($core) 18 { 16 19 global $wpdb; 20 $this->hasWordFence = false; 17 21 $this->wpdb = $wpdb; 18 22 $this->core = $core; … … 36 40 } 37 41 38 public function init() { 42 public function init() 43 { 39 44 $this->options(); 40 45 } 41 46 42 public function enque_scripts() { 47 public function enque_scripts() 48 { 43 49 // no captcha-eu plugins activated => skip sdk.js load 44 50 $plugins = get_option('captcha_at_plugin'); … … 68 74 } 69 75 70 public function enqueue_sdk_script() { 76 public function enqueue_sdk_script() 77 { 71 78 // check if proxy enabled 72 79 if (get_option('captcha_at_proxy_enabled')) { … … 83 90 } 84 91 85 public function login_scripts() { 92 public function login_scripts() 93 { 86 94 // handle sdk.js loading 87 95 $this->enqueue_sdk_script(); … … 117 125 } 118 126 119 public function handleActivationTransient() { 127 public function handleActivationTransient() 128 { 120 129 // check if update transient is set 121 130 $isActivation = get_transient('captcha-at-notice-activation'); … … 127 136 } 128 137 129 public function handleEndpoint() { 138 public function handleEndpoint() 139 { 130 140 // if host is not set or empty => use default 131 141 if (get_option('captcha_at_host') && '' != get_option('captcha_at_host')) { … … 136 146 } 137 147 138 public function handleSDKVersion() { 148 public function handleSDKVersion() 149 { 139 150 // if host is not set or empty => use default 140 151 $optKey = 'captcha_at_version_sdk'; … … 151 162 } 152 163 153 public function sdkVersionCheckUpdate($proxyForce = false) { 164 public function sdkVersionCheckUpdate($proxyForce = false) 165 { 154 166 // use host from options (no proxy) 155 167 $restKey = get_option('captcha_at_rest_key'); … … 207 219 } 208 220 209 private function concatInterceptors() { 221 private function concatInterceptors() 222 { 210 223 // get all selected plugins to add the interceptor's to 211 224 $plugins = get_option('captcha_at_plugin'); … … 245 258 } 246 259 247 private function localize_script_data($scriptData) { 260 private function localize_script_data($scriptData) 261 { 248 262 // localize scriptData to captchaAt variable 249 263 wp_localize_script('captcha-eu-wp', 'captchaAt', $scriptData); 250 264 } 251 265 252 public function options() { 266 public function options() 267 { 253 268 register_setting('captcha-at_settings', 'captcha_at_rest_key'); 254 269 register_setting('captcha-at_settings', 'captcha_at_host', ['default' => 'https://w19.captcha.at']); … … 260 275 } 261 276 262 public function menu() { 277 public function menu() 278 { 263 279 $settings_page = add_menu_page( 264 280 __('Captcha.eu', 'captcha-eu'), … … 288 304 } 289 305 290 public function pre_comment_on_post($comment_post_ID) { 306 public function pre_comment_on_post($comment_post_ID) 307 { 291 308 $go_back = sprintf('<br><a href="javascript:history.go(-1)">' . __('Back to', 'captcha-eu') . ' "%s"</a>', get_the_title($comment_post_ID)); 292 309 $error = '<strong>' . __('ERROR', 'captcha-eu') . '</strong>:' . __('Captcha.eu failed to validate.', 'captcha-eu') . $go_back; … … 302 319 } 303 320 304 public function authenticate($user, $username, $password) { 321 public function authenticate($user, $username, $password) 322 { 305 323 $error = new \WP_Error('captcha_failed', __('Captcha.eu failed', 'captcha-eu')); 306 324 … … 308 326 return $user; 309 327 } 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 310 344 if (! isset($_POST['captcha_at_solution'])) { 311 345 return $error; … … 319 353 } 320 354 321 public function allow_password_reset($allow, $user_id) { 355 public function allow_password_reset($allow, $user_id) 356 { 322 357 if (! isset($_POST['captcha_at_solution'])) { 323 358 return false; … … 331 366 } 332 367 333 public function wpcf7_spam($spam, $submission) { 368 public function wpcf7_spam($spam, $submission) 369 { 334 370 if ($spam) { 335 371 return $spam; … … 350 386 } 351 387 352 public function wpforms_process($fields, $entry, $form_data) { 388 public function wpforms_process($fields, $entry, $form_data) 389 { 353 390 if (! isset($_POST['captcha_at_solution'])) { 354 391 wpforms()->process->errors[$form_data['id']]['footer'] = esc_html__('Captcha.eu failed', 'captcha-eu'); … … 360 397 } 361 398 362 public function gform_abort_submission_with_confirmation($do_abort, $form) { 399 public function gform_abort_submission_with_confirmation($do_abort, $form) 400 { 363 401 if ($do_abort) { 364 402 return $do_abort; … … 376 414 } 377 415 378 public function ninja_forms_submit_data($formData) { 416 public function ninja_forms_submit_data($formData) 417 { 379 418 // formData not set => exit 380 419 if (! isset($formData) || empty($formData)) { … … 405 444 } 406 445 407 public function registration_errors($errors, $login_sanitized, $email) { 446 public function registration_errors($errors, $login_sanitized, $email) 447 { 408 448 // check if captcha solution supplied 409 449 if (! isset($_POST['captcha_at_solution'])) { … … 422 462 } 423 463 424 public function mc4wp_form_errors($errors, $form) { 464 public function mc4wp_form_errors($errors, $form) 465 { 425 466 // no solution supplied 426 467 if (! isset($form->raw_data['captcha_at_solution'])) { … … 439 480 } 440 481 441 public function admin_notices() { 482 public function admin_notices() 483 { 442 484 // only disable for captcha-eu pages 443 485 $screen = get_current_screen(); … … 472 514 473 515 // check if current screen should show captcha-nag's 474 private function nagEnabledOnPage() { 516 private function nagEnabledOnPage() 517 { 475 518 // get pagenow & screen 476 519 global $pagenow; … … 480 523 } 481 524 482 public function captchaNagValidateErrors() { 525 public function captchaNagValidateErrors() 526 { 483 527 global $pagenow; 484 528 $screen = get_current_screen(); … … 537 581 } 538 582 539 public function captchaNagSetup($force = false) { 583 public function captchaNagSetup($force = false) 584 { 540 585 // SHOW NAG/NOTICE AFTER INSTALLING 541 586 global $pagenow; … … 568 613 } 569 614 570 public function captchaNagDeactivated() { 615 public function captchaNagDeactivated() 616 { 571 617 // SHOW NAG/NOTICE AFTER INSTALLING 572 618 echo '<div class="update-nag captcha-at-nag">'; … … 581 627 } 582 628 583 public function plugin_deactivated() { 629 public function plugin_deactivated() 630 { 584 631 // clear update schedules/crons 585 632 wp_clear_scheduled_hook('captcha_at_sched_sdk_version'); … … 599 646 } 600 647 601 public function addError($error = '') { 648 public function addError($error = '') 649 { 602 650 // if error empty => skip 603 651 if ('' == $error) { … … 633 681 } 634 682 635 private function options_delete_proxy() { 683 private function options_delete_proxy() 684 { 636 685 // delete all proxy options 637 686 delete_option('captcha_at_proxy_enabled'); … … 640 689 } 641 690 642 public function admin_scripts($hook) { 691 public function admin_scripts($hook) 692 { 643 693 $screen = get_current_screen(); 644 694 … … 649 699 } 650 700 651 public function captcha_at_check_settings() { 701 public function captcha_at_check_settings() 702 { 652 703 // get values from POST 653 704 $postHost = isset($_POST['host']) ? sanitize_url($_POST['host']) : false; … … 696 747 } 697 748 698 public function woocommerce_login_form($content = '') { 749 public function woocommerce_login_form($content = '') 750 { 699 751 echo '<input type="hidden" name="login" value="Login">'; 700 752 … … 702 754 } 703 755 704 public function woocommerce_process_login_errors($validation_error, $login, $pass) { 756 public function woocommerce_process_login_errors($validation_error, $login, $pass) 757 { 705 758 if (! isset($_POST['captcha_at_solution'])) { 706 759 // no solution supplied … … 722 775 } 723 776 724 public function woocommerce_register_form($content = '') { 777 public function woocommerce_register_form($content = '') 778 { 725 779 echo '<input type="hidden" name="register" value="Register">'; 726 780 … … 728 782 } 729 783 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 { 731 786 if (! isset($_POST['captcha_at_solution'])) { 732 787 // no solution supplied … … 748 803 } 749 804 750 public function woocommerce_lostpassword_form($content = '') { 805 public function woocommerce_lostpassword_form($content = '') 806 { 751 807 return $content; 752 808 } 753 809 754 public function woocommerce_after_checkout_billing_form($checkout) { 810 public function woocommerce_after_checkout_billing_form($checkout) 811 { 755 812 echo '<input type="hidden" name="captcha_at_solution" class="captcha_at_hidden_field" value="test">'; 756 813 } 757 814 758 public function woocommerce_after_checkout_validation($fields, $errors) { 815 public function woocommerce_after_checkout_validation($fields, $errors) 816 { 759 817 if (! isset($_POST['captcha_at_solution'])) { 760 818 // no solution supplied … … 772 830 } 773 831 774 public function elementor_pro_forms_validation($record, $ajax_handler) { 832 public function elementor_pro_forms_validation($record, $ajax_handler) 833 { 775 834 $msgErr = __('Captcha.eu failed', 'captcha-eu'); 776 835 … … 793 852 } 794 853 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 { 796 856 if (! isset($_POST['captcha_at_solution'])) { 797 857 echo __('Captcha.eu failed', 'captcha-eu'); … … 807 867 } 808 868 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 { 810 871 // option has been updated => check 811 872 $proxyEnable = $valueNew; … … 822 883 } 823 884 824 public function rest_get_sdkjs() { 885 public function rest_get_sdkjs() 886 { 825 887 // set content type header to javascript 826 888 header('Content-Type: application/javascript'); … … 832 894 } 833 895 834 public function rest_challenge(\WP_REST_Request $request) { 896 public function rest_challenge(\WP_REST_Request $request) 897 { 835 898 // get param from url 836 899 $publicSecret = $request->get_param('publicSecret'); … … 884 947 } 885 948 886 public function rest_api_init() { 949 public function rest_api_init() 950 { 887 951 // serve sdk.js 888 952 register_rest_route('captcha-eu/v1', '/sdk.js', [ … … 900 964 } 901 965 902 public function add_filters() { 966 public function add_filters() 967 { 903 968 // get selected plugins from option 904 969 $selectedPlugins = get_option('captcha_at_plugin'); … … 1012 1077 } 1013 1078 1014 public function notice($type = '', $msg = '') { 1079 public function notice($type = '', $msg = '') 1080 { 1015 1081 return (object) [ 1016 1082 'type' => $type, … … 1019 1085 } 1020 1086 1021 private function apiFetchLatestVersion() { 1087 private function apiFetchLatestVersion() 1088 { 1022 1089 // fetch asset version info route 1023 1090 $data = wp_remote_get($this->endpoint . '/version?t=' . time(), [ … … 1051 1118 } 1052 1119 1053 private function apiFetchPersonal($host = '', $restKey = '') { 1120 private function apiFetchPersonal($host = '', $restKey = '') 1121 { 1054 1122 // fetch personal info route 1055 1123 $data = wp_remote_get($host . '/api/personal', [ … … 1076 1144 } 1077 1145 1078 private function getApiOptions() { 1146 private function getApiOptions() 1147 { 1079 1148 $host = get_option('captcha_at_host'); 1080 1149 … … 1091 1160 } 1092 1161 1093 private function getPluginData() { 1162 private function getPluginData() 1163 { 1094 1164 // ensure get_plugin_data is available 1095 1165 if (! function_exists('get_plugin_data')) { … … 1102 1172 } 1103 1173 1104 public function options_page() { 1174 public function options_page() 1175 { 1105 1176 // define vars for the option page to use 1106 1177 … … 1255 1326 } 1256 1327 1257 public function options_page_settings() { 1328 public function options_page_settings() 1329 { 1258 1330 // configErrors => used to display errors/notices on option settings page 1259 1331 $configMessages = []; -
captcha-eu/trunk/src/Core.php
r2941141 r2985152 3 3 namespace CAPTCHA\Plugin; 4 4 5 class Core { 5 class Core 6 { 6 7 private $plugin_dir; 7 8 private $plugin_dir_url; … … 11 12 public $options; 12 13 13 public function __construct() { 14 public function __construct() 15 { 14 16 global $wpdb; 15 17 $this->wpdb = $wpdb; … … 21 23 } 22 24 23 public function getRealIP() { 25 public function getRealIP() 26 { 24 27 // Check if the header is present 25 28 if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { … … 42 45 } 43 46 44 public function anonymizeIP($ip) { 47 public function anonymizeIP($ip) 48 { 45 49 // Check if the IP address is IPv4 or IPv6 46 50 if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { … … 71 75 } 72 76 73 public function validate($solution) { 77 public function validate($solution) 78 { 74 79 $url = $this->admin->endpoint; 75 80 $restKey = get_option('captcha_at_rest_key'); 76 $url = $url .'/validate';81 $url .= '/validate'; 77 82 78 83 // if the request is made through a proxy or load balancer -
captcha-eu/trunk/src/Frontend.php
r2941141 r2985152 3 3 namespace CAPTCHA\Plugin; 4 4 5 class Frontend { 5 class Frontend 6 { 6 7 private $plugin_dir; 7 8 private $wpdb; 8 9 private $core; 9 10 10 public function __construct($core) { 11 public function __construct($core) 12 { 11 13 global $wpdb; 12 14 $this->wpdb = $wpdb; … … 15 17 } 16 18 17 public function add_filters() { 19 public function add_filters() 20 { 18 21 } 19 22 } -
captcha-eu/trunk/src/Options.php
r2941141 r2985152 3 3 namespace CAPTCHA\Plugin; 4 4 5 class Options { 5 class Options 6 { 6 7 private $plugin_dir; 7 8 private $plugin_dir_url; … … 9 10 private $optionErrors; 10 11 11 public function __construct($core) { 12 public function __construct($core) 13 { 12 14 $this->core = $core; 13 15 … … 22 24 } 23 25 24 private function add_actions() { 26 private function add_actions() 27 { 25 28 add_action('admin_menu', [$this, 'enqueue_styles'], 20); 26 29 } 27 30 28 public function enqueue_styles() { 31 public function enqueue_styles() 32 { 29 33 wp_enqueue_style('captchaOptions', $this->plugin_dir_url . 'assets/css/options.css'); 30 34 } 31 35 32 36 // render title 33 public function fieldTitle($val = '', $icon = '') { 37 public function fieldTitle($val = '', $icon = '') 38 { 34 39 // empty => don't output 35 40 if ('' == $val) { … … 51 56 52 57 // render k/v table 53 public function fieldKeyValue($arrKV = []) { 58 public function fieldKeyValue($arrKV = []) 59 { 54 60 if ([] == $arrKV) { 55 61 return ''; … … 77 83 78 84 // wrap items in div 79 public function wrapInDiv($class = '', $content = []) { 85 public function wrapInDiv($class = '', $content = []) 86 { 80 87 $out = ''; 81 88 … … 94 101 95 102 // render label 96 public function fieldLabel($for = '', $val = '') { 103 public function fieldLabel($for = '', $val = '') 104 { 97 105 // empty => don't output 98 106 if ('' == $for || '' == $val) { … … 104 112 105 113 // render info icon with title text 106 public function fieldInfoIcon($title = '') { 114 public function fieldInfoIcon($title = '') 115 { 107 116 // empty => don't output 108 117 if ('' == $title) { … … 114 123 115 124 // render input field with type text 116 public function fieldInputText($name = '', $val = '', $placeholder = '') { 125 public function fieldInputText($name = '', $val = '', $placeholder = '') 126 { 117 127 // empty => don't output 118 128 if ('' == $name) { … … 124 134 125 135 // render textarea field 126 public function fieldInputTextarea($name = '', $val = '', $placeholder = '') { 136 public function fieldInputTextarea($name = '', $val = '', $placeholder = '') 137 { 127 138 // empty => don't output 128 139 if ('' == $name) { … … 134 145 135 146 // 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 { 137 149 // empty => don't output 138 150 if ('' == $name || [] == $options) { … … 170 182 171 183 // render panel with message 172 public function panelMSG($type = '', $msg = '') { 184 public function panelMSG($type = '', $msg = '') 185 { 173 186 // empty => don't output 174 187 if ('' == $msg) { … … 184 197 185 198 // render panel with message 186 public function settingsPanel($fields = [], $class = '') { 199 public function settingsPanel($fields = [], $class = '') 200 { 187 201 // empty => don't output 188 202 if (empty($fields)) { -
captcha-eu/trunk/tests/phpunit/PrettyPrinter.php
r2906129 r2985152 3 3 namespace Test; 4 4 5 class PrettyPrinter extends \PHPUnit\TextUI\ResultPrinter implements \PHPUnit\Framework\TestListener { 5 class PrettyPrinter extends \PHPUnit\TextUI\ResultPrinter implements \PHPUnit\Framework\TestListener 6 { 6 7 private $headerPrinted = false; 7 8 … … 10 11 * unit test summary (after all tests have run). 11 12 */ 12 protected function printHeader(): void { 13 protected function printHeader(): void 14 { 13 15 parent::printHeader(); 14 16 } 15 17 16 protected function formatExceptionMsg($exceptionMessage) { 18 protected function formatExceptionMsg($exceptionMessage) 19 { 17 20 $exceptionMessage = str_replace("+++ Actual\n", '', $exceptionMessage); 18 21 $exceptionMessage = str_replace("--- Expected\n", '', $exceptionMessage); … … 24 27 } 25 28 26 protected function printDefectTrace(\PHPUnit\Framework\TestFailure $defect): void { 29 protected function printDefectTrace(\PHPUnit\Framework\TestFailure $defect): void 30 { 27 31 $this->write($this->formatExceptionMsg($defect->getExceptionAsString())); 28 32 $trace = \PHPUnit\Util\Filter::getFilteredStacktrace( … … 49 53 * @param string $color optional color (if supported by console) 50 54 */ 51 private function out($message, $color = '', $linebreak = false) { 55 private function out($message, $color = '', $linebreak = false) 56 { 52 57 echo($color ? $this->formatWithColor($color, $message) : $message) . ($linebreak ? "\n" : ''); 53 58 } … … 56 61 * Fired prior to each individual test. 57 62 */ 58 public function startTest(\PHPUnit\Framework\Test $test): void { 63 public function startTest(\PHPUnit\Framework\Test $test): void 64 { 59 65 $this->out(">> RUN '" . preg_replace('/^test/', '', $test->getName()) . "'..."); 60 66 } … … 66 72 * @param int time of execution 67 73 */ 68 public function endTest(\PHPUnit\Framework\Test $test, $time): void { 74 public function endTest(\PHPUnit\Framework\Test $test, $time): void 75 { 69 76 // copied from parent:endTest() 70 77 if ($test instanceof \PHPUnit\Framework\TestCase) { … … 93 100 * called at the initialization of each test suite. 94 101 */ 95 public function prettySuiteName($s) { 102 public function prettySuiteName($s) 103 { 96 104 return preg_replace("/^Tests\\\/", '', $s); 97 105 } 98 106 99 public function startTestSuite(\PHPUnit\Framework\TestSuite $suite): void { 107 public function startTestSuite(\PHPUnit\Framework\TestSuite $suite): void 108 { 100 109 parent::startTestSuite($suite); 101 110 if (! $this->headerPrinted) { … … 116 125 } 117 126 118 public function endTestSuite(\PHPUnit\Framework\TestSuite $suite): void { 127 public function endTestSuite(\PHPUnit\Framework\TestSuite $suite): void 128 { 119 129 if ('PHPUnit' != $suite->getName()) { 120 130 $this->out("END SUITE '" . $this->prettySuiteName($suite->getName()) . "'\n\n"); … … 128 138 * @param string $progress 129 139 */ 130 protected function writeProgress($progress): void { 140 protected function writeProgress($progress): void 141 { 131 142 // suppress output; 132 143 } -
captcha-eu/trunk/tests/phpunit/bootstrap.php
r2906129 r2985152 12 12 define('KRN_IS_TESTING', 1); 13 13 14 class bootstrap { 15 public function __construct() { 14 class bootstrap 15 { 16 public function __construct() 17 { 16 18 $_tests_dir = getenv('WP_TESTS_DIR'); 17 19 if (! $_tests_dir) { … … 30 32 } 31 33 32 public function _manually_load_plugin() { 34 public function _manually_load_plugin() 35 { 33 36 require dirname(dirname(__FILE__)) . '../../kmm-flattable.php'; 34 37 } -
captcha-eu/trunk/tests/test-captcha.php
r2906129 r2985152 1 1 <?php 2 2 /** 3 * @covers \KMM\Flattable\Core4 */3 * @covers \KMM\Flattable\Core 4 */ 5 5 use CAPTCHA\Plugin\Core; 6 6 7 class FlattableTestDB { 7 class FlattableTestDB 8 { 8 9 public $prefix = 'wptest'; 9 10 10 public function query($sql) { 11 public function query($sql) 12 { 11 13 } 12 14 13 public function get_results($r) { 15 public function get_results($r) 16 { 14 17 } 15 18 16 public function prepare($data) { 19 public function prepare($data) 20 { 17 21 } 18 22 } 19 23 20 class TestFlattable extends \WP_UnitTestCase { 21 public function setUp(): void { 24 class TestFlattable extends \WP_UnitTestCase 25 { 26 public function setUp(): void 27 { 22 28 // setup a rest server 23 29 parent::setUp(); … … 28 34 * @test 29 35 */ 30 public function dummy_test() { 36 public function dummy_test() 37 { 31 38 $this->assertNull(null); 32 39 } 33 40 34 public function tearDown(): void { 41 public function tearDown(): void 42 { 35 43 parent::tearDown(); 36 44 } -
captcha-eu/trunk/vendor/autoload.php
r2962567 r2985152 23 23 require_once __DIR__ . '/composer/autoload_real.php'; 24 24 25 return ComposerAutoloaderInit c6537ae706336734539418e7c25e7522::getLoader();25 return ComposerAutoloaderInit317f193e59d41c516767761402e9a3bd::getLoader(); -
captcha-eu/trunk/vendor/composer/autoload_real.php
r2962567 r2985152 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit c6537ae706336734539418e7c25e75225 class ComposerAutoloaderInit317f193e59d41c516767761402e9a3bd 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit c6537ae706336734539418e7c25e7522', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInit317f193e59d41c516767761402e9a3bd', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInit c6537ae706336734539418e7c25e7522', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInit317f193e59d41c516767761402e9a3bd', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInit c6537ae706336734539418e7c25e7522::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInit317f193e59d41c516767761402e9a3bd::getInitializer($loader)); 33 33 34 34 $loader->register(true); -
captcha-eu/trunk/vendor/composer/autoload_static.php
r2962567 r2985152 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit c6537ae706336734539418e7c25e75227 class ComposerStaticInit317f193e59d41c516767761402e9a3bd 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 32 32 { 33 33 return \Closure::bind(function () use ($loader) { 34 $loader->prefixLengthsPsr4 = ComposerStaticInit c6537ae706336734539418e7c25e7522::$prefixLengthsPsr4;35 $loader->prefixDirsPsr4 = ComposerStaticInit c6537ae706336734539418e7c25e7522::$prefixDirsPsr4;36 $loader->classMap = ComposerStaticInit c6537ae706336734539418e7c25e7522::$classMap;34 $loader->prefixLengthsPsr4 = ComposerStaticInit317f193e59d41c516767761402e9a3bd::$prefixLengthsPsr4; 35 $loader->prefixDirsPsr4 = ComposerStaticInit317f193e59d41c516767761402e9a3bd::$prefixDirsPsr4; 36 $loader->classMap = ComposerStaticInit317f193e59d41c516767761402e9a3bd::$classMap; 37 37 38 38 }, 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> 169 3833695+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> 169 3833695+0000 checkout: moving from main to v1.12.01 0000000000000000000000000000000000000000 2a9170263fcd9cc4fd0b50917293c21d6c1a5bfe Erick Hitter (GitLab CI) <git-contrib+ci@ethitter.com> 1698435822 +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> 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> 169 3833695+0000 clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/1 0000000000000000000000000000000000000000 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> 169 3833695+0000 clone: from /root/.composer/cache/vcs/https---github.com-composer-installers.git/1 0000000000000000000000000000000000000000 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 4 4 * Description: Captcha.eu provides a GDPR compliant protection against bots and spammers. 5 5 * Plugin URI: https://www.captcha.eu 6 * Version: 1.0.2 56 * Version: 1.0.26 7 7 * Author: captchaeu 8 8 * Author URI: https://profiles.wordpress.org/captchaeu/
Note: See TracChangeset
for help on using the changeset viewer.