WordPress.org

Ready to get started?Download WordPress

Forums

wp_get_archives and 3.0 (11 posts)

  1. mike
    Member
    Posted 4 years ago #

    I had a simple archives page set up pre-3.0 that worked well. It had:

    <?php wp_get_archives('type=postbypost'); ?>

    Post-upgrade, the function no longer returns anything and in fact stops the execution of the page. However, if I replace it with

    <?php wp_get_archives('type=postbypost&limit=50'); ?>

    It prints out just fine. If I put a large number like 5000, it fails again. Why doesn't the default limit of "all" no longer work? I would like to use the "all" option because the number of posts increases fairly quickly over time.

  2. MichaelH
    Member
    Posted 4 years ago #

    I'm not able to duplicate your problem.

    Maybe a plugin causing the problem.

  3. mike
    Member
    Posted 4 years ago #

    Indeed, WP Super Cache appears to be the culprit (even if upgraded to the most recent version).

    So I next tried W3 Total Cache as well and it again broke the wp_get_archives. So it seems that caching + unlimited archive listing do not agree.

    Any idea what the underlying issue could be?

  4. MichaelH
    Member
    Posted 4 years ago #

    Changeset 14486 looks like it made a change with cache of wp_get_archives but can't say why those caching programs have problems with that...

  5. Donncha O Caoimh
    Member
    Posted 4 years ago #

    That change is to how it caches using the object cache. WP Super Cache doesn't have an object cache so I don't think that is it. Perhaps a memory issue?

    Mike - any memory errors in your PHP error logs?

  6. mike
    Member
    Posted 4 years ago #

    Thanks for the responses. I need to set up a PHP error log on my server. I don't think that is the problem as the site is on a dedicated server with 8Gigs of RAM. PHP's memory settings seem ok as well:

    max_execution_time = 30     ; Maximum execution time of each script, in seconds
    max_input_time = 60	; Maximum amount of time each script may spend parsing request data
    memory_limit = 8M      ; Maximum amount of memory a script may consume (8MB)

    Will get back to you.

  7. mike
    Member
    Posted 4 years ago #

    Easier than I thought to set up the error log. It is a memory issue:

    [25-Jun-2010 01:48:58] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 102286 bytes) in /home/REMOVED/wp-includes/general-template.php on line 1025

    So not really a bug, but I would think that 8MB would be enough. Upping it to 32MB didn't help. Is that a unreasonable amount? There are about 1250 posts in the full postbypost output.

  8. MichaelH
    Member
    Posted 4 years ago #

    Use the memory bump plugin from http://wordpress.org/extend/plugins/memory-bump/

  9. Frederick Townes
    Member
    Posted 4 years ago #

    8MB is not enough for default WordPress. There are parts of WordPress core that require many times that amount. Most business installations have 96M or more that I've seen.

  10. mike
    Member
    Posted 4 years ago #

    Yes, 96MB limit got it working. The plugin didn't help though. 96MB seems kind of ridiculous. Something about the 3.0 upgrade did something to the memory usage of wp_get_archives().

  11. Frederick Townes
    Member
    Posted 4 years ago #

    What I know for certain is that W3TC does not need 96M to run unless there is other code misbehaving or otherwise demanding more memory itself. There are a number of tricks you can use and probably some plugins out there that will show you the memory usage of given operations. You may want to start there.

Topic Closed

This topic has been closed to new replies.

About this Topic