最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

performance - What is the first action or filter executed by wordpress?

programmeradmin1浏览0评论

To mesure performance of a wordpress website i need what is the first filter or action executed by wordpress ? it seems that index.php is the input file of server, there is a way to add a global time variable Programmatically by editing this file when a plugin is installed and add this line:

 $timezone = date_default_timezone_get();
 define( 'REQUEST_RECEIVED_TIME', $timezone );

To mesure performance of a wordpress website i need what is the first filter or action executed by wordpress ? it seems that index.php is the input file of server, there is a way to add a global time variable Programmatically by editing this file when a plugin is installed and add this line:

 $timezone = date_default_timezone_get();
 define( 'REQUEST_RECEIVED_TIME', $timezone );
Share Improve this question edited Jun 30, 2020 at 17:56 fuxia 107k38 gold badges255 silver badges459 bronze badges asked Jun 30, 2020 at 14:15 GogoGogo 1133 bronze badges 3
  • 1 Does this answer your question? What is the very earliest action hook you can call? – Jacob Peattie Commented Jun 30, 2020 at 14:16
  • no it give the hook but for performance there is other stuff before hooks – Gogo Commented Jun 30, 2020 at 17:29
  • You asked what the earliest hook was. That question has the answer. If that’s not what you need then you should ask your actual question. – Jacob Peattie Commented Jul 1, 2020 at 2:05
Add a comment  | 

1 Answer 1

Reset to default 2

Here is nicely described what and when is loading and why. I recommend also this awesome plugin Query Monitor that helped me also to fix performance issues.

in short:

muplugins_loaded
registered_taxonomy
registered_post_type
plugins_loaded
sanitize_comment_cookies
setup_theme
unload_textdomain
load_textdomain
after_setup_theme
auth_cookie_malformed
auth_cookie_valid
set_current_user
init
widgets_init
register_sidebar
wp_register_sidebar_widget
wp_loaded
parse_request
send_headers
parse_tax_query
parse_query
pre_get_posts
posts_selection
wp
template_redirect
wp_default_scripts
wp_default_styles
admin_bar_init
add_admin_bar_menus
get_header
wp_head
wp_enqueue_scripts
wp_print_styles
wp_print_scripts
loop_start
the_post
get_template_part_content
begin_fetch_post_thumbnail_html
end_fetch_post_thumbnail_html
loop_end
get_sidebar
dynamic_sidebar_before
dynamic_sidebar
dynamic_sidebar_after
get_footer
twentytwelve_credits
wp_footer
wp_print_footer_scripts
admin_bar_menu
wp_before_admin_bar_render
wp_after_admin_bar_render
shutdown
发布评论

评论列表(0)

  1. 暂无评论