{"id":2148,"date":"2010-01-19T21:25:30","date_gmt":"2010-01-19T20:25:30","guid":{"rendered":"http:\/\/www.itwriting.com\/blog\/2148-fixing-a-wordpress-plugin-setting.html"},"modified":"2010-01-19T21:25:30","modified_gmt":"2010-01-19T20:25:30","slug":"fixing-a-wordpress-plugin-setting","status":"publish","type":"post","link":"https:\/\/www.itwriting.com\/blog\/2148-fixing-a-wordpress-plugin-setting.html","title":{"rendered":"Fixing a WordPress plugin setting"},"content":{"rendered":"<p>I changed the theme and plugins used on this blog <a href=\"http:\/\/www.itwriting.com\/blog\/2060-seven-years-of-blogging-and-a-redesign.html\" target=\"_blank\">recently<\/a>. Along the way I managed to slightly corrupt the settings for one of the plugins, <a href=\"http:\/\/www.gdstarrating.com\/\" target=\"_blank\">GD Star Rating<\/a>, the result being that the stars in the Top Rated Posts widget would not display. I figured out the problem: the plugin stores the path to the graphics which represent the stars, and this had incorrectly been set to an https path. Since I use a self-generated SSL certificate, the result was that browsers did not trust the connection and refused to display the graphics.<\/p>\n<p>Unfortunately this path is not configured directly in the plugin options, as far I can see. I temporarily changed it to display a text rating while I worked out how to fix it.<\/p>\n<p>The setting had to be in the MySQL database somewhere; and I found it. It is one value in a massive 10,000 character field called&#160; option_value, in the main options table. It seems that most of the settings for the plugin live in this single colon-separated field, even though the plugin also creates 12 tables of its own for the ratings data. Hmm, I don\u2019t like the way this implemented. How often does this field get queried and parsed?<\/p>\n<p>Still, the immediate problem was to alter the value. I ran up the MySQL interactive SQL utility and typed very carefully. This is where one false move can obliterate your WordPress install; I\u2019m reminded of someone I knew (not me, honest) who set all his company\u2019s customers to have the same address with a careless update missing its WHERE clause. Fortunately this is only a blog. Transactions are also good. Anyway, what could go wrong? it was a simple combination of UPDATE, REPLACE and WHERE.<\/p>\n<p>It worked, the stars have returned, and I know a little bit more about the innards of WordPress and this particular plugin.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I changed the theme and plugins used on this blog recently. Along the way I managed to slightly corrupt the settings for one of the plugins, GD Star Rating, the result being that the stars in the Top Rated Posts widget would not display. I figured out the problem: the plugin stores the path to &hellip; <a href=\"https:\/\/www.itwriting.com\/blog\/2148-fixing-a-wordpress-plugin-setting.html\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Fixing a WordPress plugin setting<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,62,96],"tags":[210,620,1036],"class_list":["post-2148","post","type-post","status-publish","format-standard","hentry","category-blogging","category-open-source","category-web-authoring","tag-blogging","tag-mysql","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/2148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/comments?post=2148"}],"version-history":[{"count":0,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/2148\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/media?parent=2148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/categories?post=2148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/tags?post=2148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}