Index: /extensions/flickr2piwigo/admin/config.php
===================================================================
--- /extensions/flickr2piwigo/admin/config.php	(revision 28832)
+++ /extensions/flickr2piwigo/admin/config.php	(revision 28833)
@@ -9,5 +9,6 @@
     );
   unset($_SESSION['phpFlickr_auth_token']);
-  conf_update_param('flickr2piwigo', serialize($conf['flickr2piwigo']));
+
+  conf_update_param('flickr2piwigo', $conf['flickr2piwigo']);
   $page['infos'][] = l10n('Information data registered in database');
 }
Index: /extensions/flickr2piwigo/main.inc.php
===================================================================
--- /extensions/flickr2piwigo/main.inc.php	(revision 28832)
+++ /extensions/flickr2piwigo/main.inc.php	(revision 28833)
@@ -17,11 +17,11 @@
 define('FLICKR_ADMIN',    get_root_url() . 'admin.php?page=plugin-' . FLICKR_ID);
 define('FLICKR_FS_CACHE', PHPWG_ROOT_PATH . $conf['data_location'] . 'flickr_cache/');
-define('FLICKR_VERSION',  'auto');
-
 
 include_once(FLICKR_PATH . 'include/ws_functions.inc.php');
 
 
-add_event_handler('init', 'flickr_init');
+$conf['flickr2piwigo'] = safe_unserialize($conf['flickr2piwigo']);
+
+
 add_event_handler('ws_add_methods', 'flickr_add_ws_method');
 
@@ -66,13 +66,2 @@
   }
 }
-
-
-function flickr_init()
-{
-  global $conf;
-  include_once(FLICKR_PATH . 'maintain.inc.php');
-  $maintain = new flickr2piwigo_maintain(FLICKR_ID);
-  $maintain->autoUpdate(FLICKR_VERSION, 'install');
-
-  $conf['flickr2piwigo'] = unserialize($conf['flickr2piwigo']);
-}
Index: /extensions/flickr2piwigo/maintain.class.php
===================================================================
--- /extensions/flickr2piwigo/maintain.class.php	(revision 28833)
+++ /extensions/flickr2piwigo/maintain.class.php	(revision 28833)
@@ -0,0 +1,65 @@
+<?php
+defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
+
+class flickr2piwigo_maintain extends PluginMaintain
+{
+  private $default_conf = array(
+    'api_key' => null,
+    'secret_key' => null,
+    );
+
+  function install($plugin_version, &$errors=array())
+  {
+    global $conf;
+
+    if (empty($conf['flickr2piwigo']))
+    {
+      conf_update_param('flickr2piwigo', $this->default_conf, true);
+    }
+
+    mkgetdir(PHPWG_ROOT_PATH . $conf['data_location'] . 'flickr_cache/', MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR);
+  }
+
+  function update($old_version, $new_version, &$errors=array())
+  {
+    $this->install($new_version, $errors);
+  }
+
+  function uninstall()
+  {
+    global $conf;
+
+    conf_delete_param('flickr2piwigo');
+
+    self::rrmdir(PHPWG_ROOT_PATH . $conf['data_location'] . 'flickr_cache/');
+  }
+
+  static function rrmdir($dir)
+  {
+    if (!is_dir($dir))
+    {
+      return false;
+    }
+    $dir = rtrim($dir, '/');
+    $objects = scandir($dir);
+    $return = true;
+
+    foreach ($objects as $object)
+    {
+      if ($object !== '.' && $object !== '..')
+      {
+        $path = $dir.'/'.$object;
+        if (filetype($path) == 'dir')
+        {
+          $return = $return && self::rrmdir($path);
+        }
+        else
+        {
+          $return = $return && @unlink($path);
+        }
+      }
+    }
+
+    return $return && @rmdir($dir);
+  }
+}
Index: tensions/flickr2piwigo/maintain.inc.php
===================================================================
--- /extensions/flickr2piwigo/maintain.inc.php	(revision 28832)
+++ 	(revision )
@@ -1,77 +1,0 @@
-<?php
-defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
-
-class flickr2piwigo_maintain extends PluginMaintain
-{
-  private $installed = false;
-
-  private $default_conf = array(
-    'api_key' => null,
-    'secret_key' => null,
-    );
-
-  function install($plugin_version, &$errors=array())
-  {
-    global $conf;
-
-    if (empty($conf['flickr2piwigo']))
-    {
-      $conf['flickr2piwigo'] = serialize($this->default_conf);
-      conf_update_param('flickr2piwigo', $conf['flickr2piwigo']);
-    }
-
-    mkgetdir(PHPWG_ROOT_PATH . $conf['data_location'] . 'flickr_cache/', MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR);
-
-    $this->installed = true;
-  }
-
-  function activate($plugin_version, &$errors=array())
-  {
-    if (!$this->installed)
-    {
-      $this->install($plugin_version, $errors);
-    }
-  }
-
-  function deactivate()
-  {
-  }
-
-  function uninstall()
-  {
-    global $conf;
-
-    conf_delete_param('flickr2piwigo');
-
-    self::rrmdir(PHPWG_ROOT_PATH . $conf['data_location'] . 'flickr_cache/');
-  }
-
-  static function rrmdir($dir)
-  {
-    if (!is_dir($dir))
-    {
-      return false;
-    }
-    $dir = rtrim($dir, '/');
-    $objects = scandir($dir);
-    $return = true;
-
-    foreach ($objects as $object)
-    {
-      if ($object !== '.' && $object !== '..')
-      {
-        $path = $dir.'/'.$object;
-        if (filetype($path) == 'dir')
-        {
-          $return = $return && self::rrmdir($path);
-        }
-        else
-        {
-          $return = $return && @unlink($path);
-        }
-      }
-    }
-
-    return $return && @rmdir($dir);
-  }
-}
