Skip to content
Sign In Create account

DigiAudit

Brand DigiAudit for your agency

Set your own name, address, logo and colour in config.php, send requests to your CRM by webhook, and extend the plugin with its hooks.

3 min read Updated

Everything a client sees about who made the plugin, and every address a request goes to, comes from one file: config.php, at the root of the plugin folder. None of it can be changed from the WordPress admin, so a client cannot redirect your quote requests.

Edit config.php before you install

Unzip the release, edit config.php, zip the digiaudit folder again, and install that zip on the client's site.

KeyPublished valueWhat it sets
agency_nameDigipacketThe name in the header, e-mails and report
agency_email[email protected]Where quote requests and proactive alerts go
agency_phoneemptyShown in the call to action, the e-mails and the report
agency_websiteemptyShown in the e-mails and the report
agency_logoemptyAbsolute URL of a logo, about 200 × 60. Replaces the DigiAudit mark in the header
support_urlour contact pageWhere the Support button goes. Empty hides the button
primary_color#2563ebThe accent colour of the interface
cta_title, cta_textFrench textThe heading and body of the call-to-action card
response_delay24 à 48 h ouvréesThe reply time promised in the acknowledgement
show_pricesfalseShows a starting price on each problem and an overall estimate
price_quick, price_medium, price_complexsetStarting prices for a quick fix, a standard job and an advanced one
currency€The currency symbol printed beside them
webhook_urlemptyA URL that receives every quote request as JSON
webhook_secretemptyThe secret that signs those requests

Keep your changes through updates

An update replaces the plugin folder, config.php included. To set values an update cannot touch, put them in a must-use plugin instead — a PHP file in wp-content/mu-plugins/:

php
<?php
add_filter( 'digipacket_audit_agency_config', function ( $config ) {
	$config['agency_name']  = 'Your Agency';
	$config['agency_email'] = '[email protected]';
	return $config;
} );

Any key from the table can be set this way.

Send requests to your CRM

With webhook_url set, DigiAudit posts JSON to it on every quote request (quote.requested) and on every proactive alert (scan.alert). A quote request fails only if both the e-mail and the webhook fail, so a webhook is the way to never lose one on a server that cannot send mail.

Each call carries:

  • X-Digipacket-Audit-Event — quote.requested or scan.alert;
  • X-Digipacket-Audit-Signature — sha256= and the HMAC-SHA256 of the raw body, when webhook_secret is set.

The body holds event, quote (reference, contact details, urgency, message, selected items), site (address, versions, theme, plugins), score, grade, counts, categories, selected, issues, scanned_at and plugin. A 2xx answer within 10 seconds counts as delivered.

Check the signature before trusting a call:

php
$body     = file_get_contents( 'php://input' );
$expected = 'sha256=' . hash_hmac( 'sha256', $body, $secret );

if ( ! hash_equals( $expected, $_SERVER['HTTP_X_DIGIPACKET_AUDIT_SIGNATURE'] ?? '' ) ) {
	http_response_code( 401 );
	exit;
}

Hooks

HookKindUse
digipacket_audit_checksfilterAdd or remove checks
digipacket_audit_agency_configfilterOverride any config.php value
digipacket_audit_capabilityfilterWho may use the plugin — manage_options by default
digipacket_audit_scan_resultsfilterChange results before the score is calculated
digipacket_audit_quote_recipientsfilterCopy quote e-mails to more addresses
digipacket_audit_webhook_payloadfilterChange the webhook body
digipacket_audit_php_eolfilterEnd-of-support dates for each PHP version
digipacket_audit_large_image_bytesfilterThe heavy-image threshold, 500 KB by default
digipacket_audit_scan_completedactionAfter every scan
digipacket_audit_quote_sentactionAfter every quote request that was sent

Add a check of your own

Extend Digipacket_Audit_Check, describe the check in setup(), return a result from run(), and register it:

php
class My_Check extends Digipacket_Audit_Check {

	protected function setup() {
		$this->id             = 'my_check';
		$this->category       = 'security'; // security, performance, seo or maintenance
		$this->title          = 'Mon contrôle';
		$this->weight         = 5;
		$this->effort         = 'quick';    // quick, medium or complex
		$this->risk           = 'Pourquoi c\'est important.';
		$this->recommendation = 'Ce que la correction implique.';
	}

	public function run( Digipacket_Audit_Context $ctx ) {
		$ok = true; // Your test.

		return $ok
			? $this->good( 'Tout va bien.' )
			: $this->critical( 'Problème détecté.', array( 'détail' ) );
	}
}

add_filter( 'digipacket_audit_checks', function ( $checks ) {
	$check                = new My_Check();
	$checks[ $check->id ] = $check;
	return $checks;
} );

warning() and skip() return the other two outcomes.

Still stuck?

Open a ticket from your control panel and say which step you reached. A screenshot of what you see is the fastest way to show us.

Still stuck

Nothing here fits? Write to us.

Tell us what you are trying to do rather than what went wrong, and we will tell you whether it is something we can fix from here.

  • Answered by a person

    There is no ticket robot in front of us. What you write is what somebody reads.

  • Say what you are trying to do

    The fastest answers come from the message that explains the goal, not only the error.

  • Your services are already in front of us

    Sign in first and we can see the account the question is about without asking you to describe it.