Markup (JSON-LD) structured in schema.org - Version 2.1.2

Version Description

(2015-12-09) =

  • Check : WordPress version 4.4 operation check.
Download this release

Release Info

Developer miiitaka
Plugin Icon 128x128 Markup (JSON-LD) structured in schema.org
Version 2.1.2
Comparing to
See all releases

Code changes from version 2.1.1 to 2.1.2

readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Markup (JSON-LD) structured in schema.org ===
2
  Contributors: miiitaka
3
- Tags: schema, schema.org, json, json-ld, seo, post, posts, google
4
  Requires at least: 4.3.1
5
- Tested up to: 4.3.1
6
- Stable tag: 2.1.1
7
 
8
  It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an post page, fixed page and etc.
9
 
@@ -26,7 +26,15 @@ Base knowledge is "https://schema.org/" and "https://developers.google.com/struc
26
 
27
  You can display the breadcrumbs in the short code. Breadcrumb definition is available even if not active.
28
 
29
- `[wp-structuring-markup-breadcrumb]`
 
 
 
 
 
 
 
 
30
 
31
  == Installation ==
32
 
@@ -37,13 +45,17 @@ You can display the breadcrumbs in the short code. Breadcrumb definition is avai
37
 
38
  == Changelog ==
39
 
 
 
 
 
40
  = 2.1.1 (2015-12-04) =
41
 
42
- * Added : Add the table update processing at the time of version up
43
 
44
  = 2.1.0 (2015-12-03) =
45
 
46
- * Added : Schema.org type "Event" schema.org definition Add "Event" custom post output that works
47
 
48
  = 2.0.2 (2015-11-27) =
49
 
@@ -55,7 +67,7 @@ You can display the breadcrumbs in the short code. Breadcrumb definition is avai
55
 
56
  = 2.0.0 (2015-11-23) =
57
 
58
- * Added : Schema.org type "BreadcrumbList" schema.org definition Add breadcrumbs short code output that works
59
  * Updated : Schema.org definition immobilization.
60
 
61
  = 1.3.2 (2015-11-17) =
1
  === Markup (JSON-LD) structured in schema.org ===
2
  Contributors: miiitaka
3
+ Tags: schema, schema.org, json, json-ld, seo, post, posts, google, shortcode, breadcrumb
4
  Requires at least: 4.3.1
5
+ Tested up to: 4.4.0
6
+ Stable tag: 2.1.2
7
 
8
  It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an post page, fixed page and etc.
9
 
26
 
27
  You can display the breadcrumbs in the short code. Breadcrumb definition is available even if not active.
28
 
29
+ [ Example ]
30
+
31
+ ```
32
+ <?php
33
+ if (shortcode_exists('wp-structuring-markup-breadcrumb')) {
34
+ echo do_shortcode('[wp-structuring-markup-breadcrumb]');
35
+ }
36
+ ?>
37
+ ```
38
 
39
  == Installation ==
40
 
45
 
46
  == Changelog ==
47
 
48
+ = 2.1.2 (2015-12-09) =
49
+
50
+ * Check : WordPress version 4.4 operation check.
51
+
52
  = 2.1.1 (2015-12-04) =
53
 
54
+ * Added : Add the table update processing at the time of version up.
55
 
56
  = 2.1.0 (2015-12-03) =
57
 
58
+ * Added : Schema.org type "Event" schema.org definition Add "Event" custom post output that works.
59
 
60
  = 2.0.2 (2015-11-27) =
61
 
67
 
68
  = 2.0.0 (2015-11-23) =
69
 
70
+ * Added : Schema.org type "BreadcrumbList" schema.org definition Add breadcrumbs short code output that works.
71
  * Updated : Schema.org definition immobilization.
72
 
73
  = 1.3.2 (2015-11-17) =
