stevegrunwell / schemify Goto Github PK
View Code? Open in Web Editor NEWAutomatically generate Schema.org JSON-LD markup for WordPress content.
Home Page: https://wordpress.org/plugins/schemify/
License: MIT License
Automatically generate Schema.org JSON-LD markup for WordPress content.
Home Page: https://wordpress.org/plugins/schemify/
License: MIT License
With WooCommerce being such a popular e-commerce plugin for WordPress, representing products as such via Schemify should help a lot of people.
This would involve introducing the Product
schema, as well as things like ratings, reviews, etc.
Ability to copy and past custom schema information in the structured data box on the post admin screen so it can be saved.
Useful in the event the plugin does not pick up all require data
When a developer registers a custom post type via register_post_type()
, there should be support for a schemify-schema
argument that automatically specifies the type of schema that should be used to represent the post (via the schemify_schema
filter).
Supporting the BreadcrumbList scheme can be a useful feature as it helps google add a list of breadcrumb links under search results!
As schemify already includes WebPage scheme it may be pretty easy to get this supported.
See: http://schema.org/BreadcrumbList
And: https://developers.google.com/search/docs/data-types/breadcrumbs
When a search results page gets loaded with title and excerpt for each of the results, the debugger throws an error about a deprecated argument. This is caused by Thing::getDescription()
passing false
as the $post_id
, which triggers a call to _deprecated_argument()
inside get_the_excerpt()
. I'm not sure what part is actually generating the post ID for the arg, but I've included the call stack here to see if someone else can help identify where it's happening.
Best I can tell, it all starts with append_to_footer()
, which tries get_the_ID()
but that fails and returns false
. This just keeps getting passed down the line; even future calls to check it fail because they're using get_the_ID()
which has already decided there isn't one to give.
( ! ) Notice: get_the_excerpt was called with an argument that is <strong>deprecated</strong> since version 2.3.0 with no alternative available. in /app/public/wp-includes/functions.php on line 4026
--
1 | 0.0043 | 364256 | {main}( ) | .../index.php:0
2 | 0.1128 | 365424 | require( '/app/public/wp-blog-header.php' ) | .../index.php:17
3 | 0.3119 | 3633768 | require_once( '/app/public/wp-includes/template-loader.php' ) | .../wp-blog-header.php:19
4 | 0.3129 | 3635152 | include( '/app/public/wp-content/themes/connect-base/search.php' ) | .../template-loader.php:74
5 | 0.3296 | 3697424 | get_footer( ??? ) | .../search.php:65
6 | 0.3296 | 3697800 | locate_template( ???, ???, ??? ) | .../general-template.php:84
7 | 0.3296 | 3697880 | load_template( ???, ??? ) | .../template.php:647
8 | 0.3299 | 3698112 | require_once( '/app/public/wp-content/themes/connect-base/footer.php' ) | .../template.php:688
9 | 0.3299 | 3698112 | wp_footer( ) | .../footer.php:9
10 | 0.3299 | 3698112 | do_action( ???, ??? ) | .../general-template.php:2605
11 | 0.3299 | 3698488 | WP_Hook->do_action( ??? ) | .../plugin.php:453
12 | 0.3299 | 3698488 | WP_Hook->apply_filters( ???, ??? ) | .../class-wp-hook.php:323
13 | 0.3299 | 3699616 | Schemify\Theme\append_to_footer( ??? ) | .../class-wp-hook.php:298
14 | 0.3300 | 3699616 | Schemify\Core\get_json( ???, ??? ) | .../theme.php:91
15 | 0.3300 | 3699616 | Schemify\Core\build_object( ???, ??? ) | .../core.php:132
16 | 0.3302 | 3700544 | Schemify\Schemas\Thing->getProperties( ) | .../core.php:46
17 | 0.3302 | 3700544 | Schemify\Schemas\Thing->build( ???, ??? ) | .../Thing.php:98
18 | 0.3302 | 3701936 | Schemify\Schemas\Thing->getProp( ??? ) | .../Thing.php:183
19 | 0.3302 | 3702256 | Schemify\Schemas\Thing->getDescription( ??? ) | .../Thing.php:135
20 | 102.5890 | 3708744 | get_the_excerpt( ??? ) | .../Thing.php:257
21 | 102.5890 | 3708744 | _deprecated_argument( ???, ???, ??? ) | .../post-template.php:376
22 | 102.5891 | 3709064 | trigger_error ( ??? ) | .../functions.php:4026
When building a schema for attachment.php, the attachedArticle
property is a copy of the main schema if the media is unattached (thus wp_get_post_parent_id()
returns 0
):
{
"@context": "http:\/\/schema.org",
"@type": "ImageObject",
"associatedArticle": {
"@type": "ImageObject"
}
}
This results in a "ImageObject is not a known valid target type for the associatedArticle property" validation error.
Co-Authors Plus is a popular plugin for assigning multiple authors to a single post. Posts published with one or more author (as assigned via Co-Authors Plus) should change the author
property to an array, with one or more Person or Organization objects.
Piggybacking off the Event
Schema from #6, add a compatibility layer for The Events Calendar events.
Even if it's not something that WordPress offers out of the box, Events are common custom post types for WordPress sites; Schemify should come with a default Event schema.
As it stands, the caching in Schemify is pretty basic: the object assembled in Thing::build()
(for top-level queries only) gets cached indefinitely. If, for instance, an attachment or a user profile were to be updated, these would not be automatically flushed from the cache.
Schemify needs a more robust system, wherein (for instance), an update to an attachment would flush the cache for any post that uses it as a post thumbnail, or a user updating his/her profile would cause the cache for any posts where he/she is the author to be rebuilt.
Naturally, we want to try to make this a non-blocking process that also won't cause a cache stampede on larger sites.
The SearchResultsPage Schema should be applied on WordPress search results.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.