How WebAssembly Is Powering WordPress ![rw-book-cover](https://cdn.wasmer.io/original_images/webassembly-wp.png) ## Metadata - Author: [[Syrus Akbary]] - Full Title: How WebAssembly Is Powering WordPress - Category: #articles - Document Note: --- tags: [#WebAssembly, #WordPress, #Performance] - #WebAssembly - #WordPress - #Performance Author: Syrus Akbary Source: Wasmer Blog Reference: [How WebAssembly is Powering WordPress](https://wasmer.io/posts/how-webassembly-is-powering-wordpress) date created: 2025-07-15 14:00 --- # Title: How WebAssembly is Powering WordPress ## Table of Contents: - [📝 Summary](#📝-summary) - [📖 Main Content](#📖-main-content) - [🗒️ Notes](#🗒️-notes) - [📖 References](#📖-references) - [🗣️ Paraphrase](#🗣️-paraphrase) - [📰 Newsletter](#📰-newsletter) - [✅ Action Items](#✅-action-items) - [🧪 Hypotheses](#🧪-hypotheses) - [📊 Methodology](#📊-methodology) - [❓ Questions](#❓-questions) - [🔮 Future Research](#🔮-future-research) - [💡 Implications](#💡-implications) - [🧠 Learning Styles Assessment](#🧠-learning-styles-assessment) - [📊 Accessibility Assessment](#📊-accessibility-assessment) - [🌍 DEIB Assessment](#🌍-deib-assessment) - [✅ Logical validity](#✅-logical-validity) - [🔍 DARVO Analysis Prompt](#🔍-darvo-analysis-prompt) - [🔍 SEO Evaluation](#🔍-seo-evaluation) - [🎯 Conclusion](#🎯-conclusion) ### References: - Wasmer Blog - WordPress official documentation - Mozilla WebAssembly docs ## 📝 Summary: This article by Syrus Akbary explains how WebAssembly (Wasm) is being used to enhance WordPress, focusing on performance, portability, and security. By integrating Wasm, WordPress can leverage high-performance code execution beyond traditional PHP, enabling plugins and core features to run faster and more securely. ## 📖 Main Content: Akbary outlines the historical reliance of WordPress on PHP and how Wasm opens new possibilities by allowing compiled languages like Rust, C, and Go to run inside WordPress. This unlocks high-performance functionalities previously difficult to implement. Wasm provides near-native speed, sandboxed execution, and cross-platform compatibility, making it a perfect fit for modern WordPress scalability challenges. He also discusses real-world examples, such as using Wasm for heavy computation tasks in plugins (image processing, data analysis), and hints at future potential for more robust plugin ecosystems and backend performance improvements. ### 🗒️ Notes - **Traditional WordPress stack** - Heavy reliance on PHP. - Historically limited by PHP's single-threaded, interpreted nature. - **WebAssembly benefits** - Near-native execution speed. - Runs languages like Rust, C, and Go in the browser and server contexts. - Secure, sandboxed environments reduce risk. - **Use cases for WordPress** - Image manipulation, data processing, encryption tasks. - Potential to improve plugin performance dramatically. - **Cross-platform advantages** - Same codebase runs on different environments without recompilation. - Bridges the gap between frontend and backend code efficiency. - **Plugin ecosystem impact** - Encourages more complex, high-performance plugins. - Empowers developers from non-PHP backgrounds to contribute. - **Security improvements** - Wasm sandboxing reduces vulnerabilities. - Isolated execution contexts protect main application. ## 📖 References: - [How WebAssembly is Powering WordPress](https://wasmer.io/posts/how-webassembly-is-powering-wordpress) - [Mozilla WebAssembly](https://developer.mozilla.org/en-US/docs/WebAssembly) - WordPress Plugin Developer Handbook ## 🗣️ Paraphrase: 1. Original: "WebAssembly allows developers to run code at near-native speeds, making it possible to handle computationally heavy tasks inside WordPress plugins." - Paraphrased: "Thanks to WebAssembly’s almost native performance, developers can tackle demanding computational workloads within WordPress plugins effectively." 2. Original: "This opens WordPress to a wider range of developers beyond the PHP ecosystem, fostering innovation and stronger security." - Paraphrased: "This broadens WordPress’s appeal, inviting developers skilled in other languages and sparking greater innovation and security enhancements." ## 📰 Newsletter: 🔥 **New Era for WordPress Performance!** 🔥 WebAssembly (Wasm) is stepping onto the WordPress stage, transforming how plugins and core features handle heavy tasks. Imagine lightning-fast image edits and secure, sandboxed execution right inside your WP stack! This means more power to developers, more speed for sites, and new opportunities for plugin innovation. Want to know how Rust, C, and Go could soon boost your favorite CMS? Check it out! 👉 [Read More](https://wasmer.io/posts/how-webassembly-is-powering-wordpress) ## ✅ Action Items: - Evaluate integrating Wasm into GoDaddy's WordPress hosting for speed and security. - Create educational resources to onboard PHP developers to Wasm fundamentals. - Encourage plugin developers to experiment with Wasm for performance-heavy features. - Promote cross-language contributions in open source to foster a more diverse ecosystem. - Align with OSPO goals to support transparent, inclusive innovation. ## 🧪 Hypotheses: - Wasm integration will decrease page load times and server resource usage by at least 20%. - WordPress plugin adoption of Wasm will attract non-PHP developers, increasing ecosystem diversity. ### 📊 Methodology: - Benchmark plugins pre- and post-Wasm integration. - Conduct developer surveys on experience and contribution barriers. - Analyze resource utilization data and security incident reports before and after Wasm adoption. ### ❓ Questions: - How will Wasm reshape the future of WordPress plugin architecture? - What educational initiatives are needed to support cross-language developer onboarding? ### 🔮 Future Research: - Long-term impact of Wasm on WordPress security posture. - Performance comparisons across different hosting environments. ### 💡 Implications: - May redefine WordPress scalability strategies. - Could lead to broader adoption of cross-compiled languages in CMS ecosystems. - Sets precedent for integrating modern runtime tech in open-source platforms. ## 🧠 Learning Styles Assessment: **Readability**: Approx. grade 12. - **Visual**: Limited visuals; diagrams on architecture could help. - **Aural**: No podcast/audio; consider an explainer video. - **Verbal**: Strong narrative and descriptive explanations. - **Physical**: No direct interactivity; suggest Wasm coding labs. - **Logical**: Strong case for benefits with clear examples. - **Social**: Encourages community development and contributions. - **Solitary**: Promotes individual learning via examples and reflections. - **Naturalistic**: Could include green hosting or energy efficiency angles. ## 📊 Accessibility Assessment: - **Screen Reader**: Likely accessible; confirm semantic structure. - **Keyboard**: Should work fine. - **Contrast and Readability**: Clear; verify on different devices. - **Text Resizing**: Flexible; should maintain layout integrity. ## 🌍 DEIB Assessment: - **Cultural Relevance**: Focus on tech; more global case studies could help. - **Inclusive Language**: Neutral and inclusive. - **Neurodiversity Support**: Could improve with shorter paragraphs and bullet points. - **Representation**: Limited mention of contributor diversity. - **Psychological Safety**: Encourages broad participation without gatekeeping. ## ✅ Logical validity: **Strengths**: - Balanced view of PHP limitations vs. Wasm potential. - Strong causal links between Wasm features and benefits. **Weaknesses**: - Lacks detailed counterarguments or empirical benchmarks. **Tone**: Enthusiastic, persuasive, technical yet accessible. ## 🔍 DARVO Analysis Prompt: - **Deny**: None present. - **Attack**: No personal or competitive attacks. - **Reverse Victim**: None; the focus is constructive. **Conclusion**: No DARVO tactics; narrative is open and welcoming. ## 🔍 SEO Evaluation: - **Keywords**: "WebAssembly," "WordPress performance," "WordPress plugins" — naturally used. - **Meta Description**: Strong; highlights Wasm's role in boosting WordPress. - **Title Tag**: Clear and keyword rich. - **Headers**: Structured, supports SEO. - **Content Length**: Good depth. - **Links**: Includes authoritative and internal references. - **URL**: Short, descriptive. - **Images**: Could add diagrams with alt - Summary: In less than a year, [WordPress.com](http://WordPress.com) released WP Playground and WP Studio. But …did you know that both **WordPress Playground**... - URL: https://wasmer.io/posts/how-webassembly-is-powering-wordpress ![Post cover image](https://wasmer.io/_next/image?url=https%3A%2F%2Fcdn.wasmer.io%2Foriginal_images%2Fwebassembly-wp.png&w=3840&q=75)Post cover image In less than a year, [WordPress.com](http://WordPress.com) released WP Playground and WP Studio. But …did you know that both **WordPress Playground** (the in-browser WordPress playground) and **WP Studio** (a local dev app by WordPress) leverage WebAssembly to run WordPress without needing a PHP server or MySQL database? ![WordPress Studio Screenshot](https://wasmer.io/_next/image?url=https%3A%2F%2Fcdn.wasmer.io%2Fimages%2Fwp-studio-screenshot.original.png&w=1920&q=75)WordPress Studio Screenshot ![WordPress Playground Screenshot](https://wasmer.io/_next/image?url=https%3A%2F%2Fcdn.wasmer.io%2Fimages%2Fwp-playground-screenshot.original.png&w=1920&q=75)WordPress Playground Screenshot The entire WordPress stack (PHP runtime, web server logic, and database) runs in a fully-sandboxed web environment, either in a browser or an Electron-based desktop app thanks to WebAssembly. > 👉 If you are not familiar with WebAssembly, we recommend taking a look at this video: “WebAssembly on 100 seconds”: <https://www.youtube.com/watch?v=cbB3QEwWMlA> > > In this article we will explore the technical implementation details: how WordPress is executed via WebAssembly, the key components involved, performance considerations, how filesystem/database operations work, and the main drawbacks (like reliance on SQLite and performance gaps with native execution). #### Running WordPress via WebAssembly Instead of rewriting WordPress itself to JavaScript to run in the browser, the simplest solution was to compile the PHP *interpreter* (along with needed extensions) to WebAssembly, as WebAssembly can run seamlessly in the browser. That assures full compatibility with any existing PHP program. The WordPress Playground project built a custom pipeline to compile the PHP engine (C source) using **Emscripten** (a C/C++-to-Wasm toolchain) to WebAssembly: [wordpress.github.io](https://wordpress.github.io/wordpress-playground/developers/architecture/wasm-php-overview/#:~:text=WebAssembly%20PHP). The result of compiling PHP to WebAssembly produces a `.wasm` binary (for example, `php-8.2.wasm` for PHP 8.2) that can be loaded in the browser or any Javascript environment. WordPress’s PHP code (the core, plugins, themes) remains exactly the same. The compiled PHP interpreter in *Wasm* reads and executes those scripts at runtime, just like PHP would on a server. ![WordPress compilation pipeline to WebAssembly](https://wasmer.io/_next/image?url=https%3A%2F%2Fcdn.wasmer.io%2Fimages%2Fwordpress-php-compile-wasm.original.png&w=1920&q=75)WordPress compilation pipeline to WebAssembly > 👉 Note: Using Emscripten is not the only way to compile PHP to WebAssembly. At Wasmer we also released [WASIX](https://wasix.org/), which sets a universal system call layer for interacting with WebAssembly and allows running the programs both in the browser and the server. Read further to see the advantages and drawbacks of each strategy. > > To launch WordPress, the environment needs all the usual files and a database. WordPress Playground distributes pre-packaged WordPress releases optimized for the browser: core files are bundled into a small ZIP (around 5MB compressed, down from ~70MB). This bundle includes a pre-configured `wp-config.php` set to use SQLite (since MySQL isn’t available) and even has the installation steps pre-run to simplify the creation process. In the browser, the Playground code fetches the ZIP for the requested WordPress version, unpacks it into an **in-memory virtual filesystem** , and then invokes the PHP-Wasm binary to execute WordPress. Essentially, the browser becomes a self-contained server: “PHP is compiled to WebAssembly (PHP-WASM), MySQL is replaced by SQLite, and server functionality is replaced by JavaScript APIs”. When you navigate the Playground’s demo site, an iframe with a Javascript Service worker captures WordPress’s generated HTML and displays it, making it feel like a normal browsing experience even though WordPress is running inside a sandboxed WebAssembly VM in your browser. #### Key WebAssembly Components and Architecture Several WebAssembly-related technologies make this possible: * [**Emscripten**](https://emscripten.org/): The PHP interpreter (and its C extensions) are compiled to Wasm using Emscripten. Emscripten provides the low-level *libc*, file I/O, and other OS emulation layers that PHP needs. The Playground team created a custom build pipeline for PHP, enabling support for features like the PHP CLI SAPI and needed extensions (SQLite, OpenSSL, libxml, etc.) in the Wasm binary. They also use Emscripten’s [**Asyncify**](https://kripken.github.io/blog/wasm/2019/07/16/asyncify.html) feature in certain builds to deal with blocking PHP calls. For example, in Node.js, Asyncify is used so that synchronous socket functions in PHP can work with async JS APIs (by pausing the Wasm execution while JS completes an operation) * **WebAssembly Runtimes**: In browsers, the Wasm module runs on the built-in WebAssembly engine (like Chrome’s V8 or Firefox’s SpiderMonkey). These engines JIT-compile WebAssembly to native machine code for near-native speed execution. * **Service Workers**: In the browser WordPress Playground, a combination of web technologies orchestrate the WordPress experience. A Service Worker is used to intercept requests (like when WordPress in the iframe tries to load an image or navigate to a new page) and serve the responses from the in-memory WordPress instance, as if it were a web server. The WordPress admin or site frontend is loaded in an `<iframe>`, and the Playground’s JS infrastructure makes sure any request in that iframe (e.g. to `wp-admin/admin-ajax.php` or a page link) is routed to the PHP/Wasm for processing, then the HTML output is delivered back. This is how WordPress can appear to function normally, despite no actual server – the browser itself is *pretending* to be the server using the Playground’s coordination logic The current approach used in WordPress Playground and WP Studio has some major drawbacks: * Emscripten only makes WordPress work in browser-like environments (like WordPress Playground being used in the browser and WordPress Studio using Electron), leaving **server-side** usage unsupported. * **Performance**: compiling PHP to WebAssembly could involve a 3-6x slowdown when executing PHP programs if not done efficiently. In the current build of PHP by WordPress, OpCache is not enabled in the Wasm build of PHP that is powering WordPress Playground and WordPress Studio. So you will see a significant slowdown when running WordPress using Playground or WordPress studio if you try to use some heavy-weight plugins (like Elementor or Woocommerce). * **WP Cron** doesn’t work on WordPress Playground or WordPress studio, which means that many plugins (such as SimplyStatic and more) will not work in your setup. * **SQLite**: to not require the user to have a MySQL server installed (and because of direct socket connections are currently impossible from browser environments), they replaced MySQL with SQLite. However, SQLite is not fully compatible with MySQL. That means that some plugins will simply not work on the WP Playground and Studio. #### How Wasmer solved the drawbacks Thankfully, at Wasmer we solved each of these drawbacks to allow a near-native experience when running and hosting WordPress via Wasmer and WebAssembly: * Thanks to compiling PHP to WebAssembly using [WASIX](https://wasix.org/) instead of Emscripten, we can now run WordPress on servers, in the browser and even embedded, without changing any setup. This is the first universal container of WordPress that can run **seamlessly on the server** or in a browser. * **Performance**: at Wasmer we enabled maximum performance when running PHP. We have done it in various ways: + Thanks to using Wasm Exceptions (instead of Asyncify) for longjmp/setjmp calls used by PHP, we **improved the runtime speed by 2x**. + Thanks to using [Wasmer’s Instaboot](https://wasmer.io/posts/announcing-instaboot-instant-cold-starts-for-serverless-apps), we **improved the startup speed by 10x** when compared to other Cloud ProvidersWe have detailed more of this on our last presentation in Wasm I/O 2025: [Video](https://www.youtube.com/watch?v=DgLZF8eubLI) (slides: <https://speakerdeck.com/syrusakbary/making-php-extremely-fast-in-webassembly>) * **Cron jobs**: Wasmer added support for cron jobs out of the box, this allows running wp-cron jobs without an issue. * **SQLite**: as WASIX allows direct socket connections, you can now run WordPress with MySQL via WebAssembly. Thanks to that we can allow reusing exactly the same code from all the plugins. With all the drawbacks solved, you now can benefit of a great WordPress hosting in Wasmer that runs fast, is safe and supports the whole world of WordPress. At Wasmer, we have been pioneering WebAssembly in server side and browser environments since our inception. Thanks to our unique technology, we can now run PHP at near-native speeds on the server. But we want this technology to be available for everyone, as it allows us to offer incredibly fast hosting at affordable prices. When you deploy new WordPress sites with Wasmer, you will be automatically using WebAssembly under the hood, and will get all the speed improvements for free. Deploy and serve your WordPress sites for free and experience it yourself! Syrus Akbary is an enterpreneur and programmer. Specifically known for his contributions to the field of WebAssembly. He is the Founder and CEO of Wasmer, an innovative company that focuses on creating developer tools and infrastructure for running Wasm, How WebAssembly Is Powering WordPress, Syrus Akbary, 01k075nbmwfntttaf6bt6vct4e.