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

Reduce zip file size #401

Open
t-hamano opened this issue Sep 25, 2024 · 6 comments
Open

Reduce zip file size #401

t-hamano opened this issue Sep 25, 2024 · 6 comments
Labels
[Priority] High Used to indicate top priority items that need quick attention [Type] Enhancement A suggestion for improvement.

Comments

@t-hamano
Copy link
Contributor

When I removed the files necessary for development from this repository and converted it to a zip file, I found that the file size in my environment was 14.711 MB.

The theme directory does not mention any requirements regarding file size, but the maximum size of a zip file that can actually be uploaded to the theme directory is 10 MB:

https://wordpress.org/themes/upload/

upload

Although there is a file size limit for the theme directory, it seems strange that the default theme exceeds that size.

One approach to reducing the size might be to convert to the AVIF image format proposed in #383.

The /assets/fonts directory (about 8 MB) and /assets/images directory (about 6 MB) take up most of the overall size.

Incidentally, the file sizes when downloading the wordpress-develop theme directory and converting each theme to zip are as follows:

Theme Name Zip File Size
Twenty Twenty-Four 2.896MB
Twenty Twenty-Three 2.160MB
Twenty Twenty-Two 5.818MB
Twenty Twenty-One 2.783MB
Twenty Twenty 1.005MB
Twenty Nineteen 0.620MB
Twenty Seventeen 2.115MB
Twenty Sixteen 1.807MB
Twenty Fifteen 4.230MB
Twenty Fourteen 2.173MB
Twenty Thirteen 1.764MB
Twenty Twelve 1.192MB
Twenty Eleven 1.238MB
Twenty Ten 1.097MB
@carolinan
Copy link
Contributor

I am not opposed to the using AVIF, core also has a script for reducing the image sizes that will be ran before commit.
I believe the font families are set though as part of the design and style variations.

@carolinan carolinan added [Type] Enhancement A suggestion for improvement. [Priority] High Used to indicate top priority items that need quick attention labels Sep 26, 2024
@t-hamano
Copy link
Contributor Author

t-hamano commented Oct 1, 2024

Now that this theme has shipped into core, I zipped this directory and measured its size, finding it to be 11.4MB.

@carolinan
Copy link
Contributor

I reduced some of the image size https://github.com/WordPress/twentytwentyfive/pull/475/files but I was in a hurry.

@carolinan
Copy link
Contributor

@juanfra @beafialho This issue needs more attention.
Can the number of images, image duplicates, and image sizes be reduced further please?

@beafialho
Copy link
Contributor

Taking a look at the heavier images, I think their size can be reduced they don't need to be as big.

We can remove this image from the theme image-from-rawpixel-id-8803077-original.webp and replace it with image-from-rawpixel-id-8802835-jpeg-scaled.webp in this pattern:

Image

We can replace location.webp with a cropped version export from the Figma comp.

@beafialho
Copy link
Contributor

We could also remove this image:

Image

And replace it in the pattern with the one below:

Image

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Priority] High Used to indicate top priority items that need quick attention [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants