Files
ogre-captcha/ogre-captcha.php
T
Cooper Dalrymple e8b8fc1871
Validate Build / validate-build (push) Failing after 35s
Locations and verification
2026-06-04 17:05:42 -05:00

79 lines
2.1 KiB
PHP

<?php
/**
* Ogre CAPTCHA
*
* @package ogre-captcha
* @author cleverogre
* @copyright 2026 CleverOgre
* @license GLP-3.0-or-later
* @version 0.0.0
* @since 0.0.0
*
* @wordpress-plugin
* Plugin Name: Ogre CAPTCHA
* Plugin URI: https://git.cleverogre.com/cleverogre/ogre-captcha/
* Description: Protect your site with CAPTCHA
* Version: 0.0.0
* Requires at least: 6.0
* Requires PHP: 8.2
* Author: CleverOgre
* Author URI: https://cleverogre.com/
* Text Domain: ogre-captcha
* License: GPLv3 or later
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
* Update URI: https://git.cleverogre.com/cleverogre/ogre-captcha/
* Domain Path: /lang
*/
namespace Ogre;
use Ogre\Captcha\Settings;
defined('ABSPATH') || exit;
require_once 'vendor/autoload.php';
final class Captcha extends Plugin {
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',
]);
}
protected function enable():void {
parent::enable();
add_filter('plugin_action_links_' . self::get_basename(), [$this, 'action_links']);
}
protected function disable():void {
parent::disable();
remove_filter('plugin_action_links_' . self::get_basename(), [$this, 'action_links']);
}
public function action_links($links) {
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;
}
}
Captcha::instance();