WordPress Local Development on OS X with Valet and Bedrock

Laravel’s Valet tool makes spinning up a local development environment quick and painless for OS X users. Valet uses the Caddy web server, PHP 7, along with MariaDB. It can be installed in just a few minutes with Homebrew and Composer. Valet or Trellis We recommend using Trellis to have dev/prod parity, but sometimes you … Continued

We’ve Migrated from Yoast SEO

We’re no longer running the Yoast SEO WordPress plugin on this site. We’d kept our Yoast SEO installation version at v2.3.5 and held off on updating the plugin after v3.0 was released at the end of November 2015. The large amount of bug reports and complaints since v3.0 were a big concern. Even with the … Continued

Simplifying Trellis

It’s easy to get comfortable using a project. Especially one that you’ve worked on and helped to create. Which is why it’s even easier to lose the perspective of a new user. Here’s what the default config looked like for a WordPress site in Trellis as of ~3 days ago: # Documentation: https://roots.io/trellis/docs/local-development-setup/ wordpress_sites: example.com: … Continued

Trellis Adds Let’s Encrypt Integration

Trellis now comes with automated Let’s Encrypt integration for free SSL certificates and the best HTTPS setup. HTTPS is now more important than ever. Strong encryption through HTTPS creates a safer and more secure web while protecting your site’s users. Google even started using HTTPS as a positive ranking for SEO purposes. Roots believes in … Continued

WordPress Password Security Follow-up

I wrote a blog post about on improving password security in WordPress and the Roots team created a plugin called wp-password-bcrypt to improve it a few weeks ago. Late Friday night, a few people (including myself) got into a Twitter argument about these security issues. Andrew Nacin, a Lead Developer of WordPress, ended up tweeting … Continued

Improving WordPress Password Security

We’ve released the wp-password-bcrypt plugin to improve WordPress password security by using bcrypt instead of insecure MD5 password hashing. March 21st update: see the follow-up post on password security for more information and corrections on some errors made in this post. WordPress, and its community, love to parrot that it powers 25% of the web. … Continued

Life of a Front-end WordPress Request

