Support » Plugin: Simple Share Buttons Adder » Javascript Error After Optimizing speed

  • Resolved asanabria11



    Your plugin works great, and never had any problems with it. until I started optimizing for google page speeds. one of the suggestions from google is move scripts to the footer. and while this makes the page load faster, it breaks your plugin.

    I found the exact place where we can fix the issue:
    Its on the file: Php/class-styles.php line 70
    wp_add_inline_script( “{$this->plugin->assets_prefix}-ssba”, sprintf( ‘Main.boot( %s );’,
    wp_json_encode( array() )
    ) );

    wp_add_inline_script( “{$this->plugin->assets_prefix}-ssba”, sprintf( ‘ jQuery(function(){Main.boot( %s );})’,
    wp_json_encode( array() )
    ) );
    Fixes the issue in my website since it now waits for the functions and javascript to be loaded.

    But this is only going to work until I update your plugin again, so I was wondering if you could incorporate this fix or something similar in your plugin for future updates.

    Alex Sanabria

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Simple Share


    Hi @asanabria11,

    This is great stuff! Thanks so much for providing feedback.
    I’ve let our developer know and will be looking into implementing this feature further. If you have any other questions please let us know!

    Hello your code has a syntax error but i can’t figure it our. Are you sure you pasted correctly? I want to try it.



Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.