Export Courses to Excel
The "Export Reports to Excel" plugin enables administrators to easily export detailed reports from their WordPress site to an Excel file. Utilizing the PHPSpreadsheet library, this plugin executes a comprehensive SQL query to gather report data and generates a downloadable Excel file.
Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/khaled152/export-report-plugin-wordpress-/archive/refs/heads/main.zipExport Reports to Excel
Description
The "Export Reports to Excel" plugin enables administrators to easily export detailed reports from their WordPress site to an Excel file. Utilizing the PHPSpreadsheet library, this plugin executes a comprehensive SQL query to gather report data and generates a downloadable Excel file. Perfect for administrators who need to manage and analyze report data offline.
Key Features
- Effortless Export: Export comprehensive reports, including user details, enrollment information, completion statuses, and assessment results, directly to an Excel file.
- Customizable SQL Query: Tailor the SQL query to match your specific reporting needs.
- Access Control: Ensures that only users with the appropriate permissions (e.g., administrators) can export the data.
- User-Friendly Interface: Provides an intuitive admin page in the WordPress dashboard to initiate the export process.
- Instant File Download: Generates the Excel file on-the-fly and prompts the user to download it immediately.
Version
1.0
Author
Khaled Ahmed
Installation
- Download and install Composer if you haven't already.
- Run
composer require phpoffice/phpspreadsheetin the root directory of your plugin to install PHPSpreadsheet. - Upload the plugin files to the
/wp-content/plugins/export-reports-to-exceldirectory, or install the plugin through the WordPress plugins screen directly. - Activate the plugin through the 'Plugins' screen in WordPress.
- Navigate to the "Export Reports" page in the WordPress admin menu.
Usage
- Navigate to the Export Page: Go to the "Export Reports" page in the WordPress admin menu.
- Export Data: Click the "Export Reports" button to generate and download the Excel file with your report data.
Customizing the SQL Query
To use this plugin for your specific reporting needs, you must customize the SQL query in the export_courses_to_excel function. The default query is a placeholder and needs to be replaced with your own query to gather the required report data.
-
Open the
export-reports-to-excel.phpfile. -
Locate the following line:
$query = 'YOUR_SQL_QUERY_HERE'; -
Replace
'YOUR_SQL_QUERY_HERE'with your actual SQL query. Ensure your query retrieves the necessary fields and data for your report.
Example:
$query = 'SELECT user_login AS `User Login`, user_email AS `User Email`, display_name AS `Display Name` FROM wp_users';