When the jQuery is load at very bottom of the footer, the code jQuery('.saswp_star_color .saswp_star').attr('stop-color', saswpStarColor);
located on schema-and-structured-data-for-wp/modules/rating-box/frontend.php
on the function saswp_rating_box_custom_script
is breaking everything on the pae because it couldn’t find the jQuery.
Solution 1: Use vanilla JS as fallback
let saswpStarColor = "<?php echo $sd_data['saswp-rbcc-stars-color']; ?>";
if (typeof jQuery !== 'undefined') {
jQuery('.saswp_star_color .saswp_star').attr('stop-color', saswpStarColor);
} else {
const stars = document.querySelectorAll('.saswp_star_color .saswp_star');
stars.forEach((star) => star.setAttribute('stop-color', saswpStarColor));
}
Solution 2: put it at very bottom of the hook
add_action('wp_footer', array($this, 'saswp_rating_box_custom_script'), PHP_INT_MAX);
https://github.com/ahmedkaludi/schema-and-structured-data-for-wp/pull/2086