Title: Why does this put scripts above the declaration?
Last modified: August 2, 2018

---

# Why does this put scripts above the declaration?

 *  Resolved [asha23](https://wordpress.org/support/users/asha23/)
 * (@asha23)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/why-does-this-put-scripts-above-the-declaration/)
 * This is terrible, as it causes my doctype to be ignored.
 * Please change this so that all the scripts load into the head.
 * Thanks

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Thread Starter [asha23](https://wordpress.org/support/users/asha23/)
 * (@asha23)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/why-does-this-put-scripts-above-the-declaration/#post-10551782)
 * Scripts should not be loaded outside of the head especially not before my doctype
   declaration.
 * It’s a hack.
 *  Thread Starter [asha23](https://wordpress.org/support/users/asha23/)
 * (@asha23)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/why-does-this-put-scripts-above-the-declaration/#post-10551825)
 * Have searched through the plugin. This looks like an injection as I can’t find
   references to it anywhere in the plugin itself.
 * What is going on with this???
 *  Thread Starter [asha23](https://wordpress.org/support/users/asha23/)
 * (@asha23)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/why-does-this-put-scripts-above-the-declaration/#post-10551834)
 * Here’s the code
 *     ```
       <script type="text/javascript">function heateorSssLoadEvent(e) {var t=window.onload;if (typeof window.onload!="function") {window.onload=e}else{window.onload=function() {t();e()}}};	var heateorSssSharingAjaxUrl = 'http://azanti.local/wp/wp-admin/admin-ajax.php', heateorSssCloseIconPath = 'http://azanti.local/content/plugins/sassy-social-share/public/../images/close.png', heateorSssPluginIconPath = 'http://azanti.local/content/plugins/sassy-social-share/public/../images/logo.png', heateorSssHorizontalSharingCountEnable = 0, heateorSssVerticalSharingCountEnable = 0, heateorSssSharingOffset = -10; var heateorSssMobileStickySharingEnabled = 0;var heateorSssCopyLinkMessage = "Link copied.";var heateorSssUrlCountFetched = [], heateorSssSharesText = 'Shares', heateorSssShareText = 'Share';function heateorSssPopup(e) {window.open(e,"popUpWindow","height=400,width=600,left=400,top=100,resizable,scrollbars,toolbar=0,personalbar=0,menubar=no,location=no,directories=no,status")}</script>			<style type="text/css">
       					.heateor_sss_horizontal_sharing .heateorSssSharing{
       							color: #fff;
       						border-width: 0px;
       			border-style: solid;
       			border-color: transparent;
       		}
       				.heateor_sss_horizontal_sharing .heateorSssTCBackground{
       			color:#666;
       		}
       				.heateor_sss_horizontal_sharing .heateorSssSharing:hover{
       						border-color: transparent;
       		}
       		.heateor_sss_vertical_sharing .heateorSssSharing{
       							color: #fff;
       						border-width: 0px;
       			border-style: solid;
       			border-color: transparent;
       		}
       				.heateor_sss_vertical_sharing .heateorSssTCBackground{
       			color:#666;
       		}
       				.heateor_sss_vertical_sharing .heateorSssSharing:hover{
       						border-color: transparent;
       		}
       		@media screen and (max-width:783px) {.heateor_sss_vertical_sharing{display:none!important}}			</style>
       ```
   
    -  This reply was modified 7 years, 10 months ago by [asha23](https://wordpress.org/support/users/asha23/).
 *  Thread Starter [asha23](https://wordpress.org/support/users/asha23/)
 * (@asha23)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/why-does-this-put-scripts-above-the-declaration/#post-10551860)
 * The hack starts on line 146 of class-sassy-social-share-public.php
 * Please fix this plugin and enqueue this inline script properly.
 *  Thread Starter [asha23](https://wordpress.org/support/users/asha23/)
 * (@asha23)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/why-does-this-put-scripts-above-the-declaration/#post-10551887)
 * There is a stylesheet just plonked in there as well
 *  Plugin Author [Heateor Support](https://wordpress.org/support/users/heateor/)
 * (@heateor)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/why-does-this-put-scripts-above-the-declaration/#post-10554478)
 * > Scripts should not be loaded outside of the head especially not before my doctype
   > declaration
 * Plugin uses `wp_head` hook to place the Javascript variables (and the custom 
   CSS you save in the `Custom CSS` option) in `<head>` of the webpage. It’s how
   your theme uses `wp_head` hook that prints that script and CSS at the webpage.
   You can confirm this by switching to another theme for a while.
 *  Thread Starter [asha23](https://wordpress.org/support/users/asha23/)
 * (@asha23)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/why-does-this-put-scripts-above-the-declaration/#post-10567896)
 * The problem is, this puts a script above the <head> of the webpage.
 * It will do this, because in the plugin it just echoes out a load of code.
    -  This reply was modified 7 years, 10 months ago by [asha23](https://wordpress.org/support/users/asha23/).
 *  Plugin Author [Heateor Support](https://wordpress.org/support/users/heateor/)
 * (@heateor)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/why-does-this-put-scripts-above-the-declaration/#post-10569959)
 * Did you try switching to any default theme of WordPress? If you do, you will 
   find that problem is with your theme.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Why does this put scripts above the declaration?’ is closed to new replies.

 * ![](https://ps.w.org/sassy-social-share/assets/icon-128x128.png?rev=3258279)
 * [Social Sharing Plugin - Sassy Social Share](https://wordpress.org/plugins/sassy-social-share/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/sassy-social-share/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/sassy-social-share/)
 * [Active Topics](https://wordpress.org/support/plugin/sassy-social-share/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sassy-social-share/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sassy-social-share/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [Heateor Support](https://wordpress.org/support/users/heateor/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/why-does-this-put-scripts-above-the-declaration/#post-10569959)
 * Status: resolved