• Resolved rzack

    (@rzack)


    Hello, and thanks again for the great plugin.

    We’re using Super Socializer for Social Login only. It appears that the Super Socializer code is only then required on the Login and Register pages.

    However, Super Socializer appears to be always loading its scripts/styles on every page on the site, which is causing some conflicts with other plugins and some slowdowns for the site. For example, this code is in the top of every page:

    
    <script type="text/javascript">var theChampCloseIconPath = 'https://our.news/wp-content/plugins/super-socializer/images/close.png';var heateorSsSDKBlockedMsg = <code>Your browser is blocking some features of this website. Please follow the instructions at <a href=\'https://support.heateor.com/browser-blocking-social-features/\' target=\'_blank\' style=\'color:#33a9d8\'>https://support.heateor.com/browser-blocking-social-features/</a> to unblock these.</code></script>
    <script> var theChampSiteUrl = 'https://our.news', theChampVerified = 0, theChampEmailPopup = 0; </script>
    <script> var theChampFBKey = '<redacted>', theChampFBLang = 'en_US', theChampFbLikeMycred = 0, theChampSsga = 0, theChampCommentNotification = 0, theChampHeateorFcmRecentComments = 0, theChampFbIosLogin = 0; </script>
    <style type="text/css">
    	.the_champ_horizontal_sharing .theChampSharing{
    	color: #fff;
    	border-width: 0px;
    	border-style: solid;
    	border-color: transparent;
    	}

    Social Commenting, Social Sharing, and Like Buttons are all disabled in the admin dashboard, but that code above still appears on every page.

    We even tried dequeuing some of the scripts/styles in functions.php, but that doesn’t appear to work as this code appears to not be enqueued normally.

    Is there any way for us to specify to only load this plugin on the Login and Register pages, and/or remove the code it inserts on all other pages?
    Thank you!

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Heateor Support

    (@heateor)

    Hi there,

    We will improve this aspect in upcoming releases.

    We even tried dequeuing some of the scripts/styles in functions.php, but that doesn’t appear to work as this code appears to not be enqueued normally

    You need to dequeue the files in the same fashion in which these are enqueued. You can do that like described below:

    /**
     * Initiate dequeue call on 'init' event
     */
    function heateor_ss_dequeue_init() {
        add_action( 'wp_enqueue_scripts', 'heateor_ss_dequeue_scripts_css' );
    }
    add_action( 'init', 'heateor_ss_dequeue_init' );
    
    /**
     * Dequeue CSS and Javascript on the required pages
     */
    function heateor_ss_dequeue_scripts_css() {
        wp_dequeue_script( 'the_champ_ss_general_scripts' );
        // you can dequeue more scripts and CSS
    }
    Phil

    (@magicfilou)

    Hi!

    Yep, I hope you will release a new version soon to show your code only on page where we call your functions …. As you know we are fighting against time loading on every page, so useless codes are indesirable

    TIA

    Thread Starter rzack

    (@rzack)

    Thank you, however, we tried that dequeue code and it also does not seem to work. Likely since you aren’t always enqueuing ALL the style/scripts but hard coding their insertion. For example, line 125 of super_socializer.php:

    <script>function theChampLoadEvent(e){var t=window.onload;if(typeof window.onload!="function"){window.onload=e}else{window.onload=function(){t();e()}}}</script>

    Dequeuing won’t work since this script is being hard-coded and not enqueued.
    Please fix in next release. Thank you!

    • This reply was modified 6 years, 9 months ago by rzack.

    Hi everyone !

    Thanks for this great plugin ! I have the same problem of rzack.

    Please fix it soon. Thank you!

    Plugin Author Heateor Support

    (@heateor)

    @magicfilou @wp-spirit
    Okay. We will do it soon.

    Thank you, however, we tried that dequeue code and it also does not seem to work

    Dequeue function will dequeue only the .js files which are adding to webpage load time. We will improve it further.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Only load plugin on specific pages’ is closed to new replies.