PluginProbe
WP-Ban / trunk
WP-Ban vtrunk
trunk 1.00 1.10 1.11 1.20 1.30 1.31 1.40 1.50 1.62 1.63 1.64 1.65 1.66 1.67 1.68 1.69 1.69.1 1.69.2 2.0.0
wp-ban / wp-ban.php

wp-ban.php in WP-Ban trunk, at wp-ban.php

82 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: WP-Ban
4 * Plugin URI: https://lesterchan.net/portfolio/programming/php/
5 * Description: Ban users by IP, IP range, host name, user agent and referrer URL from visiting your WordPress blog.
6 * Version: 2.0.0
7 * Requires at least: 6.8
8 * Requires PHP: 8.2
9 * Author: Lester 'GaMerZ' Chan
10 * Author URI: https://lesterchan.net
11 * License: GPLv2 or later
12 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
13 * Text Domain: wp-ban
14 * Domain Path: /languages
15 *
16 * @package WP-Ban
17 */
18
19 /*
20 Copyright 2026 Lester Chan (email : lesterchan@gmail.com)
21
22 This program is free software; you can redistribute it and/or modify
23 it under the terms of the GNU General Public License as published by
24 the Free Software Foundation; either version 2 of the License, or
25 (at your option) any later version.
26
27 This program is distributed in the hope that it will be useful,
28 but WITHOUT ANY WARRANTY; without even the implied warranty of
29 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 GNU General Public License for more details.
31
32 You should have received a copy of the GNU General Public License
33 along with this program; if not, write to the Free Software
34 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
35 */
36
37 defined( 'ABSPATH' ) || exit;
38
39 /**
40 * WP-Ban version. The last-run value is kept in the wp_ban_version row.
41 */
42 define( 'WP_BAN_VERSION', '2.0.0' );
43
44 /**
45 * Schema counter. Bumped only when the stored rows need reshaping.
46 */
47 define( 'WP_BAN_DB_VERSION', '2' );
48
49 /**
50 * WP-Ban slug, which is also the text domain.
51 */
52 define( 'WP_BAN_SLUG', 'wp-ban' );
53
54 /**
55 * WP-Ban main file.
56 */
57 define( 'WP_BAN_MAIN_FILE', __FILE__ );
58
59 /**
60 * WP-Ban directory, with a trailing slash.
61 */
62 define( 'WP_BAN_DIR', plugin_dir_path( __FILE__ ) );
63
64 /**
65 * WP-Ban URL, with a trailing slash.
66 *
67 * Derived rather than hardcoded: before 2.0.0 the plugin built its admin URL
68 * from the literal string 'wp-ban/ban-options.php', so installing under any
69 * other directory name broke the settings screen outright.
70 */
71 define( 'WP_BAN_URL', plugin_dir_url( __FILE__ ) );
72
73 require_once WP_BAN_DIR . 'includes/class-wp-ban-options.php';
74 require_once WP_BAN_DIR . 'includes/class-wp-ban-ip.php';
75 require_once WP_BAN_DIR . 'includes/class-wp-ban-stats.php';
76 require_once WP_BAN_DIR . 'includes/class-wp-ban-verdict.php';
77 require_once WP_BAN_DIR . 'includes/class-wp-ban-blocker.php';
78 require_once WP_BAN_DIR . 'includes/class-wp-ban-settings.php';
79 require_once WP_BAN_DIR . 'includes/class-wp-ban.php';
80
81 WP_Ban::get_instance();
82