Plugin: rah_comment_spam

By (plugin prefix rah)

Plugin categorization:
Textpattern version compatibility: 4.5 4.8
Latest plugin version is: 0.9.0

Description

Rah_comment_spam provides customizable anti-spam tools for Textpattern CMS’ comment system.

Download releases

rah_comment_spam 0.9.0
Release date:
PHP download

Installation instructions

How to install a PHP .zip format plugin

If you notice any kind of problem with this page’s construction or content (plugin doesn’t work as stated, outdated information, typos, broken links, or whatever), open an issue and we’ll investigate.

Further information

Tag error: <txp:php>
global $variable;
global $json;

$github_url = parse('<txp:variable name="json-repo-github" />');
$github_ident = explode('/', parse_url($github_url, PHP_URL_PATH));

$query = <<<'GRAPHQL'
query($organizationLogin:String!,$repositoryName:String!) {
  repository(owner:$organizationLogin, name:$repositoryName) {
    url
    stargazers {
      totalCount
    }
    licenseInfo {
        name
        url
    }
    pushedAt
  }
}
GRAPHQL;

$variables = [
    'organizationLogin' => $github_ident[1],
    'repositoryName'    => $github_ident[2]
];

$githubjson = json_encode([
    'query'     => $query,
    'variables' => $variables
]);

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_URL => 'https://api.github.com/graphql',
    CURLOPT_TIMEOUT => 8,
    CURLOPT_FAILONERROR => true,
    CURLOPT_POSTFIELDS => $githubjson,
    CURLOPT_HTTPHEADER => array(
        'User-Agent: Textpattern CMS',
        'Content-Type: application/json;charset=utf-8',
        'Authorization: bearer '.$variable['github-api-key']
    ),
]);

$response = curl_exec($curl);
curl_close($curl);

if ($response === false) {
    return;
}

if (!($githubjson = json_decode($response))) {
    return;
}

$githubjson = json_decode($response);

echo '<h3>GitHub details</h3>';
echo '<p><a rel="external" href="'.$githubjson->data->repository->url.'">GitHub project page <span class="ui-icon ui-icon-extlink"></span></a></p>';
echo '<a class="button" rel="external" href="'.$githubjson->data->repository->url.'" title="Stars on GitHub"><span class="ui-icon ui-extra-icon-github">GitHub</span> <strong>Stars</strong></a> <a class="count-bubble" rel="external" href="'.$githubjson->data->repository->url.'/stargazers" title="Stargazers on GitHub">'.intval($githubjson->data->repository->stargazers->totalCount).'</a>';
echo '<dl class="definitionlist--compact">';
echo '<dt>Repo latest activity</dt>';
echo '<dd><time datetime="'.$githubjson->data->repository->pushedAt.'">'.date("Y-m-d, g:ia", strtotime($githubjson->data->repository->pushedAt)).'</time></dd>';

if (isset($githubjson->data->repository->licenseInfo->name)) {
    echo '<dt>Repo license(s)</dt>';
    echo '<dd><a href="'.$githubjson->data->repository->licenseInfo->url.'">'.htmlspecialchars($githubjson->data->repository->licenseInfo->name).'</a></dd>';
}

echo '</dl>';
</txp:php> ->  8192: Function curl_close() is deprecated since 8.5, as it has no effect since PHP 8.0 Issue detected while parsing form repo_link_github on page plugins
textpattern/publish/taghandlers.php:2754 eval()
php()
textpattern/vendors/Textpattern/Tag/Registry.php:140 call_user_func()
textpattern/lib/txplib_publish.php:540 Textpattern\Tag\Registry->process()
textpattern/lib/txplib_publish.php:429 processTags()
textpattern/lib/txplib_misc.php:3743 parse()
textpattern/publish/taghandlers.php:447 parse_form()
output_form()
textpattern/vendors/Textpattern/Tag/Registry.php:140 call_user_func()
textpattern/lib/txplib_publish.php:540 Textpattern\Tag\Registry->process()

GitHub details

GitHub project page

GitHub Stars 2
Repo latest activity
Repo license(s)
GNU General Public License v2.0

The Plugins Carver