Support » Plugin: Favorites » Spinner spins until page refresh (plugin is clashing with a certain function)

  • I just updated the plugin on my test site: newtestsite.rockitpro.com

    While logged in and clicking a Favorite button, the spinner endlessly spins. If you refresh the page the button changes to the “Remove” button so the post did get added to favorites. Clicking the “Remove” button works as intended. I’ve narrowed the problem down to this code in my functions.php file:

    //SHORTCODE FOR MINI AUDIO PLAYER [audiomini]
    add_shortcode('audiomini', 'my_thumbaudio_shortcode');
    function wp_audio_shortcode_thumbclass( $class ) {
        $class .= ' audio-mini';
        return $class;
    }
    function my_thumbaudio_shortcode( $attr ) {
        add_filter( 'wp_audio_shortcode_class', 'wp_audio_shortcode_thumbclass', 1, 1 );
        echo wp_audio_shortcode( $attr );
        remove_filter( 'wp_audio_shortcode_class', 'wp_audio_shortcode_thumbclass', 1 );
    }

    Delete that out of my functions.php file and the Favorite button works perfect. Any idea why the above code is making the button bug out?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Kyle Phillips

    (@kylephillips)

    It sounds like there is either a javascript conflict, or a plugin conflict affecting the back end response.

    Try updating to the latest release, v2.1.2.

    If the issue remains, check the developer console for any javascript errors that may be occurring.

    The latest release also includes a “development mode” that when enabled, will log ajax responses in the console. That may help in figuring out what is going on.

    Just updated to latest version and still have the issue. After clicking a Favorite button the log says “There was an error saving the favorite.” but I’m not seeing what the error is.

    If you want to log in real quick and test I made you a member:

    https://newtestsite.rockitpro.com/login/
    Name: kylephillips
    Pass: kylephillips

    Login and just scroll down to one of the posts and click a Favorite button.

    It’s not a plugin for sure, if I switch themes with all plugins enabled it works fine, if I use my current theme but delete the SHORTCODE FOR MINI AUDIO PLAYER code in my functions.php file it works fine too. If I delete that block of code the plugin says “The current user favorites were successfully loaded.” and “The favorite was successfully saved.” and everything works.

    Tried it with and without Page Cache checked. Favorites version 1.2.3 worked fine.

    2.1.4 update still didn’t fix it 🙁

    My knowledge of functions and JavaScript is very limited so I don’t understand why when the above code is removed, only then does your plugin work correctly.

    Plugin Author Kyle Phillips

    (@kylephillips)

    I’m a little perplexed as to why the code above would be producing the error. It looks like all it is doing is using the built-in audio shortcode and adding a CSS class to it.

    I’ve tried reproducing the error locally, but have been unable to.

    Sorry for the late reply, been under the weather.

    So what I’m doing is putting the audio code from my original post into my functions.php file to create a 2nd, smaller audio player. I’m calling that 2nd audio player in each post’s manual excerpt, then I’m calling each post’s manual excerpt for featured and related posts. I use the big audio player for my main posts and the 2nd, smaller audio player for featured posts and related posts.

    If I remove the below code from the post excerpt, the favorite button works for that post.

    [isnotmobile][audiomini mp3="https://www.blahblah.com/stream.php?f=blahblah.com-STILLATIT_HOOK772_tagged.mp3" ogg="https://www.blahblah.com/stream.php?f=blahblah.com-STILLATIT_HOOK772_tagged.ogg"][/isnotmobile]
    [ismobile][audiomini mp3="https://www.blahblah.com/beatsmp3/ROCKITPRO.COM-STILLATIT_HOOK772_tagged.mp3" ogg="https://www.blahblah.com/beatsmp3/blahblah.com-STILLATIT_HOOK772_tagged.ogg"][/ismobile]

    Such an odd bug. If you can’t figure it out I’ll just stick with 1.2.3 on my main website, that version is the last version that works for me.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Spinner spins until page refresh (plugin is clashing with a certain function)’ is closed to new replies.