INN / link-roundups

A WordPress plugin to make it easy to collect links from around the web, turn them into roundup posts and streamline the production of daily/weekly roundup newsletters using MailChimp. Built and maintained by INN Labs.
https://wordpress.org/plugins/link-roundups/
GNU General Public License v2.0
20 stars 4 forks source link

function lroundups_migrate_options() appears to always overwrite existing options with old options #119

Closed benlk closed 8 years ago

benlk commented 8 years ago

https://github.com/INN/link-roundups/blob/1477b0fddfcaa3ea2e4ecbb8c410937163b5fc72/inc/updates/functions.php#L22-L43

This was noticed when updating Link Roundups using the update button on all production sites. Sites with custom values for the following items were reset:

The affected sites are listed in an email to Adam, and there's only 2, but that's enough that we're going to need to fix this eventually.


    // check for old options and replace the old prefixes with lroundups_
    foreach ( $old_options as $old_option ) {
        $new_option = str_replace(
            array('argo_link_roundups_', 'link_roundups_'), 'lroundups_', $old_option);
        $old_value = get_option($old_option);
        $result = update_option($new_option, $old_value);
        if ($result)
            delete_option($old_option);
    }
aschweigert commented 8 years ago

not super urgent, but we'll definitely want to make sure we address this before we push the next update