WordPress / theme-test-data

Theme Test Data
622 stars 16 forks source link

Update themeunittestdata.wordpress.xml with WP 6.1 block markup #73

Closed carolinan closed 1 year ago

carolinan commented 1 year ago

This PR adds new posts with blocks generated in WP 6.1.

How to test

  1. Download the file
  2. Activate the WordPress Importer tool
  3. Import the file, check the box for downloading the media
  4. Test all posts, pages and archives. Both the old and the new content should load correctly.
carolinan commented 1 year ago

It is not possible to import the file with the WordPress importer. I see these problems:

Warning: Undefined array key 1 in plugins/wordpress-importer/parsers/class-wxr-parser-regex.php on line 65
Warning: Undefined array key 1 in plugins/wordpress-importer/parsers/class-wxr-parser-regex.php on line 65

And 1. Import author: ()

Can anyone locate the faulty part of the updated file?

mikeritter commented 1 year ago

I see "Page Image Alignment" is in a "classic editor" block.

Using TT3, the "Image Right Align" is NOT in line with the following text, but "Left" works and this does look correct in the classic editor block in FSE.

Screen Shot 2023-03-06 at 9 15 47 PM
mikeritter commented 1 year ago

On "Page Image Alignment", "Left Aligned with Caption" breaks outside container for content. See screengrab.

Screen Shot 2023-03-06 at 9 24 10 PM
mikeritter commented 1 year ago

See previous Re: Left-aligned image with caption pertains to Right-aligned image with caption.

Both break out from container when width is constrained in TT3.

Screen Shot 2023-03-06 at 9 27 52 PM
mikeritter commented 1 year ago

Again, "Page Image Alignment", last, right-aligned image looks as expected in classic editor block, but in TT3 when right-aligned image falls at end of paragraph, last line of text is aligned with bottom, not top of image.

Screen Shot 2023-03-06 at 9 27 52 PM
carolinan commented 1 year ago

That is correct, and untouched in this PR, because it is the old markup. TT3 does not include CSS for image overflow.

I am sorry that was not clear in the description. The PR adds new posts with 6.1 markup, it doesn't remove the old. The 6.1 markup is in the 6.1 category.

mikeritter commented 1 year ago

That is correct, and untouched in this PR, because it is the old markup. TT3 does not include CSS for image overflow.

I am sorry that was not clear in the description. The PR adds new posts with 6.1 markup, it doesn't remove the old. The 6.1 markup is in the 6.1 category.

Thank you.

So, is this a problem with TT3 or this test data, as this test data is presumably forward-looking?

Should we initiate a pull request to include CSS for image overflow in TT3?

Feel free to reference my screen grabs if you do so.

carolinan commented 1 year ago

There was a decision during development of Twenty Twenty-Three to not include extra CSS. The problem is with the image block. It has no overflow rules. Different contributors have tried to add them to the block, but I don't have a link to the pull requests right now.

For most of us, this is a layout bug: the problem is that it has been this way for so long, that fixing it now would drastically change the positioning of image blocks on peoples websites. That is the problem that still needs to be solved. Trying to find a way to display them correctly next to other content, allowing "old" images to do the same, but not re-position the images without user action...

kafleg commented 1 year ago

@carolinan

While impoting the data, I found this,

