Coder Social home page Coder Social logo

andrew-kandels / vulnero Goto Github PK

View Code? Open in Web Editor NEW
28.0 6.0 6.0 448 KB

Vulnero is a WordPress plugin that transforms WordPress into an object-oriented CMS by implementing a Zend Framework application that interfaces with its API.

Home Page: http://www.vulnero.com/

PHP 100.00%

vulnero's Introduction

Vulnero 1.0

This is the list of changes for the 1.0 release series.

Vulnero 1.0.1

  • First project release, feature complete.
  • Created a release branch for the 1.0 series.

Vulnero 0.1.3

  • Splitting off vulnero-app (the standalone plugin) as its own repository
  • Various small bug fixes I've identified using the library for its first major project

Vulnero 0.1.2

  • Refactored widgets slightly to simplify the capturing of options
  • Another major routing overhaul, removed the concepts of layouts, using 100% WP page templates
  • Renamed some files to better explain their purpose
  • Unit tests and documentation updated to describe the latest functionality
  • Moving caching, environment and bootstrap option configuration to the default admin page
  • Added Zend Framework submodule to simplify installation if it's not in your include_path

Vulnero 0.1.1

  • Major routing improvements and better use of the request and response objects
  • Unit tests covering all present functionality in its entirety
  • Move all Vulnero logic to library/Vulnero, separating from the Application
  • New website with public source code serving as a sample application
  • Online documentation
  • API class separating WordPress API methods for better testability
  • Better control over layouts and WordPress templates
  • Simplifying installation

Vulnero 0.1.0

  • First upload for the project.
  • Includes the basic WordPress plugin structure and application folders.
  • Extends WordPress routing with Zend application routing
  • Bootstraps database, routing, config, layouts, views, database
  • Controller view scripts display content within WordPress page templates as layouts
  • Partial auth implementation
  • Setup config and routes ini configuration files
  • Setup default and error controllers
  • Setup formatted exception output

vulnero's People

Contributors

akandels avatar nateluis429gi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

vulnero's Issues

Zend_Config

Implement wp_options integration, admin panel options and caching either with the default cache adapter or internally.

white space before DOCTYPE tag if _SESSION variables exist

I've been tracking an issue, but I was wondering if anyone else has seen something like this.

My wordpress template has a DOCTYPE tag on the first line. When I have a $_SESSION variable declared, I automatically get 3 lines of white space before the DOCTYPE tag. If I wipe my session, the white space goes away.

I was able to track the problem down to this line:

\library\zend\session.php
approximately line 470
$startedCleanly = session_start();

Right before the session_start(), there is no white space. As soon as the function exits, I have 3 lines of white space.

I did a var_dump(debug_backtrace()), and it seems to arrive at this file/line through Vulnero. But I'm not sure how to track this any further.

This is the debug trace once i get into Bootstrap.
\library\Vulnero\Application\Bootstrap\Bootstrap.php (function=authenticate, approximate line number 386)
\library\Zend\Auth.php
\library\Zend\Auth\Storage\Session.php
\library\Zend\Session\Namespace.php

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

//white space line here (goes away if there are no $_SESSION variables)
//white space line here (goes away if there are no $_SESSION variables)
//white space line here (goes away if there are no $_SESSION variables)

Add cache configuration to admin page

Currently the cache configuration must be done in the application/config/config.ini file. Make this more portable and easy to configure out of the box by moving this to the admin page.

wpautop() is filtering HTML from Vulnero

This isn't really a Vulnero issue, but I was wondering if you have any thoughts on it.

When Vulnero sends the content back to Wordpress, wpautop() is inserting P and BR tags into my code. This can cause problems in certain situations.

For example, if you have a FORM tag that spans multiple lines, wpautop() inserts BR tags inside of the FORM tag. That's not a huge issue. I suppose I can put all my html tags on one line.

The bigger issue for me is that if in my zend forms, if I put any text next to the field, wpautop() inserts /p tags to the left of it.

But if I put any text next to my field, it it puts a paragph tag between my text and the INPUT field:

