What Will 2019 Bring For Gutenberg in WordPress

GutenbergBack towards the end of last year, I did a few posts on Gutenberg for WordPress. Since then there’s been a bit more clarity around what 2019 will bring for Gutenberg in WordPress.

A post on the Make WordPress blog explains how phase 2 will be about introducing Gutenberg to the Customizer:

Gutenberg phase 1 and 2

This means that the sidebar, widgets, and menus will all be moved to Gutenberg.

Assurances that the Classic Editor will be supported until 31st December 2021 are largely worthless, as Gutenberg will be rolling out into Customizer in 2019 and this will fundamentally change WordPress.

Themes already need to be updated for Gutenberg as a post editor; entire new themes, or huge rewrites, will be required when the Customizer changes.

WordPress/ClassicPress Plugin Development: Checking If Function Exists In Namespace

WordPress PluginI’ve been developing my own plugins for WordPress and, more reently, ClassicPress. At times it’s been necessary to check if a function exists.

It’s fairly straightforward to do this check:

if (!function_exists('azrcrv_get_breadrumbs')){
	// code here
}

I also use a few plugins developed by other people. One of the ones I’ve been reviewing recently is Estimated Read Time by CodePotent.

John uses namespaces in his plugins which means the check also needs to include the namespace. You can check for this using the following syntax (the highlighted section is the namespace defined in the plugin):

if (function_exists('CodePotent\EstimatedReadTime\process_shortcode')){
	// code here
}

I’m posting this as a reminder to myself as it took me a few minutes of searching before I found the right answer.

Is Newspack The Reason for Gutenberg in WordPress?

WordPressAutomattic/Wordpress.com have just announced Newspack by WordPress.com – A New Publishing Solution for News Organizations.

Newspack by WordPress.com is a new platform aimed at small and medium-sized news organisations, receiving a total of $2.4m funding, with half of that from from Google. Other contributors include The Lenfest Institute for Journalism, ConsenSys and The John S. and James L. Knight Foundation.

Google have a post on how a new publishing platform can help local news. I do wonder about the intentions behind this, as Google have a history of opposition from news organisations around the world who don’t like the aggregation which Google does.

Continue reading “Is Newspack The Reason for Gutenberg in WordPress?”

GitHub Announces New Unlimited Repos & Unitifed Enterprise Offering

GitHubI’ve recently been taking a look at ClassicPress and one of the subjects that came up was that it might, for the plugin directory, use GutHub instead of SVN like WordPress.

I create an account and started looking into creating repositories for my plugins. Hot all of my plugins are on that site however, as not all have been released to the public. Some of them are only going to be usable to me (for example plugins drive both the GP Table Reference and my distilleries website) and you were limited on GitHub to a certain number of private repositories.

However, GitHub yesterday announced the following:

  • GitHub Free now includes unlimited private repositories. For the first time, developers can use GitHub for their private projects with up to three collaborators per repository for free. Many developers want to use private repos to apply for a job, work on a side project, or try something out in private before releasing it publicly. Starting today, those scenarios, and many more, are possible on GitHub at no cost. Public repositories are still free (of course–no changes there) and include unlimited collaborators.
  • GitHub Enterprise is the new unified product for Enterprise Cloud (formerly GitHub Business Cloud) and Enterprise Server (formerly GitHub Enterprise). Organizations that want the flexibility to use GitHub in a cloud or self-hosted configuration can now access both at one per-seat price. And with GitHub Connect, these products can be securely linked, providing a hybrid option so developers can work seamlessly across both environments.

The second point isn’t relevant to me, but the first might be useful as it will allow me to store both my public and private plugins in the same place.

More details are available from the GitHub blog.

Before Upgrading to WordPress 5 And Gutenberg

GutenbergWordPress 5 with Gutenberg is due for release tomorrow on 6th December 2018. While many people, on WordPress.com and other hosted WordPress providers, will not have a say about upgrading, they can mitigate the effects somewhat by installing the Classic Editor:

Classic Editor Plugin

For those with control over their sites, you can choose to upgrade to WordPress 5 or not (some postings by Matt Mullenweg had suggested that upgrading would happen automatically, but a few posts have been made clarifying that this would not happen).

Much of the community is recommending holding off upgrading until 5.0.1 at the earliest and I strongly agree with this sentiment.

Any upgrade you do, should be on a staging environment first so that you can test to verify that your theme and plugins will all work correctly after the upgrade to WordPress 5.

Whenever you do upgrade your live website, I would recommend having a complete website upgrade (database and files), so that you can roll back if necessary, and test immediately after the upgrade has completed.

What If Gutenberg for WordPress Doesn’t Work For Me?

GutenbergGutenberg is coming. Gutenberg is included in WordPress 5 which is slated for release on 6th December 2018. This is avoidable in the short term, by preventing WordPress upgrading or by upgrading and then installing the Classic Editor plugin, but this plugin has been announced as only supported until 31stDecember 2021. After this the Classic Editor will no longer be supported.

At this point you either need to switch to Gutenberg or find an alternative to WordPress.

That alternative might be another CMS, another blogging platform, or a WordPress fork.

I mention that last as a new WordPress fork called ClassicPress has been announced which I’ve been looking into and I think it has possibilities. I’ll have more posts soon on ClassicPress as I continue my investigation.

