• Resolved suffiansalam

    (@suffiansalam)


    Hi WPCode team,

    I’m using the WPCode plugin on my WordPress site, and I noticed that the wpcode_snippets option in the wp_options table is being autoloaded and currently takes up a significant amount of memory. This makes it one of the top entries contributing to autoload bloat on the site.

    Questions:

    1. Is it safe to set the autoload to 'no' for wpcode_snippets?
    2. Does WPCode depend on this being autoloaded for admin/editor operations, or is it dynamically fetched when needed?
    3. Do you recommend a best practice for performance optimization if a user has dozens of snippets stored?

    Thanks in advance for the clarification and for building such a helpful plugin!

    Best regards,
    Suffian Shakoor

Viewing 1 replies (of 1 total)
  • Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @suffiansalam,

    The wpcode_snippets option is used as a preload to ensure that active snippets are available for execution without having to do additional queries on the database. WordPress autoloads the options in 1 single query which is faster than having to do 1 query for each option.

    If you set the “autoload” to “no”, but you have active snippets, you will introduce an extra query as the plugin will still have to load the snippet code to execute it.

    In most cases, simply not loading this 1 option should not have a significant impact on your site’s performance. The type of code executed in the snippets or in plugins is usually the one that causes slowdowns. This makes it hard to identify what is causing slowdowns as simply disabling all WPCode snippets will make the wpcode_snippets option small. However, the actual size of that option might not be causing the issue instead it might be the PHP code executed.

    Of course, if you’re going to load hundreds of MB of code from snippets, that will have an impact.

    Let me know if I can provide more info.

Viewing 1 replies (of 1 total)

The topic ‘Large Autoload Size for wpcode_snippets’ is closed to new replies.