FOR INTERNAL USE ONLY
Fork the SaaS dev environment repo at git@bitbucket.org:storelocatorplus/slp-saas-docker-env.git (set this to upstream).
Clone your forked copy to a local environment.
Install the latest Docker dashboard.
Follow the instructions in the README.MD file.
Docker Container Notes
The environment will setup a local Docker WordPress install with WP multisite enabled.
The default is to connect to a shared AWS RDS server, but the recommendation is to use the “local” build and setup a local MySQL sever.
The local DB server startup command (assuming the images are already built):
`docker-compose -f "docker-compose.yml" -f "docker-compose.local-db.yml" up -d`
The WordPress Environment
It is critical to have the .htaccess file enabled and properly configured for WordPress subdirectory multisite to work with MySLP. This will require the local server to be running the default Apache server, not the custom server or an nginx server as shown on many online documents.
Our custom .htaccess file differs slightly from the default from WordPress.
The latest copy as of 2209.12:
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
# from nginx dashbeta
RewriteRule ^(?!^/my-db-admin)(/[^/]+)?(/wp-.*) $2 [L]
RewriteRule ^(?!^/my-db-admin)(/[^/]+)?(/.*\.php) $2 [L]
#RewriteCond %{REQUEST_FILENAME} -f [OR]
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
The Database
You should start by copying over the production database and restoring it locally.
You’ll need to change the wp_options to replace any ‘https://dashboard.storelocatorplus.com’ URLs with ‘https://mysite.test’. WP CLI is the most thorough option, but you can start by setting the “home” and “site url” options is the main wp_options table.
For any client sites you want to work with you’ll need to find their matching wp_<id>_options table (the numbers may not match the UID) and replace their home and site URLs as well. This is not thorough and may miss some options that SLP uses, but it will function for most of the application.
Deployment Repository
The MySLP SaaS platform is managed by the “Dashboard Deployment” repository at git@bitbucket.org:storelocatorplus/myslp_deployment_2018.git.
This is a master repository that contains the main WordPress environment and subtrees that pull in other repositories that include the themes and plugins that work together to build the SaaS environment.
Coding
Must Use Plugins Subtree
Updating the “Must Use Plugins” (MUP) codebase is done in one of two modes.
“Direct Editing” Mode
This is for the main loader files (load*.php), the MySLP Dashboard code, and the myslp-payments code. You edit the files directly in the MUP repository and commit as normal.
Updatin MySLP Dashboard JavaScript
Webpack managed scripts…
When editing the MySLP Dashboard must-use plugin, make sure you run the proper node commands if you change the locations.js, thether.js, shepherd.js or related JavaScript files.
npm run build-prod
Grunt managed assets (CSS, JS)
This handles the CSS files as well as common, management, settings, and category JS files. As well as the master.css file.
grunt minifyjs
grunt css
grunt minify
“SLP Pushed Content”
The other must use plugin is Store Locator Plus®. Since this is also a standalone plugin, this is edited in the main SLP plugin repo directly. Those changes are committed there and stored in that repository.
A separate repo , the “WP Dev Toolkit” has a set of Grunt commands that help manage the WordPress code production. Things like pushing prerelease copies out to the world, the production deployments, etc.
One of those Grunt commands is a script that copies relevant “SLP Base Plugin” code over to the MUP “store-locator-le” subdirectory. It brings over code from the current checked out codebase, or WIP edits, so be sure to have a stable environment before running the “push_slp_to_mu” command via Grunt.