Changeset 3071620 for schema-and-structured-data-for-wp
- Timestamp:
- 04/16/2024 01:05:20 PM (12 months ago)
- Location:
- schema-and-structured-data-for-wp/trunk
- Files:
-
- 4 edited
-
modules/gutenberg/includes/class-gutenberg.php (modified) (7 diffs)
-
output/gutenberg.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
structured-data-for-wp.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
schema-and-structured-data-for-wp/trunk/modules/gutenberg/includes/class-gutenberg.php
r2972162 r3071620 548 548 549 549 case 'right': 550 echo '<img class="alignright" style="float:right;" '. html_entity_decode(esc_attr($item['image_align'])).'>';550 echo '<img class="alignright" style="float:right;" '. esc_attr($item['image_align']).'>'; 551 551 break; 552 552 case 'left': 553 echo '<img class="alignleft" style="float:left;" '. html_entity_decode(esc_attr($item['image_align'])).'>';553 echo '<img class="alignleft" style="float:left;" '. esc_attr($item['image_align']).'>'; 554 554 break; 555 555 556 556 default: 557 echo '<img class="alignleft" style="float:left;" '. html_entity_decode(esc_attr($item['image_align'])).'>';557 echo '<img class="alignleft" style="float:left;" '. esc_attr($item['image_align']).'>'; 558 558 break; 559 559 } … … 562 562 foreach($attributes['items'] as $item){ 563 563 564 $block_title = isset($item['title'])?$item['title']:''; 565 $block_description = isset($item['description'])?$item['description']:''; 566 564 567 if($item['title'] || $item['description']){ 565 568 … … 574 577 575 578 case 'h1': 576 echo '<h1>'. html_entity_decode(esc_attr($item['title'])).'</h1>';579 echo sprintf('<h1>%s</h1>', esc_html($block_title)); 577 580 break; 578 581 case 'h2': 579 echo '<h2>'. html_entity_decode(esc_attr($item['title'])).'</h2>';582 echo sprintf('<h2>%s</h2>', esc_html($block_title)); 580 583 break; 581 584 case 'h3': 582 echo '<h3>'. html_entity_decode(esc_attr($item['title'])).'</h3>';585 echo sprintf('<h3>%s</h3>', esc_html($block_title)); 583 586 break; 584 587 case 'h4': 585 echo '<h4>'. html_entity_decode(esc_attr($item['title'])).'</h4>';588 echo sprintf('<h4>%s</h4>', esc_html($block_title)); 586 589 break; 587 590 case 'h5': 588 echo '<h5>'. html_entity_decode(esc_attr($item['title'])).'</h5>';591 echo sprintf('<h5>%s</h5>', esc_html($block_title)); 589 592 break; 590 593 case 'h6': 591 echo '<h6>'. html_entity_decode(esc_attr($item['title'])).'</h6>';594 echo sprintf('<h6>%s</h6>', esc_html($block_title)); 592 595 break; 593 596 case 'div': 594 echo '<div>'. html_entity_decode(esc_attr($item['title'])).'</div>';597 echo sprintf('<div>%s</div>', esc_html($block_title)); 595 598 break; 596 599 case 'p': 597 echo '<p>'. html_entity_decode(esc_attr($item['title'])).'</p>';600 echo sprintf('<p>%s</p>', esc_html($block_title)); 598 601 break; 599 602 case 'strong': 600 echo '<strong>'. html_entity_decode(esc_attr($item['title'])).'</strong>';603 echo sprintf('<strong>%s</strong>', esc_html($block_title)); 601 604 break; 602 605 603 606 604 607 default: 605 echo '<h5>'. html_entity_decode(esc_attr($item['title'])).'</h5>';608 echo sprintf('<h5>%s</h5>', esc_html($block_title)); 606 609 break; 607 610 } 608 611 609 612 }else{ 610 echo '<h5 class="saswp-faq-question-title">'. html_entity_decode(esc_attr($item['title'])).'</h5>';613 echo sprintf('<h5 class="saswp-faq-question-title">%s</h5>', esc_html($block_title)); 611 614 } 612 615 613 echo '<p class="saswp-faq-answer-text">'.html_entity_decode(esc_textarea($item['description'])).'</p>'; 616 if(isset($item['description'])){ 617 $allowed_tags = array('img' => array( 618 'class' => array(), 619 'id' => array(), 620 'style' => array(), 621 'src' => array(), 622 'key' => array(), 623 'alt' => array(), 624 'height' => array(), 625 'width' => array() 626 ) 627 ); 628 echo sprintf('<p class="saswp-faq-answer-text">%s</p>', wp_kses($item['description'], $allowed_tags)); 629 } 614 630 615 631 } … … 693 709 } 694 710 if(isset($attributes['description'])){ 695 echo '<p>'.html_entity_decode(esc_attr($attributes['description'])).'</p>';711 echo sprintf('<p>%s</p>', esc_html($attributes['description'])); 696 712 } 697 713 … … 705 721 706 722 707 if(($attributes['listStyleType']=='none')){ 708 echo'<ol '.$className.' style="list-style-type:none;">'; 709 }elseif(($attributes['listStyleType']=='disc')){ 710 echo'<ol '.$className.' style="list-style-type:disc;">'; 711 }else{ 723 if(isset($attributes['listStyleType'])){ 724 if(($attributes['listStyleType']=='none')){ 725 echo'<ol '.$className.' style="list-style-type:none;">'; 726 }elseif(($attributes['listStyleType']=='disc')){ 727 echo'<ol '.$className.' style="list-style-type:disc;">'; 728 }else{ 729 echo '<ol>'; 730 } 731 }else{ 712 732 echo '<ol>'; 713 }733 } 714 734 715 735 if(isset($item['image_align'])){ … … 719 739 720 740 case 'right': 721 echo '<img class="alignright"'. html_entity_decode(esc_attr($item['image_align'])).'>';741 echo '<img class="alignright"'. esc_attr($item['image_align']).'>'; 722 742 break; 723 743 case 'left': 724 echo '<img class="alignleft" '. html_entity_decode(esc_attr($item['image_align'])).'>';744 echo '<img class="alignleft" '. esc_attr($item['image_align']).'>'; 725 745 break; 726 746 727 747 default: 728 echo '<img class="alignleft" '. html_entity_decode(esc_attr($item['image_align'])).'>';748 echo '<img class="alignleft" '. esc_attr($item['image_align']).'>'; 729 749 break; 730 750 } … … 733 753 foreach($attributes['items'] as $item){ 734 754 755 $block_title = isset($item['title'])?$item['title']:''; 756 $block_description = isset($item['description'])?$item['description']:''; 757 735 758 if($item['title'] || $item['description']){ 736 759 echo '<li>'; 737 if(isset($attributes['headingTag']) && !empty($attributes['headingTag']) && $attributes['headingTag'] == 'h1' || $attributes['headingTag'] == 'h2' || $attributes['headingTag'] == 'h3' || $attributes['headingTag'] == 'h4' || $attributes['headingTag'] == 'h5' || $attributes['headingTag'] == 'h6'){ 738 echo '<'.html_entity_decode(esc_attr($attributes['headingTag'])).'>'. html_entity_decode(esc_attr($item['title'])).'</'.html_entity_decode(esc_attr($attributes['headingTag'])).'>'; 760 if(isset($attributes['headingTag']) && !empty($attributes['headingTag'])){ 761 $heading_array = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'); 762 if(in_array($attributes['headingTag'], $heading_array)){ 763 echo sprintf('<%s> %s </%s>', esc_html($attributes['headingTag']), esc_html($block_title), esc_html($attributes['headingTag'])); 764 } 739 765 }else{ 740 echo '<h1 class="saswp-how-to-step-name">'. html_entity_decode(esc_attr($item['title'])).'</h1>';766 echo sprintf('<h1 class="saswp-how-to-step-name">%s</h1>', esc_html($block_title)); 741 767 } 742 echo '<p class="saswp-how-to-step-text">'.html_entity_decode(esc_textarea($item['description'])).'</p>'; 768 $allowed_tags = array('img' => array( 769 'class' => array(), 770 'id' => array(), 771 'style' => array(), 772 'src' => array(), 773 'key' => array(), 774 'alt' => array(), 775 'height' => array(), 776 'width' => array() 777 ) 778 ); 779 780 echo sprintf('<p class="saswp-how-to-step-text">%s</p>', wp_kses($item['description'], $allowed_tags)); 743 781 echo '</li>'; 744 782 } -
schema-and-structured-data-for-wp/trunk/output/gutenberg.php
r2972162 r3071620 930 930 $supply_data['name'] = htmlspecialchars(wp_strip_all_tags($val['title']), ENT_QUOTES, 'UTF-8'); 931 931 $supply_data['acceptedAnswer']['@type'] = 'Answer'; 932 $supply_data['acceptedAnswer']['text'] = htmlspecialchars(wp_strip_all_tags(do_shortcode($val['description'])), ENT_QUOTES, 'UTF-8');932 $supply_data['acceptedAnswer']['text'] = isset($val['description'])?htmlspecialchars(wp_strip_all_tags(do_shortcode($val['description'])), ENT_QUOTES, 'UTF-8'):''; 933 933 934 934 if(isset($val['imageId']) && $val['imageId'] !=''){ -
schema-and-structured-data-for-wp/trunk/readme.txt
r3060932 r3071620 5 5 Tested up to: 6.5 6 6 Requires PHP: 5.6.20 7 Stable tag: 1. 297 Stable tag: 1.30 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 122 122 == Changelog == 123 123 124 = 1.30 (16 April 2024) = 125 126 * Fixed: Security vulnerability issues raised by Wordfence 127 124 128 = 1.29 (29 March 2024) = 125 129 -
schema-and-structured-data-for-wp/trunk/structured-data-for-wp.php
r3060932 r3071620 3 3 Plugin Name: Schema & Structured Data for WP & AMP 4 4 Description: Schema & Structured Data adds Google Rich Snippets markup according to Schema.org guidelines to structure your site for SEO. (AMP Compatible) 5 Version: 1. 295 Version: 1.30 6 6 Text Domain: schema-and-structured-data-for-wp 7 7 Domain Path: /languages … … 14 14 if ( ! defined( 'ABSPATH' ) ) exit; 15 15 16 define('SASWP_VERSION', '1. 29');16 define('SASWP_VERSION', '1.30'); 17 17 define('SASWP_DIR_NAME_FILE', __FILE__ ); 18 18 define('SASWP_DIR_NAME', dirname( __FILE__ ));
Note: See TracChangeset
for help on using the changeset viewer.