WordPress 5 With Gutenberg Releases Thursday 6th December 2018

WordPressAfter pushing back the release date of WordPress 5 from 27th November to an unannounced date, the new release date has, early hours of today, been announced as Thursday 6th December 2018.

This is a very soon date which gives people little time to plan.

From feedback on the announcement page, it appears the majority think the date is driven by the WordCamp US conference. An event should never be the driver for software release; the driver should be that the software is ready and Gutenberg appears not to be ready.

You can edit your wp-config file to prevent an upgrade (if you host your own site) or can install the Classic Editor to get the old functionality back.

What Happens To My Existing Posts When I Upgrade Gutenberg for WordPress?

GutenbergUpgrading to Gutenberg is not necessarily a choice that users of WordPress will make for themselves. If you’re hosted on WordPress.com or deployed your site via a web host, you will have little to zero say about when you upgrade.

Your existing posts will be editable via Gutenberg, and will show with the entire post in a single block; be very cautious about allowing Gutenberg to migrate them to blocks, as in my testing I have found this usually corrupts the post (this may be due to how I’ve created my posts, but the conversion appears to hate any styling.

You can revert to the standard experience, by installing the Classic Editor, but any migrated posts will remain changed. The Classic Editor will remain available via a plugin, but it has already been announced that it will only be supported until 31stDecember 2021. After this the Classic Editor will no longer be supported.

What Are Gutenberg for WordPress Blocks?

GutenbergIn the last post, I mentioned blocks a fair bit, but maybe didn’t explain blocks well enough. WordPress has an FAQ which describes blocks:

What are “blocks” and why are we using them?
The current WordPress editor is an open text window–it’s always been a wonderful blank canvas for writing, but when it comes to building posts and pages with images, multimedia, embedded content from social media, polls, and other elements, it required a mix of different approaches that were not always intuitive:

  • Media library/HTML for images, multimedia and approved files.
  • Pasted links for embeds.
  • Shortcodes for specialized assets from plugins.
  • Featured images for the image at the top of a post or page.
  • Excerpts for subheadings.
  • Widgets for content on the side of a page.
  • As we thought about these uses and how to make them obvious and consistent, we began to embrace the concept of “blocks.” All of the above items could be blocks: easy to search and understand, and easy to dynamically shift around the page. The block concept is very powerful, and if designed thoughtfully, can offer an outstanding editing and publishing experience.

Basically, every section of a post is a block; headings, paragraphs, images, lists, galleries are all separate blocks. WordPress also recommend that all meta field and shortcodes are upgraded to blocks (this last is more one for plugin developers).

Unfortunately, blocks, unlike current standard plugins, are not created with PHP, but Javascript and a framework such as React JS (which Gutenberg itself uses).

This massively decreases the accessibility of creating extensions for WordPress as PHP is easier to learn than Javascript. Whether you think this is a good or bad thing depends on your view of the world. People often deride PHP, but it has meant a proliferation of plugins available so almost any requirements you might have can be met by an existing plugin. Unfortunately, not all of these plugins are high quality, so some care must be taken with the plugins used.

The bar has been raised for accessibility in that Javascript is harder to learn than PHP, so some of the poorer developers may drop out, but it also means that the slightly better developers will be writing bad Javascript blocks, so the overall quality may not change at all.

What you’re likely to have is less plugins providing blocks.

What is Gutenberg (for WordPress)?

GutenbergDo you use WordPress? Are you Gutenberg ready? Do you know what Gutenberg is?

For many people who would answer yes to the first question, I think there are probably many who would answer the second question I pose above, by asking (my third question) “what is Gutenberg?”

I’ve been aware of Gutenberg for quite a while now, as I am a hobbyist WordPress plugin developer, but it has been down my list of things to deal with.

Unfortunately, while I am still not ready due to other things I need to deal with, it’s time for decisions to be made. “Why?”, you ask; because Gutenberg is almost here.

Ok, time for a definition:

Gutenberg is a take on a new editor for WordPress. It is named after Johannes Gutenberg, who invented a printing press with movable type more than 500 years ago. The current visual editor requires a lot of us to utilize shortcodes and HTML to make things work. Their goal is to make this easier, especially for those just starting with WordPress. – Kinsta.com

This definition is a fairly common one that you will see; stating that Gutenberg is a new editor.

But, this isn’t actually accurate. Gutenberg as an editor, is phase one of the implementation of Gutenberg in WordPress. Introduced initially as a plugin, the description of the plugin starts with this:

Gutenberg is more than an editor. While the editor is the focus right now, the project will ultimately impact the entire publishing experience including customization (the next focus area). – Gutenberg Plugin

When WordPress 5.0 rolls out, it has just hit Release Candidate status, but the release date for the final is now not known, Gutenberg will become the default editor as it is rolled into the core of WordPress and ceases to be a plugin. Gone will be the old editor, unless you choose to install the Classic Editor plugin. This will only buy you a certain amount of time though, as that plugin is only officially supported up to the end of 2021. However, in the three years until then, later phases of Gutenberg will be created and integrated into the core of WordPress which will further change the experience.

And as the statement above shows, it will impact on every aspect of the publishing experience including customisation.

My big issue with Gutenberg (actually I have several), is that it mixes content with structure. In a later post, I’ll expand further on this. I’ll also do some other posts around Gutenberg including on blocks (going to be important) and the actual experience.