Half-Elf on Tech

Thoughts From a Professional Lesbian

Tag: plugins

  • Understanding Plugin Stats on WordPress

    Understanding Plugin Stats on WordPress

    So you’ve have a plugin and you’ve finally released it on WordPress.org to allow the masses. It’s going well, you’ve run a couple revisions with no major issues. But how can you tell how ‘well’ your plugin is actually doing?

    Realistically, you’re going to have to wait a while, maybe even a year, for things to even out realistically. After a year, you should have something like this on your Stats panel and this CAN be explained!

    Here’s what Ban Hammer’s stats look like. It’s just about a year old right now.

    1) Initial Release – This was when I released it and started pimping it.

    2) First Major Revision – This was when I started adding in more features, making the code faster, and debugging something.

    3) Certified for 3.0 – This was … well, yeah, that.

    Look at how the spikes ramp up a lot. The first one is moderate, the second one is twice the first, and the third is another moderate change. It’s not impressive, my plugin is for a pretty niche market and I don’t expect it to be hugely popular. Impostercide gets about 80 a day right now, compared to the 10 to 30 Ban Hammer got in its first days. But the basic picture is pretty clearly painted.

    It’s not quite an exponential jump for each update, but the update is what’s telling you who is really using your plugin.

    Let’s look at the very popular WP Super-Cache plugin:

    His spikes are pretty static, standing at 11k downloads on every major release. That’s really impressive, but it gives a far more realistic understanding of your plugin and how many people are really using it.

  • Switching to WordPress MultiSite Breaks Links

    As of WordPress 3.1 you can NO LONGER remove the blog slug via the method described in this post! – Feb 28 2011

    Warning: WordPress MultiSite is not for the newbie!

    Most people I know who are using MultiSite (formerly WPMU) are people who have always been using that fork of WordPress. With the advent of MultiSite, a built in way for people to move from single ‘blog’ installs of WordPress to a multiple site structure, more and more users want to move to it, which is great. But. There are some weird ‘problems’ with MultiSite that cause a lot of users to think it’s broken. It’s not, it’s just different.

    My friend Andrea wrote a nice tutorial about how to create a network, and generally when I need help, I scan WPMU Tutorials first. Or I tweet at her. One of the things we’ve talked about is the way WordPress MultiSite changes your blog links.

    When I changed https://ipstenu.org from single to multi, my links were changed from https://ipstenu.org/YYYY/MM/PostName to https://ipstenu.org/blog/YYYY/MM/PostName, which I did not want! Thankfully, I knew a lot of people had this problem beforehand and I fixed it quickly, which I will explain here, but first, here’s why it’s done that way.

    Normally, when we use pretty permalinks (that’s the part of your URL that looks ‘pretty’ instead of code-like) on a blog, all we have to worry about is not conflicting with post names and page names. If you have an about page, generally the URL is https://ipstenu.org/about. Since WordPress has to translate https://ipstenu.org/?p=2 into that to be pretty, you can’t also have a blog post with the same URL. How would the software know WHICH page you wanted? Simple enough. For details on that, you can read Otto’s post on Category in Permalinks Considered Harmful.

    When you add in MultiSite, suddenly the code has to check for something more: is this new Site named something that breaks my existing links?

    There are two kinds of MultiSite, and I use them both. You have SubFolders and SubDomains. Subfolders gets you URLs like https://ipstenu.org/code and SubDomains gets you https://halfelf.org/. If you use SubFolders, WordPress takes an extra step to make sure that pages named ‘code’ don’t break when you have a new blog with the same name. To help do that, it kicks your blog URLs from your main blog (i.e. https://ipstenu.org/) up a level to a new URL: https://ipstenu.org/blog/. For those of us who move from Single to Multi, this breaks our old links.

    Thankfully there are a couple fixes which can tide you over until WordPress 3.1 is released. The developers plan on having this ‘fixed’ or at least editable by then, so at the worst, you can go from having a blog slug to ‘news’ or ‘pasta’ or whatever.

    .htaccess

    If you want to keep the blog folder, but you want to redirect your old posts, .htaccess is your friend.

    If I wanted to redirect all YYYY/MM/DD posts to /blog/… I would add this:

     
    RewriteRule ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)$ https://ipstenu.org/blog/$1/$2/$3/$4 [L,R=301]
    

    What I actually did on another site was this:

    RewriteRule ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)$ http://domain.com/blog/$4 [L,R=301]
    

    And I changed my permalinks to just post name. This was risky, in a way, but it matches how I use the site better.

    Plugins

    There are a couple plugins that can help you here. Thinking in WordPress made a plugin for WPMU, but I’ve heard it doesn’t quite work yet.

    Andrea (and her husband Ron) have a Remove Blog plugin that can also help you.

    I’m sure there are others, but I mostly recommend Andrea and Ron’s. And not just because I like them.

    Hack

    If you’re dead-set on doing this, and you don’t want to use a plugin, there is a manual way to do this. Remember, by doing this you will BREAK the ability of WordPress to check for conflicts between your main site’s urls and any new site. If you’re using SubDirectory SubDomain MultiSite, this should be fine. Hell, I’m doing it. If you’re using SubFolder, I really don’t recommend this at all.

    You ready?

    • Login to your admin site.
    • Go to: Super Admin > Sites > Edit
    • Scroll down to “Permalink Structure” and remove the “/blog” part
    • Save

    That’s it.

  • Plug It In, Plug It In

    vilcus-plug-it-inI am not a great programmer by any means. I can hack around and muddle my way through with the best of the great net scapegraces. I’m not the genius who invents a brand new way of doing things. That said, I do, eventually, get annoyed with things enough that I force myself to learn how to code.

    Yesterday I was pissed off at WordPress because of it’s user management tools, and no plugins really did what I wanted. See, I have open registration. It lets me sync my blog and forum and let people post. But where it fails is that I can’t set users as ‘banned’ in WordPress. This is a simple thing, I feel. A user role that has no rights and is just banned from commenting. They can read all they want, but no comment. I’ve tried just about every tool out there, but they never work. In addition to that, spammers sign up to my blog.

    Since creating a ‘bozo’ user role is outside my ability, I decided what I wanted was a plugin to prevent people from registering if they were on my blacklist, similar to how I can prevent them from commenting on my comment blacklist. At first I was using TimesToCome Stop Bot Registration, which (among other things) uses StopForumSpam’s list of spammers as a stop-gap.

    The problem with TTC is that if you register with a bad email (jane132@gmail.com instead of jane123@gmail.com) and then try to register with the RIGHT email, it notes that the IP is the same and bans both emails and the IP. Which caused a couple people no end of problems on my site. It had to go.

    From there, I tried No Disposable Email, which checks against a list of known baddies. That was nice, but it was a text file list that you had to update by hand. But it got me thinking.

    I quickly converted it into Ban Hammer, which allowed me to update and edit the text file from a submenu inside my admin session. But that wasn’t enough. Why did I have to have two places to keep my jerk list? If someone was on my WordPress Comment Blacklist, I didn’t want them to comment. That implies they’re just not welcome at all. So why don’t I make Ban Hammer pull from that list. Which I did.

    I still have things I want to do to the code, like put in an option to use StopForumSpam’s list, and a way to edit the error message. But for now, Ban Hammer sits by my other plugins, Recently Registered (lists the last 25 registrations) and my bbPress plugin Spoiler Bar (adds in spoiler ‘code’ to bbPress) on my Google Code site. It’s not for ‘public’ release, but it’s there so my friends who have been helping me test out my ideas can easily download. What? I have nerd friends!