15 Commits

Author SHA1 Message Date
ogrecooper cb0f8ec691 Merge pull request 'Fix WooCommerce lost password captcha' (#12) from wc-lost-password-fix into main
Reviewed-on: #12
2026-08-26 22:33:18 +00:00
Cooper Dalrymple 04665817df Updated to version 1.2.9 2026-08-26 17:33:08 -05:00
Cooper Dalrymple d1a2758514 Nevermind, I figured it out. The standard lost password action was getting in the way. 2026-08-26 17:30:44 -05:00
Cooper Dalrymple 1539a6fc06 Disable WC lost password... for now. Getting "Token not found" error. 2026-08-26 17:27:26 -05:00
Cooper Dalrymple 958376cafd Fix parameter count on hook 2026-08-26 17:27:07 -05:00
Cooper Dalrymple f06d449065 Fix class error!! 2026-08-24 18:00:17 -05:00
ogrecooper 514b5ca03b Merge pull request 'Disable captcha on nested forms' (#11) from nested-forms into main
Reviewed-on: #11
2026-08-19 17:29:30 +00:00
Cooper Dalrymple 714af0515a Push version to 1.2.8 2026-08-19 12:28:58 -05:00
Cooper Dalrymple b3bc2f2772 Disable captcha on nested forms 2026-08-19 12:28:56 -05:00
ogrecooper e3b14cd625 Merge pull request 'Remove duplicate settings action link' (#10) from duplicate-settings-link into main
Reviewed-on: #10
2026-08-14 15:06:37 +00:00
Cooper Dalrymple 4b07e946f3 Update changelog 2026-08-14 10:06:22 -05:00
Cooper Dalrymple fd06317b1d Push to version 1.2.7 2026-08-14 10:03:33 -05:00
Cooper Dalrymple 406eb625a9 Add GF section to settings page 2026-08-14 10:03:27 -05:00
Cooper Dalrymple 05f6bc1b4b Remove GFAddOn plugin action link 2026-08-14 09:45:32 -05:00
Cooper Dalrymple e5da11e5f2 Generate ids for form locations 2026-08-03 17:14:17 -05:00
14 changed files with 137 additions and 48 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "https://getcomposer.org/schema.json",
"name": "cleverogre/ogre-captcha",
"version": "1.2.6",
"version": "1.2.9",
"title": "Ogre CAPTCHA",
"description": "Protect your site with CAPTCHA",
"author": "CleverOgre",
Generated
+5 -4
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "f65bf8d077abc18766530e9d520877ba",
"content-hash": "be46026a283f180e03369ac71487bc45",
"packages": [
{
"name": "cleverogre/plugin-framework",
@@ -12,7 +12,7 @@
"source": {
"type": "git",
"url": "git@git.cleverogre.com:cleverogre/plugin-framework.git",
"reference": "74700a249ae3b5e559c071e2467764da4645a26f"
"reference": "cbea8dd02640b88b86091801adbb3da86a8bb55c"
},
"require": {
"cleverogre/plugin-update-checker": "dev-main",
@@ -38,7 +38,8 @@
"inc/package-updater.php",
"inc/acf.php",
"inc/trait-singleton.php",
"inc/abstract-plugin.php"
"inc/abstract-plugin.php",
"inc/abstract-settings.php"
]
},
"license": [
@@ -51,7 +52,7 @@
"Plugin",
"WordPress"
],
"time": "2026-06-05T20:21:23+00:00"
"time": "2026-08-26T16:47:47+00:00"
},
{
"name": "cleverogre/plugin-update-checker",
+16 -2
View File
@@ -47,8 +47,17 @@ abstract class Location {
abstract public function activate():void;
protected function get_widget_id(): string {
return sprintf(
'cap-%s',
$this->name
);
}
public function render():void {
Widget::render();
Widget::render([
'id' => $this->get_widget_id(),
]);
}
public function process(WP_Error|null $errors = null):void {
@@ -78,7 +87,12 @@ abstract class Location {
public function footer():void {
if (!Settings::is_widget_floating()) return;
$html = ob_get_clean();
$html = Widget::set_button_floating($html);
$html = Widget::set_button_floating(
$html,
[
'id' => $this->get_widget_id(),
]
);
echo $html;
}
+2 -2
View File
@@ -4,7 +4,7 @@
* @author cleverogre
* @copyright 2026 CleverOgre
* @license GLP-3.0-or-later
* @version 1.0.0
* @version 1.2.9
* @since 1.0.0
*/
@@ -63,7 +63,7 @@ final class API {
if (empty($token)) {
$errors->add(self::ERROR_EMPTY_TOKEN, Plugin::__('Please complete CAPTCHA verification.'));
} else if (!API::verify($token)) {
} else if (!self::verify($token)) {
$errors->add(self::ERROR_INVALID_CAPTCHA, Plugin::__('Your answer was incorrect - please try again.'));
}
+17 -1
View File
@@ -4,7 +4,7 @@
* @author cleverogre
* @copyright 2026 CleverOgre
* @license GLP-3.0-or-later
* @version 1.2.5
* @version 1.2.7
* @since 1.0.0
*/
@@ -12,6 +12,7 @@ namespace Ogre\Captcha;
use Ogre\Singleton;
use Ogre\Captcha as Plugin;
use Ogre\Captcha\GravityForms\Addon;
defined('ABSPATH') || exit;
@@ -378,6 +379,21 @@ final class Settings {
]
);
if (Plugin::is_gravityforms_active() && class_exists('Ogre\Captcha\GravityForms\Addon')) {
add_settings_section(
'gravityforms',
Plugin::__('Gravity Forms'),
[$this, 'section'],
Plugin::get_id(),
[
'description' => sprintf(
Plugin::__('The configuration of Ogre CAPTCHA\'s Gravityforms integration can be found on <a href="%s">this page</a> and within the settings of each form.'),
esc_url(Addon::get_instance()->get_url())
),
]
);
}
}
+1 -1
View File
@@ -97,7 +97,7 @@ final class Widget {
);
$attributes = [
'data-cap-floating' => "#{$args['id']}",
'data-cap-floating' => '#' . $args['id'],
'data-cap-floating-position' => $args['position'],
];
+47 -3
View File
@@ -4,7 +4,7 @@
* @author cleverogre
* @copyright 2026 CleverOgre
* @license GLP-3.0-or-later
* @version 1.2.1
* @version 1.2.8
* @since 1.1.0
*/
@@ -19,6 +19,7 @@ use GFForms;
use GFAddOn;
use GFFormDisplay;
use GFCommon;
use GP_Nested_Forms;
defined('ABSPATH') || exit;
@@ -116,9 +117,19 @@ final class Addon extends GFAddOn {
}
public function is_enabled(array|null $form = null): bool {
// Check to make sure that we're enabled on the plugin level first
$plugin_enabled = $this->get_plugin_setting('enabled') === '1';
if (is_null($form) || !$plugin_enabled) return $plugin_enabled;
$form_id = !is_null($form) ? absint(rgar($form, 'id')) : 0;
// If Gravity Perks Nested Forms is active and the current form is nested, disable entirely (it's not compatible at the moment)
if (class_exists('GP_Nested_Forms')) {
$gp_nested_forms = GP_Nested_Forms::get_instance();
if ($gp_nested_forms->is_nested_form_submission() && $gp_nested_forms->get_parent_form_id() !== $form_id) return false;
}
// Now check to see if the opt-out is enabled within the form settings
$form_settings = $this->get_form_settings($form);
$form_disabled = (bool) rgar($form_settings, 'disabled');
return !$form_disabled;
@@ -135,10 +146,24 @@ final class Addon extends GFAddOn {
if (!Settings::is_connected() || !$this->is_enabled($form)) return $button_input;
if ((is_admin() && !defined('DOING_AJAX')) || GFCommon::is_form_editor()) return $button_input;
$id = sprintf(
'gform_cap_%d',
absint(rgar($form, 'id'))
);
ob_start();
Widget::render();
Widget::render([
'id' => $id,
]);
$button_input = ob_get_clean() . $button_input;
if (Settings::is_widget_floating()) $button_input = Widget::set_button_floating($button_input);
if (Settings::is_widget_floating()) {
$button_input = Widget::set_button_floating(
$button_input,
[
'id' => $id,
]
);
}
return $button_input;
}
@@ -146,7 +171,11 @@ final class Addon extends GFAddOn {
if ($context != 'form-submit') return $validation_result;
$form = $validation_result['form'];
// Make sure that we are actually processing the end of the form
if (!GFFormDisplay::is_last_page($form) || rgpost('action') == 'heartbeat') return $validation_result;
// Make sure that we are connected and enabled
if (!Settings::is_connected() || !$this->is_enabled($form)) return $validation_result;
$errors = API::process(Widget::get_token());
@@ -158,4 +187,19 @@ final class Addon extends GFAddOn {
return $validation_result;
}
public function plugin_settings_link( $links, $file ) {
// Remove plugin action link
return $links;
}
public function get_url(): string {
return add_query_arg(
[
'page' => 'gf_settings',
'subview' => $this->get_slug()
],
admin_url('admin.php')
);
}
}
+3 -1
View File
@@ -42,7 +42,9 @@ final class LoginForm extends Location {
$content .= ob_get_clean();
if (Settings::is_widget_floating()) {
Widget::add_dynamic_floating_attributes();
Widget::add_dynamic_floating_attributes([
'id' => $this->get_widget_id(),
]);
}
return $content;
+3 -1
View File
@@ -4,7 +4,7 @@
* @author cleverogre
* @copyright 2026 CleverOgre
* @license GLP-3.0-or-later
* @version 1.2.6
* @version 1.2.9
* @since 1.0.0
*/
@@ -34,8 +34,10 @@ final class LostPasswordForm extends LoginLocation {
{
parent::activate();
add_action('lostpassword_form', [$this, 'render']);
if (!isset($_POST['woocommerce-lost-password-nonce'])) {
add_action('lostpassword_post', [$this, 'process_form'], 10, 1);
}
}
public function process_form(WP_Error $errors):void {
$this->process($errors);
@@ -4,7 +4,7 @@
* @author cleverogre
* @copyright 2026 CleverOgre
* @license GLP-3.0-or-later
* @version 1.2.0
* @version 1.2.9
* @since 1.0.0
*/
@@ -37,7 +37,7 @@ final class LostPassword extends Location {
add_action('woocommerce_lostpassword_form', [$this, 'render']);
add_action('woocommerce_after_lost_password_form', [$this, 'footer']);
if (isset($_POST['woocommerce-lost-password-nonce'])) {
add_action('lostpassword_post', [$this, 'process_form']);
add_action('lostpassword_post', [$this, 'process_form'], 10, 2);
}
}
+2 -2
View File
@@ -6,14 +6,14 @@
* @author cleverogre
* @copyright 2026 CleverOgre
* @license GLP-3.0-or-later
* @version 1.2.6
* @version 1.2.7
* @since 1.0.0
*
* @wordpress-plugin
* Plugin Name: Ogre CAPTCHA
* Plugin URI: https://git.cleverogre.com/cleverogre/ogre-captcha/
* Description: Protect your site with CAPTCHA
* Version: 1.2.6
* Version: 1.2.9
* Requires at least: 6.0
* Requires PHP: 8.2
* Author: CleverOgre
+25 -25
View File
@@ -1,12 +1,12 @@
{
"name": "cleverogre/ogre-captcha",
"version": "1.2.6",
"version": "1.2.9",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "cleverogre/ogre-captcha",
"version": "1.2.6",
"version": "1.2.9",
"license": "GPL-3.0+",
"devDependencies": {
"gulp": "^5.0.0",
@@ -58,9 +58,9 @@
"license": "MIT"
},
"node_modules/@types/node": {
"version": "26.1.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.1.tgz",
"integrity": "sha512-nxAkRSVkN1Y0JC1W8ky/fTfkGsMmcrRsbx+3XoZE+rMOX71kLYTV7fLXpqud1GpbpP5TuffXFqfX7fH2GgZREw==",
"version": "26.3.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.3.0.tgz",
"integrity": "sha512-L3fgrnchriRC2ExBflb8j4uZZURHZfQsmQeyVzhjcHW4kkwVyo8/0h1B2MVzMTrYUJYu6G7EWs14hW/L9putqw==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -380,9 +380,9 @@
}
},
"node_modules/bare-events": {
"version": "2.9.1",
"resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.9.1.tgz",
"integrity": "sha512-Z0oHEHAFDZkffN8Qc39zNZjQlMDkPJRyyyZieU1VH7u8c5S+qHZ2S8ixdKIAxEjfHO7FJxXmJWgteOghVanIsg==",
"version": "2.9.2",
"resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.9.2.tgz",
"integrity": "sha512-AIPKioV7/Y/8KfZ3AAhjPJxLLbY49S64Ym5DakZlUg75qQiTgUq9hEJoEwa4eUezPUlXRy/i5NpsKvo9jgKmoA==",
"dev": true,
"license": "Apache-2.0",
"peerDependencies": {
@@ -488,16 +488,16 @@
}
},
"node_modules/brace-expansion": {
"version": "5.0.7",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz",
"integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==",
"version": "5.0.9",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",
"integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==",
"dev": true,
"license": "MIT",
"dependencies": {
"balanced-match": "^4.0.2"
},
"engines": {
"node": "18 || 20 || >=22"
"node": "20 || >=22"
}
},
"node_modules/braces": {
@@ -1769,9 +1769,9 @@
"license": "MIT"
},
"node_modules/glob/node_modules/brace-expansion": {
"version": "1.1.16",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.16.tgz",
"integrity": "sha512-IDw48K2/2kRkg9LdJxurvq3lV3aBgq0REY89duEqFRthjlPdXHKMj7EnQOXVckxzgisinf3nHfrcE2FufFLXMw==",
"version": "1.1.18",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz",
"integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -2815,9 +2815,9 @@
}
},
"node_modules/is-plain-object": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
"integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.1.0.tgz",
"integrity": "sha512-bUi/yjmtKYcRVUtWRGr0UA6xEFh2I6zWUwMrUXB3s7bmYCaZ8a+0ZsTRkrawh/mzlSD1Y0Ph8bp/U+TvBpWDNw==",
"dev": true,
"license": "MIT",
"engines": {
@@ -3232,13 +3232,13 @@
}
},
"node_modules/minimatch": {
"version": "10.2.5",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz",
"integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==",
"version": "10.2.6",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz",
"integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==",
"dev": true,
"license": "BlueOak-1.0.0",
"dependencies": {
"brace-expansion": "^5.0.5"
"brace-expansion": "^5.0.8"
},
"engines": {
"node": "18 || 20 || >=22"
@@ -4477,9 +4477,9 @@
"license": "MIT"
},
"node_modules/streamx": {
"version": "2.28.0",
"resolved": "https://registry.npmjs.org/streamx/-/streamx-2.28.0.tgz",
"integrity": "sha512-1Yowhzjf0ivGMrTIkY9hav5TxobO9qIVqUE41fiCGMGgc3CLlf4MY+9AHmZqBWgDTue0fY9zWjYFVyf6Diuobw==",
"version": "2.28.1",
"resolved": "https://registry.npmjs.org/streamx/-/streamx-2.28.1.tgz",
"integrity": "sha512-zEzXb0s5Cds7tqMH6rhZ05lcJydCWiQPEwiNngVqzsxCc962vLY4Uw+mW7od8kDH258k2Uz/JrOkdIAAhSh9VA==",
"dev": true,
"license": "MIT",
"dependencies": {
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "https://www.schemastore.org/package.json",
"name": "cleverogre/ogre-captcha",
"version": "1.2.6",
"version": "1.2.9",
"title": "Ogre CAPTCHA",
"description": "Protect your site with CAPTCHA",
"author": "CleverOgre",
+11 -1
View File
@@ -3,7 +3,7 @@ Contributors: ogrecooper, cleverogre
Tested up to: 7.0
Requires at least: 6.0
Requires PHP: 8.2
Version: 1.2.6
Version: 1.2.9
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Copyright: CleverOgre
@@ -28,6 +28,16 @@ If you don't know what plugin you have downloaded, please contact [CleverOgre](t
== Changelog ==
= 1.2.9 - 2026-08-26 =
* Fix WooCommerce lost password form
= 1.2.8 - 2026-08-19 =
* Fix compatibility issue with Gravity Perks Nested Forms
= 1.2.7 - 2026-08-14 =
* Remove duplicate settings link
* Add Gravity Forms section to settings page
= 1.2.6 - 2026-07-15 =
* Fix bug with lost password reset when using AIOWPS