Clean Options RSS options

The Clean Options plugin lists options named "rss_(hash value)" and "rss_(hash value)_ts". Where do these options come from? WordPress uses the fetch_rss function to get content from RSS feeds. For example, the dashboard uses fetch_rss() to get incoming links, dev news (wordpress.org/development/feed/), and planet news (planet.wordpress.org/feed/).
The fetch_rss function uses Magpie to cache the feed contents as options named "rss_(hash value)" for the content, and "rss_(hash value)_ts" for the timestamp. If the timestamp is determined to not be "stale", the cached content is used, else the feed is fetched anew.

1: The Clean Options plugin uses the $wpdb object to find all options where the autoload field of the wp_options table is NOT equal to "yes". The results are put into an array.
2: Each option in the array that matches a regex testing for option names beginning with "rss_" (contents) are put into an array, and options that match a regex testing for option names that begin with "rss_" and end with "_ts" (timestamps) are put into another.
3: The length of the timestamp options array is determined.
4: If the sorted timestamp array contains 15 or more options, the timestamp value of the 15'th one is passed to a variable.
5: The timestamp values of the other timestamp options are compared with this value. If there are less than 15 timestamp options, or if a timestamp option has a value that is the same or more recent than the "15'th time", the timestamp option is listed without a checkbox. That is, it can not be selected for preview nor can it be deleted by the Clean Options plugin. If the value of the timestamp option is older than the "15'th time", it can be selected for preview and deleted.
6: Although displayed as pairs in the list, the RSS content options array is not paired with the timestamp array. All content options are listed with a checkbox and can be selected for preview and deleted by the Clean Options plugin.

Should they be deleted by the Clean Options plugin? Note that "15" is used arbitrarily. The appropriateness of this number for any given blog depends on how many fetch_rss calls the blog makes. It is believed that this number is adequate in identifying those options which are Most Likely newer and thereby Most Likely being currently used. Most Likely – NOT – Definitely.

It is not known what the effect would be if a content option were to be deleted without it's corresponding timestamp option also being deleted. Nor is it known what the effect might be if both were to be deleted while still currently being used by the blog. However, if there is a long list of paired "rss_(hash value)" and "rss_(hash value)_ts" options, of those where both have checkboxes and both can be selected for preview, those with the oldest dates should be relatively safe to delete.

The timestamps of older options can be selected and end with "# days old" in BOLD.
Please only remove the older options in which BOTH options of the pair can be selected.

Technorati Tags: , ,

2 Comments

  1. Gaz
    Posted October 28, 2010 at 8:00 pm | Permalink

    Hi

    I just installed v1.3.2 of Clean Options on a WordPress 3.0.1 standalone blog (not a MultiSite blog) – this site originated in WordPress 2.3 and Clean Options found deprecated stuff going that far back, which the WP devs had insisted had been removed – Ha! – well done Clean Options.

    Unfortunately, and the main reason for me adding Clean Options, it is not displaying anyway to view the paired RSS entries – I searched and hunted, and it just does not display the page shown in the screen shots. That "safe" examination and delete method was what I wanted the most from the plugin.

    Can you give any guidance on this? Or is there a bug in the v1.3.2 version that's hiding that page? If it's a simple code edit, could you point me at it please? I have several sites that must be migrated to a new server in the next day or so, and I'm desperate to clean down their wp_options tables before moving them.

    Thanks
    Gaz

  2. Posted November 1, 2010 at 4:50 am | Permalink

    The "safe" examination pre-delete has always been in every version of the Clean Options plugin.

    I am disappointed to learn that WordPress 3.0.1 hasn't removed the deprecated cache feed rows for you. AFAIK the wp-admin/includes/schema.php file should be removing the rss_*** rows.

    The rows used to begin with the prefix rss_*** then with the switch from Magpie to SimplePie it became transient_*** so I'm guessing these are what you're referring to.

    I have been busy working on Clean Options version 2.0 which has what remained of the obsolete code trimmed out of it. My best suggestion is to download an older version of the Clean Options plugin which will hopefully still work with WordPress 3.0.1 from WordPress > Clean Options > WordPress Plugins

    I'm pretty sure Clean Options version 1.3.1 should still "pair" them for you – if my guess about which type of feed rows you mean is correct.