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

Include /wp-includes/fonts/dashicons.svg in the bundle #729

Closed
eHtmlu opened this issue Nov 1, 2023 · 0 comments · Fixed by #810
Closed

Include /wp-includes/fonts/dashicons.svg in the bundle #729

eHtmlu opened this issue Nov 1, 2023 · 0 comments · Fixed by #810
Labels

Comments

@eHtmlu
Copy link

eHtmlu commented Nov 1, 2023

Please add /wp-includes/fonts/dashicons.svg to the bundle so the file can be accessed via PHP.

Reason:
For example, the Block Designer plugin requires server-side access to this file:
https://playground.wordpress.net/?plugin=block-designer&php-extension-bundle=kitchen-sink
If you go to the admin panel, click on "Block Designer" and then click on "Create new block", the plugin crashes because the dashicons.svg file is missing.

adamziel added a commit that referenced this issue Nov 27, 2023
playground.wordpress.net ships an optimized WordPress build where most
static assets are removed to keep the initial download snappy. However,
some backend code actually depends on those assets being present as seen
in #729 and #770. This PR allowlists additional files:

* wp-includes/images/media
* wp-includes/fonts/dashicons.svg
* wp-content/plugins/akismet/_inc

To test, run Playground locally, go to this URL, and confirm it displays
the list of files as shown below.

http://localhost:5400/website-server/#%7B%22landingPage%22:%22/test.php%22,%22steps%22:[%7B%22step%22:%22writeFile%22,%22path%22:%22/wordpress/test.php%22,%22data%22:%22%3Cpre%3E%3C?php%20var_dump(glob(%27/wordpress/wp-includes/fonts/*%27));%20var_dump(glob(%27/wordpress/wp-includes/images/media/*%27));%20var_dump(glob(%27/wordpress/wp-content/plugins/akismet/_inc/*%27));%22}]}

```
array(3) {
  [0]=>
  string(60) "/wordpress/wp-includes/fonts/class-wp-font-face-resolver.php"
  [1]=>
  string(51) "/wordpress/wp-includes/fonts/class-wp-font-face.php"
  [2]=>
  string(42) "/wordpress/wp-includes/fonts/dashicons.svg"
}
array(9) {
  [0]=>
  string(47) "/wordpress/wp-includes/images/media/archive.png"
  [1]=>
  string(45) "/wordpress/wp-includes/images/media/audio.png"
  [2]=>
  string(44) "/wordpress/wp-includes/images/media/code.png"
  [3]=>
  string(47) "/wordpress/wp-includes/images/media/default.png"
  [4]=>
  string(48) "/wordpress/wp-includes/images/media/document.png"
  [5]=>
  string(51) "/wordpress/wp-includes/images/media/interactive.png"
  [6]=>
  string(51) "/wordpress/wp-includes/images/media/spreadsheet.png"
  [7]=>
  string(44) "/wordpress/wp-includes/images/media/text.png"
  [8]=>
  string(45) "/wordpress/wp-includes/images/media/video.png"
}
array(3) {
  [0]=>
  string(59) "/wordpress/wp-content/plugins/akismet/_inc/akismet-admin.js"
  [1]=>
  string(62) "/wordpress/wp-content/plugins/akismet/_inc/akismet-frontend.js"
  [2]=>
  string(53) "/wordpress/wp-content/plugins/akismet/_inc/akismet.js"
}
```
adamziel added a commit that referenced this issue Nov 29, 2023
playground.wordpress.net ships an optimized WordPress build where most
static assets are removed to keep the initial download snappy. However,
some backend code actually depends on those assets being present as seen
in #729 and #770. This PR allowlists additional files:

* wp-includes/images/media
* wp-includes/fonts/dashicons.svg
* wp-content/plugins/akismet/_inc

To test, run Playground locally, go to this URL, and confirm it displays
the list of files as shown below.

http://localhost:5400/website-server/#%7B%22landingPage%22:%22/test.php%22,%22steps%22:[%7B%22step%22:%22writeFile%22,%22path%22:%22/wordpress/test.php%22,%22data%22:%22%3Cpre%3E%3C?php%20var_dump(glob(%27/wordpress/wp-includes/fonts/*%27));%20var_dump(glob(%27/wordpress/wp-includes/images/media/*%27));%20var_dump(glob(%27/wordpress/wp-content/plugins/akismet/_inc/*%27));%22}]}

