Odd script added to posts and pages
-
I just set up a new WordPress site last night and I noticed this afternoon that every page and post has the following code appended at the end, sometimes multiple times:
<script>// <![CDATA[ (function () { window.setTimeout(function() { initPlayer(true); }, 2500); window.setTimeout(function() { initPlayer(false); }, 3000); window.setTimeout(function() { initPlayer(false); }, 3500); function initPlayer() { ytPlayer = document.getElementById("movie_player"); ytPlayer.addEventListener("onStateChange", "onPlayerStateChange"); } onPlayerStateChange = function(newState) { if (newState == "-1") { init(); } //Video Unstarted! if (newState == "0") { init(); } //Video Ended! if (newState == "1") { init(); } //Video Playing! if (newState == "2") { init(); } //Video Paused if (newState == "4") { init(); } //Video Buffering! if (newState == "5") { init(); } //Video Cued! } onStateChange = function(newState) {} init = function() { var settings_button = document.querySelector(".ytp-settings-button") if(typeof settings_button !== 'undefined' && settings_button !== null) { settings_button.click(); settings_button.click(); } var all_labels = document.getElementsByClassName("ytp-menuitem-label"); for (var i = 0; i < all_labels.length; i++) { var txt = all_labels[i].textContent; if ((txt == "Annotations" || txt == "Aantekeninge" || txt == "Annotasiyalar" || txt == "Anotasi" || txt == "Anotasi" || txt == "Anotacions" || txt == "Poznámky" || txt == "Annoteringer" || txt == "Anmerkungen" || txt == "Märkused" || txt == "Anotaciones" || txt == "Anotaciones" || txt == "Oharpenak" || txt == "Mga Anotasyon" || txt == "##PART 2##" || txt == "Anotacións" || txt == "Napomene" || txt == "Izichasiselo" || txt == "Textaskýringar" || txt == "Annotazioni" || txt == "Ufafanuzi" || txt == "Piezīmes" || txt == "Komentarai" || txt == "Kommentárok" || txt == "Aantekeningen" || txt == "Annoteringer" || txt == "Izohlar" || txt == "Adnotacje" || txt == "Notas" || txt == "Anotações" || txt == "##PART 3##" || "Adnotări" || txt == "Shënime" || txt == "Anotácie" || txt == "Pripisi" || txt == "Merkinnät" || txt == "Annoteringar" || txt == "Chú thích" || txt == "Пояснения" || txt == "Аннотациялар" || txt == "Аннотациялар" || txt == "Прибелешки" || txt == "Тэмдэглэгээ" || txt == "Аннотацииv" || txt == "Напомене" || txt == "Анотації" || txt == "##PART 4##" || txt == "Σχολιασμοί" || txt == "Ծանոթագրություններ" || txt == "הערות" || txt == "تشریحات" || txt == "التعليقات التوضيحية" || txt == "حاشیهنویسیها" || txt == "एनोटेशनहरू" || txt == "भाष्ये" || txt == "टिप्पणियां" || txt == "টিকা রচনা" || txt == "ਐਨੋਟੇਸ਼ਨਸ" || txt == "ઍનોટેશન્સ" || txt == "விரிவுரைகள்" || txt == "ఉల్లేఖనాలు" || txt == "ಟಿಪ್ಪಣಿಗಳು" || txt == "വ്യാഖ്യാനങ്ങൾ" || txt == "##PART 5##" || txt == "විවරණ" || txt == "คำอธิบายประกอบ" || txt == "ຄໍາອະທິບາຍປະກອບ" || txt == "မှတ်စာများ" || txt == "ანოტაციები" || txt == "ማብራሪያዎች" || txt == "ចំណារពន្យល់" || txt == "注释" || txt == "註解" || txt == "註解" || txt == "アノテーション" || txt == "특수효과") && (all_labels[i].parentNode.getAttribute("aria-checked") == "true")) { all_labels[i].click(); } } }; })() // ]]></script>When I start a new post with the text editor it is not there, but if I switch to the visual editor and back to text it is added. To me it looks like YouTube code, but I do not have any videos on my site.
I have Akismet and SI CAPTCHA Anti-spam installed and I am using a child theme customization of Twenty Sixteen I made with a few CSS changes to the background and fonts.
I did check out Disqus but I have since uninstalled the plugin. I am not sure if that is related at all.
The topic ‘Odd script added to posts and pages’ is closed to new replies.