Subscribe2 HTML v11.4

Version 11.4 of the Subscribe2 HTML has been released and is available now. This version has been tested on WordPress 4.9.x and 5.0.x. It requires at least WordPress 3.3.

Current users of Subscribe2 HTML with an active support and upgrade subscription can upgrade using the WordPress plugin admin page.

Version 11.4 contains the enhancements and bug fixes listed below.

  • Fixed a bug in barred domain checking
  • Fixed bugs in implementation of Invisible ReCaptcha
  • Implemented V3 ReCaptcha
  • Cache ReCaptcha response to account for multiple forms on a single web page
  • Migrate email override meta box to a sidebar for the ‘Gutenberg’ block editor
  • Migrate email preview meta box to a sidebar for the ‘Gutenberg’ block editor
  • Moved new Block Editor code to separate class
  • Eslinted all javascript files
  • Fixed an issue with javascript IP updating linked to widget form name
  • Fixed issue in transition of wrap parameter in the new Block when changing to and from the shortcode block
  • Updated to latest PHP Code sniff standards and cleansed files
  • Other minor bug fixes and enhancements

Gutenberg and the Override Checkbox

For a very long time that has been a check box available in the editor that allows the email notification from Subscribe2 HTML to be suppressed on a per post level. WordPress calls this box a `meta box`.

tl:dr; – The Override checkbox needs updating for the new `Gutenberg` editor – where should it go?

With the new editor (code named Gutenberg), these meta boxes are supported but conversion to new code is highly recommended (although not well documented!).

So, I’ve been looking at how to migrate to new code, particularly because if the current checkbox is ticked and the post then immediately published, the email goes out due to the order in which processes are triggered in WordPress and Subscribe2 HTML (a work around for now is to ensure you save the post before clicking the Publish button).

The possible locations for the checkbox are a `Block` or a `Sidebar menu`, and there are drawbacks to both over the current position.

With a Block you have to manually add it to a post and then check the box. Also, blocks are intended more to reflect the content of a post, but it does work this way. It would look like this:

The other option is a sidebar menu, this seems a more sensible place to put the checkbox. The drawback is that design decisions in Gutenberg mean that the sidebar can be ‘unpinned’ which remove the email icon from the top row. You then have to know to restore it using the sidebar more menu. This is how it would look:

And the Plugins section in this menu would be unticked and need clicking to restore the item after being unpinned.

So, the main reasons for this post, were do you think the override should go in the next release of Subscribe2 HTML? And thanks for reading this far 🙂

WordPress 5.0 and Subscribe2 HTML

I’m sure you’ve all noticed in your WordPress admin areas that WordPress 5.0 has been released. As far as I can tell the current version (11.3) of Subscribe2 HTML works just fine in the new version.

You may have also noticed that WordPress 5.0 seems to be one of the most controversial and divisive versions of WordPress in many years, the new Editor seems to be loved or hated with few taking the middle ground. As such a Classic Editor plugin has been made available with WordPress 5.0 to restore the old editor look. Again, Subscribe2 HTML works just fine with this too.

Finally, some are very upset with the direction of WordPress 5.0 and they have forked the code and created ClassicPress. While this code is still reported as being in beta testing it seems to be a clone of WordPress 4.9.8. And yes, you’ve already guessed, Subscribe2 HTML works just fine here as well.

Subscribe2 HTML remains fully supported on WordPress and I’ll aim to keep it working in ClassicPress now too. 👍

Subscribe2 HTML v11.3

Version 11.3 of the Subscribe2 HTML has been released and is available now. This version has been tested on WordPress 4.9.x and 5.0 betas. It requires at least WordPress 3.3.

Current users of Subscribe2 HTML with an active support and upgrade subscription can upgrade using the WordPress plugin admin page.