trunk/css/style.css ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /** List Setting */
2
+ .schema-admin-table-list th:nth-child(1) {
3
+ width: 10em;
4
+ }
5
+ .schema-admin-table-list td {
6
+ vertical-align: middle;
7
+ }
8
+ .schema-admin-table-list td:nth-child(1) span {
9
+ display: inline-block;
10
+ padding: 0 1em 0 1em;
11
+ text-align: center;
12
+ width: 8em;
13
+ }
14
+ .schema-admin-table-list td:nth-child(1) span.active {
15
+ background: #00a0d2;
16
+ color: #ffffff;
17
+ }
18
+ .schema-admin-table-list td:nth-child(1) span.stop {
19
+ background: #CCCCCC;
20
+ }
21
+
22
+ /** Posts page */
23
+ .schema-admin-h1-span {
24
+ display: inline-block;
25
+ font-size: 80%;
26
+ margin: 0 0 0 10px;
27
+ }
28
+ .schema-admin-table {
29
+ margin: 15px 0 15px 0;
30
+ }
31
+ .schema-admin-table caption {
32
+ border-left: solid 4px #00a0d2;
33
+ margin: 0 0 10px 0;
34
+ padding: 3px 0 3px 7px;
35
+ text-align: left;
36
+ }
37
+ .schema-admin-table th {
38
+ padding: 3px 5px 0 0;
39
+ text-align: right;
40
+ vertical-align: top;
41
+ width: 120px;
42
+ }
43
+ .schema-admin-table td label{
44
+ margin: 0 10px 0 0;
45
+ }
46
+ .schema-admin-table small {
47
+ margin: 0 0 0 10px;
48
+ }
49
+ .schema-admin-table input[type="checkbox"] {
50
+ margin: 0 5px 0 0;
51
+ }
trunk/includes/wp-structuring-admin-db.php ADDED
@@ -0,0 +1,268 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Schema.org Admin DB Connection
4
+ *
5
+ * @author Kazuya Takami
6
+ * @since 1.0.0
7
+ * @version 2.1.1
8
+ */
9
+ class Structuring_Markup_Admin_Db {
10
+
11
+ /**
12
+ * Variable definition.
13
+ *
14
+ * @since 1.0.0
15
+ * @version 2.1.0
16
+ */
17
+ private $table_name;
18
+
19
+ /** Schema.org Type defined. */
20
+ public $type_array = array(
21
+ "article" => "Article",
22
+ "blog_posting" => "Blog Posting",
23
+ "breadcrumb" => "Breadcrumb",
24
+ "event" => "Event",
25
+ "news_article" => "News Article",
26
+ "organization" => "Organization",
27
+ "website" => "Web Site"
28
+ );
29
+
30
+ /**
31
+ * Constructor Define.
32
+ *
33
+ * @since 1.0.0
34
+ * @version 1.3.2
35
+ */
36
+ public function __construct () {
37
+ global $wpdb;
38
+ $this->table_name = $wpdb->prefix . 'structuring_markup';
39
+ }
40
+
41
+ /**
42
+ * Create Table.
43
+ *
44
+ * @since 1.0.0
45
+ * @version 2.1.1
46
+ * @param string $text_domain
47
+ * @param string $version
48
+ */
49
+ public function create_table ( $text_domain, $version ) {
50
+ require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
51
+
52
+ global $wpdb;
53
+
54
+ $prepared = $wpdb->prepare( "SHOW TABLES LIKE %s", $this->table_name );
55
+ $is_db_exists = $wpdb->get_var( $prepared );
56
+ $charset_collate = $wpdb->get_charset_collate();
57
+
58
+ if ( is_null( $is_db_exists ) ) {
59
+ $this->create_table_execute( $charset_collate, $text_domain, $version );
60
+
61
+ foreach ( $this->type_array as $key => $value ) {
62
+ $args = array(
63
+ 'type' => $key,
64
+ 'activate' => "",
65
+ 'output' => serialize( array() ),
66
+ 'options' => serialize( array() ),
67
+ 'register_date' => date( "Y-m-d H:i:s" ),
68
+ 'update_date' => date( "Y-m-d H:i:s" )
69
+ );
70
+ $this->insert_options( $args );
71
+ }
72
+ } else {
73
+ /**
74
+ * version up process.
75
+ *
76
+ * @since 2.0.0
77
+ * @version 2.1.1
78
+ * */
79
+ $options = get_option( $text_domain );
80
+
81
+ if ( !isset( $options['version'] ) || $options['version'] !== $version ) {
82
+ $lists = $this->get_list_options();
83
+
84
+ $wpdb->query( "DROP TABLE " . $this->table_name );
85
+ $this->create_table_execute( $charset_collate, $text_domain, $version );
86
+
87
+ foreach ( $this->type_array as $key => $value ) {
88
+ $args = array(
89
+ 'type' => $key,
90
+ 'activate' => "",
91
+ 'output' => serialize( array() ),
92
+ 'options' => serialize( array() ),
93
+ 'register_date' => date( "Y-m-d H:i:s" ),
94
+ 'update_date' => date( "Y-m-d H:i:s" )
95
+ );
96
+ foreach ( $lists as $list ) {
97
+ if ( $list->type === $key ) {
98
+ $activate = isset( $list->activate ) ? $list->activate : "";
99
+
100
+ $args = array(
101
+ 'type' => $key,
102
+ 'activate' => $activate,
103
+ 'output' => $list->output,
104
+ 'options' => $list->options,
105
+ 'register_date' => date( "Y-m-d H:i:s" ),
106
+ 'update_date' => date( "Y-m-d H:i:s" )
107
+ );
108
+ }
109
+ }
110
+ $this->insert_options( $args );
111
+ }
112
+ }
113
+ }
114
+ }
115
+
116
+ /**
117
+ * Create table execute
118
+ *
119
+ * @since 2.0.0
120
+ * @version 2.1.1
121
+ * @param string $charset_collate
122
+ * @param string $text_domain
123
+ * @param string $version
124
+ */
125
+ private function create_table_execute ( $charset_collate, $text_domain, $version ) {
126
+ $query = " CREATE TABLE " . $this->table_name;
127
+ $query .= " (id MEDIUMINT(9) NOT NULL AUTO_INCREMENT PRIMARY KEY";
128
+ $query .= ",type TINYTEXT NOT NULL";
129
+ $query .= ",activate TINYTEXT NOT NULL";
130
+ $query .= ",output TEXT NOT NULL";
131
+ $query .= ",options TEXT NOT NULL";
132
+ $query .= ",register_date DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL";
133
+ $query .= ",update_date DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL";
134
+ $query .= ",UNIQUE KEY id (id)) " . $charset_collate;
135
+
136
+ dbDelta( $query );
137
+
138
+ $options = array( 'version' => $version );
139
+ update_option( $text_domain, $options, 'yes' );
140
+ }
141
+
142
+ /**
143
+ * Get Data.
144
+ *
145
+ * @since 1.0.0
146
+ * @version 2.1.0
147
+ * @param integer $id
148
+ * @return array $results
149
+ */
150
+ public function get_options ( $id ) {
151
+ global $wpdb;
152
+
153
+ $query = "SELECT * FROM " . $this->table_name . " WHERE id = %d";
154
+ $data = array( esc_html( $id ) );
155
+ $prepared = $wpdb->prepare( $query, $data );
156
+ $args = $wpdb->get_row( $prepared );
157
+ $results = array();
158
+
159
+ if ( $args ) {
160
+ $results['id'] = $args->id;
161
+ $results['activate'] = isset( $args->activate ) ? $args->activate : "";
162
+ $results['type'] = $args->type;
163
+ $results['output'] = unserialize( $args->output );
164
+ $results['option'] = unserialize( $args->options );
165
+ }
166
+ return (array) $results;
167
+ }
168
+
169
+ /**
170
+ * Get All Data.
171
+ *
172
+ * @since 1.0.0
173
+ * @return array $results
174
+ */
175
+ public function get_list_options () {
176
+ global $wpdb;
177
+
178
+ $query = "SELECT * FROM " . $this->table_name . " ORDER BY type ASC";
179
+
180
+ return (array) $wpdb->get_results( $query );
181
+ }
182
+
183
+ /**
184
+ * Get Select Data.
185
+ *
186
+ * @since 1.0.0
187
+ * @param array $output
188
+ * @return array $results
189
+ */
190
+ public function get_select_options ( $output ) {
191
+ global $wpdb;
192
+
193
+ $query = "SELECT * FROM " . $this->table_name . " WHERE output LIKE '%%%s%%'";
194
+ $data = array( $output );
195
+ $prepared = $wpdb->prepare( $query, $data );
196
+ $results = $wpdb->get_results( $prepared );
197
+
198
+ return (array) $results;
199
+ }
200
+
201
+ /**
202
+ * Get Type Data.
203
+ *
204
+ * @since 2.0.0
205
+ * @version 2.1.0
206
+ * @param string $type
207
+ * @return array $results
208
+ */
209
+ public function get_type_options ( $type ) {
210
+ global $wpdb;
211
+
212
+ $query = "SELECT * FROM " . $this->table_name . " WHERE type = %s";
213
+ $data = array( esc_html( $type ) );
214
+ $prepared = $wpdb->prepare( $query, $data );
215
+ $args = $wpdb->get_row( $prepared );
216
+ $results = array();
217
+
218
+ if ( $args ) {
219
+ $results['id'] = $args->id;
220
+ $results['activate'] = isset( $args->activate ) ? $args->activate : "";
221
+ $results['type'] = $args->type;
222
+ $results['output'] = unserialize( $args->output );
223
+ $results['option'] = unserialize( $args->options );
224
+ }
225
+ return (array) $results;
226
+ }
227
+
228
+ /**
229
+ * Insert Data.
230
+ *
231
+ * @since 1.0.0
232
+ * @version 2.0.0
233
+ * @param array $args
234
+ */
235
+ private function insert_options ( array $args ) {
236
+ global $wpdb;
237
+
238
+ $prepared = array( '%s', '%s', '%s', '%s', '%s', '%s' );
239
+ $wpdb->insert( $this->table_name, $args, $prepared );
240
+ }
241
+
242
+ /**
243
+ * Update Data.
244
+ *
245
+ * @since 1.0.0
246
+ * @version 2.0.0
247
+ * @param array $post($_POST)
248
+ * @return integer $post['id']
249
+ */
250
+ public function update_options ( array $post ) {
251
+ global $wpdb;
252
+
253
+ $data = array(
254
+ 'type' => $post['type'],
255
+ 'activate' => isset( $post['activate'] ) ? $post['activate'] : "",
256
+ 'output' => serialize( $post['output'] ),
257
+ 'options' => isset( $post['option'] ) ? serialize( $post['option'] ) : "",
258
+ 'update_date' => date( "Y-m-d H:i:s" )
259
+ );
260
+ $key = array( 'id' => esc_html( $post['id'] ) );
261
+ $prepared = array( '%s', '%s', '%s', '%s', '%s' );
262
+ $key_prepared = array( '%d' );
263
+
264
+ $wpdb->update( $this->table_name, $data, $key, $prepared, $key_prepared );
265
+
266
+ return (integer) $post['id'];
267
+ }
268
+ }
trunk/includes/wp-structuring-admin-list.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Schema.org Admin List
4
+ *
5
+ * @author Kazuya Takami
6
+ * @since 1.0.0
7
+ * @version 2.0.0
8
+ * @see wp-structuring-admin-db.php
9
+ */
10
+ class Structuring_Markup_Admin_List {
11
+
12
+ /**
13
+ * Variable definition.
14
+ *
15
+ * @since 1.3.0
16
+ * @version 2.0.0
17
+ */
18
+ private $text_domain;
19
+
20
+ /**
21
+ * Constructor Define.
22
+ *
23
+ * @since 1.0.0
24
+ * @version 2.0.0
25
+ * @param String $text_domain
26
+ */
27
+ public function __construct ( $text_domain ) {
28
+ $this->text_domain = $text_domain;
29
+ $this->page_render();
30
+ }
31
+
32
+ /**
33
+ * LIST Page HTML Render.
34
+ *
35
+ * @since 1.0.0
36
+ * @version 2.0.0
37
+ */
38
+ private function page_render () {
39
+ $post_url = 'admin.php?page=' . $this->text_domain . '-post';
40
+
41
+ $html = '';
42
+ $html .= '<div class="wrap">';
43
+ $html .= '<h1>' . esc_html__( 'Schema.org Settings List', $this->text_domain );
44
+ $html .= '</h1>';
45
+ echo $html;
46
+
47
+ $html = '<hr>';
48
+ $html .= '<table class="wp-list-table widefat fixed striped posts schema-admin-table-list">';
49
+ $html .= '<tr>';
50
+ $html .= '<th scope="row">' . esc_html__( 'Status', $this->text_domain ) . '</th>';
51
+ $html .= '<th scope="row">' . esc_html__( 'Schema Type', $this->text_domain ) . '</th>';
52
+ $html .= '<th scope="row">' . esc_html__( 'Output Page', $this->text_domain ) . '</th>';
53
+ $html .= '<th scope="row">' . esc_html__( 'ShortCode', $this->text_domain ) . '</th>';
54
+ $html .= '<th scope="row">&nbsp;</th>';
55
+ $html .= '</tr>';
56
+ echo $html;
57
+
58
+ $db = new Structuring_Markup_Admin_Db();
59
+ $results = $db->get_list_options();
60
+ $type_array = $db->type_array;
61
+
62
+ if ( $results ) {
63
+ foreach ( $results as $row ) {
64
+ $html = '<tr><td>';
65
+ $html .= $row->activate === 'on' ? '<span class="active">Activate' : '<span class="stop">Deactivate';
66
+ $html .= '</span></td>';
67
+ $html .= '<td><a href="';
68
+ $html .= admin_url( $post_url . '&type=' . esc_html( $row->type ) . '&schema_post_id=' . esc_html( $row->id ) ) . '">' . $type_array[esc_html( $row->type )];
69
+ $html .= '</a></td>';
70
+ $html .= '<td>' . $this->unserialize_output( $row->output ) . '</td>';
71
+ $html .= '<td>';
72
+
73
+ if ( $row->type === 'breadcrumb' ) {
74
+ $html .= '<input type="text" onfocus="this.select();" readonly="readonly" value="[wp-structuring-markup-breadcrumb]" class="large-text code">';
75
+ } else {
76
+ $html .= '-';
77
+ }
78
+ $html .= '</td>';
79
+
80
+ $html .= '<td><a href="';
81
+ $html .= admin_url( $post_url . '&type=' . esc_html( $row->type ) . '&schema_post_id=' . esc_html( $row->id ) ) . '">' . esc_html__( 'Edit', $this->text_domain );
82
+ $html .= '</a></td>';
83
+ $html .= '</tr>';
84
+ echo $html;
85
+ }
86
+ } else {
87
+ echo '<td colspan="5">' . esc_html__( 'Without registration.', $this->text_domain ) . '</td>';
88
+ }
89
+
90
+ $html = '</table>';
91
+ $html .= '</div>';
92
+ echo $html;
93
+ }
94
+
95
+ /**
96
+ * LIST Page HTML Render.
97
+ *
98
+ * @since 1.0.0
99
+ * @version 2.0.0
100
+ * @param string $obj
101
+ * @return string $output
102
+ */
103
+ private function unserialize_output ( $obj ) {
104
+ $output = implode( ",", unserialize( $obj ) );
105
+ return (string) $output;
106
+ }
107
+ }
trunk/includes/wp-structuring-admin-post.php ADDED
@@ -0,0 +1,240 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Schema.org Admin Post
4
+ *
5
+ * @author Kazuya Takami
6
+ * @since 1.0.0
7
+ * @version 2.1.0
8
+ */
9
+ class Structuring_Markup_Admin_Post {
10
+
11
+ /**
12
+ * Variable definition.
13
+ *
14
+ * @since 1.3.0
15
+ * @version 2.0.0
16
+ */
17
+ private $text_domain;
18
+ private $type_array;
19
+
20
+ /**
21
+ * Constructor Define.
22
+ *
23
+ * @since 1.0.0
24
+ * @version 2.0.0
25
+ * @param String $text_domain
26
+ */
27
+ public function __construct ( $text_domain ) {
28
+ $this->text_domain = $text_domain;
29
+
30
+ /**
31
+ * Update Status
32
+ *
33
+ * "ok" : Successful update
34
+ * "output" : Output No Check
35
+ */
36
+ $status = "";
37
+
38
+ /** DB Connect */
39
+ $db = new Structuring_Markup_Admin_Db();
40
+ $this->type_array = $db->type_array;
41
+
42
+ /** Set Default Parameter for Array */
43
+ $options = array(
44
+ "id" => "",
45
+ "type" => "",
46
+ "activate" => "",
47
+ "output" => array(),
48
+ "option" => array()
49
+ );
50
+
51
+ /** DataBase Update & Insert Mode */
52
+ if ( isset( $_POST['id'] ) && is_numeric( $_POST['id'] ) ) {
53
+ if ( isset( $_POST['output'] ) ) {
54
+ $options['id'] = $db->update_options( $_POST );
55
+ $status = "ok";
56
+ } else {
57
+ $status = "output";
58
+ }
59
+ }
60
+
61
+ /** Key Set */
62
+ if ( isset( $_GET['schema_post_id'] ) && is_numeric( $_GET['schema_post_id'] ) ) {
63
+ $options['id'] = esc_html( $_GET['schema_post_id'] );
64
+ }
65
+
66
+ /** Type Set */
67
+ if ( isset( $_GET['type'] ) && array_key_exists( $_GET['type'], $this->type_array) ) {
68
+ $options['type'] = esc_html( $_GET['type'] );
69
+ }
70
+
71
+ $options = $db->get_options( $options['id'] );
72
+
73
+ $this->page_render( $options, $status );
74
+ }
75
+
76
+ /**
77
+ * Setting Page of the Admin Screen.
78
+ *
79
+ * @since 1.0.0
80
+ * @version 2.1.0
81
+ * @param array $options
82
+ * @param string $status
83
+ */
84
+ private function page_render ( array $options, $status ) {
85
+ $html = '';
86
+ $html .= '<div class="wrap">';
87
+ $html .= '<h1>' . esc_html__( 'Schema.org Register', $this->text_domain );
88
+ $html .= '<span class="schema-admin-h1-span">[ Schema Type : ' . esc_html( $this->type_array[$options['type']] ) . ' ]</span>';
89
+ $html .= '</h1>';
90
+ switch ( $status ) {
91
+ case "ok":
92
+ $html .= $this->information_render();
93
+ break;
94
+ case "output":
95
+ $html .= $this->output_error_render();
96
+ break;
97
+ default:
98
+ break;
99
+ }
100
+ echo $html;
101
+
102
+ /** Output Page Select */
103
+ $html = '<hr>';
104
+ $html .= '<form method="post" action="">';
105
+ $html .= '<input type="hidden" name="id" value="' . esc_attr( $options['id'] ) . '">';
106
+ $html .= '<input type="hidden" name="type" value="' . esc_attr( $options['type'] ) . '">';
107
+ $html .= '<table class="schema-admin-table">';
108
+ $html .= '<tr><th>Activate : </th><td><label>';
109
+ $html .= '<input type="checkbox" name="activate" value="on"';
110
+ $html .= ( isset( $options['activate'] ) && $options['activate'] === "on" ) ? ' checked' : '';
111
+ $html .= '>Activate</label></td></tr>';
112
+ $html .= '<tr><th>' . esc_html__( 'Output Page', $this->text_domain ) . ' : </th><td>';
113
+ echo $html;
114
+
115
+ switch ( $options['type'] ) {
116
+ case 'article':
117
+ $html = $this->output_checkbox_render( $options['output'], "post", "Post", esc_html__( 'Post Page', $this->text_domain ) );
118
+ $html .= '</td></tr></table><hr>';
119
+ echo $html;
120
+
121
+ require_once ( plugin_dir_path( __FILE__ ) . 'wp-structuring-admin-type-article.php' );
122
+ new Structuring_Markup_Type_Article();
123
+ break;
124
+ case 'blog_posting':
125
+ $html = $this->output_checkbox_render( $options['output'], "post", "Post", esc_html__( 'Post Page', $this->text_domain ) );
126
+ $html .= '</td></tr></table><hr>';
127
+ echo $html;
128
+
129
+ require_once ( plugin_dir_path( __FILE__ ) . 'wp-structuring-admin-type-blog-posting.php' );
130
+ new Structuring_Markup_Type_Blog_Posting();
131
+ break;
132
+ case 'breadcrumb':
133
+ $html = $this->output_checkbox_render( $options['output'], "all", "All", esc_html__( 'All Page', $this->text_domain ) );
134
+ $html .= '</td></tr></table><hr>';
135
+ echo $html;
136
+
137
+ require_once ( plugin_dir_path( __FILE__ ) . 'wp-structuring-admin-type-breadcrumb.php' );
138
+ new Structuring_Markup_Type_Breadcrumb( $options['option'] );
139
+ break;
140
+ case 'event':
141
+ $html = $this->output_checkbox_render( $options['output'], "event", "Event Post", esc_html__( 'Event Post Page', $this->text_domain ) );
142
+ $html .= '</td></tr></table><hr>';
143
+ echo $html;
144
+
145
+ require_once ( plugin_dir_path( __FILE__ ) . 'wp-structuring-admin-type-event.php' );
146
+ new Structuring_Markup_Type_Event();
147
+ break;
148
+ case 'news_article':
149
+ $html = $this->output_checkbox_render( $options['output'], "post", "Post", esc_html__( 'Post Page', $this->text_domain ) );
150
+ $html .= '</td></tr></table><hr>';
151
+ echo $html;
152
+
153
+ require_once ( plugin_dir_path( __FILE__ ) . 'wp-structuring-admin-type-news-article.php' );
154
+ new Structuring_Markup_Type_NewsArticle();
155
+ break;
156
+ case 'organization':
157
+ $html = $this->output_checkbox_render( $options['output'], "all", "All", esc_html__( 'All Page', $this->text_domain ) );
158
+ $html .= $this->output_checkbox_render( $options['output'], "home", "Top", esc_html__( 'Top Page', $this->text_domain ) );
159
+ $html .= $this->output_checkbox_render( $options['output'], "post", "Post", esc_html__( 'Post Page', $this->text_domain ) );
160
+ $html .= $this->output_checkbox_render( $options['output'], "page", "Fixed", esc_html__( 'Fixed Page', $this->text_domain ) );
161
+ $html .= '</td></tr></table><hr>';
162
+ echo $html;
163
+
164
+ require_once ( plugin_dir_path( __FILE__ ) . 'wp-structuring-admin-type-organization.php' );
165
+ new Structuring_Markup_Type_Organization( $options['option'] );
166
+ break;
167
+ case 'website':
168
+ $html = $this->output_checkbox_render( $options['output'], "all", "All", esc_html__( 'All Page', $this->text_domain ) );
169
+ $html .= $this->output_checkbox_render( $options['output'], "home", "Top", esc_html__( 'Top Page', $this->text_domain ) );
170
+ $html .= $this->output_checkbox_render( $options['output'], "post", "Post", esc_html__( 'Post Page', $this->text_domain ) );
171
+ $html .= $this->output_checkbox_render( $options['output'], "page", "Fixed", esc_html__( 'Fixed Page', $this->text_domain ) );
172
+ $html .= '</td></tr></table><hr>';
173
+ echo $html;
174
+
175
+ require_once( plugin_dir_path( __FILE__ ) . 'wp-structuring-admin-type-website.php' );
176
+ new Structuring_Markup_Type_Website( $options['option'] );
177
+ break;
178
+ }
179
+
180
+ $html = '</form>';
181
+ $html .= '</div>';
182
+ echo $html;
183
+ }
184
+
185
+ /**
186
+ * CheckBox Build Render
187
+ *
188
+ * @since 1.0.0
189
+ * @version 2.0.0
190
+ * @param array $option['output']
191
+ * @param string $output
192
+ * @param string $value
193
+ * @param string $display
194
+ * @return string $html
195
+ */
196
+ private function output_checkbox_render ( array $option, $output, $value, $display ) {
197
+ $html = '<label>';
198
+ $html .= '<input type="checkbox" name="output[' . $output . ']" value="' . $value . '""';
199
+ $html .= isset( $option[$output] ) ? ' checked' : '';
200
+ $html .= '>' . $display . '</label>';
201
+
202
+ return (string) $html;
203
+ }
204
+
205
+ /**
206
+ * Information Message Render
207
+ *
208
+ * @since 1.0.0
209
+ * @version 2.0.0
210
+ * @return string $html
211
+ */
212
+ private function information_render () {
213
+ $html = '<div id="message" class="updated notice notice-success is-dismissible below-h2">';
214
+ $html .= '<p>Schema.org Information Update.</p>';
215
+ $html .= '<button type="button" class="notice-dismiss">';
216
+ $html .= '<span class="screen-reader-text">Dismiss this notice.</span>';
217
+ $html .= '</button>';
218
+ $html .= '</div>';
219
+
220
+ return (string) $html;
221
+ }
222
+
223
+ /**
224
+ * Error Message Render
225
+ *
226
+ * @since 1.0.0
227
+ * @version 2.0.0
228
+ * @return string $html
229
+ */
230
+ private function output_error_render () {
231
+ $html = '<div id="notice" class="notice notice-error is-dismissible below-h2">';
232
+ $html .= '<p>Output No Select.</p>';
233
+ $html .= '<button type="button" class="notice-dismiss">';
234
+ $html .= '<span class="screen-reader-text">Dismiss this notice.</span>';
235
+ $html .= '</button>';
236
+ $html .= '</div>';
237
+
238
+ return (string) $html;
239
+ }
240
+ }
trunk/includes/wp-structuring-admin-type-article.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Schema.org Type Article
4
+ *
5
+ * @author Kazuya Takami
6
+ * @version 1.1.0
7
+ * @since 1.1.0
8
+ * @see wp-structuring-admin-db.php
9
+ * @link http://schema.org/Article
10
+ * @link https://developers.google.com/structured-data/rich-snippets/articles
11
+ */
12
+ class Structuring_Markup_Type_Article {
13
+
14
+ /**
15
+ * Constructor Define.
16
+ *
17
+ * @since 1.1.0
18
+ */
19
+ public function __construct () {
20
+ $this->page_render();
21
+ }
22
+
23
+ /**
24
+ * Form Layout Render
25
+ *
26
+ * @since 1.1.0
27
+ */
28
+ private function page_render () {
29
+ $html = '<table class="schema-admin-table">';
30
+ $html .= '<caption>Basic Setting( Post Page Only )</caption>';
31
+ $html .= '<tr><th>headline :</th><td><small>Default : post_title</small></td></tr>';
32
+ $html .= '<tr><th>datePublished :</th><td><small>Default : get_the_time( DATE_ISO8601, ID )</small></td></tr>';
33
+ $html .= '<tr><th>author :</th><td><small>Default : get_the_author_meta( "display_name", author_ID )</small></td></tr>';
34
+ $html .= '<tr><th>image :</th><td><small>Default : thumbnail</small></td></tr>';
35
+ $html .= '<tr><th>description :</th><td><small>Default : post_excerpt</small></td></tr>';
36
+ $html .= '<tr><th>articleBody :</th><td><small>Default : post_content</small></td></tr>';
37
+ $html .= '</table>';
38
+ echo $html;
39
+
40
+ echo '<p>Setting Knowledge : <a href="https://developers.google.com/structured-data/rich-snippets/articles" target="_blank">https://developers.google.com/structured-data/rich-snippets/articles</a></p>';
41
+ submit_button();
42
+ }
43
+ }
trunk/includes/wp-structuring-admin-type-blog-posting.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Schema.org Type BlogPosting
4
+ *
5
+ * @author Kazuya Takami
6
+ * @version 1.2.0
7
+ * @since 1.2.0
8
+ * @see wp-structuring-admin-db.php
9
+ * @link http://schema.org/BlogPosting
10
+ * @link https://developers.google.com/structured-data/rich-snippets/articles
11
+ */
12
+ class Structuring_Markup_Type_Blog_Posting {
13
+
14
+ /**
15
+ * Constructor Define.
16
+ *
17
+ * @since 1.2.0
18
+ */
19
+ public function __construct () {
20
+ $this->page_render();
21
+ }
22
+
23
+ /**
24
+ * Form Layout Render
25
+ *
26
+ * @since 1.2.0
27
+ */
28
+ private function page_render () {
29
+ $html = '<table class="schema-admin-table">';
30
+ $html .= '<caption>Basic Setting( Post Page Only )</caption>';
31
+ $html .= '<tr><th>headline :</th><td><small>Default : post_title</small></td></tr>';
32
+ $html .= '<tr><th>datePublished :</th><td><small>Default : get_the_time( DATE_ISO8601, ID )</small></td></tr>';
33
+ $html .= '<tr><th>dateModified :</th><td><small>Default : get_the_modified_time( DATE_ISO8601, ID )</small></td></tr>';
34
+ $html .= '<tr><th>author :</th><td><small>Default : get_the_author_meta( "display_name", author_ID )</small></td></tr>';
35
+ $html .= '<tr><th>image :</th><td><small>Default : thumbnail</small></td></tr>';
36
+ $html .= '<tr><th>description :</th><td><small>Default : post_excerpt</small></td></tr>';
37
+ $html .= '<tr><th>articleBody :</th><td><small>Default : post_content</small></td></tr>';
38
+ $html .= '</table>';
39
+ echo $html;
40
+
41
+ echo '<p>Setting Knowledge : <a href="https://developers.google.com/structured-data/rich-snippets/articles" target="_blank">https://developers.google.com/structured-data/rich-snippets/articles</a></p>';
42
+ submit_button();
43
+ }
44
+ }
trunk/includes/wp-structuring-admin-type-breadcrumb.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Schema.org Type Breadcrumb
4
+ *
5
+ * @author Kazuya Takami
6
+ * @version 2.0.2
7
+ * @since 2.0.0
8
+ * @see wp-structuring-admin-db.php
9
+ * @link https://schema.org/BreadcrumbList
10
+ * @link https://developers.google.com/structured-data/breadcrumbs
11
+ */
12
+ class Structuring_Markup_Type_Breadcrumb {
13
+
14
+ /**
15
+ * Constructor Define.
16
+ *
17
+ * @since 2.0.0
18
+ * @param array $option
19
+ */
20
+ public function __construct ( array $option ) {
21
+ /** Default Value Set */
22
+ if ( empty( $option ) ) {
23
+ $option = $this->get_default_options( $option );
24
+ }
25
+ $this->page_render( $option );
26
+ }
27
+
28
+ /**
29
+ * Form Layout Render
30
+ *
31
+ * @since 2.0.0
32
+ * @param array $option
33
+ */
34
+ private function page_render ( array $option ) {
35
+ $html = '<table class="schema-admin-table">';
36
+ $html .= '<caption>Basic Setting</caption>';
37
+ $html .= '<tr><th><label for="home_on">Home Display :</label></th><td>';
38
+ $html .= '<input type="checkbox" name="option[' . "home_on" . ']" id="home_on" value="on"';
39
+ if ( isset( $option['home_on'] ) && $option['home_on'] === 'on' ) {
40
+ $html .= ' checked="checked"';
41
+ }
42
+ $html .= '>Active';
43
+ $html .= '<small>( Installed the HOME to breadcrumbs )</small>';
44
+ $html .= '</td></tr>';
45
+ $html .= '<tr><th><label for="home_name">Home Name :</label></th><td>';
46
+ $html .= '<input type="text" name="option[' . "home_name" . ']" id="home_name" class="regular-text" value="' . esc_attr( $option['home_name'] ) . '">';
47
+ $html .= '<small>Default : bloginfo("name")</small>';
48
+ $html .= '</td></tr>';
49
+ $html .= '</table>';
50
+ echo $html;
51
+
52
+ echo '<p>Setting Knowledge : <a href="https://developers.google.com/structured-data/slsb-overview" target="_blank">https://developers.google.com/structured-data/slsb-overview</a></p>';
53
+ submit_button();
54
+ }
55
+
56
+ /**
57
+ * Return the default options array
58
+ *
59
+ * @version 2.0.2
60
+ * @since 2.0.0
61
+ * @param array $args
62
+ * @return array $args
63
+ */
64
+ private function get_default_options ( array $args ) {
65
+ $args['home_on'] = '';
66
+ $args['home_name'] = '';
67
+
68
+ return (array) $args;
69
+ }
70
+ }
trunk/includes/wp-structuring-admin-type-event.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Schema.org Type Event
4
+ *
5
+ * @author Kazuya Takami
6
+ * @version 2.1.0
7
+ * @since 2.1.0
8
+ * @see wp-structuring-admin-db.php
9
+ * @link http://schema.org/Event
10
+ * @link http://schema.org/Place
11
+ * @link http://schema.org/Offer
12
+ * @link https://developers.google.com/structured-data/events/
13
+ * @link https://developers.google.com/structured-data/rich-snippets/events
14
+ */
15
+ class Structuring_Markup_Type_Event {
16
+
17
+ /**
18
+ * Constructor Define.
19
+ *
20
+ * @since 2.1.0
21
+ */
22
+ public function __construct () {
23
+ $this->page_render();
24
+ }
25
+
26
+ /**
27
+ * Form Layout Render
28
+ *
29
+ * @since 2.1.0
30
+ */
31
+ private function page_render () {
32
+ $html = '<table class="schema-admin-table">';
33
+ $html .= '<caption>Basic Setting</caption>';
34
+ $html .= '<tr><th>name :</th><td><small>Input a custom post: field name "schema_event_name"</small></td></tr>';
35
+ $html .= '<tr><th>startDate :</th><td><small>Input a custom post: field name "schema_event_date" & "schema_event_time"</small></td></tr>';
36
+ $html .= '<tr><th>url :</th><td><small>Input a custom post: field name "schema_event_url"</small></td></tr>';
37
+ $html .= '</table>';
38
+ echo $html;
39
+
40
+ $html = '<table class="schema-admin-table">';
41
+ $html .= '<caption>Location Type "Place" Setting</caption>';
42
+ $html .= '<tr><th>name :</th><td><small>Input a custom post: field name "schema_event_place_name"</small></td></tr>';
43
+ $html .= '<tr><th>url(sameAs) :</th><td><small>Input a custom post: field name "schema_event_place_url"</small></td></tr>';
44
+ $html .= '<tr><th>address :</th><td><small>Input a custom post: field name "schema_event_place_address"</small></td></tr>';
45
+ $html .= '</table>';
46
+ echo $html;
47
+
48
+ $html = '<table class="schema-admin-table">';
49
+ $html .= '<caption>Location Type "Offers" Setting</caption>';
50
+ $html .= '<tr><th>price :</th><td><small>Input a custom post: field name "schema_event_place_name"</small></td></tr>';
51
+ $html .= '<tr><th>priceCurrency :</th><td><small>Input a custom post: field name "schema_event_place_address"</small></td></tr>';
52
+ $html .= '<tr><th>url :</th><td><small>Input a custom post: field name "schema_event_place_url"</small></td></tr>';
53
+ $html .= '</table>';
54
+ echo $html;
55
+
56
+ echo '<p>Custom post name "schema_event_post"</p>';
57
+ echo '<p>Setting Knowledge : <a href="https://developers.google.com/structured-data/rich-snippets/events" target="_blank">https://developers.google.com/structured-data/rich-snippets/events</a></p>';
58
+
59
+ submit_button();
60
+ }
61
+ }
trunk/includes/wp-structuring-admin-type-news-article.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Schema.org Type News Article
4
+ *
5
+ * @author Kazuya Takami
6
+ * @version 1.0.0
7
+ * @since 1.0.0
8
+ * @see wp-structuring-admin-db.php
9
+ * @link http://schema.org/NewsArticle
10
+ * @link https://developers.google.com/structured-data/rich-snippets/articles
11
+ */
12
+ class Structuring_Markup_Type_NewsArticle {
13
+
14
+ /**
15
+ * Constructor Define.
16
+ *
17
+ * @since 1.0.0
18
+ */
19
+ public function __construct () {
20
+ $this->page_render();
21
+ }
22
+
23
+ /**
24
+ * Form Layout Render
25
+ *
26
+ * @since 1.0.0
27
+ */
28
+ private function page_render () {
29
+ $html = '<table class="schema-admin-table">';
30
+ $html .= '<caption>Basic Setting( Post Page Only )</caption>';
31
+ $html .= '<tr><th>headline :</th><td><small>Default : post_title</small></td></tr>';
32
+ $html .= '<tr><th>datePublished :</th><td><small>Default : get_the_time( DATE_ISO8601, ID )</small></td></tr>';
33
+ $html .= '<tr><th>image :</th><td><small>Default : thumbnail</small></td></tr>';
34
+ $html .= '<tr><th>description :</th><td><small>Default : post_excerpt</small></td></tr>';
35
+ $html .= '<tr><th>articleBody :</th><td><small>Default : post_content</small></td></tr>';
36
+ $html .= '</table>';
37
+ echo $html;
38
+
39
+ echo '<p>Setting Knowledge : <a href="https://developers.google.com/structured-data/rich-snippets/articles" target="_blank">https://developers.google.com/structured-data/rich-snippets/articles</a></p>';
40
+ submit_button();
41
+ }
42
+ }
trunk/includes/wp-structuring-admin-type-organization.php ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Schema.org Type Organization
4
+ *
5
+ * @author Kazuya Takami
6
+ * @version 1.0.0
7
+ * @since 1.0.0
8
+ * @see wp-structuring-admin-db.php
9
+ * @link https://schema.org/Organization
10
+ * @link https://developers.google.com/structured-data/customize/overview
11
+ * @link https://developers.google.com/structured-data/customize/logos
12
+ * @link https://developers.google.com/structured-data/customize/contact-points
13
+ * @link https://developers.google.com/structured-data/customize/social-profiles
14
+ */
15
+ class Structuring_Markup_Type_Organization {
16
+
17
+ /** contactType defined. */
18
+ private $contact_type_array = array(
19
+ array("type" => "customer_support", "display" => "customer support"),
20
+ array("type" => "technical_support", "display" => "technical support"),
21
+ array("type" => "billing_support", "display" => "billing support"),
22
+ array("type" => "bill_payment", "display" => "bill payment"),
23
+ array("type" => "sales", "display" => "sales"),
24
+ array("type" => "reservations", "display" => "reservations"),
25
+ array("type" => "credit_card_support", "display" => "credit card support"),
26
+ array("type" => "emergency", "display" => "emergency"),
27
+ array("type" => "baggage_tracking", "display" => "baggage tracking"),
28
+ array("type" => "roadside_assistance", "display" => "roadside assistance"),
29
+ array("type" => "package_tracking", "display" => "package tracking")
30
+ );
31
+ /** Social Profile */
32
+ private $social_array = array(
33
+ array("type" => "facebook", "display" => "Facebook"),
34
+ array("type" => "twitter", "display" => "Twitter"),
35
+ array("type" => "google", "display" => "Google+"),
36
+ array("type" => "instagram", "display" => "Instagram"),
37
+ array("type" => "youtube", "display" => "Youtube"),
38
+ array("type" => "linkedin", "display" => "LinkedIn"),
39
+ array("type" => "myspace", "display" => "Myspace"),
40
+ array("type" => "pinterest", "display" => "Pinterest"),
41
+ array("type" => "soundcloud", "display" => "SoundCloud"),
42
+ array("type" => "tumblr", "display" => "Tumblr")
43
+ );
44
+
45
+ /**
46
+ * Constructor Define.
47
+ *
48
+ * @since 1.0.0
49
+ * @param array $option
50
+ */
51
+ public function __construct ( array $option ) {
52
+ /** Default Value Set */
53
+ if ( empty( $option ) ) {
54
+ $option = $this->get_default_options( $option );
55
+ }
56
+ $this->page_render( $option );
57
+ }
58
+
59
+ /**
60
+ * Form Layout Render
61
+ *
62
+ * @since 1.0.0
63
+ * @param array $option
64
+ */
65
+ private function page_render ( array $option ) {
66
+ /** Logos */
67
+ $html = '<table class="schema-admin-table">';
68
+ $html .= '<caption>Logos</caption>';
69
+ $html .= '<tr><th><label for="name">Organization Name :</label></th><td>';
70
+ $html .= '<input type="text" name="option[' . "name" . ']" id="name" class="regular-text" required value="' . esc_attr( $option['name'] ) . '">';
71
+ $html .= '<small>Default : bloginfo("name")</small>';
72
+ $html .= '</td></tr>';
73
+ $html .= '<tr><th><label for="url">url :</label></th><td>';
74
+ $html .= '<input type="text" name="option[' . "url" . ']" id="url" class="regular-text" required value="' . esc_attr( $option['url'] ) . '">';
75
+ $html .= '<small>Default : bloginfo("url")</small>';
76
+ $html .= '</td></tr>';
77
+ $html .= '<tr><th><label for="logo">logo :</label></th><td>';
78
+ $html .= '<input type="text" name="option[' . "logo" . ']" id="logo" class="regular-text" required value="' . esc_attr( $option['logo'] ) . '">';
79
+ $html .= '<small>Default : bloginfo("logo") + "/images/logo.png"</small>';
80
+ $html .= '</td></tr>';
81
+ $html .= '</table>';
82
+ echo $html;
83
+
84
+ /** Corporate Contact */
85
+ $html = '<table class="schema-admin-table">';
86
+ $html .= '<caption>Corporate Contact</caption>';
87
+ $html .= '<tr><th><label for="contact_point">contactPoint :</label></th><td>';
88
+ $html .= '<input type="checkbox" name="option[' . "contact_point" . ']" id="contact_point" value="on"';
89
+ if ( isset( $option['contact_point'] ) && $option['contact_point'] === 'on' ) {
90
+ $html .= ' checked="checked"';
91
+ }
92
+ $html .= '>Active';
93
+ $html .= '</td></tr>';
94
+ $html .= '<tr><th><label for="telephone">telephone :</label></th><td>';
95
+ $html .= '<input type="text" name="option[' . "telephone" . ']" id="telephone" class="regular-text" value="' . esc_attr( $option['telephone'] ) . '">';
96
+ $html .= '<small>Default : +1-880-555-1212</small>';
97
+ $html .= '</td></tr>';
98
+ $html .= '<tr><th><label for="contact_type">contactType :</label></th><td>';
99
+ $html .= '<select id="contact_type" name="option[' . "contact_type" . ']">';
100
+ foreach ( $this->contact_type_array as $value ) {
101
+ $html .= '<option value="' . $value['type'] . '"';
102
+ if ( $value['type'] === $option['contact_type'] ) {
103
+ $html .= ' selected';
104
+ }
105
+ $html .= '>' . $value['display'] . '</option>';
106
+ }
107
+ $html .= '</select>';
108
+ $html .= '<small>Default : "customer support"</small>';
109
+ $html .= '</td></tr>';
110
+ $html .= '<tr><th><label for="area_served">areaServed :</label></th><td>';
111
+ $html .= '<input type="text" name="option[' . "area_served" . ']" id="area_served" class="regular-text" value="' . esc_attr( $option['area_served'] ) . '">';
112
+ $html .= '<small>Default : "US"&nbsp;&nbsp;Multiple : "US,CA"</small>';
113
+ $html .= '</td></tr>';
114
+ $html .= '<tr><th>contactOption :</th><td>';
115
+ $html .= '<label><input type="checkbox" name="option[' . "contact_point_1" . ']" id="contact_point_1" value="on"';
116
+ if ( isset( $option['contact_point_1'] ) && $option['contact_point_1'] === 'on' ) {
117
+ $html .= ' checked="checked"';
118
+ }
119
+ $html .= '>HearingImpairedSupported</label><br>';
120
+ $html .= '<label><input type="checkbox" name="option[' . "contact_point_2" . ']" id="contact_point_2" value="on"';
121
+ if ( isset( $option['contact_point_2'] ) && $option['contact_point_2'] === 'on' ) {
122
+ $html .= ' checked="checked"';
123
+ }
124
+ $html .= '>TollFree</label><br>';
125
+ $html .= '</td></tr>';
126
+ $html .= '<tr><th><label for="available_language">available<br>Language :</label></th><td>';
127
+ $html .= '<input type="text" name="option[' . "available_language" . ']" id="available_language" class="regular-text" value="' . esc_attr( $option['available_language'] ) . '">';
128
+ $html .= '<small>Default : "English"&nbsp;&nbsp;Multiple : "French,English"</small>';
129
+ $html .= '</td></tr>';
130
+ $html .= '</table>';
131
+ echo $html;
132
+
133
+ /** Social Profiles */
134
+ $html = '<table class="schema-admin-table">';
135
+ $html .= '<caption>Social Profiles</caption>';
136
+ foreach ( $this->social_array as $value ) {
137
+ $html .= '<tr><th><label for="' . $value['type'] . '">' . $value['display'] . ' :</label></th><td>';
138
+ $html .= '<input type="text" name="option[' . "social" . '][' . $value['type'] . ']" id="' . $value['type'] . '" class="regular-text" value="' . esc_attr( $option['social'][$value['type']] ) . '">';
139
+ $html .= '</td></tr>';
140
+ }
141
+ $html .= '</table>';
142
+ echo $html;
143
+
144
+ echo '<p>Setting Knowledge : <a href="https://developers.google.com/structured-data/customize/overview" target="_blank">https://developers.google.com/structured-data/customize/overview</a></p>';
145
+ submit_button();
146
+ }
147
+
148
+ /**
149
+ * Return the default options array
150
+ *
151
+ * @since 1.0.0
152
+ * @version 2.0.0
153
+ * @param array $args
154
+ * @return array $args
155
+ */
156
+ private function get_default_options ( array $args ) {
157
+ $args['name'] = get_bloginfo('name');
158
+ $args['url'] = get_bloginfo('url');
159
+ $args['logo'] = get_bloginfo('url') . '/images/logo.png';
160
+ $args['contact_point'] = '';
161
+ $args['telephone'] = '+1-880-555-1212';
162
+ $args['contact_type'] = 'customer_support';
163
+ $args['area_served'] = 'US';
164
+ $args['contact_option_1'] = '';
165
+ $args['contact_option_2'] = '';
166
+ $args['available_language'] = 'English';
167
+
168
+ foreach ( $this->social_array as $value ) {
169
+ $args['social'][$value['type']] = '';
170
+ }
171
+
172
+ return (array) $args;
173
+ }
174
+ }
trunk/includes/wp-structuring-admin-type-website.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Schema.org Type WebSite
4
+ *
5
+ * @author Kazuya Takami
6
+ * @version 1.0.0
7
+ * @since 1.0.0
8
+ * @see wp-structuring-admin-db.php
9
+ * @link https://schema.org/WebSite
10
+ * @link https://developers.google.com/structured-data/slsb-overview
11
+ * @link https://developers.google.com/structured-data/site-name
12
+ */
13
+ class Structuring_Markup_Type_Website {
14
+
15
+ /**
16
+ * Constructor Define.
17
+ *
18
+ * @since 1.0.0
19
+ * @param array $option
20
+ */
21
+ public function __construct ( array $option ) {
22
+ /** Default Value Set */
23
+ if ( empty( $option ) ) {
24
+ $option = $this->get_default_options( $option );
25
+ }
26
+ $this->page_render( $option );
27
+ }
28
+
29
+ /**
30
+ * Form Layout Render
31
+ *
32
+ * @since 1.0.0
33
+ * @param array $option
34
+ */
35
+ private function page_render ( array $option ) {
36
+ $html = '<table class="schema-admin-table">';
37
+ $html .= '<caption>Basic Setting</caption>';
38
+ $html .= '<tr><th><label for="name">name :</label></th><td>';
39
+ $html .= '<input type="text" name="option[' . "name" . ']" id="name" class="regular-text" required value="' . esc_attr( $option['name'] ) . '">';
40
+ $html .= '<small>Default : bloginfo("name")</small>';
41
+ $html .= '</td></tr>';
42
+ $html .= '<tr><th><label for="alternateName">alternateName :</label></th><td>';
43
+ $html .= '<input type="text" name="option[' . "alternateName" . ']" id="alternateName" class="regular-text" value="' . esc_attr( $option['alternateName'] ) . '">';
44
+ $html .= '<small>Default : bloginfo("name")</small>';
45
+ $html .= '</td></tr>';
46
+ $html .= '<tr><th><label for="url">url :</label></th><td>';
47
+ $html .= '<input type="text" name="option[' . "url" . ']" id="url" class="regular-text" required value="' . esc_attr( $option['url'] ) . '">';
48
+ $html .= '<small>Default : bloginfo("url")</small>';
49
+ $html .= '</td></tr>';
50
+ $html .= '</table>';
51
+ echo $html;
52
+
53
+ $html = '<table class="schema-admin-table">';
54
+ $html .= '<caption>Sitelink Search Box</caption>';
55
+ $html .= '<tr><th><label for="potential_action">potentialAction Active :</label></th><td>';
56
+ $html .= '<input type="checkbox" name="option[' . "potential_action" . ']" id="potential_action" value="on"';
57
+ if ( isset( $option['potential_action'] ) && $option['potential_action'] === 'on' ) {
58
+ $html .= ' checked="checked"';
59
+ }
60
+ $html .= '>Active';
61
+ $html .= '</td></tr>';
62
+ $html .= '<tr><th><label for="target">target :</label></th><td>';
63
+ $html .= '<input type="text" name="option[' . "target" . ']" id="target" class="regular-text" value="' . esc_attr( $option['target'] ) . '">';
64
+ $html .= '<small>Default : bloginfo("url") + /?s=</small>';
65
+ $html .= '</td></tr>';
66
+ $html .= '</table>';
67
+ echo $html;
68
+
69
+ echo '<p>Setting Knowledge : <a href="https://developers.google.com/structured-data/slsb-overview" target="_blank">https://developers.google.com/structured-data/slsb-overview</a></p>';
70
+ submit_button();
71
+ }
72
+
73
+ /**
74
+ * Return the default options array
75
+ *
76
+ * @since 1.0.0
77
+ * @version 2.0.0
78
+ * @param array $args
79
+ * @return array $args
80
+ */
81
+ private function get_default_options ( array $args ) {
82
+ $args['name'] = get_bloginfo('name');
83
+ $args['alternateName'] = $args['name'];
84
+ $args['url'] = get_bloginfo('url');
85
+ $args['potential_action'] = '';
86
+ $args['target'] = $args['url'] . '/?s=';
87
+
88
+ return (array) $args;
89
+ }
90
+ }
trunk/includes/wp-structuring-custom-post-event.php ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Schema.org Custom Post "Event"
4
+ *
5
+ * @author Kazuya Takami
6
+ * @since 2.1.0
7
+ * @version 2.1.0
8
+ */
9
+ class Structuring_Markup_Custom_Post_Event {
10
+
11
+ /**
12
+ * Variable definition.
13
+ *
14
+ * @since 2.1.0
15
+ * @version 2.1.0
16
+ */
17
+ private $text_domain;
18
+ private $custom_type = 'schema_event_post';
19
+
20
+ /**
21
+ * Constructor Define.
22
+ *
23
+ * @since 2.1.0
24
+ * @version 2.1.0
25
+ * @param String $text_domain
26
+ */
27
+ public function __construct ( $text_domain ) {
28
+ $this->text_domain = $text_domain;
29
+
30
+ register_post_type(
31
+ $this->custom_type,
32
+ array(
33
+ 'labels' => array(
34
+ 'name' => esc_html__( 'Event Posts', $this->text_domain ),
35
+ 'singular_name' => esc_html__( 'Event Posts', $this->text_domain )
36
+ ),
37
+ 'public' => true,
38
+ 'menu_position' => 5,
39
+ 'has_archive' => true,
40
+ 'supports' => array( 'title', 'editor', 'author', 'thumbnail' ),
41
+ 'rewrite' => array( 'slug' => 'events' ),
42
+ )
43
+ );
44
+
45
+ if ( is_admin() ) {
46
+ add_action( 'admin_init', array( $this, 'admin_init' ) );
47
+ add_action( 'admin_menu', array( $this, 'admin_menu' ) );
48
+ }
49
+ }
50
+
51
+ /**
52
+ * admin init.
53
+ *
54
+ * @since 2.1.0
55
+ * @version 2.1.0
56
+ */
57
+ public function admin_init () {
58
+ add_action( 'save_post_' . $this->custom_type, array( $this, 'save_post' ) );
59
+ }
60
+
61
+ /**
62
+ * admin meta boxes.
63
+ *
64
+ * @since 2.1.0
65
+ * @version 2.1.0
66
+ */
67
+ public function admin_menu () {
68
+ $custom_field_title = esc_html__( 'Schema.org Type Event', $this->text_domain );
69
+ add_meta_box( $this->custom_type, $custom_field_title, array( $this, 'set_custom_fields' ), $this->custom_type, 'normal' );
70
+ }
71
+
72
+ /**
73
+ * Set custom fields.
74
+ *
75
+ * @since 2.1.0
76
+ * @version 2.1.0
77
+ */
78
+ public function set_custom_fields () {
79
+ $args = get_post_meta( get_the_ID(), $this->custom_type, false );
80
+ $args = isset( $args[0] ) ? unserialize( $args[0] ) : "";
81
+
82
+ if ( !isset( $args['schema_event_name'] ) ) $args['schema_event_name'] = '';
83
+ if ( !isset( $args['schema_event_date'] ) ) $args['schema_event_date'] = date( 'Y-m-d' );
84
+ if ( !isset( $args['schema_event_time'] ) ) $args['schema_event_time'] = date( 'h:i' );
85
+ if ( !isset( $args['schema_event_url'] ) ) $args['schema_event_url'] = '';
86
+ if ( !isset( $args['schema_event_place_name'] ) ) $args['schema_event_place_name'] = '';
87
+ if ( !isset( $args['schema_event_place_url'] ) ) $args['schema_event_place_url'] = '';
88
+ if ( !isset( $args['schema_event_place_address'] ) ) $args['schema_event_place_address'] = '';
89
+ if ( !isset( $args['schema_event_offers_price'] ) ) $args['schema_event_offers_price'] = 0;
90
+ if ( !isset( $args['schema_event_offers_currency'] ) ) $args['schema_event_offers_currency'] = esc_html__( 'USD', $this->text_domain );
91
+
92
+ $html = '';
93
+ $html .= '<table>';
94
+ $html .= '<tr><th><label for="schema_event_name">';
95
+ $html .= esc_html__( 'Event Name', $this->text_domain );
96
+ $html .= '</label></th><td>';
97
+ $html .= '<input type="text" name="option[' . "schema_event_name" . ']" id="schema_event_name" class="regular-text" required value="' . esc_attr( $args['schema_event_name'] ) . '">';
98
+ $html .= '</td></tr>';
99
+ $html .= '<tr><th><label for="schema_event_date">';
100
+ $html .= esc_html__( 'Start Date', $this->text_domain );
101
+ $html .= '</label></th><td>';
102
+ $html .= '<input type="date" name="option[' . "schema_event_date" . ']" id="schema_event_date" required value="' . esc_attr( $args['schema_event_date'] ) . '">';
103
+ $html .= '<input type="time" name="option[' . "schema_event_time" . ']" id="schema_event_time" required value="' . esc_attr( $args['schema_event_time'] ) . '">';
104
+ $html .= '</td></tr>';
105
+ $html .= '<tr><th><label for="schema_event_url">';
106
+ $html .= esc_html__( 'Event URL', $this->text_domain );
107
+ $html .= '</label></th><td>';
108
+ $html .= '<input type="text" name="option[' . "schema_event_url" . ']" id="schema_event_url" class="regular-text" required value="' . esc_attr( $args['schema_event_url'] ) . '">';
109
+ $html .= '</td></tr>';
110
+ $html .= '<tr><th><label for="schema_event_place_name">';
111
+ $html .= esc_html__( 'Place Name', $this->text_domain );
112
+ $html .= '</label></th><td>';
113
+ $html .= '<input type="text" name="option[' . "schema_event_place_name" . ']" id="schema_event_place_name" class="regular-text" required value="' . esc_attr( $args['schema_event_place_name'] ) . '">';
114
+ $html .= '</td></tr>';
115
+ $html .= '<tr><th><label for="schema_event_place_url">';
116
+ $html .= esc_html__( 'Place URL', $this->text_domain );
117
+ $html .= '</label></th><td>';
118
+ $html .= '<input type="text" name="option[' . "schema_event_place_url" . ']" id="schema_event_place_url" class="regular-text" required value="' . esc_attr( $args['schema_event_place_url'] ) . '">';
119
+ $html .= '</td></tr>';
120
+ $html .= '<tr><th><label for="schema_event_place_address">';
121
+ $html .= esc_html__( 'Place Address', $this->text_domain );
122
+ $html .= '</label></th><td>';
123
+ $html .= '<input type="text" name="option[' . "schema_event_place_address" . ']" id="schema_event_place_address" class="regular-text" required value="' . esc_attr( $args['schema_event_place_address'] ) . '">';
124
+ $html .= '</td></tr>';
125
+ $html .= '<tr><th><label for="schema_event_offers_price">';
126
+ $html .= esc_html__( 'Price', $this->text_domain );
127
+ $html .= '</label></th><td>';
128
+ $html .= '<input type="number" name="option[' . "schema_event_offers_price" . ']" id="schema_event_offers_price" required value="' . esc_attr( $args['schema_event_offers_price'] ) . '">';
129
+ $html .= '</td></tr>';
130
+ $html .= '<tr><th><label for="schema_event_offers_currency">';
131
+ $html .= esc_html__( 'Currency', $this->text_domain );
132
+ $html .= '</label></th><td>';
133
+ $html .= '<input type="text" name="option[' . "schema_event_offers_currency" . ']" id="schema_event_offers_currency" maxlength="3" required value="' . esc_attr( $args['schema_event_offers_currency'] ) . '">';
134
+ $html .= '&nbsp;&nbsp;<small>( with <a hre="https://en.wikipedia.org/wiki/ISO_4217#Active_codes" target="_blank">ISO 4217 codes</a> e.g. "USD" )</small>';
135
+ $html .= '</td></tr>';
136
+ $html .= '</table>';
137
+
138
+ echo $html;
139
+ }
140
+
141
+ /**
142
+ * Save custom post.
143
+ *
144
+ * @since 2.1.0
145
+ * @version 2.1.0
146
+ * @param integer $post_id The post ID.
147
+ */
148
+ public function save_post ( $post_id ) {
149
+ if ( isset( $_POST['option'] ) ) {
150
+ update_post_meta( $post_id, $this->custom_type, serialize( $_POST['option'] ) );
151
+ }
152
+ }
153
+ }
trunk/includes/wp-structuring-display.php ADDED
@@ -0,0 +1,341 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Schema.org Display
4
+ *
5
+ * @author Kazuya Takami
6
+ * @version 2.1.0
7
+ * @since 1.0.0
8
+ */
9
+ class Structuring_Markup_Display {
10
+
11
+ /**
12
+ * Constructor Define.
13
+ *
14
+ * @since 1.0.0
15
+ */
16
+ public function __construct () {
17
+ $db = new Structuring_Markup_Admin_Db();
18
+ $this->set_schema( $db );
19
+ }
20
+
21
+ /**
22
+ * Setting schema.org
23
+ *
24
+ * @since 1.0.0
25
+ * @version 2.1.0
26
+ * @param Structuring_Markup_Admin_Db $db
27
+ */
28
+ private function set_schema ( Structuring_Markup_Admin_Db $db ) {
29
+ echo '<!-- Markup (JSON-LD) structured in schema.org START -->' . PHP_EOL;
30
+ $this->get_schema_data( $db, 'all' );
31
+ if ( is_home() ) {
32
+ $this->get_schema_data( $db, 'home' );
33
+ }
34
+ if ( is_single() && get_post_type() === 'post' ) {
35
+ $this->get_schema_data( $db, 'post' );
36
+ }
37
+ if ( is_singular( 'schema_event_post' ) ) {
38
+ $this->get_schema_data( $db, 'event' );
39
+ }
40
+ if ( is_page() ) {
41
+ $this->get_schema_data( $db, 'page' );
42
+ }
43
+ echo '<!-- Markup (JSON-LD) structured in schema.org END -->' . PHP_EOL;
44
+ }
45
+
46
+ /**
47
+ * Setting JSON-LD Template
48
+ *
49
+ * @since 1.0.0
50
+ * @version 2.1.0
51
+ * @param Structuring_Markup_Admin_Db $db
52
+ * @param string $output
53
+ */
54
+ private function get_schema_data ( Structuring_Markup_Admin_Db $db, $output ) {
55
+ $results = $db->get_select_options( $output );
56
+
57
+ if ( isset( $results ) ) {
58
+ foreach ( $results as $row ) {
59
+ if ( isset( $row->type ) && isset( $row->activate ) && $row->activate === 'on' ) {
60
+ switch ( $row->type ) {
61
+ case 'article':
62
+ $this->set_schema_article();
63
+ break;
64
+ case 'blog_posting':
65
+ $this->set_schema_blog_posting();
66
+ break;
67
+ case 'breadcrumb':
68
+ if ( isset( $row->options ) ) {
69
+ $this->set_schema_breadcrumb(unserialize($row->options));
70
+ }
71
+ break;
72
+ case 'event':
73
+ $this->set_schema_event();
74
+ break;
75
+ case 'news_article':
76
+ $this->set_schema_news_article();
77
+ break;
78
+ case 'organization':
79
+ if ( isset( $row->options ) ) {
80
+ $this->set_schema_organization( unserialize( $row->options ) );
81
+ }
82
+ break;
83
+ case 'website':
84
+ if ( isset( $row->options ) ) {
85
+ $this->set_schema_website( unserialize( $row->options ) );
86
+ }
87
+ break;
88
+ }
89
+ }
90
+ }
91
+ }
92
+ }
93
+
94
+ /**
95
+ * Setting JSON-LD Template
96
+ *
97
+ * @since 1.0.0
98
+ * @param array $args
99
+ */
100
+ private function set_schema_json ( array $args ) {
101
+ echo '<script type="application/ld+json">' , PHP_EOL;
102
+ echo json_encode( $args, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT ) , PHP_EOL;
103
+ echo '</script>' , PHP_EOL;
104
+ }
105
+
106
+ /**
107
+ * Setting JSON-LD Template
108
+ *
109
+ * @since 1.1.3
110
+ * @version 2.0.0
111
+ * @param string $text
112
+ * @return string $text
113
+ */
114
+ private function escape_text_tags ( $text ) {
115
+ return (string) str_replace( array( "\r", "\n" ), '', strip_tags( $text ) );
116
+ }
117
+
118
+ /**
119
+ * Setting schema.org Article
120
+ *
121
+ * @since 1.1.0
122
+ * @version 1.1.3
123
+ */
124
+ private function set_schema_article () {
125
+ global $post;
126
+ if ( has_post_thumbnail( $post->ID ) ) {
127
+ $images = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
128
+ $args = array(
129
+ "@context" => "http://schema.org",
130
+ "@type" => "Article",
131
+ "headline" => $this->escape_text_tags( $post->post_title ),
132
+ "datePublished" => get_the_time( DATE_ISO8601, $post->ID ),
133
+ "author" => $this->escape_text_tags( get_the_author_meta( 'display_name', $post->post_author ) ),
134
+ "image" => array( $images[0] ),
135
+ "description" => $this->escape_text_tags( $post->post_excerpt ),
136
+ "articleBody" => $this->escape_text_tags( $post->post_content )
137
+ );
138
+ $this->set_schema_json( $args );
139
+ }
140
+ }
141
+
142
+ /**
143
+ * Setting schema.org BlogPosting
144
+ *
145
+ * @since 1.2.0
146
+ * @version 1.2.0
147
+ */
148
+ private function set_schema_blog_posting () {
149
+ global $post;
150
+ if ( has_post_thumbnail( $post->ID ) ) {
151
+ $images = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
152
+ $args = array(
153
+ "@context" => "http://schema.org",
154
+ "@type" => "BlogPosting",
155
+ "headline" => $this->escape_text_tags( $post->post_title ),
156
+ "datePublished" => get_the_time( DATE_ISO8601, $post->ID ),
157
+ "dateModified" => get_the_modified_time( DATE_ISO8601, $post->ID ),
158
+ "author" => $this->escape_text_tags( get_the_author_meta( 'display_name', $post->post_author ) ),
159
+ "image" => array( $images[0] ),
160
+ "description" => $this->escape_text_tags( $post->post_excerpt ),
161
+ "articleBody" => $this->escape_text_tags( $post->post_content )
162
+ );
163
+ $this->set_schema_json( $args );
164
+ }
165
+ }
166
+
167
+ /**
168
+ * Setting schema.org Breadcrumb
169
+ *
170
+ * @since 2.0.0
171
+ * @version 2.0.0
172
+ * @param array $options
173
+ */
174
+ private function set_schema_breadcrumb ( array $options ) {
175
+ require_once( plugin_dir_path( __FILE__ ) . 'wp-structuring-short-code-breadcrumb.php' );
176
+ $obj = new Structuring_Markup_ShortCode_Breadcrumb();
177
+ $item_array = $obj->breadcrumb_array_setting( $options );
178
+
179
+ if ( $item_array ) {
180
+ /** itemListElement build */
181
+ $item_list_element = array();
182
+ $position = 1;
183
+ foreach ($item_array as $item) {
184
+ $item_list_element[] = array(
185
+ "@type" => "ListItem",
186
+ "position" => $position,
187
+ "item" => $item
188
+ );
189
+ $position++;
190
+ }
191
+
192
+ /** Breadcrumb Schema build */
193
+ $args = array(
194
+ "@context" => "http://schema.org",
195
+ "@type" => "BreadcrumbList",
196
+ "itemListElement" => $item_list_element
197
+ );
198
+
199
+ $this->set_schema_json($args);
200
+ }
201
+ }
202
+
203
+ /**
204
+ * Setting schema.org Event
205
+ *
206
+ * @since 2.1.0
207
+ * @version 2.1.0
208
+ */
209
+ private function set_schema_event () {
210
+ global $post;
211
+ $meta = get_post_meta( $post->ID, 'schema_event_post', false );
212
+
213
+ if ( isset( $meta[0] ) ) {
214
+ $meta = unserialize( $meta[0] );
215
+
216
+ if ( !isset( $meta['schema_event_name']) ) $meta['schema_event_name'] = '';
217
+ if ( !isset( $meta['schema_event_date']) ) $meta['schema_event_date'] = date('Y-m-d');
218
+ if ( !isset( $meta['schema_event_time']) ) $meta['schema_event_time'] = date('h:i');
219
+ if ( !isset( $meta['schema_event_url']) ) $meta['schema_event_url'] = '';
220
+ if ( !isset( $meta['schema_event_place_name'] ) ) $meta['schema_event_place_name'] = '';
221
+ if ( !isset( $meta['schema_event_place_url'] ) ) $meta['schema_event_place_url'] = '';
222
+ if ( !isset( $meta['schema_event_place_address'] ) ) $meta['schema_event_place_address'] = '';
223
+ if ( !isset( $meta['schema_event_offers_price'] ) ) $meta['schema_event_offers_price'] = 0;
224
+ if ( !isset( $meta['schema_event_offers_currency'] ) ) $meta['schema_event_offers_currency'] = '';
225
+
226
+ $args = array(
227
+ "@context" => "http://schema.org",
228
+ "@type" => "Event",
229
+ "name" => $this->escape_text_tags( $meta['schema_event_name'] ),
230
+ "startDate" => $this->escape_text_tags( $meta['schema_event_date'] ) . 'T' . $this->escape_text_tags( $meta['schema_event_time'] ),
231
+ "url" => esc_url( $meta['schema_event_url'] ),
232
+ "location" => array(
233
+ "@type" => "Place",
234
+ "sameAs" => esc_url( $meta['schema_event_place_url'] ),
235
+ "name" => $this->escape_text_tags( $meta['schema_event_place_name'] ),
236
+ "address" => $this->escape_text_tags( $meta['schema_event_place_address'] )
237
+ ),
238
+ "offers" => array(
239
+ "@type" => "Offer",
240
+ "price" => $this->escape_text_tags( $meta['schema_event_offers_price'] ),
241
+ "priceCurrency" => $this->escape_text_tags( $meta['schema_event_offers_currency'] ),
242
+ "url" => esc_url( $meta['schema_event_url'] )
243
+ )
244
+ );
245
+ $this->set_schema_json( $args );
246
+ }
247
+ }
248
+
249
+ /**
250
+ * Setting schema.org NewsArticle
251
+ *
252
+ * @since 1.0.0
253
+ * @version 1.1.3
254
+ */
255
+ private function set_schema_news_article () {
256
+ global $post;
257
+ if ( has_post_thumbnail( $post->ID ) ) {
258
+ $images = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
259
+ $args = array(
260
+ "@context" => "http://schema.org",
261
+ "@type" => "NewsArticle",
262
+ "headline" => $this->escape_text_tags( $post->post_title ),
263
+ "datePublished" => get_the_time( DATE_ISO8601, $post->ID ),
264
+ "image" => array( $images[0] ),
265
+ "description" => $this->escape_text_tags( $post->post_excerpt ),
266
+ "articleBody" => $this->escape_text_tags( $post->post_content )
267
+ );
268
+ $this->set_schema_json( $args );
269
+ }
270
+ }
271
+
272
+ /**
273
+ * Setting schema.org Organization
274
+ *
275
+ * @since 1.0.0
276
+ * @version 1.2.1
277
+ * @param array $options
278
+ */
279
+ private function set_schema_organization ( array $options ) {
280
+ /** Logos */
281
+ $args = array(
282
+ "@context" => "http://schema.org",
283
+ "@type" => "Organization",
284
+ "name" => isset( $options['name'] ) ? esc_html( $options['name'] ) : "",
285
+ "url" => isset( $options['url'] ) ? esc_html( $options['url'] ) : "",
286
+ "logo" => isset( $options['logo'] ) ? esc_html( $options['logo'] ) : ""
287
+ );
288
+
289
+ /** Corporate Contact */
290
+ if ( isset( $options['contact_point'] ) && $options['contact_point'] === 'on' ) {
291
+ $contact_point["contactPoint"] = array(
292
+ array(
293
+ "@type" => "ContactPoint",
294
+ "telephone" => isset( $options['telephone'] ) ? esc_html( $options['telephone'] ) : "",
295
+ "contactType" => isset( $options['contact_type'] ) ? esc_html( $options['contact_type'] ) : ""
296
+ )
297
+ );
298
+ $args = array_merge( $args, $contact_point );
299
+ }
300
+
301
+ /** Social Profiles */
302
+ if ( isset( $options['social'] ) ) {
303
+ $socials["sameAs"] = array();
304
+
305
+ foreach ( $options['social'] as $value ) {
306
+ if ( !empty( $value ) ) {
307
+ $socials["sameAs"][] = esc_html( $value );
308
+ }
309
+ }
310
+ $args = array_merge( $args, $socials );
311
+ }
312
+ $this->set_schema_json( $args );
313
+ }
314
+
315
+ /**
316
+ * Setting schema.org WebSite
317
+ *
318
+ * @since 1.0.0
319
+ * @param array $options
320
+ */
321
+ private function set_schema_website ( array $options ) {
322
+ $args = array(
323
+ "@context" => "http://schema.org",
324
+ "@type" => "WebSite",
325
+ "name" => isset( $options['name'] ) ? esc_html( $options['name'] ) : "",
326
+ "alternateName" => isset( $options['alternateName'] ) ? esc_html( $options['alternateName'] ) : "",
327
+ "url" => isset( $options['url'] ) ? esc_html( $options['url'] ) : ""
328
+ );
329
+
330
+ if ( isset( $options['potential_action'] ) && $options['potential_action'] === 'on' ) {
331
+ $potential_action["potentialAction"] = array(
332
+ "@type" => "SearchAction",
333
+ "target" => isset( $options['target'] ) ? esc_html( $options['target'] ) . "{search_term_string}" : "",
334
+ "query-input" => isset( $options['target'] ) ? "required name=search_term_string" : ""
335
+ );
336
+ $args = array_merge( $args, $potential_action );
337
+ }
338
+
339
+ $this->set_schema_json( $args );
340
+ }
341
+ }
trunk/includes/wp-structuring-short-code-breadcrumb.php ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Breadcrumb ShortCode Settings
4
+ *
5
+ * @author Kazuya Takami
6
+ * @version 2.1.0
7
+ * @since 2.0.0
8
+ */
9
+ class Structuring_Markup_ShortCode_Breadcrumb {
10
+
11
+ /**
12
+ * ShortCode Display.
13
+ *
14
+ * @since 2.0.0
15
+ * @access public
16
+ * @param array $options
17
+ * @return string $html
18
+ */
19
+ public function short_code_display ( array $options ) {
20
+ $item_array = $this->breadcrumb_array_setting( $options );
21
+ $html = '';
22
+
23
+ if ( $item_array ) {
24
+ $html .= '<!-- Markup (JSON-LD) structured in schema.org Breadcrumb START -->' . PHP_EOL;
25
+ $html .= '<ol>' . PHP_EOL;
26
+ foreach ($item_array as $item) {
27
+ $html .= '<li>';
28
+ $html .= '<a href="' . esc_url($item['@id']) . '">';
29
+ $html .= esc_html($item['name']);
30
+ $html .= '</a>';
31
+ $html .= '</li>' . PHP_EOL;
32
+ }
33
+ $html .= '</ol>' . PHP_EOL;
34
+ $html .= '<!-- Markup (JSON-LD) structured in schema.org Breadcrumb END -->' . PHP_EOL;
35
+ }
36
+
37
+ return (string) $html;
38
+ }
39
+
40
+ /**
41
+ * Breadcrumb array setting.
42
+ *
43
+ * @version 2.1.0
44
+ * @since 2.0.0
45
+ * @access public
46
+ * @param array $options
47
+ * @return array $item_array
48
+ */
49
+ public function breadcrumb_array_setting ( array $options ) {
50
+ global $post;
51
+
52
+ /** item build */
53
+ $item_array = array();
54
+ $current_url = esc_url( home_url() . $_SERVER['REQUEST_URI'] );
55
+
56
+ if ( isset( $options['home_on'] ) && $options['home_on'] === 'on' ) {
57
+ if ( isset( $options['home_name'] ) && $options['home_name'] !== '' ) {
58
+ $item_array[] = $this->set_schema_breadcrumb_item( home_url(), $options['home_name'] );
59
+ } else {
60
+ $item_array[] = $this->set_schema_breadcrumb_item( home_url(), get_bloginfo('name') );
61
+ }
62
+ }
63
+
64
+ if ( is_search() ) {
65
+ $item_array[] = $this->set_schema_breadcrumb_item( $current_url, get_search_query() );
66
+ } elseif ( is_tag() ) {
67
+ $item_array[] = $this->set_schema_breadcrumb_item( $current_url, single_tag_title( '', false ) );
68
+ } elseif ( is_date() ) {
69
+ $item_array[] = $this->set_schema_breadcrumb_item( get_year_link( get_query_var( 'year' ) ), get_query_var( 'year' ) );
70
+ if ( get_query_var( 'day' ) !== 0 ) {
71
+ $item_array[] = $this->set_schema_breadcrumb_item( get_month_link( get_query_var( 'year' ), get_query_var( 'monthnum' ) ), get_query_var( 'monthnum' ) );
72
+ $item_array[] = $this->set_schema_breadcrumb_item( get_day_link( get_query_var( 'year' ), get_query_var( 'monthnum' ), get_query_var( 'day' ) ), get_query_var( 'day' ) );
73
+ } elseif ( get_query_var( 'monthnum' ) !== 0 ) {
74
+ $item_array[] = $this->set_schema_breadcrumb_item( get_month_link( get_query_var( 'year' ), get_query_var( 'monthnum' ) ), get_query_var( 'monthnum' ) );
75
+ }
76
+ } elseif ( is_category() ) {
77
+ $categories = get_queried_object();
78
+ if( $categories->parent !== 0 ) {
79
+ $ancestors = array_reverse( get_ancestors( $categories->cat_ID, 'category' ) );
80
+ foreach( $ancestors as $ancestor ) {
81
+ $item_array[] = $this->set_schema_breadcrumb_item( get_category_link( $ancestor ), get_cat_name( $ancestor ) );
82
+ }
83
+ }
84
+ $item_array[] = $this->set_schema_breadcrumb_item( get_category_link( $categories->term_id ), $categories->name );
85
+ } elseif ( is_author() ) {
86
+ $item_array[] = $this->set_schema_breadcrumb_item( $current_url, get_the_author_meta( 'display_name', get_query_var( 'author' ) ) );
87
+ } elseif ( is_page() ) {
88
+ if( $post->post_parent !== 0 ) {
89
+ $ancestors = array_reverse( get_post_ancestors( $post->ID ) );
90
+ foreach( $ancestors as $ancestor ){
91
+ $item_array[] = $this->set_schema_breadcrumb_item( get_permalink( $ancestor ), get_the_title( $ancestor ) );
92
+ }
93
+ }
94
+ $item_array[] = $this->set_schema_breadcrumb_item( $current_url, $post->post_title );
95
+ } elseif ( is_attachment() ) {
96
+ if ( $post->post_parent !== 0 ) {
97
+ $item_array[] = $this->set_schema_breadcrumb_item( get_permalink( $post->post_parent ), get_the_title( $post->post_parent ) );
98
+ }
99
+ $item_array[] = $this->set_schema_breadcrumb_item( $current_url, $post->post_title );
100
+ } elseif ( is_single() ) {
101
+ $categories = get_the_category($post->ID);
102
+ if ( isset($categories[0]) ) {
103
+ $cat = $categories[0];
104
+
105
+ if ( $cat->parent !== 0 ) {
106
+ $ancestors = array_reverse( get_ancestors( $cat->cat_ID, 'category' ) );
107
+ foreach ( $ancestors as $ancestor ) {
108
+ $item_array[] = $this->set_schema_breadcrumb_item( get_category_link( $ancestor ), get_cat_name( $ancestor ) );
109
+ }
110
+ }
111
+ $item_array[] = $this->set_schema_breadcrumb_item( get_category_link( $cat->term_id ), $cat->name);
112
+ }
113
+ $item_array[] = $this->set_schema_breadcrumb_item( $current_url, $post->post_title );
114
+ }
115
+
116
+ return (array) $item_array;
117
+ }
118
+
119
+ /**
120
+ * Breadcrumb item settings
121
+ *
122
+ * @since 2.0.0
123
+ * @version 2.0.0
124
+ * @param string $id
125
+ * @param string $name
126
+ * @return array $args
127
+ */
128
+ private function set_schema_breadcrumb_item ( $id, $name ) {
129
+ $args = array(
130
+ "@id" => esc_html( $id ),
131
+ "name" => esc_html( $name )
132
+ );
133
+ return (array) $args;
134
+ }
135
+ }
trunk/languages/wp-structuring-markup-ja.mo ADDED
Binary file
trunk/languages/wp-structuring-markup-ja.po ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2015 Markup (JSON-LD) structured in schema.org
2
+ # This file is distributed under the same license as the Markup (JSON-LD) structured in schema.org package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Markup (JSON-LD) structured in schema.org 2.1.0\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-structuring-markup\n"
7
+ "POT-Creation-Date: 2015-12-03 08:59:46+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: Kazuya Takami <foundationmeister@outlook.com>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
+
15
+ #: includes/wp-structuring-admin-list.php:43
16
+ msgid "Schema.org Settings List"
17
+ msgstr "Schema.org 設定一覧"
18
+
19
+ #: includes/wp-structuring-admin-list.php:50
20
+ msgid "Status"
21
+ msgstr "Status"
22
+
23
+ #: includes/wp-structuring-admin-list.php:51
24
+ msgid "Schema Type"
25
+ msgstr "Schema タイプ"
26
+
27
+ #: includes/wp-structuring-admin-list.php:52
28
+ #: includes/wp-structuring-admin-post.php:112
29
+ msgid "Output Page"
30
+ msgstr "出力ページ"
31
+
32
+ #: includes/wp-structuring-admin-list.php:53
33
+ msgid "ShortCode"
34
+ msgstr "ショートコード"
35
+
36
+ #: includes/wp-structuring-admin-list.php:81 wp-structuring-markup.php:134
37
+ msgid "Edit"
38
+ msgstr "編集"
39
+
40
+ #: includes/wp-structuring-admin-list.php:87
41
+ msgid "Without registration."
42
+ msgstr "登録されていません。"
43
+
44
+ #: includes/wp-structuring-admin-post.php:87
45
+ msgid "Schema.org Register"
46
+ msgstr "Schema.org 登録"
47
+
48
+ #: includes/wp-structuring-admin-post.php:117
49
+ #: includes/wp-structuring-admin-post.php:125
50
+ #: includes/wp-structuring-admin-post.php:149
51
+ #: includes/wp-structuring-admin-post.php:159
52
+ #: includes/wp-structuring-admin-post.php:170
53
+ msgid "Post Page"
54
+ msgstr "投稿ページ"
55
+
56
+ #: includes/wp-structuring-admin-post.php:133
57
+ #: includes/wp-structuring-admin-post.php:157
58
+ #: includes/wp-structuring-admin-post.php:168
59
+ msgid "All Page"
60
+ msgstr "全てのページ"
61
+
62
+ #: includes/wp-structuring-admin-post.php:141
63
+ msgid "Event Post Page"
64
+ msgstr "イベント投稿ページ"
65
+
66
+ #: includes/wp-structuring-admin-post.php:158
67
+ #: includes/wp-structuring-admin-post.php:169
68
+ msgid "Top Page"
69
+ msgstr "トップページ"
70
+
71
+ #: includes/wp-structuring-admin-post.php:160
72
+ #: includes/wp-structuring-admin-post.php:171
73
+ msgid "Fixed Page"
74
+ msgstr "固定ページ"
75
+
76
+ #: includes/wp-structuring-custom-post-event.php:34
77
+ #: includes/wp-structuring-custom-post-event.php:35
78
+ msgid "Event Posts"
79
+ msgstr "イベント投稿"
80
+
81
+ #: includes/wp-structuring-custom-post-event.php:68
82
+ msgid "Schema.org Type Event"
83
+ msgstr "Schema.org Type Event"
84
+
85
+ #: includes/wp-structuring-custom-post-event.php:90
86
+ #: includes/wp-structuring-display.php:224
87
+ msgid "USD"
88
+ msgstr "JPY"
89
+
90
+ #: includes/wp-structuring-custom-post-event.php:95
91
+ msgid "Event Name"
92
+ msgstr "イベント名"
93
+
94
+ #: includes/wp-structuring-custom-post-event.php:100
95
+ msgid "Start Date"
96
+ msgstr "開始日"
97
+
98
+ #: includes/wp-structuring-custom-post-event.php:106
99
+ msgid "Event URL"
100
+ msgstr "イベントURL"
101
+
102
+ #: includes/wp-structuring-custom-post-event.php:111
103
+ msgid "Place Name"
104
+ msgstr "場所名"
105
+
106
+ #: includes/wp-structuring-custom-post-event.php:116
107
+ msgid "Place URL"
108
+ msgstr "会場URL"
109
+
110
+ #: includes/wp-structuring-custom-post-event.php:121
111
+ msgid "Place Address"
112
+ msgstr "会場住所"
113
+
114
+ #: includes/wp-structuring-custom-post-event.php:126
115
+ msgid "Price"
116
+ msgstr "参加料"
117
+
118
+ #: includes/wp-structuring-custom-post-event.php:131
119
+ msgid "Currency"
120
+ msgstr "通貨"
121
+
122
+ #: wp-structuring-markup.php:125 wp-structuring-markup.php:126
123
+ msgid "Schema.org Settings"
124
+ msgstr "Schema.org 設定"
125
+
126
+ #: wp-structuring-markup.php:133
127
+ msgid "Schema.org Setting Edit"
128
+ msgstr "Schema.org 設定編集"
129
+
130
+ #. Plugin Name of the plugin/theme
131
+ msgid "Markup (JSON-LD) structured in schema.org"
132
+ msgstr "Markup (JSON-LD) structured in schema.org"
133
+
134
+ #. Plugin URI of the plugin/theme
135
+ msgid "https://wordpress.org/plugins/wp-structuring-markup/"
136
+ msgstr "https://wordpress.org/plugins/wp-structuring-markup/"
137
+
138
+ #. Description of the plugin/theme
139
+ msgid ""
140
+ "It is plug in to implement structured markup (JSON-LD syntax) by schema.org "
141
+ "definition on an article or the fixed page."
142
+ msgstr "このプラグインは、投稿ページ、固定ページなどにschema.org定義の構造化マークアップ( JSON -LDの構文)を実装するプラグインです。"
143
+
144
+ #. Author of the plugin/theme
145
+ msgid "Kazuya Takami"
146
+ msgstr "Kazuya Takami"
147
+
148
+ #. Author URI of the plugin/theme
149
+ msgid "http://programp.com/"
150
+ msgstr "http://programp.com/"
trunk/languages/wp-structuring-markup.pot ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2015 Markup (JSON-LD) structured in schema.org
2
+ # This file is distributed under the same license as the Markup (JSON-LD) structured in schema.org package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Markup (JSON-LD) structured in schema.org 2.1.0\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-structuring-"
7
+ "markup\n"
8
+ "POT-Creation-Date: 2015-12-03 08:59:46+00:00\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n"
13
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
+ "Language-Team: LANGUAGE <LL@li.org>\n"
15
+
16
+ #: includes/wp-structuring-admin-list.php:43
17
+ msgid "Schema.org Settings List"
18
+ msgstr ""
19
+
20
+ #: includes/wp-structuring-admin-list.php:50
21
+ msgid "Status"
22
+ msgstr ""
23
+
24
+ #: includes/wp-structuring-admin-list.php:51
25
+ msgid "Schema Type"
26
+ msgstr ""
27
+
28
+ #: includes/wp-structuring-admin-list.php:52
29
+ #: includes/wp-structuring-admin-post.php:112
30
+ msgid "Output Page"
31
+ msgstr ""
32
+
33
+ #: includes/wp-structuring-admin-list.php:53
34
+ msgid "ShortCode"
35
+ msgstr ""
36
+
37
+ #: includes/wp-structuring-admin-list.php:81 wp-structuring-markup.php:134
38
+ msgid "Edit"
39
+ msgstr ""
40
+
41
+ #: includes/wp-structuring-admin-list.php:87
42
+ msgid "Without registration."
43
+ msgstr ""
44
+
45
+ #: includes/wp-structuring-admin-post.php:87
46
+ msgid "Schema.org Register"
47
+ msgstr ""
48
+
49
+ #: includes/wp-structuring-admin-post.php:117
50
+ #: includes/wp-structuring-admin-post.php:125
51
+ #: includes/wp-structuring-admin-post.php:149
52
+ #: includes/wp-structuring-admin-post.php:159
53
+ #: includes/wp-structuring-admin-post.php:170
54
+ msgid "Post Page"
55
+ msgstr ""
56
+
57
+ #: includes/wp-structuring-admin-post.php:133
58
+ #: includes/wp-structuring-admin-post.php:157
59
+ #: includes/wp-structuring-admin-post.php:168
60
+ msgid "All Page"
61
+ msgstr ""
62
+
63
+ #: includes/wp-structuring-admin-post.php:141
64
+ msgid "Event Post Page"
65
+ msgstr ""
66
+
67
+ #: includes/wp-structuring-admin-post.php:158
68
+ #: includes/wp-structuring-admin-post.php:169
69
+ msgid "Top Page"
70
+ msgstr ""
71
+
72
+ #: includes/wp-structuring-admin-post.php:160
73
+ #: includes/wp-structuring-admin-post.php:171
74
+ msgid "Fixed Page"
75
+ msgstr ""
76
+
77
+ #: includes/wp-structuring-custom-post-event.php:34
78
+ #: includes/wp-structuring-custom-post-event.php:35
79
+ msgid "Event Posts"
80
+ msgstr ""
81
+
82
+ #: includes/wp-structuring-custom-post-event.php:68
83
+ msgid "Schema.org Type Event"
84
+ msgstr ""
85
+
86
+ #: includes/wp-structuring-custom-post-event.php:90
87
+ #: includes/wp-structuring-display.php:224
88
+ msgid "USD"
89
+ msgstr ""
90
+
91
+ #: includes/wp-structuring-custom-post-event.php:95
92
+ msgid "Event Name"
93
+ msgstr ""
94
+
95
+ #: includes/wp-structuring-custom-post-event.php:100
96
+ msgid "Start Date"
97
+ msgstr ""
98
+
99
+ #: includes/wp-structuring-custom-post-event.php:106
100
+ msgid "Event URL"
101
+ msgstr ""
102
+
103
+ #: includes/wp-structuring-custom-post-event.php:111
104
+ msgid "Place Name"
105
+ msgstr ""
106
+
107
+ #: includes/wp-structuring-custom-post-event.php:116
108
+ msgid "Place URL"
109
+ msgstr ""
110
+
111
+ #: includes/wp-structuring-custom-post-event.php:121
112
+ msgid "Place Address"
113
+ msgstr ""
114
+
115
+ #: includes/wp-structuring-custom-post-event.php:126
116
+ msgid "Price"
117
+ msgstr ""
118
+
119
+ #: includes/wp-structuring-custom-post-event.php:131
120
+ msgid "Currency"
121
+ msgstr ""
122
+
123
+ #: wp-structuring-markup.php:125 wp-structuring-markup.php:126
124
+ msgid "Schema.org Settings"
125
+ msgstr ""
126
+
127
+ #: wp-structuring-markup.php:133
128
+ msgid "Schema.org Setting Edit"
129
+ msgstr ""
130
+
131
+ #. Plugin Name of the plugin/theme
132
+ msgid "Markup (JSON-LD) structured in schema.org"
133
+ msgstr ""
134
+
135
+ #. Plugin URI of the plugin/theme
136
+ msgid "https://wordpress.org/plugins/wp-structuring-markup/"
137
+ msgstr ""
138
+
139
+ #. Description of the plugin/theme
140
+ msgid ""
141
+ "It is plug in to implement structured markup (JSON-LD syntax) by schema.org "
142
+ "definition on an article or the fixed page."
143
+ msgstr ""
144
+
145
+ #. Author of the plugin/theme
146
+ msgid "Kazuya Takami"
147
+ msgstr ""
148
+
149
+ #. Author URI of the plugin/theme
150
+ msgid "http://programp.com/"
151
+ msgstr ""
trunk/readme.txt ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Markup (JSON-LD) structured in schema.org ===
2
+ Contributors: miiitaka
3
+ Tags: schema, schema.org, json, json-ld, seo, post, posts, google, shortcode, breadcrumb
4
+ Requires at least: 4.3.1
5
+ Tested up to: 4.4.0
6
+ Stable tag: 2.1.2
7
+
8
+ It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an post page, fixed page and etc.
9
+
10
+ == Description ==
11
+
12
+ It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an post page, fixed page and etc.
13
+ Base knowledge is "https://schema.org/" and "https://developers.google.com/structured-data/"
14
+
15
+ = Schema.org Type =
16
+
17
+ * Article: http://schema.org/Article
18
+ * BlogPosting: http://schema.org/BlogPosting
19
+ * BreadcrumbList: https://schema.org/BreadcrumbList
20
+ * Event: https://schema.org/Event
21
+ * NewsArticle: http://schema.org/NewsArticle
22
+ * Organization: https://schema.org/Organization
23
+ * Website: https://schema.org/WebSite
24
+
25
+ = Breadcrumb =
26
+
27
+ You can display the breadcrumbs in the short code. Breadcrumb definition is available even if not active.
28
+
29
+ [ Example ]
30
+
31
+ `
32
+ <?php
33
+ if (shortcode_exists('wp-structuring-markup-breadcrumb')) {
34
+ echo do_shortcode('[wp-structuring-markup-breadcrumb]');
35
+ }
36
+ ?>
37
+ `
38
+
39
+ == Installation ==
40
+
41
+ * A plug-in installation screen is displayed in the WordPress admin panel.
42
+ * It installs in `wp-content/plugins`.
43
+ * The plug-in is activated.
44
+ * Open 'Schema.org Setting' menu.
45
+
46
+ == Changelog ==
47
+
48
+ = 2.1.2 (2015-12-09) =
49
+
50
+ * Check : WordPress version 4.4 operation check.
51
+
52
+ = 2.1.1 (2015-12-04) =
53
+
54
+ * Added : Add the table update processing at the time of version up.
55
+
56
+ = 2.1.0 (2015-12-03) =
57
+
58
+ * Added : Schema.org type "Event" schema.org definition Add "Event" custom post output that works.
59
+
60
+ = 2.0.2 (2015-11-27) =
61
+
62
+ * Fixed : Breadcrumb ShortCode minor bug fixed.
63
+
64
+ = 2.0.1 (2015-11-25) =
65
+
66
+ * Fixed : Notice error fixed.
67
+
68
+ = 2.0.0 (2015-11-23) =
69
+
70
+ * Added : Schema.org type "BreadcrumbList" schema.org definition Add breadcrumbs short code output that works.
71
+ * Updated : Schema.org definition immobilization.
72
+
73
+ = 1.3.2 (2015-11-17) =
74
+
75
+ * Fixed : Fixed translation.
76
+ * Added : Additional output comment.
77
+
78
+ = 1.3.1 =
79
+
80
+ * Fixed : none-function fixed.
81
+
82
+ = 1.3.0 =
83
+
84
+ * Added : Localizing into Japanese.
85
+
86
+ = 1.2.1 =
87
+
88
+ * Updated : Read admin menu css -> wp_register_style setting
89
+ * Fixed : Typo Missing.
90
+
91
+ = 1.2.0 =
92
+
93
+ * Added : Schema.org type "BlogPosting".
94
+
95
+ = 1.1.3 =
96
+
97
+ * Fixed : To escape a newline code and the tag of the body attribute in Type "Article" and "NewsArticle".
98
+
99
+ = 1.1.2 =
100
+
101
+ * Updated : Schema.org type "Article" image attribute.
102
+
103
+ = 1.1.0 =
104
+
105
+ * Added : Schema.org type "Article".
106
+
107
+ = 1.0.1 - 1.0.8 =
108
+
109
+ * Fixed : Missing plugin path setting.
110
+
111
+ = 1.0.0 =
112
+
113
+ * First release of this plugin.
114
+
115
+ == Contact ==
116
+
117
+ * email to foundationmeister[at]outlook.com
118
+ * twitter @miiitaka
trunk/uninstall.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
3
+ exit;
4
+ }
5
+ new Structuring_Markup_Uninstall();
6
+
7
+ /**
8
+ * Schema.org Plugin Uninstall
9
+ *
10
+ * @author Kazuya Takami
11
+ * @version 2.1.0
12
+ * @since 1.0.0
13
+ */
14
+ class Structuring_Markup_Uninstall {
15
+
16
+ /**
17
+ * Variable definition.
18
+ *
19
+ * @since 2.1.0
20
+ * @version 2.1.0
21
+ */
22
+ private $custom_type = 'schema_event_post';
23
+
24
+ /**
25
+ * Constructor Define.
26
+ *
27
+ * @since 1.0.0
28
+ * @version 2.0.0
29
+ */
30
+ public function __construct () {
31
+ $this->drop_table( 'structuring_markup' );
32
+ $this->delete_custom_post( $this->custom_type );
33
+ $this->delete_post_meta( $this->custom_type );
34
+ delete_option( 'wp_structuring_markup' );
35
+ }
36
+
37
+ /**
38
+ * Drop Table.
39
+ *
40
+ * @since 1.0.0
41
+ * @version 2.1.0
42
+ * @param string $table_name
43
+ */
44
+ private function drop_table ( $table_name = null ) {
45
+ global $wpdb;
46
+ $table_name = $wpdb->prefix . $table_name;
47
+ $wpdb->query( "DROP TABLE IF EXISTS " . $table_name );
48
+ }
49
+
50
+ /**
51
+ * Delete custom post.
52
+ *
53
+ * @since 2.1.0
54
+ * @version 2.1.0
55
+ * @param string $custom_type
56
+ */
57
+ private function delete_custom_post ( $custom_type = null ) {
58
+ global $wpdb;
59
+ $table_name = $wpdb->prefix . "posts";
60
+
61
+ $key = array( 'post_type' => $custom_type );
62
+ $key_prepared = array( '%s' );
63
+
64
+ $wpdb->delete( $table_name, $key, $key_prepared );
65
+ }
66
+
67
+ /**
68
+ * Delete post meta.
69
+ *
70
+ * @since 2.1.0
71
+ * @version 2.1.0
72
+ * @param string $custom_type
73
+ */
74
+ private function delete_post_meta ( $custom_type = null ) {
75
+ global $wpdb;
76
+ $table_name = $wpdb->prefix . "postmeta";
77
+
78
+ $key = array( 'meta_key' => $custom_type );
79
+ $key_prepared = array( '%s' );
80
+
81
+ $wpdb->delete( $table_name, $key, $key_prepared );
82
+ }
83
+ }
trunk/wp-structuring-markup.php ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Markup (JSON-LD) structured in schema.org
4
+ Plugin URI: https://wordpress.org/plugins/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: 2.1.2
7
+ Author: Kazuya Takami
8
+ Author URI: http://programp.com/
9
+ License: GPLv2 or later
10
+ Text Domain: wp-structuring-markup
11
+ Domain Path: /languages
12
+ */
13
+ require_once( plugin_dir_path( __FILE__ ) . 'includes/wp-structuring-admin-db.php' );
14
+
15
+ new Structuring_Markup();
16
+
17
+ /**
18
+ * Schema.org Basic Class
19
+ *
20
+ * @author Kazuya Takami
21
+ * @since 1.0.0
22
+ * @version 2.1.1
23
+ */
24
+ class Structuring_Markup {
25
+
26
+ /**
27
+ * Variable definition.
28
+ *
29
+ * @since 1.3.0
30
+ * @version 2.1.1
31
+ */
32
+ private $text_domain = 'wp-structuring-markup';
33
+ private $version = '2.1.1';
34
+
35
+ /**
36
+ * Constructor Define.
37
+ *
38
+ * @since 1.0.0
39
+ * @version 2.1.0
40
+ */
41
+ public function __construct() {
42
+ register_activation_hook( __FILE__, array( $this, 'create_table' ) );
43
+
44
+ add_shortcode( $this->text_domain . '-breadcrumb', array( $this, 'short_code_init_breadcrumb' ) );
45
+
46
+ add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ) );
47
+ add_action( 'init', array( $this, 'create_post_type_event' ) );
48
+
49
+ if ( is_admin() ) {
50
+ add_action( 'admin_init', array( $this, 'admin_init' ) );
51
+ add_action( 'admin_menu', array( $this, 'admin_menu' ) );
52
+ } else {
53
+ add_action( 'wp_head', array( $this, 'wp_head' ) );
54
+ }
55
+ }
56
+
57
+ /**
58
+ * Create table.
59
+ *
60
+ * @since 2.0.0
61
+ * @version 2.0.0
62
+ */
63
+ public function create_table() {
64
+ $db = new Structuring_Markup_Admin_Db();
65
+ $db->create_table( $this->text_domain, $this->version );
66
+ }
67
+
68
+ /**
69
+ * Breadcrumb ShortCode Register.
70
+ *
71
+ * @since 2.0.0
72
+ * @version 2.0.0
73
+ * @return string $html
74
+ */
75
+ public function short_code_init_breadcrumb () {
76
+ $db = new Structuring_Markup_Admin_Db();
77
+ $results = $db->get_type_options( 'breadcrumb' );
78
+
79
+ if ( isset( $results['option'] ) ) {
80
+ $options = $results['option'];
81
+
82
+ require_once( plugin_dir_path( __FILE__ ) . 'includes/wp-structuring-short-code-breadcrumb.php');
83
+ $obj = new Structuring_Markup_ShortCode_Breadcrumb();
84
+ return $obj->short_code_display( $options );
85
+ }
86
+ }
87
+
88
+ /**
89
+ * i18n.
90
+ *
91
+ * @since 1.3.0
92
+ * @version 1.3.0
93
+ */
94
+ public function plugins_loaded () {
95
+ load_plugin_textdomain( $this->text_domain, false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
96
+ }
97
+
98
+ /**
99
+ * Create custom post type "event".
100
+ *
101
+ * @since 2.1.0
102
+ * @version 2.1.0
103
+ */
104
+ function create_post_type_event () {
105
+ require_once( plugin_dir_path( __FILE__ ) . 'includes/wp-structuring-custom-post-event.php' );
106
+ new Structuring_Markup_Custom_Post_Event( $this->text_domain );
107
+ }
108
+
109
+ /**
110
+ * admin init.
111
+ *
112
+ * @since 1.3.1
113
+ * @version 2.1.1
114
+ */
115
+ public function admin_init () {
116
+ /** version up check */
117
+ $options = get_option( $this->text_domain );
118
+ if ( !isset( $options['version'] ) || $options['version'] !== $this->version ) {
119
+ $this->create_table();
120
+ }
121
+
122
+ wp_register_style( 'wp-structuring-markup-admin-style', plugins_url( 'css/style.css', __FILE__ ) );
123
+ }
124
+
125
+ /**
126
+ * Add Menu to the Admin Screen.
127
+ *
128
+ * @since 1.0.0
129
+ * @version 2.0.0
130
+ */
131
+ public function admin_menu () {
132
+ $list_page = add_menu_page(
133
+ esc_html__( 'Schema.org Settings', $this->text_domain ),
134
+ esc_html__( 'Schema.org Settings', $this->text_domain ),
135
+ 'manage_options',
136
+ plugin_basename( __FILE__ ),
137
+ array( $this, 'list_page_render' )
138
+ );
139
+ $post_page = add_submenu_page(
140
+ $this->text_domain . '-post',
141
+ esc_html__( 'Schema.org Setting Edit', $this->text_domain ),
142
+ esc_html__( 'Edit', $this->text_domain ),
143
+ 'manage_options',
144
+ $this->text_domain . '-post',
145
+ array( $this, 'post_page_render' )
146
+ );
147
+
148
+ /** Using registered $page handle to hook stylesheet loading */
149
+ add_action( 'admin_print_styles-' . $list_page, array( $this, 'add_style' ) );
150
+ add_action( 'admin_print_styles-' . $post_page, array( $this, 'add_style' ) );
151
+
152
+ /** Custom post menu controls */
153
+ if ( isset( $_GET['page'] ) && $_GET['page'] === $this->text_domain . '-post' && !empty( $_POST ) ) {
154
+ if ( isset( $_POST['activate'] ) && $_POST['activate'] === 'on' ) {
155
+ flush_rewrite_rules();
156
+ }
157
+ if ( !isset( $_POST['activate'] ) ) {
158
+ remove_menu_page('edit.php?post_type=schema_event_post');
159
+ }
160
+ } else {
161
+ /** DB Connect */
162
+ $db = new Structuring_Markup_Admin_Db();
163
+ $results = $db->get_type_options('event');
164
+
165
+ if ( !isset( $results['activate'] ) || $results['activate'] !== 'on' ) {
166
+ remove_menu_page( 'edit.php?post_type=schema_event_post' );
167
+ }
168
+ }
169
+ }
170
+
171
+ /**
172
+ * CSS admin add.
173
+ *
174
+ * @since 1.3.1
175
+ * @version 1.3.1
176
+ */
177
+ public function add_style () {
178
+ wp_enqueue_style( 'wp-structuring-markup-admin-style' );
179
+ }
180
+
181
+ /**
182
+ * LIST Page Template Require.
183
+ *
184
+ * @since 1.0.0
185
+ * @version 1.3.0
186
+ */
187
+ public function list_page_render () {
188
+ require_once( plugin_dir_path( __FILE__ ) . 'includes/wp-structuring-admin-list.php' );
189
+ new Structuring_Markup_Admin_List( $this->text_domain );
190
+ }
191
+
192
+ /**
193
+ * POST Page Template Require.
194
+ *
195
+ * @since 1.0.0
196
+ * @version 1.3.0
197
+ */
198
+ public function post_page_render () {
199
+ require_once( plugin_dir_path( __FILE__ ) . 'includes/wp-structuring-admin-post.php' );
200
+ new Structuring_Markup_Admin_Post( $this->text_domain );
201
+ }
202
+
203
+ /**
204
+ * Display Page Template Require.
205
+ *
206
+ * @since 1.3.0
207
+ * @version 1.3.0
208
+ */
209
+ public function wp_head () {
210
+ require_once( plugin_dir_path( __FILE__ ) . 'includes/wp-structuring-display.php' );
211
+ new Structuring_Markup_Display();
212
+ }
213
+ }
wp-structuring-markup.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Markup (JSON-LD) structured in schema.org
4
  Plugin URI: https://wordpress.org/plugins/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: 2.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://wordpress.org/plugins/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: 2.1.2
7
  Author: Kazuya Takami
8
  Author URI: http://programp.com/
9
  License: GPLv2 or later