Link RoundupProductivitySEOWeb DevelopmentWordpress

There are a lot of lists out there about “20 Best Free Plugins!” and “Top Ten Essential WP Plugins!”, but you know what isn’t out there yet? A top list of Deborah’s favourite most handy plugins. Some of them may be found in some of the other lists out there, but some of them are a bit more random. So without further ado: Deborah’s Favourite Most Handy List of Plugins in 2020!

So here we go, in no particular order:

Classic Editor 

Johannes Gutenberg
Classic Editor: the editor that Johannes Gutenberg would have used.

This is probably on a lot of other lists out there. I have to be honest: I hate Gutenberg. In fact, I think the original Gutenberg is rolling in his grave at the thought that his name is being used for such an awful page builder. I’d rather just write everything manually than use Gutenberg, that’s how awkward it is. But thanks to sensible people out there, the Classic Editor plugin exists, to bring back the WYSIWYG editor. My life is made easier.

If you like, you can disable Gutenberg, or leave it enabled so that any other users who DO like Gutenberg (weirdos) can still use it. Conveniently, it opens automatically to the user’s last-used editor, so you don’t have to worry about repeatedly switching back and forth.

Schema & Schema Default Image 

Google structured data rich snippets results
All that fancy stuff like the sidebar there and whatnot? That’s because of structured data.

Schema is very simple and straightforward for getting your structured data markup in the right format, which makes your site look a lot better in Google search results. It’s helpful for your local SEO and great for people who are simply searching for you (or didn’t know they were searching for you).

The Schema Default Image plugin goes hand-in-hand with Schema, adding an option for you to designate a default image if your pages or posts don’t have a featured image, which is a nice little add-on.

Honeypot for Contact Form 7

It works on Winnie, and it’ll work on spammers.

Contact Form 7 is a great contact form plugin, but as with any contact form, you can end up getting a lot of spam. Thanks, but I don’t want to buy viagra from random Russian people, and neither do the clients for whom I build websites. I mean, I assume they don’t.

ReCAPTCHA is helpful in decreasing the spam, but I find when I implement CF7’s quiz feature AND the honeypot, it makes a huge difference! Overkill? Maybe. But nobody likes spam.

Header, Footer and Post Injections 

Get it? Header!

Sometimes you end up having to use a theme that makes it very difficult to plugin bits of code in the header or anywhere else, and you can get this done all in one place without having to use 5 different plugins. It’s also another one of those really straightforward plugins that is simple to use. It even takes into consideration accelerated mobile pages.

Code Snippets 

Code Snippets is a bit like Header, Footer, and Post Injections, but you can insert lines of code one at a time and enable and disable each of them as you please. It adds them to your theme’s functions.php file automatically. The graphical interface is nice, and allows you to add comments and tags for notes for yourself (or other admins). I don’t always need this plugin, but I’m really glad it exists!

Use Any Font 

Seriously, ANY font!

Ever have that one website you have to build where the client’s font ISN’T a Google font? That’s when this comes handy. You can upload one font for free and it converts it into a web font. Mind you, if you need more than one custom font, you’re going to have to pay, but usually I only need one custom font. It plays nicely with various editors and page builders too.

Disable admin notices individually

I can’t be the only one who gets tired the plethora of notifications in WordPress. It’s either “give us a rating!” or “upgrade to premium!” or “really useless information that takes up half the page!” and you have to click the little x to close them out every. single. time.

Notifications blocks
Dude. Nobody even cares.

Well, Disable admin notices individually solves that problem for you. You can dismiss a message permanently. And don’t worry, if you didn’t mean to dismiss one, you can go into the settings and un-dismiss the message. Additionally, different users and the messages they have dismissed are independent of each other — if I dismiss a message, another admin logging in will still see it until they also dismiss it.

WPFront Notification Bar

I’ve seen a lot of pages out there with a COVID-19 notification bar to alert site users to what their business is doing in response to COVID-19. If you want one of those that you can extensively customise, then this is the plugin for you. Of course, it’s not just for COVID alerts, but for any alert your heart desires. You can set cookies so that it doesn’t pop up for the same user for a certain length of time, or you can set it so it pops up every time. You can adjust colour, size, location, scroll, how it closes (or doesn’t close), and just about anything else you’d want to do. It’s an impressive little plugin if a notification bar is something that you need!

Redirection

This is not a political endorsement.

This plugin is great for handling 301 redirects. Some of our clients have ecommerce stores and rather than un-publishing a product, they’ll delete it for whatever reason. Of course, when they do that, I get the wonderful notification from Google Search Console telling me that we’ve got a 404, oh no! Redirection is great at handling and sorting out that problem so that users aren’t sent to an “oops! 404 page not found!” page. It can handle conditional redirects it even tracks errors.

