| Server IP : 213.255.246.8 / Your IP : 216.73.217.138 Web Server : Apache System : Linux dublin.stapolin.com 5.14.0-362.18.1.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jan 29 07:05:48 EST 2024 x86_64 User : stapolin ( 1019) PHP Version : 8.4.24 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/stapolin/public_html/dash.stapolin.com/ |
Upload File : |
# WordPress Maintenance Dashboard
A PHP-based dashboard for generating reports about WordPress updates from your existing MySQL database.
## Features
- **Dashboard** - Overview of clients, websites, and recent update activity
- **Report Generator** - Create consolidated or individual site reports
- WordPress Core Updates
- Plugin Updates
- Theme Updates
- Extra Work entries
- **PDF Export** - Print-friendly reports (save as PDF via browser)
- **CSV Download** - Export data for spreadsheet analysis
- **Extra Work Tracking** - Log additional maintenance tasks with time spent
- **Report History** - View previously generated reports
- **Dark Mode** - Toggle between light and dark themes
## Installation
### 1. Upload Files
Upload the entire `php-dashboard` folder to your web hosting.
### 2. Configure Database Connection
Edit `config.php` and update the database credentials:
```php
define('DB_HOST', 'your_host'); // Usually 'localhost'
define('DB_NAME', 'your_database_name');
define('DB_USER', 'your_username');
define('DB_PASS', 'your_password');
```
### 3. Create Extra Work Table
Run the SQL in `schema.sql` to create the `st_extra_work` table:
```sql
CREATE TABLE IF NOT EXISTS st_extra_work (
work_id BIGINT AUTO_INCREMENT PRIMARY KEY,
website_id INT NOT NULL,
work_date DATE NOT NULL,
description TEXT NOT NULL,
time_spent INT NOT NULL COMMENT 'Time spent in minutes',
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
CONSTRAINT fk_extra_work_website
FOREIGN KEY (website_id)
REFERENCES st_websites(website_id)
ON DELETE CASCADE,
INDEX idx_extra_work_website (website_id),
INDEX idx_extra_work_date (work_date)
) ENGINE=InnoDB;
```
### 4. Set File Permissions
Ensure the web server can read all files:
- PHP files: 644
- Directories: 755
### 5. Access Dashboard
Navigate to `https://yourdomain.com/php-dashboard/` (or wherever you uploaded it).
## File Structure
```
php-dashboard/
├── api/
│ ├── extra-work.php # CRUD API for extra work entries
│ └── generate-report.php # Report generation API
├── includes/
│ ├── database.php # Database connection class
│ ├── footer.php # Page footer template
│ ├── functions.php # Helper functions
│ └── header.php # Page header template with navigation
├── lib/
│ └── pdf-generator.php # PDF generation helper
├── config.php # Database configuration
├── index.php # Dashboard home page
├── reports.php # Report generator page
├── extra-work.php # Extra work management page
├── history.php # Report history page
├── schema.sql # SQL to create extra_work table
└── README.md # This file
```
## Required Database Tables
The dashboard expects these tables in your MySQL database:
- `st_clients` - Client information
- `st_websites` - Website information (linked to clients)
- `st_plugin` - Plugin update history
- `st_themes` - Theme update history
- `st_core` - WordPress core update history
- `st_extra_work` - Extra work entries (created by this dashboard)
## Customization
### Branding
Edit `includes/header.php` to change the logo and application name.
### Timezone
Edit `config.php` to set your timezone:
```php
define('TIMEZONE', 'America/New_York');
```
### PDF Library
The current PDF generation uses browser print functionality. For server-side PDF generation, you can integrate:
- [TCPDF](https://tcpdf.org/)
- [FPDF](http://www.fpdf.org/)
- [Dompdf](https://github.com/dompdf/dompdf)
## Requirements
- PHP 7.4 or higher
- MySQL 5.7 or higher
- PDO MySQL extension
## Troubleshooting
### Database Connection Errors
1. Verify credentials in `config.php`
2. Ensure PDO MySQL extension is enabled
3. Check if your hosting allows remote MySQL connections (if database is on different server)
### No Data Showing
1. Verify the table names match your existing database
2. Check that there is data in the tables for the selected date range
3. Review browser console for JavaScript errors
## License
MIT License - Use freely for your WordPress maintenance business.