diff --git a/lib/plugins/acl/admin.php b/lib/plugins/acl/admin.php
index 1197892f2b57e877ddfdc6111027a63e797be497..0d9cd742a872e9e08e046b9e9fd03d3c36e4f94b 100644
--- a/lib/plugins/acl/admin.php
+++ b/lib/plugins/acl/admin.php
@@ -173,8 +173,6 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
      * @author  Andreas Gohr <andi@splitbrain.org>
      */
     function html() {
-        global $ID;
-
         echo '<div id="acl_manager">'.NL;
         echo '<h1>'.$this->getLang('admin_acl').'</h1>'.NL;
         echo '<div class="level1">'.NL;
@@ -208,7 +206,6 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
      * @author Andreas Gohr <andi@splitbrain.org>
      */
     function _get_opts($addopts=null){
-        global $ID;
         $opts = array(
                     'do'=>'admin',
                     'page'=>'acl',
@@ -230,7 +227,6 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
         global $ID;
         global $lang;
 
-        $dir = $conf['datadir'];
         $ns  = $this->ns;
         if(empty($ns)){
             $ns = dirname(str_replace(':','/',$ID));
@@ -326,7 +322,6 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
      * @author Andreas Gohr <andi@splitbrain.org>
      */
     function _html_detail(){
-        global $conf;
         global $ID;
 
         echo '<form action="'.wl().'" method="post" accept-charset="utf-8"><div class="no">'.NL;
@@ -493,7 +488,6 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
      * @author Andreas Gohr <andi@splitbrain.org>
      */
     function _html_list_acl($item){
-        global $ID;
         $ret = '';
         // what to display
         if($item['label']){
@@ -764,7 +758,6 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
      * @author  Andreas Gohr <andi@splitbrain.org>
      */
     function _html_select(){
-        global $conf;
         $inlist = false;
 
         if($this->who &&
diff --git a/lib/plugins/config/settings/config.class.php b/lib/plugins/config/settings/config.class.php
index 8c48018d79113ef313f2a5d2797589063f3c5c4d..a30a0605b63b5e46384c4ce26f1bc09ed634024e 100644
--- a/lib/plugins/config/settings/config.class.php
+++ b/lib/plugins/config/settings/config.class.php
@@ -369,7 +369,7 @@ if (!class_exists('setting')) {
      *  update setting with user provided value $input
      *  if value fails error check, save it
      *
-     *  @return true if changed, false otherwise (incl. on error)
+     *  @return boolean true if changed, false otherwise (incl. on error)
      */
     function update($input) {
         if (is_null($input)) return false;
@@ -426,7 +426,6 @@ if (!class_exists('setting')) {
 
       if ($fmt=='php') {
         // translation string needs to be improved FIXME
-        $tr = array("\n"=>'\n', "\r"=>'\r', "\t"=>'\t', "\\" => '\\\\', "'" => '\\\'');
         $tr = array("\\" => '\\\\', "'" => '\\\'');
 
         $out =  '$'.$var."['".$this->_out_key()."'] = '".strtr($this->_local, $tr)."';\n";
@@ -538,7 +537,7 @@ if (!class_exists('setting_email')) {
      *  update setting with user provided value $input
      *  if value fails error check, save it
      *
-     *  @return true if changed, false otherwise (incl. on error)
+     *  @return boolean true if changed, false otherwise (incl. on error)
      */
     function update($input) {
         if (is_null($input)) return false;
@@ -574,7 +573,7 @@ if (!class_exists('setting_richemail')) {
      *  update setting with user provided value $input
      *  if value fails error check, save it
      *
-     *  @return true if changed, false otherwise (incl. on error)
+     *  @return boolean true if changed, false otherwise (incl. on error)
      */
     function update($input) {
         if (is_null($input)) return false;
diff --git a/lib/plugins/info/syntax.php b/lib/plugins/info/syntax.php
index 9aedbf0aabab8c3bdc66034c941e9451544b774e..d813aa23a7789343733f434f222bf8d1118ebc3f 100644
--- a/lib/plugins/info/syntax.php
+++ b/lib/plugins/info/syntax.php
@@ -15,20 +15,6 @@ if(!defined('DOKU_INC')) die();
  */
 class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
 
-    /**
-     * return some info
-     */
-    function getInfo(){
-        return array(
-            'author' => 'Andreas Gohr',
-            'email'  => 'andi@splitbrain.org',
-            'date'   => '2008-09-12',
-            'name'   => 'Info Plugin',
-            'desc'   => 'Displays information about various DokuWiki internals',
-            'url'    => 'http://dokuwiki.org/plugin:info',
-        );
-    }
-
     /**
      * What kind of syntax are we?
      */
@@ -114,7 +100,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
      *
      * uses some of the original renderer methods
      */
-    function _plugins_xhtml($type, &$renderer){
+    function _plugins_xhtml($type, Doku_Renderer &$renderer){
         global $lang;
         $renderer->doc .= '<ul>';
 
@@ -152,7 +138,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
      *
      * uses some of the original renderer methods
      */
-    function _helpermethods_xhtml(&$renderer){
+    function _helpermethods_xhtml(Doku_Renderer &$renderer){
         global $lang;
 
         $plugins = plugin_list('helper');
@@ -237,7 +223,7 @@ class syntax_plugin_info extends DokuWiki_Syntax_Plugin {
     /**
      * Adds a TOC item
      */
-    function _addToTOC($text, $level, &$renderer){
+    function _addToTOC($text, $level, Doku_Renderer_xhtml &$renderer){
         global $conf;
 
         if (($level >= $conf['toptoclevel']) && ($level <= $conf['maxtoclevel'])){
diff --git a/lib/plugins/plugin/admin.php b/lib/plugins/plugin/admin.php
index b2108f185d650bc7c839385c3049181f21ee6758..8b1ee3c7d37175e94f591766289b7693f74a8de4 100644
--- a/lib/plugins/plugin/admin.php
+++ b/lib/plugins/plugin/admin.php
@@ -33,6 +33,10 @@ class admin_plugin_plugin extends DokuWiki_Admin_Plugin {
     var $disabled = 0;
     var $plugin = '';
     var $cmd = '';
+
+    /**
+     * @var ap_manage
+     */
     var $handler = NULL;
 
     var $functions = array('delete','update',/*'settings',*/'info');  // require a plugin name
@@ -43,27 +47,9 @@ class admin_plugin_plugin extends DokuWiki_Admin_Plugin {
     var $error = '';
 
     function admin_plugin_plugin() {
-        global $conf;
         $this->disabled = plugin_isdisabled('plugin');
     }
 
-    /**
-     * return some info
-     */
-    function getInfo(){
-        $disabled = ($this->disabled) ? '(disabled)' : '';
-
-        return array(
-                'author' => 'Christopher Smith',
-                'email'  => 'chris@jalakai.co.uk',
-                'date'   => '2009-11-11',
-                'name'   => 'Plugin Manager',
-                'desc'   => "Manage Plugins, including automated plugin installer $disabled",
-                'url'    => 'http://www.dokuwiki.org/plugin:plugin',
-                );
-    }
-
-
     /**
      * return sort order for position in admin menu
      */
diff --git a/lib/plugins/plugin/classes/ap_download.class.php b/lib/plugins/plugin/classes/ap_download.class.php
index 0eb567c8096e1b4a3cded785f4ea7b28b1475943..3cc4558670c67e7c90d40f10ca4aa96145067abf 100644
--- a/lib/plugins/plugin/classes/ap_download.class.php
+++ b/lib/plugins/plugin/classes/ap_download.class.php
@@ -7,7 +7,6 @@ class ap_download extends ap_manage {
      * Initiate the plugin download
      */
     function process() {
-        global $lang;
         global $INPUT;
 
         $plugin_url = $INPUT->str('url');
@@ -45,7 +44,6 @@ class ap_download extends ap_manage {
      * Process the downloaded file
      */
     function download($url, $overwrite=false) {
-        global $lang;
         // check the url
         $matches = array();
         if (!preg_match("/[^\/]*$/", $url, $matches) || !$matches[0]) {
@@ -241,7 +239,7 @@ class ap_download extends ap_manage {
      * if neither bz, gz or zip are recognized, tar is assumed.
      *
      * @author Andreas Gohr <andi@splitbrain.org>
-     * @returns false if the file can't be read, otherwise an "extension"
+     * @returns boolean|string false if the file can't be read, otherwise an "extension"
      */
     function guess_archive($file){
         $fh = fopen($file,'rb');
diff --git a/lib/plugins/plugin/classes/ap_manage.class.php b/lib/plugins/plugin/classes/ap_manage.class.php
index 28579cbe9d046cb051a9e4ec0f55ebd9c9b04d21..3ec740dae8de6a9fda9ea1f5e7e74cb4859681e3 100644
--- a/lib/plugins/plugin/classes/ap_manage.class.php
+++ b/lib/plugins/plugin/classes/ap_manage.class.php
@@ -69,7 +69,6 @@ class ap_manage {
     }
 
     function html_pluginlist() {
-        global $ID;
         global $plugin_protected;
 
         foreach ($this->manager->plugin_list as $plugin) {
@@ -195,11 +194,8 @@ class ap_manage {
 
             closedir($dh);
             return @rmdir($path);
-        } else {
-            return @unlink($path);
         }
-
-        return false;
+        return @unlink($path);
     }
 
 
diff --git a/lib/plugins/plugin/classes/ap_update.class.php b/lib/plugins/plugin/classes/ap_update.class.php
index c43429a1bc2446765f61683454290d00f017bffc..5d7f6cb08b8b3b71a6185b2969d9feb24d7605c2 100644
--- a/lib/plugins/plugin/classes/ap_update.class.php
+++ b/lib/plugins/plugin/classes/ap_update.class.php
@@ -5,8 +5,6 @@ class ap_update extends ap_download {
     var $overwrite = true;
 
     function process() {
-        global $lang;
-
         $plugin_url = $this->plugin_readlog($this->plugin, 'url');
         $this->download($plugin_url, $this->overwrite);
         return '';
diff --git a/lib/plugins/popularity/action.php b/lib/plugins/popularity/action.php
index 1c7a2f65d6904209452c0bc5cd388f1fdac33bcf..f0cbb771bec6943f570b44e46dc46223dc41f7b7 100644
--- a/lib/plugins/popularity/action.php
+++ b/lib/plugins/popularity/action.php
@@ -9,6 +9,10 @@ require_once(DOKU_PLUGIN.'action.php');
 require_once(DOKU_PLUGIN.'popularity/admin.php');
 
 class action_plugin_popularity extends Dokuwiki_Action_Plugin {
+
+    /**
+     * @var helper_plugin_popularity
+     */
     var $helper;
 
     function action_plugin_popularity(){
@@ -22,7 +26,7 @@ class action_plugin_popularity extends Dokuwiki_Action_Plugin {
         $controller->register_hook('INDEXER_TASKS_RUN', 'AFTER',  $this, '_autosubmit', array());
     }
 
-    function _autosubmit(&$event, $param){
+    function _autosubmit(Doku_Event &$event, $param){
         //Do we have to send the data now
         if ( !$this->helper->isAutosubmitEnabled() || $this->_isTooEarlyToSubmit() ){
             return;
diff --git a/lib/plugins/popularity/admin.php b/lib/plugins/popularity/admin.php
index 474a09ef954bf4522438e56040e8cdbfc780071d..deb8048f4e9c01be83f8601333dd0a6fb8abe2fd 100644
--- a/lib/plugins/popularity/admin.php
+++ b/lib/plugins/popularity/admin.php
@@ -14,6 +14,10 @@ if(!defined('DOKU_INC')) die();
  */
 class admin_plugin_popularity extends DokuWiki_Admin_Plugin {
     var $version;
+
+    /**
+     * @var helper_plugin_popularity
+     */
     var $helper;
     var $sentStatus = null;
 
@@ -118,9 +122,9 @@ class admin_plugin_popularity extends DokuWiki_Admin_Plugin {
 
     /**
      * Build the form which presents the data to be sent
-     * @param string $submit How is the data supposed to be sent? (may be: 'browser' or 'server')
+     * @param string $submissionMode How is the data supposed to be sent? (may be: 'browser' or 'server')
      * @param string $data   The popularity data, if it has already been computed. NULL otherwise.
-     * @return The form, as an html string
+     * @return string The form, as an html string
      */
     function buildForm($submissionMode, $data = null){
         $url = ($submissionMode === 'browser' ? $this->helper->submitUrl : script());
diff --git a/lib/plugins/popularity/helper.php b/lib/plugins/popularity/helper.php
index 34521021d02ff87ec801facf6a0f0efe4e81c58d..5bbeddba08a9092f382dceedc8aeb5bf4d22d4c9 100644
--- a/lib/plugins/popularity/helper.php
+++ b/lib/plugins/popularity/helper.php
@@ -29,6 +29,8 @@ class helper_plugin_popularity extends Dokuwiki_Plugin {
      */
     var $popularityLastSubmitFile;
 
+    var $version;
+
 
     function helper_plugin_popularity(){
         global $conf;
@@ -69,7 +71,7 @@ class helper_plugin_popularity extends Dokuwiki_Plugin {
 
     /**
      * Check if autosubmit is enabled
-     * @return TRUE if we should send data once a month, FALSE otherwise
+     * @return boolean TRUE if we should send data once a month, FALSE otherwise
      */
     function isAutoSubmitEnabled(){
         return @file_exists($this->autosubmitFile);
@@ -78,7 +80,7 @@ class helper_plugin_popularity extends Dokuwiki_Plugin {
     /**
      * Send the data, to the submit url
      * @param string $data The popularity data
-     * @return An empty string if everything worked fine, a string describing the error otherwise
+     * @return string An empty string if everything worked fine, a string describing the error otherwise
      */
     function sendData($data){
         $error = '';
@@ -102,7 +104,7 @@ class helper_plugin_popularity extends Dokuwiki_Plugin {
 
     /**
      * Gather all information
-     * @return The popularity data as a string
+     * @return string The popularity data as a string
      */
     function gatherAsString(){
         $data = $this->_gather();
@@ -119,7 +121,7 @@ class helper_plugin_popularity extends Dokuwiki_Plugin {
 
     /**
      * Gather all information
-     * @return The popularity data as an array
+     * @return array The popularity data as an array
      */
     function _gather(){
         global $conf;
diff --git a/lib/plugins/revert/admin.php b/lib/plugins/revert/admin.php
index 958cf5acf0d51afa04c609f333464eeb3d91df6a..fcdaa230dcfcae35da7be90d502f079c18a89a3b 100644
--- a/lib/plugins/revert/admin.php
+++ b/lib/plugins/revert/admin.php
@@ -73,8 +73,6 @@ class admin_plugin_revert extends DokuWiki_Admin_Plugin {
      * Start the reversion process
      */
     function _revert($revert,$filter){
-        global $conf;
-
         echo '<hr /><br />';
         echo '<p>'.$this->getLang('revstart').'</p>';
 
diff --git a/lib/plugins/syntax.php b/lib/plugins/syntax.php
index 8b94493e4df93b2747f75249ae7187a1e2480d76..552cc747ad72efbc13649bc2a8f78932fbe961cb 100644
--- a/lib/plugins/syntax.php
+++ b/lib/plugins/syntax.php
@@ -84,13 +84,13 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode {
      *
      * Usually you should only need the $match param.
      *
-     * @param   $match   string    The text matched by the patterns
-     * @param   $state   int       The lexer state for the match
-     * @param   $pos     int       The character position of the matched text
-     * @param   $handler Doku_Handler Reference to the Doku_Handler object
-     * @return  array              Return an array with all data you want to use in render
+     * @param   string       $match   The text matched by the patterns
+     * @param   int          $state   The lexer state for the match
+     * @param   int          $pos     The character position of the matched text
+     * @param   Doku_Handler $handler Reference to the Doku_Handler object
+     * @return  array Return an array with all data you want to use in render
      */
-    function handle($match, $state, $pos, &$handler){
+    function handle($match, $state, $pos, Doku_Handler &$handler){
         trigger_error('handle() not implemented in '.get_class($this), E_USER_WARNING);
     }
 
@@ -117,7 +117,7 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode {
      * @param   $data     array         data created by handler()
      * @return  boolean                 rendered correctly?
      */
-    function render($format, &$renderer, $data) {
+    function render($format, Doku_Renderer &$renderer, $data) {
         trigger_error('render() not implemented in '.get_class($this), E_USER_WARNING);
 
     }
diff --git a/lib/plugins/usermanager/admin.php b/lib/plugins/usermanager/admin.php
index 30b65debbf509aecb518cbd2d231e1ba99dfb918..cf8963e6492d98721340cb0235a85403afb99721 100644
--- a/lib/plugins/usermanager/admin.php
+++ b/lib/plugins/usermanager/admin.php
@@ -73,8 +73,6 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
      * handle user request
      */
     function handle() {
-        global $ID;
-
         if (is_null($this->_auth)) return false;
 
         // extract the command and any specific parameters
@@ -308,7 +306,6 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
 
     function _htmlInputField($id, $name, $label, $value, $cando, $indent=0) {
         $class = $cando ? '' : ' class="disabled"';
-        $disabled = $cando ? '' : ' disabled="disabled"';
         echo str_pad('',$indent);
 
         if($name == 'userpass'){
@@ -549,7 +546,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
     /**
      * retrieve & clean user data from the form
      *
-     * @return  array(user, password, full name, email, array(groups))
+     * @return array (user, password, full name, email, array(groups))
      */
     function _retrieveUser($clean=true) {
         global $auth;