wp-rocket icon indicating copy to clipboard operation
wp-rocket copied to clipboard

Update HostResolver.php to better detect Cloudways environments

Open anasmoiz opened this issue 7 months ago • 1 comments

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';
}

anasmoiz avatar May 29 '25 10:05 anasmoiz

CC @DahmaniAdame

piotrbak avatar May 29 '25 11:05 piotrbak

@DahmaniAdame @piotrbak Could we please get an update on this? Our new stack went into public preview last week.

anasmoiz avatar Jul 22 '25 13:07 anasmoiz

@anasmoiz noted. We'll include it on the next release. cc @engahmeds3ed

DahmaniAdame avatar Jul 22 '25 15:07 DahmaniAdame

@wp-media/qa-team we have a Cloudways account on Bitwarden for testing.

DahmaniAdame avatar Jul 25 '25 07:07 DahmaniAdame

@anasmoiz Could you provide a temporary testing environment with the change already implemented?

DahmaniAdame avatar Jul 30 '25 09:07 DahmaniAdame

@DahmaniAdame, I have sent an invitation to your email. Could you please confirm if you have received access?

anasmoiz avatar Jul 30 '25 12:07 anasmoiz

@anasmoiz got access. Thanks! Pinging QA to have a look.

DahmaniAdame avatar Jul 30 '25 12:07 DahmaniAdame