Version 11.3 contains the enhancements and bug fixes listed below.

  • Fixed error message in older version of WordPress where get_user_locale() function is not available
  • Add additional Unsubscribe email headers when {UNSUBLINK} keyword is used
  • Fixed warning message on Your Subscriptions page
  • Added option to hide V2 ReCaptcha box until text box is clicked
  • Improve ReCaptcha form insertion when above buttons to ensure valid HTML
  • Added noscript tags to ReCaptcha form insertion for browsers that have disabled or have no support for JavaScript
  • Fixed issue with transformation of Gutenberg text box size at default value
  • Extended ‘s2_form’ filter to include shortcode attributes to allow more accurate filtering
  • Extended Widget to pass attribute to indicate Widget use over standard form use
  • Extended ReCpatcha ‘s2_captcha_element’ filter to pass shortcode arguments
  • Fix some notices generated by undefined variables
  • Implement use of WordPress filesystem API
  • Ensure Editor buttons loads when Classic Editor plugin in use with WordPress 5.0
  • Numerous minor code enhancements and fixes

Subscribe2 HTML v11.2

Version 11.2 of the Subscribe2 HTML has been released and is available now. This version has been tested on WordPress 4.9.x. It requires at least WordPress 3.3.

Current users of Subscribe2 HTML with an active support and upgrade subscription can upgrade using the WordPress plugin admin page.

Version 11.2 contains the enhancements and bug fixes listed below.

  • Dropped use of the ‘Precedence’ email header as use is controversial and not widely supported
  • Fix for date appearing in wrong language when authors use different language in WordPress admin to the main site language – thanks to Henk Barreveld
  • Improve barred domains to specifically allow domains – thanks to Ed Zacchini
  • Gutenberg block updated based on changes to the editor
  • Fixed issue that prevented post autosaves in Gutenberg editor
  • Further Coding Standard improvements

Subscribe2 HTML v11.1

Version 11.1 of the Subscribe2 HTML has been released and is available now. This version has been tested on WordPress 4.9.x. It requires at least WordPress 3.3.

Current users of Subscribe2 HTML with an active support and upgrade subscription can upgrade using the WordPress plugin admin page.

Version 11.1 contains the enhancements and bug fixes listed below.

  • Introduces Gutenberg block for those testing the Gutenberg editor
  • Fixed incorrectly labelled string for translation
  • Improve REGEX for the old Subscribe2 token – props @pik256
  • Load external javascripts asynchronously
  • Improve Bulk Management user experience
  • Allow Bulk Management for selected subscribers in Multisite installs
  • Move Display options for Subscriber page to screen option
  • Fixed error messages when using ‘s2_custom_keyword’ hook in digest mode – thanks to Bryan Fogarty
  • Fixed filter reset issue in Subscribers table when sorting by column
  • Added option to move ReCaptcha above the form submit buttons – props Daniel Allen
  • Improvements to the ReCaptcha code
  • Code layout and readability improvements with WordPress Coding Standards
  • Other minor big fixes

Subscribe2 HTML and Gutenberg

tl;dr
The next version of Subscribe2 HTML is coming with a ‘block’ that will work with the Gutenberg editor project. There may be some useful information below for other plugin developers too.


Back in 2017 the team behind WordPress decided to spend some time developing the editor, noting that it had remained pretty much unchanged for several years while other areas of WordPress developed at a pace, it was deemed in need of some tender loving care. The project was dubbed Gutenberg.

I have been spending some time testing Gutenberg to ensure that Subscribe2 HTML will continue to function when the planned release of WordPress 5.0 (no date for the yet) lands in your update page. The good news is, to date I have not noticed any differences in the way WordPress and Subscribe2 HTML work together despite the massive code differences in the editor background and the significant visual changes you’ll see in the editor.

In the next version of Subscribe2 HTML you will get a Gutenberg ‘block’. The ‘block’ is fundamental to the design and functionality of the Gutenberg editor. And Subscribe2 HTML now has a block to insert the Subscribe2 HTML shortcode and configure parameters from in the editor.

One of the biggest struggles I have was ensuring international users are able to translate the ‘block’ code into their language. The Gutenberg approach is to create a POT file from the Javascript code, convert that to a PHP file and then create a global POT file. The seemed like too many steps to me and also needs the use of a Babel plugin (if this is losing you, well it lost me too!).

I therefore wrote a little more PHP to parse through the Javascript block I wrote to expose all of the i18n strings to a PHP file that then get pulled into the normal POT file. My parsing code, should any other plugin developers find it useful is on GitHub.

You can call the script from the command line:
php -f ./pot-helper.php textdomain output-file.php input-file1.js input-file2.js

Or call it using grunt by including grunt-shell in your package.json file and adding the necessary configuration in your Gruntfile.js.