Half-Elf on Tech

Thoughts From a Professional Lesbian

Author: Ipstenu (Mika Epstein)

  • Fetch As Google Failed

    Fetch As Google Failed

    Once upon a time, I got an email from Google recently saying that Fetch as Google was failing for ipstenu.org.

    I eyed them like they had a fifth eye. I was on ipstenu.org. I was on halfelf.org. They were clearly wrong. So I went to Google Webmasters Tools and checked out what was going on. I had a whole page that said “Temporarily unreachable.” I gave it a day. Sometimes that’s just Google being weird. But no.

    Google's error - temporarily unreachable

    After cursing a little while, I turned off all the plugins on the site and switched to the default theme. And the fetch worked. So I turned them on one at a time until it stopped.

    And the moral, ladies and gentlemen, is that even though it’s been ten years of WordPress, when someone asks you to make sure you go through the normal debugging steps, you do it.

    • flushing any caching plugins you might be running, as well as server and/or browser caches.
    • deactivating all plugins (yes, all) to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s). If you can’t get into your admin dashboard, try resetting the plugins folder by FTP or PhpMyAdmin (read “How to deactivate all plugins when you can’t log in to wp-admin” if you need help). Sometimes, an apparently inactive plugin can still cause problems. Also remember to deactivate any plugins in the mu-plugins folder. The easiest way is to rename that folder to mu-plugins-old
    • switching to the Twenty Fourteen theme to rule out any theme-specific problems. If you can’t log in to change themes, you can remove the theme folders via FTP so the only one is `twentyfifteen`. That will force your site to use it.
    • manually upgrading. When all else fails, download a fresh copy of the latest.zip file of WP (top right on this page) to your computer, and use that to copy up. You may need to delete the wp-admin and wp-includes folders on your server. Read the Manual Update directions first.

    So yes. Do try it.

  • To Block or Not To Block

    To Block or Not To Block

    Ad blockers. Okay.

    I have ads in this site. I have donation buttons. I make more via the ads, naturally, and I use the money to offset the absolute frivolity it is to run a web server. I also use ad blockers.

    And I also understand the worry of ad blockers on iOS because I see the possible loss of income.

    But.

    My ads are not obtrusive. I hope. I test them a lot on browsers. I don’t display them on smaller ones. I am picky about the ads. I don’t have pop-up/lightbox ads or alerts that congenially prompt people to sign up for a mailing list or try a service. I hate those things. They get between me and the content I’m trying to read. They prevent me from visiting sites. And if you’ve tried to click away an ad like that on your iPhone, you know my pain. Let’s not even get into the accessibility problems.

    No, ethically I chose not to host the ads I hate.

    And I lose money because of that.

    A lot of money. Probably a hundred a month, easy. And I’m personally okay with that, because I can afford this website. I have the money to keep it up, and for what it costs me, it’s cheaper than other hobbies. It’s helped turn a hobby into a career.

    But the same cannot be said of all websites. Many need those ads to survive and flourish.

    So in the balance between content and money, with accessibility and speed on the line, what is the right answer? Who is more important? Where is the right path to earn money while showing ads and not pissing off readers?

    And I’m not the only person who has trouble with this balance. The developers of Peace, an iOS ad blocker, pulled his product after two days, saying it didn’t feel good. He doesn’t like being the person who gets to decide what ads are right and wrong. That said, Marco is still a proponent of blocking for the ethical reasons of knowing who’s tracking you.

    Disclosure time! I use an blocker on my computer. It’s µBlock, which Taylor Swift also uses:

    But the truth is I actually block few things. It’s not that I want a blocker but I want an unobstructor tool. Just like we despised pop-ups, I hate the following things:

    1. Ads that redirect my iPhone to the App Store to buy your stupid game
    2. Ads that cover my entire browser window, forcing me to click away
    3. Ads that autoplay, making me scroll the hell around and figure out what I have to turn off
    4. Ads that popup in the background, making me address them before I can read

    If you can’t see a trend, let me explain it for you. I hate all things that pull me away from your content.

    The New York Times has reported on this: Enabling of Ad Blocking in Apple’s iOS 9 Prompts Backlash

    “When ad blockers became the most downloaded apps in the App Store, it forced publishers and advertisers to rethink the role that advertising plays on the web,” said David Carroll, an associate professor of media design at the Parsons School of Design.

    That illustrates the issue. It’s not that we hate ads. Most of us understand them as a necessary evil. We pay for Netflix to get fewer ads. We pay for cable to get higher quality shows… in theory. We get ads with free TV because it’s free and has to make money. We get ads on newspapers and in magazines because they are surprisingly low cost for what they are. Ditto comic books.

    We know and we understand why ads are there. We rebel because the ads make it impossible to get at the content. The thing we came for.

    I don’t have an answer. I know that, sometimes, I actually do click on ads that interest me. I also know that most of the time people don’t click on ads. I know that many sites need ads to keep going and to keep delivering content. But I know what we’re doing, making ads more and more in your face, is not the right way to win.

    Right now I have no iOS ad blocker. I haven’t found one I like yet. I’m sure that will change.

  • Apple News: Only Our News Fits

    Apple News: Only Our News Fits

    iOS 9 has a new tool, Apple News. This is the replacement for the Newsstand app everyone shoved in that ‘Apple Shit’ folder on their iPhones and muttered about how it took up space on their 16G iPhone they didn’t care about, and damn it, I don’t have an iWatch so why do I care about that app either?

    You know you have that folder.

    News, though, is actually pretty damn cool! It’s actually a news reader app I like and want to use. Except for two big issues.

    You see, I have an Apple Watch and I like how it alerts me to things. I get a wrist buzz, I look down, I know things. A text message, a direct message from Twitter (since few people can do that), an email in a certain box (not yet, but as soon as I figure that out…). What I want with News is for my watch to buzz when there’s a new article about a specific thing.

    The first thing I did was set up News to search for topics I wanted. Like you do. And I put in ‘Jorja Fox’ because I’m still running that website.

    Apple News search for 'Jorja Fox' shows me 'Jordan' and two other people with the name Jordan, but no Jorja

    Interesting, right? No Jorja. I clicked on ‘Show more topics’ but even after scrolling and scrolling, I couldn’t find her. The same thing happened with ‘George Eads’ and ‘Rachel Ray’ but not ‘Bobby Flay.’ Looking for ‘Jennifer Tilly’ brought up ‘Jennifer Lopez’ (close!) but weirdly enough I was able to find ‘Sara Sidle’ (the character Jorja played on CSI).

    News Favorites: ADI, CSI, Sara Sidle

    I ended up managing to make my favorites (Animal Defenders Intl, CSI, and Sara Sidle), but I couldn’t find the movie ‘Lion Ark’ or ‘Extinction Soup.’ Actually, finding the ADI was incredibly hard.

    The search function doesn’t seem to trigger for exact matches as much as it should.

    If you want to add a website, it’s not at all logical. You have to add an RSS feed if the news site isn’t located there and even that isn’t logical. Go to Safari, find the RSS feed, click it, and your iOS device will ask you if you want to open in News. Say yes! There you go.

    Except… How do I add an arbitrary search? You don’t. You can’t. If you want to have a ‘Cat Cora’ channel, or a ‘Jorja Fox’ channel, you’re out of luck. If the name doesn’t show up it doesn’t show up, and yes, I scrolled and scrolled. Then I got a little smarter and got the Google RSS link:

    https://news.google.com/news?pz=1&cf=all&q=Jorja+Fox&output=rss

    I opened that on iOS and added it. And it didn’t work. Oh it added something, but it wouldn’t open within News.

    Then I tried Bing:

    https://www.bing.com/news/search?q=jorja+fox&go=Submit&qs=n&form=NWBQBN&pq=jorja+fox&sc=8-9&sp=-1&sk=&format=RSS

    And Apple News said it couldn’t add Bing to News. Bias much? After iOS 9.0.2 dropped (literally that night), I was able to add Bing, but only if I went to that URL and viewed as desktop (if you didn’t know, there’s “Request Desktop Site” button in Mobile Safari).

    Added news.google.com and all I get is a spinning circle

    Now sometimes there’s a button in the ‘Share’ setting in Safari that lets me add to News. And sometimes there is not. Way to go, Apple. In all cases, I get the spinning circle of doom after I add something to News.

    Naturally I went to look for help on Apple News and found none.

    In the midst of all this, I realized a horrible thing. You don’t get alerts on your Watch from News. You do from a variety of other news apps. You can’t from News. So they’ve made a great new tool that doesn’t let you add arbitrary searches, doesn’t alert you to new news about the searches you can make on your Apple Watch. And while I do have notifications on, it doesn’t seem to notify me about anything.

    In contrast, I added Google News & Weather to my iPhone and, once I logged in with my Google account, it remembered I had a saved search and showed that. Except it also showed me general news and weather. I can’t dismiss those. I have to show them, above my custom news, all the time. Plus the alerts I get are for world news, not my personal searches, which is funny since Google can email me when my custom search has new articles, so I know it can do this.

    Here’s what I want: A ‘News Reader’ that lets me get alerts on what I want to get alerts on. If a site it scans publishes something with my keywords, it pings me. When I read the app, it would sort by date (hiding duplicates by default), and let me thumbs-up or thumbs-down the article to help train it as to what was relevant.

    One of the apps I tried, while looking for that, was Nuzzel. Cute hedgehog aside, the idea that I can get the news from people I follow (and one presumes I trust) is nice. But that only shows me what people know about. News360 suffered the same problem as Apple News, that adding certain arbitrary topics proved impossible. It could find some of my terms but not all. At least they had a way for me to file a bug report, though.

  • Changing Git History

    Changing Git History

    Working on a group project in Git, I did the smart thing with my code. I made a branch and proceeded to edit my files. I also did a dumb thing. I made four commits.

    The first was for the first, ugly, functional version of the code. The second was a less ugly, kind of broken version. The third was the rewrite and the fourth was the working version. When I wanted to submit my changes for a review, it was going to be ugly. I did not need or want people looking at four commits They only wanted the one.

    Now I’m a weird person for how I do commits. I add a new feature like a new function to parse things, and I commit that. Then I change my CSS and commit that. And so on and so on. This means I can look through my commit history and see exactly when I made a change. When I’m ready to do my release, I document all the changes based on that commit log and have it as my message.

    But when you’re working with a team, and all they want is one clean commit? Well I’m their worst nightmare. There is a cure for this, though! You can squash your commits, merging them all into one.

    Squash

    Actually it’s rebase. It can be squash too, though. I ran the following command which says to rebase my last 4 commits:

    git rebase -i HEAD~4
    

    That opens up another editor

    pick b17617p Crap I need to do this thing!
    pick 122hdla Added feature HUMAN to autogenerate a humans.txt file
    pick nw9v88a Changed comment avatar size to 96px
    pick 8jsdy1m Updated CSS for comment avatars to make them a circle
    
    # Rebase b17617p..8jsdy1m onto b17617p
    #
    # Commands:
    #  p, pick = use commit
    #  r, reword = use commit, but edit the commit message
    #  e, edit = use commit, but stop for amending
    #  s, squash = use commit, but meld into previous commit
    #  f, fixup = like "squash", but discard this commit's log message
    #  x, exec = run command (the rest of the line) using shell
    #
    # If you remove a line here THAT COMMIT WILL BE LOST.
    # However, if you remove everything, the rebase will be aborted.
    #
    

    Now here’s where it’s weird. The first one, b17617p is the one I have to merge everything into. And it has the worst commit message, doesn’t it? Oh and I was totally not using the right formatting for how the company wants me to format my commits. They want the comment to be “Feature: Change” so I would have “Humans: Added new feature to autogenerate humans.txt”

    Since I knew I wanted to merge it all and totally rewrite the commit, I just did this:

    pick b17617p Crap I need to do this thing!
    squash 122hdla Added feature HUMAN to autogenerate a humans.txt file
    squash nw9v88a Changed comment avatar size to 96px
    squash 8jsdy1m Updated CSS for comment avatars to make them a circle
    

    Which, once saved and exited, gave me this:

    # This is a combination of 4 commits.
    # The first commit's message is:
    
    Crap I need to do this thing!
    
    # This is the 2nd commit message:
    
    Added feature HUMAN to autogenerate a humans.txt file
    
    # This is the 3rd commit message:
    
    Changed comment avatar size to 96px
    
    # This is the 4th commit message:
    
    Updated CSS for comment avatars to make them a circle
    
    # Please enter the commit message for your changes. Lines starting
    # with '#' will be ignored, and an empty message aborts the commit.
    # Explicit paths specified without -i nor -o; assuming --only paths...
    # Not currently on any branch.
    # Changes to be committed:
    #   (use "git reset HEAD <file>..." to unstage)
    #
    #	new file:   LICENSE
    #	modified:   README.textile
    #	modified:   Rakefile
    #	modified:   bin/jekyll
    #
    

    Since everything with a # is ignored, I deleted it and made it this:

    Humans: New Feature -- Humans.txt is now autogenerated
    Comments: Changed avatar size to 96px and edited CSS to make it a circle
    

    Yeah, that’s it. Admittedly, these should be two separate changes, but they’re all a part of the same project in this case so it’s okay.

    Of course, at the end of this, I looked at my code on our web tool and swore, because I’d left a debug line in. My hero Mike said “Don’t worry! ammend!”

    I made my change, instead of a normal git commit -a -m "These are my changes" I ran a git add FILENAME and git commit --ammend to fix up your most recent commit.

    It lets you combine staged changes with the previous commit instead of committing it as an entirely new snapshot. It can also be used to simply edit the previous commit message without changing its snapshot.

    And yes, it’s pretty awesome. Use it wisely.

  • Custom Excerpts Read More for Genesis

    Custom Excerpts Read More for Genesis

    I nearly always make a custom excerpt for every post I write. This has the benefit of letting my lede be extended into a great sub-headline. It has the downside of killing my ‘Read More’ links.

    The objective is simple. Have a custom excerpt and a read more link. The problem is that there are multiple excerpts and WordPress handles them all in different ways.

    1. The teaser – This is what you write in a post and end with a <!--more--> tag.
    2. The automatic excerpt – This is the first 55 words of a post.
    3. The custom excerpt – This is what you put in the ‘excerpt’ box on a post.

    Those are parsed in reverse order, so the custom excerpt is given the highest priority. That means in order to show my read-more links, I need to put this in my theme’s function.php file:

    function new_excerpt_more( $more ) {
    	return ' <a class="read-more" href="'. get_permalink( get_the_ID() ) . '">' . __('Read More', 'your-text-domain') . '</a>';
    }
    add_filter( 'excerpt_more', 'new_excerpt_more' );
    

    But. I’m using StudioPress’ Genesis theme. This means I’d like to take advantage of some of the awesome accessibility friendly features so that my read more link looks like this:

    <a href="http://example.com/cookies-and-cake" class="more-link">Read more<span class="more-link-title screen-reader-text"> about Cookies and Cake</span></a>
    

    Okay, cool. How do I do that? Back in the old days, this was how you’d edit the link for Genesis:

    //* Modify the WordPress read more link
    add_filter( 'the_content_more_link', 'sp_read_more_link' );
    function sp_read_more_link() {
    	return '<a class="more-link" href="' . get_permalink() . '">[Continue Reading]</a>';
    }
    

    As of Genesis 2.2, we’re into a world of properly accessibility friendly code, and the function get_the_content_limit() has a major change where it calls genesis_a11y_more_link and that is the function that added in the span for the screen-reader, which requires me to add in the genesis-accessibility theme support for my theme.

    // Customize the read-more links in all situations
    add_filter( 'the_content_more_link', 'sp_more_link_text' );
    add_filter( 'excerpt_more', 'sp_more_link_text' );
    
    function sp_more_link_text() {
    	return '&#x02026; <a class="more-link" href="'. get_permalink( get_the_ID() ) . '">[' . genesis_a11y_more_link( 'Continue Reading' ) . ']</a>';
    }
    

    And as far as it goes, that’s perfect. It makes sure everything matches nicely and is accessibility friendly. But it doesn’t take care of my custom excerpts. For that I need a force command:

    add_action( 'genesis_after_entry_content', 'sp_force_more', 15 );
    function sp_force_more() {
    	global $post;
    	if ( has_excerpt( $post->ID ) && !is_singular() ) {
    		echo '<p><a class="more-link" href="'. get_permalink( $post->ID ) . '">[' . genesis_a11y_more_link( 'Continue Reading' ) . ']</a></p>';
    	}
    }
    

    If there was an genesis_after_entry_excerpt sort of function to hook into, I’d be happier, but this works. It puts a [Continue Reading] paragraph at the end of each of my excerpts for my front page, my archives, and not my individual pages. This helps my readers who are, perhaps, not always as aware as they might be about where to click.

  • Mailbag: An Appropriate Solution

    Mailbag: An Appropriate Solution

    Y’all know I don’t really like to answer these questions. I mean. Presumably you’ve noticed I don’t answer this a lot anymore?

    I don’t care if you use Multisite. And I hate this question because you’re (innocently) asking me one of the most incredibly complicated questions possible.

    I’m working with a college who wishes to create a portfolio system for their students. Basically, a student can create their own website – or multiple – to share with employers and others. I’m thinking WP Multisite may be a good option. I could have super admin access, the college’s admin can have super admin access, and each student will have admin access to their individual sites. Would you agree that WP Multisite would be an appropriate solution?

    I agree it can be an appropriate solution.

    I will never agree it’s the solution.

    Read the post I linked to above, will you? The one that explains exactly why this is such a damned hard thing to answer.

    Now. Ask yourself this:

    1. Are those students the people who will be happy where they can’t install a plugin or a theme, or will they badger you endlessly to install them?
    2. Will those students ever want to easily export/move their sites?
    3. Will they ever need ‘more’ than WordPress and, thus, need shell or DB access?
    4. What do you want them to be able to do when they’re done?
    5. How much time do you have to fix their sites?
    6. Are you able to review and ensure security for all plugins and themes they may want?
    7. Do they already have webhosting? (Most universities give you some.)

    Figure that out and you’ll know if it’s the most appropriate solution for them and you.