Support » Plugin: XML Sitemaps » Plugin resets sitemap settings when upgrade to newer version

  • Resolved anthonywoods

    (@anthonywoods)


    Hi,

    I was wondering if anyone can help. I use this fantastic plugin for a lot of websites and by default I leave all settings in the plugin un checked so we have a simple page sitemap with no inclusions of the blog, authors, categories or anything else except pages and posts.

    The issue I am currently having is each time the plugin is updated it actually resets the settings to default and checks all the settings. We are trying to keep the plugin up to date on all our websites but having to configure our settings each time the plugin is updated can become annoying.

    I think this is caused by the following line of code:

    xml-sitemaps.php

    static function init_options() {
            $defaults = array(
                'inc_authors' => true,
    	        'inc_categories' => true,
    	        'inc_tags' => true,
    	        'inc_archives' => true,
                'exclude_pages' => '',
    	        'mobile_sitemap' => false,
    	        'version' => xml_sitemaps_version,
    	        'empty_author' => false,
          	);

    I have tried to alter these settings from “True” to “False” but as you can guess once an update for this plugin comes along it will over ride them.

    I am wondering if there is a work around for this plugin or do you have any plans to save existing settings while the plugin is upgraded or deactivated (as the same happens on deactivation).

    https://wordpress.org/plugins/xml-sitemaps/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mike Koepke

    (@mike_koepke)

    Yikes! Any update should have not overwrite prior settings. The code you reference does set the initial options but after that declaration there is a call to merge existing settings with the initial ones. It should only add array elements that don’t exist.

    I’ll have to troubleshoot to see where the bug is.

    Plugin Author Mike Koepke

    (@mike_koepke)

    Anthony,

    Release 2.3.1 should resolve the issue with option settings not being preserved. Let me know how it worked out.

    Mike

    I’m not sure whether this started happening after the 2.3.1 update or before, but my settings are getting wiped even more regularly than with each update – my best guess is it’s every hour or so.

    Plugin Author Mike Koepke

    (@mike_koepke)

    I think I tracked down why finally. It wasn’t making sense on the logic why they would get reset. It appears is actually happens when other plugins and/or WordPress itself gets updated and we get an activation message. It overwrites the settings. I’m testing out the fix.

    Linn Øyen Farley

    (@linnalexandra)

    Thanks so much for the update!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Plugin resets sitemap settings when upgrade to newer version’ is closed to new replies.