ProcessWire Weekly #128

The 128th issue of ProcessWire Weekly brings in all the latest news from the ProcessWire community. Modules, sites, and more. Read on!

Hello there and welcome to the 128th issue of ProcessWire Weekly! This time we're going to take a closer look at the latest core updates, introduce a new module for scheduling tasks, and share another ProcessWire recipe of the week.

Our latest site of the week is a homage to a great American composer Elliott Carter, and once again we're absolutely thrilled to see just what a motivated and talented designer and developer can do with ProcessWire and a bit of time. Truly magnificent work.

Thanks to all of our readers for being here with us again, and as always, any feedback is most welcome – please don't hesitate to drop us a line if there's anything in your mind you'd like to share with us. Enjoy our latest issue and have a great weekend!

Latest core updates: ProcessWire 3.0.38 and a recipe for logging outbound emails

In his latest blog post Ryan introduces ProcessWire 3.0.38 dev. While there's nothing really major in this version, it does contain some pretty nice updates nevertheless:

  • Core modules that have been listed as configurable but haven't had any user-configurable settings are no longer displayed as configurable in the Modules section.
  • TextformatterSmartypants module has been updated and the latest version now includes optional support for using UTF-8 characters instead of HTML entities.
  • Multiple improvements to WireMail: wrapping of long subject headers, structural fixes for when attachments are present, and proper quotes around names when using name + address combinations.
  • Support for common translations for words that are used over and over again: "yes", "no", "save", "name", "label", and so on. When a common translation for these words exist, they can be skipped in the per-file context, in which case the common translation will be used automatically.

In addition to these feature updates, a bunch of relatively minor bugs were fixed in this version. As a special highlight the WireMail updates mentioned above were submitted by BitPoet as a pull request – yet another proof that our current community powered development model works.

For more details about the core updates mentioned here and a very cool recipe for logging all outbound emails, don't forget to check out Ryan's latest blog post at the blog. Thanks!

New module: PWCron

PWCron is a brand new module by Ville Sulin and Joonas Kolkka. In a nutshell PWCron is a simple cron helper for scheduling actions of other modules: with little effort it can be configured to trigger features from other modules at a specific interval.

Getting started with PWCron is also quite simple, but has one notable twist: in addition to installing the module itself you need to set up a cron task to run behind the scenes. This cron task will invoke PWCron, which in turn will invoke other actions.

PWCron supports two separate methods depending on your needs:

  • Lazy method, where you specify (via module config screen) an interval, the name of your module, and the name of the method that PWCron needs to trigger. This method is very easy to set up, and most likely fits most use cases just fine.
  • Pro method, where your module hooks into the PWCron::cronHook() method. This method requires a bit more work – you need to handle stuff like intervals, logging, etc. yourself – but allows for more customization too.

For more details about this module please check out the PWCron GitHub repository. For questions and general feedback you should head down to the dedicated support forum thread.

Big thanks to Ville and Joonas for sharing this module with us – great stuff indeed!

Recipe of the week: benchmark code execution times with built-in methods

This weeks recipe was originally tweeted by none other than Mr. Ryan Cramer himself, and it's just about as simple as a recipe can get, but – as we've probably mentioned a few times already – a great recipe doesn't have to be complex. It just needs to solve a problem and make sense on itself. One might even argue that the simpler, the better.

The Problem

You've got something that you suspect might be a bottleneck for your site, or you just want to compare two implementations to see which one is actually faster. Either way you want to know how a block of code behaves in terms of raw performance.

The Solution

The solution to this one, it turns out, requires no more than two extra lines of code:

$t = Debug::timer();
// insert here whatever it is that you want to time
echo Debug::timer($t);

That's just about it, Debug::timer() takes care of everything else.

For those curious about what that Debug thing is, it's actually one of ProcessWire's core classes, and for the time being it's one and only feature is handling timers (like the one we've used in our example above). Debug has been around for quite a while, but it's still quite likely one of the least well known parts of the system.

For those of you looking for more extensive debugging tools, we can highly recommend the Tracy Debugger module. Whatever it is that you need in terms of debugging, Tracy Debugger most likely includes support for it right out of the box.

If you've got a recipe of your own that you'd like to share with others, feel free to submit it at ProcessWire Recipes. Big thanks to Ryan for sharing this week's recipe with us!

Site of the week: composer Elliott Carter

Our latest site of the week focuses on the works of American composer Elliott Carter (December 11, 1908 - November 5, 2012).

During his musical career – which spanned over 75 years – Elliott Carter published more than 150 works, won the Pulitzer Prize twice, and received five GRAMMY nominations. In his biography he is described by others as “America’s great musical poet” and “one of America’s most distinguished creative artists in any field”. Both seem like fitting titles if you ask me.

Built by Macrura, this responsive site makes use of large photographs, and feels at the same time modern and timeless. The amount of content on the site is pretty amazing: in addition to carousels, slideouts, feeds, and music players there are also news items with tagging support, events with filtering tools, complex tables of data, and more.

Suffice to say, this site is pretty complex and there's a lot going on behind the scenes. If you're interested in hearing more about how some of the more complex features were built, how everything was optimized for greatly improved load times, which modules were used and so on, check out this showcase forum thread.

Big thanks to Macrura for sharing this project with us – and especially for sharing some of your experiences about what had to be done to make it perform well. Your insights will no doubt one day be useful to others, so.. thank you, sir!

Stay tuned for our next issue

That's it for the 128th issue of ProcessWire Weekly. We'll be back with more news, updates, and content Saturday, 29th of October. As always, ProcessWire newsletter subscribers will get our updates a few days later.

Thanks for staying with us, once again. Hope you've had a great and productive week, and don't forget to check out the ProcessWire forums for more interesting topics. Until next week, happy hacking with ProcessWire!

Post a comment