CM Custom Reports (CMCR) - Advanced - Creating Your Own Report
Creating Own Report
PHP Experience Required
It's necessary to edit PHP files in order to create new reports. This requires some coding experience.
TIP: Code Sample
Link to the code sample (zip of the sample plugin) - click here.
- Download Sample File
Follow this link
- Unzip file and locate the report
Under the reports folder
- Change the SampleReport filename to some distinctive and meaningful
For example, PostsByCategoryReport
- Change the include_once dirname( _FILE_ ) . '/reports/SampleReport.php'; to use the correct filename
For example, include_once dirname( _FILE_ ) . '/reports/PostsByCategoryReport.php';
- Change the CMCR_Sample_Report to CMCR_New_File_Name (following the naming convention)
For example, CMCR_Posts_By_Category_Report
- Modify the code of the report class
The parts which need to be changed are marked with the TODO: comment in the code
TIP: getData Method
The most important method to change is the "getData" - which actually is responsible for delivering the data for the graphs.
- Install and activate the addon
We Can Help You
If you need a custom report but you're not a developer you can hire our developers and we'll create a custom report for you.