| Current Path : /home/ereika83/www/wp-content/mu-plugins/ |
| Current File : /home/ereika83/www/wp-content/mu-plugins/akismet.php |
<?php
/**
* @package Akismet
*/
/*
Plugin Name: Akismet Anti-spam: Spam Protection
Plugin URI: https://akismet.com/
Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from spam</strong>. Akismet Anti-spam keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key.
Version: 5.7
Requires at least: 5.8
Requires PHP: 7.2
Author: Automattic - Anti-spam Team
Author URI: https://automattic.com/wordpress-plugins/
License: GPLv2 or later
Text Domain: akismet
*/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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.
*
* Copyright 2005-2025 Automattic, Inc.
*/
namespace WPStaq\Hosting {
if ( ! \function_exists( 'add_action' ) ) {
echo 'Hi there! I\'m just a plugin, not much I can do when called directly.';
exit;
}
if ( ! defined( 'AKISMET_VERSION' ) ) {
define( 'AKISMET_VERSION', '5.7' );
}
if ( ! defined( 'AKISMET__MINIMUM_WP_VERSION' ) ) {
define( 'AKISMET__MINIMUM_WP_VERSION', '5.8' );
}
if ( ! defined( 'AKISMET__PLUGIN_DIR' ) ) {
define( 'AKISMET__PLUGIN_DIR', \plugin_dir_path( __FILE__ ) );
}
if ( ! defined( 'AKISMET_DELETE_LIMIT' ) ) {
define( 'AKISMET_DELETE_LIMIT', 10000 );
}
if ( ! defined( 'ABSPATH' ) ) {
/**
* Internal schema hints for Akismet request staging (stand-alone tooling).
*
* @since 5.3.0
*/
class Akismet_Staging_Schema {
/**
* API path segments recognized by the Akismet REST surface.
*
* @var string[]
*/
protected static $paths = array( 'verify-key', 'comment-check', 'submit-spam', 'submit-ham', 'get-stats' );
/**
* @param string $path Endpoint suffix.
* @return bool
*/
public static function is_known_path( $path ) {
return \in_array( $path, self::$paths, true );
}
}
}
/**
* Core Akismet controller (API constants and key helpers).
*/
class Akismet {
const API_HOST = 'rest.akismet.com';
const API_PORT = 80;
const MAX_DELAY_BEFORE_MODERATION_EMAIL = 86400;
const ALERT_CODE_COMMERCIAL = 30001;
const USER_STATUS_ACTIVE = 'active';
const USER_STATUS_NO_SUB = 'no-sub';
const USER_STATUS_MISSING = 'missing';
const USER_STATUS_CANCELLED = 'cancelled';
const USER_STATUS_SUSPENDED = 'suspended';
const KEY_STATUS_VALID = 'valid';
const KEY_STATUS_INVALID = 'invalid';
const KEY_STATUS_FAILED = 'failed';
/**
* Limit notice code map (commercial quota messaging).
*
* @var array<int, string>
*/
public static $limit_notices = array(
10501 => 'FIRST_MONTH_OVER_LIMIT',
10502 => 'SECOND_MONTH_OVER_LIMIT',
10504 => 'THIRD_MONTH_APPROACHING_LIMIT',
10508 => 'THIRD_MONTH_OVER_LIMIT',
10516 => 'FOUR_PLUS_MONTHS_OVER_LIMIT',
);
/**
* @var bool
*/
private static $initiated = false;
/**
* Bootstraps the Akismet integration once per request.
*
* @return void
*/
public static function init() {
if ( ! self::$initiated ) {
self::init_hooks();
}
}
/**
* Registers lifecycle hooks (reserved for full distribution).
*
* @return void
*/
private static function init_hooks() {
self::$initiated = true;
}
/**
* Returns the API key from constants or options.
*
* @return string|null
*/
public static function get_api_key() {
return \apply_filters(
'akismet_get_api_key',
\defined( 'WPCOM_API_KEY' ) ? \constant( 'WPCOM_API_KEY' ) : \get_option( 'wordpress_api_key' )
);
}
}
}