PluginProbe ʕ •ᴥ•ʔ
WP Job Manager / trunk
WP Job Manager vtrunk
2.4.5 2.4.4 2.4.3 2.4.2 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.1.0 1.1.1 1.1.2 1.1.3 1.10.0 1.11.0 1.11.1 1.12.0 1.12.1 1.13.0 1.14.0 1.15.0 1.16.0 1.16.1 1.17.0 1.18.0 1.19.0 1.2.0 1.20.0 1.20.1 1.21.0 1.21.1 1.21.2 1.21.3 1.21.4 1.22.0 1.22.1 1.22.2 1.22.3 1.23.0 1.23.1 1.23.10 1.23.11 1.23.12 1.23.13 1.23.2 1.23.3 1.23.4 1.23.5 1.23.6 1.23.7 1.23.8 1.23.9 1.24.0 1.24.0.1 1.25.0 1.25.0.1 1.25.1 1.25.1.1 1.25.2 1.25.2.1 1.25.3 1.25.3.1 1.26.0 1.26.0.1 1.26.1 1.26.1.1 1.26.2 1.26.2.1 1.27.0 1.27.0.1 1.28.0 1.28.0.1 1.29.0 1.29.0.1 1.29.1 1.29.1.1 1.29.2 1.29.2.1 1.29.3 1.29.3.1 1.3.0 1.3.1 1.30.0 1.30.0.1 1.30.1 1.30.1.1 1.30.2 1.30.2.1 1.31.0 1.31.0.1 1.31.1 1.31.1.1 1.31.2 1.31.3 1.32.0 1.32.1 1.32.2 1.32.3 1.33.0 1.33.1 1.33.2 1.33.3 1.33.4 1.33.5 1.34.0 1.34.1 1.34.2 1.34.3 1.34.4 1.34.5 1.35.0 1.35.1 1.35.2 1.35.3 1.36.0 1.36.1 1.36.2 1.37.0 1.38.0 1.38.1 1.39.0 1.4.0 1.40.0 1.40.1 1.40.2 1.41.0 1.42.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.7.1 1.7.3 1.8.0 1.8.1 1.8.2 1.9.0 1.9.1 1.9.2 1.9.3 2.0.0 2.1.0 2.1.1 2.2.0 2.2.1 2.2.2 2.3.0 2.4.0 2.4.1
wp-job-manager / templates / job-stats.php
wp-job-manager / templates Last commit date
emails 2 years ago form-fields 4 weeks ago access-denied-browse-job_listings.php 4 years ago access-denied-single-job_listing.php 3 years ago account-signin.php 4 years ago content-job_listing.php 2 months ago content-no-jobs-found.php 7 years ago content-single-job_listing-company.php 3 years ago content-single-job_listing-meta.php 4 years ago content-single-job_listing.php 4 years ago content-summary-job_listing.php 2 months ago content-widget-job_listing.php 2 months ago content-widget-no-jobs-found.php 7 years ago job-application-email.php 4 years ago job-application-url.php 7 years ago job-application.php 7 years ago job-dashboard-login.php 7 years ago job-dashboard-overlay.php 2 years ago job-dashboard.php 2 years ago job-filter-job-types.php 2 years ago job-filters.php 2 years ago job-listings-end.php 7 years ago job-listings-start.php 7 years ago job-pagination.php 7 years ago job-preview.php 2 years ago job-stats.php 2 months ago job-submit.php 2 years ago job-submitted.php 2 years ago notice.php 2 years ago pagination.php 6 years ago
job-stats.php
143 lines
1 <?php
2 /**
3 * Job stats
4 *
5 * @see https://wpjobmanager.com/document/template-overrides/
6 * @author Automattic
7 * @package wp-job-manager
8 * @category Template
9 * @version 2.3.0
10 *
11 * @var WP_Post $job Array of job post results.
12 * @var array $stats Total stats grouped by section.
13 * @var array $chart Total stats grouped by section.
14 */
15
16 use WP_Job_Manager\UI\UI_Elements;
17
18 if ( ! defined( 'ABSPATH' ) ) {
19 exit; // Exit if accessed directly.
20 }
21
22 ?>
23
24 <div class="jm-job-stats">
25 <div class="jm-job-stats-chart">
26 <div class="jm-section-header">
27 <?php esc_html_e( 'Daily Views', 'wp-job-manager' ); ?>
28 </div>
29 <div class="jm-chart">
30 <?php $values = $chart['values']; ?>
31 <div class="jm-chart-y-axis">
32 <?php
33 foreach ( $chart['y-labels'] as $label ) {
34 $position = ( $label / $chart['max'] ) * 100;
35 echo '<div class="jm-chart-y-axis__label" style="bottom: ' . esc_attr( $position ) . '%;"><span>' . esc_html( number_format_i18n( $label ) ) . '</span></div>';
36 }
37 ?>
38 </div>
39 <div class="jm-chart-bars">
40 <?php
41 $i = 0;
42 $count = count( $values );
43 foreach ( $values as $day ) : ?>
44 <?php
45 $class = $day['class'] ?? '';
46 $percent = $i++ / $count * 100;
47 if ( $percent > 80 ) {
48 $class .= ' jm-chart-bar--right-edge';
49 }
50 ?>
51 <div class="jm-chart-bar <?php echo esc_attr( $class ); ?>"
52 aria-describedby="jm-chart-bar-tooltip-<?php echo esc_attr( $day['date'] ); ?>">
53 <div class="jm-chart-bar-tooltip jm-ui-tooltip"
54 id="jm-chart-bar-tooltip-<?php echo esc_attr( $day['date'] ); ?>">
55 <div class="jm-ui-row">
56 <strong><?php echo esc_html( $day['date'] ); ?></strong>
57 </div>
58 <div class="jm-ui-row">
59 <?php esc_html_e( 'Search impressions', 'wp-job-manager' ); ?>
60 <strong><?php echo esc_html( number_format_i18n( $day['impressions'] ) ); ?></strong>
61 </div>
62 <div class="jm-ui-row">
63 <?php esc_html_e( 'Page views', 'wp-job-manager' ); ?>
64 <strong><?php echo esc_html( number_format_i18n( $day['views'] ) ); ?></strong>
65 </div>
66 <div class="jm-ui-row">
67 <?php esc_html_e( 'Unique visitors', 'wp-job-manager' ); ?>
68 <strong><?php echo esc_html( number_format_i18n( $day['uniques'] ) ); ?></strong>
69 </div>
70
71
72 </div>
73 <div class="jm-chart-bar-value"
74 style="height: <?php echo esc_attr( ( $day['views'] / $chart['max'] ) * 100 ); ?>%;"></div>
75 <div class="jm-chart-bar-inner-value"
76 style="height: <?php echo esc_attr( ( $day['uniques'] / $chart['max'] ) * 100 ); ?>%;"></div>
77 </div>
78 <?php endforeach; ?>
79 </div>
80 <div class="jm-chart-x-axis">
81 <div class="jm-chart-x-axis__label">
82 <?php echo esc_html( array_key_first( $values ) ); ?>
83 </div>
84 <div class="jm-chart-x-axis__label">
85 <?php echo esc_html( array_key_last( $values ) ); ?>
86 </div>
87 </div>
88 </div>
89 </div>
90 <p class="jm-job-stats__footnote">
91 <small><em><?php esc_html_e( 'Statistics reflect visitor activity on public pages and may include approximate counts.', 'wp-job-manager' ); ?></em></small>
92 </p>
93 <div class="jm-job-stat-details jm-ui-row">
94 <?php foreach ( $stats as $column_name => $column ) : ?>
95 <div class="jm-ui-col">
96 <?php foreach ( $column as $i => $section ) :
97 $help_text = $section['help'] ?? '';
98 $tooltip_id = $help_text ? 'jm-stat-section-tooltip-' . $column_name . '-' . $i : '';
99 ?>
100 <div class="jm-stat-section">
101 <div class="jm-section-header" aria-describedby="<?php echo esc_attr( $tooltip_id ); ?>">
102 <span><?php echo esc_html( $section['title'] ); ?></span>
103 <?php if ( ! empty( $help_text ) ): ?>
104 <span class="jm-section-header__help jm-ui-has-tooltip" tabindex="0">
105 <?php echo UI_Elements::icon( 'help' ); ?>
106 <div role="tooltip" class="jm-ui-tooltip" id="<?php echo esc_attr( $tooltip_id ); ?>">
107 <?php echo esc_html( $help_text ); ?>
108 </div>
109 </span>
110 <?php endif; ?>
111 </div>
112 <?php foreach ( $section['stats'] as $stat ) : ?>
113 <div class="jm-stat-row jm-ui-row">
114 <?php if ( isset( $stat['icon'] ) ) {
115 echo UI_Elements::icon( $stat['icon'], $stat['label'] );
116 } ?>
117 <div class="jm-stat-label">
118 <?php echo esc_html( $stat['label'] ); ?>
119 </div>
120 <div class="jm-stat-value">
121 <?php if ( isset( $stat['value'] ) ) : ?>
122 <?php echo esc_html( number_format_i18n( $stat['value'] ) ); ?>
123 <?php endif; ?>
124 <?php if ( isset( $stat['percent'] ) ) : ?>
125 <span
126 class="jm-stat-value-percent"><?php echo esc_html( number_format_i18n( $stat['percent'], 2 ) ); ?>%</span>
127 <?php endif; ?>
128 </div>
129 <?php if ( isset( $stat['background'] ) ) : ?>
130 <span
131 class="jm-stat-background"
132 style="width: <?php echo esc_attr( $stat['background'] . '%' ); ?>;"></span>
133 <?php endif; ?>
134 </div>
135 <?php endforeach; ?>
136 </div>
137 <?php endforeach; ?>
138 </div>
139 <?php endforeach; ?>
140
141 </div>
142 </div>
143