2017 © Pedro Peláez
 

library wp-scratch

A scalable WordPress project from scratch. Easy to deploy!

image

i30/wp-scratch

A scalable WordPress project from scratch. Easy to deploy!

  • Monday, January 8, 2018
  • by i30
  • Repository
  • 4 Watchers
  • 7 Stars
  • 8 Installations
  • Shell
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

WordPress Scratch

Build Status Latest Stable Version Latest Unstable Version License, (*1)

A scalable WordPress project from scratch. Easy to deploy!, (*2)

While working with WordPress, i feel unease to config virtual hosts, set up brand new WordPress installations, copy essential plugins... for each new project again and again., (*3)

With this, you can proxy static contents, databases, back-end and front-end into smaller servers. All of them use a same WordPress installation, it's really helpful in term of performance and maintainability. Moving your servers around or setting up load balancing becomes easier., (*4)

Requirements

Installation

  1. Prepare your server block for Nginx or virtual host for [Apache][6]. You do not need to create MySQL database, it will be created while installing WordPress., (*5)

  2. Run these two commands on your command line respectively:, (*6)

    $ composer create-project i30/wp-scratch /path/to/project/directory
    $ cd /path/to/project/directory && ./install
    
  3. Follow instructions to finish the installation. It's easy!, (*7)

From now on, to add a new WordPress site, you just need to fire the install script again., (*8)

Important Notes

  • Since $_SERVER['SERVER_NAME'] is used to determine which site will respond to requests, please make sure SERVER_NAME is configured properly. For Apache 2, remember to add UseCanonicalName = On in every virtual host., (*9)

  • While working with multiple sites (not WordPress multisite), you might need to separate UPLOADS directory. Use this script as a must-use plugin:, (*10)

    /**
    * Plugin Name: Dynamic Uploads Directory
    * Version:     1.0.0
    * Description: Create custom uploads directory base on the DB_NAME constant.
    * Author:      sarahcoding
    * Author URI:  https://sarahcoding.com
    * License:     GPL v3+
    */
    add_filter('upload_dir', function($args)
    {
    $base_url = WP_HOME . '/uploads';
    $base_dir = APP_ROOT . 'app/uploads';
    $custom_url = WP_HOME . '/' . DB_NAME . '-uploads';
    $custom_dir = APP_ROOT . 'app/' . DB_NAME . '-uploads';
    
    $args['url'] = str_replace($base_url, $custom_url, $args['url']);
    $args['path'] = str_replace($base_dir, $custom_dir, $args['path']);
    $args['baseurl'] = str_replace($base_url, $custom_url, $args['baseurl']);
    $args['basedir'] = str_replace($base_dir, $custom_dir, $args['basedir']);
    
    return $args;
    }, PHP_INT_MAX);
    

Contributing

Contribution is always welcome!, (*11)

The Versions

08/01 2018

dev-master

9999999-dev

A scalable WordPress project from scratch. Easy to deploy!

  Sources   Download

GPL-3.0

The Requires

 

by Avatar i30

20/10 2016

1.0.0

1.0.0.0

A WordPress project from scratch.

  Sources   Download

GPL-3.0

The Requires

 

by Dang Vu