Yoast_Google_Analytics_Notice

Notice class.

Defined (1)

The class is defined in the following location(s).

/admin/class-google-analytics.php  
  1. class Yoast_Google_Analytics_Notice { 
  2.  
  3. /** 
  4. * Throw a warning if no UA code is set. 
  5. */ 
  6. public static function config_warning() { 
  7. self::show_error( 
  8. sprintf( __( 'Please configure your %sGoogle Analytics settings%s!', 'google-analytics-for-wordpress' ),  
  9. '<a href="' . admin_url( 'admin.php?page=yst_ga_settings' ) . '">',  
  10. '</a>' 
  11. ); 
  12.  
  13. /** 
  14. * Throw a warning when the fetching failed 
  15. */ 
  16. public static function warning_fetching_data_authenticate() { 
  17. self::show_error( 
  18. sprintf( 
  19. __( 'It seems the authentication for the plugin has expired, please %sre-authenticate%s with Google Analytics to allow the plugin to fetch data.', 'google-analytics-for-wordpress' ),  
  20. '<a href="' . admin_url( 'admin.php?page=yst_ga_settings' ) . '">',  
  21. '</a>' 
  22. ); 
  23.  
  24. /** 
  25. * Throw a warning when the fetching failed 
  26. */ 
  27. public static function warning_fetching_data() { 
  28. self::show_error( 
  29. sprintf( 
  30. __( 'Data is not up-to-date, there was an error in retrieving the data from Google Analytics. This error could be caused by several issues. If the error persists, please see %sthis page%s.', 'google-analytics-for-wordpress' ),  
  31. '<a href="http://yoa.st/2p">',  
  32. '</a>' 
  33. ); 
  34.  
  35. /** 
  36. * Showing the given error as an error div 
  37. * @param string $error_message 
  38. */ 
  39. private static function show_error( $error_message ) { 
  40. echo '<div class="error"><p>' . $error_message . '</p></div>'; 
  41.