WordPress Development Environment as a Composer Dependancy

Wouldn’t it be awesome to have a virtual WordPress development environment added to any plugin or theme as a Composer dependancy? Today I discovered the Drupal VM project which enables exactly that.

It should be relatively easy to add this kind of support for both VVV and Chassis — it only has to sync the VAGRANT_OLD_ENV_PWD directory to a theme or plugin directory within the WP install.


Never lose a single business lead or enquiry again! Get my latest plugin Storage for Contact Form 7 now!

Buy now for only $19 →

What Is ERR_TOO_MANY_REDIRECTS Error & How To Fix It In WordPress

When running and maintaining a website you will encounter many different types of issues and errors. ERR_TOO_MANY_REDIRECTS is one of the many errors that usually confuses most users. In this post, we take a look at what causes this error and how to fix it. Thankfully, this is quite an easy error to fix. Since you’re using WordPress, you’ll be.... Continue Reading

The post What Is ERR_TOO_MANY_REDIRECTS Error & How To Fix It In WordPress is written by Roshan Perera and appeared first on WPKube.

Gutenstats Blog Is Live, Tracking Gutenberg Beta Testing Data

Matt Mullenweg tweeted out a link to Gutenstats.blog this evening, a new site dedicated to tracking Gutenberg beta testing data. The site shows there are currently more than 420,000 active installations of Gutenberg, a slightly more precise number than reported on the WordPress.org plugin page (400K+).

Gutenstats also tracked 213,000 posts written with the new editor and 8,142 posts written yesterday. These numbers were collected from posts made on WordPress.com and Jetpack sites since late August 2018 and a note on the site says the actual number is higher.

In June, Mullenweg unveiled a roadmap for Gutenberg to land in WordPress 5.0. At that time the plugin was active on just 14,000 sites. He proposed 100K+ sites having made 250K+ posts using Gutenberg as a threshold for adequate pre-5.0 testing.

Gutenstats tracking shows testing has far exceeded the original goal for active installations and should reach the posts written goal in just a few days. Mullenweg said they plan to add some block stats to the tracking page in the future.

Gutenberg is Slowly Rolling Out to WordPress.com Users

As part of the roadmap unveiled at WordCamp EU earlier this year, WordPress.com has started rolling out Gutenberg to a subset of users.

Try Gutenberg Call-out on WordPress.com

According to a WordPress.com Happiness Engineer, the team is testing the implementation to determine the best way and time to enable it. Users will not be able to use Gutenberg unless their theme is updated to support blocks and the various alignment options.

Theme Wranglers are already in the process of adding support to WordPress.com’s nearly 100 free themes.

A quick search of the WordPress.com support forums for Gutenberg provides some insight into what users think about the new editor. For example, this user provided feedback on the use of so many icons without displaying their textual equivalent.

For now, Gutenberg is opt-in but eventually will be opt-out. Once Gutenberg is made available to a wider audience, support documents and official blog posts will be published to inform users about the new editor.

A big shout-out to open source

WordPress is open source. Yoast SEO is open source. At Yoast, we’re open source fanboys (and fangirls). We’ve talked about it, we’ve written about it. And still, lots of people do not know why open source is so unique. Most people do not even know what open source software is or how it’s made. That’s why we’re starting a series of interviews with people that love open source as much as we do. We’ll even search outside of WordPress. Let’s start this series with an interview with our very own Joost de Valk, founder and CEO of Yoast.

Q. Why is open source important to you?
“Open source is important to me because it’s what allowed me to learn how to code. I learned to write code by looking at other people’s code. Another reason why open source is so very important to me is that I have a deep feeling that this is how software should be developed and how knowledge should be shared. This might sound a bit grand, but as human kind, it just doesn’t make sense to develop the same things over and over again.”

Q. In what way do you contribute to open source projects?

I actively contribute to WordPress Core myself. In addition, as a company, we contribute to open source platforms by donating development time, design time, marketing time and money.

Q. Who is your open source hero?

“Jimmy Wales of Wikipedia. He’s a hero because he open sourced Wikimedia, the platform on which Wikipedia is build. In a way – with Wikipedia itself – he actually open sourced all knowledge. That’s just really awesome.”

Q. Do you have to be a developer to be involved with open source?

“No, absolutely not. Every open source project needs copywriters, translators, marketers, designers and project managers in order to succeed. Also, we need people with lots of other skill sets for, for instance, organizing a conference. I think that at Yoast, about half of our contribution is not code.”

Q. When and what was your first open source contribution?

“My first open source contribution was a test case for WebKit, the core of Safari and Chrome. This was at the end of 2005. I’ve written hundreds of test cases for WebKit and I started blogging about that on WordPress.”

Q. Does open source say anything about the quality of a product?

“Open source itself is not a guarantee of quality. There’s good and there’s bad open source software. However, with open source software, you’ll always be able to hire a developer to work on a product, even if a product is abandoned. You’ll never end up with a completely dead product because you can always reach the code. I think that is a major advantage of open source software as compared to closed source software.

Q. How do you learn from open source software?

“Open source code is visible to everybody. Because of that, you can learn from other people’s code. You can see and learn from the solutions of other people. Working on open source projects also means that you can discuss and collaborate with others who are working on the same product.

Even better SEO with Yoast SEO Premium!

  • Optimize your site for the right keywords
  • Never a dead link in your site again
  • Previews for Twitter and Facebook
  • Get suggestions for links as you write
More info

The developers at Yoast learn from each other, but they also learn from all the other developers in the WordPress ecosystem. Because of that, because they learn from so many, different developers, they quickly improve themselves. They become better developers. I really think that people severely underestimate how important this is.”

Who’s next?

Any ideas on whom to interview next? Which open source fanatic should I reach out to? Let me know!

Read more: Why our mission is: SEO for everyone »

The post A big shout-out to open source appeared first on Yoast.

WordPress 4.9.9 Release Focus Items Include Site Health Project and Gutenberg Preparation

The WordPress 4.9.9 release leads published a roadmap for the release this week. The minor release will be led by Anthony Burchell and Alain Schlesser. It is targeted for November 5 with the first beta arriving near the end of October.

The leads identified four key focus areas for the upcoming release: accessibility, internationalization, the Site Health Project, and Gutenberg preparation. The internationalization focus is aimed at improving translations and RTL support, as well as ensuring that date/time values work. The roadmap doesn’t identify any specific accessibility items but Burchell said the leads see lots of ways they can “drastically improve the experience for a lot of people with minimal effort.”

Contributors to the Site Health Project, previously known by the “Servehappy” code name, will be working on resolving issues that will allow users to stay on WordPress 4.9.9 while they prepare for 5.0 and still have access to the important information about how to update their PHP versions.

“It will be crucial to get the Servehappy components included: WSOD protection, update dashboard notice, plugin version requirements,” Burchell said. “The reason for this focus is because, when 5.0 ships, users who decide not to upgrade will be on 4.9.9 for a potentially extended time period. If we don’t have these Servehappy components included in 4.9.9, getting rid of old PHP versions will only happen after 5.0.”

Another major part of WordPress 4.9.9 will be landing items that lay the groundwork for anything necessary for Gutenberg’s merge into 5.0. Two items identified include user locale support in REST API endpoints and endpoints to lock/unlock and release posts.

With an unusually quick turnaround, WordPress 5.0 could arrive before the end of 2018. Development will kick off in mid-November, one week ahead of the U.S. Thanksgiving holiday.

Yoast SEO 8.2: Automatically add structured data with Gutenberg content blocks

While we’re still only at the start of the Gutenberg adventure, we’re presenting an awesome, brand-new feature for the new WordPress editor today. Meet the Yoast SEO structured data content blocks! The content blocks automatically add valid structured data code to the content that is added to these blocks. Our initial line-up consists of How-to and FAQ content blocks, plus address and map blocks for our Local SEO plugins, but we’re looking to add more in the future.

Optimize for synonyms and related keywords and prevent broken pages on your site with Yoast SEO Premium! »

Yoast SEO: the #1 WordPress SEO plugin Info

Adding structured data in Gutenberg

Structured data is important but pretty hard to implement. By adding Schema.org structured data to your pages you can tell search engines exactly what’s on there. For most people implementing it comes down to asking their developer to hard-code it into the site. Or learning to master Google Tag Manager so you can inject the necessary code into your pages — this is what we teach you in our Structured data training. This complexity is one of the reasons structured data has been struggling to reach critical mass, even though Google has been pushing it for years. This is now changing with Gutenberg structured data content blocks in Yoast SEO 8.2!

As of today, we’re adding that structured data metadata automatically to the content that’s added to two new Gutenberg blocks inside Yoast SEO, namely How-to and FAQ. Local SEO and WooCommerce SEO have blocks for addresses and maps. So, if you have an FAQ page on your site you can now build these pages inside Gutenberg. Yoast SEO will automatically add the necessary Question Schema.org to that block. The same goes for How-to. Build your how-to article with the How-to content block in Gutenberg, including all the necessary steps and even images, and see a valid piece of structured data appear in the source of your page. It is now easier than ever for Google to find and understand that particular piece of content. Fantastic, right?

Our CEO Joost de Valk and CTO Omar Reiss explain the how and why of Yoast SEO structured data content blocks in this interview »

How-to structured data

How-to structured data is a fairly new addition to the Schema.org vocabulary. You use it to mark up content that teaches you how to do something following a series of steps. This could be how to cat-proof your apartment or how to install Yoast SEO Premium or something else entirely. We published a post a while back on how to add how-to structured data to your how-to articles. Please read that if you need more background information.

The structured data content blocks come with default styling, but we made it easy for you to change these. Our UX designer Luc wrote a post detailing how you can give the How-to content blocks your own styling so they fit right in with the rest of your site. There will be a post about styling your FAQ content blocks later on.

Using the Gutenberg How-to structured data content blocks is incredibly easy.

  1. Choose the Yoast SEO structured data block for How-to
  2. Type the description for the how-to
  3. Enter the time needed to do the how-to
  4. Fill in the first step title
  5. Fill in supporting text for the step
  6. If necessary, add an image using the Add image button
  7. Hit the Add step button to add a new step
  8. Use the Insert step button to insert a new step between existing steps
  9. Done? Save your draft!

