settings = $settings; $this->diagnostics = $diagnostics; $this->compatibility = $compatibility; } /** * Data the admin app boots with. * * @return array */ public function app_data() { return array( 'ajaxUrl' => admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce( QuicklyFly_Admin_Ajax::NONCE_ACTION ), 'version' => QUICKLYFLY_VERSION, 'logoUrl' => QUICKLYFLY_URL . 'assets/images/quicklyfly-logo.png', 'pro' => QuicklyFly_License::is_pro(), 'upgradeUrl' => QuicklyFly_License::upgrade_page_url(), 'plansUrl' => QUICKLYFLY_UPGRADE_URL, 'embed' => QuicklyFly_License::embedded_screens(), 'proFeatures' => QuicklyFly_License::pro_features(), 'homeUrl' => home_url( '/' ), 'settings' => $this->settings->get_all(), 'defaults' => $this->settings->defaults(), 'schema' => $this->settings->public_schema(), 'integrations' => $this->compatibility->status(), 'environment' => $this->diagnostics->environment(), 'health' => $this->diagnostics->health_checks(), 'log' => $this->diagnostics->get_log(), ); } /** * Render. * * @return void */ public function render() { if ( ! current_user_can( QuicklyFly_Admin_Ajax::CAPABILITY ) ) { return; } // Freemius screens shown inside the settings tabs when the SDK has not registered their own menu pages yet. // phpcs:ignore WordPress.Security.NonceVerification.Recommended $screen = isset( $_GET['quicklyfly_screen'] ) ? sanitize_key( wp_unslash( $_GET['quicklyfly_screen'] ) ) : ''; if ( $screen && QuicklyFly_License::render_screen( $screen ) ) { return; } // The licence form (printed by the Freemius SDK after this page) replaces the settings on the Account page. if ( QuicklyFly_License::fs_ready() && isset( $_GET['quicklyfly_account'] ) && ! QuicklyFly_License::is_connected() ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended QuicklyFly_License::render_connect_form(); return; } include QUICKLYFLY_DIR . 'admin/views/app.php'; } }