/**
  * Check some thinks on plugin activation
  *
  * @since   0.0.1
  * @access  public
  * @static
  * @return  void
  */
 public static function on_activate()
 {
     // check WordPress version
     if (!version_compare($GLOBALS['wp_version'], '4.0', '>=')) {
         deactivate_plugins(RW_Group_Blogs::$plugin_filename);
         die(wp_sprintf('<strong>%s:</strong> ' . __('This plugin requires WordPress 4.0 or newer to work', RW_Group_Blogs::get_textdomain()), RW_Group_Blogs::get_plugin_data('Name')));
     }
     // check php version
     if (version_compare(PHP_VERSION, '5.3.0', '<')) {
         deactivate_plugins(RW_Group_Blogs::$plugin_filename);
         die(wp_sprintf('<strong>%1s:</strong> ' . __('This plugin requires PHP 5.3 or newer to work. Your current PHP version is %1s, please update.', RW_Group_Blogs::get_textdomain()), RW_Group_Blogs::get_plugin_data('Name'), PHP_VERSION));
     }
     wp_schedule_event(time(), 'hourly', 'rw_group_blogs_cron');
 }
Ejemplo n.º 2
0
 /**
  * get the textdomain
  *
  * @since   0.0.1
  * @static
  * @access	public
  * @return	string textdomain
  */
 public static function get_textdomain()
 {
     if (is_null(self::$textdomain)) {
         self::$textdomain = self::get_plugin_data('TextDomain');
     }
     return self::$textdomain;
 }