WP Site Snapshot
This plugin show your site data instantly. It adds a dashboard widget with post counts, comment totals, and your latest 5 article titles.
by Moshtafizur · github.com/moshtafizur-rahman-anty/wp-site-snapshot-widget
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/moshtafizur-rahman-anty/wp-site-snapshot-widget/archive/refs/heads/master.zipA custom WordPress admin dashboard widget demonstrating strict PHP 8.0+ OOP architecture and MVC separation of concerns.
🏗️ Development Approach
When building this traditional backend plugin, I avoided legacy procedural PHP to ensure enterprise-level scalability and security:
- Object-Oriented Programming (OOP): The entire plugin logic is encapsulated inside a strict PHP class. This prevents global namespace collisions and ensures compatibility with other plugins.
- Separation of Concerns (MVC): Instead of mixing complex HTML output inside the PHP logic class, I separated the frontend markup into a dedicated
views/folder. The class safelyincludesthe view, making the codebase highly maintainable. - Safe Boot Sequence: The class is instantiated inside the
plugins_loadedhook. This guarantees all core WordPress functions are fully loaded before the plugin executes. - Core API Usage: Implemented native
wp_add_dashboard_widget()via thewp_dashboard_setuphook to safely pull and display live site statistics (posts, comments, and recent publications).
🛠️ Tech Stack & APIs Used
- PHP 7.4+ / 8.0+ (Strict OOP)
- WordPress Core Hooks API
- Dashboard Widgets API
🚀 Installation & Testing
- Download the
.zipfile from the releases or clone this repository. - Upload to the
/wp-content/plugins/directory of your local WordPress environment. - Activate the plugin through the WordPress admin dashboard.
- Navigate to the main Dashboard to see the site snapshot widget.
👨💻 About the Developer
Moshtafizur Rahman
WordPress & WooCommerce Developer | Remote European Experience
🌐 View my full portfolio | 💼 Upwork Profile | 🔗 LinkedIn