Plugin Directory

Changeset 2162317


Ignore:
Timestamp:
09/24/2019 04:20:21 PM (6 years ago)
Author:
milanmk
Message:

Release 1.14.4

Location:
schema-app-structured-data-for-schemaorg
Files:
26 added
3 edited

Legend:

Unmodified
Added
Removed
  • schema-app-structured-data-for-schemaorg/trunk/hunch-schema.php

    r2158023 r2162317  
    55 * Plugin URI: http://www.schemaapp.com
    66 * Description: This plugin adds http://schema.org structured data to your website
    7  * Version: 1.14.3
     7 * Version: 1.14.4
    88 * Author: Hunch Manifest
    99 * Author URI: https://www.hunchmanifest.com
  • schema-app-structured-data-for-schemaorg/trunk/lib/SchemaFront.php

    r2158023 r2162317  
    134134            }
    135135
    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            }
    137147
    138148            switch ( $request_data->{"@type"} ) {
    139149                case 'EntityCreated':
    140150                case 'EntityUpdated':
    141                     $schema_markup = is_array( $request_data->{"@graph"} ) ? reset( $request_data->{"@graph"} ) : $request_data->{"@graph"};
    142 
    143151                    // First delete then set; set method only updates expiry time if transient already exists
    144152                    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 );
    146154
    147155                    if ( ! empty( $this->Settings['Debug'] ) ) {
     
    229237                else
    230238                {
    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 );
    232240                }
    233241            }
     
    245253                    else
    246254                    {
    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 );
    248256                    }
    249257                }
     
    262270                    else
    263271                    {
    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 );
    265273                    }
    266274                }
  • schema-app-structured-data-for-schemaorg/trunk/readme.txt

    r2158023 r2162317  
    99Requires PHP: 5.4
    1010Tested up to: 5.2
    11 Stable tag: 1.14.3
     11Stable tag: 1.14.4
    1212License: GPL2
    1313License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8787== Changelog ==
    8888
     89= 1.14.4 =
     90- Improve, Webhook by caching all schema markup and better matching of permalinks
     91
    8992= 1.14.3 =
    9093- Fix, Updating of markup cache from Webhook event
     
    390393== Upgrade Notice ==
    391394
    392 = 1.14.2 =
    393 - Updating of markup cache from Webhook event
     395= 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.