PluginProbe ʕ •ᴥ•ʔ
ShareThis Dashboard for Google Analytics / 3.2.0
ShareThis Dashboard for Google Analytics v3.2.0
3.3.2 trunk 1.0.7 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2.5 2.3.5 2.3.6 2.3.7 2.3.8 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 3.0.0 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.3.0 3.3.1
googleanalytics / view / trending.php
googleanalytics / view Last commit date
templates 3 years ago ga-accounts-selector.php 4 years ago ga-auth-button.php 3 years ago ga-code.php 4 years ago ga-dashboard-widget.php 4 years ago ga-debug-modal.php 2 years ago ga-ga4-settings.php 3 years ago ga-googleanalytics-loader.php 4 years ago ga-notice.php 3 years ago ga-oauth-notice.php 4 years ago ga-wp-notice.php 4 years ago old-page.php 3 years ago page.php 3 years ago statistics.php 3 years ago stats.php 2 years ago trending.php 4 years ago
trending.php
128 lines
1 <?php
2 /**
3 * Trending view.
4 *
5 * @package GoogleAnalytics
6 */
7
8 ?>
9 <div class="wrap ga-wrap">
10 <h3 class="ga-trending-h3">Google Analytics</h3>
11 <h2 class="ga-trending-h2"><?php esc_html_e( 'Trending content', 'googleanalytics' ); ?></h2>
12 <div class="ga_container <?php echo esc_attr( false === Ga_Helper::are_features_enabled() ? 'label-grey ga-tooltip' : '' ); ?>"
13 id="exTab2">
14 <?php if ( false === empty( $data['error_message'] ) ) : ?>
15 <?php echo esc_html( $data['error_message'] ); ?>
16 <?php endif; ?>
17 <?php if ( false === empty( $data['ga_msg'] ) ) : ?>
18 <?php echo esc_html( $data['ga_msg'] ); ?>
19 <?php endif; ?>
20 <span class="ga-tooltiptext ga-tooltiptext-trending"><?php echo esc_html( $tooltip ); ?></span>
21 <div class="ga-trending-loader">
22 <div class="ga-trending-loader-wrapper">
23 <div class="ga-loader"></div>
24 </div>
25 <div class="ga-trending-loading-text"><?php echo esc_html__( 'Please wait. Trending Content Alerts are loading.', 'googleanalytics' ); ?></div>
26 </div>
27 <?php if ( true === Ga_Helper::are_features_enabled() && true === empty( $errors ) ) : ?>
28 <?php if ( false === empty( $alerts ) && true === empty( $alerts->error ) ) : ?>
29 <div class="trending-table-container">
30 <table class="ga-table ga-table-trending">
31 <tr>
32 <th>
33 <?php echo esc_html__( 'Top 5 Recent alerts', 'googleanalytics' ); ?>
34 </th>
35 <th class="weight-normal">
36 <?php echo esc_html__( 'Views', 'googleanalytics' ); ?>
37 </th>
38 <th class="weight-normal trending-time">
39 <?php echo esc_html__( 'Time Notified', 'googleanalytics' ); ?>
40 </th>
41 </tr>
42 <?php foreach ( $alerts as $key => $alert ) : ?>
43 <tr>
44 <td>
45 <a class="trending-link" href="<?php echo esc_url( $alert->{'url'} ); ?>">
46 <?php echo esc_html( $alert->{'url'} ); ?>
47 </a>
48 </td>
49 <td>
50 <?php
51 echo esc_html(
52 property_exists(
53 $alert,
54 'pageviews'
55 ) ? $alert->{'pageviews'} : '0'
56 );
57 ?>
58 </td>
59 <td><?php echo esc_html( gmdate( 'F jS, g:ia', strtotime( $alert->{'sent_at'} ) ) ); ?></td>
60 </tr>
61 <?php
62 if ( $key >= 4 ) {
63 break;
64 }
65 ?>
66 <?php endforeach; ?>
67 </table>
68 </div>
69 <?php elseif ( ! empty( $alerts->error ) ) : ?>
70 <div class="ga-alert ga-alert-danger">
71 <?php echo wp_kses_post( $alerts->error ); ?>
72 </div>
73 <?php else : ?>
74 <div class="ga-alert ga-alert-warning">
75 <?php echo esc_html__( 'You will see a history of trending content here once the first article takes off.', 'googleanalytics' ); ?>
76 <a class="ga-alert-link"
77 href="http://tiny.cc/trending/"><?php echo esc_html__( 'Click here to learn more', 'googleanalytics' ); ?></a>
78 </div>
79 <?php endif; ?>
80 <?php endif; ?>
81 <div>
82 <form method="post">
83 <?php
84 wp_nonce_field(
85 Ga_Admin_Controller::ACTION_SHARETHIS_INVITE,
86 Ga_Admin_Controller::GA_NONCE_FIELD_NAME
87 );
88 ?>
89 <input type="hidden" name="<?php echo esc_attr( Ga_Controller_Core::ACTION_PARAM_NAME ); ?>"
90 value="<?php echo esc_attr( Ga_Admin_Controller::ACTION_SHARETHIS_INVITE ); ?>">
91 <table>
92 <tr class="ga-ta-header">
93 <th>
94 <?php echo esc_html__( 'Trending alerts', 'googleanalytics' ); ?>
95 </th>
96 </tr>
97 <tr>
98 <td>
99 <?php
100 echo esc_html__(
101 'Interested in receiving alerts via slack or email? Sign into your Social Optimization Platform account and activate it!
102 Enter your email and we\'ll send you an invite',
103 'googleanalytics'
104 );
105 ?>
106 </td>
107 </tr>
108 <tr>
109 <td><?php echo esc_html__( 'Enter your email to receive an invite', 'googleanalytics' ); ?>
110 <input name="sharethis_invite_email" type="email" value=""
111 <?php echo disabled( false === Ga_Helper::are_features_enabled() ); ?>
112 placeholder="Your email address">
113 <button <?php echo disabled( false === Ga_Helper::are_features_enabled() ); ?>
114 type="submit" class="button button-primary"><?php echo esc_html__( 'Send' ); ?></button>
115 </td>
116 </tr>
117 </table>
118 </form>
119 </div>
120 </div>
121 </div>
122
123 <script type="text/javascript">
124 <?php if ( Ga_Helper::are_features_enabled() ) : ?>
125 ga_trending_loader.show();
126 <?php endif; ?>
127 </script>
128