GithubHelp home page GithubHelp logo

stevegrunwell / schemify Goto Github PK

View Code? Open in Web Editor NEW
58.0 5.0 11.0 186 KB

Automatically generate Schema.org JSON-LD markup for WordPress content.

Home Page: https://wordpress.org/plugins/schemify/

License: MIT License

PHP 92.48% JavaScript 0.91% Shell 6.61%
schema json-ld structured-data wordpress-plugin

schemify's Issues

Feature Request

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

`get_the_excerpt()` getting called with null instead of post ID

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

Recursive objects when building schemas for unattached media

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.

Event Schema support

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.

More robust caching

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.