Git Product home page Git Product logo

wordpress-skeleton's Introduction

[DEPRECATED] WordPress Skeleton

USE https://github.com/genesis/wordpress/ INSTEAD! IT ROCKS!

Opinionated WordPress starter template that sets up local development & remote deployment via a simple configuration & command-line tools.

Features

Installation

Creating a New Theme:

$ cd path/to/sites
$ git clone git://github.com/ericclemmons/wordpress-skeleton.git my-theme

Adding to an Existing Theme:

$ cd path/to/existing/theme
$ git remote add skeleton git://github.com/ericclemmons/wordpress-skeleton.git
$ git fetch skeleton && git merge --squash skeleton/master
  • Download & Install Vagrant
  • Install Vagrant Hostmaster: $ sudo gem install vagrant-hostmaster
  • Capistrano: $ sudo gem install capistrano capistrano-ext colored
  • Composer: $ curl -s https://getcomposer.org/installer | php
  • Composer depependencies: $ php composer.phar install

Configure your skeleton.yml

This is where all WordPress plugins, admin logins & server information is stored.

$ ./bin/skeleton configure

(Re)Generating Your WordPress Skeleton

This is done automatically whenever you configure your skeleton.yml, but should be ran if you make any changes to it manually:

$ ./bin/skeleton generate

Local Development

$ vagrant up

The first time you run this, you have to perform a cold deployment to setup the folder structure & database:

$ cap local deploy:cold

After doing it once, you can just do normal deployments, which will only update the theme:

$ cap local deploy

Open WordPress in your browser:

$ ./skeleton open

Now you can make changes to /src and refresh!

You can always view skeleton.yml or run ./skeleton info for WordPress Admin credentials.

Useful Commands

  • ./skeleton will list all possible commands you can run to affect your local skeleton's configuration. These commands are also ran remotely via cap to perform tasks on the server.

  • cap -T will list all deployment & WordPress-related commands that can be used with each environment. (You will use local the most)

wordpress-skeleton's People

Contributors

ericclemmons avatar

Stargazers

Pascal Birchler avatar Nicolas Lemoine avatar Eddie Moya avatar Peter Briers avatar Juan Ramón Díaz avatar Evan Marell avatar Marcos Sader avatar Ken Prince avatar Martin Sjåstad avatar Eric Rasch avatar Theron Smith avatar

Watchers

 avatar Eric Rasch avatar James Cloos avatar  avatar

Forkers

eponymi

wordpress-skeleton's Issues

Best practices / pre-populate: ping list

This is actually set in the WP Admin under SETTINGS -> WRITING -> Update Services (/wp-admin/options-writing.php). If we can't pre-populate this, then we should just alert the front-end devs of post-install tasks.

http://api.feedster.com/ping
http://api.moreover.com/ping
http://api.moreover.com/RPC2
http://api.my.yahoo.com/RPC2
http://api.my.yahoo.com/rss/ping
http://bblog.com/ping.php
http://blo.gs/ping.php
http://blogsearch.google.com/ping/RPC2
http://bulkfeeds.net/rpc
http://geourl.org/ping
http://ipings.com
http://ping.blo.gs/
http://ping.bloggers.jp/rpc/
http://ping.feedburner.com
http://ping.syndic8.com/xmlrpc.php
http://ping.weblogalot.com/rpc.php
http://rpc.blogrolling.com/pinger/
http://rpc.pingomatic.com
http://rpc.technorati.com/rpc/ping
http://rpc.twingly.com
http://rpc.weblogs.com/RPC2
http://topicexchange.com/RPC2
http://www.blogdigger.com/RPC2
http://www.blogpeople.net/servlet/weblogUpdates
http://www.blogshares.com/rpc.php
http://www.blogsnow.com/ping
http://www.blogstreet.com/xrbin/xmlrpc.cgi
http://www.feedsubmitter.com
http://www.newsisfree.com/xmlrpctest.php
http://www.pingerati.net
http://www.pingmyblog.com
http://www.weblogalot.com/ping
http://xping.pubsub.com/ping

DB backup & restore should change names

