getSlug() ? $this : $tip; }, 10, 2 ); add_action( 'init', function () { // The plugin is already there (free or premium build) — nothing to recommend. if ( self::isAddonsPluginActive() ) { return; } add_action( 'tiered_pricing_table/admin/advance_product_options', array( $this, 'render' ) ); } ); } public function render() { if ( $this->isSeen() ) { return; } // Belt and braces: never show the tip while the plugin is active, regardless of hook timing. if ( self::isAddonsPluginActive() ) { return; } if ( current_user_can( 'install_plugins' ) ) { $installURL = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . self::WPORG_SLUG ), 'install-plugin_' . self::WPORG_SLUG ); $installLabel = __( 'Install now — free', 'tier-pricing-table' ); } else { $installURL = 'https://wordpress.org/plugins/' . self::WPORG_SLUG . '/'; $installLabel = __( 'Free on WordPress.org', 'tier-pricing-table' ); } ?>