WordPress.org

Ready to get started?Download WordPress

Forums

WP Socializer
Bug causing all js files to be included twice (2 posts)

  1. flicht
    Member
    Posted 1 year ago #

    In wp-socializer 2.4.4 there is a bug that causes each js file to be be included two times.

    The problem is in function wpsr_footer() at line 1478 of file wp-socializer.php. The closing curly bracket for the function is in the wrong place. It needs to be moved to line 1489 so that it encloses the if statement: if(!$wpsr_settings['disablewpsr']){...}

    I hope this is helpful :-)

    http://wordpress.org/extend/plugins/wp-socializer/

  2. vaakash
    Member
    Plugin Author

    Posted 1 year ago #

    I think there is no mistake in it. The function is correctly closed.

    1470	function wpsr_footer(){
    1471	        if(wpsr_addtofavorites_bt_used()){
    1472	                wpsr_addtofavorites_script();
    1473	        }
    1474
    1475	        if(wpsr_button_used('pinterest') == 1){
    1476	                echo wpsr_pinterest_script();
    1477	        }
    1478	}
    1479
    1480	if(!$wpsr_settings['disablewpsr']){
    1481	        if($wpsr_settings['scriptsplace'] == 'header'){
    1482	                add_action('wp_head', 'wpsr_scripts_adder');
    1483	        }else{
    1484	                add_action('wp_footer', 'wpsr_scripts_adder');
    1485	        }
    1486
    1487	        add_action('wp_footer', 'wpsr_footer');
    1488	}

    In the lines 1480-1488 a conditional "add_action" is made i.e the plugin is in disabled mode, then don't print the scripts. That's all. If it is moved inside the function, then the action will not be called.

    Thank you anyway.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags