WordPress Adminimize and Latest Tweet Plugins

Published 15 years, 11 months past

Just because the world hasn’t suffered enough bad PHP coding, I released two WordPress plugins today.  One pares down some of the admin UI, and the other is a Twitter plugin.  Because the world doesn’t have enough of those, either.  You can find links to them on my WordPress Plugins and Hacks (but I repeat myself) page, or if you can go straight to their respective pages, which I’ll link here in just a second.

Okay, second’s up!

MW Adminimize (currently v0.5)

This plugin pares down the page-topping links interface that shows up on every WordPress administration page.  I got tired of seeing my blog name in Big Huge Letters all the time, and I kept forgetting that the “Dashboard” link was hidden up in that black bar.  So I fiddled with some arrays and wrote some CSS, and got something that chews up less screen real estate while also being easier for me to use.  Maybe you’ll feel the same, in which case, enjoy the plugin.

In addition to that, I pared down some of the elements of the “Write Post” page so that they took up a bit less space, and compressed the stuff around the post title’s input field.  Those styles are marginally less stable and may cause weirdness for you.  If so, sorry.  Let me know what goes south and I’ll try to get it fixed in a future version.

Oh, and I also included a CSS rule that makes the background shading of moderated comments more obvious, though not in my usual eye-scarring fashion.  It’s just a little darker and notably redder.  That doesn’t have much of anything to do with minimizing the admin UI, but I thought it was a huge improvement.  I might take it out in a future version if the crowd shouts otherwise.

MW Latest Tweet (currently v1.0)

This one does what you’d probably guess: shows the latest tweet.  Why not just use something like Twitter Tools?  Actually, I tweeted about that.  A further survey of the options available turned up nothing that was quite what I wanted.  So of course I started hacking away.

The basic mechanism is that any time a page that calls this plugin is loaded, it either returns the last-cached tweet or asks Twitter for the latest tweets so it can cache the latest of them.  If Twitter fails to respond (I know, what are the odds?), you still get the cached tweet.  This is similar to SimpleTwitter, from which I took much inspiration, but is more advanced in a number of ways.  Among the options I wanted to have and thus created was having “human time” intervals as an option, and also the ability to filter out @replies (because I personally wanted to display my latest broadcast tweet, not my latest reply).  While I was at it, I decided I’d throw in the ability to define your own XHTML output, so that if the plugin failed there wouldn’t be partial or mangled markup shoved into your pages.  Also, since I cache the whole of the latest tweet, you have all kinds of stuff you can output should you so desire.  It’s all documented on the plugin’s page.

This is not a widget, because I’ve never written one and didn’t have time to learn (due to all the time I was burning just trying to write the plugin).  You have to edit your template/web page PHP in order to call it.  That’s just the kind of DIY guy I fly.  Er, I am.

Also, I’m a wee tiny bit proud of how I styled the labels on the plugin’s Settings page.  I’ll probably write that up in a separate post.

That’s about it.  If anything goes wrong or is unclear, please do let me know in the comments.  Share and enjoy!

