protected function _akismetStatus($data)
    {
        require_once Plugin::classPath('Comment') . 'Lib/Akismet.php';

        try {
            $akismet = new \Akismet(Router::url('/'), $this->config('settings.akismet_key'));

            if (!empty($data['author_name'])) {
                $akismet->setCommentAuthor($data['author_name']);
            }

            if (!empty($data['author_email'])) {
                $akismet->setCommentAuthorEmail($data['author_email']);
            }

            if (!empty($data['author_web'])) {
                $akismet->setCommentAuthorURL($data['author_web']);
            }

            if (!empty($data['body'])) {
                $akismet->setCommentContent($data['body']);
            }

            if ($akismet->isCommentSpam()) {
                return 'spam';
            }
        } catch (\Exception $ex) {
            return 'pending';
        }

        return $data['status'];
    }
protected function _akismetStatus($data)
    {
        require_once Plugin::classPath('Comment') . 'Lib/Akismet.php';

        try {
            $akismet = new \Akismet(Router::url('/'), $this->config('settings.akismet_key'));

            if (!empty($data['author_name'])) {
                $akismet->setCommentAuthor($data['author_name']);
            }

            if (!empty($data['author_email'])) {
                $akismet->setCommentAuthorEmail($data['author_email']);
            }

            if (!empty($data['author_web'])) {
                $akismet->setCommentAuthorURL($data['author_web']);
            }

            if (!empty($data['body'])) {
                $akismet->setCommentContent($data['body']);
            }

            if ($akismet->isCommentSpam()) {
                return 'spam';
            }
        } catch (\Exception $ex) {
            return 'pending';
        }

        return $data['status'];
    }
protected function _akismetStatus ( $ data ) { require_once Plugin :: classPath ( 'Comment' ) . 'Lib/Akismet.php' ; try { $ akismet = new \ Akismet ( Router :: url ( '/' ) , $ this -> config ( 'settings.akismet_key' ) ) ; if ( ! empty ( $ data [ 'author_name' ] ) ) { $ akismet -> setCommentAuthor ( $ data [ 'author_name' ] ) ; } if ( ! empty ( $ data [ 'author_email' ] ) ) { $ akismet -> setCommentAuthorEmail ( $ data [ 'author_email' ] ) ; } if ( ! empty ( $ data [ 'author_web' ] ) ) { $ akismet -> setCommentAuthorURL ( $ data [ 'author_web' ] ) ; } if ( ! empty ( $ data [ 'body' ] ) ) { $ akismet -> setCommentContent ( $ data [ 'body' ] ) ; } if ( $ akismet -> isCommentSpam ( ) ) { return 'spam' ; } } catch ( \ Exception $ ex ) { return 'pending' ; } return $ data [ 'status' ] ; }
Calculates comment's status using akismet.

@param array $data Comment's data to be validated by Akismet
@return string Filtered comment's status
Calculates comment s status using akismet .