Changeset 2162317
- Timestamp:
- 09/24/2019 04:20:21 PM (6 years ago)
- Location:
- schema-app-structured-data-for-schemaorg
- Files:
-
- 26 added
- 3 edited
-
tags/1.14.4 (added)
-
tags/1.14.4/css (added)
-
tags/1.14.4/css/schemaStyle.css (added)
-
tags/1.14.4/data (added)
-
tags/1.14.4/data/tree.jsonld (added)
-
tags/1.14.4/hunch-schema.php (added)
-
tags/1.14.4/js (added)
-
tags/1.14.4/js/schema.js (added)
-
tags/1.14.4/js/schemaAdmin.js (added)
-
tags/1.14.4/js/schemaEditor.js (added)
-
tags/1.14.4/lib (added)
-
tags/1.14.4/lib/HunchSchema (added)
-
tags/1.14.4/lib/HunchSchema/Author.php (added)
-
tags/1.14.4/lib/HunchSchema/Blog.php (added)
-
tags/1.14.4/lib/HunchSchema/Category.php (added)
-
tags/1.14.4/lib/HunchSchema/Page.php (added)
-
tags/1.14.4/lib/HunchSchema/Post.php (added)
-
tags/1.14.4/lib/HunchSchema/Search.php (added)
-
tags/1.14.4/lib/HunchSchema/Tag.php (added)
-
tags/1.14.4/lib/HunchSchema/Thing.php (added)
-
tags/1.14.4/lib/SchemaEditor.php (added)
-
tags/1.14.4/lib/SchemaFront.php (added)
-
tags/1.14.4/lib/SchemaServer.php (added)
-
tags/1.14.4/lib/SchemaSettings.php (added)
-
tags/1.14.4/lib/classmap.php (added)
-
tags/1.14.4/readme.txt (added)
-
trunk/hunch-schema.php (modified) (1 diff)
-
trunk/lib/SchemaFront.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
schema-app-structured-data-for-schemaorg/trunk/hunch-schema.php
r2158023 r2162317 5 5 * Plugin URI: http://www.schemaapp.com 6 6 * Description: This plugin adds http://schema.org structured data to your website 7 * Version: 1.14. 37 * Version: 1.14.4 8 8 * Author: Hunch Manifest 9 9 * Author URI: https://www.hunchmanifest.com -
schema-app-structured-data-for-schemaorg/trunk/lib/SchemaFront.php
r2158023 r2162317 134 134 } 135 135 136 $transient_id = 'HunchSchema-Markup-' . md5( $request_data->{"@id"} ); 136 if ( stripos( $request_data->{"@id"}, '#' ) !== false ) { 137 $permalink = strstr( $request_data->{"@id"}, '#', true ); 138 } else { 139 $permalink = $request_data->{"@id"}; 140 } 141 142 $transient_id = 'HunchSchema-Markup-' . md5( $permalink ); 143 144 if ( ! empty( $this->Settings['Debug'] ) ) { 145 file_put_contents( $rest_api_cache_log_file, sprintf( "Permalink: %s\nTransient: %s\n", $permalink, $transient_id ), FILE_APPEND ); 146 } 137 147 138 148 switch ( $request_data->{"@type"} ) { 139 149 case 'EntityCreated': 140 150 case 'EntityUpdated': 141 $schema_markup = is_array( $request_data->{"@graph"} ) ? reset( $request_data->{"@graph"} ) : $request_data->{"@graph"};142 143 151 // First delete then set; set method only updates expiry time if transient already exists 144 152 delete_transient( $transient_id ); 145 set_transient( $transient_id, json_encode( $ schema_markup), 86400 );153 set_transient( $transient_id, json_encode( $request_data->{"@graph"} ), 86400 ); 146 154 147 155 if ( ! empty( $this->Settings['Debug'] ) ) { … … 229 237 else 230 238 { 231 printf( '< !-- Schema App - %s-%s-%s --><script type="application/ld+json">%s</script><!-- Schema App -->' . "\n", $SchemaMarkupType, $PostType, $post->ID, $SchemaMarkup );239 printf( '<script type="application/ld+json" data-schema="%s-%s-%s">%s</script>' . "\n", $post->ID, $PostType, $SchemaMarkupType, $SchemaMarkup ); 232 240 } 233 241 } … … 245 253 else 246 254 { 247 printf( '< !-- Schema App Website --><script type="application/ld+json">%s</script><!-- Schema App Website -->' . "\n", $SchemaMarkupWebSite );255 printf( '<script type="application/ld+json" data-schema="Website">%s</script>' . "\n", $SchemaMarkupWebSite ); 248 256 } 249 257 } … … 262 270 else 263 271 { 264 printf( '< !-- Schema App Breadcrumb --><script type="application/ld+json">%s</script><!-- Schema App Breadcrumb -->' . "\n", $SchemaMarkupBreadcrumb );272 printf( '<script type="application/ld+json" data-schema="Breadcrumb">%s</script>' . "\n", $SchemaMarkupBreadcrumb ); 265 273 } 266 274 } -
schema-app-structured-data-for-schemaorg/trunk/readme.txt
r2158023 r2162317 9 9 Requires PHP: 5.4 10 10 Tested up to: 5.2 11 Stable tag: 1.14. 311 Stable tag: 1.14.4 12 12 License: GPL2 13 13 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 87 87 == Changelog == 88 88 89 = 1.14.4 = 90 - Improve, Webhook by caching all schema markup and better matching of permalinks 91 89 92 = 1.14.3 = 90 93 - Fix, Updating of markup cache from Webhook event … … 390 393 == Upgrade Notice == 391 394 392 = 1.14. 2=393 - Updating of markup cache from Webhook event395 = 1.14.4 = 396 - Improve Webhook by caching all schema markup and better matching of permalinks
Note: See TracChangeset
for help on using the changeset viewer.