WordPress on .NET (WpDotNet) is our flagship project and possibly the largest publicly available real-world PHP application that runs on .NET. In the latest version, we are introducing a fantastic set of new features: on-the-fly compilation in the background, live editing, and live diagnostics.
Getting up to speed
WpDotNet is provided as a NuGet package containing the entire compiled project. Getting it to work as part of an ASP.NET (Core) 5.0 application is as simple as referencing the NuGet package
PeachPied.WordPress.AspNetCore. To update to the newest version, just change the referenced package version to
5.7.1-preview7. For more information on how to create a web application with WordPress, please see docs.peachpie.io/scenarios/wordpress/aspnetcore-wordpress/.
On-the-Fly Background Compilation
The new feature – on-the-fly compilation or hotplug – allows users to work with WpDotNet applications just as they are used to from the standard PHP version of WordPress. Any modifications within wp-content plugins and themes folders take effect even during run time.
Our built-in HotPlug plugin watches for files inside those folders and tries to compile the files in the background. If there are no errors, the compiled assembly is seamlessly swapped in-memory, and is used by the running application. Since the compilation produces various interesting diagnostics, we are listing them for your convenience directly in the WordPress admin section, as well.
This enables you to use regular plugins and themes from the WordPress marketplace within the dashboard together with pre-compiled ones. As a result, users preferring not to have source files of themes and plugins on their server are still able to reference them at design time, having only the compiled DLLs on the server. Furthermore, it is now possible to use plugins and themes “xcopied” to the application’
Great for developers
WpDotNet does not allow 3rd party code that contains errors. Whenever a plugin or theme contains a vulnerability or anything our analysis views as a fatal problem, the compilation fails and the compiled assembly won’t be loaded into the memory. Developers may edit their plugins and check the diagnostics and problems the code has, and also debug their code right in Visual Studio.
Also, whenever a user installs a plugin from the dashboard, they will see whether the plugin contains possible issues, or whether there might be problems in combination with their version of WpDotNet.