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

It looks like your domain is not set up on Cloudflare #7012

Open
mihdan opened this issue Oct 6, 2024 · 0 comments · May be fixed by #7013
Open

It looks like your domain is not set up on Cloudflare #7012

mihdan opened this issue Oct 6, 2024 · 0 comments · May be fixed by #7013
Labels
module: cloudflare priority: low Issues that can wait type: enhancement Improvements that slightly enhance existing functionality and are fast to implement

Comments

@mihdan
Copy link

mihdan commented Oct 6, 2024

Describe the bug

I have a website in Russian масла.сайт. When setting up the Cloudflare addon I get the error “It looks like your domain is not set up on Cloudflare”. This happens because the $this->endpoints->get_zones( $zone_id ); function returns the domain name as масла.сайт and the $parsed_url = wp_parse_url( $site_url ); function as xn--80aa6ac0a.xn--80aswg.

To solve the problem, you need to use PHP's built-in idn_to_utf8() function:

// Filename wp-content/plugins/wp-rocket/inc/Addon/Cloudflare/Cloudflare.php
if ( property_exists( $result, 'name' ) && false !== strpos( strtolower( idn_to_utf8( $parsed_url['host'] ) ), $result->name ) ) {
    $zone_found = true;
}

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'WP-Rocket Settings -> Addons -> Cloudflare'
  2. Fill in the 'Account email' and 'Zone ID' fields, and then click the 'Save Changes' button
  3. See error 'It looks like your domain is not set up on Cloudflare'
@piotrbak piotrbak added type: enhancement Improvements that slightly enhance existing functionality and are fast to implement module: cloudflare priority: low Issues that can wait labels Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: cloudflare priority: low Issues that can wait type: enhancement Improvements that slightly enhance existing functionality and are fast to implement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants