Half-Elf on Tech

Thoughts From a Professional Lesbian

Category: How It Is

Making philosophy about the why behind technical things.

  • WordPress Cancel Post Button

    WordPress Cancel Post Button

    Someone asked about this in the forums. I can see why folks would find it useful, so here’s a simple addition to add a ‘Cancel Post’ button to your publishing metabox.

    This plugin checks what post-type you’re on and redirects you correctly for pages and CPTs.

    To Install

    Make a file called cancel-button.php and put it in your mu-plugins folder (if you don’t have one, just make it in /wp-content/). In that file, paste the following (yes there’s no ending PHP tag, it’s okay, you don’t need it):

    <?php
    
    /* 
    Plugin Name: Cancel
    Plugin URI: https://halfelf.org/
    Description: Adds a 'cancel' button to posts, next to Publish.
    Version: 1.0
    Author: Ipstenu
    License: GPL2
    
    */
    
    add_action( 'post_submitbox_misc_actions', 'author_in_publish' );
    
    function author_in_publish() {
        $screen = get_current_screen();
        $cancel = get_admin_url();
        if ( $screen->id == 'post') {$cancel = "edit.php"; }
        else { $cancel = "edit.php?post_type=$screen->id";}
        
        echo "<div class=\"misc-pub-section\"><a class=\"button\" href=\"".$cancel."\" id=\"post-preview\">".__('Cancel Post')."</a><input type=\"hidden\" name=\"wp-cancelpost\" id=\"wp-cancelpost\" value=\"\"></div>";
    }
    

    This will add the button for all your sites on a network, if you happen to use Multisite.

  • Cloudy With a Chance of Upgrades

    Cloudy With a Chance of Upgrades

    We’re all being seduced by the cloud. Amazon’s AWS has become so popular and so, seemingly, inexpensive, that people are looking at it to run a website, instead of traditional hosting. Understanding the cloud actually was the first post on this site, and while two years ago I struggled to comprehend it, today I find myself at a loss many times when asked ‘Do I need the Cloud?’

    I don’t need the cloud for webhosting, and you probably don’t either.

    My Sky

    Yes, I have a semi-cloudlike host on LiquidWeb right now, for seven of the ten domains I manage (the other three are all on their own hosts, one of which being my me Elf Dreams, where I talk about DreamHost stuff). I don’t plan on moving the other seven simply because it’s a massive effort. It’s easier to move yourself across country than it would be to move all my sites, re-build the server as I need it, get the code for the new OS (CentOS vs whatever I move to). Heck, I’m dreading upgrading to CentOS6 because of how annoying that is.

    The point is that I do know and understand what the cloud is and does. It’s very cool, if you’re big enough to need it. Most indie sites are not.

    How the cloud works, in general, is based on the shared resources principal. Everyone shares all the resources in the cloud at all times. If you think back to shared hosting, everyone shares all the resources on that server. The difference between the cloud and the shared is that the cloud has infinite expandability (kind of, but you get the idea), where as a shared host is limited to what it is physically. But when we were back on shared hosting, we used to have a problem with bad neighbors. You know, the other guy on your server who got tweeted by Felicia Day or Wil Wheaton, and suddenly all the sites on your server went down like a bad quiche.

    That can happen on the cloud too.

    It’s not exactly the same, but when you’re on a cloud, you’re on a server with a lot of virtual machines (VM). A VM is a “completely isolated guest operating system installation within a normal host operating system” which is a confusing concept. The reason they’re good is that a VM isolates your hardware in a funky way, making reboots faster, while letting your VM instances share a bunch of hardware and become faster. The flip side to this is that you’re still on a real server. Instead of everyone sharing the same CPU/RAM, you get partitions so I can only use X amount and you can only use Y, and thus we don’t kill each other, until we start slaughtering input/output.

    Disk I/O (input/output) can be best explained if you’re an older computer user. Remember when we used to play “Where in the World is Carmen San Diego?” and we’d press a button to ‘travel’ and that old floppy drive would grind like a cheap espresso brewer? That’s I/O. The disk is being read and the data is being input from the disk and output to your Apple IIe. The basic concept of this still exists, and it makes sense when you remember we have to read the data off somewhere. So if you happen to be on a box that is getting a lot of traffic, and using a lot of disk I/O, then you’re going to be slow.

    Hole in the SkyThere are ways to mitigate this, of course, but that isn’t the problem. The problem is that you don’t always know that you need to, or how you should. And even if you do know, it’s not always very easy to do it, so the little guy, who doesn’t have the resources to do it themselves, or the money to hire someone, are left hoping that they’re okay, and often end up paying more than they need to.

    And this is why you and I don’t need the cloud yet. The cloud is something I might need, but for now, there are no benefits I don’t already have with a well optimized server and a well built site. If I was a bigger site, or a company, I’d be looking at it as my next upgrade, and studying my past growth. It took me almost 10 years to grow to need a VPS, and it will likely take me at least 5 more before I need to seriously consider cloud. By then, something new will be the big thing, so the best thing I can do is study nginx and keep a finger on the pulse of web technology.

    Of coures, the one major advantage to the cloud, and the reason I still see it as being around for a while, is the ability to scale up and down. A webhost provider can cannily utilize that to provide scalable shared hosting, so if you have a bad neighbor, they can be scaled up with less impact to you. But so far as I know, we’re only there with VPS demi-cloud providers right now. Give it time, and the cloud as we know it today will be tomorrow’s low-end hosting.

  • phpMyAdmin vs CMS

    By ‘CMS’ I mean WordPress, Drupal, whatever.

    So here’s a funny. I moved my DreamHost site to a VPS, so I could learn nginx (I’m still a newb) and suddenly I couldn’t get to my phpMyAdmin anymore! Before someone says it’s DreamHost’s fault, this is actually due to how I installed subdomains (which I don’t recommend) and configured nginx (still optomizing). That said, not every CMS is flexible enough for this, so if you have this problem too, here’s a work-around.

    As you know, you’re supposed to go to http://mysql.elftest.net which then sends you to http://elftest.net/dh_phpmyadmin/mysql.elftest.net/ to get to your phpMyAdmin page. Except it gives you a 404 styled like your site instead.

    Solution? Make a fake subdomain.

    I made db.elftest.net (which has nothing), but now I can go to http://db.elftest.net/dh_phpmyadmin/mysql.elftest.net/ and log in!

    How I buggered my subdomains, and how I fixed it, is another post.

  • Subdomains, WordPress and nginx

    This should be obvious, but I’m not familiar with nginx, so it wasn’t.

    I added trunk.elftest.net as a separate subdomain (rather than Multisite) because I wanted it to run trunk and not impact anyone else.

    The way that DreamHost works, is you have a separate folder for your nginx configurations, called nginx, and it lives off your home directory. This is commonly referenced as ~/nginx/ and yes, if you type in cd ~/nginx/ you’ll jump right there.

    To make WordPress work, I had to create ~/nginx/trunk.elftest.net and add a wordpress.conf file there, with the standard DreamHost nginx config for WP.

    ######################
     # Permalinks
    if (!-e $request_filename) {
     rewrite ^.*$ /index.php last;
     }

    Magic.

  • The Self-Perpetuating Myths

    The Self-Perpetuating Myths

    This is your only warning: I’m going to talk about racism and sexism in tech, and there will be some swearing. I don’t mind if you disagree with me, just try to be constructive.

    One brown baby, three white. I blame a lot of things on society.

    We’ve all heard that minorities aren’t fairly represented in certain aspects of society. There aren’t enough women/brown/gay/whatever on boards, or working in a specific group. We all know that girl gamers get grief. How many of you have gotten asked ‘Are you a girl IRL?’ when you play a female MMO character?

    When you look at groups like the Apple execs, it’s white guys across the board. Google? 2/3rd’s white guy. Yahoo!’s surprisingly the same with three out of twelve.

    But that name at the top, Marissa Mayer, is the weird one in all this.

    Pretty recently she left Google for Yahoo! which was a surprise to a lot of people. Right away, the old snark showed up. She used to blog about cupcakes, and was obsessed to the point of making a spreadsheet about frostings. Seriously? What does that have to do with her ability to helm a company? If anything I’d argue that sort of obsessive attention to detail is what you want. But no, people pointed out it was a ‘chick’ thing. Because a man making a spreadsheet to understand the various pros and cons for armor on an MMO is manly, but food’s a chick thing.

    That sounds pretty stupid when you put it that way, doesn’t it?

    Look, we all know that when it comes to brain-work, there’s no difference between what a woman can come up with and what a man comes up with. If you can’t accept that, you may as well just stop reading this blog now. What makes the difference is how we were raised and where our natural talents lie. Just because I’m not a super psycho coder, and prefer to spend my time helping people with their code, doesn’t mean I’m less intelligent than the people who wrote an eCommerce plugin. And yet, people persist in saying I’m in a ‘soft’ technology role.

    I think I look at more varied code than the majority of WordPress users. I review plugins and I’m pretty capable of understanding what is and isn’t a safe and secure plugin. I can look at themes and tell you where your code is inefficient. Where I lack is not in my technical chops but in my desire. How I create isn’t with code, or visual arts, but with words. The fact that I happen to be a woman means nothing. Still, you can’t escape things like the Women in Refrigerators syndrome, or how few women write comics (even ones with female leads, like Batwoman and Wonder Woman). So what’s really going on here? What’s being under-represented?

    From talking to a lot of group ‘leads’ of software projects, things are still skewed to the white guy, and it shows. If you look at a community dinner I attended, the men were the majority. Then you look at what the women/brown were the leads for, and you come up with the disturbing comment I heard that UI and Support are ‘soft’ tech topics, and that sure made me feel pretty crappy. But I know support isn’t ‘soft’ anything. In support you see more code than just what you and someone else write. At the same time, I’ve been told many times that there’s no coding involved with support.

    Edit: Note, the other woman actually was a core-team rep, not UI, which made the comment I heard even stupider.

    A lot of this is a self-perpetuating perception issue: If a group isn’t equally represented, then there’s an issue. If women aren’t 50% of the presenters at WordCamp, you’re doing_it_wrong(), people will say. And yet we know that forcing equality does not actually make things equal. The basic idea of affirmative action makes a little sense “If you have a white man and a black woman equally qualified, pick the person who will bring more diversity to give diversity a chance.” Then again, that sounds really fucking stupid when you say it outloud, doesn’t it?

    Why do people feel ‘minorities’ aren’t represented? Why do people feel equal numbers means equal representation? What makes equality?

    I’ve been involved in technology since I was a kid. My grandmother loves telling the story about how, when I was under-six, I set up her Novation CAT modem, dialed into her IBM server, and entered in all her data so that she could make me french toast. Never once, until I was in my 20s and working for a company, did anyone ever make noise about how I was a woman. My family made no point of it, and neither did my schools, my friends, or the people I talked to online back then. To them, this was not a ‘boy’ thing or a ‘girl’ thing, but simply something that I liked to do. Meanwhile, I was chastised by my peers for being a tomboy, for being the ‘masculine’ one in my relationships (I feel bad, in retrospect, for my ex-boyfriends), and for all those other things where I didn’t fit in with normal. But computers, technology, and everything along those lines were never something where gender-lines were drawn.

    Shannon Eastin - NLF's first female ref.All of that changed when I joined corporate America. Within a week, I knew, yet again, I was ‘different.’ I was one of five women in my area, and one of two technical women (the others were managers, though one was a working manager). I was weird, because I liked technology, I liked to play with things, and I’d research when I didn’t know. The more I moved away from Microsoft, the less overt my social oddity became, but it was still there.

    This behavior does not replicate within the WordPress Community in the same way.

    Oh, it’s still there, don’t get me wrong. If you want to go search through the forums, there are some awesome posts where a guy goes from totally respecting me to insulting me, and the trigger is when someone mentions in passing that I am of the female persuasion. But in the WP ‘core’ team, I’ve never met anything but respect and friendship. Now these guys are, predominately, white men, and just by their nature, lack the ability to know what it’s like to be a woman. That’s not a bad thing, it’s just a fact. I can’t know what it’s like to be brown, they can’t know what it’s like to be a woman. But like attracts like, and it’s not surprising that the leads end up being white males.

    Most groups work this way. You want to work with people you can get along with, so you pick people similar to you that add value to the party. Again, nothing’s wrong with that! Does that mean minorities get under-represented? Yes. And there is something wrong with how we’re skewed, in that way. It’s not really their fault. Like I said, I blame society. I can’t help but see the world as a woman who’s been treated like crap for being a woman, and white amles can’t help seeing the world as anything but who they are either. And I don’t think ‘forcing’ people to be diverse helps at all. It just sets up a whole mess of problems.

    What can Open Source do?

    So far, I think they’re doing it right, and much of that has to do with the need-based drive of technology. We need solutions, we don’t care who comes up with them, so long as they work and are secure. Also, because a lot of these developers are distributed, we lack the inherit problems of sight-prejudice, that is, if you can’t see I’m a minority, you rarely assume I am one. I become judged on the character and quality of my communication. This has drawbacks, of course. The lack of visual cues makes many of us seem like assholes (text is a terrible communication medium, as it leaves the reader to interpret what they will from what they read), when all we are is being direct.

    It could be better, of course, but I don’t feel that forcing integration is going to do that in a way that won’t leave us with lingering animosity. The problem I face is that I don’t know the answer. I see the problem, and I feel, on a visceral level, the solutions we’ve made aren’t working. I rage against ‘Political Correctness’ because as we take away more and more ‘bad’ things to say, we’re left with a neutered society that lacks the ability to express their thoughts. You can’t say retard, lame, gay, or a hundred other words to express how stupid you feel something is, and with understandable reason. But saying ‘drat’ just doesn’t feel strong enough sometimes, and you want to shout ‘mother fucker!’ We lose freedom of expression in our quest to be fair.

    This brings us back to my three questions:

    • Why do people feel ‘minorities’ aren’t represented?
    • Why do people feel equal numbers means equal representation?
    • What makes equality?

    The fact is, I don’t know. I think the answer is numbers, but that feels less right when I say it. It’s both in value of work and volume, certainly, but neither one is more important than the other, when we get around to it. Like I said at WordCamp San Francisco: WordPress would be nothing without the devs, but it would also be nothing without the users, and without the people who offer support. We all work together. And thankfully, for the most part, Open Source gets this.

    My suggestion to minorities, of whom I am two, is that sometimes when we feel we’re being persecuted, or picked on, it’s actually not that at all. We may be reading a personal attack into something that wasn’t meant that way. Take a moment to reason it out.

    My suggestion to the majority, of whom I am one, be careful when you make assumptions. When you look at the world from a place of privilege, it’s incredibly hard to see things from that other perspective. Also take a trip to where you’re the minority. It’s enlightening.

    I call these self-perpetuating myths because they make themselves more important. The more white-guy-only groups, the more white-guy-only they remain, and the more minorities feel/appear undervalued and underrepresented. Like begets like, and so on, until finally all we have is a steaming pile of angry. I leave this open ended, as the development of humanity is ongoing, and I hope in a decade, I can come back and look at this in a new way.

  • Handling Negatives

    Handling Negatives

    Positivity is two way streetEvery once in a while, someone raises a stink about how their WordPress plugin or theme got a bad review or comment on the forums and how the mods should delete it.

    We rarely do.(We have, on occasion, done so, but usually only under sever provocation, and often that ends with the developers making the demands being blocked for being jerks.)

    The issue at heart is not ‘OMG! Someone hates my plugin!’ but how do you handle the negative remarks. I mention this in passing (multiple times) in my ‘How to Support Plugins’ presentation, but text is really a terrible medium to communicate. You know there’s a difference between these two sentences:

    “I want a unicorn,” she said, bubbling with delight and hope.

    and

    She jabbed a finger in my direction. “I want a unicorn!” Her voice pitched in a low, guttural, growl.

    But the reason you know that the first one is nice and the second a little threatening is the context. Prose lends itself to this quite well, because authors take the time to explain what’s being felt and evoked. A help ticket, on the other hand, is pretty dry and plain stuff. And because we’re humans, we attempt to put meaning into the words, often ones the author never intended. We’re programed to look for the meaning, hidden or otherwise, and we always interperate based on our mood and our situations.

    This means when you see a ‘complaint’ like this, you have a reaction:

    Ipstenu’s Really Awesome Plugin has a security hole. If you go to /wp-content/plugins/really-awesome/readem.php?=../../../wp-config.php then you can totally read the contents of your wp-config!

    Obviously as a developer my first reaction should not be to yell at this user and remind them to email me about my plugin.(Protip, developers, always put your email or a contact link in your plugin! If they can’t find you, then you don’t get to bitch they didn’t contact you. At the very least, put it in your source code.) And even though people should email plugins@wordpress.org they don’t always know that, and it’s okay. You can’t know what you don’t know, after all. No, my first reaction, as a dev, is to plug the hole! It’s that obvious. Fix the problem, push a new version, and then come back to the post and reply:

    Wow, thank you for letting me know. I’ve fixed that and released a new version. If you find things like this again, please email me at ipstenu@….. Again, thank you for reporting this.

    Then in my plugin, you’ll see a credit in the changelog and/or the version history:

    Version 2.0 – Security update thanks to RandomUser. readem.php let you read any php file on your install. Please upgrade ASAP.

    That’s it.

    The idea isn’t to hide any mistakes I make, or act out of fear and desperation, but to take a hold of the problem, resolve it, and move forward. Check out WPSecureNet and their list of plugins. Normally they’ll only post when an exploit is closed, but sometimes they report while vulnerable. There’s no shame in being listed there, unless you haven’t patched your plugin yet, and realisticly there’s no shame in being listed anywhere as having a bug.

    Look, bugs happen. We can wish we’d never stub our toes, but we will. We can wish we’d never stab our toes, but someone will find a way to do that too. Humans are imperfect. We make mistakes, we don’t see things that are ‘obvious’ and it happens. Consider the number of books you get when typos: that’s after an author, an editor, and a test reader has proofed the book. With most code, you have fewer eyes than a book, and bugs still slip in. Clearly it’s going to be impossible to prevent any and all bugs, and once we accept that, then we can move on to taking these moments as less painful.

    It is painful to get a security report, or even a bug report. Even if this is ‘just’ a hobby, you’ve spent hours of your free time banging away, trying to make something awesome, and now you found out it just wasn’t. No matter how experienced you are, you take this personally, even for just a split second. Getting over that hurdle, that fear that everything is ruined, isn’t easy. And this is why I keep saying that you shouldn’t worry as much about the bugs as how you handle them.

    Your users, be they just the folks who use the plugin or people who pay you, will follow your lead. If you’re calm, collected, and honest, then they’ll value you and your product. They’ll appreciate you and what you can do. By taking the negatives and turning them positive (sorry, that’s cheesy) you will improve your relationship with users, clients, and the community.

    I want that unicorn!But what about those angry ‘You suck!’ posts? Oh, they happen, and with a bit more frequency than we’d all like. Often people like to lump them with those posts where people complain about your plugin, only to have the wrong plugin… Look. The way you handle those negative people is the way you will set the tone for your entire online life. You can react aggressively, or you can handle it calmly and rationally. Personally, when I see someone rage on about how the original poster is a moron, and they don’t know what they’re talking about, I put them on my blacklist. I will never again use their plugins or themes or any code, if I can help it. I’ll sooner fork it than anything else, because the best way I can vote is with my feet.

    What about you? How do you handle the angry unicorn lovers? And what do you do when the devs go postal on you?