Hi,
Thank you for your fast reply! I will respond here, so maybe it helps others too.
We use the plugin with composer.
Our php-code is like:
Code: Select all
use lib\Cleantalk;
use lib\CleantalkRequest;
use lib\CleantalkResponse;
$this->oRequest = new CleantalkRequest();
$this->oRequest->auth_key = 'xxxxx';
$this->oRequest->agent = 'php-api';
$this->oRequest->js_on = 1;
$this->oRequest->allow_links = 1;
// the message to test is like:
$this->oRequest->sender_email = 'xxx';
$this->oRequest->sender_nickname = 'xxx';
$this->oRequest->sender_ip = 'xxx';
$this->oRequest->message = 'xxx';
$this->oRequest->submit_time = time() - (int) $formTime; // from session
$this->oRequest->sender_info => '{"Refferrer":"http:\/\/xxxxx","UserAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko\/20100101 Firefox\/64.0"}';
//etc....
$this->oService = new Cleantalk();
$this->oService->server_url = " http://moderate.cleantalk.org/api2.0/";
// we check both methods, because it is a contact-form with unknown email-adresses.
$this->oResponseUser = $this->oService->isAllowUser($this->oRequest);
$this->oResponseMessage = $this->oService->isAllowMessage($this->oRequest);
NB. If there are some minor php-errors in above code, that is because I copied parts of our real code, to give a picture of it. Because the real code is divided in classes and methods etc. The real code has no (parse-)errors and gets a valid CleantalkResponse object back..
oResponseUser: (oResponseMessage is (almost) the same)
Code: Select all
received => -1
stop_words =>
comment => *** Antispam disabled. Check access key in CleanTalk plugin/module options. ***
blacklisted => 1
allow => 1
id => 1171dd45f986e1e2a3025ef36ff52b9a
errno => 0
errstr =>
fast_submit => 0
spam => 0
js_disabled => 0
sms_allow =>
sms =>
sms_error_code =>
sms_error_text =>
stop_queue => 0
inactive => 1
account_status => 0
codes
0 => KEY_NOT_FOUND
We used these examples:
https://github.com/CleanTalk/php-antispam
Yesterday it worked and gave a nice spam-report. But today we get this response, but as far as I know, we did not change our code.
Thanks for helping.
flexJoly