Dave's WordPress Starter Kit
Dave's WordPress Starter Kit takes some repetitiveness out of new WordPress projects and provides a few useful defaults.
- Optimizations in
- Security and performance improvements in
- Easier file browsing by moving
- Easier local development with Mark Jaquith's
- Install WordPress with no default content (e.g. "Hello world!")
- A few helpful default
- wp-cli and EditorConfig support
setup.sh. It will download the latest version of WordPress, set up the
/contentdirectory, and handle a few other tasks.
wp-config.php and the wp-content directory
By default, the kit moves
wp-config.php one level above
wordpress directory. The
wp-content directory has
content and is also moved outside the
wordpress directory, which is supported just fine.
For me, moving the configuration files and custom assets out
of the application directory helps reinforce the separation
between the two --- i.e., don't modify core files. It also
saves a step when browsing to the
content folder from your
file manager or the command line.
Additional modifications to wp-config.php
WP_SITEURLis predefined to include the
wordpressdirectory. Otherwise, WordPress won't know to look in
wordpressfor the installation files when you first navigate to the root directory.
If you remove the
WP_SITEURLdefinition before installation, you will get a 404 at yourwebsite.com; just browse to yourwebsite.com/wordpress and the installer should work fine.
WP_HOMEis predefined so that your site's home page isn't at
The default database prefix is changed from
wpto a random string. You probably want to change this to something more sensible for your project, but in case you don't, your database will be more secure than with the default.
trueto prevent users from editing theme or plugin files from the Dashboard.
Looks pretty via formatting based on Nicholas Gallagher's work.
WP_HOME lock the associated
settings in the Dashboard but do not also change the
database values. For more information, see the Codex.
wp-config.php is included in
default. If you want to include
wp-config.php in your
repository, you need to take the affirmative step of
removing it from
.gitignore. Requiring this step
safeguards against accidentally pushing the file to a public
cloud such as GitHub.
Local development with local-config.php
I use the local development configuration suggested by Mark
Jaquith. This configuration involves creating a separate
which your local database values are stored and
A conditional inside
wp-config.php checks for the
local-config.php and uses it if found. If
not, it continues using the production configuration in
When deploying your site to your production server, then,
you obviously have to exclude
local-config.php, or else it
will be used. So
local-config.php is included in
For more information about the configuration, read Mark Jaquith's blog post or watch his presentation at WordCamp SF 2011, both of which include other tips for local development. Or check out his WordPress Skeleton, where many of these ideas have already been implemented.
Goodbye "Hello world!"
install.php file inside the
contains an empty
wp_install_defaults function, which
overrides the standard function in
wp-admin/includes/upgrade.php. Leaving the function empty
causes WordPress to install without the default "Hello
world!" post, page, links, categories, etc. (via the
wp-hackers mailing list and WordPress bits).
Some .htaccess defaults
Block surfers from accessing
wp-config.phpand include-only files (via the Codex)
Prevent viewing the
.htaccessfile itself (via Net magazine)
Prevent access to PHP files in
wp-cli.yml configuration file supplies default options
wp executable. The
path config is predefined so
knows where to find the core files after installation.
EditorConfig "helps developers define and maintain consistent coding styles between different editors and IDEs":
The EditorConfig project consists of a file format for defining coding styles and a collection of text editor plugins that enable editors to read the file format and adhere to defined styles.
Projects using EditorConfig include jQuery and
.editorconfig is included here that suits my
needs, but of course you can tailor it for your preferences.
crossdomain.xml, humans.txt, robots.txt
The Starter Kit includes the
robots.txt files from the HTML5 Boilerplate. Links for more
information are included in each file, as well as in
the H5BP docs.