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.

Advertisements

Subscribe2 HTML v11.0

Version 11.0 of the Subscribe2 HTML has been released and is available now. This version has been tested on WordPress 4.8.1, 4.8.2, 4.8.3 and 4.9. 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.0 contains the enhancements and bug fixes listed below.

  • BIG New Feature – option to add ReCaptcha to the Subscribe2 sign up forms
  • New Feature – REST API class added, disabled by default but there for those that want it
  • Fixed SQL error on Uninstalling that results in failure to drop plugin tables – thanks to SemperPlugins
  • Updated to current version of Plugin update checking code
  • Fixed a PHP Warning notice for PHP 7.0 and above
  • Fixed undefined variable PHP warning in Digest email function
  • Improve HTML character decoding for plain text emails
  • Change input type from ‘text’ to ’email’ on the subscribe form – will improve keyboard layout on mobile device
  • Fix for apparent failure when Toggling Public Subscribers in the admin area caused by JavaScript suppressing page reload
  • Minor code layout corrections consistent with WordPress Coding Standards
  • Abstracted and improved upon the WordPress core email validation function
  • Fixed bug affecting display of Registered Users when using WordPress multisite – thanks to @theinich
  • Ensure Content Type is explicitly set for all HTML and Plain Text emails
  • Other minor bug fixes and improvements
  • Tested on WordPress 4.8.1, 4.8.2, 4.8.3 and 4.9 (Betas, Release Candidates and Final Release)

Subscribe2 HTML v10.15

Version 10.15 of the Subscribe2 HTML was released about four weeks ago and is available now. This version has been tested on WordPress 4.7.4 and 4.7.5 and 4.8. 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 10.15 contains the enhancements and bug fixes listed below.

  • Introduced a more robust way of collecting remote IP addresses for logging subscription requests in PHP4
  • Introduced a method for updating for IP address using client side javascript – useful when site pages are cached
  • Improved Accessibility for Subscribe2 menus in keeping with planned changes for WordPress 4.8
  • Dropped legacy use of screen icons for admin pages to allowed continued compatibility with older WordPress versions
  • Correct capitalisation of the Return-Path email header – props Kyle Johnson
  • Introduced a feature to allow preview email to be sent while editing content, even in draft status – suggested by silverback
  • Other minor bug fixes and enhancements
  • Tested on WordPress 4.7.4, 4.7.5 and 4.8

Subscribe2 HTML v10.14

Version 10.14 of the Subscribe2 HTML was released about four weeks ago and is available now. This version has been tested on WordPress 4.7.2 and 4.7.3. 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 10.14 contains the enhancements and bug fixes listed below.

  • Fixed display of update messages on the Plugins page
  • Added setting to allow display of Registered Subscriber form on the front end
  • Make ‘Sender’ error notice on Subscribe2->Settings page dismissable
  • Add security measures to AJAX form
  • Further improvements to code layout and file naming using WordPress Code Sniffer Coding Standards
  • Tested on WordPress 4.7.2 and 4.7.3

Subscribe2 HTML v10.13

Version 10.13 of the Subscribe2 HTML was released about two weeks ago and is available now. This version has been tested on WordPress 4.6.1 and 4.7. 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 10.13 contains the enhancements and bug fixes listed below.

  • Abstracted the code for the ‘Your Subscriptions’ page to allow placement elsewhere – props Göran Rudling
  • Improved compatibility and efficiency of CSS embedding functions – thanks to L Sterling
  • Added single and plural alert message when deleting subscribers
  • Fixed file name error with Ajax form JavaScript library
  • Link initiation of plugin to WordPress hook to avoid issues with pluggable.php being called – thanks to @sneezry
  • Updated links to the new plugin website
  • Fixed an SQL bug in the automatic cleaner function for unconfirmed subscription requests
  • Extended use of custom stylesheet filter
  • Improve initialisation of some early filters – thanks to Jeff
  • Ensured central position of the popup AJAX form
  • Add check to fail gracefully when processing a ‘post’ with no category assigned at the time of publication – props @flymike
  • Tested on WordPress 4.7

Subscribe2 HTML v10.12

Version 10.12 of the Subscribe2 HTML was released about two weeks ago and is available now. This version has been tested on WordPress 4.5 and 4.5.1. It requires at least WordPress 3.3.

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

Version 10.12 contains the enhancements and bug fixes listed below.

  • Fixed error message that displays when free version is installed and active alongside Subscribe2 HTML
  • Fixed a bug affecting display of registered subscribed when filtered by category
  • Fixed a ‘Mixed content’ error on Settings page if using SSL / HTTPS connection
  • Updated to latest CSS version of jQueryUI on Settings page
  • Fixed a ‘Mixed content’ error on ajax form if using SSL / HTTPS connection
  • Remove use of get_currentuserinfo() function deprecated in WordPress 4.5  – thanks to Luke Cavanagh
  • Avoid loading jQuery UI libraries and CSS on Settings page for date picker unless it is needed
  • Updated JavaScript files and images to WordPress naming convention
  • Context specific delete warnings for Public and Registered Subscribers
  • Fixed an issue that stopped digest previews sending if the last post used was excluded somehow – thanks to Lori
  • Improve display of upgrade messages for WordPress 4.6

 

Subscribe2 HTML v10.11

Version 10.11 of the Subscribe2 HTML in now available. This version has been tested on WordPress 4.4.2 and 4.5. It requires at least WordPress 3.3.

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

Version 10.11 contains the enhancements and bug fixes listed below.

  • Apply the ‘s2_form’ filter to all aspects of the form including those after erroneous input
  • Ensure license key contains no white space when stored in the database
  • Fix an issue where ‘=’ symbols are inserted into HTML email content for some subscribers – thanks to Jennifer Erdman and Scott Vosburgh
  • Remove use of wp_staticize_emoji() function to stop double encoding emojis
  • Further improvements to code layout using WordPress Code Sniffer Coding Standards
  • Improved {UNSUBLINK} to provide a single click unsubscription function for Registered Subscribers rather than a link to the Your Subscriptions page – links are still available through use of the ‘s2_registered_unsublink_type’ filter
  • Updated Links section in Settings page to point to paid plugin site and support forum
  • Fixed pagination to ensure appropriate next and previous buttons are disabled in WordPress 4.3 and above
  • Updated Widgets to enable Selective Refresh Support in WordPress 4.5 and above
  • Make post ID globally available so it can be accessed by developers via filters such as the ‘s2_custom_keywords’ filter for scheduled posts
  • Removed unnecessary code from update checker class
  • Removed unused parameter from headers() function