Introducing MagicPress

The other day I saw Aaron Rutley tweet about a tool he’d built called ValetPress:

It combined two of my favourite things – WordPress & Laravel Valet. If you’re reading my blog, you likely already know what WordPress is but may not know about Valet.

Valet is a Laravel development environment for Mac minimalists. No Vagrant, No Apache, No Nginx, No /etc/hosts file. You can even share your sites publicly using local tunnels. Yeah, we like it too.

Laravel Valet configures your Mac to always run Caddy in the background when your machine starts. Then, using DnsMasq, Valet proxies all requests on the *.dev domain to point to sites installed on your local machine.

In other words, a blazing fast Laravel development environment that uses roughly 7mb of RAM. Valet isn’t a complete replacement for Vagrant or Homestead, but provides a great alternative if you want flexible basics, prefer extreme speed, or are working on a machine with a limited amount of RAM.

It’s not for everyone, but I’ve found it to be sufficient for quickly prototyping new things and keeping my MBP’s battery alive more than a couple hours.

Aaron’s solution is awesome – he’s introduced a new command that allows you to quickly spin up new Valet powered WordPress sites using WP-CLI.

I wanted to try make the install process a little bit easier, have always wanted to build a Node CLI app and selfishly, wanted some specific commands for making WooCommerce development sites, so I got inspired and put together MagicPress.

If you’ve already got Valet and WP-CLI installed, you just need one more command to get started with MagicPress.

npm install magicpress -g

For the rest, check the docs. You may need to configure the MySQL username/password if yours isn’t rootroot. To do that, just run:

sudo mp config

At this point, you’re ready to to create new WordPress development sites! The good news? It’s almost instant:

mp new sitename

sitename.dev is now a functioning WordPress installation with a DB and everything!

Check out the docs as things have likely changed since I wrote this, but one of my favourite optional commands is –woocommerce. Append it to the end of your mp new command and the new site will have a copy of WooCommerce installed, along with the Storefront theme.

mp new woo --woocommerce

There’s also the –dev command that I highly recommend using, which will install a bunch of useful developer-friendly plugins like Query Monitor. I hope to add some more commands and delete functionality soon, but for now, I’m interested to see if others find this as useful as I have!

PS. It’s MIT-licensed, so you can pretty much do whatever you want with it (except blame me if something breaks). 🙂

Photo by Thomas Kelley

The Software Update Problem

Regardless of how well you write code or develop products, updates are mandatory. When it comes to the software, the phrase ‘nothing is perfect’ is especially true.

So you’ll need to make updates. Probably a lot of them. Not just to cover bugs and improve compatibility, but also to add new features and enhancements to keep new and old customers happy (and coming back for more).

Continue reading

Join Me at WordSesh on Saturday

If you’ve be listening to me blabber on for the last 3 weeks (actually 22 days – yes, I’m counting) during Blogging for Hippo, then you’ve either grown to love me or hate me. Either way, it’s cool.

But this weekend, from Saturday 0:00 UTC to Sunday 0:00 UTC, there’s something very special taking place – WordSesh – a “full day of live WordPress presentations from all over the world streamed live to you wherever you may be”.

And I’m speaking at it. Woo!

It’s awesome. It’s fresh. It’s WordSesh. (I’m came up with that myself!)

Continue reading

Getting Started with WordPress Hooks – Actions & Filters

When I first started developing WordPress stuff years ago, I had no idea what ‘hooks’, ‘actions’ or ‘filters’ were. I saw them written about, used, discussed and explained countless times but I was afraid to try understand them. They scared me.

But I grew up. Like all good developers do, I eventually got over my fears and dedicated some time to really get my head around them. So I read a lot of guides, like this one, this one, and especially this one – it all started to make sense!

Continue reading

A Quick Look at the WordPress uninstall.php File

Creating a plugin for WordPress is a fun experience. You get to build something that eventually gets used by countless people, makes their lives easier, perhaps makes you a profit and in general just makes the world a better place.

But don’t be the jerk that overstays their welcome. When your plugin creates ‘data’ on a user’s site, like a post type, page or setting, you have a responsibility to remove that data when a user decides to delete your plugin. If you neglect to clean up after yourself, you’re imposing a lifetime of DB clutter on your (ex-)user and making the world a worse place.

Continue reading

Being a WordPress Product Manager

I’m not a product manager. At least, I’m not paid to be a product manager. But I do manage products. All developers do. It comes with the job (as a developer).

So in my not-so-official role as the product manager of every single product I’ve ever built, I’ve started to realise a few things about what I believe makes a product great.

Continue reading

Recipe Hero 1.0

About 6 months ago I started working on a simple idea – a beautiful, modern recipe plugin for WordPress. A month or so after that I launched a very rough beta release, starting at 0.5. It took me a few months, but today I’m extremely happy to launch Recipe Hero 1.0.

It took me longer than it should have, but I got stuck in a mentality where everything had to be right before I pulled the trigger. That’s not the right mentality – at least in my opinion. So, today I’ve released the almost-ready one point oh.

Continue reading