license ) && method_exists( $wpconsent->license, 'is_active' ) && $wpconsent->license->is_active(); } /** * Whether the consent banner is switched on, which is what makes the * plugin do anything visible. * * @since 4.10.0 * * @return bool * @noinspection PhpUndefinedFunctionInspection */ public function is_configured(): bool { if ( ! $this->is_active() || ! $this->is_loaded() ) { return false; } $wpconsent = wpconsent(); if ( ! isset( $wpconsent->settings ) ) { return false; } return ! empty( $wpconsent->settings->get_option( 'enable_consent_banner', 0 ) ); } /** * The plugin's own onboarding wizard. * * @since 4.10.0 * * @return string */ public function get_setup_url(): string { return admin_url( 'admin.php?page=wpconsent-onboarding' ); } /** * Drop the onboarding redirect WPConsent arms. * * @since 4.10.0 */ public function after_activation(): void { delete_transient( 'wpconsent_onboarding_redirect' ); $activated = get_option( 'wpconsent_activated', [] ); if ( ! empty( $activated['wpconsent'] ) ) { return; } // On a first install WPConsent arms its onboarding redirect on the next // admin request, unless this record of that run is already there. The // version is the one its own first run writes, so its upgrade routines // still run afterwards. $activated['wpconsent'] = time(); $activated['version'] = '0'; update_option( 'wpconsent_activated', $activated ); } }