Comments (40)

  1. Hello Eric,
    i think it is better, when it possible, the user can change the admin-theme. This is easy possible with WordPress 2.5 and bigger.
    I have write a small update for your very nice plugin. Now can all iser change the deisgn with your small admin-area and colors for fresh and classic-design.
    I hope you enjoy this code and use for the next version, maybe.

    You can download the version on: http://bueltge.de/wp-content/download/wp/mw_adminimize.zip

    With best regards and i hope you like the small codechanges.
    Sorry for my bad english!

  2. Hi, just tried installing your latest tweet plugin but I’m getting the following error

    PHP Warning: Attempt to assign property of non-object in /home/public_html/wp-content/plugins/mw_latest_tweet/mw_latest_tweet.php on line 40

    I’m using the latest WordPress version and PHP 5.2.6.

    Any ideas? Thanks.

  3. Those are some very küül labels you got yourself there, Eric… good thinking!

  4. Nice.

    Suggestion: Include a screenshot for item #1. Us fussy designer types can’t be bothered to install plug-ins if we don’t know what the visual ramifications are in advance. :)

  5. John: I’m not sure. Line 40 of the PHP is:

    if ($options->humantime) $tweet->created_at = _mw_lt_human_time($tweet->created_at,2,true);

    …which is to say, if the “human time” option is set, then set a certain piece of the data to be something else. I don’t get that warning when I run the plugin, but then maybe I don’t have the right PHP warning level set. Also, I don’t have PHP 5.anything available, being on 4.x. Perhaps that’s the difference?

    Update: it looks like it is a PHP5 thing, at least according to many of the results I got in my search via Google. The top result was actually WordPress related, and its recommendation was to change your error reporting via the php.ini file. That doesn’t really seem like a great answer, since it seems more like ignoring the problem than solving it, but I didn’t find anything more substantial. In fact, most answers seemed to go along the lines of this one, which says: “…since PHP 5 still has some unresolved compatibility issues with its elder brother (PHP 4) it kinda makes you pay the price of being cutting edge.”

    And then there’s this PHP bug report, but to be honest, I don’t really understand it. My knowledge of PHP, like my use of English, is entirely based on intuition and absorptive learning.

  6. Fine, Mike, if you have to be that way, the plugin page has a screenshot now. Sheesh. Designers!

  7. Frank: I’m actually thinking about adding the ability to set color themes in a future version through an admin Settings page, and your code has given me several pointers as to how to go about that. Thanks!

  8. Thanks, Chriztian. Say, do you (or does anyone) know if Safari 3 finally supports input selection when you click on a label’s text? Because Safari 2.x doesn’t, at least not for me, which makes those labels a lot less useful (and potentially rather frustrating).

  9. @Eric: Welcome. I wait and hope for a new version of your plugin with a minimize design for all areas in the wp-admin.

  10. @Eric: Yes! I just tried it out and click labels in Safari 3.1.1 does give the input focus.

  11. Hello Eric,

    i have write more functions and more css in your very nice plugin.
    When you like, please look in the new version on the same url of my first comment – DL-Link.

    Now it is possible to use your new menu only, when aktivate the user-style mw-fresh or mw_classic.
    News in css: non fix width for the admin-area and the category-box is on the sidebar when aktivate your new admin-theme.

    I hope you enjoy this. I write in your plugin, i like your very nice idea and css.
    WIth best regards

  12. Nicely done, Eric. The changes to the WordPress admin screens via your plugin definitely appeal to my sense of aesthetics, too.

  13. Thanks so much for the admin plugin! I can’t wait to try it. I’ve been attempting to do something similar myself but haven’t got very far yet.

    Next I want to try to get that save/publish box back down below the post field and move the categories & tags back up to the sidebar. I’m always looking for the publish/save box at the bottom and I know I’ll be forgetting to put in the tags if they’re not up where I can see them. I’m not sure if it’s possible to do this without editing the admin templates though :(

  14. @Eric Ok, no worries. Thanks for for the great plugin.

  15. Peter: good to see you, sir! I’m not at all surprised you and I share an aesthetic sense, actually.

    Kevin: röck! Thanks for the answer. I’m glad to hear they got that fixed.

    Megan: I’m absolutely with you on desired changes to the “Write Post” page, but those aren’t really about minimizing the admin UI so much as making it work better for people like you and me. (I also want the excerpt to have higher visibility so I don’t forget it, either.) I’ve done some hacking of that page’s markup for myself, but that doesn’t really work for most people.

    I’m think it might be possible to substitute an entirely new page for the existing one, though, so the plugin route still seems possible. Alternatively, even if reworking the “Write Post” page’s markup is out, a plugin could be made to check that certain bits of information (categories, tags, excerpt, etc.) have been supplied and throw up a warning flag if not. Hopefully one or both will come to pass!

  16. Hello Eric,

    SORRY for my many comments!
    I have also write a update. I have included the tag and category-box in the sidebar. The plugin works great with WP 2.5 and bigger. It is possible to use the Plugin SimpleTags with this nice plugin. When aktivate the Plugin SimpleTags, then it is faster end better in WP 2.6 – v2.6 has a new function for deactivation meta boxes.
    I have change the Menu in a new form, your new menu plus button Design is on the right site, how in the wishes on comment #13 from Megan.

    I have make a screenshot.
    And you can also download the new version on the same adress (zip) how in comment #1.

    When you like and enjoy, then i make a blogpost with the new version or upload to the SVN of wp.org?
    Sorry also for my many comments and passion.
    With best regards

  17. I also had an issue getting the twitter plugin to work with php5. What I found is that the problem is that when you use json_decode (line 162), you are returning the value as an array. Since php5 redid most of the object model, you can’t reference that array as an object in php5, which you all over the place. To fix this, I just had to change json_encode’s 2nd parameter to false. Since that may make installations of json on php4 explode, I added an additional if clause to check. Here is the modified _mw_lt_json_parse function as works for me. As always, everyone, use at your own risk. WebDev is my forte, not php. :p

    FUNCTION _mw_lt_json_parse($stream) {
    if (function_exists('json_decode')) {
    if(phpversion() >= 5){
    $result = json_decode($stream, false);
    $result = json_decode($stream, true);
    } else {
    if (!class_exists('Services_JSON')) require_once("mw_latest_tweet/json.php");
    $parser = new Services_JSON();
    $result = $parser->decode($stream);
    return $result;

  18. Eric,

    You might like to know that you’re using a deprecated function in your MW Adminimize plugin.

    The function get_bloginfo() should be used in place of get_settings() .

    Additionally, the file mw_adminimize.php should really be placed inside the mw_adminimize directory for better file organisation.

    Nice work on the UI changes with this plugin.

  19. get_settings() is deprecated, eh? Thanks for letting me know, john. I didn’t see that mentioned in the API documentation I read, but I might have missed it.

    As for the file organization, yeah, I suppose so. I still instinctively think of plugins as having to live at the ‘root level’ of wp-content/plugins, even though I know intellectually that’s not the case. I’ll probably get it done in a future version.

  20. Thanks, Christopher! I’ll have to give that a workout and see if things go wonky in PHP4 or not. I know, they shouldn’t. And if I had a nickel for every time I’ve said that about code I’m writing or adding… well, I wouldn’t have to worry about my retirement, that’s for sure.

  21. Getting that same error:

    “Warning: Attempt to assign property of non-object in /home/nolageek/public_html/wordpress/wp-content/plugins/mw_latest_tweet.php on line 40”

    Replacing that function didn’t fix it though. :(

  22. Please Eric,
    i have change the informations from john in the new releases of your plugin. I have see this problems and write new thsi functions and give more wp-standard and more flexibilitiy to the user-account in wp.
    Please see my comment #16 and write me a answer.
    When you like, then i puplished the new version with your name. You Sytle is nice and i have only write the new functions for wp.

    With best regards and best wishes.

  23. Eric, thanks for these. Great work. I happened to install the Twitter plugin while Twitter was having some downtime (the odds of this happening can only be calculated by C3PO, I’m sure) and the one thing I noticed about the plugin is that it doesn’t have any default text to show if Twitter is down and there is no cache to rely on.

    Other than that, kudos.

  24. Hey, Colin, glad you like it! I’ve written a v1.1 that incorporates bloginfo(), Christopher’s altered JSON parsing routine, and a change to the plugin’s file arrangement (I put it into the directory). I’ll put up a beta very soon, but I’d like to hear more about your idea. My use case (not everyone’s, of course) is that I have the plugin push out all of the markup and to not return anything if there’s no latest tweet text, so that way nothing shows up unless there’s existing text. Do you think I should return an error or other message (in place of the text) instead? If so, any suggestions?

    ALSO: Twitter has just lowered its API call limit to 30/hour. Everyone set your cache update interval accordingly.

  25. Frank, I appreciate your efforts to update the plugin, but of course I also want to keep my own code up to date—it’s how I learn. I did grab a copy of your version to take a look, and hope I’ll stay current.

  26. @Eric: Nice, i hope you enjoy the new functions and code for your plugin. I work a little bit at the next version with addin for a field for add a category. Then i think it is enough and you can update your plugin.
    When you think, you are ready with a stable version (i think 0.4 is stable), then upload please to wordpress.org/extend/plugins/. This is very good for automaticly update in the wp-admin.
    Best wishes

  27. Pingback ::

    WordPress Admin Theme Adminimize - bueltge.de [by:ltge.de]

    […] Stylesheet für das Admin-Menu kommt von Eric Meyer, der daraus das Plugin „MW Adminimize“ gemacht hat. Mit diesen Design hat alles angefangen und ich danke Eric sehr für diese […]

  28. @Eric: now i have write a new version with more features. When you will see, please use the same download-adresse hwo in comment #1.
    Thank you very much.

    * I thnik is a ery nice plugin for more usability in wp-admin and maybe we can send to the plugin competition, do you like it?

  29. Eric, a little more than a month ago I made an admin theme called Baltic Amber. It includes a backend color composer that creates the whole color pallet out of only two base colors which user can specify (using a simple color wheel) or set to random. Color generator uses a set of color rules, so you would never get those red on green color pallets that hurt the eyes. Here are a few screenshots.

  30. Eric, now i have ready the new version with many options for the admin and user. It ist posible to change the admin-design with your nice idea for a small header and a better menu. Now is compatibility with drop down plugins and it is possible to set the menu and all meta-boxes.

    I have include many functions and options and new styles for the backend-style. The styles are only for a demo – maybe the user write a new color-scheme.

    Download is an same adress of comment #1.

    Please, i will upload to the wordpress.org-SVN for easy update and more informations to all users. I have leve the nice name and your name in the description.
    Please give me a answer and a feedback for upload?! Thank you very much and best wishes.

  31. Eric,

    I have downloaded and installed your Adminimize plugin for WP 2.5.1, unfortunately the large blog title is still showing and not pushing to the top (as is shown in your screenshot). I have uploaded a screenshot here: http://www.scrnshots.com/users/jacobburke/screenshots/22370

    Any help you can provide me is greatly appreciated.


  32. Eric, are you still supporting this plugin? I have not received a response from you with my problem. I have since upgraded to WordPress 2.6 and am still having the same issue with the blog title not being minimized and pushed to the top. Hope to get some help with this soon! Thanks!

  33. Hey, Jacob, sorry for the silence– new baby and other demands have kept me away from this. I’m supporting the plugin to the extent that I’m providing it, but I don’t know that I can give a whole lot of one-on-one help for other installs. I’ll try, though.

    I know the plugin works on my WP2.6 install as it did on 2.5.x. Of course, my install is not your install. The selector on the rule that does the shrinking and moving is:

    #wpwrap #wphead h1

    Does that match the markup tree in your admin page(s)? If not, that’d be the problem. The other possibility is that the stylesheet isn’t being loaded at all for some reason. Try inspecting the element in Firebug to see what’s what.

    Having seen your screenshot, it does feel to me like there’s a difference in markup that causing the selector to fail. Why there would be a difference, I don’t know, but finding out why might help improve the plugin.

  34. Eric,

    I have checked the element and the tree is different with the plugin activated.

    #wpwrap #wpcontent #wphead h1

    I hope this helps, I am thinking that the stylesheet may not be loading correctly.


  35. Eric, I found the issue! What I did was copy over the entire mw-adminimize folder to my plugins folder. The plugin was looking in that folder and not the mw-adminimize folder inside of that folder. I had modified the script for my installation.


    The plugin is working now, thanks again for a better looking admin interface!


  36. Can anyone confirm for me if this works with 2.6.1? I’ve tried a number of twitter plug-in’s & had success with Twitter for WordPress: http://bit.ly/E95ES with 2.6, but since the upgrade – none work for me (& I’ve tried a few).
    If it’s something to do with this update – then I’m happy enough, but if some of you out there has success displaying your tweets with 2.6.1 I’d ‘really’ like to know… because I’m obviously doing something rather incorrectly
    thanks in advance

  37. Hello Eric.

    I like your WordPress plug-in for Twitter.

    Thanks for this. :)

  38. Hi Eric.
    I have one problem with adminimize and I would like know if u can help me.
    It not give me the information about what users can make. when I click on the settings tab to view the permissions and restrictions all checks are white. it don’t give me this informations. this is normal?
    sory my enlish, I am brazilian

  39. I just made a variation on the plug-in:

    Toolbarize plug-in

  40. Pingback ::

    Grungy WordPress Theme « Tim Gieseking | Web Developer | St. Louis, MO

    […] theme intended for use on a personal blog. It supports a Flickr stream and Eric Meyer’s latest tweet […]

Add Your Thoughts

Meyerweb dot com reserves the right to edit or remove any comment, especially when abusive or irrelevant to the topic at hand.

HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <em> <i> <q cite=""> <s> <strong> <pre class=""> <kbd>

if you’re satisfied with it.

Comment Preview