Skip to content

Commit

Permalink
Improve page metrics route
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Nov 9, 2023
1 parent 7f6cc2b commit 7d5b2f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/images/image-loading-optimization/detection.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function ilo_print_detection_script() {
$serve_time,
$detection_time_window,
WP_DEBUG,
rest_url( ILO_REST_API_NAMESPACE . ILO_PAGE_METRIC_STORAGE_ROUTE ),
rest_url( ILO_REST_API_NAMESPACE . ILO_PAGE_METRICS_ROUTE ),
wp_create_nonce( 'wp_rest' ),
);
wp_print_inline_script_tag(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

const ILO_REST_API_NAMESPACE = 'image-loading-optimization/v1';

const ILO_PAGE_METRIC_STORAGE_ROUTE = '/image-loading-optimization/page-metric-storage';
const ILO_PAGE_METRICS_ROUTE = '/page-metrics';

/**
* Register endpoint for storage of page metric.
Expand All @@ -36,7 +36,7 @@ function ilo_register_endpoint() {

register_rest_route(
ILO_REST_API_NAMESPACE,
ILO_PAGE_METRIC_STORAGE_ROUTE,
ILO_PAGE_METRICS_ROUTE,
array(
'methods' => 'POST',
'callback' => static function ( WP_REST_Request $request ) {
Expand Down

0 comments on commit 7d5b2f5

Please sign in to comment.