Support » Plugin: Social Sharing Plugin - Sassy Social Share » Why does this put scripts above the declaration?
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
-
Scripts should not be loaded outside of the head especially not before my doctype declaration.
It’s a hack.
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???
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 5 years, 4 months ago by
asha23.
The hack starts on line 146 of class-sassy-social-share-public.php
Please fix this plugin and enqueue this inline script properly.
There is a stylesheet just plonked in there as well
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 theCustom CSS
option) in<head>
of the webpage. It’s how your theme useswp_head
hook that prints that script and CSS at the webpage. You can confirm this by switching to another theme for a while.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 5 years, 3 months ago by
asha23.
Did you try switching to any default theme of WordPress? If you do, you will find that problem is with your theme.
-
This reply was modified 5 years, 4 months ago by
- The topic ‘Why does this put scripts above the declaration?’ is closed to new replies.