Skip to content

Commit b2ece6a

Browse files
committed
Merge remote-tracking branch 'origin/fix_speed_module' into fix_speed_module
2 parents c6dc08a + 0c26b94 commit b2ece6a

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

mu-plugin/plausible-proxy-speed-module.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,9 @@ private function is_proxy_request() {
6868
return false;
6969
}
7070

71-
$rest_prefix = function_exists( 'rest_get_url_prefix' )
72-
? trim( rest_get_url_prefix(), '/' )
73-
: 'wp-json';
74-
75-
$expected = '/' . $rest_prefix . '/' . trim( $namespace, '/' );
71+
$expected = function_exists( 'rest_url' )
72+
? untrailingslashit( (string) wp_parse_url( rest_url( trim( $namespace, '/' ) ), PHP_URL_PATH ) )
73+
: '/wp-json/' . trim( $namespace, '/' );
7674

7775
return $path === $expected
7876
|| str_starts_with( $path, $expected . '/' );

0 commit comments

Comments
 (0)