Skip to main content

Testing Plugins

You can run a fully functional WordPress test plugin in your own browser, which can be launched in about 10 seconds and reset by refreshing the page.

Principles

The principles include several key technologies:

  1. WebAssembly and PHP: The platform's core is built on WebAssembly, a binary instruction format for a stack-based virtual machine. WebAssembly allows high-performance applications to run on the web. In this case, it runs PHP (the language WordPress is written in), enabling PHP scripts to execute in the browser.

  2. Service Workers and Web Workers: Service Workers handle background tasks and manage offline capabilities, while Web Workers execute scripts in background threads. Together, they facilitate the running of PHP code and manage HTTP requests within the browser environment. These components work together to simulate the server environment required by WordPress.

  3. Virtual File System: The virtual file system is used to manage WordPress files, themes, plugins, and user-uploaded content. This system mimics the file storage typically provided by a server file system. It allows users to interact with WordPress as they would in a standard installation, including uploading and modifying themes and plugins.

Preview Button

On the plugin page, you can click the Preview button to launch the WordPress test environment.

WordPress Toolbar

Once WordPress is fully launched, a toolbar will appear at the top right side. It allows us to perform some quick actions.

Path

On the left side of the toolbar is the current Path of the WordPress site. After modifying it, click the > button to access the corresponding page of the site.

Refresh

Hovering the mouse over the right side buttons will display their respective functions.

Clicking Reload will refresh the current WordPress page (do not use the browser's refresh button, otherwise all modifications to WordPress will be lost).

Home

Clicking the Home button will take you back to the homepage of the WordPress site.

Dashboard

Clicking the Dashboard button will take you back to the WordPress Admin Dashboard.

Plugins

Clicking the Plugins button will take you to the list of plugins. The plugin generated by BudCoder will appear here.

Download

Clicking the Download button will allow you to download the generated plugin code.

Composer Package

When the plugin includes Composer Packages, after WordPress initialization is complete, it will continue to load the Composer Packages.

If loading fails due to network issues, you can click the ... to the left of the Modify button to open the Advanced Options settings box.

Select the Reinstall button to reload.

Error Display

You can find the runtime error messages generated by WordPress in the browser console (opened with F12).

Copy and paste these messages into the modification box to allow BudCoder to automatically fix the errors.

Limitations

This WordPress environment only supports the following PHP extensions:

gd, mbstring, iconv, openssl, libxml, xml, dom, simplexml, xmlreader, xmlwriter