From f4d5f5ed8acd2dee08d3fc8526f5235f8ccc61f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francesco=20Mina=CC=80?= Date: Sun, 11 Feb 2018 16:03:36 +0100 Subject: [PATCH] fix readme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Francesco Minà€ --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4bbf681..0129cbe 100644 --- a/README.md +++ b/README.md @@ -65,9 +65,24 @@ Any other needs or suggestion? [Please open a issue](https://github.com/zeppaman ## How to implement a WpGet compliant plugin This is easy. We have prepared a ready-to-use php updater class that interact with plugin repository to keep plugin updated. This needs only to setup some wordpress settings (repository url and access token). After that your plugin will check for newer version using WpGet and will download them using the private repository. Easy! -For now, [just copy and paste this class into your plugin](https://raw.githubusercontent.com/zeppaman/WpGet/master/src-client/WpGetUpdater.php). In next future we are going to deliver this using a composer package and a public wordpress plugin. +For now, [just copy and paste this class into your plugin](https://raw.githubusercontent.com/zeppaman/WpGet/master/src-client/WpGetUpdater.php). In next future we are going to deliver this using a composer package and a public wordpress plugin. After copying the file, and before including it in the plugin, some variables must be set. This can be done in the plugin itself or in another file, for example the wp-config.php file. The variable are: +```php +// repository config data +define( 'WPGET_REPO_SLUG','test000' ); +define( 'WPGET_PACKAGE_NAME','my-plugin' ); +define( 'WPGET_API_URL','http://localhost:3000/web/' ); +define( 'WPGET_TOKEN_READ','FnrvNuzwKodEgIqxsBctbFc2SxMncM'); + +// plugin info +// plugin filename +define( 'WPGET_PLUGIN_FILE', 'plugin-test.php' ); +// plugin directory +define( 'WPGET_PLUGIN_DIR', 'plugin-test' ); +``` + An example of complete yaml file it can be found inside plugin zip file [here](https://github.com/zeppaman/WpGet/raw/master/example/plugin-test.zip) + ```yaml version: 1.2.4 # versione in form major.minor.build name: name of the package