Update HostResolver.php to better detect Cloudways environments
Hey team,
We have found a small improvement in WP-Rocket, basically you have code to detect Cloudways environment at wp-rocket/inc/ThirdParty/Hostings/HostResolver.php
if ( isset( $_SERVER['cw_allowed_ip'] ) ) {
self::$hostname = 'cloudways';
return 'cloudways';
}
The above code needs to be updated as follows to ensure consistency across different environments.
if (strpos($_SERVER['DOCUMENT_ROOT'], '.cloudwaysapps.com/') !== false || isset($_SERVER['cw_allowed_ip'])) {
self::$hostname = 'cloudways';
return 'cloudways';
}
CC @DahmaniAdame
@DahmaniAdame @piotrbak Could we please get an update on this? Our new stack went into public preview last week.
@anasmoiz noted. We'll include it on the next release. cc @engahmeds3ed
@wp-media/qa-team we have a Cloudways account on Bitwarden for testing.
@anasmoiz Could you provide a temporary testing environment with the change already implemented?
@DahmaniAdame, I have sent an invitation to your email. Could you please confirm if you have received access?
@anasmoiz got access. Thanks! Pinging QA to have a look.