` Import WordPress Failed to import category 6.1 : Invalid taxonomy. Failed to import nav_menu Social menu : Invalid taxonomy. Failed to import “ WP 6.1 Font size scale ”: Invalid post type post Failed to import “ WP 6.1 spacing presets ”: Invalid post type post Failed to import “ WP 6.1 Theme block category ”: Invalid post type post Failed to import “ WP 6.1 Widgets block category ”: Invalid post type post Failed to import “ WP 6.1 Design category blocks ”: Invalid post type post Failed to import “ WP 6.1 Media category blocks ”: Invalid post type post Failed to import “ WP 6.1 Text category blocks ”: Invalid post type post Failed to import “Keyboard navigation”: Invalid post type post Failed to import Media “dsc20050727_091048_222”: Request failed due to an error: A valid URL was not provided. (http_request_failed) Failed to import Media “dsc20050813_115856_52”: Request failed due to an error: A valid URL was not provided. (http_request_failed) Failed to import Media “Wind Farm”: Request failed due to an error: A valid URL was not provided. (http_request_failed) Failed to import Media “Antique Farm Machinery”: Request failed due to an error: A valid URL was not provided. (http_request_failed)

Notice: exif_read_data(dsc02085-1.jpg): Potentially invalid endianess, trying again with different endianness before imminent failure. in C:\laragon\www\reviews\wp-admin\includes\image.php on line 848

Warning: exif_read_data(dsc02085-1.jpg): Illegal IFD size: 2 + 0x534F*12 = 0x3E7B6 > 0x2EE0 in C:\laragon\www\reviews\wp-admin\includes\image.php on line 848 Failed to import Media “Rusty Rail”: Request failed due to an error: A valid URL was not provided. (http_request_failed) Failed to import Media “Resinous”: Request failed due to an error: A valid URL was not provided. (http_request_failed) Failed to import Media “St. Louis Blues”: Request failed due to an error: A valid URL was not provided. (http_request_failed) Failed to import Media “OLYMPUS DIGITAL CAMERA”: Request failed due to an error: A valid URL was not provided. (http_request_failed) Failed to import Media “Image Alignment 580x300”: Request failed due to an error: A valid URL was not provided. (http_request_failed) Failed to import Media “Image Alignment 150x150”: Request failed due to an error: A valid URL was not provided. (http_request_failed) Failed to import Media “Horizontal Featured Image”: Request failed due to an error: A valid URL was not provided. (http_request_failed) Failed to import Media “I Am Worth Loving Wallpaper”: Request failed due to an error: A valid URL was not provided. (http_request_failed) Failed to import Media “Image Alignment 300x200”: Request failed due to an error: A valid URL was not provided. (http_request_failed) Failed to import Media “Vertical Featured Image”: Request failed due to an error: A valid URL was not provided. (http_request_failed) Failed to import Media “Image Alignment 1200x4002”: Request failed due to an error: A valid URL was not provided. (http_request_failed) Failed to import Media “Unicorn Wallpaper”: Request failed due to an error: A valid URL was not provided. (http_request_failed) Failed to import “twitter.com”: Invalid post type nav_menu_item Failed to import “facebook.com”: Invalid post type nav_menu_item Failed to import “github.com”: Invalid post type nav_menu_item Failed to import “instagram.com”: Invalid post type nav_menu_item Failed to import “linkedin.com”: Invalid post type nav_menu_item Failed to import Media “triforce-wallpaper”: Request failed due to an error: A valid URL was not provided. (http_request_failed) Failed to import Media “dsc20040724_152504_532”: Request failed due to an error: A valid URL was not provided. (http_request_failed) Failed to import Media “dsc20050604_133440_34211”: Request failed due to an error: A valid URL was not provided. (http_request_failed) Failed to import Media “2014-slider-mobile-behavior”: Request failed due to an error: A valid URL was not provided. (http_request_failed) Failed to import Media “dsc20050315_145007_132”: Request failed due to an error: A valid URL was not provided. (http_request_failed) Failed to import “Block category: Common”: Invalid post type post Failed to import “Block category: Formatting”: Invalid post type post Failed to import “Block category: Layout Elements”: Invalid post type post Failed to import “Block category: Embeds”: Invalid post type post Failed to import “Block category: Widgets”: Invalid post type post Failed to import “Block: Columns”: Invalid post type post Failed to import “Block: Cover”: Invalid post type post Failed to import “Block: Button”: Invalid post type post Failed to import “Block: Quote”: Invalid post type post Failed to import “Block: Gallery”: Invalid post type post Failed to import “Block: Image”: Invalid post type post Failed to import “Ελληνικά-Greek”: Invalid post type page Failed to import “Επίπεδο 2 -Second Greek level”: Invalid post type page Failed to import “Επίπεδο 3”: Invalid post type page All done. Have fun! `

carolinan commented 1 year ago

Please try again, I am not able to reproduce the invalid post types. There is no reason for the "page", etc to be invalid.

carolinan commented 1 year ago

