| @@ -1,43 +1,51 @@ | ||
| 1 | 1 | <?php |
| 2 | +// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- view template receives variables via extract(); prefixing is impractical. | |
| 2 | 3 | |
| 3 | - if ( empty( $args ) || ! is_array( $args ) ) { | |
| 4 | - return; | |
| 5 | - } | |
| 6 | 4 | |
| 5 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 6 | + exit; | |
| 7 | +} | |
| 8 | +if ( empty( $args ) || ! is_array( $args ) ) { | |
| 9 | + return; | |
| 10 | +} | |
| 11 | + | |
| 7 | 12 | ?> |
| 8 | 13 | |
| 9 | 14 | <tr> |
| 10 | - <td style="text-align: left; font-size: 20px; padding-top: 40px;"> | |
| 11 | - <?php _e( 'Top Performing Docs', 'betterdocs' );?> | |
| 12 | - </td> | |
| 15 | + <td style="text-align: left; font-size: 20px; padding-top: 40px;"> | |
| 16 | + <?php esc_html_e( 'Top Performing Docs', 'betterdocs' ); ?> | |
| 17 | + </td> | |
| 13 | 18 | </tr> |
| 14 | 19 | <tr> |
| 15 | - <td style="padding:0"> | |
| 16 | - <table style="width: 100%; border-collapse: separate; border-spacing: 2px; padding-top: 20px;"> | |
| 17 | - <tr style="background: #fff;"> | |
| 18 | - <th style="text-align: left; font-size: 14px; font-weight: 600; color:#6e6e73; text-transform: capitalize; padding: 8px 15px; width: 48%;"> | |
| 19 | - <?php _e( 'Doc Title', 'betterdocs' );?> | |
| 20 | - </th> | |
| 21 | - <th style="text-align: center; font-size: 14px; font-weight: 600; color:#6e6e73; text-transform: capitalize; padding: 8px 8px;"> | |
| 22 | - <?php _e( 'Total Views', 'betterdocs' );?> | |
| 23 | - </th> | |
| 24 | - <th style="text-align: center; font-size: 14px; font-weight: 600; color:#6e6e73; text-transform: capitalize; padding: 8px 8px;"> | |
| 25 | - <?php _e( 'Unique Views', 'betterdocs' );?> | |
| 26 | - </th> | |
| 27 | - <?php | |
| 28 | - if ( $total_reactions > 0 ) { | |
| 29 | - echo '<th style="text-align: center; font-size: 14px; font-weight: 600; color:#6e6e73; text-transform: capitalize; padding: 8px 15px;">' . __( 'Reactions', 'betterdocs' ) . '</th>'; | |
| 30 | - } | |
| 31 | - ?> | |
| 32 | - </tr> | |
| 33 | - <?php | |
| 34 | - foreach ( $args as $docs ) { | |
| 35 | - betterdocs()->views->get( 'admin/email/analytics/parts/single-docs', [ | |
| 36 | - 'docs' => $docs, | |
| 37 | - 'total_reactions' => $total_reactions | |
| 38 | - ] ); | |
| 39 | - } | |
| 40 | - ?> | |
| 41 | - </table> | |
| 42 | - </td> | |
| 20 | + <td style="padding:0"> | |
| 21 | + <table style="width: 100%; border-collapse: separate; border-spacing: 2px; padding-top: 20px;"> | |
| 22 | + <tr style="background: #fff;"> | |
| 23 | + <th style="text-align: left; font-size: 14px; font-weight: 600; color:#6e6e73; text-transform: capitalize; padding: 8px 15px; width: 48%;"> | |
| 24 | + <?php esc_html_e( 'Doc Title', 'betterdocs' ); ?> | |
| 25 | + </th> | |
| 26 | + <th style="text-align: center; font-size: 14px; font-weight: 600; color:#6e6e73; text-transform: capitalize; padding: 8px 8px;"> | |
| 27 | + <?php esc_html_e( 'Total Views', 'betterdocs' ); ?> | |
| 28 | + </th> | |
| 29 | + <th style="text-align: center; font-size: 14px; font-weight: 600; color:#6e6e73; text-transform: capitalize; padding: 8px 8px;"> | |
| 30 | + <?php esc_html_e( 'Unique Views', 'betterdocs' ); ?> | |
| 31 | + </th> | |
| 32 | + <?php | |
| 33 | + if ( $total_reactions > 0 ) { | |
| 34 | + echo '<th style="text-align: center; font-size: 14px; font-weight: 600; color:#6e6e73; text-transform: capitalize; padding: 8px 15px;">' . esc_html__( 'Reactions', 'betterdocs' ) . '</th>'; | |
| 35 | + } | |
| 36 | + ?> | |
| 37 | + </tr> | |
| 38 | + <?php | |
| 39 | + foreach ( $args as $docs ) { | |
| 40 | + betterdocs()->views->get( | |
| 41 | + 'admin/email/analytics/parts/single-docs', | |
| 42 | + [ | |
| 43 | + 'docs' => $docs, | |
| 44 | + 'total_reactions' => $total_reactions | |
| 45 | + ] | |
| 46 | + ); | |
| 47 | + } | |
| 48 | + ?> | |
| 49 | + </table> | |
| 50 | + </td> | |
| 43 | 51 | </tr> |