Three new WordPress plugins

I factored out some of my various WordPress hacks into standalone plugins. Perhaps they will be of use to someone else.

  • WYSIWYG Comments Trix:
    Replaces the standard comment submission form with a WYSIWYG rich-text editor. A bunch of you said this was a bad idea, because 64KB should be enough for anybody.

  • Geolocate Comments:
    Saves and displays (to me) the location of each commenter's IP address. Hello to all my friends in the Russian bot farm industry!

  • Mirror Gravatar:
    Mirrors commenters' Gravatars and serves them locally, rather than loading them from gravatar.com on each page load, thus both speeding things up and eliminating an off-site webbug.

They join in infamy my previous two plugins:

FYI, the other plugins that I still use are:

For a long time I used WP Super Cache, but I decided that it was more trouble than it was worth. It was far too agressive at showing people out-of-date pages, and I think that since I started using CloudFront as a CDN for my images and videos, it's a lot less necessary. I guess we'll find out the next time I say something that makes the techbro hordes invade.

Separating out these plugins made me marvel at how long my wp-content/themes/jwz/functions.php file has gotten over the years, due to the inevitable accretion. What all is in there? Let's conduct an inventory, mostly for my own benefit:

Theme stuff:

  • Colors, scripts, sidebars widgets.
  • A bunch of permalink-canonicalization crud.
  • Hacked the "Archives" sidebar widget to go into "year mode" after a few months, instead of listing 200+ months.
  • Show relative dates on posts and comments.
  • Move the login fields above the text area instead of below (what were they thinking?)

Disable misfeatures:

  • Tear the legs off of "wpautop", "wptexturize", and all the emoji crap.
  • Disable "Gutenberg", "XML-RPC", and "JSON REST".
  • Disable "categories" as much as possible.
  • Search results by date, not some nebulous "relevance".

Images:

  • Filters to move images and videos into the CDN.
  • Locally mirror images posted in comments.
  • Auto-generate IMG SRCSETs, dependent upon my image scaler. WordPress kind-of handles this thing internally if you use their built-in image uploader, but I don't, because reasons.

Search and social media crud:

  • Add OpenGraph and Twit metadata properly.
  • Remove "users" and "taxonomies" from sitemaps.
  • Keep year and month indexes out of search engines: link to leaf nodes only.
  • Omit sidebars and comments and such from the version of the site seen by search engines. I know they hate that, but it makes the search results better.
  • Auto-crosspost to Twitter and sometimes Instagram.

Other random features:

  • Added an option to hide all comments on particular posts, without actually deleting them.
  • Added an option to mark particular posts as search-engine-noindex.
  • Better HTML-to-plaintext conversion for RSS feeds and multipart/alternative emails. This is useless but it's the principle of the thing.

Relatedly, I also re-organized my hacks/ page for the first time in over a decade.

Previously, previously, previously, previously, previously, previously, previously, previously, previously.

Tags: , , , ,

4 Responses:

  1. CSL3 says:
    3

    Herp Derp: which is absolutely essential.

    I mean, why even have a Comments section if it doesn't have Herp Derp? That's why Disqus is shit (well, that and it's appeal to nazis).
  2. George Dorn says:
    1

    I guess we'll find out the next time I say something that makes the techbro hordes invade.

    I see another useful plugin here; detect referer [sic] headers from common techbro horde sites and redirect them to a static version of the blog hosted entirely on a CDN.  You don't want their comments anyway.
    • jwz says:

      Sadly, referers often aren't sent on the modern web, because spammers ruined it for everybody.

      One nice feature of WP Super Cache is that it has a big red "lockdown" button for when you notice that the shit has hit the fan.

  3. narf says:
    2

    I'm not asking you to work for free. But, if you ever come across a site and see a sea lion there and just decide, "Fuck it. I'm done listening to their shit" and make a Herp Derp bookmarklet/extension to Herp Derp by user on a different site.... I might drive from Texas and make you whatever meal you request. (and, I'll buy the drinks. From DNA, of course.)

Leave a Reply

Your email address will not be published. But if you provide a fake email address, I will likely assume that you are a troll, and not publish your comment.

Starting a new top-level thread.

  • Previously