Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide SDK random promo notice #855

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
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
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;
}
}
Loading