How to Use Security Ninja Tokens in MainWP Pro Reports
Requirements
Before you start, make sure your MainWP environment and child sites are ready to surface Security Ninja data in reports.
- MainWP dashboard with the Pro Reports extension enabled
- Security Ninja for MainWP installed and activated on the MainWP dashboard
- Security Ninja installed on the child sites you report on (Pro required for events data)
- After installing or updating, run a MainWP site Sync to refresh cached data
Available Tokens
These tokens can be used anywhere tokens are supported in Pro Reports (templates and emails). Tables render minimal semantic HTML suitable for all default templates.
[securityninja.score]
– Overall Security Ninja score reported by the site[securityninja.vulnerabilities]
– Total number of detected vulnerabilities[securityninja.vulnerabilities.table]
– Table of detected items with columns: Type, Name, Installed, Info[securityninja.events.table]
– Table of the last 10 events with columns: Time, IP, Module, Action, Description
Note: the table tokens intentionally include no descriptive text so you can place them inside your own narrative.
Insert Tokens into Reports
When editing a report, you can insert tokens via the token picker or paste them directly.
- Go to MainWP > Extensions > Pro Reports > Edit (or create) a report
- Use the “Insert tokens” control above the field to pick from available tokens (look for the Security Ninja group)
- Alternatively, paste tokens directly where needed using square brackets, e.g.
[securityninja.score]
- Save the report and preview or generate content to verify replacements
Insert Tokens into Emails
You can use the same tokens in email subject and message content sent by Pro Reports.
- In the report editor, locate the Email Subject and Email Message fields
- Click “Insert tokens” to pick a token, or paste the token directly
- Use “Preview message” to render a sample using one of the selected sites
Tip: Keep subjects concise. For example: Monthly Security Report — Score [securityninja.score]
Data Sources and Sync
Token values primarily come from cached site details synchronized by MainWP. If a value is missing, the addon performs a light remote fetch to fill essential fields. Events require Security Ninja Pro on the child site.
- After adding sites or updating plugins, run MainWP > Sites > Sync
- Run Security Ninja tests on child sites to refresh scores and results
- Events are populated from your MainWP database and reflect the latest synchronized logs
Examples
Report section
Subject example:
Website Security Summary — Score: [securityninja.score]
Body example:
Overall score: [securityninja.score]
Vulnerabilities detected: [securityninja.vulnerabilities]
[securityninja.vulnerabilities.table]
Recent activity
[securityninja.events.table]
Email message
Subject: Monthly Security Report — Score [securityninja.score]
Hello,
Here is your monthly security overview.
Score: [securityninja.score]
Vulnerabilities: [securityninja.vulnerabilities]
[securityninja.vulnerabilities.table]
Recent activity
[securityninja.events.table]
Troubleshooting
-
Tokens show as plain text
- Confirm the token is wrapped in square brackets and spelled correctly
- Ensure Pro Reports is active and the report was saved after edits
-
Empty tables or zero counts
- Run MainWP Sync to refresh cached data
- Run Security Ninja tests on the child site to refresh its data
- Events require Security Ninja Pro on the child site
-
Styling adjustments
- The table HTML is minimal; use your report template CSS to adjust fonts, borders, or spacing
Related Articles
Contact Support
If you need help, contact support at support@wpsecurityninja.com.