Support » Plugin: Rate my Post - WP Rating System » Plugin Not Reacting to Clicks

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Blaz K.

    (@blazk)

    Hi there,
    this looks like a javascript problem. I’m quite sure that this is related to caching and/or minification.
    Did you try clearing the cache? If you are using CDN, please also clear CDN cache. If the problem persists exclude the following file from minification: https://fretello.com//wp-content/plugins/rate-my-post/public/js/rate-my-post-public.js

    You are using Autoptimize right? To see how to exclude a file from minification check out FAQ here https://wordpress.org/plugins/autoptimize/. The relevant question is: How does “exclude from optimizing” work?

    Let me know if this solved the problem.

    Blaz

    I excluded your plugin from CDN and Autoptimize, I even tried disabling both plugins it still does not work. Any other ideas?

    Cheers,
    Florian

    Plugin Author Blaz K.

    (@blazk)

    What about W3 Total Cache? Did you empty all W3 caches after excluding the plugin from Autoptimize. I checked the website just now and I don’t see https://fretello.com//wp-content/plugins/rate-my-post/public/js/rate-my-post-public.js in page source which means that it is minified and aggregated with other javascript or for some other reason not there – like page caching.

    By the way are you using shortcode or the automatic option?

    • This reply was modified 1 year, 4 months ago by Blaz K..

    hey guys; I had a quick look and that JS is not there even when AO is disabled, see https://fretello.com/choosing-guitar-picks/?ao_noptimize=1

    frank (ao dev)

    Plugin Author Blaz K.

    (@blazk)

    Thanks for input @optimizingmatters. I also tried locally with Autoptimize and the plugin works with html, css and js minification enabled. Now I’m getting really curious 🙂

    @fretello I found this thread https://wordpress.org/support/topic/slider-does-not-work-accordingly/ and it seems that you had similar issues (javascript files not loading)? Did you manage to resolve that? I can’t reproduce the issue you are encountering and because the issue seems similar to the above one, I would like to hear if you and the developer managed to resolve it.

    By the way, does saving plugin settings work? If it does, this could be a lead to resolving the issues.

    Blaz

    • This reply was modified 1 year, 4 months ago by Blaz K..
    • This reply was modified 1 year, 4 months ago by Blaz K..

    Nope, we haven’t been able to resolve this issue with the plugin, we implemented a solution ourselves. Since W3 and AO is disabled, I am a bit lost and wonder what else can cause the issue. Do you think it could be theme related?

    Plugin Author Blaz K.

    (@blazk)

    I see that you are also using CDN – have you tried clearing CDN cache?
    By the way can you save plugin settings? Because saving settings also requires javascript and I’m wondering if only frontend javascript is not loading.

    If that is the case I would try to enqueue frontend javascript in in the <head> by modifying these two lines in rate-my-post\public\class-rate-my-post-public.php

    
    wp_register_script( $this->rate_my_post, plugin_dir_url( __FILE__ ) . 'js/rate-my-post-public.js', array( 'jquery' ), $this->version, true );
    wp_register_script( 'rmp-cookie-js', plugin_dir_url( __FILE__ ) . 'lib/js.cookie.js', array( 'jquery' ), $this->version, true );
    

    to

    
    wp_register_script( $this->rate_my_post, plugin_dir_url( __FILE__ ) . 'js/rate-my-post-public.js', array( 'jquery' ), $this->version, false );
    wp_register_script( 'rmp-cookie-js', plugin_dir_url( __FILE__ ) . 'lib/js.cookie.js', array( 'jquery' ), $this->version, false );
    

    If this would by any chance work, I would make an option to select where to enqueue js in the next update.

    Blaz

    Plugin Author Blaz K.

    (@blazk)

    Hi @chaitanyya,
    great to hear that you managed to include the script. Because the script is utilizing ajax it also uses wp_localize_script function. See rate-my-post\public\class-rate-my-post-public.php, line 68.

    And this script should be included as well:
    https://fretello.com/wp-content/plugins/rate-my-post/public/lib/js.cookie.js

    Have you figured out what is causing the issues?

    Plugin Author Blaz K.

    (@blazk)

    @fretello and @chaitanyya since this was a very interesting issue I took some time to investigate it. The only way I could reproduce this issue is by deregistering jquery script (this one comes with WordPress). I see that your website loads jquery but it is possible that it is deregistered somewhere and then re-registered with a different handle?
    I suggest investigating theme and plugins for the following line of code:

    wp_deregister_script( 'jquery' );

    Plugin Author Blaz K.

    (@blazk)

    That’s great @chaitanyya. The theme deregistering jquery also explains why Strong Testimonials plugin didn’t work on your website. Many WP plugins depend on the jquery handle. I see that the plugin is now working and thus I’m marking this as resolved.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Plugin Not Reacting to Clicks’ is closed to new replies.