Plugin Directory

Changeset 2575898


Ignore:
Timestamp:
08/01/2021 04:57:16 AM (5 years ago)
Author:
milanmk
Message:

Release 1.17.7

Location:
schema-app-structured-data-for-schemaorg
Files:
27 added
4 edited

Legend:

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

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

    r2471303 r2575898  
    2222
    2323        if ( ! empty( $this->Settings['SchemaLinkedOpenData'] ) ) {
     24            add_action( 'send_headers', array( $this, 'linked_open_data_headers' ) );
    2425            add_action( 'wp', array( $this, 'linked_open_data_output' ), 10, 1 );
    2526            add_action( 'wp_head', array( $this, 'linked_open_data_link_tag' ) );
     
    117118        }
    118119
     120        // Check for Account Id
     121        $account_id         = trim( str_replace( array( 'http://schemaapp.com/db/', 'https://schemaapp.com/db/' ), '', $this->Settings['graph_uri'] ), '/' );
     122        $request_account_id = trim( str_ireplace( array( 'https://data.schemaapp.com/', $request_data->{"base64encode"} ), '', $request_data->{"url"} ), '/' );
     123
     124        if ( $request_account_id != $account_id ) {
     125            if ( ! empty( $this->Settings['Debug'] ) ) {
     126                $this->create_log( $rest_api_cache_log_file, sprintf( 'Result: Invalid url property, Account Id does not match. url: %s Account Id: %s', $request_data->{"url"}, $account_id ) );
     127            }
     128
     129            return new WP_REST_Response( array( 'status' => 'error', 'message' => 'Invalid url property, Account Id does not match' ), 401 );
     130        }
     131
    119132        // @graph is empty for EntityDeleted
    120133        if ( empty( $request_data->{"@type"} ) || empty( $request_data->{"@id"} ) || ( $request_data->{"@type"} != 'EntityDeleted' && empty( $request_data->{"@graph"} ) ) ) {
     
    327340
    328341            exit;
     342        }
     343    }
     344
     345
     346    public function linked_open_data_headers( $wp ) {
     347        if ( ! empty( $_GET['format'] ) && $_GET['format'] == 'application/ld json' ) {
     348            header( 'Content-Type: application/json; charset=UTF-8', true );
    329349        }
    330350    }
  • schema-app-structured-data-for-schemaorg/trunk/lib/SchemaSettings.php

    r2560888 r2575898  
    290290        ); 
    291291        add_settings_section(
    292             'plugin_settings_advanced', // ID
    293             'Advanced Plugin Setup', // Title
    294             array( $this, 'print_section_plugin_advanced' ), // Callback
    295             'schema-app-setting' // Page
    296         ); 
    297         add_settings_section(
    298292            'publisher_settings', // ID
    299293            'Publisher Settings', // Title
     
    376370        do_action( 'hunch_schema_settings_section', 'schema_option_name', 'schema-app-setting', 'schema' );
    377371
     372        add_settings_section(
     373            'plugin_settings_advanced', // ID
     374            'Advanced Plugin Setup', // Title
     375            array( $this, 'print_section_plugin_advanced' ), // Callback
     376            'schema-app-setting' // Page
     377        ); 
    378378
    379379        //// Schema App License Page
  • schema-app-structured-data-for-schemaorg/trunk/readme.txt

    r2565234 r2575898  
    88Requires at least: 3.7
    99Requires PHP: 5.4
    10 Tested up to: 5.7
    11 Stable tag: 1.17.6
     10Tested up to: 5.8
     11Stable tag: 1.17.7
    1212License: GPL2
    1313License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8080== Changelog ==
    8181
     82= 1.17.7 =
     83Release Date - 1 August 2021
     84
     85- Fix, Added proper Content-Type header to Linked Open Data request
     86- Improve, Added Rest API Account Id validation
     87
    8288= 1.17.6 =
    8389Release Date - 9 July 2021
     
    510516== Upgrade Notice ==
    511517
    512 = 1.17.6 =
    513  - Updated get permalink routine, Added static method for getting post content
     518= 1.17.7 =
     519- Added proper Content-Type header to Linked Open Data request
Note: See TracChangeset for help on using the changeset viewer.