monsterinsights_lite_activation_hook

Fired when the plugin is activated.

Description

monsterinsights_lite_activation_hook( (boolean) $network_wide ); 

Parameters (1)

0. $network_wide (boolean)
True if WPMU superadmin uses Network Activate action, false otherwise.

Usage

  1. if ( !function_exists( 'monsterinsights_lite_activation_hook' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-analytics-for-wordpress-by-monsterinsights/googleanalytics.php'; 
  3.  
  4. // True if WPMU superadmin uses "Network Activate" action, false otherwise. 
  5. $network_wide = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = monsterinsights_lite_activation_hook($network_wide); 
  9.  

Defined (1)

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

/googleanalytics.php  
  1. function monsterinsights_lite_activation_hook( $network_wide ) { 
  2.  
  3. global $wp_version; 
  4.  
  5. $url = admin_url( 'plugins.php' ); 
  6. // Check for MS dashboard 
  7. if ( is_network_admin() ) { 
  8. $url = network_admin_url( 'plugins.php' ); 
  9.  
  10. if ( version_compare( $wp_version, '3.8', '<' ) && ( ! defined( 'MONSTERINSIGHTS_FORCE_ACTIVATION' ) || ! MONSTERINSIGHTS_FORCE_ACTIVATION ) ) { 
  11. deactivate_plugins( plugin_basename( __FILE__ ) ); 
  12. wp_die( sprintf( esc_html__( 'Sorry, but your version of WordPress does not meet MonsterInsight\'s required version of %1$s3.8%2$s to run properly. The plugin not been activated. %3$sClick here to return to the Dashboard%4$s.', 'google-analytics-by-wordpress' ), '<strong>', '</strong>', '<a href="' . $url . '">', '</a>' ) ); 
  13.  
  14. if ( class_exists( 'MonsterInsights' ) ) { 
  15. deactivate_plugins( plugin_basename( __FILE__ ) ); 
  16. wp_die( sprintf( esc_html__( 'Please uninstall and remove MonsterInsights Pro before activating MonsterInsights Lite. The Lite version has not been activated. %1$sClick here to return to the Dashboard%2$s.', 'google-analytics-by-wordpress' ), '<a href="' . $url . '">', '</a>' ) );