• Hi Hector,

    WordPress Popular Posts plugin Version 7.0.1, then 7.1.0
    WordPress version: 6.5.5
    PHP version: 7.4.33

    I had a problem when trying to delete (bin) a post or page – it caused the dashboard to be replaced by a blank screen showing:
    Fatal error: Allowed memory size of 402653184 bytes exhausted (tried to allocate 20480 bytes) in htdocs/wp-includes/functions.php on line 7181

    When I disabled the WPP plugin, I could bin a post as normal.

    I saw another support topic mention to reset the cache by changing the setting Data Caching to Disabled on the WPP Settings | Tools page. I tried this, but when I clicked Apply, I got a similar Fatal error: memory exhausted error displayed in the dashboard, and the Data Caching setting was still set to “Enable Caching” when the dashboard was refreshed. I updated the plugin from 7.0.1 to 7.1.0, but the problem was still there.

    I then added:
    define( ‘WP_MEMORY_LIMIT’, ‘512M’ );
    to wp-config.php to increase the memory limit in PHP (which was 384M), but this was not enough. Eventually I tried: define( ‘WP_MEMORY_LIMIT’, ‘1G’ ); and then it worked normally and the Data Caching setting was disabled. I then set it back to “Enable Caching” again. I could now also delete a post successfully without the PHP error occuring.

    I noticed that before I turned off Data Caching, the table wp_popularpoststransients in the database was quite large (there were 100k+ records created over the 3 months from when WPP was first installed). The tkey_date of the first record was dated from when the plugin was first enabled. After disabling and re-enabling Data Caching, the table had been cleared.

    Although I’ve managed to fix my initial problem by increasing the PHP memory limit to a large size, I’m wondering if the large number of records in the wp_popularpoststransients table was causing a WP internal query to run out of memory? Is this table ever automatically pruned? If I leave the config as it is, will the number of records build up again in a few months and cause even a 1G memory limit to run out and the same problem will return? Or should I leave the Data Caching disabled (it was enabled by default when the plugin was installed)?

    Thanks

    Andrew

    Plugin Configuration
    Performance Nag: Dismissed
    Log Limit: No
    Log Views From: Everyone
    Data Caching: Yes, 1 minute
    Data Sampling: No
    External object cache: No
    WPP_CACHE_VIEWS: No

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Hey @ahneale,

    I noticed that before I turned off Data Caching, the table wp_popularpoststransients in the database was quite large (there were 100k+ records created over the 3 months from when WPP was first installed).

    That’s strange. Data Caching is enabled on my site and expires after 1 minute just like on your site (this is the default setting) and right now I have around 2000k entries on that table, all of them with a tkey_date no older than the last 24 hours. If I understood correctly, you’re seeing entries that are 3 months old on that table?

    In any case, it’s been a while since I last had a look at that part of the code. Seeing that my own transients table isn’t as large as yours I believe that yes there’s a system in place to prune it every now and then. I’ll have another look to jog my memory and see if there’s anything that could explain what’s going on on your end.

    For the time being, yes, please disable Data Caching.

    Thread Starter ahneale

    (@ahneale)

    Yes, there were entries from 3 months old up to when the table was cleared by turning Data Caching to “Never Cache”. I’ll leave it disabled, thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.