Here’s an example how-to on how to install Yoast SEO Premium:How-to content blockAnd here’s what Google’s Structured Data Testing Tool says of that page:the result in the structured data testing toolEpic, right? Remember, due to restrictions by Google it is not possible to add more than one How-to content block on a page.

Want to dive into the mark-up and styling of our HowTo block? Read this post from our UX designer Luc.

FAQ structured data

If you have a section on your site for frequently asked questions — an FAQ— then you’ll enjoy the new FAQ structured data content block. Schema.org/Question is “A specific question – e.g. from a user seeking answers online, or collected in a Frequently Asked Questions (FAQ) document.” You can now easily add the structured data needed for search engines to understand FAQ content. Just fill in the questions, add the answers and maybe an image if needed. Hit publish and your perfectly structured FAQ block is ready!

Local SEO & WooCommerce SEO with Gutenberg blocks

Of course, we had to give some of our other SEO WordPress plugins some Gutenberg love as well. Do you own a local business or are you doing a lot of local SEO? If so, you need our Local SEO or WooCommerce SEO plugins. These plugins help you to improve your site so it can more easily rank in your local search results.

Today, the two local SEO plugins get structured data content blocks for Gutenberg as well: you can now add valid structured data to your site by adding the new address block. The fields will appear automatically if you’ve filled in the fields in the plugin settings. Of course, you can finetune what you do and don’t want to appear. In addition, you can use the new Google Maps structured data content block to easily add a good looking map with structured data to your site.Address content block

More to come

Gutenberg’s block-based design makes it a very interesting platform to design for. These structured data content blocks are our first tools specifically built for the new WordPress editor. We hope to expand our offering of structured data blocks in the near future. We can’t wait to bring you blocks for job postings, events and recipes, among others! And please, do give us your feedback so we can make these blocks even more awesome.

Polish readability analysis

Yoast SEO 8.2 also brings a new supported language: Polish! We can now analyze text written in Polish and make suggestions to improve the readability. In addition, we will now also suggest articles to link to using our internal linking tool in Yoast SEO Premium. The Polish readability analysis was made possible by contributions from the community. We’re thankful for the great support from the people at Macopedia, who sent us word lists which make a vital part of our analysis. We’re always super enthusiastic when people in the community show us their love for our products and also a commitment to the open source spirit by contributing to our code base!

Bug fixes and enhancements

As always, we’ve fixed a couple of annoying bugs. This time we focused on fixing bugs related to slugs, user input incorrectly triggering analyses, zooming issues on iPhones and several others. You can read up on them in the changelog. We do want to thank mt8, who helped us fix a bug related to OpenGraph images that wouldn’t correctly show for the front page in a couple of situations.

Update now!

Yoast SEO 8.2 is a very exciting release. With the launch of the structured data content blocks for Gutenberg, we’re heading into unknown and very exciting territory. We can’t wait to see what you do with the current set of blocks and hope to bring even more blocks to you in the near future. Try it, tell us what you think and enjoy using Yoast SEO 8.2!

Read more: Why you should buy Yoast SEO »

The post Yoast SEO 8.2: Automatically add structured data with Gutenberg content blocks appeared first on Yoast.

Activate WordPress Plugins via the Database

Recently a reader named Chris asked, “how can we turn ON a plugin from the database?” He mentioned reading my previous article, Quickly Disable or Enable All WordPress Plugins via the Database, but for circumstantial slash technical reasons needed to do the opposite and enable a plugin directly via the WordPress database. I thought it was an interesting question that might actually be useful to discuss here at Perishable Press.

Disclaimer

This tutorial explains how to enable plugins via the database, but it is not recommended that you do it on any live/production site. The technique is meant for experimenting and/or maybe if there is an emergency situation like getting hacked or whatever. The best and recommended way to enable plugins is via the Plugins screen in the WP Admin Area. If you activate plugins any other way, they may not function properly.

First: Understand

Before even touching your database, it is important to understand what you are doing. That way you are prepared if anything unexpected happens. Also, if the database contains any important data, it is recommended that you make good working backups, again, just in case.

For this tutorial, we are going to modify an option in the WordPress options table. The option name is active_plugins, and the value is a serialized array that contains information about which plugins currently are active.

By modifying the serialized active_plugins array, we can specify exactly which plugins are active. So that’s the basic idea, now let’s zoom in and see how it’s done. First we’ll walk through the process in general, and then later we’ll look at a specific example.

General technique

To activate any installed plugin, follow these steps:

Step 1: Copy the active_plugins array

Using a tool such as phpMyAdmin, enter the following SQL command:

SELECT * FROM wp_options WHERE option_name = 'active_plugins'

Remember to edit the default table prefix, wp_, to match your own configuration. After executing the query, copy the value of the active_plugins option. Depending on how many plugins you have, the copied value should look something like this:

a:10:{i:0;s:19:"akismet/akismet.php";i:3;s:45:"dashboard-widgets-suite/dashboard-widgets.php";i:4;s:33:"disable-embeds/disable-embeds.php";i:5;s:33:"disable-emojis/disable-emojis.php";i:6;s:43:"disable-wp-rest-api/disable-wp-rest-api.php";i:7;s:36:"google-sitemap-generator/sitemap.php";i:8;s:37:"simple-ajax-chat/simple-ajax-chat.php";i:9;s:45:"simple-local-avatars/simple-local-avatars.php";i:10;s:27:"updraftplus/updraftplus.php";i:11;s:45:"user-submitted-posts/user-submitted-posts.php";}

If that looks strange to you, join the club. But guess what, it’s just an ordinary serialized array. For this particular site, the array shows that there are 10 plugins currently active. We want to add another, so there will be a total of 11 active plugins.

Step 2: Unfold the active_plugins array

Next we want to “unfold” the active_plugins array, so that it looks like something like this:

a:10:{
	i:0;s:19:"akismet/akismet.php";
	i:1;s:45:"dashboard-widgets-suite/dashboard-widgets.php";
	i:2;s:33:"disable-embeds/disable-embeds.php";
	i:3;s:33:"disable-emojis/disable-emojis.php";
	i:4;s:43:"disable-wp-rest-api/disable-wp-rest-api.php";
	i:5;s:36:"google-sitemap-generator/sitemap.php";
	i:6;s:37:"simple-ajax-chat/simple-ajax-chat.php";
	i:7;s:45:"simple-local-avatars/simple-local-avatars.php";
	i:8;s:27:"updraftplus/updraftplus.php";
	i:9;s:45:"user-submitted-posts/user-submitted-posts.php";
}

Now things are beginning to make sense. Notice each item in the array represents one active plugin. For each item, the array index is denoted by i:n;, where n is some unique integer. Similarly, the array value begins with s:x:, where x is the number of characters contained in the quoted value, for example:

i:9;s:45:"user-submitted-posts/user-submitted-posts.php";

This is the last item in the array. It has an index of 9, and a string s value that is 45 characters in length: user-submitted-posts/user-submitted-posts.php. So one of the active plugins is User Submitted Posts.

Step 3: Add another plugin to the array

At this point, we want to add another plugin to the active_plugins array. To do so, we first prepare an array item, for example:

i:10;s:33:"my-plugin-name/my-plugin-name.php";

Here we have increased the index by 1, so we now have i:10;. And then for the value, we counted the number of characters in our plugin “slug”, which is the name of the plugin directory followed by a forward slash and the name of the main plugin file.

After preparing the array item, we want to add it to the array like so:

a:10:{
	i:0;s:19:"akismet/akismet.php";
	i:1;s:45:"dashboard-widgets-suite/dashboard-widgets.php";
	i:2;s:33:"disable-embeds/disable-embeds.php";
	i:3;s:33:"disable-emojis/disable-emojis.php";
	i:4;s:43:"disable-wp-rest-api/disable-wp-rest-api.php";
	i:5;s:36:"google-sitemap-generator/sitemap.php";
	i:6;s:37:"simple-ajax-chat/simple-ajax-chat.php";
	i:7;s:45:"simple-local-avatars/simple-local-avatars.php";
	i:8;s:27:"updraftplus/updraftplus.php";
	i:9;s:45:"user-submitted-posts/user-submitted-posts.php";
	i:10;s:33:"my-plugin-name/my-plugin-name.php";
}

Notice the index values are all unique and in ascending order. And the values all look good, correct syntax, and so forth. But now that we’ve added another item to the array, the array count a:10 is off by one. So because there now are 11 items in the array, we need to make one more slight modification:

a:11:{
	i:0;s:19:"akismet/akismet.php";
	i:1;s:45:"dashboard-widgets-suite/dashboard-widgets.php";
	i:2;s:33:"disable-embeds/disable-embeds.php";
	i:3;s:33:"disable-emojis/disable-emojis.php";
	i:4;s:43:"disable-wp-rest-api/disable-wp-rest-api.php";
	i:5;s:36:"google-sitemap-generator/sitemap.php";
	i:6;s:37:"simple-ajax-chat/simple-ajax-chat.php";
	i:7;s:45:"simple-local-avatars/simple-local-avatars.php";
	i:8;s:27:"updraftplus/updraftplus.php";
	i:9;s:45:"user-submitted-posts/user-submitted-posts.php";
	i:10;s:33:"my-plugin-name/my-plugin-name.php";
}

Perfect. Now the array is complete, but we still need to remove all of the whitespace that we added when we unfolded the array a few steps ago. The fastest way to remove all spaces is to use a free online tool like this one. After removing all whitespace from our serialized array, we have this:

a:11:{i:0;s:19:"akismet/akismet.php";i:1;s:45:"dashboard-widgets-suite/dashboard-widgets.php";i:2;s:33:"disable-embeds/disable-embeds.php";i:3;s:33:"disable-emojis/disable-emojis.php";i:4;s:43:"disable-wp-rest-api/disable-wp-rest-api.php";i:5;s:36:"google-sitemap-generator/sitemap.php";i:6;s:37:"simple-ajax-chat/simple-ajax-chat.php";i:7;s:45:"simple-local-avatars/simple-local-avatars.php";i:8;s:27:"updraftplus/updraftplus.php";i:9;s:45:"user-submitted-posts/user-submitted-posts.php";i:10;s:33:"my-plugin-name/my-plugin-name.php";}

All packed and ready for the database.

Step 4: Update the active_plugins array

