From d2850524cf61963cc706dd0811bfb051e47888cb Mon Sep 17 00:00:00 2001 From: Diego Zanella Date: Tue, 9 Sep 2014 11:52:04 +0100 Subject: [PATCH 1/3] Added composer.json file * File is required for usage with Packagist --- composer.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 composer.json diff --git a/composer.json b/composer.json new file mode 100644 index 00000000..7dbbb9a4 --- /dev/null +++ b/composer.json @@ -0,0 +1,25 @@ +{ + "name": "aelia/plugin-update-checker", + "type": "library", + "description": "A custom update checker for WordPress plugins. Useful if you can't or don't want to host your plugin in the official WP plugin repository, but would still like it to support automatic plugin updates.", + "keywords": ["wordpress","auto-update", "automatic updates"], + "homepage": "https://github.com/aelia-co/plugin-update-checker", + "license": "MIT", + "authors": [ + { + "name": "Yahnis Elsts", + "email": "whiteshadow@w-shadow.com", + "homepage": "http://w-shadow.com/", + "role": "Developer" + }, + { + "name": "Diego Zanella (Aelia)", + "email": "admin@aelia.co", + "homepage": "http://aelia.co/", + "role": "Developer" + } + ], + "require": { + "php": ">=5.2.0" + } +} From c42b3249929bd8e166c00044eef6ac8c9fe68506 Mon Sep 17 00:00:00 2001 From: Diego Zanella Date: Tue, 9 Sep 2014 11:58:31 +0100 Subject: [PATCH 2/3] Corrected licence in composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7dbbb9a4..3ab86a7d 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "description": "A custom update checker for WordPress plugins. Useful if you can't or don't want to host your plugin in the official WP plugin repository, but would still like it to support automatic plugin updates.", "keywords": ["wordpress","auto-update", "automatic updates"], "homepage": "https://github.com/aelia-co/plugin-update-checker", - "license": "MIT", + "license": "GPL", "authors": [ { "name": "Yahnis Elsts", From b147fabd2ba9fc2414e459b28dcbe7e9b6c4638c Mon Sep 17 00:00:00 2001 From: Diego Date: Tue, 17 Mar 2020 09:42:14 +0100 Subject: [PATCH 3/3] Added filter to allow suppressing the "invalid meta" notice * Ref. https://github.com/YahnisElsts/plugin-update-checker/issues/347 --- Puc/v4p9/Metadata.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Puc/v4p9/Metadata.php b/Puc/v4p9/Metadata.php index 93f30bd6..fa306c94 100644 --- a/Puc/v4p9/Metadata.php +++ b/Puc/v4p9/Metadata.php @@ -31,15 +31,29 @@ protected static function createFromJson($json, $target) { $apiResponse = json_decode($json); if ( empty($apiResponse) || !is_object($apiResponse) ){ $errorMessage = "Failed to parse update metadata. Try validating your .json file with http://jsonlint.com/"; - do_action('puc_api_error', new WP_Error('puc-invalid-json', $errorMessage)); - trigger_error($errorMessage, E_USER_NOTICE); + + $api_error = new WP_Error('puc-invalid-json', $errorMessage); + do_action('puc_api_error', $api_error); + + // Allow 3rd parties to suppress the notice, as they might have their own + // error handling mechanism in place + // @link https://github.com/YahnisElsts/plugin-update-checker/issues/347 + if(apply_filters('puc_show_trigger_api_response_error', true, $api_error)) { + trigger_error($errorMessage, E_USER_NOTICE); + } return false; } $valid = $target->validateMetadata($apiResponse); if ( is_wp_error($valid) ){ do_action('puc_api_error', $valid); - trigger_error($valid->get_error_message(), E_USER_NOTICE); + + // Allow 3rd parties to suppress the notice, as they might have their own + // error handling mechanism in place + // @link https://github.com/YahnisElsts/plugin-update-checker/issues/347 + if(apply_filters('puc_show_trigger_api_response_error', true, $valid)) { + trigger_error($valid->get_error_message(), E_USER_NOTICE); + } return false; }