Accelerated Mobile Pages

This plugin isn’t for every website, but if you write a lot of articles, recipes, or sell products through an ecommerce store, this plugin can make a huge difference. It puts all of your posts into an AMP format, a stripped down version of your post that is mobile-friendly and gives you a chance to show up in the Google News carousel. Since implementing AMP for a few of our clients, we’ve seen a huge upturn in traffic to those pages.

There are lots of upgrades you can purchase for this plugin, but the free version is more than enough to work for most of our clients. It’s worth mentioning here that there is a free plugin, AMP Contact FORM 7 – AMPCF7 to make Contact Form 7 work with AMP. It hasn’t been updated in two years, but it hasn’t failed me yet.

And have I mentioned yet that having your own ecommerce store can be far more beneficial than selling on third-party platforms? Indeed, you can boost your own store‘s SEO with this.

Contact Form 7 Database Addon – CFDB7

If you’re worried about missing contact emails or accidentally losing the data that people have submitted, this plugin is handy. It stores each contact form’s information in a database on your site. You can export it as a CSV file, delete individual entries (or all) if there are duplicates, and it requires no configuration at all.

Special Mentions

I think that a lot of lists cover these plugins, but it’s worth mentioning anyway without needing to go into detail.

Augoptimize – our favourite plugin for optimising image sizes, scripts, and generally speeding up a page. We use it in conjunction with a subscription to ShortPixel.

Wordfence – Excellent for website security. You’d be amazed at how often people try hacking pretty much ANY website.

Yoast SEO – The best tool for SEO!

What are your favourite handy WordPress plugins? Let me know in the comments!

FutureProgrammingTechnologyWeb Development

and now for something completely different

In the our 20-odd years with PHP, there have always been people attempting to work a step or two ahead of where the language was at the time. Working with PHP4 in the early 2000s, when a very elementary Java-derived object model was grafted on the language, people attempted to write proper Java without the guardrails. Objects are the sort of thing that, if your language doesn’t give you, you will probably try to invent, as people before that with PHP3.

PHP5 brought the gradual strengthening of the language’s object model, as well as dynamic “magic methods” which people ran wild with in the late 2000s, stretching things every which way. By the early 2010s the ecosystem had sobered up and begun to build serious structures around it. The language got a proper package manager in Composer, and in playing by a set of community-established conventions, one could draw upon vast resources for free. Many of us did, and over the lifespan of PHP5, the language completed a transformation from its hobbyist origins to something more enterprise-worthy. This was only aided by the widespread shift to cloud-centric computing, which PHP — stateless by nature — was uniquely equipped to handle.

PHP: The Next Generation

PHP7 came at an opportune time in the mid-2010s. Apparent competition from Facebook’s PHP-based hacklang seemed to kick the release schedule for PHP5’s sequel into high gear, amidst worries that a competing, partially-compatible offshoot would fragment the ecosystem. The internals team, which typically ties major version jumps (3 to 4, 4 to 5, 5 to . . . 7) to significant engine improvements, did not disappoint. Version 7 arrived with huge speed improvements (5x, by many counts) and set about, over the lifespan of the 7.x line, finishing the task of strengthening the language’s guardrails. The end result took much of the wind out of hacklang’s sails and, though it continues as a part of facebook’s internal toolset, the feared splintering of the community did not arrive.

Now, as we await the arrival of PHP Next Generation — Version 8 — in the closing months of 2020, let’s look at how we’ve continued to work at the margins in our time with PHP 7, and how we can expect to see our visions realized in future PHP.

make it so

Building a more reflective environment

Beyond the speed boost, PHP greatly strengthened the type system, once considered a critical weakness of the language. Once a weakly typed language, its modern incarnations are more accurately gradually typed — that is to say, while you can still work in a fast and loose way as before, structure and boundary may be introduced as the lines become more defined.

Through external tools, through linters and validation, structure and boundary may be enforced on a project level. The language may be wielded in a way acceptable to the enterprise, without losing the dynamism, flexibility and lightness of weight that characterize a scripting language.

If PHP is the best of both worlds, it’s the hardening of its type system that has brought it there, and it’s around its type system that our work has revolved.

class Before {
protected $database;
public function getUser($id, $password);
}
class After {
protected $database;
public function getUser(int $id, string $age): User;
}

Before is an example of a method signature, PHP5-style. We can infer that $id is probably a number, and $password is probably a string of text. getUser probably returns a user record. These are all reasonable assumptions, but there’s no actual indication of this, and certainly no enforcement. What happens if you pass in a textual ID and a numeric password, or trick it to return something other than a user record? And putting aside everything that could go wrong at runtime, there’s little usable information here for an IDE to provide hinting as you work.