Finally, we can return to the WordPress database and update the active_plugins array with our modified version. After the replacement has been made, we can visit the Plugins screen in the WP Admin Area, where we should see our new plugin active along with the 10 originally active plugins.

Troubleshooting

After updating the active_plugins array, if we find that ZERO plugins are active, then there was a mistake in the serialized array, either syntax, or spelling, or path name, or character count, misplaced or missing colon or semicolon, whatever. Serialized arrays must be exactly perfect or WordPress will empty the array and deactivate all plugins. So if you return to the Plugins screen to find all plugins disabled, or some other unexpected result, try again with the array, making sure that syntax is 100% correct.

Real-world example

Now that we’ve covered how to activate WordPress plugins via the database in general, let’s look at a specific (and quick) example. Let’s say that I want to activate Banhammer on a site that has a couple of other plugins already active. First I copy the value of the active_plugins option from the database:

a:2:{i:0;s:39:"block-bad-queries/block-bad-queries.php";i:1;s:45:"dashboard-widgets-suite/dashboard-widgets.php";}

I then prepare an array item for the Banhammer plugin:

i:2;s:23:"banhammer/banhammer.php";

So here the index 2 is because this will will be the third item in the array (remember array indexing begins at zero). Then for the value, s because the file path is a string that contains 23 characters, hence the 23. Also notice zero white spaces; we’re just going to insert that line directly into the active-plugins array, like so:

a:3:{i:0;s:39:"block-bad-queries/block-bad-queries.php";i:1;s:45:"dashboard-widgets-suite/dashboard-widgets.php";i:2;s:23:"banhammer/banhammer.php";}

Sanity checking everything looks good, I can now replace/update the active_plugins array in the options table. Done. Revisiting the Plugin screen in the WP Admin Area (and I actually did this while writing this tutorial), Banhammer is activated along with the other two plugins. Easy peasy, once you understand how it works.

Busta move

This tutorial shows you how to activate any WordPress plugin via the database. For those not familiar with serialized arrays, the process may seem overly complicated. But in reality, it’s just updating an array in the database. The only tricky part is making sure the syntax and logic is correct for the serialized array.


Dark Mode is Possibly Coming to a WordPress Dashboard Near You

For the past year, Daniel James has been developing the Dark Mode plugin for WordPress. The plugin is actively installed on more than 1K sites. Dark Mode replaces the white and grey colors in the backend with darker colors that are easier on the eyes.

Dark Mode for WordPress

James has published a proposal to merge the plugin into core. There are three things to know about Dark Mode up front. It does not have a high contrast mode to meet accessibility needs, is not a new admin color scheme for the backend, and is not a tool that helps people with vision issues.

By default, WordPress ships with eight admin color schemes. However, color schemes are only applied to the WordPress sidebar and Admin toolbar. Dark Mode is applied to the main content area of the dashboard. This gives users the ability to use Dark Mode and an Admin Color Scheme in tandem. 

Admin Color Schemes

Dark Mode is not compatible with Gutenberg but is compatible with TinyMCE. Because of the speed at which Gutenberg is being developed as a plugin, James decided that a merge proposal without Gutenberg support is the best way forward. Compatibility with Gutenberg will likely arrive once it is merged into core.

Because Dark Mode affects the content area of the WordPress Dashboard, if it’s merged into core, plugins will need to support two different color schemes.

There is no easy way for Dark Mode to support every plugin, especially when many of them use custom user interface elements. This guide on the plugin’s GitHub page explains how developers can add support for Dark Mode.

Proposal Hits a Snag

Within the comments on the proposal, members of the core and accessibility teams weighed in. Gary Pendergast, a WordPress core developer, outlined a list of requirements from the Core Handbook that the plugin has yet to achieve.

James responded by explaining the process of merging a feature plugin into core as outlined in the Core Handbook does not lend itself to all projects.

“For example, weekly meetings, or kick-off posts etc,” James said. “I understand that Gutenberg is probably a top priority right now but it’d be great if I could have some help on what to do to push this forward. I think an introduction of Gutenberg and Dark Mode would be a great addition to shout about in 5.0.”

Some of the Benefits of Dark Mode

One of the obvious benefits is that Dark Mode is aesthetically pleasing, especially after sunset. Depending on the screen technology, darker colors are more energy efficient. It’s also a mode that’s gaining in popularity. For example, earlier this year, Apple announced Dark Mode will be available in macOS Mojave.

I find myself using Dark Mode on Reddit, the Twitter app on my iPhone, and now WordPress. I like to browse the web on my phone while laying in bed and my partner enjoys not seeing a bright screen shining in her direction.

Based on comments made to the proposal and on social media, there is a definitive interest in having a Dark Mode option in WordPress. Is Dark Mode something you’d like to see be part of core? Also, I’m curious as to which Admin Color scheme you use. Please vote in the poll below.

Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.

Google Smart Lock for All

Google Smart Lock is an app for iOS and Android devices that can talk to U2F security keys over bluetooth and NFC. Wouldn’t it be great to use it with the WordPress Two Factor plugin?

Turns out the app registers a custom u2f-google URL protocol with the iOS which can be used by any other app (including the Safari browser) to open the app with the necessary payload for the U2F authentication, which has the following format:

u2f-google://auth?data=PAYLOAD&returnUrl=RETURNURL

where PAYLOAD is a JSON string (urlencoded twice) with the following schema:

{
	"type": "u2f_sign_request",
	"appId": "https://www.gstatic.com/securitykey/origins.json",
	"challenge": "CHALLENGEFROMTHEAPP",
	"registeredKeys": [{
		"version": "U2F_V2",
		"keyHandle": "UNIQUEKEYHANDLE",
		"transports": ["usb"]
	}, {
		"version": "U2F_V2",
		"keyHandle": "UNIQUEKEYHANDLE",
		"transports": ["ble", "usb", "nfc"]
	}],
	"timeoutSeconds": 180,
	"requestId": 123456789,
	"displayIdentifier": "NAME@EXAMPLE.COM"
}

where CHALLENGEFROMTHEAPP is a cryptographic challenge generated by the U2F client (the WordPress plugin) and registeredKeys is a list of all the registered U2F devices with the U2F client (which must include the U2F key to be used over bluetooth).

The app now sends this data to the U2F key via bluetooth which responds with a message that gets added to the RETURNURL as a URL hash RETURNURL#chaldt=PAYLOAD where PAYLOAD is again double-urlencoded and has the following format:

{
	"type": "u2f_sign_response",
	"requestId": 123456789,
	"responseData": {
		"clientData": "CLIENTDATA",
		"signatureData": "SIGNATUREDATA",
		"keyHandle": "KEYHANDLE"
	}
}

where responseData contains the SignResponse object as defined by the FIDO U2F JavaScript API. This data can now be used by the client to verify the signature and complete the authentication.

The Hack

To make the Google Smart Lock app work with the Two Factor plugin, we should adjust the u2f-google link payload with our own data and set the correct returnUrl.

Unfortunately, the Smart Lock app ignores all requests where the returnUrl doesn’t start with https://accounts.google.com/signin which is a real shame because it would allow any site to offer U2F authentication without creating a custom middleware app for talking to U2F keys over bluetooth or NFC.


Use Contact Form 7 to collect business leads and enquiries? I created Storage for Contact Form 7 plugin which stores them safely in WordPress database.

Get it now for only $19 →

Are content blocks the future? And, what’s the benefit for SEO?

In Yoast SEO 8.0 you’ve met with the Yoast SEO Gutenberg sidebar. Since the 8.1 release, you can see the snippet preview in action in this sidebar. These are our first step of integrating Yoast SEO with Gutenberg. But there is more to come. Shortly, we’ll also introduce a whole new concept: Yoast SEO content blocks. In this interview with our CEO Joost and CTO Omar we explore content blocks: What are they? What do they have to do with SEO? And what are Yoast’s plans with blocks? Let’s go! 

Optimize for synonyms and related keywords and prevent broken pages on your site with Yoast SEO Premium! »

Yoast SEO: the #1 WordPress SEO plugin Info

Q. We’ve heard the term content blocks often lately. Can you explain what those blocks are?

Omar: Blocks are single components that you can use in the Gutenberg editor. You can see them as separate content items. With these items you can structure your content and build a page. A bit like you’re building a page with pieces of LEGO. Every content block can have its own styling and meta data. Because of this, a block becomes more valuable and this opens up lots of opportunities, also in terms of SEO.

gutenberg

Creation of content in blocks with Gutenberg

Q. What opportunities of blocks are you referring to?

Omar: For us, the advantage lies mostly in the meta data you can include in a block. You can add structured data to your content block, for instance. With structured data you tell search engines in a schematic way what your content is about: is it a recipe, a book or a film? Structured data exists for many things (entities): products, but also blog posts, Q&A’s or How to‘s. You can find them all on schema.org.

Joost: Let’s say you have a Q&A section on your site. If you add structured data to you Q&A block it’s directly clear to Google that this block provides answers to certain questions and what these questions and answers are. Therefore it’s easier for Google to match them up with a certain query. Because of the structured way it’s set up it’s easier to point to an answer directly, which could be an advantage for voice search as well. Voice search typically works well if it can read out loud one singular answer to a question.

Q. If you have content blocks with structured data, does that increase your chance of ranking?

Joost: We can’t say that it will instantly make you rank higher. It will help Google understand your content better, which is always good and might give you an edge. And, of course, structured data is essential, if you’d like to get rich results in the search engines. We also suspect that if you have a page that is schematically divided into blocks with their own – related – keywords, it might be easier to make your page rank for multiple related keywords too.

Q. Ok, sounds great. But how is this connected to Yoast SEO?

Joost: We’re developing Yoast SEO content blocks with schema.org meta data. Shortly, we’ll launch the first blocks: FAQ blocks and How to blocks. This means you’ll be able to select such a block in the Gutenberg content editor. The block will help you fill out all the necessary data for that specific entity. In case of the How to, for instance, it will have fields for the time it’ll take and steps that are required. And, of course, it will add the applicable structured data to those fields. This ensures your content is offered the best way possible to search engines.

Omar: What’s more, it helps content creators and editors to provide the most complete information in a structured way on their site. Some content creators intuitively add all relevant information in their content, but if you use content blocks with structured data you’re sure you’re adding all necessary information to, for instance, your recipe or job posting.

