Changeset 3254837
- Timestamp:
- 03/12/2025 02:34:39 PM (13 months ago)
- Location:
- trustcaptcha/trunk
- Files:
-
- 11 edited
-
composer.json (modified) (1 diff)
-
composer.lock (modified) (2 diffs)
-
readme.txt (modified) (4 diffs)
-
trustcaptcha.php (modified) (1 diff)
-
vendor/composer/autoload_psr4.php (modified) (1 diff)
-
vendor/composer/autoload_static.php (modified) (2 diffs)
-
vendor/composer/installed.json (modified) (2 diffs)
-
vendor/composer/installed.php (modified) (3 diffs)
-
vendor/trustcaptcha/trustcaptcha-php/.gitignore (modified) (1 diff)
-
vendor/trustcaptcha/trustcaptcha-php/composer.json (modified) (2 diffs)
-
vendor/trustcaptcha/trustcaptcha-php/src/CaptchaManager.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trustcaptcha/trunk/composer.json
r3185168 r3254837 1 1 { 2 "name": "trustcaptcha/trustcaptcha-wordpress", 3 "type": "wordpress-plugin", 4 "require-dev": { 5 "wp-coding-standards/wpcs": "^2.3", 6 "phpcompatibility/phpcompatibility-wp": "*", 7 "dealerdirect/phpcodesniffer-composer-installer": "^0.7" 8 }, 2 9 "require": { 3 "trustcaptcha/trustcaptcha-php": "^1.1" 10 "trustcaptcha/trustcaptcha-php": "^1.2" 11 }, 12 "autoload": { 13 "psr-4": { 14 "Trustcaptcha\\": "src/php" 15 } 16 }, 17 "authors": [ 18 { 19 "name": "Trustcaptcha", 20 "homepage": "https://trustcaptcha.com" 21 } 22 ], 23 "config": { 24 "allow-plugins": { 25 "dealerdirect/phpcodesniffer-composer-installer": true 26 } 4 27 } 5 28 } -
trustcaptcha/trunk/composer.lock
r3185168 r3254837 5 5 "This file is @generated automatically" 6 6 ], 7 "content-hash": " cce021571cf51d5888b93f91a6ae7593",7 "content-hash": "92a29e794688673a61d1bb11facdb2ce", 8 8 "packages": [ 9 9 { 10 10 "name": "trustcaptcha/trustcaptcha-php", 11 "version": "1. 1.1",11 "version": "1.2.0", 12 12 "source": { 13 13 "type": "git", 14 14 "url": "https://github.com/trustcaptcha/php-library.git", 15 "reference": "ebf1feabd912cf75c8a8f0ba32782261c19842f7" 16 }, 17 "dist": { 18 "type": "zip", 19 "url": "https://api.github.com/repos/trustcaptcha/php-library/zipball/ebf1feabd912cf75c8a8f0ba32782261c19842f7", 20 "reference": "ebf1feabd912cf75c8a8f0ba32782261c19842f7", 21 "shasum": "" 22 }, 23 "require": { 15 "reference": "86c4f3de7e040382af2ca0c2959a196bb4e68b71" 16 }, 17 "dist": { 18 "type": "zip", 19 "url": "https://api.github.com/repos/trustcaptcha/php-library/zipball/86c4f3de7e040382af2ca0c2959a196bb4e68b71", 20 "reference": "86c4f3de7e040382af2ca0c2959a196bb4e68b71", 21 "shasum": "" 22 }, 23 "require": { 24 "ext-json": "*", 24 25 "php": ">=7.0" 25 26 }, 26 27 "require-dev": { 27 "phpunit/phpunit": "^9. 5"28 "phpunit/phpunit": "^9.6" 28 29 }, 29 30 "type": "library", … … 64 65 "support": { 65 66 "issues": "https://github.com/trustcaptcha/php-library/issues", 66 "source": "https://github.com/trustcaptcha/php-library/tree/1. 1.1"67 }, 68 "time": "2024-1 0-26T15:38:49+00:00"67 "source": "https://github.com/trustcaptcha/php-library/tree/1.2.0" 68 }, 69 "time": "2024-12-20T15:57:28+00:00" 69 70 } 70 71 ], 71 "packages-dev": [], 72 "packages-dev": [ 73 { 74 "name": "dealerdirect/phpcodesniffer-composer-installer", 75 "version": "v0.7.2", 76 "source": { 77 "type": "git", 78 "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", 79 "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" 80 }, 81 "dist": { 82 "type": "zip", 83 "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", 84 "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", 85 "shasum": "" 86 }, 87 "require": { 88 "composer-plugin-api": "^1.0 || ^2.0", 89 "php": ">=5.3", 90 "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" 91 }, 92 "require-dev": { 93 "composer/composer": "*", 94 "php-parallel-lint/php-parallel-lint": "^1.3.1", 95 "phpcompatibility/php-compatibility": "^9.0" 96 }, 97 "type": "composer-plugin", 98 "extra": { 99 "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" 100 }, 101 "autoload": { 102 "psr-4": { 103 "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" 104 } 105 }, 106 "notification-url": "https://packagist.org/downloads/", 107 "license": [ 108 "MIT" 109 ], 110 "authors": [ 111 { 112 "name": "Franck Nijhof", 113 "email": "franck.nijhof@dealerdirect.com", 114 "homepage": "http://www.frenck.nl", 115 "role": "Developer / IT Manager" 116 }, 117 { 118 "name": "Contributors", 119 "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" 120 } 121 ], 122 "description": "PHP_CodeSniffer Standards Composer Installer Plugin", 123 "homepage": "http://www.dealerdirect.com", 124 "keywords": [ 125 "PHPCodeSniffer", 126 "PHP_CodeSniffer", 127 "code quality", 128 "codesniffer", 129 "composer", 130 "installer", 131 "phpcbf", 132 "phpcs", 133 "plugin", 134 "qa", 135 "quality", 136 "standard", 137 "standards", 138 "style guide", 139 "stylecheck", 140 "tests" 141 ], 142 "support": { 143 "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", 144 "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" 145 }, 146 "time": "2022-02-04T12:51:07+00:00" 147 }, 148 { 149 "name": "phpcompatibility/php-compatibility", 150 "version": "9.3.5", 151 "source": { 152 "type": "git", 153 "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", 154 "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" 155 }, 156 "dist": { 157 "type": "zip", 158 "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", 159 "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", 160 "shasum": "" 161 }, 162 "require": { 163 "php": ">=5.3", 164 "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" 165 }, 166 "conflict": { 167 "squizlabs/php_codesniffer": "2.6.2" 168 }, 169 "require-dev": { 170 "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" 171 }, 172 "suggest": { 173 "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", 174 "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." 175 }, 176 "type": "phpcodesniffer-standard", 177 "notification-url": "https://packagist.org/downloads/", 178 "license": [ 179 "LGPL-3.0-or-later" 180 ], 181 "authors": [ 182 { 183 "name": "Wim Godden", 184 "homepage": "https://github.com/wimg", 185 "role": "lead" 186 }, 187 { 188 "name": "Juliette Reinders Folmer", 189 "homepage": "https://github.com/jrfnl", 190 "role": "lead" 191 }, 192 { 193 "name": "Contributors", 194 "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" 195 } 196 ], 197 "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", 198 "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", 199 "keywords": [ 200 "compatibility", 201 "phpcs", 202 "standards" 203 ], 204 "support": { 205 "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", 206 "source": "https://github.com/PHPCompatibility/PHPCompatibility" 207 }, 208 "time": "2019-12-27T09:44:58+00:00" 209 }, 210 { 211 "name": "phpcompatibility/phpcompatibility-paragonie", 212 "version": "1.3.3", 213 "source": { 214 "type": "git", 215 "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", 216 "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac" 217 }, 218 "dist": { 219 "type": "zip", 220 "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/293975b465e0e709b571cbf0c957c6c0a7b9a2ac", 221 "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac", 222 "shasum": "" 223 }, 224 "require": { 225 "phpcompatibility/php-compatibility": "^9.0" 226 }, 227 "require-dev": { 228 "dealerdirect/phpcodesniffer-composer-installer": "^1.0", 229 "paragonie/random_compat": "dev-master", 230 "paragonie/sodium_compat": "dev-master" 231 }, 232 "suggest": { 233 "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", 234 "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." 235 }, 236 "type": "phpcodesniffer-standard", 237 "notification-url": "https://packagist.org/downloads/", 238 "license": [ 239 "LGPL-3.0-or-later" 240 ], 241 "authors": [ 242 { 243 "name": "Wim Godden", 244 "role": "lead" 245 }, 246 { 247 "name": "Juliette Reinders Folmer", 248 "role": "lead" 249 } 250 ], 251 "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", 252 "homepage": "http://phpcompatibility.com/", 253 "keywords": [ 254 "compatibility", 255 "paragonie", 256 "phpcs", 257 "polyfill", 258 "standards", 259 "static analysis" 260 ], 261 "support": { 262 "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", 263 "security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy", 264 "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" 265 }, 266 "funding": [ 267 { 268 "url": "https://github.com/PHPCompatibility", 269 "type": "github" 270 }, 271 { 272 "url": "https://github.com/jrfnl", 273 "type": "github" 274 }, 275 { 276 "url": "https://opencollective.com/php_codesniffer", 277 "type": "open_collective" 278 } 279 ], 280 "time": "2024-04-24T21:30:46+00:00" 281 }, 282 { 283 "name": "phpcompatibility/phpcompatibility-wp", 284 "version": "2.1.6", 285 "source": { 286 "type": "git", 287 "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", 288 "reference": "80ccb1a7640995edf1b87a4409fa584cd5869469" 289 }, 290 "dist": { 291 "type": "zip", 292 "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/80ccb1a7640995edf1b87a4409fa584cd5869469", 293 "reference": "80ccb1a7640995edf1b87a4409fa584cd5869469", 294 "shasum": "" 295 }, 296 "require": { 297 "phpcompatibility/php-compatibility": "^9.0", 298 "phpcompatibility/phpcompatibility-paragonie": "^1.0" 299 }, 300 "require-dev": { 301 "dealerdirect/phpcodesniffer-composer-installer": "^1.0" 302 }, 303 "suggest": { 304 "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", 305 "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." 306 }, 307 "type": "phpcodesniffer-standard", 308 "notification-url": "https://packagist.org/downloads/", 309 "license": [ 310 "LGPL-3.0-or-later" 311 ], 312 "authors": [ 313 { 314 "name": "Wim Godden", 315 "role": "lead" 316 }, 317 { 318 "name": "Juliette Reinders Folmer", 319 "role": "lead" 320 } 321 ], 322 "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", 323 "homepage": "http://phpcompatibility.com/", 324 "keywords": [ 325 "compatibility", 326 "phpcs", 327 "standards", 328 "static analysis", 329 "wordpress" 330 ], 331 "support": { 332 "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", 333 "security": "https://github.com/PHPCompatibility/PHPCompatibilityWP/security/policy", 334 "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" 335 }, 336 "funding": [ 337 { 338 "url": "https://github.com/PHPCompatibility", 339 "type": "github" 340 }, 341 { 342 "url": "https://github.com/jrfnl", 343 "type": "github" 344 }, 345 { 346 "url": "https://opencollective.com/php_codesniffer", 347 "type": "open_collective" 348 } 349 ], 350 "time": "2025-01-16T22:34:19+00:00" 351 }, 352 { 353 "name": "squizlabs/php_codesniffer", 354 "version": "3.11.3", 355 "source": { 356 "type": "git", 357 "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", 358 "reference": "ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10" 359 }, 360 "dist": { 361 "type": "zip", 362 "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10", 363 "reference": "ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10", 364 "shasum": "" 365 }, 366 "require": { 367 "ext-simplexml": "*", 368 "ext-tokenizer": "*", 369 "ext-xmlwriter": "*", 370 "php": ">=5.4.0" 371 }, 372 "require-dev": { 373 "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" 374 }, 375 "bin": [ 376 "bin/phpcbf", 377 "bin/phpcs" 378 ], 379 "type": "library", 380 "extra": { 381 "branch-alias": { 382 "dev-master": "3.x-dev" 383 } 384 }, 385 "notification-url": "https://packagist.org/downloads/", 386 "license": [ 387 "BSD-3-Clause" 388 ], 389 "authors": [ 390 { 391 "name": "Greg Sherwood", 392 "role": "Former lead" 393 }, 394 { 395 "name": "Juliette Reinders Folmer", 396 "role": "Current lead" 397 }, 398 { 399 "name": "Contributors", 400 "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" 401 } 402 ], 403 "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", 404 "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", 405 "keywords": [ 406 "phpcs", 407 "standards", 408 "static analysis" 409 ], 410 "support": { 411 "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", 412 "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", 413 "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", 414 "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" 415 }, 416 "funding": [ 417 { 418 "url": "https://github.com/PHPCSStandards", 419 "type": "github" 420 }, 421 { 422 "url": "https://github.com/jrfnl", 423 "type": "github" 424 }, 425 { 426 "url": "https://opencollective.com/php_codesniffer", 427 "type": "open_collective" 428 }, 429 { 430 "url": "https://thanks.dev/phpcsstandards", 431 "type": "thanks_dev" 432 } 433 ], 434 "time": "2025-01-23T17:04:15+00:00" 435 }, 436 { 437 "name": "wp-coding-standards/wpcs", 438 "version": "2.3.0", 439 "source": { 440 "type": "git", 441 "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", 442 "reference": "7da1894633f168fe244afc6de00d141f27517b62" 443 }, 444 "dist": { 445 "type": "zip", 446 "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62", 447 "reference": "7da1894633f168fe244afc6de00d141f27517b62", 448 "shasum": "" 449 }, 450 "require": { 451 "php": ">=5.4", 452 "squizlabs/php_codesniffer": "^3.3.1" 453 }, 454 "require-dev": { 455 "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6", 456 "phpcompatibility/php-compatibility": "^9.0", 457 "phpcsstandards/phpcsdevtools": "^1.0", 458 "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" 459 }, 460 "suggest": { 461 "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." 462 }, 463 "type": "phpcodesniffer-standard", 464 "notification-url": "https://packagist.org/downloads/", 465 "license": [ 466 "MIT" 467 ], 468 "authors": [ 469 { 470 "name": "Contributors", 471 "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" 472 } 473 ], 474 "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", 475 "keywords": [ 476 "phpcs", 477 "standards", 478 "wordpress" 479 ], 480 "support": { 481 "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues", 482 "source": "https://github.com/WordPress/WordPress-Coding-Standards", 483 "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" 484 }, 485 "time": "2020-05-13T23:57:56+00:00" 486 } 487 ], 72 488 "aliases": [], 73 489 "minimum-stability": "stable", -
trustcaptcha/trunk/readme.txt
r3185168 r3254837 1 1 === Trustcaptcha === 2 2 Contributors: trustcaptcha 3 Tags: captcha, trustcaptcha, spam-protection, gdpr, european-union3 Tags: captcha, trustcaptcha, bot-protection, gdpr, reCAPTCHA-alternative 4 4 Requires at least: 4.0 5 Tested up to: 6. 65 Tested up to: 6.7 6 6 Requires PHP: 7.0 7 7 Stable tag: 1.0.0 … … 11 11 == Short Description == 12 12 13 Bot Protection - GDPR Compliant, Intelligent, Accessible. Protect your website and your customers' privacy with our accessible CAPTCHA. Customize the CAPTCHA to your individual needs and save money with our pay-per-use billing.13 GDPR-compliant reCAPTCHA alternative with bot score. 14 14 15 15 == Description == 16 16 17 Bot Protection - GDPR Compliant, Intelligent, Accessible. Protect your website and your customers' privacy with our accessible CAPTCHA. Customize the CAPTCHA to your individual needs and save money with our pay-per-use billing.17 GDPR-compliant reCAPTCHA alternative with bot score. Protect your website from bot attacks and spam with our invisible and GDPR-compliant reCAPTCHA alternative. Benefit from our multi-layered security concept with proof-of-work and intelligent bot score for reliable bot detection. 18 18 19 19 **Supported Plugins:** 20 20 21 - BBPress New Topic 22 - BBPress Reply 23 - Contact Form 7 24 - Elementor Forms 25 - Fluent Forms 26 - Forminator 27 - Gravity Forms 28 - Mailchimp for WordPress 29 - Ninja Forms 30 - Ninja Forms Multi Step 21 31 - WordPress Comments 22 32 - WordPress Login 23 33 - WordPress Lost Password 24 34 - WordPress Registration 25 - Contact Form 726 35 - WooCommerce Login 27 36 - WooCommerce Registration 28 37 - WooCommerce Checkout 29 38 - WooCommerce Lost Password 30 - Gravity Forms 31 - WPForms 39 - WP Forms 32 40 33 41 == Third-Party Services == … … 45 53 1. Install the plugin through the WordPress plugin browser or by uploading the plugin files to the `/wp-content/plugins/trustcaptcha` directory. 46 54 2. Create a Trustcaptcha account at [Trustcaptcha](https://www.trustcaptcha.com) and create a new captcha. 47 3. Obtain your Captcha Credentials (site-key and secret-key, which can be found [here](https://dashboord.trustcaptcha.com/en/captchas/dashboard)) and enter them in the Trustcaptcha settings in WordPress (Settings -> Trustcaptcha). 55 3. Obtain your Captcha Credentials (site-key and secret-key, which can be found [here](https://dashboard.trustcaptcha.com/en/captchas)) and enter them in the Trustcaptcha settings in WordPress (Settings -> Trustcaptcha). 56 4. Activate Trustcaptcha for all desired plugins. 57 5. Insert Trustcaptcha in all desired forms, if Trustcaptcha does not do this automatically. 58 59 == Need help? == 60 61 You have a question, need help or a plugin is not yet listed? Please contact our support team: [Contact us](https://www.trustcaptcha.com/en/contact-us) 48 62 49 63 == Changelog == 64 65 = 1.1.0 = 66 * Refactor code and improve user experience 67 * Update from Trustcaptcha v1.5.x to v1.8.x 68 * Add support for plugins: BBPress, Elementor Forms, Fluent Forms, Forminator, Mailchimp, Ninja Forms 50 69 51 70 = 1.0.0 = … … 54 73 == Upgrade Notice == 55 74 75 = 1.1.0 = 76 * Refactor code and improve user experience 77 * Update from Trustcaptcha v1.5.x to v1.8.x 78 * Add support for plugins: BBPress, Elementor Forms, Fluent Forms, Forminator, Mailchimp, 79 56 80 = 1.0.0 = 57 81 * Initial release -
trustcaptcha/trunk/trustcaptcha.php
r3185168 r3254837 1 1 <?php 2 /* 3 Plugin Name: Trustcaptcha 4 Plugin URI: https://docs.trustcaptcha.com/en/documentation/cms/wordpress 5 Description: Bot Protection - GDPR Compliant, Intelligent, Accessible. Protect your website and your customers' privacy with our accessible CAPTCHA. Customize the CAPTCHA to your individual needs and save money with our pay-per-use billing. 6 Version: 1.0.0 7 Author: Trustcaptcha GmbH 8 Author URI: https://www.trustcaptcha.com 9 Text Domain: trustcaptcha 10 Domain Path: /languages 11 Requires at least: 4.0 12 Tested up to: 6.6 13 Requires PHP: 7.0 14 License: GPLv2 or later 15 License URI: https://www.gnu.org/licenses/gpl-2.0.html 16 */ 2 /** 3 * Trustcaptcha WordPress Plugin 4 * 5 * @package trustcaptcha 6 * 7 * Plugin Name: Trustcaptcha for WordPress 8 * Plugin URI: https://docs.trustcaptcha.com/en/platforms/wordpress 9 * Description: GDPR-compliant reCAPTCHA alternative with bot score. Protect your website from bot attacks and spam with our invisible and GDPR-compliant reCAPTCHA alternative. Benefit from our multi-layered security concept with proof-of-work and intelligent bot score for reliable bot detection. 10 * Version: 1.1.0 11 * Author: Trustcaptcha GmbH 12 * Author URI: https://www.trustcaptcha.com 13 * Text Domain: trustcaptcha 14 * Domain Path: /languages 15 * 16 * Requires at least:4.0 17 * Tested up to: 6.7 18 * Requires PHP: 7.0 19 * 20 * License: GPLv2 or later 21 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 22 */ 17 23 18 if (!defined('ABSPATH')) { 19 exit; 24 use Trustcaptcha\Initializer; 25 26 if ( ! defined( 'ABSPATH' ) ) { 27 exit; 20 28 } 21 29 22 // Composer Autoloader einbinden 23 if (file_exists(__DIR__ . '/vendor/autoload.php')) { 24 require_once __DIR__ . '/vendor/autoload.php'; 25 } else { 26 return; 30 define( 'TRUSTCAPTCHA_BASE_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) ); 31 32 const TRUSTCAPTCHA_BASE_FILE = __FILE__; 33 const PLUGIN_VERSION = '1.1.0'; 34 35 require 'vendor/autoload.php'; 36 37 function trustcaptcha(): Initializer 38 { 39 static $trustcaptcha; 40 if ( ! $trustcaptcha ) { 41 $trustcaptcha = new Initializer(); 42 } 43 return $trustcaptcha; 27 44 } 28 45 29 use Trustcaptcha\CaptchaManager; 30 31 require_once __DIR__ . '/trustcaptcha_settings.php'; 32 33 if (get_option('trustcaptcha_plugin_support_wordpress_comments')) { 34 require_once __DIR__ . '/integrations/wordpress-comments.php'; 35 } 36 if (get_option('trustcaptcha_plugin_support_wordpress_login')) { 37 require_once __DIR__ . '/integrations/wordpress-login.php'; 38 } 39 if (get_option('trustcaptcha_plugin_support_wordpress_lostpassword')) { 40 require_once __DIR__ . '/integrations/wordpress-lostpassword.php'; 41 } 42 if (get_option('trustcaptcha_plugin_support_wordpress_registration')) { 43 require_once __DIR__ . '/integrations/wordpress-registration.php'; 44 } 45 if (get_option('trustcaptcha_plugin_support_cf7')) { 46 require_once __DIR__ . '/integrations/contact-form-7.php'; 47 } 48 if (get_option('trustcaptcha_plugin_support_woocommerce_login')) { 49 require_once __DIR__ . '/integrations/woocommerce-login.php'; 50 } 51 if (get_option('trustcaptcha_plugin_support_woocommerce_register')) { 52 require_once __DIR__ . '/integrations/woocommerce-register.php'; 53 } 54 if (get_option('trustcaptcha_plugin_support_woocommerce_checkout')) { 55 require_once __DIR__ . '/integrations/woocommerce-checkout.php'; 56 } 57 if (get_option('trustcaptcha_plugin_support_woocommerce_lostpassword')) { 58 require_once __DIR__ . '/integrations/woocommerce-lostpassword.php'; 59 } 60 if (get_option('trustcaptcha_plugin_support_gravityforms')) { 61 require_once __DIR__ . '/integrations/gravity-forms.php'; 62 } 63 if (get_option('trustcaptcha_plugin_support_wpforms')) { 64 require_once __DIR__ . '/integrations/wpforms.php'; 65 } 66 67 68 69 70 function trustcaptcha_enqueue_script() { 71 wp_register_script('trustcaptcha-js', 'https://resources.trustcaptcha.com/1_5_x/trustcaptcha.js', array(), null, true); 72 wp_enqueue_script('trustcaptcha-js'); 73 } 74 add_action('wp_enqueue_scripts', 'trustcaptcha_enqueue_script'); 75 76 function trustcaptcha_add_module_type_attribute($tag, $handle, $src) { 77 if ('trustcaptcha-js' === $handle) { 78 $tag = str_replace('<script ', '<script type="module" ', $tag); 79 } 80 return $tag; 81 } 82 add_filter('script_loader_tag', 'trustcaptcha_add_module_type_attribute', 10, 3); 83 84 function trustcaptcha_load_textdomain() { 85 load_plugin_textdomain('trustcaptcha', false, basename(dirname(__FILE__)) . '/languages'); 86 } 87 add_action('init', 'trustcaptcha_load_textdomain'); 88 89 90 function trustcaptcha_generate_captcha_html() { 91 $site_key = get_option('trustcaptcha_site_key'); 92 $language = get_option('trustcaptcha_language'); 93 $theme = get_option('trustcaptcha_theme'); 94 $captcha_html = '<div class="captcha-container" style="margin-bottom: 16px;"><trustcaptcha-component sitekey="' . esc_attr($site_key) . '" language="' . esc_attr($language) . '" theme="' . esc_attr($theme) . '"></trustcaptcha-component></div>'; 95 96 return $captcha_html; 97 } 98 99 function trustcaptcha_generate_captcha_echo() { 100 $allowed_tags = array( 101 'div' => array( 102 'class' => array(), 103 'style' => array() 104 ), 105 'trustcaptcha-component' => array( 106 'sitekey' => array(), 107 'language' => array(), 108 'theme' => array(), 109 'trustcaptcha-api' => array() 110 ) 111 ); 112 echo wp_kses(trustcaptcha_generate_captcha_html(), $allowed_tags); 113 } 114 115 function trustcaptcha_verify_token($content, $action = 'die') { 116 $secret_key = get_option('trustcaptcha_secret_key'); 117 $threshold = get_option('trustcaptcha_threshold'); 118 $verificationToken = isset($_POST['tc-verification-token']) ? sanitize_text_field(wp_unslash($_POST['tc-verification-token'])) : ''; 119 120 if (!empty($verificationToken) && !preg_match('/^[a-zA-Z0-9\/\r\n+]*={0,2}$/', $verificationToken)) { // check base64 encoding 121 $verificationToken = ''; 122 } 123 124 $handle_error = function($error_code = 'generic_error', $action = 'die') { 125 $error_messages = array( 126 'captcha_not_completed' => __('Captcha has not yet been completed. Please wait until the Captcha has been passed.', 'trustcaptcha'), 127 'captcha_verification_error' => __('Captcha verification failed due to an error.', 'trustcaptcha'), 128 'captcha_verification_failed' => __('Action canceled because we could not be sure that you are actually a human user. Please try again later.', 'trustcaptcha'), 129 ); 130 131 $error_message = $error_messages[$error_code] ?? __('An unknown error occurred.', 'trustcaptcha'); 132 133 if ('error' === $action) { 134 return new WP_Error($error_code, $error_message); 135 } else { 136 wp_die(esc_html($error_message), esc_html__('Error', 'trustcaptcha'), array('back_link' => true)); 137 } 138 }; 139 140 if (empty($verificationToken)) { 141 return $handle_error('captcha_not_completed', $action); 142 } 143 144 try { 145 $verificationResult = CaptchaManager::getVerificationResult($secret_key, $verificationToken); 146 } catch (Exception $e) { 147 return $handle_error('captcha_verification_error', $action); 148 } 149 150 if (!$verificationResult->verificationPassed || $verificationResult->score > $threshold) { 151 return $handle_error('captcha_verification_failed', $action); 152 } 153 154 return $content; 155 } 46 trustcaptcha()->setup(); -
trustcaptcha/trunk/vendor/composer/autoload_psr4.php
r3185168 r3254837 7 7 8 8 return array( 9 'Trustcaptcha\\' => array($vendorDir . '/trustcaptcha/trustcaptcha-php/src'), 9 'Trustcaptcha\\' => array($baseDir . '/src/php', $vendorDir . '/trustcaptcha/trustcaptcha-php/src'), 10 'Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\' => array($vendorDir . '/dealerdirect/phpcodesniffer-composer-installer/src'), 10 11 ); -
trustcaptcha/trunk/vendor/composer/autoload_static.php
r3185168 r3254837 12 12 'Trustcaptcha\\' => 13, 13 13 ), 14 'D' => 15 array ( 16 'Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\' => 55, 17 ), 14 18 ); 15 19 … … 17 21 'Trustcaptcha\\' => 18 22 array ( 19 0 => __DIR__ . '/..' . '/trustcaptcha/trustcaptcha-php/src', 23 0 => __DIR__ . '/../..' . '/src/php', 24 1 => __DIR__ . '/..' . '/trustcaptcha/trustcaptcha-php/src', 25 ), 26 'Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\' => 27 array ( 28 0 => __DIR__ . '/..' . '/dealerdirect/phpcodesniffer-composer-installer/src', 20 29 ), 21 30 ); -
trustcaptcha/trunk/vendor/composer/installed.json
r3185168 r3254837 2 2 "packages": [ 3 3 { 4 "name": "dealerdirect/phpcodesniffer-composer-installer", 5 "version": "v0.7.2", 6 "version_normalized": "0.7.2.0", 7 "source": { 8 "type": "git", 9 "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", 10 "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" 11 }, 12 "dist": { 13 "type": "zip", 14 "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", 15 "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", 16 "shasum": "" 17 }, 18 "require": { 19 "composer-plugin-api": "^1.0 || ^2.0", 20 "php": ">=5.3", 21 "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" 22 }, 23 "require-dev": { 24 "composer/composer": "*", 25 "php-parallel-lint/php-parallel-lint": "^1.3.1", 26 "phpcompatibility/php-compatibility": "^9.0" 27 }, 28 "time": "2022-02-04T12:51:07+00:00", 29 "type": "composer-plugin", 30 "extra": { 31 "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" 32 }, 33 "installation-source": "dist", 34 "autoload": { 35 "psr-4": { 36 "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" 37 } 38 }, 39 "notification-url": "https://packagist.org/downloads/", 40 "license": [ 41 "MIT" 42 ], 43 "authors": [ 44 { 45 "name": "Franck Nijhof", 46 "email": "franck.nijhof@dealerdirect.com", 47 "homepage": "http://www.frenck.nl", 48 "role": "Developer / IT Manager" 49 }, 50 { 51 "name": "Contributors", 52 "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" 53 } 54 ], 55 "description": "PHP_CodeSniffer Standards Composer Installer Plugin", 56 "homepage": "http://www.dealerdirect.com", 57 "keywords": [ 58 "PHPCodeSniffer", 59 "PHP_CodeSniffer", 60 "code quality", 61 "codesniffer", 62 "composer", 63 "installer", 64 "phpcbf", 65 "phpcs", 66 "plugin", 67 "qa", 68 "quality", 69 "standard", 70 "standards", 71 "style guide", 72 "stylecheck", 73 "tests" 74 ], 75 "support": { 76 "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", 77 "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" 78 }, 79 "install-path": "../dealerdirect/phpcodesniffer-composer-installer" 80 }, 81 { 82 "name": "phpcompatibility/php-compatibility", 83 "version": "9.3.5", 84 "version_normalized": "9.3.5.0", 85 "source": { 86 "type": "git", 87 "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", 88 "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" 89 }, 90 "dist": { 91 "type": "zip", 92 "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", 93 "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", 94 "shasum": "" 95 }, 96 "require": { 97 "php": ">=5.3", 98 "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" 99 }, 100 "conflict": { 101 "squizlabs/php_codesniffer": "2.6.2" 102 }, 103 "require-dev": { 104 "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" 105 }, 106 "suggest": { 107 "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", 108 "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." 109 }, 110 "time": "2019-12-27T09:44:58+00:00", 111 "type": "phpcodesniffer-standard", 112 "installation-source": "dist", 113 "notification-url": "https://packagist.org/downloads/", 114 "license": [ 115 "LGPL-3.0-or-later" 116 ], 117 "authors": [ 118 { 119 "name": "Wim Godden", 120 "homepage": "https://github.com/wimg", 121 "role": "lead" 122 }, 123 { 124 "name": "Juliette Reinders Folmer", 125 "homepage": "https://github.com/jrfnl", 126 "role": "lead" 127 }, 128 { 129 "name": "Contributors", 130 "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" 131 } 132 ], 133 "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", 134 "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", 135 "keywords": [ 136 "compatibility", 137 "phpcs", 138 "standards" 139 ], 140 "support": { 141 "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", 142 "source": "https://github.com/PHPCompatibility/PHPCompatibility" 143 }, 144 "install-path": "../phpcompatibility/php-compatibility" 145 }, 146 { 147 "name": "phpcompatibility/phpcompatibility-paragonie", 148 "version": "1.3.3", 149 "version_normalized": "1.3.3.0", 150 "source": { 151 "type": "git", 152 "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", 153 "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac" 154 }, 155 "dist": { 156 "type": "zip", 157 "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/293975b465e0e709b571cbf0c957c6c0a7b9a2ac", 158 "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac", 159 "shasum": "" 160 }, 161 "require": { 162 "phpcompatibility/php-compatibility": "^9.0" 163 }, 164 "require-dev": { 165 "dealerdirect/phpcodesniffer-composer-installer": "^1.0", 166 "paragonie/random_compat": "dev-master", 167 "paragonie/sodium_compat": "dev-master" 168 }, 169 "suggest": { 170 "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", 171 "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." 172 }, 173 "time": "2024-04-24T21:30:46+00:00", 174 "type": "phpcodesniffer-standard", 175 "installation-source": "dist", 176 "notification-url": "https://packagist.org/downloads/", 177 "license": [ 178 "LGPL-3.0-or-later" 179 ], 180 "authors": [ 181 { 182 "name": "Wim Godden", 183 "role": "lead" 184 }, 185 { 186 "name": "Juliette Reinders Folmer", 187 "role": "lead" 188 } 189 ], 190 "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", 191 "homepage": "http://phpcompatibility.com/", 192 "keywords": [ 193 "compatibility", 194 "paragonie", 195 "phpcs", 196 "polyfill", 197 "standards", 198 "static analysis" 199 ], 200 "support": { 201 "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", 202 "security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy", 203 "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" 204 }, 205 "funding": [ 206 { 207 "url": "https://github.com/PHPCompatibility", 208 "type": "github" 209 }, 210 { 211 "url": "https://github.com/jrfnl", 212 "type": "github" 213 }, 214 { 215 "url": "https://opencollective.com/php_codesniffer", 216 "type": "open_collective" 217 } 218 ], 219 "install-path": "../phpcompatibility/phpcompatibility-paragonie" 220 }, 221 { 222 "name": "phpcompatibility/phpcompatibility-wp", 223 "version": "2.1.6", 224 "version_normalized": "2.1.6.0", 225 "source": { 226 "type": "git", 227 "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", 228 "reference": "80ccb1a7640995edf1b87a4409fa584cd5869469" 229 }, 230 "dist": { 231 "type": "zip", 232 "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/80ccb1a7640995edf1b87a4409fa584cd5869469", 233 "reference": "80ccb1a7640995edf1b87a4409fa584cd5869469", 234 "shasum": "" 235 }, 236 "require": { 237 "phpcompatibility/php-compatibility": "^9.0", 238 "phpcompatibility/phpcompatibility-paragonie": "^1.0" 239 }, 240 "require-dev": { 241 "dealerdirect/phpcodesniffer-composer-installer": "^1.0" 242 }, 243 "suggest": { 244 "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", 245 "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." 246 }, 247 "time": "2025-01-16T22:34:19+00:00", 248 "type": "phpcodesniffer-standard", 249 "installation-source": "dist", 250 "notification-url": "https://packagist.org/downloads/", 251 "license": [ 252 "LGPL-3.0-or-later" 253 ], 254 "authors": [ 255 { 256 "name": "Wim Godden", 257 "role": "lead" 258 }, 259 { 260 "name": "Juliette Reinders Folmer", 261 "role": "lead" 262 } 263 ], 264 "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", 265 "homepage": "http://phpcompatibility.com/", 266 "keywords": [ 267 "compatibility", 268 "phpcs", 269 "standards", 270 "static analysis", 271 "wordpress" 272 ], 273 "support": { 274 "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", 275 "security": "https://github.com/PHPCompatibility/PHPCompatibilityWP/security/policy", 276 "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" 277 }, 278 "funding": [ 279 { 280 "url": "https://github.com/PHPCompatibility", 281 "type": "github" 282 }, 283 { 284 "url": "https://github.com/jrfnl", 285 "type": "github" 286 }, 287 { 288 "url": "https://opencollective.com/php_codesniffer", 289 "type": "open_collective" 290 } 291 ], 292 "install-path": "../phpcompatibility/phpcompatibility-wp" 293 }, 294 { 295 "name": "squizlabs/php_codesniffer", 296 "version": "3.11.3", 297 "version_normalized": "3.11.3.0", 298 "source": { 299 "type": "git", 300 "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", 301 "reference": "ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10" 302 }, 303 "dist": { 304 "type": "zip", 305 "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10", 306 "reference": "ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10", 307 "shasum": "" 308 }, 309 "require": { 310 "ext-simplexml": "*", 311 "ext-tokenizer": "*", 312 "ext-xmlwriter": "*", 313 "php": ">=5.4.0" 314 }, 315 "require-dev": { 316 "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" 317 }, 318 "time": "2025-01-23T17:04:15+00:00", 319 "bin": [ 320 "bin/phpcbf", 321 "bin/phpcs" 322 ], 323 "type": "library", 324 "extra": { 325 "branch-alias": { 326 "dev-master": "3.x-dev" 327 } 328 }, 329 "installation-source": "dist", 330 "notification-url": "https://packagist.org/downloads/", 331 "license": [ 332 "BSD-3-Clause" 333 ], 334 "authors": [ 335 { 336 "name": "Greg Sherwood", 337 "role": "Former lead" 338 }, 339 { 340 "name": "Juliette Reinders Folmer", 341 "role": "Current lead" 342 }, 343 { 344 "name": "Contributors", 345 "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" 346 } 347 ], 348 "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", 349 "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", 350 "keywords": [ 351 "phpcs", 352 "standards", 353 "static analysis" 354 ], 355 "support": { 356 "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", 357 "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", 358 "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", 359 "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" 360 }, 361 "funding": [ 362 { 363 "url": "https://github.com/PHPCSStandards", 364 "type": "github" 365 }, 366 { 367 "url": "https://github.com/jrfnl", 368 "type": "github" 369 }, 370 { 371 "url": "https://opencollective.com/php_codesniffer", 372 "type": "open_collective" 373 }, 374 { 375 "url": "https://thanks.dev/phpcsstandards", 376 "type": "thanks_dev" 377 } 378 ], 379 "install-path": "../squizlabs/php_codesniffer" 380 }, 381 { 4 382 "name": "trustcaptcha/trustcaptcha-php", 5 "version": "1. 1.1",6 "version_normalized": "1. 1.1.0",383 "version": "1.2.0", 384 "version_normalized": "1.2.0.0", 7 385 "source": { 8 386 "type": "git", 9 387 "url": "https://github.com/trustcaptcha/php-library.git", 10 "reference": "ebf1feabd912cf75c8a8f0ba32782261c19842f7" 11 }, 12 "dist": { 13 "type": "zip", 14 "url": "https://api.github.com/repos/trustcaptcha/php-library/zipball/ebf1feabd912cf75c8a8f0ba32782261c19842f7", 15 "reference": "ebf1feabd912cf75c8a8f0ba32782261c19842f7", 16 "shasum": "" 17 }, 18 "require": { 388 "reference": "86c4f3de7e040382af2ca0c2959a196bb4e68b71" 389 }, 390 "dist": { 391 "type": "zip", 392 "url": "https://api.github.com/repos/trustcaptcha/php-library/zipball/86c4f3de7e040382af2ca0c2959a196bb4e68b71", 393 "reference": "86c4f3de7e040382af2ca0c2959a196bb4e68b71", 394 "shasum": "" 395 }, 396 "require": { 397 "ext-json": "*", 19 398 "php": ">=7.0" 20 399 }, 21 400 "require-dev": { 22 "phpunit/phpunit": "^9. 5"23 }, 24 "time": "2024-1 0-26T15:38:49+00:00",401 "phpunit/phpunit": "^9.6" 402 }, 403 "time": "2024-12-20T15:57:28+00:00", 25 404 "type": "library", 26 405 "installation-source": "dist", … … 61 440 "support": { 62 441 "issues": "https://github.com/trustcaptcha/php-library/issues", 63 "source": "https://github.com/trustcaptcha/php-library/tree/1. 1.1"442 "source": "https://github.com/trustcaptcha/php-library/tree/1.2.0" 64 443 }, 65 444 "install-path": "../trustcaptcha/trustcaptcha-php" 445 }, 446 { 447 "name": "wp-coding-standards/wpcs", 448 "version": "2.3.0", 449 "version_normalized": "2.3.0.0", 450 "source": { 451 "type": "git", 452 "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", 453 "reference": "7da1894633f168fe244afc6de00d141f27517b62" 454 }, 455 "dist": { 456 "type": "zip", 457 "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62", 458 "reference": "7da1894633f168fe244afc6de00d141f27517b62", 459 "shasum": "" 460 }, 461 "require": { 462 "php": ">=5.4", 463 "squizlabs/php_codesniffer": "^3.3.1" 464 }, 465 "require-dev": { 466 "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6", 467 "phpcompatibility/php-compatibility": "^9.0", 468 "phpcsstandards/phpcsdevtools": "^1.0", 469 "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" 470 }, 471 "suggest": { 472 "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." 473 }, 474 "time": "2020-05-13T23:57:56+00:00", 475 "type": "phpcodesniffer-standard", 476 "installation-source": "dist", 477 "notification-url": "https://packagist.org/downloads/", 478 "license": [ 479 "MIT" 480 ], 481 "authors": [ 482 { 483 "name": "Contributors", 484 "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" 485 } 486 ], 487 "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", 488 "keywords": [ 489 "phpcs", 490 "standards", 491 "wordpress" 492 ], 493 "support": { 494 "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues", 495 "source": "https://github.com/WordPress/WordPress-Coding-Standards", 496 "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" 497 }, 498 "install-path": "../wp-coding-standards/wpcs" 66 499 } 67 500 ], 68 501 "dev": true, 69 "dev-package-names": [] 502 "dev-package-names": [ 503 "dealerdirect/phpcodesniffer-composer-installer", 504 "phpcompatibility/php-compatibility", 505 "phpcompatibility/phpcompatibility-paragonie", 506 "phpcompatibility/phpcompatibility-wp", 507 "squizlabs/php_codesniffer", 508 "wp-coding-standards/wpcs" 509 ] 70 510 } -
trustcaptcha/trunk/vendor/composer/installed.php
r3185168 r3254837 1 1 <?php return array( 2 2 'root' => array( 3 'name' => ' __root__',3 'name' => 'trustcaptcha/trustcaptcha-wordpress', 4 4 'pretty_version' => 'dev-master', 5 5 'version' => 'dev-master', 6 'reference' => ' 34316fc6f6214e98c70a5f242ed330c1a24c0816',7 'type' => ' library',6 'reference' => '03c358822be6179f1fbc5d22d7c3e66e6f495a50', 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', 9 9 'aliases' => array(), … … 11 11 ), 12 12 'versions' => array( 13 '__root__' => array( 14 'pretty_version' => 'dev-master', 15 'version' => 'dev-master', 16 'reference' => '34316fc6f6214e98c70a5f242ed330c1a24c0816', 13 'dealerdirect/phpcodesniffer-composer-installer' => array( 14 'pretty_version' => 'v0.7.2', 15 'version' => '0.7.2.0', 16 'reference' => '1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db', 17 'type' => 'composer-plugin', 18 'install_path' => __DIR__ . '/../dealerdirect/phpcodesniffer-composer-installer', 19 'aliases' => array(), 20 'dev_requirement' => true, 21 ), 22 'phpcompatibility/php-compatibility' => array( 23 'pretty_version' => '9.3.5', 24 'version' => '9.3.5.0', 25 'reference' => '9fb324479acf6f39452e0655d2429cc0d3914243', 26 'type' => 'phpcodesniffer-standard', 27 'install_path' => __DIR__ . '/../phpcompatibility/php-compatibility', 28 'aliases' => array(), 29 'dev_requirement' => true, 30 ), 31 'phpcompatibility/phpcompatibility-paragonie' => array( 32 'pretty_version' => '1.3.3', 33 'version' => '1.3.3.0', 34 'reference' => '293975b465e0e709b571cbf0c957c6c0a7b9a2ac', 35 'type' => 'phpcodesniffer-standard', 36 'install_path' => __DIR__ . '/../phpcompatibility/phpcompatibility-paragonie', 37 'aliases' => array(), 38 'dev_requirement' => true, 39 ), 40 'phpcompatibility/phpcompatibility-wp' => array( 41 'pretty_version' => '2.1.6', 42 'version' => '2.1.6.0', 43 'reference' => '80ccb1a7640995edf1b87a4409fa584cd5869469', 44 'type' => 'phpcodesniffer-standard', 45 'install_path' => __DIR__ . '/../phpcompatibility/phpcompatibility-wp', 46 'aliases' => array(), 47 'dev_requirement' => true, 48 ), 49 'squizlabs/php_codesniffer' => array( 50 'pretty_version' => '3.11.3', 51 'version' => '3.11.3.0', 52 'reference' => 'ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10', 17 53 'type' => 'library', 18 'install_path' => __DIR__ . '/../ ../',54 'install_path' => __DIR__ . '/../squizlabs/php_codesniffer', 19 55 'aliases' => array(), 20 'dev_requirement' => false,56 'dev_requirement' => true, 21 57 ), 22 58 'trustcaptcha/trustcaptcha-php' => array( 23 'pretty_version' => '1. 1.1',24 'version' => '1. 1.1.0',25 'reference' => ' ebf1feabd912cf75c8a8f0ba32782261c19842f7',59 'pretty_version' => '1.2.0', 60 'version' => '1.2.0.0', 61 'reference' => '86c4f3de7e040382af2ca0c2959a196bb4e68b71', 26 62 'type' => 'library', 27 63 'install_path' => __DIR__ . '/../trustcaptcha/trustcaptcha-php', … … 29 65 'dev_requirement' => false, 30 66 ), 67 'trustcaptcha/trustcaptcha-wordpress' => array( 68 'pretty_version' => 'dev-master', 69 'version' => 'dev-master', 70 'reference' => '03c358822be6179f1fbc5d22d7c3e66e6f495a50', 71 'type' => 'wordpress-plugin', 72 'install_path' => __DIR__ . '/../../', 73 'aliases' => array(), 74 'dev_requirement' => false, 75 ), 76 'wp-coding-standards/wpcs' => array( 77 'pretty_version' => '2.3.0', 78 'version' => '2.3.0.0', 79 'reference' => '7da1894633f168fe244afc6de00d141f27517b62', 80 'type' => 'phpcodesniffer-standard', 81 'install_path' => __DIR__ . '/../wp-coding-standards/wpcs', 82 'aliases' => array(), 83 'dev_requirement' => true, 84 ), 31 85 ), 32 86 ); -
trustcaptcha/trunk/vendor/trustcaptcha/trustcaptcha-php/.gitignore
r3185168 r3254837 29 29 ### VS Code ### 30 30 .vscode/ 31 /composer.lock 32 /vendor/ -
trustcaptcha/trunk/vendor/trustcaptcha/trustcaptcha-php/composer.json
r3185168 r3254837 29 29 ], 30 30 "require": { 31 "php": ">=7.0" 31 "php": ">=7.0", 32 "ext-json": "*" 32 33 }, 33 34 "autoload": { … … 37 38 }, 38 39 "require-dev": { 39 "phpunit/phpunit": "^9. 5"40 "phpunit/phpunit": "^9.6" 40 41 } 41 42 } -
trustcaptcha/trunk/vendor/trustcaptcha/trustcaptcha-php/src/CaptchaManager.php
r3185168 r3254837 7 7 require_once 'model/VerificationToken.php'; 8 8 require_once 'model/VerificationResult.php'; 9 require_once 'AesEncryption.php';10 9 11 10 class CaptchaManager { 12 11 13 public static function getVerificationResult(string $ base64secretKey, string $base64verificationToken): VerificationResult {12 public static function getVerificationResult(string $secretKey, string $base64verificationToken): VerificationResult { 14 13 $verificationToken = self::getVerificationToken($base64verificationToken); 15 $accessToken = AesEncryption::decryptToString($base64secretKey, $verificationToken->encryptedAccessToken);16 $urlAsString = "{$verificationToken->apiEndpoint}/verifications/{$verificationToken->verificationId}/assessments?accessToken={$accessToken}&pl=php";17 14 18 $response = file_get_contents($urlAsString); 15 $url = "{$verificationToken->apiEndpoint}/verifications/{$verificationToken->verificationId}/assessments"; 16 $headers = [ 17 "tc-authorization: $secretKey", 18 "tc-library-language: php", 19 "tc-library-version: 1.2" 20 ]; 21 22 $options = [ 23 "http" => [ 24 "header" => implode("\r\n", $headers), 25 "method" => "GET" 26 ] 27 ]; 28 $context = stream_context_create($options); 29 $response = @file_get_contents($url, false, $context); 30 19 31 if ($response === false) { 32 $http_response_code = $http_response_header[0] ?? null; 33 if (strpos($http_response_code, "403") !== false) { 34 throw new SecretKeyInvalidException("Secret key is invalid"); 35 } elseif (strpos($http_response_code, "404") !== false) { 36 throw new VerificationNotFoundException("Verification not found"); 37 } elseif (strpos($http_response_code, "423") !== false) { 38 throw new VerificationNotFinishedException("Verification not finished"); 39 } 20 40 throw new Exception("Failed to retrieve verification result"); 21 41 } 42 22 43 return new VerificationResult($response); 23 44 } … … 25 46 private static function getVerificationToken(string $verificationToken): VerificationToken { 26 47 $decodedVerificationToken = base64_decode($verificationToken); 48 if ($decodedVerificationToken === false) { 49 throw new VerificationTokenInvalidException("Invalid base64 encoded token"); 50 } 51 27 52 $data = json_decode($decodedVerificationToken); 53 if (!isset($data->apiEndpoint, $data->verificationId, $data->encryptedAccessToken)) { 54 throw new VerificationTokenInvalidException("Missing required fields in verification token"); 55 } 56 28 57 return new VerificationToken($data->apiEndpoint, $data->verificationId, $data->encryptedAccessToken); 29 58 } 30 59 } 60 61 class SecretKeyInvalidException extends Exception {} 62 class VerificationTokenInvalidException extends Exception {} 63 class VerificationNotFoundException extends Exception {} 64 class VerificationNotFinishedException extends Exception {}
Note: See TracChangeset
for help on using the changeset viewer.