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

[5.2] Vote : add aggregateRating in article's schemaorg information #42933

Merged
merged 79 commits into from
Apr 30, 2024
Merged

[5.2] Vote : add aggregateRating in article's schemaorg information #42933

merged 79 commits into from
Apr 30, 2024

Conversation

conseilgouz
Copy link
Contributor

@conseilgouz conseilgouz commented Mar 1, 2024

( see discussion #42920)

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
Set different schemaorg type for your articles
Check your articles 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

@ManuelVoileux
Copy link

Thanks for raising hand.


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

@conseilgouz
Copy link
Contributor Author

This fix works with Joomla! 5.0 but, as there won't be any more 5.0 release, I put it in 5.1 branch.

@ManuelVoileux
Copy link

ManuelVoileux commented Mar 1, 2024

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.


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

@ManuelVoileux
Copy link

Imahge of the test


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

@ManuelVoileux
Copy link

AFTER applying this Pull Request I got green light from Google
Screenshot 2024-03-01 at 13-30-10

@sandewt
Copy link
Contributor

sandewt commented Mar 1, 2024

This issue also concerns Joomla 4.

@richard67
Copy link
Member

AFTER applying this Pull Request I got green light from Google

@ManuelVoileux Does that mean a successful test? If so, please go to the issue tracker here https://issues.joomla.org/tracker/joomla-cms/42933 and mark your test result by using the blue "Test this" button at the top left corner, then selecting the appropriate test result (success) and submit.

Every pull request needs 2 successful human tests, and it needs to submit the test result with the issue tracker so the tests are properly counted.

Thanks in advance.

@richard67
Copy link
Member

This issue also concerns Joomla 4.

@conseilgouz If this is right, it would need to make this pull request for the 4.4-dev branch. Later maintainers will merge it up into the 5.1-dev branch when the 4.4-dev PR will have been tested and merged.

@brianteeman
Copy link
Contributor

This solution is correct for J4 which uses itemprop etc
This solution is not correct for J5 which used jsonld

@ManuelVoileux
Copy link

I have tested this item ✅ successfully on ceb86b1


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

@Fedik
Copy link
Member

Fedik commented Mar 1, 2024

Not that easy.

The page does not contain Product, how it can have the product rating then?
I mean having an empty Product is invalid also.

Just try https://search.google.com/test/rich-results?hl=en

<div itemscope="itemscope" itemtype="https://schema.org/Product"> 
<p class="visually-hidden" itemprop="aggregateRating" itemscope itemtype="https://schema.org/AggregateRating">
   <meta itemprop="ratingCount" content="5">
   <meta itemprop="worstRating" content="1">
   <span itemprop="ratingValue">5</span>
   <span itemprop="bestRating">5</span>
</p>
</div>

It will ask you for full product information.

@Fedik
Copy link
Member

Fedik commented Mar 1, 2024

A better fix would be to remove all HTML schema from layout plugins/content/vote/tmpl/rating.php
And add it with schema plugin, as part of the content schema.

@ManuelVoileux
Copy link

ManuelVoileux commented Mar 1, 2024

Not that easy.
The page does not contain Product, how it can have the product rating then? I mean having an empty Product is invalid also.
Just try https://search.google.com/test/rich-results?hl=en

<div itemscope="itemscope" itemtype="https://schema.org/Product"> ...  </div>

It will ask you for full product information.

If the Schema tab is filled in, the itemscope, itemtype should be taken from the schema type, and the rating result should be merged in the schema output.

@Fedik
Copy link
Member

Fedik commented Mar 1, 2024

If the Schema tab is filled in, the itemscope, itemtype should be taken from the schema type, and the rating result should be merged in the schema output.

Correct, that what I mean in #42933 (comment)

@conseilgouz
Copy link
Contributor Author

The page does not contain Product, how it can have the product rating then?

I had a doubt about Product type. This idea comes from JED pages : if you take a look at https://extensions.joomla.org/extension/cg-isotope/ source code, it's done this way and Google search gives me nice stars.

@conseilgouz
Copy link
Contributor Author

google_search

@conseilgouz
Copy link
Contributor Author

conseilgouz commented Mar 1, 2024

This issue also concerns Joomla 4.

@conseilgouz If this is right, it would need to make this pull request for the 4.4-dev branch. Later maintainers will merge it up into the 5.1-dev branch when the 4.4-dev PR will have been tested and merged.

Same code, same issue in Joomla 4.4.

@richard67 : is 4.4-dev PR a new PR ?

@conseilgouz You can rebase this PR here by changing the base branch with use of the "Edit" button right beside the title on GitHub, or you make a new one for the 4.4-dev branch, whatever is easier for you.

@conseilgouz
Copy link
Contributor Author

closed, move to 4.4-dev branch #42934

@conseilgouz conseilgouz closed this Mar 1, 2024
@conseilgouz conseilgouz deleted the 5.1-dev branch March 1, 2024 16:41
@sandewt
Copy link
Contributor

sandewt commented Mar 1, 2024

closed, move to 4.4-dev branch #42934

You could have changed the branche here to move to 4.4

@Fedik
Copy link
Member

Fedik commented Mar 1, 2024

I had a doubt about Product type. This idea comes from JED pages : if you take a look at
https://extensions.joomla.org/extension/cg-isotope/ source code, it's done this way and Google search gives me nice stars.

No, that not correct example.
That whole page is about Product, and there it is correct.
Hovewer what you trying here, is incorect, sorry. Because here no product exists.

@conseilgouz
Copy link
Contributor Author

No, that not correct example.
That whole page is about Product, and there it is correct.
Hovewer what you trying here, is incorect, sorry. Because here no product exists.

Product is a generic type, it could be anything : https://schema.org/Product

In JED page, I did not find any other schema.org line other than reviews and aggregateRating, and Google seems to be happy with this.

@conseilgouz
Copy link
Contributor Author

You could have changed the branche here to move to 4.4

I tried but I broke it (I'm not a great github user).

@sandewt
Copy link
Contributor

sandewt commented Mar 3, 2024

Product is a generic type, it could be anything : https://schema.org/Product

It may be more applicable to use ?

<div itemprop="review" itemscope itemtype="https://schema.org/Review">

instead of:

<div itemprop="review" itemscope itemtype="https://schema.org/Product">

Customer reviews: (Microdata)
see: https://schema.org/reviewCount
see: https://schema.org/Rating

See examples

@conseilgouz conseilgouz restored the 5.1-dev branch March 3, 2024 13:00
@Quy
Copy link
Contributor

Quy commented Mar 29, 2024

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Mar 29, 2024
@growunder
Copy link

I have tested this item ✅ successfully on 556e59e

Tested successfully. applied patch and fixed the issue


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

@cybersalt
Copy link

I have tested this item ✅ successfully on 556e59e


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

@conseilgouz
Copy link
Contributor Author

@cybersalt @growunder Thank you for your test.
@exlemor and @viocassel already made "human tests", so now we have 4 positive tests.
Unfortunately, Fedik made this a new feature instead of a bug (why ?), so, even if is RTC, it won't be released with 5.1, may be in 5.2...
Pascal

@HLeithner HLeithner changed the base branch from 5.1-dev to 5.2-dev April 24, 2024 09:07
@HLeithner
Copy link
Member

This pull request has been automatically rebased to 5.2-dev.

@HLeithner HLeithner changed the title [5.1] Vote : add aggregateRating in article's schemaorg information [5.2] Vote : add aggregateRating in article's schemaorg information Apr 24, 2024
@pe7er pe7er self-assigned this Apr 24, 2024
@pe7er pe7er enabled auto-merge (squash) April 30, 2024 07:49
@Quy Quy removed the PR-5.1-dev label Apr 30, 2024
@Quy Quy added this to the Joomla! 5.2.0 milestone Apr 30, 2024
@pe7er pe7er merged commit 7db6a0f into joomla:5.2-dev Apr 30, 2024
3 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Apr 30, 2024
@pe7er
Copy link
Contributor

pe7er commented Apr 30, 2024

Thanks @conseilgouz !

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