Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 322a9d95bd | |||
| af10bb0e82 | |||
| 20b812e91b | |||
| 2165224454 | |||
| f8bf6e40ca | |||
| f8e5bd4e3f | |||
| 5c4d471fc0 | |||
| 1cae0e1310 | |||
| e0ef6dd34d | |||
| 47ca0903b1 |
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://getcomposer.org/schema.json",
|
||||
"name": "cleverogre/ogre-captcha",
|
||||
"version": "1.2.1",
|
||||
"version": "1.2.4",
|
||||
"title": "Ogre CAPTCHA",
|
||||
"description": "Protect your site with CAPTCHA",
|
||||
"author": "CleverOgre",
|
||||
|
||||
Generated
+1
-1
@@ -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": "49f5e6f919f33ce6a3edc2992620a64a",
|
||||
"content-hash": "d662e21940aa15a41d819c504c3139c9",
|
||||
"packages": [
|
||||
{
|
||||
"name": "cleverogre/plugin-framework",
|
||||
|
||||
+4
-3
@@ -4,7 +4,7 @@
|
||||
* @author cleverogre
|
||||
* @copyright 2026 CleverOgre
|
||||
* @license GLP-3.0-or-later
|
||||
* @version 1.2.1
|
||||
* @version 1.2.3
|
||||
* @since 1.2.1
|
||||
*/
|
||||
|
||||
@@ -109,8 +109,9 @@ final class CLI {
|
||||
* @when after_wp_load
|
||||
*/
|
||||
public function form(array $args, array $assoc_args):void {
|
||||
list($locations) = $args;
|
||||
extract($assoc_args);
|
||||
$locations = !empty($args) ? (array) array_values($args)[0] : [];
|
||||
$all = $assoc_args['all'] ?? false;
|
||||
$disable = $assoc_args['disable'] ?? false;
|
||||
|
||||
if (empty($locations) && !$all) {
|
||||
WP_CLI::error('Please specify one or more form locations, or use --all.');
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* @author cleverogre
|
||||
* @copyright 2026 CleverOgre
|
||||
* @license GLP-3.0-or-later
|
||||
* @version 1.2.1
|
||||
* @version 1.2.4
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
@@ -122,7 +122,7 @@ final class Settings {
|
||||
}
|
||||
|
||||
public static function set_site_key(string $value):bool {
|
||||
self::get('site_key');
|
||||
self::set('site_key', $value);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ final class Settings {
|
||||
}
|
||||
|
||||
public static function set_secret_key(string $value):bool {
|
||||
self::get('secret_key');
|
||||
self::set('secret_key', $value);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* @author cleverogre
|
||||
* @copyright 2026 CleverOgre
|
||||
* @license GLP-3.0-or-later
|
||||
* @version 1.2.0
|
||||
* @version 1.2.4
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
@@ -35,7 +35,7 @@ final class LostPasswordForm extends LoginLocation {
|
||||
{
|
||||
parent::activate();
|
||||
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 {
|
||||
|
||||
+77
-73
@@ -6,14 +6,14 @@
|
||||
* @author cleverogre
|
||||
* @copyright 2026 CleverOgre
|
||||
* @license GLP-3.0-or-later
|
||||
* @version 1.2.1
|
||||
* @version 1.2.4
|
||||
* @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.1
|
||||
* Version: 1.2.4
|
||||
* Requires at least: 6.0
|
||||
* Requires PHP: 8.2
|
||||
* Author: CleverOgre
|
||||
@@ -41,83 +41,87 @@ defined('ABSPATH') || exit;
|
||||
|
||||
require_once 'vendor/autoload.php';
|
||||
|
||||
final class Captcha extends Plugin {
|
||||
if (!class_exists('Ogre\Captcha')) {
|
||||
|
||||
public static function is_woocommerce_active():bool {
|
||||
return is_plugin_active('woocommerce/woocommerce.php');
|
||||
}
|
||||
final class Captcha extends Plugin {
|
||||
|
||||
public static function is_gravityforms_active():bool {
|
||||
return is_plugin_active('gravityforms/gravityforms.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');
|
||||
public static function is_woocommerce_active():bool {
|
||||
return is_plugin_active('woocommerce/woocommerce.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'))
|
||||
));
|
||||
public static function is_gravityforms_active():bool {
|
||||
return is_plugin_active('gravityforms/gravityforms.php');
|
||||
}
|
||||
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 {
|
||||
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();
|
||||
|
||||
}
|
||||
|
||||
Captcha::instance();
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "cleverogre/ogre-captcha",
|
||||
"version": "1.0.0",
|
||||
"version": "1.2.3",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "cleverogre/ogre-captcha",
|
||||
"version": "1.0.0",
|
||||
"version": "1.2.3",
|
||||
"license": "GPL-3.0+",
|
||||
"devDependencies": {
|
||||
"gulp": "^5.0.0",
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://www.schemastore.org/package.json",
|
||||
"name": "cleverogre/ogre-captcha",
|
||||
"version": "1.2.1",
|
||||
"version": "1.2.4",
|
||||
"title": "Ogre CAPTCHA",
|
||||
"description": "Protect your site with CAPTCHA",
|
||||
"author": "CleverOgre",
|
||||
|
||||
+11
-1
@@ -3,7 +3,7 @@ Contributors: ogrecooper, cleverogre
|
||||
Tested up to: 7.0
|
||||
Requires at least: 6.0
|
||||
Requires PHP: 8.2
|
||||
Version: 1.2.1
|
||||
Version: 1.2.4
|
||||
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.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 =
|
||||
* Added WP CLI commands to modify settings
|
||||
|
||||
|
||||
Reference in New Issue
Block a user