Skip to content

Commit e04379e

Browse files
committed
Added Referer-Policy to supported headers
1 parent 29714e6 commit e04379e

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

includes/src/Traits/Plugin/WcpWooCommerceUtils.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,14 @@ public function autoClearPostCacheOnWooCommerceSetStockStatus($product_id)
5858
}
5959

6060
/**
61-
* Retrieve the product ID safely
61+
* Retrieve the product ID safely.
62+
*
63+
* Compatible with older versions
6264
*
6365
* @param $product
6466
*
67+
* @since 1.0.0
68+
*
6569
* @return int|string
6670
*/
6771
private function getProductId($product) {

includes/src/Traits/Shared/HttpUtils.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public function cacheableHeadersList()
9090
'Proxy-Authenticate',
9191
'Refresh',
9292
'Retry-After',
93+
'Referrer-Policy',
9394
'Server',
9495
'Status',
9596
'Strict-Transport-Security',
@@ -123,7 +124,7 @@ public function cacheableHeadersList()
123124
if (($status = (string) $this->httpStatus())) {
124125
array_unshift($headers, $this->httpProtocol().' '.$status);
125126
}
126-
return $headers;
127+
return $this->applyWpFilters(MEGAOPTIM_RAPID_CACHE_GLOBAL_NS . '_cacheable_headers', $headers);
127128
}
128129

129130
/**

readme.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,4 +241,6 @@ Released under the terms of the [GNU General Public License](http://www.gnu.org/
241241
- New: Added developer functions: rapidcache_get_version(), rapidcache_clear_cache(), rapidcache_clear_post_cache($post_id), rapidcache_clear_url_cache($url), rapidcache_wipe_cache(), rapidcache_purge_expired_cache(), rapidcache_get_options()
242242
- New: Added `rapid_cache_ob_callback_filter` that allow to filter the page output before saving into cache
243243
- Fix: 'Non static method should not be called statically
244-
- Fix: 'Headers already sent' warnings
244+
- Fix: 'Headers already sent' warnings
245+
- Fix: 'Notice: id was called incorrectly. Product properties should not be accessed directly.' warning with WooCommerce
246+
- New: Add Referrer-Policy to cacheable headers list

0 commit comments

Comments
 (0)