Viewing 15 replies - 1 through 15 (of 26 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    Thanks for the report.

    Another similar topic has been opened about this: https://wordpress.org/support/topic/very-slow-loads-and-long-query-times-on-dashboard/

    We are investigating.

    Plugin Author Weston Ruter

    (@westonruter)

    A quick way to fix the performance problem should be to turn off AMP Developer Tools in your WordPress user profile settings.

    The query should not be slow, but this should restore admin performance.

    Plugin Author Weston Ruter

    (@westonruter)

    In your screenshot, can you please expand the callstack for the get_posts() call? I want to see which part of the AMP plugin is making that query.

    Also, why does the plugin slug show as _amp? You should probably make sure the plugin directory is amp instead. But this should be unrelated.

    Thread Starter itking

    (@itking)

    its now amp

    here is the detailed for expand the callstack for the get_posts() call
    WP_Query->get_posts
    WP_Query->query
    WP_Query->__construct
    AMP_Validated_URL_Post_Type::get_validation_error_urls_count
    AMP_Validated_URL_Post_Type::add_admin_menu_new_invalid_url_count
    WP_Hook->apply_filters
    WP_Hook->do_action
    do_action(‘admin_menu’)
    require_once(‘wp-admin/includes/menu.php’)
    require(‘wp-admin/menu.php’)
    require_once(‘wp-admin/admin.php’)

    how do i disabled this validation all the time ?

    Plugin Author Weston Ruter

    (@westonruter)

    I see, so it’s coming from AMP_Validated_URL_Post_Type::add_admin_menu_new_invalid_url_count().

    That’s strange because the output is explicitly being cached in a transient. See the code: https://github.com/ampproject/amp-wp/blob/34e098ca0b773138ec33cdbf3228ccaedcaad64d/includes/validation/class-amp-validated-url-post-type.php#L482-L486

    The transient is stored for 1 day, so this query should only be run once a day. But you’re saying it was being run every time you load the admin page?

    I wonder, do you have an object-cache.php in your wp-content directory? Is it there for an inactive caching plugin?

    In the Overview tab of Query Monitor, look for the “Object Cache” section. What is the hit rate? Does it say that an external object cache is being used?

    how do i disabled this validation all the time ?

    It will be disabled as long as you have AMP Developer Tools disabled in your user profile. It’s also only available for administrators to enable.

    • This reply was modified 5 years, 7 months ago by Weston Ruter.
    Thread Starter itking

    (@itking)

    see these screenshots:

    2020-09-03_07-06-18

    2020-09-03_07-07-18

    Plugin Author Weston Ruter

    (@westonruter)

    @itking thanks, please also share the screenshot of the Overview tab.

    I think what’s happening is that persistent object caching is broken, or that the Redis Cache plugin is misconfigured. Can you enable Redis Object Cache as indicated on the second screenshot?

    Thread Starter itking

    (@itking)

    see this screenshot for overview tab:
    2020-09-03_07-19-01

    Thread Starter itking

    (@itking)

    after i enabled object cache plugin here is the screenshot:

    2020-09-03_07-24-01

    Plugin Author Weston Ruter

    (@westonruter)

    OK, you probably don’t have the Redis service available. I suggest deactivating the Redis Cache plugin altogether. And make sure that the object-cache.php file is removed from the wp-content directory upon deactivation.

    Thread Starter itking

    (@itking)

    ok, here is the screenshot now, issue is same all the time URL validation causing problem.

    2020-09-03_07-34-51

    Thread Starter itking

    (@itking)

    i also added this code at functions.php but did not help.

    remove_filter( ‘dashboard_glance_items’, [ ‘AMP_Validated_URL_Post_Type’, ‘filter_dashboard_glance_items’ ] );

    2020-09-03_07-44-02

    Plugin Author Weston Ruter

    (@westonruter)

    Is the issue happening even when you have AMP Developer Tools disabled in your WordPress user profile settings?

    And you have fully removed Redis Cache and the object-cache.php drop-in?

    Plugin Author Weston Ruter

    (@westonruter)

    i also added this code at functions.php but did not help.

    remove_filter( ‘dashboard_glance_items’, [ ‘AMP_Validated_URL_Post_Type’, ‘filter_dashboard_glance_items’ ] );

    This is only for disabling the Dashboard At a Glance widget. This is also disabled by turning off AMP Developer Tools.

    Plugin Author Weston Ruter

    (@westonruter)

    It seems that this query is not the only one that is being flagged as slow, right?

    There is also a query from Yoast that is being flagged as slow.

    You may have a MySQL configuration issue.

    As requested in the other support topic, can you take the slow SQL query and run an EXPLAIN query on it via WP-CLI DB shell? It could be that your database is lacking the necessary indexes to run efficient queries.

    For example, if I run wp db cli and enter the SELECT query in question with EXPLAIN added to the front:

    EXPLAIN SELECT SQL_CALC_FOUND_ROWS wp_posts.ID
    FROM wp_posts
    WHERE 1=1
    AND wp_posts.post_type = 'amp_validated_url'
    AND (wp_posts.post_status = 'publish'
    OR wp_posts.post_status = 'future'
    OR wp_posts.post_status = 'draft'
    OR wp_posts.post_status = 'pending'
    OR wp_posts.post_status = 'private')
    AND (
    SELECT 1
    FROM wp_term_relationships
    INNER JOIN wp_term_taxonomy
    ON wp_term_taxonomy.term_taxonomy_id = wp_term_relationships.term_taxonomy_id
    INNER JOIN wp_terms
    ON wp_terms.term_id = wp_term_taxonomy.term_id
    WHERE wp_term_taxonomy.taxonomy = 'amp_validation_error'
    AND wp_term_relationships.object_id = wp_posts.ID
    AND wp_terms.term_group IN ( 0, 1 )
    LIMIT 1 )
    ORDER BY wp_posts.post_date DESC
    LIMIT 0, 4;

    The result I get is:

    +------+--------------------+-----------------------+--------+-----------------------------------+------------------+---------+--------------------------------------------------+------+------------------------------------------+
    | id   | select_type        | table                 | type   | possible_keys                     | key              | key_len | ref                                              | rows | Extra                                    |
    +------+--------------------+-----------------------+--------+-----------------------------------+------------------+---------+--------------------------------------------------+------+------------------------------------------+
    |    1 | PRIMARY            | wp_posts              | range  | type_status_date                  | type_status_date | 164     | NULL                                             |   65 | Using where; Using index; Using filesort |
    |    2 | DEPENDENT SUBQUERY | wp_term_relationships | ref    | PRIMARY,term_taxonomy_id          | PRIMARY          | 8       | wordpress.wp_posts.ID                            |    1 | Using index                              |
    |    2 | DEPENDENT SUBQUERY | wp_term_taxonomy      | eq_ref | PRIMARY,term_id_taxonomy,taxonomy | PRIMARY          | 8       | wordpress.wp_term_relationships.term_taxonomy_id |    1 | Using where                              |
    |    2 | DEPENDENT SUBQUERY | wp_terms              | eq_ref | PRIMARY                           | PRIMARY          | 8       | wordpress.wp_term_taxonomy.term_id               |    1 | Using where                              |
    +------+--------------------+-----------------------+--------+-----------------------------------+------------------+---------+--------------------------------------------------+------+------------------------------------------+

    What is the result for you?

    • This reply was modified 5 years, 7 months ago by Weston Ruter.
Viewing 15 replies - 1 through 15 (of 26 total)

The topic ‘Slow Admin’ is closed to new replies.