Removed deprecated instance() and __construct() methods from base class
This commit is contained in:
parent
74826384a8
commit
74f2e0f9a7
@ -9,8 +9,10 @@
|
|||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Quit.
|
// Quit if accessed directly.
|
||||||
defined( 'ABSPATH' ) || exit;
|
if ( ! defined( 'ABSPATH' ) ) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Statify Blacklist admin configuration.
|
* Statify Blacklist admin configuration.
|
||||||
|
@ -9,8 +9,10 @@
|
|||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Quit.
|
// Quit if accessed directly.
|
||||||
defined( 'ABSPATH' ) || exit;
|
if ( ! defined( 'ABSPATH' ) ) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Statify Blacklist system configuration.
|
* Statify Blacklist system configuration.
|
||||||
@ -25,6 +27,7 @@ class StatifyBlacklist_System extends StatifyBlacklist {
|
|||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*
|
*
|
||||||
* @param bool $network_wide Whether the plugin was activated network-wide or not.
|
* @param bool $network_wide Whether the plugin was activated network-wide or not.
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function install( $network_wide = false ) {
|
public static function install( $network_wide = false ) {
|
||||||
// Create tables for each site in a network.
|
// Create tables for each site in a network.
|
||||||
@ -59,6 +62,7 @@ class StatifyBlacklist_System extends StatifyBlacklist {
|
|||||||
* @since 1.4.3
|
* @since 1.4.3
|
||||||
*
|
*
|
||||||
* @param integer $site_id Site ID.
|
* @param integer $site_id Site ID.
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function install_site( $site_id ) {
|
public static function install_site( $site_id ) {
|
||||||
switch_to_blog( (int) $site_id );
|
switch_to_blog( (int) $site_id );
|
||||||
@ -74,6 +78,8 @@ class StatifyBlacklist_System extends StatifyBlacklist {
|
|||||||
* Plugin uninstall handler.
|
* Plugin uninstall handler.
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function uninstall() {
|
public static function uninstall() {
|
||||||
if ( is_multisite() ) {
|
if ( is_multisite() ) {
|
||||||
@ -109,6 +115,7 @@ class StatifyBlacklist_System extends StatifyBlacklist {
|
|||||||
* @since 1.4.3
|
* @since 1.4.3
|
||||||
*
|
*
|
||||||
* @param integer $site_id Site ID.
|
* @param integer $site_id Site ID.
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function uninstall_site( $site_id ) {
|
public static function uninstall_site( $site_id ) {
|
||||||
$old = get_current_blog_id();
|
$old = get_current_blog_id();
|
||||||
@ -121,6 +128,8 @@ class StatifyBlacklist_System extends StatifyBlacklist {
|
|||||||
* Upgrade plugin options.
|
* Upgrade plugin options.
|
||||||
*
|
*
|
||||||
* @since 1.2.0
|
* @since 1.2.0
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function upgrade() {
|
public static function upgrade() {
|
||||||
self::update_options();
|
self::update_options();
|
||||||
|
@ -8,8 +8,10 @@
|
|||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Quit.
|
// Quit if accessed directly.
|
||||||
defined( 'ABSPATH' ) || exit;
|
if ( ! defined( 'ABSPATH' ) ) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Statify Blacklist.
|
* Statify Blacklist.
|
||||||
@ -42,30 +44,12 @@ class StatifyBlacklist {
|
|||||||
*/
|
*/
|
||||||
public static $multisite;
|
public static $multisite;
|
||||||
|
|
||||||
/**
|
|
||||||
* Class self initialize.
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
* @deprecated 1.4.2 Replaced by init().
|
|
||||||
*/
|
|
||||||
public static function instance() {
|
|
||||||
self::init();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class constructor.
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
* @deprecated 1.4.2 Replaced by init().
|
|
||||||
*/
|
|
||||||
public function __construct() {
|
|
||||||
self::init();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plugin initialization.
|
* Plugin initialization.
|
||||||
*
|
*
|
||||||
* @since 1.4.2
|
* @since 1.4.2
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function init() {
|
public static function init() {
|
||||||
// Skip on autosave or AJAX.
|
// Skip on autosave or AJAX.
|
||||||
@ -103,6 +87,7 @@ class StatifyBlacklist {
|
|||||||
* @since 1.2.1 update_options($options = null) Parameter with default value introduced.
|
* @since 1.2.1 update_options($options = null) Parameter with default value introduced.
|
||||||
*
|
*
|
||||||
* @param array $options Optional. New options to save.
|
* @param array $options Optional. New options to save.
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function update_options( $options = null ) {
|
public static function update_options( $options = null ) {
|
||||||
if ( self::$multisite ) {
|
if ( self::$multisite ) {
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* Plugin Name: Statify Blacklist
|
* Plugin Name: Statify Blacklist
|
||||||
* Plugin URI: https://wordpress.org/plugins/statify-blacklist/
|
* Plugin URI: https://wordpress.org/plugins/statify-blacklist/
|
||||||
* Description: Extension for the Statify plugin to add a customizable blacklists.
|
* Description: Extension for the Statify plugin to add a customizable blacklists.
|
||||||
* Version: 1.4.4
|
* Version: 1.5.0-alpha
|
||||||
* Author: Stefan Kalscheuer (@stklcode)
|
* Author: Stefan Kalscheuer (@stklcode)
|
||||||
* Author URI: https://www.stklcode.de
|
* Author URI: https://www.stklcode.de
|
||||||
* Text Domain: statify-blacklist
|
* Text Domain: statify-blacklist
|
||||||
@ -30,8 +30,10 @@
|
|||||||
* along with Statify Blacklist. If not, see http://www.gnu.org/licenses/gpl-2.0.html.
|
* along with Statify Blacklist. If not, see http://www.gnu.org/licenses/gpl-2.0.html.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Quit.
|
// Quit if accessed directly.
|
||||||
defined( 'ABSPATH' ) || exit;
|
if ( ! defined( 'ABSPATH' ) ) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
// Constants.
|
// Constants.
|
||||||
define( 'STATIFYBLACKLIST_FILE', __FILE__ );
|
define( 'STATIFYBLACKLIST_FILE', __FILE__ );
|
||||||
@ -95,6 +97,8 @@ function statify_blacklist_compatibility_check() {
|
|||||||
/**
|
/**
|
||||||
* Disable plugin if active and incompatible.
|
* Disable plugin if active and incompatible.
|
||||||
*
|
*
|
||||||
|
* @since 1.5.0
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function statify_blacklist_disable() {
|
function statify_blacklist_disable() {
|
||||||
@ -110,6 +114,8 @@ function statify_blacklist_disable() {
|
|||||||
/**
|
/**
|
||||||
* Admin notification for unmet requirements.
|
* Admin notification for unmet requirements.
|
||||||
*
|
*
|
||||||
|
* @since 1.5.0
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function statify_blacklist_disabled_notice() {
|
function statify_blacklist_disabled_notice() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user