Skip to content

Commit

Permalink
Hide SDK random promo notice
Browse files Browse the repository at this point in the history
  • Loading branch information
girishpanchal30 committed Nov 14, 2024
1 parent 5dc33c3 commit be83492
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion inc/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static function instance() {

if ( null === self::$_instance ) {
add_filter( 'themeisle_sdk_products', [ __CLASS__, 'register_sdk' ] );
add_filter( 'themeisle_sdk_ran_promos', '__return_true' );
add_filter( 'themeisle_sdk_ran_promos', [ __CLASS__, 'sdk_hide_promo_notice' ] );
add_filter( 'optimole-wp_uninstall_feedback_icon', [ __CLASS__, 'change_icon' ] );
add_filter( 'optimole_wp_uninstall_feedback_after_css', [ __CLASS__, 'adds_uf_css' ] );
add_filter( 'optimole_wp_feedback_review_message', [ __CLASS__, 'change_review_message' ] );
Expand Down Expand Up @@ -246,4 +246,19 @@ public function __clone() {
public function __wakeup() {
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'optimole-wp' ), '1.0.0' );
}

/**
* Hide SDK promo notice for pro uses.
*
* @access public
*/
public static function sdk_hide_promo_notice() {
if ( self::$_instance->admin->settings->is_connected() ) {
$service_data = self::$_instance->admin->settings->get( 'service_data' );
if ( isset( $service_data['plan'] ) && 'free' !== $service_data['plan'] ) {
return false;
}
}
return true;
}
}

0 comments on commit be83492

Please sign in to comment.