(In the months before PHP7 was announced, our team had a working model that looked an awful lot like After, running entirely on plain-vanilla PHP 5.4. We stopped work on it at that point, and the less we say about how we did it, the better.)

After, using the syntactic enhancements of PHP7, is replete with useful information for automated tools and human readers, and establishes clear boundaries for runtime operation. Try feeding in the wrong values, or coaxing out a bad result. The engine itself will refuse.

So what did people do before 2015? Labour with blind IDEs, unable to analyze their code? No, the PHP community did what it does in the face of adversity and established sensible community standards. Deriving from the Javadoc format, DocBlocks became a standard way of expressing the intent of a program.

class Annotated {
/** @var Connection */
protected $database;
/**
* Retrieve a user from the database.
* @param int $id
* @param string $password
* @throws UserNotFoundException
* @returns User
*/
public function getUser($id, $password);
}

In this way, people were pretending that PHP was well-typed long before it was. Now, these specifications are suggestions, not rules: the language does not register them and will not enforce them at runtime. But they provide a standard way to provide a wealth of metadata beyond what the type system can adequately capture, even now. (Referring back to the After diagram, you’ll notice that this diagram contains more information. PHP 7.0 was incapable of attaching type information to $database, and it doesn’t specify possible error states.)

So on our side we’ve got a consistently improving type system and well-defined documentation format with broad community support. We’ve got powerful Reflection capabilities built in to the language — that is, programs can read their own blueprint, make decisions based on their own structure. All this within a language with a history of dynamism and “magic” undefined conditions.
So let’s look at one way in which we worked past a shortcoming of PHP, and had the opportunity to loop back once the language caught up.

Typed Properties in PHP 7

Let’s dwell for a second or two on a fragment of the last two code samples, to see a shortcoming of PHP 7.0 as it initially shipped.

class After {
protected $database;
}
class Annotated {
/** @var Connection */
protected $database;
}

In contrast to methods, class properties such as the $database are as weakly-typed as ever before. Within a class, it’s the honour system. If you were to make $database public rather than protected, you’d be merely trusting the rest of your system not to pass in a bad value, and you’re telling the rest of system nothing (except by way of commentary) of its intended content.

Meanwhile, our team is building a framework around a Dependency Injection container, and this is a crucial bit of missing information for us as we attempt to analyze and fulfill the needs of a class.
But since we have metadata available in another way, we end up with something like this:

class ExampleController {
/**
* @var UserEntity
* @Inject(required=true)
*/
protected $user;
}

No, not the prettiest. We earnestly wished, at the time, that we could express property types like this:

class ExampleController {
protected UserEntity $user;
}

and Annotations like this, such as in Java:

class ExampleController {
@Inject(required=true)
protected $user;
}

but we continue to build our system as if the language had those functionalities, without our own implementations as a stopgap. In each case, we were expecting the language to go that way eventually, though we couldn’t say for certain any timeframe.

Sure enough, as development of PHP 7.x continued and initial shortcomings were resolved one by one, we got one item checked off our wishlist with PHP 7.4. Typed Properties now allowed the above to be slimmed down to:

class ExampleController {
/** @Inject(required=true) */
protected UserEntity $user;
}

Furthermore, the properly typed property doesn’t function just as a suggestion for the dependency system to interpret and fulfill. Another guardrail, formally in place, and we began supporting this method within our framework immediately. But its addition didn’t invalidate the old method. @var annotations remain valid and will remain so indefinitely.
But speaking of annotations…

Annotations in PHP 8

This is a bit of a “stop the presses” moment, as I had already written how this remains a long-running, major item on our wishlist. How I had followed various RFCs over the past decade, hopeful for each of them, resigned to the reality that it might never be accepted.

Our half-way implementation might be all we ever had, and that was okay. Then, with my press date looming, this lands in my inbox:

i just closed the vote. [Attributes v2](https://wiki.php.net/rfc/attributes_v2) was accepted with 51 yay, 1 nay. The selected syntax will be <<Attribute>>.

Thank you everyone for participating in the discussion and vote!

I was more than glad to tear up that draft, and I’ll be glad to see DocBlock annotations become an optional feature as code like this becomes the norm:

class ExampleController {
<<Inject>>
protected UserEntity $user;
}

Yet, even as the language has caught up with our intentions and we’ve adapted our course accordingly, functionality has remained consistent throughout. The language gave us enough rope to mock-up both features to the degree that we didn’t feel impoverished in their absence, and were able to pivot effortlessly when both were introduced.

It remains to be seen what aspect of PHP 9 we end up building, but we look forward to discovery.

There are many reasons to be excited for PHP 8!

Annotations — er, Attributes — are a definite favourite here, but a major PHP release is a big deal and we’ll be here in future weeks to go through them all.