Categories
Microblog Personal WordPress

I’m a Code Wrangler

This is old news at this point, but I realized I never mentioned it here. A few months back, I shifted from a Happiness Lead to a developer.

I’m excited about the move and especially that I’m able to continue to work on Jetpack. I’ve always worked with the code powering Jetpack, but usually minor things that I discovered through working directly with our customers.

My goal isn’t to create some sweeping new feature, but to make steady, solid improvements to Jetpack. Small fixes that improve what real people are seeing with the project are beautiful things.

Of course, my tinkering is on hold a bit while on paternity leave and being on the sidelines while WordPress 5.0 ships isn’t easy! There is so much to learn, explore, and create in the space with the Block Editor, but I’ll be slinging code again soon!

Advertisements
Categories
Featured Technology WordPress

🧁 WordPress Adds Emoji 11 Support

Note: This post is regarding upcoming WordPress 4.9.8 and this is not applicable to production sites… yet.

In WordPress 4.9.8, among the improvements will be support for the latest Emoji 11 release. WordPress, technically, has already supported it—you’ve been able to add a 🦸 or 🦹 character even since general emoji support was added. One of the pieces of emoji support within WordPress was using the Twemoji library to polyfill emoji that your operating system didn’t support.

In other words, while you can add any Unicode character to your post, it is generally up to your operating system to support it, except for emoji, which WordPress provides a backwards-compatible way for them to display. Emoji 11 went live in early June and WordPress 4.9.7 adds support for the polyfill for these new emoji. Have an old computer? Apple hasn’t released a new version of OS X yet? You’re not on Android P, which is only in development anyhow? No problem, WordPress has your back.

So, no matter if you’re in the heat of summer 🥵 or the dead of winter 🥶, or if you’re 🥺 or 🥳, WordPress is here for you. There are a lot more than just a few smileys or the all-important cupcake 🧁. There are a ton of science-related emoji 🧬 and 🥎 to supplement the existing ⚾️.

If you’re reading this while, um, doing something else ( 🧻 ), Emojipedia has a great run down of the new emoji, specifically as presented by Twemoji.

I’m a little excited by the cupcake emoji, so I decided to use real cupcakes to help make it happen…. These baked goods would be from my wife, Vanessa’s own Qué Bueno Bakery, which is a bronze level Unicode sponsor for the cupcake emoji.

Okay, maybe I’m more than a little excited.

If you’re a 🦸 and testing out Gutenberg, the emoji won’t yet render when editing a post. There’s an issue for it—need to find a good way to ensure the emoji aren’t saved as images when they’re rendered via Twemoji.

What is your favorite new emoji coming soon to your WordPress site?

Categories
Technology WordPress

Customizing the Privacy Policy link in Genesis eNews Extended

You put together a brand new fancy Privacy Policy page on your WordPress 4.9.6+ site and are ready to include a link to is using the latest version of Genesis eNews Extended. That’s great!

This is a brand new feature, though, so themes aren’t styling for it yet. What can you do?

Styling

Using the Customizer via Apperarance->Customize within WP-Admin, you can add a small bit of “Additional CSS” to change this link’s styling however you’d like. The link is within a small html tag with a class of enews-privacy  with the a tag itself having the WordPress-wide privacy-policy-link class.

In other words, you can target specifically the eNews privacy link with something like:

.enews-privacy a.privacy-policy-link {
color: green;
}

Other CSS selectors, such as the a:focus and so on can be used too.

Changing the text

The text and the link itself is set by WordPress. You can use the the_privacy_policy_link filter (inline docs) to update the entire HTML block or the privacy_policy_url filter (inline docs) to update the overall link or only the URL. Alternative, you can update only the text by using the gettext filter (docs).

For example:

<?php // do not include in an existing php file

// This one works great if this is a secondary site of a company with one central privacy page. Example: Jetpack's site might want the link to always go to automattic.com/privacy/
function bk_change_the_url_only( $url ) {
return 'https://example.com/privacy/';
}

add_filter( 'privacy_policy_url', 'bk_change_the_url_only' );
Categories
Featured Technology WordPress

Genesis eNews Extended 2.1 Released

Genesis eNews Extended 2.1 is now available on WordPress.org. It has been a couple of years since a new version has been released—frankly, the plugin just works and it hasn’t needed much work.

