From ca002a86c553d9ae5fb466f663529f4a9a48e60b Mon Sep 17 00:00:00 2001 From: Almira Krdzic Date: Mon, 30 Jul 2018 09:07:20 +0200 Subject: [PATCH] Readme changes --- README.md | 58 +++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 4581484..bd70d6a 100644 --- a/README.md +++ b/README.md @@ -92,9 +92,9 @@ Wiaas implementation based on wordpress [woocommerce](https://woocommerce.com/) ### Backend - - Project structure +- Project structure - Project structure is inspired with [Roots Bedrock structure](https://roots.io/bedrock/). + `Project structure is inspired with [Roots Bedrock structure](https://roots.io/bedrock/). ├── composer.json # → Manage versions of WordPress, plugins & dependencies @@ -125,41 +125,41 @@ Wiaas implementation based on wordpress [woocommerce](https://woocommerce.com/) - Secure passwords with [wp-password-bcrypt](https://github.com/roots/wp-password-bcrypt) - Composer as task runner for automatic wordpress db updates - - Dependencies management +- Dependencies management - Wordpress core (`"johnpbloch/wordpress"`) and wordpress plugins code are managed with `composer.json` file. - - But using combination of [Composer scripts](https://getcomposer.org/doc/articles/scripts.md) and [WP CLI commands](https://developer.wordpress.org/cli/commands/) - we can automate database updates as well (mainly plugin activation and db updates after plugin version change); - - For adding new plugin from wordpress official repo add `"wpackagist-plugin/{plugin_name}": "{plugin_version}"` to `composer.json`. - Then add package to `"activate-plugins"` composer script in `composer.json` file in order in which you wish them to be activated. - If plugin exposes wp cli command for database updates add it to `"update-db"` composer script in `composer.json` file - (ex: woocommerce plugin exposes `wp wc update` which will apply pending database plugins for woocommerce). - - For updating wordpress core or plugins, update version for package - (wordpress core database changes will be applied with `wp core update-db` cli command ). - - After any of these actions run: + Wordpress core (`"johnpbloch/wordpress"`) and wordpress plugins code are managed with `composer.json` file. + + But using combination of [Composer scripts](https://getcomposer.org/doc/articles/scripts.md) and [WP CLI commands](https://developer.wordpress.org/cli/commands/) + we can automate database updates as well (mainly plugin activation and db updates after plugin version change); + + For adding new plugin from wordpress official repo add `"wpackagist-plugin/{plugin_name}": "{plugin_version}"` to `composer.json`. + Then add package to `"activate-plugins"` composer script in `composer.json` file in order in which you wish them to be activated. + If plugin exposes wp cli command for database updates add it to `"update-db"` composer script in `composer.json` file + (ex: woocommerce plugin exposes `wp wc update` which will apply pending database plugins for woocommerce). + + For updating wordpress core or plugins, update version for package + wordpress core database changes will be applied with `wp core update-db` cli command ). + + After any of these actions run: composer update # → Will download latest code composer update-db # → Activate plugins and calls all exposed wp cli commands for db updates - For removing plugin that has no db changes just remove it from composer.json and execute `composer update` which will remove its code; - If plugin has database changes that we wish to be removed that is oneoff migration that can be done from - admin panel or using `wp plugin deactivate {plugin_name} && composer remove wpackagist-plugin/{plugin_name}` script. + For removing plugin that has no db changes just remove it from composer.json and execute `composer update` which will remove its code; + If plugin has database changes that we wish to be removed that is oneoff migration that can be done from + admin panel or using `wp plugin deactivate {plugin_name} && composer remove wpackagist-plugin/{plugin_name}` script. - WP CLI is very powerful tool for writing automation scripts without need to track and copy mysql dumps. + WP CLI is very powerful tool for writing automation scripts without need to track and copy mysql dumps. - - Wiaas plugin +- Wiaas plugin - Our code is placed inside `backend/app/plugins/wiaas` folder. - This folder will be managed by git and commited to repository (check `backend/.gitignore`). + Our code is placed inside `backend/app/plugins/wiaas` folder. + This folder will be managed by git and commited to repository (check `backend/.gitignore`). - Wiaas exposes `wp wiaas update-db` command to WP CLI which will execute pending db updates for wiaas. + Wiaas exposes `wp wiaas update-db` command to WP CLI which will execute pending db updates for wiaas. - If your feature requires some database updates that can be easiliy executed from wordpress code, then - place this update to `wiaas/includes/db-updates/wiaas-db-update-functions.php` as a function named `wiaas_db_update_{name}`. - Then add this function to `wiaas/includes/class-wiaas-db-update.php` with its timestamp. - This way after `composer update-db` is executed your database update will be applied. + If your feature requires some database updates that can be easiliy executed from wordpress code, then + place this update to `wiaas/includes/db-updates/wiaas-db-update-functions.php` as a function named `wiaas_db_update_{name}`. + Then add this function to `wiaas/includes/class-wiaas-db-update.php` with its timestamp. + This way after `composer update-db` is executed your database update will be applied. \ No newline at end of file