Slow Admin
-
Wordpress Admin area is very slow, I feel AMP plugin is checking for validation for all post URLs when ever or where ever i click on admin dashboard.
Here is the screenshot: https://www.screencast.com/t/t5hvzwApA3ir
any help is appreciated.
The page I need help with: [log in to see the link]
-
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.
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.
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 isampinstead. But this should be unrelated.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 ?
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.phpin yourwp-contentdirectory? 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.
@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?
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.phpfile is removed from thewp-contentdirectory upon deactivation.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.phpdrop-in?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.
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
EXPLAINquery 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 cliand enter theSELECTquery in question withEXPLAINadded 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.
-
This reply was modified 5 years, 7 months ago by
The topic ‘Slow Admin’ is closed to new replies.





