in this case, which is something like wptest01.openshift.local/testpage/. Passing this string to wp_parse_url results in a path-only array [ "path" => "wptest01.openshift.local/testpage/" ], so thehost` member is not available.
are effectively the same. So caching actually works, but throws a warning.
To Reproduce
Steps to reproduce the behavior:
Install latest Cachify development version on any compatible WordPress site
Enable the plugin
Enable PHP warnings in the log and/or output
Visit any yet uncached page
Expected behavior
The page should be displayed as usual and a cache entry should be generated in the corresponding backend (database, filesystem, ...) without any warnings.
System:
OS: any
WordPress: 6.1 (same for 6.0, 5.9 and likely any compatible version)
Describe the bug This misbehavior is a regression from #190.
As a side effect the URL parsing routing has been modified: https://github.com/pluginkollektiv/cachify/blob/d89efc317464d1d6df5a264786621e7a039bf465/inc/class-cachify.php#L1014-L1025
https://github.com/pluginkollektiv/cachify/blob/852cbd07aa431f37d68fad8bd01a67c94ec5ddfe/inc/class-cachify.php#L1000-L1011
If the method is called without arguments (which is done when the cache is populated), it raises a PHP warning:
We do set
in this case, which is something like
wptest01.openshift.local/testpage/
. Passing this string towp_parse_url
results in a path-only array[ "path" => "wptest01.openshift.local/testpage/
" ], so the
host` member is not available.The resulting key is fine, because
and
are effectively the same. So caching actually works, but throws a warning.
To Reproduce Steps to reproduce the behavior:
Expected behavior The page should be displayed as usual and a cache entry should be generated in the corresponding backend (database, filesystem, ...) without any warnings.
System:
Additional context Enable PHP warnings in log and/or output, e.g. setting
define('WP_DEBUG', true);