Plugin Directory


Ignore:
Timestamp:
04/16/2024 01:05:20 PM (12 months ago)
Author:
magazine3
Message:

Released Version 1.30

Location:
schema-and-structured-data-for-wp/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • schema-and-structured-data-for-wp/trunk/modules/gutenberg/includes/class-gutenberg.php

    r2972162 r3071620  
    548548                               
    549549                                  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']).'>';
    551551                                    break;
    552552                                  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']).'>';
    554554                                    break;
    555555   
    556556                                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']).'>';
    558558                                break;
    559559                            }
     
    562562                        foreach($attributes['items'] as $item){
    563563                           
     564                          $block_title = isset($item['title'])?$item['title']:'';
     565                          $block_description = isset($item['description'])?$item['description']:'';
     566
    564567                          if($item['title'] || $item['description']){
    565568   
     
    574577   
    575578                                    case 'h1':
    576                                             echo '<h1>'. html_entity_decode(esc_attr($item['title'])).'</h1>';
     579                                            echo sprintf('<h1>%s</h1>', esc_html($block_title));
    577580                                        break;
    578581                                    case 'h2':
    579                                             echo '<h2>'. html_entity_decode(esc_attr($item['title'])).'</h2>';
     582                                            echo sprintf('<h2>%s</h2>', esc_html($block_title));
    580583                                        break;
    581584                                    case 'h3':
    582                                             echo '<h3>'. html_entity_decode(esc_attr($item['title'])).'</h3>';
     585                                            echo sprintf('<h3>%s</h3>', esc_html($block_title));
    583586                                        break;
    584587                                    case 'h4':
    585                                             echo '<h4>'. html_entity_decode(esc_attr($item['title'])).'</h4>';
     588                                            echo sprintf('<h4>%s</h4>', esc_html($block_title));
    586589                                        break;
    587590                                    case 'h5':
    588                                             echo '<h5>'. html_entity_decode(esc_attr($item['title'])).'</h5>';
     591                                            echo sprintf('<h5>%s</h5>', esc_html($block_title));
    589592                                        break;
    590593                                    case 'h6':
    591                                             echo '<h6>'. html_entity_decode(esc_attr($item['title'])).'</h6>';
     594                                            echo sprintf('<h6>%s</h6>', esc_html($block_title));
    592595                                        break;   
    593596                                    case 'div':
    594                                             echo '<div>'. html_entity_decode(esc_attr($item['title'])).'</div>';
     597                                            echo sprintf('<div>%s</div>', esc_html($block_title));
    595598                                        break; 
    596599                                    case 'p':
    597                                             echo '<p>'. html_entity_decode(esc_attr($item['title'])).'</p>';
     600                                            echo sprintf('<p>%s</p>', esc_html($block_title));
    598601                                        break;
    599602                                    case 'strong':
    600                                             echo '<strong>'. html_entity_decode(esc_attr($item['title'])).'</strong>';
     603                                            echo sprintf('<strong>%s</strong>', esc_html($block_title));
    601604                                        break;   
    602605   
    603606   
    604607                                    default:
    605                                     echo '<h5>'. html_entity_decode(esc_attr($item['title'])).'</h5>';
     608                                    echo sprintf('<h5>%s</h5>', esc_html($block_title));
    606609                                        break;
    607610                                }
    608611   
    609612                            }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));   
    611614                            }
    612615                                                   
    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                            }
    614630                           
    615631                          } 
     
    693709                }               
    694710                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']));
    696712                }
    697713                               
     
    705721                   
    706722
    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{
    712732                        echo '<ol>';
    713                      }
     733                    }
    714734                   
    715735                    if(isset($item['image_align'])){
     
    719739                           
    720740                              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']).'>';
    722742                                break;
    723743                              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']).'>';
    725745                                break;
    726746
    727747                            default:
    728                             echo  '<img class="alignleft" '. html_entity_decode(esc_attr($item['image_align'])).'>';
     748                            echo  '<img class="alignleft" '. esc_attr($item['image_align']).'>';
    729749                            break;
    730750                        }
     
    733753                    foreach($attributes['items'] as $item){
    734754                       
     755                      $block_title = isset($item['title'])?$item['title']:'';
     756                      $block_description = isset($item['description'])?$item['description']:'';
     757
    735758                      if($item['title'] || $item['description']){
    736759                        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                            }
    739765                        }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));
    741767                        }
    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));
    743781                        echo '</li>';
    744782                      } 
  • schema-and-structured-data-for-wp/trunk/output/gutenberg.php

    r2972162 r3071620  
    930930                                   $supply_data['name']                    = htmlspecialchars(wp_strip_all_tags($val['title']), ENT_QUOTES, 'UTF-8');
    931931                                   $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'):'';
    933933
    934934                                    if(isset($val['imageId']) && $val['imageId'] !=''){
  • schema-and-structured-data-for-wp/trunk/readme.txt

    r3060932 r3071620  
    55Tested up to: 6.5
    66Requires PHP: 5.6.20
    7 Stable tag: 1.29
     7Stable tag: 1.30
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    122122== Changelog ==
    123123
     124= 1.30 (16 April 2024) =
     125
     126* Fixed: Security vulnerability issues raised by Wordfence
     127
    124128= 1.29 (29 March 2024) =
    125129
  • schema-and-structured-data-for-wp/trunk/structured-data-for-wp.php

    r3060932 r3071620  
    33Plugin Name: Schema & Structured Data for WP & AMP
    44Description: Schema & Structured Data adds Google Rich Snippets markup according to Schema.org guidelines to structure your site for SEO. (AMP Compatible)
    5 Version: 1.29
     5Version: 1.30
    66Text Domain: schema-and-structured-data-for-wp
    77Domain Path: /languages
     
    1414if ( ! defined( 'ABSPATH' ) ) exit;
    1515
    16 define('SASWP_VERSION', '1.29');
     16define('SASWP_VERSION', '1.30');
    1717define('SASWP_DIR_NAME_FILE', __FILE__ );
    1818define('SASWP_DIR_NAME', dirname( __FILE__ ));
Note: See TracChangeset for help on using the changeset viewer.