Squiz Labs Blog - The latest news from the R&D division of Squiz®

Subscribe to our RSS feeds

Squiz Matrix Newsletter #501

As we near the end of the year, the busy elves here in the Squiz Labs office have been hard at work, crafting up two new releases of Squiz Matrix this week! Versions and are patch releases, each containing a variety of bug fixes, as well as a minor enhancement for our 5.1 release.

Xmas Tree 

Next week will be our last full working week of the year. We'll be releasing our final Matrix releases of the year, versions and on Wednesday, December 17th.

It will also be our last newsletter of the year. As usual, we'll be taking a look back at the year's highlights in our Squiz Labs 2014 retrospective. Be sure to check back next week for that!


This week we have one new feature to report, the ability to clone assets within the Edit+ for Squiz Matrix interface. Continue reading below for more information on all this week's developments.

Edit+ for Squiz Matrix: Clone Asset Tool

Due for release in version (TBA)

Along with moving and link assets, Squiz Matrix's Administration Interface allows users to clone assets, creating a copy of the asset and any of its dependent assets in another area of your system.

Learn more about cloning an asset.

This functionality, however, was not previously available when using the Edit+ for Squiz Matrix editing interface. 

This feature introduces the ability to clone assets within Edit+ via a new Clone Existing Asset button in the Asset Creation Wizard pop-up (accessed when creating a new asset).

The Clone Existing Asset pop-up 

Clicking this button will display the Clone Existing Asset pop-up, allowing you to select the asset you want to clone, enter a name for the cloned asset and specify where in the system you want to create the asset.

When you have configured these settings, clicking the Clone button will create a clone of your asset.

Cloning an asset 

This feature has been added to further enhance the Edit+ for Squiz Matrix interface and the functionality available. 

Squiz Matrix Newsletter #500

Today, we've reached a rather big milestone for the Squiz Matrix Newsletter, our 500th issue!

In order to commemorate this achievement, we've created one of those fancy wall plate things that you always see available at truly momentous occasions. We've tried to maintain the gaudiness extravagance that you often see in these beautiful pieces.

This special Squiz Matrix Newsletter Quincentenary plates are available now, in a strictly limited run of infinite. To order your plate, simply right click on the image below and select Save ;)


If you hover over the plate (and the stars align) you might get another little surprise ... gotta love Grumpy Cat! (If you see nothing, you might need to clear your browser cache).

In all seriousness though, five hundred is a pretty big stack of newsletters, so before we get to this week's features, let's take a look at some fast facts about the history of the Squiz Matrix Newsletter.

Extra! Extra! Read all about it

  • It's been almost exactly ten years ago that we released the first issue of the newsletter, back on December 10th, 2004.
  • The newsletter was originally titled the MySource Matrix Developer Newsletter and used to be sent to subscribers via email.
  • It wasn't until our 280th issue, back in June 2012, that we began posting the newsletters here on the Squiz Labs blog.
  • Four different people have been in charge of writing the newsletter.
  • Over the years we've reported on ... well, we don't know exactly how many features and enhancements we've written up. We'd guess in the thousands ... let's just say 'a lot'.
  • Based on the first release of the newsletter, we should be up to issue #522 this week. So we've misplaced twenty-two issues somewhere... oops.

 If you've just joined us, here's a list of some our more noteworthy newsletters:

Well, enough with all the newsletter talk... we've got a great new features to get to!


This week we have one new feature to report, new Copy/Paste from Word and Drag & Drop Image functionality on the Edit+ WYSIWYG editing area. Continue reading below for more information on all this week's developments. 

Edit+ WYSIWYG: Copy/Paste from Word and Drag & Drop Image

Due for release in version (TBA)

This feature introduces a new extension that will allow you to copy and paste, or drag and drop and image located on your local computer or inside a Word document, into the Edit+ WYSIWYG editing area.

Once an image has been copied into the WYSIWYG, a temporary image preview will be displayed, marked with a dotted blue border, along with the inline Image plugin tool.

Copied image preview

The image preview will maintain the original image's width and height, so that you can visualise how the image will look amongst your content.

The inline Image tool allows users to specify the settings of the image, including its URL and location, before uploading it to your system.

The inline Image plugin tool

One an image has been uploaded, you can click Commit to save your changes on the page. If click Commit before uploading the image you have dropped or copied into your content, Matrix will remind you that you of this and prompt you to upload your image.  

The Drag and Drop Image functionality is currently available on all latest Firefox, Chrome and Safari browsers, as well as IE10 and 11.

The Copy/Paste from Word functionality is available on the latest version of Chrome and IE11. 

PHP_CodeSniffer 2.0.0 released

Nineteen months ago, I started work on a project to allow PHP_CodeSniffer to fix the problems that it finds. Doing this required a lot of changes to the core classes, a lot of iteration and refactoring of the fixing and testing code, and an enormous amount of time and testing across many PHP projects to ensure I am confident enough to release something that actually modifies code. I could keep writing unit tests forever, but I've finally got to a point where I am happy to release this first version of the PHP Code Beautifier and Fixer (PHPCBF), for when you just can't be bothered fixing coding standard errors yourself.