When backing up the DB, the name should be converted from wordpress.env.db.name to wordpress_backup so that it can be restored to any environment via:

cat backup.sql | 's/`wordpress_backup`/`new_name`/g' | mysql

or something like that.

Vagrant reload has mysql error

Eric@eric-mbp:~/Sites/ericclemmons/wordpress-skeleton [master>]$ vagrant up
[default] VM already created. Booting if it's not already running...
[default] Clearing any previously set forwarded ports...
[default] Fixed port collision for 22 => 2222. Now on port 2200.
[default] Forwarding ports...
[default] -- 22 => 2200 (adapter 1)
[default] Exporting NFS shared folders...
[vagrant] Preparing to edit /etc/exports. Administrator privileges will be required...
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
[default] Configuring and enabling network interfaces...
[default] Setting host name...
[default] Mounting shared folders...
[default] -- v-csc-1: /tmp/vagrant-chef-1/chef-solo-1/cookbooks
[default] -- v-csc-2: /tmp/vagrant-chef-1/chef-solo-2/cookbooks
[default] Mounting NFS shared folders...
[vagrant] Updating host entry for default VM. Administrator privileges will be required...
[default] Running provisioner: Vagrant::Provisioners::ChefSolo...
[default] Generating chef JSON and uploading...
[default] Running chef-solo...
stdin: is not a tty
[Tue, 18 Sep 2012 16:06:22 +0200] INFO: *** Chef 0.10.10 ***
[Tue, 18 Sep 2012 16:06:23 +0200] INFO: Setting the run_list to ["recipe[wordpress-skeleton]"] from JSON
[Tue, 18 Sep 2012 16:06:23 +0200] INFO: Run List is [recipe[wordpress-skeleton]]
[Tue, 18 Sep 2012 16:06:23 +0200] INFO: Run List expands to [wordpress-skeleton]
[Tue, 18 Sep 2012 16:06:23 +0200] INFO: Starting Chef Run for develop.wordpress-skeleton.com
[Tue, 18 Sep 2012 16:06:23 +0200] INFO: Running start handlers
[Tue, 18 Sep 2012 16:06:23 +0200] INFO: Start handlers complete.
[Tue, 18 Sep 2012 16:06:23 +0200] INFO: Could not find previously defined grants.sql resource
[Tue, 18 Sep 2012 16:06:23 +0200] INFO: Processing execute[apt-get-update] action run (apt::default line 22)
[Tue, 18 Sep 2012 16:06:23 +0200] INFO: Processing execute[apt-get update] action nothing (apt::default line 29)
[Tue, 18 Sep 2012 16:06:23 +0200] INFO: Processing package[update-notifier-common] action install (apt::default line 36)
[Tue, 18 Sep 2012 16:06:23 +0200] INFO: Processing execute[apt-get-update-periodic] action run (apt::default line 40)
[Tue, 18 Sep 2012 16:06:29 +0200] INFO: execute[apt-get-update-periodic] ran successfully
[Tue, 18 Sep 2012 16:06:29 +0200] INFO: Processing directory[/var/cache/local] action create (apt::default line 50)
[Tue, 18 Sep 2012 16:06:29 +0200] INFO: Processing directory[/var/cache/local/preseeding] action create (apt::default line 50)
[Tue, 18 Sep 2012 16:06:29 +0200] INFO: directory[/var/cache/local/preseeding] mode changed to 644
[Tue, 18 Sep 2012 16:06:29 +0200] INFO: Processing package[apache2] action install (apache2::default line 20)
[Tue, 18 Sep 2012 16:06:29 +0200] INFO: Processing service[apache2] action enable (apache2::default line 25)
[Tue, 18 Sep 2012 16:06:29 +0200] INFO: Processing directory[/etc/apache2/ssl] action create (apache2::default line 138)
[Tue, 18 Sep 2012 16:06:29 +0200] INFO: Processing directory[/etc/apache2/conf.d] action create (apache2::default line 145)
[Tue, 18 Sep 2012 16:06:29 +0200] INFO: Processing directory[/var/cache/apache2] action create (apache2::default line 152)
[Tue, 18 Sep 2012 16:06:29 +0200] INFO: Processing template[apache2.conf] action create (apache2::default line 159)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing template[security] action create (apache2::default line 175)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing template[charset] action create (apache2::default line 185)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing template[/etc/apache2/ports.conf] action create (apache2::default line 195)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing template[/etc/apache2/sites-available/default] action create (apache2::default line 204)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing template[/etc/apache2/mods-available/status.conf] action create (apache2::mod_status line 21)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing execute[a2enmod status] action run (apache2::mod_status line 38)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing template[/etc/apache2/mods-available/alias.conf] action create (apache2::mod_alias line 21)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing execute[a2enmod alias] action run (apache2::mod_alias line 38)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing execute[a2enmod auth_basic] action run (apache2::mod_auth_basic line 38)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing execute[a2enmod authn_file] action run (apache2::mod_authn_file line 38)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing execute[a2enmod authz_default] action run (apache2::mod_authz_default line 38)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing execute[a2enmod authz_groupfile] action run (apache2::mod_authz_groupfile line 38)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing execute[a2enmod authz_host] action run (apache2::mod_authz_host line 38)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing execute[a2enmod authz_user] action run (apache2::mod_authz_user line 38)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing template[/etc/apache2/mods-available/autoindex.conf] action create (apache2::mod_autoindex line 21)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing execute[a2enmod autoindex] action run (apache2::mod_autoindex line 38)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing template[/etc/apache2/mods-available/dir.conf] action create (apache2::mod_dir line 21)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing execute[a2enmod dir] action run (apache2::mod_dir line 38)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing execute[a2enmod env] action run (apache2::mod_env line 38)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing template[/etc/apache2/mods-available/mime.conf] action create (apache2::mod_mime line 21)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing execute[a2enmod mime] action run (apache2::mod_mime line 38)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing template[/etc/apache2/mods-available/negotiation.conf] action create (apache2::mod_negotiation line 21)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing execute[a2enmod negotiation] action run (apache2::mod_negotiation line 38)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing template[/etc/apache2/mods-available/setenvif.conf] action create (apache2::mod_setenvif line 21)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing execute[a2enmod setenvif] action run (apache2::mod_setenvif line 38)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing service[apache2] action start (apache2::default line 219)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing package[mysql-client] action install (mysql::client line 46)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing package[libmysqlclient-dev] action install (mysql::client line 46)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing directory[/var/cache/local/preseeding] action create (mysql::server line 31)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: directory[/var/cache/local/preseeding] mode changed to 755
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing execute[preseed mysql-server] action nothing (mysql::server line 38)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing template[/var/cache/local/preseeding/mysql-server.seed] action create (mysql::server line 43)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing template[/etc/mysql/debian.cnf] action create (mysql::server line 51)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: template[/etc/mysql/debian.cnf] backed up to /var/chef/backup/etc/mysql/debian.cnf.chef-20120918160630
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: template[/etc/mysql/debian.cnf] updated content
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing package[mysql-server] action install (mysql::server line 78)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing directory[/etc/mysql/conf.d] action create (mysql::server line 85)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing service[mysql] action nothing (mysql::server line 105)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing template[/etc/mysql/my.cnf] action create (mysql::server line 125)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing template[/etc/mysql/grants.sql] action create (mysql::server line 179)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: template[/etc/mysql/grants.sql] backed up to /var/chef/backup/etc/mysql/grants.sql.chef-20120918160630
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: template[/etc/mysql/grants.sql] updated content
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: template[/etc/mysql/grants.sql] sending run action to execute[mysql-install-privileges] (immediate)
[Tue, 18 Sep 2012 16:06:30 +0200] INFO: Processing execute[mysql-install-privileges] action run (mysql::server line 195)
[Tue, 18 Sep 2012 16:06:30 +0200] ERROR: execute[mysql-install-privileges] (mysql::server line 195) has had an error
[Tue, 18 Sep 2012 16:06:30 +0200] ERROR: template[/etc/mysql/grants.sql] (/tmp/vagrant-chef-1/chef-solo-2/cookbooks/mysql/recipes/server.rb:179:in `from_file') had an error:
execute[mysql-install-privileges] (mysql::server line 195) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "/usr/bin/mysql" -u root -p"vagrant" < "/etc/mysql/grants.sql" ----
STDOUT: 
STDERR: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
---- End output of "/usr/bin/mysql" -u root -p"vagrant" < "/etc/mysql/grants.sql" ----
Ran "/usr/bin/mysql" -u root -p"vagrant" < "/etc/mysql/grants.sql" returned 1
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/mixlib-shellout-1.0.0.rc.1/lib/mixlib/shellout.rb:242:in `invalid!'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/mixlib-shellout-1.0.0.rc.1/lib/mixlib/shellout.rb:228:in `error!'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/mixin/shell_out.rb:36:in `shell_out!'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/provider/execute.rb:58:in `action_run'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/resource.rb:454:in `send'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/resource.rb:454:in `run_action'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/runner.rb:49:in `run_action'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/runner.rb:57:in `run_action'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/runner.rb:55:in `each'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/runner.rb:55:in `run_action'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/runner.rb:85:in `converge'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/runner.rb:85:in `each'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/runner.rb:85:in `converge'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/resource_collection.rb:94:in `execute_each_resource'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/resource_collection.rb:92:in `execute_each_resource'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/runner.rb:80:in `converge'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/client.rb:330:in `converge'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/client.rb:163:in `run'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application/solo.rb:207:in `run_application'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application/solo.rb:195:in `loop'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application/solo.rb:195:in `run_application'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application.rb:70:in `run'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/chef-solo:25
/opt/vagrant_ruby/bin/chef-solo:19:in `load'
/opt/vagrant_ruby/bin/chef-solo:19
[Tue, 18 Sep 2012 16:06:30 +0200] ERROR: Running exception handlers
[Tue, 18 Sep 2012 16:06:30 +0200] ERROR: Exception handlers complete
[Tue, 18 Sep 2012 16:06:30 +0200] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out
[Tue, 18 Sep 2012 16:06:30 +0200] FATAL: Mixlib::ShellOut::ShellCommandFailed: execute[mysql-install-privileges] (mysql::server line 195) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "/usr/bin/mysql" -u root -p"vagrant" < "/etc/mysql/grants.sql" ----
STDOUT: 
STDERR: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
---- End output of "/usr/bin/mysql" -u root -p"vagrant" < "/etc/mysql/grants.sql" ----
Ran "/usr/bin/mysql" -u root -p"vagrant" < "/etc/mysql/grants.sql" returned 1
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.

PHP Fatal errors while running configuration command

See last lines of log here: https://gist.github.com/14c987732f9ee311cc9a

Generating...
PHP Fatal error: Class 'RecursiveCallbackFilterIterator' not found in /Users/erasch/Sites/cmn.dev/github/wordpress-skeleton/library/Skeleton/Generator/Generator.php on line 34

Fatal error: Class 'RecursiveCallbackFilterIterator' not found in /Users/erasch/Sites/cmn.dev/github/wordpress-skeleton/library/Skeleton/Generator/Generator.php on line 34

List dev+prod plugins

You mentioned that there are "out of the box" dev plugins we should support for basic development and production plugins that are handy for most users.

List them in this ticket & I'll get them added to skeleton.yml.mustache

Ask for WordPress Admin

The user needs to be explicitly prompted for the WordPress admin across all environments

  • username
  • e-mail
  • password

Stage + Prod deployment settings

Currently there is only the local deployment configuration.

Using my other projects as an example, the core deploy.rb should be able to handle pretty much the full deployment configuration.

Best practices / pre-populate: .htaccess (root)

Reserving space for caching (not necessary at all), inserting expires headers, general WP code, and then security attempts. This .htaccess file is intended for the root folder of the website.

Options -Indexes

# BEGIN WPSuperCache
# END WPSuperCache


# ----------------------------------------------------------------------
# Expires headers (for better cache control)
# Source: https://github.com/h5bp/html5-boilerplate/blob/master/.htaccess#L209
# ----------------------------------------------------------------------

# These are pretty far-future expires headers.
# They assume you control versioning with filename-based cache busting
# Additionally, consider that outdated proxies may miscache
#   www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/

# If you don't use filenames to version, lower the CSS  and JS to something like
#   "access plus 1 week" or so.

<IfModule mod_expires.c>
  ExpiresActive on

# Perhaps better to whitelist expires rules? Perhaps.
  ExpiresDefault                          "access plus 1 month"

# cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
  ExpiresByType text/cache-manifest       "access plus 0 seconds"

# Your document html
  ExpiresByType text/html                 "access plus 0 seconds"

# Data
  ExpiresByType text/xml                  "access plus 0 seconds"
  ExpiresByType application/xml           "access plus 0 seconds"
  ExpiresByType application/json          "access plus 0 seconds"

# Feed
  ExpiresByType application/rss+xml       "access plus 1 hour"
  ExpiresByType application/atom+xml      "access plus 1 hour"

# Favicon (cannot be renamed)
  ExpiresByType image/x-icon              "access plus 1 week"

# Media: images, video, audio
  ExpiresByType image/gif                 "access plus 1 month"
  ExpiresByType image/png                 "access plus 1 month"
  ExpiresByType image/jpg                 "access plus 1 month"
  ExpiresByType image/jpeg                "access plus 1 month"
  ExpiresByType video/ogg                 "access plus 1 month"
  ExpiresByType audio/ogg                 "access plus 1 month"
  ExpiresByType video/mp4                 "access plus 1 month"
  ExpiresByType video/webm                "access plus 1 month"

# HTC files  (css3pie)
  ExpiresByType text/x-component          "access plus 1 month"

# Webfonts
  ExpiresByType application/x-font-ttf    "access plus 1 month"
  ExpiresByType font/opentype             "access plus 1 month"
  ExpiresByType application/x-font-woff   "access plus 1 month"
  ExpiresByType image/svg+xml             "access plus 1 month"
  ExpiresByType application/vnd.ms-fontobject "access plus 1 month"

# CSS and JavaScript
  ExpiresByType text/css                  "access plus 1 year"
  ExpiresByType application/javascript    "access plus 1 year"

</IfModule>


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

# protect wpconfig.php
<files wp-config.php>
Order deny,allow
deny from all
</files>

# protect .htaccess
<Files .htaccess>
Order allow,deny
deny from all
</Files>

Rename "develop" to "local"

This makes more sense with the local vagrant VM and doesn't conflict with many existing development environments.

deploy:cold

It's annoying to do, but blow away vendor/wordpress/wordpress, composer install, & run ./skeleton generate and cap local deploy:cold until it works out the gate.

There's a weird race condition with not having the DB in time to install plugins or create users, but the code has to exist first.

Best practices / pre-populate: robots.txt

Here's the robots.txt I've used on sites. The sitemap link can change, though, depending on the site and the plugin used (Yoast's WordPress SEO uses a different sitemap filename).

# www.robotstxt.org/
# www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449

User-agent: *
Disallow: /cgi-bin/
Disallow: /wp-*
Allow: /
Sitemap: http://www.[WEBSITE].com/sitemap.xml.gz

Next step: How to log into the WP Admin...

Make the initial WP Admin account/password known via the README.

This brings up another question. Will the db save/restore to the local/dev/live site affect the users already there? We would not want those to be altered in any way (since they are part of the db).

wp:db:save & wp:db:restore commands

These capistrano tasks should automate the exporting & importing of remote data on the server.

wp:db:save should export a gzip'd db dump on the specified environment & download it to the local machine under db.

wp:db:restore should upload a specified backup and import it into the remote database.

  • wordpress.db will need to be wordpress.db.mustache
  • The user should be prompted before restoring any database
  • wp:db:drop should be ran prior to restoring the db

Best practices / pre-populate: .htaccess (wp-admin)

This .htaccess file is intended to go in the /wp-admin folder to strengthen security.

Options -Indexes

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# Prevents directory listing
IndexIgnore *
# END WordPress

Have sexier output

Capifony has a really nice, clean, non-capistrano-like output that we should use instead of the crappy, verbose output.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.