Giter Club home page Giter Club logo

wp-plugin-update-server's Introduction

WP Packages Update Server - Run your own update server

Developer documentation:

Introduction

WP Packages Update Server allows developers to provide updates for plugins & themes not hosted on wordpress.org (if not compliant with the GPLv2 or later, for example), or for generic packages unrelated to WordPress altogether. It also allows to control the updates with license. Package updates may be either uploaded directly, or hosted in a Remote Repository, public or private, with the latest version of packages stored either locally or in the Cloud. It supports Bitbucket, Github, Gitlab, and self-hosted installations of Gitlab for package updates ; S3 compatible service providers are supported for package storage.

The main branch contains a beta version of WPPUS v2. The dev branch contains an alpha version of WPPUS v2. For stable versions, please use releases.
The v1 branch is only maintained by the community via pull requests, and releases are published only based on community feedback. No new feature will be added and no more in-depth maintenance will be performed by the original author.
There is no formal upgrade path from v1 to v2.

Overview

This plugin adds the following major features to WordPress:

  • Packages Overview: manage package updates with a table showing Package Name, Version, Type, File Name, Size, Last Modified and License Status ; includes bulk operations to delete, download and change the license status, and the ability to delete all the packages. Upload updates from your local machine to WPPUS, or let the system to automatically download them to WPPUS from a Remote Repository. Store packages either locally, or in the Cloud with an S3 compatible service. Packages can also be managed through their own API.
  • Remote Sources: configure the Remote Repository Service of your choice (Bitbucket, Github, Gitlab, or a self-hosted installation of Gitlab) with secure credentials and a branch name where the updates are hosted ; choose to check for updates recurringly, or when receiveing a webhook notification. WPPUS acts as a middleman between your Remote Repository, your udpates storage (local or Cloud), and your clients.
  • Licenses: manage licenses with a table showing ID, License Key, Registered Email, Status, Package Type, Package Slug, Creation Date, and Expiry Date ; add and edit them with a form, or use the API for more control. Licenses prevent packages installed on client machines from being updated without a valid license. Licenses are generated automatically by default and the values are unguessable (it is recommended to keep the default). When checking the validity of licenses an extra license signature is also checked to prevent the use of a license on more than the configured allowed domains.
  • Not limited to WordPress: with a platform-agnostic API, updates can be served for any type of package, not just WordPress plugins & themes. Basic examples of integration with Node.js, PHP, bash, and Python are provided in the documentation.
  • API & Webhooks: Use the Package API to administer packages (browse, read, edit, add, delete), and request for expirable signed URLs of packages to allow secure downloads. Use the License API to administer licenses (browse, read, edit, add, delete) and check, activate or deactivate licenses. Fire Webhooks to notify any URL of your choice of key events affecting packages and licenses.

To connect their packages and WP Packages Update Server, developers can find integration examples in wp-packages-update-server/integration:

  • Dummy Plugin: a folder dummy-plugin with a simple, empty plugin that includes the necessary code in the dummy-plugin.php main plugin file and the necessary libraries in a lib folder.
  • Dummy Theme: a folder dummy-theme with a simple, empty child theme of Twenty Seventeen that includes the necessary code in the functions.php file and the necessary libraries in a lib folder.
  • Dummy Generic: a folder dummy-generic with a simple command line program written bash, Node.js, PHP, bash, and Python. Execute by calling ./dummy-generic.[js|php|sh|py] from the command line. See wppus-api.[js|php|sh|py] for simple examples of the API calls.

In addition, requests to the various APIs are optimised with a customisable Must Use Plugin automatically added upon install of WP Packages Update Server. The original file can be found in wp-packages-update-server/optimisation/wppus-endpoint-optimizer.php.

Special Thanks

A warm thank you to Yahnis Elsts, the author of Plugin Update Checker and WP Update Server libraries, without whom the creation of this plugin would not have been possible.
Authorisation to use these libraries freely provided relevant licenses are included has been graciously granted here.

Compatibility

  • Tested with PHP 8.x - may work with PHP 7.x versions for the most part, but it is not guaranteed
  • WP Packages Update Server proper uses Plugin Update Checker Library 5.3 and WP Update Server Library 2.0.1
  • Integration examples for WordPress packages use Plugin Update Checker Library 5.3

Pull requests to solve any bugs, improve performance, and keep libraries up to date are welcome and highly encouraged.
Requests to debug or troubleshoot specific setups will not be addressed.

Screenshots

Note: the screenshots are updated regularly, but the actual interface may vary slightly.

Packages Overview

Packages Overview

Remote Sources

Remote Sources

Licenses

Licenses

API & Webhooks

API & Webhooks

Client - plugin screens

Plugins

Plugin Details

Client - theme screens

Themes

Theme Details

Theme License

Client - updates screen

Updates

User Interface

Aside from a help page, WP Packages Update Server provides a user interface to manage packages, manage licenses, manage Remote Repository connection, and to configure API & Webhooks.

Packages Overview

This tab allows administrators to:

  • View the list of packages currently available in WP Packages Update Server, with Package Name, Version, Type (Plugin or Theme), File Name, Size, Last Modified and License Status (if enabled)
  • Download a package
  • Toggle between "Require License" and "Do not Require License" for a package when "Enable Package Licenses" is checked under the "Licenses" tab
  • Delete a package
  • Apply bulk actions on the list of packages (download, delete, change license status of the package if licenses are enabled)
  • Add a package (either by uploading it directly, or by priming it by pulling it from a configured Remote Repository)
  • Configure and test a Cloud Storage service
  • Configure other packages-related settings - file upload, cache and logs max sizes.

