WordPress.org

Ready to get started?Download WordPress

Forums

P2
p2 theme does not send all input from comment form via ajax request (4 posts)

  1. webvitaly
    Member
    Posted 1 year ago #

    I am the developer of Anti-spam plugin.

    Anti-spam plugin works like this:

    Two extra hidden fields are added to comments form. Both them should be send and checked on the server. If the user visits site, than the hidden fields are filled automatically with javascript insted of the user. If the spammer tries to submit comment form, he will make a mistake with filling inputs and spam comment will be automatically rejected.

    p2 theme submits comments via ajax and scripts sends only name, email, url, comments etc. But p2 script does not sends new added inputs to comment form via another plugins.

    I checked the code and founded it in 'js/p2.js' file:

    var dataString = {action: 'new_comment' , _ajax_post: nonce, comment: commenttext,  comment_parent: comment_parent, comment_post_ID: comment_post_ID, subscribe: subscribe, subscribe_blog: subscribe_blog};
    if (!isUserLoggedIn) {
    	dataString['author'] = $('#author').val();
    	dataString['email'] = $('#email').val();
    	dataString['url'] = $('#url').val();
    }

    What can be done to make p2 theme work with Anti-spam and other plugins related to commenting?

  2. Lance Willett
    Themer
    Posted 9 months ago #

    I'm not sure, what would you suggest? I don't think this has come up before from other plugin developers.

    Maybe a filter on the comment POST variables so plugins can submit other values?

  3. webvitaly
    Member
    Posted 9 months ago #

    Is it possible to go thru all inputs in the form and submit all of them via js?

  4. Lance Willett
    Themer
    Posted 9 months ago #

    No, that would be a security issue, because anyone could insert any value or input they wish.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic