Plugins extend Vvveb CMS by adding new features, modifying existing behavior, or integrating external services.
Each plugin lives in its own directory under plugins/my-plugin-name. When distributing a plugin as a ZIP file, the archive must contain a single top‑level folder matching the plugin’s slug (e.g., my-plugin-name/).
A valid plugin must include at least one file:
plugins/my-plugin-name/plugin.php
This file contains the plugin metadata header and the main plugin class.
Plugin Header
Every plugin must begin with a comment block that defines its metadata. This information is used by Vvveb to display the plugin in the admin interface and manage activation, settings, and updates.
<?php
/*
Name: Insert Footer Header Scripts
Slug: insert-scripts
Category: tools
Url: http://www.vvveb.com
Description: Insert footer and header scripts such as analytics or widgets.
Thumb: insert-scripts.svg
Author: givanz
Version: 0.1
Author url: http://www.vvveb.com
Settings: /admin/?module=plugins/insert-scripts/settings
*/
use Vvveb\System\Event;
if (! defined('V_VERSION')) {
die('Invalid request!');
}
class InsertScriptsPlugin {
...
}
?>
Notes
- Slug must match the plugin folder name exactly.
- Settings is optional and should point to the plugin’s admin settings page or controller.
- Thumb is the icon displayed in the admin plugin list.
Plugin Folder Structure
Plugins follow a structure similar to the CMS itself, allowing them to provide controllers, templates, SQL files, components, public assets, and optional installation scripts.
Not all folders are required; a plugin may include only what it needs.
A full plugin structure looks like this:
my-plugin-name/
├── plugin.php # Main plugin file (required)
├── plugin.svg # Plugin thumbnail (optional)
│
├── app/ # Frontend functionality
│ ├── controller/
│ │ └── index.php # Optional frontend controller
│ ├── template/
│ │ ├── common.tpl # Shared template
│ │ └── index.tpl # Frontend page template
│ └── validate/
│ └── plugin-form.php # Optional validation rules
│
├── admin/ # Admin-side functionality
│ ├── controller/
│ │ └── index.php # Admin controller (settings, tools)
│ ├── template/
│ │ └── settings.tpl # Admin settings page template
│ └── validate/
│ └── plugin-form.php # Optional validation rules
│
├── public/ # Public assets
│ ├── admin/
│ │ └── settings.html # HTML for admin settings UI
│ ├── app/
│ │ └── index.html # HTML for frontend UI
│ ├── js/
│ │ └── plugin.js # Optional JavaScript
│ └── css/
│ └── plugin.css # Optional CSS
│
├── install/ # Optional installation scripts
│ └── sql/
│ ├── mysql/plugin.sql # MySQL schema
│ ├── pgsql/plugin.sql # PostgreSQL schema
│ └── sqlite/plugin.sql # SQLite schema
│
├── sql/ # Runtime SQL queries
│ ├── mysql/plugin.sql
│ ├── pgsql/plugin.sql
│ └── sqlite/plugin.sql
│
├── component/
│ └── mycomponent.php # Custom component provided by plugin
│
├── system/
│ ├── plugin.php # Custom libraries or helpers
│ └── library.php # Additional system utilities
│
└── vendor/ # Third‑party libraries (optional)
How Plugins Integrate with Vvveb
Plugins can extend Vvveb in several ways:
- Registering event listeners using the Event system.
- Adding new components.
- Adding admin menu items.
- Creating new frontend or backend pages.
- Injecting scripts, styles, or HTML into templates.
- Providing custom SQL models.
- Adding new validation rules.
- Including public assets (JS, CSS, images).
Because plugins follow the same MVC‑Component structure as the core CMS, they integrate cleanly and remain easy to maintain.
Plugins are one of the most powerful parts of Vvveb’s architecture.