| 1 |
<?php |
| 2 |
/** |
| 3 |
* Hook callbacks used for Optimization Detective. |
| 4 |
* |
| 5 |
* @package optimization-detective |
| 6 |
* @since 0.1.0 |
| 7 |
*/ |
| 8 |
|
| 9 |
declare( strict_types = 1 ); |
| 10 |
|
| 11 |
// @codeCoverageIgnoreStart |
| 12 |
if ( ! defined( 'ABSPATH' ) ) { |
| 13 |
exit; // Exit if accessed directly. |
| 14 |
} |
| 15 |
// @codeCoverageIgnoreEnd |
| 16 |
|
| 17 |
// The addition of the following hooks is tested in Test_OD_Hooks::test_hooks_added() and Test_OD_Storage_Post_Type::test_add_hooks(). |
| 18 |
|
| 19 |
// @codeCoverageIgnoreStart |
| 20 |
add_action( 'init', 'od_initialize_extensions', PHP_INT_MAX ); |
| 21 |
add_filter( 'template_include', 'od_buffer_output', PHP_INT_MAX ); |
| 22 |
OD_URL_Metrics_Post_Type::add_hooks(); |
| 23 |
OD_Storage_Lock::add_hooks(); |
| 24 |
add_action( 'wp', 'od_maybe_add_template_output_buffer_filter' ); |
| 25 |
add_action( 'wp_head', 'od_render_generator_meta_tag' ); |
| 26 |
add_filter( 'site_status_tests', 'od_add_rest_api_availability_test' ); |
| 27 |
add_action( 'admin_init', 'od_maybe_run_rest_api_health_check' ); |
| 28 |
add_action( 'after_plugin_row_meta', 'od_render_rest_api_health_check_admin_notice_in_plugin_row', 30 ); |
| 29 |
add_action( 'after_plugin_row_meta', 'od_render_installed_extensions_admin_notice_in_plugin_row', 30 ); |
| 30 |
add_filter( 'plugin_row_meta', 'od_render_extensions_meta_link', 10, 2 ); |
| 31 |
add_action( 'rest_api_init', 'od_register_rest_url_metric_store_endpoint' ); |
| 32 |
add_filter( 'rest_pre_dispatch', 'od_decompress_rest_request_body', 10, 3 ); |
| 33 |
add_action( 'od_trigger_page_cache_invalidation', 'od_trigger_post_update_actions' ); |
| 34 |
// @codeCoverageIgnoreEnd |
| 35 |
|