From 9699191eb3d2ed379218e3f516332b3cdd00b8cf Mon Sep 17 00:00:00 2001 From: changwoo Date: Mon, 22 Nov 2021 12:00:49 +0900 Subject: [PATCH] Version 0.3.0 --- CHANGELOG | 8 ++++++++ composer.json | 8 +++++++- .../registers/abstract-nss-register-base-uninstall.php | 1 - includes/modules/class-nss-registers.php | 2 +- index.php | 4 ++-- uninstall.php | 8 +++----- 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index f9be86b..7eaacfb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,11 @@ +0.3.0 +----- +2021-11-22 + +- Merge pull request #1. +- Fix uninstall script. + + 0.2.0 ----- 2021-11-13 diff --git a/composer.json b/composer.json index e7ceeea..dc44f56 100644 --- a/composer.json +++ b/composer.json @@ -9,6 +9,12 @@ "email": "ep6tri@hotmail.com", "role": "author", "homepage": "https://blog.changwoo.pe.kr" + }, + { + "name": "wolfkang", + "email": "donghyeok@shoplic.kr", + "role": "contributor", + "homepage": "https://shoplic.kr/" } ], "scripts": { @@ -33,7 +39,7 @@ "includes" ] }, - "version": "0.2.0", + "version": "0.3.0", "require-dev": { "phpunit/phpunit": "^7" }, diff --git a/core/abstracts/registers/abstract-nss-register-base-uninstall.php b/core/abstracts/registers/abstract-nss-register-base-uninstall.php index 827d840..cd8acea 100644 --- a/core/abstracts/registers/abstract-nss-register-base-uninstall.php +++ b/core/abstracts/registers/abstract-nss-register-base-uninstall.php @@ -11,7 +11,6 @@ if ( ! class_exists( 'NSS_Register_Base_Uninstall' ) ) { abstract class NSS_Register_Base_Uninstall implements NSS_Register { public function __construct() { - register_uninstall_hook( nss()->get_main_file(), [ $this, 'register' ] ); } /** diff --git a/includes/modules/class-nss-registers.php b/includes/modules/class-nss-registers.php index be96eb9..bbd8f50 100644 --- a/includes/modules/class-nss-registers.php +++ b/includes/modules/class-nss-registers.php @@ -31,7 +31,7 @@ public function __construct() { 'option' => NSS_Register_Option::class, 'script' => NSS_Register_Script::class, 'style' => NSS_Register_Style::class, - 'uninstall' => NSS_Register_Uninstall::class, + 'uninstall' => function () { return new NSS_Register_Uninstall(); }, ] ); } diff --git a/index.php b/index.php index 1ae592f..84049c6 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ * Plugin Name: Naran Social Share * Plugin URI: https://github.com/chwnam/naran-social-share * Description: Share your posts to social media, and so on. - * Version: 0.2.0 + * Version: 0.3.0 * Requires at least: 4.4.0 * Requires PHP: 7.4 * Author: changwoo @@ -23,7 +23,7 @@ require_once __DIR__ . '/vendor/autoload.php'; const NSS_MAIN_FILE = __FILE__; -const NSS_VERSION = '0.2.0'; +const NSS_VERSION = '0.3.0'; const NSS_PRIORITY = 885; nss(); diff --git a/uninstall.php b/uninstall.php index 4ffa3c8..6340e46 100644 --- a/uninstall.php +++ b/uninstall.php @@ -8,8 +8,6 @@ die; } -foreach ( nss()->registers->uninstall->get_items() as $item ) { - if ( $item instanceof NSS_Register_Uninstall ) { - $item->register(); - } -} +require_once __DIR__ . '/index.php'; + +nss()->registers->uninstall->register();