```
array(3) {
  [0]=>
  string(60) "/wordpress/wp-includes/fonts/class-wp-font-face-resolver.php"
  [1]=>
  string(51) "/wordpress/wp-includes/fonts/class-wp-font-face.php"
  [2]=>
  string(42) "/wordpress/wp-includes/fonts/dashicons.svg"
}
array(9) {
  [0]=>
  string(47) "/wordpress/wp-includes/images/media/archive.png"
  [1]=>
  string(45) "/wordpress/wp-includes/images/media/audio.png"
  [2]=>
  string(44) "/wordpress/wp-includes/images/media/code.png"
  [3]=>
  string(47) "/wordpress/wp-includes/images/media/default.png"
  [4]=>
  string(48) "/wordpress/wp-includes/images/media/document.png"
  [5]=>
  string(51) "/wordpress/wp-includes/images/media/interactive.png"
  [6]=>
  string(51) "/wordpress/wp-includes/images/media/spreadsheet.png"
  [7]=>
  string(44) "/wordpress/wp-includes/images/media/text.png"
  [8]=>
  string(45) "/wordpress/wp-includes/images/media/video.png"
}
array(3) {
  [0]=>
  string(59) "/wordpress/wp-content/plugins/akismet/_inc/akismet-admin.js"
  [1]=>
  string(62) "/wordpress/wp-content/plugins/akismet/_inc/akismet-frontend.js"
  [2]=>
  string(53) "/wordpress/wp-content/plugins/akismet/_inc/akismet.js"
}
```
adamziel added a commit that referenced this issue Nov 29, 2023
playground.wordpress.net ships an optimized WordPress build where most
static assets are removed to keep the initial download snappy. However,
some backend code actually depends on those assets being present as seen
in #729 and
#770. This PR
allowlists additional files:

* wp-includes/images/media
* wp-includes/fonts/dashicons.svg
* wp-content/plugins/akismet/_inc

Closes #729
Closes #770

## Testing instructions

To test, run Playground locally, go to this URL, and confirm it displays
the list of files as shown below.


http://localhost:5400/website-server/#%7B%22landingPage%22:%22/test.php%22,%22steps%22:[%7B%22step%22:%22writeFile%22,%22path%22:%22/wordpress/test.php%22,%22data%22:%22%3Cpre%3E%3C?php%20var_dump(glob(%27/wordpress/wp-includes/fonts/*%27));%20var_dump(glob(%27/wordpress/wp-includes/images/media/*%27));%20var_dump(glob(%27/wordpress/wp-content/plugins/akismet/_inc/*%27));%22}]}


```
array(3) {
  [0]=>
  string(60) "/wordpress/wp-includes/fonts/class-wp-font-face-resolver.php"
  [1]=>
  string(51) "/wordpress/wp-includes/fonts/class-wp-font-face.php"
  [2]=>
  string(42) "/wordpress/wp-includes/fonts/dashicons.svg"
}
array(9) {
  [0]=>
  string(47) "/wordpress/wp-includes/images/media/archive.png"
  [1]=>
  string(45) "/wordpress/wp-includes/images/media/audio.png"
  [2]=>
  string(44) "/wordpress/wp-includes/images/media/code.png"
  [3]=>
  string(47) "/wordpress/wp-includes/images/media/default.png"
  [4]=>
  string(48) "/wordpress/wp-includes/images/media/document.png"
  [5]=>
  string(51) "/wordpress/wp-includes/images/media/interactive.png"
  [6]=>
  string(51) "/wordpress/wp-includes/images/media/spreadsheet.png"
  [7]=>
  string(44) "/wordpress/wp-includes/images/media/text.png"
  [8]=>
  string(45) "/wordpress/wp-includes/images/media/video.png"
}
array(3) {
  [0]=>
  string(59) "/wordpress/wp-content/plugins/akismet/_inc/akismet-admin.js"
  [1]=>
  string(62) "/wordpress/wp-content/plugins/akismet/_inc/akismet-frontend.js"
  [2]=>
  string(53) "/wordpress/wp-content/plugins/akismet/_inc/akismet.js"
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants