Third-party code on your site
PerformanceOn an average website a whole lot of code runs that does not come from there.
9 min read
By Timo Wessels Published
A website usually runs a lot of code that does not come from you. A counting script, a map, a chat window, a font, a review widget, a booking system.
Each of them loads from a third-party server. It then runs in your visitor’s browser, with the same rights as your own code. It can read what is on the page. It can change the page. It can read along with what someone types into a form.
There is another layer below: plugins and themes get their updates from sources that do not belong to you. That is third-party code too. It even runs on your server and can reach the database.
The most important points first:
- Almost all weaknesses sit in plugins, not in WordPress itself.
- Weaknesses are exploited fast, often within hours.
- The less third-party code you have, the smaller the risk.
How big the problem is
The figures come from the security company Patchstack, from its report for 2026.
In 2025, 11,334 new vulnerabilities became known in the WordPress world. That is 42 percent more than the year before.
They are spread like this:
- 91 percent in plugins
- 9 percent in themes
- Only 6 in WordPress itself. None of them was dangerous.
So the risk sits almost entirely in what you install on top.
The real problem is speed. For heavily exploited vulnerabilities, attackers need only 5 hours on average to exploit them at scale. And for 46 percent of the vulnerabilities, no fix existed yet when they were published.
The attack through the supply chain
Attacking one single website is hardly worth it. Attacking a plugin that runs on hundreds of thousands of websites is very much worth it.
Two cases from April 2026 show this.
Case one: the plugin vendor EssentialPlugin. The vendor had been building plugins since 2015. In 2025 the company was sold through a trading platform. The new owner’s first act was to build a backdoor into the plugins. It stayed unused for about seven months. On 5 April 2026 it became active. More than 20 plugins were affected. Two days later the WordPress plugin team confirmed the attack and closed the affected plugins.
Case two: the slider plugin Smart Slider 3 Pro. Unknown attackers broke into the vendor’s update servers. They distributed a poisoned version, 3.5.1.35, through the official update channel. That is exactly the route people consider safe. The version was out for about six hours on 7 April 2026 until it was noticed. Anyone who updated in that time received a remote-access toolkit on their server. Smart Slider 3 has more than 800,000 active installations in total. Only those who updated the Pro version in that window were affected.
The lesson is uncomfortable and simple: if a plugin changes owner, that is a security event.
Your trust is in the developer, their care and their reputation. After a sale, none of that carries over automatically.
So assess the plugin again, as you did the first time. Who is the new vendor? What else do they do? Why did they buy?
Such sales are usually announced in a post that hardly anyone reads. For plugins that run on many websites, it is worth watching for them.
Will you notice when a script changes?
For files from third-party servers there is a method for this. You write a checksum into the HTML. The browser loads the file and calculates the checksum again. It runs the file only if it matches. If it does not match, it stops with an error.
<script src="https://cdn.example.com/bibliothek-3.2.1.js"
integrity="sha384-…"
crossorigin="anonymous"></script>
What it detects: someone swaps the file at the same address.
Where it works: for files with a fixed address and a fixed version. A library in version 3.2.1 delivers the same bytes on every request.
Where it does not work:
- Tag managers. They put their file together anew on every request. The bytes are different each time. A fixed checksum cannot exist.
- Addresses that always deliver the latest version. They change as soon as the vendor publishes something.
Why the difference matters: such sources are a risk you accept knowingly. You cannot repair them. Reporting both the same way would be dishonest. A line that is always red gets overlooked sooner or later.
So the right question is not “How do I secure this?” but “Do I need this?”
The matter of new windows
A link that opens in a new window gives the target page a connection back to your page. The target page could then redirect your page. Your visitor only notices when they switch back.
A small addition on the link helps:
<a href="https://example.com" target="_blank" rel="noopener">To the source</a>
For context: according to the HTML standard, browsers now do this on their own for target="_blank". Writing it out does no harm. It records the intention in the code.
rel="noreferrer" goes one step further. It stops the address you came from being sent along.
The one real emergency
There is one finding you deal with not “this month” but today: an entry on the warning list that Chrome and other browsers use.
Then visitors see a red warning across the whole page instead of your site. Nobody gets through. There are no enquiries and no sales. And everyone who sees it loses trust.
The finding also appears in Google Search Console. The section is called “Security issues”.
How to proceed. It is an incident, not an optimisation item:
- Change all access details: WordPress, database, FTP, host.
- Check the files. Look above all where malicious code likes to hide.
- Restore from a clean backup. A long retention pays off here. If the backdoor has been on the site for six weeks, yesterday’s backup is affected too.
- Find the cause.
- Only then request a new review.
Anyone who only has the warning removed and does not find the cause often gets a second entry. It is treated more strictly than the first.
And the other way round: a clean result is no free pass. The list reports only what has already been found. A freshly hacked site is not on it yet.
How to check it yourself
The list of third parties. Open the developer tools with F12. Choose the “Network” tab. Reload the page. Sort by domain. Anything that is not your own address is a third party. Write the list down. It is usually longer than expected.
Ask three questions about each entry:
- Do I know what this is?
- Do I still need it?
- Is it in my privacy policy?
The third question links two topics. The same list answers both: which third-party code runs, and which recipients the privacy policy must name. Two duties, one list.
The status on the warning list. Google Search Console has a section called “Security issues”. If nothing is there, all is well at this point.
The plugins. In the back end, under “Plugins”, look: when was the last update? Is the plugin still maintained? A plugin with no update for two years is an open bill.
The links. Search the source code once for target="_blank" and see whether rel is there.
What you can do
1. Less is more. What you remove, you do not have to secure. That is the most effective step. It makes the page faster and the privacy policy shorter.
On almost every grown website I find tracking pixels from campaigns that ran years ago. Add widgets from services that were cancelled long ago.
2. Switch on automatic updates where it is reasonable. With an average of 5 hours, “I do the updates at the end of the month” is not a strategy. For critical building blocks that an update might break, go through the test environment. But do it promptly.
3. Set checksums where you can: for libraries with a fixed version from third-party servers.
4. For all the others, ask whether they have to be there.
5. Keep the list of third parties and maintain it together with the privacy policy. If you maintain only one of the two, both go out of date.
6. Reassess when a plugin changes owner.
7. Have a backup with a long retention. In an emergency it is the difference between half a day and a week.
What I tell clients: the question is not whether to trust third-party code. Nobody builds a website without it today. The question is how many you trust. Five services that you know and maintain are manageable. Twenty, half of which nobody can place, are not.
Sources
- Patchstack, State of WordPress Security in 2026 — 11,334 new vulnerabilities in 2025 (plus 42 percent), 91 percent in plugins, 9 percent in themes, 6 in core without high priority, a median of 5 hours to mass exploitation for heavily exploited vulnerabilities, 46 percent unfixed at disclosure: patchstack.com(external site: patchstack.com)
- Patchstack, Critical Supply Chain Compromise on 20+ Plugins by EssentialPlugin, 15 April 2026 — the sale of the company in 2025, the backdoor unused for about seven months until 5 April 2026, confirmation by the plugin team on 7 April, more than 20 plugins: patchstack.com(external site: patchstack.com)
- The Hacker News, Backdoored Smart Slider 3 Pro Update Distributed via Compromised Nextend Servers, 10 April 2026, citing Patchstack and Nextend — the poisoned version 3.5.1.35 through the official update channel, available for about six hours, more than 800,000 active installations of Smart Slider 3 in total: thehackernews.com(external site: thehackernews.com)
- W3C, Subresource Integrity — the
integrityattribute with a checksum,crossorigin, the browser refuses files that fail the check: w3.org(external site: w3.org) - WHATWG, HTML Standard: Links —
rel="noopener"andnoreferrer, and thattarget="_blank"withoutrel="opener"is treated likenoopener: html.spec.whatwg.org(external site: html.spec.whatwg.org) - Google Search Console Help, Security issues report — how Google reports hacked content and malware, with warnings in search and in the browser: support.google.com(external site: support.google.com)
- Google, Safe Browsing — Chrome and other browsers show a warning before dangerous sites: safebrowsing.google.com(external site: safebrowsing.google.com)
- Own testing practice — the five steps for an entry on the warning list, the note on the second entry, the retention of backups, the tracking pixels from old campaigns, the list of third parties for security and the privacy policy at once.