Index: /extensions/UserStat/admin/plugin_admin.php
===================================================================
--- /extensions/UserStat/admin/plugin_admin.php	(revision 5548)
+++ /extensions/UserStat/admin/plugin_admin.php	(revision 5549)
@@ -22,5 +22,5 @@
 $main_plugin_object = get_plugin_data($plugin_id);
 
-$plugin_ai = new UserStat_AIP($prefixeTable, $main_plugin_object->get_filelocation());
+$plugin_ai = new UserStat_AIP($prefixeTable, $main_plugin_object->getFileLocation());
 $plugin_ai->manage();
 
Index: /extensions/UserStat/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/UserStat/language/fr_FR/plugin.lang.php	(revision 5548)
+++ /extensions/UserStat/language/fr_FR/plugin.lang.php	(revision 5549)
@@ -50,4 +50,7 @@
 $lang['us_withMail'] = 'Avec eMail';
 
+//1.1.0
+$lang['To install this plugin, you need to install Grum Plugin Classes %s before'] = 'Pour installer ce plugin, vous devez au préalable, installer le plugin Grum Plugin Classes %s';
+
 
 ?>
Index: /extensions/UserStat/main.inc.php
===================================================================
--- /extensions/UserStat/main.inc.php	(revision 5548)
+++ /extensions/UserStat/main.inc.php	(revision 5549)
@@ -54,5 +54,5 @@
 define('USERSTAT_PATH' , PHPWG_PLUGINS_PATH . USERSTAT_DIR . '/');
 
-define('USERSTAT_VERSION' , '1.1.0'); // => ne pas oublier la version dans l'entête !!
+include_once('userstat_version.inc.php'); // => Don't forget to update this file !!
 
 global $prefixeTable;
@@ -64,5 +64,5 @@
 
   $obj = new UserStat_AIM($prefixeTable, __FILE__);
-  $obj->init_events();
+  $obj->initEvents();
   set_plugin_data($plugin['id'], $obj);
 }
Index: /extensions/UserStat/maintain.inc.php
===================================================================
--- /extensions/UserStat/maintain.inc.php	(revision 5548)
+++ /extensions/UserStat/maintain.inc.php	(revision 5549)
@@ -14,4 +14,6 @@
 //ini_set('display_errors', true);
 
+include_once('userstat_version.inc.php'); // => Don't forget to update this file !!
+
 if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
 
@@ -20,5 +22,5 @@
 
 
-global $gpc_installed, $lang; //needed for plugin manager compatibility
+global $gpc_installed, $gpcNeeded, $lang; //needed for plugin manager compatibility
 
 /* -----------------------------------------------------------------------------
@@ -26,9 +28,10 @@
 ----------------------------------------------------------------------------- */
 $gpc_installed=false;
