Support » Plugin: Akismet Spam Protection » I don’t think Akismet’s checkSpam is working properly

  • Resolved freeko92

    (@freeko92)


    We are trying to develop spam comment processing logic through Akismet’s checkSpam, but regardless of what content is in the comment, always returning ‘false’. What am I missing?

    Below is the code I wrote to test.

    
    const comment = {
        ip: '192.0.96.247',
        useragent: 'CommentorsAgent 1.0 WebKit',
        content: 'Nice',
        email: 'test050505@test.com',
        name: 'test'
    }
    
    async function checkSpamComment(comment) {
        try {
            const isSpam = await client.checkSpam(comment)
    
            if (isSpam) console.log('OMG Spam!')
            else console.log('Totally not spam')
    
        } catch (err) {
            console.error('Something went wrong:', err.message)
        }
    }
    
    checkSpamComment();
    
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Christopher Finke

    (@cfinke)

    If you want to guarantee a true response, send akismet-guaranteed-spam as the content or akismet-guaranteed-spam@example.com as the email.

    Thread Starter freeko92

    (@freeko92)

    First of all, thank you so much for your answer, but on the contrary, if only false comes out, how can I test it?

    Plugin Author Christopher Finke

    (@cfinke)

    It’s actually pretty hard to intentionally create something that looks like real spam unless you’re a real spammer — the nature of spam changes quickly and catching it is reliant upon millions of data points from other pieces of real-time content, so that’s why we have the values that will guarantee a spam response.

    Thread Starter freeko92

    (@freeko92)

    Thanks a lot. Your help was a ray of light to me. 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.