An MU Plugin that makes a few adjustments to make local development friendlier (for me).
- Clone this directory into
wp-content/mu-plugins/must-use-local/
- Setup
mu-plugins/index.php
to loadwp-content/mu-plugins/must-use-local/must-use-local.php
somehow or copy themu-autoloader.php
file in this plugin to yourmu-plugins/
directory.
- Disable SSL verification locally to avoid any annoying issues with self-signed certs for
.test
domains. - Treat requests to local domains as external so that things like cron actually work.
- Increase session time for authenticated users to 365 days.
- Filter PHPMailer so that Mailhog is used to send (and capture) emails locally.
I want to be able to export a production database, set it up locally, and then adjust the display of Jetpack related posts without much hassle.
- Related posts does not work in development mode, so set that to false.
- Nothing should think it's in production, so enable staging mode.
- Except! When retrieving image URLs, Jetpack should think it's in development mode so that it doesn't use Photon.
When I configure a production database locally, I want to be able to run wp user update 123 --user_pass=password
and immediately login to the site.
- Unhook Jetpack SSO locally so that no attempt to use WordPress.com to sign-in is made.
- Adds Xdebug related information to the Server section of the Site Health Info page.
This gist and this article include a LocalValetDriver.php
file that when placed in the project root and configured properly will proxy remote images from a domain when they are not available locally.
I would include this file in the repo, but I can't find an explicit license, so copy it from one of those sources. :)