Schema - Version 1.7.5

Version Description

  • Fix: PHP Fatal error when truncating long headlines.
  • Fix: PHP warning when parse HTML5-code, added a better error suppression.
  • Tweak: Added a discount code for Schema Premium message.
  • Update: Pumped tested WordPress version to 5.1 release.
Download this release

Release Info

Developer hishaman
Plugin Icon 128x128 Schema
Version 1.7.5
Comparing to
See all releases

Code changes from version 1.7.4 to 1.7.5

includes/admin/meta.php CHANGED
@@ -246,7 +246,7 @@ $fields_schema_premium_plugin = array(
246
 
247
  array( // Post Types Select box
248
  'label' => '', // <label>
249
- 'desc' => '<b>'.__('Want to enable new features?', 'schema-wp') .'<br>'. __(' Check out <a target="_blank" href="https://schema.press/downloads/schema-premium/">Schema Premium</a>.', 'schema-wp') . '</b>', // description
250
  'id' => $prefix.'schema_premium', // field id and name
251
  'type' => 'desc' // type of field
252
  ),
246
 
247
  array( // Post Types Select box
248
  'label' => '', // <label>
249
+ 'desc' => '<b>'.__('Want to enable new features?', 'schema-wp').'<br><br>'.__(' <a class="button button-large" target="_blank" href="https://schema.press/downloads/schema-premium/">Get Schema Premium</a>', 'schema-wp').'</b><br><br>'.__('Save 15% off your purchase? Use discount code: <b>SPFREE15</b>', 'schema-wp'), // description
250
  'id' => $prefix.'schema_premium', // field id and name
251
  'type' => 'desc' // type of field
252
  ),
includes/misc-functions.php CHANGED
@@ -345,13 +345,19 @@ function schema_wp_get_media( $post_id = null) {
345
 
346
  if ( $post->post_content ) {
347
  $Document = new DOMDocument();
 
 
 
348
  @$Document->loadHTML( $post->post_content );
 
 
349
  $DocumentImages = $Document->getElementsByTagName( 'img' );
350
 
351
  if ( $DocumentImages->length ) {
352
  $image_url = $DocumentImages->item( 0 )->getAttribute( 'src' );
353
  $image_width = ( $DocumentImages->item( 0 )->getAttribute( 'width' ) > 696 ) ? $DocumentImages->item( 0 )->getAttribute( 'width' ) : 696;
354
  $image_height = $DocumentImages->item( 0 )->getAttribute( 'height' );
 
355
  }
356
  }
357
  }
@@ -890,11 +896,12 @@ function schema_wp_is_blog() {
890
  * @since 1.7.1
891
  * @return string
892
  */
893
- function schema_wp_get_truncate_to_word( $value, $limit = 110, $end = '...' ) {
 
 
 
 
 
894
 
895
- $limit = apply_filters( 'schema_wp_truncate_to_word_limit', $limit );
896
- $limit = $limit - mb_strlen($end); // Take into account $end string into the limit
897
- $valuelen = mb_strlen($value);
898
-
899
- return $limit < $valuelen ? mb_substr($value, 0, mb_strrpos($value, ' ', $limit - $valuelen)) . $end : $value;
900
  }
345
 
346
  if ( $post->post_content ) {
347
  $Document = new DOMDocument();
348
+ // @since 1.7.5
349
+ libxml_use_internal_errors(true);
350
+ // load the html into the object
351
  @$Document->loadHTML( $post->post_content );
352
+ // @since 1.7.5
353
+ libxml_clear_errors();
354
  $DocumentImages = $Document->getElementsByTagName( 'img' );
355
 
356
  if ( $DocumentImages->length ) {
357
  $image_url = $DocumentImages->item( 0 )->getAttribute( 'src' );
358
  $image_width = ( $DocumentImages->item( 0 )->getAttribute( 'width' ) > 696 ) ? $DocumentImages->item( 0 )->getAttribute( 'width' ) : 696;
359
  $image_height = $DocumentImages->item( 0 )->getAttribute( 'height' );
360
+
361
  }
362
  }
363
  }
896
  * @since 1.7.1
897
  * @return string
898
  */
899
+ function schema_wp_get_truncate_to_word( $string, $limit = 110, $end = '...' ) {
900
+
901
+ $limit = apply_filters( 'schema_wp_truncate_to_word_limit', $limit );
902
+ $limit = $limit - strlen($end); // Take into account $end string into the limit
903
+ $string = substr($string, 0, $limit);
904
+ $string = substr($string, 0, strrpos($string, ' ')) . $end;
905
 
906
+ return $string;
 
 
 
 
907
  }
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: hishaman, schemapress
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=NGVUBT2QXN7YL
4
  Tags: schema, schema.org, json, json-ld, google, seo, structured data, markup, search engine, search, rich snippets, breadcrumbs, social, post, page, plugin, wordpress, content, article, news, search results, site name, knowledge graph, social, social profiles, keywords, meta-tags, metadata, tags, categories, optimize, ranking, search engine optimization, search engines, serp, sitelinks, google sitelinks, sitelinks search box, google sitelinks search box, semantic, structured, canonical, custom post types, post type, title, terms, media, images, thumb, featured, url, video, video markup, video object, VideoObject, video schema, audio object, AudioObject, audio schema, audio, sameAs, about, contact, amp, mobile, taxonomy
5
  Requires at least: 4.0
6
- Tested up to: 5.0.3
7
  Requires PHP: 5.4
8
- Stable tag: 1.7.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -22,7 +22,7 @@ Enhanced Presentation in Search Results By including structured data appropriate
22
  Check out the [Plugin Homepage](https://schema.press/) for more info and [documentation](https://schema.press/docs/).
23
 
24
 
25
- ###What is Schema markup?
26
 
27
  Schema markup is code (semantic vocabulary) that you put on your website to help the search engines return more informative results for users. So, Schema is not just for SEO reasons, it’s also for the benefit of the searcher.
28
 
@@ -38,9 +38,13 @@ Schema markup is code (semantic vocabulary) that you put on your website to help
38
  * Reuse data saved in post meta, which is created by other plugins.
39
  * Extensible, means you can extend its functionality via other plugins, extensions or within your Theme’s functions.php file.
40
 
41
- > Note: some features are Premium. Which means you need Schema Premium to have those features. You can [get Schema Premium here](https://schema.press/pricing/)!
42
 
43
- **Plugin Extensions**
 
 
 
 
44
 
45
  * [Schema Review](https://wordpress.org/plugins/schema-review/): Extend Schema functionality by adding review and rating Structured Data functionality for Editors and Authors.
46
  * [Schema Default Image](https://wordpress.org/plugins/schema-default-image/): Add ability to set a default WordPress Featured image for schema.org markup.
@@ -81,11 +85,20 @@ Schema markup is code (semantic vocabulary) that you put on your website to help
81
 
82
  ### Premium Supported Schema.org Types
83
 
84
- > Schema Premium has additional support for [schema.org types](https://schema.press/docs-premium/supported-types/).
85
-
86
- * LocalBusiness
87
- * Event
88
- * JobPosting
 
 
 
 
 
 
 
 
 
89
 
90
  ### Supported Plugins
91
 
@@ -98,7 +111,7 @@ Schema plugin integrates and/or play nicely with (not necessarily a full integra
98
  * The SEO Framework
99
  * Visual Composer
100
  * ThirstyAffiliates
101
- * WooCommerce
102
  * Easy Digital Downloads (EDD)
103
 
104
  ### Supported Themes
@@ -129,7 +142,9 @@ Feel free to [fork the project on GitHub](https://github.com/schemapress/Schema)
129
 
130
  = Do you offer a Premium plugin? =
131
 
132
- Yes, we do have a [Schema Premium](https://schema.press/downloads/schema-premium/) plugin that is packed with [features](https://schema.press/features/).
 
 
133
 
134
  = The plugin isn't working or have a bug? =
135
 
@@ -183,6 +198,12 @@ Yes, Schema plugin will detect AMP plugin and output a more complete and valid s
183
 
184
  == Changelog ==
185
 
 
 
 
 
 
 
186
  = 1.7.4 =
187
  * Fix: Activating plugin creates unwanted two menu items (Post, Page).
188
  * Fix: Author Twitter URL output even no ID was provided.
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=NGVUBT2QXN7YL
4
  Tags: schema, schema.org, json, json-ld, google, seo, structured data, markup, search engine, search, rich snippets, breadcrumbs, social, post, page, plugin, wordpress, content, article, news, search results, site name, knowledge graph, social, social profiles, keywords, meta-tags, metadata, tags, categories, optimize, ranking, search engine optimization, search engines, serp, sitelinks, google sitelinks, sitelinks search box, google sitelinks search box, semantic, structured, canonical, custom post types, post type, title, terms, media, images, thumb, featured, url, video, video markup, video object, VideoObject, video schema, audio object, AudioObject, audio schema, audio, sameAs, about, contact, amp, mobile, taxonomy
5
  Requires at least: 4.0
6
+ Tested up to: 5.1
7
  Requires PHP: 5.4
8
+ Stable tag: 1.7.5
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
22
  Check out the [Plugin Homepage](https://schema.press/) for more info and [documentation](https://schema.press/docs/).
23
 
24
 
25
+ ### What is Schema markup?
26
 
27
  Schema markup is code (semantic vocabulary) that you put on your website to help the search engines return more informative results for users. So, Schema is not just for SEO reasons, it’s also for the benefit of the searcher.
28
 
38
  * Reuse data saved in post meta, which is created by other plugins.
39
  * Extensible, means you can extend its functionality via other plugins, extensions or within your Theme’s functions.php file.
40
 
41
+ > Note: some features are Premium. Which means you need Schema Premium to have those features. [Get Schema Premium here](https://schema.press/pricing/)!
42
 
43
+ ### Free vs Premium
44
+
45
+ > See: a [Free vs Premium comparison](https://schema.press/vs/).
46
+
47
+ ### Free Plugin Extensions
48
 
49
  * [Schema Review](https://wordpress.org/plugins/schema-review/): Extend Schema functionality by adding review and rating Structured Data functionality for Editors and Authors.
50
  * [Schema Default Image](https://wordpress.org/plugins/schema-default-image/): Add ability to set a default WordPress Featured image for schema.org markup.
85
 
86
  ### Premium Supported Schema.org Types
87
 
88
+ > Schema Premium has additional support for [schema.org types](https://schema.press/docs-premium/supported-types/), including:
89
+
90
+ * [Article](https://schema.press/docs-premium/add-schema-article/s)
91
+ * [Blog Posting](https://schema.press/docs-premium/add-schema-org-markup-blogposting/)
92
+ * [Event](https://schema.press/docs-premium/add-schema-org-event/)
93
+ * [Course](https://schema.press/docs-premium/add-schema-org-course/)
94
+ * [Job Posting](https://schema.org/JobPosting)
95
+ * [Local Business](https://schema.press/docs-premium/add-schema-localbusiness/)
96
+ * [Person](https://schema.org/Person)
97
+ * [Product](https://schema.press/docs-premium/add-schema-product/)
98
+ * [Recipe](https://schema.press/docs-premium/add-schema-org-recipe/)
99
+ * [Review](https://schema.press/docs-premium/add-schema-org-markup-for-review/)
100
+ * [Service](https://schema.press/docs-premium/add-schema-service/)
101
+ * [Software Application](https://schema.press/docs-premium/add-schema-org-markup-for-software-application/)
102
 
103
  ### Supported Plugins
104
 
111
  * The SEO Framework
112
  * Visual Composer
113
  * ThirstyAffiliates
114
+ * **[Premium]** WooCommerce: [Schema for WooCommerce]() extension.
115
  * Easy Digital Downloads (EDD)
116
 
117
  ### Supported Themes
142
 
143
  = Do you offer a Premium plugin? =
144
 
145
+ Yes, we do have a [Schema Premium](https://schema.press/downloads/schema-premium/) plugin that is packed with [features](https://schema.press/features/) and [supports more schema.org types](https://schema.press/docs-premium/supported-types/).
146
+
147
+ See [Schema Free vs Schema Premium](https://schema.press/vs/).
148
 
149
  = The plugin isn't working or have a bug? =
150
 
198
 
199
  == Changelog ==
200
 
201
+ = 1.7.5 =
202
+ * Fix: PHP Fatal error when truncating long headlines.
203
+ * Fix: PHP warning when parse HTML5-code, added a better error suppression.
204
+ * Tweak: Added a discount code for Schema Premium message.
205
+ * Update: Pumped tested WordPress version to 5.1 release.
206
+
207
  = 1.7.4 =
208
  * Fix: Activating plugin creates unwanted two menu items (Post, Page).
209
  * Fix: Author Twitter URL output even no ID was provided.
schema.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: The next generation of Structured Data.
6
  * Author: Hesham
7
  * Author URI: http://zebida.com
8
- * Version: 1.7.4
9
  * Text Domain: schema-wp
10
  * Domain Path: languages
11
  *
@@ -31,7 +31,6 @@
31
  if ( ! defined( 'ABSPATH' ) ) exit;
32
 
33
  if ( ! class_exists( 'Schema_WP' ) ) :
34
-
35
  /**
36
  * Main Schema_WP Class
37
  *
@@ -51,7 +50,7 @@ final class Schema_WP {
51
  *
52
  * @since 1.0
53
  */
54
- private $version = '1.7.4';
55
 
56
  /**
57
  * The settings instance variable
@@ -83,9 +82,14 @@ final class Schema_WP {
83
  * @return Schema_WP
84
  */
85
  public static function instance() {
 
86
  if ( ! isset( self::$instance ) && ! ( self::$instance instanceof SCHEMA_WP ) ) {
87
  self::$instance = new SCHEMA_WP;
88
-
 
 
 
 
89
  if( version_compare( PHP_VERSION, '5.4', '<' ) ) {
90
 
91
  add_action( 'admin_notices', array( 'SCHEMA_WP', 'below_php_version_notice' ) );
@@ -142,7 +146,7 @@ final class Schema_WP {
142
  public function below_php_version_notice() {
143
  echo '<div class="error"><p>' . __( 'Your version of PHP is below the minimum version of PHP required by Schema plugin. Please contact your host and request that your version be upgraded to 5.4 or later.', 'schema-wp' ) . '</p></div>';
144
  }
145
-
146
  /**
147
  * Setup plugin constants
148
  *
@@ -343,6 +347,7 @@ endif; // End if class_exists check
343
  * @return Schema_WP The one true Schema_WP Instance
344
  */
345
  function schema_wp() {
 
346
  return Schema_WP::instance();
347
  }
348
  schema_wp();
5
  * Description: The next generation of Structured Data.
6
  * Author: Hesham
7
  * Author URI: http://zebida.com
8
+ * Version: 1.7.5
9
  * Text Domain: schema-wp
10
  * Domain Path: languages
11
  *
31
  if ( ! defined( 'ABSPATH' ) ) exit;
32
 
33
  if ( ! class_exists( 'Schema_WP' ) ) :
 
34
  /**
35
  * Main Schema_WP Class
36
  *
50
  *
51
  * @since 1.0
52
  */
53
+ private $version = '1.7.5';
54
 
55
  /**
56
  * The settings instance variable
82
  * @return Schema_WP
83
  */
84
  public static function instance() {
85
+
86
  if ( ! isset( self::$instance ) && ! ( self::$instance instanceof SCHEMA_WP ) ) {
87
  self::$instance = new SCHEMA_WP;
88
+
89
+ if ( class_exists( 'Schema_Premium' ) ) {
90
+ return self::$instance;
91
+ }
92
+
93
  if( version_compare( PHP_VERSION, '5.4', '<' ) ) {
94
 
95
  add_action( 'admin_notices', array( 'SCHEMA_WP', 'below_php_version_notice' ) );
146
  public function below_php_version_notice() {
147
  echo '<div class="error"><p>' . __( 'Your version of PHP is below the minimum version of PHP required by Schema plugin. Please contact your host and request that your version be upgraded to 5.4 or later.', 'schema-wp' ) . '</p></div>';
148
  }
149
+
150
  /**
151
  * Setup plugin constants
152
  *
347
  * @return Schema_WP The one true Schema_WP Instance
348
  */
349
  function schema_wp() {
350
+
351
  return Schema_WP::instance();
352
  }
353
  schema_wp();
uninstall.php CHANGED
@@ -10,17 +10,14 @@
10
  */
11
 
12
  // Exit if accessed directly
13
- if ( ! defined( 'ABSPATH' ) ) exit;
14
 
15
  // Make sure that we are uninstalling
16
- if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) exit();
 
17
 
18
- // Plugin Folder Path
19
- if ( ! defined( 'SCHEMAWP_PLUGIN_DIR' ) )
20
- define( 'SCHEMAWP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
21
-
22
- // Load file
23
- include_once( SCHEMAWP_PLUGIN_DIR . 'includes/admin/class-capabilities.php' );
24
 
25
  // Leave no trail
26
  $option_name = 'schema_wp_settings';
10
  */
11
 
12
  // Exit if accessed directly
13
+ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) exit;
14
 
15
  // Make sure that we are uninstalling
16
+ if ( !defined( 'WP_UNINSTALL_PLUGIN' ) )
17
+ exit();
18
 
19
+ // Load Schema file
20
+ include_once( 'schema.php' );
 
 
 
 
21
 
22
  // Leave no trail
23
  $option_name = 'schema_wp_settings';