The Imperative of Modern PHP: Fortifying WordPress Security and Performance in an Evolving Digital Landscape

The WordPress ecosystem is at a critical juncture, grappling with the pervasive risks associated with outdated PHP versions. A recent discussion on the Jukebox Podcast from WP Tavern, featuring seasoned WordPress developer Milan Petrović, illuminated the urgent need for websites to transition to modern PHP 8.x, emphasizing its profound implications for both security and performance. Petrović’s insights, stemming from his presentation at WordCamp Europe, underscore a growing consensus among developers and security experts: clinging to legacy PHP is an active invitation for exploitation in an increasingly sophisticated threat environment.
Background: WP Tavern, Jukebox Podcast, and WordCamp Europe
WP Tavern is a prominent news publication dedicated to all aspects of the WordPress content management system, covering its people, events, plugins, blocks, and themes. The Jukebox Podcast, hosted by Nathan Wrigley, serves as an audio extension of this mission, offering in-depth conversations with key figures in the WordPress community. This particular episode delved into a topic of paramount importance: the often-overlooked yet critical role of PHP versions in maintaining a secure and efficient WordPress website.
The discussion was particularly timely, following Milan Petrović’s presentation at WordCamp Europe, one of the largest annual gatherings for the global WordPress community. These events serve as crucial platforms for sharing knowledge, fostering collaboration, and addressing pressing issues facing the platform. Petrović, with nearly two decades of experience immersed in the WordPress and PHP landscapes, brought a wealth of practical knowledge to the fore. His journey began in 2007, encompassing the development of numerous plugins, particularly for bbPress forums, leading his own company (Dev4Press), and eventually joining the Freemius team as a full-stack developer in 2024. This extensive background positions him uniquely to speak on the evolution and current challenges of WordPress development.
The Looming Threat: Legacy PHP and Open Vulnerabilities
A central theme of Petrović’s message is the severe security debt incurred by websites running on older, unsupported PHP versions. He highlighted that many WordPress users are only peripherally aware of PHP, perhaps noting version numbers in their hosting control panels without fully grasping their impact. However, the reality is stark: legacy PHP versions, particularly PHP 7.4 and earlier, expose sites to a multitude of known vulnerabilities.
"There are 3 or 4,000 open bug reports for PHP 7 and PHP 5, which are still in use today," Petrović stated, expressing alarm at the sheer volume of unpatched issues. These bugs, publicly documented and accessible, represent a fertile ground for malicious actors. Since PHP 7.4 reached its end-of-life more than four and a half years ago (around late 2019 / early 2020), these thousands of confirmed bugs will never receive official fixes. This means that websites operating on these versions are inherently vulnerable to automated exploitation, as hackers can leverage these well-known weaknesses at the server level, irrespective of the specific content management system in use.
Common exploits, such as authentication bypass and server-side request forgery, find easier success on legacy code. Petrović characterized the continued reliance on these outdated versions as "an active invitation for automated exploitation," emphasizing that such sites are not merely at risk, but are effectively signaling their susceptibility to attack. The danger is not abstract; it translates into real-world threats of data breaches, website defacement, and service disruption.
Performance: The Unsung Hero of Modern PHP
Beyond security, Milan Petrović underscored the significant performance enhancements offered by newer PHP versions, particularly PHP 8.x. This aspect is often overlooked but provides a compelling business case for upgrades, especially for hosting providers and agencies.
"Each new version gets you 5 or 10% more performance without doing anything," Petrović explained. He pointed out that PHP 8.5 is "more than 50% faster than PHP 7.4." This substantial increase in execution speed is coupled with a notable reduction in memory usage. Petrović presented a slide at WordCamp Europe demonstrating how the same piece of code could run with almost half the memory on PHP 8.5 compared to older versions.
For hosting companies, these performance gains translate directly into cost savings and increased capacity. Faster execution and lower memory consumption mean that servers can handle more websites or deliver existing sites with greater responsiveness, improving user experience and SEO rankings. For individual website owners, the benefits are equally tangible: quicker page loads, smoother interactions, and a more efficient backend. The argument, as presented by Petrović, is remarkably straightforward: modern PHP makes websites faster, more resource-efficient, and inherently more secure.
WordPress’s Backward Compatibility Dilemma
The conversation inevitably turned to WordPress’s long-standing policy of backward compatibility. This policy, while instrumental in the platform’s widespread adoption by allowing users to run older versions on varied server environments, has inadvertently created a significant challenge for modernization.
"One of the most important decisions that… was done with WordPress early on, is that backwards compatibility, because it opened the doors for a wider adoption," Petrović acknowledged. This approach enabled hosting companies to offer WordPress hosting cheaply without the immediate pressure to update server environments. However, this commitment has led to a situation where "even the WordPress Core code is kind of stuck because of that policy." WordPress still officially supports PHP 7.4, despite its end-of-life status, and astonishingly, a small percentage of WordPress sites continue to run on PHP 5, which has been unsupported for many years. Current statistics often show around 20% of WordPress sites still on PHP 7.4, with a persistent tail of even older versions.
Petrović argued that WordPress needs to accelerate its adoption of newer PHP versions. He suggested that declaring PHP 8.0 or 8.1 as the new minimal required version would be a crucial "step in the right direction." While WordPress itself is compatible with PHP 8.x, officially deprecating support for older versions would send a strong signal to the wider ecosystem—developers, hosting providers, and end-users—to upgrade. This doesn’t necessitate an immediate, sweeping overhaul of WordPress core code, which could be modernized gradually. Instead, it creates an environment where new features and security patterns inherent in modern PHP can be fully leveraged.
The Role of Hosting Providers and Developers
The adoption challenge isn’t solely on WordPress core. Hosting companies, plugin developers, and end-users all play a part. Petrović categorized hosting providers into different groups:
- Managed Hosting: Often proactive, forcing updates to at least PHP 8.2 or 8.3, despite potential support burdens if something breaks.
- Budget Hosts: More resistant to change due to the significant investment required to update infrastructure and staff, coupled with a large base of non-technical users who prioritize stability over cutting-edge features.
Petrović recognized the complexity for hosting providers, who face "a lot of factors to play into that adoption." The fear of breaking websites and generating support tickets from non-technical users is a significant deterrent. However, he reiterated that the long-term gains in performance and security far outweigh the initial investment and challenges.
Plugin developers, too, face a balancing act. Many popular plugins have already invested considerable time in updating their codebases to support PHP 8.x. Furthermore, reliance on third-party libraries often forces developers’ hands. "Outside of WordPress ecosystem, those libraries will move much faster with the adoption of newer PHPs versions than WordPress itself," Petrović noted. If a plugin depends on a library that now requires PHP 8.1 or 8.2, the plugin developer must update their own requirements, creating a trickle-down effect.
The Vulnerability Lab Plugin: A Tool for Education and Demonstration
To visually demonstrate the stark differences in security and performance across PHP versions, Milan Petrović developed the "Vulnerability Lab plugin." This tool, created specifically for his WordCamp Europe talk and available on GitHub, allows developers to run code examples that exhibit distinct behaviors on old versus new PHP versions.
The plugin aims to demystify the impact of PHP versions. For instance, a piece of code might result in a fatal error on PHP 7.4 while executing flawlessly on PHP 8.x. Crucially, it also illustrates performance metrics, showing how memory usage can be drastically reduced on modern PHP. This tangible evidence can be invaluable for agencies in educating clients about the necessity of upgrades. Instead of simply stating "PHP 7.4 is bad," the plugin offers a concrete "here it is, why it is bad actually."
While primarily designed for developers, the plugin’s visual components and clear demonstrations make it a powerful educational tool for agencies to present compelling arguments to their clients, showcasing the risks of inaction and the benefits of modernization. Petrović plans to expand the plugin to include more examples and possibly a "pattern library" demonstrating how to transition old PHP patterns to secure, modern ones.
A Gradual Path Forward: Community and Continuous Improvement
The path to a more secure and performant WordPress ecosystem, Petrović emphasized, does not require an immediate, all-or-nothing overhaul. Instead, it can be a gradual process. "You can start upgrading small things. You can start with stricter typing. You can start with very small changes, and then gradually you can add those new attributes," he advised developers.
This phased approach acknowledges the complexities of a massive ecosystem like WordPress, where millions of sites run diverse plugin stacks and rely on varied hosting environments. The goal is a combination of WordPress’s existing robust security measures (escaping, sanitization) with the inherent protections and performance gains of modern PHP.
Petrović also highlighted the wealth of information available from the official PHP website, which meticulously details upcoming features and changes for each annual release (e.g., PHP 8.6 expected in December). This resource is vital for developers to stay ahead and plan their upgrade strategies.
Ultimately, the call to action extends to the entire WordPress community:
- WordPress Core: To accelerate the minimum PHP version requirement.
- Hosting Companies: To invest in infrastructure upgrades and actively encourage/facilitate user transitions to modern PHP.
- Plugin/Theme Developers: To update their codebases, leverage modern PHP features, and bump their minimum PHP requirements.
- End-Users: To become more aware of their website’s underlying technology, understand the risks of outdated software, and actively manage their PHP versions in consultation with their hosts or developers.
Milan Petrović’s advocacy for modern PHP serves as a vital reminder that a website, much like a bicycle, requires continuous maintenance and occasional upgrades to remain functional, secure, and efficient. Ignoring these imperatives is not merely neglecting an update; it is knowingly exposing oneself to preventable risks in an ever-evolving digital landscape. The future of WordPress’s security and performance hinges on this collective move towards modernization.