Please note this version requires WordPress 4.9.6 and will not be offered unless you’re running WordPress 4.9.6+.

The European Union is preparing to implement this week their new data protection law, GDPR, which impacts Genesis eNews Extended and WordPress. If you have WordPress 4.9.6, released last week, you can setup a privacy policy page which Genesis eNews Extended will provide a link to under the subscription form, if you choose.

The feature respects the WordPress setting for the privacy page, as well as the various hooks implemented as part of the new feature for both the text of the link and the link itself. If any themes or plugins filters these value, the widget will use the same values to help site administrators set once and forget.

On a related note, I’ve fielded a few questions about how to add a checkbox to the widget for GDPR compliance. From my best understanding, this is not required. A subscription form that is exclusively for an e-mail subscription does not require a checkbox to confirm the visitor intent, since the action they are doing is the one and the same. If a form exists for any other purpose, then there does need to be a checkbox to confirm the visitor intent to also subscribe to a list.

Because of this, I am not adding an option to add a subscription confirmation checkbox to Genesis eNews Extended. It is meant to be a very simple plugin exclusively for newsletter subscriptions and while site owners are free to use it for other purposes, I’m only building and supporting the intended use as a mailing list subscription form “wrapper” that allow Genesis theme styles to have an easy time theming a “standard” subscription form.

Update: 2.1.1 was also released to fix a small issue with a bit of extra code displaying on the front end.

Categories
Featured WordPress

WordPress Drop-In Plugins?

You know all about WordPress plugins and may have heard of Must-Use plugins, but what about “Drop-Ins”?

In WordPress, there are three types of plugins:

  • Regular plugins – in /wp-content/plugins/ and can (generally) be activated/deactivated/updated via wp-admin’s UI.
  • Must-Use plugins – in /wp-content/mu-plugins/. Only PHP files in the mu-plugins directory itself are detected and they are always loaded—you “must use” them. You can’t deactivate them or update them via UI. You must delete or move the file to deactivate and must manually update via FTP or some other out-of-WordPress method.
  • Drop-Ins plugins – in the wp-content but only specific file names. They replace/augment very specific functionality within WordPress.
File name
Purpose
Loaded
wp-content/advanced-cache.php
Caching functionality
When WP_CACHE is set true.
wp-content/db.php
Replaces WP’s default database handling.
Always.
wp-content/db-error.php
Custom DB error message.
Completely replaces the error page that usually says Error establishing a database connection.
Database Error
wp-content/install.php
Custom install scripts. Allows someone to override wp_install() or any other function in wp-admin/includes/upgrade.php
WordPress installation
wp-content/maintenance.php
Custom maintenance message. Completely replaces the Briefly unavailable for scheduled maintenance. Check back in a minute. error page.
During plugin/theme/etc updates.
wp-content/object-cache.php
Functionality specifically for an object cache.
Always.
wp-content/sunrise.php
Very early loading functions before multisite starts to load.
When SUNRISE is true. Multisite only.
wp-content/blog-deleted.php
Custom error message when loading a deleted subsite.
Attempting to access a deleted subsite. Multisite only.
wp-content/blog-inactive.php
Custom error message when loading an inactive subsite. Attempting to access an inactive subsite. Multisite only.
wp-content/blog-suspended.php
Custom error message when loaded a suspended site.
Attempting to access a suspended subsite. Multisite only.

The list is very specific and, in many cases, providing a quick replacement to an error page where it may not make sense to try to add via hooks or filters.

The kicker is the caching ones—advanced-cache.php or object-cache.php—are often added by the installation/activation functions of caching plugins but are not always removed when uninstalling. If the caching plugin is deleted via the file manager instead of a typical deactivation, it wouldn’t be able to delete the drop-in either.

If you run into situations where you’re trying to debug something and it seems like there is mysteriously cached items. Check out the wp-content directory and try renaming those files to force-deactivate a cache if there are seemingly no normal caching plugins active.

Categories
Microblog Site Info WordPress

Keeping It Clean

I went through my debug log tonight, which had been a bit long mainly due to older plugins throwing warnings in PHP 7.

Of four plugins generating PHP 7 warnings, two had merged-but-unreleased fixes, one has a pending PR that I could apply and confirm working, and wrote a PR for the last one.

Clean logs here I come!