Cheetah
Public Member Functions | List of all members
Akismet Class Reference

Public Member Functions

 __construct ($blogURL, $wordPressAPIKey)
 
 isKeyValid ()
 
 isCommentSpam ()
 
 submitSpam ()
 
 submitHam ()
 
 setUserIP ($userip)
 
 setReferrer ($referrer)
 
 setPermalink ($permalink)
 
 setCommentType ($commentType)
 
 setCommentAuthor ($commentAuthor)
 
 setCommentAuthorEmail ($authorEmail)
 
 setCommentAuthorURL ($authorURL)
 
 setCommentContent ($commentBody)
 
 setCommentUserAgent ($userAgent)
 
 setAPIPort ($apiPort)
 
 setAkismetServer ($akismetServer)
 
 setAkismetVersion ($akismetVersion)
 
 setRequestFactory ($requestFactory)
 

Detailed Description

Definition at line 64 of file Akismet.class.php.

Constructor & Destructor Documentation

◆ __construct()

Akismet::__construct (   $blogURL,
  $wordPressAPIKey 
)
Parameters
string$blogURLThe URL of your blog.
string$wordPressAPIKeyWordPress API key.

Definition at line 92 of file Akismet.class.php.

Member Function Documentation

◆ isCommentSpam()

Akismet::isCommentSpam ( )

Tests for spam.

Uses the web service provided by Akismet to see whether or not the submitted comment is spam. Returns a boolean value.

Returns
bool True if the comment is spam, false if not
Exceptions
Willthrow an exception if the API key passed to the constructor is invalid.

Definition at line 188 of file Akismet.class.php.

◆ isKeyValid()

Akismet::isKeyValid ( )

Makes a request to the Akismet service to see if the API key passed to the constructor is valid.

Use this method if you suspect your API key is invalid.

Returns
bool True is if the key is valid, false if not.

Definition at line 135 of file Akismet.class.php.

◆ setAkismetServer()

Akismet::setAkismetServer (   $akismetServer)

Defaults to rest.akismet.com

Definition at line 301 of file Akismet.class.php.

◆ setAkismetVersion()

Akismet::setAkismetVersion (   $akismetVersion)

Defaults to '1.1'

Parameters
string$akismetVersion

Definition at line 310 of file Akismet.class.php.

◆ setAPIPort()

Akismet::setAPIPort (   $apiPort)

Defaults to 80

Definition at line 294 of file Akismet.class.php.

◆ setCommentAuthor()

Akismet::setCommentAuthor (   $commentAuthor)

The name that the author submitted with the comment.

Definition at line 255 of file Akismet.class.php.

◆ setCommentAuthorEmail()

Akismet::setCommentAuthorEmail (   $authorEmail)

The email address that the author submitted with the comment.

The address is assumed to be valid.

Definition at line 264 of file Akismet.class.php.

◆ setCommentAuthorURL()

Akismet::setCommentAuthorURL (   $authorURL)

The URL that the author submitted with the comment.

Definition at line 271 of file Akismet.class.php.

◆ setCommentContent()

Akismet::setCommentContent (   $commentBody)

The comment's body text.

Definition at line 278 of file Akismet.class.php.

◆ setCommentType()

Akismet::setCommentType (   $commentType)

The type of comment being submitted.

May be blank, comment, trackback, pingback, or a made up value like "registration" or "wiki".

Definition at line 248 of file Akismet.class.php.

◆ setCommentUserAgent()

Akismet::setCommentUserAgent (   $userAgent)

Lets you override the user agent used to submit the comment. you may wish to do this when submitting ham/spam. Defaults to $_SERVER['HTTP_USER_AGENT']

Definition at line 287 of file Akismet.class.php.

◆ setPermalink()

Akismet::setPermalink (   $permalink)

A permanent URL referencing the blog post the comment was submitted to.

Parameters
string$permalinkThe URL. Optional.

Definition at line 239 of file Akismet.class.php.

◆ setReferrer()

Akismet::setReferrer (   $referrer)

To override the referring page when submitting spam/ham later on

Parameters
string$referrerThe referring page. Optional.

Definition at line 230 of file Akismet.class.php.

◆ setRequestFactory()

Akismet::setRequestFactory (   $requestFactory)

Used by unit tests to mock transport layer

Parameters
AkismetRequestFactory$requestFactory

Definition at line 319 of file Akismet.class.php.

◆ setUserIP()

Akismet::setUserIP (   $userip)

To override the user IP address when submitting spam/ham later on

Parameters
string$useripAn IP address. Optional.

Definition at line 221 of file Akismet.class.php.

◆ submitHam()

Akismet::submitHam ( )

Submit ham that is incorrectly tagged as spam.

Using this function will make you a good citizen as it helps Akismet to learn from its mistakes. This will improve the service for everybody.

Definition at line 212 of file Akismet.class.php.

◆ submitSpam()

Akismet::submitSpam ( )

Submit spam that is incorrectly tagged as ham.

Using this function will make you a good citizen as it helps Akismet to learn from its mistakes. This will improve the service for everybody.

Definition at line 203 of file Akismet.class.php.


The documentation for this class was generated from the following file: