WordPress.org

Ready to get started?Download WordPress

Forums

Grunion Contact Form
Plugin doesn't work without Akimet (16 posts)

  1. scworldnetter
    Member
    Posted 3 years ago #

    I don't use Akismet. I get the error:

    Fatal error: Call to undefined function akismet_http_post() in /home/cloudf2/public_html/blog/wp-content/plugins/grunion-contact-form/grunion-contact-form.php on line 497

    I will disable the code to Akimet manually, but it would be nice if it was part of the plugin feature.

  2. scworldnetter
    Member
    Posted 3 years ago #

    For anyone else who runs into this problem, I commented out the following code in grunion-contact-form.php:

    // $akismet_values = contact_form_prepare_for_akismet( $contact_form_values );
    	// $is_spam = contact_form_is_spam_akismet( $akismet_values );
    	// if ( is_wp_error( $is_spam ) )
    	//	return; // abort
    	// else if ( $is_spam )
    	//	$spam = '***SPAM*** ';

    This prevents the plugin from calling Akismet. Seems to do the trick. A more elegant solution would be if the plugin had a settings page where you could enable or disable this function.

  3. Joseph Scott
    Member
    Plugin Author

    Posted 3 years ago #

    This had been reported in a previous thread - http://wordpress.org/support/topic/plugin-grunion-contact-form-fatal-error-call-to-undefined-function-akismet_http_post?replies=8

    I've already committed a fix for this in Grunion, so it will be part of the next release. You can see what I committed here http://plugins.trac.wordpress.org/changeset/325516

  4. David
    Member
    Posted 3 years ago #

    I'm also having a problem with the plugin which seems much simpler.

    When you click submit / sent it redirects to:

    mydomain.com/contact/#contact-form-8 but then the page doesn't load properly. I have never have "Contact Form 8" installed - if it is referring to that but the same page did use to have Contact Forms ][ running on it. Is there a clash?

  5. Joseph Scott
    Member
    Plugin Author

    Posted 3 years ago #

    Anything clues in the error logs for the server? I've not used Contact Forms ][, but I wouldn't rule out a possible conflict.

  6. David
    Member
    Posted 3 years ago #

    Hi Joseph, Thanks for the quick reply but I don't know how to access the error logs.

    [delete]I thought that it might be a permalinks problem. For example, does Grunion redirect back to the same page the contact form was on to .../page/#something and then an existing permalink redirects that[/delete]

    I have set it up on a test blog that uses the same hosting provider (Heart Internet Reseller [UK]) at http://www.accuratehosting.co.uk/testwordpressinstall/?page_id=2 And when it sends the email, it fails for some reason. On the other version, I use fancy permalinks. In both cases, the page stops loading half way through.

    Given the duplicate issue, perhaps it is a server issue. Do you know how I can get hold of the error logs?

  7. David
    Member
    Posted 3 years ago #

    Follow up from above: I have just installed Clean-Contact as a replacement because I needed a contact page and this has worked on other sites hosted in the same way. Anyway...

    Because Askimet was not activated, the emails failed to send by Clean-Contact (although it told me via an error message). Might this have been a problem here too? Askimet is not running on either site and I don't have an API key to test.

  8. Joseph Scott
    Member
    Plugin Author

    Posted 3 years ago #

    That's definitely possible. I've made some changes in the development version of Grunion to address situations where the Akismet plugin was not in use. You can grab the files from http://plugins.svn.wordpress.org/grunion-contact-form/trunk/ if you want to try it out. This is the development version, so use with extra caution.

  9. David
    Member
    Posted 3 years ago #

    Thanks Joe. Downloaded the Files. That did the trick. message was sent straight away.

  10. David
    Member
    Posted 3 years ago #

    Hi Joseph, had this issue crop up for me today, but looking through the code in grunion-contact-form.php I saw lines 539-540

    if ( function_exists( 'akismet_http_post' ) )
    		add_filter( 'contact_form_is_spam', 'contact_form_is_spam_akismet', 10, 2 );

    and felt that the spam check is optional and only on if Akismet is available, yet the function is always getting used because of line 390:
    $is_spam = contact_form_is_spam_akismet( $akismet_values );

    I thus changed line 390 to read:
    $is_spam = apply_filters( 'contact_form_is_spam', $result = false, $akismet_values );
    which preserves the default spam check as false

    This doesn't fix the admin.php though because of lines 450
    contact_form_akismet_submit( 'spam', $akismet_values );
    and 410
    contact_form_akismet_submit( 'ham', $akismet_values );

    So I converted those to read
    do_action('contact_form_akismet', 'spam', $akismet_values );
    and
    do_action('contact_form_akismet', 'ham', $akismet_values );
    instead and changed the lines in grunion-contact-form.php at 539-540 to now read

    if ( function_exists( 'akismet_http_post' ) ) {
    		add_filter( 'contact_form_is_spam', 'contact_form_is_spam_akismet', 10, 2 );
    		add_action( 'contact_form_akismet', 'contact_form_akismet_submit', 10, 2 );
    	}

    It all seems to work great now, both Akismet off and on. I've submited these changes via a ticket at http://plugins.trac.wordpress.org/ticket/1275 I case they prove useful.

  11. Joseph Scott
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks for the patch.

    Can you take a look at Grunion -trunk and see if this is still needed.

  12. David
    Member
    Posted 3 years ago #

    Yep, looked through trunk and it'd still have the same error when marking a feedback as spam or ham within the admin. Have updated the ticket with a new patch against trunk.

  13. Joseph Scott
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks for the updated patch, I'll take a look at it and start testing.

  14. Joseph Scott
    Member
    Plugin Author

    Posted 3 years ago #

    @David -

    I committed a fix for this item, basically your patch with a few very small tweaks. This will be included in the next release.

  15. yotzeret
    Member
    Posted 3 years ago #

    I used the comment-out fix that scworldnetter suggested and that fixed it for me. Looking forward to the update!

  16. DavidA2008
    Member
    Posted 3 years ago #

    Hi

    I am running Grunion 2.1, which I believe has the fix that allows it to send email if Askimet is disabled. However, I am not receiving email from it.

    Please can anyone suggest whether 2.1 will work with Askimet disabled and, if so, what else may be the reason for my problem?

    David

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic