Skip to content

Commit 05e63e0

Browse files
committed
WordPress: Keep dashicons, icons, and Akismet CSS in the bundle
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" } ```
1 parent f2444b4 commit 05e63e0

File tree

141 files changed

+16145
-11482
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+16145
-11482
lines changed

packages/playground/compile-wordpress/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ RUN cd wordpress && \
6565
\) \
6666
# Preserve the wp-admin SVG files that are read by PHP
6767
-not -path '*/wp-admin/images/*.svg' \
68+
# Some plugins use the dashicons font. See #729.
69+
-not -path '*/wp-includes/fonts/dashicons.svg' \
70+
# WordPress functions like wp_mime_type_icon() use
71+
# the icons shipped in images/media. See #770.
72+
-not -path '*/wp-includes/images/media/*' \
6873
-delete
6974

7075
# Keep only the CSS files that are read by PHP
@@ -81,11 +86,6 @@ RUN cd wordpress && \
8186
# This file is patched in JavaScript and needs to
8287
# be served from VFS. See #703
8388
-not -path '*/wp-includes/js/dist/block-editor*.js' \
84-
# Some plugins use the dashicons font. See #729.
85-
-not -path '*/wp-includes/fonts/dashicons.svg' \
86-
# WordPress functions like wp_mime_type_icon() use
87-
# the icons shipped in images/media. See #770.
88-
-not -path '*/wp-includes/images/media/*' \
8989
# Akismet is shipped with WordPress and it
9090
# requires the included files to be present
9191
-not -path '*/wp-content/plugins/akismet/*' \

packages/playground/remote/public/wp-nightly/wp-admin/css/about-rtl.css

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222

2323
.about__container {
2424
/* Section backgrounds */
25-
--background: #EAE9E7;
25+
--background: #151515;
2626
--subtle-background: #EAE9E7;
2727

2828
/* Main text color */
2929
--text: #1e1e1e;
3030
--text-light: #fff;
3131

3232
/* Accent colors: used in header, on special classes. */
33-
--accent-1: #C94C26; /* Link color */
33+
--accent-1: #D8613C; /* Link color */
3434
--accent-2: #CFCABE; /* Accent background */
3535
--accent-3: #f0f0f1; /* hr background */
3636
--accent-4: #B1C5A4; /* Light green */
@@ -539,30 +539,28 @@
539539
justify-content: end;
540540
box-sizing: border-box;
541541
padding: var(--gap) 0;
542-
height: clamp(12.5rem, -1.25rem + 36.67vw, 26.25rem);
542+
min-height: 420px;
543543
color: var(--text-light);
544-
background-image: url('../images/about-header-about.svg?ver=6.4'), url('../images/about-header-background.svg?ver=6.4');
545-
background-size: auto 70%, cover;
544+
background: var(--background) url('../images/about-header-about.svg?ver=6.4') no-repeat;
545+
background-size: cover;
546+
background-position: center;
546547
border-radius: 5px;
547-
background-repeat: no-repeat;
548-
background-position: left 7% center, top right;
549-
background-color: var(--background);
550548
}
551549

552550
.credits-php .about__header {
553-
background-image: url('../images/about-header-credits.svg?ver=6.4'), url('../images/about-header-background.svg?ver=6.4');
551+
background-image: url('../images/about-header-credits.svg?ver=6.4');
554552
}
555553

556554
.freedoms-php .about__header {
557-
background-image: url('../images/about-header-freedoms.svg?ver=6.4'), url('../images/about-header-background.svg?ver=6.4');
555+
background-image: url('../images/about-header-freedoms.svg?ver=6.4');
558556
}
559557

560558
.privacy-php .about__header {
561-
background-image: url('../images/about-header-privacy.svg?ver=6.4'), url('../images/about-header-background.svg?ver=6.4');
559+
background-image: url('../images/about-header-privacy.svg?ver=6.4');
562560
}
563561

564562
.contribute-php .about__header {
565-
background-image: url('../images/about-header-contribute.svg?ver=6.4'), url('../images/about-header-background.svg?ver=6.4');
563+
background-image: url('../images/about-header-contribute.svg?ver=6.4');
566564
}
567565

568566
.about__header-image {
@@ -571,9 +569,8 @@
571569

572570
.about__header-title {
573571
box-sizing: border-box;
574-
margin: 0 calc(var(--gap) + 2rem);
572+
margin: 0 calc(var(--gap) + 3rem);
575573
padding: 0;
576-
max-width: 55%;
577574
}
578575

579576
.about__header-title h1 {
@@ -585,7 +582,6 @@
585582
font-weight: 600;
586583
}
587584

588-
.about-php .about__header-title h1,
589585
.credits-php .about__header-title h1,
590586
.freedoms-php .about__header-title h1,
591587
.privacy-php .about__header-title h1,
@@ -650,8 +646,11 @@
650646
}
651647

