While I was in there, I also fixed the password saving bug that I kept having in Chrome (just cut out the submit button JS), switched it to eliminate the Pear_JSON package entirely (WordPress has JSON support built in already), and did some other minor things. I’m sure I missed some bits, but for the most part it was really just a hack and slash job. Eliminated about 30% of the plugin’s main code and all the ancillary Twitter libraries.

On a side note, this sort of thing only reinforces something I’ve said before: Plugins should only try to do one thing, and to do it well. Trying to have a twitter solution in this plugin when I didn’t want to use that bit at all basically just made it stop doing the shortlinks correctly. That’s a real problem when it’s really a shortlink plugin to begin with. I already had a really good twitter solution, trying to have all this extra crap in there just made it not work properly.

If I had more time, I’d also remove all the JS stuff on the settings page too. That’s not really necessary when you only have a few fields to enter. But I guess it works, sort of. Whatever. Not important.

Anyway, here you go. I won’t be putting this in the plugins repository, since it’s not really my code. But I am posting it here in case it helps anybody. And if Ozh changes his plugin to eliminate the Twitter stuff (or to at least make it optional without impacting functionality), then it would be worth switching to that in the future. I won’t be supporting this plugin anytime soon.

Edit: Note that I did this mainly because I wanted to use my own Simple Twitter Connect instead for posting items to Twitter. That works fine and uses the shortlink from this plugin fine. But the extra Twitter stuff in the original plugin interfered with it, and there was no good way to disable that stuff short of editing the plugin. I’m a fan of not editing other people’s plugins, but in this case there really wasn’t a lot of choice. YOURLS is a good system and I like using it, I just wish the WP plugin for it wasn’t trying to do so much. Just so you know.

33 Comments

Heh, nice job
For the record, when I first implemented the tweet capabilities, my first thought was “I’ll get people use Otto’s STC”. I don’t remember why I didn’t stick to this… Probably wanted to learn how things worked myself

I´ve already set the auto publish feature on twitter and facebook, but I still have those 2 problems:

1 – Facebook
The auto publish only works if I set the plugin to publish on my Facebook profile and also on my Facebook Fan page. I´d like to publish only at the fan page, but if I set the plugin like this, it didn´t publish my post on my facebook´s fan page.

2 – Twitter

Simple twitter connect still doesn´t short de URL when I use the auto publish feature, but when I use the twitter on the dashboard it works fine and short the URL as expected.

2. I use the Ozh Plugin until the last version of it, and never had a problem, but when I upgrade for this last version, I can’t connect my plugin with the twitter more. Then, I can’t send my messages of posts published in wordpress to twitter;

3. My English is bad. I want know that your plugin correct this problem. I try read the post, my I didn’t understood.

4. If I change the Ozh Plugin by the your plugin, can I send the posts to twitter?

[…] integration, so I didn’t need the extra stuff. Luckily, neither did Otto. Here’s a version of that plugin with the fluff removed. It just takes care of making the shortlinks. It works perfectly here on […]

Hi, I’m using latest versions of Yourls and WP, I also installed this great plugin, and it works, but something is wrong, coz then I crete a post in my blog it isn’t tweeted but the link is automatically made in my YOURLS without any problem.

In the plugin configuration all windows are green (looks like OK!) and I checked a lof of times the manual. WP says that connection to my tweeter is correct.

Hi Otto, have you upgraded your Yourls install at all? I was cruising around the yourls site, and noticed a lot of bugfixes in the trunk version, so I upgraded (version 1.5.1). When I run that version, the plugin link breaks somewhat. New links are generated, but they aren’t reported back to the site… seems something is breaking the ability to report back. I rolled back to the 1.5 version, and all is well. So I’m not looking for support or anything, I’m back in action…. just checking to see if you had successfully upgraded at all to see if it was something on my end. Other than that, just a heads up I guess, something will most likely break the plugin in a future Yourls release. Regardless, thanks for the modded plugin, love it!

When I installed this plugin it does make duplicate entries for a single URL. I saw that each time I went to a old post the admin would display 4 short urls for that post. The official plugin does not have this problem.

[…] but it had all kinds of funky Twitter integration that I didn’t want. Next I manage to find a modified version which did all the hooking up of your WordPress and YOURLS but left Twitter out, perfect. Well […]

Hey Otto, did you run into any problems with your modified plugin after the 3.5 upgrade? I’ve been using your modified plugin since you put it out, and it’s always worked perfectly until now. When I try to publish a post, I’m guessing when the short URL attempts to get generated, my site redirects to my Yourls install page URL and tells me it’s already installed. The post publishes but no short URL generates. On the front end, if I click from my index page on a post, instead of going to the single view it redirects to my Yourls install link. Pretty strange. I checked in the settings, and I have the green light on connection still.

Tell me this isn’t whacky…. I killed all plugins but yours and ran the vanilla 2012 theme. Still have the same problem. But everything is fine on my various other sites. Just happening on VoodooPress. What on earth could even cause a redirect to my yourls install URL? I don’t actually expect anything… just wanted to report back that it’s an isolated incident to one site, and I have no idea what could be causing it! I mean, same plugin on all sites using the same Yourls install… everything is the same, but one site has just decided to go completely BONK!

Ha.. sorry to keep bugging you, just want to throw more info your way in case it’s relevant at all. It seems the issue actually does happen across all my sites. It just doesn’t trigger until I make a post. rvoodoo.com was working groovy, but I hadn’t made a new post after upgrading. I just made a new post and now that site also exhibits the same symptoms I mentioned above.