Skip to content

Commit

Permalink
Update for OJS 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
wopsononock committed Feb 3, 2022
1 parent a86792b commit e347ad5
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 9 deletions.
24 changes: 17 additions & 7 deletions AkismetPlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,14 +433,24 @@ function _sendPayload($data, $flag = false) {
$httpRequest .= "User-Agent: {$ua}\r\n";
$httpRequest .= "\r\n{$requestBody}";
$response = $errno = $errstr = $headers = $content = '';
if (false != ($socket = fsockopen('ssl://'.$host, $port, $errno, $errstr))) {
fwrite($socket, $httpRequest);
while (!feof($socket)) {
$response .= fgets($socket);
}
fclose($socket);
list($headers, $content) = explode("\r\n\r\n", $response, 2);
$httpClient = Application::get()->getHttpClient();
try {$response = $httpClient->request(
'POST',
'https://'.$host.$path,
[
'User-Agent'=>$ua,
'form_params' => $data
]
);
$content = (string) $response->getBody();
}
catch (Exception $e){
$content='';
error_log($e->getMessage());
}



return ((!$flag && $content === 'true') || ($flag && $content === 'Thanks for making the web a better place.'));
}

Expand Down
51 changes: 51 additions & 0 deletions locale/en_US/locale.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2022-02-02T11:39:21-05:00\n"
"PO-Revision-Date: 2022-02-02T11:39:21-05:00\n"
"Language: \n"

msgid "plugins.generic.akismet.displayName"
msgstr "Akismet Anti-Spam Plugin"

msgid "plugins.generic.akismet.description"
msgstr "Integrate OJS with Akismet for new user registrations. Through this plugin, OJS can submit each new user registration to Akismet, and will reject those Akismet identifies as spam."

msgid "plugins.generic.akismet.spamDetected"
msgstr "This entry has been flagged as spam."

msgid "plugins.generic.akismet.spamFailed"
msgstr "Flagging this entry as spam failed."

msgid "plugins.generic.akismet.privacyNotice"
msgstr "All information collected via this form (except for the password) may be submitted to a third party (Akismet) for spam filtering. Please review <a href=\"https://automattic.com/privacy-notice/\" target=\"_blank\">the Akismet service's privacy notice</a>."

msgid "plugins.generic.akismet.manager.akismetSettings"
msgstr "Akismet Settings"

msgid "plugins.generic.akismet.manager.settings.description"
msgstr "<p>Please provide the Akismet API key. You must already have registered with <a href=\"https://akismet.com/\">Akismet</a> for the service.</p>"

msgid "plugins.generic.akismet.manager.settings.akismetKey"
msgstr "Akismet API key"

msgid "plugins.generic.akismet.manager.settings.akismetKeyRequired"
msgstr "The Akismet API key is required."

msgid "plugins.generic.akismet.manager.settings.akismetPrivacyNotice"
msgstr "Display a privacy notice on the registration page."

msgid "plugins.generic.akismet.actions.flagAsSpam"
msgstr "Report as spam"

msgid "plugins.generic.akismet.grid.action.flagAsSpam"
msgstr "Report as spam to Akismet"

msgid "plugins.generic.akismet.actions.confirmFlagAsSpam"
msgstr "Do you want to report this user's registration to Akismet as spam?"
4 changes: 2 additions & 2 deletions version.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<version>
<application>akismet</application>
<type>plugins.generic</type>
<release>1.2.2.2</release>
<date>2021-07-23</date>
<release>1.2.3.0</release>
<date>2022-02-03</date>
<lazy-load>1</lazy-load>
<class>AkismetPlugin</class>
</version>

0 comments on commit e347ad5

Please sign in to comment.