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

Version Description

  • Fixed : none-function fixed.
Download this release

Release Info

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

Code changes from version 1.3.0 to 1.3.1

readme.txt CHANGED
@@ -3,7 +3,7 @@ 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: 1.3.0
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
 
@@ -32,6 +32,10 @@ Base knowledge is "https://schema.org/" and "https://developers.google.com/struc
32
 
33
  == Changelog ==
34
 
 
 
 
 
35
  = 1.3.0 =
36
 
37
  * Added : Localizing into Japanese.
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: 1.3.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
 
32
 
33
  == Changelog ==
34
 
35
+ = 1.3.1 =
36
+
37
+ * Fixed : none-function fixed.
38
+
39
  = 1.3.0 =
40
 
41
  * Added : Localizing into Japanese.
trunk/css/style.css DELETED
@@ -1,22 +0,0 @@
1
- .schema-admin-table {
2
- margin: 15px 0 15px 0;
3
- }
4
- .schema-admin-table caption {
5
- border-left: solid 4px #00a0d2;
6
- margin: 0 0 10px 0;
7
- padding: 3px 0 3px 7px;
8
- text-align: left;
9
- }
10
- .schema-admin-table th {
11
- text-align: right;
12
- width: 100px;
13
- }
14
- .schema-admin-table td label{
15
- margin: 0 10px 0 0;
16
- }
17
- .schema-admin-table small {
18
- margin: 0 0 0 10px;
19
- }
20
- .schema-admin-table input[type="checkbox"] {
21
- margin: 0 5px 0 0;
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/wp-structuring-admin-db.php DELETED
@@ -1,169 +0,0 @@
1
- <?php
2
- define( 'WP_STRUCTURING_MARKUP_DB', 'structuring_markup' );
3
-
4
- /**
5
- * Schema.org Admin DB Connection
6
- *
7
- * @author Kazuya Takami
8
- * @version 1.0.0
9
- * @since 1.0.0
10
- */
11
- class Structuring_Markup_Admin_Db {
12
- private $table_name;
13
-
14
- /**
15
- * Constructor Define.
16
- *
17
- * @since 1.0.0
18
- */
19
- public function __construct() {
20
- global $wpdb;
21
- $this->table_name = $wpdb->prefix . WP_STRUCTURING_MARKUP_DB;
22
- }
23
-
24
- /**
25
- * Create Table.
26
- *
27
- * @since 1.0.0
28
- */
29
- public function create_table() {
30
- global $wpdb;
31
-
32
- $prepared = $wpdb->prepare( "SHOW TABLES LIKE %s", $this->table_name );
33
- $is_db_exists = $wpdb->get_var( $prepared );
34
-
35
- if ( is_null( $is_db_exists ) ) {
36
- $charset_collate = $wpdb->get_charset_collate();
37
-
38
- $query = " CREATE TABLE " . $this->table_name;
39
- $query .= " (id mediumint(9) NOT NULL AUTO_INCREMENT PRIMARY KEY";
40
- $query .= ",type tinytext NOT NULL";
41
- $query .= ",output text NOT NULL";
42
- $query .= ",options text NOT NULL";
43
- $query .= ",register_date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL";
44
- $query .= ",update_date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL";
45
- $query .= ",UNIQUE KEY id (id)) " . $charset_collate;
46
-
47
- require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
48
- dbDelta( $query );
49
- }
50
- }
51
-
52
- /**
53
- * Get Data.
54
- *
55
- * @since 1.0.0
56
- * @param integer $id
57
- * @return array $results
58
- */
59
- public function get_options( $id ) {
60
- global $wpdb;
61
-
62
- $query = "SELECT * FROM " . $this->table_name . " WHERE id = %d";
63
- $data = array( $id );
64
- $prepared = $wpdb->prepare( $query, $data );
65
- $args = $wpdb->get_row( $prepared );
66
- $results = array();
67
-
68
- if ( $args ) {
69
- $results['id'] = $args->id;
70
- $results['type'] = $args->type;
71
- $results['output'] = unserialize( $args->output );
72
- $results['option'] = unserialize( $args->options );
73
- }
74
- return (array) $results;
75
- }
76
-
77
- /**
78
- * Get All Data.
79
- *
80
- * @since 1.0.0
81
- * @return array $results
82
- */
83
- public function get_list_options() {
84
- global $wpdb;
85
-
86
- $query = "SELECT * FROM " . $this->table_name . " ORDER BY update_date DESC";
87
-
88
- return (array) $wpdb->get_results( $query );
89
- }
90
-
91
- /**
92
- * Get Select Data.
93
- *
94
- * @since 1.0.0
95
- * @param array $output
96
- * @return array $results
97
- */
98
- public function get_select_options( $output ) {
99
- global $wpdb;
100
-
101
- $query = "SELECT * FROM " . $this->table_name . " WHERE output LIKE '%%%s%%'";
102
- $data = array( $output );
103
- $prepared = $wpdb->prepare( $query, $data );
104
- $results = $wpdb->get_results( $prepared );
105
-
106
- return (array) $results;
107
- }
108
-
109
- /**
110
- * Insert Data.
111
- *
112
- * @since 1.0.0
113
- * @param array $post($_POST)
114
- * @return integer $id
115
- */
116
- public function insert_options( array $post ) {
117
- global $wpdb;
118
-
119
- $data = array(
120
- 'type' => $post['type'],
121
- 'output' => serialize( $post['output'] ),
122
- 'options' => isset( $post['option'] ) ? serialize( $post['option'] ) : "",
123
- 'register_date' => date( "Y-m-d H:i:s" ),
124
- 'update_date' => date( "Y-m-d H:i:s" )
125
- );
126
- $prepared = array( '%s', '%s', '%s' );
127
-
128
- $wpdb->insert( $this->table_name, $data, $prepared );
129
-
130
- return (int) $wpdb->insert_id;
131
- }
132
-
133
- /**
134
- * Update Data.
135
- *
136
- * @since 1.0.0
137
- * @param array $post($_POST)
138
- */
139
- public function update_options( array $post ) {
140
- global $wpdb;
141
-
142
- $data = array(
143
- 'type' => $post['type'],
144
- 'output' => serialize( $post['output'] ),
145
- 'options' => isset( $post['option'] ) ? serialize( $post['option'] ) : "",
146
- 'update_date' => date( "Y-m-d H:i:s" )
147
- );
148
- $key = array( 'id' => $post['id'] );
149
- $prepared = array( '%s', '%s', '%s' );
150
- $key_prepared = array( '%d' );
151
-
152
- $wpdb->update( $this->table_name, $data, $key, $prepared, $key_prepared );
153
- }
154
-
155
- /**
156
- * Delete Data.
157
- *
158
- * @since 1.0.0
159
- * @param integer $id
160
- */
161
- public function delete_options( $id ) {
162
- global $wpdb;
163
-
164
- $key = array( 'id' => $id );
165
- $key_prepared = array( '%d' );
166
-
167
- $wpdb->delete( $this->table_name, $key, $key_prepared );
168
- }
169
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/wp-structuring-admin-list.php DELETED
@@ -1,144 +0,0 @@
1
- <?php
2
- /**
3
- * Schema.org Admin List
4
- *
5
- * @author Kazuya Takami
6
- * @version 1.2.0
7
- * @since 1.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
- */
17
- private $text_domain;
18
-
19
- /** Schema.org Type defined. */
20
- private $type_array = array(
21
- "website" => "Web Site",
22
- "organization" => "Organization",
23
- "article" => "Article",
24
- "blog_posting" => "Blog Posting",
25
- "news_article" => "News Article"
26
- );
27
-
28
- /**
29
- * Constructor Define.
30
- *
31
- * @since 1.0.0
32
- * @version 1.3.0
33
- * @param String $text_domain
34
- */
35
- function __construct( $text_domain ) {
36
- $this->text_domain = $text_domain;
37
-
38
- $db = new Structuring_Markup_Admin_Db();
39
- $mode = "";
40
-
41
- if ( isset( $_GET['mode'] ) && $_GET['mode'] === 'delete' ) {
42
- if ( isset( $_GET['schema_post_id'] ) && is_numeric( $_GET['schema_post_id'] ) ) {
43
- $db->delete_options( $_GET['schema_post_id'] );
44
- $mode = "delete";
45
- }
46
- }
47
-
48
- $this->page_render( $db, $mode );
49
- }
50
-
51
- /**
52
- * LIST Page HTML Render.
53
- *
54
- * @since 1.0.0
55
- * @version 1.3.0
56
- * @param Structuring_Markup_Admin_Db $db
57
- * @param String $mode
58
- */
59
- private function page_render( Structuring_Markup_Admin_Db $db, $mode = "" ) {
60
- $post_url = admin_url() . 'admin.php?page=' . $this->text_domain . '/includes/wp-structuring-admin-post.php';
61
- $self_url = $_SERVER['PHP_SELF'] . '?' . esc_html( $_SERVER['QUERY_STRING'] );
62
-
63
- $html = '';
64
- $html .= '<div class="wrap">';
65
- $html .= '<h1>' . esc_html__( 'Schema.org Setting List', $this->text_domain );
66
- $html .= '<a href="' . $post_url . '" class="page-title-action">' . esc_html__( 'Add New', $this->text_domain ) . '</a>';
67
- $html .= '</h1>';
68
- echo $html;
69
-
70
- if ( $mode === "delete" ) {
71
- $this->information_render();
72
- }
73
-
74
- $html = '<hr>';
75
- $html .= '<table class="wp-list-table widefat fixed striped posts">';
76
- $html .= '<tr>';
77
- $html .= '<th scope="row">' . esc_html__( 'Schema Type', $this->text_domain ) . '</th>';
78
- $html .= '<th scope="row">' . esc_html__( 'Output Page', $this->text_domain ) . '</th>';
79
- $html .= '<th scope="row">' . esc_html__( 'Register Date', $this->text_domain ) . '</th>';
80
- $html .= '<th scope="row">' . esc_html__( 'Update Date', $this->text_domain ) . '</th>';
81
- $html .= '<th scope="row">&nbsp;</th>';
82
- $html .= '</tr>';
83
- echo $html;
84
-
85
- $results = $db->get_list_options();
86
-
87
- if ( $results ) {
88
- foreach ( $results as $row ) {
89
- $html = '';
90
- $html .= '<tr>';
91
- $html .= '<td>';
92
- $html .= '<a href="' . $post_url . '&mode=edit&schema_post_id=' . esc_html( $row->id ) . '">' . $this->type_array[esc_html( $row->type )] . '</a>';
93
- $html .= '</td>';
94
- $html .= '<td>' . $this->unserialize_output( $row->output ) . '</td>';
95
- $html .= '<td>' . esc_html( $row->register_date ) . '</td>';
96
- $html .= '<td>' . esc_html( $row->update_date ) . '</td>';
97
- $html .= '<td>';
98
- $html .= '<a href="' . $post_url . '&mode=edit&schema_post_id=' . esc_html( $row->id ) . '">';
99
- $html .= esc_html__( 'Edit', $this->text_domain );
100
- $html .= '</a>&nbsp;&nbsp;&nbsp;&nbsp;';
101
- $html .= '<a href="' . $self_url . '&mode=delete&schema_post_id=' . esc_html( $row->id ) . '">';
102
- $html .= esc_html__( 'Delete', $this->text_domain );
103
- $html .= '</a>';
104
- $html .= '</td>';
105
- $html .= '</tr>';
106
- echo $html;
107
- }
108
- } else {
109
- echo '<td colspan="3">' . esc_html__( 'Without registration.', $this->text_domain ) . '</td>';
110
- }
111
-
112
- $html = '</table>';
113
- $html .= '</div>';
114
- echo $html;
115
- }
116
-
117
- /**
118
- * LIST Page HTML Render.
119
- *
120
- * @since 1.0.0
121
- * @param object $obj
122
- * @return string $args
123
- */
124
- private function unserialize_output( $obj ) {
125
- $args = unserialize( $obj );
126
- return (string) implode( ",", $args );
127
- }
128
-
129
- /**
130
- * Information Message Render
131
- *
132
- * @since 1.0.0
133
- */
134
- private function information_render() {
135
- $html = '<div id="message" class="updated notice notice-success is-dismissible below-h2">';
136
- $html .= '<p>Deletion succeeds.</p>';
137
- $html .= '<button type="button" class="notice-dismiss">';
138
- $html .= '<span class="screen-reader-text">Dismiss this notice.</span>';
139
- $html .= '</button>';
140
- $html .= '</div>';
141
-
142
- echo $html;
143
- }
144
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/wp-structuring-admin-post.php DELETED
@@ -1,271 +0,0 @@
1
- <?php
2
- /**
3
- * Schema.org Admin Post
4
- *
5
- * @author Kazuya Takami
6
- * @version 1.2.0
7
- * @since 1.0.0
8
- */
9
- class Structuring_Markup_Admin_Post {
10
-
11
- /**
12
- * Variable definition.
13
- *
14
- * @since 1.3.0
15
- */
16
- private $text_domain;
17
-
18
- /** Schema.org Type defined. */
19
- private $type_array = array(
20
- array("type" => "website", "display" => "Web Site"),
21
- array("type" => "organization", "display" => "Organization"),
22
- array("type" => "article", "display" => "Article"),
23
- array("type" => "blog_posting", "display" => "Blog Posting"),
24
- array("type" => "news_article", "display" => "News Article")
25
- );
26
-
27
- /**
28
- * Constructor Define.
29
- *
30
- * @since 1.0.0
31
- * @version 1.3.0
32
- * @param String $text_domain
33
- */
34
- public function __construct( $text_domain ) {
35
- $this->text_domain = $text_domain;
36
-
37
- /**
38
- * Input Mode
39
- *
40
- * "" : Input Start
41
- * "edit" : Edit Mode
42
- */
43
- $mode = isset( $_GET['mode'] ) ? esc_html( $_GET['mode'] ) : "";
44
-
45
- /**
46
- * Update Status
47
- *
48
- * "ok" : Successful update
49
- * "output" : Output No Check
50
- */
51
- $status = "";
52
-
53
- /** DB Connect */
54
- $db = new Structuring_Markup_Admin_Db();
55
-
56
- /** Set Default Parameter for Array */
57
- $options = array(
58
- "id" => "",
59
- "type" => "website",
60
- "output" => array(),
61
- "option" => array()
62
- );
63
-
64
- /** Key Set */
65
- if ( isset( $_GET['schema_post_id'] ) && is_numeric( $_GET['schema_post_id'] ) ) {
66
- $options['id'] = esc_html( $_GET['schema_post_id'] );
67
- }
68
-
69
- /** Type Set */
70
- if ( isset( $_GET['type'] ) ) {
71
- foreach ( $this->type_array as $value ) {
72
- if ( $_GET['type'] === $value['type'] ) {
73
- $options['type'] = esc_html( $_GET['type'] );
74
- break;
75
- }
76
- }
77
- }
78
-
79
- /** DataBase Update & Insert Mode */
80
- if ( isset( $_POST['id'] ) && is_numeric( $_POST['id'] ) ) {
81
- if ( isset( $_POST['output'] ) ) {
82
- $db->update_options( $_POST );
83
- $options['id'] = $_POST['id'];
84
- $status = "ok";
85
- } else {
86
- $status = "output";
87
- }
88
- } else {
89
- if ( isset( $_POST['id'] ) && $_POST['id'] === '' ) {
90
- if ( isset( $_POST['output'] ) ) {
91
- $options['id'] = $db->insert_options( $_POST );
92
- $status = "ok";
93
- $mode = "edit";
94
- } else {
95
- $status = "output";
96
- }
97
- }
98
- }
99
-
100
- /** Mode Judgment */
101
- if ( isset( $options['id'] ) && is_numeric( $options['id'] ) ) {
102
- $options = $db->get_options( $options['id'] );
103
- }
104
-
105
- $this->page_render( $options, $mode, $status );
106
- }
107
-
108
- /**
109
- * Setting Page of the Admin Screen.
110
- *
111
- * @since 1.0.0
112
- * @version 1.3.0
113
- * @param array $options
114
- * @param string $mode
115
- * @param string $status
116
- */
117
- private function page_render( array $options, $mode, $status ) {
118
- $html = '';
119
- $html .= '<div class="wrap">';
120
- $html .= '<h1>' . esc_html__( 'Schema.org Register', $this->text_domain ) . '</h1>';
121
- echo $html;
122
-
123
- switch ( $status ) {
124
- case "ok":
125
- $this->information_render();
126
- break;
127
- case "output":
128
- $this->output_error_render();
129
- break;
130
- default:
131
- break;
132
- }
133
-
134
- $html = '<hr>';
135
- $html .= '<form method="get" action="">';
136
- $html .= '<input type="hidden" name="page" value="wp-structuring-markup/includes/wp-structuring-admin-post.php">';
137
- $html .= '<table class="schema-admin-table">';
138
- $html .= '<tr><th><label for="type">Schema Type :</label></th><td>';
139
- $html .= '<select id="type" name="type" onchange="this.form.submit();">';
140
- foreach ( $this->type_array as $value ) {
141
- $html .= '<option value="' . $value['type'] . '"';
142
- if ( $value['type'] === $options['type'] ) {
143
- $html .= ' selected';
144
- } else {
145
- if ( $mode === "edit" ) {
146
- $html .= ' disabled';
147
- }
148
- }
149
- $html .= '>' . $value['display'] . '</option>';
150
- }
151
- $html .= '</select>';
152
- $html .= '</td></tr></table>';
153
- $html .= '</form>';
154
- echo $html;
155
-
156
- /** Output Page Select */
157
- $html = '<form method="post" action="">';
158
- $html .= '<input type="hidden" name="id" value="' . esc_attr( $options['id'] ) . '">';
159
- $html .= '<input type="hidden" name="type" value="' . esc_attr( $options['type'] ) . '">';
160
- $html .= '<table class="schema-admin-table">';
161
- $html .= '<tr><th>' . esc_html__( 'Output Page', $this->text_domain ) . ':</th><td>';
162
- echo $html;
163
-
164
- switch ( $options['type'] ) {
165
- case 'website':
166
- $this->output_checkbox_render( $options['output'], "all", "All", esc_html__( 'All Page', $this->text_domain ) );
167
- $this->output_checkbox_render( $options['output'], "home", "Top", esc_html__( 'Top Page', $this->text_domain ) );
168
- $this->output_checkbox_render( $options['output'], "post", "Post", esc_html__( 'Post Page', $this->text_domain ) );
169
- $this->output_checkbox_render( $options['output'], "page", "Fixed", esc_html__( 'Fixed Page', $this->text_domain ) );
170
- $html = '</td></tr></table><hr>';
171
- echo $html;
172
-
173
- require_once( plugin_dir_path( __FILE__ ) . 'wp-structuring-admin-type-website.php' );
174
- new Structuring_Markup_Type_Website( $options['option'] );
175
- break;
176
- case 'organization':
177
- $this->output_checkbox_render( $options['output'], "all", "All", esc_html__( 'All Page', $this->text_domain ) );
178
- $this->output_checkbox_render( $options['output'], "home", "Top", esc_html__( 'Top Page', $this->text_domain ) );
179
- $this->output_checkbox_render( $options['output'], "post", "Post", esc_html__( 'Post Page', $this->text_domain ) );
180
- $this->output_checkbox_render( $options['output'], "page", "Fixed", esc_html__( 'Fixed Page', $this->text_domain ) );
181
- $html = '</td></tr></table><hr>';
182
- echo $html;
183
-
184
- require_once ( plugin_dir_path( __FILE__ ) . 'wp-structuring-admin-type-organization.php' );
185
- new Structuring_Markup_Type_Organization( $options['option'] );
186
- break;
187
- case 'article':
188
- $this->output_checkbox_render( $options['output'], "post", "Post", esc_html__( 'Post Page', $this->text_domain ) );
189
- $html = '</td></tr></table><hr>';
190
- echo $html;
191
-
192
- require_once ( plugin_dir_path( __FILE__ ) . 'wp-structuring-admin-type-article.php' );
193
- new Structuring_Markup_Type_Article();
194
- break;
195
- case 'blog_posting':
196
- $this->output_checkbox_render( $options['output'], "post", "Post", esc_html__( 'Post Page', $this->text_domain ) );
197
- $html = '</td></tr></table><hr>';
198
- echo $html;
199
-
200
- require_once ( plugin_dir_path( __FILE__ ) . 'wp-structuring-admin-type-blog-posting.php' );
201
- new Structuring_Markup_Type_Blog_Posting();
202
- break;
203
- case 'news_article':
204
- $this->output_checkbox_render( $options['output'], "post", "Post", esc_html__( 'Post Page', $this->text_domain ) );
205
- $html = '</td></tr></table><hr>';
206
- echo $html;
207
-
208
- require_once ( plugin_dir_path( __FILE__ ) . 'wp-structuring-admin-type-news-article.php' );
209
- new Structuring_Markup_Type_NewsArticle();
210
- break;
211
- }
212
-
213
- $html = '</form>';
214
- $html .= '</div>';
215
- echo $html;
216
- }
217
-
218
- /**
219
- * CheckBox Build Render
220
- *
221
- * @since 1.0.0
222
- * @param array $option['output']
223
- * @param string $output
224
- * @param string $value
225
- * @param string $display
226
- * @return string $html
227
- */
228
- private function output_checkbox_render( array $option, $output, $value, $display ) {
229
- $html = '<label>';
230
- $html .= '<input type="checkbox" name="output[' . $output . ']" value="' . $value . '""';
231
-
232
- if ( isset( $option[$output] ) ) {
233
- $html .= ' checked';
234
- }
235
- $html .= '>' . $display . '</label>';
236
-
237
- echo $html;
238
- }
239
-
240
- /**
241
- * Information Message Render
242
- *
243
- * @since 1.0.0
244
- */
245
- private function information_render() {
246
- $html = '<div id="message" class="updated notice notice-success is-dismissible below-h2">';
247
- $html .= '<p>Schema.org Information Update.</p>';
248
- $html .= '<button type="button" class="notice-dismiss">';
249
- $html .= '<span class="screen-reader-text">Dismiss this notice.</span>';
250
- $html .= '</button>';
251
- $html .= '</div>';
252
-
253
- echo $html;
254
- }
255
-
256
- /**
257
- * Error Message Render
258
- *
259
- * @since 1.0.0
260
- */
261
- private function output_error_render() {
262
- $html = '<div id="notice" class="notice notice-error is-dismissible below-h2">';
263
- $html .= '<p>Output No Select.</p>';
264
- $html .= '<button type="button" class="notice-dismiss">';
265
- $html .= '<span class="screen-reader-text">Dismiss this notice.</span>';
266
- $html .= '</button>';
267
- $html .= '</div>';
268
-
269
- echo $html;
270
- }
271
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/wp-structuring-admin-type-article.php DELETED
@@ -1,43 +0,0 @@
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
- */
11
- class Structuring_Markup_Type_Article {
12
-
13
- /**
14
- * Constructor Define.
15
- *
16
- * @since 1.1.0
17
- */
18
- public function __construct()
19
- {
20
- $this->page_render();
21
- }
22
-
23
- /**
24
- * Form Layout Render
25
- *
26
- * @since 1.1.0
27
- */
28
- private function page_render()
29
- {
30
- $html = '<table class="schema-admin-table">';
31
- $html .= '<caption>Basic Setting( Post Page Only )</caption>';
32
- $html .= '<tr><th>headline :</th><td><small>Default : post_title</small></td></tr>';
33
- $html .= '<tr><th>datePublished :</th><td><small>Default : get_the_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
- submit_button();
42
- }
43
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/wp-structuring-admin-type-blog-posting.php DELETED
@@ -1,44 +0,0 @@
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
- */
11
- class Structuring_Markup_Type_Blog_Posting {
12
-
13
- /**
14
- * Constructor Define.
15
- *
16
- * @since 1.2.0
17
- */
18
- public function __construct()
19
- {
20
- $this->page_render();
21
- }
22
-
23
- /**
24
- * Form Layout Render
25
- *
26
- * @since 1.2.0
27
- */
28
- private function page_render()
29
- {
30
- $html = '<table class="schema-admin-table">';
31
- $html .= '<caption>Basic Setting( Post Page Only )</caption>';
32
- $html .= '<tr><th>headline :</th><td><small>Default : post_title</small></td></tr>';
33
- $html .= '<tr><th>datePublished :</th><td><small>Default : get_the_time( DATE_ISO8601, ID )</small></td></tr>';
34
- $html .= '<tr><th>dateModified :</th><td><small>Default : get_the_modified_time( DATE_ISO8601, ID )</small></td></tr>';
35
- $html .= '<tr><th>author :</th><td><small>Default : get_the_author_meta( "display_name", author_ID )</small></td></tr>';
36
- $html .= '<tr><th>image :</th><td><small>Default : thumbnail</small></td></tr>';
37
- $html .= '<tr><th>description :</th><td><small>Default : post_excerpt</small></td></tr>';
38
- $html .= '<tr><th>articleBody :</th><td><small>Default : post_content</small></td></tr>';
39
- $html .= '</table>';
40
- echo $html;
41
-
42
- submit_button();
43
- }
44
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/wp-structuring-admin-type-news-article.php DELETED
@@ -1,44 +0,0 @@
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
- {
21
- $this->page_render();
22
- }
23
-
24
- /**
25
- * Form Layout Render
26
- *
27
- * @since 1.0.0
28
- */
29
- private function page_render()
30
- {
31
- $html = '<table class="schema-admin-table">';
32
- $html .= '<caption>Basic Setting( Post Page Only )</caption>';
33
- $html .= '<tr><th>headline :</th><td><small>Default : post_title</small></td></tr>';
34
- $html .= '<tr><th>datePublished :</th><td><small>Default : get_the_time( DATE_ISO8601, 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-organization.php DELETED
@@ -1,176 +0,0 @@
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
- {
53
- /** Default Value Set */
54
- if ( empty( $option ) ) {
55
- $option = $this->get_default_options( $option );
56
- }
57
- $this->page_render( $option );
58
- }
59
-
60
- /**
61
- * Form Layout Render
62
- *
63
- * @since 1.0.0
64
- * @param array $option
65
- */
66
- private function page_render( array $option )
67
- {
68
- /** Logos */
69
- $html = '<table class="schema-admin-table">';
70
- $html .= '<caption>Logos</caption>';
71
- $html .= '<tr><th><label for="name">Organization Name :</label></th><td>';
72
- $html .= '<input type="text" name="option[' . "name" . ']" id="name" class="regular-text" required value="' . esc_attr( $option['name'] ) . '">';
73
- $html .= '<small>Default : bloginfo("name")</small>';
74
- $html .= '</td></tr>';
75
- $html .= '<tr><th><label for="url">url :</label></th><td>';
76
- $html .= '<input type="text" name="option[' . "url" . ']" id="url" class="regular-text" required value="' . esc_attr( $option['url'] ) . '">';
77
- $html .= '<small>Default : bloginfo("url")</small>';
78
- $html .= '</td></tr>';
79
- $html .= '<tr><th><label for="logo">logo :</label></th><td>';
80
- $html .= '<input type="text" name="option[' . "logo" . ']" id="logo" class="regular-text" required value="' . esc_attr( $option['logo'] ) . '">';
81
- $html .= '<small>Default : bloginfo("logo") + "/images/logo.png"</small>';
82
- $html .= '</td></tr>';
83
- $html .= '</table>';
84
- echo $html;
85
-
86
- /** Corporate Contact */
87
- $html = '<table class="schema-admin-table">';
88
- $html .= '<caption>Corporate Contact</caption>';
89
- $html .= '<tr><th><label for="contact_point">contactPoint :</label></th><td>';
90
- $html .= '<input type="checkbox" name="option[' . "contact_point" . ']" id="contact_point" value="on"';
91
- if ( isset( $option['contact_point'] ) && $option['contact_point'] === 'on' ) {
92
- $html .= ' checked="checked"';
93
- }
94
- $html .= '>Active';
95
- $html .= '</td></tr>';
96
- $html .= '<tr><th><label for="telephone">telephone :</label></th><td>';
97
- $html .= '<input type="text" name="option[' . "telephone" . ']" id="telephone" class="regular-text" value="' . esc_attr( $option['telephone'] ) . '">';
98
- $html .= '<small>Default : +1-880-555-1212</small>';
99
- $html .= '</td></tr>';
100
- $html .= '<tr><th><label for="contact_type">contactType :</label></th><td>';
101
- $html .= '<select id="contact_type" name="option[' . "contact_type" . ']">';
102
- foreach ( $this->contact_type_array as $value ) {
103
- $html .= '<option value="' . $value['type'] . '"';
104
- if ( $value['type'] === $option['contact_type'] ) {
105
- $html .= ' selected';
106
- }
107
- $html .= '>' . $value['display'] . '</option>';
108
- }
109
- $html .= '</select>';
110
- $html .= '<small>Default : "customer support"</small>';
111
- $html .= '</td></tr>';
112
- $html .= '<tr><th><label for="area_served">areaServed :</label></th><td>';
113
- $html .= '<input type="text" name="option[' . "area_served" . ']" id="area_served" class="regular-text" value="' . esc_attr( $option['area_served'] ) . '">';
114
- $html .= '<small>Default : "US"&nbsp;&nbsp;Multiple : "US,CA"</small>';
115
- $html .= '</td></tr>';
116
- $html .= '<tr><th>contactOption :</th><td>';
117
- $html .= '<label><input type="checkbox" name="option[' . "contact_point_1" . ']" id="contact_point_1" value="on"';
118
- if ( isset( $option['contact_point_1'] ) && $option['contact_point_1'] === 'on' ) {
119
- $html .= ' checked="checked"';
120
- }
121
- $html .= '>HearingImpairedSupported</label><br>';
122
- $html .= '<label><input type="checkbox" name="option[' . "contact_point_2" . ']" id="contact_point_2" value="on"';
123
- if ( isset( $option['contact_point_2'] ) && $option['contact_point_2'] === 'on' ) {
124
- $html .= ' checked="checked"';
125
- }
126
- $html .= '>TollFree</label><br>';
127
- $html .= '</td></tr>';
128
- $html .= '<tr><th><label for="available_language">available<br>Language :</label></th><td>';
129
- $html .= '<input type="text" name="option[' . "available_language" . ']" id="available_language" class="regular-text" value="' . esc_attr( $option['available_language'] ) . '">';
130
- $html .= '<small>Default : "English"&nbsp;&nbsp;Multiple : "French,English"</small>';
131
- $html .= '</td></tr>';
132
- $html .= '</table>';
133
- echo $html;
134
-
135
- /** Social Profiles */
136
- $html = '<table class="schema-admin-table">';
137
- $html .= '<caption>Social Profiles</caption>';
138
- foreach ( $this->social_array as $value ) {
139
- $html .= '<tr><th><label for="' . $value['type'] . '">' . $value['display'] . ' :</label></th><td>';
140
- $html .= '<input type="text" name="option[' . "social" . '][' . $value['type'] . ']" id="' . $value['type'] . '" class="regular-text" value="' . esc_attr( $option['social'][$value['type']] ) . '">';
141
- $html .= '</td></tr>';
142
- }
143
- $html .= '</table>';
144
- echo $html;
145
-
146
- 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>';
147
- submit_button();
148
- }
149
-
150
- /**
151
- * Return the default options array
152
- *
153
- * @since 1.0.0
154
- * @param array $args
155
- * @return array $args
156
- */
157
- private function get_default_options( array $args ) {
158
- $args['id'] = '';
159
- $args['name'] = get_bloginfo('name');
160
- $args['url'] = get_bloginfo('url');
161
- $args['logo'] = get_bloginfo('url') . '/images/logo.png';
162
- $args['contact_point'] = '';
163
- $args['telephone'] = '+1-880-555-1212';
164
- $args['contact_type'] = 'customer_support';
165
- $args['area_served'] = 'US';
166
- $args['contact_option_1'] = '';
167
- $args['contact_option_2'] = '';
168
- $args['available_language'] = 'English';
169
-
170
- foreach ( $this->social_array as $value ) {
171
- $args['social'][$value['type']] = '';
172
- }
173
-
174
- return (array) $args;
175
- }
176
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/wp-structuring-admin-type-website.php DELETED
@@ -1,92 +0,0 @@
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
- {
23
- /** Default Value Set */
24
- if ( empty( $option ) ) {
25
- $option = $this->get_default_options( $option );
26
- }
27
- $this->page_render( $option );
28
- }
29
-
30
- /**
31
- * Form Layout Render
32
- *
33
- * @since 1.0.0
34
- * @param array $option
35
- */
36
- private function page_render( array $option )
37
- {
38
- $html = '<table class="schema-admin-table">';
39
- $html .= '<caption>Basic Setting</caption>';
40
- $html .= '<tr><th><label for="name">name :</label></th><td>';
41
- $html .= '<input type="text" name="option[' . "name" . ']" id="name" class="regular-text" required value="' . esc_attr( $option['name'] ) . '">';
42
- $html .= '<small>Default : bloginfo("name")</small>';
43
- $html .= '</td></tr>';
44
- $html .= '<tr><th><label for="alternateName">alternateName :</label></th><td>';
45
- $html .= '<input type="text" name="option[' . "alternateName" . ']" id="alternateName" class="regular-text" value="' . esc_attr( $option['alternateName'] ) . '">';
46
- $html .= '<small>Default : bloginfo("name")</small>';
47
- $html .= '</td></tr>';
48
- $html .= '<tr><th><label for="url">url :</label></th><td>';
49
- $html .= '<input type="text" name="option[' . "url" . ']" id="url" class="regular-text" required value="' . esc_attr( $option['url'] ) . '">';
50
- $html .= '<small>Default : bloginfo("url")</small>';
51
- $html .= '</td></tr>';
52
- $html .= '</table>';
53
- echo $html;
54
-
55
- $html = '<table class="schema-admin-table">';
56
- $html .= '<caption>Sitelink Search Box</caption>';
57
- $html .= '<tr><th><label for="potential_action">potentialAction Active :</label></th><td>';
58
- $html .= '<input type="checkbox" name="option[' . "potential_action" . ']" id="potential_action" value="on"';
59
- if ( isset( $option['potential_action'] ) && $option['potential_action'] === 'on' ) {
60
- $html .= ' checked="checked"';
61
- }
62
- $html .= '>Active';
63
- $html .= '</td></tr>';
64
- $html .= '<tr><th><label for="target">target :</label></th><td>';
65
- $html .= '<input type="text" name="option[' . "target" . ']" id="target" class="regular-text" value="' . esc_attr( $option['target'] ) . '">';
66
- $html .= '<small>Default : bloginfo("url") + /?s=</small>';
67
- $html .= '</td></tr>';
68
- $html .= '</table>';
69
- echo $html;
70
-
71
- 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>';
72
- submit_button();
73
- }
74
-
75
- /**
76
- * Return the default options array
77
- *
78
- * @since 1.0.0
79
- * @param array $args
80
- * @return array $args
81
- */
82
- private function get_default_options( array $args ) {
83
- $args['id'] = '';
84
- $args['name'] = get_bloginfo('name');
85
- $args['alternateName'] = $args['name'];
86
- $args['url'] = get_bloginfo('url');
87
- $args['potential_action'] = '';
88
- $args['target'] = $args['url'] . '/?s=';
89
-
90
- return (array) $args;
91
- }
92
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/wp-structuring-display.php DELETED
@@ -1,250 +0,0 @@
1
- <?php
2
- /**
3
- * Schema.org Display
4
- *
5
- * @author Kazuya Takami
6
- * @version 1.2.1
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
- * @param Structuring_Markup_Admin_Db $db
26
- */
27
- private function set_schema( Structuring_Markup_Admin_Db $db ) {
28
- $this->get_schema_data( $db, 'all' );
29
- if ( is_home() ) {
30
- $this->get_schema_data( $db, 'home' );
31
- }
32
- if ( is_single() ) {
33
- $this->get_schema_data( $db, 'post' );
34
- }
35
- if ( is_page() ) {
36
- $this->get_schema_data( $db, 'page' );
37
- }
38
- }
39
-
40
- /**
41
- * Setting JSON-LD Template
42
- *
43
- * @since 1.0.0
44
- * @version 1.2.0
45
- * @param Structuring_Markup_Admin_Db $db
46
- * @param string $output
47
- */
48
- private function get_schema_data( Structuring_Markup_Admin_Db $db, $output ) {
49
- $results = $db->get_select_options( $output );
50
-
51
- if ( isset( $results ) ) {
52
- foreach ( $results as $row ) {
53
- if ( isset( $row->type ) ) {
54
- switch ( $row->type ) {
55
- case 'website':
56
- if ( isset( $row->options ) ) {
57
- $this->set_schema_website( unserialize( $row->options ) );
58
- }
59
- break;
60
- case 'organization':
61
- if ( isset( $row->options ) ) {
62
- $this->set_schema_organization( unserialize( $row->options ) );
63
- }
64
- break;
65
- case 'article':
66
- if ( isset( $row->options ) ) {
67
- $this->set_schema_article();
68
- }
69
- break;
70
- case 'blog_posting':
71
- if ( isset( $row->options ) ) {
72
- $this->set_schema_blog_posting();
73
- }
74
- break;
75
- case 'news_article':
76
- if ( isset( $row->options ) ) {
77
- $this->set_schema_news_article();
78
- }
79
- break;
80
- }
81
- }
82
- }
83
- }
84
- }
85
-
86
- /**
87
- * Setting JSON-LD Template
88
- *
89
- * @since 1.0.0
90
- * @param array $args
91
- */
92
- private function set_schema_json( array $args ) {
93
- echo '<script type="application/ld+json">' , PHP_EOL;
94
- echo json_encode( $args, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT ) , PHP_EOL;
95
- echo '</script>' , PHP_EOL;
96
- }
97
-
98
- /**
99
- * Setting JSON-LD Template
100
- *
101
- * @since 1.1.3
102
- * @param string $text
103
- * @return string $text
104
- */
105
- private function escape_text_tags( $text ) {
106
- return str_replace( array( "\r", "\n" ), '', strip_tags( $text ) );
107
- }
108
-
109
- /**
110
- * Setting schema.org WebSite
111
- *
112
- * @since 1.0.0
113
- * @param array $options
114
- */
115
- private function set_schema_website( array $options ) {
116
- $args = array(
117
- "@context" => "http://schema.org",
118
- "@type" => "WebSite",
119
- "name" => isset( $options['name'] ) ? esc_html( $options['name'] ) : "",
120
- "alternateName" => isset( $options['alternateName'] ) ? esc_html( $options['alternateName'] ) : "",
121
- "url" => isset( $options['url'] ) ? esc_html( $options['url'] ) : ""
122
- );
123
-
124
- if ( isset( $options['potential_action'] ) && $options['potential_action'] === 'on' ) {
125
- $potential_action["potentialAction"] = array(
126
- "@type" => "SearchAction",
127
- "target" => isset( $options['target'] ) ? esc_html( $options['target'] ) . "{search_term_string}" : "",
128
- "query-input" => isset( $options['target'] ) ? "required name=search_term_string" : ""
129
- );
130
- $args = array_merge( $args, $potential_action );
131
- }
132
-
133
- $this->set_schema_json( $args );
134
- }
135
-
136
- /**
137
- * Setting schema.org Organization
138
- *
139
- * @since 1.0.0
140
- * @version 1.2.1
141
- * @param array $options
142
- */
143
- private function set_schema_organization( array $options ) {
144
- /** Logos */
145
- $args = array(
146
- "@context" => "http://schema.org",
147
- "@type" => "Organization",
148
- "name" => isset( $options['name'] ) ? esc_html( $options['name'] ) : "",
149
- "url" => isset( $options['url'] ) ? esc_html( $options['url'] ) : "",
150
- "logo" => isset( $options['logo'] ) ? esc_html( $options['logo'] ) : ""
151
- );
152
-
153
- /** Corporate Contact */
154
- if ( isset( $options['contact_point'] ) && $options['contact_point'] === 'on' ) {
155
- $contact_point["contactPoint"] = array(
156
- array(
157
- "@type" => "ContactPoint",
158
- "telephone" => isset( $options['telephone'] ) ? esc_html( $options['telephone'] ) : "",
159
- "contactType" => isset( $options['contact_type'] ) ? esc_html( $options['contact_type'] ) : ""
160
- )
161
- );
162
- $args = array_merge( $args, $contact_point );
163
- }
164
-
165
- /** Social Profiles */
166
- if ( isset( $options['social'] ) ) {
167
- $socials["sameAs"] = array();
168
-
169
- foreach ( $options['social'] as $value ) {
170
- if ( !empty( $value ) ) {
171
- $socials["sameAs"][] = esc_html( $value );
172
- }
173
- }
174
- $args = array_merge( $args, $socials );
175
- }
176
- $this->set_schema_json( $args );
177
- }
178
-
179
- /**
180
- * Setting schema.org Article
181
- *
182
- * @since 1.1.0
183
- * @version 1.1.3
184
- */
185
- private function set_schema_article() {
186
- global $post;
187
- if ( has_post_thumbnail( $post->ID ) ) {
188
- $images = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
189
- $args = array(
190
- "@context" => "http://schema.org",
191
- "@type" => "Article",
192
- "headline" => $this->escape_text_tags( $post->post_title ),
193
- "datePublished" => get_the_time( DATE_ISO8601, $post->ID ),
194
- "author" => $this->escape_text_tags( get_the_author_meta( 'display_name', $post->post_author ) ),
195
- "image" => array( $images[0] ),
196
- "description" => $this->escape_text_tags( $post->post_excerpt ),
197
- "articleBody" => $this->escape_text_tags( $post->post_content )
198
- );
199
- $this->set_schema_json( $args );
200
- }
201
- }
202
-
203
- /**
204
- * Setting schema.org BlogPosting
205
- *
206
- * @since 1.2.0
207
- * @version 1.2.0
208
- */
209
- private function set_schema_blog_posting() {
210
- global $post;
211
- if ( has_post_thumbnail( $post->ID ) ) {
212
- $images = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
213
- $args = array(
214
- "@context" => "http://schema.org",
215
- "@type" => "BlogPosting",
216
- "headline" => $this->escape_text_tags( $post->post_title ),
217
- "datePublished" => get_the_time( DATE_ISO8601, $post->ID ),
218
- "dateModified" => get_the_modified_time( DATE_ISO8601, $post->ID ),
219
- "author" => $this->escape_text_tags( get_the_author_meta( 'display_name', $post->post_author ) ),
220
- "image" => array( $images[0] ),
221
- "description" => $this->escape_text_tags( $post->post_excerpt ),
222
- "articleBody" => $this->escape_text_tags( $post->post_content )
223
- );
224
- $this->set_schema_json( $args );
225
- }
226
- }
227
-
228
- /**
229
- * Setting schema.org NewsArticle
230
- *
231
- * @since 1.0.0
232
- * @version 1.1.3
233
- */
234
- private function set_schema_news_article() {
235
- global $post;
236
- if ( has_post_thumbnail( $post->ID ) ) {
237
- $images = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );
238
- $args = array(
239
- "@context" => "http://schema.org",
240
- "@type" => "NewsArticle",
241
- "headline" => $this->escape_text_tags( $post->post_title ),
242
- "datePublished" => get_the_time( DATE_ISO8601, $post->ID ),
243
- "image" => array( $images[0] ),
244
- "description" => $this->escape_text_tags( $post->post_excerpt ),
245
- "articleBody" => $this->escape_text_tags( $post->post_content )
246
- );
247
- $this->set_schema_json( $args );
248
- }
249
- }
250
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/languages/wp-structuring-markup-ja.mo DELETED
Binary file
trunk/languages/wp-structuring-markup-ja.po DELETED
@@ -1,113 +0,0 @@
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 1.3.0\n"
6
- "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-structuring-"
7
- "markup\n"
8
- "POT-Creation-Date: 2015-10-24 10:02:34+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:65
17
- msgid "Schema.org Setting List"
18
- msgstr "Schema.org 設定一覧"
19
-
20
- #: includes/wp-structuring-admin-list.php:66 wp-structuring-markup.php:95
21
- msgid "Add New"
22
- msgstr "新規追加"
23
-
24
- #: includes/wp-structuring-admin-list.php:77
25
- msgid "Schema Type"
26
- msgstr ""
27
-
28
- #: includes/wp-structuring-admin-list.php:78
29
- #: includes/wp-structuring-admin-post.php:161
30
- msgid "Output Page"
31
- msgstr "出力ページ"
32
-
33
- #: includes/wp-structuring-admin-list.php:79
34
- msgid "Register Date"
35
- msgstr "登録日"
36
-
37
- #: includes/wp-structuring-admin-list.php:80
38
- msgid "Update Date"
39
- msgstr "更新日"
40
-
41
- #: includes/wp-structuring-admin-list.php:99
42
- msgid "Edit"
43
- msgstr "編集"
44
-
45
- #: includes/wp-structuring-admin-list.php:102
46
- msgid "Delete"
47
- msgstr "削除"
48
-
49
- #: includes/wp-structuring-admin-list.php:109
50
- msgid "Without registration."
51
- msgstr "登録されていません。"
52
-
53
- #: includes/wp-structuring-admin-post.php:120
54
- msgid "Schema.org Register"
55
- msgstr "Scheme.org 登録"
56
-
57
- #: includes/wp-structuring-admin-post.php:166
58
- #: includes/wp-structuring-admin-post.php:177
59
- msgid "All Page"
60
- msgstr "全てのページ"
61
-
62
- #: includes/wp-structuring-admin-post.php:167
63
- #: includes/wp-structuring-admin-post.php:178
64
- msgid "Top Page"
65
- msgstr "トップページ"
66
-
67
- #: includes/wp-structuring-admin-post.php:168
68
- #: includes/wp-structuring-admin-post.php:179
69
- #: includes/wp-structuring-admin-post.php:188
70
- #: includes/wp-structuring-admin-post.php:196
71
- #: includes/wp-structuring-admin-post.php:204
72
- msgid "Post Page"
73
- msgstr "投稿ページ"
74
-
75
- #: includes/wp-structuring-admin-post.php:169
76
- #: includes/wp-structuring-admin-post.php:180
77
- msgid "Fixed Page"
78
- msgstr "固定ページ"
79
-
80
- #: wp-structuring-markup.php:78 wp-structuring-markup.php:79
81
- msgid "Scheme.org Setting"
82
- msgstr "Scheme.org 設定"
83
-
84
- #: wp-structuring-markup.php:86 wp-structuring-markup.php:87
85
- msgid "Setting All"
86
- msgstr "設定一覧"
87
-
88
- #: wp-structuring-markup.php:94
89
- msgid "Scheme.org Setting Post"
90
- msgstr "新規登録"
91
-
92
- #. Plugin Name of the plugin/theme
93
- msgid "Markup (JSON-LD) structured in schema.org"
94
- msgstr ""
95
-
96
- #. Plugin URI of the plugin/theme
97
- msgid "https://github.com/miiitaka/wp-structuring-markup"
98
- msgstr ""
99
-
100
- #. Description of the plugin/theme
101
- msgid ""
102
- "It is plug in to implement structured markup (JSON-LD syntax) by schema.org "
103
- "definition on an article or the fixed page."
104
- msgstr ""
105
- "このプラグインは、投稿ページ、固定ページなどにschema.org定義の構造化マークアップ( JSON -LDの構文)を実装するプラグインです。"
106
-
107
- #. Author of the plugin/theme
108
- msgid "Kazuya Takami"
109
- msgstr ""
110
-
111
- #. Author URI of the plugin/theme
112
- msgid "http://programp.com/"
113
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/languages/wp-structuring-markup.pot DELETED
@@ -1,112 +0,0 @@
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 1.3.0\n"
6
- "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-structuring-"
7
- "markup\n"
8
- "POT-Creation-Date: 2015-10-24 10:02:34+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:65
17
- msgid "Schema.org Setting List"
18
- msgstr ""
19
-
20
- #: includes/wp-structuring-admin-list.php:66 wp-structuring-markup.php:95
21
- msgid "Add New"
22
- msgstr ""
23
-
24
- #: includes/wp-structuring-admin-list.php:77
25
- msgid "Schema Type"
26
- msgstr ""
27
-
28
- #: includes/wp-structuring-admin-list.php:78
29
- #: includes/wp-structuring-admin-post.php:161
30
- msgid "Output Page"
31
- msgstr ""
32
-
33
- #: includes/wp-structuring-admin-list.php:79
34
- msgid "Register Date"
35
- msgstr ""
36
-
37
- #: includes/wp-structuring-admin-list.php:80
38
- msgid "Update Date"
39
- msgstr ""
40
-
41
- #: includes/wp-structuring-admin-list.php:99
42
- msgid "Edit"
43
- msgstr ""
44
-
45
- #: includes/wp-structuring-admin-list.php:102
46
- msgid "Delete"
47
- msgstr ""
48
-
49
- #: includes/wp-structuring-admin-list.php:109
50
- msgid "Without registration."
51
- msgstr ""
52
-
53
- #: includes/wp-structuring-admin-post.php:120
54
- msgid "Schema.org Post"
55
- msgstr ""
56
-
57
- #: includes/wp-structuring-admin-post.php:166
58
- #: includes/wp-structuring-admin-post.php:177
59
- msgid "All Page"
60
- msgstr ""
61
-
62
- #: includes/wp-structuring-admin-post.php:167
63
- #: includes/wp-structuring-admin-post.php:178
64
- msgid "Top Page"
65
- msgstr ""
66
-
67
- #: includes/wp-structuring-admin-post.php:168
68
- #: includes/wp-structuring-admin-post.php:179
69
- #: includes/wp-structuring-admin-post.php:188
70
- #: includes/wp-structuring-admin-post.php:196
71
- #: includes/wp-structuring-admin-post.php:204
72
- msgid "Post Page"
73
- msgstr ""
74
-
75
- #: includes/wp-structuring-admin-post.php:169
76
- #: includes/wp-structuring-admin-post.php:180
77
- msgid "Fixed Page"
78
- msgstr ""
79
-
80
- #: wp-structuring-markup.php:78 wp-structuring-markup.php:79
81
- msgid "Scheme.org Setting"
82
- msgstr ""
83
-
84
- #: wp-structuring-markup.php:86 wp-structuring-markup.php:87
85
- msgid "Setting All"
86
- msgstr ""
87
-
88
- #: wp-structuring-markup.php:94
89
- msgid "Scheme.org Setting Post"
90
- msgstr ""
91
-
92
- #. Plugin Name of the plugin/theme
93
- msgid "Markup (JSON-LD) structured in schema.org"
94
- msgstr ""
95
-
96
- #. Plugin URI of the plugin/theme
97
- msgid "https://github.com/miiitaka/wp-structuring-markup"
98
- msgstr ""
99
-
100
- #. Description of the plugin/theme
101
- msgid ""
102
- "It is plug in to implement structured markup (JSON-LD syntax) by schema.org "
103
- "definition on an article or the fixed page."
104
- msgstr ""
105
-
106
- #. Author of the plugin/theme
107
- msgid "Kazuya Takami"
108
- msgstr ""
109
-
110
- #. Author URI of the plugin/theme
111
- msgid "http://programp.com/"
112
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/readme.txt DELETED
@@ -1,71 +0,0 @@
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: 1.3.0
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定義の構造化マークアップ( JSON -LDの構文)を実装するプラグインです。
16
- 基本知識は、https://schema.org/ や https://developers.google.com/structured-data/ を参考にしてください。
17
-
18
- = Schema.org Type =
19
-
20
- * Website: https://schema.org/WebSite
21
- * Organization: https://schema.org/Organization
22
- * Article: http://schema.org/Article
23
- * BlogPosting: http://schema.org/BlogPosting
24
- * NewsArticle: http://schema.org/NewsArticle
25
-
26
- == Installation ==
27
-
28
- * A plug-in installation screen is displayed in the WordPress admin panel.
29
- * It installs in `wp-content/plugins`.
30
- * The plug-in is activated.
31
- * Open 'Schema.org Setting' menu.
32
-
33
- == Changelog ==
34
-
35
- = 1.3.0 =
36
-
37
- * Added : Localizing into Japanese.
38
-
39
- = 1.2.1 =
40
-
41
- * Updated : Read admin menu css -> wp_register_style setting
42
- * Fixed : Typo Missing.
43
-
44
- = 1.2.0 =
45
-
46
- * Added : Schema.org type "BlogPosting".
47
-
48
- = 1.1.3 =
49
-
50
- * Fixed : To escape a newline code and the tag of the body attribute in Type "Article" and "NewsArticle".
51
-
52
- = 1.1.2 =
53
-
54
- * Updated : Schema.org type "Article" image attribute.
55
-
56
- = 1.1.0 =
57
-
58
- * Added : Schema.org type "Article".
59
-
60
- = 1.0.1 - 1.0.8 =
61
-
62
- * Fixed : Missing plugin path setting.
63
-
64
- = 1.0.0 =
65
-
66
- * First release of this plugin.
67
-
68
- == Contact ==
69
-
70
- email to foundationmeister[at]outlook.com
71
- twitter @miiitaka
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/uninstall.php DELETED
@@ -1,35 +0,0 @@
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 1.0.0
12
- * @since 1.0.0
13
- */
14
- class Structuring_Markup_Uninstall {
15
-
16
- /**
17
- * Constructor Define.
18
- *
19
- * @since 1.0.0
20
- */
21
- function __construct() {
22
- $this->drop_table();
23
- }
24
-
25
- /**
26
- * Drop Table.
27
- *
28
- * @since 1.0.0
29
- */
30
- private function drop_table() {
31
- global $wpdb;
32
- $table_name = $wpdb->prefix . "structuring_markup";
33
- $wpdb->query( "DROP TABLE IF EXISTS " . $table_name );
34
- }
35
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/wp-structuring-markup.php DELETED
@@ -1,154 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Markup (JSON-LD) structured in schema.org
4
- Plugin URI: https://github.com/miiitaka/wp-structuring-markup
5
- Description: It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an article or the fixed page.
6
- Version: 1.3.0
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 1.3.0
23
- */
24
- class Structuring_Markup {
25
-
26
- /**
27
- * Variable definition.
28
- *
29
- * @since 1.3.0
30
- */
31
- private $text_domain = 'wp-structuring-markup';
32
-
33
- /**
34
- * Constructor Define.
35
- *
36
- * @since 1.0.0
37
- * @version 1.3.0
38
- */
39
- public function __construct() {
40
- add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ) );
41
-
42
- $db = new Structuring_Markup_Admin_Db();
43
- $db->create_table();
44
-
45
- if ( is_admin() ) {
46
- add_action( 'admin_init', array( $this, 'admin_init' ) );
47
- add_action( 'admin_menu', array( $this, 'admin_menu' ) );
48
- } else {
49
- add_action( 'wp_head', array( $this, 'wp_head' ) );
50
- }
51
- }
52
-
53
- /**
54
- * admin init.
55
- *
56
- * @since 1.3.0
57
- * @version 1.3.0
58
- */
59
- public function admin_init() {
60
- wp_register_style( 'wp-structuring-markup-admin-style', plugins_url( 'css/style.css', __FILE__ ) );
61
- }
62
-
63
- /**
64
- * i18n.
65
- *
66
- * @since 1.3.0
67
- * @version 1.3.0
68
- */
69
- public function plugins_loaded() {
70
- load_plugin_textdomain(
71
- $this->text_domain,
72
- false,
73
- dirname( plugin_basename( __FILE__ ) ) . '/languages'
74
- );
75
- }
76
-
77
- /**
78
- * Add Menu to the Admin Screen.
79
- *
80
- * @since 1.0.0
81
- * @version 1.2.1
82
- */
83
- public function admin_menu() {
84
- add_menu_page(
85
- esc_html__( 'Scheme.org Setting', $this->text_domain ),
86
- esc_html__( 'Scheme.org Setting', $this->text_domain ),
87
- 'manage_options',
88
- plugin_basename( __FILE__ ),
89
- array( $this, 'list_page_render' )
90
- );
91
- add_submenu_page(
92
- __FILE__,
93
- esc_html__( 'Setting All', $this->text_domain ),
94
- esc_html__( 'Setting All', $this->text_domain ),
95
- 'manage_options',
96
- plugin_basename( __FILE__ ),
97
- array( $this, 'list_page_render' )
98
- );
99
- $page = add_submenu_page(
100
- __FILE__,
101
- esc_html__( 'Scheme.org Setting Post', $this->text_domain ),
102
- esc_html__( 'Add New', $this->text_domain ),
103
- 'manage_options',
104
- plugin_dir_path( __FILE__ ) . 'includes/wp-structuring-admin-post.php',
105
- array( $this, 'post_page_render' )
106
- );
107
-
108
- /* Using registered $page handle to hook stylesheet loading */
109
- add_action( 'admin_print_styles-' . $page, array( $this, 'add_style' ) );
110
- }
111
-
112
- /**
113
- * CSS admin add.
114
- *
115
- * @since 1.0.0
116
- * @version 1.3.0
117
- */
118
- public function add_style() {
119
- wp_enqueue_style( 'wp-structuring-markup-admin-style' );
120
- }
121
-
122
- /**
123
- * LIST Page Template Require.
124
- *
125
- * @since 1.0.0
126
- * @version 1.3.0
127
- */
128
- public function list_page_render() {
129
- require_once( plugin_dir_path( __FILE__ ) . 'includes/wp-structuring-admin-list.php' );
130
- new Structuring_Markup_Admin_List( $this->text_domain );
131
- }
132
-
133
- /**
134
- * POST Page Template Require.
135
- *
136
- * @since 1.0.0
137
- * @version 1.3.0
138
- */
139
- public function post_page_render() {
140
- require_once( plugin_dir_path( __FILE__ ) . 'includes/wp-structuring-admin-post.php' );
141
- new Structuring_Markup_Admin_Post( $this->text_domain );
142
- }
143
-
144
- /**
145
- * Display Page Template Require.
146
- *
147
- * @since 1.3.0
148
- * @version 1.3.0
149
- */
150
- public function wp_head() {
151
- require_once( plugin_dir_path( __FILE__ ) . 'includes/wp-structuring-display.php' );
152
- new Structuring_Markup_Display();
153
- }
154
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wp-structuring-markup.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Markup (JSON-LD) structured in schema.org
4
  Plugin URI: https://github.com/miiitaka/wp-structuring-markup
5
  Description: It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an article or the fixed page.
6
- Version: 1.3.0
7
  Author: Kazuya Takami
8
  Author URI: http://programp.com/
9
  License: GPLv2 or later
@@ -19,7 +19,7 @@ new Structuring_Markup();
19
  *
20
  * @author Kazuya Takami
21
  * @since 1.0.0
22
- * @version 1.3.0
23
  */
24
  class Structuring_Markup {
25
 
@@ -43,16 +43,23 @@ class Structuring_Markup {
43
  $db->create_table();
44
 
45
  if ( is_admin() ) {
46
- /** Register Plug-in CSS */
47
- add_action( 'admin_init', function () {
48
- wp_register_style( 'wp-structuring-markup-admin-style', plugins_url( 'css/style.css', __FILE__ ) );
49
- });
50
  add_action( 'admin_menu', array( $this, 'admin_menu' ) );
51
  } else {
52
  add_action( 'wp_head', array( $this, 'wp_head' ) );
53
  }
54
  }
55
 
 
 
 
 
 
 
 
 
 
 
56
  /**
57
  * i18n.
58
  *
@@ -99,9 +106,17 @@ class Structuring_Markup {
99
  );
100
 
101
  /* Using registered $page handle to hook stylesheet loading */
102
- add_action( 'admin_print_styles-' . $page, function () {
103
- wp_enqueue_style( 'wp-structuring-markup-admin-style' );
104
- });
 
 
 
 
 
 
 
 
105
  }
106
 
107
  /**
3
  Plugin Name: Markup (JSON-LD) structured in schema.org
4
  Plugin URI: https://github.com/miiitaka/wp-structuring-markup
5
  Description: It is plug in to implement structured markup (JSON-LD syntax) by schema.org definition on an article or the fixed page.
6
+ Version: 1.3.1
7
  Author: Kazuya Takami
8
  Author URI: http://programp.com/
9
  License: GPLv2 or later
19
  *
20
  * @author Kazuya Takami
21
  * @since 1.0.0
22
+ * @version 1.3.1
23
  */
24
  class Structuring_Markup {
25
 
43
  $db->create_table();
44
 
45
  if ( is_admin() ) {
46
+ add_action( 'admin_init', array( $this, 'admin_init' ) );
 
 
 
47
  add_action( 'admin_menu', array( $this, 'admin_menu' ) );
48
  } else {
49
  add_action( 'wp_head', array( $this, 'wp_head' ) );
50
  }
51
  }
52
 
53
+ /**
54
+ * admin init.
55
+ *
56
+ * @since 1.3.1
57
+ * @version 1.3.1
58
+ */
59
+ public function admin_init() {
60
+ wp_register_style( 'wp-structuring-markup-admin-style', plugins_url( 'css/style.css', __FILE__ ) );
61
+ }
62
+
63
  /**
64
  * i18n.
65
  *
106
  );
107
 
108
  /* Using registered $page handle to hook stylesheet loading */
109
+ add_action( 'admin_print_styles-' . $page, array( $this, 'add_style' ) );
110
+ }
111
+
112
+ /**
113
+ * CSS admin add.
114
+ *
115
+ * @since 1.3.1
116
+ * @version 1.3.1
117
+ */
118
+ public function add_style() {
119
+ wp_enqueue_style( 'wp-structuring-markup-admin-style' );
120
  }
121
 
122
  /**