2017 © Pedro Peláez
 

project masters-wp

WordPress boilerplate based in bedrock and foundationpress

image

open-ecommerce/masters-wp

WordPress boilerplate based in bedrock and foundationpress

  • Saturday, July 29, 2017
  • by eduardosilva
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

WP, WP-Cli, Composer, Foundation, Sass and Grunt , (*1)

WordPress Starting base template

This is the repository integrating some other repos about adding composer to wp and integrating foundation to a wp theme with the idea of simplify the starting process. Later on you can select the wp plugins you want to have changing the composer.json file but this are the plugins we are using:, (*2)

You can see a demo at:

http://wp-brixton.oe-lab.tk/, (*3)

We are using the following repos with the real hard work:

for composer install https://github.com/roots/bedrock that uses: https://github.com/johnpbloch/wordpress-core-installer to use plugins as vendors and https://github.com/vlucas/phpdotenv to have the beautiful .env configuration, (*4)

for the foundation theme that we call oe-brixton, the amazing work of Ole Fredrik Lie.

we are using the code instead of forking to have our own configuration but I will recommend to take the latest version from the Ole's repo. https://github.com/olefredrik/foundationpress, (*5)

for the bootstrap theme that we call oe-kennington, the amazing work of Per Thykjaer Jensen.

we are using the code instead of forking to have our own implementation but I will recomment to clone the lates version from this repo. https://github.com/asathoor/maat-or-the-improved-bootstrap, (*6)

You can see some in progress documentation once you finish with the installation

https://github.com/open-ecommerce/masters-wp/blob/master/docs/working-on-it.md, (*7)

How to install and eventualy deploy :)

