Version Description
- Fix: Shortcades was not excluded from description.
- Fix: Set publicly_queryable to false in Schema post type to disable creation of single pages.
- Fix: Removed a notice in AMP pages, and fixed markup output.
- Enhancement: Improved performance of markup output on AMP pages.
- Updated the readme.txt file, and pumped the tested WP version to 4.9.8
Download this release
Release Info
Developer | hishaman |
Plugin | Schema |
Version | 1.7.2 |
Comparing to | |
See all releases |
Code changes from version 1.7.1 to 1.7.2
- includes/admin/meta/css/chosen-sprite.png +0 -0
- includes/admin/meta/css/chosen-sprite@2x.png +0 -0
- includes/admin/post-type/schema-post-type.php +1 -1
- includes/integrations/amp.php +22 -9
- includes/integrations/wp-rich-snippets.php +2 -2
- includes/misc-functions.php +6 -3
- readme.txt +9 -2
- schema.php +2 -2
includes/admin/meta/css/chosen-sprite.png
CHANGED
File without changes
|
includes/admin/meta/css/chosen-sprite@2x.png
CHANGED
File without changes
|
includes/admin/post-type/schema-post-type.php
CHANGED
@@ -42,7 +42,7 @@ function schema_wp_cpt_init() {
|
|
42 |
'labels' => $labels,
|
43 |
'description' => __( 'Description.', 'schema-wp' ),
|
44 |
'public' => false,
|
45 |
-
'publicly_queryable' =>
|
46 |
'show_ui' => true,
|
47 |
'show_in_menu' => false,
|
48 |
'show_in_nav_menus' => false,
|
42 |
'labels' => $labels,
|
43 |
'description' => __( 'Description.', 'schema-wp' ),
|
44 |
'public' => false,
|
45 |
+
'publicly_queryable' => false,
|
46 |
'show_ui' => true,
|
47 |
'show_in_menu' => false,
|
48 |
'show_in_nav_menus' => false,
|
includes/integrations/amp.php
CHANGED
@@ -18,23 +18,36 @@ add_filter( 'amp_post_template_metadata', 'schema_wp_amp_modify_json_output', 10
|
|
18 |
*/
|
19 |
function schema_wp_amp_modify_json_output( $metadata, $post ) {
|
20 |
|
21 |
-
|
22 |
-
$
|
23 |
|
24 |
-
|
|
|
25 |
|
26 |
-
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
-
|
30 |
|
31 |
-
|
|
|
|
|
32 |
}
|
33 |
|
34 |
-
|
|
|
35 |
return $json;
|
36 |
}
|
37 |
|
38 |
-
// Return the un-filtered array
|
39 |
return $metadata;
|
40 |
}
|
18 |
*/
|
19 |
function schema_wp_amp_modify_json_output( $metadata, $post ) {
|
20 |
|
21 |
+
// Get AMP plugin settings
|
22 |
+
$options = get_settings('amp-options');
|
23 |
|
24 |
+
// Get schema markup json
|
25 |
+
$json = schema_wp_get_jsonld( $post->ID );
|
26 |
|
27 |
+
// Check if this is the About or Contact page
|
28 |
+
// If so, override the $json array
|
29 |
+
if ( array($options['supported_post_types']) && in_array("page", $options['supported_post_types'])) {
|
30 |
+
|
31 |
+
$about_page_id = schema_wp_get_option( 'about_page' );
|
32 |
+
$contact_page_id = schema_wp_get_option( 'contact_page' );
|
33 |
+
|
34 |
+
if ( isset($about_page_id) && $post->ID == $about_page_id ) {
|
35 |
+
|
36 |
+
$json = schema_wp_get_page_about_json( 'AboutPage' );
|
37 |
+
}
|
38 |
|
39 |
+
if ( isset($contact_page_id) && $post->ID == $contact_page_id) {
|
40 |
|
41 |
+
$json = schema_wp_get_page_contact_json( 'ContactPage' );
|
42 |
+
}
|
43 |
+
|
44 |
}
|
45 |
|
46 |
+
// Return markup array
|
47 |
+
if ( ! empty($json) ) {
|
48 |
return $json;
|
49 |
}
|
50 |
|
51 |
+
// Return the un-filtered markup array
|
52 |
return $metadata;
|
53 |
}
|
includes/integrations/wp-rich-snippets.php
CHANGED
@@ -15,7 +15,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
|
15 |
|
16 |
add_action( 'schema_output', 'schema_wp_wprs_output_remove' );
|
17 |
/*
|
18 |
-
* Remove
|
19 |
*
|
20 |
* @since 1.5.6
|
21 |
*/
|
@@ -35,7 +35,7 @@ add_action( 'init', 'schema_wp_wprs_remove_admin_bar_menu' );
|
|
35 |
* @since 1.5.4
|
36 |
*/
|
37 |
function schema_wp_wprs_remove_admin_bar_menu() {
|
38 |
-
// Check if
|
39 |
if ( ! function_exists('wprs_admin_bar_menu_items') ) return;
|
40 |
remove_action( 'admin_bar_menu', 'wprs_admin_bar_menu_items', 99 );
|
41 |
}
|
15 |
|
16 |
add_action( 'schema_output', 'schema_wp_wprs_output_remove' );
|
17 |
/*
|
18 |
+
* Remove schema markup if WP Rich Snippets plugin is enabled
|
19 |
*
|
20 |
* @since 1.5.6
|
21 |
*/
|
35 |
* @since 1.5.4
|
36 |
*/
|
37 |
function schema_wp_wprs_remove_admin_bar_menu() {
|
38 |
+
// Check if function exists
|
39 |
if ( ! function_exists('wprs_admin_bar_menu_items') ) return;
|
40 |
remove_action( 'admin_bar_menu', 'wprs_admin_bar_menu_items', 99 );
|
41 |
}
|
includes/misc-functions.php
CHANGED
@@ -90,7 +90,7 @@ function schema_wp_get_type( $post_id = null ) {
|
|
90 |
* @param int $post_id The post ID.
|
91 |
* @return string post ID, or false
|
92 |
*/
|
93 |
-
function schema_wp_get_jsonld( $post_id
|
94 |
|
95 |
global $post;
|
96 |
|
@@ -100,7 +100,7 @@ function schema_wp_get_jsonld( $post_id = null ) {
|
|
100 |
|
101 |
$schema_json = get_post_meta( $post_id, '_schema_json', true);
|
102 |
|
103 |
-
If ( ! isset($schema_json )) $schema_json =
|
104 |
|
105 |
return apply_filters( 'schema_wp_json', $schema_json );
|
106 |
}
|
@@ -283,7 +283,8 @@ function schema_wp_get_description( $post_id = null ) {
|
|
283 |
$full_content = $content_post->post_content;
|
284 |
$excerpt = $content_post->post_excerpt;
|
285 |
|
286 |
-
|
|
|
287 |
$full_content = wp_strip_all_tags( $full_content );
|
288 |
|
289 |
// Filter content before it gets shorter ;)
|
@@ -292,6 +293,8 @@ function schema_wp_get_description( $post_id = null ) {
|
|
292 |
|
293 |
$desc_word_count = apply_filters( 'schema_wp_filter_description_word_count', 49 );
|
294 |
$short_content = wp_trim_words( $full_content, $desc_word_count, '' );
|
|
|
|
|
295 |
$description = apply_filters( 'schema_wp_filter_description', ( $excerpt != '' ) ? $excerpt : $short_content );
|
296 |
|
297 |
return $description;
|
90 |
* @param int $post_id The post ID.
|
91 |
* @return string post ID, or false
|
92 |
*/
|
93 |
+
function schema_wp_get_jsonld( $post_id ) {
|
94 |
|
95 |
global $post;
|
96 |
|
100 |
|
101 |
$schema_json = get_post_meta( $post_id, '_schema_json', true);
|
102 |
|
103 |
+
If ( ! isset($schema_json )) $schema_json = array();
|
104 |
|
105 |
return apply_filters( 'schema_wp_json', $schema_json );
|
106 |
}
|
283 |
$full_content = $content_post->post_content;
|
284 |
$excerpt = $content_post->post_excerpt;
|
285 |
|
286 |
+
// Strip shortcodes and tags
|
287 |
+
$full_content = preg_replace('#\[[^\]]+\]#', '', $full_content);
|
288 |
$full_content = wp_strip_all_tags( $full_content );
|
289 |
|
290 |
// Filter content before it gets shorter ;)
|
293 |
|
294 |
$desc_word_count = apply_filters( 'schema_wp_filter_description_word_count', 49 );
|
295 |
$short_content = wp_trim_words( $full_content, $desc_word_count, '' );
|
296 |
+
|
297 |
+
// Use excerpt if presnet, or use short_content
|
298 |
$description = apply_filters( 'schema_wp_filter_description', ( $excerpt != '' ) ? $excerpt : $short_content );
|
299 |
|
300 |
return $description;
|
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: 4.9.
|
7 |
Requires PHP: 5.4
|
8 |
-
Stable tag: 1.7.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -156,6 +156,13 @@ Yes, Schema plugin will detect AMP plugin and output a more complete and valid s
|
|
156 |
|
157 |
== Changelog ==
|
158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
= 1.7.1 =
|
160 |
* Added new function schema_wp_post_meta_fields, stop loading post meta directly.
|
161 |
* Added new function schema_wp_is_blog, check if is Blog page.
|
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: 4.9.8
|
7 |
Requires PHP: 5.4
|
8 |
+
Stable tag: 1.7.2
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
156 |
|
157 |
== Changelog ==
|
158 |
|
159 |
+
= 1.7.2 =
|
160 |
+
* Fix: Shortcades was not excluded from description.
|
161 |
+
* Fix: Set publicly_queryable to false in Schema post type to disable creation of single pages.
|
162 |
+
* Fix: Removed a notice in AMP pages, and fixed markup output.
|
163 |
+
* Enhancement: Improved performance of markup output on AMP pages.
|
164 |
+
* Updated the readme.txt file, and pumped the tested WP version to 4.9.8
|
165 |
+
|
166 |
= 1.7.1 =
|
167 |
* Added new function schema_wp_post_meta_fields, stop loading post meta directly.
|
168 |
* Added new function schema_wp_is_blog, check if is Blog page.
|
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.
|
9 |
* Text Domain: schema-wp
|
10 |
* Domain Path: languages
|
11 |
*
|
@@ -51,7 +51,7 @@ final class Schema_WP {
|
|
51 |
*
|
52 |
* @since 1.0
|
53 |
*/
|
54 |
-
private $version = '1.7.
|
55 |
|
56 |
/**
|
57 |
* The settings instance variable
|
5 |
* Description: The next generation of Structured Data.
|
6 |
* Author: Hesham
|
7 |
* Author URI: http://zebida.com
|
8 |
+
* Version: 1.7.2
|
9 |
* Text Domain: schema-wp
|
10 |
* Domain Path: languages
|
11 |
*
|
51 |
*
|
52 |
* @since 1.0
|
53 |
*/
|
54 |
+
private $version = '1.7.2';
|
55 |
|
56 |
/**
|
57 |
* The settings instance variable
|