zero-spam-for-wordpress icon indicating copy to clipboard operation
zero-spam-for-wordpress copied to clipboard

[BUG] List of blocked domains is too large and saved in an option that is autoloaded which slows down your site

Open jmslbam opened this issue 3 years ago • 1 comments

Hi all!

After importing the recommended settings a site becomes slow because the autoloaded options will grow with 2MB. I have had this kind of problem with other sites that stored to much of their data in an option.

To Reproduce Steps to reproduce the behavior:

  1. Go to MySQL and check the sizes of the zero-spam-settings options that is Autoloaded.
  2. Go to Use Blocked Email Domains Recommendation and import recommendations image
  3. Go to MySQL and check the size again. Mine grew by 2.1MB, yupp that's right 2.1MB extra on every load from the Database.

Expected behavior I expect this large of amount of data not te be autoloaded and to be saved in a separated table.

screenshots Screenshot 2023-02-21 at 00 07 29 Screenshot 2023-02-21 at 00 25 42 Screenshot 2023-02-21 at 00 25 27

After image

jmslbam avatar Feb 21 '23 10:02 jmslbam

Thanks for bringing this to our attention @jmslbam. This problem is a little more complex to fix, but do have plans to rework the settings system to avoid this. I'll leave this issue open until that has been done.

bmarshall511 avatar May 15 '23 20:05 bmarshall511

Thanks for the detailed report! I'm happy to verify that this issue has been addressed in the upcoming v5.5.8 release. We have refactored how the "Blocked Email Domains" list is stored to address the performance concern you raised:

  1. Separated Storage: The blocked email domains list has been moved out of the main settings option and into its own dedicated option key (zerospam_blocked_email_domains).

  2. Disabled Autoloading: We now explicitly set autoload = 'no' for this specific option. This ensures that the large dataset (approx. 2MB) is not loaded into memory on every page load, but is only queried when specifically needed.

This should completely eliminate the database overhead you observed. Thanks again for helping us improve performance!

bmarshall511 avatar Jan 07 '26 22:01 bmarshall511