Changeset 3248039
- Timestamp:
- 02/27/2025 06:15:00 PM (13 months ago)
- Location:
- hcaptcha-for-forms-and-more
- Files:
-
- 234 added
- 158 edited
- 1 copied
-
tags/4.11.0 (copied) (copied from hcaptcha-for-forms-and-more/trunk)
-
tags/4.11.0/assets/css/forms.css (modified) (1 diff)
-
tags/4.11.0/assets/css/forms.min.css (modified) (1 diff)
-
tags/4.11.0/assets/css/settings-base.css (modified) (1 diff)
-
tags/4.11.0/assets/css/settings-base.min.css (modified) (1 diff)
-
tags/4.11.0/assets/js/events.js (modified) (2 diffs)
-
tags/4.11.0/assets/js/events.min.js (modified) (1 diff)
-
tags/4.11.0/assets/js/forms.js (modified) (4 diffs)
-
tags/4.11.0/assets/js/forms.min.js (modified) (1 diff)
-
tags/4.11.0/assets/js/settings-base.js (modified) (1 diff)
-
tags/4.11.0/assets/js/settings-list-page-base.js (modified) (3 diffs)
-
tags/4.11.0/assets/js/settings-list-page-base.min.js (modified) (1 diff)
-
tags/4.11.0/changelog.txt (modified) (5 diffs)
-
tags/4.11.0/composer.json (added)
-
tags/4.11.0/hcaptcha.php (modified) (3 diffs)
-
tags/4.11.0/readme.txt (modified) (19 diffs)
-
tags/4.11.0/src/php/Admin/Events/Events.php (modified) (11 diffs)
-
tags/4.11.0/src/php/Admin/Events/EventsTable.php (modified) (1 diff)
-
tags/4.11.0/src/php/Admin/Events/FormsTable.php (modified) (1 diff)
-
tags/4.11.0/src/php/Affiliates/Login.php (modified) (1 diff)
-
tags/4.11.0/src/php/Asgaros/Base.php (modified) (2 diffs)
-
tags/4.11.0/src/php/Avada/Form.php (modified) (2 diffs)
-
tags/4.11.0/src/php/Brizy/Base.php (modified) (1 diff)
-
tags/4.11.0/src/php/BuddyPress/CreateGroup.php (modified) (1 diff)
-
tags/4.11.0/src/php/CF7/Admin.php (modified) (2 diffs)
-
tags/4.11.0/src/php/CF7/CF7.php (modified) (7 diffs)
-
tags/4.11.0/src/php/CF7/ReallySimpleCaptcha.php (added)
-
tags/4.11.0/src/php/CoBlocks/Form.php (modified) (1 diff)
-
tags/4.11.0/src/php/ColorlibCustomizer/Base.php (modified) (2 diffs)
-
tags/4.11.0/src/php/ColorlibCustomizer/Login.php (modified) (1 diff)
-
tags/4.11.0/src/php/ColorlibCustomizer/LostPassword.php (modified) (1 diff)
-
tags/4.11.0/src/php/ColorlibCustomizer/Register.php (modified) (1 diff)
-
tags/4.11.0/src/php/DelayedScript/DelayedScript.php (modified) (5 diffs)
-
tags/4.11.0/src/php/DownloadManager/DownloadManager.php (modified) (2 diffs)
-
tags/4.11.0/src/php/ElementorPro/HCaptchaHandler.php (modified) (2 diffs)
-
tags/4.11.0/src/php/ElementorPro/Login.php (modified) (1 diff)
-
tags/4.11.0/src/php/EssentialAddons/Register.php (modified) (1 diff)
-
tags/4.11.0/src/php/EssentialBlocks/Form.php (modified) (1 diff)
-
tags/4.11.0/src/php/FluentForm/Form.php (modified) (12 diffs)
-
tags/4.11.0/src/php/GravityForms/Form.php (modified) (2 diffs)
-
tags/4.11.0/src/php/HTMLForms/Form.php (modified) (2 diffs)
-
tags/4.11.0/src/php/Helpers/HCaptcha.php (modified) (4 diffs)
-
tags/4.11.0/src/php/Jetpack/Base.php (modified) (4 diffs)
-
tags/4.11.0/src/php/LearnDash/Register.php (modified) (1 diff)
-
tags/4.11.0/src/php/LoginSignupPopup/Login.php (modified) (1 diff)
-
tags/4.11.0/src/php/LoginSignupPopup/Register.php (modified) (1 diff)
-
tags/4.11.0/src/php/Main.php (modified) (18 diffs)
-
tags/4.11.0/src/php/Maintenance/Login.php (modified) (2 diffs)
-
tags/4.11.0/src/php/Migrations/Migrations.php (modified) (11 diffs)
-
tags/4.11.0/src/php/Passster/Protect.php (modified) (1 diff)
-
tags/4.11.0/src/php/ProfileBuilder/Login.php (modified) (1 diff)
-
tags/4.11.0/src/php/Settings/Abstracts/SettingsBase.php (modified) (2 diffs)
-
tags/4.11.0/src/php/Settings/EventsPage.php (modified) (5 diffs)
-
tags/4.11.0/src/php/Settings/FormsPage.php (modified) (8 diffs)
-
tags/4.11.0/src/php/Settings/General.php (modified) (1 diff)
-
tags/4.11.0/src/php/Settings/Integrations.php (modified) (12 diffs)
-
tags/4.11.0/src/php/Settings/ListPageBase.php (modified) (5 diffs)
-
tags/4.11.0/src/php/Settings/Settings.php (modified) (1 diff)
-
tags/4.11.0/src/php/Settings/SystemInfo.php (modified) (1 diff)
-
tags/4.11.0/src/php/SimpleMembership/Login.php (modified) (1 diff)
-
tags/4.11.0/src/php/SimpleMembership/LostPassword.php (modified) (1 diff)
-
tags/4.11.0/src/php/SimpleMembership/Register.php (modified) (1 diff)
-
tags/4.11.0/src/php/Spectra/Form.php (modified) (1 diff)
-
tags/4.11.0/src/php/SupportCandy/Base.php (modified) (1 diff)
-
tags/4.11.0/src/php/UsersWP/Register.php (modified) (2 diffs)
-
tags/4.11.0/src/php/WC/Login.php (modified) (1 diff)
-
tags/4.11.0/src/php/WC/LostPassword.php (modified) (1 diff)
-
tags/4.11.0/src/php/WC/Register.php (modified) (1 diff)
-
tags/4.11.0/src/php/WP/Base.php (modified) (2 diffs)
-
tags/4.11.0/src/php/WP/Comment.php (modified) (1 diff)
-
tags/4.11.0/src/php/WPDiscuz/Comment.php (modified) (1 diff)
-
tags/4.11.0/src/php/WPDiscuz/Subscribe.php (modified) (1 diff)
-
tags/4.11.0/src/php/WPForms/Form.php (modified) (4 diffs)
-
tags/4.11.0/src/php/WPForo/Base.php (modified) (2 diffs)
-
tags/4.11.0/src/php/Wordfence/General.php (modified) (1 diff)
-
tags/4.11.0/src/php/includes/request.php (modified) (2 diffs)
-
tags/4.11.0/vendor/autoload.php (modified) (1 diff)
-
tags/4.11.0/vendor/composer/autoload_classmap.php (modified) (1 diff)
-
tags/4.11.0/vendor/composer/autoload_real.php (modified) (2 diffs)
-
tags/4.11.0/vendor/composer/autoload_static.php (modified) (3 diffs)
-
tags/4.11.0/vendor/composer/installed.json (modified) (1 diff)
-
tags/4.11.0/vendor/composer/installed.php (modified) (3 diffs)
-
tags/4.11.0/vendor/composer/platform_check.php (added)
-
tags/4.11.0/vendor/woocommerce (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/README.md (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/action-scheduler.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/changelog.txt (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/ActionScheduler_ActionClaim.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/ActionScheduler_ActionFactory.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/ActionScheduler_AdminView.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/ActionScheduler_AsyncRequest_QueueRunner.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/ActionScheduler_Compatibility.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/ActionScheduler_DataController.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/ActionScheduler_DateTime.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/ActionScheduler_Exception.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/ActionScheduler_FatalErrorMonitor.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/ActionScheduler_InvalidActionException.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/ActionScheduler_ListTable.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/ActionScheduler_LogEntry.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/ActionScheduler_NullLogEntry.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/ActionScheduler_OptionLock.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/ActionScheduler_QueueCleaner.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/ActionScheduler_QueueRunner.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/ActionScheduler_SystemInformation.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/ActionScheduler_Versions.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/ActionScheduler_WPCommentCleaner.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/ActionScheduler_wcSystemStatus.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/WP_CLI (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/WP_CLI/Action (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/WP_CLI/Action/Cancel_Command.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/WP_CLI/Action/Create_Command.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/WP_CLI/Action/Delete_Command.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/WP_CLI/Action/Generate_Command.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/WP_CLI/Action/Get_Command.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/WP_CLI/Action/List_Command.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/WP_CLI/Action/Next_Command.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/WP_CLI/Action/Run_Command.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/WP_CLI/ActionScheduler_WPCLI_Clean_Command.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/WP_CLI/ActionScheduler_WPCLI_QueueRunner.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/WP_CLI/ActionScheduler_WPCLI_Scheduler_command.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/WP_CLI/Action_Command.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/WP_CLI/Migration_Command.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/WP_CLI/ProgressBar.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/WP_CLI/System_Command.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/abstracts (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Abstract_ListTable.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Abstract_QueueRunner.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Abstract_RecurringSchedule.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Abstract_Schedule.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Abstract_Schema.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Lock.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Logger.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Store.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_TimezoneHelper.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_WPCLI_Command.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/actions (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/actions/ActionScheduler_Action.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/actions/ActionScheduler_CanceledAction.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/actions/ActionScheduler_FinishedAction.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/actions/ActionScheduler_NullAction.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/data-stores (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/data-stores/ActionScheduler_DBLogger.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/data-stores/ActionScheduler_DBStore.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/data-stores/ActionScheduler_HybridStore.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/data-stores/ActionScheduler_wpCommentLogger.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/data-stores/ActionScheduler_wpPostStore.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/data-stores/ActionScheduler_wpPostStore_PostStatusRegistrar.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/data-stores/ActionScheduler_wpPostStore_PostTypeRegistrar.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/data-stores/ActionScheduler_wpPostStore_TaxonomyRegistrar.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/migration (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/migration/ActionMigrator.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/migration/ActionScheduler_DBStoreMigrator.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/migration/BatchFetcher.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/migration/Config.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/migration/Controller.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/migration/DryRun_ActionMigrator.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/migration/DryRun_LogMigrator.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/migration/LogMigrator.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/migration/Runner.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/migration/Scheduler.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/schedules (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/schedules/ActionScheduler_CanceledSchedule.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/schedules/ActionScheduler_CronSchedule.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/schedules/ActionScheduler_IntervalSchedule.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/schedules/ActionScheduler_NullSchedule.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/schedules/ActionScheduler_Schedule.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/schedules/ActionScheduler_SimpleSchedule.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/schema (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/schema/ActionScheduler_LoggerSchema.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/classes/schema/ActionScheduler_StoreSchema.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/deprecated (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/deprecated/ActionScheduler_Abstract_QueueRunner_Deprecated.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/deprecated/ActionScheduler_AdminView_Deprecated.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/deprecated/ActionScheduler_Schedule_Deprecated.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/deprecated/ActionScheduler_Store_Deprecated.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/deprecated/functions.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/functions.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/lib (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/lib/WP_Async_Request.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/lib/cron-expression (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_AbstractField.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_DayOfMonthField.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_DayOfWeekField.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_FieldFactory.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_FieldInterface.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_HoursField.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_MinutesField.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_MonthField.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_YearField.php (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/lib/cron-expression/LICENSE (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/lib/cron-expression/README.md (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/license.txt (added)
-
tags/4.11.0/vendor/woocommerce/action-scheduler/readme.txt (added)
-
trunk/assets/css/forms.css (modified) (1 diff)
-
trunk/assets/css/forms.min.css (modified) (1 diff)
-
trunk/assets/css/settings-base.css (modified) (1 diff)
-
trunk/assets/css/settings-base.min.css (modified) (1 diff)
-
trunk/assets/js/events.js (modified) (2 diffs)
-
trunk/assets/js/events.min.js (modified) (1 diff)
-
trunk/assets/js/forms.js (modified) (4 diffs)
-
trunk/assets/js/forms.min.js (modified) (1 diff)
-
trunk/assets/js/settings-base.js (modified) (1 diff)
-
trunk/assets/js/settings-list-page-base.js (modified) (3 diffs)
-
trunk/assets/js/settings-list-page-base.min.js (modified) (1 diff)
-
trunk/changelog.txt (modified) (5 diffs)
-
trunk/composer.json (added)
-
trunk/hcaptcha.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (19 diffs)
-
trunk/src/php/Admin/Events/Events.php (modified) (11 diffs)
-
trunk/src/php/Admin/Events/EventsTable.php (modified) (1 diff)
-
trunk/src/php/Admin/Events/FormsTable.php (modified) (1 diff)
-
trunk/src/php/Affiliates/Login.php (modified) (1 diff)
-
trunk/src/php/Asgaros/Base.php (modified) (2 diffs)
-
trunk/src/php/Avada/Form.php (modified) (2 diffs)
-
trunk/src/php/Brizy/Base.php (modified) (1 diff)
-
trunk/src/php/BuddyPress/CreateGroup.php (modified) (1 diff)
-
trunk/src/php/CF7/Admin.php (modified) (2 diffs)
-
trunk/src/php/CF7/CF7.php (modified) (7 diffs)
-
trunk/src/php/CF7/ReallySimpleCaptcha.php (added)
-
trunk/src/php/CoBlocks/Form.php (modified) (1 diff)
-
trunk/src/php/ColorlibCustomizer/Base.php (modified) (2 diffs)
-
trunk/src/php/ColorlibCustomizer/Login.php (modified) (1 diff)
-
trunk/src/php/ColorlibCustomizer/LostPassword.php (modified) (1 diff)
-
trunk/src/php/ColorlibCustomizer/Register.php (modified) (1 diff)
-
trunk/src/php/DelayedScript/DelayedScript.php (modified) (5 diffs)
-
trunk/src/php/DownloadManager/DownloadManager.php (modified) (2 diffs)
-
trunk/src/php/ElementorPro/HCaptchaHandler.php (modified) (2 diffs)
-
trunk/src/php/ElementorPro/Login.php (modified) (1 diff)
-
trunk/src/php/EssentialAddons/Register.php (modified) (1 diff)
-
trunk/src/php/EssentialBlocks/Form.php (modified) (1 diff)
-
trunk/src/php/FluentForm/Form.php (modified) (12 diffs)
-
trunk/src/php/GravityForms/Form.php (modified) (2 diffs)
-
trunk/src/php/HTMLForms/Form.php (modified) (2 diffs)
-
trunk/src/php/Helpers/HCaptcha.php (modified) (4 diffs)
-
trunk/src/php/Jetpack/Base.php (modified) (4 diffs)
-
trunk/src/php/LearnDash/Register.php (modified) (1 diff)
-
trunk/src/php/LoginSignupPopup/Login.php (modified) (1 diff)
-
trunk/src/php/LoginSignupPopup/Register.php (modified) (1 diff)
-
trunk/src/php/Main.php (modified) (18 diffs)
-
trunk/src/php/Maintenance/Login.php (modified) (2 diffs)
-
trunk/src/php/Migrations/Migrations.php (modified) (11 diffs)
-
trunk/src/php/Passster/Protect.php (modified) (1 diff)
-
trunk/src/php/ProfileBuilder/Login.php (modified) (1 diff)
-
trunk/src/php/Settings/Abstracts/SettingsBase.php (modified) (2 diffs)
-
trunk/src/php/Settings/EventsPage.php (modified) (5 diffs)
-
trunk/src/php/Settings/FormsPage.php (modified) (8 diffs)
-
trunk/src/php/Settings/General.php (modified) (1 diff)
-
trunk/src/php/Settings/Integrations.php (modified) (12 diffs)
-
trunk/src/php/Settings/ListPageBase.php (modified) (5 diffs)
-
trunk/src/php/Settings/Settings.php (modified) (1 diff)
-
trunk/src/php/Settings/SystemInfo.php (modified) (1 diff)
-
trunk/src/php/SimpleMembership/Login.php (modified) (1 diff)
-
trunk/src/php/SimpleMembership/LostPassword.php (modified) (1 diff)
-
trunk/src/php/SimpleMembership/Register.php (modified) (1 diff)
-
trunk/src/php/Spectra/Form.php (modified) (1 diff)
-
trunk/src/php/SupportCandy/Base.php (modified) (1 diff)
-
trunk/src/php/UsersWP/Register.php (modified) (2 diffs)
-
trunk/src/php/WC/Login.php (modified) (1 diff)
-
trunk/src/php/WC/LostPassword.php (modified) (1 diff)
-
trunk/src/php/WC/Register.php (modified) (1 diff)
-
trunk/src/php/WP/Base.php (modified) (2 diffs)
-
trunk/src/php/WP/Comment.php (modified) (1 diff)
-
trunk/src/php/WPDiscuz/Comment.php (modified) (1 diff)
-
trunk/src/php/WPDiscuz/Subscribe.php (modified) (1 diff)
-
trunk/src/php/WPForms/Form.php (modified) (4 diffs)
-
trunk/src/php/WPForo/Base.php (modified) (2 diffs)
-
trunk/src/php/Wordfence/General.php (modified) (1 diff)
-
trunk/src/php/includes/request.php (modified) (2 diffs)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_classmap.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_real.php (modified) (2 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (3 diffs)
-
trunk/vendor/composer/installed.json (modified) (1 diff)
-
trunk/vendor/composer/installed.php (modified) (3 diffs)
-
trunk/vendor/composer/platform_check.php (added)
-
trunk/vendor/woocommerce (added)
-
trunk/vendor/woocommerce/action-scheduler (added)
-
trunk/vendor/woocommerce/action-scheduler/README.md (added)
-
trunk/vendor/woocommerce/action-scheduler/action-scheduler.php (added)
-
trunk/vendor/woocommerce/action-scheduler/changelog.txt (added)
-
trunk/vendor/woocommerce/action-scheduler/classes (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_ActionClaim.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_ActionFactory.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_AdminView.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_AsyncRequest_QueueRunner.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_Compatibility.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_DataController.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_DateTime.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_Exception.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_FatalErrorMonitor.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_InvalidActionException.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_ListTable.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_LogEntry.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_NullLogEntry.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_OptionLock.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_QueueCleaner.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_QueueRunner.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_SystemInformation.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_Versions.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_WPCommentCleaner.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/ActionScheduler_wcSystemStatus.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/WP_CLI (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/WP_CLI/Action (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/WP_CLI/Action/Cancel_Command.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/WP_CLI/Action/Create_Command.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/WP_CLI/Action/Delete_Command.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/WP_CLI/Action/Generate_Command.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/WP_CLI/Action/Get_Command.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/WP_CLI/Action/List_Command.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/WP_CLI/Action/Next_Command.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/WP_CLI/Action/Run_Command.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/WP_CLI/ActionScheduler_WPCLI_Clean_Command.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/WP_CLI/ActionScheduler_WPCLI_QueueRunner.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/WP_CLI/ActionScheduler_WPCLI_Scheduler_command.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/WP_CLI/Action_Command.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/WP_CLI/Migration_Command.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/WP_CLI/ProgressBar.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/WP_CLI/System_Command.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/abstracts (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Abstract_ListTable.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Abstract_QueueRunner.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Abstract_RecurringSchedule.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Abstract_Schedule.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Abstract_Schema.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Lock.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Logger.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_Store.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_TimezoneHelper.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/abstracts/ActionScheduler_WPCLI_Command.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/actions (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/actions/ActionScheduler_Action.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/actions/ActionScheduler_CanceledAction.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/actions/ActionScheduler_FinishedAction.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/actions/ActionScheduler_NullAction.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/data-stores (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/data-stores/ActionScheduler_DBLogger.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/data-stores/ActionScheduler_DBStore.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/data-stores/ActionScheduler_HybridStore.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/data-stores/ActionScheduler_wpCommentLogger.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/data-stores/ActionScheduler_wpPostStore.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/data-stores/ActionScheduler_wpPostStore_PostStatusRegistrar.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/data-stores/ActionScheduler_wpPostStore_PostTypeRegistrar.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/data-stores/ActionScheduler_wpPostStore_TaxonomyRegistrar.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/migration (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/migration/ActionMigrator.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/migration/ActionScheduler_DBStoreMigrator.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/migration/BatchFetcher.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/migration/Config.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/migration/Controller.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/migration/DryRun_ActionMigrator.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/migration/DryRun_LogMigrator.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/migration/LogMigrator.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/migration/Runner.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/migration/Scheduler.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/schedules (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/schedules/ActionScheduler_CanceledSchedule.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/schedules/ActionScheduler_CronSchedule.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/schedules/ActionScheduler_IntervalSchedule.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/schedules/ActionScheduler_NullSchedule.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/schedules/ActionScheduler_Schedule.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/schedules/ActionScheduler_SimpleSchedule.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/schema (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/schema/ActionScheduler_LoggerSchema.php (added)
-
trunk/vendor/woocommerce/action-scheduler/classes/schema/ActionScheduler_StoreSchema.php (added)
-
trunk/vendor/woocommerce/action-scheduler/deprecated (added)
-
trunk/vendor/woocommerce/action-scheduler/deprecated/ActionScheduler_Abstract_QueueRunner_Deprecated.php (added)
-
trunk/vendor/woocommerce/action-scheduler/deprecated/ActionScheduler_AdminView_Deprecated.php (added)
-
trunk/vendor/woocommerce/action-scheduler/deprecated/ActionScheduler_Schedule_Deprecated.php (added)
-
trunk/vendor/woocommerce/action-scheduler/deprecated/ActionScheduler_Store_Deprecated.php (added)
-
trunk/vendor/woocommerce/action-scheduler/deprecated/functions.php (added)
-
trunk/vendor/woocommerce/action-scheduler/functions.php (added)
-
trunk/vendor/woocommerce/action-scheduler/lib (added)
-
trunk/vendor/woocommerce/action-scheduler/lib/WP_Async_Request.php (added)
-
trunk/vendor/woocommerce/action-scheduler/lib/cron-expression (added)
-
trunk/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression.php (added)
-
trunk/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_AbstractField.php (added)
-
trunk/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_DayOfMonthField.php (added)
-
trunk/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_DayOfWeekField.php (added)
-
trunk/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_FieldFactory.php (added)
-
trunk/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_FieldInterface.php (added)
-
trunk/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_HoursField.php (added)
-
trunk/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_MinutesField.php (added)
-
trunk/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_MonthField.php (added)
-
trunk/vendor/woocommerce/action-scheduler/lib/cron-expression/CronExpression_YearField.php (added)
-
trunk/vendor/woocommerce/action-scheduler/lib/cron-expression/LICENSE (added)
-
trunk/vendor/woocommerce/action-scheduler/lib/cron-expression/README.md (added)
-
trunk/vendor/woocommerce/action-scheduler/license.txt (added)
-
trunk/vendor/woocommerce/action-scheduler/readme.txt (added)
Legend:
- Unmodified
- Added
- Removed
-
hcaptcha-for-forms-and-more/tags/4.11.0/assets/css/forms.css
r3233179 r3248039 45 45 } 46 46 47 #hcaptcha-chart-message { 48 padding: 5px 10px; 49 border: 1px solid #c3c4c7; 50 box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); 51 color: #50575e; 52 background-color: #f6f7f7; 53 text-align: center; 54 } 55 47 56 @media (max-width: 782px) { 48 57 #hcaptcha-options #hcaptcha-forms-wrap table tbody tr td { -
hcaptcha-for-forms-and-more/tags/4.11.0/assets/css/forms.min.css
r3233179 r3248039 1 #hcaptcha-options #hcaptcha-forms-wrap table tbody tr td{padding:8px 10px}.hcaptcha-forms-sample-bg{aspect-ratio:2845/1637;background-image:url(../images/forms-page.png);background-position:50%;background-repeat:no-repeat;background-size:cover;box-sizing:border-box;filter:blur(1px);-webkit-filter:blur(1px);width:100%}.hcaptcha-forms-sample-text{background-color:rgba(92,111,138,.8);border:3px solid #f0f2f5;color:#f0f2f5;left:50%;padding:20px;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);width:80%;z-index:1}.hcaptcha-forms-sample-text p{font-size:1.3em}#hcaptcha-options .hcaptcha-forms-sample-text p a{color:#f0f2f5}#hcaptcha-forms-chart{aspect-ratio:3/1;background-color:#fff;margin:auto;position:relative;width:100%} @media (max-width:782px){#hcaptcha-options #hcaptcha-forms-wrap table tbody tr td{min-height:19.5px;padding-block-end:3px;padding-block-start:3px;padding-inline-end:8px;padding-inline-start:35%}#hcaptcha-options #hcaptcha-forms-wrap table tbody tr td.column-primary{padding:3px 10px}}1 #hcaptcha-options #hcaptcha-forms-wrap table tbody tr td{padding:8px 10px}.hcaptcha-forms-sample-bg{aspect-ratio:2845/1637;background-image:url(../images/forms-page.png);background-position:50%;background-repeat:no-repeat;background-size:cover;box-sizing:border-box;filter:blur(1px);-webkit-filter:blur(1px);width:100%}.hcaptcha-forms-sample-text{background-color:rgba(92,111,138,.8);border:3px solid #f0f2f5;color:#f0f2f5;left:50%;padding:20px;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);width:80%;z-index:1}.hcaptcha-forms-sample-text p{font-size:1.3em}#hcaptcha-options .hcaptcha-forms-sample-text p a{color:#f0f2f5}#hcaptcha-forms-chart{aspect-ratio:3/1;background-color:#fff;margin:auto;position:relative;width:100%}#hcaptcha-chart-message{background-color:#f6f7f7;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);color:#50575e;padding:5px 10px;text-align:center}@media (max-width:782px){#hcaptcha-options #hcaptcha-forms-wrap table tbody tr td{min-height:19.5px;padding-block-end:3px;padding-block-start:3px;padding-inline-end:8px;padding-inline-start:35%}#hcaptcha-options #hcaptcha-forms-wrap table tbody tr td.column-primary{padding:3px 10px}} -
hcaptcha-for-forms-and-more/tags/4.11.0/assets/css/settings-base.css
r3233179 r3248039 38 38 margin-inline-end: 30px; 39 39 color: #646970; 40 border-bottom: 2px solid transparent;41 40 } 42 41 -
hcaptcha-for-forms-and-more/tags/4.11.0/assets/css/settings-base.min.css
r3233179 r3248039 1 body.settings_page_hcaptcha{background:#f0f2f5;color:#5c6f8a}.wrap h1.hcaptcha-settings-header{align-items:center;display:flex;font-size:34px;font-weight:700}.hcaptcha-logo{height:64px;margin-block-end:10px;margin-block-start:10px;margin-inline-end:5px;margin-inline-start:0}.hcaptcha-settings-tabs{background:#fff;display:flex;flex-wrap:wrap;justify-content:space-between;line-height:4.5em;margin:10px -20px 0;padding:0 20px;position:sticky;top:0;z-index:2}.hcaptcha-settings-tab{ border-bottom:2px solid transparent;color:#646970;display:inline-block;font-size:1.1em;margin-inline-end:30px;text-decoration:none}.hcaptcha-settings-tab:hover{border-bottom-color:#025176!important;border-bottom:2px solid;color:#666}.hcaptcha-settings-tab.active{border-bottom:2px solid #0075ab}.hcaptcha-header-bar{align-items:center;background:#f0f2f5;display:flex;justify-content:space-between;margin:0 -20px;padding:0 20px;position:sticky;top:60px;z-index:2}#hcaptcha-options h2{color:#5c6f8a;font-size:1.5em}#hcaptcha-options h2~*{display:none}#hcaptcha-options h3{color:#5c6f8a;margin:1.5em 0 1em}#hcaptcha-options .notice-dismiss:before{color:#5c6f8a}#hcaptcha-options table tbody tr td{margin:0;padding:0;position:relative}#hcaptcha-options table tr td fieldset input[type=checkbox]{border:none;box-shadow:none;display:inline;height:1.25rem;margin-block-end:0;margin-block-start:-.125rem;margin-inline-end:.5rem;margin-inline-start:0;width:2.3611rem}#hcaptcha-options table tr td fieldset input[type=checkbox]:before{background:url(../images/checkbox-off.svg);background-size:cover;content:"";display:inline-block;height:1.25rem;margin:0;width:2.3611rem}#hcaptcha-options table tr td fieldset input[type=checkbox]:checked:before{background:no-repeat url(../images/checkbox-on.svg);background-size:cover}#hcaptcha-options fieldset:disabled{color:#dadada}#hcaptcha-options .button-primary{background-color:#026593;border-color:#026593;color:#fff}#hcaptcha-options .button-primary:hover{background-color:#025176}#hcaptcha-options .button-secondary{background-color:#fff;border-color:#026593;color:#026593}#hcaptcha-options .button-secondary:hover{background-color:#ccc}#hcaptcha-options a{color:#0075ab}#hcaptcha-navigation a{border-color:#0075ab}#hcaptcha-options a.hcaptcha-settings-tab{color:#5c6f8a}#hcaptcha-options .helper:before{background:#5c6f8a;border-radius:1.2em;color:#fff;content:"?";height:1.2em;inset-inline-end:0;position:absolute;text-align:center;top:0;transform:translateY(-27px);width:1.2em}#hcaptcha-options fieldset+.helper:before{top:50%;transform:translate(25px,-.7em)}.rtl #hcaptcha-options fieldset+.helper:before{transform:translate(-25px,-.8em)}#hcaptcha-options .helper .helper-content{background:#5c6f8a;box-sizing:border-box;color:#f0f2f5;display:none;inset-inline-end:0;padding:.5em 1em;position:absolute;top:0;transform:translate(1px,10px);width:100%}.rtl #hcaptcha-options .helper .helper-content{transform:translate(-1px,10px)}#hcaptcha-options fieldset+.helper .helper-content{top:50%;transform:translate(25px,25px);width:calc(100% + 25px)}#hcaptcha-options .helper:hover{cursor:help}#hcaptcha-options .helper:hover .helper-content{display:block;z-index:1}#hcaptcha-options .helper .helper-content:after{border:10px solid transparent;border-bottom-color:#5c6f8a;content:"";inset-inline-end:0;position:absolute;top:0;transform:translateY(-100%)}#hcaptcha-options .helper .helper-content a{color:#fff}#hcaptcha-message{box-sizing:border-box}#hcaptcha-message>p{font-size:13px;font-weight:600;line-height:1.5;margin:.5em 0}@keyframes blink{0%{opacity:1}16.7%{opacity:0}33.3%{opacity:1}50%{opacity:0}66.7%{opacity:1}83.3%{opacity:0}to{opacity:1}}.blink{animation:blink 3s linear}.hcaptcha-hide{display:none}.hcaptcha-excerpt{display:block;max-width:100%;overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap;width:max-content}.hcaptcha-excerpt:hover{overflow:visible}.hcaptcha-excerpt:hover .hcaptcha-hide{background:#5c6f8a;border:1px solid #c3c4c7;border-radius:6px;box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);color:#f0f2f5;display:block;inset-inline-start:50%;max-width:300px;padding:8px 10px;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);white-space:normal;width:max-content;z-index:1}@media (max-width:782px){#hcaptcha-options .wp-list-table .toggle-row{top:15px}#hcaptcha-options .wp-list-table tr.is-expanded .toggle-row{top:6.5px}#hcaptcha-options .widefat tbody th.check-column{padding:0;vertical-align:middle}#hcaptcha-options .widefat thead td.check-column,.widefat tfoot td.check-column{padding-left:0}#hcaptcha-options .widefat th input[type=checkbox]{margin-bottom:0}#hcaptcha-options .wp-list-table .is-expanded td:not(.hidden){overflow:visible}.hcaptcha-settings-tabs{margin:unset;margin-block-end:0;margin-block-start:10px;margin-inline-end:-12px;margin-inline-start:-10px;padding-block-end:0;padding-block-start:0;padding-inline-end:12px;padding-inline-start:10px}.hcaptcha-excerpt{display:table-cell;height:44px;vertical-align:middle}tr.is-expanded .hcaptcha-excerpt{height:19.5px}}@media (max-width:600px){#hcaptcha-options table tbody{grid-template-columns:1fr}#hcaptcha-options table tbody tr{position:relative}#hcaptcha-options fieldset+.helper:before{transform:translateY(-.7em)}#hcaptcha-options fieldset+.helper .helper-content{transform:translateY(25px);width:100%}#hcaptcha-options .helper{z-index:1}.hcaptcha-settings-tab{inset-inline-end:15px}}1 body.settings_page_hcaptcha{background:#f0f2f5;color:#5c6f8a}.wrap h1.hcaptcha-settings-header{align-items:center;display:flex;font-size:34px;font-weight:700}.hcaptcha-logo{height:64px;margin-block-end:10px;margin-block-start:10px;margin-inline-end:5px;margin-inline-start:0}.hcaptcha-settings-tabs{background:#fff;display:flex;flex-wrap:wrap;justify-content:space-between;line-height:4.5em;margin:10px -20px 0;padding:0 20px;position:sticky;top:0;z-index:2}.hcaptcha-settings-tab{color:#646970;display:inline-block;font-size:1.1em;margin-inline-end:30px;text-decoration:none}.hcaptcha-settings-tab:hover{border-bottom-color:#025176!important;border-bottom:2px solid;color:#666}.hcaptcha-settings-tab.active{border-bottom:2px solid #0075ab}.hcaptcha-header-bar{align-items:center;background:#f0f2f5;display:flex;justify-content:space-between;margin:0 -20px;padding:0 20px;position:sticky;top:60px;z-index:2}#hcaptcha-options h2{color:#5c6f8a;font-size:1.5em}#hcaptcha-options h2~*{display:none}#hcaptcha-options h3{color:#5c6f8a;margin:1.5em 0 1em}#hcaptcha-options .notice-dismiss:before{color:#5c6f8a}#hcaptcha-options table tbody tr td{margin:0;padding:0;position:relative}#hcaptcha-options table tr td fieldset input[type=checkbox]{border:none;box-shadow:none;display:inline;height:1.25rem;margin-block-end:0;margin-block-start:-.125rem;margin-inline-end:.5rem;margin-inline-start:0;width:2.3611rem}#hcaptcha-options table tr td fieldset input[type=checkbox]:before{background:url(../images/checkbox-off.svg);background-size:cover;content:"";display:inline-block;height:1.25rem;margin:0;width:2.3611rem}#hcaptcha-options table tr td fieldset input[type=checkbox]:checked:before{background:no-repeat url(../images/checkbox-on.svg);background-size:cover}#hcaptcha-options fieldset:disabled{color:#dadada}#hcaptcha-options .button-primary{background-color:#026593;border-color:#026593;color:#fff}#hcaptcha-options .button-primary:hover{background-color:#025176}#hcaptcha-options .button-secondary{background-color:#fff;border-color:#026593;color:#026593}#hcaptcha-options .button-secondary:hover{background-color:#ccc}#hcaptcha-options a{color:#0075ab}#hcaptcha-navigation a{border-color:#0075ab}#hcaptcha-options a.hcaptcha-settings-tab{color:#5c6f8a}#hcaptcha-options .helper:before{background:#5c6f8a;border-radius:1.2em;color:#fff;content:"?";height:1.2em;inset-inline-end:0;position:absolute;text-align:center;top:0;transform:translateY(-27px);width:1.2em}#hcaptcha-options fieldset+.helper:before{top:50%;transform:translate(25px,-.7em)}.rtl #hcaptcha-options fieldset+.helper:before{transform:translate(-25px,-.8em)}#hcaptcha-options .helper .helper-content{background:#5c6f8a;box-sizing:border-box;color:#f0f2f5;display:none;inset-inline-end:0;padding:.5em 1em;position:absolute;top:0;transform:translate(1px,10px);width:100%}.rtl #hcaptcha-options .helper .helper-content{transform:translate(-1px,10px)}#hcaptcha-options fieldset+.helper .helper-content{top:50%;transform:translate(25px,25px);width:calc(100% + 25px)}#hcaptcha-options .helper:hover{cursor:help}#hcaptcha-options .helper:hover .helper-content{display:block;z-index:1}#hcaptcha-options .helper .helper-content:after{border:10px solid transparent;border-bottom-color:#5c6f8a;content:"";inset-inline-end:0;position:absolute;top:0;transform:translateY(-100%)}#hcaptcha-options .helper .helper-content a{color:#fff}#hcaptcha-message{box-sizing:border-box}#hcaptcha-message>p{font-size:13px;font-weight:600;line-height:1.5;margin:.5em 0}@keyframes blink{0%{opacity:1}16.7%{opacity:0}33.3%{opacity:1}50%{opacity:0}66.7%{opacity:1}83.3%{opacity:0}to{opacity:1}}.blink{animation:blink 3s linear}.hcaptcha-hide{display:none}.hcaptcha-excerpt{display:block;max-width:100%;overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap;width:max-content}.hcaptcha-excerpt:hover{overflow:visible}.hcaptcha-excerpt:hover .hcaptcha-hide{background:#5c6f8a;border:1px solid #c3c4c7;border-radius:6px;box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);color:#f0f2f5;display:block;inset-inline-start:50%;max-width:300px;padding:8px 10px;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);white-space:normal;width:max-content;z-index:1}@media (max-width:782px){#hcaptcha-options .wp-list-table .toggle-row{top:15px}#hcaptcha-options .wp-list-table tr.is-expanded .toggle-row{top:6.5px}#hcaptcha-options .widefat tbody th.check-column{padding:0;vertical-align:middle}#hcaptcha-options .widefat thead td.check-column,.widefat tfoot td.check-column{padding-left:0}#hcaptcha-options .widefat th input[type=checkbox]{margin-bottom:0}#hcaptcha-options .wp-list-table .is-expanded td:not(.hidden){overflow:visible}.hcaptcha-settings-tabs{margin:unset;margin-block-end:0;margin-block-start:10px;margin-inline-end:-12px;margin-inline-start:-10px;padding-block-end:0;padding-block-start:0;padding-inline-end:12px;padding-inline-start:10px}.hcaptcha-excerpt{display:table-cell;height:44px;vertical-align:middle}tr.is-expanded .hcaptcha-excerpt{height:19.5px}}@media (max-width:600px){#hcaptcha-options table tbody{grid-template-columns:1fr}#hcaptcha-options table tbody tr{position:relative}#hcaptcha-options fieldset+.helper:before{transform:translateY(-.7em)}#hcaptcha-options fieldset+.helper .helper-content{transform:translateY(25px);width:100%}#hcaptcha-options .helper{z-index:1}.hcaptcha-settings-tab{inset-inline-end:15px}} -
hcaptcha-for-forms-and-more/tags/4.11.0/assets/js/events.js
r3233179 r3248039 5 5 * @param HCaptchaEventsObject.bulkAction 6 6 * @param HCaptchaEventsObject.bulkNonce 7 * @param HCaptchaEventsObject.bulkMessage 7 8 * @param HCaptchaEventsObject.failed 8 9 * @param HCaptchaEventsObject.failedLabel … … 123 124 124 125 initChart(); 126 hCaptchaSettingsBase.showSuccessMessage( HCaptchaEventsObject.bulkMessage ); 125 127 document.getElementById( 'doaction' ).addEventListener( 'click', handleBulkAction ); 126 128 }; -
hcaptcha-for-forms-and-more/tags/4.11.0/assets/js/events.min.js
r3233179 r3248039 1 (()=>{var e=function(e){var t,a;t=document.getElementById("eventsChart"),a=window.innerWidth>600?3:2,new Chart(t,{type:"bar",data:{datasets:[{label:HCaptchaEventsObject.succeedLabel,data:HCaptchaEventsObject.succeed,borderWidth:1},{label:HCaptchaEventsObject.failedLabel,data:HCaptchaEventsObject.failed,borderWidth:1}]},options:{responsive:!0,maintainAspectRatio:!0,aspectRatio:a,scales:{x:{type:"time",time:{displayFormats:{millisecond:"HH:mm:ss",second:"HH:mm:ss",minute:"HH:mm",hour:"HH:mm",day:"dd.MM.yyyy",week:"dd.MM.yyyy",month:"dd.MM.yyyy",quarter:"dd.MM.yyyy",year:"dd.MM.yyyy"},tooltipFormat:"dd.MM.yyyy HH:mm",unit:HCaptchaEventsObject.unit}},y:{beginAtZero:!0,ticks:{precision:0}}}}}), document.getElementById("doaction").addEventListener("click",(function(t){t.preventDefault();var a=t.target.closest("form"),s=new FormData(a),n=s.get("action");if("-1"!==n){var c=s.getAll("bulk-checkbox[]");if(c.length){var o={action:HCaptchaEventsObject.bulkAction,nonce:HCaptchaEventsObject.bulkNonce,bulk:n,ids:JSON.stringify(c)};e.post({url:HCaptchaEventsObject.ajaxUrl,data:o,beforeSend:function(){return hCaptchaSettingsBase.showSuccessMessage(HCaptchaListPageBaseObject.DoingBulk)}}).done((function(e){e.success?window.location.reload():hCaptchaSettingsBase.showErrorMessage(e.data)})).fail((function(e){hCaptchaSettingsBase.showErrorMessage(e.statusText)}))}else hCaptchaSettingsBase.showErrorMessage(HCaptchaListPageBaseObject.noItems)}else hCaptchaSettingsBase.showErrorMessage(HCaptchaListPageBaseObject.noAction)}))};window.hCaptchaForms=e,jQuery(document).ready(e)})();1 (()=>{var e=function(e){var t,a;t=document.getElementById("eventsChart"),a=window.innerWidth>600?3:2,new Chart(t,{type:"bar",data:{datasets:[{label:HCaptchaEventsObject.succeedLabel,data:HCaptchaEventsObject.succeed,borderWidth:1},{label:HCaptchaEventsObject.failedLabel,data:HCaptchaEventsObject.failed,borderWidth:1}]},options:{responsive:!0,maintainAspectRatio:!0,aspectRatio:a,scales:{x:{type:"time",time:{displayFormats:{millisecond:"HH:mm:ss",second:"HH:mm:ss",minute:"HH:mm",hour:"HH:mm",day:"dd.MM.yyyy",week:"dd.MM.yyyy",month:"dd.MM.yyyy",quarter:"dd.MM.yyyy",year:"dd.MM.yyyy"},tooltipFormat:"dd.MM.yyyy HH:mm",unit:HCaptchaEventsObject.unit}},y:{beginAtZero:!0,ticks:{precision:0}}}}}),hCaptchaSettingsBase.showSuccessMessage(HCaptchaEventsObject.bulkMessage),document.getElementById("doaction").addEventListener("click",(function(t){t.preventDefault();var a=t.target.closest("form"),s=new FormData(a),n=s.get("action");if("-1"!==n){var c=s.getAll("bulk-checkbox[]");if(c.length){var o={action:HCaptchaEventsObject.bulkAction,nonce:HCaptchaEventsObject.bulkNonce,bulk:n,ids:JSON.stringify(c)};e.post({url:HCaptchaEventsObject.ajaxUrl,data:o,beforeSend:function(){return hCaptchaSettingsBase.showSuccessMessage(HCaptchaListPageBaseObject.DoingBulk)}}).done((function(e){e.success?window.location.reload():hCaptchaSettingsBase.showErrorMessage(e.data)})).fail((function(e){hCaptchaSettingsBase.showErrorMessage(e.statusText)}))}else hCaptchaSettingsBase.showErrorMessage(HCaptchaListPageBaseObject.noItems)}else hCaptchaSettingsBase.showErrorMessage(HCaptchaListPageBaseObject.noAction)}))};window.hCaptchaForms=e,jQuery(document).ready(e)})(); -
hcaptcha-for-forms-and-more/tags/4.11.0/assets/js/forms.js
r3233179 r3248039 5 5 * @param HCaptchaFormsObject.bulkAction 6 6 * @param HCaptchaFormsObject.bulkNonce 7 * @param HCaptchaFormsObject.bulkMessage 7 8 * @param HCaptchaFormsObject.served 8 9 * @param HCaptchaFormsObject.servedLabel … … 99 100 } 100 101 102 const datepicker = document.getElementById( 'hcaptcha-datepicker' ); 101 103 const data = { 102 104 action: HCaptchaFormsObject.bulkAction, … … 104 106 bulk, 105 107 ids: JSON.stringify( ids ), 108 date: datepicker?.value ?? '', 106 109 }; 107 110 … … 128 131 129 132 initChart(); 133 hCaptchaSettingsBase.showSuccessMessage( HCaptchaFormsObject.bulkMessage ); 130 134 document.getElementById( 'doaction' ).addEventListener( 'click', handleBulkAction ); 131 135 }; -
hcaptcha-for-forms-and-more/tags/4.11.0/assets/js/forms.min.js
r3233179 r3248039 1 (()=>{var e=function(e){var t,a;t=document.getElementById("formsChart"),a=window.innerWidth>600?3:2,new Chart(t,{type:"bar",data:{datasets:[{label:HCaptchaFormsObject.servedLabel,backgroundColor:"rgba(2,101,147,0.5)",data:HCaptchaFormsObject.served,borderWidth:1}]},options:{responsive:!0,maintainAspectRatio:!0,aspectRatio:a,scales:{x:{type:"time",time:{displayFormats:{millisecond:"HH:mm:ss",second:"HH:mm:ss",minute:"HH:mm",hour:"HH:mm",day:"dd.MM.yyyy",week:"dd.MM.yyyy",month:"dd.MM.yyyy",quarter:"dd.MM.yyyy",year:"dd.MM.yyyy"},tooltipFormat:"dd.MM.yyyy HH:mm",unit:HCaptchaFormsObject.unit}},y:{beginAtZero:!0,ticks:{precision:0}}}}}), document.getElementById("doaction").addEventListener("click",(function(t){t.preventDefault();var a=t.target.closest("form"),s=new FormData(a),o=s.get("action");if("-1"!==o){var r=s.getAll("bulk-checkbox[]").map((function(e){var t=a.querySelector('input[name="bulk-checkbox[]"][value="'.concat(e,'"]')).closest("tr");return{source:t.querySelector("td.name .hcaptcha-excerpt").dataset.source,formId:t.querySelector("td.form_id").textContent}}));if(r.length){var c={action:HCaptchaFormsObject.bulkAction,nonce:HCaptchaFormsObject.bulkNonce,bulk:o,ids:JSON.stringify(r)};e.post({url:HCaptchaFormsObject.ajaxUrl,data:c,beforeSend:function(){return hCaptchaSettingsBase.showSuccessMessage(HCaptchaListPageBaseObject.DoingBulk)}}).done((function(e){e.success?window.location.reload():hCaptchaSettingsBase.showErrorMessage(e.data)})).fail((function(e){hCaptchaSettingsBase.showErrorMessage(e.statusText)}))}else hCaptchaSettingsBase.showErrorMessage(HCaptchaListPageBaseObject.noItems)}else hCaptchaSettingsBase.showErrorMessage(HCaptchaListPageBaseObject.noAction)}))};window.hCaptchaForms=e,jQuery(document).ready(e)})();1 (()=>{var e=function(e){var t,a;t=document.getElementById("formsChart"),a=window.innerWidth>600?3:2,new Chart(t,{type:"bar",data:{datasets:[{label:HCaptchaFormsObject.servedLabel,backgroundColor:"rgba(2,101,147,0.5)",data:HCaptchaFormsObject.served,borderWidth:1}]},options:{responsive:!0,maintainAspectRatio:!0,aspectRatio:a,scales:{x:{type:"time",time:{displayFormats:{millisecond:"HH:mm:ss",second:"HH:mm:ss",minute:"HH:mm",hour:"HH:mm",day:"dd.MM.yyyy",week:"dd.MM.yyyy",month:"dd.MM.yyyy",quarter:"dd.MM.yyyy",year:"dd.MM.yyyy"},tooltipFormat:"dd.MM.yyyy HH:mm",unit:HCaptchaFormsObject.unit}},y:{beginAtZero:!0,ticks:{precision:0}}}}}),hCaptchaSettingsBase.showSuccessMessage(HCaptchaFormsObject.bulkMessage),document.getElementById("doaction").addEventListener("click",(function(t){var a;t.preventDefault();var s=t.target.closest("form"),o=new FormData(s),c=o.get("action");if("-1"!==c){var r=o.getAll("bulk-checkbox[]").map((function(e){var t=s.querySelector('input[name="bulk-checkbox[]"][value="'.concat(e,'"]')).closest("tr");return{source:t.querySelector("td.name .hcaptcha-excerpt").dataset.source,formId:t.querySelector("td.form_id").textContent}}));if(r.length){var n=document.getElementById("hcaptcha-datepicker"),i={action:HCaptchaFormsObject.bulkAction,nonce:HCaptchaFormsObject.bulkNonce,bulk:c,ids:JSON.stringify(r),date:null!==(a=null==n?void 0:n.value)&&void 0!==a?a:""};e.post({url:HCaptchaFormsObject.ajaxUrl,data:i,beforeSend:function(){return hCaptchaSettingsBase.showSuccessMessage(HCaptchaListPageBaseObject.DoingBulk)}}).done((function(e){e.success?window.location.reload():hCaptchaSettingsBase.showErrorMessage(e.data)})).fail((function(e){hCaptchaSettingsBase.showErrorMessage(e.statusText)}))}else hCaptchaSettingsBase.showErrorMessage(HCaptchaListPageBaseObject.noItems)}else hCaptchaSettingsBase.showErrorMessage(HCaptchaListPageBaseObject.noAction)}))};window.hCaptchaForms=e,jQuery(document).ready(e)})(); -
hcaptcha-for-forms-and-more/tags/4.11.0/assets/js/settings-base.js
r3233179 r3248039 136 136 137 137 setHeaderBarTop(); 138 139 138 highLight(); 140 139 -
hcaptcha-for-forms-and-more/tags/4.11.0/assets/js/settings-list-page-base.js
r3233179 r3248039 1 1 /* global HCaptchaListPageBaseObject, flatpickr */ 2 2 3 /** 4 * @param flatpickr.l10ns 5 */ 6 document.addEventListener( 'DOMContentLoaded', function() { 3 const settingsListPagePage = ( function() { 4 /** 5 * @param flatpickr.l10ns 6 */ 7 7 8 /** 8 9 * @type {HTMLInputElement} … … 87 88 selectorElement.setAttribute( 88 89 'aria-expanded', 89 selectorElement.style.display === 'block' ? 'true' : 'false' 90 selectorElement.style.display === 'block' ? 'true' : 'false', 90 91 ); 91 92 } … … 222 223 } 223 224 225 /** 226 * Public properties and functions. 227 */ 228 const app = {}; 229 224 230 bindEvents(); 225 231 initFlatPicker(); 232 233 return app; 226 234 } ); 235 236 window.hCaptchaSettingsListPagePage = settingsListPagePage; 237 238 document.addEventListener( 'DOMContentLoaded', settingsListPagePage ); -
hcaptcha-for-forms-and-more/tags/4.11.0/assets/js/settings-list-page-base.min.js
r3233179 r3248039 1 (()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(e){for(var n=1;n<arguments.length;n++){var a=null!=arguments[n]?arguments[n]:{};n%2?t(Object(a),!0).forEach((function(t){r(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):t(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function r(t,n,r){return(n=function(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var a=r.call(t,n||"default");if("object"!=e(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}(n))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t} document.addEventListener("DOMContentLoaded",(function(){var e=document.getElementById("hcaptcha-datepicker");if(e){var t,r,a="hcaptcha-is-selected",o=HCaptchaListPageBaseObject.delimiter,c=HCaptchaListPageBaseObject.locale,i=document.getElementById("hcaptcha-options"),l=document.querySelector(".hcaptcha-filter"),u=document.getElementById("hcaptcha-datepicker-popover-button"),p=l.querySelector('input[type="radio"][data-default]');document.addEventListener("click",f),i.querySelector("#hcaptcha-datepicker-popover-button").addEventListener("click",d),i.querySelectorAll('[type="radio"]').forEach((function(e){e.addEventListener("change",v)})),i.querySelector('[type="reset"]').addEventListener("click",b),i.addEventListener("submit",s),i.querySelector("#current-page-selector").addEventListener("keydown",y),r=l.querySelector('input[value="custom"]'),t=flatpickr(e,{mode:"range",inline:!0,allowInput:!1,enableTime:!1,clickOpens:!1,altInput:!0,altFormat:"M j, Y",dateFormat:"Y-m-d",locale:n(n({},flatpickr.l10ns[c]||{}),{},{rangeSeparator:o}),onChange:function(e,t,n){r.checked=!0,m(r.parentElement),t&&(u.textContent=n.altInput.value)}}),v({},r.checked)}function s(t){var n;t.preventDefault(),this.querySelectorAll('input[type="radio"]').forEach((function(e){e.name=""})),(n=u.nextElementSibling).setAttribute("aria-expanded","false"),n.style.display="none";var r=new URL(window.location.href),a=r.searchParams;a.delete("date"),e.value&&a.append("date",e.value),window.location.href=r.toString()}function d(e){e.preventDefault(),e.stopPropagation();var t=e.target.nextElementSibling;"none"===t.style.display||""===t.style.display?t.style.display="block":t.style.display="none",t.setAttribute("aria-expanded","block"===t.style.display?"true":"false")}function y(e){if("Enter"===e.key){e.preventDefault();var t=new URL(window.location.href),n=parseInt(t.searchParams.get("paged")),r=parseInt(e.target.value);(isNaN(n)||n<1)&&(n=1),isNaN(r)||r<1||(t.searchParams.delete("paged"),r!==n&&(t.searchParams.set("paged",r.toString()),window.location.href=t.href))}}function f(e){var t=document.querySelector(".hcaptcha-datepicker-popover");t.contains(e.target)||(t.style.display="none")}function m(e){l.querySelectorAll("label").forEach((function(e){e.classList.remove(a)})),e.classList.add(a)}function b(e){e.preventDefault(),p.checked=!0,v()}function v(){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=l.querySelector("input:checked"),a=r.parentElement,c=n?e:r,i=c.value.split(o),p=c.nextElementSibling;u.textContent=n?p.value:a.textContent,m(a),Array.isArray(i)&&2===i.length?t.setDate(i):t.clear()}}))})();1 (()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(e){for(var n=1;n<arguments.length;n++){var a=null!=arguments[n]?arguments[n]:{};n%2?t(Object(a),!0).forEach((function(t){r(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):t(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function r(t,n,r){return(n=function(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var a=r.call(t,n||"default");if("object"!=e(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}(n))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}var a=function(){var e=document.getElementById("hcaptcha-datepicker");if(e){var t,r,a="hcaptcha-is-selected",o=HCaptchaListPageBaseObject.delimiter,c=HCaptchaListPageBaseObject.locale,i=document.getElementById("hcaptcha-options"),l=document.querySelector(".hcaptcha-filter"),u=document.getElementById("hcaptcha-datepicker-popover-button"),p=l.querySelector('input[type="radio"][data-default]');return document.addEventListener("click",f),i.querySelector("#hcaptcha-datepicker-popover-button").addEventListener("click",d),i.querySelectorAll('[type="radio"]').forEach((function(e){e.addEventListener("change",b)})),i.querySelector('[type="reset"]').addEventListener("click",v),i.addEventListener("submit",s),i.querySelector("#current-page-selector").addEventListener("keydown",y),r=l.querySelector('input[value="custom"]'),t=flatpickr(e,{mode:"range",inline:!0,allowInput:!1,enableTime:!1,clickOpens:!1,altInput:!0,altFormat:"M j, Y",dateFormat:"Y-m-d",locale:n(n({},flatpickr.l10ns[c]||{}),{},{rangeSeparator:o}),onChange:function(e,t,n){r.checked=!0,m(r.parentElement),t&&(u.textContent=n.altInput.value)}}),b({},r.checked),{}}function s(t){var n;t.preventDefault(),this.querySelectorAll('input[type="radio"]').forEach((function(e){e.name=""})),(n=u.nextElementSibling).setAttribute("aria-expanded","false"),n.style.display="none";var r=new URL(window.location.href),a=r.searchParams;a.delete("date"),e.value&&a.append("date",e.value),window.location.href=r.toString()}function d(e){e.preventDefault(),e.stopPropagation();var t=e.target.nextElementSibling;"none"===t.style.display||""===t.style.display?t.style.display="block":t.style.display="none",t.setAttribute("aria-expanded","block"===t.style.display?"true":"false")}function y(e){if("Enter"===e.key){e.preventDefault();var t=new URL(window.location.href),n=parseInt(t.searchParams.get("paged")),r=parseInt(e.target.value);(isNaN(n)||n<1)&&(n=1),isNaN(r)||r<1||(t.searchParams.delete("paged"),r!==n&&(t.searchParams.set("paged",r.toString()),window.location.href=t.href))}}function f(e){var t=document.querySelector(".hcaptcha-datepicker-popover");t.contains(e.target)||(t.style.display="none")}function m(e){l.querySelectorAll("label").forEach((function(e){e.classList.remove(a)})),e.classList.add(a)}function v(e){e.preventDefault(),p.checked=!0,b()}function b(){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=l.querySelector("input:checked"),a=r.parentElement,c=n?e:r,i=c.value.split(o),p=c.nextElementSibling;u.textContent=n?p.value:a.textContent,m(a),Array.isArray(i)&&2===i.length?t.setDate(i):t.clear()}};window.hCaptchaSettingsListPagePage=a,document.addEventListener("DOMContentLoaded",a)})(); -
hcaptcha-for-forms-and-more/tags/4.11.0/changelog.txt
r3233179 r3248039 1 = 4.11.0 = 2 * Added Really Simple CAPTCHA plugin integration. 3 * Added compatibility with the UsersWP plugin v1.2.28. 4 * Added compatibility with Perfmatters plugin. 5 * Added support for the Fluent Login form. 6 * Added confirmation messages upon deletion of events on the Forms and Events pages. 7 * Added asynchronous migrations for large databases. 8 * Added hCaptcha error messages to the Contact Form 7 when JavaScript is disabled. 9 * Optimized Forms page performance for large databases with millions of entries. 10 * Fixed processing wpDiscuz comment form with wpDiscuz custom ajax. 11 * Fixed adding hCaptcha internal fields to Avada from submission. 12 * Fixed ASC ordering by date on the Events page. 13 * Fixed selection of a time interval on the Events page when site local time was not GMT. 14 * Fixed losing options during plugin update in rare cases. 15 * Fixed the live hCaptcha tag on the Contact Form 7 edit page after insertion but before saving the form. 16 * Fixed shortcode processing in the Contact Form 7 form when Auto-Add was off. 17 * Fixed error on theme installation. 18 * Tested with WooCommerce 9.7. 19 1 20 = 4.10.0 = 2 21 * Added support for wp_login_form() function and LoginOut block. … … 219 238 * Fixed Content Security Policy headers processing. 220 239 240 = 3.10.1 = 241 * Added filter `hcap_add_csp_headers` to allow adding Content Security Policy headers. 242 * Fixed Content Security Policy headers processing. 243 221 244 = 3.10.0 = 222 245 * Tested with WordPress 6.5. … … 276 299 * Added optional Enterprise settings. 277 300 * Fixed improper display of the "rate plugin" message on options.php. 278 * Fixed colored border of hCaptcha challenge arrow.301 * Fixed the colored border of hCaptcha challenge arrow. 279 302 280 303 = 3.6.0 = … … 300 323 * Added hCaptcha field to Ninja Forms admin editor. 301 324 * Added invisible hCaptcha support for Ninja Forms. 302 * Added the ability to process customized Mail Chimp forms.325 * Added the ability to process customized Mailchimp forms. 303 326 * Added HTML Forms integration. 304 327 * Added the Auto Theme option to follow light/dark theme settings on site. … … 359 382 360 383 = 3.3.0 = 361 * Color scheme inadmin UI has been updated.384 * The color scheme in the admin UI has been updated. 362 385 * Added compatibility with Passster. 363 386 * Added compatibility with Theme My Login. -
hcaptcha-for-forms-and-more/tags/4.11.0/hcaptcha.php
r3233179 r3248039 11 11 * Plugin URI: https://www.hcaptcha.com/ 12 12 * Description: hCaptcha keeps out bots and spam while putting privacy first. It is a drop-in replacement for reCAPTCHA. 13 * Version: 4.1 0.013 * Version: 4.11.0 14 14 * Requires at least: 5.3 15 15 * Requires PHP: 7.2 … … 22 22 * 23 23 * WC requires at least: 3.0 24 * WC tested up to: 9. 624 * WC tested up to: 9.7 25 25 */ 26 26 … … 40 40 * Plugin version. 41 41 */ 42 const HCAPTCHA_VERSION = '4.1 0.0';42 const HCAPTCHA_VERSION = '4.11.0'; 43 43 44 44 /** -
hcaptcha-for-forms-and-more/tags/4.11.0/readme.txt
r3233179 r3248039 5 5 Tested up to: 6.7 6 6 Requires PHP: 7.2 7 Stable tag: 4.1 0.07 Stable tag: 4.11.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 35 35 * **Logged-in Users:** Optionally turn off hCaptcha for logged-in users. 36 36 * **Delayed API Loading:** Load the hCaptcha API instantly or on user interaction for zero page load impact. 37 * ** White List IPs:** Whitelist certain IPs to skip hCaptcha verification.37 * **Allowlist IPs:** Allowlist certain IPs to skip hCaptcha verification. 38 38 * **Multisite Support:** Sync hCaptcha settings across a Multisite Network. 39 39 … … 59 59 The purpose of a CAPTCHA is to distinguish between people and machines via a challenge-response test, and thus increase the cost of spamming or otherwise abusing websites by keeping out bots. 60 60 61 To use this plugin, install it and enter your sitekey and secret in the Settings ->hCaptcha menu after signing up on hCaptcha.com.61 To use this plugin, install it and enter your sitekey and secret in the Settings → hCaptcha menu after signing up on hCaptcha.com. 62 62 63 63 [hCaptcha Free](https://www.hcaptcha.com/) lets websites block bots and other forms of abuse via humanity challenges. … … 88 88 1. Install hCaptcha either via the WordPress.org plugin repository (best) or by uploading the files to your server. ([Upload instructions](https://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/)) 89 89 2. Activate the hCaptcha plugin on the 'Plugins' admin page 90 3. Enter your site key and secret on the Settings ->hCaptcha->General page91 4. Enable desired Integrations on the Settings ->hCaptcha->Integrations page90 3. Enter your site key and secret on the Settings→hCaptcha→General page 91 4. Enable desired Integrations on the Settings→hCaptcha→Integrations page 92 92 93 93 == Frequently Asked Questions == … … 115 115 ` 116 116 117 The shortcode adds not only the hCaptcha div to the form ,but also a nonce field. You can set your own nonce action and name. For this, use arguments in the shortcode:117 The shortcode adds not only the hCaptcha div to the form but also a nonce field. You can set your own nonce action and name. For this, use arguments in the shortcode: 118 118 119 119 ` … … 398 398 } 399 399 400 // Turn off protection for Gravity form with id = 1.400 // Turn off protection for a Gravity form with id = 1. 401 401 return false; 402 402 } … … 449 449 ` 450 450 451 = How to whitelist certain IPs =451 = How to allowlist certain IPs = 452 452 453 453 You can use the following filter. It should be added to your plugin's (or mu-plugin's) main file. This filter won't work being added to a theme's functions.php file. … … 455 455 ` 456 456 /** 457 * Filter user IP to check if it is whitelisted.458 * For whitelisted IPs, hCaptcha will not be shown.457 * Filter user IP to check if it is allowlisted. 458 * For allowlisted IPs, hCaptcha will not be shown. 459 459 * 460 * @param bool $ whitelisted Whether IP is whitelisted.460 * @param bool $allowlisted Whether IP is allowlisted. 461 461 * @param string $ip IP. 462 462 * 463 463 * @return bool 464 464 */ 465 function my_hcap_ whitelist_ip( $whitelisted, $ip ) {466 467 // Whitelist local IPs.465 function my_hcap_allowlist_ip( $allowlisted, $ip ) { 466 467 // Allowlist local IPs. 468 468 if ( false === $ip ) { 469 469 return true; 470 470 } 471 471 472 // Whitelist some other IPs.472 // Allowlist some other IPs. 473 473 if ( '1.1.1.1' === $ip ) { 474 474 return true; 475 475 } 476 476 477 return $ whitelisted;477 return $allowlisted; 478 478 } 479 479 480 add_filter( 'hcap_whitelist_ip', 'my_hcap_ whitelist_ip', 10, 2 );480 add_filter( 'hcap_whitelist_ip', 'my_hcap_allowlist_ip', 10, 2 ); 481 481 ` 482 482 … … 568 568 * Essential Blocks Form 569 569 * Extra Comment, Contact, Email Optin and Login Forms 570 * Fluent Forms 570 * Fluent Forms, including Login Form 571 571 * Forminator Forms 572 572 * Formidable Forms … … 587 587 * Passster Protection Form 588 588 * Profile Builder Login, Recover Password, and Register Forms 589 * Really Simple CAPTCHA 589 590 * Quform Forms 590 591 * Sendinblue Form … … 616 617 [open a pull request](https://github.com/hCaptcha/hcaptcha-wordpress-plugin). 617 618 618 We also suggest emailing the authors of plugins you'd like to support hCaptcha: it will usually take them only an hour or two to add native support. This will simplify your use of hCaptcha ,and is the best solution in the long run.619 We also suggest emailing the authors of plugins you'd like to support hCaptcha: it will usually take them only an hour or two to add native support. This will simplify your use of hCaptcha and is the best solution in the long run. 619 620 620 621 You may use native hCaptcha support if available for your plugin. Please check with your plugin author if native support is not yet available. … … 627 628 628 629 == Changelog == 630 631 = 4.11.0 = 632 * Added Really Simple CAPTCHA plugin integration. 633 * Added compatibility with the UsersWP plugin v1.2.28. 634 * Added compatibility with Perfmatters plugin. 635 * Added support for the Fluent Login form. 636 * Added confirmation messages upon deletion of events on the Forms and Events pages. 637 * Added asynchronous migrations for large databases. 638 * Added hCaptcha error messages to the Contact Form 7 when JavaScript is disabled. 639 * Optimized Forms page performance for large databases with millions of entries. 640 * Fixed processing wpDiscuz comment form with wpDiscuz custom ajax. 641 * Fixed adding hCaptcha internal fields to Avada from submission. 642 * Fixed ASC ordering by date on the Events page. 643 * Fixed selection of a time interval on the Events page when site local time was not GMT. 644 * Fixed losing options during plugin update in rare cases. 645 * Fixed the live hCaptcha tag on the Contact Form 7 edit page after insertion but before saving the form. 646 * Fixed shortcode processing in the Contact Form 7 form when Auto-Add was off. 647 * Fixed error on theme installation. 648 * Tested with WooCommerce 9.7. 629 649 630 650 = 4.10.0 = … … 637 657 * Added deletion of events on the Events page. 638 658 * Improved error messaging for hCaptcha verification. 639 * Fixed IP detection in the WordPress core via filter. Now syncs with hCaptcha event information when IP collection is activated.659 * Fixed IP detection in the WordPress core via filter. Now syncs with hCaptcha event information when an IP collection is activated. 640 660 * Fixed fatal error with the WPForms plugin in rare cases. 641 661 * Fixed error message at the first entry to the login page when Hide Login Errors in on. … … 653 673 * Added the ability to install plugins and themes from the Integrations page. 654 674 * Added ability to hide the login errors. 655 * Added an onymous collection of IP and User Agent data in locally stored analytics to simplify GDPR compliance.675 * Added an anonymous collection of IP and User Agent data in locally stored analytics to simplify GDPR compliance. 656 676 * Added extended info about IP address on the Events page on hover. 657 677 * Added selecting any page on Forms and Events. … … 660 680 * Fixed fatal error as a consequence of a bug in the TutorLMS. 661 681 * Fixed help text box layout on the General page. 662 * Fixed dismiss and reset Notifications actions.682 * Fixed the dismiss and reset Notifications actions. 663 683 * Fixed duplication of entries in the Events table. 664 684 … … 672 692 * Added 'theme' badge to themes on the Integrations page. 673 693 * Updated hCaptcha API error codes. 674 * Fixed processing of Divi form with diacritical marks.694 * Fixed processing of a Divi form with diacritical marks. 675 695 * Fixed deactivating of all themes by Ctrl+Click on the Integrations page. 676 696 * Fixed theme name display upon activation. … … 693 713 * Added compatibility with Akismet tag in Contact Form 7. 694 714 * Added compatibility with Elementor Element Caching. 695 * Added activation and deactivation of plugin snetwork wide if hCaptcha is set network wide.715 * Added activation and deactivation of plugin network wide if hCaptcha is set network wide. 696 716 * Added ability to use shortcode in the Jetpack Classic form. 697 717 * Added ability to use shortcode in the Mailchimp for WP form. … … 733 753 * Fixed error messaging when there are several Jetpack forms on the same page. 734 754 * Fixed unconditional forcing hCaptcha in Jetpack forms. 735 * Fixed appearance of Beaver Builder editor with "Turn Off When Logged In" setting.736 * Fixed appearance of Contact Form 7 editor with "Turn Off When Logged In" setting.737 * Fixed appearance of Essential Addons editor with "Turn Off When Logged In" setting.738 * Fixed appearance of Gravity Forms editor with "Turn Off When Logged In" setting.739 * Fixed appearance of Fluent Forms editor with "Turn Off When Logged In" setting.740 * Fixed appearance of Forminator editor with "Turn Off When Logged In" setting.741 * Fixed appearance of Formidable Forms with "Turn Off When Logged In" setting.742 * Fixed appearance of Ninja Forms editor with "Turn Off When Logged In" setting.743 * Fixed appearance of WPForms editor with "Turn Off When Logged In" setting.755 * Fixed the appearance of Beaver Builder editor with "Turn Off When Logged In" setting. 756 * Fixed the appearance of Contact Form 7 editor with "Turn Off When Logged In" setting. 757 * Fixed the appearance of Essential Addons editor with "Turn Off When Logged In" setting. 758 * Fixed the appearance of Gravity Forms editor with "Turn Off When Logged In" setting. 759 * Fixed the appearance of Fluent Forms editor with "Turn Off When Logged In" setting. 760 * Fixed the appearance of Forminator editor with "Turn Off When Logged In" setting. 761 * Fixed the appearance of Formidable Forms with "Turn Off When Logged In" setting. 762 * Fixed the appearance of Ninja Forms editor with "Turn Off When Logged In" setting. 763 * Fixed the appearance of WPForms editor with "Turn Off When Logged In" setting. 744 764 * Fixed fatal error on Gravity Forms Entries page. 745 765 * Fixed Elementor preview. … … 844 864 * Tested with WooCommerce 8.7. 845 865 846 = 3.10.1 =847 * Added filter `hcap_add_csp_headers` to allow adding Content Security Policy headers.848 * Fixed Content Security Policy headers processing.849 850 = 3.10.0 =851 * Tested with WordPress 6.5.852 * Tested with WooCommerce 8.6.853 * The minimum required WordPress version is now 5.1.854 * Added Force hCaptcha check before submit feature.855 * Added Elementor Pro Login integration.856 * Added Login/Signup Popup integration.857 * Added CoBlocks integration.858 * Added Enterprise parameters to the System Info page.859 * Added checking of Enterprise parameters before saving.860 * Improved translation on Settings pages.861 * Improved error reporting for Active hCaptcha on the General page.862 * Fixed hCaptcha error codes table.863 * Fixed Settings pages layout with Chrome 122.864 * Fixed Content Security Policy headers.865 * Fixed fatal error with Formidable Forms 6.8.2.866 867 = 3.9.0 =868 * Added Spectra — WordPress Gutenberg Blocks integration.869 * Added Akismet integration.870 * Added test of hCaptcha completion before checking the site config.871 * Added site config check upon changing Enterprise params.872 * Added auto verify feature for forms in widgets.873 * Fixed site config check upon changing site and secret keys.874 * Fixed the list of themes after activation on the Integrations page.875 * Fixed jumping WooCommerce checkout page to hCaptcha on a page load.876 * Fixed missing hCaptcha on the Divi Comment Form.877 878 = 3.8.1 =879 * Fixed activation and deactivation of plugin and themes on the Integrations page.880 881 = 3.8.0 =882 * Added search of plugin and themes on the Integrations page.883 * Added toggling of sections on the General page.884 * Added new dialog on activation and deactivation of plugin and themes.885 * Added selection of a new theme on deactivation of the current one.886 * Added 'backend' to optional Enterprise settings.887 * Added filter `hcap_api_host`, allowing to filter the API host.888 * Added filter `hcap_api_src`, allowing to filter the API source url with params.889 * Updated integration with Back In Stock Notifier.890 * Fixed Brevo (formerly Sendinblue) plugin position on Integrations page.891 * Fixed testing config with test accounts.892 * Fixed saving Notification state.893 * Fixed compatibility of Ninja Forms with GeoDirectory.894 * Fixed compatibility of Beaver Builder with GeoDirectory.895 * Fixed compatibility of Divi with GeoDirectory.896 * Fixed compatibility of MailPoet with GeoDirectory.897 * Fixed compatibility of Passster with GeoDirectory.898 * Fixed styles of Settings pages on mobile.899 900 = 3.7.1 =901 * Fixed adding arguments to api.js for Enterprise accounts.902 903 = 3.7.0 =904 * Tested with WooCommerce 8.5.905 * Added optional Enterprise settings.906 * Fixed improper display of the "rate plugin" message on options.php.907 * Fixed colored border of hCaptcha challenge arrow.908 909 = 3.6.0 =910 * Tested with WooCommerce 8.4.911 * Added compatibility with BuddyPress 12.0.912 * Added hCaptcha tag to Contact Form 7 Admin Editor.913 * Added support for WPForms embedded forms.914 * Added Affiliates Login Form integration.915 * Added Affiliates Register Form integration.916 * Improved login forms security.917 * Improved inline scripts to optimize page load time.918 * Improved Integrations settings page - the Save Changes button moved up for better user experience.919 * Fixed hCaptcha position in BuddyPress.920 * Fixed hCaptcha position in wpDiscuz.921 * Fixed fatal error in Brizy integration.922 * Fixed auto-detection of hCaptcha language.923 * Fixed and added some translations.924 925 = 3.5.0 =926 * Tested with PHP 8.3.927 * Tested with WooCommerce 8.3.928 * Added hCaptcha field to Gravity Forms admin editor.929 * Added hCaptcha field to Ninja Forms admin editor.930 * Added invisible hCaptcha support for Ninja Forms.931 * Added the ability to process customized Mailchimp forms.932 * Added HTML Forms integration.933 * Added the Auto Theme option to follow light/dark theme settings on site.934 * Added support for WP Twenty Twenty-One theme dark mode.935 * Added support for WP Dark Mode plugin.936 * Added support for Droit Dark Mode plugin.937 * Added ability to activate/deactivate themes from the Integrations settings page.938 * Fixed loading of local .mo files.939 * Fixed inability to send Divi Contact Form.940 * Fixed MailPoet issues in admin.941 942 = 3.4.1 =943 * Tested with WordPress 6.4.944 * Tested with WooCommerce 8.2.945 * Added MailPoet integration.946 * Added Simple Download Monitor integration.947 * Added WP Job Openings integration.948 * Added Simple Basic Contact Form integration.949 * Added Easy Digital Downloads Login Form integration.950 * Added Easy Digital Downloads Lost Password Form integration.951 * Added Easy Digital Downloads Register Form integration.952 * Added purging of old failed login data to keep the `hcaptcha_login_data` option size small.953 * Fixed compatibility with HPOS in WooCommerce.954 * Fixed fatal error caused by broken backward compatibility in the Ultimate Member 2.7.0.955 * Fixed SystemInfo on multisite.956 * Fixed the missing dependency of WooCommerce checkout script.957 * Fixed fatal error occurred during login under some conditions.958 * Fixed the inability to send the Divi Contact Form when Divi Email Optin was active.959 960 = 3.3.3 =961 * Added compatibility with LearnDash.962 * Added requirement to check the site config after changes in credentials.963 * Added filter `hcap_login_limit_exceeded`, allowing to filter the login limit exceeded status.964 * Changed Brevo (formerly Sendinblue) logo.965 * Fixed activation of hCaptcha with empty keys.966 * Fixed autocomplete of the Site Key field by LastPass.967 * Fixed form detection for Auto-Verify.968 * Fixed Brevo form working in the post content only.969 * Fixed hCaptcha not loading correctly for a Brevo form.970 * Fixed Passster form working in the post content only.971 * Fixed LearnDash form working in the post content only.972 * Fixed auto-verify form not working on the homepage.973 974 = 3.3.2 =975 * Improved Beaver Builder login sequence.976 * Improved Classified Listing login sequence.977 * Improved Divi login sequence.978 * Improved MemberPress login sequence.979 * Improved Paid Membership Pro login sequence.980 * Improved Profile Builder login sequence.981 * Improved Ultimate Member login sequence.982 * Improved Wordfence login sequence.983 * Improved native WordPress login sequence.984 * Fixed login error when WP Login form option was `'on'` and WC Login form option was `'off'`.985 * Fixed compatibility with WPS Hide Login.986 * Fixed compatibility with All-In-One Security.987 * Fixed compatibility with Rename wp-admin Login.988 989 = 3.3.0 =990 * Color scheme in admin UI has been updated.991 * Added compatibility with Passster.992 * Added compatibility with Theme My Login.993 * Added compatibility with Gravity Perks Nested Forms.994 * Added compatibility with Wordfence Login Security.995 * Added compatibility with Wordfence Security.996 * Added compatibility with UsersWP.997 * Added compatibility with Kadence Advanced Form.998 * Improved support for a Kadence simple form.999 * Replaced deprecated ajaxStop events.1000 * Fixed error on a Classified Listing Login form.1001 * Fixed admin page title.1002 1003 = 3.2.0 =1004 * Tested with WooCommerce 8.0.1005 * Added ability to use hCaptcha field provided by the Fluent Forms plugin.1006 * Added ability to use hCaptcha field provided by the Forminator plugin.1007 * Added ability to use hCaptcha field provided by the Quform plugin.1008 * Added hCaptcha reset to allow sending an Elementor form several times without reloading the page.1009 * Added hCaptcha reset to allow sending a Forminator form several times without reloading the page.1010 * Added hCaptcha reset to allow sending a Quform form several times without reloading the page.1011 * Blocked hCaptcha settings on Fluent Forms admin pages with a notice having a link to the hCaptcha plugin General settings page.1012 * Blocked hCaptcha settings on Forminator admin pages with a notice having a link to the hCaptcha plugin General settings page.1013 * Blocked hCaptcha settings on Quform admin pages with a notice having a link to the hCaptcha plugin General settings page.1014 * Fixed Fluent Forms submit error.1015 * Fixed positioning of hCaptcha in Fluent Form.1016 * Fixed deprecation errors in debug.log that occurred with Fluent Forms.1017 * Fixed Forminator form display error.1018 * Fixed dynamic display of settings in sample hCaptcha.1019 1020 = 3.1.0 =1021 * Added notification system.1022 * Fixed mode selection for sample hCaptcha on the General settings page.1023 1024 = 3.0.1 =1025 * Fixed error on Contact Form 7 validation.1026 * Fixed checkboxes disabled status after activation of a plugin on the Integrations page.1027 1028 = 3.0.0 =1029 * Dropped support for PHP 5.6. The minimum required PHP version is now 7.0.1030 * Tested with WordPress 6.3.1031 * Tested with WooCommerce 7.9.1032 * Added hCaptcha config check to the General settings page.1033 * Added dynamic display of settings in sample hCaptcha.1034 * Added compatibility with Ajax Gravity Forms.1035 * Added compatibility with Profile Builder.1036 * Added compatibility with an Easy Digital Downloads Checkout form.1037 1038 866 [See changelog for all versions](https://plugins.svn.wordpress.org/hcaptcha-for-forms-and-more/trunk/changelog.txt). -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/Admin/Events/Events.php
r3233179 r3248039 21 21 */ 22 22 public const TABLE_NAME = 'hcaptcha_events'; 23 24 /** 25 * Served items limit. 26 */ 27 public const SERVED_LIMIT = 1000; 23 28 24 29 /** … … 131 136 global $wpdb; 132 137 133 $args = wp_parse_args( 134 $args, 135 [ 136 'columns' => [], 137 'offset' => 0, 138 'limit' => 20, 139 'order' => 'ASC', 140 'orderby' => '', 141 'dates' => [], 142 ] 143 ); 144 $args['dates'] = $args['dates'] ?: self::get_default_dates(); 138 $args = self::prepare_args( $args ); 145 139 146 140 $columns = implode( ',', $args['columns'] ); … … 150 144 $where_date_nested = self::get_where_date_gmt_nested( $args ); 151 145 $orderby = self::get_order_by( $args ); 152 $limit = absint( $args['limit'] );146 $limit = $args['limit']; 153 147 154 148 // phpcs:disable WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.PreparedSQL.InterpolatedNotPrepared … … 160 154 WHERE $where_date", 161 155 $wpdb->prepare( 162 "SELECT 163 $columns 156 "SELECT $columns 164 157 FROM $table_name 165 158 WHERE $where_date_nested … … 210 203 global $wpdb; 211 204 212 $args = wp_parse_args( 213 $args, 214 [ 215 'offset' => 0, 216 'limit' => 20, 217 'order' => 'ASC', 218 'orderby' => '', 219 'dates' => [], 220 ] 221 ); 222 $args['dates'] = $args['dates'] ?: self::get_default_dates(); 205 $args = self::prepare_args( $args ); 223 206 224 207 $table_name = $wpdb->prefix . self::TABLE_NAME; 225 208 $where_date = self::get_where_date_gmt( $args ); 226 209 $orderby = self::get_order_by( $args ); 227 $offset = absint( $args['offset'] ); 228 $limit = absint( $args['limit'] ); 229 210 $offset = $args['offset']; 211 $limit = $args['limit']; 212 213 // We need to collect id also to distinguish rows on the Forms page. 230 214 // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching 231 215 $results = (array) $wpdb->get_results( 232 216 $wpdb->prepare( 233 217 // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared 234 "SELECT 235 SQL_CALC_FOUND_ROWS 236 id, source, form_id, COUNT(*) as served 218 "SELECT SQL_CALC_FOUND_ROWS id, source, form_id, COUNT(*) as served 237 219 FROM $table_name 238 220 WHERE $where_date … … 258 240 } 259 241 260 $where = "($where) AND " . $where_date; 242 $where = "($where) AND " . $where_date; 243 $served_limit = self::SERVED_LIMIT; 261 244 262 245 // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching 263 246 $served = (array) $wpdb->get_results( 264 247 // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared 265 "SELECT date_gmt FROM $table_name WHERE $where" 248 "SELECT date_gmt 249 FROM $table_name FORCE INDEX (date_gmt) 250 WHERE $where 251 ORDER BY date_gmt 252 LIMIT $served_limit" 266 253 // phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared 267 254 ); … … 327 314 $dates = $args['dates']; 328 315 329 if ( $dates ) { 330 $dates[1] = $dates[1] ?? $dates[0]; 331 332 $dates[0] .= ' 00:00:00'; 333 $dates[1] .= ' 23:59:59'; 334 335 foreach ( $dates as &$date ) { 336 $date = wp_date( 'Y-m-d H:i:s', strtotime( $date ) ); 337 } 338 339 unset( $date ); 340 341 $where_date = sprintf( 342 "date_gmt BETWEEN '%s' AND '%s'", 343 esc_sql( $dates[0] ), 344 esc_sql( $dates[1] ) 345 ); 346 } else { 347 $where_date = '1=1'; 348 } 349 350 return $where_date; 316 if ( ! $dates ) { 317 return '1=1'; 318 } 319 320 $dates = self::prepare_gmt_dates( $dates ); 321 322 return sprintf( 323 "date_gmt BETWEEN '%s' AND '%s'", 324 esc_sql( $dates[0] ), 325 esc_sql( $dates[1] ) 326 ); 351 327 } 352 328 … … 363 339 $dates = $args['dates']; 364 340 365 if ( $dates ) { 366 $dates[1] = $dates[1] ?? $dates[0]; 367 368 $dates[0] .= ' 00:00:00'; 369 $dates[1] .= ' 23:59:59'; 370 371 foreach ( $dates as &$date ) { 372 $date = wp_date( 'Y-m-d H:i:s', strtotime( $date ) ); 373 } 374 375 unset( $date ); 376 377 $table_name = $wpdb->prefix . self::TABLE_NAME; 378 $offset = absint( $args['offset'] ); 379 380 $where_date = sprintf( 381 "date_gmt BETWEEN '%s' AND '%s' 382 AND date_gmt <= ( 383 SELECT date_gmt 384 FROM %s 385 WHERE date_gmt BETWEEN '%s' AND '%s' 386 ORDER BY date_gmt DESC 387 LIMIT %d, 1 388 ) 389 ", 390 esc_sql( $dates[0] ), 391 esc_sql( $dates[1] ), 392 $table_name, 393 esc_sql( $dates[0] ), 394 esc_sql( $dates[1] ), 395 $offset 396 ); 397 } else { 398 $where_date = '1=1'; 399 } 400 401 return $where_date; 341 if ( ! $dates ) { 342 return '1=1'; 343 } 344 345 $dates = self::prepare_gmt_dates( $dates ); 346 $table_name = $wpdb->prefix . self::TABLE_NAME; 347 $order = $args['order']; 348 $offset = $args['offset']; 349 $compare = 'DESC' === $order ? '<=' : '>='; 350 351 return sprintf( 352 "date_gmt BETWEEN '%s' AND '%s' 353 AND date_gmt %s ( 354 SELECT date_gmt 355 FROM %s 356 WHERE date_gmt BETWEEN '%s' AND '%s' 357 ORDER BY date_gmt %s 358 LIMIT %d, 1 359 ) 360 ", 361 esc_sql( $dates[0] ), 362 esc_sql( $dates[1] ), 363 $compare, 364 $table_name, 365 esc_sql( $dates[0] ), 366 esc_sql( $dates[1] ), 367 $order, 368 $offset 369 ); 370 } 371 372 /** 373 * Prepare dates. 374 * 375 * @param array $dates Dates. 376 * 377 * @return array 378 */ 379 public static function prepare_gmt_dates( array $dates ): array { 380 $dates[1] = $dates[1] ?? $dates[0]; 381 382 $dates[0] .= ' 00:00:00'; 383 $dates[1] .= ' 23:59:59'; 384 385 foreach ( $dates as &$date ) { 386 $date = get_gmt_from_date( $date ); 387 } 388 389 unset( $date ); 390 391 return $dates; 402 392 } 403 393 … … 411 401 private static function get_order_by( array $args ): string { 412 402 $orderby = $args['orderby']; 413 $orderby = 'name' === $orderby ? 'source' : $orderby; 414 $order = strtoupper( $args['order'] ); 403 $order = $args['order']; 415 404 $order = 'ASC' === $order ? '' : $order; 416 405 … … 423 412 * @return array 424 413 */ 425 p rivatestatic function get_default_dates(): array {414 public static function get_default_dates(): array { 426 415 $end_date = date_create_immutable( 'now', wp_timezone() ); 427 416 $start_date = $end_date; … … 495 484 return preg_match( '/^' . $regex . '$/is', $subject ); 496 485 } 486 487 /** 488 * Prepare arguments. 489 * 490 * @param array $args Arguments. 491 * 492 * @return array 493 */ 494 private static function prepare_args( array $args ): array { 495 $args = wp_parse_args( 496 $args, 497 [ 498 'columns' => [], 499 'offset' => 0, 500 'limit' => 20, 501 'order' => 'ASC', 502 'orderby' => '', 503 'dates' => [], 504 ] 505 ); 506 507 $args['columns'] = array_map( 'strtolower', $args['columns'] ); 508 $args['offset'] = absint( $args['offset'] ); 509 $args['limit'] = max( 1, absint( $args['limit'] ) ); 510 $order = strtoupper( $args['order'] ); 511 $args['order'] = in_array( $order, [ 'ASC', 'DESC' ], true ) ? $order : 'ASC'; 512 $orderby = strtolower( $args['orderby'] ); 513 $args['orderby'] = in_array( $orderby, $args['columns'], true ) ? $orderby : ''; 514 $dates = (array) $args['dates']; 515 $args['dates'] = $dates ?: self::get_default_dates(); 516 517 return $args; 518 } 497 519 } -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/Admin/Events/EventsTable.php
r3233179 r3248039 105 105 $orderby = isset( $_GET['orderby'] ) ? sanitize_key( $_GET['orderby'] ) : 'date_gmt'; 106 106 $date = isset( $_GET['date'] ) 107 // We need filter_input here to keep the delimiter intact. 107 108 ? filter_input( INPUT_GET, 'date', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) 108 : ''; // We need filter_input here to keep delimiter intact.109 : ''; 109 110 // phpcs:enable WordPress.Security.NonceVerification.Recommended 110 111 -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/Admin/Events/FormsTable.php
r3233179 r3248039 96 96 $orderby = isset( $_GET['orderby'] ) ? sanitize_key( $_GET['orderby'] ) : 'source'; 97 97 $date = isset( $_GET['date'] ) 98 // We need filter_input here to keep the delimiter intact. 98 99 ? filter_input( INPUT_GET, 'date', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) 99 : ''; // We need filter_input here to keep delimiter intact.100 : ''; 100 101 // phpcs:enable WordPress.Security.NonceVerification.Recommended 101 102 102 $dates = explode( ListPageBase::TIMESPAN_DELIMITER, $date ); 103 $dates = array_filter( array_map( 'trim', $dates ) ); 104 $per_page = $this->get_items_per_page( self::ITEMS_PER_PAGE, $this->per_page_default ); 105 $offset = ( $paged - 1 ) * $per_page; 106 $args = [ 103 $dates = explode( ListPageBase::TIMESPAN_DELIMITER, $date ); 104 $dates = array_filter( array_map( 'trim', $dates ) ); 105 $column_slugs = str_replace( [ 'cb', 'name' ], [ 'id', 'source' ], array_keys( $this->columns ) ); 106 $per_page = $this->get_items_per_page( self::ITEMS_PER_PAGE, $this->per_page_default ); 107 $offset = ( $paged - 1 ) * $per_page; 108 $args = [ 109 'columns' => $column_slugs, 107 110 'offset' => $offset, 108 111 'limit' => $per_page, -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/Affiliates/Login.php
r3114572 r3248039 57 57 */ 58 58 public function print_inline_styles(): void { 59 $css = <<<CSS 59 /* language=CSS */ 60 $css = ' 60 61 .affiliates-dashboard .h-captcha { 61 62 margin-top: 2rem; 62 63 } 63 CSS;64 '; 64 65 65 66 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/Asgaros/Base.php
r3114572 r3248039 104 104 */ 105 105 public function print_inline_styles(): void { 106 $css = <<<CSS 106 /* language=CSS */ 107 $css = ' 107 108 #af-wrapper div.editor-row.editor-row-hcaptcha { 108 109 display: flex; … … 113 114 margin-bottom: 0; 114 115 } 115 CSS;116 '; 116 117 117 118 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/Avada/Form.php
r3114572 r3248039 36 36 public function init_hooks(): void { 37 37 add_action( 'fusion_form_after_open', [ $this, 'form_after_open' ], 10, 2 ); 38 add_filter( 'fusion_builder_form_submission_data', [ $this, 'submission_data' ] ); 38 39 add_action( 'fusion_element_button_content', [ $this, 'add_hcaptcha' ], 10, 2 ); 39 40 add_filter( 'fusion_form_demo_mode', [ $this, 'verify' ] ); … … 51 52 public function form_after_open( array $args, array $params ): void { 52 53 $this->form_id = isset( $params['id'] ) ? (int) $params['id'] : 0; 54 } 55 56 /** 57 * Filter submission data. 58 * 59 * @param array|mixed $data Submission data. 60 * 61 * @return array 62 */ 63 public function submission_data( $data ): array { 64 $data = (array) $data; 65 66 unset( 67 $data['data']['hcaptcha-widget-id'], 68 $data['data']['h-captcha-response'], 69 $data['data']['g-recaptcha-response'] 70 ); 71 72 return $data; 53 73 } 54 74 -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/Brizy/Base.php
r3114572 r3248039 132 132 $style_shown = true; 133 133 134 $css = <<<CSS 134 /* language=CSS */ 135 $css = ' 135 136 .brz-forms2.brz-forms2__item .h-captcha { 136 137 margin-bottom: 0; 137 138 } 138 CSS;139 '; 139 140 140 141 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/BuddyPress/CreateGroup.php
r3114572 r3248039 100 100 */ 101 101 public function print_inline_styles(): void { 102 $css = <<<'CSS' 102 /* language=CSS */ 103 $css = ' 103 104 #buddypress .h-captcha { 104 105 margin-top: 15px; 105 106 } 106 CSS;107 '; 107 108 HCaptcha::css_display( $css ); 108 109 } -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/CF7/Admin.php
r3200161 r3248039 60 60 add_action( 'current_screen', [ $this, 'current_screen' ] ); 61 61 } 62 63 add_filter( 'hcap_print_hcaptcha_scripts', '__return_true' ); 62 64 } 63 65 … … 329 331 } 330 332 333 if ( ! current_user_can( 'edit_posts' ) ) { 334 wp_send_json_error( esc_html__( 'You do not have permission to update the form.', 'hcaptcha-for-forms-and-more' ) ); 335 336 return; // For testing purposes. 337 } 338 331 339 $shortcode = html_entity_decode( filter_input( INPUT_POST, 'shortcode', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) ); 332 340 $form = html_entity_decode( filter_input( INPUT_POST, 'form', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/CF7/CF7.php
r3185570 r3248039 36 36 37 37 /** 38 * Field type. 39 */ 40 public const FIELD_TYPE = 'hcaptcha'; 41 42 /** 38 43 * Init hooks. 39 44 * … … 138 143 $class = $attr['cf7-class'] ?? ''; 139 144 $hcap_form = preg_replace( 140 [ '/(<h-captcha\s+?class="h-captcha")/', '#</h-captcha>#' ], 141 [ '<span id="' . esc_attr( $id ) . '" class="wpcf7-form-control h-captcha ' . esc_attr( $class ) . '"', '</span>' ], 145 [ 146 '/(<h-captcha\s+?class="h-captcha")/', 147 '#</h-captcha>#', 148 ], 149 [ 150 '<span id="' . esc_attr( $id ) . '" class="wpcf7-form-control h-captcha ' . esc_attr( $class ) . '"', 151 '</span>', 152 ], 142 153 $hcap_form 143 154 ); 155 156 $submission = WPCF7_Submission::get_instance(); 157 $hcap_invalid_field = $submission ? $submission->get_invalid_field( 'hcap-cf7' ) : []; 158 $reason = $hcap_invalid_field['reason'] ?? ''; 159 $not_valid_tip = $reason ? '<span class="wpcf7-not-valid-tip" aria-hidden="true">' . $reason . '</span>' : ''; 144 160 145 161 return ( 146 162 '<span class="wpcf7-form-control-wrap" data-name="' . self::DATA_NAME . '">' . 147 163 $hcap_form . 148 '</span>' 164 '</span>' . 165 $not_valid_tip 149 166 ); 150 167 } … … 203 220 if ( 204 221 ! $this->mode_auto && 205 ! ( $this->mode_embed && $this->has_field( $submission, 'hcaptcha') )222 ! ( $this->mode_embed && $this->has_field( $submission, self::FIELD_TYPE ) ) 206 223 ) { 207 224 return $result; … … 228 245 */ 229 246 protected function has_field( WPCF7_Submission $submission, string $type ): bool { 230 $form_fields = $submission->get_contact_form()->scan_form_tags(); 231 232 foreach ( $form_fields as $form_field ) { 233 if ( $type === $form_field->type ) { 234 return true; 247 $has_field = false; 248 $contact_form = $submission->get_contact_form(); 249 250 if ( self::FIELD_TYPE === $type && has_shortcode( $contact_form->form_html(), 'cf7-hcaptcha' ) ) { 251 $has_field = true; 252 } else { 253 $form_fields = $contact_form->scan_form_tags(); 254 255 foreach ( $form_fields as $form_field ) { 256 if ( $type === $form_field->type ) { 257 $has_field = true; 258 } 235 259 } 236 260 } 237 261 238 return false; 262 /** 263 * Filter whether form has a field of given type. 264 * 265 * @param bool $has_field Form has field. 266 */ 267 return apply_filters( 'hcap_cf7_has_field', $has_field, $submission, $type ); 239 268 } 240 269 … … 255 284 $result->invalidate( 256 285 [ 257 'type' => 'hcaptcha',286 'type' => self::FIELD_TYPE, 258 287 'name' => self::DATA_NAME, 259 288 ], … … 292 321 */ 293 322 public function print_inline_styles(): void { 294 $css = <<<CSS 323 /* language=CSS */ 324 $css = ' 295 325 span[data-name="hcap-cf7"] .h-captcha { 296 326 margin-bottom: 0; … … 301 331 margin-top: 2rem; 302 332 } 303 CSS;333 '; 304 334 305 335 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/CoBlocks/Form.php
r3114572 r3248039 203 203 */ 204 204 public function print_inline_styles(): void { 205 $css = <<<CSS 205 /* language=CSS */ 206 $css = ' 206 207 .wp-block-coblocks-form .h-captcha { 207 208 margin-bottom: 25px; 208 209 } 209 CSS;210 '; 210 211 211 212 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/ColorlibCustomizer/Base.php
r3114572 r3248039 11 11 12 12 /** 13 * Class Login13 * Class Base 14 14 */ 15 15 abstract class Base { … … 65 65 66 66 if ( 'normal' === $hcaptcha_size ) { 67 $css = <<<CSS 67 /* language=CSS */ 68 $css = ' 68 69 .ml-container #login { 69 70 min-width: 350px; 70 71 } 71 CSS;72 '; 72 73 } 73 74 -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/ColorlibCustomizer/Login.php
r3021508 r3248039 27 27 case 'compact': 28 28 case 'normal': 29 $css .= <<<CSS 29 /* language=CSS */ 30 $css .= ' 30 31 .ml-container #loginform { 31 32 height: unset; 32 33 } 33 CSS;34 '; 34 35 break; 35 36 case 'invisible': -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/ColorlibCustomizer/LostPassword.php
r3021508 r3248039 27 27 case 'compact': 28 28 case 'normal': 29 $css .= <<<CSS 29 /* language=CSS */ 30 $css .= ' 30 31 .ml-container #lostpasswordform { 31 32 height: unset; 32 33 } 33 CSS;34 '; 34 35 break; 35 36 case 'invisible': -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/ColorlibCustomizer/Register.php
r3021508 r3248039 27 27 case 'compact': 28 28 case 'normal': 29 $css .= <<<CSS 29 /* language=CSS */ 30 $css .= ' 30 31 .ml-container #registerform { 31 32 height: unset; 32 33 } 33 CSS;34 '; 34 35 break; 35 36 case 'invisible': -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/DelayedScript/DelayedScript.php
r3215681 r3248039 19 19 * 20 20 * @param string $js js code to wrap in setTimeout(). 21 * @param int $delay Delay in ms. Negative means no delay, justwait for user interaction.21 * @param int $delay Delay in ms. Negative means no delay, wait for user interaction. 22 22 * 23 23 * @return string … … 25 25 */ 26 26 public static function create( string $js, int $delay = -1 ): string { 27 $js = <<<JS 27 /* language=JS */ 28 $js = " 28 29 ( () => { 29 30 'use strict'; … … 75 76 } ); 76 77 } )(); 77 JS;78 "; 78 79 79 80 return "<script>\n" . HCaptcha::js_minify( $js ) . "\n</script>\n"; … … 84 85 * 85 86 * @param array $args Arguments. 86 * @param int $delay Delay in ms. Negative means no delay, justwait for user interaction.87 * @param int $delay Delay in ms. Negative means no delay, wait for user interaction. 87 88 */ 88 89 public static function launch( array $args, int $delay = -1 ): void { 89 90 unset( $args['id'], $args['async'] ); 90 91 91 $js = <<<JS 92 /* language=JS */ 93 $js = " 92 94 const t = document.getElementsByTagName( 'script' )[0]; 93 95 const s = document.createElement( 'script' ); 94 96 s.type = 'text/javascript'; 95 97 s.id = 'hcaptcha-api'; 96 JS;98 "; 97 99 98 $js = "$js\n";100 $js = trim( $js, " \n\r" ); 99 101 100 102 // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped … … 107 109 } 108 110 109 $js .= "\ t\t\ts['$key'] = '$arg';\n";111 $js .= "\n\t\t\ts['$key'] = '$arg';"; 110 112 } 111 113 112 $js .= <<<JS 114 /* language=JS */ 115 $js .= ' 113 116 s.async = true; 114 117 t.parentNode.insertBefore( s, t ); 115 JS; 118 '; 119 120 $js = trim( $js, " \n\r" ); 116 121 117 122 echo self::create( $js, $delay ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/DownloadManager/DownloadManager.php
r3185570 r3248039 119 119 */ 120 120 public function print_inline_styles(): void { 121 $css = <<<CSS 121 /* language=CSS */ 122 $css = ' 122 123 .wpdm-button-area + .h-captcha { 123 124 margin-bottom: 1rem; … … 128 129 color: #fff !important; 129 130 } 130 CSS;131 '; 131 132 132 133 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/ElementorPro/HCaptchaHandler.php
r3185570 r3248039 498 498 */ 499 499 public function print_inline_styles(): void { 500 $css = <<<CSS 500 /* language=CSS */ 501 $css = ' 501 502 .elementor-field-type-hcaptcha .elementor-field { 502 503 background: transparent !important; … … 506 507 margin-bottom: unset; 507 508 } 508 CSS;509 '; 509 510 510 511 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/ElementorPro/Login.php
r3129246 r3248039 107 107 */ 108 108 public function print_inline_styles(): void { 109 $css = <<<CSS 109 /* language=CSS */ 110 $css = ' 110 111 .elementor-widget-login .h-captcha { 111 112 margin-bottom: 0; 112 113 } 113 CSS;114 '; 114 115 115 116 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/EssentialAddons/Register.php
r3185570 r3248039 90 90 */ 91 91 public function print_inline_styles(): void { 92 $css = <<<CSS 92 /* language=CSS */ 93 $css = ' 93 94 #eael-register-form .h-captcha { 94 95 margin-top: 1rem; 95 96 margin-bottom: 0; 96 97 } 97 CSS;98 '; 98 99 99 100 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/EssentialBlocks/Form.php
r3114572 r3248039 124 124 */ 125 125 public function print_inline_styles(): void { 126 $css = <<<CSS 126 /* language=CSS */ 127 $css = ' 127 128 .wp-block-essential-blocks-form .h-captcha { 128 129 margin: 15px 0 0 0; 129 130 } 130 CSS;131 '; 131 132 132 133 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/FluentForm/Form.php
r3185570 r3248039 15 15 use FluentForm\App\Models\Form as FluentForm; 16 16 use FluentForm\App\Modules\Form\FormFieldsParser; 17 use FluentForm\Framework\Helpers\ArrayHelper; 18 use HCaptcha\Abstracts\LoginBase; 17 19 use HCaptcha\Helpers\HCaptcha; 18 20 use HCaptcha\Main; … … 21 23 /** 22 24 * Class Form 25 * 26 * Can be used as a login form also. 23 27 */ 24 class Form {28 class Form extends LoginBase { 25 29 26 30 /** 27 31 * Nonce action. 28 32 */ 29 pr ivateconst ACTION = 'hcaptcha_fluentform';33 protected const ACTION = 'hcaptcha_fluentform'; 30 34 31 35 /** 32 36 * Nonce name. 33 37 */ 34 pr ivateconst NONCE = 'hcaptcha_fluentform_nonce';38 protected const NONCE = 'hcaptcha_fluentform_nonce'; 35 39 36 40 /** … … 57 61 58 62 /** 59 * Constructor.60 */61 public function __construct() {62 $this->init_hooks();63 }64 65 /**66 63 * Init hooks. 67 64 * 68 65 * @return void 69 66 */ 70 pr ivatefunction init_hooks(): void {67 protected function init_hooks(): void { 71 68 add_filter( 'fluentform/rendering_field_html_hcaptcha', [ $this, 'render_field_hcaptcha' ], 10, 3 ); 72 69 add_action( 'fluentform/render_item_submit_button', [ $this, 'add_hcaptcha' ], 9, 2 ); … … 131 128 */ 132 129 public function verify( array $errors, array $data, FluentForm $form, array $fields ): array { 130 if ( $this->is_login_form( $form ) ) { 131 $email = (string) ArrayHelper::get( $data, 'email' ); 132 $password = (string) ArrayHelper::get( $data, 'password' ); 133 $user = get_user_by( 'email', $email ); 134 135 if ( $user && wp_check_password( $password, $user->user_pass, $user->ID ) ) { 136 $this->login( $email, $user ); 137 } else { 138 $this->login_failed( $email ); 139 } 140 141 if ( ! $this->is_login_limit_exceeded() ) { 142 return $errors; 143 } 144 145 wp_send_json( 146 __( 'Login failed. Please reload the page.', 'hcaptcha-for-forms-and-more' ), 147 423 148 ); 149 150 // For testing purposes. 151 return $errors; 152 } 153 133 154 remove_filter( 'pre_http_request', [ $this, 'pre_http_request' ] ); 134 155 … … 202 223 wp_deregister_script( $fluent_forms_conversational_script ); 203 224 204 $form = $this->get_ captcha();225 $form = $this->get_hcaptcha(); 205 226 $form = str_replace( 206 227 [ … … 307 328 public function fluentform_has_hcaptcha(): bool { 308 329 add_filter( 'pre_http_request', [ $this, 'pre_http_request' ], 10, 3 ); 330 309 331 return false; 310 332 } … … 349 371 */ 350 372 public function print_inline_styles(): void { 351 $css = <<<CSS 373 /* language=CSS */ 374 $css = ' 352 375 .frm-fluent-form .h-captcha { 353 376 line-height: 0; 354 377 margin-bottom: 0; 355 378 } 356 CSS;379 '; 357 380 358 381 HCaptcha::css_display( $css ); … … 368 391 */ 369 392 protected function has_own_hcaptcha( $form ): bool { 370 FormFieldsParser::resetData(); 371 372 if ( FormFieldsParser::hasElement( $form, 'hcaptcha' ) ) { 373 return true; 374 } 375 376 return false; 393 return $this->has_element( $form, 'hcaptcha' ); 377 394 } 378 395 … … 382 399 * @return string 383 400 */ 384 private function get_captcha(): string { 401 protected function get_hcaptcha(): string { 402 $form = FluentForm::find( $this->form_id ); 403 404 if ( $this->is_login_form( $form ) && ! $this->is_login_limit_exceeded() ) { 405 return ''; 406 } 407 385 408 $args = [ 386 409 'action' => self::ACTION, … … 396 419 397 420 /** 421 * Whether the form is a login form. 422 * 423 * @param FluentForm|stdClass $form Form. 424 * 425 * @return bool 426 */ 427 private function is_login_form( $form ): bool { 428 429 return ( 430 has_action( 'fluentform/before_insert_submission' ) && 431 $this->has_element( $form, 'input_email' ) && 432 $this->has_element( $form, 'input_password' ) 433 ); 434 } 435 436 /** 437 * Whether the form has an element. 438 * 439 * @param FluentForm|stdClass $form Form. 440 * @param string $element_name Element name. 441 * 442 * @return bool 443 */ 444 private function has_element( $form, string $element_name ): bool { 445 FormFieldsParser::resetData(); 446 447 return FormFieldsParser::hasElement( $form, $element_name ); 448 } 449 450 /** 398 451 * Get hCaptcha wrapped as Fluent Forms field. 399 452 * … … 403 456 ob_start(); 404 457 458 /* language=HTML */ 405 459 ?> 406 460 <div class="ff-el-group"> … … 409 463 <?php 410 464 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 411 echo $this->get_ captcha();465 echo $this->get_hcaptcha(); 412 466 ?> 413 467 </div> -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/GravityForms/Form.php
r3233179 r3248039 252 252 */ 253 253 public function print_inline_styles(): void { 254 $css = <<<CSS 254 /* language=CSS */ 255 $css = ' 255 256 .gform_previous_button + .h-captcha { 256 257 margin-top: 2rem; … … 285 286 margin: 1em 0 0 0 !important; 286 287 } 287 CSS;288 '; 288 289 289 290 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/HTMLForms/Form.php
r3114572 r3248039 197 197 */ 198 198 public function print_inline_styles(): void { 199 $css = <<<CSS 199 /* language=CSS */ 200 $css = ' 200 201 #form-preview .h-captcha { 201 202 margin-bottom: 2rem; … … 205 206 margin-top: 2rem; 206 207 } 207 CSS;208 '; 208 209 209 210 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/Helpers/HCaptcha.php
r3233179 r3248039 405 405 */ 406 406 public static function css_display( string $css, bool $wrap = true ): void { 407 $css = trim( $css, " \n\r" ); 408 407 409 if ( $wrap ) { 408 410 echo "<style>\n"; … … 425 427 */ 426 428 public static function css_minify( string $css ): string { 429 $css = trim( $css, " \n\r" ); 430 427 431 if ( defined( 'SCRIPT_DEBUG' ) && constant( 'SCRIPT_DEBUG' ) ) { 428 432 return $css; … … 446 450 */ 447 451 public static function js_display( string $js, bool $wrap = true ): void { 452 $js = trim( $js, " \n\r" ); 453 448 454 if ( $wrap ) { 449 455 echo "<script>\n"; … … 466 472 */ 467 473 public static function js_minify( string $js ): string { 474 $js = trim( $js, " \n\r" ); 475 468 476 if ( defined( 'SCRIPT_DEBUG' ) && constant( 'SCRIPT_DEBUG' ) ) { 469 477 return $js; -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/Jetpack/Base.php
r3215681 r3248039 143 143 } 144 144 145 $message = <<< HTML145 $message = ' 146 146 <div class="contact-form__input-error"> 147 147 <span class="contact-form__warning-icon"> … … 149 149 <i aria-hidden="true"></i> 150 150 </span> 151 <span> $this->error_message</span>151 <span>' . $this->error_message . '</span> 152 152 </div> 153 HTML;153 '; 154 154 155 155 return $hcaptcha . $message; … … 201 201 */ 202 202 public function print_inline_styles(): void { 203 $css = <<<CSS 203 /* language=CSS */ 204 $css = ' 204 205 form.contact-form .grunion-field-hcaptcha-wrap.grunion-field-wrap { 205 206 flex-direction: row !important; … … 210 211 margin-bottom: 0; 211 212 } 212 CSS;213 '; 213 214 214 215 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/LearnDash/Register.php
r3215681 r3248039 107 107 */ 108 108 public function print_inline_styles(): void { 109 $css = <<<CSS 109 /* language=CSS */ 110 $css = ' 110 111 #learndash_registerform .h-captcha { 111 112 margin-bottom: 0; 112 113 } 113 CSS;114 '; 114 115 115 116 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/LoginSignupPopup/Login.php
r3114572 r3248039 120 120 */ 121 121 public function print_inline_styles(): void { 122 $css = <<<CSS 122 /* language=CSS */ 123 $css = ' 123 124 .xoo-el-form-container div[data-section="login"] .h-captcha { 124 125 margin-bottom: 25px; 125 126 } 126 CSS;127 '; 127 128 128 129 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/LoginSignupPopup/Register.php
r3114572 r3248039 141 141 */ 142 142 public function print_inline_styles(): void { 143 $css = <<<CSS 143 /* language=CSS */ 144 $css = ' 144 145 .xoo-el-form-container div[data-section="register"] .h-captcha { 145 146 margin-bottom: 25px; 146 147 } 147 CSS;148 '; 148 149 149 150 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/Main.php
r3233179 r3248039 20 20 use HCaptcha\CACSP\Compatibility; 21 21 use HCaptcha\CF7\CF7; 22 use HCaptcha\CF7\ReallySimpleCaptcha; 22 23 use HCaptcha\DelayedScript\DelayedScript; 23 24 use HCaptcha\Divi\Fix; … … 190 191 191 192 add_action( 'plugins_loaded', [ $this, 'load_modules' ], self::LOAD_PRIORITY + 1 ); 192 add_filter( 'hcap_whitelist_ip', [ $this, ' whitelist_ip' ], -PHP_INT_MAX, 2 );193 add_filter( 'hcap_whitelist_ip', [ $this, 'allowlist_ip' ], -PHP_INT_MAX, 2 ); 193 194 add_action( 'before_woocommerce_init', [ $this, 'declare_wc_compatibility' ] ); 194 195 … … 252 253 * Do not load hCaptcha functionality: 253 254 * - if a user is logged in and the option 'off_when_logged_in' is set; 254 * - for whitelisted IPs;255 * - for allowlisted IPs; 255 256 * - when the site key or the secret key is empty (after first plugin activation). 256 257 */ … … 258 259 ( is_user_logged_in() && $settings->is_on( 'off_when_logged_in' ) ) || 259 260 /** 260 * Filters the user IP to check whether it is whitelisted.261 * Filters the user IP to check whether it is allowlisted. 261 262 * 262 * @param bool $ whitelisted IP is whitelisted.263 * @param bool $allowlisted IP is allowlisted. 263 264 * @param string|false $ip IP string or false for local addresses. 264 265 */ … … 438 439 * @return void 439 440 * @noinspection CssUnusedSymbol 441 * @noinspection CssUnknownTarget 440 442 */ 441 443 public function print_inline_styles(): void { … … 445 447 $bg = $settings->get_custom_theme_background() ?: 'initial'; 446 448 447 $css = <<<CSS 449 /* language=CSS */ 450 $css = ' 448 451 .h-captcha { 449 452 position: relative; … … 469 472 470 473 .h-captcha::before { 471 content: '';474 content: \'\'; 472 475 display: block; 473 476 position: absolute; 474 477 top: 0; 475 478 left: 0; 476 background: url( $div_logo_url) no-repeat;479 background: url( ' . $div_logo_url . ' ) no-repeat; 477 480 border: 1px solid transparent; 478 481 border-radius: 4px; … … 502 505 html.wp-dark-mode-active .h-captcha[data-theme="auto"]::before, 503 506 html.drdt-dark-mode .h-captcha[data-theme="auto"]::before { 504 background-image: url( $div_logo_white_url);507 background-image: url( ' . $div_logo_white_url . ' ); 505 508 background-repeat: no-repeat; 506 509 background-color: #333; … … 509 512 510 513 .h-captcha[data-theme="custom"]::before { 511 background-color: $bg;514 background-color: ' . $bg . '; 512 515 } 513 516 … … 523 526 border-style: none; 524 527 } 525 CSS;528 '; 526 529 527 530 HCaptcha::css_display( $css ); … … 535 538 */ 536 539 public function login_head(): void { 537 $css = <<<'CSS' 540 /* language=CSS */ 541 $css = ' 538 542 @media (max-width: 349px) { 539 543 .h-captcha { … … 553 557 } 554 558 } 555 CSS;559 '; 556 560 557 561 HCaptcha::css_display( $css ); … … 588 592 $host = preg_replace( '#(http|https)://#', '', $host ); 589 593 590 // We need to add scheme here, otherwise wp_parse_url returns null.594 // We need to add a scheme here, otherwise wp_parse_url returns null. 591 595 $host = (string) wp_parse_url( 'https://' . $host, PHP_URL_HOST ); 592 596 … … 753 757 // @codeCoverageIgnoreStart 754 758 if ( class_exists( FeaturesUtil::class ) ) { 755 FeaturesUtil::declare_compatibility( 'custom_order_tables', constant( 'HCAPTCHA_FILE' ) , true);759 FeaturesUtil::declare_compatibility( 'custom_order_tables', constant( 'HCAPTCHA_FILE' ) ); 756 760 } 757 761 // @codeCoverageIgnoreEnd … … 759 763 760 764 /** 761 * Filter user IP to check if it is whitelisted.762 * For whitelisted IPs, hCaptcha will not be shown.763 * 764 * @param bool|mixed $ whitelisted Whether IP is whitelisted.765 * Filter user IP to check if it is allowlisted. 766 * For allowlisted IPs, hCaptcha will not be shown. 767 * 768 * @param bool|mixed $allowlisted Whether IP is allowlisted. 765 769 * @param string|false $client_ip Client IP. 766 770 * 767 771 * @return bool|mixed 768 772 */ 769 public function whitelist_ip( $whitelisted, $client_ip ) {773 public function allowlist_ip( $allowlisted, $client_ip ) { 770 774 $ips = explode( 771 775 "\n", … … 802 806 } 803 807 804 return $ whitelisted;808 return $allowlisted; 805 809 } 806 810 … … 973 977 [ 'cf7_status', null ], 974 978 'contact-form-7/wp-contact-form-7.php', 975 [ CF7::class, Admin::class ],979 [ CF7::class, Admin::class, ReallySimpleCaptcha::class ], 976 980 ], 977 981 'Cookies and Content Security Policy' => [ … … 1491 1495 /** 1492 1496 * Is plugin active. 1493 * When network wideactivated, check if the plugin is network active.1497 * When network is widely activated, check if the plugin is network active. 1494 1498 * 1495 1499 * @param string $plugin_name Plugin name. -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/Maintenance/Login.php
r3200161 r3248039 122 122 */ 123 123 public function print_inline_styles(): void { 124 $css = <<<CSS 124 /* language=CSS */ 125 $css = ' 125 126 body.maintenance > .login-form-container { 126 127 min-width: 343px; … … 136 137 margin-top: 2em; 137 138 } 138 CSS;139 '; 139 140 140 141 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/Migrations/Migrations.php
r3166267 r3248039 8 8 namespace HCaptcha\Migrations; 9 9 10 use ActionScheduler; 11 use ActionScheduler_Store; 10 12 use HCaptcha\Admin\Events\Events; 11 13 use HCaptcha\Settings\PluginSettingsBase; … … 37 39 38 40 /** 41 * Migration completed status. 42 */ 43 public const COMPLETED = - 3; 44 45 /** 39 46 * Priority of the plugins_loaded action to load Migrations. 40 47 */ … … 45 52 */ 46 53 private const PLUGIN_NAME = 'hCaptcha Plugin'; 54 55 /** 56 * Action Scheduler group name. 57 */ 58 private const AS_GROUP = 'hcaptcha'; 47 59 48 60 /** … … 58 70 * @return void 59 71 */ 60 p ublicfunction init(): void {72 private function init(): void { 61 73 if ( ! $this->is_allowed() ) { 62 74 return; … … 73 85 private function init_hooks(): void { 74 86 add_action( 'plugins_loaded', [ $this, 'migrate' ], self::LOAD_PRIORITY ); 87 add_action( 'plugins_loaded', [ $this, 'load_action_scheduler' ], -10 ); 88 89 add_action( 'async_migrate_4_11_0', [ $this, 'async_migrate_4_11_0' ] ); 90 } 91 92 /** 93 * Load action scheduler. 94 * 95 * @return void 96 */ 97 public function load_action_scheduler(): void { 98 require_once HCAPTCHA_PATH . '/vendor/woocommerce/action-scheduler/action-scheduler.php'; 75 99 } 76 100 … … 88 112 get_class_methods( $this ), 89 113 static function ( $migration ) { 90 return false !== strpos( $migration, 'migrate_' );114 return 0 === strpos( $migration, 'migrate_' ); 91 115 } 92 116 ); … … 141 165 * Determine if migration is allowed. 142 166 */ 143 p ublicfunction is_allowed(): bool {167 private function is_allowed(): bool { 144 168 // phpcs:ignore WordPress.Security.NonceVerification.Recommended 145 169 if ( isset( $_GET['service-worker'] ) ) { … … 148 172 149 173 return ( 150 ( is_admin() && ! wp_doing_ajax()) ||174 is_admin() || 151 175 wp_doing_cron() || 152 176 ( defined( 'WP_CLI' ) && constant( 'WP_CLI' ) ) … … 317 341 } 318 342 319 update_option( PluginSettingsBase::OPTION_NAME, $new_options ); 343 // This two lines is a precaution for a case if options in a new format already exist. 344 $options = get_option( PluginSettingsBase::OPTION_NAME, [] ); 345 $options = array_merge( $new_options, $options ); 346 347 update_option( PluginSettingsBase::OPTION_NAME, $options ); 320 348 321 349 foreach ( array_keys( $options_map ) as $old_option_name ) { … … 384 412 385 413 /** 414 * Migrate to 4.11.0 415 * 416 * @return bool|null 417 * @noinspection PhpUnused 418 */ 419 protected function migrate_4_11_0(): ?bool { 420 return $this->run_async( __FUNCTION__ ); 421 } 422 423 /** 424 * Async migration to 4.11.0. 425 * 426 * @return void 427 */ 428 public function async_migrate_4_11_0(): void { 429 global $wpdb; 430 431 $table_name = $wpdb->prefix . Events::TABLE_NAME; 432 433 // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching 434 // phpcs:disable WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 435 $result = $wpdb->query( 436 "CREATE INDEX idx_date_source_form 437 ON $table_name 438 (date_gmt, source, form_id)" 439 ); 440 441 if ( $result ) { 442 $wpdb->query( "DROP INDEX hcaptcha_id on $table_name" ); 443 } 444 // phpcs:enable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching 445 // phpcs:enable WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 446 447 $this->mark_completed(); 448 } 449 450 /** 386 451 * Save license level in settings. 387 452 * … … 404 469 update_option( PluginSettingsBase::OPTION_NAME, $option ); 405 470 } 471 472 /** 473 * Run async action. 474 * 475 * @param string $method Method name. 476 * @param array $args Arguments. 477 * 478 * @return bool|null 479 * @noinspection PhpSameParameterValueInspection 480 */ 481 private function run_async( string $method, array $args = [] ): ?bool { 482 $hook = 'async_' . $method; 483 $group = self::AS_GROUP; 484 $transient = $group . '_' . $hook; 485 486 $status = (int) get_transient( $transient ); 487 488 if ( self::COMPLETED === $status ) { 489 delete_transient( $transient ); 490 491 return true; 492 } 493 494 if ( ! $status ) { 495 set_transient( $transient, self::STARTED ); 496 } 497 498 add_action( 499 'action_scheduler_init', 500 function () use ( $hook, $args, $group ) { 501 $transient = $group . '_' . $hook; 502 $status = $this->create_as_action( $hook, $args, $group ); 503 504 if ( self::FAILED === $status ) { 505 set_transient( $transient, $status ); 506 } 507 } 508 ); 509 510 return null; 511 } 512 513 /** 514 * Create an AS action. 515 * 516 * @param string $hook Hook name. 517 * @param array $args Hook arguments. 518 * @param string $group Group name. 519 * 520 * @return int Started or failed. 521 */ 522 private function create_as_action( string $hook, array $args, string $group ): int { 523 $actions = as_get_scheduled_actions( 524 [ 525 'hook' => $hook, 526 'args' => $args, 527 'group' => $group, 528 'status' => [ // All statuses except completed. 529 ActionScheduler_Store::STATUS_PENDING, 530 ActionScheduler_Store::STATUS_RUNNING, 531 ActionScheduler_Store::STATUS_FAILED, 532 ActionScheduler_Store::STATUS_CANCELED, 533 ], 534 ] 535 ); 536 537 if ( empty( $actions ) ) { 538 // Plan the unique action. 539 $action_id = as_enqueue_async_action( $hook, $args, $group, true ); 540 541 return $action_id ? self::STARTED : self::FAILED; 542 } 543 544 // Get the last action status. 545 $last_action_id = max( array_map( 'intval', array_keys( $actions ) ) ); 546 $store = ActionScheduler::store(); 547 $status = $store ? $store->get_status( $last_action_id ) : ActionScheduler_Store::STATUS_FAILED; 548 549 $started = in_array( 550 $status, 551 [ 552 ActionScheduler_Store::STATUS_PENDING, 553 ActionScheduler_Store::STATUS_RUNNING, 554 ], 555 true 556 ); 557 558 return $started ? self::STARTED : self::FAILED; 559 } 560 561 /** 562 * Mark async migration as completed. 563 * 564 * @return void 565 */ 566 private function mark_completed(): void { 567 $hook = current_action(); 568 $group = self::AS_GROUP; 569 $transient = $group . '_' . $hook; 570 571 set_transient( $transient, self::COMPLETED ); 572 } 406 573 } -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/Passster/Protect.php
r3185570 r3248039 165 165 */ 166 166 public function print_inline_styles(): void { 167 $css = <<<CSS 167 /* language=CSS */ 168 $css = ' 168 169 .passster-form .h-captcha { 169 170 margin-bottom: 5px; 170 171 } 171 CSS;172 '; 172 173 173 174 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/ProfileBuilder/Login.php
r3233179 r3248039 86 86 */ 87 87 public function print_inline_styles(): void { 88 $css = <<<CSS 88 /* language=CSS */ 89 $css = ' 89 90 #wppb-loginform .h-captcha { 90 91 margin-bottom: 14px; 91 92 } 92 CSS;93 '; 93 94 94 95 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/Settings/Abstracts/SettingsBase.php
r3185570 r3248039 892 892 } 893 893 894 register_setting( $this->option_group(), $this->option_name() ); 894 $args = [ 895 'sanitize_callback' => [ $this, 'sanitize_option_callback' ], 896 ]; 897 898 register_setting( $this->option_group(), $this->option_name(), $args ); 895 899 896 900 /** … … 913 917 ); 914 918 } 919 } 920 921 /** 922 * Filters an option value following sanitization. 923 * 924 * @param array|mixed $value The sanitized option value. 925 * 926 * @return array 927 */ 928 public function sanitize_option_callback( $value ): array { 929 // Remove unexpected settings. 930 $settings = array_intersect_key( (array) $value, $this->form_fields() ); 931 932 foreach ( $settings as $key => $setting ) { 933 $type = $this->form_fields[ $key ]['type']; 934 935 switch ( $type ) { 936 case 'checkbox': 937 $settings[ $key ] = array_map( 'sanitize_text_field', $setting ); 938 break; 939 case 'textarea': 940 $settings[ $key ] = wp_kses_post( $setting ); 941 break; 942 default: 943 $settings[ $key ] = sanitize_text_field( $setting ); 944 } 945 } 946 947 return $settings; 915 948 } 916 949 -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/Settings/EventsPage.php
r3233179 r3248039 8 8 namespace HCaptcha\Settings; 9 9 10 use HCaptcha\Admin\Events\Events; 10 11 use HCaptcha\Admin\Events\EventsTable; 11 12 use HCaptcha\Helpers\DB; … … 56 57 57 58 /** 58 * Init class hooks.59 */60 protected function init_hooks(): void {61 parent::init_hooks();62 63 add_action( 'wp_ajax_' . self::BULK_ACTION, [ $this, 'bulk_action' ] );64 }65 66 /**67 59 * Get page title. 68 60 * … … 108 100 109 101 $this->prepare_chart_data(); 110 }111 112 /**113 * Ajax callback for bulk actions.114 *115 * @return void116 */117 public function bulk_action(): void {118 $this->run_checks( self::BULK_ACTION );119 120 // Nonce is checked by check_ajax_referer() in run_checks().121 // phpcs:disable WordPress.Security.NonceVerification.Missing122 $bulk = isset( $_POST['bulk'] ) ? sanitize_text_field( wp_unslash( $_POST['bulk'] ) ) : '';123 $ids = isset( $_POST['ids'] )124 ? (array) json_decode( sanitize_text_field( wp_unslash( $_POST['ids'] ) ), true )125 : [];126 // phpcs:enable WordPress.Security.NonceVerification.Missing127 128 if ( 'trash' === $bulk ) {129 if ( ! $this->delete_hcaptcha_events( $ids ) ) {130 wp_send_json_error( __( 'Failed to delete the selected items.', 'hcaptcha-for-forms-and-more' ) );131 }132 133 wp_send_json_success();134 135 // For testing purposes.136 return;137 }138 139 wp_send_json_error( __( 'Invalid bulk action.', 'hcaptcha-for-forms-and-more' ) );140 102 } 141 103 … … 174 136 'bulkAction' => self::BULK_ACTION, 175 137 'bulkNonce' => wp_create_nonce( self::BULK_ACTION ), 138 'bulkMessage' => $this->get_clean_transient(), 176 139 'succeed' => $this->succeed, 177 140 'failed' => $this->failed, … … 282 245 * Delete hCaptcha events by IDs. 283 246 * 284 * @param array $ ids Array of event IDs to delete.247 * @param array $args Arguments. 285 248 * 286 249 * @return bool 287 250 */ 288 pr ivate function delete_hcaptcha_events( array $ids ): bool {251 protected function delete_events( array $args ): bool { 289 252 global $wpdb; 290 253 291 $table_name = $wpdb->prefix . 'hcaptcha_events'; 292 293 $in = DB::prepare_in( $ids, '%d' ); 254 $ids = $args['ids'] ?? []; 255 256 $table_name = $wpdb->prefix . Events::TABLE_NAME; 257 $in = DB::prepare_in( $ids, '%d' ); 294 258 295 259 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/Settings/FormsPage.php
r3233179 r3248039 8 8 namespace HCaptcha\Settings; 9 9 10 use HCaptcha\Admin\Events\Events; 10 11 use HCaptcha\Admin\Events\FormsTable; 11 12 use KAGG\Settings\Abstracts\SettingsBase; … … 48 49 49 50 /** 50 * Init class hooks.51 */52 protected function init_hooks(): void {53 parent::init_hooks();54 55 add_action( 'wp_ajax_' . self::BULK_ACTION, [ $this, 'bulk_action' ] );56 }57 58 /**59 51 * Get page title. 60 52 * … … 98 90 99 91 $this->prepare_chart_data(); 100 }101 102 /**103 * Ajax callback for bulk actions.104 *105 * @return void106 */107 public function bulk_action(): void {108 $this->run_checks( self::BULK_ACTION );109 110 // Nonce is checked by check_ajax_referer() in run_checks().111 // phpcs:disable WordPress.Security.NonceVerification.Missing112 $bulk = isset( $_POST['bulk'] ) ? sanitize_text_field( wp_unslash( $_POST['bulk'] ) ) : '';113 $ids = isset( $_POST['ids'] )114 ? (array) json_decode( sanitize_text_field( wp_unslash( $_POST['ids'] ) ), true )115 : [];116 // phpcs:enable WordPress.Security.NonceVerification.Missing117 118 if ( 'trash' === $bulk ) {119 if ( ! $this->delete_hcaptcha_events_by_forms( $ids ) ) {120 wp_send_json_error( __( 'Failed to delete the selected items.', 'hcaptcha-for-forms-and-more' ) );121 }122 123 wp_send_json_success();124 125 // For testing purposes.126 return;127 }128 129 wp_send_json_error( __( 'Invalid bulk action.', 'hcaptcha-for-forms-and-more' ) );130 92 } 131 93 … … 164 126 'bulkAction' => self::BULK_ACTION, 165 127 'bulkNonce' => wp_create_nonce( self::BULK_ACTION ), 128 'bulkMessage' => $this->get_clean_transient(), 166 129 'served' => $this->served, 167 130 'servedLabel' => __( 'Served', 'hcaptcha-for-forms-and-more' ), … … 219 182 </p> 220 183 </canvas> 184 <?php 185 if ( count( $this->list_table->served ) >= Events::SERVED_LIMIT ) { 186 echo '<div id="hcaptcha-chart-message">'; 187 printf( 188 /* translators: 1: Number of elements. */ 189 esc_html__( 'The chart is limited to displaying a maximum of %1$s elements.', 'hcaptcha-for-forms-and-more' ), 190 esc_html( number_format_i18n( Events::SERVED_LIMIT ) ) 191 ); 192 echo '</div>'; 193 } 194 ?> 221 195 </div> 222 196 <div id="hcaptcha-forms-wrap"> … … 257 231 * Delete hCaptcha events by forms. 258 232 * 259 * @param array $ ids Array of event IDs to delete.233 * @param array $args Arguments. 260 234 * 261 235 * @return bool 262 236 */ 263 pr ivate function delete_hcaptcha_events_by_forms( array $ids ): bool {237 protected function delete_events( array $args ): bool { 264 238 global $wpdb; 265 239 266 $table_name = $wpdb->prefix . 'hcaptcha_events'; 240 $ids = $args['ids'] ?? []; 241 $dates = $args['dates'] ?? []; 242 $dates = $dates ?: Events::get_default_dates(); 243 $dates = Events::prepare_gmt_dates( $dates ); 244 245 $table_name = $wpdb->prefix . Events::TABLE_NAME; 267 246 $conditions = []; 268 247 $values = []; 269 248 249 if ( ! $ids ) { 250 return false; 251 } 252 270 253 foreach ( $ids as $item ) { 271 $conditions[] = '(source = %s AND form_id = % d)';254 $conditions[] = '(source = %s AND form_id = %s)'; 272 255 $values[] = $item['source']; 273 256 $values[] = $item['formId']; … … 275 258 276 259 $where_clause = implode( ' OR ', $conditions ); 260 $where_clause = "($where_clause) AND date_gmt BETWEEN %s AND %s"; 277 261 278 262 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching … … 281 265 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare 282 266 "DELETE FROM $table_name WHERE $where_clause", 283 ...$values 267 ...$values, 268 ...$dates 284 269 ) 285 270 ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/Settings/General.php
r3233179 r3248039 535 535 ], 536 536 'whitelisted_ips' => [ 537 'label' => __( ' Whitelisted IPs', 'hcaptcha-for-forms-and-more' ),537 'label' => __( 'Allowlisted IPs', 'hcaptcha-for-forms-and-more' ), 538 538 'type' => 'textarea', 539 539 'section' => self::SECTION_OTHER, -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/Settings/Integrations.php
r3233179 r3248039 16 16 use WP_Filesystem_Base; 17 17 use WP_Theme; 18 use WP_Upgrader;19 18 20 19 /** … … 300 299 'type' => 'checkbox', 301 300 'options' => [ 302 'form' => __( 'Form Auto-Add', 'hcaptcha-for-forms-and-more' ), 303 'embed' => __( 'Form Embed', 'hcaptcha-for-forms-and-more' ), 304 'live' => __( 'Live Form in Admin', 'hcaptcha-for-forms-and-more' ), 301 'form' => __( 'Form Auto-Add', 'hcaptcha-for-forms-and-more' ), 302 'embed' => __( 'Form Embed', 'hcaptcha-for-forms-and-more' ), 303 'live' => __( 'Live Form in Admin', 'hcaptcha-for-forms-and-more' ), 304 'replace_rsc' => __( 'Replace Really Simple CAPTCHA', 'hcaptcha-for-forms-and-more' ), 305 305 ], 306 306 ], … … 1248 1248 */ 1249 1249 protected function maybe_activate_plugin( string $plugin ) { 1250 1251 1250 if ( hcaptcha()->is_plugin_active( $plugin ) ) { 1252 1251 return true; … … 1266 1265 1267 1266 ob_start(); 1268 1269 1267 $result = $this->activate_plugin( $plugin ); 1270 1271 1268 ob_end_clean(); 1272 1269 … … 1282 1279 */ 1283 1280 protected function install_plugin( string $plugin ): ?WP_Error { 1284 1285 1281 $plugin = trim( explode( '/', $plugin )[0] ); 1286 1282 … … 1296 1292 } 1297 1293 1298 require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; 1299 require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; 1294 if ( ! class_exists( 'Plugin_Upgrader', false ) ) { 1295 // @codeCoverageIgnoreStart 1296 require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; 1297 require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; 1298 // @codeCoverageIgnoreEnd 1299 } 1300 1300 1301 1301 $api = plugins_api( … … 1457 1457 * @param string $theme Theme to activate. 1458 1458 * 1459 * @return null|WP_Error Null on success, WP_Error on failure. 1460 */ 1461 protected function activate_theme( string $theme ): ?WP_Error { 1462 if ( ! wp_get_theme( $theme )->exists() ) { 1463 return new WP_Error( 1464 'theme_not_found', 1465 __( 'Theme not found.', 'hcaptcha-for-forms-and-more' ) 1466 ); 1459 * @return null|true|WP_Error Null on success, WP_Error on failure. 1460 */ 1461 protected function activate_theme( string $theme ) { 1462 if ( wp_get_theme()->get_stylesheet() === $theme ) { 1463 return true; 1467 1464 } 1468 1465 … … 1493 1490 * @return null|WP_Error Null on success, WP_Error on failure. 1494 1491 */ 1495 pr ivatefunction install_theme( string $theme ): ?WP_Error {1492 protected function install_theme( string $theme ): ?WP_Error { 1496 1493 $theme = trim( $theme ); 1497 1494 … … 1510 1507 } 1511 1508 1512 require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; 1513 require_once ABSPATH . 'wp-admin/includes/theme.php'; 1509 if ( ! class_exists( 'Theme_Upgrader', false ) ) { 1510 // @codeCoverageIgnoreStart 1511 require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; 1512 require_once ABSPATH . 'wp-admin/includes/theme.php'; 1513 // @codeCoverageIgnoreEnd 1514 } 1514 1515 1515 1516 $api = themes_api( … … 1522 1523 1523 1524 if ( is_wp_error( $api ) ) { 1524 return new WP_Error( $api->get_error_code(), $api->get_error_message() );1525 return $api; 1525 1526 } 1526 1527 … … 1611 1612 * 1612 1613 * @return string 1613 * @noinspection PhpVoidFunctionResultUsedInspection1614 1614 */ 1615 1615 protected function get_default_theme(): string { … … 1678 1678 * Install entity (plugin or theme). 1679 1679 * 1680 * @param WP_Upgrader$upgrader Upgrader instance.1681 * @param WP_Ajax_Upgrader_Skin $skin Upgrader skin instance.1682 * @param string $download_link Download link.1680 * @param Plugin_Upgrader|Theme_Upgrader|object $upgrader Upgrader instance. 1681 * @param WP_Ajax_Upgrader_Skin|object $skin Upgrader skin instance. 1682 * @param string $download_link Download link. 1683 1683 * 1684 1684 * @return WP_Error|null 1685 * @noinspection PhpPossiblePolymorphicInvocationInspection 1686 */ 1687 protected function install_entity( WP_Upgrader $upgrader, WP_Ajax_Upgrader_Skin $skin, string $download_link ): ?WP_Error { 1685 */ 1686 protected function install_entity( object $upgrader, object $skin, string $download_link ): ?WP_Error { 1688 1687 $result = $upgrader->install( $download_link ); 1689 1688 -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/Settings/ListPageBase.php
r3233179 r3248039 50 50 51 51 /** 52 * Transient name where to store a page bulk action message. 53 */ 54 protected const TRANSIENT = 'hcaptcha_page_base'; 55 56 /** 52 57 * Default date format. 53 58 */ … … 55 60 56 61 /** 62 * Bulk ajax action. 63 * Must be overridden in child classes. 64 * Here is for testing purposes. 65 */ 66 public const BULK_ACTION = ''; 67 68 /** 57 69 * Chart time unit. 58 70 * … … 67 79 */ 68 80 protected $allowed = false; 81 82 /** 83 * Delete hCaptcha events by IDs. 84 * 85 * @param array $args Arguments. 86 * 87 * @return bool 88 */ 89 abstract protected function delete_events( array $args ): bool; 69 90 70 91 /** … … 76 97 add_action( 'admin_init', [ $this, 'admin_init' ] ); 77 98 add_action( 'kagg_settings_header', [ $this, 'date_picker_display' ] ); 99 add_action( 'wp_ajax_' . static::BULK_ACTION, [ $this, 'bulk_action' ] ); 78 100 } 79 101 … … 259 281 260 282 /** 283 * Ajax callback for bulk actions. 284 * 285 * @return void 286 */ 287 public function bulk_action(): void { 288 $this->run_checks( static::BULK_ACTION ); 289 290 // Nonce is checked by check_ajax_referer() in run_checks(). 291 // phpcs:disable WordPress.Security.NonceVerification.Missing 292 $bulk = isset( $_POST['bulk'] ) ? sanitize_text_field( wp_unslash( $_POST['bulk'] ) ) : ''; 293 $ids = isset( $_POST['ids'] ) 294 ? (array) json_decode( sanitize_text_field( wp_unslash( $_POST['ids'] ) ), true ) 295 : []; 296 $date = isset( $_POST['date'] ) 297 // We need filter_input here to keep the delimiter intact. 298 ? filter_input( INPUT_POST, 'date', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) 299 : ''; 300 // phpcs:enable WordPress.Security.NonceVerification.Missing 301 302 $dates = explode( self::TIMESPAN_DELIMITER, $date ); 303 $dates = array_filter( array_map( 'trim', $dates ) ); 304 305 if ( 'trash' === $bulk ) { 306 $args = [ 307 'ids' => $ids, 308 'dates' => $dates, 309 ]; 310 311 if ( ! $this->delete_events( $args ) ) { 312 wp_send_json_error( __( 'Failed to delete the selected items.', 'hcaptcha-for-forms-and-more' ) ); 313 314 // For testing purposes. 315 return; 316 } 317 318 set_transient( 319 self::TRANSIENT, 320 __( 'Selected items have been successfully deleted.', 'hcaptcha-for-forms-and-more' ) 321 ); 322 323 wp_send_json_success(); 324 325 // For testing purposes. 326 return; 327 } 328 329 wp_send_json_error( __( 'Invalid bulk action.', 'hcaptcha-for-forms-and-more' ) ); 330 } 331 332 /** 333 * Get and clean the transient. 334 * 335 * @return string 336 */ 337 protected function get_clean_transient(): string { 338 $bulk_message = (string) get_transient( self::TRANSIENT ); 339 340 if ( $bulk_message ) { 341 delete_transient( self::TRANSIENT ); 342 } 343 344 return $bulk_message; 345 } 346 347 /** 261 348 * Sets the timespan (or date range) for performing mysql queries. 262 349 * -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/Settings/Settings.php
r3200161 r3248039 7 7 8 8 // phpcs:ignore Generic.Commenting.DocComment.MissingShort 9 /** @noinspection ContractViolationInspection */10 9 11 10 namespace HCaptcha\Settings; -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/Settings/SystemInfo.php
r3114572 r3248039 187 187 $data .= $this->data( 'Turn Off When Logged In', $this->is_on( 'off_when_logged_in' ) ); 188 188 $data .= $this->data( 'Disable reCAPTCHA Compatibility', $this->is_on( 'recaptcha_compat_off' ) ); 189 $data .= $this->data( ' Whitelisted IPs', $this->is_empty( $settings->get( 'whitelisted_ips' ) ) );189 $data .= $this->data( 'Allowlisted IPs', $this->is_empty( $settings->get( 'whitelisted_ips' ) ) ); 190 190 $data .= $this->data( 'Login attempts before hCaptcha', $settings->get( 'login_limit' ) ); 191 191 $data .= $this->data( 'Failed login attempts interval, min', $settings->get( 'login_interval' ) ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/SimpleMembership/Login.php
r3166267 r3248039 97 97 */ 98 98 public function print_inline_styles(): void { 99 $css = <<<CSS 99 /* language=CSS */ 100 $css = ' 100 101 #swpm-login-form .h-captcha { 101 102 margin: 10px 0; 102 103 } 103 CSS;104 '; 104 105 105 106 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/SimpleMembership/LostPassword.php
r3166267 r3248039 98 98 */ 99 99 public function print_inline_styles(): void { 100 $css = <<<CSS 100 /* language=CSS */ 101 $css = ' 101 102 #swpm-pw-reset-form .h-captcha { 102 103 margin: 10px 0; 103 104 } 104 CSS;105 '; 105 106 106 107 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/SimpleMembership/Register.php
r3166267 r3248039 98 98 */ 99 99 public function print_inline_styles(): void { 100 $css = <<<CSS 100 /* language=CSS */ 101 $css = ' 101 102 #swpm-registration-form .h-captcha { 102 103 margin: 10px 0; 103 104 } 104 CSS;105 '; 105 106 106 107 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/Spectra/Form.php
r3143189 r3248039 155 155 $style_shown = true; 156 156 157 $css = <<<CSS 157 /* language=CSS */ 158 $css = ' 158 159 .uagb-forms-main-form .h-captcha { 159 160 margin-bottom: 20px; 160 161 } 161 CSS;162 '; 162 163 163 164 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/SupportCandy/Base.php
r3114572 r3248039 140 140 $style_shown = true; 141 141 142 $css = <<<CSS 142 /* language=CSS */ 143 $css = ' 143 144 form.wpsc-create-ticket .h-captcha { 144 145 margin: 0 15px 15px 15px; 145 146 } 146 CSS;147 '; 147 148 148 149 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/UsersWP/Register.php
r3114572 r3248039 80 80 $template = (string) ob_get_clean(); 81 81 82 ob_start(); 83 84 $args = [ 82 $args = [ 85 83 'action' => static::ACTION, 86 84 'name' => static::NONCE, … … 90 88 ], 91 89 ]; 92 93 HCaptcha::form_display( $args ); 94 95 $captcha = (string) ob_get_clean(); 96 $search = '<input type="submit"'; 90 $hcaptcha = HCaptcha::form( $args ); 91 $search = '/(<(?:input|button) type="submit")/'; 97 92 98 93 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 99 echo str_replace( $search, $captcha . $search, $template );94 echo preg_replace( $search, $hcaptcha . '$1', $template ); 100 95 } 101 96 -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/WC/Login.php
r3114572 r3248039 71 71 */ 72 72 public function print_inline_styles(): void { 73 $css = <<<CSS 73 /* language=CSS */ 74 $css = ' 74 75 .woocommerce-form-login .h-captcha { 75 76 margin-top: 2rem; 76 77 } 77 CSS;78 '; 78 79 79 80 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/WC/LostPassword.php
r3114572 r3248039 60 60 */ 61 61 public function print_inline_styles(): void { 62 $css = <<<CSS 62 /* language=CSS */ 63 $css = ' 63 64 .woocommerce-ResetPassword .h-captcha { 64 65 margin-top: 0.5rem; 65 66 } 66 CSS;67 '; 67 68 68 69 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/WC/Register.php
r3114572 r3248039 94 94 */ 95 95 public function print_inline_styles(): void { 96 $css = <<<CSS 96 /* language=CSS */ 97 $css = ' 97 98 .woocommerce-form-register .h-captcha { 98 99 margin-top: 2rem; 99 100 } 100 CSS;101 '; 101 102 102 103 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/WP/Base.php
r3129246 r3248039 23 23 * 24 24 * @return string 25 * @noinspection PhpUndefinedFunctionInspection 25 26 */ 26 27 private function get_login_url(): string { … … 28 29 // Integration with WPS Hide Login plugin. 29 30 return wp_parse_url( Plugin::get_instance()->new_login_url(), PHP_URL_PATH ); 31 } 32 33 if ( function_exists( 'perfmatters_login_url' ) ) { 34 // Integration with Perfmatters plugin. 35 return wp_parse_url( perfmatters_login_url(), PHP_URL_PATH ); 30 36 } 31 37 -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/WP/Comment.php
r3233179 r3248039 115 115 $comment_data = (array) $comment_data; 116 116 117 if ( is_admin() ) {117 if ( is_admin() || wp_doing_ajax() ) { 118 118 return $comment_data; 119 119 } -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/WPDiscuz/Comment.php
r3129246 r3248039 138 138 */ 139 139 public function print_inline_styles(): void { 140 $css = <<<CSS 140 /* language=CSS */ 141 $css = ' 141 142 .wpd-field-hcaptcha .h-captcha { 142 143 margin-left: auto; 143 144 } 144 CSS;145 '; 145 146 146 147 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/WPDiscuz/Subscribe.php
r3114572 r3248039 79 79 */ 80 80 public function print_inline_styles(): void { 81 $css = <<<CSS 81 /* language=CSS */ 82 $css = ' 82 83 #wpdiscuz-subscribe-form .h-captcha { 83 84 margin-top: 5px; 84 85 margin-left: auto; 85 86 } 86 CSS;87 '; 87 88 88 89 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/WPForms/Form.php
r3233179 r3248039 126 126 */ 127 127 public function print_inline_styles(): void { 128 $css = <<<CSS 128 /* language=CSS */ 129 $css = ' 129 130 div.wpforms-container-full .wpforms-form .h-captcha { 130 131 position: relative; … … 152 153 position: relative; 153 154 } 154 CSS;155 '; 155 156 156 157 HCaptcha::css_display( $css ); … … 197 198 198 199 if ( isset( $fields['hcaptcha-heading'] ) ) { 199 $notice_content = <<<HTML200 $notice_content = ' 200 201 <div 201 202 id="wpforms-setting-row-hcaptcha-heading" … … 209 210 </div> 210 211 <div class="wpforms-specific-note-content"> 211 <p><strong> $label</strong></p>212 <p> $description</p>212 <p><strong>' . $label . '</strong></p> 213 <p>' . $description . '</p> 213 214 </div> 214 215 </div> 215 216 </span> 216 217 </div> 217 HTML;218 '; 218 219 219 220 $fields['hcaptcha-heading'] .= $notice_content; -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/WPForo/Base.php
r3114572 r3248039 129 129 $style_shown = true; 130 130 131 $css = <<<CSS 131 /* language=CSS */ 132 $css = ' 132 133 #wpforo #wpforo-wrap div .h-captcha { 133 134 position: relative; … … 142 143 margin: 0 -20px; 143 144 } 144 CSS;145 '; 145 146 146 147 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/Wordfence/General.php
r3129246 r3248039 85 85 */ 86 86 public function print_inline_styles(): void { 87 $css = <<<CSS 88 #loginform[style="position: relative;"] > .h-captcha { 89 visibility: hidden !important; 90 } 91 CSS; 87 /* language=CSS */ 88 $css = ' 89 #loginform[style="position: relative;"] > .h-captcha { 90 visibility: hidden !important; 91 } 92 '; 92 93 93 94 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/tags/4.11.0/src/php/includes/request.php
r3233179 r3248039 320 320 } 321 321 322 if ( ! function_exists( 'hcaptcha_get_verify_output' ) ) { 323 /** 324 * Get verify output. 325 * 326 * @param string $empty_message Empty message. 327 * @param string $fail_message Fail message. 322 if ( ! function_exists( 'hcaptcha_get_verify_message' ) ) { 323 /** 324 * Get 'verify' message. 325 * 328 326 * @param string $nonce_field_name Nonce field name. 329 327 * @param string $nonce_action_name Nonce action name. 330 328 * 331 * @deprecated 4.7.0332 *333 329 * @return null|string Null on success, error message on failure. 334 330 */ 335 function hcaptcha_get_verify_output( string $empty_message, string $fail_message, string $nonce_field_name, string $nonce_action_name ): ?string { 336 _deprecated_function( __FUNCTION__, '4.7.0', 'hcaptcha_verify_post' ); 337 338 if ( ! empty( $empty_message ) || ! empty( $fail_message ) ) { 339 // @codeCoverageIgnoreStart 340 _deprecated_argument( __FUNCTION__, '2.1.0' ); 341 // @codeCoverageIgnoreEnd 342 } 343 331 function hcaptcha_get_verify_message( string $nonce_field_name, string $nonce_action_name ): ?string { 344 332 return hcaptcha_verify_post( $nonce_field_name, $nonce_action_name ); 345 333 } 346 334 } 347 335 348 if ( ! function_exists( 'hcaptcha_get_verify_message ' ) ) {349 /** 350 * Get 'verify' message.336 if ( ! function_exists( 'hcaptcha_get_verify_message_html' ) ) { 337 /** 338 * Get verify message HTML. 351 339 * 352 340 * @param string $nonce_field_name Nonce field name. … … 355 343 * @return null|string Null on success, error message on failure. 356 344 */ 357 function hcaptcha_get_verify_message( string $nonce_field_name, string $nonce_action_name ): ?string {358 return hcaptcha_verify_post( $nonce_field_name, $nonce_action_name );359 }360 }361 362 if ( ! function_exists( 'hcaptcha_get_verify_message_html' ) ) {363 /**364 * Get verify message HTML.365 *366 * @param string $nonce_field_name Nonce field name.367 * @param string $nonce_action_name Nonce action name.368 *369 * @return null|string Null on success, error message on failure.370 */371 345 function hcaptcha_get_verify_message_html( string $nonce_field_name, string $nonce_action_name ): ?string { 372 346 $message = hcaptcha_verify_post( $nonce_field_name, $nonce_action_name ); -
hcaptcha-for-forms-and-more/tags/4.11.0/vendor/autoload.php
r3233179 r3248039 23 23 require_once __DIR__ . '/composer/autoload_real.php'; 24 24 25 return ComposerAutoloaderInit 5b9e71c5ecc4233f8a6f35918bdc1f18::getLoader();25 return ComposerAutoloaderInit3e48e8c03c5b5a02f16696bf1a21546e::getLoader(); -
hcaptcha-for-forms-and-more/tags/4.11.0/vendor/composer/autoload_classmap.php
r3233179 r3248039 41 41 'HCaptcha\\CF7\\Base' => $baseDir . '/src/php/CF7/Base.php', 42 42 'HCaptcha\\CF7\\CF7' => $baseDir . '/src/php/CF7/CF7.php', 43 'HCaptcha\\CF7\\ReallySimpleCaptcha' => $baseDir . '/src/php/CF7/ReallySimpleCaptcha.php', 43 44 'HCaptcha\\ClassifiedListing\\Contact' => $baseDir . '/src/php/ClassifiedListing/Contact.php', 44 45 'HCaptcha\\ClassifiedListing\\Login' => $baseDir . '/src/php/ClassifiedListing/Login.php', -
hcaptcha-for-forms-and-more/tags/4.11.0/vendor/composer/autoload_real.php
r3233179 r3248039 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 5b9e71c5ecc4233f8a6f35918bdc1f185 class ComposerAutoloaderInit3e48e8c03c5b5a02f16696bf1a21546e 6 6 { 7 7 private static $loader; … … 23 23 } 24 24 25 spl_autoload_register(array('ComposerAutoloaderInit5b9e71c5ecc4233f8a6f35918bdc1f18', 'loadClassLoader'), true, true); 25 require __DIR__ . '/platform_check.php'; 26 27 spl_autoload_register(array('ComposerAutoloaderInit3e48e8c03c5b5a02f16696bf1a21546e', 'loadClassLoader'), true, true); 26 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 27 spl_autoload_unregister(array('ComposerAutoloaderInit 5b9e71c5ecc4233f8a6f35918bdc1f18', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInit3e48e8c03c5b5a02f16696bf1a21546e', 'loadClassLoader')); 28 30 29 31 require __DIR__ . '/autoload_static.php'; 30 call_user_func(\Composer\Autoload\ComposerStaticInit 5b9e71c5ecc4233f8a6f35918bdc1f18::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInit3e48e8c03c5b5a02f16696bf1a21546e::getInitializer($loader)); 31 33 32 34 $loader->setClassMapAuthoritative(true); -
hcaptcha-for-forms-and-more/tags/4.11.0/vendor/composer/autoload_static.php
r3233179 r3248039 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 5b9e71c5ecc4233f8a6f35918bdc1f187 class ComposerStaticInit3e48e8c03c5b5a02f16696bf1a21546e 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 69 69 'HCaptcha\\CF7\\Base' => __DIR__ . '/../..' . '/src/php/CF7/Base.php', 70 70 'HCaptcha\\CF7\\CF7' => __DIR__ . '/../..' . '/src/php/CF7/CF7.php', 71 'HCaptcha\\CF7\\ReallySimpleCaptcha' => __DIR__ . '/../..' . '/src/php/CF7/ReallySimpleCaptcha.php', 71 72 'HCaptcha\\ClassifiedListing\\Contact' => __DIR__ . '/../..' . '/src/php/ClassifiedListing/Contact.php', 72 73 'HCaptcha\\ClassifiedListing\\Login' => __DIR__ . '/../..' . '/src/php/ClassifiedListing/Login.php', … … 216 217 { 217 218 return \Closure::bind(function () use ($loader) { 218 $loader->prefixLengthsPsr4 = ComposerStaticInit 5b9e71c5ecc4233f8a6f35918bdc1f18::$prefixLengthsPsr4;219 $loader->prefixDirsPsr4 = ComposerStaticInit 5b9e71c5ecc4233f8a6f35918bdc1f18::$prefixDirsPsr4;220 $loader->classMap = ComposerStaticInit 5b9e71c5ecc4233f8a6f35918bdc1f18::$classMap;219 $loader->prefixLengthsPsr4 = ComposerStaticInit3e48e8c03c5b5a02f16696bf1a21546e::$prefixLengthsPsr4; 220 $loader->prefixDirsPsr4 = ComposerStaticInit3e48e8c03c5b5a02f16696bf1a21546e::$prefixDirsPsr4; 221 $loader->classMap = ComposerStaticInit3e48e8c03c5b5a02f16696bf1a21546e::$classMap; 221 222 222 223 }, null, ClassLoader::class); -
hcaptcha-for-forms-and-more/tags/4.11.0/vendor/composer/installed.json
r3064004 r3248039 130 130 }, 131 131 "install-path": "../matthiasmullie/path-converter" 132 }, 133 { 134 "name": "woocommerce/action-scheduler", 135 "version": "3.9.2", 136 "version_normalized": "3.9.2.0", 137 "source": { 138 "type": "git", 139 "url": "https://github.com/woocommerce/action-scheduler.git", 140 "reference": "efbb7953f72a433086335b249292f280dd43ddfe" 141 }, 142 "dist": { 143 "type": "zip", 144 "url": "https://api.github.com/repos/woocommerce/action-scheduler/zipball/efbb7953f72a433086335b249292f280dd43ddfe", 145 "reference": "efbb7953f72a433086335b249292f280dd43ddfe", 146 "shasum": "" 147 }, 148 "require": { 149 "php": ">=7.1" 150 }, 151 "require-dev": { 152 "phpunit/phpunit": "^7.5", 153 "woocommerce/woocommerce-sniffs": "0.1.0", 154 "wp-cli/wp-cli": "~2.5.0", 155 "yoast/phpunit-polyfills": "^2.0" 156 }, 157 "time": "2025-02-03T09:09:30+00:00", 158 "type": "wordpress-plugin", 159 "extra": { 160 "scripts-description": { 161 "test": "Run unit tests", 162 "phpcs": "Analyze code against the WordPress coding standards with PHP_CodeSniffer", 163 "phpcbf": "Fix coding standards warnings/errors automatically with PHP Code Beautifier" 164 } 165 }, 166 "installation-source": "dist", 167 "notification-url": "https://packagist.org/downloads/", 168 "license": [ 169 "GPL-3.0-or-later" 170 ], 171 "description": "Action Scheduler for WordPress and WooCommerce", 172 "homepage": "https://actionscheduler.org/", 173 "support": { 174 "issues": "https://github.com/woocommerce/action-scheduler/issues", 175 "source": "https://github.com/woocommerce/action-scheduler/tree/3.9.2" 176 }, 177 "install-path": "../woocommerce/action-scheduler" 132 178 } 133 179 ], -
hcaptcha-for-forms-and-more/tags/4.11.0/vendor/composer/installed.php
r3233179 r3248039 2 2 'root' => array( 3 3 'name' => 'hcaptcha/hcaptcha-wordpress-plugin', 4 'pretty_version' => '4.1 0.0',5 'version' => '4.1 0.0.0',6 'reference' => ' 3f3d675e6a0c12404a0a7aa20b4472b5d37ea88d',4 'pretty_version' => '4.11.0', 5 'version' => '4.11.0.0', 6 'reference' => '83b1b3615b255290d2a5050750f078835392d129', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 'hcaptcha/hcaptcha-wordpress-plugin' => array( 14 'pretty_version' => '4.1 0.0',15 'version' => '4.1 0.0.0',16 'reference' => ' 3f3d675e6a0c12404a0a7aa20b4472b5d37ea88d',14 'pretty_version' => '4.11.0', 15 'version' => '4.11.0.0', 16 'reference' => '83b1b3615b255290d2a5050750f078835392d129', 17 17 'type' => 'wordpress-plugin', 18 18 'install_path' => __DIR__ . '/../../', … … 38 38 'dev_requirement' => false, 39 39 ), 40 'woocommerce/action-scheduler' => array( 41 'pretty_version' => '3.9.2', 42 'version' => '3.9.2.0', 43 'reference' => 'efbb7953f72a433086335b249292f280dd43ddfe', 44 'type' => 'wordpress-plugin', 45 'install_path' => __DIR__ . '/../woocommerce/action-scheduler', 46 'aliases' => array(), 47 'dev_requirement' => false, 48 ), 40 49 ), 41 50 ); -
hcaptcha-for-forms-and-more/trunk/assets/css/forms.css
r3233179 r3248039 45 45 } 46 46 47 #hcaptcha-chart-message { 48 padding: 5px 10px; 49 border: 1px solid #c3c4c7; 50 box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); 51 color: #50575e; 52 background-color: #f6f7f7; 53 text-align: center; 54 } 55 47 56 @media (max-width: 782px) { 48 57 #hcaptcha-options #hcaptcha-forms-wrap table tbody tr td { -
hcaptcha-for-forms-and-more/trunk/assets/css/forms.min.css
r3233179 r3248039 1 #hcaptcha-options #hcaptcha-forms-wrap table tbody tr td{padding:8px 10px}.hcaptcha-forms-sample-bg{aspect-ratio:2845/1637;background-image:url(../images/forms-page.png);background-position:50%;background-repeat:no-repeat;background-size:cover;box-sizing:border-box;filter:blur(1px);-webkit-filter:blur(1px);width:100%}.hcaptcha-forms-sample-text{background-color:rgba(92,111,138,.8);border:3px solid #f0f2f5;color:#f0f2f5;left:50%;padding:20px;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);width:80%;z-index:1}.hcaptcha-forms-sample-text p{font-size:1.3em}#hcaptcha-options .hcaptcha-forms-sample-text p a{color:#f0f2f5}#hcaptcha-forms-chart{aspect-ratio:3/1;background-color:#fff;margin:auto;position:relative;width:100%} @media (max-width:782px){#hcaptcha-options #hcaptcha-forms-wrap table tbody tr td{min-height:19.5px;padding-block-end:3px;padding-block-start:3px;padding-inline-end:8px;padding-inline-start:35%}#hcaptcha-options #hcaptcha-forms-wrap table tbody tr td.column-primary{padding:3px 10px}}1 #hcaptcha-options #hcaptcha-forms-wrap table tbody tr td{padding:8px 10px}.hcaptcha-forms-sample-bg{aspect-ratio:2845/1637;background-image:url(../images/forms-page.png);background-position:50%;background-repeat:no-repeat;background-size:cover;box-sizing:border-box;filter:blur(1px);-webkit-filter:blur(1px);width:100%}.hcaptcha-forms-sample-text{background-color:rgba(92,111,138,.8);border:3px solid #f0f2f5;color:#f0f2f5;left:50%;padding:20px;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);width:80%;z-index:1}.hcaptcha-forms-sample-text p{font-size:1.3em}#hcaptcha-options .hcaptcha-forms-sample-text p a{color:#f0f2f5}#hcaptcha-forms-chart{aspect-ratio:3/1;background-color:#fff;margin:auto;position:relative;width:100%}#hcaptcha-chart-message{background-color:#f6f7f7;border:1px solid #c3c4c7;box-shadow:0 1px 1px rgba(0,0,0,.04);color:#50575e;padding:5px 10px;text-align:center}@media (max-width:782px){#hcaptcha-options #hcaptcha-forms-wrap table tbody tr td{min-height:19.5px;padding-block-end:3px;padding-block-start:3px;padding-inline-end:8px;padding-inline-start:35%}#hcaptcha-options #hcaptcha-forms-wrap table tbody tr td.column-primary{padding:3px 10px}} -
hcaptcha-for-forms-and-more/trunk/assets/css/settings-base.css
r3233179 r3248039 38 38 margin-inline-end: 30px; 39 39 color: #646970; 40 border-bottom: 2px solid transparent;41 40 } 42 41 -
hcaptcha-for-forms-and-more/trunk/assets/css/settings-base.min.css
r3233179 r3248039 1 body.settings_page_hcaptcha{background:#f0f2f5;color:#5c6f8a}.wrap h1.hcaptcha-settings-header{align-items:center;display:flex;font-size:34px;font-weight:700}.hcaptcha-logo{height:64px;margin-block-end:10px;margin-block-start:10px;margin-inline-end:5px;margin-inline-start:0}.hcaptcha-settings-tabs{background:#fff;display:flex;flex-wrap:wrap;justify-content:space-between;line-height:4.5em;margin:10px -20px 0;padding:0 20px;position:sticky;top:0;z-index:2}.hcaptcha-settings-tab{ border-bottom:2px solid transparent;color:#646970;display:inline-block;font-size:1.1em;margin-inline-end:30px;text-decoration:none}.hcaptcha-settings-tab:hover{border-bottom-color:#025176!important;border-bottom:2px solid;color:#666}.hcaptcha-settings-tab.active{border-bottom:2px solid #0075ab}.hcaptcha-header-bar{align-items:center;background:#f0f2f5;display:flex;justify-content:space-between;margin:0 -20px;padding:0 20px;position:sticky;top:60px;z-index:2}#hcaptcha-options h2{color:#5c6f8a;font-size:1.5em}#hcaptcha-options h2~*{display:none}#hcaptcha-options h3{color:#5c6f8a;margin:1.5em 0 1em}#hcaptcha-options .notice-dismiss:before{color:#5c6f8a}#hcaptcha-options table tbody tr td{margin:0;padding:0;position:relative}#hcaptcha-options table tr td fieldset input[type=checkbox]{border:none;box-shadow:none;display:inline;height:1.25rem;margin-block-end:0;margin-block-start:-.125rem;margin-inline-end:.5rem;margin-inline-start:0;width:2.3611rem}#hcaptcha-options table tr td fieldset input[type=checkbox]:before{background:url(../images/checkbox-off.svg);background-size:cover;content:"";display:inline-block;height:1.25rem;margin:0;width:2.3611rem}#hcaptcha-options table tr td fieldset input[type=checkbox]:checked:before{background:no-repeat url(../images/checkbox-on.svg);background-size:cover}#hcaptcha-options fieldset:disabled{color:#dadada}#hcaptcha-options .button-primary{background-color:#026593;border-color:#026593;color:#fff}#hcaptcha-options .button-primary:hover{background-color:#025176}#hcaptcha-options .button-secondary{background-color:#fff;border-color:#026593;color:#026593}#hcaptcha-options .button-secondary:hover{background-color:#ccc}#hcaptcha-options a{color:#0075ab}#hcaptcha-navigation a{border-color:#0075ab}#hcaptcha-options a.hcaptcha-settings-tab{color:#5c6f8a}#hcaptcha-options .helper:before{background:#5c6f8a;border-radius:1.2em;color:#fff;content:"?";height:1.2em;inset-inline-end:0;position:absolute;text-align:center;top:0;transform:translateY(-27px);width:1.2em}#hcaptcha-options fieldset+.helper:before{top:50%;transform:translate(25px,-.7em)}.rtl #hcaptcha-options fieldset+.helper:before{transform:translate(-25px,-.8em)}#hcaptcha-options .helper .helper-content{background:#5c6f8a;box-sizing:border-box;color:#f0f2f5;display:none;inset-inline-end:0;padding:.5em 1em;position:absolute;top:0;transform:translate(1px,10px);width:100%}.rtl #hcaptcha-options .helper .helper-content{transform:translate(-1px,10px)}#hcaptcha-options fieldset+.helper .helper-content{top:50%;transform:translate(25px,25px);width:calc(100% + 25px)}#hcaptcha-options .helper:hover{cursor:help}#hcaptcha-options .helper:hover .helper-content{display:block;z-index:1}#hcaptcha-options .helper .helper-content:after{border:10px solid transparent;border-bottom-color:#5c6f8a;content:"";inset-inline-end:0;position:absolute;top:0;transform:translateY(-100%)}#hcaptcha-options .helper .helper-content a{color:#fff}#hcaptcha-message{box-sizing:border-box}#hcaptcha-message>p{font-size:13px;font-weight:600;line-height:1.5;margin:.5em 0}@keyframes blink{0%{opacity:1}16.7%{opacity:0}33.3%{opacity:1}50%{opacity:0}66.7%{opacity:1}83.3%{opacity:0}to{opacity:1}}.blink{animation:blink 3s linear}.hcaptcha-hide{display:none}.hcaptcha-excerpt{display:block;max-width:100%;overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap;width:max-content}.hcaptcha-excerpt:hover{overflow:visible}.hcaptcha-excerpt:hover .hcaptcha-hide{background:#5c6f8a;border:1px solid #c3c4c7;border-radius:6px;box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);color:#f0f2f5;display:block;inset-inline-start:50%;max-width:300px;padding:8px 10px;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);white-space:normal;width:max-content;z-index:1}@media (max-width:782px){#hcaptcha-options .wp-list-table .toggle-row{top:15px}#hcaptcha-options .wp-list-table tr.is-expanded .toggle-row{top:6.5px}#hcaptcha-options .widefat tbody th.check-column{padding:0;vertical-align:middle}#hcaptcha-options .widefat thead td.check-column,.widefat tfoot td.check-column{padding-left:0}#hcaptcha-options .widefat th input[type=checkbox]{margin-bottom:0}#hcaptcha-options .wp-list-table .is-expanded td:not(.hidden){overflow:visible}.hcaptcha-settings-tabs{margin:unset;margin-block-end:0;margin-block-start:10px;margin-inline-end:-12px;margin-inline-start:-10px;padding-block-end:0;padding-block-start:0;padding-inline-end:12px;padding-inline-start:10px}.hcaptcha-excerpt{display:table-cell;height:44px;vertical-align:middle}tr.is-expanded .hcaptcha-excerpt{height:19.5px}}@media (max-width:600px){#hcaptcha-options table tbody{grid-template-columns:1fr}#hcaptcha-options table tbody tr{position:relative}#hcaptcha-options fieldset+.helper:before{transform:translateY(-.7em)}#hcaptcha-options fieldset+.helper .helper-content{transform:translateY(25px);width:100%}#hcaptcha-options .helper{z-index:1}.hcaptcha-settings-tab{inset-inline-end:15px}}1 body.settings_page_hcaptcha{background:#f0f2f5;color:#5c6f8a}.wrap h1.hcaptcha-settings-header{align-items:center;display:flex;font-size:34px;font-weight:700}.hcaptcha-logo{height:64px;margin-block-end:10px;margin-block-start:10px;margin-inline-end:5px;margin-inline-start:0}.hcaptcha-settings-tabs{background:#fff;display:flex;flex-wrap:wrap;justify-content:space-between;line-height:4.5em;margin:10px -20px 0;padding:0 20px;position:sticky;top:0;z-index:2}.hcaptcha-settings-tab{color:#646970;display:inline-block;font-size:1.1em;margin-inline-end:30px;text-decoration:none}.hcaptcha-settings-tab:hover{border-bottom-color:#025176!important;border-bottom:2px solid;color:#666}.hcaptcha-settings-tab.active{border-bottom:2px solid #0075ab}.hcaptcha-header-bar{align-items:center;background:#f0f2f5;display:flex;justify-content:space-between;margin:0 -20px;padding:0 20px;position:sticky;top:60px;z-index:2}#hcaptcha-options h2{color:#5c6f8a;font-size:1.5em}#hcaptcha-options h2~*{display:none}#hcaptcha-options h3{color:#5c6f8a;margin:1.5em 0 1em}#hcaptcha-options .notice-dismiss:before{color:#5c6f8a}#hcaptcha-options table tbody tr td{margin:0;padding:0;position:relative}#hcaptcha-options table tr td fieldset input[type=checkbox]{border:none;box-shadow:none;display:inline;height:1.25rem;margin-block-end:0;margin-block-start:-.125rem;margin-inline-end:.5rem;margin-inline-start:0;width:2.3611rem}#hcaptcha-options table tr td fieldset input[type=checkbox]:before{background:url(../images/checkbox-off.svg);background-size:cover;content:"";display:inline-block;height:1.25rem;margin:0;width:2.3611rem}#hcaptcha-options table tr td fieldset input[type=checkbox]:checked:before{background:no-repeat url(../images/checkbox-on.svg);background-size:cover}#hcaptcha-options fieldset:disabled{color:#dadada}#hcaptcha-options .button-primary{background-color:#026593;border-color:#026593;color:#fff}#hcaptcha-options .button-primary:hover{background-color:#025176}#hcaptcha-options .button-secondary{background-color:#fff;border-color:#026593;color:#026593}#hcaptcha-options .button-secondary:hover{background-color:#ccc}#hcaptcha-options a{color:#0075ab}#hcaptcha-navigation a{border-color:#0075ab}#hcaptcha-options a.hcaptcha-settings-tab{color:#5c6f8a}#hcaptcha-options .helper:before{background:#5c6f8a;border-radius:1.2em;color:#fff;content:"?";height:1.2em;inset-inline-end:0;position:absolute;text-align:center;top:0;transform:translateY(-27px);width:1.2em}#hcaptcha-options fieldset+.helper:before{top:50%;transform:translate(25px,-.7em)}.rtl #hcaptcha-options fieldset+.helper:before{transform:translate(-25px,-.8em)}#hcaptcha-options .helper .helper-content{background:#5c6f8a;box-sizing:border-box;color:#f0f2f5;display:none;inset-inline-end:0;padding:.5em 1em;position:absolute;top:0;transform:translate(1px,10px);width:100%}.rtl #hcaptcha-options .helper .helper-content{transform:translate(-1px,10px)}#hcaptcha-options fieldset+.helper .helper-content{top:50%;transform:translate(25px,25px);width:calc(100% + 25px)}#hcaptcha-options .helper:hover{cursor:help}#hcaptcha-options .helper:hover .helper-content{display:block;z-index:1}#hcaptcha-options .helper .helper-content:after{border:10px solid transparent;border-bottom-color:#5c6f8a;content:"";inset-inline-end:0;position:absolute;top:0;transform:translateY(-100%)}#hcaptcha-options .helper .helper-content a{color:#fff}#hcaptcha-message{box-sizing:border-box}#hcaptcha-message>p{font-size:13px;font-weight:600;line-height:1.5;margin:.5em 0}@keyframes blink{0%{opacity:1}16.7%{opacity:0}33.3%{opacity:1}50%{opacity:0}66.7%{opacity:1}83.3%{opacity:0}to{opacity:1}}.blink{animation:blink 3s linear}.hcaptcha-hide{display:none}.hcaptcha-excerpt{display:block;max-width:100%;overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap;width:max-content}.hcaptcha-excerpt:hover{overflow:visible}.hcaptcha-excerpt:hover .hcaptcha-hide{background:#5c6f8a;border:1px solid #c3c4c7;border-radius:6px;box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);color:#f0f2f5;display:block;inset-inline-start:50%;max-width:300px;padding:8px 10px;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);white-space:normal;width:max-content;z-index:1}@media (max-width:782px){#hcaptcha-options .wp-list-table .toggle-row{top:15px}#hcaptcha-options .wp-list-table tr.is-expanded .toggle-row{top:6.5px}#hcaptcha-options .widefat tbody th.check-column{padding:0;vertical-align:middle}#hcaptcha-options .widefat thead td.check-column,.widefat tfoot td.check-column{padding-left:0}#hcaptcha-options .widefat th input[type=checkbox]{margin-bottom:0}#hcaptcha-options .wp-list-table .is-expanded td:not(.hidden){overflow:visible}.hcaptcha-settings-tabs{margin:unset;margin-block-end:0;margin-block-start:10px;margin-inline-end:-12px;margin-inline-start:-10px;padding-block-end:0;padding-block-start:0;padding-inline-end:12px;padding-inline-start:10px}.hcaptcha-excerpt{display:table-cell;height:44px;vertical-align:middle}tr.is-expanded .hcaptcha-excerpt{height:19.5px}}@media (max-width:600px){#hcaptcha-options table tbody{grid-template-columns:1fr}#hcaptcha-options table tbody tr{position:relative}#hcaptcha-options fieldset+.helper:before{transform:translateY(-.7em)}#hcaptcha-options fieldset+.helper .helper-content{transform:translateY(25px);width:100%}#hcaptcha-options .helper{z-index:1}.hcaptcha-settings-tab{inset-inline-end:15px}} -
hcaptcha-for-forms-and-more/trunk/assets/js/events.js
r3233179 r3248039 5 5 * @param HCaptchaEventsObject.bulkAction 6 6 * @param HCaptchaEventsObject.bulkNonce 7 * @param HCaptchaEventsObject.bulkMessage 7 8 * @param HCaptchaEventsObject.failed 8 9 * @param HCaptchaEventsObject.failedLabel … … 123 124 124 125 initChart(); 126 hCaptchaSettingsBase.showSuccessMessage( HCaptchaEventsObject.bulkMessage ); 125 127 document.getElementById( 'doaction' ).addEventListener( 'click', handleBulkAction ); 126 128 }; -
hcaptcha-for-forms-and-more/trunk/assets/js/events.min.js
r3233179 r3248039 1 (()=>{var e=function(e){var t,a;t=document.getElementById("eventsChart"),a=window.innerWidth>600?3:2,new Chart(t,{type:"bar",data:{datasets:[{label:HCaptchaEventsObject.succeedLabel,data:HCaptchaEventsObject.succeed,borderWidth:1},{label:HCaptchaEventsObject.failedLabel,data:HCaptchaEventsObject.failed,borderWidth:1}]},options:{responsive:!0,maintainAspectRatio:!0,aspectRatio:a,scales:{x:{type:"time",time:{displayFormats:{millisecond:"HH:mm:ss",second:"HH:mm:ss",minute:"HH:mm",hour:"HH:mm",day:"dd.MM.yyyy",week:"dd.MM.yyyy",month:"dd.MM.yyyy",quarter:"dd.MM.yyyy",year:"dd.MM.yyyy"},tooltipFormat:"dd.MM.yyyy HH:mm",unit:HCaptchaEventsObject.unit}},y:{beginAtZero:!0,ticks:{precision:0}}}}}), document.getElementById("doaction").addEventListener("click",(function(t){t.preventDefault();var a=t.target.closest("form"),s=new FormData(a),n=s.get("action");if("-1"!==n){var c=s.getAll("bulk-checkbox[]");if(c.length){var o={action:HCaptchaEventsObject.bulkAction,nonce:HCaptchaEventsObject.bulkNonce,bulk:n,ids:JSON.stringify(c)};e.post({url:HCaptchaEventsObject.ajaxUrl,data:o,beforeSend:function(){return hCaptchaSettingsBase.showSuccessMessage(HCaptchaListPageBaseObject.DoingBulk)}}).done((function(e){e.success?window.location.reload():hCaptchaSettingsBase.showErrorMessage(e.data)})).fail((function(e){hCaptchaSettingsBase.showErrorMessage(e.statusText)}))}else hCaptchaSettingsBase.showErrorMessage(HCaptchaListPageBaseObject.noItems)}else hCaptchaSettingsBase.showErrorMessage(HCaptchaListPageBaseObject.noAction)}))};window.hCaptchaForms=e,jQuery(document).ready(e)})();1 (()=>{var e=function(e){var t,a;t=document.getElementById("eventsChart"),a=window.innerWidth>600?3:2,new Chart(t,{type:"bar",data:{datasets:[{label:HCaptchaEventsObject.succeedLabel,data:HCaptchaEventsObject.succeed,borderWidth:1},{label:HCaptchaEventsObject.failedLabel,data:HCaptchaEventsObject.failed,borderWidth:1}]},options:{responsive:!0,maintainAspectRatio:!0,aspectRatio:a,scales:{x:{type:"time",time:{displayFormats:{millisecond:"HH:mm:ss",second:"HH:mm:ss",minute:"HH:mm",hour:"HH:mm",day:"dd.MM.yyyy",week:"dd.MM.yyyy",month:"dd.MM.yyyy",quarter:"dd.MM.yyyy",year:"dd.MM.yyyy"},tooltipFormat:"dd.MM.yyyy HH:mm",unit:HCaptchaEventsObject.unit}},y:{beginAtZero:!0,ticks:{precision:0}}}}}),hCaptchaSettingsBase.showSuccessMessage(HCaptchaEventsObject.bulkMessage),document.getElementById("doaction").addEventListener("click",(function(t){t.preventDefault();var a=t.target.closest("form"),s=new FormData(a),n=s.get("action");if("-1"!==n){var c=s.getAll("bulk-checkbox[]");if(c.length){var o={action:HCaptchaEventsObject.bulkAction,nonce:HCaptchaEventsObject.bulkNonce,bulk:n,ids:JSON.stringify(c)};e.post({url:HCaptchaEventsObject.ajaxUrl,data:o,beforeSend:function(){return hCaptchaSettingsBase.showSuccessMessage(HCaptchaListPageBaseObject.DoingBulk)}}).done((function(e){e.success?window.location.reload():hCaptchaSettingsBase.showErrorMessage(e.data)})).fail((function(e){hCaptchaSettingsBase.showErrorMessage(e.statusText)}))}else hCaptchaSettingsBase.showErrorMessage(HCaptchaListPageBaseObject.noItems)}else hCaptchaSettingsBase.showErrorMessage(HCaptchaListPageBaseObject.noAction)}))};window.hCaptchaForms=e,jQuery(document).ready(e)})(); -
hcaptcha-for-forms-and-more/trunk/assets/js/forms.js
r3233179 r3248039 5 5 * @param HCaptchaFormsObject.bulkAction 6 6 * @param HCaptchaFormsObject.bulkNonce 7 * @param HCaptchaFormsObject.bulkMessage 7 8 * @param HCaptchaFormsObject.served 8 9 * @param HCaptchaFormsObject.servedLabel … … 99 100 } 100 101 102 const datepicker = document.getElementById( 'hcaptcha-datepicker' ); 101 103 const data = { 102 104 action: HCaptchaFormsObject.bulkAction, … … 104 106 bulk, 105 107 ids: JSON.stringify( ids ), 108 date: datepicker?.value ?? '', 106 109 }; 107 110 … … 128 131 129 132 initChart(); 133 hCaptchaSettingsBase.showSuccessMessage( HCaptchaFormsObject.bulkMessage ); 130 134 document.getElementById( 'doaction' ).addEventListener( 'click', handleBulkAction ); 131 135 }; -
hcaptcha-for-forms-and-more/trunk/assets/js/forms.min.js
r3233179 r3248039 1 (()=>{var e=function(e){var t,a;t=document.getElementById("formsChart"),a=window.innerWidth>600?3:2,new Chart(t,{type:"bar",data:{datasets:[{label:HCaptchaFormsObject.servedLabel,backgroundColor:"rgba(2,101,147,0.5)",data:HCaptchaFormsObject.served,borderWidth:1}]},options:{responsive:!0,maintainAspectRatio:!0,aspectRatio:a,scales:{x:{type:"time",time:{displayFormats:{millisecond:"HH:mm:ss",second:"HH:mm:ss",minute:"HH:mm",hour:"HH:mm",day:"dd.MM.yyyy",week:"dd.MM.yyyy",month:"dd.MM.yyyy",quarter:"dd.MM.yyyy",year:"dd.MM.yyyy"},tooltipFormat:"dd.MM.yyyy HH:mm",unit:HCaptchaFormsObject.unit}},y:{beginAtZero:!0,ticks:{precision:0}}}}}), document.getElementById("doaction").addEventListener("click",(function(t){t.preventDefault();var a=t.target.closest("form"),s=new FormData(a),o=s.get("action");if("-1"!==o){var r=s.getAll("bulk-checkbox[]").map((function(e){var t=a.querySelector('input[name="bulk-checkbox[]"][value="'.concat(e,'"]')).closest("tr");return{source:t.querySelector("td.name .hcaptcha-excerpt").dataset.source,formId:t.querySelector("td.form_id").textContent}}));if(r.length){var c={action:HCaptchaFormsObject.bulkAction,nonce:HCaptchaFormsObject.bulkNonce,bulk:o,ids:JSON.stringify(r)};e.post({url:HCaptchaFormsObject.ajaxUrl,data:c,beforeSend:function(){return hCaptchaSettingsBase.showSuccessMessage(HCaptchaListPageBaseObject.DoingBulk)}}).done((function(e){e.success?window.location.reload():hCaptchaSettingsBase.showErrorMessage(e.data)})).fail((function(e){hCaptchaSettingsBase.showErrorMessage(e.statusText)}))}else hCaptchaSettingsBase.showErrorMessage(HCaptchaListPageBaseObject.noItems)}else hCaptchaSettingsBase.showErrorMessage(HCaptchaListPageBaseObject.noAction)}))};window.hCaptchaForms=e,jQuery(document).ready(e)})();1 (()=>{var e=function(e){var t,a;t=document.getElementById("formsChart"),a=window.innerWidth>600?3:2,new Chart(t,{type:"bar",data:{datasets:[{label:HCaptchaFormsObject.servedLabel,backgroundColor:"rgba(2,101,147,0.5)",data:HCaptchaFormsObject.served,borderWidth:1}]},options:{responsive:!0,maintainAspectRatio:!0,aspectRatio:a,scales:{x:{type:"time",time:{displayFormats:{millisecond:"HH:mm:ss",second:"HH:mm:ss",minute:"HH:mm",hour:"HH:mm",day:"dd.MM.yyyy",week:"dd.MM.yyyy",month:"dd.MM.yyyy",quarter:"dd.MM.yyyy",year:"dd.MM.yyyy"},tooltipFormat:"dd.MM.yyyy HH:mm",unit:HCaptchaFormsObject.unit}},y:{beginAtZero:!0,ticks:{precision:0}}}}}),hCaptchaSettingsBase.showSuccessMessage(HCaptchaFormsObject.bulkMessage),document.getElementById("doaction").addEventListener("click",(function(t){var a;t.preventDefault();var s=t.target.closest("form"),o=new FormData(s),c=o.get("action");if("-1"!==c){var r=o.getAll("bulk-checkbox[]").map((function(e){var t=s.querySelector('input[name="bulk-checkbox[]"][value="'.concat(e,'"]')).closest("tr");return{source:t.querySelector("td.name .hcaptcha-excerpt").dataset.source,formId:t.querySelector("td.form_id").textContent}}));if(r.length){var n=document.getElementById("hcaptcha-datepicker"),i={action:HCaptchaFormsObject.bulkAction,nonce:HCaptchaFormsObject.bulkNonce,bulk:c,ids:JSON.stringify(r),date:null!==(a=null==n?void 0:n.value)&&void 0!==a?a:""};e.post({url:HCaptchaFormsObject.ajaxUrl,data:i,beforeSend:function(){return hCaptchaSettingsBase.showSuccessMessage(HCaptchaListPageBaseObject.DoingBulk)}}).done((function(e){e.success?window.location.reload():hCaptchaSettingsBase.showErrorMessage(e.data)})).fail((function(e){hCaptchaSettingsBase.showErrorMessage(e.statusText)}))}else hCaptchaSettingsBase.showErrorMessage(HCaptchaListPageBaseObject.noItems)}else hCaptchaSettingsBase.showErrorMessage(HCaptchaListPageBaseObject.noAction)}))};window.hCaptchaForms=e,jQuery(document).ready(e)})(); -
hcaptcha-for-forms-and-more/trunk/assets/js/settings-base.js
r3233179 r3248039 136 136 137 137 setHeaderBarTop(); 138 139 138 highLight(); 140 139 -
hcaptcha-for-forms-and-more/trunk/assets/js/settings-list-page-base.js
r3233179 r3248039 1 1 /* global HCaptchaListPageBaseObject, flatpickr */ 2 2 3 /** 4 * @param flatpickr.l10ns 5 */ 6 document.addEventListener( 'DOMContentLoaded', function() { 3 const settingsListPagePage = ( function() { 4 /** 5 * @param flatpickr.l10ns 6 */ 7 7 8 /** 8 9 * @type {HTMLInputElement} … … 87 88 selectorElement.setAttribute( 88 89 'aria-expanded', 89 selectorElement.style.display === 'block' ? 'true' : 'false' 90 selectorElement.style.display === 'block' ? 'true' : 'false', 90 91 ); 91 92 } … … 222 223 } 223 224 225 /** 226 * Public properties and functions. 227 */ 228 const app = {}; 229 224 230 bindEvents(); 225 231 initFlatPicker(); 232 233 return app; 226 234 } ); 235 236 window.hCaptchaSettingsListPagePage = settingsListPagePage; 237 238 document.addEventListener( 'DOMContentLoaded', settingsListPagePage ); -
hcaptcha-for-forms-and-more/trunk/assets/js/settings-list-page-base.min.js
r3233179 r3248039 1 (()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(e){for(var n=1;n<arguments.length;n++){var a=null!=arguments[n]?arguments[n]:{};n%2?t(Object(a),!0).forEach((function(t){r(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):t(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function r(t,n,r){return(n=function(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var a=r.call(t,n||"default");if("object"!=e(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}(n))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t} document.addEventListener("DOMContentLoaded",(function(){var e=document.getElementById("hcaptcha-datepicker");if(e){var t,r,a="hcaptcha-is-selected",o=HCaptchaListPageBaseObject.delimiter,c=HCaptchaListPageBaseObject.locale,i=document.getElementById("hcaptcha-options"),l=document.querySelector(".hcaptcha-filter"),u=document.getElementById("hcaptcha-datepicker-popover-button"),p=l.querySelector('input[type="radio"][data-default]');document.addEventListener("click",f),i.querySelector("#hcaptcha-datepicker-popover-button").addEventListener("click",d),i.querySelectorAll('[type="radio"]').forEach((function(e){e.addEventListener("change",v)})),i.querySelector('[type="reset"]').addEventListener("click",b),i.addEventListener("submit",s),i.querySelector("#current-page-selector").addEventListener("keydown",y),r=l.querySelector('input[value="custom"]'),t=flatpickr(e,{mode:"range",inline:!0,allowInput:!1,enableTime:!1,clickOpens:!1,altInput:!0,altFormat:"M j, Y",dateFormat:"Y-m-d",locale:n(n({},flatpickr.l10ns[c]||{}),{},{rangeSeparator:o}),onChange:function(e,t,n){r.checked=!0,m(r.parentElement),t&&(u.textContent=n.altInput.value)}}),v({},r.checked)}function s(t){var n;t.preventDefault(),this.querySelectorAll('input[type="radio"]').forEach((function(e){e.name=""})),(n=u.nextElementSibling).setAttribute("aria-expanded","false"),n.style.display="none";var r=new URL(window.location.href),a=r.searchParams;a.delete("date"),e.value&&a.append("date",e.value),window.location.href=r.toString()}function d(e){e.preventDefault(),e.stopPropagation();var t=e.target.nextElementSibling;"none"===t.style.display||""===t.style.display?t.style.display="block":t.style.display="none",t.setAttribute("aria-expanded","block"===t.style.display?"true":"false")}function y(e){if("Enter"===e.key){e.preventDefault();var t=new URL(window.location.href),n=parseInt(t.searchParams.get("paged")),r=parseInt(e.target.value);(isNaN(n)||n<1)&&(n=1),isNaN(r)||r<1||(t.searchParams.delete("paged"),r!==n&&(t.searchParams.set("paged",r.toString()),window.location.href=t.href))}}function f(e){var t=document.querySelector(".hcaptcha-datepicker-popover");t.contains(e.target)||(t.style.display="none")}function m(e){l.querySelectorAll("label").forEach((function(e){e.classList.remove(a)})),e.classList.add(a)}function b(e){e.preventDefault(),p.checked=!0,v()}function v(){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=l.querySelector("input:checked"),a=r.parentElement,c=n?e:r,i=c.value.split(o),p=c.nextElementSibling;u.textContent=n?p.value:a.textContent,m(a),Array.isArray(i)&&2===i.length?t.setDate(i):t.clear()}}))})();1 (()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(e){for(var n=1;n<arguments.length;n++){var a=null!=arguments[n]?arguments[n]:{};n%2?t(Object(a),!0).forEach((function(t){r(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):t(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function r(t,n,r){return(n=function(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var a=r.call(t,n||"default");if("object"!=e(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}(n))in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}var a=function(){var e=document.getElementById("hcaptcha-datepicker");if(e){var t,r,a="hcaptcha-is-selected",o=HCaptchaListPageBaseObject.delimiter,c=HCaptchaListPageBaseObject.locale,i=document.getElementById("hcaptcha-options"),l=document.querySelector(".hcaptcha-filter"),u=document.getElementById("hcaptcha-datepicker-popover-button"),p=l.querySelector('input[type="radio"][data-default]');return document.addEventListener("click",f),i.querySelector("#hcaptcha-datepicker-popover-button").addEventListener("click",d),i.querySelectorAll('[type="radio"]').forEach((function(e){e.addEventListener("change",b)})),i.querySelector('[type="reset"]').addEventListener("click",v),i.addEventListener("submit",s),i.querySelector("#current-page-selector").addEventListener("keydown",y),r=l.querySelector('input[value="custom"]'),t=flatpickr(e,{mode:"range",inline:!0,allowInput:!1,enableTime:!1,clickOpens:!1,altInput:!0,altFormat:"M j, Y",dateFormat:"Y-m-d",locale:n(n({},flatpickr.l10ns[c]||{}),{},{rangeSeparator:o}),onChange:function(e,t,n){r.checked=!0,m(r.parentElement),t&&(u.textContent=n.altInput.value)}}),b({},r.checked),{}}function s(t){var n;t.preventDefault(),this.querySelectorAll('input[type="radio"]').forEach((function(e){e.name=""})),(n=u.nextElementSibling).setAttribute("aria-expanded","false"),n.style.display="none";var r=new URL(window.location.href),a=r.searchParams;a.delete("date"),e.value&&a.append("date",e.value),window.location.href=r.toString()}function d(e){e.preventDefault(),e.stopPropagation();var t=e.target.nextElementSibling;"none"===t.style.display||""===t.style.display?t.style.display="block":t.style.display="none",t.setAttribute("aria-expanded","block"===t.style.display?"true":"false")}function y(e){if("Enter"===e.key){e.preventDefault();var t=new URL(window.location.href),n=parseInt(t.searchParams.get("paged")),r=parseInt(e.target.value);(isNaN(n)||n<1)&&(n=1),isNaN(r)||r<1||(t.searchParams.delete("paged"),r!==n&&(t.searchParams.set("paged",r.toString()),window.location.href=t.href))}}function f(e){var t=document.querySelector(".hcaptcha-datepicker-popover");t.contains(e.target)||(t.style.display="none")}function m(e){l.querySelectorAll("label").forEach((function(e){e.classList.remove(a)})),e.classList.add(a)}function v(e){e.preventDefault(),p.checked=!0,b()}function b(){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=l.querySelector("input:checked"),a=r.parentElement,c=n?e:r,i=c.value.split(o),p=c.nextElementSibling;u.textContent=n?p.value:a.textContent,m(a),Array.isArray(i)&&2===i.length?t.setDate(i):t.clear()}};window.hCaptchaSettingsListPagePage=a,document.addEventListener("DOMContentLoaded",a)})(); -
hcaptcha-for-forms-and-more/trunk/changelog.txt
r3233179 r3248039 1 = 4.11.0 = 2 * Added Really Simple CAPTCHA plugin integration. 3 * Added compatibility with the UsersWP plugin v1.2.28. 4 * Added compatibility with Perfmatters plugin. 5 * Added support for the Fluent Login form. 6 * Added confirmation messages upon deletion of events on the Forms and Events pages. 7 * Added asynchronous migrations for large databases. 8 * Added hCaptcha error messages to the Contact Form 7 when JavaScript is disabled. 9 * Optimized Forms page performance for large databases with millions of entries. 10 * Fixed processing wpDiscuz comment form with wpDiscuz custom ajax. 11 * Fixed adding hCaptcha internal fields to Avada from submission. 12 * Fixed ASC ordering by date on the Events page. 13 * Fixed selection of a time interval on the Events page when site local time was not GMT. 14 * Fixed losing options during plugin update in rare cases. 15 * Fixed the live hCaptcha tag on the Contact Form 7 edit page after insertion but before saving the form. 16 * Fixed shortcode processing in the Contact Form 7 form when Auto-Add was off. 17 * Fixed error on theme installation. 18 * Tested with WooCommerce 9.7. 19 1 20 = 4.10.0 = 2 21 * Added support for wp_login_form() function and LoginOut block. … … 219 238 * Fixed Content Security Policy headers processing. 220 239 240 = 3.10.1 = 241 * Added filter `hcap_add_csp_headers` to allow adding Content Security Policy headers. 242 * Fixed Content Security Policy headers processing. 243 221 244 = 3.10.0 = 222 245 * Tested with WordPress 6.5. … … 276 299 * Added optional Enterprise settings. 277 300 * Fixed improper display of the "rate plugin" message on options.php. 278 * Fixed colored border of hCaptcha challenge arrow.301 * Fixed the colored border of hCaptcha challenge arrow. 279 302 280 303 = 3.6.0 = … … 300 323 * Added hCaptcha field to Ninja Forms admin editor. 301 324 * Added invisible hCaptcha support for Ninja Forms. 302 * Added the ability to process customized Mail Chimp forms.325 * Added the ability to process customized Mailchimp forms. 303 326 * Added HTML Forms integration. 304 327 * Added the Auto Theme option to follow light/dark theme settings on site. … … 359 382 360 383 = 3.3.0 = 361 * Color scheme inadmin UI has been updated.384 * The color scheme in the admin UI has been updated. 362 385 * Added compatibility with Passster. 363 386 * Added compatibility with Theme My Login. -
hcaptcha-for-forms-and-more/trunk/hcaptcha.php
r3233179 r3248039 11 11 * Plugin URI: https://www.hcaptcha.com/ 12 12 * Description: hCaptcha keeps out bots and spam while putting privacy first. It is a drop-in replacement for reCAPTCHA. 13 * Version: 4.1 0.013 * Version: 4.11.0 14 14 * Requires at least: 5.3 15 15 * Requires PHP: 7.2 … … 22 22 * 23 23 * WC requires at least: 3.0 24 * WC tested up to: 9. 624 * WC tested up to: 9.7 25 25 */ 26 26 … … 40 40 * Plugin version. 41 41 */ 42 const HCAPTCHA_VERSION = '4.1 0.0';42 const HCAPTCHA_VERSION = '4.11.0'; 43 43 44 44 /** -
hcaptcha-for-forms-and-more/trunk/readme.txt
r3233179 r3248039 5 5 Tested up to: 6.7 6 6 Requires PHP: 7.2 7 Stable tag: 4.1 0.07 Stable tag: 4.11.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 35 35 * **Logged-in Users:** Optionally turn off hCaptcha for logged-in users. 36 36 * **Delayed API Loading:** Load the hCaptcha API instantly or on user interaction for zero page load impact. 37 * ** White List IPs:** Whitelist certain IPs to skip hCaptcha verification.37 * **Allowlist IPs:** Allowlist certain IPs to skip hCaptcha verification. 38 38 * **Multisite Support:** Sync hCaptcha settings across a Multisite Network. 39 39 … … 59 59 The purpose of a CAPTCHA is to distinguish between people and machines via a challenge-response test, and thus increase the cost of spamming or otherwise abusing websites by keeping out bots. 60 60 61 To use this plugin, install it and enter your sitekey and secret in the Settings ->hCaptcha menu after signing up on hCaptcha.com.61 To use this plugin, install it and enter your sitekey and secret in the Settings → hCaptcha menu after signing up on hCaptcha.com. 62 62 63 63 [hCaptcha Free](https://www.hcaptcha.com/) lets websites block bots and other forms of abuse via humanity challenges. … … 88 88 1. Install hCaptcha either via the WordPress.org plugin repository (best) or by uploading the files to your server. ([Upload instructions](https://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/)) 89 89 2. Activate the hCaptcha plugin on the 'Plugins' admin page 90 3. Enter your site key and secret on the Settings ->hCaptcha->General page91 4. Enable desired Integrations on the Settings ->hCaptcha->Integrations page90 3. Enter your site key and secret on the Settings→hCaptcha→General page 91 4. Enable desired Integrations on the Settings→hCaptcha→Integrations page 92 92 93 93 == Frequently Asked Questions == … … 115 115 ` 116 116 117 The shortcode adds not only the hCaptcha div to the form ,but also a nonce field. You can set your own nonce action and name. For this, use arguments in the shortcode:117 The shortcode adds not only the hCaptcha div to the form but also a nonce field. You can set your own nonce action and name. For this, use arguments in the shortcode: 118 118 119 119 ` … … 398 398 } 399 399 400 // Turn off protection for Gravity form with id = 1.400 // Turn off protection for a Gravity form with id = 1. 401 401 return false; 402 402 } … … 449 449 ` 450 450 451 = How to whitelist certain IPs =451 = How to allowlist certain IPs = 452 452 453 453 You can use the following filter. It should be added to your plugin's (or mu-plugin's) main file. This filter won't work being added to a theme's functions.php file. … … 455 455 ` 456 456 /** 457 * Filter user IP to check if it is whitelisted.458 * For whitelisted IPs, hCaptcha will not be shown.457 * Filter user IP to check if it is allowlisted. 458 * For allowlisted IPs, hCaptcha will not be shown. 459 459 * 460 * @param bool $ whitelisted Whether IP is whitelisted.460 * @param bool $allowlisted Whether IP is allowlisted. 461 461 * @param string $ip IP. 462 462 * 463 463 * @return bool 464 464 */ 465 function my_hcap_ whitelist_ip( $whitelisted, $ip ) {466 467 // Whitelist local IPs.465 function my_hcap_allowlist_ip( $allowlisted, $ip ) { 466 467 // Allowlist local IPs. 468 468 if ( false === $ip ) { 469 469 return true; 470 470 } 471 471 472 // Whitelist some other IPs.472 // Allowlist some other IPs. 473 473 if ( '1.1.1.1' === $ip ) { 474 474 return true; 475 475 } 476 476 477 return $ whitelisted;477 return $allowlisted; 478 478 } 479 479 480 add_filter( 'hcap_whitelist_ip', 'my_hcap_ whitelist_ip', 10, 2 );480 add_filter( 'hcap_whitelist_ip', 'my_hcap_allowlist_ip', 10, 2 ); 481 481 ` 482 482 … … 568 568 * Essential Blocks Form 569 569 * Extra Comment, Contact, Email Optin and Login Forms 570 * Fluent Forms 570 * Fluent Forms, including Login Form 571 571 * Forminator Forms 572 572 * Formidable Forms … … 587 587 * Passster Protection Form 588 588 * Profile Builder Login, Recover Password, and Register Forms 589 * Really Simple CAPTCHA 589 590 * Quform Forms 590 591 * Sendinblue Form … … 616 617 [open a pull request](https://github.com/hCaptcha/hcaptcha-wordpress-plugin). 617 618 618 We also suggest emailing the authors of plugins you'd like to support hCaptcha: it will usually take them only an hour or two to add native support. This will simplify your use of hCaptcha ,and is the best solution in the long run.619 We also suggest emailing the authors of plugins you'd like to support hCaptcha: it will usually take them only an hour or two to add native support. This will simplify your use of hCaptcha and is the best solution in the long run. 619 620 620 621 You may use native hCaptcha support if available for your plugin. Please check with your plugin author if native support is not yet available. … … 627 628 628 629 == Changelog == 630 631 = 4.11.0 = 632 * Added Really Simple CAPTCHA plugin integration. 633 * Added compatibility with the UsersWP plugin v1.2.28. 634 * Added compatibility with Perfmatters plugin. 635 * Added support for the Fluent Login form. 636 * Added confirmation messages upon deletion of events on the Forms and Events pages. 637 * Added asynchronous migrations for large databases. 638 * Added hCaptcha error messages to the Contact Form 7 when JavaScript is disabled. 639 * Optimized Forms page performance for large databases with millions of entries. 640 * Fixed processing wpDiscuz comment form with wpDiscuz custom ajax. 641 * Fixed adding hCaptcha internal fields to Avada from submission. 642 * Fixed ASC ordering by date on the Events page. 643 * Fixed selection of a time interval on the Events page when site local time was not GMT. 644 * Fixed losing options during plugin update in rare cases. 645 * Fixed the live hCaptcha tag on the Contact Form 7 edit page after insertion but before saving the form. 646 * Fixed shortcode processing in the Contact Form 7 form when Auto-Add was off. 647 * Fixed error on theme installation. 648 * Tested with WooCommerce 9.7. 629 649 630 650 = 4.10.0 = … … 637 657 * Added deletion of events on the Events page. 638 658 * Improved error messaging for hCaptcha verification. 639 * Fixed IP detection in the WordPress core via filter. Now syncs with hCaptcha event information when IP collection is activated.659 * Fixed IP detection in the WordPress core via filter. Now syncs with hCaptcha event information when an IP collection is activated. 640 660 * Fixed fatal error with the WPForms plugin in rare cases. 641 661 * Fixed error message at the first entry to the login page when Hide Login Errors in on. … … 653 673 * Added the ability to install plugins and themes from the Integrations page. 654 674 * Added ability to hide the login errors. 655 * Added an onymous collection of IP and User Agent data in locally stored analytics to simplify GDPR compliance.675 * Added an anonymous collection of IP and User Agent data in locally stored analytics to simplify GDPR compliance. 656 676 * Added extended info about IP address on the Events page on hover. 657 677 * Added selecting any page on Forms and Events. … … 660 680 * Fixed fatal error as a consequence of a bug in the TutorLMS. 661 681 * Fixed help text box layout on the General page. 662 * Fixed dismiss and reset Notifications actions.682 * Fixed the dismiss and reset Notifications actions. 663 683 * Fixed duplication of entries in the Events table. 664 684 … … 672 692 * Added 'theme' badge to themes on the Integrations page. 673 693 * Updated hCaptcha API error codes. 674 * Fixed processing of Divi form with diacritical marks.694 * Fixed processing of a Divi form with diacritical marks. 675 695 * Fixed deactivating of all themes by Ctrl+Click on the Integrations page. 676 696 * Fixed theme name display upon activation. … … 693 713 * Added compatibility with Akismet tag in Contact Form 7. 694 714 * Added compatibility with Elementor Element Caching. 695 * Added activation and deactivation of plugin snetwork wide if hCaptcha is set network wide.715 * Added activation and deactivation of plugin network wide if hCaptcha is set network wide. 696 716 * Added ability to use shortcode in the Jetpack Classic form. 697 717 * Added ability to use shortcode in the Mailchimp for WP form. … … 733 753 * Fixed error messaging when there are several Jetpack forms on the same page. 734 754 * Fixed unconditional forcing hCaptcha in Jetpack forms. 735 * Fixed appearance of Beaver Builder editor with "Turn Off When Logged In" setting.736 * Fixed appearance of Contact Form 7 editor with "Turn Off When Logged In" setting.737 * Fixed appearance of Essential Addons editor with "Turn Off When Logged In" setting.738 * Fixed appearance of Gravity Forms editor with "Turn Off When Logged In" setting.739 * Fixed appearance of Fluent Forms editor with "Turn Off When Logged In" setting.740 * Fixed appearance of Forminator editor with "Turn Off When Logged In" setting.741 * Fixed appearance of Formidable Forms with "Turn Off When Logged In" setting.742 * Fixed appearance of Ninja Forms editor with "Turn Off When Logged In" setting.743 * Fixed appearance of WPForms editor with "Turn Off When Logged In" setting.755 * Fixed the appearance of Beaver Builder editor with "Turn Off When Logged In" setting. 756 * Fixed the appearance of Contact Form 7 editor with "Turn Off When Logged In" setting. 757 * Fixed the appearance of Essential Addons editor with "Turn Off When Logged In" setting. 758 * Fixed the appearance of Gravity Forms editor with "Turn Off When Logged In" setting. 759 * Fixed the appearance of Fluent Forms editor with "Turn Off When Logged In" setting. 760 * Fixed the appearance of Forminator editor with "Turn Off When Logged In" setting. 761 * Fixed the appearance of Formidable Forms with "Turn Off When Logged In" setting. 762 * Fixed the appearance of Ninja Forms editor with "Turn Off When Logged In" setting. 763 * Fixed the appearance of WPForms editor with "Turn Off When Logged In" setting. 744 764 * Fixed fatal error on Gravity Forms Entries page. 745 765 * Fixed Elementor preview. … … 844 864 * Tested with WooCommerce 8.7. 845 865 846 = 3.10.1 =847 * Added filter `hcap_add_csp_headers` to allow adding Content Security Policy headers.848 * Fixed Content Security Policy headers processing.849 850 = 3.10.0 =851 * Tested with WordPress 6.5.852 * Tested with WooCommerce 8.6.853 * The minimum required WordPress version is now 5.1.854 * Added Force hCaptcha check before submit feature.855 * Added Elementor Pro Login integration.856 * Added Login/Signup Popup integration.857 * Added CoBlocks integration.858 * Added Enterprise parameters to the System Info page.859 * Added checking of Enterprise parameters before saving.860 * Improved translation on Settings pages.861 * Improved error reporting for Active hCaptcha on the General page.862 * Fixed hCaptcha error codes table.863 * Fixed Settings pages layout with Chrome 122.864 * Fixed Content Security Policy headers.865 * Fixed fatal error with Formidable Forms 6.8.2.866 867 = 3.9.0 =868 * Added Spectra — WordPress Gutenberg Blocks integration.869 * Added Akismet integration.870 * Added test of hCaptcha completion before checking the site config.871 * Added site config check upon changing Enterprise params.872 * Added auto verify feature for forms in widgets.873 * Fixed site config check upon changing site and secret keys.874 * Fixed the list of themes after activation on the Integrations page.875 * Fixed jumping WooCommerce checkout page to hCaptcha on a page load.876 * Fixed missing hCaptcha on the Divi Comment Form.877 878 = 3.8.1 =879 * Fixed activation and deactivation of plugin and themes on the Integrations page.880 881 = 3.8.0 =882 * Added search of plugin and themes on the Integrations page.883 * Added toggling of sections on the General page.884 * Added new dialog on activation and deactivation of plugin and themes.885 * Added selection of a new theme on deactivation of the current one.886 * Added 'backend' to optional Enterprise settings.887 * Added filter `hcap_api_host`, allowing to filter the API host.888 * Added filter `hcap_api_src`, allowing to filter the API source url with params.889 * Updated integration with Back In Stock Notifier.890 * Fixed Brevo (formerly Sendinblue) plugin position on Integrations page.891 * Fixed testing config with test accounts.892 * Fixed saving Notification state.893 * Fixed compatibility of Ninja Forms with GeoDirectory.894 * Fixed compatibility of Beaver Builder with GeoDirectory.895 * Fixed compatibility of Divi with GeoDirectory.896 * Fixed compatibility of MailPoet with GeoDirectory.897 * Fixed compatibility of Passster with GeoDirectory.898 * Fixed styles of Settings pages on mobile.899 900 = 3.7.1 =901 * Fixed adding arguments to api.js for Enterprise accounts.902 903 = 3.7.0 =904 * Tested with WooCommerce 8.5.905 * Added optional Enterprise settings.906 * Fixed improper display of the "rate plugin" message on options.php.907 * Fixed colored border of hCaptcha challenge arrow.908 909 = 3.6.0 =910 * Tested with WooCommerce 8.4.911 * Added compatibility with BuddyPress 12.0.912 * Added hCaptcha tag to Contact Form 7 Admin Editor.913 * Added support for WPForms embedded forms.914 * Added Affiliates Login Form integration.915 * Added Affiliates Register Form integration.916 * Improved login forms security.917 * Improved inline scripts to optimize page load time.918 * Improved Integrations settings page - the Save Changes button moved up for better user experience.919 * Fixed hCaptcha position in BuddyPress.920 * Fixed hCaptcha position in wpDiscuz.921 * Fixed fatal error in Brizy integration.922 * Fixed auto-detection of hCaptcha language.923 * Fixed and added some translations.924 925 = 3.5.0 =926 * Tested with PHP 8.3.927 * Tested with WooCommerce 8.3.928 * Added hCaptcha field to Gravity Forms admin editor.929 * Added hCaptcha field to Ninja Forms admin editor.930 * Added invisible hCaptcha support for Ninja Forms.931 * Added the ability to process customized Mailchimp forms.932 * Added HTML Forms integration.933 * Added the Auto Theme option to follow light/dark theme settings on site.934 * Added support for WP Twenty Twenty-One theme dark mode.935 * Added support for WP Dark Mode plugin.936 * Added support for Droit Dark Mode plugin.937 * Added ability to activate/deactivate themes from the Integrations settings page.938 * Fixed loading of local .mo files.939 * Fixed inability to send Divi Contact Form.940 * Fixed MailPoet issues in admin.941 942 = 3.4.1 =943 * Tested with WordPress 6.4.944 * Tested with WooCommerce 8.2.945 * Added MailPoet integration.946 * Added Simple Download Monitor integration.947 * Added WP Job Openings integration.948 * Added Simple Basic Contact Form integration.949 * Added Easy Digital Downloads Login Form integration.950 * Added Easy Digital Downloads Lost Password Form integration.951 * Added Easy Digital Downloads Register Form integration.952 * Added purging of old failed login data to keep the `hcaptcha_login_data` option size small.953 * Fixed compatibility with HPOS in WooCommerce.954 * Fixed fatal error caused by broken backward compatibility in the Ultimate Member 2.7.0.955 * Fixed SystemInfo on multisite.956 * Fixed the missing dependency of WooCommerce checkout script.957 * Fixed fatal error occurred during login under some conditions.958 * Fixed the inability to send the Divi Contact Form when Divi Email Optin was active.959 960 = 3.3.3 =961 * Added compatibility with LearnDash.962 * Added requirement to check the site config after changes in credentials.963 * Added filter `hcap_login_limit_exceeded`, allowing to filter the login limit exceeded status.964 * Changed Brevo (formerly Sendinblue) logo.965 * Fixed activation of hCaptcha with empty keys.966 * Fixed autocomplete of the Site Key field by LastPass.967 * Fixed form detection for Auto-Verify.968 * Fixed Brevo form working in the post content only.969 * Fixed hCaptcha not loading correctly for a Brevo form.970 * Fixed Passster form working in the post content only.971 * Fixed LearnDash form working in the post content only.972 * Fixed auto-verify form not working on the homepage.973 974 = 3.3.2 =975 * Improved Beaver Builder login sequence.976 * Improved Classified Listing login sequence.977 * Improved Divi login sequence.978 * Improved MemberPress login sequence.979 * Improved Paid Membership Pro login sequence.980 * Improved Profile Builder login sequence.981 * Improved Ultimate Member login sequence.982 * Improved Wordfence login sequence.983 * Improved native WordPress login sequence.984 * Fixed login error when WP Login form option was `'on'` and WC Login form option was `'off'`.985 * Fixed compatibility with WPS Hide Login.986 * Fixed compatibility with All-In-One Security.987 * Fixed compatibility with Rename wp-admin Login.988 989 = 3.3.0 =990 * Color scheme in admin UI has been updated.991 * Added compatibility with Passster.992 * Added compatibility with Theme My Login.993 * Added compatibility with Gravity Perks Nested Forms.994 * Added compatibility with Wordfence Login Security.995 * Added compatibility with Wordfence Security.996 * Added compatibility with UsersWP.997 * Added compatibility with Kadence Advanced Form.998 * Improved support for a Kadence simple form.999 * Replaced deprecated ajaxStop events.1000 * Fixed error on a Classified Listing Login form.1001 * Fixed admin page title.1002 1003 = 3.2.0 =1004 * Tested with WooCommerce 8.0.1005 * Added ability to use hCaptcha field provided by the Fluent Forms plugin.1006 * Added ability to use hCaptcha field provided by the Forminator plugin.1007 * Added ability to use hCaptcha field provided by the Quform plugin.1008 * Added hCaptcha reset to allow sending an Elementor form several times without reloading the page.1009 * Added hCaptcha reset to allow sending a Forminator form several times without reloading the page.1010 * Added hCaptcha reset to allow sending a Quform form several times without reloading the page.1011 * Blocked hCaptcha settings on Fluent Forms admin pages with a notice having a link to the hCaptcha plugin General settings page.1012 * Blocked hCaptcha settings on Forminator admin pages with a notice having a link to the hCaptcha plugin General settings page.1013 * Blocked hCaptcha settings on Quform admin pages with a notice having a link to the hCaptcha plugin General settings page.1014 * Fixed Fluent Forms submit error.1015 * Fixed positioning of hCaptcha in Fluent Form.1016 * Fixed deprecation errors in debug.log that occurred with Fluent Forms.1017 * Fixed Forminator form display error.1018 * Fixed dynamic display of settings in sample hCaptcha.1019 1020 = 3.1.0 =1021 * Added notification system.1022 * Fixed mode selection for sample hCaptcha on the General settings page.1023 1024 = 3.0.1 =1025 * Fixed error on Contact Form 7 validation.1026 * Fixed checkboxes disabled status after activation of a plugin on the Integrations page.1027 1028 = 3.0.0 =1029 * Dropped support for PHP 5.6. The minimum required PHP version is now 7.0.1030 * Tested with WordPress 6.3.1031 * Tested with WooCommerce 7.9.1032 * Added hCaptcha config check to the General settings page.1033 * Added dynamic display of settings in sample hCaptcha.1034 * Added compatibility with Ajax Gravity Forms.1035 * Added compatibility with Profile Builder.1036 * Added compatibility with an Easy Digital Downloads Checkout form.1037 1038 866 [See changelog for all versions](https://plugins.svn.wordpress.org/hcaptcha-for-forms-and-more/trunk/changelog.txt). -
hcaptcha-for-forms-and-more/trunk/src/php/Admin/Events/Events.php
r3233179 r3248039 21 21 */ 22 22 public const TABLE_NAME = 'hcaptcha_events'; 23 24 /** 25 * Served items limit. 26 */ 27 public const SERVED_LIMIT = 1000; 23 28 24 29 /** … … 131 136 global $wpdb; 132 137 133 $args = wp_parse_args( 134 $args, 135 [ 136 'columns' => [], 137 'offset' => 0, 138 'limit' => 20, 139 'order' => 'ASC', 140 'orderby' => '', 141 'dates' => [], 142 ] 143 ); 144 $args['dates'] = $args['dates'] ?: self::get_default_dates(); 138 $args = self::prepare_args( $args ); 145 139 146 140 $columns = implode( ',', $args['columns'] ); … … 150 144 $where_date_nested = self::get_where_date_gmt_nested( $args ); 151 145 $orderby = self::get_order_by( $args ); 152 $limit = absint( $args['limit'] );146 $limit = $args['limit']; 153 147 154 148 // phpcs:disable WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.PreparedSQL.InterpolatedNotPrepared … … 160 154 WHERE $where_date", 161 155 $wpdb->prepare( 162 "SELECT 163 $columns 156 "SELECT $columns 164 157 FROM $table_name 165 158 WHERE $where_date_nested … … 210 203 global $wpdb; 211 204 212 $args = wp_parse_args( 213 $args, 214 [ 215 'offset' => 0, 216 'limit' => 20, 217 'order' => 'ASC', 218 'orderby' => '', 219 'dates' => [], 220 ] 221 ); 222 $args['dates'] = $args['dates'] ?: self::get_default_dates(); 205 $args = self::prepare_args( $args ); 223 206 224 207 $table_name = $wpdb->prefix . self::TABLE_NAME; 225 208 $where_date = self::get_where_date_gmt( $args ); 226 209 $orderby = self::get_order_by( $args ); 227 $offset = absint( $args['offset'] ); 228 $limit = absint( $args['limit'] ); 229 210 $offset = $args['offset']; 211 $limit = $args['limit']; 212 213 // We need to collect id also to distinguish rows on the Forms page. 230 214 // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching 231 215 $results = (array) $wpdb->get_results( 232 216 $wpdb->prepare( 233 217 // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared 234 "SELECT 235 SQL_CALC_FOUND_ROWS 236 id, source, form_id, COUNT(*) as served 218 "SELECT SQL_CALC_FOUND_ROWS id, source, form_id, COUNT(*) as served 237 219 FROM $table_name 238 220 WHERE $where_date … … 258 240 } 259 241 260 $where = "($where) AND " . $where_date; 242 $where = "($where) AND " . $where_date; 243 $served_limit = self::SERVED_LIMIT; 261 244 262 245 // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching 263 246 $served = (array) $wpdb->get_results( 264 247 // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared 265 "SELECT date_gmt FROM $table_name WHERE $where" 248 "SELECT date_gmt 249 FROM $table_name FORCE INDEX (date_gmt) 250 WHERE $where 251 ORDER BY date_gmt 252 LIMIT $served_limit" 266 253 // phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared 267 254 ); … … 327 314 $dates = $args['dates']; 328 315 329 if ( $dates ) { 330 $dates[1] = $dates[1] ?? $dates[0]; 331 332 $dates[0] .= ' 00:00:00'; 333 $dates[1] .= ' 23:59:59'; 334 335 foreach ( $dates as &$date ) { 336 $date = wp_date( 'Y-m-d H:i:s', strtotime( $date ) ); 337 } 338 339 unset( $date ); 340 341 $where_date = sprintf( 342 "date_gmt BETWEEN '%s' AND '%s'", 343 esc_sql( $dates[0] ), 344 esc_sql( $dates[1] ) 345 ); 346 } else { 347 $where_date = '1=1'; 348 } 349 350 return $where_date; 316 if ( ! $dates ) { 317 return '1=1'; 318 } 319 320 $dates = self::prepare_gmt_dates( $dates ); 321 322 return sprintf( 323 "date_gmt BETWEEN '%s' AND '%s'", 324 esc_sql( $dates[0] ), 325 esc_sql( $dates[1] ) 326 ); 351 327 } 352 328 … … 363 339 $dates = $args['dates']; 364 340 365 if ( $dates ) { 366 $dates[1] = $dates[1] ?? $dates[0]; 367 368 $dates[0] .= ' 00:00:00'; 369 $dates[1] .= ' 23:59:59'; 370 371 foreach ( $dates as &$date ) { 372 $date = wp_date( 'Y-m-d H:i:s', strtotime( $date ) ); 373 } 374 375 unset( $date ); 376 377 $table_name = $wpdb->prefix . self::TABLE_NAME; 378 $offset = absint( $args['offset'] ); 379 380 $where_date = sprintf( 381 "date_gmt BETWEEN '%s' AND '%s' 382 AND date_gmt <= ( 383 SELECT date_gmt 384 FROM %s 385 WHERE date_gmt BETWEEN '%s' AND '%s' 386 ORDER BY date_gmt DESC 387 LIMIT %d, 1 388 ) 389 ", 390 esc_sql( $dates[0] ), 391 esc_sql( $dates[1] ), 392 $table_name, 393 esc_sql( $dates[0] ), 394 esc_sql( $dates[1] ), 395 $offset 396 ); 397 } else { 398 $where_date = '1=1'; 399 } 400 401 return $where_date; 341 if ( ! $dates ) { 342 return '1=1'; 343 } 344 345 $dates = self::prepare_gmt_dates( $dates ); 346 $table_name = $wpdb->prefix . self::TABLE_NAME; 347 $order = $args['order']; 348 $offset = $args['offset']; 349 $compare = 'DESC' === $order ? '<=' : '>='; 350 351 return sprintf( 352 "date_gmt BETWEEN '%s' AND '%s' 353 AND date_gmt %s ( 354 SELECT date_gmt 355 FROM %s 356 WHERE date_gmt BETWEEN '%s' AND '%s' 357 ORDER BY date_gmt %s 358 LIMIT %d, 1 359 ) 360 ", 361 esc_sql( $dates[0] ), 362 esc_sql( $dates[1] ), 363 $compare, 364 $table_name, 365 esc_sql( $dates[0] ), 366 esc_sql( $dates[1] ), 367 $order, 368 $offset 369 ); 370 } 371 372 /** 373 * Prepare dates. 374 * 375 * @param array $dates Dates. 376 * 377 * @return array 378 */ 379 public static function prepare_gmt_dates( array $dates ): array { 380 $dates[1] = $dates[1] ?? $dates[0]; 381 382 $dates[0] .= ' 00:00:00'; 383 $dates[1] .= ' 23:59:59'; 384 385 foreach ( $dates as &$date ) { 386 $date = get_gmt_from_date( $date ); 387 } 388 389 unset( $date ); 390 391 return $dates; 402 392 } 403 393 … … 411 401 private static function get_order_by( array $args ): string { 412 402 $orderby = $args['orderby']; 413 $orderby = 'name' === $orderby ? 'source' : $orderby; 414 $order = strtoupper( $args['order'] ); 403 $order = $args['order']; 415 404 $order = 'ASC' === $order ? '' : $order; 416 405 … … 423 412 * @return array 424 413 */ 425 p rivatestatic function get_default_dates(): array {414 public static function get_default_dates(): array { 426 415 $end_date = date_create_immutable( 'now', wp_timezone() ); 427 416 $start_date = $end_date; … … 495 484 return preg_match( '/^' . $regex . '$/is', $subject ); 496 485 } 486 487 /** 488 * Prepare arguments. 489 * 490 * @param array $args Arguments. 491 * 492 * @return array 493 */ 494 private static function prepare_args( array $args ): array { 495 $args = wp_parse_args( 496 $args, 497 [ 498 'columns' => [], 499 'offset' => 0, 500 'limit' => 20, 501 'order' => 'ASC', 502 'orderby' => '', 503 'dates' => [], 504 ] 505 ); 506 507 $args['columns'] = array_map( 'strtolower', $args['columns'] ); 508 $args['offset'] = absint( $args['offset'] ); 509 $args['limit'] = max( 1, absint( $args['limit'] ) ); 510 $order = strtoupper( $args['order'] ); 511 $args['order'] = in_array( $order, [ 'ASC', 'DESC' ], true ) ? $order : 'ASC'; 512 $orderby = strtolower( $args['orderby'] ); 513 $args['orderby'] = in_array( $orderby, $args['columns'], true ) ? $orderby : ''; 514 $dates = (array) $args['dates']; 515 $args['dates'] = $dates ?: self::get_default_dates(); 516 517 return $args; 518 } 497 519 } -
hcaptcha-for-forms-and-more/trunk/src/php/Admin/Events/EventsTable.php
r3233179 r3248039 105 105 $orderby = isset( $_GET['orderby'] ) ? sanitize_key( $_GET['orderby'] ) : 'date_gmt'; 106 106 $date = isset( $_GET['date'] ) 107 // We need filter_input here to keep the delimiter intact. 107 108 ? filter_input( INPUT_GET, 'date', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) 108 : ''; // We need filter_input here to keep delimiter intact.109 : ''; 109 110 // phpcs:enable WordPress.Security.NonceVerification.Recommended 110 111 -
hcaptcha-for-forms-and-more/trunk/src/php/Admin/Events/FormsTable.php
r3233179 r3248039 96 96 $orderby = isset( $_GET['orderby'] ) ? sanitize_key( $_GET['orderby'] ) : 'source'; 97 97 $date = isset( $_GET['date'] ) 98 // We need filter_input here to keep the delimiter intact. 98 99 ? filter_input( INPUT_GET, 'date', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) 99 : ''; // We need filter_input here to keep delimiter intact.100 : ''; 100 101 // phpcs:enable WordPress.Security.NonceVerification.Recommended 101 102 102 $dates = explode( ListPageBase::TIMESPAN_DELIMITER, $date ); 103 $dates = array_filter( array_map( 'trim', $dates ) ); 104 $per_page = $this->get_items_per_page( self::ITEMS_PER_PAGE, $this->per_page_default ); 105 $offset = ( $paged - 1 ) * $per_page; 106 $args = [ 103 $dates = explode( ListPageBase::TIMESPAN_DELIMITER, $date ); 104 $dates = array_filter( array_map( 'trim', $dates ) ); 105 $column_slugs = str_replace( [ 'cb', 'name' ], [ 'id', 'source' ], array_keys( $this->columns ) ); 106 $per_page = $this->get_items_per_page( self::ITEMS_PER_PAGE, $this->per_page_default ); 107 $offset = ( $paged - 1 ) * $per_page; 108 $args = [ 109 'columns' => $column_slugs, 107 110 'offset' => $offset, 108 111 'limit' => $per_page, -
hcaptcha-for-forms-and-more/trunk/src/php/Affiliates/Login.php
r3114572 r3248039 57 57 */ 58 58 public function print_inline_styles(): void { 59 $css = <<<CSS 59 /* language=CSS */ 60 $css = ' 60 61 .affiliates-dashboard .h-captcha { 61 62 margin-top: 2rem; 62 63 } 63 CSS;64 '; 64 65 65 66 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/Asgaros/Base.php
r3114572 r3248039 104 104 */ 105 105 public function print_inline_styles(): void { 106 $css = <<<CSS 106 /* language=CSS */ 107 $css = ' 107 108 #af-wrapper div.editor-row.editor-row-hcaptcha { 108 109 display: flex; … … 113 114 margin-bottom: 0; 114 115 } 115 CSS;116 '; 116 117 117 118 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/Avada/Form.php
r3114572 r3248039 36 36 public function init_hooks(): void { 37 37 add_action( 'fusion_form_after_open', [ $this, 'form_after_open' ], 10, 2 ); 38 add_filter( 'fusion_builder_form_submission_data', [ $this, 'submission_data' ] ); 38 39 add_action( 'fusion_element_button_content', [ $this, 'add_hcaptcha' ], 10, 2 ); 39 40 add_filter( 'fusion_form_demo_mode', [ $this, 'verify' ] ); … … 51 52 public function form_after_open( array $args, array $params ): void { 52 53 $this->form_id = isset( $params['id'] ) ? (int) $params['id'] : 0; 54 } 55 56 /** 57 * Filter submission data. 58 * 59 * @param array|mixed $data Submission data. 60 * 61 * @return array 62 */ 63 public function submission_data( $data ): array { 64 $data = (array) $data; 65 66 unset( 67 $data['data']['hcaptcha-widget-id'], 68 $data['data']['h-captcha-response'], 69 $data['data']['g-recaptcha-response'] 70 ); 71 72 return $data; 53 73 } 54 74 -
hcaptcha-for-forms-and-more/trunk/src/php/Brizy/Base.php
r3114572 r3248039 132 132 $style_shown = true; 133 133 134 $css = <<<CSS 134 /* language=CSS */ 135 $css = ' 135 136 .brz-forms2.brz-forms2__item .h-captcha { 136 137 margin-bottom: 0; 137 138 } 138 CSS;139 '; 139 140 140 141 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/BuddyPress/CreateGroup.php
r3114572 r3248039 100 100 */ 101 101 public function print_inline_styles(): void { 102 $css = <<<'CSS' 102 /* language=CSS */ 103 $css = ' 103 104 #buddypress .h-captcha { 104 105 margin-top: 15px; 105 106 } 106 CSS;107 '; 107 108 HCaptcha::css_display( $css ); 108 109 } -
hcaptcha-for-forms-and-more/trunk/src/php/CF7/Admin.php
r3200161 r3248039 60 60 add_action( 'current_screen', [ $this, 'current_screen' ] ); 61 61 } 62 63 add_filter( 'hcap_print_hcaptcha_scripts', '__return_true' ); 62 64 } 63 65 … … 329 331 } 330 332 333 if ( ! current_user_can( 'edit_posts' ) ) { 334 wp_send_json_error( esc_html__( 'You do not have permission to update the form.', 'hcaptcha-for-forms-and-more' ) ); 335 336 return; // For testing purposes. 337 } 338 331 339 $shortcode = html_entity_decode( filter_input( INPUT_POST, 'shortcode', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) ); 332 340 $form = html_entity_decode( filter_input( INPUT_POST, 'form', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) ); -
hcaptcha-for-forms-and-more/trunk/src/php/CF7/CF7.php
r3185570 r3248039 36 36 37 37 /** 38 * Field type. 39 */ 40 public const FIELD_TYPE = 'hcaptcha'; 41 42 /** 38 43 * Init hooks. 39 44 * … … 138 143 $class = $attr['cf7-class'] ?? ''; 139 144 $hcap_form = preg_replace( 140 [ '/(<h-captcha\s+?class="h-captcha")/', '#</h-captcha>#' ], 141 [ '<span id="' . esc_attr( $id ) . '" class="wpcf7-form-control h-captcha ' . esc_attr( $class ) . '"', '</span>' ], 145 [ 146 '/(<h-captcha\s+?class="h-captcha")/', 147 '#</h-captcha>#', 148 ], 149 [ 150 '<span id="' . esc_attr( $id ) . '" class="wpcf7-form-control h-captcha ' . esc_attr( $class ) . '"', 151 '</span>', 152 ], 142 153 $hcap_form 143 154 ); 155 156 $submission = WPCF7_Submission::get_instance(); 157 $hcap_invalid_field = $submission ? $submission->get_invalid_field( 'hcap-cf7' ) : []; 158 $reason = $hcap_invalid_field['reason'] ?? ''; 159 $not_valid_tip = $reason ? '<span class="wpcf7-not-valid-tip" aria-hidden="true">' . $reason . '</span>' : ''; 144 160 145 161 return ( 146 162 '<span class="wpcf7-form-control-wrap" data-name="' . self::DATA_NAME . '">' . 147 163 $hcap_form . 148 '</span>' 164 '</span>' . 165 $not_valid_tip 149 166 ); 150 167 } … … 203 220 if ( 204 221 ! $this->mode_auto && 205 ! ( $this->mode_embed && $this->has_field( $submission, 'hcaptcha') )222 ! ( $this->mode_embed && $this->has_field( $submission, self::FIELD_TYPE ) ) 206 223 ) { 207 224 return $result; … … 228 245 */ 229 246 protected function has_field( WPCF7_Submission $submission, string $type ): bool { 230 $form_fields = $submission->get_contact_form()->scan_form_tags(); 231 232 foreach ( $form_fields as $form_field ) { 233 if ( $type === $form_field->type ) { 234 return true; 247 $has_field = false; 248 $contact_form = $submission->get_contact_form(); 249 250 if ( self::FIELD_TYPE === $type && has_shortcode( $contact_form->form_html(), 'cf7-hcaptcha' ) ) { 251 $has_field = true; 252 } else { 253 $form_fields = $contact_form->scan_form_tags(); 254 255 foreach ( $form_fields as $form_field ) { 256 if ( $type === $form_field->type ) { 257 $has_field = true; 258 } 235 259 } 236 260 } 237 261 238 return false; 262 /** 263 * Filter whether form has a field of given type. 264 * 265 * @param bool $has_field Form has field. 266 */ 267 return apply_filters( 'hcap_cf7_has_field', $has_field, $submission, $type ); 239 268 } 240 269 … … 255 284 $result->invalidate( 256 285 [ 257 'type' => 'hcaptcha',286 'type' => self::FIELD_TYPE, 258 287 'name' => self::DATA_NAME, 259 288 ], … … 292 321 */ 293 322 public function print_inline_styles(): void { 294 $css = <<<CSS 323 /* language=CSS */ 324 $css = ' 295 325 span[data-name="hcap-cf7"] .h-captcha { 296 326 margin-bottom: 0; … … 301 331 margin-top: 2rem; 302 332 } 303 CSS;333 '; 304 334 305 335 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/CoBlocks/Form.php
r3114572 r3248039 203 203 */ 204 204 public function print_inline_styles(): void { 205 $css = <<<CSS 205 /* language=CSS */ 206 $css = ' 206 207 .wp-block-coblocks-form .h-captcha { 207 208 margin-bottom: 25px; 208 209 } 209 CSS;210 '; 210 211 211 212 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/ColorlibCustomizer/Base.php
r3114572 r3248039 11 11 12 12 /** 13 * Class Login13 * Class Base 14 14 */ 15 15 abstract class Base { … … 65 65 66 66 if ( 'normal' === $hcaptcha_size ) { 67 $css = <<<CSS 67 /* language=CSS */ 68 $css = ' 68 69 .ml-container #login { 69 70 min-width: 350px; 70 71 } 71 CSS;72 '; 72 73 } 73 74 -
hcaptcha-for-forms-and-more/trunk/src/php/ColorlibCustomizer/Login.php
r3021508 r3248039 27 27 case 'compact': 28 28 case 'normal': 29 $css .= <<<CSS 29 /* language=CSS */ 30 $css .= ' 30 31 .ml-container #loginform { 31 32 height: unset; 32 33 } 33 CSS;34 '; 34 35 break; 35 36 case 'invisible': -
hcaptcha-for-forms-and-more/trunk/src/php/ColorlibCustomizer/LostPassword.php
r3021508 r3248039 27 27 case 'compact': 28 28 case 'normal': 29 $css .= <<<CSS 29 /* language=CSS */ 30 $css .= ' 30 31 .ml-container #lostpasswordform { 31 32 height: unset; 32 33 } 33 CSS;34 '; 34 35 break; 35 36 case 'invisible': -
hcaptcha-for-forms-and-more/trunk/src/php/ColorlibCustomizer/Register.php
r3021508 r3248039 27 27 case 'compact': 28 28 case 'normal': 29 $css .= <<<CSS 29 /* language=CSS */ 30 $css .= ' 30 31 .ml-container #registerform { 31 32 height: unset; 32 33 } 33 CSS;34 '; 34 35 break; 35 36 case 'invisible': -
hcaptcha-for-forms-and-more/trunk/src/php/DelayedScript/DelayedScript.php
r3215681 r3248039 19 19 * 20 20 * @param string $js js code to wrap in setTimeout(). 21 * @param int $delay Delay in ms. Negative means no delay, justwait for user interaction.21 * @param int $delay Delay in ms. Negative means no delay, wait for user interaction. 22 22 * 23 23 * @return string … … 25 25 */ 26 26 public static function create( string $js, int $delay = -1 ): string { 27 $js = <<<JS 27 /* language=JS */ 28 $js = " 28 29 ( () => { 29 30 'use strict'; … … 75 76 } ); 76 77 } )(); 77 JS;78 "; 78 79 79 80 return "<script>\n" . HCaptcha::js_minify( $js ) . "\n</script>\n"; … … 84 85 * 85 86 * @param array $args Arguments. 86 * @param int $delay Delay in ms. Negative means no delay, justwait for user interaction.87 * @param int $delay Delay in ms. Negative means no delay, wait for user interaction. 87 88 */ 88 89 public static function launch( array $args, int $delay = -1 ): void { 89 90 unset( $args['id'], $args['async'] ); 90 91 91 $js = <<<JS 92 /* language=JS */ 93 $js = " 92 94 const t = document.getElementsByTagName( 'script' )[0]; 93 95 const s = document.createElement( 'script' ); 94 96 s.type = 'text/javascript'; 95 97 s.id = 'hcaptcha-api'; 96 JS;98 "; 97 99 98 $js = "$js\n";100 $js = trim( $js, " \n\r" ); 99 101 100 102 // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped … … 107 109 } 108 110 109 $js .= "\ t\t\ts['$key'] = '$arg';\n";111 $js .= "\n\t\t\ts['$key'] = '$arg';"; 110 112 } 111 113 112 $js .= <<<JS 114 /* language=JS */ 115 $js .= ' 113 116 s.async = true; 114 117 t.parentNode.insertBefore( s, t ); 115 JS; 118 '; 119 120 $js = trim( $js, " \n\r" ); 116 121 117 122 echo self::create( $js, $delay ); -
hcaptcha-for-forms-and-more/trunk/src/php/DownloadManager/DownloadManager.php
r3185570 r3248039 119 119 */ 120 120 public function print_inline_styles(): void { 121 $css = <<<CSS 121 /* language=CSS */ 122 $css = ' 122 123 .wpdm-button-area + .h-captcha { 123 124 margin-bottom: 1rem; … … 128 129 color: #fff !important; 129 130 } 130 CSS;131 '; 131 132 132 133 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/ElementorPro/HCaptchaHandler.php
r3185570 r3248039 498 498 */ 499 499 public function print_inline_styles(): void { 500 $css = <<<CSS 500 /* language=CSS */ 501 $css = ' 501 502 .elementor-field-type-hcaptcha .elementor-field { 502 503 background: transparent !important; … … 506 507 margin-bottom: unset; 507 508 } 508 CSS;509 '; 509 510 510 511 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/ElementorPro/Login.php
r3129246 r3248039 107 107 */ 108 108 public function print_inline_styles(): void { 109 $css = <<<CSS 109 /* language=CSS */ 110 $css = ' 110 111 .elementor-widget-login .h-captcha { 111 112 margin-bottom: 0; 112 113 } 113 CSS;114 '; 114 115 115 116 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/EssentialAddons/Register.php
r3185570 r3248039 90 90 */ 91 91 public function print_inline_styles(): void { 92 $css = <<<CSS 92 /* language=CSS */ 93 $css = ' 93 94 #eael-register-form .h-captcha { 94 95 margin-top: 1rem; 95 96 margin-bottom: 0; 96 97 } 97 CSS;98 '; 98 99 99 100 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/EssentialBlocks/Form.php
r3114572 r3248039 124 124 */ 125 125 public function print_inline_styles(): void { 126 $css = <<<CSS 126 /* language=CSS */ 127 $css = ' 127 128 .wp-block-essential-blocks-form .h-captcha { 128 129 margin: 15px 0 0 0; 129 130 } 130 CSS;131 '; 131 132 132 133 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/FluentForm/Form.php
r3185570 r3248039 15 15 use FluentForm\App\Models\Form as FluentForm; 16 16 use FluentForm\App\Modules\Form\FormFieldsParser; 17 use FluentForm\Framework\Helpers\ArrayHelper; 18 use HCaptcha\Abstracts\LoginBase; 17 19 use HCaptcha\Helpers\HCaptcha; 18 20 use HCaptcha\Main; … … 21 23 /** 22 24 * Class Form 25 * 26 * Can be used as a login form also. 23 27 */ 24 class Form {28 class Form extends LoginBase { 25 29 26 30 /** 27 31 * Nonce action. 28 32 */ 29 pr ivateconst ACTION = 'hcaptcha_fluentform';33 protected const ACTION = 'hcaptcha_fluentform'; 30 34 31 35 /** 32 36 * Nonce name. 33 37 */ 34 pr ivateconst NONCE = 'hcaptcha_fluentform_nonce';38 protected const NONCE = 'hcaptcha_fluentform_nonce'; 35 39 36 40 /** … … 57 61 58 62 /** 59 * Constructor.60 */61 public function __construct() {62 $this->init_hooks();63 }64 65 /**66 63 * Init hooks. 67 64 * 68 65 * @return void 69 66 */ 70 pr ivatefunction init_hooks(): void {67 protected function init_hooks(): void { 71 68 add_filter( 'fluentform/rendering_field_html_hcaptcha', [ $this, 'render_field_hcaptcha' ], 10, 3 ); 72 69 add_action( 'fluentform/render_item_submit_button', [ $this, 'add_hcaptcha' ], 9, 2 ); … … 131 128 */ 132 129 public function verify( array $errors, array $data, FluentForm $form, array $fields ): array { 130 if ( $this->is_login_form( $form ) ) { 131 $email = (string) ArrayHelper::get( $data, 'email' ); 132 $password = (string) ArrayHelper::get( $data, 'password' ); 133 $user = get_user_by( 'email', $email ); 134 135 if ( $user && wp_check_password( $password, $user->user_pass, $user->ID ) ) { 136 $this->login( $email, $user ); 137 } else { 138 $this->login_failed( $email ); 139 } 140 141 if ( ! $this->is_login_limit_exceeded() ) { 142 return $errors; 143 } 144 145 wp_send_json( 146 __( 'Login failed. Please reload the page.', 'hcaptcha-for-forms-and-more' ), 147 423 148 ); 149 150 // For testing purposes. 151 return $errors; 152 } 153 133 154 remove_filter( 'pre_http_request', [ $this, 'pre_http_request' ] ); 134 155 … … 202 223 wp_deregister_script( $fluent_forms_conversational_script ); 203 224 204 $form = $this->get_ captcha();225 $form = $this->get_hcaptcha(); 205 226 $form = str_replace( 206 227 [ … … 307 328 public function fluentform_has_hcaptcha(): bool { 308 329 add_filter( 'pre_http_request', [ $this, 'pre_http_request' ], 10, 3 ); 330 309 331 return false; 310 332 } … … 349 371 */ 350 372 public function print_inline_styles(): void { 351 $css = <<<CSS 373 /* language=CSS */ 374 $css = ' 352 375 .frm-fluent-form .h-captcha { 353 376 line-height: 0; 354 377 margin-bottom: 0; 355 378 } 356 CSS;379 '; 357 380 358 381 HCaptcha::css_display( $css ); … … 368 391 */ 369 392 protected function has_own_hcaptcha( $form ): bool { 370 FormFieldsParser::resetData(); 371 372 if ( FormFieldsParser::hasElement( $form, 'hcaptcha' ) ) { 373 return true; 374 } 375 376 return false; 393 return $this->has_element( $form, 'hcaptcha' ); 377 394 } 378 395 … … 382 399 * @return string 383 400 */ 384 private function get_captcha(): string { 401 protected function get_hcaptcha(): string { 402 $form = FluentForm::find( $this->form_id ); 403 404 if ( $this->is_login_form( $form ) && ! $this->is_login_limit_exceeded() ) { 405 return ''; 406 } 407 385 408 $args = [ 386 409 'action' => self::ACTION, … … 396 419 397 420 /** 421 * Whether the form is a login form. 422 * 423 * @param FluentForm|stdClass $form Form. 424 * 425 * @return bool 426 */ 427 private function is_login_form( $form ): bool { 428 429 return ( 430 has_action( 'fluentform/before_insert_submission' ) && 431 $this->has_element( $form, 'input_email' ) && 432 $this->has_element( $form, 'input_password' ) 433 ); 434 } 435 436 /** 437 * Whether the form has an element. 438 * 439 * @param FluentForm|stdClass $form Form. 440 * @param string $element_name Element name. 441 * 442 * @return bool 443 */ 444 private function has_element( $form, string $element_name ): bool { 445 FormFieldsParser::resetData(); 446 447 return FormFieldsParser::hasElement( $form, $element_name ); 448 } 449 450 /** 398 451 * Get hCaptcha wrapped as Fluent Forms field. 399 452 * … … 403 456 ob_start(); 404 457 458 /* language=HTML */ 405 459 ?> 406 460 <div class="ff-el-group"> … … 409 463 <?php 410 464 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 411 echo $this->get_ captcha();465 echo $this->get_hcaptcha(); 412 466 ?> 413 467 </div> -
hcaptcha-for-forms-and-more/trunk/src/php/GravityForms/Form.php
r3233179 r3248039 252 252 */ 253 253 public function print_inline_styles(): void { 254 $css = <<<CSS 254 /* language=CSS */ 255 $css = ' 255 256 .gform_previous_button + .h-captcha { 256 257 margin-top: 2rem; … … 285 286 margin: 1em 0 0 0 !important; 286 287 } 287 CSS;288 '; 288 289 289 290 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/HTMLForms/Form.php
r3114572 r3248039 197 197 */ 198 198 public function print_inline_styles(): void { 199 $css = <<<CSS 199 /* language=CSS */ 200 $css = ' 200 201 #form-preview .h-captcha { 201 202 margin-bottom: 2rem; … … 205 206 margin-top: 2rem; 206 207 } 207 CSS;208 '; 208 209 209 210 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/Helpers/HCaptcha.php
r3233179 r3248039 405 405 */ 406 406 public static function css_display( string $css, bool $wrap = true ): void { 407 $css = trim( $css, " \n\r" ); 408 407 409 if ( $wrap ) { 408 410 echo "<style>\n"; … … 425 427 */ 426 428 public static function css_minify( string $css ): string { 429 $css = trim( $css, " \n\r" ); 430 427 431 if ( defined( 'SCRIPT_DEBUG' ) && constant( 'SCRIPT_DEBUG' ) ) { 428 432 return $css; … … 446 450 */ 447 451 public static function js_display( string $js, bool $wrap = true ): void { 452 $js = trim( $js, " \n\r" ); 453 448 454 if ( $wrap ) { 449 455 echo "<script>\n"; … … 466 472 */ 467 473 public static function js_minify( string $js ): string { 474 $js = trim( $js, " \n\r" ); 475 468 476 if ( defined( 'SCRIPT_DEBUG' ) && constant( 'SCRIPT_DEBUG' ) ) { 469 477 return $js; -
hcaptcha-for-forms-and-more/trunk/src/php/Jetpack/Base.php
r3215681 r3248039 143 143 } 144 144 145 $message = <<< HTML145 $message = ' 146 146 <div class="contact-form__input-error"> 147 147 <span class="contact-form__warning-icon"> … … 149 149 <i aria-hidden="true"></i> 150 150 </span> 151 <span> $this->error_message</span>151 <span>' . $this->error_message . '</span> 152 152 </div> 153 HTML;153 '; 154 154 155 155 return $hcaptcha . $message; … … 201 201 */ 202 202 public function print_inline_styles(): void { 203 $css = <<<CSS 203 /* language=CSS */ 204 $css = ' 204 205 form.contact-form .grunion-field-hcaptcha-wrap.grunion-field-wrap { 205 206 flex-direction: row !important; … … 210 211 margin-bottom: 0; 211 212 } 212 CSS;213 '; 213 214 214 215 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/LearnDash/Register.php
r3215681 r3248039 107 107 */ 108 108 public function print_inline_styles(): void { 109 $css = <<<CSS 109 /* language=CSS */ 110 $css = ' 110 111 #learndash_registerform .h-captcha { 111 112 margin-bottom: 0; 112 113 } 113 CSS;114 '; 114 115 115 116 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/LoginSignupPopup/Login.php
r3114572 r3248039 120 120 */ 121 121 public function print_inline_styles(): void { 122 $css = <<<CSS 122 /* language=CSS */ 123 $css = ' 123 124 .xoo-el-form-container div[data-section="login"] .h-captcha { 124 125 margin-bottom: 25px; 125 126 } 126 CSS;127 '; 127 128 128 129 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/LoginSignupPopup/Register.php
r3114572 r3248039 141 141 */ 142 142 public function print_inline_styles(): void { 143 $css = <<<CSS 143 /* language=CSS */ 144 $css = ' 144 145 .xoo-el-form-container div[data-section="register"] .h-captcha { 145 146 margin-bottom: 25px; 146 147 } 147 CSS;148 '; 148 149 149 150 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/Main.php
r3233179 r3248039 20 20 use HCaptcha\CACSP\Compatibility; 21 21 use HCaptcha\CF7\CF7; 22 use HCaptcha\CF7\ReallySimpleCaptcha; 22 23 use HCaptcha\DelayedScript\DelayedScript; 23 24 use HCaptcha\Divi\Fix; … … 190 191 191 192 add_action( 'plugins_loaded', [ $this, 'load_modules' ], self::LOAD_PRIORITY + 1 ); 192 add_filter( 'hcap_whitelist_ip', [ $this, ' whitelist_ip' ], -PHP_INT_MAX, 2 );193 add_filter( 'hcap_whitelist_ip', [ $this, 'allowlist_ip' ], -PHP_INT_MAX, 2 ); 193 194 add_action( 'before_woocommerce_init', [ $this, 'declare_wc_compatibility' ] ); 194 195 … … 252 253 * Do not load hCaptcha functionality: 253 254 * - if a user is logged in and the option 'off_when_logged_in' is set; 254 * - for whitelisted IPs;255 * - for allowlisted IPs; 255 256 * - when the site key or the secret key is empty (after first plugin activation). 256 257 */ … … 258 259 ( is_user_logged_in() && $settings->is_on( 'off_when_logged_in' ) ) || 259 260 /** 260 * Filters the user IP to check whether it is whitelisted.261 * Filters the user IP to check whether it is allowlisted. 261 262 * 262 * @param bool $ whitelisted IP is whitelisted.263 * @param bool $allowlisted IP is allowlisted. 263 264 * @param string|false $ip IP string or false for local addresses. 264 265 */ … … 438 439 * @return void 439 440 * @noinspection CssUnusedSymbol 441 * @noinspection CssUnknownTarget 440 442 */ 441 443 public function print_inline_styles(): void { … … 445 447 $bg = $settings->get_custom_theme_background() ?: 'initial'; 446 448 447 $css = <<<CSS 449 /* language=CSS */ 450 $css = ' 448 451 .h-captcha { 449 452 position: relative; … … 469 472 470 473 .h-captcha::before { 471 content: '';474 content: \'\'; 472 475 display: block; 473 476 position: absolute; 474 477 top: 0; 475 478 left: 0; 476 background: url( $div_logo_url) no-repeat;479 background: url( ' . $div_logo_url . ' ) no-repeat; 477 480 border: 1px solid transparent; 478 481 border-radius: 4px; … … 502 505 html.wp-dark-mode-active .h-captcha[data-theme="auto"]::before, 503 506 html.drdt-dark-mode .h-captcha[data-theme="auto"]::before { 504 background-image: url( $div_logo_white_url);507 background-image: url( ' . $div_logo_white_url . ' ); 505 508 background-repeat: no-repeat; 506 509 background-color: #333; … … 509 512 510 513 .h-captcha[data-theme="custom"]::before { 511 background-color: $bg;514 background-color: ' . $bg . '; 512 515 } 513 516 … … 523 526 border-style: none; 524 527 } 525 CSS;528 '; 526 529 527 530 HCaptcha::css_display( $css ); … … 535 538 */ 536 539 public function login_head(): void { 537 $css = <<<'CSS' 540 /* language=CSS */ 541 $css = ' 538 542 @media (max-width: 349px) { 539 543 .h-captcha { … … 553 557 } 554 558 } 555 CSS;559 '; 556 560 557 561 HCaptcha::css_display( $css ); … … 588 592 $host = preg_replace( '#(http|https)://#', '', $host ); 589 593 590 // We need to add scheme here, otherwise wp_parse_url returns null.594 // We need to add a scheme here, otherwise wp_parse_url returns null. 591 595 $host = (string) wp_parse_url( 'https://' . $host, PHP_URL_HOST ); 592 596 … … 753 757 // @codeCoverageIgnoreStart 754 758 if ( class_exists( FeaturesUtil::class ) ) { 755 FeaturesUtil::declare_compatibility( 'custom_order_tables', constant( 'HCAPTCHA_FILE' ) , true);759 FeaturesUtil::declare_compatibility( 'custom_order_tables', constant( 'HCAPTCHA_FILE' ) ); 756 760 } 757 761 // @codeCoverageIgnoreEnd … … 759 763 760 764 /** 761 * Filter user IP to check if it is whitelisted.762 * For whitelisted IPs, hCaptcha will not be shown.763 * 764 * @param bool|mixed $ whitelisted Whether IP is whitelisted.765 * Filter user IP to check if it is allowlisted. 766 * For allowlisted IPs, hCaptcha will not be shown. 767 * 768 * @param bool|mixed $allowlisted Whether IP is allowlisted. 765 769 * @param string|false $client_ip Client IP. 766 770 * 767 771 * @return bool|mixed 768 772 */ 769 public function whitelist_ip( $whitelisted, $client_ip ) {773 public function allowlist_ip( $allowlisted, $client_ip ) { 770 774 $ips = explode( 771 775 "\n", … … 802 806 } 803 807 804 return $ whitelisted;808 return $allowlisted; 805 809 } 806 810 … … 973 977 [ 'cf7_status', null ], 974 978 'contact-form-7/wp-contact-form-7.php', 975 [ CF7::class, Admin::class ],979 [ CF7::class, Admin::class, ReallySimpleCaptcha::class ], 976 980 ], 977 981 'Cookies and Content Security Policy' => [ … … 1491 1495 /** 1492 1496 * Is plugin active. 1493 * When network wideactivated, check if the plugin is network active.1497 * When network is widely activated, check if the plugin is network active. 1494 1498 * 1495 1499 * @param string $plugin_name Plugin name. -
hcaptcha-for-forms-and-more/trunk/src/php/Maintenance/Login.php
r3200161 r3248039 122 122 */ 123 123 public function print_inline_styles(): void { 124 $css = <<<CSS 124 /* language=CSS */ 125 $css = ' 125 126 body.maintenance > .login-form-container { 126 127 min-width: 343px; … … 136 137 margin-top: 2em; 137 138 } 138 CSS;139 '; 139 140 140 141 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/Migrations/Migrations.php
r3166267 r3248039 8 8 namespace HCaptcha\Migrations; 9 9 10 use ActionScheduler; 11 use ActionScheduler_Store; 10 12 use HCaptcha\Admin\Events\Events; 11 13 use HCaptcha\Settings\PluginSettingsBase; … … 37 39 38 40 /** 41 * Migration completed status. 42 */ 43 public const COMPLETED = - 3; 44 45 /** 39 46 * Priority of the plugins_loaded action to load Migrations. 40 47 */ … … 45 52 */ 46 53 private const PLUGIN_NAME = 'hCaptcha Plugin'; 54 55 /** 56 * Action Scheduler group name. 57 */ 58 private const AS_GROUP = 'hcaptcha'; 47 59 48 60 /** … … 58 70 * @return void 59 71 */ 60 p ublicfunction init(): void {72 private function init(): void { 61 73 if ( ! $this->is_allowed() ) { 62 74 return; … … 73 85 private function init_hooks(): void { 74 86 add_action( 'plugins_loaded', [ $this, 'migrate' ], self::LOAD_PRIORITY ); 87 add_action( 'plugins_loaded', [ $this, 'load_action_scheduler' ], -10 ); 88 89 add_action( 'async_migrate_4_11_0', [ $this, 'async_migrate_4_11_0' ] ); 90 } 91 92 /** 93 * Load action scheduler. 94 * 95 * @return void 96 */ 97 public function load_action_scheduler(): void { 98 require_once HCAPTCHA_PATH . '/vendor/woocommerce/action-scheduler/action-scheduler.php'; 75 99 } 76 100 … … 88 112 get_class_methods( $this ), 89 113 static function ( $migration ) { 90 return false !== strpos( $migration, 'migrate_' );114 return 0 === strpos( $migration, 'migrate_' ); 91 115 } 92 116 ); … … 141 165 * Determine if migration is allowed. 142 166 */ 143 p ublicfunction is_allowed(): bool {167 private function is_allowed(): bool { 144 168 // phpcs:ignore WordPress.Security.NonceVerification.Recommended 145 169 if ( isset( $_GET['service-worker'] ) ) { … … 148 172 149 173 return ( 150 ( is_admin() && ! wp_doing_ajax()) ||174 is_admin() || 151 175 wp_doing_cron() || 152 176 ( defined( 'WP_CLI' ) && constant( 'WP_CLI' ) ) … … 317 341 } 318 342 319 update_option( PluginSettingsBase::OPTION_NAME, $new_options ); 343 // This two lines is a precaution for a case if options in a new format already exist. 344 $options = get_option( PluginSettingsBase::OPTION_NAME, [] ); 345 $options = array_merge( $new_options, $options ); 346 347 update_option( PluginSettingsBase::OPTION_NAME, $options ); 320 348 321 349 foreach ( array_keys( $options_map ) as $old_option_name ) { … … 384 412 385 413 /** 414 * Migrate to 4.11.0 415 * 416 * @return bool|null 417 * @noinspection PhpUnused 418 */ 419 protected function migrate_4_11_0(): ?bool { 420 return $this->run_async( __FUNCTION__ ); 421 } 422 423 /** 424 * Async migration to 4.11.0. 425 * 426 * @return void 427 */ 428 public function async_migrate_4_11_0(): void { 429 global $wpdb; 430 431 $table_name = $wpdb->prefix . Events::TABLE_NAME; 432 433 // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching 434 // phpcs:disable WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 435 $result = $wpdb->query( 436 "CREATE INDEX idx_date_source_form 437 ON $table_name 438 (date_gmt, source, form_id)" 439 ); 440 441 if ( $result ) { 442 $wpdb->query( "DROP INDEX hcaptcha_id on $table_name" ); 443 } 444 // phpcs:enable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching 445 // phpcs:enable WordPress.DB.DirectDatabaseQuery.SchemaChange, WordPress.DB.PreparedSQL.InterpolatedNotPrepared 446 447 $this->mark_completed(); 448 } 449 450 /** 386 451 * Save license level in settings. 387 452 * … … 404 469 update_option( PluginSettingsBase::OPTION_NAME, $option ); 405 470 } 471 472 /** 473 * Run async action. 474 * 475 * @param string $method Method name. 476 * @param array $args Arguments. 477 * 478 * @return bool|null 479 * @noinspection PhpSameParameterValueInspection 480 */ 481 private function run_async( string $method, array $args = [] ): ?bool { 482 $hook = 'async_' . $method; 483 $group = self::AS_GROUP; 484 $transient = $group . '_' . $hook; 485 486 $status = (int) get_transient( $transient ); 487 488 if ( self::COMPLETED === $status ) { 489 delete_transient( $transient ); 490 491 return true; 492 } 493 494 if ( ! $status ) { 495 set_transient( $transient, self::STARTED ); 496 } 497 498 add_action( 499 'action_scheduler_init', 500 function () use ( $hook, $args, $group ) { 501 $transient = $group . '_' . $hook; 502 $status = $this->create_as_action( $hook, $args, $group ); 503 504 if ( self::FAILED === $status ) { 505 set_transient( $transient, $status ); 506 } 507 } 508 ); 509 510 return null; 511 } 512 513 /** 514 * Create an AS action. 515 * 516 * @param string $hook Hook name. 517 * @param array $args Hook arguments. 518 * @param string $group Group name. 519 * 520 * @return int Started or failed. 521 */ 522 private function create_as_action( string $hook, array $args, string $group ): int { 523 $actions = as_get_scheduled_actions( 524 [ 525 'hook' => $hook, 526 'args' => $args, 527 'group' => $group, 528 'status' => [ // All statuses except completed. 529 ActionScheduler_Store::STATUS_PENDING, 530 ActionScheduler_Store::STATUS_RUNNING, 531 ActionScheduler_Store::STATUS_FAILED, 532 ActionScheduler_Store::STATUS_CANCELED, 533 ], 534 ] 535 ); 536 537 if ( empty( $actions ) ) { 538 // Plan the unique action. 539 $action_id = as_enqueue_async_action( $hook, $args, $group, true ); 540 541 return $action_id ? self::STARTED : self::FAILED; 542 } 543 544 // Get the last action status. 545 $last_action_id = max( array_map( 'intval', array_keys( $actions ) ) ); 546 $store = ActionScheduler::store(); 547 $status = $store ? $store->get_status( $last_action_id ) : ActionScheduler_Store::STATUS_FAILED; 548 549 $started = in_array( 550 $status, 551 [ 552 ActionScheduler_Store::STATUS_PENDING, 553 ActionScheduler_Store::STATUS_RUNNING, 554 ], 555 true 556 ); 557 558 return $started ? self::STARTED : self::FAILED; 559 } 560 561 /** 562 * Mark async migration as completed. 563 * 564 * @return void 565 */ 566 private function mark_completed(): void { 567 $hook = current_action(); 568 $group = self::AS_GROUP; 569 $transient = $group . '_' . $hook; 570 571 set_transient( $transient, self::COMPLETED ); 572 } 406 573 } -
hcaptcha-for-forms-and-more/trunk/src/php/Passster/Protect.php
r3185570 r3248039 165 165 */ 166 166 public function print_inline_styles(): void { 167 $css = <<<CSS 167 /* language=CSS */ 168 $css = ' 168 169 .passster-form .h-captcha { 169 170 margin-bottom: 5px; 170 171 } 171 CSS;172 '; 172 173 173 174 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/ProfileBuilder/Login.php
r3233179 r3248039 86 86 */ 87 87 public function print_inline_styles(): void { 88 $css = <<<CSS 88 /* language=CSS */ 89 $css = ' 89 90 #wppb-loginform .h-captcha { 90 91 margin-bottom: 14px; 91 92 } 92 CSS;93 '; 93 94 94 95 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/Settings/Abstracts/SettingsBase.php
r3185570 r3248039 892 892 } 893 893 894 register_setting( $this->option_group(), $this->option_name() ); 894 $args = [ 895 'sanitize_callback' => [ $this, 'sanitize_option_callback' ], 896 ]; 897 898 register_setting( $this->option_group(), $this->option_name(), $args ); 895 899 896 900 /** … … 913 917 ); 914 918 } 919 } 920 921 /** 922 * Filters an option value following sanitization. 923 * 924 * @param array|mixed $value The sanitized option value. 925 * 926 * @return array 927 */ 928 public function sanitize_option_callback( $value ): array { 929 // Remove unexpected settings. 930 $settings = array_intersect_key( (array) $value, $this->form_fields() ); 931 932 foreach ( $settings as $key => $setting ) { 933 $type = $this->form_fields[ $key ]['type']; 934 935 switch ( $type ) { 936 case 'checkbox': 937 $settings[ $key ] = array_map( 'sanitize_text_field', $setting ); 938 break; 939 case 'textarea': 940 $settings[ $key ] = wp_kses_post( $setting ); 941 break; 942 default: 943 $settings[ $key ] = sanitize_text_field( $setting ); 944 } 945 } 946 947 return $settings; 915 948 } 916 949 -
hcaptcha-for-forms-and-more/trunk/src/php/Settings/EventsPage.php
r3233179 r3248039 8 8 namespace HCaptcha\Settings; 9 9 10 use HCaptcha\Admin\Events\Events; 10 11 use HCaptcha\Admin\Events\EventsTable; 11 12 use HCaptcha\Helpers\DB; … … 56 57 57 58 /** 58 * Init class hooks.59 */60 protected function init_hooks(): void {61 parent::init_hooks();62 63 add_action( 'wp_ajax_' . self::BULK_ACTION, [ $this, 'bulk_action' ] );64 }65 66 /**67 59 * Get page title. 68 60 * … … 108 100 109 101 $this->prepare_chart_data(); 110 }111 112 /**113 * Ajax callback for bulk actions.114 *115 * @return void116 */117 public function bulk_action(): void {118 $this->run_checks( self::BULK_ACTION );119 120 // Nonce is checked by check_ajax_referer() in run_checks().121 // phpcs:disable WordPress.Security.NonceVerification.Missing122 $bulk = isset( $_POST['bulk'] ) ? sanitize_text_field( wp_unslash( $_POST['bulk'] ) ) : '';123 $ids = isset( $_POST['ids'] )124 ? (array) json_decode( sanitize_text_field( wp_unslash( $_POST['ids'] ) ), true )125 : [];126 // phpcs:enable WordPress.Security.NonceVerification.Missing127 128 if ( 'trash' === $bulk ) {129 if ( ! $this->delete_hcaptcha_events( $ids ) ) {130 wp_send_json_error( __( 'Failed to delete the selected items.', 'hcaptcha-for-forms-and-more' ) );131 }132 133 wp_send_json_success();134 135 // For testing purposes.136 return;137 }138 139 wp_send_json_error( __( 'Invalid bulk action.', 'hcaptcha-for-forms-and-more' ) );140 102 } 141 103 … … 174 136 'bulkAction' => self::BULK_ACTION, 175 137 'bulkNonce' => wp_create_nonce( self::BULK_ACTION ), 138 'bulkMessage' => $this->get_clean_transient(), 176 139 'succeed' => $this->succeed, 177 140 'failed' => $this->failed, … … 282 245 * Delete hCaptcha events by IDs. 283 246 * 284 * @param array $ ids Array of event IDs to delete.247 * @param array $args Arguments. 285 248 * 286 249 * @return bool 287 250 */ 288 pr ivate function delete_hcaptcha_events( array $ids ): bool {251 protected function delete_events( array $args ): bool { 289 252 global $wpdb; 290 253 291 $table_name = $wpdb->prefix . 'hcaptcha_events'; 292 293 $in = DB::prepare_in( $ids, '%d' ); 254 $ids = $args['ids'] ?? []; 255 256 $table_name = $wpdb->prefix . Events::TABLE_NAME; 257 $in = DB::prepare_in( $ids, '%d' ); 294 258 295 259 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -
hcaptcha-for-forms-and-more/trunk/src/php/Settings/FormsPage.php
r3233179 r3248039 8 8 namespace HCaptcha\Settings; 9 9 10 use HCaptcha\Admin\Events\Events; 10 11 use HCaptcha\Admin\Events\FormsTable; 11 12 use KAGG\Settings\Abstracts\SettingsBase; … … 48 49 49 50 /** 50 * Init class hooks.51 */52 protected function init_hooks(): void {53 parent::init_hooks();54 55 add_action( 'wp_ajax_' . self::BULK_ACTION, [ $this, 'bulk_action' ] );56 }57 58 /**59 51 * Get page title. 60 52 * … … 98 90 99 91 $this->prepare_chart_data(); 100 }101 102 /**103 * Ajax callback for bulk actions.104 *105 * @return void106 */107 public function bulk_action(): void {108 $this->run_checks( self::BULK_ACTION );109 110 // Nonce is checked by check_ajax_referer() in run_checks().111 // phpcs:disable WordPress.Security.NonceVerification.Missing112 $bulk = isset( $_POST['bulk'] ) ? sanitize_text_field( wp_unslash( $_POST['bulk'] ) ) : '';113 $ids = isset( $_POST['ids'] )114 ? (array) json_decode( sanitize_text_field( wp_unslash( $_POST['ids'] ) ), true )115 : [];116 // phpcs:enable WordPress.Security.NonceVerification.Missing117 118 if ( 'trash' === $bulk ) {119 if ( ! $this->delete_hcaptcha_events_by_forms( $ids ) ) {120 wp_send_json_error( __( 'Failed to delete the selected items.', 'hcaptcha-for-forms-and-more' ) );121 }122 123 wp_send_json_success();124 125 // For testing purposes.126 return;127 }128 129 wp_send_json_error( __( 'Invalid bulk action.', 'hcaptcha-for-forms-and-more' ) );130 92 } 131 93 … … 164 126 'bulkAction' => self::BULK_ACTION, 165 127 'bulkNonce' => wp_create_nonce( self::BULK_ACTION ), 128 'bulkMessage' => $this->get_clean_transient(), 166 129 'served' => $this->served, 167 130 'servedLabel' => __( 'Served', 'hcaptcha-for-forms-and-more' ), … … 219 182 </p> 220 183 </canvas> 184 <?php 185 if ( count( $this->list_table->served ) >= Events::SERVED_LIMIT ) { 186 echo '<div id="hcaptcha-chart-message">'; 187 printf( 188 /* translators: 1: Number of elements. */ 189 esc_html__( 'The chart is limited to displaying a maximum of %1$s elements.', 'hcaptcha-for-forms-and-more' ), 190 esc_html( number_format_i18n( Events::SERVED_LIMIT ) ) 191 ); 192 echo '</div>'; 193 } 194 ?> 221 195 </div> 222 196 <div id="hcaptcha-forms-wrap"> … … 257 231 * Delete hCaptcha events by forms. 258 232 * 259 * @param array $ ids Array of event IDs to delete.233 * @param array $args Arguments. 260 234 * 261 235 * @return bool 262 236 */ 263 pr ivate function delete_hcaptcha_events_by_forms( array $ids ): bool {237 protected function delete_events( array $args ): bool { 264 238 global $wpdb; 265 239 266 $table_name = $wpdb->prefix . 'hcaptcha_events'; 240 $ids = $args['ids'] ?? []; 241 $dates = $args['dates'] ?? []; 242 $dates = $dates ?: Events::get_default_dates(); 243 $dates = Events::prepare_gmt_dates( $dates ); 244 245 $table_name = $wpdb->prefix . Events::TABLE_NAME; 267 246 $conditions = []; 268 247 $values = []; 269 248 249 if ( ! $ids ) { 250 return false; 251 } 252 270 253 foreach ( $ids as $item ) { 271 $conditions[] = '(source = %s AND form_id = % d)';254 $conditions[] = '(source = %s AND form_id = %s)'; 272 255 $values[] = $item['source']; 273 256 $values[] = $item['formId']; … … 275 258 276 259 $where_clause = implode( ' OR ', $conditions ); 260 $where_clause = "($where_clause) AND date_gmt BETWEEN %s AND %s"; 277 261 278 262 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching … … 281 265 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare 282 266 "DELETE FROM $table_name WHERE $where_clause", 283 ...$values 267 ...$values, 268 ...$dates 284 269 ) 285 270 ); -
hcaptcha-for-forms-and-more/trunk/src/php/Settings/General.php
r3233179 r3248039 535 535 ], 536 536 'whitelisted_ips' => [ 537 'label' => __( ' Whitelisted IPs', 'hcaptcha-for-forms-and-more' ),537 'label' => __( 'Allowlisted IPs', 'hcaptcha-for-forms-and-more' ), 538 538 'type' => 'textarea', 539 539 'section' => self::SECTION_OTHER, -
hcaptcha-for-forms-and-more/trunk/src/php/Settings/Integrations.php
r3233179 r3248039 16 16 use WP_Filesystem_Base; 17 17 use WP_Theme; 18 use WP_Upgrader;19 18 20 19 /** … … 300 299 'type' => 'checkbox', 301 300 'options' => [ 302 'form' => __( 'Form Auto-Add', 'hcaptcha-for-forms-and-more' ), 303 'embed' => __( 'Form Embed', 'hcaptcha-for-forms-and-more' ), 304 'live' => __( 'Live Form in Admin', 'hcaptcha-for-forms-and-more' ), 301 'form' => __( 'Form Auto-Add', 'hcaptcha-for-forms-and-more' ), 302 'embed' => __( 'Form Embed', 'hcaptcha-for-forms-and-more' ), 303 'live' => __( 'Live Form in Admin', 'hcaptcha-for-forms-and-more' ), 304 'replace_rsc' => __( 'Replace Really Simple CAPTCHA', 'hcaptcha-for-forms-and-more' ), 305 305 ], 306 306 ], … … 1248 1248 */ 1249 1249 protected function maybe_activate_plugin( string $plugin ) { 1250 1251 1250 if ( hcaptcha()->is_plugin_active( $plugin ) ) { 1252 1251 return true; … … 1266 1265 1267 1266 ob_start(); 1268 1269 1267 $result = $this->activate_plugin( $plugin ); 1270 1271 1268 ob_end_clean(); 1272 1269 … … 1282 1279 */ 1283 1280 protected function install_plugin( string $plugin ): ?WP_Error { 1284 1285 1281 $plugin = trim( explode( '/', $plugin )[0] ); 1286 1282 … … 1296 1292 } 1297 1293 1298 require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; 1299 require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; 1294 if ( ! class_exists( 'Plugin_Upgrader', false ) ) { 1295 // @codeCoverageIgnoreStart 1296 require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; 1297 require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; 1298 // @codeCoverageIgnoreEnd 1299 } 1300 1300 1301 1301 $api = plugins_api( … … 1457 1457 * @param string $theme Theme to activate. 1458 1458 * 1459 * @return null|WP_Error Null on success, WP_Error on failure. 1460 */ 1461 protected function activate_theme( string $theme ): ?WP_Error { 1462 if ( ! wp_get_theme( $theme )->exists() ) { 1463 return new WP_Error( 1464 'theme_not_found', 1465 __( 'Theme not found.', 'hcaptcha-for-forms-and-more' ) 1466 ); 1459 * @return null|true|WP_Error Null on success, WP_Error on failure. 1460 */ 1461 protected function activate_theme( string $theme ) { 1462 if ( wp_get_theme()->get_stylesheet() === $theme ) { 1463 return true; 1467 1464 } 1468 1465 … … 1493 1490 * @return null|WP_Error Null on success, WP_Error on failure. 1494 1491 */ 1495 pr ivatefunction install_theme( string $theme ): ?WP_Error {1492 protected function install_theme( string $theme ): ?WP_Error { 1496 1493 $theme = trim( $theme ); 1497 1494 … … 1510 1507 } 1511 1508 1512 require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; 1513 require_once ABSPATH . 'wp-admin/includes/theme.php'; 1509 if ( ! class_exists( 'Theme_Upgrader', false ) ) { 1510 // @codeCoverageIgnoreStart 1511 require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; 1512 require_once ABSPATH . 'wp-admin/includes/theme.php'; 1513 // @codeCoverageIgnoreEnd 1514 } 1514 1515 1515 1516 $api = themes_api( … … 1522 1523 1523 1524 if ( is_wp_error( $api ) ) { 1524 return new WP_Error( $api->get_error_code(), $api->get_error_message() );1525 return $api; 1525 1526 } 1526 1527 … … 1611 1612 * 1612 1613 * @return string 1613 * @noinspection PhpVoidFunctionResultUsedInspection1614 1614 */ 1615 1615 protected function get_default_theme(): string { … … 1678 1678 * Install entity (plugin or theme). 1679 1679 * 1680 * @param WP_Upgrader$upgrader Upgrader instance.1681 * @param WP_Ajax_Upgrader_Skin $skin Upgrader skin instance.1682 * @param string $download_link Download link.1680 * @param Plugin_Upgrader|Theme_Upgrader|object $upgrader Upgrader instance. 1681 * @param WP_Ajax_Upgrader_Skin|object $skin Upgrader skin instance. 1682 * @param string $download_link Download link. 1683 1683 * 1684 1684 * @return WP_Error|null 1685 * @noinspection PhpPossiblePolymorphicInvocationInspection 1686 */ 1687 protected function install_entity( WP_Upgrader $upgrader, WP_Ajax_Upgrader_Skin $skin, string $download_link ): ?WP_Error { 1685 */ 1686 protected function install_entity( object $upgrader, object $skin, string $download_link ): ?WP_Error { 1688 1687 $result = $upgrader->install( $download_link ); 1689 1688 -
hcaptcha-for-forms-and-more/trunk/src/php/Settings/ListPageBase.php
r3233179 r3248039 50 50 51 51 /** 52 * Transient name where to store a page bulk action message. 53 */ 54 protected const TRANSIENT = 'hcaptcha_page_base'; 55 56 /** 52 57 * Default date format. 53 58 */ … … 55 60 56 61 /** 62 * Bulk ajax action. 63 * Must be overridden in child classes. 64 * Here is for testing purposes. 65 */ 66 public const BULK_ACTION = ''; 67 68 /** 57 69 * Chart time unit. 58 70 * … … 67 79 */ 68 80 protected $allowed = false; 81 82 /** 83 * Delete hCaptcha events by IDs. 84 * 85 * @param array $args Arguments. 86 * 87 * @return bool 88 */ 89 abstract protected function delete_events( array $args ): bool; 69 90 70 91 /** … … 76 97 add_action( 'admin_init', [ $this, 'admin_init' ] ); 77 98 add_action( 'kagg_settings_header', [ $this, 'date_picker_display' ] ); 99 add_action( 'wp_ajax_' . static::BULK_ACTION, [ $this, 'bulk_action' ] ); 78 100 } 79 101 … … 259 281 260 282 /** 283 * Ajax callback for bulk actions. 284 * 285 * @return void 286 */ 287 public function bulk_action(): void { 288 $this->run_checks( static::BULK_ACTION ); 289 290 // Nonce is checked by check_ajax_referer() in run_checks(). 291 // phpcs:disable WordPress.Security.NonceVerification.Missing 292 $bulk = isset( $_POST['bulk'] ) ? sanitize_text_field( wp_unslash( $_POST['bulk'] ) ) : ''; 293 $ids = isset( $_POST['ids'] ) 294 ? (array) json_decode( sanitize_text_field( wp_unslash( $_POST['ids'] ) ), true ) 295 : []; 296 $date = isset( $_POST['date'] ) 297 // We need filter_input here to keep the delimiter intact. 298 ? filter_input( INPUT_POST, 'date', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) 299 : ''; 300 // phpcs:enable WordPress.Security.NonceVerification.Missing 301 302 $dates = explode( self::TIMESPAN_DELIMITER, $date ); 303 $dates = array_filter( array_map( 'trim', $dates ) ); 304 305 if ( 'trash' === $bulk ) { 306 $args = [ 307 'ids' => $ids, 308 'dates' => $dates, 309 ]; 310 311 if ( ! $this->delete_events( $args ) ) { 312 wp_send_json_error( __( 'Failed to delete the selected items.', 'hcaptcha-for-forms-and-more' ) ); 313 314 // For testing purposes. 315 return; 316 } 317 318 set_transient( 319 self::TRANSIENT, 320 __( 'Selected items have been successfully deleted.', 'hcaptcha-for-forms-and-more' ) 321 ); 322 323 wp_send_json_success(); 324 325 // For testing purposes. 326 return; 327 } 328 329 wp_send_json_error( __( 'Invalid bulk action.', 'hcaptcha-for-forms-and-more' ) ); 330 } 331 332 /** 333 * Get and clean the transient. 334 * 335 * @return string 336 */ 337 protected function get_clean_transient(): string { 338 $bulk_message = (string) get_transient( self::TRANSIENT ); 339 340 if ( $bulk_message ) { 341 delete_transient( self::TRANSIENT ); 342 } 343 344 return $bulk_message; 345 } 346 347 /** 261 348 * Sets the timespan (or date range) for performing mysql queries. 262 349 * -
hcaptcha-for-forms-and-more/trunk/src/php/Settings/Settings.php
r3200161 r3248039 7 7 8 8 // phpcs:ignore Generic.Commenting.DocComment.MissingShort 9 /** @noinspection ContractViolationInspection */10 9 11 10 namespace HCaptcha\Settings; -
hcaptcha-for-forms-and-more/trunk/src/php/Settings/SystemInfo.php
r3114572 r3248039 187 187 $data .= $this->data( 'Turn Off When Logged In', $this->is_on( 'off_when_logged_in' ) ); 188 188 $data .= $this->data( 'Disable reCAPTCHA Compatibility', $this->is_on( 'recaptcha_compat_off' ) ); 189 $data .= $this->data( ' Whitelisted IPs', $this->is_empty( $settings->get( 'whitelisted_ips' ) ) );189 $data .= $this->data( 'Allowlisted IPs', $this->is_empty( $settings->get( 'whitelisted_ips' ) ) ); 190 190 $data .= $this->data( 'Login attempts before hCaptcha', $settings->get( 'login_limit' ) ); 191 191 $data .= $this->data( 'Failed login attempts interval, min', $settings->get( 'login_interval' ) ); -
hcaptcha-for-forms-and-more/trunk/src/php/SimpleMembership/Login.php
r3166267 r3248039 97 97 */ 98 98 public function print_inline_styles(): void { 99 $css = <<<CSS 99 /* language=CSS */ 100 $css = ' 100 101 #swpm-login-form .h-captcha { 101 102 margin: 10px 0; 102 103 } 103 CSS;104 '; 104 105 105 106 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/SimpleMembership/LostPassword.php
r3166267 r3248039 98 98 */ 99 99 public function print_inline_styles(): void { 100 $css = <<<CSS 100 /* language=CSS */ 101 $css = ' 101 102 #swpm-pw-reset-form .h-captcha { 102 103 margin: 10px 0; 103 104 } 104 CSS;105 '; 105 106 106 107 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/SimpleMembership/Register.php
r3166267 r3248039 98 98 */ 99 99 public function print_inline_styles(): void { 100 $css = <<<CSS 100 /* language=CSS */ 101 $css = ' 101 102 #swpm-registration-form .h-captcha { 102 103 margin: 10px 0; 103 104 } 104 CSS;105 '; 105 106 106 107 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/Spectra/Form.php
r3143189 r3248039 155 155 $style_shown = true; 156 156 157 $css = <<<CSS 157 /* language=CSS */ 158 $css = ' 158 159 .uagb-forms-main-form .h-captcha { 159 160 margin-bottom: 20px; 160 161 } 161 CSS;162 '; 162 163 163 164 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/SupportCandy/Base.php
r3114572 r3248039 140 140 $style_shown = true; 141 141 142 $css = <<<CSS 142 /* language=CSS */ 143 $css = ' 143 144 form.wpsc-create-ticket .h-captcha { 144 145 margin: 0 15px 15px 15px; 145 146 } 146 CSS;147 '; 147 148 148 149 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/UsersWP/Register.php
r3114572 r3248039 80 80 $template = (string) ob_get_clean(); 81 81 82 ob_start(); 83 84 $args = [ 82 $args = [ 85 83 'action' => static::ACTION, 86 84 'name' => static::NONCE, … … 90 88 ], 91 89 ]; 92 93 HCaptcha::form_display( $args ); 94 95 $captcha = (string) ob_get_clean(); 96 $search = '<input type="submit"'; 90 $hcaptcha = HCaptcha::form( $args ); 91 $search = '/(<(?:input|button) type="submit")/'; 97 92 98 93 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 99 echo str_replace( $search, $captcha . $search, $template );94 echo preg_replace( $search, $hcaptcha . '$1', $template ); 100 95 } 101 96 -
hcaptcha-for-forms-and-more/trunk/src/php/WC/Login.php
r3114572 r3248039 71 71 */ 72 72 public function print_inline_styles(): void { 73 $css = <<<CSS 73 /* language=CSS */ 74 $css = ' 74 75 .woocommerce-form-login .h-captcha { 75 76 margin-top: 2rem; 76 77 } 77 CSS;78 '; 78 79 79 80 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/WC/LostPassword.php
r3114572 r3248039 60 60 */ 61 61 public function print_inline_styles(): void { 62 $css = <<<CSS 62 /* language=CSS */ 63 $css = ' 63 64 .woocommerce-ResetPassword .h-captcha { 64 65 margin-top: 0.5rem; 65 66 } 66 CSS;67 '; 67 68 68 69 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/WC/Register.php
r3114572 r3248039 94 94 */ 95 95 public function print_inline_styles(): void { 96 $css = <<<CSS 96 /* language=CSS */ 97 $css = ' 97 98 .woocommerce-form-register .h-captcha { 98 99 margin-top: 2rem; 99 100 } 100 CSS;101 '; 101 102 102 103 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/WP/Base.php
r3129246 r3248039 23 23 * 24 24 * @return string 25 * @noinspection PhpUndefinedFunctionInspection 25 26 */ 26 27 private function get_login_url(): string { … … 28 29 // Integration with WPS Hide Login plugin. 29 30 return wp_parse_url( Plugin::get_instance()->new_login_url(), PHP_URL_PATH ); 31 } 32 33 if ( function_exists( 'perfmatters_login_url' ) ) { 34 // Integration with Perfmatters plugin. 35 return wp_parse_url( perfmatters_login_url(), PHP_URL_PATH ); 30 36 } 31 37 -
hcaptcha-for-forms-and-more/trunk/src/php/WP/Comment.php
r3233179 r3248039 115 115 $comment_data = (array) $comment_data; 116 116 117 if ( is_admin() ) {117 if ( is_admin() || wp_doing_ajax() ) { 118 118 return $comment_data; 119 119 } -
hcaptcha-for-forms-and-more/trunk/src/php/WPDiscuz/Comment.php
r3129246 r3248039 138 138 */ 139 139 public function print_inline_styles(): void { 140 $css = <<<CSS 140 /* language=CSS */ 141 $css = ' 141 142 .wpd-field-hcaptcha .h-captcha { 142 143 margin-left: auto; 143 144 } 144 CSS;145 '; 145 146 146 147 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/WPDiscuz/Subscribe.php
r3114572 r3248039 79 79 */ 80 80 public function print_inline_styles(): void { 81 $css = <<<CSS 81 /* language=CSS */ 82 $css = ' 82 83 #wpdiscuz-subscribe-form .h-captcha { 83 84 margin-top: 5px; 84 85 margin-left: auto; 85 86 } 86 CSS;87 '; 87 88 88 89 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/WPForms/Form.php
r3233179 r3248039 126 126 */ 127 127 public function print_inline_styles(): void { 128 $css = <<<CSS 128 /* language=CSS */ 129 $css = ' 129 130 div.wpforms-container-full .wpforms-form .h-captcha { 130 131 position: relative; … … 152 153 position: relative; 153 154 } 154 CSS;155 '; 155 156 156 157 HCaptcha::css_display( $css ); … … 197 198 198 199 if ( isset( $fields['hcaptcha-heading'] ) ) { 199 $notice_content = <<<HTML200 $notice_content = ' 200 201 <div 201 202 id="wpforms-setting-row-hcaptcha-heading" … … 209 210 </div> 210 211 <div class="wpforms-specific-note-content"> 211 <p><strong> $label</strong></p>212 <p> $description</p>212 <p><strong>' . $label . '</strong></p> 213 <p>' . $description . '</p> 213 214 </div> 214 215 </div> 215 216 </span> 216 217 </div> 217 HTML;218 '; 218 219 219 220 $fields['hcaptcha-heading'] .= $notice_content; -
hcaptcha-for-forms-and-more/trunk/src/php/WPForo/Base.php
r3114572 r3248039 129 129 $style_shown = true; 130 130 131 $css = <<<CSS 131 /* language=CSS */ 132 $css = ' 132 133 #wpforo #wpforo-wrap div .h-captcha { 133 134 position: relative; … … 142 143 margin: 0 -20px; 143 144 } 144 CSS;145 '; 145 146 146 147 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/Wordfence/General.php
r3129246 r3248039 85 85 */ 86 86 public function print_inline_styles(): void { 87 $css = <<<CSS 88 #loginform[style="position: relative;"] > .h-captcha { 89 visibility: hidden !important; 90 } 91 CSS; 87 /* language=CSS */ 88 $css = ' 89 #loginform[style="position: relative;"] > .h-captcha { 90 visibility: hidden !important; 91 } 92 '; 92 93 93 94 HCaptcha::css_display( $css ); -
hcaptcha-for-forms-and-more/trunk/src/php/includes/request.php
r3233179 r3248039 320 320 } 321 321 322 if ( ! function_exists( 'hcaptcha_get_verify_output' ) ) { 323 /** 324 * Get verify output. 325 * 326 * @param string $empty_message Empty message. 327 * @param string $fail_message Fail message. 322 if ( ! function_exists( 'hcaptcha_get_verify_message' ) ) { 323 /** 324 * Get 'verify' message. 325 * 328 326 * @param string $nonce_field_name Nonce field name. 329 327 * @param string $nonce_action_name Nonce action name. 330 328 * 331 * @deprecated 4.7.0332 *333 329 * @return null|string Null on success, error message on failure. 334 330 */ 335 function hcaptcha_get_verify_output( string $empty_message, string $fail_message, string $nonce_field_name, string $nonce_action_name ): ?string { 336 _deprecated_function( __FUNCTION__, '4.7.0', 'hcaptcha_verify_post' ); 337 338 if ( ! empty( $empty_message ) || ! empty( $fail_message ) ) { 339 // @codeCoverageIgnoreStart 340 _deprecated_argument( __FUNCTION__, '2.1.0' ); 341 // @codeCoverageIgnoreEnd 342 } 343 331 function hcaptcha_get_verify_message( string $nonce_field_name, string $nonce_action_name ): ?string { 344 332 return hcaptcha_verify_post( $nonce_field_name, $nonce_action_name ); 345 333 } 346 334 } 347 335 348 if ( ! function_exists( 'hcaptcha_get_verify_message ' ) ) {349 /** 350 * Get 'verify' message.336 if ( ! function_exists( 'hcaptcha_get_verify_message_html' ) ) { 337 /** 338 * Get verify message HTML. 351 339 * 352 340 * @param string $nonce_field_name Nonce field name. … … 355 343 * @return null|string Null on success, error message on failure. 356 344 */ 357 function hcaptcha_get_verify_message( string $nonce_field_name, string $nonce_action_name ): ?string {358 return hcaptcha_verify_post( $nonce_field_name, $nonce_action_name );359 }360 }361 362 if ( ! function_exists( 'hcaptcha_get_verify_message_html' ) ) {363 /**364 * Get verify message HTML.365 *366 * @param string $nonce_field_name Nonce field name.367 * @param string $nonce_action_name Nonce action name.368 *369 * @return null|string Null on success, error message on failure.370 */371 345 function hcaptcha_get_verify_message_html( string $nonce_field_name, string $nonce_action_name ): ?string { 372 346 $message = hcaptcha_verify_post( $nonce_field_name, $nonce_action_name ); -
hcaptcha-for-forms-and-more/trunk/vendor/autoload.php
r3233179 r3248039 23 23 require_once __DIR__ . '/composer/autoload_real.php'; 24 24 25 return ComposerAutoloaderInit 5b9e71c5ecc4233f8a6f35918bdc1f18::getLoader();25 return ComposerAutoloaderInit3e48e8c03c5b5a02f16696bf1a21546e::getLoader(); -
hcaptcha-for-forms-and-more/trunk/vendor/composer/autoload_classmap.php
r3233179 r3248039 41 41 'HCaptcha\\CF7\\Base' => $baseDir . '/src/php/CF7/Base.php', 42 42 'HCaptcha\\CF7\\CF7' => $baseDir . '/src/php/CF7/CF7.php', 43 'HCaptcha\\CF7\\ReallySimpleCaptcha' => $baseDir . '/src/php/CF7/ReallySimpleCaptcha.php', 43 44 'HCaptcha\\ClassifiedListing\\Contact' => $baseDir . '/src/php/ClassifiedListing/Contact.php', 44 45 'HCaptcha\\ClassifiedListing\\Login' => $baseDir . '/src/php/ClassifiedListing/Login.php', -
hcaptcha-for-forms-and-more/trunk/vendor/composer/autoload_real.php
r3233179 r3248039 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 5b9e71c5ecc4233f8a6f35918bdc1f185 class ComposerAutoloaderInit3e48e8c03c5b5a02f16696bf1a21546e 6 6 { 7 7 private static $loader; … … 23 23 } 24 24 25 spl_autoload_register(array('ComposerAutoloaderInit5b9e71c5ecc4233f8a6f35918bdc1f18', 'loadClassLoader'), true, true); 25 require __DIR__ . '/platform_check.php'; 26 27 spl_autoload_register(array('ComposerAutoloaderInit3e48e8c03c5b5a02f16696bf1a21546e', 'loadClassLoader'), true, true); 26 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 27 spl_autoload_unregister(array('ComposerAutoloaderInit 5b9e71c5ecc4233f8a6f35918bdc1f18', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInit3e48e8c03c5b5a02f16696bf1a21546e', 'loadClassLoader')); 28 30 29 31 require __DIR__ . '/autoload_static.php'; 30 call_user_func(\Composer\Autoload\ComposerStaticInit 5b9e71c5ecc4233f8a6f35918bdc1f18::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInit3e48e8c03c5b5a02f16696bf1a21546e::getInitializer($loader)); 31 33 32 34 $loader->setClassMapAuthoritative(true); -
hcaptcha-for-forms-and-more/trunk/vendor/composer/autoload_static.php
r3233179 r3248039 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 5b9e71c5ecc4233f8a6f35918bdc1f187 class ComposerStaticInit3e48e8c03c5b5a02f16696bf1a21546e 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 69 69 'HCaptcha\\CF7\\Base' => __DIR__ . '/../..' . '/src/php/CF7/Base.php', 70 70 'HCaptcha\\CF7\\CF7' => __DIR__ . '/../..' . '/src/php/CF7/CF7.php', 71 'HCaptcha\\CF7\\ReallySimpleCaptcha' => __DIR__ . '/../..' . '/src/php/CF7/ReallySimpleCaptcha.php', 71 72 'HCaptcha\\ClassifiedListing\\Contact' => __DIR__ . '/../..' . '/src/php/ClassifiedListing/Contact.php', 72 73 'HCaptcha\\ClassifiedListing\\Login' => __DIR__ . '/../..' . '/src/php/ClassifiedListing/Login.php', … … 216 217 { 217 218 return \Closure::bind(function () use ($loader) { 218 $loader->prefixLengthsPsr4 = ComposerStaticInit 5b9e71c5ecc4233f8a6f35918bdc1f18::$prefixLengthsPsr4;219 $loader->prefixDirsPsr4 = ComposerStaticInit 5b9e71c5ecc4233f8a6f35918bdc1f18::$prefixDirsPsr4;220 $loader->classMap = ComposerStaticInit 5b9e71c5ecc4233f8a6f35918bdc1f18::$classMap;219 $loader->prefixLengthsPsr4 = ComposerStaticInit3e48e8c03c5b5a02f16696bf1a21546e::$prefixLengthsPsr4; 220 $loader->prefixDirsPsr4 = ComposerStaticInit3e48e8c03c5b5a02f16696bf1a21546e::$prefixDirsPsr4; 221 $loader->classMap = ComposerStaticInit3e48e8c03c5b5a02f16696bf1a21546e::$classMap; 221 222 222 223 }, null, ClassLoader::class); -
hcaptcha-for-forms-and-more/trunk/vendor/composer/installed.json
r3064004 r3248039 130 130 }, 131 131 "install-path": "../matthiasmullie/path-converter" 132 }, 133 { 134 "name": "woocommerce/action-scheduler", 135 "version": "3.9.2", 136 "version_normalized": "3.9.2.0", 137 "source": { 138 "type": "git", 139 "url": "https://github.com/woocommerce/action-scheduler.git", 140 "reference": "efbb7953f72a433086335b249292f280dd43ddfe" 141 }, 142 "dist": { 143 "type": "zip", 144 "url": "https://api.github.com/repos/woocommerce/action-scheduler/zipball/efbb7953f72a433086335b249292f280dd43ddfe", 145 "reference": "efbb7953f72a433086335b249292f280dd43ddfe", 146 "shasum": "" 147 }, 148 "require": { 149 "php": ">=7.1" 150 }, 151 "require-dev": { 152 "phpunit/phpunit": "^7.5", 153 "woocommerce/woocommerce-sniffs": "0.1.0", 154 "wp-cli/wp-cli": "~2.5.0", 155 "yoast/phpunit-polyfills": "^2.0" 156 }, 157 "time": "2025-02-03T09:09:30+00:00", 158 "type": "wordpress-plugin", 159 "extra": { 160 "scripts-description": { 161 "test": "Run unit tests", 162 "phpcs": "Analyze code against the WordPress coding standards with PHP_CodeSniffer", 163 "phpcbf": "Fix coding standards warnings/errors automatically with PHP Code Beautifier" 164 } 165 }, 166 "installation-source": "dist", 167 "notification-url": "https://packagist.org/downloads/", 168 "license": [ 169 "GPL-3.0-or-later" 170 ], 171 "description": "Action Scheduler for WordPress and WooCommerce", 172 "homepage": "https://actionscheduler.org/", 173 "support": { 174 "issues": "https://github.com/woocommerce/action-scheduler/issues", 175 "source": "https://github.com/woocommerce/action-scheduler/tree/3.9.2" 176 }, 177 "install-path": "../woocommerce/action-scheduler" 132 178 } 133 179 ], -
hcaptcha-for-forms-and-more/trunk/vendor/composer/installed.php
r3233179 r3248039 2 2 'root' => array( 3 3 'name' => 'hcaptcha/hcaptcha-wordpress-plugin', 4 'pretty_version' => '4.1 0.0',5 'version' => '4.1 0.0.0',6 'reference' => ' 3f3d675e6a0c12404a0a7aa20b4472b5d37ea88d',4 'pretty_version' => '4.11.0', 5 'version' => '4.11.0.0', 6 'reference' => '83b1b3615b255290d2a5050750f078835392d129', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 'hcaptcha/hcaptcha-wordpress-plugin' => array( 14 'pretty_version' => '4.1 0.0',15 'version' => '4.1 0.0.0',16 'reference' => ' 3f3d675e6a0c12404a0a7aa20b4472b5d37ea88d',14 'pretty_version' => '4.11.0', 15 'version' => '4.11.0.0', 16 'reference' => '83b1b3615b255290d2a5050750f078835392d129', 17 17 'type' => 'wordpress-plugin', 18 18 'install_path' => __DIR__ . '/../../', … … 38 38 'dev_requirement' => false, 39 39 ), 40 'woocommerce/action-scheduler' => array( 41 'pretty_version' => '3.9.2', 42 'version' => '3.9.2.0', 43 'reference' => 'efbb7953f72a433086335b249292f280dd43ddfe', 44 'type' => 'wordpress-plugin', 45 'install_path' => __DIR__ . '/../woocommerce/action-scheduler', 46 'aliases' => array(), 47 'dev_requirement' => false, 48 ), 40 49 ), 41 50 );
Note: See TracChangeset
for help on using the changeset viewer.