Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter bensword

    (@bensword)

    I didnt find this option to view what is the load time.

    Currently, I have reverted to the previous version and am not updating.

    Thread Starter bensword

    (@bensword)

    Hey

    Look at my hosting team reply:

    I’m not entirely sure, but I found this piece of code in the plugin, inside includes/class-xmlsitemapfeed.php, function filter_request:
    // set up query filters
    $zone = $this->timezone();
    if ( get_lastdate($zone, $news_post_type) > date(‘Y-m-d H:i:s’, strtotime(‘-48 hours’)) ) {
    add_filter(‘post_limits’, array($this, ‘filter_news_limits’));
    add_filter(‘posts_where’, array($this, ‘filter_news_where’), 10, 1);
    } else {
    add_filter(‘post_limits’, array($this, ‘filter_no_news_limits’));
    }

    Here’s one way that the plugin could intend to only have one post on sitemap-news.xml: if that condition of having a post published earlier than two days ago is not valid (meaning your latest post is 2 days old), then the sitemap will only contain the most recent post. I don’t understand the logic behind that, but that’s not my call. The date of the latest post is obtained through a function provided by the plugin as well, get_lastdate().
    This function retrieves the date of the latest post but stores some things like the timezone in Memcache. The plugin also clears the cache and asks the database for a fresh copy of the options which represent interest, also inside includes/class-xmlsitemapfeed.php in the function cache_flush().
    I think the problem relies here, although I can’t explain it 100%. The cache isn’t flushed correctly, as the developer only clears certain keys inside the cache. Relying on that, you’ve ended up several times with that single post on your sitemap-news.xml. But if I go in that cache_flush function and add a wp_cache_flush() call, which tells WordPress to clear the entire object cache, the plugin works just fine. That line of code makes all the difference, although it is only a fix of mine which isn’t necessarily a best practice.

    Maybe given this info you could provide to the developer he could narrow down the issue more than I could, for now all I managed is to provide some clues that I hope will be helpful.

    Thread Starter bensword

    (@bensword)

    Presslab are my hosting company.

    They have found an issue with the Yoast plugin and deployed a patch.

    The sitemap seem to be working now.

    Thread Starter bensword

    (@bensword)

    Hey,

    Well the issue is back also with this copycat plugin.

    I have reinstalled your but still get the error.

    Thread Starter bensword

    (@bensword)

    Yeah. I actually changed to a similar plugin and it now works…

    Thread Starter bensword

    (@bensword)

    no, I have also picked all categories and its not working.

    It actually was showing all of the articles one day and then went back to showing only one…
    It comes and goes…

    Thread Starter bensword

    (@bensword)

    Hey

    Sorry, I didnt catch your reply on this one.

    Guess it was because the issue went away….

    But now it is back again.
    Shows only one post on the sitemap…

    php version: 5.6.30

    On thing is my admin dashboard runs on https….while site is on http.
    Might have some relation?

    Thanks,
    Ben

Viewing 7 replies - 1 through 7 (of 7 total)