The following settings are available:

Name Type Description
Use Cloud Storage checkbox Check to use a Cloud Storage Service - S3 Compatible.
If it does not exist, a virtual folder wppus-packages will be created in the Storage Unit chosen for package storage.
Cloud Storage Access Key text The Access Key provided by the Cloud Storage service provider.
Cloud Storage Secret Key text The Secret Key provided by the Cloud Storage service provider.
Cloud Storage Endpoint text The domain (without http:// or https://) of the endpoint for the Cloud Storage Service.
Cloud Storage Unit text Usually known as a "bucket" or a "container" depending on the Cloud Storage service provider.
Cloud Storage Region text The region of the Cloud Storage Unit, as indicated by the Cloud Storage service provider.
Archive max size (in MB) number Maximum file size when uploading or downloading packages.
Cache max size (in MB) number Maximum size in MB for the wp-content/plugins/wp-packages-update-server/cache directory. If the size of the directory grows larger, its content will be deleted at next cron run (checked hourly). The size indicated in the "Force Clean" button is the real current size.
Logs max size (in MB) number Maximum size in MB for the wp-content/plugins/wp-packages-update-server/logs directory. If the size of the directory grows larger, its content will be deleted at next cron run (checked hourly). The size indicated in the "Force Clean" button is the real current size.

A button is available to send a test request to the Cloud Storage Service. The request checks whether the provider is reachable and if the Storage Unit exists and is writable.
If it does not exist during the test, a virtual folder wppus-packages will be created in the Storage Unit chosen for package storage.

Remote Sources

This tab allows administrators to configure how Remote Sources are handled with the following settings:

Name Type Description
Use Remote Repository Service checkbox Enables this server to download packages from a Remote Repository before delivering updates.
Supports Bitbucket, Github and Gitlab.
If left unchecked, zip packages need to be manually uploaded to wp-content/plugins/wp-packages-update-server/packages.
It affects all the packages delivered by this installation of WP Packages Update Server if they have a corresponding repository in the Remote Repository Service.
Settings of the "Packages remote source" section will be saved only if this option is checked.
Remote Repository Service URL text The URL of the Remote Repository Service where packages are hosted.
Must follow the following pattern: https://repository-service.tld/username where https://repository-service.tld may be a self-hosted instance of Gitlab.
Each package repository URL must follow the following pattern: https://repository-service.tld/username/package-slug/ ; the package files must be located at the root of the repository, and in the case of plugins the main plugin file must follow the pattern package-slug.php.
Self-hosted Remote Repository Service checkbox Check this only if the Remote Repository Service is a self-hosted instance of Gitlab.
Packages branch name text The branch to download when getting remote packages from the Remote Repository Service.
Remote Repository Service credentials text Credentials for non-publicly accessible repositories.
In the case of Github and Gitlab, an access token (token).
In the case of Bitbucket, the Consumer key and secret separated by a pipe (consumer_key|consumer_secret). IMPORTANT: when creating the consumer, "This is a private consumer" must be checked.
Use Webhooks checkbox Check so that each repository of the Remote Repository Service calls a Webhook when updates are pushed.
When checked, WP Packages Update 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/wppus-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 WP Packages Update 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 WP Packages Update Server will poll the Remote Repository 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.
Remote Repository Webhook Secret text Ideally a random string, the secret string included in the request by the repository service when calling the Webhook.
WARNING: Changing this value will invalidate all the existing Webhooks set up on all package repositories.
After changing this setting, make sure to update the Webhooks secrets in the repository service.
Remote update check frequency select Only available in case Webhooks are not used - How often WP Packages Update Server will poll each Remote Repository for package updates - checking too often may slow down the server (recommended "Once Daily").

A button is available to send a test request to the Remote Repository Service. The request checks whether the service is reachable and if the request can be authenticated.
Tests via this button are not supported for Bitbucket ; if Bitbucket is used, testing should be done after saving the settings and trying to prime a package in the Packages Overview tab.

In case Webhooks are not used, the following actions are available to forcefully alter the packages schedules (maintenance, tests, etc):

  • Clear all the scheduled remote updates
  • Reschedule all the remote updates

Licenses

This tab allows administrators to:

  • Entirely enable/disable package licenses. It affects all the packages with a "Requires License" license status delivered by WP Packages Update Server.
  • View the list of licenses currently stored by WP Packages Update Server, with License Key, Registered Email, Status, Package Type (Plugin or Theme), Package Slug, Creation Date, Expiry Date, ID
  • Add a license
  • Edit a license
  • Delete a license
  • Apply bulk actions on the list of licenses (delete, change license status)

API & Webhooks

This tab allows administrators to configure:

  • the Package API to administer packages (browse, read, edit, add, delete), request for expirable signed URLs of packages to allow secure downloads, and requests for tokens & true nonces.
  • the License API to administer licenses (browse, read, edit, add, delete) and check, activate or deactivate licenses.
  • the list of URLs notified via Webhooks, with the following available events:
    • Package events (package)
      • Package added or updated (package_update)
      • Package deleted (package_delete)
      • Package downloaded via a signed URL (package_download)
    • License events (license)
      • License activated (license_activate)
      • License deactivated (license_deactivate)
      • License added (license_add)
      • License edited (license_edit)
      • License deleted (license_delete)
      • License becomes required for a package (license_require)
      • License becomes not required a for package (license_unrequire)

Available settings:

Name Description
Private API Keys (Package API) Multiple values ; creating a key required a "Package Key ID" used to identify the package key.
Used to sign requests to obtain tokens for package administration operations (browse, read, edit, add, delete) and obtaining signed URLs of package.
The Package Key ID must contain only numbers, letters, - and _.
WARNING: Keep these keys secret, do not share any of them with customers!
IP Whitelist (Package API) Multiple values.
List of IP addresses and/or CIDRs of remote sites authorized to use the Package Private API (one IP address or CIDR per line).
Leave blank to accept any IP address (not recommended).
Private API Keys (License API) Multiple values ; creating a key required a "License Key ID" used to identify the package key.
Used to sign requests to obtain tokens for license administration operations (browse, read, edit, add, delete).
The License Key ID must contain only numbers, letters, - and _.
WARNING: Keep these keys secret, do not share any of them with customers!
IP Whitelist (License API) Multiple values.
List of IP addresses and/or CIDRs of remote sites authorized to use the License Private API (one IP address or CIDR per line).
Leave blank to accept any IP address (not recommended).
Webhook Multiple values ; creating a Webhook requires a "Payload URL", a secret-key, and a list of events.
Webhooks are event notifications sent to arbitrary URLs at next cronjob (1 min. latest after the event occured, depending on the server configuration) with a payload of data for third party services integration.
To allow the recipients to authenticate the notifications, the payload is signed with a secret-key secret key using sha1 algorithm and sha256 algorithm ; the resulting hashes are made available in the X-WPPUS-Signature and X-WPPUS-Signature-256 headers respectively.
The secret-key must be at least 16 characters long, ideally a random string.
The payload is sent in JSON format via a POST request.
WARNING: Only add URLs you trust!

Performances

Performance can be evaluated using the script tests.php located at the plugin's root. It is included only if the WordPress constants WP_DEBUG and SAVEQUERIES are truthy. Developers can edit the script freely by uncommenting relevant parts to activate the desired tests.

The performance insights below have been gathered on a cheap shared hosting server (less than $10 per month) with 256 MB of RAM, without any function hooked to WP Packages Update Server actions or filters, no Webhook, and with the MU Plugin endpoint optimizer active. Your Mileage May Vary depending on your server configuration and various optimisations you may add to your WordPress installation.

The general conclusion is that calls to the APIs are lighter and faster than loading the vaste majority of WordPress homepages (which is the page likely to be visited the most on any website) and lighter than a WordPress ajax call (extra optimisations and aggressive caching not considered).

Benchmark

Performances loading the frontpage of a fresh WordPress installation with dummy-theme, an empty static frontpage and no active plugin:

--- Start load tests ---
Time elapsed: 0.129
Server memory used: 16.02 M / 256M
Total number of queries: 13
Total number of scripts: 194
--- End load tests ---

Update API

Performances when a client is checking for updates (no license):

--- Start load tests ---
Time elapsed: 0.103
Total server memory used: 16.06 M / 256M
Total number of queries: 1
Total number of scripts: 173
Server memory used to run the plugin: 1.76 M / 256M
Number of queries executed by the plugin: 0
Number of included/required scripts by the plugin: 30
--- End load tests ---

Performances when a client is downloading an update (YMMV: downloading dummy-plugin - no license):

--- Start load tests ---
Time elapsed: 0.111
Total server memory used: 16.06 M / 256M
Total number of queries: 1
Total number of scripts: 173
Server memory used to run the plugin: 1.8 M / 256M
Number of queries executed by the plugin: 0
Number of included/required scripts by the plugin: 30
--- End load tests ---

Performances when a client is checking for updates (with license):

--- Start load tests ---
Time elapsed: 0.112
Total server memory used: 16.06 M / 256M
Total number of queries: 2
Total number of scripts: 174
Server memory used to run the plugin: 1.76 M / 256M
Number of queries executed by the plugin: 1
Number of included/required scripts by the plugin: 31
--- End load tests ---

Performances when a client is downloading an update (YMMV: downloading dummy-plugin - with license):

--- Start load tests ---
Time elapsed: 0.114
Total server memory used: 16.06 M / 256M
Total number of queries: 2
Total number of scripts: 174
Server memory used to run the plugin: 1.76 M / 256M
Number of queries executed by the plugin: 1
Number of included/required scripts by the plugin: 31
--- End load tests ---

Public License API

Performances when a client is activating/deactivating a bogus license key:

--- Start load tests ---
Time elapsed: 0.108
Total server memory used: 15.24 M / 256M
Total number of queries: 2
Total number of scripts: 154
Server memory used to run the plugin: 966.85 K / 256M
Number of queries executed by the plugin: 1
Number of included/required scripts by the plugin: 11
--- End load tests ---

Performances when a client is activating a license key:

--- Start load tests ---
Time elapsed: 0.109
Total server memory used: 15.24 M / 256M
Total number of queries: 6
Total number of scripts: 154
Server memory used to run the plugin: 966.85 K / 256M
Number of queries executed by the plugin: 5
Number of included/required scripts by the plugin: 11
--- End load tests ---

Performances when a client is deactivating a license key:

--- Start load tests ---
Time elapsed: 0.098
Total server memory used: 15.24 M / 256M
Total number of queries: 6
Total number of scripts: 154
Server memory used to run the plugin: 966.85 K / 256M
Number of queries executed by the plugin: 5
Number of included/required scripts by the plugin: 11
--- End load tests ---

Help

The following can also be found under the "Help" tab of the WP Packages Update Server admin page.

Provide updates with WP Packages Update Server - packages requirements

To link your packages to WP Packages Update Server, and optionally to prevent webmasters from getting updates of your ppackages without a license, your packages need to include some extra code.

For plugins, and themes, it is fairly straightforward:

  • Add a lib directory with the plugin-update-checker and wp-update-checker libraries to the root of the package (provided in dummy-[plugin|theme] ; wp-update-checker can be customized as you see fit, but plugin-update-checker should be left untouched).
  • Add the following code to the main plugin file (for plugins) or in the functions.php file (for themes) :
/** Enable updates - note the  `$prefix_updater` variable: change `prefix` to a unique string for your package **/
require_once __DIR__ . '/lib/wp-package-updater/class-wp-package-updater.php';

$prefix_updater = new WP_Package_Updater(
	wp_normalize_path( __FILE__ ),
	0 === strpos( __DIR__, WP_PLUGIN_DIR ) ? wp_normalize_path( __DIR__ ) : get_stylesheet_directory()
);
  • Add a wppus.json file at the root of the package with the following content - change the value of "server" to your own (required), and select a value for "requireLicense" (optional):
{
   "server": "https://server.domain.tld/",
   "requireLicense": true|false
}
  • Connect WPPUS with your repository and prime your package, or manually upload your package to WPPUS.

For generic packages, the steps involved entirely depend on the language used to write the package and the update process of the target platform.
You may refer to the documentation found here.


See wp-content/plugins/wp-packages-update-server/integration/dummy-plugin for an example of plugin, and wp-content/plugins/wp-packages-update-server/integration/dummy-theme for an example of theme. They are fully functionnal and can be used to test all the features of the server with a test client installation of WordPress.

See wp-content/plugins/wp-packages-update-server/integration/dummy-generic for examples of a generic package written in Bash, NodeJS, PHP with Curl, and Python. The API calls made by generic packages to the license API and Update API are the same as the WordPress packages. Unlike the upgrade library provided with plugins & themes, the code found in wppwus-api.[sh|php|js|py] files is NOT ready for production environment and MUST be adapted.

Unless "Use Remote Repository Service" is checked in "Remote Sources", you need to manually upload the packages zip archives (and subsequent updates) in wp-content/wppus/packages or CloudStorageUnit://wppus-packages/. A package needs to a valid generic package, or a valid WordPress plugin or theme package, and in the case of a plugin the main plugin file must have the same name as the zip archive. For example, the main plugin file in package-slug.zip would be package-slug.php.

Requests optimisation

When the remote clients where your plugins and themes are installed send a request to check for updates or download a package, this server's WordPress installation is loaded, with its own plugins and themes. This is not optimised if left untouched because unnecessary action and filter hooks that execute before parse_request action hook are also triggered, even though the request is not designed to produce any on-screen output or further computation.

To solve this, the file wp-content/plugins/wp-packages-update-server/optimisation/wppus-endpoint-optimiser.php is automatically copied to wp-content/mu-plugins/wppus-endpoint-optimiser.php. This effectively creates a Must Use Plugin running before everything else and preventing themes and other plugins from being executed when an update request or a license API request is received by WP Packages Update Server.

You may edit the variable $wppus_always_active_plugins of the MU Plugin file to allow some plugins to run anyway, or set the $wppus_bypass_themes to false to allow functions.php files to be included, for example to hook into WP Plugin Server actions and filters. If in use and a new version is available, the MU Plugin will be backed-up to wp-content/mu-plugins/wppus-endpoint-optimiser.php.backup when updating WP Packages Update Server and will automatically be replaced with its new version. If necessary, make sure to report any previous customization from the backup to the new file.

The MU Plugin also provides the global variables $wppus_doing_update_api_request and $wppus_doing_license_api_request that can be tested when adding hooks and filters would you choose to keep some plugins active with $wppus_always_active_plugins or keep functions.php from themes included with $wppus_bypass_themes set to false.

More help...

For more help on how to use WP Packages Update Server, please open an issue - 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 [email protected] with full details for responsible disclosure.

wp-plugin-update-server's People

Contributors

dependabot[bot] avatar froger-me avatar mbsouth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wp-plugin-update-server's Issues

Access_Token will be removed by July 1st, 2020

Hey @froger-me

first of all thank you for your great job with the wp-plugin-update-server repo. Github sent me an email where they announce that they will not support the access_token by July 1st, 2020.

This is the email from GitHub:

Hi @sekra24,

On February 14th, 2020 at 07:02 (UTC) your personal access token (reponame) using WordPress/5.3.2; https://www.domain.com was used as part of a query parameter to access an endpoint through the GitHub API:

https://api.github.com/repositories/XXXXXXXXXX/releases/latest

Please use the Authorization HTTP header instead, as using the access_token query parameter is deprecated and will be removed July 1st, 2020.

Depending on your API usage, we'll be sending you this email reminder once every 3 days for each token and User-Agent used in API calls made on your behalf.
Just one URL that was accessed with a token and User-Agent combination will be listed in the email reminder, not all.

Visit https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api/#authenticating-using-query-parameters for more information.

Thanks,
The GitHub Team

Remote (Github) packages not updated?

Hi, since the last update of the plugin I'm experiencing this issue and I wonder if it's only me.

No matter if I delete the package, add it again, it is still stuck to an old version. Github's now version is dummy-plugin 1.50 while the plugin is pulling a mysterious v1.13 :)

Tried to empty cache and everything, still same result. The strange thing is no error is present.

I also tried these steps:
-reset the permalinks
-delete the package from the server
... and checked if the issue still happens when visiting the API url without priming the package with http://mysite.org/wppus-update-api/?action=get_metadata&package_id=dummy-plugin&checking_for_updates=1&update_type=Plugin . Still the same old version pulled.
The version I am stuck with is the one prior to updating WP Plugin Update Server actually.

Can you, guys, please check if you experience the same on your servers? Thank you!

License Management

How can I add License Management that can working with Woocommerce?
This will make a perfect combination!

Custom action or parameters for the update API?

I wanted to ask you a question. In the past I used this class to manage updates of themes and plugins, but I've never been able to find the efficient way to use it to create a page of add-ons available for a specific plugin.

The problem is that WP Update Server works at the level of a single plugin or theme. The instance of the UpdateChecker class is created by passing the server IP. the slug and little else. It can also be created by sending the path of a json file.

However the main problem is that the instance that searches for updates is always relative to a single package (theme or plugin). To create my add-ons page I modified the dispatcher (and all its properties) to read a new action called get_addons, with the slug parameter to be passed to the corresponding new methods.

In practice, a query args like this:

?action=get_addons&slug=theme-o-plugin-slug&version=theme-o-plugin-version

However, as a system it has become fragile and unmanageable when needs have grown and in addition to add-ons, patches and translations have taken over.

So what I wanted to ask you is this. How could one do to add this feature?

Quoted from #6

curl error: cant resolve host

Getting this error on the "Update Page" and cant find Plugin on the details page:

Warning: The URL https://myhost.de/wppus-update-api/?action=get_metadata&package_id=woocommerce_random_products&installed_version=0.1.3&php=7.2.31-1+ubuntu16.04.1+deb.sury.org+1&locale=de_DE&checking_for_updates=1&update_type=Plugin does not point to a valid metadata file. WP HTTP Error: cURL error 6: Could not resolve host: myhost.de in /var/www/vhosts/myhost.de/myhost.de/wp-content/plugins/woocommerce_random_products/lib/plugin-update-checker/Puc/v4p9/UpdateChecker.php on line 408

if i open the link in browser i can get the expected json.
any solution for this problem?

Activate / Deactivate functions don't validate package_slug

Sorry to bother you again. I am using version 1.4.16 and have 2 packages that need a license key. For both of the packages I created one:

image

For x-framework we have 32de42939f8fbb434f396d97
For x-image-search we have db8aa70fdb5fae9e2bf036f5

image

As you can see in the image above, I am able to activate a license key that is not meant for the package. It seems that there is no check between the given package_slug (to check on) and the package_slug that is given in the license details on the wp-packages-update-server end.

Hopefully I explained it well enough.

Delete and Delete All Packaes not work

Hello,

I'm trying your plugin and I realized that all the options to delete a plugin do not work. I tried on Linux where I could have a permissions problem and also on Windows but the problem persists.

With WP_DEBUG set no warning or error is displayed.

Do you have any idea?

Example not working

I installed Dummy Plugin with licence, but I get folowing error: Unexpected Error! The query to retrieve the license data returned a malformed response.

If I look at developer console, I see javascritp error:
image

Any hint how to resolve this issue?

WP Plugin Update Server with Bitbucket

Hello, first thank you for the cool plugin. I'm anxious to get it working. Everything appears to be setup right on the server. My plugin is updating in packages when I retrieve it from remote. But even with the dummy plugin setup and the without license part filled out I get errors.

Could not determine if updates are available for Dummy Plugin.
HTTP response code is 404 (expected: 200) puc_unexpected_response_code

I found on localhost (windows running xampp) the dummy-plugin causes white screen of death. if I change
$dummy_plugin_updater = new WP_Plugin_Updater(
'https://my-domain.tld',
FILE,
plugin_dir_path( FILE )
);

$dummy_plugin_updater = new WP_Plugin_Updater(
'https://my-domain.tld',
FILE,
wp_normalize_path(plugin_dir_path( FILE ))
);
it loads but still get the same error.

I think it's checking GITHUB instead of bitbucket but I'm not sure how that works.

I also can't figure out how to troubleshoot. I tried loading the endpoint with https://my-domain.tld/wp-content/plugins/wp-update-server/?update_action=get_metadata&plugin_id=dummy-plugin%2Fdummy-plugin.php according to meta_data url. On localhost it's completely botched on linux it seems right but won't load I get the same error either way

Could not determine if updates are available for Dummy Plugin.
HTTP response code is 404 (expected: 200) puc_unexpected_response_code

LOCALHOST
https://my-domain.tld/wp-content/plugins/wp-update-server/?update_action=get_metadata&plugin_id=C%3A%5CX%5CAAA_PHPSTORM_PROJECTS%5Cmylocaldev.dev.cc%5Cwp-content%5Cplugins%5Cdummy-plugin%5Cdummy-plugin.php

HOSTING SERVER WITH LINUX
https://my-domain.tld/wp-content/plugins/wp-update-server/?update_action=get_metadata&plugin_id=dummy-plugin%2Fdummy-plugin.php

Not sure where to go from here. Thanks for your help.
Russ

Can't download theme from a subgroup on gitlab.com and JS Error: $(...).datepicker is not a function main.js:337:27

WP Core Version 4.9.8
WP Plugin Update Server Version 1.4.8

I've tried to use gitlab.com/group/subgroup as Remote repository service URL and when I try to get the theme by Get remote package the spinner never stops spinning.

Also I got this error in the JS console.

TypeError: $(...).datepicker is not a function main.js:337:27
<anonimno> https://DOMAIN.TLD/wp-content/plugins/wp-plugin-update-server/js/admin/main.js:337:27
i https://DOMAIN.TLD/wp-admin/load-scripts.php:2:27444
fireWith https://DOMAIN.TLD/wp-admin/load-scripts.php:2:28213
ready https://DOMAIN.TLD/wp-admin/load-scripts.php:2:30004
K https://DOMAIN.TLD/wp-admin/load-scripts.php:2:30366

Perhpas these two issues are related?

Update available, but 'update now' link not visible

When I click the "Check for updates" link under the plugin details, it shows the message "A new version is available."

But the "Update now" section below the plugin details isn't visible, so the plugin can't be updated.

I'm using Gitlab for the remote source and the 'Prime a package using a remote repository' is updating the version number correctly to show the updated files.

Does anyone know how to fix this or help troubleshoot?

Possible incorrect use of the function **date_i18n**

WP Plugin Update Server Version: 1.4.14
WP Version: 5.8

Possible incorrect use of the function date_i18n in wp-plugin-update-server/wp-plugin-update-server/integration-examples/dummy-theme/lib/wp-package-updater/ on line 445

Expected behavior:
Outputs a message on WP Admin Dashboard that a license has expired. This message should include the expiration date.

Actual behavior:
Outputs the current date of the day instead of the expiration date.

The use of date_i18n in /wp-package-updater/class-wp-package-updater.php on line 445:

date_i18n( get_option( 'date_format' ), $license_data->date_expiry )

is incorrect. According to WP code reference, the second parameter can´t be a date (string) but only int|bool:

date_i18n( 
    string $format, 
    int|bool $timestamp_with_offset = false, 
    bool $gmt = false )

Possible solution:
445: date_format( date_create( $license_data->date_expiry ), get_option( 'date_format' ) )
shows the correct expiration date.

WP Update server Easy setup not working?

I forgot one thing. I remember that wp update server allowed to do something like this:

Easy to set up.

Just upload the script directory to your server and drop a plugin or theme ZIP in the packages subdirectory. Now you have a working update API at http://yourserver.com/wp-update-server/?action=get_metadata&slug=your-plugin.
Unfortunately with your plugin it does not work. I have also tried to the wp-content/wppus directory but without success.

Did you change anything?

Quoted from #6

Fatal Error on Activation

I attempt to activate the plugin and get this message:

Plugin could not be activated because it triggered a fatal error.
Failed to create the necessary database table(s).

I am using MAMP PRO4 (localhost), but have never had this happen in past years with any other plugin.

Maybe something I am missing? Simply uploaded / activated like any other plugin.

Updates from localhost dev on windows.

Updating from localhost dev on windows still not working. To me it would be important that it is compatible with localhost on windows development mostly because wordpress.org and the https://github.com/YahnisElsts/plugin-update-checker do also work.

I think you find the issue in your function that creates the plugin_id for the endpoint
(plugin_id=dummy-plugin%2Fdummy-plugin.php)
on localhost for windows is sending
(plugin_id=C%3A%5C%5CX%5C%5CAAA_PHPSTORM_PROJECTS%5C%5Cmyproject.dev.cc%5C%5Cwp-content%5C%5Cplugins%5C%5Cdummy-plugin%5C%5Cdummy-plugin.php)
In the localhost dev site admin > Plugins > Dummy Plugin v1 > Check for Updates when I try and update I get this error:
Could not determine if updates are available for Dummy Plugin. HTTP response code is 404 (expected: 200) puc_unexpected_response_code
Thanks @froger-me

Uncaught ReferenceError: Wppus is not defined

I get a Uncaught ReferenceError: Wppus is not defined error when I try and click the "Get remote package" button from the "Prime a package using a Remote Repository (recommended)" option.

Maybe related: When on the Licenses tab I click on "Add License", nothing happens.

Public API Authentication Key

    • Public API Authentication Key => The Public API Authentication Key in the "Licenses" tab of WP Plugin Update Server

I can't find the Public API Authentication Key in the license settings
Where can I get it to add it to the functions file?

PHP 7.3 warning

I try use intergration example - plugin.
After activation I see error:
<b>Deprecated</b>: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in <b>/var/www/flector/data/www/*****.ru/wp-content/plugins/dummy-plugin/lib/plugin-update-checker/Puc/v4p4/Plugin/UpdateChecker.php</b> on line <b>641</b><br> <br>

Integration with plugins software-license-manager

Hello
I hope you are well
I use the software-license-manager plugin to license my plugins and templates so that licenses are created and activated automatically.
Is it possible to integrate the license section in your plugin with this plugin so that a license can be created automatically?
In general, what is your solution for creating automatic licenses for our plugins? So that the user can get and activate the license by purchasing the plugin from my site and then can receive the updates?
My site store is implemented with WooCommerce.
tanks

PUC Empty Response and Unexpected Error Query on License Activation

Screenshot_2

I have a couple of issues and I am not sure if they are related or not.

Issue 1 - When clicking on the check for updates I get an error ould not determine if updates are available for IAM IP Address. The metadata file appears to be empty. puc_empty_response

Issue 2 - This issue pertains to the licensing. When adding a license I get Unexpected Error! The query to retrieve the license data returned a malformed response.

I have read through the past issues and I have done the suggested on several and I am still unable to get this to work correctly. At this point I am not wondering if this could be the update server site that I am using but I cannot be sure.

Any help would be appreciated.

Deprecation notice for authentication via URL query parameters

I received this email from GitHub,

On {DATE} at 19:04 (UTC) your personal access token (TOKEN_NAME) using WordPress/5.4.5; {SITE_URL} was used as part of a query parameter to access an endpoint through the GitHub API:

https://api.github.com/repositories/204429255/zipball/master

Please use the Authorization HTTP header instead, as using the access_token query parameter is deprecated. If this token is being used by an app you don't have control over, be aware that it may stop working as a result of this deprecation.

Depending on your API usage, we'll be sending you this email reminder on a monthly basis for each token and User-Agent used in API calls made on your behalf.
Just one URL that was accessed with a token and User-Agent combination will be listed in the email reminder, not all.

Visit https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param for more information about suggested workarounds and removal dates.

Is there any way to resolve it?

It's trying to download from the plugin intsall directory site rather than the update server

I've installed your plugin at www.themoyles.co.uk and have added an update.
Just testing from localhost/themoyles

Added the lib directory from the dummy-plugin to my plugin with this code...

require_once plugin_dir_path( __FILE__ ) . 'lib/wp-package-updater/class-wp-package-updater.php';

$parents_evening_updater = new WP_Package_Updater(
  'https://www.themoyles.co.uk',
  wp_normalize_path( __FILE__ ),
  wp_normalize_path( plugin_dir_path( __FILE__ ) )
);

and I get this...
Downloading update from https://localhost/moyles/wp-update-server/?action=download&token=8ec7628dfcbb4ed6&package_id=###### which gives an error

Rather than trying to download from www.themoyles.co.uk it's trying from my home server!

What have I done wrong?!

Updating from gitlab.com stopped working

A few days ago when I tested fetching themes from gitlab.com everything worked.

Now I get: Error - could not get remote package. Check if a repository with this slug exists and has a valid file structure. on both github.com and gitlab.com

WPPUS: 1.4.9
Wordpress: 4.9.8

And this is happening on two separate installs. One on WP Engine and the other on DigitalOcean droplet. Error in error log says:

Sun Dec 02 07:38:22.066775 2018] [php7:notice] [pid 19140] [client xxx.xxx.xxx.xxx:xxxxx] WPPUS_Zip_Package_Manager::clean_package: Not Found, referer: https://domain.tld/wp-admin/admin.php?page=wppus-page

Also this is what I get in the debug log.

[02-Dec-2018 17:48:28 UTC] PHP Notice:  Undefined property: WPPUS_Zip_Package_Manager::$debug in /shared/httpd/wppus/wp-content/plugins/wp-plugin-update-server/inc/class-wppus-zip-package-manager.php on line 88
[02-Dec-2018 17:48:28 UTC] PHP Stack trace:
[02-Dec-2018 17:48:28 UTC] PHP   1. {main}() /shared/httpd/wppus/wp-admin/admin-ajax.php:0
[02-Dec-2018 17:48:28 UTC] PHP   2. do_action($tag = *uninitialized*, $arg = *uninitialized*) /shared/httpd/wppus/wp-admin/admin-ajax.php:100
[02-Dec-2018 17:48:28 UTC] PHP   3. WP_Hook->do_action($args = *uninitialized*) /shared/httpd/wppus/wp-includes/plugin.php:453
[02-Dec-2018 17:48:28 UTC] PHP   4. WP_Hook->apply_filters($value = *uninitialized*, $args = *uninitialized*) /shared/httpd/wppus/wp-includes/class-wp-hook.php:310
[02-Dec-2018 17:48:28 UTC] PHP   5. WPPUS_Update_Manager->prime_package_from_remote() /shared/httpd/wppus/wp-includes/class-wp-hook.php:284
[02-Dec-2018 17:48:28 UTC] PHP   6. WPPUS_Update_API::download_remote_update($slug = *uninitialized*, $type = *uninitialized*, $update_server = *uninitialized*) /shared/httpd/wppus/wp-content/plugins/wp-plugin-update-server/inc/class-wppus-update-manager.php:301
[02-Dec-2018 17:48:28 UTC] PHP   7. WPPUS_Update_Server->save_remote_package_to_local($safe_slug = *uninitialized*) /shared/httpd/wppus/wp-content/plugins/wp-plugin-update-server/inc/class-wppus-update-api.php:95
[02-Dec-2018 17:48:28 UTC] PHP   8. WPPUS_Zip_Package_Manager->clean_package() /shared/httpd/wppus/wp-content/plugins/wp-plugin-update-server/inc/class-wppus-update-server.php:104
[02-Dec-2018 17:48:28 UTC] WPPUS_Zip_Package_Manager::clean_package: Not Found
[02-Dec-2018 17:48:28 UTC] PHP Notice:  Undefined variable: package in /shared/httpd/wppus/wp-content/plugins/wp-plugin-update-server/inc/class-wppus-zip-package-manager.php on line 94
[02-Dec-2018 17:48:28 UTC] PHP Stack trace:
[02-Dec-2018 17:48:28 UTC] PHP   1. {main}() /shared/httpd/wppus/wp-admin/admin-ajax.php:0
[02-Dec-2018 17:48:28 UTC] PHP   2. do_action($tag = *uninitialized*, $arg = *uninitialized*) /shared/httpd/wppus/wp-admin/admin-ajax.php:100
[02-Dec-2018 17:48:28 UTC] PHP   3. WP_Hook->do_action($args = *uninitialized*) /shared/httpd/wppus/wp-includes/plugin.php:453
[02-Dec-2018 17:48:28 UTC] PHP   4. WP_Hook->apply_filters($value = *uninitialized*, $args = *uninitialized*) /shared/httpd/wppus/wp-includes/class-wp-hook.php:310
[02-Dec-2018 17:48:28 UTC] PHP   5. WPPUS_Update_Manager->prime_package_from_remote() /shared/httpd/wppus/wp-includes/class-wp-hook.php:284
[02-Dec-2018 17:48:28 UTC] PHP   6. WPPUS_Update_API::download_remote_update($slug = *uninitialized*, $type = *uninitialized*, $update_server = *uninitialized*) /shared/httpd/wppus/wp-content/plugins/wp-plugin-update-server/inc/class-wppus-update-manager.php:301
[02-Dec-2018 17:48:28 UTC] PHP   7. WPPUS_Update_Server->save_remote_package_to_local($safe_slug = *uninitialized*) /shared/httpd/wppus/wp-content/plugins/wp-plugin-update-server/inc/class-wppus-update-api.php:95
[02-Dec-2018 17:48:28 UTC] PHP   8. WPPUS_Zip_Package_Manager->clean_package() /shared/httpd/wppus/wp-content/plugins/wp-plugin-update-server/inc/class-wppus-update-server.php:104

Little confused and seeking help...

Stumbled across your plugin in search engine and see it was removed from WP repository.

I do not see a plugin in package? Not sure how to proceed with the files that are in the package?

Please forgive my lack of knowledge on the way to obtain the plugin:) Like to use it in a classroom project.

Thanks!

Licenses need domain to manage

hi
Licenses need domain to manage, can add domain example.com to my License in Licenses page ?

how to fill allowed_domains array ?

Packages licensing: Prevent plugins and themes installed on remote WordPress installation from being updated without a valid license. Licenses are generated automatically by default and the values are unguessable (it is recommended to keep the default). When checking the validity of licenses an extra license signature is also checked to prevent the use of a license on more than the configured allowed domains.

how to use this ?

Sometimes after cron / check for updates a corrupt zip is stored on the server

Sometimes when an automatic plugin / theme update is triggered a corrupt zip is stored on the server. When I the visit the overview page I get an empty page. This is the error I get when visiting the Overview page:

[Tue Feb 19 21:16:53.226198 2019] [php7:error] [pid 26188] [client www.xxx.yyy.zzz:32844] PHP Fatal error: Uncaught Wpup_InvalidPackageException: The specified file /nas/content/live/wpkupisi/wp-content/wppus/packages/bohinj-si-stage.zip does not contain a valid WordPress plugin or theme. in /nas/content/live/wpkupisi/wp-content/plugins/wp-plugin-update-server/lib/wp-update-server/includes/Wpup/ZipMetadataParser.php:128\nStack trace:\n#0 /nas/content/live/wpkupisi/wp-content/plugins/wp-plugin-update-server/lib/wp-update-server/includes/Wpup/ZipMetadataParser.php(102): Wpup_ZipMetadataParser->extractMetadata()\n#1 /nas/content/live/wpkupisi/wp-content/plugins/wp-plugin-update-server/lib/wp-update-server/includes/Wpup/ZipMetadataParser.php(74): Wpup_ZipMetadataParser->setMetadata()\n#2 /nas/content/live/wpkupisi/wp-content/plugins/wp-plugin-update-server/lib/wp-update-server/includes/Wpup/Package.php(67): Wpup_ZipMetadataParser->__construct(NULL, '/nas/content/li...', Object(Wpup_FileCache))\n#3 /nas/content/live/wpkupisi/wp-content/plugins/wp-plugin-update-server/inc/class-wppus-update-manager.php(785): Wpup_Package::fr in /nas/content/live/wpkupisi/wp-content/plugins/wp-plugin-update-server/lib/wp-update-server/includes/Wpup/ZipMetadataParser.php on line 128, referer: https://DOMAIN.TLD/wp-admin/admin.php?page=wppus-page-remote-sources

Can you set a try catch for this case and display which theme / plugin is corrupt? What exactly is the issue that this happens I haven't seen anything in the log yet but it doesn't happen when I update manually.

Setup Usage Problem

Hello, thank you for this plugin. How to integrate this plugin into our own server and theme to be updated, and is there a video tutorial for general use?

request.log missing

In main package, request.log records all logs of requests. But folder seems empty.
Known issue?

404 error for /wppus-update-api

I am getting a 404 for /wppus-update-api
more specifically,
https://domain/wppus-update-api/?action=get_metadata&package_id=pkg-name&installed_version=0.9&php=7.0.25-0ubuntu0.16.04.1&locale=en_US&checking_for_updates=1&update_type=Plugin

I have a fresh WP install with only the WP Plugin Update Server plugin installed.
WP 5.0.3
Package is hosted in BitBucket private repository.

Is there something I am missing?

Extra info:
RE: BitBucket--I set up the consumer as the instructions said. It pulled the "prime" fine, but the WP list of packages still shows that first version even though the download link gets a newer version. Wondering if these issues may be related.

{feature request] Company and contact information as taxonomy

Hi there. first off, thank you so much for this plugin and that it is open source. I have been using the plugin-update-checker library on a suite of plugins and had building a plugin like this on my roadmap. I am over the moon that I have found this plugin and really appreciate your hard work. Thank you so much! I was searching for the update-plugin-checker repo on github and this plugin popped up on Google. I was yelling in my office at my coworkers how pumped I was that I found this plugin. Seriously thank you!

I am in the early stages of setting this up and went through the exercise of adding a package. Everything was very straight forward in that respect. What I could see down the road is that typing in the person's name, email, and company every time will get cumbersome, especially when a single client has 4+ licenses. I was thinking to make this data entry more efficient that each license could be associated with a taxonomy term that is the contact. And then the contact term holds the name, email, company name, etc. So really just an idea, not a 'request'.

Thanks so much again. Really appreciate your hard work!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.