With the introduction of schema blocks, we’re adding content elements to Yoast SEO for the first time. We’ll make sure those elements are well structured and themable. Our front-end developers and UX-designers are currently working on creating tutorials for theming these blocks. Of course we’ve given these elements basic default styles to make sure they can be used out of the box.

Q. What are your plans with them for Yoast SEO? What kind of blocks are you thinking of?

Omar: We have no restrictions, we’ll try to do as many as possible. In addition to the How to and FAQ block, we’re transforming the widgets and shortcodes in our Local SEO plugin to make them available as blocks too. We’ll work first on blocks which we can dogfood on Yoast.com, like Job posting and Event. After that we’ll just go for the popular ones, like Recipe.

Q. It all sounds amazing, aren’t there any drawbacks as well?

Joost: Blocks are very easy to reuse on different pages. But how will Google deal with that? Will search engines see it as duplicate content? With a single banner or buy button they’ll work it out, but what about reusing the same ‘how to’ on multiple locations on your site? Will Google see that as duplicate content? We’re very curious about that, because it’s not possible to canonicalize a single block yet.

6. Does this concept only exists in WordPress or in other CMS’s too? Will we go to a future where there will only be blocks?

Omar: Some other CMS’s are block based already. But most of them are less intuitive than Gutenberg will be. WordPress needs to make this move as well to be able to compete with website builders. It’s nice to see that Drupal is planning to include Gutenberg in their CMS as well, because they see how promising it is.

Joost: The block philosophy of Gutenberg is just very powerful, as the example above shows. So it’s interesting to see where this will go from here. I don’t believe that the future will only be blocks though, pages will still be a thing!

Read more: What is Gutenberg? »

The post Are content blocks the future? And, what’s the benefit for SEO? appeared first on Yoast.

How to Start a Travel Blog (to Make Money or Otherwise) in 2018

Do you want to start a travel blog but don’t know where to begin? Travel blogs are a popular medium to share your travels with not just family and friends but also with the rest of the world. In this guide, we will walk you through how to properly start a travel blog and even make money from it without any special technical skills.

Starting a travel blog to make money

What do you need to start a travel blog?

There are three things you need to properly start a travel blog.

  • A domain name (this will be your blog’s name that people will type to find your site e.g. wpbeginner.com)
  • Web hosting account (this is where your website files are stored on the internet)
  • Your undivided attention for 30 minutes.

Yes, you can get started with a proper professional-looking travel blog in less than 30 minutes. We will walk you through the process every step of the way.

In this step by step tutorial, we will cover the following items.

  • How to Register a Domain Name for Free
  • How to Choose the Best Web Hosting
  • How to Install WordPress
  • How to Find the Perfect Theme (website design) for a Travel Blog
  • How to Add Content to Your Travel Blog
  • How to Get More Traffic to Your New Blog
  • How to Make Money from Your Travel Blog
  • Resources to Learn WordPress and Grow Your Travel Blog

That being said, let’s get started.

Step 1. Choosing The Right Platform

For most beginners, the biggest mistake is not starting with the right blogging platform. Since you are already here, you will not be making that mistake.

We recommend using WordPress.org. It is the most powerful and popular blogging platform in the world giving you complete freedom to start, grow, and make money from your blog. For more details, see our complete WordPress review.

It is important not to confuse WordPress.org with WordPress.com, as they are two different platforms. WordPress.com is a hosted solution and WordPress.org is a self-hosted platform. For more on this topic, see our comparison of WordPress.com vs WordPress.org.

To start a travel blog with WordPress.org, you will need a domain name and a WordPress hosting account. To learn more, see our article on the difference between domain name and web hosting.

Normally, a domain name costs $14.99 / year and web hosting normally costs $7.99 / month.

That’s a lot for beginners who are just starting their travel blog.

Thankfully, Bluehost has agreed to offer our users a free domain name and discount on web hosting. They are one of the largest hosting companies in the world and officially recommended by WordPress.org.

→ Click Here to Claim This Exclusive Bluehost Offer ←

Basically, you’ll be able to get started for just $2.75 per month.

Bluehost is committed to giving back to the WordPress community since 2005. They have promised us that if you cannot get your blog setup within 30 minutes by following this tutorial, then our expert team will complete the process for you without any cost. They will compensate us, so you don’t have to. Simply contact us for free blog setup help.

Note: At WPBeginner we believe in full transparency. If you sign up with Bluehost using our referral link, then we will earn a small commission at no extra cost to you (in fact you will save money and get a free domain + free SSL). We would get this commission for recommending just about any WordPress hosting company, but we only recommend products that we use personally use and believe will add value to our readers.

That being said, now let’s go ahead and purchase your domain name and hosting for your travel blog.

First, you need to open the Bluehost website in a new browser tab and click on the green get started button.

Get started with Bluehost

Next, you will be asked to select the plan that you want (basic and plus are the most popular among our users).

After that, you will be asked to enter the domain name for your website.

Choose domain name

Tip: Make sure your domain name is easy to pronounce and spell. You can also use keywords that you think people will search when looking for a travel blog. This will help you get more traffic from Google search. For more tips, see our guide on how to choose the best domain name for your blog.

After choosing your domain name click on the next button to continue.

Now, you will need to add your account information and finalize the package information to complete the process. We recommend going with the 36-month plan because that’s the best value.

You will also see some optional extras that you can purchase. We don’t recommend purchasing them right away. You can always add them later on if you decide that you need them.

Finalize package details

After that, you need to enter your payment information and finish the purchase.

Once finished, you will receive an email with details on how to login to your web hosting control panel (cPanel).

Step 2. Installing WordPress

This step is not required as Bluehost will automatically install WordPress on your domain name. You just need to click on the link in the email you received after sign up.

This will take you to your hosting control panel. From here, you can just click on the login to WordPress button to enter your WordPress site’s admin dashboard.

WordPress dashboard

Now you are ready to customize your travel blog’s appearance and start adding content.

Step 3. Choosing a Theme for Your Travel Blog

Travel themes

Themes are one of the best things about WordPress. They control your website’s design and appearance and there are thousands of free and paid WordPress themes to choose from.

WordPress is used by all kind of websites so WordPress themes come with lots of choices. A WordPress theme designed for business websites may not look so great for a travel blog.

You will need a theme that matches the look and feel of a travel blog. The trick here is to strive for simplicity and find the perfect balance between functionality and design.

Need to look at some great examples? See our expert pick of the best WordPress themes for travel blogs.

After you have found a suitable theme, head over to our guide on how to install a WordPress theme for step by step installation instructions.

Step 4. Adding Content to Your New Travel Blog

After you have installed and set up a WordPress theme, the next step is to start adding content. WordPress comes with two default content types, they are called posts and pages. While the posts will be the entries in your travel blog, pages are for adding static content to your website.

We recommend adding the static content first because it helps you build a structure for your website. For example, contact form page, about us page, privacy policy page, and more. See our list of important pages that every WordPress blog should have.

Next, you would want to start adding articles and posts to your travel blog. Go to Posts » Add New page to add your first blog post.

Writing blog posts

You can add any type of content you want. You can write articles, add images, create image galleries, embed videos, audio, and more.

For more details, see our guide on how to add a new blog post in WordPress and utilize all the features.

Step 5. Content Ideas for a Great Travel Blog

Editorial calendar

Your travel blog posts are where you will develop your own voice and engage your audience. They need to be informative, entertaining, and helpful.

You may be able to quickly add first few posts but it will get harder to regularly come up with new ideas for your blog posts. Check out this massive list blog post ideas that are proven to work, and you can easily use them for your travel blog.

We also recommend you to regularly visit popular travel blogs to get inspiration for your own blog post ideas. See what these top blogs are doing and replicate that on your own blog.

We are not advising you to steal or reproduce the same content. You just need to get the ideas, inspiration, and topics and then use them to create unique content with your own voice, style, and flavor.

You will also notice that popular travel blogs publish quite regularly. That’s because maintaining a consistent frequency is the key to successful blogging. You need to stick with a consistent frequency for your artilces. We recommend starting with three articles a week and gradually build up your pace to 5 articles a week.

Step 6. Getting More Traffic to Your Travel Blog

Once you start adding content to your travel blog, the next step is to help users find your website. To do this, you need to do take the following steps.

1. Work on Your Blog’s SEO

SEO

Search engines are the primary source of traffic for most websites and blogs on the internet. They recommend website owners to use certain best practices to increase their site’s visibility in search results. These best practices are called SEO or search engine optimization.

WordPress is very SEO friendly out of the box. However, there is much more that you can do to drive even more traffic to your travel blog. For detailed step by step instructions, follow our ultimate WordPress SEO guide for beginners.

2. Improve Website Speed and Performance

Performance

No one likes a slow website. Your users will leave your website instantly with a bad user experience and you will probably never get them again. It also affects your website’s search rankings as Google considers speed one of the top ranking factors.

You will not to perform certain WordPress performance adjustments to speed up your website. We have a complete guide with step by step instructions to improve your WordPress speed and performance.

3. Track User Statistics

Website analytics

Most beginners use their best guesses to decide what their users will like to read or view. You don’t need to do that when you can get actual data to show you exactly what your users want and do on your website. Using this data you can make informed decisions to plan your content strategy and grow your website.

To get these insights you need to start using Google Analytics. It tells you how many people are visiting your website, what they see, where they come from, and more.

For instructions, see our article on how to install Google Analytics in WordPress for beginners.

Google Analytics offers a ton of data. However, as a beginner, you may not know what to look where and which reports to monitor.

To answer these questions, we have made a beginners guide on how to easily track user engagement in WordPress with Google Analytics.

4. Make a YouTube Channel

Make a YouTube channel

YouTube is not only the world’s largest video sharing website, it is also the world’s second most popular search engine. You can create a YouTube channel for free and start uploading your travel videos, vlogs, and travel tips videos.

Travel channels are huge on YouTube. In fact, there are already travel vloggers on YouTube making six-figure income through sponsorships, advertisements, and brand endorsements.

Even if you don’t want to become a YouTuber, you can still use the platform to drive traffic to your travel blog.

Step 7. Making Money From Your Travel Blog

Ever wondered how these top travel bloggers go to all these exotic locations all over the world. Travelling is quite expensive and some of these travel bloggers do nothing else but travel. How do they make money?

Here we will tell you how other travel blogs make money and how you can do the same with your travel blog.

