Changeset 3406275
- Timestamp:
- 11/30/2025 06:43:49 PM (3 months ago)
- Location:
- microdata-to-json-ld-converter
- Files:
-
- 18 added
- 2 deleted
- 10 edited
- 1 copied
-
tags/1.7 (copied) (copied from microdata-to-json-ld-converter/trunk)
-
tags/1.7/README.md (modified) (2 diffs)
-
tags/1.7/assets (added)
-
tags/1.7/assets/banner-1544x500.png (added)
-
tags/1.7/assets/banner-772x250.png (added)
-
tags/1.7/assets/icon-128x128.png (added)
-
tags/1.7/assets/icon-256x256.png (added)
-
tags/1.7/assets/screenshot-1.png (added)
-
tags/1.7/assets/screenshot-2.png (added)
-
tags/1.7/assets/screenshot-3.png (added)
-
tags/1.7/assets/screenshot-4.png (added)
-
tags/1.7/includes/class-mdtj-schema-validator.php (modified) (1 diff)
-
tags/1.7/includes/class-microdata-to-json-ld-converter.php (modified) (3 diffs)
-
tags/1.7/microdata-to-json-ld-converter.php (modified) (2 diffs)
-
tags/1.7/package.json (deleted)
-
tags/1.7/readme.txt (modified) (2 diffs)
-
trunk/README.md (modified) (2 diffs)
-
trunk/assets (added)
-
trunk/assets/banner-1544x500.png (added)
-
trunk/assets/banner-772x250.png (added)
-
trunk/assets/icon-128x128.png (added)
-
trunk/assets/icon-256x256.png (added)
-
trunk/assets/screenshot-1.png (added)
-
trunk/assets/screenshot-2.png (added)
-
trunk/assets/screenshot-3.png (added)
-
trunk/assets/screenshot-4.png (added)
-
trunk/includes/class-mdtj-schema-validator.php (modified) (1 diff)
-
trunk/includes/class-microdata-to-json-ld-converter.php (modified) (3 diffs)
-
trunk/microdata-to-json-ld-converter.php (modified) (2 diffs)
-
trunk/package.json (deleted)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
microdata-to-json-ld-converter/tags/1.7/README.md
r3361462 r3406275 8 8 * **Requires at least:** 5.5 9 9 * **Tested up to:** 6.8 10 * **Stable tag:** 1. 6.510 * **Stable tag:** 1.7 11 11 * **Requires PHP:** 7.2 12 12 * **License:** GPLv2 or later … … 125 125 ## Changelog 126 126 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 127 130 ### 1.6.6 128 131 * **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 2 2 /** 3 3 * Schema.org Validator Class 4 * @version 1. 6.64 * @version 1.7 5 5 */ 6 6 class MDTJ_Schema_Validator { -
microdata-to-json-ld-converter/tags/1.7/includes/class-microdata-to-json-ld-converter.php
r3361462 r3406275 2 2 /** 3 3 * Main plugin class. 4 * @version 1. 6.64 * @version 1.7 5 5 * 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. 6 7 * 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. 7 8 * v1.6.5 - Replaced deprecated mb_convert_encoding for handling character sets for HTML parsing. … … 58 59 59 60 public function start_buffer() { 61 // $mdtj_preview = isset( $_GET['mdtj_preview'] ) ? sanitize_key( $_GET['mdtj_preview'] ) : ''; 60 62 $mdtj_preview = isset( $_GET['mdtj_preview'] ) ? sanitize_key( wp_unslash( $_GET['mdtj_preview'] ) ) : ''; 61 63 … … 369 371 } 370 372 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 372 392 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>'; } 373 393 -
microdata-to-json-ld-converter/tags/1.7/microdata-to-json-ld-converter.php
r3361462 r3406275 4 4 * Plugin URI: https://www.sethcreates.com/plugins-for-wordpress/microdata-to-json-ld-converter/ 5 5 * 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.66 * Version: 1.7 7 7 * Author: Seth Smigelski 8 8 * Author URI: https://www.sethcreates.com/plugins-for-wordpress/ … … 19 19 // 1. Define plugin constants 20 20 define( 'MDTJ_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 21 //define( 'MDTJ_PLUGIN_VERSION', '1. 6' );21 //define( 'MDTJ_PLUGIN_VERSION', '1.7' ); 22 22 23 23 // 2. Require the class files -
microdata-to-json-ld-converter/tags/1.7/readme.txt
r3361462 r3406275 4 4 Requires at least: 5.5 5 5 Tested up to: 6.8 6 Stable tag: 1. 6.66 Stable tag: 1.7 7 7 Requires PHP: 7.2 8 8 License: GPLv2 or later … … 98 98 == Changelog == 99 99 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 100 103 = 1.6.6 = 101 104 * **SECURITY:** Improved Input handling and enhanced protection against parameter manipulation attacks. -
microdata-to-json-ld-converter/trunk/README.md
r3361462 r3406275 8 8 * **Requires at least:** 5.5 9 9 * **Tested up to:** 6.8 10 * **Stable tag:** 1. 6.510 * **Stable tag:** 1.7 11 11 * **Requires PHP:** 7.2 12 12 * **License:** GPLv2 or later … … 125 125 ## Changelog 126 126 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 127 130 ### 1.6.6 128 131 * **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 2 2 /** 3 3 * Schema.org Validator Class 4 * @version 1. 6.64 * @version 1.7 5 5 */ 6 6 class MDTJ_Schema_Validator { -
microdata-to-json-ld-converter/trunk/includes/class-microdata-to-json-ld-converter.php
r3361462 r3406275 2 2 /** 3 3 * Main plugin class. 4 * @version 1. 6.64 * @version 1.7 5 5 * 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. 6 7 * 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. 7 8 * v1.6.5 - Replaced deprecated mb_convert_encoding for handling character sets for HTML parsing. … … 58 59 59 60 public function start_buffer() { 61 // $mdtj_preview = isset( $_GET['mdtj_preview'] ) ? sanitize_key( $_GET['mdtj_preview'] ) : ''; 60 62 $mdtj_preview = isset( $_GET['mdtj_preview'] ) ? sanitize_key( wp_unslash( $_GET['mdtj_preview'] ) ) : ''; 61 63 … … 369 371 } 370 372 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 372 392 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>'; } 373 393 -
microdata-to-json-ld-converter/trunk/microdata-to-json-ld-converter.php
r3361462 r3406275 4 4 * Plugin URI: https://www.sethcreates.com/plugins-for-wordpress/microdata-to-json-ld-converter/ 5 5 * 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.66 * Version: 1.7 7 7 * Author: Seth Smigelski 8 8 * Author URI: https://www.sethcreates.com/plugins-for-wordpress/ … … 19 19 // 1. Define plugin constants 20 20 define( 'MDTJ_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 21 //define( 'MDTJ_PLUGIN_VERSION', '1. 6' );21 //define( 'MDTJ_PLUGIN_VERSION', '1.7' ); 22 22 23 23 // 2. Require the class files -
microdata-to-json-ld-converter/trunk/readme.txt
r3361462 r3406275 4 4 Requires at least: 5.5 5 5 Tested up to: 6.8 6 Stable tag: 1. 6.66 Stable tag: 1.7 7 7 Requires PHP: 7.2 8 8 License: GPLv2 or later … … 98 98 == Changelog == 99 99 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 100 103 = 1.6.6 = 101 104 * **SECURITY:** Improved Input handling and enhanced protection against parameter manipulation attacks.
Note: See TracChangeset
for help on using the changeset viewer.