Joomla version 1.7 Wordpress plugin enabled in admin part

Wordpress plugin code:

<?php
// no direct access
defined('_JEXEC') or die;

jimport('joomla.plugin.plugin');

class plgSystemMetatags extends JPlugin
{   
    public function __construct(&$subject, $config)
    {
        parent::__construct($subject, $config); 
    }

    public function onBeforeRender()
    {
        $document =& JFactory::getDocument();
        $document->setMetaData('keywords', 'test keywords');    
    }   
}

But this does not work

Meta description renders value, which occur global configuration

wordpress plugin xml file

<?xml version="1.0" encoding="utf-8"?>
<extension version="1.7" type="plugin" group="system" method="upgrade" client="site">
    <name>System - Metatags</name>
    <author>Joomla! Project</author>
    <creationDate>November 2005</creationDate>
    <copyright>Copyright (C) 2005 - 2011 Open Source Matters. All rights reserved.</copyright>
    <license>GNU General Public License version 2 or later; see LICENSE.txt</license>
    <authorEmail>admin@joomla.org</authorEmail>
    <authorUrl>www.joomla.org</authorUrl>
    <version>1.7.0</version>
    <description></description>

    <files>
        <filename plugin="metatags">metatags.php</filename>
        <filename>index.html</filename>
    </files>

</extension>

use onBeforeRender rather than onAfterRender.

When onAfterRender event is triggered the creation of the applying has already been obtainable in the response buffer.