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

micoformats2: avatar leaks into post as "photo" property #301

Open
sknebel opened this issue Jul 27, 2018 · 4 comments
Open

micoformats2: avatar leaks into post as "photo" property #301

sknebel opened this issue Jul 27, 2018 · 4 comments

Comments

@sknebel
Copy link

sknebel commented Jul 27, 2018

It seems all instances of the avatar have class="u-photo" markup declaring them as a photo property. This is useful inside h-cards, but not all instances of the avatar are nested inside one. This causes the avatar to become a property of the post, which isn't right. I'm not really firm with Wordpress themes or PHP, but happy to help with the microformats side of things. My first hunch would be to not attach "u-photo" to the avatar automatically, and instead explicitly add it to the avatars in h-cards.

E.g. from the demo page: https://independentpublisher.me/2013/discovering-the-real-nepal/, the mf2 parser output contains
the gravatar 3 times as a photo property:

{
    "items": [
        {
            "type": [
                "h-entry"
            ],
            "properties": {
                "name": [
                    "Discovering the Real Nepal (showcases Post Cover)"
                ],
                "photo": [
                    "https://secure.gravatar.com/avatar/a058cfca65a5103e838b1d0ea077ca4b?s=32&d=mm&r=g",
                    "https://secure.gravatar.com/avatar/a058cfca65a5103e838b1d0ea077ca4b?s=100&d=mm&r=g",
                    "https://secure.gravatar.com/avatar/a058cfca65a5103e838b1d0ea077ca4b?s=100&d=mm&r=g"
                ],

I investigated this today because it caused issues with @jgmac1106's syndication of a post to Twitter to attach his avatar to the tweet as a picture: https://twitter.com/jgmac1106/status/1022789703261724673

@vishae
Copy link

vishae commented Aug 7, 2018

I'm interested to know how to fix this in the interim, while we wait for the developer to look into this - I'm currently using Brid.gy to cross-post to Twitter and it's a bit annoying to have my avatar cross-posted as well.

@jgmac1106
Copy link

@vishae I would recommend forking the repo. There are others willing to help maintain the theme.

There are a number of issues to be addressed.

@vishae
Copy link

vishae commented Aug 14, 2018

I haven’t tried forking the repo yet, but I guess I should note down my workaround for now, in case anyone is interested.

I found and commented out the independent_publisher_mf2_get_avatar_data function in inc/mf2.php, and it seems to work fine now.

Then you might want to look into this (https://stackoverflow.com/questions/20473004/how-to-add-automatic-class-in-image-for-wordpress-post) to automatically add a “u-photo” class to images in your post.

@mkaz
Copy link

mkaz commented Nov 26, 2018

I came to report a conflict with the same function and Gutenberg's Latest Comments block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants