After doing some research, I'm finding some compelling reasons to implement an alternate structured data markup method. Specifically switching from microdata (current method) to JSON-LD. Here's my case:
First off, we have some minor issues with our structured data already. I'll open another issue shortly but here for example we're outputting the currency and price together which isn't recommended.
Secondly, JSON-LD is potentially easier to manage and less problematic from a theme perspective. It separates the data from the markup thereby making our templates much simpler.
WooCommerce just did it two months ago. Long discussion about it over there with lots of great information. Really sounds like a good move. Also it being recommended by Google gives it serious weight.
Doing this would get rid of the infamous "HTML characters in titles" title we get all the time due to improper use of the_title() in attributes.
Would love to see this!
Want me to try and tackle this?
Go for it!
On Tue, Nov 22, 2016 at 2:10 PM, Kyle [email protected] wrote:
Want me to try and tackle this?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/easydigitaldownloads/easy-digital-downloads/issues/5240#issuecomment-262351977,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_HfSRpQkpqz8nv8rUHzCw5h2CYxyfnks5rA0xJgaJpZM4K47Fr
.
Here's what I think we need to do to make this happen:
class-edd-structured-data.php filewp_footeredd_add_schema_microdata() or use that to hook into wp_footer and output the JSONLooking for input to make sure I'm thinking about this correctly and not missing anything important.
@brashrebel that approach seems right to me!
@brashrebel Did you see my JSON-LD plugin? https://gitlab.com/caldera-labs/caldera-jsonld It's lacking a UI and isn't PHP5-friendly, but please to borrow code.
@brashrebel Would love to see this! 👍
We also need to add support for Fragments, which would help theme developers as well: https://github.com/json-ld/json-ld.org/issues/107 h/t @inetbiz
@cklosowski I've looked into fragments but not sure how it would apply to us?
@sunnyratilal not apply to you. When WE add json+ld, we can reference that hash id.
@amdrew As we've deprecated the existing schema functions, we'll need to push out an update to Themedd as it makes use of the edd_add_schema_microdata function.
@SDavisMedia The same applies for Vendd as well.
@sunnyratilal this looks really good! Working great for me. Couple things:
availability.'<script type="application/ld+json">' . $output_data . '</script>' on every page no matter what. Should that be revised to only be echoed when applicable? I just get <script type="application/ld+json">[]</script> on every non-download page.seller because FES 😄 Some or all of these can be separate issues so let me know how you feel about them and I'll make that happen if needed.
edd_generate_download_structured_data filter that could be used by extensions. Personally, I think we should keep it to one filter in case changes in the future and renames the available key to something else because that would make a edd_structured_data_available filter be semantically incorrect.<script> elements containing JSON-LD are valid so this shouldn't be an issue.Merged!
Most helpful comment
@brashrebel Did you see my JSON-LD plugin? https://gitlab.com/caldera-labs/caldera-jsonld It's lacking a UI and isn't PHP5-friendly, but please to borrow code.