{"id":5647,"date":"2011-02-24T20:30:44","date_gmt":"2011-02-25T01:30:44","guid":{"rendered":"http:\/\/www.allyngibson.net\/?p=5647"},"modified":"2014-01-21T15:13:38","modified_gmt":"2014-01-21T15:13:38","slug":"on-wordpress-upgrades-and-errors","status":"publish","type":"post","link":"http:\/\/www.allyngibson.com\/?p=5647","title":{"rendered":"On WordPress Upgrades and Errors"},"content":{"rendered":"<p>As much as I love and use WordPress, it can occasionally be a major pain in the ass.<\/p>\n<p>Like whenever upgrade time rolls around.  There&#8217;s a certain amount of crossing fingers and praying when I upload a new batch of files to the server.<\/p>\n<p>Is the theme going to break?  Is a plugin going to mung things up?  Will I be able to access my admin screens?<\/p>\n<p>I admit, I am a bad upgrader.  I turn no plug-ins off.  I don&#8217;t make a database back-up right then and there.  I live on the edge of the danger zone!<\/p>\n<p>(Note to self.  Back-up database.)<\/p>\n<p>Yesterday&#8217;s upgrade to WordPress 3.1 went comparatively smoothly.  Nothing seemed to <i>obviously<\/i> break.<\/p>\n<p>But when I went to write a post, the dropdown menus didn&#8217;t work, and WordPress stared at me blankly when I tried to add tags.  I didn&#8217;t realize it, but at the very bottom of the page, far below my screen, WordPress was telling me that I had a php Fatal Error.<\/p>\n<p>This Fatal Error manifested on only two screens &mdash; the Dashboard and the Write Post screens.  I spent two hours last night trying to figure out which plugin caused the trouble.<\/p>\n<p>I eventually narrowed it down to <a href=\"http:\/\/wordpress.org\/extend\/plugins\/twitter-digest\/\">Twitter Digest<\/a>, the plugin I use to archive my tweets into my blog database.  (I had been using Twitter Tools for that, until one day Twitter Tools decided that it didn&#8217;t want to do that anymore.  Twitter Tools is fickle.)<\/p>\n<p>I deactivated the plugin, and everything was fine.<\/p>\n<p>I did some research when I got home from work tonight.  Google led me here &mdash; <a href=\"http:\/\/core.trac.wordpress.org\/ticket\/11827\">a WordPress bug report<\/a>.<\/p>\n<blockquote><p>The implementation of the json_encode and decode compatibility functions is incompatible with plugins that already included the Services_JSON class<\/p><\/blockquote>\n<p>Hmm.  This seemed promising.<\/p>\n<p>I experimented a little with compat.php.  I reactivated the plugin.  The Fatal Errors came back.<\/p>\n<p>Bollocks.<\/p>\n<p>I did more research.<\/p>\n<p>I discovered that Twitter Digest contains the entire JSON class.  Of course it does; it was written for a version of WordPress that didn&#8217;t <i>have<\/i> the JSON functions.  Defining the same function twice would naturally break WordPress.<\/p>\n<p>So I deleted that entire chunk of code from the plugin.<\/p>\n<p>I have my fingers crossed that it works.  It seems to.  I reset the digests, and Twitter Digest has created a tweet archive for yesterday&#8217;s tweets.<\/p>\n<p>Still backing up the database, though. \ud83d\ude09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As much as I love and use WordPress, it can occasionally be a major pain in the ass. Like whenever upgrade time rolls around. There&#8217;s a certain amount of crossing fingers and praying when I upload a new batch of files to the server. Is the theme going to break? Is a plugin going to<a class=\"more-link\" href=\"http:\/\/www.allyngibson.com\/?p=5647\">Continue reading <span class=\"screen-reader-text\">&#8220;On WordPress Upgrades and Errors&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4095],"tags":[58,4096],"class_list":["post-5647","post","type-post","status-publish","format-standard","hentry","category-wordpress","tag-php","tag-wordpress","entry"],"_links":{"self":[{"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=\/wp\/v2\/posts\/5647","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5647"}],"version-history":[{"count":0,"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=\/wp\/v2\/posts\/5647\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5647"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.allyngibson.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}