Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update endurance-page-cache.php #120

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions endurance-page-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public function to_studly_case( $value ) {
/**
* Convert a string to snake case.
*
* @param string $value String to be converted.
* @param string $value String to be converted.
* @param string $delimiter Delimiter (can be a dash for conversion to kebab case).
*
* @return string
Expand Down Expand Up @@ -401,9 +401,9 @@ public function skip_404_handling() {
* Handlers that listens for changes to options and checks to see, based on the option name, if the cache should
* be purged.
*
* @param string $option Option name
* @param mixed $old_value Old option value
* @param mixed $new_value New option value
* @param string $option Option name
* @param mixed $old_value Old option value
* @param mixed $new_value New option value
*
* @return bool
*/
Expand Down Expand Up @@ -534,9 +534,9 @@ public function comment( $comment_id ) {
/**
* Purge appropriate caches when post when post is updated.
*
* @param string $old_status The previous post status
* @param string $new_status The new post status
* @param WP_Post $post The post object of the edited or created post
* @param string $old_status The previous post status
* @param string $new_status The new post status
* @param WP_Post $post The post object of the edited or created post
*/
public function save_post( $old_status, $new_status, $post ) {

Expand Down Expand Up @@ -749,7 +749,7 @@ public function purge_cdn_single( $pattern = '' ) {
/**
* Ensure that a URI isn't purged more than once per minute.
*
* @param string $uri URI being purged
* @param string $uri URI being purged
* @param string $type The type of throttling
*
* @return bool True if additional purges should be avoided, false otherwise.
Expand Down Expand Up @@ -841,7 +841,7 @@ public function purge_request( $uri ) {
/**
* Get URL to be used for purge requests.
*
* @param string $uri The original URI
* @param string $uri The original URI
* @param string $scheme The scheme to be used
*
* @return string
Expand All @@ -859,7 +859,7 @@ public function get_purge_request_url( $uri, $scheme = 'http' ) {
return $base . $uri;
}

return str_replace( str_replace( wp_parse_url( home_url(), PHP_URL_PATH ), '', home_url() ), $base, $uri );
return str_replace( str_replace( wp_parse_url( home_url('/'), PHP_URL_PATH ), '', home_url() ), $base, $uri );
}

/**
Expand Down Expand Up @@ -1560,7 +1560,7 @@ protected function get_triggers( $include_duplicates = false ) {
* Calling this method with *no* parameters triggers a full cache wipe for the domain.
* Calling this method with relative paths to resources will purge just those resources.
*
* @param array $resources (Site paths, image assets, scripts, styles, files, etc)
* @param array $resources (Site paths, image assets, scripts, styles, files, etc)
* @param array $override_services (see defaults on self::$udev_api_services)
*
* @return void
Expand Down Expand Up @@ -1615,7 +1615,7 @@ protected function udev_cache_api_uri( $services ) {
/**
* Take hosts (and perhaps specific resources) to purge and encode JSON for request body.
*
* @param array $hosts List of hosts
* @param array $hosts List of hosts
* @param array $resources List of resources
*
* @return string|false
Expand Down
Loading