Skip to content

Commit 81e7530

Browse files
Merge pull request #504 from CleanTalk/wp-cli-spbc.ag
WP CLI implemented
2 parents 507451e + 65e2c19 commit 81e7530

6 files changed

Lines changed: 513 additions & 7 deletions

File tree

inc/spbc-firewall.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ function spbc_firewall_skip_check()
171171
|| spbc_wp_doing_cron() // Pass WP cron tasks
172172
|| \CleantalkSP\Variables\Server::inUri('/favicon.ico') // Exclude favicon.ico requests from the check
173173
|| spbc_mailpoet_doing_cron()
174+
|| spbc_is_cli()
174175
) {
175176
return true;
176177
}

inc/spbc-pluggable.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,13 @@ function spbc_mailpoet_doing_cron()
8080
strpos(Server::get('REQUEST_URI', null, 'url'), 'mailpoet_router') !== false
8181
);
8282
}
83+
84+
/**
85+
* Checks if the request is the command line access
86+
*
87+
* @return boolean
88+
*/
89+
function spbc_is_cli()
90+
{
91+
return PHP_SAPI === "cli";
92+
}

0 commit comments

Comments
 (0)