Also I can not change the exif data of the images because the images are hosted on a wordpress.com site I do not have access to. Unless the image is broken in the tests, these notices can be ignored.

kafleg commented 1 year ago

I still have the same issue.

kafleg commented 1 year ago

import_issue

carolinan commented 1 year ago

Can you include any more details about your WordPress installation? I tried in wp 5.9, 6, 6.1.1 , 6.2 current nightly, with different PHP versions and I am not seeing these issues.

kafleg commented 1 year ago

I'm testing with WordPress 6.1, using Edge browser, windows 11, Laragon, PHP 7.4.

James-Roberts commented 1 year ago

Running WordPress 6.2, in Chrome on MacOS Ventura 13.1. Using wp-env for local environment on a fresh install.

I received the following warning when importing the content:

Notice: exif_read_data(dsc02085-1.jpg): Potentially invalid endianess, trying again with different endianness before imminent failure. in /var/www/html/wp-admin/includes/image.php on line 848 Warning: exif_read_data(dsc02085-1.jpg): Illegal IFD size: 2 + 0x534F*12 = 0x3E7B6 > 0x2EE0 in /var/www/html/wp-admin/includes/image.php on line 848

import

James-Roberts commented 1 year ago

These are the results of my tests on the posts under the 6.1 category.

All posts have the following paragraph: "This test post was generated using the block theme Emptytheme in WordPress 6.1.1.".

I'm running 6.2, using Twenty Twenty-three.

Minus the above paragraph, below is my report on each 6.1 post:

WP 6.1 Font size scale :white_check_mark:

WP 6.1 spacing presets

WP 6.1 Theme block category :white_check_mark:

WP 6.1 Widgets block category

WP 6.1 Design category blocks

WP 6.1 Media category blocks

WP 6.1 Text category blocks :white_check_mark:

carolinan commented 1 year ago

All posts have the following paragraph: "This test post was generated using the block theme Emptytheme in WordPress 6.1.1.".

Yes, the blocks were generated using Emptytheme, the XML file is static, the WordPress importer saves the same content to the database no matter which theme is currently active.

The reason why I chose Emptytheme is that it does not have settings that can affect the markup, it only uses the defaults + appearance tools: https://github.com/WordPress/gutenberg/blob/trunk/test/emptytheme/theme.json Themes can register their own presets, that is why I included the information about which theme was used, and it is why we get different results in Twenty Twenty Three. It would not be able to use Twenty Twenty Three as an example since it uses unique presets that are not used by other themes.

carolinan commented 1 year ago

Yes all separator issues are from the theme and the block editor, not the XML file. In short, the width of the separator block "default" style was removed from block themes and is only applied in classic themes. For the separator styles to work in block themes again, the developer has to add the width to the variation in theme.json, which is currently not working unless you add custom CSS.

carolinan commented 1 year ago

I'm testing with WordPress 6.1, using Edge browser, windows 11, Laragon, PHP 7.4.

I wont be able to test this because I do not have windows 11. But I would encourage you to use a more current PHP version :p

carolinan commented 1 year ago

I have removed the image that caused the Exif PHP notice.

  1. I no longer see the notice when importing the XML file
  2. I double-checked that the posts with galleries, where the image was previously included, still work.
kafleg commented 1 year ago

Finally, I'm able to import the file.

Result:

**Import WordPress**

Notice: exif_read_data(dsc02085.jpg): Potentially invalid endianess, trying again with different endianness before imminent failure. in C:\laragon\www\reviews\wp-admin\includes\image.php on line 848

Warning: exif_read_data(dsc02085.jpg): Illegal IFD size: 2 + 0x534F*12 = 0x3E7B6 > 0x2EE0 in C:\laragon\www\reviews\wp-admin\includes\image.php on line 848
All done. Have fun!

Remember to update the passwords and roles of imported users.
kafleg commented 1 year ago

image

carolinan commented 1 year ago

How? That image was removed an hour ago. Do you see any references left in the file?

kafleg commented 1 year ago

can you share the link to the latest XML file that I can import?

carolinan commented 1 year ago

Please, clone the project and pull down the pull request.

kafleg commented 1 year ago

Finally, there is no error.

image