1. Sponsorships

The traveling perks for most famous travel bloggers are sponsorships. These sponsorships come from hotels, airlines, cruise ships, tour operators, and even government agencies promoting tourism.

Once your blog reaches a decent amount of regular traffic, you can reach out to these organizations on your own. In return for free stuff, they would want you to mention their place or service on your blog.

How do you find out who would be interested in such a deal? See which other companies are already sponsoring other travel bloggers, or randomly try your luck with hotels and airlines for the places you want to visit.

While sponsorship deals will give you some perks, they will not make money for you.

2. Advertisements

Not just travel blogs, but almost all popular blogs on the internet rely on advertisements. The most popular way to display ads on your blog is by using Google AdSense.

It connects bloggers like you to the advertisers looking for a targeted audience. Advertisers pay Google, which pays you after taking a small cut of their own. For details see our article on how to how to add Google AdSense to your WordPress blog.

3. Affiliate Marketing

Affiliate marketing enables you to recommend travel products that you use and love. You get a referral commission when your users purchase a product after clicking on your link.

To make money with affiliate marketing, you will need to find travel products and brands with an affiliate program. These could be backpack manufacturers, adventure cameras, selfie sticks, travel insurance companies, tour companies, and so on.

The biggest affiliate partner you can sign up for is Amazon Affiliates. They have tons of products in travel gadgets, accessories, luggage, bags, clothing, electronics, and more.

Need help getting started? See our beginner’s guide to affiliate marketing with step by step instructions and tools you will need to succeed.

4. YouTube Travel Vlogger

As we have mentioned earlier, YouTube provides lots of opportunities to travel bloggers. Since videos are much more engaging than plain text or even photos, top brands and advertisers are spending big dollars on YouTube promotions and ads.

YouTube runs its own advertising program too which will generate you some revenue. However, it will help you connect with brands and advertisers while getting new subscribers and followers at the same time.

Step 8. Mastering Your WordPress Skills

WordPress is quite easy to use and manage. However, there is a learning curve involved whenever you start with a new platform. You will continue discovering new things to learn. This is where WPBeginner can help.

WPBeginner is the largest WordPress resource site for beginners. We have lots of helpful content which is created specifically for beginners, business owners, and bloggers.

Following are few of the helpful resources you will find on WPBeginner (all of them are completely free).

  • WPBeginner Blog – The central place for all our WordPress tutorials and guides.
  • WPBeginner Dictionary – Our WordPress glossary is the best place to familiarize yourself with the WordPress lingo
  • WPBeginner Videos – New WordPress users can start with these 23 videos to master WordPress.
  • WPBeginner on YouTube – Need more video instructions? Subscribe to our YouTube channel with more than 110,000 subscribers and 10 Million+ views.
  • WPBeginner Blueprint – Check out plugins, tools, and services we use on WPBeginner.
  • WPBeginner Deals – Exclusive discounts on WordPress products and services for WPBeginner users.

Many of our users use Google to find answers on WPBeginner by simply adding ‘wpbeginner’ at the end of their search term.

We hope this article helped you learn how to start a travel blog and make money from it. You may also want to see our list of essential WordPress plugins for new websites.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Start a Travel Blog (to Make Money or Otherwise) in 2018 appeared first on WPBeginner.

X Theme Leftover Code Snippets

While working on the site’s 24th redesign, I ended up with about 10 code snippets that were awesome but ultimately not needed. So rather than just delete them, I am posting them here just in case. Just in case I ever decide to use the functions, and of course just in case the code might be useful to anyone who is looking. Check out the Table of Contents for an overview.

Table of Contents

HTML: Meta Tags

If you examine the source code of the current theme, you will notice that the viewport meta tag is omitted. Why? Because despite convention, the tag is not necessary in all cases. So after a bit of cross-browser testing, the design looked great on mobile devices without the meta viewport tag. And because absolute minimalism is my current thang, omitting meta viewport was a no-brainer. Here are a couple of common examples of this tag:

<meta name="viewport" content="initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1">

CSS: Multimedia Elements

I’ve been including these styles across designs for years now, but never really make use of them. So finally they were omitted from the new Perishable Press theme. If your site makes use of multimedia HTML elements audio, canvas, progress, or svg, these styles apply some basic styling to keep things looking good across browsers.

audio, canvas, progress { display: inline-block; vertical-align: baseline; }
audio:not([controls]) { display: none; height: 0; }
svg:not(:root) { overflow: hidden; }

CSS: Better Image Rendering

In previous designs, I did not hesitate to add as many vendor prefixes as needed to make things awesome. But not in the new design. Instead, I tried extra hard to avoid as many browser-specific properties as possible. For example, in my previous designs, I implemented CSS to improve or enhance image rendering using the image-rendering property. As far as I can tell it does work (kind of) in most cases for most images. But the amount of code required to cover all browsers is kinda nuts. So the following “better image rendering” styles were removed from my CSS palette.

img {
	-ms-interpolation-mode: nearest-neighbor;   /* IE 7+ */ 
	image-rendering: -webkit-optimize-contrast; /* Safari 6 */
	image-rendering: -webkit-crisp-edges;       /* Safari 7+ */
	image-rendering: -moz-crisp-edges;          /* Firefox 3.6+ */
	image-rendering: -o-crisp-edges;            /* Opera 12 */
	image-rendering: pixelated;                 /* Chrome 41+, Opera 26+ */
	}

CSS: Breaking Long Words

Here are two CSS declarations that I used for previous designs. The first declaration “force-breaks” any long lines of text. For example, it’s a good idea to break long words and phrases inside of <table> elements. Otherwise they break out of their table cells, break layout, and decrease readability. The second declaration does the opposite: it tells browsers to not break or wrap long lines of text. For example, when displaying long lines of code inside of <pre> tags, we can display overflow via horizontal scroll instead of breaking or wrapping. Here is more information about wrapping long lines with CSS.

.text-wrap, table td {
     word-wrap:  break-word; 
 -ms-word-break: break-all;
     word-break: break-all;
     word-break: break-word;
-webkit-hyphens: auto;
   -moz-hyphens: auto;
        hyphens: auto;
	}

.text-wrap-none, pre {
     word-wrap:  normal; 
 -ms-word-break: normal;
     word-break: normal;
     word-break: normal;
-webkit-hyphens: none;
   -moz-hyphens: none;
        hyphens: none;
	}

JavaScript: Don’t Append Anchors

Something else I was toying with was disabling the appending of anchors to the URL displayed in the browser address bar. For example, if you click on a link pointing to #somewhere on the same page, the browser will update the address bar by appending the fragment identifier to the URL. So if you are visiting https://example.com/ and click on a link to #hashtag, the browser will display https://example.com/#hashtag. This code snippet disables that automatic updating of the URL when users click any internal #anchor links.

