PluginProbe ʕ •ᴥ•ʔ
ShareThis Dashboard for Google Analytics / 3.0.0
ShareThis Dashboard for Google Analytics v3.0.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 / class / class-ga-notice.php
googleanalytics / class Last commit date
controller 4 years ago core 4 years ago class-ga-admin.php 3 years ago class-ga-autoloader.php 4 years ago class-ga-frontend.php 4 years ago class-ga-helper.php 3 years ago class-ga-hook.php 4 years ago class-ga-notice.php 4 years ago class-ga-sharethis.php 4 years ago class-ga-stats.php 4 years ago class-ga-template.php 4 years ago
class-ga-notice.php
55 lines
1 <?php
2 /**
3 * Google Analytics notice.
4 *
5 * @package GoogleAnalytics
6 */
7
8 /**
9 * Notice class.
10 */
11 class Ga_Notice {
12
13 /**
14 * Get translated error message.
15 *
16 * @param string $error Error string.
17 *
18 * @return string Translated error string.
19 */
20 public static function get_message( $error ) {
21 $message = '';
22
23 if ( Ga_Helper::GA_DEBUG_MODE ) {
24 $message = Ga_Helper::ga_wp_notice(
25 ( ! empty( $error['class'] ) ? esc_html( '[' . $error['class'] . ']' ) : '' ) . ' ' . $error['message'],
26 'error'
27 );
28 } elseif ( 'Ga_Lib_Google_Api_Client_AuthCode_Exception' === $error['class'] ) {
29 $message = Ga_Helper::ga_wp_notice( $error['message'], 'error' );
30 } elseif ( 'Ga_Lib_Sharethis_Api_Client_InvalidDomain_Exception' === $error['class'] ) {
31 $message = Ga_Helper::ga_wp_notice( $error['message'], 'error' );
32 } elseif ( 'Ga_Lib_Sharethis_Api_Client_Invite_Exception' === $error['class'] ) {
33 $message = Ga_Helper::ga_wp_notice( $error['message'], 'error' );
34 } elseif (
35 in_array(
36 $error['class'],
37 array( 'Ga_Lib_Sharethis_Api_Client_Verify_Exception', 'Ga_Lib_Sharethis_Api_Client_Alerts_Exception' ),
38 true
39 )
40 ) {
41 $message = Ga_Helper::ga_wp_notice( $error['message'], 'error' );
42 } elseif ( 'Ga_Data_Outdated_Exception' === $error['class'] ) {
43 $message = Ga_Helper::ga_wp_notice( $error['message'], 'warning' );
44 } else {
45 $message = Ga_Helper::ga_wp_notice(
46 __( 'There are temporary connection issues, please try again later or go to Google Analytics website to see the dashboards' ),
47 'error'
48 );
49 }
50
51 return $message;
52 }
53
54 }
55