Skip to content

Instantly share code, notes, and snippets.

@johnalarcon
Last active December 22, 2019 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnalarcon/db118b4e823cf92dccf2b3fba150957d to your computer and use it in GitHub Desktop.
Save johnalarcon/db118b4e823cf92dccf2b3fba150957d to your computer and use it in GitHub Desktop.
A robust endpoint example demonstrating how to create a fully-populated display around a plugin. For use with Update Manager plugin for ClassicPress. This can be copied directly into the endpoint text editor and tweaked to suit.
=== Update Manager ===
Description: Painlessly push updates to your ClassicPress plugin users! Serve updates from GitHub, your own site, or somewhere in the cloud. 100% integrated with the ClassicPress update process; slim and performant.
Version: 1.0.0-rc2
Text Domain: codepotent-update-manager
Domain Path: /languages
Requires PHP: 5.6
Requires: 1.0.0
Tested: 4.9.99
Author: Code Potent
Author URI: https://codepotent.com
Plugin URI: https://codepotent.com/classicpress/plugins/
Download link: https://github.com/codepotent/Update-Manager/releases/download/1.0.0-rc2/codepotent-update-manager-1.0.0-rc2.zip
License: GPLv2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Painlessly push updates to your ClassicPress plugin users! Serve updates from GitHub, your own site, or somewhere in the cloud. 100% integrated with the ClassicPress update process; slim and performant.
== Description ==
# Remote Updates made Easy
No matter where you host your plugin code – GitHub, BitBucket, AWS, or even your own website – the Update Manager plugin makes quick work of pushing updates to your end users. A fantastic tool for plugin developers, agencies, and freelancers!
# Simple & Lightweight
The Update Manager only requires that you add a single file to your plugin(s) – and it's a mere 20k! There's no libraries to think about. There's no huge files to add bloat. There's no complicated steps to trip you up! And, _best of all_, your users don't have to install an extra plugin just to deal with updates.
# Complete Integration
The Update Manager plugin is fully integrated with ClassicPress' core update process. Adding your own icons, banners, and screenshots is as simple as dropping your images into the right directory. When your users click for information about your plugin in their dashboard, the popup windows look fantastic – just like this one – with details, imagery, changelog, reviews...and more!
# Online Documentation
You can find the full [online documentation](https://codepotent.com/classicpress/plugins/) at codepotent.com.
[![Code Potent makes cool stuff!](https://static.codepotent.com/images/logotype/codepotent-logotype-words-optimized.svg)](https://codepotent.com/classicpress/plugins/)
== Frequently Asked Questions ==
# Frequently Asked Questions
Got a question not answered here? Check the [documentation](https://codepotent.com/classicpress/plugins/update-manager/#docs).
### How is this different than other updater plugins?
Unlike other updaters, your users won't have to install an extra plugin just to handle updates. Additionally, you can add your own images just by dropping them into the right places. The Update Manager plugin is tightly integrated with the update process, so, you won't see missing bits of data here and there. And, it's the only one written specifically for ClassicPress. The code is exceptionally documented and it is written in namespaced, object-oriented PHP to ensure maximum encapsulation. In short: this is a Code Potent production, baby!
### How does the Update Manager plugin accommodate GDPR?
When your end user's sites check for updates, data is sent to your installation of the Update Manager plugin. This includes data such as the requesting URL, information from plugin header files, and URLs for any images related to the plugin (such as the icon, banner, and screenshots.) The data is used _in memory_ and is not captured, stored, or tracked in any way. While this information is not necessarily sensitive or personally identifying, it is still a good idea to disclose it in your Privacy Policy. If you visit the Privacy page for your ClassicPress site, (`Dashboard > Settings > Privacy`) you will find complete details on the data received, how it is used, and some ideas for how you might update your Privacy Policy.
### Will my users have to install anything more than my own plugin(s)?
No. You'll include one tiny file within your plugin and that's it.
### How much weight will this add to my plugin(s)?
The update client file is about 20k.
### Where can I serve my updated files from?
You can host your plugin update files wherever you like. Serve them from GitHub. Serve them from the cloud. Serve them from your own ClassicPress Media Library. Any web-accessible location is fine.
### Can the Update Manager plugin force automatic updates on end users?
While you can make an update available, it is your end users' decision on whether or not to update. If some of your end users have configured their own sites to receive automatic updates for plugins, then the updates will be automatically applied. This is a core feature, rather than functionality specific to the Update Manager plugin.
### Can I push updates for a plugin that is not actually installed on my own site?
Yes. The Update Manager plugin (which _is_ installed on your site) gathers the data (that you saved in the editor) and spits it out as an endpoint [like this](https://codepotent.com/?update=plugin_information&plugin=codepotent-update-manager/codepotent-update-manager.php&site_url=https://example.org) – it doesn't matter if the particular plugin is actually installed or not.
### If Code Potent pushes an update for the Update Manager plugin, will I have to update my own remote plugins, too, as a result?
If the `UpdateClient.class.php` file is changed in some way, then, yes, you would want to update that file in your remote plugins, as well. However, that code is pretty solid and I don't anticipate changes to that file anytime soon. Changes made to any/all other files in the Update Manager plugin will not have any impact.
### Help! I updated a plugin and it still shows an update is available!
This will occur if you forget to bump the version number in the primary PHP file of your plugin. Essentially, you're updating your plugin to the very same version of itself (as far as the system is concerned.) Hence, the update notification persists. To resolve the issue, bump the version number in your updated plugin's primary PHP file (before packing it up as a zip file) and apply the update one last time.
### I'm getting PCLZIP_ERR_BAD_FORMAT – why is that?
- the `Download link` field is not pointing to an actual zip file, or
- the zip file is corrupt or incomplete, or
- you have error reporting enabled and your plugin triggered an error during the installation process, corrupting the data., or
- you are on Safari and it is auto-unzipping files, which may cause a corruption.
### Can I push theme updates with Update Manager?
No. Theme support is not available at this time.
[![Code Potent makes cool stuff!](https://static.codepotent.com/images/logotype/codepotent-logotype-words-optimized.svg)](https://codepotent.com/classicpress/plugins/)
== Screenshots ==
# Screenshots
1. **A beautifully native experience!** Your end users will enjoy a perfectly native, seamless experience, complete with your own header branding. You can add as much (or as little) information as you like, and you can format the information with markdown. The tabbed interface is smart, too – if there's no data for a particular tab, it just won't display.
2. **Include your own branding!** Got an icon or logo for your plugin? Sweet! This is a nice touch that brings your branding full-circle in the update process. You can use an svg, png, or jpg icon. If you don't have an image available, a default placeholder image is used.
3. **Build on what you already have!** Nobody wants to fill out a million form fields. Luckily, you can practically paste in your existing readme.txt file and just make a few tweaks from there. The Update Manager plugin takes care of the rest.
4. **Testing updates is easy!** Updates can be pushed out on a domain-by-domain basis, allowing you to test updates on a small scale before rolling them out. And, for those who are testing your updates, you can provide them a way to contact you if they experience any issues or just want to tell you it went smoothly.
[![Code Potent makes cool stuff!](https://static.codepotent.com/images/logotype/codepotent-logotype-words-optimized.svg)](https://codepotent.com/classicpress/plugins/)
== Reviews ==
# User Reviews
*****
"This was well worth the wait, thank you – just took it for a test drive and although it took a little bit of a head scratch I got it to do exactly what it says on the tin. 5 stars!"
~ **Zulfikar Gani**, _Theme Developer_
[classicdesigner.co.uk](https://classicdesigner.co.uk/)
*****
"This plugin has greatly improved the update process for Code Potent plugins! And it has been great to see other top developers in the space adopting Update Manager as their go-to solution!"
~ **John Alarcon**, _Plugin Developer_
[codepotent.com](https://codepotent.com)
[![Code Potent makes cool stuff!](https://static.codepotent.com/images/logotype/codepotent-logotype-words-optimized.svg)](https://codepotent.com/classicpress/plugins/)
== Other Notes ==
# About Code Potent
Managed by John Alarcon, the Code Potent project and brand have become synonymous with high quality ClassicPress offerings – from plugins to tutorials to support. Code Potent plugins are consistently well-received and are found far and wide throughout the ClassicPress ecosystem.
[![Code Potent makes cool stuff!](https://static.codepotent.com/images/logotype/codepotent-logotype-words-optimized.svg)](https://codepotent.com/classicpress/plugins/)
== Changelog ==
# Changelog
**[1.0.0-rc2](https://github.com/codepotent/Update-Manager/releases/download/1.0.0-rc2/codepotent-update-manager-1.0.0-rc2.zip)** | 12-21-2019
1. Move `$config['server']` property to a constant; to keep editable lines in one place.
1. Add better inline descriptions of data fields.
1. Add better inline description to the `$cp_latest_version` property.
1. Add link to admin bar for creating new endpoints.
1. Add filter for passing in number of active installs.
1. Update constants that contain `PLUGIN_REPO`; replace that string with `PLUGIN_ENDPOINT`.
1. Minor text changes.
1. Make jQuery multilingual.
1. Translate notification texts.
1. Change custom post type identifer to `plugin_endpoint`; [issue #1](https://github.com/codepotent/Update-Manager/issues/1).
1. Convert to new post type on activation; [issue #1](https://github.com/codepotent/Update-Manager/issues/1).
1. Remove forced menu positioning; preserve the filter; [issue #2](https://github.com/codepotent/Update-Manager/issues/2).
1. Add "View Details" thickbox link to plugin meta row; [issue #3](https://github.com/codepotent/Update-Manager/issues/3).
1. Improve support for `UpdateClient.class.php` relocation; [issue #4](https://github.com/codepotent/Update-Manager/issues/4).
1. Update `PLUGIN_DIRNAME` constant to be backward compatible to PHP 5.6; [issue #5](https://github.com/codepotent/Update-Manager/issues/5).
1. Add filter for additional processing of incoming requests; [issue #6](https://github.com/codepotent/Update-Manager/issues/6), [pull #7](https://github.com/codepotent/Update-Manager/pull/7).
1. Add privacy disclosure functionality; [issue #8](https://github.com/codepotent/Update-Manager/issues/8).
1. Add housekeeping code for plugin deletion; [issue #9](https://github.com/codepotent/Update-Manager/issues/9).
**[1.0.0-rc1](https://github.com/codepotent/Update-Manager/releases/download/1.0.0-rc1/codepotent-update-manager-1.0.0-rc1.zip)** | 11-15-2019
1. Initial release.
[![Code Potent makes cool stuff!](https://static.codepotent.com/images/logotype/codepotent-logotype-words-optimized.svg)](https://codepotent.com/classicpress/plugins/)
== Upgrade Notice ==
This update will bring you up to date with the latest release candidate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment