[Extension Request] Clients Reports and Pro Client Reports: Report Tokens for iThemes Security

Hello,

I haven’t found any reliable information on the subject.
How can I integrate the information from Ithemes Security into Client Reports and Client Reports Pro?
Thank you very much for your answer

Hey @xtdesignweb

Welcome to the MainWP Community.

Currently, Client Reports and Pro Reports do not support iThemes data, and there are no available tokens for them.

Please feel free to make a suggestion about it on our feedback site. That way, others can vote for it, letting us know which features our users want the most.

If you are interested in creating a custom token for iThemes, I can provide additional information. Keep in mind that this would require some coding knowledge.

Hello,

I have some notion of coding but I am not an expert.
If you know a method to make an itheme token, I’m interested to try it.

​I’d be happy to explain one part of the necessary steps. Unfortunately, the other part is entirely dependent on the information you wish to include in the report, and in this case, it’s somewhat complicated.

​This part would need to be inserted into the functions.php file of your child theme, or even better by using our Custom Dashboard extension.

​add_filter( 'mainwp_pro_reports_custom_tokens', 'mycustom_mainwp_pro_reports_custom_tokens', 10, 3 );

function mycustom_mainwp_pro_reports_custom_tokens( $tokensValues, $report, $website ) {

if ( is_array( $tokensValues ) && isset( $tokensValues['[report.custom.token]'] ) ) {

$tokensValues['[report.custom.token]'] = "your custom value";

}

return $tokensValues;

}

​​In that example code, we are mostly interested in this line: $tokensValues[‘[report.custom.token]’] = “your custom value”;

​report.custom.token can be anything you want and will be used to insert the data in the report. For example [my.ithemes.token] .

But the value part is the complicated one.

​You would essentially need to write custom code which would process iThemes data and present it in the desired way so that you could insert it into the Report.


​So let’s say custom_code() processes iThemes information, and the processed data is stored in the database in your new [ithemes.log.data] array.

​You would then retrieve that information from the database before the filter is executed, by stating something like $ithemeslogdata = $website['ithemes.log.data'];

​And the line in the filter would then look something like $tokensValues['[my.ithemes.token]'] = "$ithemeslogdata";.

Hopefully, this helps.