scan-results.php
103 lines
| 1 | <?php |
| 2 | if ( ! defined( 'ABSPATH' ) ) { |
| 3 | exit; |
| 4 | } |
| 5 | ?> |
| 6 | <?php |
| 7 | if ( $scan_results ) : |
| 8 | ?> |
| 9 | <div class="wt-cli-cookie-scan-results-container"> |
| 10 | <div class="wt-cli-scan-result-header"> |
| 11 | <div class="wt-cli-row wt-cli-align-center"> |
| 12 | <div class="wt-cli-col-6"> |
| 13 | <h2> |
| 14 | <?php |
| 15 | echo esc_html__( 'Cookie scan result for your website', 'cookie-law-info' ); |
| 16 | ?> |
| 17 | </h2> |
| 18 | </div> |
| 19 | <div class="wt-cli-col-6"> |
| 20 | <div class="wt-cli-scan-result-actions"> |
| 21 | <?php echo wp_kses_post( $this->get_scan_btn( true ) ); ?> |
| 22 | </div> |
| 23 | </div> |
| 24 | </div> |
| 25 | </div> |
| 26 | <div class="wt-cli-scan-results-body"> |
| 27 | <div class="wt-cli-scan-result-summary"> |
| 28 | <ul class="wt-cli-scan-result-summary-list"> |
| 29 | <li> |
| 30 | <b><?php echo esc_html__( 'Total URLs', 'cookie-law-info' ); ?></b>: <span class="wt-cli-cookie-scan-count"> <?php echo esc_html( $scan_results['total_urls'] ); ?></span><br /> |
| 31 | </li> |
| 32 | <li> |
| 33 | <b><?php echo esc_html__( 'Total cookies', 'cookie-law-info' ); ?></b>: <span class="wt-cli-cookie-scan-count"> <?php echo esc_html( $scan_results['total_cookies'] ); ?></span><br /> |
| 34 | </li> |
| 35 | </ul> |
| 36 | </div> |
| 37 | <?php if ( $scan_results['total_cookies'] > 0 ) : ?> |
| 38 | <div class="wt-cli-scan-result-import-section"> |
| 39 | <p> |
| 40 | <?php |
| 41 | |
| 42 | echo sprintf( |
| 43 | wp_kses( |
| 44 | /* translators: %s: Cookie List URL */ |
| 45 | __( 'Clicking “Add to cookie list” will import the discovered cookies to the <a href="%s" target="_blank">Cookie List</a> and thus display them in the cookie declaration section of your consent banner.', 'cookie-law-info' ), |
| 46 | array( |
| 47 | 'a' => array( |
| 48 | 'href' => array(), |
| 49 | 'target' => array(), |
| 50 | ), |
| 51 | ) |
| 52 | ), |
| 53 | esc_url( $cookie_list_page ) |
| 54 | ); |
| 55 | ?> |
| 56 | </p> |
| 57 | <a class="button-primary cli_import" data-scan-id="<?php echo esc_attr( $scan_results['scan_id'] ); ?>" style="margin-left:5px;"><?php echo esc_html__( 'Add to cookie list', 'cookie-law-info' ); ?></a> |
| 58 | </div> |
| 59 | <?php endif; ?> |
| 60 | <?php |
| 61 | $count = 1; |
| 62 | $cookies = isset( $scan_results['cookies'] ) ? $scan_results['cookies'] : array(); |
| 63 | ?> |
| 64 | <div class="wt-cli-scan-result-cookie-container"> |
| 65 | <div class="wt-cli-row"> |
| 66 | <div class="wt-cli-col-12"> |
| 67 | <div class="wt-cli-scan-result-cookies"> |
| 68 | <table class="wt-cli-table"> |
| 69 | <thead> |
| 70 | <th style="width:6%;"><?php echo esc_html__( 'Sl.No:', 'cookie-law-info' ); ?></th> |
| 71 | <th><?php echo esc_html__( 'Cookie Name', 'cookie-law-info' ); ?></th> |
| 72 | <th style="width:15%;" ><?php echo esc_html__( 'Duration', 'cookie-law-info' ); ?></th> |
| 73 | <th style="width:15%;" ><?php echo esc_html__( 'Category', 'cookie-law-info' ); ?></th> |
| 74 | <th style="width:40%;" ><?php echo esc_html__( 'Description', 'cookie-law-info' ); ?></th> |
| 75 | </thead> |
| 76 | <tbody> |
| 77 | <?php if ( isset( $cookies ) && is_array( $cookies ) && count( $cookies ) > 0 ) : ?> |
| 78 | <?php foreach ( $cookies as $cookie ) : ?> |
| 79 | <tr> |
| 80 | <td><?php echo esc_html( $count ); ?></td> |
| 81 | <td><?php echo esc_html( $cookie['id'] ); ?></td> |
| 82 | <td><?php echo esc_html( $cookie['expiry'] ); ?></td> |
| 83 | <td><?php echo esc_html( $cookie['category'] ); ?></td> |
| 84 | <td><?php echo wp_kses_post( wp_unslash( $cookie['description'] ) ); ?></td> |
| 85 | </tr> |
| 86 | <?php |
| 87 | $count ++; |
| 88 | endforeach; |
| 89 | ?> |
| 90 | <?php else : ?> |
| 91 | <tr><td class="colspanchange" colspan="5" style="text-align:center"><?php echo esc_html__( 'Your cookie list is empty', 'cookie-law-info' ); ?></td></tr> |
| 92 | <?php endif; ?> |
| 93 | </tbody> |
| 94 | </table> |
| 95 | </div> |
| 96 | </div> |
| 97 | </div> |
| 98 | </div> |
| 99 | </div> |
| 100 | </div> |
| 101 | <?php else : ?> |
| 102 | <?php endif; ?> |
| 103 |