Skip to content

mrengy/recycleabike

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

recycleabike

Recycle-a-Bike website

Working locally

Initial setup for local site

This is assuming knowledge of the basics of installing WordPress locally.

Clone this repository

Install Composer

From the root of the repository on your local machine, run Composer's install command. This will download files for WordPress Core and the specified plugins. Note that if you installed Composer globally on your machine, the command is composer install but if you installed Composer locally within the repository, the command is php composer.phar install.

You may need to create the default .htaccess file in the root of your local repository.

Create or import a local database (ask Mike if you need a copy from production). Change whatever database contents need to be changed: references to the site url throughout, user passwords.

Copy the contents of the production "uploads" directory to your local "contents" > "uploads" directory.

Make a copy of wp-config-sample.php and name it wp-config.php. Edit it with your local database details. This is important - don't skip this step and run the browser-based install. The wp-config-sample.php has some lines that set custom paths for the WordPress installation that are required for the site to run.

Keeping local site up to date

Run "git pull" in the local root of the repository as you would normally. In order to update dependencies (which may have changed in the code), run Composer Update. (again, note that if you installed Composer locally rather than globally on your machine, the command is php composer.phar update )

Technical details

Composer

This site uses Composer for dependency management and treats WordPress Core and plugins as dependencies. The goal is to enable automatic updates with minimal maintenance and easily keeping multiple environments (including local) in sync while also version controlling the active theme using Github.

The approach follows the main idea in this Medium post, except that the theme(s) and list of dependencies are all in the same repository. Also, there are some corrections (like up to date sources of dependencies) taken from this Roots tutorial.

SASS

We use SASS for fancy things that SASS provides, and we compile it to CSS locally.

Edit code in the .scss file rather than editing .css files directly.

To build the debug CSS and minified CSS, run make from the command line in the neve-child directory. To "watch" the minified CSS, run make watch from the command line in the neve-child directory.

Automatic WordPress updates

The below sites and also the production site are set to allow WordPress core and plugins to automatically update.

WP core automatic updates are set in wp-config.php. Also, there is a must-use plugin that is required to enable WP core automatic updates with git, following this approach.

Plugins automatically update as set in wp-admin on each site.

Development Site

http://devsite.recycleabike.org

An independent installation of WordPress with its own database. This site is set to automatically pull every 5 minutes from the master branch in Github and automatically run a composer update command to update all dependencies following each pull from Github.

htaccess username: demo

password: demo123

Archive Site

http://archive.recycleabike.org

contains all the content that was on the site as of the end of 2020, before this overhaul began.

An independent installation of WordPress with its own database, and some other non-WordPress content that was on the server.

htaccess username: demo

password: demo123