I originally started with a goal of being able to fix the most commonly found errors when checking PHP projects using the PSR2 coding standard, but I expanded that goal to include all coding standards (including custom standards) and supported file types (PHP, JS and CSS). So as of version 2.0.0, when you run PHP_CodeSniffer and get  your standard report of the errors found, you will now be able to see which of those errors can be automatically corrected by PHPCBF. Sample report output can be seen on the wiki: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Fixing-Errors-Automatically

Custom Coding Standards

If you have a custom coding standard that uses the sniffs included with PHP_CodeSniffer, you will find that many of the errors your standard finds are already fixable with PHPCBF. PHP_CodeSniffer comes with just over 600 unique errors and PHPCBF is able to fix just over half of those. The rest of the errors are almost entirely made up of things that cannot be automatically fixed, such as variable names and changes to comparison operators.

If you have your own custom sniffs, you are able to add auto-fixing code to them using the new auto-fixing tools built into PHP_CodeSniffer. You have access to all the normal token-based functions you are used to, as well as some new fixer-specific functions to do things like replacing token content and adding content and newlines to tokens. PHPCBF is also able to group a set of changes so that they are all applied or rejected together, detect sniffs trying to fix the same piece of code in the same run, and detect and resolve conflicting changes that are being applied.

The Diff Report

Along with the new PHPCBF script, PHP_CodeSniffer adds a new report type; the diff report. If you don't like the idea of a script fixing errors automatically, you can instead ask PHP_CodeSniffer to output a diff of the fixes that it would make using the command line argument --report=diff. If you like what you see, you can simply change the phpcs command to phpcbf, leave all the command line options the same, and let PHPCBF patch your files.

More Features

Version 2.0.0 brings a lot more changes that just auto-fixing, including:

View the full 2.0.0 changelog at PEAR or Github

Thank You

So many developers have helped test this auto-fixing code over the last year and half. More than twenty developers have directly contributed code to make the auto-fixing more accurate and more still have reported bugs to help diagnose issues with the fixing.

But I'd like to send special thanks to Alexander Obuhovich (@aik099 on Github and Twitter) for both testing PHPCBF and for being so active on Github issues and PRs, and to the developers working on the WordPress coding standards (https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards) for working with me to find solutions for running and testing complex custom coding standards and for trying out the auto-fixing code in their standard.

Version 1.5.6

I've also released version 1.5.6 today and I'm keeping the 1.5 branch around for a little while longer to make it easier to upgrade to 2.0, especially for developers who need to change custom coding standards. If you have having problems with the 2.0 version, please use 1.5.6 in the meantime.

View the full 1.5.6 changelog at PEAR or Github.

Stay up to date on all PHP_CodeSniffer changes, including new features and releases, by subscribing to the RSS feed or following me on Twitter.

Squiz Matrix Newsletter #499

We released two new micro versions of Squiz Matrix earlier this week, version, containing one minor enhancement and seven bug fixes, and version, containing two minor enhancements and ten bug fixes.

The minor enhancements introduced in this week's releases include our new thumbnail keyword replacements, discussed in last week's newsletter.

Both of these releases are now available.

For more information on all our latest releases, hop on over to the Release Information page on the Squiz Matrix User Manual Library.

This week, we have one minor enhancement to report, a minor enhancement to the Lineages pop-up on an asset. Continue reading below for more information on all this week's developments. 

Lineages Pop-Up to Display Full Path 

When an asset is linked in multiple places within your site, clicking the Show in Asset Map icon on the asset will display the Lineages pop-up, listing the paths of the selected asset.

If these paths are too long, the Lineages pop-up will automatically truncate them, as shown in the image below.

The Lineages pop-up 

This was a minor issue, however, as there was previously no way to full these full asset paths.

This minor enhancement corrects this issue, by modifying the Lineages pop-up so that these truncated paths will display the full asset path when hovered over.

This new enhancement has been included in this week's release of Squiz Matrix, available now.

Squiz Matrix Newsletter #498

Two new releases of Matrix are available this week, version, containing four bug fixes; and version, containing two minor enhancements and nine bug fixes.

Both of these releases are now available.

For more information on all our latest releases, hop on over to the Release Information page on the Squiz Matrix User Manual Library.

This week, we have one minor enhancement to report, new image thumbnail keywords. Continue reading below for more information on all this week's developments.

New Thumbnail Keyword Replacements

Due for release in version (November 24th 2014)

New keyword replacements have been added to retrieve the thumbnail of users who have created, updated, published and/or changed the status of an asset.

The following keywords can now be used within Squiz Matrix: 

  • %asset_created_by_thumbnail%
  • %asset_published_by_thumbnail%
  • %asset_updated_by_thumbnail%
  • %asset_status_changed_by_thumbnail%

These new keywords respect the various permutations of the existing asset_thumbnail keywords. For example, the following keyword replacement will print the thumbnail URL of the user who updated the asset.


These keywords have been added to remedy potential permission issues that were occuring when trying to use the as_asset keyword modifier to retrieve this thumbnail information.

Squiz Labs

R & D division of Squiz Pty Ltd

Open source web experience management solutions

Squiz Labs is the research and development division of Squiz, the company behind the Squiz Suite of web experience management and development tools.

Our PHP and JavaScript developers are responsible for producing innovative enterprise-quality software while our interface designers and testing team ensure our products both look great and are easy to use.