Installation

  1. Create a new project in a new folder for your project:, (*8)

    composer create-project open-ecommerce/masters-wp your-project-folder-name, (*9)

  2. Copy .env.example to .env and update environment variables:, (*10)

    • DB_NAME - Database name
    • DB_USER - Database user
    • DB_PASSWORD - Database password
    • DB_HOST - Database host
    • WP_ENV - Set to environment (development, staging, production)
    • WP_HOME - Full URL to WordPress home (http://example.com)
    • WP_SITEURL - Full URL to WordPress including subdirectory (http://example.com/wp)
    • AUTH_KEY, SECURE_AUTH_KEY, LOGGED_IN_KEY, NONCE_KEY, AUTH_SALT, SECURE_AUTH_SALT, LOGGED_IN_SALT, NONCE_SALT

    If you want to automatically generate the security keys (assuming you have wp-cli installed locally) you can use the very handy [wp-cli-dotenv-command][wp-cli-dotenv]:, (*11)

    wp package install aaemnnosttv/wp-cli-dotenv-command, (*12)

    wp dotenv salts regenerate, (*13)

    Or, you can cut and paste from the [Roots WordPress Salt Generator][roots-wp-salt]., (*14)

  3. Create local DB with your tool of preference I like wp-cli so I will just run the wp command that will use what ever db credentials we put in the .env file wp db create, (*15)

  4. Add theme(s) in web/app/themes as you would for a normal WordPress site., (*16)

  5. Set your site vhost document root to /path/to/example/web/ (/path/to/example/current/web/ if using deploys), (*17)

  1. Access WP admin at http://example.com/wp/wp-admin

Deploys

There are two methods to deploy Bedrock sites out of the box:, (*18)

Any other deployment method can be used as well with one requirement:, (*19)

composer install must be run as part of the deploy process., (*20)

Documentation

Bedrock documentation is available at https://roots.io/bedrock/docs/., (*21)

Now you need to choose the theme you want to use we put 2 themes in this repo:

oe-brixton based in foundation 4

As I said it is forked from Fredrik repo: https://github.com/olefredrik/foundationpress, (*22)

This is a starter-theme for WordPress based on Foundation 6, the most advanced responsive (mobile-first) framework in the world. The purpose of FoundationPress, is to act as a small and handy toolbox that contains the essentials needed to build any design. FoundationPress is meant to be a starting point, not the final product., (*23)

more info about oe-brixton documentation, (*24)

oe-kennington based in bootstrap 4

This theme it is a fork of Maat theme repo and customized for our own needs., (*25)

more info about oe-kennington documentation, (*26)

Prerequisites

You will need WP-CLI installed in your box with a lamp (mysql, apache, php etc), (*27)

Installing cli in your system:, (*28)

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

other options, (*29)

php -r "readfile('https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar');" > wp-cli.phar

If you can't run curl in your shared server just download wp-cli.phar and upload the file using ftp, (*30)

Then, you need to make the file executable:, (*31)

chmod +x wp-cli.phar

The final step is to move the file to a folder, so that you can execute it from anywhere. Renaming the file to something easy to remember and type is also a good idea; this is the reason why wp is the most commonly used name:, (*32)

sudo mv wp-cli.phar /usr/local/bin/wp
wp --info

Instructions to make the wordpress work in your dev box

clone the master branch of this repo

git clone https://github.com/open-ecommerce/masters-wp.git

(or to the ssh address if you have a sshkey), (*33)

cd masters-wp/htdocs

get latest version of wp for your locale

(choose your locale from this site: http://wpcentral.io/internationalization/), (*34)

wp core download --locale=en_GB

install wp for your db credentials

(change 'mynewwpdb' with the name of db you want create in the mysql server and your own credentials), (*35)

wp core config --dbname=mynewwpdb --dbuser=root --dbpass=123 --dbhost=localhost --dbprefix=oe34_

create the db based in the just created wp-config (only if you haven't created the db manualy)

wp db create

install and configure wp

  • change 'myurl.dev' with the url you want to use localy.
  • title is just the title inside the wp config
  • change the wp admin credentials
  • check more options at WP-CLI documentation: http://wp-cli.org/commands/core/install/
wp core install --url=myurl.dev  --title="Open-ecommerce wp master" --admin_user=oeadmin --admin_password=Password123
--admin_email="info@open-ecommerce.org"

install the plugins via composer

  • you can edit the composer.json file to add the pugins you want to install
  • the wp plugins can be find at: http://wpackagist.org/
composer install

We added: "config": { "secure-http": false } in the composer.json, to avoid problems getting http repositories in some shared servers., (*36)

activate all plugins using wp-cli

  • you can go now to the admin and activate the wordprss you want or you can activate all the just composer installed plugins with this wp-cli command
wp plugin activate --all

install test unit demo data

  • we are using the wptest repo of Michael Novotny that it is very cool to test themes.
  • check more options at WP-CLI documentation: https://github.com/manovotny/wptest

you can pull the latest version from the repo with curl:, (*37)

curl -OL https://raw.githubusercontent.com/manovotny/wptest/master/wptest.xml

or with php readfile:, (*38)

php -r "readfile('https://raw.githubusercontent.com/manovotny/wptest/master/wptest.xml');" > wptest.xml

I added also our version of the wptest call oe-dumy-sample into this repo just go to to the wp folder and import all with wp, (*39)

wp import wptest.xml --authors=create

or, (*40)

wp import oe-dummy-sample.xml --authors=create

and then delete the file, (*41)

rm wptest.xml

add the domain to your dev box

  • if you are in ubuntu you can use the file manager to do that: sudo nautilus
  • copy the /docs/myurl.dev.conf to etc/apache2/sites-available and change the domain
  • sudo a2ensite myurl.dev.conf
  • add the domain to your /etc/hosts file

at this point you should be having a wp installed and configured

  • navigate to the myurl.dev/wp-login
  • user: oeadmin
  • pass: Password123

next step is to build the wp foundation theme you can check the full doc in the foundationPress repo but a quick reminder

  • navigate into the themes folder /wp-content/themes/oewp
  • run npm install (will install all the grunt modules)
  • run 'grunt' to watch the theme folder and compile all grunt tasks when you change the sass files

While you're working on your project, run:

$ npm run watch

3. For building all the assets, run:

$ npm run build

Build all assets minified and without sourcemaps:

$ npm run production

about .htaccess files

  • we are using this htaccess boilerplate from Bob Elison's gist at: https://gist.github.com/wycks/3011895
  • you will need to tweak it depending on the modules you have installed in your server (if you using apache at all...)

The Versions

29/07 2017

dev-master

9999999-dev https://open-ecommerce.org/

WordPress boilerplate based in bedrock and foundationpress

  Sources   Download

MIT

The Requires

 

The Development Requires

wordpress wp stack composer vagrant npm bedrock gulp foundationpress

12/02 2017

v1.0

1.0.0.0 https://open-ecommerce.org/

WordPress boilerplate based in bedrock and foundationpress

  Sources   Download

MIT

The Requires

 

The Development Requires

wordpress wp stack composer vagrant npm bedrock gulp foundationpress