Have you ever asked yourself what happens when you hit a URL on a WordPress website? Here’s the very simplified version of the story: WordPress environment is loaded (core, plugins, theme) WordPress looks at URL and builds some query arguments based on it Obtained query arguments are used to run a \WP_Query (known as "main … Continued

Disable PHP 7 Deprecated Notices from WordPress Plugins

If you’re running PHP 7 then you’ve probably ran into issues with deprecated notices from various WordPress plugins. Trellis was recently upgraded with PHP 7 support so unfortunately we’ve seen a lot of these notices. If it was your own code, you’d want to fix these deprecations. But since we’re dealing with plugins, that’s not … Continued

2015 Recap

2015 was a really big year for Roots. It was the first year that we really executed on our vision of providing a suite of modern tools to make WordPress development easier and better. This was achieved with two major changes: releasing Sage and Trellis. The first half of 2015 was extremely busy with re-branding, … Continued

Sage 8.3.0 Updates

Sage is losing weight! The lib/ folder is down to 5 files. There were mostly minor changes in this release, including: config.php and init.php have been combined into setup.php Search template has been removed Modernizr has been removed The ConditionalTagCheck class has been removed Take a look at the Sage 8.3.0 release on GitHub for … Continued

Stepping Outside the Bubble

On August 15th, 2015, Vancouver hosted another WordCamp. This year was not developer-centric, although with two talks always running, the talks on the 8th floor were nearly all developer focused. It was a pleasure to see talks dealing with the upcoming ECMAScript 6, HHVM, the REST API + Angular.js, and load/stress testing your site. One … Continued

Trellis Updates: 0.9.1 Release

As Trellis finally gets closer to 1.0.0, some useful features have been contributed in the past few weeks. MailHog Pull request by @louim Dealing with emails in development is never fun. The two common solutions are usually: Ignore it and hope it works fine on production Set up real SMTP credentials to send emails Enter … Continued

Where MAMP and VVV Fall Short

Most people in the WordPress world probably get started off with MAMP or WAMP. The issue with that is that they can be extremely brittle, for one thing. You’re also tied to the versions of the software that MAMP pre-includes. They might upgrade to newer versions, such as PHP 5.6, but the problem is that … Continued

Why Do We Use These Tools?

If you think you don’t need tools like gulp and Composer, think again. Embrace them and you will be become better at your job. Last week I came across a thread in the Advanced WordPress group about Roots and Sage. One of the commenters said: That was exactly what drove me away from Roots, you … Continued

Introducing Trellis

Roots has a number of projects now with the two most popular being Sage and Bedrock. This is reflected on our site with those two projects being front and centre on the home page and in the top nav. It’s time to promote a third project alongside those two: Trellis. Trellis is the new name … Continued

Roots on The Changelog Podcast

Scott and Ben appear on this week’s Changelog podcast to talk about modern WordPress development. We talk about a more modern WordPress stack, Bedrock and Sage, dependency management, WordPress deployment, smarter development setup with tools like Ansible and Vagrant, and so much more. I think we’re all on the same page when it comes to … Continued

How to Override Bower Packages

Sage uses gulp to take a list of source files, transform them, then output them to a build directory. Sage also uses the Bower package manager for front-end assets. So the list of source files to be transformed through the build process almost always includes files from Bower packages. How does Sage know which files … Continued

Sage 8.2.0 and Soil 3.4.0 Updates

New updates have been made to both Sage and Soil. Sage is now using Sass Bootstrap as the default. Bootstrap 4 is going to be Sass. There’s not an ETA on a release, but it’s been in development for almost a year, so hopefully we’ll see an alpha soon There’s not really a big difference. … Continued

A Modern WordPress Example

Roots now has quite a few projects, and as we’re constantly improving them, it can be difficult to understand how to configure and get them all working together. As much as we try to provide documentation and support, the easiest way to learn is still to see a working example and some code in action. … Continued

Deploying Bedrock Sites

Bedrock was created with Capistrano as its built-in deployment tool and its remained that way for almost 18 months. Very soon, the Capistrano specific files and configs in Bedrock will be moved to its own separate repository but still easy to use. You can follow the progress at https://github.com/roots/bedrock/pull/163 and check out the new repo. … Continued

We’ve Migrated from Gumroad to Easy Digital Downloads

When we began selling products on roots.io in the summer of 2013, we went with Gumroad since it was really easy to implement and had a great user buying experience. Gumroad is the perfect tool if you’re selling a single product by a single seller. In our case, we weren’t just selling products as "Roots". … Continued

Sage 8.1.0 and Soil 3.1.0 Updates

New updates have been made to both Sage and Soil. The changelog is small and mostly minor for both projects. We’ve moved HTML5 Boilerplate’s Google Analytics snippet out of Sage and turned it into a Soil module. The option for adding a Google Analytics ID still exists in the theme config (lib/config.php) and the theme … Continued

Upping PHP Requirements in Your WordPress Themes and Plugins

There has been talk for a while now about the PHP requirements of WordPress. WordPress still supports PHP 5.2.4, however, PHP 5.2 was deprecated on January 6, 2011, over 4 years ago as of the time of this writing. PHP 5.3 was deprecated August 14, 2014. Why is WordPress continuing to support such antiquated versions … Continued

Modifying Bootstrap in Sage

Sage uses the Bootstrap front-end framework by default, and that brings along a little baggage. Bootstrap on its own has a bit of a reputation – most of it good, but a couple of common complaints: Bootstrap? Everyone uses Bootstrap and now the whole web looks the same! Bootstrap looks great out of the box, … Continued

New Website, Sage, and the Future

This is the 5th major update to the site since 2011. We’ve updated the design, re-branded the starter theme, and released a big update with version 8.0.0. Re-introducing the starter theme as Sage The Roots starter theme is now known as Sage. Ever since we launched Bedrock, things got a little weird with branding since … Continued

Cleaner WordPress Markup with Soil

Soil is a WordPress plugin that cleans up WordPress markup along with a few other enhancements. Code is poetry? The biggest component of Soil is the ‘clean up’, which stems from me being a little OCD with code formatting. Soil’s clean up makes the output of WordPress markup as minimal as possible, mostly by using … Continued

Roots 7.0.0 Updates

Roots 7.0.0 was released today! The new release features a much improved theme development workflow. Development started back in Feburary and, after a lot of feedback and help from the Roots community, is finally ready. This new version introduces Bower for front-end package management, better LESS organization, and a new Grunt workflow. What's new Leaner … Continued

Bedrock 1.1.1 Updates

There's been quite a few updates and improvements to Bedrock since the initial release that it warrants a new post and a quick look into the changes. Web directory The biggest change was introducing a web/ subdirectory that contains your WordPress application and the WP core only. Previously everything was in the same root project … Continued

Sage Shouldn’t Be Your First WordPress Theme

Sage was created to make your life easier as a WordPress developer, and it contains a collection of valuable tools for creating better websites even faster. But, much like most new skills it is usually easier to start with the basics, and then get more complex. What you should know first If you are just … Continued

Switch Between Environments from the WordPress Admin Bar

We've released a WordPress Stage Switcher plugin that will allow you to easily switch between environments from the WordPress admin bar: You'll need to have ENVIRONMENTS and WP_ENV defined in your WordPress config to use the stage switcher. The ENVIRONMENTS constant must be a serialized array of 'environment' => 'url' elements: $envs = array( ‘development’ … Continued

2013 Recap

2013 was a big year for Roots. Here's a rundown: Released 7 new versions of the Roots Theme Integrated Grunt into the master branch to better automate theme development Updated to Bootstrap 3 as soon as it was released Added LESS source maps support Moved from Google Groups to Discourse for our discussion forum Acquired … Continued

Introducing Bedrock

Bedrock is a modern WordPress stack that helps you get started with the best development tools and project structure. Bedrock's main features: Dependency management with Composer Automated deployments with Capistrano Easy development environments with Vagrant – coming soon! Better folder structure Easy WordPress configuration with environment specific files Environment variables with Dotenv Bedrock is meant … Continued

Twelve-Factor WordPress App

This is the introduction to a 12 part series for turning a WordPress site into a Twelve-Factor App. Want to turn your WordPress site into a Twelve-factor App? Bedrock is a WordPress project boilerplate to help you get started with the best tools and practices. If you aren’t familiar with the Twelve-Factor App: it’s a … Continued

Timing WordPress Requests

Sometimes when doing performance testing, you just want to do a quick test without setting up a full benchmarking test suite. WordPress and PHP offer a few tools for us to use. WP Timers WP has 2 little known functions available for us: timer_start and timer_stop. timer_start (source) just sets a global variable $timestart to … Continued

WordPress Plugins with Composer

This is a follow-up to my previous post on Using Composer with WordPress. Read that first for an introduction. Our WordPress project boilerplate, Bedrock, uses Composer for dependency management. A few common questions came up after my last post and screencast. This post will hopefully clear up two of them. 1. How do I make … Continued

Using Composer with WordPress

This post will give you an introduction to Composer and how to manage WordPress core, plugins, and even themes with it. If you already know what Composer is and how to use it and just want to see how to integrate it with WordPress, you can skip straight to the The Solution section below. Our … Continued

Using WooCommerce with Sage

When you first install WooCommerce with Sage you’ll notice that WooCommerce calls a duplicate header, sidebar and footer onto all product pages. This is because WooCommerce uses its own calls to get_header(), get_sidebar() and get_footer() in their template files, whereas Sage has already includes those areas in base.php with the theme wrapper. Fortunately it is … Continued