Blog Fix: Twitter Tools plugin and WordPress 2.3

Share on facebook
Share on google
Share on twitter
Share on linkedin

I’m going through and reviewing my site after updating it to WordPress 2.3 and it looks like there are still some hidden “issues” stemming from the migration to the new Category/Tagging structure. The latest one that I found is related to the “Twitter Tools” plugin.

Update: Some people were reporting that “term_ID” was not working where “ID” was in capitals so I have changed the code references below to lower-case (e.g., “term_id”). Remember to retype your quotes!

Here is what I did to fix:

  1. Find, (Download), Open and Edit the “twitter-tools.php” file which resides in the “wp-content/plugins/twitter-tools/” directory
  2. Locate the following lines of code (around line 868):

    function aktt_options_form() {
    global $wpdb, $aktt;
    $categories = $wpdb->get_results(”
    SELECT *
    FROM $wpdb->categories
    ORDER BY cat_name
    “);
    $cat_options = ”;
    foreach ($categories as $category) {
    if ($category->cat_id == $aktt->blog_post_category) {
    $selected = ‘selected=”selected”‘;
    }
    else {
    $selected = ”;
    }
    $cat_options .= “\n\t<option value=’$category->cat_id‘ $selected>$category->cat_name</option>”;
    }

    and change it to:

    function aktt_options_form() {
    global $wpdb, $aktt;
    $categories = $wpdb->get_results(”
    SELECT *
    FROM $wpdb->terms
    ORDER BY name
    “);
    $cat_options = ”;
    foreach ($categories as $category) {
    if ($category->term_id == $aktt->blog_post_category) {
    $selected = ‘selected=”selected”‘;
    }
    else {
    $selected = ”;
    }
    $cat_options .= “\n\t<option value=’$category->term_id‘ $selected>$category->name</option>”;
    }

    Note: you may need to change the quotation marks if you cut and paste from this entry. Simply highlight the quote marks and enter them again using your keyboard. (Sorry about the loss of code formatting…there are tabs in there to nest things properly but it shouldn’t affect the code.)

    • The database items that changed are (pre-2.3 –> post 2.3):
      • categories –> terms
      • cat_name –> name
      • cat_id –> term_id
  3. Save your changes to the twitter-tools.php” file and save to the “twitter-tools” plugin directory. That’s it!

HTD Says: More tweaks to themes and plug-ins because of WordPress 2.3 upgrade potentially coming. Stay tuned.

- Advertisement -
- Advertisement -
- Advertisement -

Global Product Review Disclosure

Disclosure: This is a global disclosure for product review articles on HighTechDad. It does not apply to Automobile reviews and there are other exceptions. Therefore, it may or may not be applicable to this particular article. I may have a material connection because I may have received a sample of a product for consideration in preparing to review the product and write this or other content. I was/am not expected to return the item after my review period. All opinions within this and other articles are my own and are typically not subject to the editorial review from any 3rd party. Also, some of the links in the post above may be “affiliate” or “advertising” links. These may be automatically created or placed by me manually. This means if you click on the link and purchase the item (sometimes but not necessarily the product or service being reviewed), I will receive a small affiliate or advertising commission. More information can be found on my About page.

Leave a Comment

60 thoughts on “Blog Fix: Twitter Tools plugin and WordPress 2.3”

  1. Your Twitter Tools fix works great so far. I did have to go ahead and retype the quotation marks, as you stated. The funny thing was that when I went out and changed them en mass the fix did not work. So I started over again and changed the double quotes one line at a time as the WordPress plugin interface reported line errors upon activation. Then I would reactivate the plugin and fix the next line until the plugin successfully activated. The thing is that not all the double quotations were changed before the plugin started working. But the plugins seems to be working now so I will leave it alone.

    Thanks for your efforts!

  2. Your Twitter Tools fix works great so far. I did have to go ahead and retype the quotation marks, as you stated. The funny thing was that when I went out and changed them en mass the fix did not work. So I started over again and changed the double quotes one line at a time as the WordPress plugin interface reported line errors upon activation. Then I would reactivate the plugin and fix the next line until the plugin successfully activated. The thing is that not all the double quotations were changed before the plugin started working. But the plugins seems to be working now so I will leave it alone.

    Thanks for your efforts!

  3. For some reason, I still can’t get it to work. When trying to activate the plugin, I get the following error: “Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/html/wp-content/plugins/twitter-tools.php on line 865”

    I imagine it has to do with the quotes but I’ve checked all the ones without that block of code.

    Any ideas?

  4. For some reason, I still can’t get it to work. When trying to activate the plugin, I get the following error: “Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/html/wp-content/plugins/twitter-tools.php on line 865”

    I imagine it has to do with the quotes but I’ve checked all the ones without that block of code.

    Any ideas?

  5. Bernard,

    You might want to check to see if Twitter Tools has been updated. I know the author had created a fix and it might be available now. The other thing you could do is redownload it, make the changes and then deactivate what you have, delete from your plugins directory and then put the new one in there.
    Hope it works!
    -HTD

  6. Bernard,

    You might want to check to see if Twitter Tools has been updated. I know the author had created a fix and it might be available now. The other thing you could do is redownload it, make the changes and then deactivate what you have, delete from your plugins directory and then put the new one in there.
    Hope it works!
    -HTD

  7. Update: it must be some weird formatting issue? Rather than copying and pasting your change, I went through and manually updated the database items/terms. THAT seemed to work.

    Thank you! :)

  8. Update: it must be some weird formatting issue? Rather than copying and pasting your change, I went through and manually updated the database items/terms. THAT seemed to work.

    Thank you! :)

  9. @ Jenn,

    Thanks for the note back. I have edited my post to really (hopefully) show that you need to change the quotes.

    Glad it worked!

    -HTD

  10. Thanks for your great advice!!

    At first I couldn’t make it work by cutting and pasting, but then I realized that two single quotation marks placed together appear as a double quotation in the code you posted.

    The easiest way for this to work is to just find:

    The database items that changed are (pre-2.3 –> post 2.3):
    categories –> terms
    cat_name –> name
    cat_ID –> term_ID

    and change every instance manually.

    Other than that it works great. Thank you.

  11. Thanks for your great advice!!

    At first I couldn’t make it work by cutting and pasting, but then I realized that two single quotation marks placed together appear as a double quotation in the code you posted.

    The easiest way for this to work is to just find:

    The database items that changed are (pre-2.3 –> post 2.3):
    categories –> terms
    cat_name –> name
    cat_ID –> term_ID

    and change every instance manually.

    Other than that it works great. Thank you.

  12. @ Wizo,

    Thanks for the feedback and I’m glad it works. Sorry for the confusion about the quotation marks. That is part of the reason why I edited the post to try to highlight that a bit more.

    -HTD

  13. @ Wizo,

    Thanks for the feedback and I’m glad it works. Sorry for the confusion about the quotation marks. That is part of the reason why I edited the post to try to highlight that a bit more.

    -HTD

  14. Francois, I had the same problem. Change the reference from term_ID to term_id and see if that works. It did for me. The MySQL db is case sensitive.

    Also I didn’t understand the selected=selected HTML so I changed that to just $selected = `selected`, but that shouldn’t make a difference.

  15. Francois, I had the same problem. Change the reference from term_ID to term_id and see if that works. It did for me. The MySQL db is case sensitive.

    Also I didn’t understand the selected=selected HTML so I changed that to just $selected = `selected`, but that shouldn’t make a difference.

  16. The fix worked well: thanks.

    I chose to make the corrections manually, rather than risk formatting characters from the cut-and-paste. And, like Francois, I was unable to get my term option to save until I changed the term_ID to term_id.

    Seems to be all good now. :-)

  17. The fix worked well: thanks.

    I chose to make the corrections manually, rather than risk formatting characters from the cut-and-paste. And, like Francois, I was unable to get my term option to save until I changed the term_ID to term_id.

    Seems to be all good now. :-)

  18. Only issue I’m having now is the daily digests seem to be GMT based (?) so not all of my twits from the day make it to the digest. Nobody seems to have an answer, so if you figure that one out please let me know!

    I looked in twitter-tools.php at do_digest_post() but I can’t figure it out. Thanks in advance for any help!

  19. Only issue I’m having now is the daily digests seem to be GMT based (?) so not all of my twits from the day make it to the digest. Nobody seems to have an answer, so if you figure that one out please let me know!

    I looked in twitter-tools.php at do_digest_post() but I can’t figure it out. Thanks in advance for any help!

  20. Thanks for all of the updates. I will make an edit to my post to make sure it shows as “term_id” and not “term_ID”.

    Glad that my fix is working out!

    -HTD

  21. Thanks for all of the updates. I will make an edit to my post to make sure it shows as “term_id” and not “term_ID”.

    Glad that my fix is working out!

    -HTD

  22. Thanks for the fix. I would advise anyone having issues to make sure that they aren’t just copying and pasting over what’s already in twitter-tools.php. Comment out the existing code and then add in the fixed code. You’ll also want to double check all of your double and single quotes and make sure that they are formatted correctly. When I copied them over, they weren’t the right characters and it broke the script.

  23. Thanks for the fix. I would advise anyone having issues to make sure that they aren’t just copying and pasting over what’s already in twitter-tools.php. Comment out the existing code and then add in the fixed code. You’ll also want to double check all of your double and single quotes and make sure that they are formatted correctly. When I copied them over, they weren’t the right characters and it broke the script.

  24. @ Joshua,

    Thanks for the feedback. Glad that it worked. Yes, my standard practice is always to comment out the old code and put in the new one. That way, you can use it for reference and also it allows you to roll back to it easily.
    Yes, if you do cut and paste, you will have issues with the quotes. That is why I put in that Warning section.

    -HTD

  25. @ Joshua,

    Thanks for the feedback. Glad that it worked. Yes, my standard practice is always to comment out the old code and put in the new one. That way, you can use it for reference and also it allows you to roll back to it easily.
    Yes, if you do cut and paste, you will have issues with the quotes. That is why I put in that Warning section.

    -HTD

  26. Thanks very much for this fix. It’s great to see someone supporting this plugin!

    Perhaps you can help me with another Twitter Tools problem? I’d like the daily archive of Tweets to roll over at midnight LOCAL time, not GMT. This would show a complete day of Tweets starting in the morning (not at 5PM the previous day) and ending at night. Any idea how to fix that?

  27. Thanks very much for this fix. It’s great to see someone supporting this plugin!

    Perhaps you can help me with another Twitter Tools problem? I’d like the daily archive of Tweets to roll over at midnight LOCAL time, not GMT. This would show a complete day of Tweets starting in the morning (not at 5PM the previous day) and ending at night. Any idea how to fix that?

  28. @ Maria,

    You would probably have to dig into the guts of the plug-in itself to see that. I haven’t done that but it might be pretty easy to hack it.

    -HTD

  29. @Michael Thanks for the quick response. I’ve dug in a bit but don’t know enough PHP to figure it out. If you ever dig in and do figure it out, please let me know. It’s unfortunate that the plugin’s author is interested in collecting donations for his work but not providing any support for it.

  30. @Michael Thanks for the quick response. I’ve dug in a bit but don’t know enough PHP to figure it out. If you ever dig in and do figure it out, please let me know. It’s unfortunate that the plugin’s author is interested in collecting donations for his work but not providing any support for it.

  31. @ Maria,

    Well, I briefly scanned the PHP (I don’t know much about PHP either). But then I was thinking. Have you checked the Options part of WordPress to confirm that your Date & Time is set correctly? Check the UTC time and the time differential that you have configured.

    I did find a part in the code that does refer to GMT but didn’t dig into it very far.

    -HTD

  32. @ Maria,

    Well, I briefly scanned the PHP (I don’t know much about PHP either). But then I was thinking. Have you checked the Options part of WordPress to confirm that your Date & Time is set correctly? Check the UTC time and the time differential that you have configured.

    I did find a part in the code that does refer to GMT but didn’t dig into it very far.

    -HTD

  33. @Michael

    I checked and it’s set fine. It’s weird: the post appears at midnight my time, but the Tweet times begin at 5 PM two days before and end at 5 PM the previous day. As if my tweeting for a day begins at 5 PM. That doesn’t happen to you?

    I’m a GMT-7 in Arizona.

    If you come up with anything, please let me know.Thanks for your help.

  34. @Michael

    I checked and it’s set fine. It’s weird: the post appears at midnight my time, but the Tweet times begin at 5 PM two days before and end at 5 PM the previous day. As if my tweeting for a day begins at 5 PM. That doesn’t happen to you?

    I’m a GMT-7 in Arizona.

    If you come up with anything, please let me know.Thanks for your help.

  35. I’ve used this fix today for 2.3.1, but copying/pasting the code – even though I verified that everything was the same as what you posted – didn’t work. It would cause a fatal error when I would try to activate the plugin after the modification you suggested.

    My fix for that was to go in and manually type in the changed database items.

    Maybe the issue is with the quotation marks? I noticed that you changed a few ‘ ‘ – spaced apostrophes – to quotation marks. I didn’t make the same change when I typed in the new database items and now everything is working fine for me. I should specify that on your code snippets up there, it doesn’t show the spaced apostrophes in either snippett, but I did have the apostrophes in my twitter-tools.php file.

    Anyway, I’ve got it figured out and it’s working fine, so thanks for the fix! :)

  36. I’ve used this fix today for 2.3.1, but copying/pasting the code – even though I verified that everything was the same as what you posted – didn’t work. It would cause a fatal error when I would try to activate the plugin after the modification you suggested.

    My fix for that was to go in and manually type in the changed database items.

    Maybe the issue is with the quotation marks? I noticed that you changed a few ‘ ‘ – spaced apostrophes – to quotation marks. I didn’t make the same change when I typed in the new database items and now everything is working fine for me. I should specify that on your code snippets up there, it doesn’t show the spaced apostrophes in either snippett, but I did have the apostrophes in my twitter-tools.php file.

    Anyway, I’ve got it figured out and it’s working fine, so thanks for the fix! :)

  37. I have updated to wordpress 2.3.3 yesterday and installed twitertools to my blog. Now I am trying to tweet via sms, and it works! the problem is that it takes ages to update my tweets, nut if I log on and update manually it will work. can you guys help me?

  38. I have updated to wordpress 2.3.3 yesterday and installed twitertools to my blog. Now I am trying to tweet via sms, and it works! the problem is that it takes ages to update my tweets, nut if I log on and update manually it will work. can you guys help me?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About HighTechDad

Michael Sheehan (“HighTechDad”) is an avid technologist, writer, journalist, content marketer, blogger, tech influencer, social media pundit, loving husband and father of 3 beautiful girls living in the San Francisco Bay Area. This site covers technology, consumer electronics, Parent Tech, SmartHomes, cloud computing, gadgets, software, hardware, parenting “hacks,” and other tips & tricks.

Recent Articles

Get new HighTechDad articles via email

Don’t miss out on the latest articles from HighTechDad. Subscribe below to get email notifications no more than once a week (probably less).

I respect your Privacy!

– Advertisement –
Scroll to Top

Like what you've read? Get notified!

Don’t miss out on the latest HighTechDad articles! (No more than once a week! I promise!)

*Required field. I respect your Privacy!