Plugin Directory

Changeset 3447303


Ignore:
Timestamp:
01/26/2026 06:42:24 PM (2 months ago)
Author:
uptocode
Message:

1.0.1 Improved JSON+LD schema visibility

Location:
smart-content-blocks
Files:
12 added
3 edited

Legend:

Unmodified
Added
Removed
  • smart-content-blocks/trunk/includes/scba-helpers.php

    r3426401 r3447303  
    133133        1
    134134    );
     135}
     136
     137/**
     138 * Generate and attach accompanying JSON+LD for a Tyle.
     139 */
     140function scba_script_add_json_ld( string $aid ): string {
     141    if ( $aid === '' ) {
     142        return '';
     143    }
     144
     145    $data = [
     146        '@context' => 'https://schema.org/',
     147        '@type' => 'WebPageElement',
     148        '@id' => '#tiq-unit-' . $aid,
     149        'isBasedOn' => [
     150            '@id' => 'https://cdn.tyleiq.com/tyles/' . $aid . '.json'
     151        ]
     152    ];
     153   
     154    return '<script type="application/ld+json">' . json_encode($data, JSON_UNESCAPED_SLASHES) . '</script>';
    135155}
    136156
  • smart-content-blocks/trunk/readme.txt

    r3426401 r3447303  
    33Requires at least: 6.6
    44Tested up to: 6.9
    5 Stable tag: 1.0.0
     5Stable tag: 1.0.1
    66License: GPLv2 or later
    77License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4141
    4242Developer docs, use cases, and customization tips are available at [TyleIQ Docs](https://tyleiq.com/docs/getting-started/?utm_source=wpadmin&utm_medium=readme&utm_campaign=tyleiq-wp-plugin).
     43
     44== Changelog ==
     45
     46= 1.0.1 =
     47
     48Release date: 2026-01-26
     49
     50* Improvements to schema markup for better content detection by AI models.
  • smart-content-blocks/trunk/smart-content-blocks.php

    r3426401 r3447303  
    33 * Plugin Name: Smart Content Blocks With Analytics
    44 * Description: TyleIQ.com provides intelligent content units with analytics built-in. Embed them into your WooCommerce store or any page using Smart Content Blocks.
    5  * Version: 1.0.0
     5 * Version: 1.0.1
    66 * Author: TyleIQ
    77 * Author URI: https://tyleiq.com
     
    1717
    1818// Set plugin version
    19 define( 'SMART_CONTENT_BLOCKS_VERSION', '1.0.0' );
     19define( 'SMART_CONTENT_BLOCKS_VERSION', '1.0.1' );
    2020
    2121/*
     
    149149
    150150/*
    151  * Block render callback
     151 * Block render callback. Renders final HTML output.
    152152 */
    153153function scba_block_render( $attributes ): string {
     
    159159    }
    160160
    161     $valid = scba_sanitize_script( $script_tag );
    162     if ( ! $valid ) {
     161    $tag = scba_sanitize_script( $script_tag );
     162    if ( ! $tag ) {
    163163        return '';
    164164    }
    165165
    166     $valid = scba_script_add_unique_id_if_missing( $valid, 'scba-block-' );
     166    $tag = scba_script_add_unique_id_if_missing( $tag, 'scba-block-' );
    167167
    168168    $allowed           = wp_kses_allowed_html( 'post' );
     
    175175    );
    176176
    177     return wp_kses( $valid, $allowed );
     177    // Append JSON+LD
     178    $tag = $tag . scba_script_add_json_ld( $attributes['aid'] );
     179
     180    return wp_kses( $tag, $allowed );
    178181}
    179182
     
    514517                }
    515518                if ( scba_should_display( $snippet ) ) {
    516                     $script = scba_get_snippet_html( $snippet['script'] );
     519                    $script = scba_get_snippet_html( $snippet['script'] );
    517520                    $script = scba_script_add_unique_id_if_missing( $script, 'scba-wc-php-' );
    518521
     
    599602    ];
    600603
    601 
    602604    foreach ( $snippets as $i => $snippet ) {
    603605        $hook = $snippet['hook'] ?? '';
Note: See TracChangeset for help on using the changeset viewer.