Skip to content

Commit

Permalink
Merge pull request #1489 from sapayth/tweak/for_release_4.0.12
Browse files Browse the repository at this point in the history
tweak: for release 4.0.12
  • Loading branch information
sapayth authored Oct 14, 2024
2 parents f3c4f5c + ebe5313 commit 62c2870
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 88 deletions.
14 changes: 4 additions & 10 deletions Lib/Appsero/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace WeDevs\Wpuf\Lib\Appsero;

use WP_Error;

/**
* Appsero Client
*
Expand Down Expand Up @@ -110,13 +112,9 @@ public function __construct( $hash, $name, $file ) {
/**
* Initialize insights class
*
* @return Appsero\Insights
* @return object
*/
public function insights() {
if ( ! class_exists( __NAMESPACE__ . '\Insights' ) ) {
require_once __DIR__ . '/Insights.php';
}

// if already instantiated, return the cached one
if ( $this->insights ) {
return $this->insights;
Expand All @@ -130,13 +128,9 @@ public function insights() {
/**
* Initialize license checker
*
* @return Appsero\License
* @return object
*/
public function license() {
if ( ! class_exists( __NAMESPACE__ . '\License' ) ) {
require_once __DIR__ . '/License.php';
}

// if already instantiated, return the cached one
if ( $this->license ) {
return $this->license;
Expand Down
12 changes: 2 additions & 10 deletions Lib/WeDevs_Insights.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace WeDevs\Wpuf\Lib;

if ( ! class_exists( 'WPUF_WeDevs_Insights' ) ) :
if ( ! class_exists( 'WeDevs_Insights' ) ) :

/**
* weDevs Tracker
Expand All @@ -17,26 +17,18 @@
*/
class WeDevs_Insights {
/**
* @var object|Appsero\Insights|Insights
* @var object|Appsero\Insights
*/
public $insights;

/**
* Initialize the class
*/
public function __construct( $file ) {
if ( ! class_exists( 'Appsero\Client' ) ) {
require_once WPUF_ROOT . '/Lib/Appsero/Client.php';
}

$client = new Appsero\Client( '958afc63-99f8-4b98-b321-fcbc5cf95694', 'WP User Frontend', $file );
$this->insights = $client->insights();
$this->insights->client = $client;
$this->insights->init();

// $client = new Appsero\Client( '958afc63-99f8-4b98-b321-fcbc5cf95694', 'WP User Frontend', $file );
// $this->insights = $client->insights();
// $this->insights->init();
}
}

Expand Down
4 changes: 0 additions & 4 deletions includes/Ajax/Frontend_Form_Ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ class Frontend_Form_Ajax {
private $expired_post_status = 'wpuf-expired_post_status';

private $post_expiration_message = 'wpuf-post_expiration_message';
/**
* @var array
*/
private $form_fields;

/**
* @var array
Expand Down
8 changes: 7 additions & 1 deletion includes/Setup_Wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@ public function __construct() {
* @return void
*/
public function custom_admin_bar_styles() {
if ( is_admin_bar_showing() ) {
if ( ! is_admin_bar_showing() ) {
return;
}

if ( function_exists( 'wp_enqueue_admin_bar_header_styles' ) ) {
wp_enqueue_admin_bar_header_styles();
} else {
wp_admin_bar_header();
}
}

Expand Down
4 changes: 2 additions & 2 deletions includes/Traits/TaxableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,11 @@ function wpuf_tax_rate_country_state( $country, $state ) {
continue;
}
if ( $rate['state'] === $state && $rate['country'] === $country ) {
$tax_amount = $rate['rate'];
$tax_amount = ! empty( $rate['rate'] ) ? $rate['rate'] : 0;
}

if ( intval( $tax_amount ) === 0 && $rate['country'] === $country && 'country_wide' === $rate['state'] ) {
$tax_amount = $rate['rate'];
$tax_amount = ! empty( $rate['rate'] ) ? $rate['rate'] : 0;
}
}

Expand Down
Loading

0 comments on commit 62c2870

Please sign in to comment.