Skip to content

Commit

Permalink
Replaced superfluous instantiation of Object with static init() method
Browse files Browse the repository at this point in the history
  • Loading branch information
stklcode committed Aug 20, 2017
1 parent 12a7959 commit aa40945
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stklcode/statify-blacklist",
"version": "1.4.1",
"version": "1.4.2-alpha",
"description": "A blacklist extension for the famous Statify WordPress plugin",
"keywords": [
"wordpress",
Expand Down
13 changes: 12 additions & 1 deletion inc/class-statifyblacklist.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,28 @@ class StatifyBlacklist {
* Class self initialize.
*
* @since 1.0.0
* @deprecated 1.4.2 Replaced by init().
*/
public static function instance() {
new self();
self::init();
}

/**
* Class constructor.
*
* @since 1.0.0
* @deprecated 1.4.2 Replaced by init().
*/
public function __construct() {
self::init();
}

/**
* Plugin initialization.
*
* @since 1.4.2
*/
public static function init() {
// Skip on autosave or AJAX.
if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
return;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "statify-blacklist",
"version": "1.4.1",
"version": "1.4.2-alpha",
"description": "A blacklist extension for the famous Statify WordPress plugin",
"author": "Stefan Kalscheuer",
"license": "GPLv2 or later",
Expand Down
4 changes: 2 additions & 2 deletions statify-blacklist.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Plugin Name: Statify Blacklist
* Plugin URI: https://wordpress.org/plugins/statify-blacklist/
* Description: Extension for the Statify plugin to add a customizable blacklists.
* Version: 1.4.1
* Version: 1.4.2-alpha
* Author: Stefan Kalscheuer (@stklcode)
* Author URI: https://www.stklcode.de
* Text Domain: statify-blacklist
Expand Down Expand Up @@ -40,7 +40,7 @@
define( 'STATIFYBLACKLIST_BASE', plugin_basename( __FILE__ ) );

// System Hooks.
add_action( 'plugins_loaded', array( 'StatifyBlacklist', 'instance' ) );
add_action( 'plugins_loaded', array( 'StatifyBlacklist', 'init' ) );

register_activation_hook( STATIFYBLACKLIST_FILE, array( 'StatifyBlacklist_System', 'install' ) );

Expand Down

0 comments on commit aa40945

Please sign in to comment.