PHP code example of agencenous / wp-reporting

1. Go to this page and download the library: Download agencenous/wp-reporting library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

agencenous / wp-reporting example snippets




add_action ('plugins_loaded', function(){
    gister('project-name', [
        'label' => 'Project name', // translate it with __('Project name', 'project-textdomain')
        'description' => 'Send logs by emails', // translate it with __('Description', 'project-textdomain')
        'category' => 'plugin', // plugin, theme, main
        'to' => 'bm91c0BhdmVjbm91cy5ldQ==', // email addresse, plain or BASE64 encoded (to prevent spam when source is open)
        'only_in_dir' => __DIR__, // Limit error reporting to this directory for this project
        'javascript' => true, // Enable javascript error reporting
    ]);
});

// Add it in any function or class
try{
    // Your code goes here
}
catch(\Throwable $e){ // For PHP 7
    \WPReporting()->send($e, 'project-name');
}
catch(\Exception $e){ // For PHP 5
    \WPReporting()->send($e, 'project-name');
}


// Add it in any function or class
\WPReporting()->listen('project-name', E_WARNING);

// Your code goes here

\WPReporting()->stop();

\WPReporting()->load_scripts();

defined('WP_REPORTING_NETWORK', true);