bernardhanna / matrixstack
A modern WordPress stack
Installs: 32
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Shell
Type:project
Requires
- php: >=7.2
- composer/installers: ^1.10.0
- devgeniem/wp-sanitize-accented-uploads: *
- johnpbloch/wordpress: 6.0.2
- johnpbloch/wordpress-core-installer: ^2.0
- koodimonni-language/en_gb: *
- koodimonni/composer-dropin-installer: dev-master
- oscarotero/env: ^2.1
- roots/wp-config: ^1.0
- vlucas/phpdotenv: ^5.3
- wp-cli/wp-cli-bundle: *
- wpackagist-plugin/disable-media-pages: *
- wpackagist-plugin/duplicate-post: *
- wpackagist-plugin/metronet-reorder-posts: *
- wpackagist-plugin/prevent-browser-caching: *
- wpackagist-plugin/so-clean-up-wp-seo: *
- wpackagist-plugin/updraftplus: *
- wpackagist-plugin/wordpress-seo: *
Requires (Dev)
- rarst/wps: *
- wpackagist-plugin/query-monitor: *
This package is not auto-updated.
Last update: 2025-03-05 22:40:26 UTC
README
Matrixstack helps you get your projects started locally with modern Wordpress development tools and project structure. It will save time by automating tasks with a DRY development principle.
After setting up, you can create a new Wordpress project based on a modified version of bedrock just by running:
createproject
PLEASE NOTE*
The script is focused on my own workflow, it assumes a lot of things about how you will work. It may need to be tweaked to make it work for you. For example it assumes you use Linux Ubuntu 20.04, always start your projects in ~/Projects, use XXXX.test as your host name url, store your SSL certs in /var/www/certs, use an Apache server with your projects and your current projects home directory will be located in /var/www/....
Features
- Automatic MySQL-database generation
- Automatic Creation of Apache server
- Automatic host conf files creation
- Automatic update of hosts file
- Automatic set up and installation of SSL cert
- Sets up WP user, admin email and pass.
- Installs Wordpress
- Installs Wordpress development plugins
- Installs plugins we typically use in Matrix such as Yoast
- Automatic Github repo initialization
- Capistrano 3 deployment templates bundled in bin/createproject.sh
- Allows you to use Composer to manage WordPress installation
- Install WP packages from WordPress Packagist
- sets up dotenv-environments for development, staging and production
- Adds Premium plugin licences
- Sets up (modified version of)Bedrock
- Changes WP login to /wp/wp-admin for better security
- Deletes default posts and pages
- updates description
- updates language to en_GB
- deletes default themes and plugins
- sets the timezone to Dublin
- removes pingbacks
- Activates plugins
- Customizable to suit your workflow eg, change the plugins pre installed etc
Requirements
- Linux Ubuntu OS
- mkcert
- Composer v2
- Basic knowledge about bash scripting
- Basic knowledge npm packages, bundle, composer etc.
- Optional: Access to staging and production servers that supports sftp and git
- Projects located under home/Projects
- Git
- PHP >= 7.2
- Ruby >= 2.6
- Perl
- WP-CLI
- Apache
- mySQL
Installation
- Clone this repo to your Projects directory: /home/YourUserName/Projects
git clone https://github.com/bernardhanna/matrixstack.git
- Change directory to matrixstack and then bin folder
cd /Projects/matrixstack/bin
- Run the setup script for the first and only time
bash matrix.sh
-
Follow any onscreen instructions to link this file to system level.
-
Create your new project. (You can skip to this step going forward)
createproject
From here the on screen prompts will guide you
- Note when the project loads you will get a whitescreen as there is no Theme installed. You will know if everything worked by accessing the admin
Preinstallation
WP-Cli is included in matrixstack per project via composer.json but won't work by default globally. You'll need this alias on your Linux .bashrc or .bash_profile file:
alias wp='./vendor/wp-cli/wp-cli/bin/wp'
The createproject
script assumes:
- You use Linux Ubuntu as OS
- You use .test as your domain extension (it will automatically add this extension to whatever name you give your project)
- You will be using Apache
- Your SSL certs will be stored in /var/www/certs
- Your project folder will be located: var/www/PROJECT-NAME
What matrix.sh does
- Runs composer create-project with matrixstack settings
- Installs our default WordPress plugins and updates them
- Sets up MySQL database
- Installs capistrano deployment tool
- Generates default capistrano configs (config/deploy.rb, config/deploy/staging.rb, config/deploy/production.rb) with your GitHub project details and paths
- Sets up WordPress configs (wp-config credentials to .env) and salts automatically
- Installs WordPress under its own subdirectory /wp (thus, admin located in example.test/wp/wp-admin)
- Sets up default admin user as not "admin" for security
- Removes default WordPress posts, themes and plugins and everything else not so useful
- Activates default plugins, timezones, permalinks
- Flushes rewrites, adds support for permalinks and webfonts
- Sets up file permissions
- Inits a GitHub repository
- Creates a HTTPS certificate
- Sets up a virtual host for development environment
- Updates /etc/hosts file.
- Restarts development server
Next Steps (get involved)
- Fix issue with ACF pro breaking the script when trying to auto install
- Create a goLive script which checks everything in our QA sheet, installs and configures plugins like All in one security, Wordfence, WP rocket etc before deploying.
- Create Mac/Windows version
- Create a starter theme & script and incorporate
- Create a Wiki outlining whats different with the modified version of bedrock included and why its different