// don't append anchor to url
window.addEventListener('DOMContentLoaded', function(event) {
	var links = document.getElementsByTagName('a');
	for (var i = 0; i < links.length; i++) {
		if (!links[i].hash) continue;
		if (links[i].origin + links[i].pathname != self.location.href) continue;
		(function (anchorPoint) {
			links[i].addEventListener('click', function(e) {
				anchorPoint.scrollIntoView(true);
				event.preventDefault();
			}, false);
		})(document.getElementById(links[i].hash.replace(/#/, '')));
	}
}, false);

WP: Simple Art Directed Content

Art-directed content refers to content, scripts, and styles that are added to individual posts. For example, if you have a magazine-style site, and each post needs to be styled with a unique look and feel. Art-directed styles enable that to happen. I was using an outdated art-directed plugin, but in an effort to simplify my setup, I replaced the plugin with a simple yet effective function:

// simple art directed content
function shapeSpace_art_directed($content) {
	
	$id = get_the_ID();
	$art = get_post_meta($id, 'art_direction_single', true);
	if (!empty($art) && is_singular('post')) $content = $content . $art;
	return $content;
	
}
add_filter('the_content', 'shapeSpace_art_directed');

WP: Remove Empty Paragraphs

WordPress provides pretty solid formatting of markup in post content, but tends to go overboard with the wrapping of HTML comments with paragraph tags <p>. For example, when you have something <!-- like this --> in your post content, WordPress automatically will wrap it with <p> tags. This is frustrating because paragraph tags — even empty ones — usually are styled with some sort of margins or padding. So that means empty paragraphs can introduce unwanted vertical spacing in an otherwise immaculate design.

Making things worse, WordPress adds HTML comments for more tags (excerpts), so you’ve got at least one empty paragraph for each single post. Fortunately it’s possible to clean up any empty paragraphs with the following code snippet. Note that it’s also possible to take care of empty <p> tags using JavaScript or even a bit of CSS.

// remove empty paragraph tags
function shapeSpace_filter_post_content($content) {
	if (is_single()) $content = preg_replace('/<p>s*<!--(.*)-->s*</p>/i', '', $content);
	return $content;
}
add_filter('the_content', 'shapeSpace_filter_post_content');

WP: Set Cookies via Ajax

The new X theme used here at Perishable Press enables the user to switch themes, from the default “light” mode to the dark “night” mode. You can try it by clicking the round icon in the upper-right corner of the page. So if the user switches themes, their choice is remembered via small cookie. At first, I was using the WordPress Ajax API to set the cookie value, but later replaced it with a vanilla JavaScript technique.

// WordPress Ajax Cookies
function shapeSpace_ajax_switch_theme() {
	
	check_ajax_referer('ajax', 'nonce');
	
	if (isset($_POST['theme']) && ($_POST['theme'] === 'dark' || $_POST['theme'] === 'lite')) {
		
		$theme = ($_POST['theme'] === 'dark') ? 'dark' : 'lite';
		$expire = time() + (86400 * 30); // 86400 = 1 day
		$domain = 'perishablepress.com';
		
		// setcookie(name, value, expire, path, domain, secure, httponly)
		setcookie('xtheme', $theme, $expire, '/', $domain, true, true);
		
	}
	
	die();
	
}
add_action('wp_ajax_switch', 'shapeSpace_ajax_switch_theme');
add_action('wp_ajax_nopriv_switch', 'shapeSpace_ajax_switch_theme');

WP: Add Item to Edit Post Rows

Another WordPress code snippet, this one adds a link item to each row on the “Edit Post” screen. The trick here is choosing the right filter hook, which for the Edit Post screen is post_row_actions. Likewise to filter rows on the “Edit Page” screen, we can use page_row_actions. In the following technique, we add a “View HTML” link to each row. Of course, you can tweak the code to add whatever markup/links you want :)

// Add Item to Edit Post Rows
function shapeSpace_modify_list_row_actions($actions, $post) {
	
	// check for CPT and capability if needed, use nonce if needed
	
	$html = isset($actions['view']) ? $actions['view'] : null;
	$html = $html ? str_replace('View', 'HTML', $html)  : null;
	$html = $html ? str_replace('href="', 'target="_blank" title="View HTML of frontend page" href="view-source:', $html) : null;
	$actions = $html ? array_merge($actions, array('html' => $html)) : $actions;
	
	return $actions;
    
}
add_filter('post_row_actions', 'shapeSpace_modify_list_row_actions', 10, 2);
// add_filter('page_row_actions', 'shapeSpace_modify_list_row_actions', 10, 2);

Code Word

That’s all for this post. Thank you for the visit :)


Gutenberg Contributors Considering a “Focus Mode” for Writing

After overwhelming feedback from testers indicating that Gutenberg is not well suited for simply writing posts, the project’s contributors are considering a few options for improving the writing flow. These proposals are spread across several tickets on GitHub.

Two weeks ago, Gutenberg technical lead Matias Ventura submitted a PR exploring the possibility of introducing a “Focus Mode” to the editor. This mode would highlight the current selected block with all other blocks faded while the “fix toolbar to header” option is enabled. The video below shows an example of what that might look like:

“The aim is to provide a writing experience that can satisfy those that would prefer an environment with the least amount of distractions at the expense of tool clarity,” Ventura said. “I’ve been testing this and personally find it a very enjoyable mode to toggle when I just want to write for a bit. Paired with a robust set of keyboard shortcuts it could be quite nice to use. In this sense, it’d be important to provide an easy keyboard shortcut to toggle the mode on and off.”

Automattic designer Kjell Reigstad opened another ticket that proposes transforming the “Fix Toolbar to Top” setting into a “Focus Mode.”

“A key feedback point we hear is that Gutenberg’s interface can be a little overwhelming,” Reigstad said. “This often comes from users who more commonly focus on ‘writing’ versus ‘building’ their posts. They find the contextual block controls and block hover states to be distracting: When they’re focused on writing, they don’t necessarily want to think about blocks — they just want to write.”

Reigstad said this same subset of users also misses having the formatting toolbar at the top of the page, as it is in other applications like Google Docs, MS Word, and WordPress’ classic editor. He proposed a solution that addresses these concerns by combining the “Fix Toolbar to Top” option with the following UI changes that would provide a more complete “Focus Mode:”

  • The block toolbar would be pinned to the top of the screen.
  • The editor would be full screen.
  • Block outlines would be removed for both hover and selected states.
  • The block label would appear on a delay, and be toned down visually.
  • Block mover + block options would also appear on a delay.

Reigstad also created a video demo of this concept:

This new “focus Mode” concept is also compatible with Ventura’s proposal for highlighting the current selected block and fading out the others. It could either be present in both modes or available as an add-on feature.

A couple of well-written reviews on the Gutenberg plugin describe how the concept of blocks complicates the writing experience and how Gutenberg’s current writing environment is visually distracting and disruptive. This has been a major concern since the plugin was first released for testing, as there are many users who depend on WordPress for its writing features more than the page building aspects.

The Gutenberg team’s new ideas go a long way towards decluttering the interface for writers. This is especially important for those who want to do their long-form writing inside WordPress, instead of beginning their work in an application that is dedicated to providing a distraction-free writing experience. Introducing a “focus mode” or “writing mode” will solve one of the most critical issues with the new editor and we’re looking forward to seeing how this develops.

Unused Plugins Closed

I’m happy to say that at this point, all plugins that were approved and never used (that is, never had any code uploaded, ever) have been closed. Roughly 8500 plugins were closed for never having any code committed to them since approval.

In addition, the plugins that have been broken since we migrated to the new plugin backed (April last year) due to incorrect SVN usage have also been closed. They weren’t showing up anyway, so it’s not like anyone could have installed them in the first place.

This means we currently have 700 plugins that have been approved and never used, dating back to April 2017.

Going forward, we’ll be holding any new submissions from developers who have an unused plugin. This means if you submit a plugin and get it approved and immediately turn around and submit a new one, we won’t even review it until you actually use the approved one.

This is not a change to guidelines. We already require you to provide a stable version of your code from our SVN service, so this is simply a means to enforce that guideline. If you have hosting, you’re expected to use it.

How to Fix the 504 Gateway Timeout Error in WordPress

Have you ever gotten a 504 gateway timeout error on your WordPress site? This error can make your website inaccessible to users. What’s worst is that it can disappear and reappear on its own if the underlying issue is not fixed. In this article, we will show you how to fix the 504 gateway timeout error in WordPress.

Fixing 504 gateway timeout error in WordPress

What Causes 504 Gateway Timeout Error?

The 504 gateway timeout error is usually caused when a server is unable to connect to an upstream server to complete a request.

For example, if you are using a website firewall like Sucuri, and it is unable to connect to your WordPress server, then you will see a 504 gateway timeout error.

The error page’s appearance and the message may be displayed differently depending on your WordPress hosting company, the proxy server, or the browser you are using. Following are some of the most common 504 gateway timeout error messages.

  • 504 Gateway Timeout
  • HTTP 504
  • 504 ERROR
  • Gateway Timeout (504)
  • HTTP Error 504 – Gateway Timeout
  • Gateway Timeout Error

504 Gateway timeout error

While the most common reason for the error is a proxy server unable to reach the upstream server, it can also be triggered by other hosting configuration issues.

That being said, let’s see how to easily troubleshoot and fix the 504 gateway timeout error in WordPress.

1. Wait and Reload

Sometimes the 504 gateway timeout error may simply be caused by a temporary glitch on your WordPress hosting servers. Give it a few minutes and then try reloading your website.

If the issue disappears, then you don’t need to take any further steps. However, if the error persists or reappears after a while, then continue reading to troubleshoot and fix the problem.

2. Turn off VPN

Turn off VPN

If you are using a VPN service to browse the web, then try disabling it. Sometimes your VPN server may not be able to get a response from your managed WordPress hosting server, and this will result in 504 gateway timeout error.

If your website reappears, then this means that the VPN server was the culprit. Now if using the VPN is important for you, then you can try switching to a different VPN server. If you are seeing the error even after changing servers, then you would want to contact your VPN service provider for support.

3. Turn off Website Firewall

If you are using a DNS level website firewall like Sucuri or Cloudflare, then try to temporarily disable the firewall. This will allow you to connect to your WordPress hosting server directly.

Sucuri 504 error

If that fixes the issue, then it’s likely that your hosting server is blocking the firewall IP addresses which can cause this issue. You will need to contact your firewall service provider to get their list of IP addresses, and then contact your web host to whitelist those IPs.

Sometimes disabling the firewall might show you the actual server error notice. In that case, you should refer to our list of common WordPress errors to fix the specific issue.

4. Disable Your Network Proxy

If you are connected to the internet through a proxy server, then that server may be unable to get a response from your WordPress website.

Try accessing your website using a different internet connection or use online services to see if your website is down just for you or everyone.

If it is down just for you, then you need to change your network settings. You can contact your internet service provider or a network admin to troubleshoot the issue for you.

5. Change Your DNS Servers

Your internet connection uses something called DNS servers. These servers help your computer connect to the different servers on the internet.

If the DNS servers you are using are down or unable to connect to your website, then you could see a 504 gateway timeout error. The easiest way to check this is by changing the DNS servers your device is using.

On Windows computers, you can find them under Control Panel » Network and Sharing Center screen.

Changing DNS servers in Windows

On Mac computers, you can find them under Settings » Network. Click on the Advanced button, and then select the DNS tab.

DNS settings on Mac

You can change your DNS server address to 8.8.8.8 and 8.8.4.4 and apply changes.

Try visiting your website now. If this solved your error, then you are all done. The problem was with your internet connection, and it is now fixed.

6. Clean up your WordPress Database

A corrupt WordPress database may also trigger a 504 gateway timeout error. Don’t worry, your WordPress data is most likely safe. However, your database may need a little a bit of spring cleaning.

This can be easily done by optimizing your WordPress database using phpMyAdmin or using a plugin like WP-Sweep. Make sure you backup the WordPress database before performing any action.

7. Deactivate WordPress Plugins and Switch to Default Theme

WordPress plugins and themes are less likely to cause a 504 gateway timeout error. However, if a plugin or theme is making too many requests to the server, then it is likely that some of these requests may drop off and trigger a 504 gateway timeout error.

To test this, you need to deactivate all WordPress plugins via FTP.

Deactivate all WordPress plugins

After that, visit your website to see if the error has resolved.

If it is, then one of your plugins was causing the issue. You now need to activate all plugins one by one until you can reproduce the error. This will help you locate the plugin responsible for the error.

If deactivating plugins didn’t solve your issue, then you would want to check your WordPress theme. You will need to switch WordPress theme via phpMyAdmin.

After switching your theme to the default WordPress theme, visit your website to see if it’s working.

8. More Troubleshooting

If all else fails, and you are still unable to solve the 504 gateway timeout error, then follow the steps in our ultimate WordPress troubleshooting guide for beginners.

Finally, as a last resort, you need to reach out to your hosting provider for support. They may be able to fix the issue or point you in the right direction.

We hope this article helped you learn how to fix 504 gateway timeout error in WordPress. You may also want to see our guide on how to protect WordPress against brute force attacks.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Fix the 504 Gateway Timeout Error in WordPress appeared first on WPBeginner.

A Proposal for Improving the Change Block Type User Interface in Gutenberg

In Gutenberg 3.6.2, the development team moved the Convert Block option to the left most icon in the toolbar. As long as the toolbar is visible, so is the option to change block types. However, there are a few user experience issues with this approach.

Convert Block Option

The first is obvious. The paragraph block icon looks like an alignment option. The second issue is that the icon represents the current block being edited, sort of like a block label. Unless a user hovers their cursor over the icon, it’s difficult to realize that it’s for changing block types.

Kevin Hoffman, a WordPress developer and core contributor, has proposed a new user interface suggestion that aims to solve the issues mentioned above.

Suggested Changes by Kevin Hoffman

Hoffman suggests changing the icon to a drop-down menu, similar to the one in the Classic Editor. The menu would make the ability to change block types more discoverable. It removes confusion associated with icons and is a workflow that’s already established.

Gutenberg developer Joen Asmussen thanked Hoffman for the feedback and listed a number of things to consider with his approach. These include the editor’s need to be responsive, scale to editors with thin columns, accessibility, and accommodating long block names.

Gutenberg technical lead Matías Ventura also commented on the proposal.

Just wanted to say thanks for all the constructive voices here and willingness to find better solutions. If there’s anything that is fairly clear is that the current ‘block switching’ interaction is not as obvious as it could be.

I think using the paragraph icon instead of the one that is easily confused as alignment, @jasmussen‘s update in #9310, plus the addition of the drop-down arrow are a good baseline to check on the next release and see if we need something more involved. @kevinwhoffman it’d be great to expand on your proposal and see how it might look across more blocks and nested contexts.

Matías Ventura

Depending on your workflow, changing block types will be a common action. For example, I often press enter at the end of a paragraph block which creates a new paragraph block automatically. Being able to easily identify and use the change block type option will improve my writing experience.

Those with feedback on Hoffman’s proposal are encouraged to respond to the issue on GitHub. It’s also worth noting that the team is experimenting with using an icon that’s designated specifically for changing block types.

WordPress to Support Classic Editor for “Many Years to Come,” Plugin and Theme Markets Expected to Drive Gutenberg Adoption

During the 2017 State of the Word address, Matt Mullenweg announced the availability of the Classic Editor plugin for site owners who are not ready to adopt Gutenberg when it makes its debut in WordPress 5.0. Since its release, the community has speculated about what the plugin’s active installation numbers mean and how long it will be supported.

Matt Mullenweg has confirmed that support for the Classic Editor will be available for “many years to come,” which should come as a relief to those who feared that WordPress would drop support for the old editor after a year or two.

“I love that people are using the Classic Editor plugin!” Mullenweg said in comment on a recent post. “There is an infinite number of ways that WP can be used and not all will be ready for Gutenberg when 5.0 is released, Classic allows people to still be able to update core and stay current with releases, and with the click of a button try out Gutenberg again in the future if they want to. It’s also trivial to maintain because Gutenberg also uses TinyMCE, so Classic Editor users will still get improvements and updates to TinyMCE — I won’t say ‘forever’ but I don’t see any reason why we can’t maintain classic for the edit screen for many years to come.”

These assurances about the continued availability of the classic editor mean that WordPress product developers will need to decide if they want to provide support for both editing experiences or go full steam ahead with Gutenberg, limiting support to WordPress 5.0+. We don’t yet know how many users will be installing the Classic Editor after WordPress 5.0 is released but that may inform more product decisions in the future.

The Market Will Drive Gutenberg Adoption

During the Q&A following the State of the Word in 2017, WordPress developer Kevin Hoffman asked a question about the prospect of developers having to support two different editing interfaces:

Hearing you suggest the Classic Editor plugin and different ways to undeclare support for Gutenberg leads me to this idea that we are headed towards a split admin interface with no finality to the transition, meaning that I don’t see a time in the future where everyone will be on Gutenberg. We will always have these people in classic mode. As plugin and theme developers, we will always have to support two different types of users. How do we reach that point where we are past the transition, however long it might take, where we can not have this box of chocolates effect where you click “edit post type” and you never know what you’re going to get?

Mullenweg said his hope and expectation, based on how this has worked out with new interfaces in the past, is that over time product developers would adopt the latest interface. He cited the Customizer as one example where one is now very hard-pressed to find a theme developer who is rolling their own options panel after the Customizer was introduced as the new standard. It was just three years ago in 2015 when WordPress.org began requiring theme options to be built using the Customizer and now it is used everywhere.

“The truth is, if you are a plugin or theme developer, people are going to expect things in Gutenberg, so you really need to develop for Gutenberg,” Mullenweg said. “And then, at some point, I’m totally ok if you drop support for the Classic [Editor]. There will be themes and plugins that will say you need to have Gutenberg, [WP] 5.0 or newer if you want to use this.

“We already have that existing now. Plugins only support so far back in PHP in WordPress. There will be plugins that don’t support under WordPress 5.0. It’s not going to be that much different from supporting different WordPress versions where people choose sometimes to go way way way back, sometimes a year or several years, and support WordPress 3.8 and 3.9. And some don’t bother anymore. There’s lots of APIs and other things that changed during that time. At some point you just have to make a cost benefit analysis and do things like maybe Yoast is doing for upgrading PHP, and say, ‘Hey, if you really want the best of this, check out this new thing.'”

As Gutenberg blocks become the standard way of extending WordPress’ editing and customization capabilities, the market will drive its adoption. This is already happening with new blocks and block collections being released every day. The new Gutenberg Block Library offers a glimpse of that and there are many more blocks on GitHub that are not yet commercially marketed.

During that December 2017 Q&A, developers seemed to be excited about the Gutenberg demos they had just seen but their uneasiness was palpable in their questions. Now, eight months later, the current proliferation of Gutenberg themes and plugins demonstrates that WordPress developers are ready to embrace the new editor and build the creative extensions that Gutenberg’s creators’ had always anticipated.

“I’m really looking forward to seeing what the design and developer community can build with it and where their imaginations can take us from there,” Gutenberg technical lead Matías Ventura said when I interviewed him in June. “Core is going to supply the infrastructure and the main building blocks but it’s everything that can be built around it that’s going to be exciting, as always with WordPress.”

The extension ecosystem that made WordPress a success in the first place is going to be a key influence in driving adoption for the new editor. Major players in the product market are not waiting to see how users react to the new editor before building their Gutenberg-compatible interfaces. Users may not be compelled by the writing experience, but Gutenberg’s block model will provide a better framework for site customization and a core standard for page builders that interface with WordPress. If the blocks pouring into the ecosystem right now are any indication, the plugin market surrounding Gutenberg is going to offer an exciting variety of tools for site building.

Securing the WP REST API

I think many WordPress users probably underestimate the amount of data that is made available via the REST API. Just about everything is available to anyone or anything that asks for it: posts, pages, categories, tags, comments, taxonomies, media, users, settings, and more. For most of these types of data, public access is useful. For example, if you have a JSON-powered news reader, it can basically replicate your entire site structure virtually anywhere. But that easy access invites potential abuse. Just like with RSS feeds, RESTfully delivered JSON content is easily scraped and used for spam, phishing, plagiarism, adsense, and other foul things.

(more…)

Gutenberg Block Library Provides a Searchable Index of Individual Blocks

An avalanche of blocks is pouring into the WordPress ecosystem ahead of Gutenberg’s inclusion in core. A few block collections, such as Atomic Blocks, Stackable, and CoBlocks, can be found on WordPress.org, but it’s not easy to search the individual blocks they contain. Other collections and standalone blocks are spread across the web. WordPress theme developer Danny Cooper has built a centralized library of Gutenberg blocks that are currently available to extend the new editor.

The library loads blocks into a grid with infinite scroll. It is searchable, so visitors can easily find individual blocks that are part of a collection. Blocks are also tagged, which makes it possible to compare a group of similar blocks. Individual listings display screenshots of the block in action and its settings panel, as well as a link to the author and a link to download.

The Gutenberg Block Library currently has more than four dozen blocks. Visitors and block creators can submit a block that is missing from the library.

Cooper is the owner of Olympus Themes, a small collection of free and commercial niche-focused WordPress themes. He has also created his own blocks collection called Editor Blocks, which focuses on blocks for business sites. His corresponding Editor Blocks theme is available for free on WordPress.org with support for all the business blocks.

“As a theme developer I’d been waiting for a way to build themes in a way where what you see on the backend matches what you will see on the frontend,” Cooper said. “That can be achieved to some extent using the Customizer, but it’s hard to craft more than one complex page using that method.”

Cooper comes from a PHP/jQuery background and said he didn’t have a strong enough understanding of ES6, Webpack, Babel, React to create Gutenberg blocks right away. The learning curve was a little steep but after getting a handle on the basics he is now able to make small contributions to the Gutenberg project.

“It felt like I was hitting a brick wall every five minutes when I started,” he said. “Zac Gordon’s course helped me get past that stage. The #core-editor slack channel was a big help too. Other than that I just studied the code of the core blocks and used Google. As my knowledge increased I’ve tried to reach out by submitting bug reports to other Block Libraries and making minor contributions to the Gutenberg project on Github.”

WordPress.org may be able to benefit from a centralized block library in the future, as people will be frequently searching for blocks after Gutenberg lands in core. Cooper said if WordPress.org had a library like this it might even be possible to find and install blocks from inside Gutenberg.

“I could build a block that searches my library but it wouldn’t be able to install them as most are part of a ‘collection,'” Cooper said. “I’m not sure if in the future the ‘collections’ will continue to grow or people will move towards releasing individual blocks.”

In the meantime, the Gutenberg Block Library provides a helpful resource for early adopters. Browsing through the listings, it’s exciting to see the variety of block functionality that the community is creating. Users who fully embrace Gutenberg in WordPress 5.0 will find dozens of blocks (and perhaps hundreds by that time) available for the new editor, if they know where to look.

How to Ask Google to Recrawl URLs of Your WordPress Site

Recently one of our readers asked if it’s possible to get Google to recrawl specific URLs? If your website is new, then Google will take some time to crawl and display new pages or changes in search results. In this article, we will show you how to ask Google to recrawl URLs of your WordPress site.

How to ask Google to recrawl URLs of your WordPress site

When and Why Do You Need to Ask Google to Recrawl URLs?

When you add pages and posts in your WordPress site, Google will take its due time to crawl these new links. The same time is required by Google to crawl the updated URLs of your WordPress site.

When you manually ask Google to recrawl your URLs, then it will put your new link in the queue to get indexed on Google. A Google search bot will start recrawling your links one by one and display them in search results.

Some of the common reasons for asking Google to recrawl URLs are:

  1. When you add a new post or page
  2. When you make changes to an existing post or page
  3. If you think a page should be indexed in Google, but you can’t find it

For the first two options mentioned above, you can automate this process using XML sitemaps. Google is pretty good at indexing website because that’s their business.

However we have seen specific pages go missing from Google (for no reason). Sometimes just asking Google to recrawl will make the page appear right away.

That being said, let’s take a look on how to ask Google to recrawl URLs of your WordPress site and display them in the search results.

Asking Google to Recrawl URLs of Your WordPress Site

First you need to get your site listed on Google and then Google will automatically start crawling your URLs. However, you can also request Google to recrawl your new links for any cases that we discussed above.

You can follow the steps below to ask Google to recrawl URLs of your WordPress site.

Step 1: Using the URL Inspection Tool to Recrawl URLs

URL inspection tool is available in the new and updated Google search console (formerly known as Google webmaster tools). This tool helps you identify the issues related to your URLs and offer solutions to index your links in Google.

It will also help you troubleshoot the common WordPress errors for your URLs and other URL indexing issues.

In the new Google search console, you need to select your property or website to check the URL index status.

Note: If you don’t have a website listed on Google webmasters tool, then first you need to add it as a new property to continue with the URL inspection tool.

Select property

After selecting the property, you need to go to the URL Inspection tool on the left menu and add your URL in search field that you want to inspect.

Inspect URL

It will get the data about your URL and display it in the Google search console dashboard.

If your URL is on Google, then you’ll see a success message with the useful information about your link. You can expand the findings and see if there are any other issues to be solved. If not, then you’ll see the submission request from Google to recrawl and index your URL.

However, if the link isn’t on Google, then it’ll show you the errors and a possible solution to get your URL indexed on Google.

You can solve the issues and inspect the URL again until you get the success message. After that, a request is initiated to recrawl your URL. Simply repeat the same for all your URLs that you want Google to recrawl.

Step 2: Submitting XML Sitemap to Recrawl URL

If you’re still not sure about the indexing of your URLs on Google, then you can simply submit an updated XML sitemap with your new URLs to Google webmaster tools. Sitemaps are the quickest way to get your new URLs indexed on Google.

For this step, we recommend using Yoast SEO plugin which includes flexible options to properly set up your XML sitemaps in WordPress.

In your WordPress admin area, you need to go to SEO » General page. Under the Features section, you need to turn on the XML sitemaps setting.

Enable XML sitemaps

Don’t forget to click on the Save Changes button.

Next, you can view the updated sitemap by clicking on the question mark icon next to the XML sitemaps heading. If your new links are visible in this sitemap file, then you can go ahead and submit it to Google webmasters tool.

View XML sitemaps

To submit the XML sitemaps, you need to visit the new Google Search Console and go to Sitemaps on the left menu. Simply add your XML sitemap link and click on the Submit button.

Submit XML sitemaps

This updated sitemap will ask Google bots to quickly recrawl your new URLs and display them in the search results.

Note: you only have to upload the sitemap once. Google recrawls your sitemap regularly, and it will add updated posts quickly once your sitemaps are added.

We hope this article helped you learn how to ask Google to recrawl URLs of your WordPress site. You may also want to see our ultimate guide on how to improve WordPress SEO.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Ask Google to Recrawl URLs of Your WordPress Site appeared first on WPBeginner.

Add to All v1.3.0

Add to All v1.3.0 is now available to download or upgrade from within your dashboard. This new version brings a few new options as well as a major rewrite of the code base to make it cleaner. This also includes the upgrade of the Google Analytics code to now use the new gtag.js implementation as well as an option to anonymize IPs being sent to Google Analytics. Perfect if you need to be GDPR ready.

Process shortcodes

Add to All v1.3.0 - Process shortcodes
Add to All v1.3.0 – Process shortcodes

v1.3.0 adds a few new options under the Content, Footer and Feed that allows you to process shortcodes in the HTML fields. Simply enable this setting and then use the shortcode in the HTML boxes.

Exclude on post IDs

By default, all HTML inserted in the content is automatically displayed on all posts. However, in some cases you mind want to exclude this display on certain posts. You can now do so by adding these post IDs into the field as shown in the screenshot above.

Detailed changes in Add to All v1.3.0

  • Features:
    • New option to enable processing of shortcode in content, footer or feed HTML fields
    • New option to exclude display of content HTML fields on certain posts
  • Enhancements:
    • New functions and filters for content, feed, header and footer
    • Admin interface: switch between tabs without reloading
    • Google Analytics now use gtag.js implementation instead of analytics.js
    • Google Analytics: new option to anonymize IPs

As always, you can raise any issues you are facing with the plugin in the support forum. I hope you enjoy this release.

The post Add to All v1.3.0 appeared first on Ajay on the Road called Life.


Add to All v1.3.0 was first posted on August 25, 2018 at 9:50 pm.
©2003-2018 "Ajay on the Road called Life". Use of this feed is for personal non-commercial use only. If you are not reading this article in your feed reader, then the site is guilty of copyright infringement. Please contact me at https://ajaydsouza.com/contact/

Gutenberg and Classic Editor Plugins Pass 200,000 Active Installations, WordPress 4.9.9 Planning Underway

photo credit: reingestalter numeral types(license)

It has been three weeks since the “Try Gutenberg” prompt was sent out in WordPress 4.9.8 and the plugin has now passed 200,000 active installations. The callout has increased the visibility of the Gutenberg project and brought necessary feedback to the development and design of the new editor.

Prior to WordPress 4.9.8, Gutenberg reviews held a 2.7-star average on WordPress.org. Negative reviews continue to pour in and the average rating has slipped to 2.3 stars. Users are reporting that the new editor is too complicated, cumbersome, and that it offers an inferior writing experience. A few positive reviews are sprinkled in between, calling the editor a “necessary step forward,” and those reviewers seem hopeful that others will feel the same once they get past the learning curve. The vast majority of reviews, both positive and negative, report that Gutenberg’s interface is not yet intuitive to use.

The Gutenberg team’s responses to reviews have improved to be less “canned” since the initial reactions a few days after the Gutenprompt went out. However, the team still appears to be combing the feedback for bugs with the existing interface. Overall, the team’s responses are unified in a general unwillingness to admit that there are critical flaws preventing the interface from being more well-received.

Active installations of the Classic Editor plugin, the official antidote for those do not wish to adopt Gutenberg when it ships in WordPress 5.0, have climbed to more than 200,000. This number is about equal to the number of sites that have Gutenberg active. The Gutenberg team does not view Classic Editor installs as an important metric for understanding Gutenberg adoption or rejection but rather see these installs as a healthy intermediary step for sites keeping the same workflow while preparing for Gutenberg.

In response to recent discussion surrounding the ClassicPress fork of WordPress, Matt Mullenweg said, “No plans to ever have direct vote determine strategic direction in WP, but we are having a bit of a referendum in the adoption of the Gutenberg and Classic Editor plugins, people are voting with their usage. The people are deciding.”

This is essentially true in that users can decide if they want to adopt Gutenberg or not, for as long as the Classic Editor is supported. The Classic Editor plugin is an option people demanded but now the reality of two different admin experiences is nearer than before. The notion of a fork, though perhaps not a serious threat to the project, makes it painfully clear what some users are willing to do in order to avoid Gutenberg.

With the number of Classic Editor plugin installations on the rise, WordPress is headed towards a fractured admin experience. For some it may be a healthy transition option, but in the end, the number of Classic Editor installations indicates how many sites will be running an alternative editing experience because site owners are either not ready or not willing to adopt Gutenberg.

At some point in the future, WordPress will need to unite the editing experience, either by winning these users over to Gutenberg or by discontinuing support for the Classic Editor. In the meantime, WordPress product developers will need to provide support for both editing experiences or go all in on one or the other. It has the potential to erode WordPress’ momentum for a few years, especially if Gutenberg doesn’t become more intuitive.

WordPress 4.9.9 Is Expected to be a 6-8 Week Maintenance Cycle

WordPress contributors met this week to discuss WordPress 4.9.9.

“As of now there’s no specific timeline for 4.9.9,” Jeff Paul said. “That will get set once release leads are in place. However, I’d like to try and finalize leads in next week’s meeting or shortly thereafter so that we can begin 4.9.9 planning and coordination as we get into September.” Paul requested contributor submit nominations for release leads, for themselves or others, ahead of next week’s meeting.

“Until we have a confirmed timeline and plan for 5.0, my assumption is that we’ll continue with our minor release cadence of ~6-8 weeks with specific focus on items needed in support of 5.0,” Paul said.

During his announcement at WordCamp Europe in Belgrade, Matt Mullenweg said WordPress 5.0 could happen as early as August. It’s now looking more likely that 5.0 will drop closer to the end of the year. This gives WordPress users and developers more time to prepare their sites to be compatible with Gutenberg and ready to take advantage of the new features it offers. The schedule for releasing WordPress 5.0 is not yet set but the release is expected to happen in 2018.

Guideline Update: Clarifications to trialware and human readability

Two situations have arisen where we feel it would be best to clarify the guidelines a little.

Guideline 4: Human Readability

We strongly feel that one of the strengths of open source is the ability to review, observe, and adapt code. By maintaining a public directory of freely available code, we encourage and welcome future developers to engage with WordPress and push it forward.

However with the advent of larger and larger plugins using more complex libraries, people are making proper use of build tools (such as npm) to generate their distributed production code. In order to balance the need to keep plugin sizes smaller while still encouraging open source development, we will be requiring plugins to make the source code to any compressed files available.

For example, if you’ve made a Gutenberg plugin and used npm and webpack to compress and minify it, you must either include the source code within the published plugin or provide access to a public maintained source that can be reviewed, studied, and yes, forked.

We strongly recommend you include directions on the use of any build tools to encourage future developers.

Guideline 5: Trialware

Historically we’ve not permitted test or trial plugins that arbitrarily limit usage, and then upsell, to be included in the directory. The primary reason we don’t permit this is that locking people down to a specific number of (say) images is foolish and a pointless endeavour. People can, and will, fork your locked plugin and unlock it, as well they should. That said, we’ve always allowed (and will continue to) plugins that offer a free limited service (think Akismet for a good example).

Related to this are ‘sandbox’ plugins, used for testing. For example, if your plugin only accessed the Instagram Sandbox API, and included upsells about a pro version that allowed full access, you would be a trial plugin. Since they are easily abused as turning the directory into a marketplace, we have modified the 5th guideline to address this more clearly.

#guidelines