bmarwell / wp-jsonld

An enhanced version of the json-ld-for-articles wordpress plugin.
1 stars 1 forks source link

Logo is needed for organization #5

Closed bmarwell closed 8 years ago

bmarwell commented 8 years ago

What can be done, if:

We need to specify some kind of logo, because Google says so:

publisher.logo (required) ImageObject The logo of the publisher.

Logos should have a wide aspect ratio, not a square icon. Logos should be no wider than 600px, and no taller than 60px. Always retain the original aspect ratio of the logo when resizing. Ideally, logos are exactly 60px tall with width <= 600px. If maintaining a height of 60px would cause the width to exceed 600px, downscale the logo to exactly 600px wide and reduce the height accordingly below 60px to maintain the original aspect ratio.

Source: https://developers.google.com/structured-data/rich-snippets/articles?hl=de

Suggestions (multiple can be implemented):

  1. Ship an empty default one.
  2. look for /logo.png or $basedir/logo.png.
  3. use apple touch icon if exists.
  4. use opera speed dial icon if exists (don't know the search path though).
  5. create a settings interface in the backend to have a logo uploaded or specified via url.

I'd say to use to use (1) in either way, because I don't want to have invalid syntax. 2.-5. can have any priority. As I am not a good interface designer, I'd go for 2. & 3. first.

rvencu commented 8 years ago

I say let make a list of variables at top of the plugin. Start with a hardcoded default logo and later will pull important variable values from plugin options. I can help with a basic options admin page, it can be styled at a later stage. Still my coding quality will require improvements but I can save you some time.

Options 2, 3 or 4 will still require admin interface to select from media library or upload a custom file somwhere because as in my case I had to tune my usual logo to fit Google requirements then upload it. I think is too complicated to ask website admins to manually upload specific files via ftp.

Then maybe someone else comes with a better view of solving this issue

bmarwell commented 8 years ago

:+1:

About option 2/3/4: They have fixed paths, they must be in the (sub-)domain's root folder, so we actually don't need the media library interface here. Let's ship a default one for version 0.4 and resolve the other points in another issue.

bmarwell commented 8 years ago

I was giving this some more thought and will start work on this item next.

The user should have the maximum flexibility as a priority, and then choose the most proper possible fallbacks.

This will give this priority list:

  1. Implement a settings field

    needs UI setting - stalled until version 1.0.0, will create a different issue for this.

  2. use /organization-500.png (or sth similar)

    (a custom picture they can put at their root). user/admin can choose their very own and override everything else.

  3. use google plus page icon.

    that's an icon they already made public themselves, so why not use it? But how do we get to know their google plus page (publisher)?

  4. use https://logo.clearbit.com/ <domain>

    if there is an icon at this address, it is most probably the publisher/organization icon. But it was set by a third party.

  5. use apple-touch-icon.png and similar named (including sizes).

    let's not put this before the others mentioned, because the site's touch icon is almost never the same icon as the publishers one. But for blogs, it is fairly possible and recognizable.

  6. /speeddial-160px.png

    Used by opera. Rarely used and probably better than nothing or the default.

  7. $plugindir/img/default-publisher-icon.png

    Fallback. Artwork needed.

So, this is the list.

bmarwell commented 8 years ago

Fixed using: https://github.com/bmhm/wp-jsonld/commit/9be4cd4a6362002756f80eee2ac34774831b4e33

Due to the size restrictions, other options will be implemented later. Upload form for publisher logo will be tracked in #14.