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

[4.4] Vote : aggregateRating error in Google Rich Results #42934

Merged
merged 9 commits into from
Apr 27, 2024
Merged

[4.4] Vote : aggregateRating error in Google Rich Results #42934

merged 9 commits into from
Apr 27, 2024

Conversation

conseilgouz
Copy link
Contributor

( see discussion #42920) and #42933

Summary of Changes

When vote plugin is enabled, Rich results are created but are rejected by Google Rich Results tool.

Testing Instructions

Enable Vote plugin.
Enable Voting in Articles component configuration.
Vote for one or more articles.
Check your article using https://search.google.com/test/rich-results

Actual result BEFORE applying this Pull Request

Google Rich Results check gives an error
Review snippets shows 2 errors :
rich_snippet_error

Expected result AFTER applying this Pull Request

Google Rich Results check is OK
rich_snippet_ok

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

Replace tabs by spaces
@conseilgouz
Copy link
Contributor Author

@sandewt PR moved to 4.4 branch.
Please test https://issues.joomla.org/tracker/joomla-cms/42934

@ManuelVoileux
Copy link

I have tested this item ✅ successfully on 2f594e4

I have experienced the same issue.
I have activated the Vote plugin, and I have used vote on an article.
When I check with the Google validation tool I get a critical error. itemReviewed field missing.
Google error test

AFTER applying this Pull Request I got green light from Google
OK Google index

As Fedik mentionned Add the layout with Schema plugin so that no additionnal shema type (such as Product) is involved


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42934.

@fgsw
Copy link

fgsw commented Mar 2, 2024

I have tested this item ✅ successfully on 2f594e4


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42934.

Co-authored-by: jsanders <j53.sanders@gmail.com>
@conseilgouz
Copy link
Contributor Author

As Fedik mentionned Add the layout with Schema plugin so that no additionnal shema type (such as Product) is involved

Schema plugins have been introduced in Joomla 5.0 and this PR is due to work with Joomla 4.4.

@ManuelVoileux
Copy link

You are right, sorry for the mistake.
What is the appropriate process to have a J5 branch to solve this bug ?

@conseilgouz
Copy link
Contributor Author

You are right, sorry for the mistake. What is the appropriate process to have a J5 branch to solve this bug ?

It will be to move aggregatingRating into schema plugins, as each schema type has its own required fields list.

@sandewt
Copy link
Contributor

sandewt commented Mar 2, 2024

for your information: Schema.org Product type plugin #42710

@conseilgouz
Copy link
Contributor Author

for your information: Schema.org Product type plugin #42710

Thank you for this information.

This PR is trying to fix an issue in vote plugin, it's not to create a schemaorg product plugin.

As stated in #42933 , I found we could make aggregateRating work by using product type.

In J5, I think we'll have to fix it another way, maybe through existing schemaorg plugins.

@sandewt
Copy link
Contributor

sandewt commented Mar 3, 2024

Review versus Product ?

see #42933 (comment)

@Fedik
Copy link
Member

Fedik commented Mar 3, 2024

Sorry, the changes still incorrect. We should not force any itemscope in to the rating layout,
It can be rendered as part of already defined itemscope. User can already have Article layout override with custom itemscope. This changes will break his schema.

In the end, this hack replaces one problem to another.

For proper fix check the coments in PR for 5.1 (#42933 (comment))

remove itemscope redefinition
@conseilgouz
Copy link
Contributor Author

Review versus Product ?

see #42933 (comment)

Review requires a single user, rating count will disappear.

@conseilgouz
Copy link
Contributor Author

conseilgouz commented Mar 3, 2024

For proper fix check the coments in PR for 5.1

I'm trying to implement 5.1 version of this hack using schemaorg plugins.

I have a doubt on where to implement this.

For example, for Recipe, I added some lines into plugins/schema/recipe/src/Extension/Recipe.php so it added Recipe dedicated rating lines to the Recipe information. I created a new class SchemaorgPrepareRecipeAggregateRating in libraries/src/Schemaorg.

Does it sound correct or is there a better place to add this, using isPartOf maybe ?

@sandewt
Copy link
Contributor

sandewt commented Mar 3, 2024

I'm trying to implement 5.1 version of this hack using schemaorg plugins.

Sorry, but I think it's better to focus on J4 here and not J5.

@Fedik
Copy link
Member

Fedik commented Mar 3, 2024

I'm trying to implement 5.1 version of this hack using schemaorg plugins.

In theory the voting plugin should listen to onSchemaBeforeCompileHead and apend the rating data.

@bembelimen
Copy link
Contributor

I'm trying to implement 5.1 version of this hack using schemaorg plugins.

In theory the voting plugin should listen to onSchemaBeforeCompileHead and apend the rating data.

Exactly that

@exlemor
Copy link

exlemor commented Apr 21, 2024

I have tested this item ✅ successfully on 07d5eed

Hi @conseilgouz, I just tested this successfully just now.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42934.

@conseilgouz
Copy link
Contributor Author

Hi Emmanuel,
Thank you for your test.
For this PR, there already were 2 human tests by @fgsw and @ManuelVoileux, but they disappeared from the counter.

@alikon
Copy link
Contributor

alikon commented Apr 22, 2024

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42934.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Apr 22, 2024
@HLeithner HLeithner added the bug label Apr 24, 2024
@MacJoom MacJoom merged commit 19a8f56 into joomla:4.4-dev Apr 27, 2024
3 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Apr 27, 2024
@MacJoom MacJoom added this to the Joomla! 4.4.5 milestone Apr 27, 2024
@MacJoom
Copy link
Contributor

MacJoom commented Apr 27, 2024

Thank you!

@sandewt
Copy link
Contributor

sandewt commented May 30, 2024

Sorry but this PR is not correct because the Number of Votes will never be visible.
Because the class is: class="visually-hidden".

Solution move the closing </div

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

Successfully merging this pull request may close these issues.

None yet