Close

Account

Documentation

Forum

Menu

Query duplicate count_users

  • Post count: 213
    Communication Contact
    March 27, 2018 at 6:41 am #29953

    Hi,

    using the Query Monitor plugin, I found the following duplicate query error:

    Query

    SELECT COUNT(NULLIF(meta_value LIKE ‘%\”administrator\”%’, false)), COUNT(NULLIF(meta_value LIKE ‘%\”author\”%’, false)), COUNT(NULLIF(meta_value LIKE ‘%\”contributor\”%’, false)), COUNT(NULLIF(meta_value LIKE ‘%\”editor\”%’, false)), COUNT(NULLIF(meta_value LIKE ‘%\”subscriber\”%’, false)), COUNT(NULLIF(meta_value LIKE ‘%\”adrotate\\_advertiser\”%’, false)), COUNT(NULLIF(meta_value LIKE ‘%\”pending\”%’, false)), COUNT(NULLIF(meta_value LIKE ‘%\”manage\\_schema\\_options\”%’, false)), COUNT(NULLIF(meta_value = ‘a:0:{}’, false)), COUNT(*)
    FROM wp_usermeta
    INNER JOIN wp_users
    ON user_id = ID
    WHERE meta_key = ‘wp_capabilities’

    Conteggio: 118

    Caller: count_users – 118 chiamate

    JNews\Module\Block\BlockOptionAbstract->set_header_filter_option
    62 chiamate
    JNews\Module\ModuleOptionAbstract->set_content_filter_option
    55 chiamate
    JNews\Module\Element\Element_Videoplaylist_Option->set_content_filter_option
    1 chiamata

    What do you think about it ???

    I await your feedback and good work.

    Post count: 9454
    Adek
    March 27, 2018 at 9:05 am #29954

    Hi Communication Contact,

    Actually, for the query, we already using WordPress Cache to cache the result of the previous query so it will reduce the duplicate query. I will take a look at this thing for further investigation.

    Let me know if you have further question.

    Thank you

    Post count: 213
    Communication Contact
    March 27, 2018 at 9:52 am #29961

    Hi,

    how can you reduce all these duplicate query?

    I await your feedback and good work.

    Post count: 9454
    Adek
    March 27, 2018 at 10:02 am #29965

    Hi Communication Contact,

    I already create a note on this thing for further investigation and it may take a bit more time. Hopefully, we can find a solution asap.

    Thank you

    Post count: 213
    Communication Contact
    March 27, 2018 at 7:33 pm #29978

    Ok..thanks

    I await your news on this

    Post count: 2606
    Jegbagus
    April 9, 2018 at 11:59 am #30307

    hi Communication Contact, we have already fix this issue so on v2, this issue won’t be a problem anymore.

    Thank you

    Post count: 213
    Communication Contact
    April 9, 2018 at 6:48 pm #30313

    Hi,

    when will the 2.0 version of thema be published?

    I await your news on this and good work.

    Post count: 9454
    Adek
    April 10, 2018 at 9:09 am #30326

    Hi Communication Contact,

    If all goes well, we are going to release JNews v2 on this week.

    Thank you

    Post count: 213
    Communication Contact
    April 16, 2018 at 9:05 am #30503

    Hi,

    I updated the theme to version 2.0, but the duplicate queries are the same,

    I think you have not solved the problem.

    Do you have any other solution ??

    I wait for your news !!

    Post count: 9454
    Adek
    April 16, 2018 at 12:05 pm #30532

    Hi Communication Contact,

    Try to replace the content of this file wp-content/themes/jnews/lib/theme-helper.php with this one https://pastebin.com/UCmnwgRS

    Thank you

    Post count: 213
    Communication Contact
    April 17, 2018 at 12:59 am #30586

    Hi Adek,

    Have you already added this error to the new version ??

    2.0.1
    – [IMPROVEMENT] Plugin update notice
    – [IMPROVEMENT] Change version logger update event to switch theme
    – [BUG] Fixed duplicate query from count_user()

    I await your news on this

    Post count: 213
    Communication Contact
    April 17, 2018 at 2:24 am #30589

    Hi Adek,

    there are still these duplicate Queries:

    WP_Term_Query->get_terms
    2 calls
    JNews\Single\SinglePost->recursive_category
    1 call
    JNews\Module\ModuleQuery::recursive_category
    1 call

    WP_Post::get_instance
    2 calls
    apply_filters(‘jnews_content_class’)
    1 call
    apply_filters(‘the_content’)
    1 call

    SELECT *
    FROM wp_posts
    WHERE ID = 1
    LIMIT 1 2 WP_Post::get_instance
    2 calls
    apply_filters(‘jnews_content_class’)
    1 call
    apply_filters(‘the_content’)
    1 call
    SELECT t.*, tt.*
    FROM wp_terms AS t
    INNER JOIN wp_term_taxonomy AS tt
    ON t.term_id = tt.term_id
    WHERE tt.taxonomy IN (‘category’)
    AND tt.parent = ‘584’
    ORDER BY t.name ASC

    Post count: 9454
    Adek
    April 18, 2018 at 10:02 am #30690

    Hi Communication Contact,

    For the duplicate queries message, it’s a mandatory query that using the different function and we can’t make it as one query for some reason. But I think there’s no more bloated duplicate queries in there so it won’t really affect your site backend performance.

    Thank you

You must be logged in to reply to this topic.