diff --git a/src/Basic_Requirement_Checker.php b/src/Basic_Requirement_Checker.php index 538599d71897ea39686e23ddfff8d98720bb2a12..104d548eb41f91a18bdffd4f5897f8c0fa6c0e5b 100644 --- a/src/Basic_Requirement_Checker.php +++ b/src/Basic_Requirement_Checker.php @@ -340,19 +340,52 @@ class WPDesk_Basic_Requirement_Checker implements WPDesk_Translable { * @return bool */ public static function is_setting_set( $name, $value ) { - return ini_get( $name ) === strval( $value ); + return ini_get( $name ) === (string) $value; } /** * @return void + * + * @deprecated use render_notices or disable_plugin */ public function disable_plugin_render_notice() { add_action( self::HOOK_ADMIN_NOTICES_ACTION, array( $this, 'render_notices_action' ) ); } + /** + * Renders requirement notices in admin panel + * + * @return void + */ + public function render_notices() { + add_action( self::HOOK_ADMIN_NOTICES_ACTION, array( $this, 'render_notices_action' ) ); + } + + /** + * Renders requirement notices in admin panel + * + * @return void + */ + public function disable_plugin() { + add_action( self::HOOK_ADMIN_NOTICES_ACTION, array( $this, 'deactivate_action' ) ); + } + + /** + * @internal Do not use as public. Public only for wp action. + * + * @return void + */ + public function deactivate_action() { + if ( isset( $this->plugin_file ) ) { + deactivate_plugins( plugin_basename( $this->plugin_file ) ); + } + } + /** - * Shoud be called as WordPress action + * Should be called as WordPress action * + * @internal Do not use as public. Public only for wp action. + * * @return void */ public function render_notices_action() {