Coder Social home page Coder Social logo

rolandinsh / itempropwp Goto Github PK

View Code? Open in Web Editor NEW
11.0 4.0 6.0 486 KB

Add human invisible schema.org itemprop code to the content of article

Home Page: https://simplemediacode.com/wordpress-pugins/itemprop-wp/

License: GNU Lesser General Public License v2.1

PHP 99.47% CSS 0.53%
php microdata schema itemprop wordpress wordpress-plugin

itempropwp's Introduction

itemprop WP for SERP/SEO Rich snippets

Add human invisible schema.org itemprop code to post content

Throughput Graph

Description

Have a good idea for improvement? Share it | BUG report

This plugin will NOT FIX BADly programmed WordPress sites!

Example:

Article

    <span itemscope itemtype="http://schema.org/Article" class="itempropwp-wrap">
    <!-- Itemprop WP 3.5.201610051 by Rolands Umbrovskis https://umbrovskis.com -->
        <meta itemprop="name" content="Title of the Article" />
        <meta itemscope itemprop="mainEntityOfPage"  itemType="https://schema.org/WebPage" itemid="http://fulllink.example.com/seo-optimized-article/"/>
        <meta itemprop="url" content="http://fulllink.example.com/seo-optimized-article/" />
        <span itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
            <meta itemprop="url" content="http://fulllink.example.com/seo-optimized-article/example.jpg" />
            <meta itemprop="width" content="640"/>
            <meta itemprop="height" content="480"/>
        </span>
        <meta itemprop="author" content="http://fulllink.example.com/author/authorusername/"/>
        <meta itemprop="description" content="excerpt from post OR first 170 symbols (with full word), ..." />
        <meta itemprop="datePublished" content="2012-09-13 19:17:21"/>
        <meta itemprop="dateModified" content="2012-09-29 13:33:25" />
        <meta itemprop="interactionCount" content="UserComments:356"/>
        <span itemprop="publisher" itemscope itemtype="https://schema.org/Organization">
            <span itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
                <meta itemprop="url" content="http://fulllink.example.com/logo.jpg">
            </span>
            <meta itemprop="name" content="Example Blog">
        </span>
    <!-- Itemprop WP 3.5.201610051 by Rolands Umbrovskis https://umbrovskis.com end -->
    </span>

Review

    <div itemprop="review" itemscope itemtype="http://schema.org/Review">
        <meta itemprop="name" content="Item Title is greate!" />
        <meta itemprop="author" content="Rolands Umbrovskis" />
        <meta itemprop="datePublished" content="2011-03-25" />
        <span itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
            <meta itemprop="worstRating" content = "1"/>
            <meta itemprop="ratingValue" content="4.5" />
            <meta itemprop="bestRating" content="5" />
        </span>
        <span itemprop="itemReviewed" itemscope itemtype="http://schema.org/Thing">
            <meta itemprop="name" content="Item Title" />
        </span>
	
        <div itemscope itemtype="http://schema.org/Product">
            <meta itemprop="name" content="Item Title" />
            <span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
                <meta itemprop="price" content="55.36" />
                <meta itemprop="priceCurrency" content="USD" />
                <link itemprop="availability" href="http://schema.org/InStock" />
            </span>
        </div>
        <meta itemprop="description" content="Great Item Title for the price." />
    </div>

How does it work?

This asumes that Your page is not fully integrated with HTML5's data properties for microdata. This plugin will create small code inside Your full content, with extra microdata from schema.org. This will be ONLY on singular pages - post, page or your custom post type.

