Half-Elf on Tech

Thoughts From a Professional Lesbian

Category: How It Is

Making philosophy about the why behind technical things.

  • Make It Pretty

    Make It Pretty

    This one is a visual.

    Here’s what my WordPress toolbar looks like on WP 3.8 on a site where I show Jetpack Stats in the bar:

    badmenu

    And here’s what it looks like on a site where I don’t show the stats:

    goodmenu

    And here’s an even worse menu:

    worsemenu

    So what does this tell you? As a developer, you need to spend some time making sure your menus look nice. I already went to the Jetpack blokes about this, but the real crux here is ‘toolbar menu items get janky.’

    This has always been the case, of course. It’s just a little more prominent in the MP6ified world, and it is getting better, but what needs to happen is plugin and theme developers who add in toolbar menu items take stock of how their items are used.

    The obviously easy fix is to use wp_is_mobile() to check if the device is a mobile one and if so, simply not show the menu item. After all, the odds of someone needing to adjust SEO via the toolbar on a mobile is slim. An exception might be emptying cache for that page, and for them I suggest an alternative. When you really do have a major use-case for a toolbar menu item on mobile, have it degrade via wp_is_mobile() to show just an icon on mobiles. For caching, I’d use [genericon icon=”trash”] (there’s one for Dashicons: dashicons-trash).

    I know this one’s really crazy short, but it’s one of those things that really needs a reminder. You’ve got to test your toolbar additions! WordPress 3.8 is due out three days from this post. Get on it!

  • eCommerce Dream

    eCommerce Dream

    At the end of my WordCamp San Francisco talk, I said I had a dream. A dream about a plugin that can share an inventory between WordPress sites on a Multisite Network.

    Firefly_-_WhitefallImagine, if you will, a store with a physical products (Geisha dolls). The store has a bunch of different types of dolls. The store has satellite stores, one in Ariel (their flagship store) but now one on Bellerophon and another on Whitefall. While the Companion-Style dolls sell well on Ariel and Bellerophon, the Cowboy-Style ones sell best on Whitefall. Also each store has a different kind of clientele.

    So the Dollhouse Store makes a website, and then using Multisite, makes another site for each location: whitefall.dollhousestores.com and so on (or maybe whitefalldollhouse.com even). At first, the webpages are just a list of the local store products, come and buy them here, photos of the locale, employees, and local events. Then they decide to sell stuff on line. But they only want to list items for sale under specific criteria.

    1. All items for sale are stored on the network admin
    2. Each store can select what products they have at their store
    3. Each store controls product volume.
    4. Stores can request more product from homebase

    Now of course they could have a separate store for each site, but they want to manage what possible items could be sold online, so having that controlled by the network makes sense, doesn’t it?

    Firefly4_LMeanwhile another store sells cows. All the cows live at Persephone, and are shipped out to Jiangyin and other stores. They’re doing well with everyone going to cowship.com, but they too want to have jiangyin.cowship.com and so on. Each store lists what cows are for sale that live well in each location because Holsteins’ don’t like Bellerophon, who knew? This way, someone on Jiangyin can order Holsteins but not Texas Longhorns. Obviously they need to control which product can be sold at each location, same as the Dollhouse, but they also have a different problem. Their product amounts must also be stored in one location and shipped out from there, so they want to make sure they don’t oversell their cows.

    Their criteria:

    1. All items for sale are stored on the network admin
    2. Network admin controls absolute amount of products
    3. Network selects what products they have at each store
    4. Orders per store base product volume on the network amount

    These are pipe dreams. Today there is no plugin that ‘shares’ an estore across multisite sites on a network. You can’t even do it with ‘digital’ products which now that I say it aloud, I think Pippin should totally get on that.

    Today, all sites are separate, and since estores have their content saved per-site, there isn’t an easy, friendly way (if there is at all) to pull data between sites in a way that preserves shopping carts and such. I wish there was. I get asked about this at least once a week, and I have to say “Today, there is no plugin that can share an inventory between WordPress sites on a Multisite Network.”

    But this is a complicated thing. Multisite itself isn’t actually built to handle that kind of thing, since the network doesn’t have posts or pages. You’d have to dedicate a site on the network to the shop and pull in content from there, which of course has a switch_to_blog() overhead penalty. I can’t even begin to get past the paper thoughts I have here.

  • Why Does The WordPress Background Auto-Upgrade Work?

    Why Does The WordPress Background Auto-Upgrade Work?

    Way back in the stone ages I wrote an explanation as to why the WordPress Upgrade didn’t work all the time. In that post, I pointed out that servers and your installs are special snowflakes and not all the same, and that’s why an upgrade doesn’t work all the time. I’m amused that no one pointed out to me that stance (one which I still maintain by the way) seems contradictory to my proclamation that we should love the built-in updater as of WordPress 3.7.

    Allow me to challenge myself.

    Your server, with your install and your plugins and theme and tweaks, is still a special snowflake.

    The background updates for WordPress keep this in mind.

    Oh, I have to go further into this? Fine. The reason the updates are restricted to just minor, security/maintenance, updates is that, in general, they do not cause the problems people experienced 2010. It’s been three years. We’re smarter, we learned a lot, and most importantly, if the problem in 2010 showed up again, WordPress would not to install. I heard the sounds of brakes screeching. Let me explain. We want WordPress to not install itself if it can’t. We’re not defining that as a ‘failure’ because while your install did fail to upgrade, your site didn’t break.

    Let’s get the down low from the man himself:

    Those seem pretty straight forward. WordPress 3.7.1 was made so that a failure to update didn’t break your site, because if it couldn’t apply the install, it would rollback seamlessly to 3.7 without you noticing. Well, except for the email you got to say “Hey, this didn’t work, man. Sorry.”

    Why does this work and the major upgrade does not?

    That’s the real question, isn’t it? Why are we having such a monumental success for 3.7 to 3.7.1, where we didn’t from 3.6 to 3.7? Actually, we did, but you’re not comparing the right things.

    First of all, the 3.6 to 3.7 upgrade is one of the more stable ones we’ve had in a while. 2.9 to 3.0 was the birth of my OMGWTFBBQ!!! post in the forums (and the catalyst for why I’m working for DreamHost). It was a major overhaul, with a lot of changes, and a lot of complicated tweaks. Let’s be frank, it was a re-write of a crap-ton of modules, and it was just going to break things. WPMU folded into WordPress and changed to Multisite? Yikes! But as time has moved on, I’ve been reporting more and more “Everything’s okay in the forums.” This does not mean everyone is perfectly happy and perfectly safe, and the upgrades were a 100% success. We have the same type of complaints as we always have. Themes and plugins were not robustly tested enough with the new release, so they broke when the upgrade happened. This is (currently) unavoidable.

    So again, why is this working so well?

    Three Nacin MoonBecause the core team who wrote the update script learned from their mistakes in the past. The changes made in WordPress may be bold and large, but they’re also done carefully. Instead of just saying ‘What’s done gets into the new version,’ 3.7 took the ‘feature teams’ trend started a few releases back to the next level. Only if the feature was done-done did it get into 3.7. This meant that while we did not have a major ‘feature’ this release (like we did with the Media Release in 3.5), we had the opportunity to make each feature rock solid on it’s own. And this worked better than many expected because of “features as plugins.”

    While some aspects of core have to be developed in core, others begin their lives as plugins. Like the password-strength improvements and auto-upgrades were both plugins before they were added to core. Also if you look at 3.8, pretty much every major feature that can be a plugin is one. This means that one feature, a new post editor, didn’t make it because right now it’s not ready. Having things be plugins also lets more people test them, by installing the plugin without having to upgrade to a beta version of WordPress!

    Finally, and this is really important, not everyone gets upgraded at the same time. Within 24 hours of the release of WordPress 3.7.1, only 75% of English installs were updated. This was done to keep an eye out for load issues on WordPress.org’s boxes, but also on shared webservers. Which by the way are doing just fine. As we go forward, Nacin’s said he expects this to be sped up, especially for a 100% security release.

    How does it work? Glad you asked! The best explanation I got at this was over beer with Nacin, and sold me. At 7am and 7pm your site pings WordPress.org to see if there are updates. When this happens, your URL is hashed into MD5. Then the first three letters of that is converted to a base 10 number (MD5 being based on base 16, which doesn’t do you any good unless you have 6 extra fingers) and that’s used to decide if you get an update or not. The cool part of this is that it can be used to push to only one out of four thousand sites.

    I know this is all probably sounding like fan service. Like I can’t see anything wrong with this. Nothing is perfect. I’m well aware that things can break. I’m well aware there are possibilities like WP being DNS highjacked, or a plugin circumventing the updater. But. If the DNS is jacked, the API just won’t work unless the jacker has a duplicate that works. And the evil plugin would kind of have to do the same thing, or they would only be able to impact you when a natural upgrade occurred. And neither of those are actually related to background updates. They could have happened at any time in the past. They could happen tomorrow.

    Why do the upgrades work?

    Because WordPress grew up.

    And that’s pretty cool.

  • Is SEO Best Handled by a Plugin or Theme?

    Is SEO Best Handled by a Plugin or Theme?

    I’m not an SEO expert, but I know a heck of a lot more than many people who claim they are. For the record, I’ve been messing with SEO since it was ‘correct’ to put hidden text in the source code of your site. I used to spend time getting sites to rank well on Lycos and Altavista, back when I was but a wee intern for my friends. It’s fair to say I’ve been around the block with SEO.

    I don’t consider myself an expert because of skill, though in the last couple years, I’ve decided not to keep up as closely with things like schema, mostly because I don’t have to. I still retain a solid grounding in what does and does not make for good SEO (content!), and I understand that part of good SEO isn’t just content, it’s how the content is displayed for the reader, but also how the information is sorted for the computers at search engine companies.

    Credit: Plymouth UK
    Credit: Plymouth UK
    About every couple months, someone asks me if I prefer using a theme or a plugin to manage my SEO, and I have been giving the same answer for a couple years now. I don’t use either.

    This does not mean that the themes I use aren’t ‘SEO’ optimized, of course. It means that I don’t use their ‘extra’ features. I use, primarily, StudioPress’ Genesis Framework right now, and that comes with an SEO settings page which I never use. Ever. In fact, I turn it off in any child theme I make. This is not because I don’t think that it’s useful, but that what I do ‘use’ for SEO is already included.

    My SEO consists of making my content fantastic, using a theme that includes schema headers (or adding them myself if not), and following the guidelines Yoast outlines in his article WordPress SEO Tutorial. I don’t do everything he says (he likes ‘category/postname’ for permalinks, I like ‘year/postname’ but if date doesn’t really matter, I use category instead), but I do read and think about what it means.

    That’s the crux isn’t it? I don’t blindly follow advice, or use a plugin or theme because people say I have to. I read, I think, and I come to logical conclusions, and I apply them after I write my post.

    For example, Yoast says not to use ‘stopwords’ in titles and make them SEO friendly. I take this to mean your human readable title should be gripping, but the title slug should be short, to the point, and descriptive. So I customize every single title. I come up with four or five before I post, and then when I have one with a good grab, I tweak the title slug to be as short as possible, while still being descriptive. Sometimes I’m better at this than others, but I keep working it.

    pgpoaNext I customize my ‘publicize’ lede. This has to be good and it has to be short. I know I’m using my helf.us yourls, so the URL itself will be tiny, but that doesn’t mean I should use just my title for Twitter. I customize it, trying to make it a little more witty and pithy, to reflect me and my readers. Finally I customize my excerpt. Oh yes, my excerpts are all custom written, and they are intended to grab you hard. Like Yoast, I feel the only well written description is a hand written one, and I do it. For everything.

    This puts me at a funny disadvantage. Most plugins and themes I’ve seen tend to want you to make a custom meta description. There are plugins (like the one I do use, listed further down in this post) that allow you to use your excerpt as descriptions, but I’ve never quite understood why themes make this so hard. In Genesis, I have a field for “Custom Post/Page Meta Description” in every post, which if I use it, will change the meta value for description.

    When I dug into the code, I saw that it was pulling this:

    genesis_get_custom_field( '_genesis_description' );
    

    Clearly all I need to do is make that default to what I want. And when I figure that out, I’ll let you know. Right now, all I could do was remove Genesis’ function and replace it with my own. Not elegant at all.

    Now all that said, there are times when I see to ‘improve’ upon the SEO I’ve been given, because someone else is handling the content will far less care than I give. When that happens, I grab Yoast’s WordPress SEO Plugin. But for the most part, I don’t do anything on a regular basis that involves having to ‘customize’ my SEO, so it’s infinitely portable to any theme I want.

  • Why I Hate Facebook

    Why I Hate Facebook

    I do, you know. I hate it for a couple reasons, but the primary one is the user interface sucks. It’s just horrible. And since I’ve apparently turned Friday into my free, shortform, random topic day, let me explain to you why.

    Ignores My Settings

    I cannot tell you how many times I’ve gone to my timeline and seen garbage from last week. “What the hell?” I would shout, and look to see that my timeline is ordered by something called “Top Stories.” Interesting, because I know for a 100% fact that I set it to “Most Recent.” But no, no, Facebook changed it. So I change it back:

    Sort Order

    And don’t ask me how many times I’ve had to turn chat OFF.

    Click Don’t Matter

    This is worse on iOS where I have to click twice on every single link, but it’s bad on the sort order, which is not a link but a drop down. Only since it’s right above the post in my timeline, I have to wiggle my mouse around until I magically click the right place for it to work. Using Facebook on my iPhone means I have to use their app, which behaves radically differently from the normal app, so thanks. Now I have to learn everything twice.

    Unfollow Does not Mean What You Think It Means

    If I comment in a thread, I follow it. Okay. I can see why you do that, and while I’d like an option to default that to off, I’m not going to argue. But when I make a comment, sometimes I click ‘Unfollow’ right away, because I just wanted to say one thing, or post “Congratulations on your baby!” and move on. That’s the end of it, right?

    Nope. Every time someone ‘likes’ my comment, I get a notification. Every. Smegging. Time. I’m witty. Lots of people like my comments, or find them helpful, or whatever. That means I get a lot of BS notifications I don’t give a horse’s patootie about.

    Wrong location For VERY important information

    Do you know how to ‘tell’ if a post can be shared? Some can, some can’t you see. Let me help. This post is public and can be shared:

    Public Share OK

    This post is friends only and cannot be shared:

    Only Friends

    Different icons, different meanings. Where are these icons? At the bottom of the post. Why is that a problem, you may ask? After all, the share button is down there too! Not everyone shares with share buttons. A lot of people will copy what someone says on FB to a blog. If they don’t happen to scroll down (which, let’s face it, a lot of us don’t), and don’t happen to know magically that a globe is public and a group of little people is a friends-only thing, they’ll copy the post content, paste it to their website, and share with the world.

    I’m not so naive to think anything I put online is ever fully ‘private.’ But I’m intelligent, experienced, and I work in IT. I understand the world around me, and how the digital world shares data. If it’s online, someone will see it, share it, and make it public. Not everyone gets that, and they get upset.

    How could Facebook fix this? Put at the top of the post “Friends Only!” or “Public Post” so it’s clear right away.

    Bad Colors

    Did you know you can embed Facebook posts in WordPress?

    https://www.facebook.com/photo.php?fbid=10151997270514795&set=a.10150154582169795.302445.251152514794&type=1

    That’s my high school celebrating soccer season. The link for embedding FB? Grey. Pale grey. In the image below, I’m hovering over it. It’s still grey. If I didn’t know better, I’d think it was plain text!

    Embed Link

    There should be a color change when you hover over a link, a noticable color change.

    But wait, there’s more!

    I’m sure there is, but at over 600 words, lets call this a day. What annoys you about Facebook’s user interface?

  • Plugin Wish: Login With Google

    Plugin Wish: Login With Google

    Now I know what you’re thinking. “Mika, there are a hundred plugins that let you log in via Google!”

    That’s not what I mean. Let me explain with a story.

    You have a business, example.com, and you use Google Apps for everything. Then you start tying this into other companies, like a time sheet company, that let’s you ‘Login with Google’ and redirects you to the right company settings. Cool, right? Kind of like this:

    replicon

    And you think you’d like an internal, private, blog, where people can post cat pictures. Or whatever. What if you could just have the login screen be that Google button? And you know there’s a bajillion plugins for it, but you want to have it be only people on example.com. So you@gmail.com can’t login, but me@example.com and dad@example.com can too!

    I want that.

    I have not yet seen it, but I think that would be an amazing plugin. By default, the domain it ‘validates’ would be the one on which it’s installed (so here it’d be halfelf.org), but you could override it (which is good, since I’d want to use ipstenu.org). Then you’d want it to ‘generate’ new users if they don’t exist, since you don’t want to have to add every single new person, right?

    Oh and you don’t have to terribly worry about that fired guy, bob@example.com, because once he’s fired and you disable the email account, he can’t log in!

    Some concerns of course would be Two-Factor Authentication. Also how do you handle multisite? I would envision a default nothing-set option for Multisite, where the network admin could network activate, and set the default domain there. Add in a check box for “Allow individual sites to override?” at the very least. Maybe a sneaky “Always allow the super admin to log in” setting too, though that gets complicated fast.

    Cliff Seal pinged me about this and said he’d been fidddling with https://github.com/logoscreative/wordpress-openid but he never finished. Who’s up for the challenge?

    And no, it did not escape me the hilarity of me, a loud “I don’t like Google owning all my data!” person suggesting this.