Skip to content
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

New blueprint: use runPHP to add a woocommerce product #28

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

mujuonly
Copy link
Contributor

@mujuonly mujuonly commented Apr 18, 2024

The goal:

Create a product with additional metadata using runPHP option with wp_insert_post
Use phpExtensionBundles - kitchen-sink to generate XML file
Redirect to the product feed generating page using landingPage

@adamziel
Copy link
Contributor

Thank you for contributing this, @mujuonly! It looks good, I'd just move it from a runphp directory to something more descriptive, such as woocommerce-product-feed. Don't worry about the failing CI checks, that's something to fix on my end.

Switch to pull_request_target in preview-comment.yml.

Compare the updated files to merge-base trunk instead of trunk in
validate_pr.yml.
@adamziel adamziel merged commit c196946 into WordPress:trunk Apr 19, 2024
1 check passed
@adamziel
Copy link
Contributor

Oops wrong command, let me revert this and restore the original change

adamziel pushed a commit that referenced this pull request Apr 19, 2024
runphp example

blueprint line end

Blueprint metadata
@adamziel
Copy link
Contributor

adamziel commented Apr 19, 2024

Done in f5f2cef, I also renamed the directory in f5cccb2

imjlk pushed a commit to imjlk/wordpress-playground that referenced this pull request May 5, 2024
## What is this PR doing?

Supersedes WordPress#1051

Adds a PHP Blueprints demo page where the use of
[blueprints.phar](WordPress/blueprints#28) PHP
library in Playground may be further explored. The showcase is
intentionally not added to
http://localhost:5400/website-server/demos/index.html as PHP Blueprints
may become a part of Playground core soon enough.

For more context see:

* WordPress#1025
* https://github.com/WordPress/blueprints

## How does it work?

* The built Blueprints library is included with this PR via the
`blueprints.phar` file
* A number of PHP.wasm improvements have been merged to support it:
   * WordPress#1064
   * WordPress#1065
   * WordPress#1069
* This PR ships a `fetch` subprocess handler to enable streaming network
data in the Blueprints library – it uses [a special network transport
called
`fetch`](https://github.com/WordPress/blueprints/blob/efa8deef56095bd5bcb94868787e29f7b54350f3/src/WordPress/DataSource/PlaygroundFetchSource.php)
that requests network data via `proc_open()` when running in Playground.
Why subprocesses? They provide everything a custom network handler
needs: pipes, asynchronous execution, exit codes, internal PHP plumbing.

## Follow-up work

* Support a real-time progress bar

## Testing instructions

Go to http://localhost:5400/website-server/demos/php-blueprints.html and
confirm it looks like on the screenshot below:

![CleanShot 2024-02-28 at 15 46
14@2x](https://github.com/WordPress/wordpress-playground/assets/205419/47a91d99-07f3-40a5-a046-b58f8cda952e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants