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 January Commit

December was tiring. Several of us WooThemes ninjas spent the month writing a blog post, every single day, just for the sake of it. But it was fun. It pushed us to hit the publish button, produce more content and improve our writing.

But that’s over. Now it’s time to really push ourselves. This isn’t a kids game anymore.

Welcome to The January Commit, a 31 day challenge demanding each participant makes at least 1 commit on GitHub daily throughout January.

Continue reading

Contributing on GitHub for Dummies

I’m naturally an idiot so this took me a while to get a good understanding of. Even now I still mess it up, but I feel like I can at least grasp the basic requirements of being a good contributor on GitHub – so let me share them with you!

Coding in public is pretty scary. Not just for contributors, but for project maintainers too. Everything is being watched and recorded and saved forever – there’s no (easy) erasing of mistakes, which leads to a lot of pressure on everyone involved.

So take a step back, realise that this is open-source software, and relax. GitHub is the proverbial playground for an open-source project, where things can discussed and tried – don’t be afraid!

Continue reading

Building a Freemium Plugin

Over the past few years, the concept of Freemium Software seems to have been given a lot more attention than it has in the past. Sure, the phrase was only coined 8 years ago (yeah, I looked it up), but it has existed for decades.

However, with the emergence of free web software and libraries like WordPress & jQuery, freemium software has recently found a place in developers’ hearts.

Especially in the world of gaming, both online (Facebook) and mobile (iPhone / Android), freemium software has started to become the norm, with content producers finding that it’s more profitable to give a little bit for free and charge a lot for the extras.

Continue reading