-if(file_exists(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php'))
+$gpcNeeded="3.0.0";
+if(file_exists(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'))
 {
-  @include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/main.inc.php');
-  // need GPC release greater or equal than 2.0.5
-  if(checkGPCRelease(2,0,5))
+  @include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
+  // need GPC release greater or equal than 3.0.0
+  if(CommonPlugin::checkGPCRelease(3,0,0))
   {
     @include_once("userstat_aim.class.inc.php");
@@ -39,5 +42,14 @@
 function gpcMsgError(&$errors)
 {
-  array_push($errors, sprintf(l10n('us_gpc2_not_installed'), "2.0.5"));
+  global $gpcNeeded;
+  $msg=sprintf(l10n('To install this plugin, you need to install Grum Plugin Classes %s before'), $gpcNeeded);
+  if(is_array($errors))
+  {
+    array_push($errors, $msg);
+  }
+  else
+  {
+    $errors=Array($msg);
+  }
 }
 // -----------------------------------------------------------------------------
@@ -48,11 +60,13 @@
 function plugin_install($plugin_id, $plugin_version, &$errors)
 {
-  global $prefixeTable, $gpc_installed;
+  global $prefixeTable, $gpc_installed, $gpcNeeded;
   if($gpc_installed)
   {
     $obj = new UserStat_AIM($prefixeTable, __FILE__);
-    $obj->delete_config();
-    $obj->init_config();
-    $obj->save_config();
+    $obj->deleteConfig();
+    $obj->initConfig();
+    $obj->my_config['installed']=USERSTAT_VERSION2;
+    $obj->saveConfig();
+    GPCCore::register($obj->getPluginName(), USERSTAT_VERSION, $gpcNeeded);
   }
   else
@@ -64,11 +78,12 @@
 function plugin_activate($plugin_id, $plugin_version, &$errors)
 {
-  global $prefixeTable, $gpc_installed;
+  global $prefixeTable, $gpc_installed, $gpcNeeded;
   if($gpc_installed)
   {
     $obj = new UserStat_AIM($prefixeTable, __FILE__);
-    $obj->init_config();
-    $obj->load_config();
-    $obj->save_config();
+    $obj->initConfig();
+    $obj->loadConfig();
+    $obj->my_config['installed']=USERSTAT_VERSION2;
+    $obj->saveConfig();
   }
   else
@@ -88,5 +103,6 @@
   {
     $obj = new UserStat_AIM($prefixeTable, __FILE__);
-    $obj->delete_config();
+    $obj->deleteConfig();
+    GPCCore::unregister($obj->getPluginName());
   }
   else
Index: /extensions/UserStat/userstat_aim.class.inc.php
===================================================================
--- /extensions/UserStat/userstat_aim.class.inc.php	(revision 5548)
+++ /extensions/UserStat/userstat_aim.class.inc.php	(revision 5549)
@@ -16,17 +16,23 @@
 if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
 
-include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php');
-include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/css.class.inc.php');
+include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
+include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php');
 
-class UserStat_AIM extends common_plugin
+class UserStat_AIM extends CommonPlugin
 {
   protected $css = null;
 
-  function UserStat_AIM($prefixeTable, $filelocation)
+  public function __construct($prefixeTable, $filelocation)
   {
-    $this->plugin_name="UserStat";
-    $this->plugin_name_files="userstat";
+    $this->setPluginName("UserStat");
+    $this->setPluginNameFiles("userstat");
     parent::__construct($prefixeTable, $filelocation);
-    $this->css = new css(dirname($this->filelocation).'/'.$this->plugin_name_files.".css");
+    $this->css = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().".css");
+  }
+
+  public function __destruct()
+  {
+    unset($this->css);
+    parent::__destruct();
   }
 
@@ -34,7 +40,7 @@
     initialize events call for the plugin
   */
-  function init_events()
+  function initEvents()
   {
-    add_event_handler('get_admin_plugin_menu_links', array(&$this, 'plugin_admin_menu') );
+    add_event_handler('get_admin_plugin_menu_links', array(&$this, 'pluginAdminMenu') );
   }
 
@@ -43,7 +49,7 @@
     initialization of config properties
   */
-  function init_config()
+  function initConfig()
   {
-    $this->my_config=array(
+    $this->config=array(
       'UserStat_MouseOverColor' => '303030',
       /*'AStat_BarColor_Pages' => '6666ff',
@@ -69,23 +75,23 @@
 
   /*
-    surchage of common_plugin->save_config function
+    surchage of CommonPlugin->saveConfig function
   */
-  function load_config()
+  function loadConfig()
   {
-    parent::load_config();
-    if(!$this->css->css_file_exists())
+    parent::loadConfig();
+    if(!$this->css->fileExists())
     {
-      $this->css->make_CSS($this->generate_CSS());
+      $this->css->makeCSS($this->generate_CSS());
     }
   }
 
   /*
-    surchage of common_plugin->save_config function
+    surchage of CommonPlugin->saveConfig function
   */
-  function save_config()
+  function saveConfig()
   {
-    if(parent::save_config())
+    if(parent::saveConfig())
     {
-      $this->css->make_CSS($this->generate_CSS());
+      $this->css->makeCSS($this->generate_CSS());
       return(true);
     }
@@ -99,5 +105,5 @@
   {
     $text = "
-.StatTableRow:hover { background-color:#".$this->my_config['UserStat_MouseOverColor']."; }
+.StatTableRow:hover { background-color:#".$this->config['UserStat_MouseOverColor']."; }
 .formtable, .formtable P { text-align:left; display:block; }
 .formtable tr { vertical-align:top; }
Index: /extensions/UserStat/userstat_aip.class.inc.php
===================================================================
--- /extensions/UserStat/userstat_aip.class.inc.php	(revision 5548)
+++ /extensions/UserStat/userstat_aip.class.inc.php	(revision 5549)
@@ -17,27 +17,30 @@
 include_once('userstat_aim.class.inc.php');
 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
-include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/ajax.class.inc.php');
+include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCAjax.class.inc.php');
 
 class UserStat_AIP extends UserStat_AIM
 {
   protected $tabsheet;
-  protected $ajax;
-
-  function UserStat_AIP($prefixeTable, $filelocation)
+
+  public function __construct($prefixeTable, $filelocation)
   {
     parent::__construct($prefixeTable, $filelocation);
 
-    $this->load_config();
-    $this->init_events();
+    $this->loadConfig();
+    $this->initEvents();
 
     $this->tabsheet = new tabsheet();
     $this->tabsheet->add('global_stats',
                           l10n('us_tsGlobal'),
-                          $this->page_link.'&amp;fUserStat_tabsheet=global_stats');
+                          $this->getAdminLink().'&amp;fUserStat_tabsheet=global_stats');
     $this->tabsheet->add('users_stats',
                           l10n('us_tsUsers'),
-                          $this->page_link.'&amp;fUserStat_tabsheet=users_stats');
-
-    $this->ajax = new Ajax();
+                          $this->getAdminLink().'&amp;fUserStat_tabsheet=users_stats');
+  }
+
+  public function __destruct()
+  {
+    unset($this->tabsheet);
+    parent::__destruct();
   }
 
@@ -45,7 +48,7 @@
     initialize events call for the plugin
   */
-  function init_events()
-  {
-    add_event_handler('loc_end_page_header', array(&$this->css, 'apply_CSS'));
+  function initEvents()
+  {
+    add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS'));
   }
 
@@ -112,6 +115,5 @@
           break;
       }
-      //$template->
-      $this->ajax->return_result($result);
+      GPCAjax::returnResult($result);
     }
   }
@@ -154,5 +156,5 @@
     $template_datas = array();
 
-    $template_datas["ajaxUrl"] = $this->page_link;
+    $template_datas["ajaxUrl"] = $this->getAdminLink();
     $template_datas["users"] = $this->getUsersGlobalStats();
 
@@ -526,5 +528,5 @@
     $local_tpl = new Template(USERSTAT_PATH."admin/", "");
     $local_tpl->set_filename('body_page',
-                  dirname($this->filelocation).'/admin/userstat_userstat.tpl');
+                  dirname($this->getFileLocation()).'/admin/userstat_userstat.tpl');
 
     $template_datas["list"] = $this->makeUserStats($userId);
Index: /extensions/UserStat/userstat_version.inc.php
===================================================================
--- /extensions/UserStat/userstat_version.inc.php	(revision 5549)
+++ /extensions/UserStat/userstat_version.inc.php	(revision 5549)
@@ -0,0 +1,19 @@
+<?php
+/* -----------------------------------------------------------------------------
+  Plugin     : UserStat
+  Author     : Grum
+    email    : grum@grum.fr
+    website  : http://photos.grum.fr
+    PWG user : http://forum.piwigo.org/profile.php?id=3706
+
+    << May the Little SpaceFrog be with you ! >>
+  ------------------------------------------------------------------------------
+  See main.inc.php for release information
+
+  --------------------------------------------------------------------------- */
+
+  if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+  define('USERSTAT_VERSION',  '1.1.0');
+  define('USERSTAT_VERSION2', '01.01.00');
+?>
