diff --git a/README.md b/README.md
index 62ae54a..ace678e 100644
--- a/README.md
+++ b/README.md
@@ -151,7 +151,7 @@ Name | Type | Description
Enable VCS | checkbox | Enables this server to download packages from a Version Control System before delivering updates.
Supports Bitbucket, Github and Gitlab.
If left unchecked, zip packages need to be manually uploaded to `wp-content/plugins/updatepulse-server/packages`.
VCS URL | text | The URL of the Version Control System where packages are hosted.
Must follow the following pattern: `https://version-control-system.tld/username` where `https://version-control-system.tld` may be a self-hosted instance of Gitlab.
Each package repository URL must follow the following pattern: `https://version-control-system.tld/username/package-slug/`; the package files must be located at the root of the repository, and in the case of WordPress plugins the main plugin file must follow the pattern `package-slug.php`.
Self-hosted VCS | checkbox | Check this only if the Version Control System is a self-hosted instance of Gitlab.
-Packages branch name | text | The branch to download when getting remote packages from the Version Control System.
+Packages branch name | text | The branch to download when getting remote packages from the Version Control System.
If the VCS supports releases or tags, they will be prioritised over the branch name (release first, then tag, then branch).
To bypass this behaviour, set the `PUC_FORCE_BRANCH` constant to `true` in `wp-config.php`.
VCS credentials | text | Credentials for non-publicly accessible repositories.
In the case of Github and Gitlab, a Personal Access Token; in the case of Bitckucket, an App Password.
**WARNING: Keep these credentials secret, do not share them, and take care of renewing them before they expire!**
Use Webhooks | checkbox | Check so that each repository of the Version Control System calls a Webhook when updates are pushed.
When checked, UpdatePulse Server will not regularly poll repositories for package version changes, but relies on events sent by the repositories to schedule a package download.
Webhook URL: `https://domain.tld/updatepulse-server-webhook/package-type/package-slug` - where `package-type` is the package type (`plugin`, `theme`, or `generic`) and `package-slug` is the slug of the package that needs updates.
Note that UpdatePulse Server does not rely on the content of the payload to schedule a package download, so any type of event can be used to trigger the Webhook.
Remote Download Delay | number | Delay in minutes after which UpdatePulse Server will poll the Version Control System for package updates when the Webhook has been called.
Leave at `0` to schedule a package update during the cron run happening immediately after the Webhook notification was received.
diff --git a/inc/manager/class-data-manager.php b/inc/manager/class-data-manager.php
index d4454c3..01037c0 100644
--- a/inc/manager/class-data-manager.php
+++ b/inc/manager/class-data-manager.php
@@ -172,6 +172,8 @@ class Data_Manager {
* @since 1.0.0
*/
public static function maybe_setup_mu_plugin() {
+ WP_Filesystem();
+
global $wp_filesystem;
$result = true;
diff --git a/inc/manager/class-package-manager.php b/inc/manager/class-package-manager.php
index b8b686a..5fc4d8c 100644
--- a/inc/manager/class-package-manager.php
+++ b/inc/manager/class-package-manager.php
@@ -997,6 +997,7 @@ class Package_Manager {
$scheduled_hook = 'upserv_check_remote_' . $slug;
upserv_unwhitelist_package( $slug );
+ upserv_set_package_metadata( $slug, null );
Scheduler::get_instance()->unschedule_all_actions( $scheduled_hook );
/**
diff --git a/inc/nonce/class-nonce.php b/inc/nonce/class-nonce.php
index 2bce8a5..734ac66 100644
--- a/inc/nonce/class-nonce.php
+++ b/inc/nonce/class-nonce.php
@@ -588,15 +588,17 @@ class Nonce {
$sql = "DELETE FROM {$wpdb->prefix}upserv_nonce
WHERE expiry < %d
AND (
- JSON_VALID(`data`) = 1
- AND (
- JSON_EXTRACT(`data` , '$.permanent') IS NULL
- OR JSON_EXTRACT(`data` , '$.permanent') = 0
- OR JSON_EXTRACT(`data` , '$.permanent') = '0'
- OR JSON_EXTRACT(`data` , '$.permanent') = false
+ JSON_VALID(`data`) = 0
+ OR (
+ JSON_VALID(`data`) = 1
+ AND (
+ JSON_EXTRACT(`data` , '$.permanent') IS NULL
+ OR JSON_EXTRACT(`data` , '$.permanent') = 0
+ OR JSON_EXTRACT(`data` , '$.permanent') = '0'
+ OR JSON_EXTRACT(`data` , '$.permanent') = false
+ )
)
- ) OR
- JSON_VALID(`data`) = 0;";
+ );";
$sql_args = array( time() - self::DEFAULT_EXPIRY_LENGTH );
/**
diff --git a/inc/server/update/class-update-server.php b/inc/server/update/class-update-server.php
index 271eb1b..ace147e 100644
--- a/inc/server/update/class-update-server.php
+++ b/inc/server/update/class-update-server.php
@@ -1315,7 +1315,7 @@ class Update_Server {
$this->self_hosted
);
- if ( $this->update_checker ) {
+ if ( $this->update_checker && $this->update_checker->slug === $slug ) {
return;
}
diff --git a/inc/templates/admin/plugin-help-page.php b/inc/templates/admin/plugin-help-page.php
index c782712..197876a 100644
--- a/inc/templates/admin/plugin-help-page.php
+++ b/inc/templates/admin/plugin-help-page.php
@@ -52,7 +52,7 @@
printf(
// translators: %s is upserv_download_remote_package( string $package_slug, string $type );
esc_html__( '[expert] calling the %s method in your own code, with the VCS-related parameters corresponding to a VCS configuration saved in UpdatePulse Server', 'updatepulse-server' ),
- 'upserv_download_remote_package( string $package_slug, string $type, string $vcs_url = false, string branch = \'main\');'
+ 'upserv_download_remote_package( string $package_slug, string $type, string $vcs_url = false, string branch = \'main\' );'
);
?>
@@ -285,7 +285,7 @@ Licensed With: another-plugin-or-theme-slug
// translators: %1$s is a link to opening an issue, %2$s is a contact email
esc_html__( 'After reading the documentation, for more help on how to use UpdatePulse Server, please %1$s - bugfixes are welcome via pull requests, detailed bug reports with accurate pointers as to where and how they occur in the code will be addressed in a timely manner, and a fee will apply for any other request (if they are addressed). If and only if you found a security issue, please contact %2$s with full details for responsible disclosure.', 'updatepulse-server' ),
'' . esc_html__( 'open an issue on Github', 'updatepulse-server' ) . '',
- 'updatepulse@anyape.com',
+ 'updatepulse@anyape.com',
);
?>
-
+ PUC_FORCE_BRANCH, %3$s is true, %4$s is wp-config.php
+ esc_html__( 'The branch to download when getting remote packages from the Version Control System.%1$sIf the VCS supports releases or tags, they will be prioritised over the branch name (release first, then tag, then branch).%1$sTo bypass this behaviour and exclusively rely on the branch, set the %2$s constant to %3$s in %4$s.', 'updatepulse-server' ),
+ '
',
+ 'PUC_FORCE_BRANCH',
+ 'true',
+ 'wp-config.php'
+ );
+ ?>
-
+ PUC_FORCE_BRANCH, %3$s is true, %4$s is wp-config.php
+ esc_html__( 'The branch to download when getting remote packages from the Version Control System.%1$sIf the VCS supports releases or tags, they will be prioritised over the branch name (release first, then tag, then branch).%1$sTo bypass this behaviour and exclusively rely on the branch, set the %2$s constant to %3$s in %4$s.', 'updatepulse-server' ),
+ '
',
+ 'PUC_FORCE_BRANCH',
+ 'true',
+ 'wp-config.php'
+ );
+ ?>