From 6ef7a25b7fa6b6e35a2f35312a78b717686da4e3 Mon Sep 17 00:00:00 2001 From: Andy Fragen Date: Sat, 5 Feb 2022 14:05:13 -0800 Subject: [PATCH 1/2] reverse logic in nonce check and allow hooks to run always Necessary for add-on plugins --- CHANGES.md | 1 + git-updater.php | 2 +- src/Git_Updater/Settings.php | 14 ++++++-------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index fe66cdacc..33fddb819 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,5 @@ #### [unreleased] +* allow hooks to run if no settings to be saved in `Settings::update_settings()` #### 10.6.13 / 2022-02-01 * update nonce condtionals, require variables be set diff --git a/git-updater.php b/git-updater.php index 04710e8c4..62a35555b 100644 --- a/git-updater.php +++ b/git-updater.php @@ -12,7 +12,7 @@ * Plugin Name: Git Updater * Plugin URI: https://git-updater.com * Description: A plugin to automatically update GitHub hosted plugins, themes, and language packs. Additional API plugins available for Bitbucket, GitLab, Gitea, and Gist. - * Version: 10.6.13 + * Version: 10.6.13.1 * Author: Andy Fragen * License: MIT * Domain Path: /languages diff --git a/src/Git_Updater/Settings.php b/src/Git_Updater/Settings.php index d63bef427..b4b166bde 100644 --- a/src/Git_Updater/Settings.php +++ b/src/Git_Updater/Settings.php @@ -655,15 +655,13 @@ public function token_callback_checkbox( $args ) { * @link http://benohead.com/wordpress-network-wide-plugin-settings/ */ public function update_settings() { - if ( ! isset( $_POST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['_wpnonce'] ) ), 'git_updater-options' ) ) { - $this->redirect_on_save(); - return; - } - if ( ( isset( $_POST['option_page'] ) + if ( isset( $_POST['_wpnonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['_wpnonce'] ) ), 'git_updater-options' ) ) { + if ( ( isset( $_POST['option_page'] ) && 'git_updater' === $_POST['option_page'] ) - ) { - $options = $this->filter_options(); - update_site_option( 'git_updater', $this->sanitize( $options ) ); + ) { + $options = $this->filter_options(); + update_site_option( 'git_updater', $this->sanitize( $options ) ); + } } /** From 4502b546c88a47aa3e76e14e87a8d572cc37a727 Mon Sep 17 00:00:00 2001 From: Andy Fragen Date: Sat, 5 Feb 2022 15:32:47 -0800 Subject: [PATCH 2/2] composer update, release --- CHANGES.md | 3 +++ composer.lock | 10 +++++----- git-updater.php | 2 +- languages/git-updater.pot | 18 +++++++++--------- .../wp-dependency-installer/composer.json | 2 +- .../wp-dependency-installer/composer.lock | 2 +- .../wp-dependency-installer.php | 1 + vendor/composer/installed.json | 12 ++++++------ vendor/composer/installed.php | 10 +++++----- 9 files changed, 32 insertions(+), 28 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 33fddb819..baa421594 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,8 @@ #### [unreleased] + +#### 10.6.14 / 2022-02-05 * allow hooks to run if no settings to be saved in `Settings::update_settings()` +* composer update #### 10.6.13 / 2022-02-01 * update nonce condtionals, require variables be set diff --git a/composer.lock b/composer.lock index 3f20a911e..a472dbcb3 100644 --- a/composer.lock +++ b/composer.lock @@ -102,16 +102,16 @@ }, { "name": "afragen/wp-dependency-installer", - "version": "4.3.2", + "version": "4.3.3", "source": { "type": "git", "url": "https://github.com/afragen/wp-dependency-installer.git", - "reference": "707d659fcbf690999dde8d5a4359e32e0675cf98" + "reference": "5947e52d91969d2fc8e47a25c02325643b154ec8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/afragen/wp-dependency-installer/zipball/707d659fcbf690999dde8d5a4359e32e0675cf98", - "reference": "707d659fcbf690999dde8d5a4359e32e0675cf98", + "url": "https://api.github.com/repos/afragen/wp-dependency-installer/zipball/5947e52d91969d2fc8e47a25c02325643b154ec8", + "reference": "5947e52d91969d2fc8e47a25c02325643b154ec8", "shasum": "" }, "require": { @@ -158,7 +158,7 @@ "type": "github" } ], - "time": "2022-01-25T03:33:14+00:00" + "time": "2022-02-05T23:04:53+00:00" }, { "name": "afragen/wp-dismiss-notice", diff --git a/git-updater.php b/git-updater.php index 62a35555b..9d8c76684 100644 --- a/git-updater.php +++ b/git-updater.php @@ -12,7 +12,7 @@ * Plugin Name: Git Updater * Plugin URI: https://git-updater.com * Description: A plugin to automatically update GitHub hosted plugins, themes, and language packs. Additional API plugins available for Bitbucket, GitLab, Gitea, and Gist. - * Version: 10.6.13.1 + * Version: 10.6.14 * Author: Andy Fragen * License: MIT * Domain Path: /languages diff --git a/languages/git-updater.pot b/languages/git-updater.pot index c6810b2ec..1ae2db377 100644 --- a/languages/git-updater.pot +++ b/languages/git-updater.pot @@ -2,16 +2,16 @@ # This file is distributed under the MIT. msgid "" msgstr "" -"Project-Id-Version: Git Updater 10.6.12.1\n" +"Project-Id-Version: Git Updater 10.6.14\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/git-updater\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2022-01-19T01:08:50+00:00\n" +"POT-Creation-Date: 2022-02-05T23:32:19+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"X-Generator: WP-CLI 2.5.0\n" +"X-Generator: WP-CLI 2.6.0\n" "X-Domain: git-updater\n" #. Plugin Name of the plugin @@ -181,7 +181,7 @@ msgid "Please be patient while WP-Cron finishes making API calls." msgstr "" #: src/Git_Updater/Settings.php:137 -#: src/Git_Updater/Settings.php:808 +#: src/Git_Updater/Settings.php:806 msgid "Settings" msgstr "" @@ -231,23 +231,23 @@ msgstr "" msgid "The following plugins or themes might exist on wp.org, but any updates will be downloaded from their respective git repositories." msgstr "" -#: src/Git_Updater/Settings.php:842 +#: src/Git_Updater/Settings.php:840 msgid "This is a private repository." msgstr "" -#: src/Git_Updater/Settings.php:843 +#: src/Git_Updater/Settings.php:841 msgid "This repository has not connected to the API or was unable to connect." msgstr "" -#: src/Git_Updater/Settings.php:844 +#: src/Git_Updater/Settings.php:842 msgid "This repository is hosted on WordPress.org." msgstr "" -#: src/Git_Updater/Settings.php:845 +#: src/Git_Updater/Settings.php:843 msgid "This repository has been ignored and does not connect to the API." msgstr "" -#: src/Git_Updater/Settings.php:889 +#: src/Git_Updater/Settings.php:887 msgid "Installed Plugins and Themes" msgstr "" diff --git a/vendor/afragen/wp-dependency-installer/composer.json b/vendor/afragen/wp-dependency-installer/composer.json index 3eaaed2e0..a27d0090b 100644 --- a/vendor/afragen/wp-dependency-installer/composer.json +++ b/vendor/afragen/wp-dependency-installer/composer.json @@ -1,7 +1,7 @@ { "name": "afragen/wp-dependency-installer", "description": "Library that helps WordPress plugin dependency management.", - "version": "4.3.2", + "version": "4.3.3", "type": "library", "license": "MIT", "authors": [ diff --git a/vendor/afragen/wp-dependency-installer/composer.lock b/vendor/afragen/wp-dependency-installer/composer.lock index b0e2b0587..3e38deb1d 100644 --- a/vendor/afragen/wp-dependency-installer/composer.lock +++ b/vendor/afragen/wp-dependency-installer/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "522013fc51ab7aee32000de625cce168", + "content-hash": "b8862ff91363689d1c7fe048960f159d", "packages": [ { "name": "afragen/wp-dismiss-notice", diff --git a/vendor/afragen/wp-dependency-installer/wp-dependency-installer.php b/vendor/afragen/wp-dependency-installer/wp-dependency-installer.php index e208986e1..b820b3b03 100644 --- a/vendor/afragen/wp-dependency-installer/wp-dependency-installer.php +++ b/vendor/afragen/wp-dependency-installer/wp-dependency-installer.php @@ -539,6 +539,7 @@ public function activate( $slug ) { return [ 'status' => 'updated', + 'slug' => $slug, /* translators: %s: Plugin name */ 'message' => sprintf( esc_html__( '%s has been activated.' ), $this->config[ $slug ]['name'] ), 'source' => $this->config[ $slug ]['source'], diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index cc3156f36..6e12b55fe 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -102,24 +102,24 @@ }, { "name": "afragen/wp-dependency-installer", - "version": "4.3.2", - "version_normalized": "4.3.2.0", + "version": "4.3.3", + "version_normalized": "4.3.3.0", "source": { "type": "git", "url": "https://github.com/afragen/wp-dependency-installer.git", - "reference": "707d659fcbf690999dde8d5a4359e32e0675cf98" + "reference": "5947e52d91969d2fc8e47a25c02325643b154ec8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/afragen/wp-dependency-installer/zipball/707d659fcbf690999dde8d5a4359e32e0675cf98", - "reference": "707d659fcbf690999dde8d5a4359e32e0675cf98", + "url": "https://api.github.com/repos/afragen/wp-dependency-installer/zipball/5947e52d91969d2fc8e47a25c02325643b154ec8", + "reference": "5947e52d91969d2fc8e47a25c02325643b154ec8", "shasum": "" }, "require": { "afragen/wp-dismiss-notice": "*", "php": ">=5.6" }, - "time": "2022-01-25T03:33:14+00:00", + "time": "2022-02-05T23:04:53+00:00", "type": "library", "installation-source": "dist", "autoload": { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 2b1c879a3..150b5c03a 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '7d2da1edbc6d2c1e0d4e8254c0f98ac090ae3640', + 'reference' => '6ef7a25b7fa6b6e35a2f35312a78b717686da4e3', 'name' => 'afragen/git-updater', 'dev' => false, ), @@ -16,7 +16,7 @@ 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '7d2da1edbc6d2c1e0d4e8254c0f98ac090ae3640', + 'reference' => '6ef7a25b7fa6b6e35a2f35312a78b717686da4e3', 'dev_requirement' => false, ), 'afragen/singleton' => array( @@ -42,12 +42,12 @@ 'dev_requirement' => false, ), 'afragen/wp-dependency-installer' => array( - 'pretty_version' => '4.3.2', - 'version' => '4.3.2.0', + 'pretty_version' => '4.3.3', + 'version' => '4.3.3.0', 'type' => 'library', 'install_path' => __DIR__ . '/../afragen/wp-dependency-installer', 'aliases' => array(), - 'reference' => '707d659fcbf690999dde8d5a4359e32e0675cf98', + 'reference' => '5947e52d91969d2fc8e47a25c02325643b154ec8', 'dev_requirement' => false, ), 'afragen/wp-dismiss-notice' => array(