| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | <?php |
| 2 | +// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- view template receives variables via extract(); prefixing is impractical. | |
| 2 | 3 | /** |
| 3 | 4 | * Template part for displaying Article Summary |
| 4 | 5 | * |
| 5 | 6 | * @author WPDeveloper |
| @@ -31,9 +32,9 @@ | ||
| 31 | 32 | if ( ! $is_editor_mode ) { |
| 32 | 33 | $post_content = get_post_field( 'post_content', $post_id ); |
| 33 | 34 | |
| 34 | 35 | // Return early if no content exists |
| 35 | - if ( empty( $post_content ) || trim( strip_tags( $post_content ) ) === '' ) { | |
| 36 | + if ( empty( $post_content ) || trim( wp_strip_all_tags( $post_content ) ) === '' ) { | |
| 36 | 37 | return; |
| 37 | 38 | } |
| 38 | 39 | } |
| 39 | 40 | |
| @@ -102,9 +103,9 @@ | ||
| 102 | 103 | <div <?php echo $wrapper_attr; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> id="betterdocs-article-summary" data-post-id="<?php echo esc_attr( $post_id ); ?>" data-post-type="<?php echo esc_attr( get_post_type( $post_id ) ); ?>"> |
| 103 | 104 | <?php if ( $show_title ) : ?> |
| 104 | 105 | <div class="betterdocs-summary-header" id="betterdocs-summary-toggle"> |
| 105 | 106 | <span class="betterdocs-summary-title" <?php echo ! empty( $title_style ) ? 'style="' . esc_attr( $title_style ) . '"' : ''; ?>> |
| 106 | - <img src="<?php echo betterdocs()->assets->icon( 'ai-summary-icon.svg' ); ?>" alt="<?php echo esc_html__( 'AI Doc Summarizer', 'betterdocs' ); ?>" /> | |
| 107 | + <img src="<?php echo esc_url( betterdocs()->assets->icon( 'ai-summary-icon.svg' ) ); ?>" alt="<?php echo esc_attr__( 'AI Doc Summarizer', 'betterdocs' ); ?>" /> | |
| 107 | 108 | <?php echo esc_html( $title_text ); ?> |
| 108 | 109 | <span class="betterdocs-summary-arrow" <?php echo ! empty( $icon_style ) ? 'style="' . esc_attr( $icon_style ) . '"' : ''; ?>> |
| 109 | 110 | <?php echo $arrow_right; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- SVG icons cannot be escaped ?> |
| 110 | 111 | <?php echo $arrow_down; //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- SVG icons cannot be escaped ?> |
| @@ -114,9 +115,9 @@ | ||
| 114 | 115 | <?php endif; ?> |
| 115 | 116 | |
| 116 | 117 | <div class="betterdocs-summary-content" id="betterdocs-summary-content" style="display: <?php echo $is_editor_mode ? 'block' : 'none'; ?>;"> |
| 117 | 118 | <div class="betterdocs-summary-loading" id="betterdocs-summary-loading" style="display: none;" <?php echo ! empty( $loading_style ) ? 'data-style="' . esc_attr( $loading_style ) . '"' : ''; ?>> |
| 118 | - <img src="<?php echo betterdocs()->assets->icon( 'thinking-spinner.gif' ); ?>" alt="<?php echo esc_html__( 'AI Doc Summarizer Thinking', 'betterdocs' ); ?>" /> | |
| 119 | + <img src="<?php echo esc_url( betterdocs()->assets->icon( 'thinking-spinner.gif' ) ); ?>" alt="<?php echo esc_attr__( 'AI Doc Summarizer Thinking', 'betterdocs' ); ?>" /> | |
| 119 | 120 | <span class="betterdocs-thinking-text"> |
| 120 | 121 | <?php echo esc_html__( 'Thinking', 'betterdocs' ); ?><span class="betterdocs-thinking-dots"></span> |
| 121 | 122 | </span> |
| 122 | 123 | </div> |