652648
@media screen and (max-width: 960px) {
649+
.about__header-title h1 {
650+
/* Fluid font size scales on browser size 600px - 960px. */
651+
font-size: clamp(3rem, 13.33vw - 2rem, 6rem);
652+
}
653653

654-
.about-php .about__header-title h1,
655654
.credits-php .about__header-title h1,
656655
.freedoms-php .about__header-title h1,
657656
.privacy-php .about__header-title h1,

packages/playground/remote/public/wp-nightly/wp-admin/css/about-rtl.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/playground/remote/public/wp-nightly/wp-admin/css/about.css

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121

2222
.about__container {
2323
/* Section backgrounds */
24-
--background: #EAE9E7;
24+
--background: #151515;
2525
--subtle-background: #EAE9E7;
2626

2727
/* Main text color */
2828
--text: #1e1e1e;
2929
--text-light: #fff;
3030

3131
/* Accent colors: used in header, on special classes. */
32-
--accent-1: #C94C26; /* Link color */
32+
--accent-1: #D8613C; /* Link color */
3333
--accent-2: #CFCABE; /* Accent background */
3434
--accent-3: #f0f0f1; /* hr background */
3535
--accent-4: #B1C5A4; /* Light green */
@@ -538,30 +538,28 @@
538538
justify-content: end;
539539
box-sizing: border-box;
540540
padding: var(--gap) 0;
541-
height: clamp(12.5rem, -1.25rem + 36.67vw, 26.25rem);
541+
min-height: 420px;
542542
color: var(--text-light);
543-
background-image: url('../images/about-header-about.svg?ver=6.4'), url('../images/about-header-background.svg?ver=6.4');
544-
background-size: auto 70%, cover;
543+
background: var(--background) url('../images/about-header-about.svg?ver=6.4') no-repeat;
544+
background-size: cover;
545+
background-position: center;
545546
border-radius: 5px;
546-
background-repeat: no-repeat;
547-
background-position: right 7% center, top left;
548-
background-color: var(--background);
549547
}
550548

551549
.credits-php .about__header {
552-
background-image: url('../images/about-header-credits.svg?ver=6.4'), url('../images/about-header-background.svg?ver=6.4');
550+
background-image: url('../images/about-header-credits.svg?ver=6.4');
553551
}
554552

555553
.freedoms-php .about__header {
556-
background-image: url('../images/about-header-freedoms.svg?ver=6.4'), url('../images/about-header-background.svg?ver=6.4');
554+
background-image: url('../images/about-header-freedoms.svg?ver=6.4');
557555
}
558556

559557
.privacy-php .about__header {
560-
background-image: url('../images/about-header-privacy.svg?ver=6.4'), url('../images/about-header-background.svg?ver=6.4');
558+
background-image: url('../images/about-header-privacy.svg?ver=6.4');
561559
}
562560

563561
.contribute-php .about__header {
564-
background-image: url('../images/about-header-contribute.svg?ver=6.4'), url('../images/about-header-background.svg?ver=6.4');
562+
background-image: url('../images/about-header-contribute.svg?ver=6.4');
565563
}
566564

567565
.about__header-image {
@@ -570,9 +568,8 @@
570568

571569
.about__header-title {
572570
box-sizing: border-box;
573-
margin: 0 calc(var(--gap) + 2rem);
571+
margin: 0 calc(var(--gap) + 3rem);
574572
padding: 0;
575-
max-width: 55%;
576573
}
577574

578575
.about__header-title h1 {
@@ -584,7 +581,6 @@
584581
font-weight: 600;
585582
}
586583

587-
.about-php .about__header-title h1,
588584
.credits-php .about__header-title h1,
589585
.freedoms-php .about__header-title h1,
590586
.privacy-php .about__header-title h1,
@@ -649,8 +645,11 @@
649645
}
650646

651647
@media screen and (max-width: 960px) {
648+
.about__header-title h1 {
649+
/* Fluid font size scales on browser size 600px - 960px. */
650+
font-size: clamp(3rem, 13.33vw - 2rem, 6rem);
651+
}
652652

653-
.about-php .about__header-title h1,
654653
.credits-php .about__header-title h1,
655654
.freedoms-php .about__header-title h1,
656655
.privacy-php .about__header-title h1,

packages/playground/remote/public/wp-nightly/wp-admin/css/about.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/playground/remote/public/wp-nightly/wp-admin/css/list-tables-rtl.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,6 +1148,17 @@ ul.cat-checklist {
11481148
overflow-y: scroll;
11491149
}
11501150

1151+
ul.cat-checklist input[name="post_category[]"]:indeterminate::before {
1152+
content: '';
1153+
border-top: 2px solid grey;
1154+
width: 65%;
1155+
height: 2px;
1156+
position: absolute;
1157+
top: calc( 50% + 1px );
1158+
right: 50%;
1159+
transform: translate( 50%, -50% );
1160+
}
1161+
11511162
#bulk-titles .ntdelbutton,
11521163
#bulk-titles .ntdeltitle,
11531164
.inline-edit-row fieldset ul.cat-checklist label {

packages/playground/remote/public/wp-nightly/wp-admin/css/list-tables-rtl.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/playground/remote/public/wp-nightly/wp-admin/css/list-tables.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,17 @@ ul.cat-checklist {
11471147
overflow-y: scroll;
11481148
}
11491149

1150+
ul.cat-checklist input[name="post_category[]"]:indeterminate::before {
1151+
content: '';
1152+
border-top: 2px solid grey;
1153+
width: 65%;
1154+
height: 2px;
1155+
position: absolute;
1156+
top: calc( 50% + 1px );
1157+
left: 50%;
1158+
transform: translate( -50%, -50% );
1159+
}
1160+
11501161
#bulk-titles .ntdelbutton,
11511162
#bulk-titles .ntdeltitle,
11521163
.inline-edit-row fieldset ul.cat-checklist label {

packages/playground/remote/public/wp-nightly/wp-admin/css/list-tables.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 19 additions & 10 deletions
Loading
Lines changed: 19 additions & 10 deletions
Loading
Lines changed: 19 additions & 10 deletions
Loading

0 commit comments

Comments
 (0)