public function setWordPressInstallDirectory(PackageEvent $event)
    {
        if ($this->getPackageName($event) != 'johnpbloch/wordpress') {
            return;
        }
        
        $composer = $event->getComposer();
        $rootPkg = $composer->getPackage();
        
        if (! $rootPkg) {
            return;
        }
        
        $extra = $rootPkg->getExtra();
        
        if (isset($extra['wordpress-install-dir']) && $extra['wordpress-install-dir']) {
            return;
        }
        
        $extra['wordpress-install-dir'] = static::$plugin->getPublicDirectory() . '/wp';
        
        $rootPkg->setExtra($extra);
        $composer->setPackage($rootPkg);
    }