Plugin Directory

Changeset 3406275


Ignore:
Timestamp:
11/30/2025 06:43:49 PM (3 months ago)
Author:
sethsm
Message:

Update to version 1.7 from GitHub

Location:
microdata-to-json-ld-converter
Files:
18 added
2 deleted
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • microdata-to-json-ld-converter/tags/1.7/README.md

    r3361462 r3406275  
    88* **Requires at least:** 5.5
    99* **Tested up to:** 6.8
    10 * **Stable tag:** 1.6.5
     10* **Stable tag:** 1.7
    1111* **Requires PHP:** 7.2
    1212* **License:** GPLv2 or later
     
    125125## Changelog
    126126
     127### 1.7
     128**ENHANCEMENT:** Expanded content attribute support to all HTML tags. Machine-readable data (e.g., content="2025-11-30") now correctly takes precedence over human-readable text on <span> and <div> elements.
     129
    127130### 1.6.6
    128131* **SECURITY:** Improved Input handling and enhanced protection against parameter manipulation attacks.
  • microdata-to-json-ld-converter/tags/1.7/includes/class-mdtj-schema-validator.php

    r3361462 r3406275  
    22/**
    33 * Schema.org Validator Class
    4  * @version 1.6.6
     4 * @version 1.7
    55 */
    66class MDTJ_Schema_Validator {
  • microdata-to-json-ld-converter/tags/1.7/includes/class-microdata-to-json-ld-converter.php

    r3361462 r3406275  
    22/**
    33 * Main plugin class.
    4  * @version 1.6.6
     4 * @version 1.7
    55 *
     6 * v1.7 - Expanded content attribute support to all HTML tags. Machine-readable data (e.g., content="2025-11-30") now correctly takes precedence over human-readable text on <span> and <div> elements.
    67 * v1.6.6 - Improved input handling and enhanced security against parameter manipulation attacks.  Direct $_GET parameter access now properly uses wp_unslash() before sanitization. JSON-LD schema output now used separated script tag construction and includes security annotations for safe content.
    78 * v1.6.5 - Replaced deprecated mb_convert_encoding for handling character sets for HTML parsing.
     
    5859
    5960    public function start_buffer() {
     61        // $mdtj_preview = isset( $_GET['mdtj_preview'] ) ? sanitize_key( $_GET['mdtj_preview'] ) : '';
    6062        $mdtj_preview = isset( $_GET['mdtj_preview'] ) ? sanitize_key( wp_unslash( $_GET['mdtj_preview'] ) ) : '';
    6163
     
    369371    }
    370372    private function get_child_properties( $element ) { $properties = array(); $queue = new SplQueue(); foreach ($element->childNodes as $child) $queue->enqueue($child); while (!$queue->isEmpty()) { $node = $queue->dequeue(); if ($node instanceof DOMElement) { if ($node->hasAttribute('itemprop')) $properties[] = $node; if (!$node->hasAttribute('itemscope')) { foreach ($node->childNodes as $child) $queue->enqueue($child); } } } return $properties; }
    371     private function get_property_value( $element ) { if ( $element->hasAttribute( 'itemscope' ) ) return $this->parse_item( $element ); $tag = strtoupper( $element->tagName ); if ( in_array($tag, array('A', 'LINK')) ) return $element->getAttribute( 'href' ); if ( in_array($tag, array('IMG', 'VIDEO', 'AUDIO', 'SOURCE')) ) return $element->getAttribute( 'src' ); if ( $tag == 'META' ) return $element->getAttribute( 'content' ); if ( $tag == 'TIME' ) return $element->getAttribute( 'datetime' ); if ( in_array($tag, array('DATA', 'INPUT')) ) return $element->getAttribute( 'value' ); return trim($element->textContent); }
     373
     374    private function get_property_value( $element ) {
     375        if ( $element->hasAttribute( 'itemscope' ) ) return $this->parse_item( $element );
     376       
     377        // FIX: Check for 'content' attribute on ANY tag first.
     378        // This allows <span content="ISO">Human</span> to work correctly.
     379        if ( $element->hasAttribute( 'content' ) ) return $element->getAttribute( 'content' );
     380
     381        $tag = strtoupper( $element->tagName );
     382       
     383        if ( in_array($tag, array('A', 'LINK')) ) return $element->getAttribute( 'href' );
     384        if ( in_array($tag, array('IMG', 'VIDEO', 'AUDIO', 'SOURCE')) ) return $element->getAttribute( 'src' );
     385        // The specific 'META' check is removed because the global check above handles it.
     386        if ( $tag == 'TIME' ) return $element->getAttribute( 'datetime' );
     387        if ( in_array($tag, array('DATA', 'INPUT')) ) return $element->getAttribute( 'value' );
     388       
     389        return trim($element->textContent);
     390    }
     391
    372392    public function render_bulk_rebuild_section_text() { echo '<p>' . esc_html__( 'Use this tool to generate JSON-LD for all published items of the selected post types.', 'microdata-to-json-ld-converter' ) . '</p>'; }
    373393   
  • microdata-to-json-ld-converter/tags/1.7/microdata-to-json-ld-converter.php

    r3361462 r3406275  
    44 * Plugin URI:  https://www.sethcreates.com/plugins-for-wordpress/microdata-to-json-ld-converter/
    55 * Description: Converts Microdata to JSON-LD, validates it against best practices, and optionally removes the original markup. Includes a bulk rebuild tool.
    6  * Version:     1.6.6
     6 * Version:     1.7
    77 * Author:      Seth Smigelski
    88 * Author URI:  https://www.sethcreates.com/plugins-for-wordpress/
     
    1919// 1. Define plugin constants
    2020define( 'MDTJ_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    21 //define( 'MDTJ_PLUGIN_VERSION', '1.6' );
     21//define( 'MDTJ_PLUGIN_VERSION', '1.7' );
    2222
    2323// 2. Require the class files
  • microdata-to-json-ld-converter/tags/1.7/readme.txt

    r3361462 r3406275  
    44Requires at least: 5.5
    55Tested up to: 6.8
    6 Stable tag: 1.6.6
     6Stable tag: 1.7
    77Requires PHP: 7.2
    88License: GPLv2 or later
     
    9898== Changelog ==
    9999
     100= 1.7 =
     101**ENHANCEMENT:** Expanded content attribute support to all HTML tags. Machine-readable data (e.g., content="2025-11-30") now correctly takes precedence over human-readable text on <span> and <div> elements.
     102
    100103= 1.6.6 =
    101104* **SECURITY:** Improved Input handling and enhanced protection against parameter manipulation attacks.
  • microdata-to-json-ld-converter/trunk/README.md

    r3361462 r3406275  
    88* **Requires at least:** 5.5
    99* **Tested up to:** 6.8
    10 * **Stable tag:** 1.6.5
     10* **Stable tag:** 1.7
    1111* **Requires PHP:** 7.2
    1212* **License:** GPLv2 or later
     
    125125## Changelog
    126126
     127### 1.7
     128**ENHANCEMENT:** Expanded content attribute support to all HTML tags. Machine-readable data (e.g., content="2025-11-30") now correctly takes precedence over human-readable text on <span> and <div> elements.
     129
    127130### 1.6.6
    128131* **SECURITY:** Improved Input handling and enhanced protection against parameter manipulation attacks.
  • microdata-to-json-ld-converter/trunk/includes/class-mdtj-schema-validator.php

    r3361462 r3406275  
    22/**
    33 * Schema.org Validator Class
    4  * @version 1.6.6
     4 * @version 1.7
    55 */
    66class MDTJ_Schema_Validator {
  • microdata-to-json-ld-converter/trunk/includes/class-microdata-to-json-ld-converter.php

    r3361462 r3406275  
    22/**
    33 * Main plugin class.
    4  * @version 1.6.6
     4 * @version 1.7
    55 *
     6 * v1.7 - Expanded content attribute support to all HTML tags. Machine-readable data (e.g., content="2025-11-30") now correctly takes precedence over human-readable text on <span> and <div> elements.
    67 * v1.6.6 - Improved input handling and enhanced security against parameter manipulation attacks.  Direct $_GET parameter access now properly uses wp_unslash() before sanitization. JSON-LD schema output now used separated script tag construction and includes security annotations for safe content.
    78 * v1.6.5 - Replaced deprecated mb_convert_encoding for handling character sets for HTML parsing.
     
    5859
    5960    public function start_buffer() {
     61        // $mdtj_preview = isset( $_GET['mdtj_preview'] ) ? sanitize_key( $_GET['mdtj_preview'] ) : '';
    6062        $mdtj_preview = isset( $_GET['mdtj_preview'] ) ? sanitize_key( wp_unslash( $_GET['mdtj_preview'] ) ) : '';
    6163
     
    369371    }
    370372    private function get_child_properties( $element ) { $properties = array(); $queue = new SplQueue(); foreach ($element->childNodes as $child) $queue->enqueue($child); while (!$queue->isEmpty()) { $node = $queue->dequeue(); if ($node instanceof DOMElement) { if ($node->hasAttribute('itemprop')) $properties[] = $node; if (!$node->hasAttribute('itemscope')) { foreach ($node->childNodes as $child) $queue->enqueue($child); } } } return $properties; }
    371     private function get_property_value( $element ) { if ( $element->hasAttribute( 'itemscope' ) ) return $this->parse_item( $element ); $tag = strtoupper( $element->tagName ); if ( in_array($tag, array('A', 'LINK')) ) return $element->getAttribute( 'href' ); if ( in_array($tag, array('IMG', 'VIDEO', 'AUDIO', 'SOURCE')) ) return $element->getAttribute( 'src' ); if ( $tag == 'META' ) return $element->getAttribute( 'content' ); if ( $tag == 'TIME' ) return $element->getAttribute( 'datetime' ); if ( in_array($tag, array('DATA', 'INPUT')) ) return $element->getAttribute( 'value' ); return trim($element->textContent); }
     373
     374    private function get_property_value( $element ) {
     375        if ( $element->hasAttribute( 'itemscope' ) ) return $this->parse_item( $element );
     376       
     377        // FIX: Check for 'content' attribute on ANY tag first.
     378        // This allows <span content="ISO">Human</span> to work correctly.
     379        if ( $element->hasAttribute( 'content' ) ) return $element->getAttribute( 'content' );
     380
     381        $tag = strtoupper( $element->tagName );
     382       
     383        if ( in_array($tag, array('A', 'LINK')) ) return $element->getAttribute( 'href' );
     384        if ( in_array($tag, array('IMG', 'VIDEO', 'AUDIO', 'SOURCE')) ) return $element->getAttribute( 'src' );
     385        // The specific 'META' check is removed because the global check above handles it.
     386        if ( $tag == 'TIME' ) return $element->getAttribute( 'datetime' );
     387        if ( in_array($tag, array('DATA', 'INPUT')) ) return $element->getAttribute( 'value' );
     388       
     389        return trim($element->textContent);
     390    }
     391
    372392    public function render_bulk_rebuild_section_text() { echo '<p>' . esc_html__( 'Use this tool to generate JSON-LD for all published items of the selected post types.', 'microdata-to-json-ld-converter' ) . '</p>'; }
    373393   
  • microdata-to-json-ld-converter/trunk/microdata-to-json-ld-converter.php

    r3361462 r3406275  
    44 * Plugin URI:  https://www.sethcreates.com/plugins-for-wordpress/microdata-to-json-ld-converter/
    55 * Description: Converts Microdata to JSON-LD, validates it against best practices, and optionally removes the original markup. Includes a bulk rebuild tool.
    6  * Version:     1.6.6
     6 * Version:     1.7
    77 * Author:      Seth Smigelski
    88 * Author URI:  https://www.sethcreates.com/plugins-for-wordpress/
     
    1919// 1. Define plugin constants
    2020define( 'MDTJ_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    21 //define( 'MDTJ_PLUGIN_VERSION', '1.6' );
     21//define( 'MDTJ_PLUGIN_VERSION', '1.7' );
    2222
    2323// 2. Require the class files
  • microdata-to-json-ld-converter/trunk/readme.txt

    r3361462 r3406275  
    44Requires at least: 5.5
    55Tested up to: 6.8
    6 Stable tag: 1.6.6
     6Stable tag: 1.7
    77Requires PHP: 7.2
    88License: GPLv2 or later
     
    9898== Changelog ==
    9999
     100= 1.7 =
     101**ENHANCEMENT:** Expanded content attribute support to all HTML tags. Machine-readable data (e.g., content="2025-11-30") now correctly takes precedence over human-readable text on <span> and <div> elements.
     102
    100103= 1.6.6 =
    101104* **SECURITY:** Improved Input handling and enhanced protection against parameter manipulation attacks.
Note: See TracChangeset for help on using the changeset viewer.