-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Web] Ship additional .wasm bundles with more PHP extensions #655
Comments
We have the same issue with our plugin. It needs both the |
Thank you for reporting @Mte90! mbstring is already supported, just not shipped with the web version of Playground. @akirk suggested shipping additional wasm bundles with more PHP extensions for the plugins that need that. Let's make this issue all about that. There could be 3 bundles:
Then, Playground would need to accept a list of PHP extensions and choose an appropriate bundle. This would affect the following APIs:
|
Why not ship just a single playground version with all the php modules? |
@Mte90 I'd love to do that! The problem is with the bundle size – the minimal playground build for the web is 6MB at the time, while the Node.js build that has more extensions is about ~11MB. With more extensions, that figure is only going to grow, but modularity would allow us to only download what's needed. I'm currently exploring modular extension loading in #314. |
It make sense but we are talking about a playground that is used by desktop and not mobile so downloading is not a big problem (compared to mobile). |
@Mte90 I didn't mean that as a blocker. Shipping an additional "all included" bundle for the plugin directory sounds reasonable to me until there is a modular solution. The preview in the plugin repository will be an opt-in feature and offer a convenient way for plugin authors to define the required PHP extensions. Whether the default option should be a "minimal" PHP build or an "all included" build is a separate conversation and would be a good fit for https://meta.trac.wordpress.org/ticket/7251. |
Adds support for loading arbitrary PHP extensions in the web version of Playground using all three available APIs: * Query API: `?php-extension-bundle=kitchen-sink` * Blueprints: `{ "phpExtensionBundles": [ "kitchen-sink" ] }` For now, it only switches between a barebones ~6MB PHP build and a larger ~8MB with more extensions included. In the future, the internal implementation will change and PHP extensions will be shipped and downloaded separately – see #673 1. Click the new "Load PHP extensions" checkbox in the configuration modal 2. Go to /phpinfo.php and confirm that `gd`, `xml`, and `mbstring` extensions are now available 3. Uncheck that checkbox 4. Confirm these extensions are no longer loaded <img width="1251" alt="CleanShot 2023-10-11 at 19 50 14@2x" src="https://github.com/WordPress/wordpress-playground/assets/205419/4f341a98-6a3a-4b01-b406-03d3e2834a20"> Solves #655 cc @dmsnell @danielbachhuber @seanmorris
Lack of OpenSSL support is currently a blocker for our plugin in WordPress Playground; looking forward to more PHP extensions being supported! |
@tbradsha Thank you for letting us know! Solving this issue is slowly becoming possible, especially after the recent merge of #838. Is your plugin publicly available? How are you using OpenSSL in it? I'm asking because the current level of network support doesn't enable use-cases like e.g. downloading SSL certificates, see #85 |
Indeed, you can search the WP.org repo for Jetpack CRM. We primarily use OpenSSL to encrypt/decrypt sensitive data. |
…883) ## What is this PR doing? Related to #655 Includes the OpenSSL PHP extension in the `kitchen-sink` extension bundle. This also makes it available via the "Load extensions" checkbox on playground.wordpress.net. ## Testing instructions 1. Apply this PR 2. Open Playground and go to /phpinfo.php 3. Confirm the OpenSSL extension is listed as available
Playground now supports an "all available PHP extensions" bundle via the
|
There is a way to load them without the modal itself? like with a URL or something in the readme? |
Yeah, see the Query API and Blueprints API in my reply. Here's how you'd use them: Query API: https://playground.wordpress.net/?php-extension-bundle=kitchen-sink Blueprints API: https://playground.wordpress.net/#{"phpExtensionBundles":["kitchen-sink"]} |
Ah ok sorry I didn't understood that kitchen-sink is just a placeholder for a php module. |
In case of our plugin Glossary we need the
mbstring
andiconv
available.You can see the plugin warning on https://playground.wordpress.net/?plugin=glossary-by-codeat&login=1&url=/wp-admin/plugins.php
Also a list in the doc of the PHP modules used by the tool can be useful for this things
The text was updated successfully, but these errors were encountered: