When submitting a rating, if the AJAX response cannot be processed then the loading wheel will not disappear. This is most often caused by your theme or another plugin loading their own version of jQuery. It is bad practise for themes or plugins to load their own version of jQuery. Here’s an excellent blog post by Pippin Williamson which covers why loading your own jQuery is irresponsible. The following JavaScript error typically occurs in this scenario “Uncaught TypeError: Cannot read property ‘data’ of null“.
If you are using a caching solution, it could be an expired nonce (number used once) issue. Every time a rating is submitted, a check is made to ensure a valid nonce is used. Try testing with page cache turned off. If that fixes the issue. Then turn it back on and try changing your page cache expiry to less than the default WordPress nonce expiry which is 12 hours. Here’s an article on WP Rocket which is relevant https://docs.wp-rocket.me/article/975-nonces-and-cache-lifespan. If you are technical, you can easily debug to rule our an expired cache issue. Temporarily change the following lines in class-rating-form.php file from:
if ( wp_verify_nonce( $ajax_nonce, MRP_Multi_Rating::ID.'-nonce' ) ) {
to:
if ( true ) {
If it works after this, then it is definitely an expired nonce issue.