13 Commits

Author SHA1 Message Date
Cooper Dalrymple 3af451a8ff Push to version 1.2.5 2026-07-01 12:11:58 -05:00
Cooper Dalrymple f310c6c2c2 Fix require license header 2026-07-01 12:00:46 -05:00
Cooper Dalrymple 099382680f Improve key inputs 2026-06-19 12:05:01 -05:00
Cooper Dalrymple 322a9d95bd Update to version 1.2.4 2026-06-18 12:36:28 -05:00
ogrecooper af10bb0e82 Merge pull request 'Minor bug fixes' (#8) from minor-bug-fixes into main
Reviewed-on: #8
2026-06-18 17:33:52 +00:00
Cooper Dalrymple 20b812e91b Fix lost password callback 2026-06-18 12:32:56 -05:00
Cooper Dalrymple 2165224454 Update packages 2026-06-18 12:32:41 -05:00
Cooper Dalrymple f8bf6e40ca Fix setters 2026-06-18 12:32:36 -05:00
Cooper Dalrymple f8e5bd4e3f Update to version 1.2.3 2026-06-12 09:55:23 -05:00
Cooper Dalrymple 5c4d471fc0 Fix non-required argument 2026-06-11 13:40:08 -05:00
Cooper Dalrymple 1cae0e1310 Update to version 1.2.2 2026-06-11 13:36:35 -05:00
Cooper Dalrymple e0ef6dd34d Prevent double loading 2026-06-09 17:34:39 -05:00
Cooper Dalrymple 47ca0903b1 Fix cli args 2026-06-09 17:34:31 -05:00
9 changed files with 112 additions and 89 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"$schema": "https://getcomposer.org/schema.json", "$schema": "https://getcomposer.org/schema.json",
"name": "cleverogre/ogre-captcha", "name": "cleverogre/ogre-captcha",
"version": "1.2.1", "version": "1.2.5",
"title": "Ogre CAPTCHA", "title": "Ogre CAPTCHA",
"description": "Protect your site with CAPTCHA", "description": "Protect your site with CAPTCHA",
"author": "CleverOgre", "author": "CleverOgre",
Generated
+1 -1
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "49f5e6f919f33ce6a3edc2992620a64a", "content-hash": "d662e21940aa15a41d819c504c3139c9",
"packages": [ "packages": [
{ {
"name": "cleverogre/plugin-framework", "name": "cleverogre/plugin-framework",
+4 -3
View File
@@ -4,7 +4,7 @@
* @author cleverogre * @author cleverogre
* @copyright 2026 CleverOgre * @copyright 2026 CleverOgre
* @license GLP-3.0-or-later * @license GLP-3.0-or-later
* @version 1.2.1 * @version 1.2.3
* @since 1.2.1 * @since 1.2.1
*/ */
@@ -109,8 +109,9 @@ final class CLI {
* @when after_wp_load * @when after_wp_load
*/ */
public function form(array $args, array $assoc_args):void { public function form(array $args, array $assoc_args):void {
list($locations) = $args; $locations = !empty($args) ? (array) array_values($args)[0] : [];
extract($assoc_args); $all = $assoc_args['all'] ?? false;
$disable = $assoc_args['disable'] ?? false;
if (empty($locations) && !$all) { if (empty($locations) && !$all) {
WP_CLI::error('Please specify one or more form locations, or use --all.'); WP_CLI::error('Please specify one or more form locations, or use --all.');
+9 -4
View File
@@ -4,7 +4,7 @@
* @author cleverogre * @author cleverogre
* @copyright 2026 CleverOgre * @copyright 2026 CleverOgre
* @license GLP-3.0-or-later * @license GLP-3.0-or-later
* @version 1.2.1 * @version 1.2.5
* @since 1.0.0 * @since 1.0.0
*/ */
@@ -122,7 +122,7 @@ final class Settings {
} }
public static function set_site_key(string $value):bool { public static function set_site_key(string $value):bool {
self::get('site_key'); self::set('site_key', $value);
return true; return true;
} }
@@ -131,7 +131,7 @@ final class Settings {
} }
public static function set_secret_key(string $value):bool { public static function set_secret_key(string $value):bool {
self::get('secret_key'); self::set('secret_key', $value);
return true; return true;
} }
@@ -278,7 +278,9 @@ final class Settings {
args: [ args: [
'name' => 'site_key', 'name' => 'site_key',
'description' => Plugin::__('Provide your Cap site key.'), 'description' => Plugin::__('Provide your Cap site key.'),
'type' => 'password', 'attributes' => [
'autocomplete' => 'off',
],
] ]
); );
@@ -291,6 +293,9 @@ final class Settings {
'name' => 'secret_key', 'name' => 'secret_key',
'description' => Plugin::__('Provide your Cap secret key.'), 'description' => Plugin::__('Provide your Cap secret key.'),
'type' => 'password', 'type' => 'password',
'attributes' => [
'autocomplete' => 'off',
],
] ]
); );
+2 -2
View File
@@ -4,7 +4,7 @@
* @author cleverogre * @author cleverogre
* @copyright 2026 CleverOgre * @copyright 2026 CleverOgre
* @license GLP-3.0-or-later * @license GLP-3.0-or-later
* @version 1.2.0 * @version 1.2.4
* @since 1.0.0 * @since 1.0.0
*/ */
@@ -35,7 +35,7 @@ final class LostPasswordForm extends LoginLocation {
{ {
parent::activate(); parent::activate();
add_action('lostpassword_form', [$this, 'render']); add_action('lostpassword_form', [$this, 'render']);
add_action('lostpassword_post', [$this, 'process_form']); add_action('lostpassword_post', [$this, 'process_form'], 10, 2);
} }
public function process_form(WP_Error $errors, WP_User|bool $user_data):void { public function process_form(WP_Error $errors, WP_User|bool $user_data):void {
+78 -74
View File
@@ -6,14 +6,14 @@
* @author cleverogre * @author cleverogre
* @copyright 2026 CleverOgre * @copyright 2026 CleverOgre
* @license GLP-3.0-or-later * @license GLP-3.0-or-later
* @version 1.2.1 * @version 1.2.5
* @since 1.0.0 * @since 1.0.0
* *
* @wordpress-plugin * @wordpress-plugin
* Plugin Name: Ogre CAPTCHA * Plugin Name: Ogre CAPTCHA
* Plugin URI: https://git.cleverogre.com/cleverogre/ogre-captcha/ * Plugin URI: https://git.cleverogre.com/cleverogre/ogre-captcha/
* Description: Protect your site with CAPTCHA * Description: Protect your site with CAPTCHA
* Version: 1.2.1 * Version: 1.2.5
* Requires at least: 6.0 * Requires at least: 6.0
* Requires PHP: 8.2 * Requires PHP: 8.2
* Author: CleverOgre * Author: CleverOgre
@@ -27,7 +27,7 @@
* Icon2x: https://plugins.cleverogre.com/wp-content/uploads/ogre-captcha-icon-256x256.png * Icon2x: https://plugins.cleverogre.com/wp-content/uploads/ogre-captcha-icon-256x256.png
* BannerLow: https://plugins.cleverogre.com/wp-content/uploads/ogre-captcha-banner-772x250.png * BannerLow: https://plugins.cleverogre.com/wp-content/uploads/ogre-captcha-banner-772x250.png
* BannerHigh: https://plugins.cleverogre.com/wp-content/uploads/ogre-captcha-banner-1544x500.png * BannerHigh: https://plugins.cleverogre.com/wp-content/uploads/ogre-captcha-banner-1544x500.png
* Requires License: yes * Require License: yes
*/ */
namespace Ogre; namespace Ogre;
@@ -41,83 +41,87 @@ defined('ABSPATH') || exit;
require_once 'vendor/autoload.php'; require_once 'vendor/autoload.php';
final class Captcha extends Plugin { if (!class_exists('Ogre\Captcha')) {
public static function is_woocommerce_active():bool { final class Captcha extends Plugin {
return is_plugin_active('woocommerce/woocommerce.php');
}
public static function is_gravityforms_active():bool { public static function is_woocommerce_active():bool {
return is_plugin_active('gravityforms/gravityforms.php'); return is_plugin_active('woocommerce/woocommerce.php');
}
protected function __construct() {
parent::__construct();
$this->add_files([
'inc/class-settings.php',
'inc/class-api.php',
'inc/class-widget.php',
'inc/abstract-location.php',
'inc/location/class-comment-form.php',
'inc/location/class-login-form.php',
'inc/location/class-login-page.php',
'inc/location/class-lost-password-form.php',
'inc/location/class-post-password-form.php',
'inc/location/class-registration-page.php',
]);
if (class_exists('WP_CLI')) {
$this->add_file('inc/class-cli.php');
} }
}
#[Override] public static function is_gravityforms_active():bool {
protected function enable():void { return is_plugin_active('gravityforms/gravityforms.php');
parent::enable();
add_filter('plugin_action_links_' . self::get_basename(), [$this, 'action_links']);
add_action('plugins_loaded', [$this, 'load_woocommerce'], 2, 0);
add_action('gform_loaded', [$this, 'load_gravityforms'], 5, 0);
}
#[Override]
protected function disable():void {
parent::disable();
remove_filter('plugin_action_links_' . self::get_basename(), [$this, 'action_links']);
remove_action('plugins_loaded', [$this, 'load_woocommerce'], 2);
remove_action('gform_loaded', [$this, 'load_gravityforms'], 5);
}
public function action_links(array $links):array {
if (current_user_can('manage_options')) {
array_unshift($links, sprintf(
'<a href="%s">%s</a>',
esc_url(Settings::get_url()),
esc_html(self::__('Settings'))
));
} }
return $links;
protected function __construct() {
parent::__construct();
$this->add_files([
'inc/class-settings.php',
'inc/class-api.php',
'inc/class-widget.php',
'inc/abstract-location.php',
'inc/location/class-comment-form.php',
'inc/location/class-login-form.php',
'inc/location/class-login-page.php',
'inc/location/class-lost-password-form.php',
'inc/location/class-post-password-form.php',
'inc/location/class-registration-page.php',
]);
if (class_exists('WP_CLI')) {
$this->add_file('inc/class-cli.php');
}
}
#[Override]
protected function enable():void {
parent::enable();
add_filter('plugin_action_links_' . self::get_basename(), [$this, 'action_links']);
add_action('plugins_loaded', [$this, 'load_woocommerce'], 2, 0);
add_action('gform_loaded', [$this, 'load_gravityforms'], 5, 0);
}
#[Override]
protected function disable():void {
parent::disable();
remove_filter('plugin_action_links_' . self::get_basename(), [$this, 'action_links']);
remove_action('plugins_loaded', [$this, 'load_woocommerce'], 2);
remove_action('gform_loaded', [$this, 'load_gravityforms'], 5);
}
public function action_links(array $links):array {
if (current_user_can('manage_options')) {
array_unshift($links, sprintf(
'<a href="%s">%s</a>',
esc_url(Settings::get_url()),
esc_html(self::__('Settings'))
));
}
return $links;
}
public function load_woocommerce():void {
if (!self::is_woocommerce_active()) return;
$this->add_files([
'inc/location/woocommerce/class-checkout.php',
'inc/location/woocommerce/class-login.php',
'inc/location/woocommerce/class-lost-password.php',
'inc/location/woocommerce/class-register.php',
]);
}
public function load_gravityforms():void {
if (!self::is_gravityforms_active() || !method_exists('GFForms', 'include_addon_framework')) return;
require_once('inc/gravityforms/class-addon.php');
GFAddOn::register(Addon::class);
}
} }
public function load_woocommerce():void { Captcha::instance();
if (!self::is_woocommerce_active()) return;
$this->add_files([
'inc/location/woocommerce/class-checkout.php',
'inc/location/woocommerce/class-login.php',
'inc/location/woocommerce/class-lost-password.php',
'inc/location/woocommerce/class-register.php',
]);
}
public function load_gravityforms():void {
if (!self::is_gravityforms_active() || !method_exists('GFForms', 'include_addon_framework')) return;
require_once('inc/gravityforms/class-addon.php');
GFAddOn::register(Addon::class);
}
} }
Captcha::instance();
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "cleverogre/ogre-captcha", "name": "cleverogre/ogre-captcha",
"version": "1.0.0", "version": "1.2.4",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "cleverogre/ogre-captcha", "name": "cleverogre/ogre-captcha",
"version": "1.0.0", "version": "1.2.4",
"license": "GPL-3.0+", "license": "GPL-3.0+",
"devDependencies": { "devDependencies": {
"gulp": "^5.0.0", "gulp": "^5.0.0",
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"$schema": "https://www.schemastore.org/package.json", "$schema": "https://www.schemastore.org/package.json",
"name": "cleverogre/ogre-captcha", "name": "cleverogre/ogre-captcha",
"version": "1.2.1", "version": "1.2.5",
"title": "Ogre CAPTCHA", "title": "Ogre CAPTCHA",
"description": "Protect your site with CAPTCHA", "description": "Protect your site with CAPTCHA",
"author": "CleverOgre", "author": "CleverOgre",
+14 -1
View File
@@ -3,7 +3,7 @@ Contributors: ogrecooper, cleverogre
Tested up to: 7.0 Tested up to: 7.0
Requires at least: 6.0 Requires at least: 6.0
Requires PHP: 8.2 Requires PHP: 8.2
Version: 1.2.1 Version: 1.2.5
License: GPLv3 or later License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html License URI: https://www.gnu.org/licenses/gpl-3.0.html
Copyright: CleverOgre Copyright: CleverOgre
@@ -28,6 +28,19 @@ If you don't know what plugin you have downloaded, please contact [CleverOgre](t
== Changelog == == Changelog ==
= 1.2.5 - 2026-07-01 =
* Improve API key input attributes
= 1.2.4 - 2026-06-18 =
* Minor bug fixes
= 1.2.3 - 2026-06-12 =
* Fix optional argument in CLI
= 1.2.2 - 2026-06-11 =
* Prevent main class loading bug
* Fix WP CLI associative arguments
= 1.2.1 - 2026-06-09 = = 1.2.1 - 2026-06-09 =
* Added WP CLI commands to modify settings * Added WP CLI commands to modify settings