If i turn on this plugin, everything works fine:
http://wordpress.org/extend/plugins/disable-wpautop/

However, this causes problems with the people who use Wordpress for the CMS functionality. Is there any way that I can do something like disabling autop ONLY for pages served by Zend? Or is there another solution?

Application.php backup-APC cache directory not present

If APC isn't installed, APC tries to use a file cache for the config. Maybe just bypass and load each request, then show a warning that APC or memcache should be installed. Or create the dir, but then people have to a+wx it.

Thoughts on ZF2?

Have you been watching the development of ZF2 at all? It's recently at beta3 and a lot of the major pieces are in place. I ask because I'm curious if you have any plans or interest in making a ZF2 version of this project as well. Also, are you looking for any contributors on the project (ZF1 or potentially ZF2)? I'd love to help out.

Fatal error when trying to activate the plugin in WP 3.3.1

Hello,

I was trying to activate the plugin in a WP 3.3.1 installation and I'm getting the following error straight away:

Fatal error: Uncaught exception 'Zend_Cache_Exception' with message 'cache_dir must be a directory' in /home/URL/wp-content/plugins/vulnero/library/Zend/Cache.php:209 Stack trace:
#0 /home/URL/wp-content/plugins/vulnero/library/Zend/Cache/Backend/File.php(154): Zend_Cache::throwException('cache_dir must ...')

#1 /home/URL/wp-content/plugins/vulnero/library/Zend/Cache/Backend/File.php(121): Zend_Cache_Backend_File->setCacheDir('/home/_/...')
#2 /home/URL/wp-content/plugins/vulnero/library/Zend/Cache.php(153): Zend_Cache_Backend_File->__construct(Array)
#3 /home/URL/wp-content/plugins/vulnero/library/Zend/Cache.php(94): Zend_Cache::makeBackend('File', Array, false, false)
#4 /home/URL/wp-content/plugins/vulnero/library/Vulnero/Application.php(65): Zend_Cache::factory('File', 'File', Array, Array)
#5 /home/
in /home/URL/wp-content/plugins/vulnero/library/Zend/Cache.php on line 209

Any idea if there's something missing or if I should do sometning manually?

Looking forward to seeing this working :)

Thank you!!

Full Unit Test Coverage

This would be specific to the 0.2.1 release milestone. Get the unit test coverage up to a level where it covers everything that can be tested in mock mode.

Zend_Auth and identity flows

The auth adapter and ACLs should extend WordPress' wp_users table and seamless be bootstrapped with the current user's values.

Caching Implementation

Implement a uniform caching strategy that caches the majority of the bootstrap through a plugin cache adapter, a custom adapter, or a fallback database table or file.

Release Packaging

Write code samples, bundle licenses and write documentation for the initial release.

Sample app errors on plugin activation

I have followed the instructions to the letter on the site, cloning from github and activating inside a fresh, clean copy of WordPress. Every time I get the attached error.

I have tried several approaches, changing the wordpress-plugin.php information and even leaving it blank.

Looking in library/Vulnero the directory appears empty. I can confirm that the Zend Framework library is on my include path as I am running several other Zend apps from the same machine.

