Giter VIP home page Giter VIP logo

plugin-nl / websitescanner-custom-schema Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 2.0 44 KB

WordPress plugin for custom JSON-ld schema markup within WordPress posts & pages.

Home Page: https://plugin.nl/websitescanner-custom-schema-plugin/

License: GNU General Public License v2.0

PHP 94.60% CSS 2.04% JavaScript 3.37%
schema-org wordpress-plugin structured-data schema-markup schema rich-snippets

websitescanner-custom-schema's People

Contributors

timvaniersel avatar

Stargazers

 avatar

Watchers

 avatar  avatar

websitescanner-custom-schema's Issues

Sanitize the input

Hello Tim,
i found your plugin in the WordPress repository (use it for some clients) and am very happy with it. Thank you very much!!!

I noticed a security hole thing that you could easily improve: the plugin does not sanitize the input.

What does it mean?
It is very easy to inject bad code via the plugin. Just add </script><script> in one of the input fields. Then you can fill some JavaScript. This script will run on the browser of the user.

bad-injection

But this security thing is easy to fix. Just sanitize the input:

sanitize-input

How to solve the problem?
Sanitizes the input with sanitize_post().

In this file:
websitescanner-custom-schema/admin/class-websitescanner-custom-schema-admin.php

Change line 97:
$data = $this->validate($_POST[$this->plugin_name]);

With this both lines:
$data = sanitize_post($_POST[$this->plugin_name], 'js');
$data = $this->validate($data);

Or just accept my pull request. :-)

Remove new lines

Currently the plugin validates if the JSON is correct and uses a different method then the validation done by Google's testing tool. By auto removing new lines within JSON fields it should correct a part of the differences.

add AMP support

Enhancement request by email:

Hi, I love your custom schema plugin. It is possible to add support to amp pages? That is a custom schema created in a post should also reflect in the amp version of the post
Thanks

Show on all post types

Currently the fields only show up on posts and pages. Would be nice if It also worked on Custom post types and products (WooCommerce).

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.