Plugin Directory

Changeset 1895211


Ignore:
Timestamp:
06/19/2018 03:33:25 PM (8 years ago)
Author:
oskarn97
Message:

update

Location:
appful/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • appful/trunk/appful.php

    r1864976 r1895211  
    44Plugin URI: https://appful.io/
    55Description: appful is one of the world's most remarkable & beautiful app service for Blogger and Online magazines. It is designed to create outstanding real native iOS and Android Apps based on the content of your Wordpress site or YouTube channel. appful is surprisingly simple to use and not a single line of code is required.
    6 Version: 1.0.105
     6Version: 1.0.106
    77Author: appful GmbH
    88Author URI: https://appful.io/
  • appful/trunk/models/comment.php

    r1864977 r1895211  
    5757        add_action('comment_on_draft', array(&$this, 'comment_on_draft'));
    5858        add_filter('comment_post_redirect', array(&$this, 'comment_post_redirect'));
    59         add_action('comment_flood_trigger', array(&$this, 'comment_flood'));
    60         add_action('comment_duplicate_trigger', array(&$this, 'comment_flood'));
     59        //add_action('comment_flood_trigger', array(&$this, 'comment_flood'));
     60        //add_action('comment_duplicate_trigger', array(&$this, 'comment_flood'));
    6161        //add_filter('comment_flood_filter', '__return_false');
    6262
     
    7474            'comment_parent' => $_REQUEST["parent"],
    7575            'comment_author_IP' => $_REQUEST["ip"],
    76             'comment_agent' => $_REQUEST["user_agent"],
    77             'comment_date' => current_time('mysql'),
    78             'comment_approved' => get_option("comment_moderation") == 0 ? 1:0,
     76            'comment_agent' => $_REQUEST["user_agent"]
    7977        );
    8078
    81 
    82         if(!get_option("appful_allow_commentflood", false)) wp_allow_comment($data);
    83         $comment_id = wp_insert_comment($data);
     79        $comment_id = wp_new_comment($data, true);
     80        if(is_wp_error($comment_id)) {
     81            $response = array("status" => end(explode('comment_', array_keys($comment_id->errors)[0])), 'error' => array_values($comment_id->errors)[0]);
     82            if($response['status'] != 'flood' || !get_option("appful_allow_commentflood", false)) {
     83                $appful_api->response->respond($response);
     84                die();
     85            }
     86        }
    8487
    8588        $this->import_wp_object(get_comment($comment_id));
Note: See TracChangeset for help on using the changeset viewer.