106 lines
3.3 KiB
PHP
106 lines
3.3 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
/*
|
||
|
|
* Plugin Name: WP fail2ban
|
||
|
|
* Plugin URI: https://wp-fail2ban.com/
|
||
|
|
* Description: Write a myriad of WordPress events to syslog for integration with fail2ban.
|
||
|
|
* Text Domain: wp-fail2ban
|
||
|
|
* Version: 4.0.2
|
||
|
|
* Author: Charles Lecklider
|
||
|
|
* Author URI: https://charles.lecklider.org/
|
||
|
|
* License: GPLv2
|
||
|
|
* SPDX-License-Identifier: GPL-2.0
|
||
|
|
* Requires PHP: 5.3
|
||
|
|
*
|
||
|
|
* @fs_premium_only /admin/premium/, composer.json, composer.lock, /premium/, /vendor/autoload.php, /vendor/composer/, /vendor/geoip2/, /vendor/maxmind/, /vendor/maxmind-db/
|
||
|
|
*/
|
||
|
|
/*
|
||
|
|
* Copyright 2012-19 Charles Lecklider (email : wordpress@charles.lecklider.org)
|
||
|
|
*
|
||
|
|
* This program is free software; you can redistribute it and/or modify
|
||
|
|
* it under the terms of the GNU General Public License, version 2, as
|
||
|
|
* published by the Free Software Foundation.
|
||
|
|
*
|
||
|
|
* This program is distributed in the hope that it will be useful,
|
||
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
|
* GNU General Public License for more details.
|
||
|
|
*
|
||
|
|
* You should have received a copy of the GNU General Public License
|
||
|
|
* along with this program; if not, write to the Free Software
|
||
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
|
|
*/
|
||
|
|
/**
|
||
|
|
* @package wp-fail2ban
|
||
|
|
*/
|
||
|
|
namespace org\lecklider\charles\wordpress\wp_fail2ban;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Guard for MU
|
||
|
|
*
|
||
|
|
* @since 4.0.0 Leave here for easy version bump
|
||
|
|
*/
|
||
|
|
global $wp_fail2ban ;
|
||
|
|
if ( empty($wp_fail2ban) && defined( 'WP_FAIL2BAN' ) ) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
define( 'WP_FAIL2BAN', '4.0.2' );
|
||
|
|
/**
|
||
|
|
* Freemius integration
|
||
|
|
*
|
||
|
|
* @since 4.0.0
|
||
|
|
*/
|
||
|
|
|
||
|
|
if ( function_exists( 'wf_fs' ) ) {
|
||
|
|
// @codeCoverageIgnoreStart
|
||
|
|
wf_fs()->set_basename( false, __FILE__ );
|
||
|
|
return;
|
||
|
|
} else {
|
||
|
|
// Create a helper function for easy SDK access.
|
||
|
|
function wf_fs()
|
||
|
|
{
|
||
|
|
global $wf_fs ;
|
||
|
|
|
||
|
|
if ( !isset( $wf_fs ) ) {
|
||
|
|
// Include Freemius SDK.
|
||
|
|
require_once dirname( __FILE__ ) . '/vendor/freemius/wordpress-sdk/start.php';
|
||
|
|
$wf_fs = fs_dynamic_init( array(
|
||
|
|
'id' => '3072',
|
||
|
|
'slug' => 'wp-fail2ban',
|
||
|
|
'type' => 'plugin',
|
||
|
|
'public_key' => 'pk_146d2c2a5bee3b157e43501ef8682',
|
||
|
|
'is_premium' => false,
|
||
|
|
'has_addons' => false,
|
||
|
|
'has_paid_plans' => true,
|
||
|
|
'trial' => array(
|
||
|
|
'days' => 7,
|
||
|
|
'is_require_payment' => false,
|
||
|
|
),
|
||
|
|
'menu' => array(
|
||
|
|
'slug' => 'wp-fail2ban',
|
||
|
|
'first-path' => 'options-general.php?page=wp-fail2ban&tab=welcome',
|
||
|
|
'support' => false,
|
||
|
|
'parent' => array(
|
||
|
|
'slug' => 'options-general.php',
|
||
|
|
),
|
||
|
|
),
|
||
|
|
'is_live' => true,
|
||
|
|
) );
|
||
|
|
}
|
||
|
|
|
||
|
|
return $wf_fs;
|
||
|
|
}
|
||
|
|
|
||
|
|
// Init Freemius.
|
||
|
|
wf_fs();
|
||
|
|
// Signal that SDK was initiated.
|
||
|
|
do_action( 'wf_fs_loaded' );
|
||
|
|
}
|
||
|
|
|
||
|
|
// @codeCoverageIgnoreEnd
|
||
|
|
/**
|
||
|
|
* Freemius insists on mangling the formatting of the main plugin file
|
||
|
|
*
|
||
|
|
* @since 4.0.0 Refactored
|
||
|
|
*/
|
||
|
|
require_once 'wp-fail2ban-main.php';
|