Automattic / gravatar-enhanced

An enhanced version of Gravatar for WordPress.
https://wordpress.org/plugins/gravatar-enhanced/
0 stars 0 forks source link

Implement the new Gravatar profile block #9

Closed wellyshen closed 1 month ago

wellyshen commented 2 months ago

Description

The new Gravatar profile block is in the temporary new-block folder, It will replace the existing block folder before it's released

Test Instructions

截圖 2024-10-03 晚上7 49 19
Editor View
截圖 2024-10-14 下午6 14 06 截圖 2024-10-14 下午6 13 52

https://github.com/user-attachments/assets/494e2fad-ebfd-4159-a311-4c843a9acbf8

https://github.com/user-attachments/assets/af0deade-40d0-4f83-84c9-3bcc4c306e52

https://github.com/user-attachments/assets/d0c3932c-8000-40b9-b423-9157315ba5f3

https://github.com/user-attachments/assets/332e1fa5-a840-464f-9abc-07fd906310a7

Editor View
截圖 2024-10-15 凌晨1 58 50 截圖 2024-10-15 凌晨1 59 15
wellyshen commented 1 month ago

I installed the new packages and built the plugin, but on adding a block I get this: I guess some styles aren't loading? It looks ok on the front-end though.

I have double-checked by:

截圖 2024-10-17 下午4 24 33

I'm not sure if that's a cache issue. Would it help if you re-install the plugin or clear the browser / Edge cache (/wp-admin/options-general.php?page=edge-cache)? If not, do you know how I can reproduce this issue?

BTW, we will replace the existing block with the new one before releasing to users. We could also double check this issue then.

On the front-end my verified WP account has a link of /[object%20Object]. It works fine on Gravatar.

I will fix this issue through the Gravatar end ( 109081-gh-Automattic/gravatar )

Regarding adding rel="noreferrer" and target="_blank" to all the rendered links, I wonder if we want to do this? If I'm adding a Gravatar card to a page I kind of want the links to work normally and pass along any referrer. Maybe this should be an option?

I have removed the rel="noreferrer". I kept the links opening in other tabs (as we did for the hovercards), so users can still browse the site or blog.

johngodley commented 1 month ago

Ok, the problem seems to be related to the chosen theme. If I use the default Twenty Twenty Four or Twenty Twenty Three the block is displayed correctly, but if I use any other theme it isn't.

I also noticed that, for me anyway, it seems to be loading the CSS files twice:

image

wellyshen commented 1 month ago

Ok, the problem seems to be related to the chosen theme. If I use the default Twenty Twenty Four or Twenty Twenty Three the block is displayed correctly, but if I use any other theme it isn't.

@johngodley I’ve tried to prevent the block's styles from being overridden by the default theme styles. Please take a look, and if the styles are still broken, let me know which theme you're using, and I’ll investigate further.

I also noticed that, for me anyway, it seems to be loading the CSS files twice:

Gutenberg loads block CSS styles from two locations: the HTML head of the page and the head of the iframe. This also happens with older blocks, so I assume it's just how Gutenberg handles loading CSS files.

Page doc's head Iframe's head
截圖 2024-10-18 凌晨12 07 47 截圖 2024-10-18 凌晨12 16 41
截圖 2024-10-18 凌晨12 06 44
wellyshen commented 1 month ago

Thank you for the review, also fix the style issue in the 2017 theme.

截圖 2024-10-18 下午5 20 33