Once we are on singular page:

  • NEW in 3.3.0 itemprop="review".
  • we will extract from it EXCERPT.
  • If You haven't provided excerpt, plugin will look-up for post content, and downsize it to 170 symbols up to full word.
  • If your content consist ONLY of shortcode, it will strip it out, and leave empty content. :(
  • If we have empty content, from previous step, we will use post title. Not best choise, but at least we have some description.
  • If Your post do not have even title, plugin will giveup and your description will be ampty. (This ir very bad :') )

Other options, like datePublished, UserComments, url are taken from post

Features

  • Admin interface for options: description lenght (if excerpt not provided),show/hide UserComments:325, show/hide dateModified
  • schema.org and Google article requirement changes (since 3.5.201602152). Thanks to @jasonreposa
  • itemprop="description" (since 3.1.1)
  • itemprop="name" (since 3.0)
  • itemprop="url" (since 3.0)
  • itemprop="image" (since 1.0)
  • itemprop="author" (since 3.0)
  • itemprop="datePublished" (since 3.0)
  • "UserComments:325" itemprop="interactionCount" (since 3.0)
  • itemprop="review" (since 3.3.0)

Links

Installation

  1. Unzip the download package
  2. Upload itempropwp to the /wp-content/plugins/ directory
  3. Activate the plugin through the 'Plugins' menu in WordPress
  4. See itempropwp.php for usage

Require PHP at least 5.3

Frequently Asked Questions

There are no questions for now! Ask!

itempropwp's People

Contributors

jasonreposa avatar rolandinsh avatar semplon avatar summatix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

itempropwp's Issues

Illegal string offset 'onoff'

PHP Warning: Illegal string offset 'onoff' in /var/www/arthur/blog/wp-content/plugins/itempropwp/itemprop_review.php on line 129

(

echo '<option value="off" '.selected($reviewonoff['onoff'], "off", false).'>Off</option>';
)

I get this on an updated ubuntu so I'm guessing it has something to do with some new version of php

via http://wordpress.org/support/topic/php-warning-illegal-string-offset-onoff-in-itempropwpitemprop_reviewphp?replies=2

Schema.org Changes

We've started getting errors on our structured data. It looks like Google now prefers an ImageObject instead of just a string URL. In addition there are errors on other newly required fields mainEntityOfPage and publisher. There may be more.

Here is a breaking example: https://developers.google.com/structured-data/testing-tool/?url=http://www.mybanktracker.com/news/2013/10/03/banking-privacy-optout-information-sharing/

Schema.org/Article properties:
https://developers.google.com/structured-data/rich-snippets/articles

save shortcodes as option

via http://wordpress.org/support/topic/link-dont-appear-in-description?replies=1#post-4568612

i have some posts where i have something like this:

my [product name] is very cool

[product name] will be live as a LINK to the product

but this plugin isnt showing it in description.

I suppose the plugin dont "read" the post but the source code?

what im seeing in description is:
my is very cool

I would like to use this plugin as it so simple, but i cant unlink the name of product because its an affiliate link.

call_user_func_array() expects parameter 1 to be a valid callback

https://wordpress.org/support/topic/some-php-strict-errors-with-itempropwp?replies=1

call_user_func_array() expects parameter 1 to be a valid callback, non-static method itempropwp::init() should not be called statically

call_user_func_array() expects parameter 1 to be a valid callback, non-static method itempropwp_review::reviewinit() should not be called statically

call_user_func_array() expects parameter 1 to be a valid callback, non-static method sidebar_generator::init() should not be called statically

Illegal string offset 'onoff'

Warning: Illegal string offset 'onoff' in C:\wp-content\plugins\itempropwp\itemprop_review.php on line 152

=> echo '<option value="off" ' . selected($reviewonoff['onoff'], "off", false) . '>Off';

Typo in description

-Description: Add human invisible schema.org code to conent
+Description: Add human invisible schema.org code to content

If Excerpt Null - no output from plugin

If I do nothing else but leave the post excerpt empty I get no output from the plugin.

I checked in source and everything related to the plugin after "" is not present.

I go back and add text in the excerpt, recheck and all is well.

I am assuming this is something peculiar to my site, otherwise it would have been reported previously.

add strip_tags to $ipwp_post_dsc

via http://wordpress.org/support/topic/itemprop-author-information?replies=6#post-4257206

@umbrovskis, I sterted using the plugin and noticed that there is a page where you can specify whatever author you want. So that does the trick for me (as I don't have an multi-author blog).

One last thing: when you get the excerpt you use this code:
$ipwp_post_dsc = apply_filters('ipwp_post_dsc', $ipwp_n->ipwp_excerpt_maxchr(get_option('smcipwp_maxlenght'), strip_shortcodes($thisipwp_post->post_content) )); // Extending @SInCE 3.1
so if my post starts whith a long HTML tag the excerpt will be empty.

Could you please change the above line with the one bellow?
$ipwp_post_dsc = apply_filters('ipwp_post_dsc', $ipwp_n->ipwp_excerpt_maxchr(get_option('smcipwp_maxlenght'), strip_tags(strip_shortcodes($thisipwp_post->post_content)) )); // Extending @SInCE 3.1

I just added a strip_tags.

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.