Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi webvitality, I suspect that info plugin mistakes any get_option() for an SQL query. This is not true as default options get loaded from the database in one big query by WordPress. Read more on http://wordpress.stackexchange.com/questions/27717/are-all-options-loaded-to-memory-on-each-request for example. Easy FancyBox does not do any database queries on its own…

    There is one possible exception: if you installed Easy FancyBox but have not changed or even saved the default options on Settigns > Media yet. In that case, there are no database options set (yet) while the active plugin tries to load them. This will cause WordPress to double-check the database for these options and that will show as these extra queries.

    A quick fix is to go to Settings > Media and even if you’re happy with the default settings, hit the Save button.

    That said, I am planning on merging all (or many of) these options into one options array. This will look cleaner in the database and only cause a small amount of extra queries when options are not saved yet.

    Hope that explanation helps 🙂

    Thread Starter webvitaly

    (@webvitaly)

    Thank you for the detailed reply.
    Hitting “Save” button on Media settings page helped to decrease the number of SQL queries by 50+.

    P.S. Info plugin uses WordPress core get_num_queries() function to output the number of queries. And this function is using $wpdb->num_queries variable which is WordPress core queries counter.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Plugin generates 70 sql queries’ is closed to new replies.