├── .idea
├── SP4D.iml
├── markdown-navigator.xml
├── markdown-navigator
│ └── profiles_settings.xml
├── misc.xml
├── modules.xml
└── vcs.xml
├── README.md
├── sp4d-img-01.jpg
├── sp4d-img-02.jpg
├── sp4d-img-03.jpg
├── sp4d-img-04.jpg
├── sp4d-img-05.jpg
├── sp4d-img-06.jpg
├── sp4d-img-07.jpg
├── sp4d-img-08.jpg
├── sp4d-img-09.jpg
├── sp4d-img-10.jpg
├── sp4d-img-11.jpg
├── sp4d-img-12.jpg
├── sp4d-img-13.jpg
├── sp4d-img-14.jpg
├── sp4d-img-15.jpg
├── sp4d-img-16.jpg
├── sp4d-img-17.jpg
├── sp4d-img-18.jpg
├── sp4d-img-19.jpg
├── sp4d-img-20.jpg
├── sp4d-img-21.jpg
├── sp4d-img-22.jpg
├── sp4d-img-23.jpg
├── sp4d-img-24.jpg
├── sp4d-img-25.jpg
├── sp4d-img-26.jpg
├── sp4d-img-27.jpg
├── sp4d-img-28.jpg
├── sp4d-img-29.jpg
├── sp4d-img-30.jpg
├── sp4d-img-31.jpg
├── sp4d-img-32.jpg
├── sp4d-img-33.jpg
├── sp4d-img-34.jpg
└── sp4d-img-35.jpg
/.idea/SP4D.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/markdown-navigator.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/.idea/markdown-navigator/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Why SatisPress?
2 |
3 | When you start to look in to adding premium plugins to your `composer.json` file, you'll do some searching (you will search first - won't you!) and you'll find a few different options.
4 |
5 | One of those options is [SatisPress](https://github.com/blazersix/satispress). Read their [README.md](https://github.com/blazersix/satispress/blob/master/README.md) for a great primer on what composer is/does, and the problems with premium plugins not having public repos.
6 |
7 | Some plugin authors are starting to offer composer access to their plugins. For example [Delicious Brains](https://deliciousbrains.com/composer-premium-wordpress-plugins/), ACF Pro ([kinda](https://discourse.roots.io/t/acf-pro-as-a-composer-dependency-without-committing-your-license-key-unencrypted/6690)), [metabox.io](https://docs.metabox.io/extensions/composer/) and probably some others. Remember that any plugin in the main WordPress repo is available via wpackagist.org and called with the vendor prefix `wpackagist-plugin/` - so for example if you wanted to include Pods in your composer site you can just use `"wpackagist-plugin/pods": "2.7.8"`.
8 |
9 | ## How?
10 |
11 | SatisPress is a standard WordPress plugin, so we need a site to install it on. We'll also install all the premium/private plugins on this same site. SatisPress then makes them available to composer on our other sites.
12 | We also will have the site(s) on which we want to have composer handle our premium plugins. [Bedrock](https://roots.io/bedrock/) is a great way of setting up a WordPress site with controller managing dependencies
13 |
14 | ### 1. Set up the donor site
15 |
16 | Any old WP install will do - I span up a dev site on Pantheon for the purposes of this demo, but a $5 droplet on Digital Ocean with their one click WP-on-16.04 app would also do. It only gives you http initially - https would be better. This is easy enough on Digital Ocean following their comprehensive guides to add a domain name and Let's Encrypt certificate.
17 | Better still, you could use something like Runcloud.io to configure your $5 droplet and install WP for you. It takes a bit longer to install than using Digital Ocean's one-click app, but would be easier to manage after the initial set up.
18 | For my actual SatisPress site I use one of the spare installs on my [Kinsta](https://kinsta.com/plans/) plan. This works really well and only took seconds to spin up a new site.
19 |
20 | ### 2. Install SatisPress
21 |
22 | Read the [installation guide](https://github.com/blazersix/satispress/blob/develop/docs/installation.md) or go ahead and download a zip of the [lastest release](https://github.com/blazersix/satispress/releases/latest).
23 |
24 | 
25 |
26 | ### 3. Install Premium Plugins
27 |
28 | Next install any and all plugins that you want to use with composer. You'll see a checkbox for each plugin on the right of the plugins screen. Make sure to check the boxes for the plugins you want SatisPress to handle.
29 |
30 | 
31 |
32 | Activate and add in any licenses needed to get automatic updates.
33 |
34 | ### 4. Protect your premium plugins (optional)
35 |
36 | You'll want to protect your premium plugins. One option is HTTP Basic Authentication, which is supported by SatisPress 0.2.2 out of the box.
37 |
38 | Click `Settings > SatisPress` and tick 'Enable HTTP Basic Authentication.'
39 |
40 | 
41 |
42 | You may also need to edit your site root `.htaccess` to add the following lines:
43 |
44 | ```To get around this, you'll need to set an environment variable in the site root .htaccess file.
45 |
46 | RewriteEngine On
47 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
48 |
49 | ```
50 |
51 | It **must** come before the WordPress redirects. For more information, check out [this wiki article](https://github.com/blazersix/satispress/wiki/Basic-Auth).
52 |
53 | Finally, create a new user. Make them a `Contributor` rather than anyone with greater access. Make a note of this username and password. (Ideally, you would create multiple users, so you can later revoke credentials if necessary.)
54 |
55 | 
56 |
57 | ### 5. Set up your new site
58 |
59 | If you're reading this guide then you're probably into setting your WordPress site up properly. For me this means at the very least using [Bedrock](https://roots.io/bedrock/) from Roots so that the whole thing is version controlled - even WordPress core becomes a dependency managed by composer. Neat eh?
60 | I'm setting this site up in my local environment first, (and making regular commits to git)
61 | I use either [Valet+](https://github.com/weprovide/valet-plus) or [Trellis](https://roots.io/trellis) and for quick set up in Valet you can't beat [@aaemnnosttv](https://github.com/aaemnnosttv)'s [WP Cli Valet Command](https://github.com/aaemnnosttv/wp-cli-valet-command).
62 | Here's the whole thing to create a new Bedrock site:
63 |
64 | ```
65 | $ cd ~/sites
66 | $ wp valet new use-satispress --project=bedrock
67 | ```
68 |
69 | 
70 |
71 | It's so freakin' awesome!! If you're using Valet+ rather than the standard Valet, we can now open up the project in our editor/IDE of choice with a simple
72 |
73 | ```
74 | $ valet phpstorm
75 | ```
76 |
77 | WP Valet Command creates a new directory called `use-satispress`, installs WordPress and sets up the DB, `wp-config.php` and `.env` files. If you browse to https://use-satispress.test you'll see the usual TwentySeventeen homepage. You can log in with username `admin` and password `admin`.
78 |
79 | ### 6. composer.json
80 |
81 | You'll see a `composer.json` file and a `composer.lock` file. The default `composer.json` file that comes with Bedrock looks like this:
82 |
83 | 
84 |
85 | Notice on line 29 `"repositories": {` and on line 35 `"require": {`. These are the openings for where we're going to add our satispress repository and then require our premium plugins. There are some things already in there - the main composer repo (packagist) and in `"require":` there's some useful stuff like, ya know, PHP and WordPress.
86 | The WordPress one is interesting - the vendor is `johnpbloch`. You might think it would be `"wordpress/wordpress"` or something, but I guess it's difficult to accept that WordPress core is just one of the dependencies of a project, so there's no `composer.json` file in WordPress. Luckily for us `johnpbloch` maintains a mirror with composer support.
87 |
88 | So let's head back to our 'donor' site and grab the repo details. Login and head to `wp-admin > settings > satispress`.
89 |
90 | 
91 |
92 | It gives you the code to add in to a composer.jason file;
93 |
94 | ```
95 | {
96 | "repositories": [
97 | {
98 | "type": "composer",
99 | "url": "url-of-your-donor-site/satispress"
100 | }
101 | ]
102 | }
103 | ```
104 |
105 | But we don't need all of it because we already have a `"repositories:"` block. So just grab
106 |
107 | ```
108 | {
109 | "type": "composer",
110 | "url": "url-of-your-donor-site/satispress"
111 | }
112 | ```
113 |
114 | and we're going to paste it in below the `packagist` repo already listed in our `composer.json` file so it looks a bit like this
115 |
116 | 
117 | Note the comma after the closing `}` of the `packagist` block. You'll need to add that in or you'll get an error later.
118 | You can also see we've added our custom plugins as requirements. You can get these details from your satispress settings.
119 |
120 | 
121 | Follow the format of the other things in the `"requirements":` block. You'll need to add a [version constraint](https://getcomposer.org/doc/articles/versions.md) - in this case we can only choose `3.03` as Formidable has only just been installed. As we get updates coming in to the satispress site you'll see more version available.
122 | Next up save the file (you remembered to add commas between your `"require":` items yeah?)
123 |
124 | ### 7. Add authentication token (optional)
125 |
126 | If you set up your SatisPress site to be secured behind HTTP Basic Authentication, you can manage that by adding the following in an `auth.json` file in your repository root (in the same directory as your `composer.json`).
127 |
128 | ```{
129 | "http-basic": {
130 | "url-of-your-donor-site": {
131 | "username": "username-to-access-my-repo",
132 | "password": "gcli7X#pVC7l5wWo%z5HqeuW"
133 | }
134 | }
135 | }
136 | ```
137 |
138 | You might also want to add this to your repository `.gitignore` and issue each developer with their own `auth.json` credentials, so you can later revoke them if necessary.
139 |
140 | ### 8. Use composer to install our premium plugins
141 |
142 | We now have a `composer.json` with our satispress repo and package details, and we need to install them. You can do this in PHPStorm via its composer support, but it's just as easy to head to the terminal:
143 |
144 | ```
145 | $ cd ~/sites/use-satispress
146 | $ composer install
147 | ```
148 |
149 | 
150 |
151 | Some things to note here:
152 |
153 | 1. composer only fetches from https by default. If your satispress donor site can't be https then you can add in `"secure-http": false,`
154 | 1. In SatisPress 0.2.3, packages are [public by default](https://github.com/blazersix/satispress/tree/master#security) but it looks like the [next version](https://github.com/blazersix/satispress/blob/develop/docs/security.md) will have better security built in.
155 | 1. consider setting up a cron job to automate checking for updates in your satispress site.
156 |
157 | Once you've run `composer install` head back to your new site and _hey presto!_
158 |
159 | 
160 |
--------------------------------------------------------------------------------
/sp4d-img-01.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-01.jpg
--------------------------------------------------------------------------------
/sp4d-img-02.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-02.jpg
--------------------------------------------------------------------------------
/sp4d-img-03.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-03.jpg
--------------------------------------------------------------------------------
/sp4d-img-04.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-04.jpg
--------------------------------------------------------------------------------
/sp4d-img-05.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-05.jpg
--------------------------------------------------------------------------------
/sp4d-img-06.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-06.jpg
--------------------------------------------------------------------------------
/sp4d-img-07.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-07.jpg
--------------------------------------------------------------------------------
/sp4d-img-08.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-08.jpg
--------------------------------------------------------------------------------
/sp4d-img-09.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-09.jpg
--------------------------------------------------------------------------------
/sp4d-img-10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-10.jpg
--------------------------------------------------------------------------------
/sp4d-img-11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-11.jpg
--------------------------------------------------------------------------------
/sp4d-img-12.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-12.jpg
--------------------------------------------------------------------------------
/sp4d-img-13.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-13.jpg
--------------------------------------------------------------------------------
/sp4d-img-14.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-14.jpg
--------------------------------------------------------------------------------
/sp4d-img-15.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-15.jpg
--------------------------------------------------------------------------------
/sp4d-img-16.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-16.jpg
--------------------------------------------------------------------------------
/sp4d-img-17.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-17.jpg
--------------------------------------------------------------------------------
/sp4d-img-18.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-18.jpg
--------------------------------------------------------------------------------
/sp4d-img-19.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-19.jpg
--------------------------------------------------------------------------------
/sp4d-img-20.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-20.jpg
--------------------------------------------------------------------------------
/sp4d-img-21.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-21.jpg
--------------------------------------------------------------------------------
/sp4d-img-22.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-22.jpg
--------------------------------------------------------------------------------
/sp4d-img-23.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-23.jpg
--------------------------------------------------------------------------------
/sp4d-img-24.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-24.jpg
--------------------------------------------------------------------------------
/sp4d-img-25.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-25.jpg
--------------------------------------------------------------------------------
/sp4d-img-26.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-26.jpg
--------------------------------------------------------------------------------
/sp4d-img-27.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-27.jpg
--------------------------------------------------------------------------------
/sp4d-img-28.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-28.jpg
--------------------------------------------------------------------------------
/sp4d-img-29.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-29.jpg
--------------------------------------------------------------------------------
/sp4d-img-30.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-30.jpg
--------------------------------------------------------------------------------
/sp4d-img-31.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-31.jpg
--------------------------------------------------------------------------------
/sp4d-img-32.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-32.jpg
--------------------------------------------------------------------------------
/sp4d-img-33.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-33.jpg
--------------------------------------------------------------------------------
/sp4d-img-34.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-34.jpg
--------------------------------------------------------------------------------
/sp4d-img-35.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/neilgilmour/satispress-for-dummies/8166eb9b047007f86ac086e06a98f087e03294a7/sp4d-img-35.jpg
--------------------------------------------------------------------------------