Skip to content

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

@mihdan

Description

@mihdan

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: cloudflarepriority: lowIssues that can waittype: enhancementImprovements that slightly enhance existing functionality and are fast to implement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions