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

Version Description

(2015-12-04) =

  • Added : Add the table update processing at the time of version up
Download this release

Release Info

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

Code changes from version 2.1.0 to 2.1.1

includes/wp-structuring-admin-db.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author Kazuya Takami
6
  * @since 1.0.0
7
- * @version 2.1.0
8
  */
9
  class Structuring_Markup_Admin_Db {
10
 
@@ -42,9 +42,11 @@ class Structuring_Markup_Admin_Db {
42
  * Create Table.
43
  *
44
  * @since 1.0.0
45
- * @version 2.1.0
 
 
46
  */
47
- public function create_table () {
48
  require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
49
 
50
  global $wpdb;
@@ -54,7 +56,7 @@ class Structuring_Markup_Admin_Db {
54
  $charset_collate = $wpdb->get_charset_collate();
55
 
56
  if ( is_null( $is_db_exists ) ) {
57
- $this->create_table_execute( $charset_collate );
58
 
59
  foreach ( $this->type_array as $key => $value ) {
60
  $args = array(
@@ -69,18 +71,18 @@ class Structuring_Markup_Admin_Db {
69
  }
70
  } else {
71
  /**
72
- * version 1.x.x -> 2.1.0 migration process.
73
  *
74
  * @since 2.0.0
75
- * @version 2.1.0
76
  * */
77
- $options = get_option( 'wp_structuring_markup' );
78
 
79
- if ( !isset( $options['version'] ) || $options['version'] === '2.0.0' ) {
80
  $lists = $this->get_list_options();
81
 
82
  $wpdb->query( "DROP TABLE " . $this->table_name );
83
- $this->create_table_execute( $charset_collate );
84
 
85
  foreach ( $this->type_array as $key => $value ) {
86
  $args = array(
@@ -115,10 +117,12 @@ class Structuring_Markup_Admin_Db {
115
  * Create table execute
116
  *
117
  * @since 2.0.0
118
- * @version 2.1.0
119
  * @param string $charset_collate
 
 
120
  */
121
- private function create_table_execute ( $charset_collate ) {
122
  $query = " CREATE TABLE " . $this->table_name;
123
  $query .= " (id MEDIUMINT(9) NOT NULL AUTO_INCREMENT PRIMARY KEY";
124
  $query .= ",type TINYTEXT NOT NULL";
@@ -131,8 +135,8 @@ class Structuring_Markup_Admin_Db {
131
 
132
  dbDelta( $query );
133
 
134
- $options = array( 'version' => '2.1.0' );
135
- update_option( 'wp_structuring_markup', $options, 'yes' );
136
  }
137
 
138
  /**
4
  *
5
  * @author Kazuya Takami
6
  * @since 1.0.0
7
+ * @version 2.1.1
8
  */
9
  class Structuring_Markup_Admin_Db {
10
 
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;
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(
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(
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";
135
 
136
  dbDelta( $query );
137
 
138
+ $options = array( 'version' => $version );
139
+ update_option( $text_domain, $options, 'yes' );
140
  }
141
 
142
  /**
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: 2.1.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
 
@@ -37,6 +37,10 @@ You can display the breadcrumbs in the short code. Breadcrumb definition is avai
37
 
38
  == Changelog ==
39
 
 
 
 
 
40
  = 2.1.0 (2015-12-03) =
41
 
42
  * Added : Schema.org type "Event" schema.org definition Add "Event" custom post output that works
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
 
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
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.0
7
  Author: Kazuya Takami
8
  Author URI: http://programp.com/
9
  License: GPLv2 or later
@@ -19,16 +19,18 @@ new Structuring_Markup();
19
  *
20
  * @author Kazuya Takami
21
  * @since 1.0.0
22
- * @version 2.1.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.
@@ -60,7 +62,7 @@ class Structuring_Markup {
60
  */
61
  public function create_table() {
62
  $db = new Structuring_Markup_Admin_Db();
63
- $db->create_table();
64
  }
65
 
66
  /**
@@ -108,9 +110,15 @@ class Structuring_Markup {
108
  * admin init.
109
  *
110
  * @since 1.3.1
111
- * @version 1.3.1
112
  */
113
  public function admin_init () {
 
 
 
 
 
 
114
  wp_register_style( 'wp-structuring-markup-admin-style', plugins_url( 'css/style.css', __FILE__ ) );
115
  }
116
 
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
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.
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
  /**
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