Fatal error: Class 'Vulnero_Application' not found in {path_omitted}/wordpress/wp-content/plugins/vulnero-app/vulnero-app.php on line 94 Call Stack: 0.0001 643288 1. {main}() {path_omitted}/wordpress/wp-admin/plugins.php:0 0.2605 28246016 2. plugin_sandbox_scrape() {path_omitted}/wordpress/wp-admin/plugins.php:148 0.2605 28246752 3. include('{path_omitted}/wordpress/wp-content/plugins/vulnero-app/vulnero-app.php') {path_omitted}/wordpress/wp-admin/plugins.php:146 Variables in local scope (#3): $application = *uninitialized* $autoLoader = class Zend_Loader_Autoloader { protected $_autoloaders = array (); protected $_defaultAutoloader = array (0 => 'Zend_Loader', 1 => 'loadClass'); protected $_fallbackAutoloader = TRUE; protected $_internalAutoloader = array (0 => ..., 1 => '_autoload'); protected $_namespaces = array ('Zend_' => TRUE, 'ZendX_' => TRUE); protected $_namespaceAutoloaders = array (); protected $_suppressNotFoundWarnings = TRUE; protected $_zfPath = NULL } $baseUrl = 'http://local.{omitted}/wp-content/plugins' $env = FALSE 

It appears the library/Vulnero directory is intact when downloading the plugin from the WordPress plugins site. However, when activating this download of the plugin the browser simply freezes with the following message:

The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

The entire admin portion of the web site then freezes and is inaccessible until you delete the vulnero plugin folder.

Unit Tests

Implement PHPUnit unit tests across the project.

Integrate 'WP Cache' Plugin

Implement any Memcached, APC, etc. caches stored in the 'WP Cache' plugin as Zend_Cache_Adapters in the bootstrap.

Implement 'WordPress SEO Plugin'

Extend Vulnero_WordPress_API to include ways to inject meta tags and other SEO content into this plugin when Vulnero handles the route (or otherwise?).

Issue with onAdminMenu()

Fatal error: Uncaught exception 'UnexpectedValueException' with message 'DirectoryIterator::__construct(/public_html/wp-content/plugins/vulnero/application/admin-pages/AdminPage) [directoryiterator.--construct]: failed to open dir: No such file or directory' in /public_html/wp-content/plugins/vulnero/library/Vulnero/Application/Bootstrap/Bootstrap.php:606 Stack trace: #0 /public_html/wp-content/plugins/vulnero/library/Vulnero/Application/Bootstrap/Bootstrap.php(606): DirectoryIterator->__construct('/usr/home/psddi...') #1 [internal function]: Vulnero_Application_Bootstrap_Bootstrap->onAdminMenu('') #2 /public_html/wp-includes/plugin.php(405): call_user_func_array(Array, Array) #3 /public_html/wp-admin/includes/menu.php(97): do_action('admin_menu', '') #4 /public_html/wp-admin/menu.php(234): require_once('/usr/home/psddi...') #5 /public_html/wp-admin/admin in /public_html/wp-content/plugins/vulnero/library/Vulnero/Application/Bootstrap/Bootstrap.php on line 606

Fix:

public function onAdminMenu()
{
$cache = $this->bootstrap('cache')
->getResource('cache');
$wordPress = $this->bootstrap('wordPress')
->getResource('wordPress');
$pages = array();
if (!$pages == $cache->load('adminpages')) {
// Automatically detect and load any admin page classes, caching the work

        $di = new DirectoryIterator(APPLICATION_PATH . '/admin-pages/AdminPage');
        foreach ($di as $item) {
            if ($item->isFile() && substr($item->getFilename(), -4) == '.php') {
                $pages[] = 'AdminPage_' . substr($item->getFilename(), 0, -4);
            }
        }

        $cache->save($pages, 'adminpages');
    }

    foreach ($pages as $page) {
        $obj = new $page($this);
    }
}

Overide Yoast meta tags with headMeta()

The yoast plugin bases the page tags for SEO on the page, which for Vulnero routes will be invalid or at the very least wrong. Implement the jobsite code to override this and either use generic values or the headMeta() values from the view.

Website Updates

Exclude "introduction" from the doco widget.
Need a "powered by" image.
Finish the footer and remove those sections from the doco.
Add support widget going over commerical/free options.
Add creative commons and W3C validator to footer.
Add a license page.
Add a contributing page.
Drive site through varnish.
Install SEO plugin.
Add some blog content.
Finish doco.

Revamp Website

Revamp my website to use the new Vulnero plugin itself so I'm eating my own dog food.

Use Template's page.php file, remove comments and surrounding content

Presently I need to use a wordpress-template.php so that things like comments aren't rendered. I'd prefer to use the default page.php in the installed theme, but things like comments and page titles show up.

Either make the wordpress-template.php optional via some sort of flag or add appropriate filters to remove the display of comment blocks and page titles from Vulnero routes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.