Skip to content

Commit 19992df

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/dev'
2 parents c31eed9 + 42a0357 commit 19992df

File tree

7 files changed

+170
-165
lines changed

7 files changed

+170
-165
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
WP Starter
22
==========
33

4-
> WordPress whole-site Composer packages has never been so easy.
4+
> WordPress whole-site Composer packages have never been so easy.
55
66
WP Starter is the easiest and fastest way to bootstrap WordPress sites entirely based on
77
[Composer](https://getcomposer.org/).
@@ -15,7 +15,7 @@ WP Starter is the easiest and fastest way to bootstrap WordPress sites entirely
1515

1616
# License
1717

18-
MIT. See LICENSE file.
18+
MIT. See [LICENSE](LICENSE) file.
1919

2020
# Dependencies
2121

@@ -41,6 +41,6 @@ file an issue as they are public.
4141

4242
WP Starter is hosted on GitHub. Feel free to open issues there for suggestions, questions and real issues.
4343

44-
# Who's Behind
44+
# Who's Behind This?
4545

4646
I'm Giuseppe, I deal with PHP since 2005. For questions, rants or chat ping me on Twitter ([@gmazzap](https://twitter.com/gmazzap)) or on ["The Loop"](http://chat.stackexchange.com/rooms/6/the-loop) (Stack Exchange) chat. Well, it's possible I'll ignore rants.

docs/complete-example.md

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ title: Complete Usage Example
44
-->
55
# Complete Usage Example
66

7-
Sometimes out-of-the-box settings for WP Starter may be fine, sometimes not. In this page there's an usage example that will make use of
8-
all WP Starter configuration. Explanation is provided below in this page.
7+
For some projects, out-of-the-box settings for WP Starter may be just fine, others might need more customization. This page contains a usage example that makes use of
8+
all of WP Starter configuration. Explanations are provided further down below after the example.
99

10-
# A *fully-equipped* `composer.json`
10+
# A *fully equipped* `composer.json`
1111

1212
```json
1313
{
@@ -95,58 +95,57 @@ all WP Starter configuration. Explanation is provided below in this page.
9595

9696
## Example Explained
9797

98-
The example above may be a little scary, but reality is that great majority of WP Starter installations don't need a so much detailed configuration. E.g. the `composer.json` provided in the *"Quick Start"* docs section is a lot less complex and still perfectly functional.
98+
The example above might seem a little scary, but most of the time you won't need such a detailed configuration. E.g. the `composer.json` provided in the *"Quick Start"* docs section is a lot less complex and still perfectly functional.
9999

100-
Only reason to publish a so hardly customized `composer.json` is to show how WP Starter configuration allows a full control on any aspect of its work, but only if required.
100+
The only reason I publish such a heavily customized `composer.json` is to demonstrate how WP Starter configuration allows you to exert full control over every aspect of its process, in case this should be required.
101101

102-
All the configurations used in the example above are explained below, section by section.
102+
All of the configurations used in the example above are explained below, section by section.
103103

104-
### `"name"`, `"description"` and `"type"` sections
104+
### `"name"`, `"description"` and `"type"` sections
105105

106-
This are simple Composer settings. See [official docs](https://getcomposer.org/doc/04-schema.md) to know more.
106+
These are simple Composer settings. See [official docs](https://getcomposer.org/doc/04-schema.md) to know more.
107107

108108
### `"minimum-stability"` section
109109

110-
By default Composer filters packages by stability, only installing one that are tagged as stable.
110+
By default, Composer filters packages by stability, only installing versions that are tagged as stable.
111111

112-
By using this setting ([see Compose docs](https://getcomposer.org/doc/04-schema.md#minimum-stability)) is possible to tell Composer to also install packages with different stability.
113-
114-
This is necessary in the example because some packages used are not stable and are added to project pulling them from Git repositories.
112+
By using this setting ([see Compose docs](https://getcomposer.org/doc/04-schema.md#minimum-stability)), it is possible to tell Composer to also install packages with different stability flags.
115113

114+
This is necessary in the example because some packages that are used are not stable and are added to project by pulling them from Git repositories.
116115

117116
### `"repositories"` section
118117

119-
This is [a Composer setting](https://getcomposer.org/doc/04-schema.md#repositories) that allows to set custom repositories where to search for packages.
118+
This is [a Composer setting](https://getcomposer.org/doc/04-schema.md#repositories) that allows to add custom repositories that will be searched for packages by Composer.
120119

121120
I've added 3 entries.
122121

123-
The first is [wpackagist](https://wpackagist.org). It is a mirror of the official WordPress plugin and theme directories as a Composer repository. In short, it allows to install all the plugins and themes available in official WordPress repository as Composer packages, no matter if they *natively* support Composer or not.
122+
The first is [wpackagist](https://wpackagist.org). It is a mirror of the official wordpress.org plugin and theme repository as a Composer repository. In short, it allows you to install all the plugins and themes available in the official wordpress.org repository as Composer packages, no matter if they *natively* support Composer or not.
124123

125-
The other two repositories are Gist of mine. They were created to show in this example how to use custom packages to collect files that you want to share among WP Starter projects. More on this below.
124+
The other two repositories are Gists of mine. They were created for this example to demonstrate how to use custom packages to collect files that you want to share among WP Starter projects. More on this below.
126125

127126
### `"require"` section
128127

129-
There are 3 packages required, and first of them is WP Starter. It is required, of course.
128+
There are 3 required packages, and the first one is WP Starter. It is required, of course.
130129

131-
The second is WordPress package. Even if WP Starter requires WordPress, but it is explicitly required to have a better control on the WordPress version that will be installed.
130+
The second is the WordPress package. Even if WP Starter requires WordPress, it is still explicitly required to have a better control over the WordPress version that will be installed.
132131

133-
The third package required is `"gmazzap/wpstarter-example-files"`. It is a package I created for this example to show how to use a custom package (in this case saved in a Gist) to collect files to be shared among WP Starter projects. Files contained in this package will be used in the example for various purposes.
132+
The third required package is `"gmazzap/wpstarter-example-files"`. It is a package I created for this example to show how to use a custom package (in this case saved as a Gist) to collect files to be shared among WP Starter projects. Files contained in this package will be used in the example for various purposes.
134133

135134
### `"require-dev"` section
136135

137136
There are five packages required for development purposes.
138137

139-
First two, "query-monitor" and "debug-bar", are popular plugins for debugging. They are both available in WordPress repository and required via wpackagist.
138+
The first two, "query-monitor" and "debug-bar", are popular plugins for debugging. They are both available in the wordpress.org repository and required via wpackagist.
140139

141-
Third package is ["Laps"](https://github.com/Rarst/laps), a profiler plugin by [@Rarst](http://t.co/dTX2awK3Qv) (Andrey Savchenko) that supports Composer natively and is available on Packagist.
140+
The third package is ["Laps"](https://github.com/Rarst/laps), a profiler plugin by [@Rarst](http://t.co/dTX2awK3Qv) (Andrey Savchenko) that supports Composer natively and is available on Packagist.
142141

143-
The fourth package is ["plugin-profiler"](https://wordpress.org/plugins/plugin-profiler/), a profiler for plugins, it is available in WordPress repository and required via wpackagist.
142+
The fourth package is ["plugin-profiler"](https://wordpress.org/plugins/plugin-profiler/), a profiler for plugins, it is available in wordpress.org repository and required via wpackagist.
144143

145144
By reading its [installation instructions](https://wordpress.org/plugins/plugin-profiler/installation/) you'll see that one of the installation options is to create a MU plugin that loads the regular plugin file.
146145

147-
For the purpose of this example I created a very simple MU plugin that just does that, and that is the fifth package required. It is located in [a Gist](https://gist.github.com/Giuseppe-Mazzapica/9939793dfb2a2361cd0f) listed in `"repositories"` to be accessible to Composer.
146+
For the purpose of this example I created a very simple MU plugin that just does that, and that is the fifth required package. It is located in [a Gist](https://gist.github.com/Giuseppe-Mazzapica/9939793dfb2a2361cd0f) listed in `"repositories"` to be accessible to Composer.
148147

149-
This MU plugin will be placed in its own folder inside `mu-plugin` folder, but WordPress will be still capable to load thanks to WP Starter loader.
148+
This MU plugin will be placed in its own folder inside `mu-plugin` folder, but WordPress will still be capable to load it thanks to WP Starter MU loader code.
150149

151150
### `"config"` section
152151

@@ -158,42 +157,42 @@ In the example above it is used to tell Composer to create optimized autoloader
158157

159158
The first entry in this section adds the method `WCM\WPStarter\Setup::run()` as `"post-install-cmd"` script. (See [Composer docs](https://getcomposer.org/doc/articles/scripts.md)). This is the only mandatory entry.
160159

161-
The second entry adds the same method as `"post-update-cmd"` script. This makes Composer to run again WP Starter routine after any update. The reason is that files copied by WP Starter via "dropins" configuration (see below) may be updated, so the updated file should be copied again in content folder.
160+
The second entry adds the same method as `"post-update-cmd"` script. This makes Composer run WP Starter routine again after any update. The reason is that files copied by WP Starter via "dropins" configuration (see below) may be updated, so the updated file should be copied into the content folder again.
162161

163-
The third entry, adds the same method using a custom name. This will never run automatically by Composer, but if there is the need to run WP Starter routine manually, this alias will simplify that task: `composer run wpstarter` is easier to type, to remember and more intuitive of `composer run post-install-cmd`.
162+
The third entry adds the same method using a custom name. This will never run automatically by Composer, but if there is the need to run WP Starter routine manually, this alias will simplify that task: `composer run wpstarter` is easier to type, to remember and more intuitive than `composer run post-install-cmd`.
164163

165164
### `"extra"` section
166165

167-
`"wordpress-install-dir"` tells Composer where to place WordPress package. This is not a WP Starter configuration, but is defined by [WordPress core installer](https://github.com/johnpbloch/wordpress-core-installer). This setting is optional and when not used, "wordpress" is used as default.
166+
`"wordpress-install-dir"` tells Composer where to place the WordPress package. This is not a WP Starter configuration, but is defined by [WordPress core installer](https://github.com/johnpbloch/wordpress-core-installer). This setting is optional and when not used, "wordpress" is used as default.
168167

169168
`"wordpress-content-dir"` informs WP Starter where the content folder is located. This configuration is optional and when not used, "wp-content" is used as default.
170169

171-
Please note that this option will **not** make Composer to place plugins and themes into the given directory.
170+
Please note that this option will **not** make Composer place plugins and themes into the given directory.
172171

173-
This option is required only if the content folder is not the standard one and only if WP Starter needs to know where content folder is located, that is, when the `"dropins"` and/or the `"gitignore"` WP Starter configuration are used.
172+
This option is required only if the content folder is not the standard one and only if WP Starter needs to know where the content folder is located, that is, when the `"dropins"` and/or the `"gitignore"` WP Starter configurations are used.
174173

175-
`"wpstarter"` is the object where take place all the WP Starter configurations. All the available settings are documented in the *"WP Starter Options"* documentation page.
174+
`"wpstarter"` is the object in which all the WP Starter configuration takes place. All the available settings are documented in the *"WP Starter Options"* documentation page.
176175

177176
In the example above I used:
178177

179-
- `"dropins"` to tell WP Starter to move two files from their package folder (where Composer placed them) to the project content folder. This is required because WordPress recognize these specific files only if they are placed there.
178+
- `"dropins"` to tell WP Starter to move two files from their package folder (where Composer placed them) to the project content folder. This is required because WordPress recognizes these specific files only if they are placed there.
180179

181-
`object-cache.php` is a dropin to manage object cache using Memcached PECL extension (it's a slightly modified version of [this file](https://github.com/tollmanz/wordpress-pecl-memcached-object-cache)) and `it_IT.php` is a locale file (italian). Both needs to be placed in content folder to work. WP Starter copies them to content folder from the package I saved in a Gist. (see `require` section above).
180+
`object-cache.php` is a dropin to manage an object cache using Memcached PECL extension (it's a slightly modified version of [this file](https://github.com/tollmanz/wordpress-pecl-memcached-object-cache)) and `it_IT.php` is a locale file (italian). Both need to be placed into the content folder to work. WP Starter copies them to the content folder from the package I saved in a Gist. (see `require` section above).
182181

183-
- `"prevent-overwrite"` is used to tell WP Starter to don't overwrite some files, specifically, `wp-config.php`, `index.php` and `.gitignore`.
182+
- `"prevent-overwrite"` is used to tell WP Starter to not overwrite some files, specifically `wp-config.php`, `index.php` and `.gitignore`.
184183

185-
This is especially useful because WP Starter routine is set to be run after any update (see `"scripts"` section above) so any customization to any of these files that happened between installation and update would be lost if WP Starter is not instructed to not overwrite them.
184+
This is especially useful because WP Starter routine is set to be run after any update (see `"scripts"` section above) so any customization to any of these files that happened between installation and update would be lost if WP Starter is not instructed not to overwrite them.
186185

187-
- `env-example` is used to tell WP Starter which file to copy as `.env.example` in project folder. The source used is the same Gist that contains `it_IT.php` file and is used to show how to use a custom package to collect files that you want to share among WP Starter projects.
186+
- `env-example` is used to tell WP Starter which file to copy as `.env.example` in project folder. The source used is the same Gist that contains the `it_IT.php` file and is used to show how to use a custom package to collect files that you want to share among WP Starter projects.
188187

189-
- `gitignore` is used to tell WP Starter what to put in the `.gitignore` file that will be created in project folder. The configuration tells to ignore WordPress, content and vendor folders, a set of common to-be-ignored files and a list of three custom entries.
188+
- `gitignore` is used to tell WP Starter what to put into the `.gitignore` file that will be created in the project folder. The configuration is set to ignore WordPress, content and vendor folders, a set of commonly ignored files and a list of three custom entries.
190189

191-
For more details about any of the WP Starter configuration have a look to *"WP Starter Options"* documentation page.
190+
For more details about any of the WP Starter configurations have a look at the *"WP Starter Options"* documentation page.
192191

193192
### `"installer-paths"` section
194193

195194
This is a configuration section introduced by [composer/installers](https://github.com/composer/installers).
196195

197-
Using this configuration is possible to tell Composer where to place packages of specific types (see [Composer docs](https://getcomposer.org/doc/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md)).
196+
Using this configuration it is possible to tell Composer where to place packages of specific types (see [Composer docs](https://getcomposer.org/doc/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md)).
198197

199-
This option is necessary here because I want to use `public/content` instead of default `wp-content` as project content folder, that is the installation target folder for plugins and themes.
198+
This option is necessary here because I want to use `public/content` instead of default `wp-content` as the project's content folder, that is the target installation folder for plugins and themes.

0 commit comments

Comments
 (0)