• I’ve noticed your plugin echoes a script at the top of any page when the shortcode is being used.
    There is an issue with Yoast SEO XML Sitemap with pages using your shortcode. It adds the inline script outside of the WordPress normal method.

    So when viewing page-sitemap.xml I get an error saying the sitemap is invalid, because xml files should never have any javascript running.

    This page contains the following errors:
    error on line 11 at column 7: XML declaration allowed only at the start of the document
    Below is a rendering of the page up to the first error.
    jQuery(document).ready(function(){ jQuery("#fcywctax.rotate-text").textrotator({ animation: "spin", separator: "|", speed: 10000 }); });

    Here is my fix in file saeid-text-rotator.php:43

    //echo $rotatejquery;
    wp_add_inline_script( 'saeidrotate-inline-script', $rotatejquery );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Inline script breaks XML sitemap’ is closed to new replies.