Skip to content

cehojac/antonella-framework-for-wp

Repository files navigation

πŸš€ Antonella Framework for WordPress

Antonella Framework

DeepWiki

Total Downloads Latest Version License Gitter

Framework for developing WordPress plugins based on Model View Controller with enterprise-level security

πŸ“– Full Documentation: https://antonellaframework.com
πŸŽ₯ Video Tutorial: https://tipeos.com/anto


✨ What's New in Version 1.9.0

πŸ”’ Enterprise-Level Security

  • CSRF Protection: Automatic nonce verification
  • Permission Control: Granular user capability checks
  • Input Sanitization: Automatic data cleaning
  • Output Escaping: XSS attack prevention
  • Security Class: Centralized API for all security functions

πŸ› οΈ Technical Improvements

  • PHP 8.2 Compatible: Full compatibility with latest PHP
  • Enhanced Headers: Complete plugin metadata
  • Docker Integration: Improved development environment
  • Auto Root File Change: Automatic plugin file renaming

πŸ“‹ Requirements

  • PHP: 8.0 or higher
  • Composer: Latest version
  • Git: For version control
  • WordPress: 5.0 or higher

πŸš€ Quick Installation

1. Create Your Plugin Project

Via Antonella installer

composer global require cehojac/antonella-installer
antonella new my-awesome-plugin
cd my-awesome-plugin

or via composer CLI

composer create-project --prefer-dist cehojac/antonella-framework-for-wp my-awesome-plugin
cd my-awesome-plugin

2. Initialize Your Project

php antonella namespace MyPlugin
php antonella updateproject

3. Start Development

Your plugin is now ready! Upload to WordPress and start developing.


🎯 Core Features

Console Commands

Command Description
php antonella namespace FOO Rename namespace across all files
php antonella make MyController Create controller class
php antonella widget MyWidget Create widget class
php antonella helper myFunction Create helper function
php antonella cpt MyPostType Create custom post type
php antonella block MyBlock Create Gutenberg block
php antonella makeup Generate ZIP for distribution
php antonella serve Start development server

Security API

use CH\Security;

// Verify user permissions
Security::check_user_capability('manage_options');

// Create secure forms
echo Security::create_nonce_field('my_action');
Security::verify_nonce('my_nonce', 'my_action');

// Sanitize input data
$data = Security::sanitize_input($_POST['data'], 'text');

// Escape output data
echo Security::escape_output($data);

Built-in Capabilities

  • βœ… MVC Architecture: Clean separation of concerns
  • βœ… Security First: Enterprise-level protection
  • βœ… Auto-loading: PSR-4 compliant
  • βœ… Blade Templates: Optional template engine
  • βœ… Custom Post Types: Easy CPT creation
  • βœ… Gutenberg Blocks: Block development tools
  • βœ… Docker Support: Containerized development
  • βœ… Testing Framework: Built-in testing tools

πŸ›‘οΈ Security Features

CSRF Protection

// In your form
echo Security::create_nonce_field('update_settings');

// In your controller
Security::verify_nonce('settings_nonce', 'update_settings');

Data Sanitization

$text = Security::sanitize_input($_POST['text'], 'text');
$email = Security::sanitize_input($_POST['email'], 'email');
$url = Security::sanitize_input($_POST['url'], 'url');
$html = Security::sanitize_input($_POST['content'], 'html');

Output Escaping

echo Security::escape_output($user_data, 'html');
echo '<img src="' . Security::escape_output($image_url, 'attr') . '">';
echo '<script>var data = ' . Security::escape_output($js_data, 'js') . ';</script>';

🐳 Development with Docker

Start Development Environment

php antonella serve
# or
php antonella serve -d  # detached mode

Features Include:

  • WordPress latest version
  • PHP 8.2
  • MySQL 8.0
  • Automatic plugin installation
  • Hot reloading

πŸ“¦ Plugin Distribution

Create Production ZIP

php antonella makeup

This command:

  • βœ… Excludes development files
  • βœ… Includes only production dependencies
  • βœ… Creates optimized ZIP file
  • βœ… Maintains proper file structure

πŸ”§ Migration from 1.8.x

Update Your Controllers

Before (1.8.x):

public function process_form() {
    $data = $_POST['data'];
    update_option('my_option', $data);
}

After (1.9.0):

public function process_form() {
    Security::check_user_capability('manage_options');
    Security::verify_nonce('my_nonce', 'my_action');
    
    $data = Security::sanitize_input($_POST['data'], 'text');
    update_option('my_option', $data);
}

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ž Support


πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸŽ‰ Made with ❀️ by Carlos Herrera

Antonella Framework - Making WordPress plugin development secure, fast, and enjoyable!

About

Framework for develop WordPress plugins based on Model View Controller

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published