Version Description
- Fixed : To escape a newline code and the tag of the body attribute in Type "Article" and "NewsArticle".
Download this release
Release Info
Developer | miiitaka |
Plugin | Markup (JSON-LD) structured in schema.org |
Version | 1.1.3 |
Comparing to | |
See all releases |
Code changes from version 1.1.2 to 1.1.3
- readme.txt +26 -4
- wp-structuring-display.php +29 -17
- wp-structuring-markup.php +1 -1
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: miiitaka
|
|
3 |
Tags: schema, json, seo, posts
|
4 |
Requires at least: 4.3.1
|
5 |
Tested up to: 4.3.1
|
6 |
-
Stable tag: 1.1.
|
7 |
|
8 |
It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an article or the fixed page.
|
9 |
|
@@ -12,6 +12,24 @@ It is plug in to implement structured markup (JSON-LD syntax) by schema.org defi
|
|
12 |
It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an article or the fixed page.
|
13 |
Base knowledge is "https://developers.google.com/structured-data/"
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
== Installation ==
|
16 |
|
17 |
* A plug-in installation screen is displayed in the WordPress admin panel.
|
@@ -21,17 +39,21 @@ Base knowledge is "https://developers.google.com/structured-data/"
|
|
21 |
|
22 |
== Changelog ==
|
23 |
|
|
|
|
|
|
|
|
|
24 |
= 1.1.2 =
|
25 |
|
26 |
-
* Schema.org type "Article" image
|
27 |
|
28 |
= 1.1.0 =
|
29 |
|
30 |
-
* Schema.org type "Article"
|
31 |
|
32 |
= 1.0.1 - 1.0.8 =
|
33 |
|
34 |
-
*
|
35 |
|
36 |
= 1.0.0 =
|
37 |
|
3 |
Tags: schema, json, seo, posts
|
4 |
Requires at least: 4.3.1
|
5 |
Tested up to: 4.3.1
|
6 |
+
Stable tag: 1.1.3
|
7 |
|
8 |
It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an article or the fixed page.
|
9 |
|
12 |
It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an article or the fixed page.
|
13 |
Base knowledge is "https://developers.google.com/structured-data/"
|
14 |
|
15 |
+
[ Schema.org Type ]
|
16 |
+
|
17 |
+
= Website =
|
18 |
+
|
19 |
+
* https://schema.org/WebSite
|
20 |
+
|
21 |
+
= Organization =
|
22 |
+
|
23 |
+
* https://schema.org/Organization
|
24 |
+
|
25 |
+
= Article =
|
26 |
+
|
27 |
+
* http://schema.org/Article
|
28 |
+
|
29 |
+
= NewsArticle =
|
30 |
+
|
31 |
+
* http://schema.org/NewsArticle
|
32 |
+
|
33 |
== Installation ==
|
34 |
|
35 |
* A plug-in installation screen is displayed in the WordPress admin panel.
|
39 |
|
40 |
== Changelog ==
|
41 |
|
42 |
+
= 1.1.3 =
|
43 |
+
|
44 |
+
* Fixed : To escape a newline code and the tag of the body attribute in Type "Article" and "NewsArticle".
|
45 |
+
|
46 |
= 1.1.2 =
|
47 |
|
48 |
+
* Updated : Schema.org type "Article" image attribute.
|
49 |
|
50 |
= 1.1.0 =
|
51 |
|
52 |
+
* Added : Schema.org type "Article".
|
53 |
|
54 |
= 1.0.1 - 1.0.8 =
|
55 |
|
56 |
+
* Fixed : Missing plugin path setting.
|
57 |
|
58 |
= 1.0.0 =
|
59 |
|
wp-structuring-display.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Schema.org Display
|
4 |
*
|
5 |
* @author Kazuya Takami
|
6 |
-
* @version 1.
|
7 |
* @since 1.0.0
|
8 |
*/
|
9 |
class Structuring_Markup_Display {
|
@@ -41,7 +41,7 @@ class Structuring_Markup_Display {
|
|
41 |
* Setting JSON-LD Template
|
42 |
*
|
43 |
* @since 1.0.0
|
44 |
-
* @version 1.1.
|
45 |
* @param Structuring_Markup_Admin_Db $db
|
46 |
* @param string $output
|
47 |
*/
|
@@ -64,12 +64,12 @@ class Structuring_Markup_Display {
|
|
64 |
break;
|
65 |
case 'article':
|
66 |
if ( isset( $row->options ) ) {
|
67 |
-
$this->set_schema_article(
|
68 |
}
|
69 |
break;
|
70 |
case 'news_article':
|
71 |
if ( isset( $row->options ) ) {
|
72 |
-
$this->set_schema_news_article(
|
73 |
}
|
74 |
break;
|
75 |
}
|
@@ -90,6 +90,17 @@ class Structuring_Markup_Display {
|
|
90 |
echo '</script>' , PHP_EOL;
|
91 |
}
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
/**
|
94 |
* Setting schema.org WebSite
|
95 |
*
|
@@ -163,21 +174,21 @@ class Structuring_Markup_Display {
|
|
163 |
* Setting schema.org Article
|
164 |
*
|
165 |
* @since 1.1.0
|
166 |
-
* @version 1.1.
|
167 |
*/
|
168 |
private function set_schema_article() {
|
169 |
global $post;
|
170 |
if ( has_post_thumbnail( $post->ID ) ) {
|
171 |
-
|
172 |
$args = array(
|
173 |
"@context" => "http://schema.org",
|
174 |
"@type" => "Article",
|
175 |
-
"headline" =>
|
176 |
"datePublished" => get_the_time( DATE_ISO8601, $post->ID ),
|
177 |
-
"author" =>
|
178 |
-
"image" => array( $
|
179 |
-
"description" =>
|
180 |
-
"articleBody" =>
|
181 |
);
|
182 |
$this->set_schema_json( $args );
|
183 |
}
|
@@ -186,20 +197,21 @@ class Structuring_Markup_Display {
|
|
186 |
/**
|
187 |
* Setting schema.org NewsArticle
|
188 |
*
|
189 |
-
* @since
|
|
|
190 |
*/
|
191 |
private function set_schema_news_article() {
|
192 |
global $post;
|
193 |
if ( has_post_thumbnail( $post->ID ) ) {
|
194 |
-
|
195 |
$args = array(
|
196 |
"@context" => "http://schema.org",
|
197 |
"@type" => "NewsArticle",
|
198 |
-
"headline" =>
|
199 |
"datePublished" => get_the_time( DATE_ISO8601, $post->ID ),
|
200 |
-
"image" => array( $
|
201 |
-
"description" =>
|
202 |
-
"articleBody" =>
|
203 |
);
|
204 |
$this->set_schema_json( $args );
|
205 |
}
|
3 |
* Schema.org Display
|
4 |
*
|
5 |
* @author Kazuya Takami
|
6 |
+
* @version 1.1.3
|
7 |
* @since 1.0.0
|
8 |
*/
|
9 |
class Structuring_Markup_Display {
|
41 |
* Setting JSON-LD Template
|
42 |
*
|
43 |
* @since 1.0.0
|
44 |
+
* @version 1.1.3
|
45 |
* @param Structuring_Markup_Admin_Db $db
|
46 |
* @param string $output
|
47 |
*/
|
64 |
break;
|
65 |
case 'article':
|
66 |
if ( isset( $row->options ) ) {
|
67 |
+
$this->set_schema_article();
|
68 |
}
|
69 |
break;
|
70 |
case 'news_article':
|
71 |
if ( isset( $row->options ) ) {
|
72 |
+
$this->set_schema_news_article();
|
73 |
}
|
74 |
break;
|
75 |
}
|
90 |
echo '</script>' , PHP_EOL;
|
91 |
}
|
92 |
|
93 |
+
/**
|
94 |
+
* Setting JSON-LD Template
|
95 |
+
*
|
96 |
+
* @since 1.1.3
|
97 |
+
* @param string $text
|
98 |
+
* @return string $text
|
99 |
+
*/
|
100 |
+
private function escape_text_tags( $text ) {
|
101 |
+
return str_replace( array( "\r", "\n" ), '', strip_tags( $text ) );
|
102 |
+
}
|
103 |
+
|
104 |
/**
|
105 |
* Setting schema.org WebSite
|
106 |
*
|
174 |
* Setting schema.org Article
|
175 |
*
|
176 |
* @since 1.1.0
|
177 |
+
* @version 1.1.3
|
178 |
*/
|
179 |
private function set_schema_article() {
|
180 |
global $post;
|
181 |
if ( has_post_thumbnail( $post->ID ) ) {
|
182 |
+
$images = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
|
183 |
$args = array(
|
184 |
"@context" => "http://schema.org",
|
185 |
"@type" => "Article",
|
186 |
+
"headline" => $this->escape_text_tags( $post->post_title ),
|
187 |
"datePublished" => get_the_time( DATE_ISO8601, $post->ID ),
|
188 |
+
"author" => $this->escape_text_tags( get_the_author_meta( 'display_name', $post->post_author ) ),
|
189 |
+
"image" => array( $images[0] ),
|
190 |
+
"description" => $this->escape_text_tags( $post->post_excerpt ),
|
191 |
+
"articleBody" => $this->escape_text_tags( $post->post_content )
|
192 |
);
|
193 |
$this->set_schema_json( $args );
|
194 |
}
|
197 |
/**
|
198 |
* Setting schema.org NewsArticle
|
199 |
*
|
200 |
+
* @since 1.0.0
|
201 |
+
* @version 1.1.3
|
202 |
*/
|
203 |
private function set_schema_news_article() {
|
204 |
global $post;
|
205 |
if ( has_post_thumbnail( $post->ID ) ) {
|
206 |
+
$images = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
|
207 |
$args = array(
|
208 |
"@context" => "http://schema.org",
|
209 |
"@type" => "NewsArticle",
|
210 |
+
"headline" => $this->escape_text_tags( $post->post_title ),
|
211 |
"datePublished" => get_the_time( DATE_ISO8601, $post->ID ),
|
212 |
+
"image" => array( $images[0] ),
|
213 |
+
"description" => $this->escape_text_tags( $post->post_excerpt ),
|
214 |
+
"articleBody" => $this->escape_text_tags( $post->post_content )
|
215 |
);
|
216 |
$this->set_schema_json( $args );
|
217 |
}
|
wp-structuring-markup.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Markup (JSON-LD) structured in schema.org
|
4 |
Plugin URI: https://github.com/miiitaka/wp-structuring-markup
|
5 |
Description: It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an article or the fixed page.
|
6 |
-
Version: 1.1.
|
7 |
Author: Kazuya Takami
|
8 |
Author URI: http://programp.com/
|
9 |
License: GPLv2 or later
|
3 |
Plugin Name: Markup (JSON-LD) structured in schema.org
|
4 |
Plugin URI: https://github.com/miiitaka/wp-structuring-markup
|
5 |
Description: It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an article or the fixed page.
|
6 |
+
Version: 1.1.3
|
7 |
Author: Kazuya Takami
|
8 |
Author URI: http://programp.com/
|
9 |
License: GPLv2 or later
|