Skip to content

Commit

Permalink
Merge branch 'release/1.9.5.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
atwellpub committed Dec 14, 2018
2 parents 229f46a + 2609b19 commit e05c218
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
20 changes: 19 additions & 1 deletion core/automation/definitions/trigger.wpleads_new_lead_insert.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,24 @@ function __construct() {
public static function simulate_new_lead( $post_id , $post, $update ) {
global $post_id, $post;

$is_new = $post->post_date === $post->post_modified;
/* first check save count */
$save_count = get_post_meta($post->ID , 'inbound_update_count' , true );
$is_new = false;

if (!$save_count) {
update_post_meta($post->ID , 'inbound_update_count' , 1 );
$is_new = true;
} else {
update_post_meta($post->ID , 'inbound_update_count' , $save_count + 1 );
}

/* if marked new lead make sure this is not an old lead without inbound_update_count meta data */
$post_date = new DateTime($post->post_date);
$yesterday = new DateTime("yesterday");
if ($is_new && ($yesterday > $post_date)) {
$is_new = false;
}


/* ignore revisions */
if ( wp_is_post_revision( $post_id )
Expand All @@ -43,6 +60,7 @@ public static function simulate_new_lead( $post_id , $post, $update ) {
return;
}


/* only perform actions on published leads */
if (get_post_status($post_id) != 'publish') {
return;
Expand Down
4 changes: 3 additions & 1 deletion core/shared/classes/class.lead-storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ static function inbound_lead_store( $args ) {
$lead['mapped_params'] = self::check_val('mapped_params', $args);
$lead['url_params'] = self::check_val('url_params', $args);
$lead['variation'] = self::check_val('variation', $args);
$lead['form_id'] = ($lead['inbound_form_id']) ? $lead['inbound_form_id'] : self::check_val('form_id', $args);
$lead['source'] = self::check_val('source', $args);
$lead['wp_lead_status'] = self::check_val('wp_lead_status', $args);
$lead['ip_address'] = self::lookup_ip_address( $args );
Expand Down Expand Up @@ -319,7 +320,8 @@ static function store_new_lead($lead){
update_post_meta( $id, 'wpleads_email_address', $lead['email'] );
/* new lead run simple page_view storage */
update_post_meta( $id, 'page_views', $lead['page_views']);
/* dont need update_post_meta( $id, 'wpleads_page_view_count', $lead['page_view_count']); */
/* set lead save count */
update_post_meta( $id , 'inbound_update_count' , 1 );

do_action('wpleads_new_lead_insert', $lead ); /* action hook on new leads only */
return $id;
Expand Down
4 changes: 2 additions & 2 deletions inbound-pro.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin URI: http://www.inboundnow.com/
Description: Professional Inbound Marketing Suite for WordPress
Author: InboundWP LLC
Version: 1.9.5.5
Version: 1.9.5.6
Author URI: http://www.inboundnow.com/
Text Domain: inbound-pro
*/
Expand Down Expand Up @@ -95,7 +95,7 @@ public function __construct() {
*/
private static function define_constants() {

define('INBOUND_PRO_CURRENT_VERSION', '1.9.5.5' );
define('INBOUND_PRO_CURRENT_VERSION', '1.9.5.6' );
define('INBOUND_PRO_STABLE_VERSION', '1.9.5.1' );
define('INBOUND_PRO_TRANSLATIONS_VERSION', '1.30.22' );
define('INBOUND_PRO_URLPATH', plugin_dir_url( __FILE__ ));
Expand Down

0 comments on commit e05c218

Please sign in to comment.