Local Community

Workflow related challenges and Feedback after using Local for a few months

Overall, utilizing local vs something like VVV has been a pretty smooth transition. I believe that most of my team’s challenges with utilizing Local or any local environment for that matter comes down to our ability to augment the initial provisioning of a website or the ability to selectively sync things as needed based on our own process.

Most of my team’s issues, we could resolve ourselves with the ability to hook into key aspects of the Addon System within Local. By further expanding filters and events of the provisioning process and screens. Each developer, team etc, could alleviate challenges I and others have requested on https://localwp.canny.io/feature-requests or have made mention of them within the Addon Category within Local Community.

I’d personally rather have the LocalWP engineers work on hooks and filters that allow other developers to solve their own process problems. A lot of the problems I have experienced and read from others stem from the initial provisioning/setup.

Challenge # 1: Local currently lacks the ability for Addons to interact/manipulate with hooks for the Clone/New Site setup input fields, add new steps, etc. https://localwp.canny.io/feature-requests/p/create-addon-hooks-for-the-create-new-site-screens.

Based on this one challenge it blocks the ability for Addon developers to implement features that they themselves or other teams could utilize for a more optimized provisioning process.

On a larger site, a provision from WP Engine could take 30 - 40 minutes.

  1. Feature 1: Give the ability to selectively sync what files are pulled down from WP Engine (and I assume Flywheel). See How to ignore certain folders from pull and push in WPEngine?

Why: Our team does not ever push directly to WPE using git push from a local environment. We have a deployment process using a set of GitHub actions. Typically this is repo for wp-content, this repo also utilizes composer for all open-source plugins and themes mirrored in wpackagist. And all custom and/or premium plugins as part of the repo (if a composer package isn’t available).

We have a Local addon we have created to proxy any media from the “prod”, “staging” or “dev” url but the initial provision still requires a site to be fully pulled down/sync’d. This is an enormous waste of bandwidth and time as some of our sites have 30-40GB of media. Our workaround now is to do a Partial Export from the WP Engine Portal and drag and drop the zip file to create an install. Having the ability to do the same type of “partial” initial sync would immediately positively benefit our team.

  1. The ability to sync only the database (as needed) during provision, and during the lifecycle of a local site.

** Why:** Pretty much the same reason as above.

  1. Adding the proper hooks to add inputs and events for addons on the provisioning screens allows the following.

Why/Use Case: When a new site completes the initial sync, we have a script that we run manually, that does a few actions. remove the wp-content folder, clone a repo from .git, moved around some files and make sure our composer dependencies are installed.

We would also love the ability to hook into when a site 100% completes install/provision and has downloaded all files.

Example of the script we run locally

# Purpose: Run this after you have sync'd a site from WP Engine so that it pulls down the appropriate repo and moves things around as needed. anything w/ <site- needs to be replaced
# @var site-install-dir : Directory of the site we're migrating (after install to local)
# @var site-hash: The hash ID created by local when a site is created
# @var site-git-project-slug: This is the GitHub project slug
# @var site-domain: the live site domain
# @var site-local-domain: the local site domain
cd ~/Local\ Sites/<site-install-dir>/app/public
# Create a backup
mv wp-content wp-content-backup
git clone git@github.com:linchpin/<site-git-project-slug>.git wp-content
# Re-Sync our original content from the backup folder excluding some assets
rsync -v --exclude 'plugins' --exclude 'mu-plugins' --exclude 'themes' --exclude 'debug.log' wp-content-backup/ wp-content/
rm -rf wp-content-backup
cd wp-content
# Install our dependent libraries
composer install
# Site shell script is created when you Open Site Shell (so this may not work initially) unless you do this step first.
~/Library/Application\ Support/Local/ssh-entry/<site-hash>.sh
# Run search-replace one last time, some times non ssl urls are missed?
wp search-replace http://<site-domain>/ https://<site-domain-local>/

Extending the ability for Addons to hook into screens and events during the provisioning process is something we’d love to utilize to add in our own fields on the site clone/create screens in order to be able to implement some of these options.

Wow end rant