With a couple of Laravel developments out in the wild, I needed to make sure that they were integrated with my existing backup solution, which includes archived / off-server storage of backups. Pulling down the backups once I had them is pretty straightforward – everything is already set up to do that from the servers I use.
The BackUpWordPress plugin is hosted on GitHub, if you want to help out with development or testing then head over to https://github.com/humanmade/backupwordpress/.
We’d also love help translating the plugin into more languages, if you can help then please visit https://translate.wordpress.org/projects/wp-plugins/backupwordpress/dev/ to start translating.
Current version: 3.6.4
Rating: 94(1041 ratings)
Downloaded 3,329,839 times
For Laravel though, I was starting afresh. I found what looked like a good solution in the form of the Laravel Backup package from the team at Spatie. There were a couple of things I liked about the package:
It’s simple, straightforward, and does one thing (create backups) well.
While I’m using it to back up to the local filesystem initially (backups are then transferred offsite separately by an existing system), the package allows you to put your backups onto any supported filesystem, so having it backup to S3, Dropbox, FTP, Rackspace cloud files or similar is just as straightforward.
I love the team’s concept of “Postcardware“, it’s nice as an open source author to know that your work is being appreciated, and used, and I hope they get plenty of postcards!
I have to say though, the real highlight in finding this package was finding Spatie and their broad range of Laravel packages – there’s at least one more that features in this series, and I can easily see myself using more of their packages in the future – thanks Spatie!
I’ve worked with Drupal & WordPress for the majority of my projects for many years. For a lot of projects that are content-centric they can make a good starting point, and minimize the amount of custom work that needs to be done.
Starting with WordPress or Drupal gives you a user framework, permissions, content management, easy content display, and a wealth of prebuilt modules / plugins to get your project off to a quick start.
However, they do have their limitations, and they’re not for every project. More recently I’ve been working with Laravel as a development framework on a number of projects that made sense to build from the ground-up. Established Laravel agencies / developers probably already have a set of add-ons that they regularly use to build out common features, but for someone relatively new to the framework, a lot of my time has been spent finding the building blocks to fill in missing bits of the puzzle.
I’m going to cover a number of these in future articles (backups / WYSIWYG editing / content filtering) in future articles of the series, but today I’m going to talk about user registration.
Laravel has scaffolding built out for user management, including registration, and password management. However – the default setup doesn’t do anything to enforce password rules / guidelines on users. One of my recent projects includes users registering for a service, and I wanted to make sure that they weren’t using too simple passwords. WordPress does this out of the box, and Drupal has plenty of modules to choose from, but for Laravel I had to look for something to plug in.
Wiring it up to Laravel was a small job (If there’s any interest I can write that up separately), essentially just extending Laravel’s validation framework, and setting the validation control on the RegisterController.
I maintain a number of WordPress plugins, and they get used on all manner of WordPress sites. One of my more popular plugins is the WooCommerce Google Product Feed extension. This queries all products, applies some logic, and user-definable mappings and outputs an XML feed that Google will import into their product ad system.
On small stores, this is pretty straightforward, but on larger stores, the effort to query all products (including all individual variations of products) can be significant.
I’ve recently been doing some work on performance-tuning the plugin. I started out with some really simple performance tracking outputting total time and memory usage at the end of the XML document. There were some quick wins as a result of that, but it didn’t really give me a feel for what was going on, or any big gains.
I’m normally a big fan of the Query Monitor plugin for reviewing what queries are run to generate a page, however in this instance it doesn’t help since there is no HTML output to the page for Query Monitor to add its results to. I needed something that wasn’t tied to logging its output to the generated page. I finally settled on Time-Stack by Joe Hoyle.
There are actually two things you need to get up and running – the timestack “app” (repo linked above), and the WordPress plugin that logs the data. Once you’ve got the app installed, and the WordPress plugin activated, then every request will be tracked, and visible in the app:
You get to see the total runtime, and memory usage, but more importantly you can drill into sections of the page request to see further information. You can right down to the actual queries being run and see exactly what’s going on. You can even instrument your code to markup useful sections for your profiling.
How did I get on? I’ll let the evidence speak for itself …
If you’re in the web industry, you’re pretty much guaranteed to have heard of Google Analytics. It’s the de-facto standard in analysing user behaviour on websites. On any site you put together – it’s likely that you’ll set it up.
When you set up a site in the Google Analytics web interface you get a copy and paste snippet of code which gets you going in no time. This snippet links your website to the account you’ve set up in Google Analytics, and tracks each page that’s viewed on your site.
For many people this is everything that’s needed.
However, Google Analytics can be used for so much more. You can use it to track anything you want using event tracking (user clicked on call-to-action button, user downloaded PDF etc.), or by providing richer context about page views (this was a logged in user etc.). Here’s some of the things I’ve used Google Analytics to track in past projects:
On a site with a multi-field search (E.g. country, market sector, and keyword) track which of the fields were provided for each search, e.g. “Country Search”, “Country & market search”, “Keyword only search” etc.
Track events according to which adverts users were shown
Track custom events when people follow certain on-page nav elements
Being familiar with what you can do with Google Analytics, on my new hill-walk blogging service I had a list of things I wanted to track. One of the things I wanted to track was selected external links. This can always be a bit hit and miss as there’s no guarantee that the tracking will fire before the browser navigates on to the clicked page.
So off I went to do a bit of research on the best way to handle the issue.
Tip: Even if you *know* how to solve a problem, have a quick check. Technology moves fast and there might be a better / easier way today than there was yesterday…
In my travels I came across the “autotrack” library by the Google Analytics team.
The library describes its capabilities (my emphasis):
Provides default tracking for the interactions most people care about, and it provides several convenience features (e.g. declarative event tracking) to make it easier than ever to understand how people are using your site.
With the autotrack library installed, this will automatically take care of tracking a click when the link is clicked. The library takes care of using the best API for the visitors browser to maximise the chances of outbound links getting tracked.
The even better news is that everything we’ve talked about here is just one of the features available (via the eventTracker plugin for autotrack). The library also includes a variety of other plugins covering tasks such as cleaning up tracked URLS, visibility tracking, media query tracking, and page visibility tracking plus more.
One of the projects I’ve worked on recently is a rebuild of workflow system for a large business. The system processes large volumes of data 24 hours a day. It’s important that any errors with the system are flagged, tracked and investigated as soon as possible.
Another of the projects is a personal project I’m launching for Hill Blogging. This service is now in beta release with a handful of beta testers. I’m keen to identify, and squash any bugs without relying on beta testers reporting them.
Both of these projects use the Laravel PHP Framework (although neither Sentry.io, nor this post are Laravel specific!). So, I set about looking for a solution that would automatically track, and alert me to errors with Laravel. Any solution had to give me enough information to identify and start fixing the error.
On both of these projects I settled on Sentry.io. It’s a SaaS product that describes itself as:
Real-time error tracking [that] gives you insight into production deployments and information to reproduce and fix crashes.
This is pretty much everything I was looking for.
Sentry offers a Laravel integration out of the box. Simply install it, attach it to your project, and set up your project key. It’s a really straightforward setup. Once it’s set up, then any exceptions thrown in your code will get logged to Sentry, together with a backtrace. You’ll also be alerted to the new error.
You can take things further if you want by logging additional information with the exceptions if you need to, but the basic setup is sufficient to get you going.
Beyond Laravel, Sentry has libraries for common frameworks, and client libraries for most mainstream libraries, so it should be relatively easy to get going with.
There’s a range of pricing options depending on your likely error volume (zero – right!?) and users. The free tier is a great way to get started and offers support for 5,000 events/day (~150,000/month) at time of writing.
For me, it’s already more than proved its worth, not only in production, but also during development / staging phases of projects, helping me get straight to the broken code without having to rely on vague bug reports from users.
It’s worth noting that there are other similar services. In my investigations, I also looked at Rollbar and Airbrake – they may work better for you depending on your own circumstances.
I was chatting with some fellow tech industry types the other day, when the conversation inevitably turned to cool (“useful”) software components that we’d used on recent projects. It struck me that I’ve worked on a couple of projects (both client projects, and personal projects) that have had me trialling and using a variety of useful little libraries / services and approaches.
It also struck me that beyond the odd pull-request / issue raising on GitHub I’d not had any contact with the authors of said software to say thanks, nor had I really shared the knowledge about what I’d found and how I’d used it. The result was the following “commitment”
Thought for the day: There’s some awesome free software components out there that don’t get enough recognition / thanks. (1/2)
I’ve spent the last four and half years working with a great team, on some fascinating, large-scale (predominantly Drupal) website builds. I’ve balanced that with a “spare-time” job building and selling WordPress plugins.
Working on WordPress plugins in my spare-time gave me the flexibility to experiment with things that interested me. I built some fun plugins, some useful plugins, and some boring-but neatly functional plugins. I’ve also learnt a lot along the way.
Selling some of those plugins has given me the flexibility to give up the day-job, and go out on my own full-time. So – as of early April, this my new office:
It comes complete with personalised mug from my ever-supportive wife Claire, greenhouse-style window display, and Bella the code-reviewing cat.
Going forward, my main aims are to:
expand my range of plugins – both free and paid
take care of some housekeeping and feature development on existing plugins
explore some other technical arenas
I’ll also be taking on some contract work (WordPress, Drupal, Symfony or Laravel for starters) to keep things interesting.
So far, I’ve released Cart recovery for WordPress, as well as its pro add-on, added new features to a few free, and paid-for plugins, done some R&D with Laravel and Ionic for future projects, and got a few nice contracts lined up.
The latest version (2.4) of Wapuuvatar includes some lovely new Wapuus, including an evil Wapuu, Swedish Wapuu, Swiss Wapuu and Edu-Wapuu
It also features a festive Wapuu. As it’s starting to feel a bit like Christmas, it also includes a handy little filter that can be used to modify the Wapuu that is picked for a particular user. That lets you come up with fun things like festive_wapuu_for_everyone – a handy little snippet that will swap all of your Wapuuvatars for festive Wapuus during December 🙂
Everyone needs a fun project every now and then, something that’s not serious, doesn’t have deadlines, or fixed set of requirements. Something that you can just play with.
I first came across Wapuu at WordCamp London, where Scott Evans had designed an awesome Punk Wapuu which covered posters, stickers – and even scarves! (You can see some of the artwork here: https://london.wordcamp.org/2015/). It turns out that the Wapuu character was original developed by the Japanese WordPress community, released under the GPL, and has since been modified by many people for many different events / purposes.