PluginProbe ʕ •ᴥ•ʔ
ShareThis Dashboard for Google Analytics / 2.1
ShareThis Dashboard for Google Analytics v2.1
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 / Ga_Notice.php
googleanalytics / class Last commit date
controller 9 years ago core 9 years ago Ga_Admin.php 9 years ago Ga_Autoloader.php 9 years ago Ga_Frontend.php 9 years ago Ga_Helper.php 9 years ago Ga_Hook.php 9 years ago Ga_Notice.php 9 years ago Ga_Sharethis.php 9 years ago Ga_Stats.php 9 years ago Ga_View.php 9 years ago
Ga_Notice.php
34 lines
1 <?php
2
3 /**
4 * Handles exception translations.
5 *
6 * Created by PhpStorm.
7 * User: mdn
8 * Date: 2017-01-25
9 * Time: 14:37
10 */
11 class Ga_Notice {
12
13 public static function get_message( $error ) {
14 $message = '';
15
16 if ( Ga_Helper::GA_DEBUG_MODE ) {
17 $message = Ga_Helper::ga_wp_notice( (!empty( $error[ 'class' ] ) ? _( '[' . $error[ 'class' ] . ']' ) : '' ) . ' ' . $error[ 'message' ], Ga_Admin::NOTICE_ERROR );
18 } elseif ( $error[ 'class' ] == 'Ga_Lib_Sharethis_Api_Client_InvalidDomain_Exception' ) {
19 $message = Ga_Helper::ga_wp_notice( $error[ 'message' ], Ga_Admin::NOTICE_ERROR );
20 } elseif ( $error[ 'class' ] == 'Ga_Lib_Sharethis_Api_Client_Invite_Exception' ) {
21 $message = Ga_Helper::ga_wp_notice( $error[ 'message' ], Ga_Admin::NOTICE_ERROR );
22 } elseif ( in_array( $error[ 'class' ], array( 'Ga_Lib_Sharethis_Api_Client_Verify_Exception', 'Ga_Lib_Sharethis_Api_Client_Alerts_Exception' ) ) ) {
23 $message = Ga_Helper::ga_wp_notice( Ga_Sharethis::GA_SHARETHIS_ALERTS_ERROR, Ga_Admin::NOTICE_ERROR );
24 } elseif ( $error[ 'class' ] == 'Ga_Data_Outdated_Exception' ) {
25 $message = Ga_Helper::ga_wp_notice( $error[ 'message' ], Ga_Admin::NOTICE_WARNING );
26 } else {
27 $message = Ga_Helper::ga_wp_notice( _( 'There are temporary connection issues, please try again later or go to Google Analytics website to see the dashboards' ), Ga_Admin::NOTICE_ERROR );
28 }
29
30 return $message;
31 }
32
33 }
34