Speed up reviews with autocomplete snippets

When reviewing themes for the WordPress.org theme directory, you will find that there are mistakes that are more common than others. This means that we often use the same type of messages in different tickets and reviews.

We can use this fact to make our reviews faster. I have done so many reviews that many of the texts are in my muscle memory, but I still save some of my reviews with the purpose of being able to copy paste them into other reviews later.

But we can improve on this further by using the code editor of our choice to add the most common texts for us.

I use VS code, and I followed these instructions to create my own review specific snippets:

In VS Code, go to File, Preferences, and select user Snippets

Now you can choose to create a snippet for a specific language, or a global snippet file. I write my reviews in a simple .txt file so I created a global file.

Documentation for how to create a new snippet is included in the file header of the new file, which made it very easy.

Place your global snippets here.
Each snippet is defined under a snippet name and has a scope, prefix, body and description. 
Add comma separated ids of the languages where the snippet is applicable in the scope field. 
If scope is left empty or omitted, the snippet gets applied to all languages. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. 
Possible variables are: 
$1, $2 for tab stops, $0 for the final cursor position, 
and ${1:label}, ${2:another} for placeholders. 
Placeholders with the same ids are connected.
Example:
"Print to console": {
	"scope": "javascript,typescript",
 	"prefix": "log",
 	"body": [
 		"console.log('$1');",
 		"$2"
 	],
 	"description": "Log output to console"
 }

I decided not to use a scope, here is an example of one of my custom snippets:

"Missing license": {
	"prefix": "missing license",
	"body": [
	"Themes are required to be 100% GPL compatible.",
	"Reviewers can not confirm that a theme is GPL compatible unless all the license information is included in the theme.",
	"Missing license information for:",
	"(Placeholder: include additional information like a script name or image used in screenshot)",
        "$0",
	],
	"description": "Missing license information for included assets."
},

So when I write my review, all I need to do to add the information about the missing license is to start typing “license” or “missing” and press enter.

Here is the first iteration of the file: Download.

Cherish 1.5

Version 1.5 contains some bug fixes that I missed in the latest major update. When I added the font family option, I forgot to also add the font names to the block editor and the WooCommerce pages. *blush*

There was also a bug where the larger menu covered the page titles of the 404 page and author archive. This has been fixed in 1.5.

I created a new setup help page for the theme:

== Changelog ==

=1.5 2019-01-11=

  • Code style changes to better comply with WordPress coding standards.
  • Improved escaping.
  • Added a setup help page.
  • Added a social menu.
  • Fixed an issue where the titles did not show for author archives and 404 pages.
  • Increased the size of the avatar on the author archive.
  • Fixed an issue where the editor would not show the correct font for the title.
  • Fixed an issue where hiding the site title would also hide the Call to Action.
  • Changed the description of the widget areas, since they are shown on all pages, not only the frontpage, oops :P.
  • Changes related to WooCommerce:
    • Increased color contrasts, increased the size of some input fields and font sizes, added underlines to some links to improve accessibility.
    • Adjusted the width of the product page.
    • Changed the number of products per row from 4 to 3.
    • Fixed a problem where the selected font did not display correctly on shop and product pages.

Musik 1.9

In version 1.9 of Musik, I wanted to optimize the theme to make it faster. I also wanted to make the theme more accessible.

-It is always a bit scary to update old themes, because I do not want to break any child themes or existing sites.

For those who are using a child theme together with Musik, note that the markup for the header and the main navigation has been updated. The code for the header image has also been moved from index.php to header.php.

  • Updated readme.txt file. Updated outdated links. Improved documentation.
  • Reduced background image size and file size.
  • Fixed a problem with the select list text color.
  • Updated navigation.js so that jQuery is no longer needed.
  • Moved WooCommerce styles to a separate file and made sure the file only loads if WooCommerce is active.
  • Added support for header video (requires WordPress 4.7 or later).
  • Added a social menu, and options to select where to display it.
  • Added a skip link focus fix for IE11.
  • Added rtl styles.
  • Improved comment area styles for smaller screens.
  • Added styles and fonts for the block editor so that the editor better matches the front.
  • Updated author.php using get_the_author_meta.
  • Changes to better comply with accessibility requirements:
    • Added underline to content links.
    • Increased color contrast, some font sizes and line heights.
    • Reduced the number of colors used.
    • Made sure that there is one H1 heading on all pages, and that heading levels are not skipped.