Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 0 additions & 56 deletions assets/css/facebook-infobanner.css

This file was deleted.

19 changes: 0 additions & 19 deletions facebook-commerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,25 +276,6 @@ public function __construct( WC_Facebookcommerce $facebook_for_woocommerce ) {
include_once 'includes/fbutils.php';
}

// Display an info banner for eligible pixel and user.
if ( $this->get_external_merchant_settings_id()
&& $this->get_facebook_pixel_id()
&& $this->get_pixel_install_time() ) {
$should_query_tip =
WC_Facebookcommerce_Utils::check_time_cap(
get_option( 'fb_info_banner_last_query_time', '' ),
self::FB_TIP_QUERY
);
$last_tip_info = WC_Facebookcommerce_Utils::get_cached_best_tip();

if ( $should_query_tip || $last_tip_info ) {
if ( ! class_exists( 'WC_Facebookcommerce_Info_Banner' ) ) {
include_once 'includes/fbinfobanner.php';
}
WC_Facebookcommerce_Info_Banner::get_instance( $this->get_external_merchant_settings_id(), $should_query_tip );
}
}

if ( ! $this->get_pixel_install_time() && $this->get_facebook_pixel_id() ) {
$this->update_pixel_install_time( time() );
}
Expand Down
237 changes: 0 additions & 237 deletions includes/fbinfobanner.php

This file was deleted.

28 changes: 0 additions & 28 deletions includes/fbutils.php
Original file line number Diff line number Diff line change
Expand Up @@ -822,34 +822,6 @@ public static function set_test_fail_reason( $msg, $trace ) {
set_transient( 'facebook_plugin_test_stack_trace', $trace );
}

/**
* Helper function to check time cap.
*
* @param string $from
* @param int $date_cap
* @return bool
*/
public static function check_time_cap( $from, $date_cap ) {
if ( null === $from ) {
return true;
}
$now = new DateTime( current_time( 'mysql' ) );
$diff_in_day = $now->diff( new DateTime( $from ) )->format( '%a' );
return is_numeric( $diff_in_day ) && (int) $diff_in_day > $date_cap;
}

/**
* Gets the cached best tip.
*
* @return mixed
*/
public static function get_cached_best_tip() {
$cached_best_tip = self::decode_json(
get_option( 'fb_info_banner_last_best_tip', '' )
);
return $cached_best_tip;
}

/**
* Normalizes product data to be included in a sync request. /items_batch
* rather than /batch this time.
Expand Down