id, 'ppl-afw' ) ) { return false; } // Keep the first run setup wizard free of distractions. // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- routing only. return ! isset( $_GET['wizard'] ); } /** * Whether the banner should render for the current user and screen. * * @since 1.1.0 * @return bool */ private function should_show() { if ( ! current_user_can( 'ppl_afw_manage_settings' ) || ! current_user_can( 'activate_plugins' ) || ! $this->on_plugin_screen() ) { return false; } $dismissed = (int) get_user_meta( get_current_user_id(), self::DISMISSED, true ); return ! ( $dismissed && ( time() - $dismissed ) < self::SNOOZE ); } /** * Enqueues the banner stylesheet on plugin screens only. * * @since 1.1.0 */ public function assets() { if ( ! $this->should_show() ) { return; } $css = PPL_AFW_DIR . 'assets/css/pro-banner.css'; wp_enqueue_style( 'ppl-afw-pro-banner', PPL_AFW_URL . 'assets/css/pro-banner.css', array(), file_exists( $css ) ? (string) filemtime( $css ) : PPL_AFW_VERSION ); } /** * Prints the banner. * * @since 1.1.0 */ public function render() { if ( ! $this->should_show() ) { return; } $dismiss = wp_nonce_url( admin_url( 'admin-post.php?action=ppl_afw_dismiss_pro_banner' ), 'ppl_afw_dismiss_pro_banner' ); $cta = add_query_arg( array( 'utm_source' => 'wp-plugin', 'utm_medium' => 'banner', 'utm_campaign' => 'affireo-affiliates-for-woocommerce', ), self::URL ); $features = array( __( 'Commission rates per product, per category, and per purchase, plus lifetime and subscription renewal commissions.', 'affireo-affiliates-for-woocommerce' ), __( 'Automatic PayPal, Stripe Connect, and bank transfer payouts on a weekly, fortnightly, or monthly schedule.', 'affireo-affiliates-for-woocommerce' ), __( 'Fraud scoring on every referral, with automatic holds and suspensions at thresholds you set.', 'affireo-affiliates-for-woocommerce' ), __( 'Coupon based tracking, performance tiers, and a multi level network up to 10 levels deep.', 'affireo-affiliates-for-woocommerce' ), ); ?>