• Resolved Pierre_02

    (@pierre_02)


    Hi.

    I’haven’t noticed it before, but since the 6.3.0 release I have a problem with my sitemaps.

    I use WordPress in multisite mode to generate static files with this plugin and use the sitemaps to improve the indexing process.

    I have added this line in my wp-config: define("WP_CONTENT_URL", "https://cdn.theconcept.fr");
    BTW all the common resources (themes, plugins, js, etc.) for my static websites are shared by all the generated files.

    My problem is that in the new Yoast release if the home_url is the same that the site_url, you use the path to your plugin for the XSL file :(…
    So, in my generated xml file I have the path to XSL file like this
    <?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//cdn.theconcept.fr/wp-content/plugins/wordpress-seo/css/main-sitemap.xsl"?>
    but the path to the XML files link to mydomain.theconcept.fr generating the “common” error:
    “Unsafe attempt to load URL https://cdn.theconcept.fr/plugins/wordpress-seo/css/main-sitemap.xsl from frame with URL https://mydomain.theconcept.fr/sitemap_index.xml. Domains, protocols and ports must match.”

    I have seen that the concerned function is the one below in inc/sitemaps/class-sitemaps-renderer.php

    protected function get_xsl_url() {
    	if ( home_url() !== site_url() ) {
    		return home_url( 'main-sitemap.xsl' );
    	}
    	return plugin_dir_url( WPSEO_FILE ) . 'css/main-sitemap.xsl';
    }

    Is there’s a hook or a tips to avoid the path to the plugin but rather the root of my websites, please?

    TIA for your help.

    Pierre.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Michael Ti?a

    (@mikes41720)

    Hello,

    We can’t offer support on custom code (needed to change (core) features of our plugin). Since we don’t want to take the risk that we break your website by suggesting incorrect or incomplete code, we cannot advise you on how to make such changes. Maybe someone watching these forums can assist you further, but if your topic is inactive for 7 days, we’ll mark it as resolved to keep the overview.

    Thank you for your understanding.

    Thread Starter Pierre_02

    (@pierre_02)

    Hi Michael.

    Do you mean that there’s no hook nor tips available to “force” the XSL URL to be changed?! No code available for my “functions.php” in my child theme?

    If that the case, it will be really great if you can think about a (near if possible) future implementation.

    TIA for your feedback.

    Pierre.

    Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    Unfortunately, we don’t have a filter available to change the XSL stylesheet path. However, we thanks for suggesting a new feature for our plugin! We’re actively using the bug tracking on our GitHub repository so your best next step would be to create a new feature request for our developers at https://github.com/Yoast/wordpress-seo/issues/new. You can create a new issue to submit your feature request. You will need an account to create one.

    Don’t forget to include the URL to this conversation in your feature request!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Problem with my sitemap’ is closed to new replies.