Tech Stack
Visual Portfolio is built using modern web technologies:Backend
- PHP 7.2+ - Minimum required version
- WordPress 6.2+ - Latest WordPress APIs and features
- WordPress Coding Standards (WPCS) - Enforced via PHP CodeSniffer
- Custom Post Types - Portfolio items stored as
vp_listspost type - REST API - Custom endpoints for AJAX functionality
Frontend
- JavaScript ES6+ - Modern JavaScript with Babel compilation
- React - Used for Gutenberg block editor integration
- SCSS - Component-based styling with variables
- Webpack - Asset bundling via @wordpress/scripts
- RTL Support - Automatic RTL CSS generation
Build Tools
- @wordpress/scripts - Official WordPress build configuration
- Webpack 5 - Module bundling and optimization
- Babel - ES6+ transpilation
- PostCSS - CSS processing with autoprefixer
Key Features
Visual Gallery Builder
Powerful Gutenberg block editor integration with:- 20+ reusable React components
- Redux-like state management
- Custom form controls for settings
- Real-time preview
Layout System
Multiple layout options including:- Grid - Flexible grid layout
- Masonry - Pinterest-style masonry
- Slider - Swiper-based carousel
- Justified - Flickr-style justified gallery
- Tiles - Custom tile patterns
Item Styles
Customizable item animations:- Classic
- Fade
- Fly
- Emerge
Components
- Filter by category
- Sort controls
- Pagination (classic, load more, infinite scroll)
- Lightbox integration (PhotoSwipe, Fancybox)
Performance Optimizations
- Lazy loading with lazysizes
- Asset optimization and minification
- Transient caching for API responses
- Conditional asset loading
- Source maps for debugging
Project Structure
Plugin Architecture
Singleton Pattern
The main plugin class uses the Singleton pattern to ensure only one instance exists:Module Loading
All classes are loaded via the main plugin file in a specific order:- Deprecations - Loaded first for backward compatibility
- Security - Core security measures
- Utilities - Helper functions and utilities
- Templates - Template loading system
- Assets - Script and style management
- Core Features - Main plugin functionality
- Gutenberg - Block editor integration
- Admin - Backend interfaces
- Third-party - Plugin and theme integrations
- Migration - Loaded last for version updates
Hook System
The plugin exclusively uses WordPress action/filter system:WordPress Integration
Custom Post Type
Portfolio items are stored asvp_lists custom post type with settings saved in post meta:
Gutenberg Blocks
Modern block editor integration:REST API
Custom endpoints for AJAX functionality with proper nonce verification:Shortcodes
Legacy shortcode support for backward compatibility:Security Best Practices
The plugin follows WordPress security standards:Input Sanitization
Output Escaping
Nonce Verification
Capability Checks
Development Philosophy
Code Quality
- WordPress Coding Standards (WPCS) compliance
- ESLint for JavaScript
- Stylelint for SCSS
- Pre-commit hooks for automated checks
Testing
- PHPUnit for PHP unit tests
- Playwright for E2E browser testing
- wp-env for local WordPress environment
Performance
- Conditional asset loading
- Transient caching
- Lazy loading images
- Minified and optimized assets
Compatibility
- WordPress.org guidelines compliance
- Theme compatibility layer
- Plugin integration support
- Backward compatibility maintenance
Next Steps
- Setup Development Environment - Get started with local development
- Architecture Deep Dive - Learn about the plugin’s class structure