| 1 |
<?php |
| 2 |
/** |
| 3 |
* The view used on the Settings → Headless admin page. |
| 4 |
* |
| 5 |
* @package FaustWP |
| 6 |
*/ |
| 7 |
|
| 8 |
?> |
| 9 |
<div class="wrap"> |
| 10 |
<header> |
| 11 |
<svg class="wpengine" width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| 12 |
<path fill-rule="evenodd" clip-rule="evenodd" d="M0 2.29413L2.29411 0H9.64706V9.64707H0V2.29413ZM10.1765 0H19.8235V7.35294L17.4706 9.64707H12.4706L10.1765 7.35294V0ZM22.6471 10.1765L20.3529 12.4706V17.5294L22.6471 19.8235H30V10.1765H22.6471ZM10.1765 30H19.8235V22.6471L17.4706 20.3529H12.4706L10.1765 22.6471V30ZM30 30V22.6471L27.7059 20.3529H20.3529V30H30ZM20.3529 0V7.35294L22.6471 9.64707H30V0H20.3529ZM13.6471 15C13.6471 15.7059 14.2353 16.353 15 16.353C15.7647 16.353 16.3529 15.7647 16.3529 15C16.3529 14.2941 15.7647 13.6471 15 13.6471C14.2941 13.6471 13.6471 14.2353 13.6471 15ZM9.64706 10.1765H0V19.8235H7.29411L9.64706 17.5294V10.1765ZM7.29411 20.3529L9.64706 22.6471V27.7059L7.29411 30H0V20.3529H7.29411Z" fill="white"/> |
| 13 |
</svg> |
| 14 |
<h1><?php esc_html_e( 'FaustWP by WP Engine', 'faustwp' ); ?></h1> |
| 15 |
</header> |
| 16 |
<?php |
| 17 |
/** |
| 18 |
* Since we are just checking for the existence of the "new_activation" query param, |
| 19 |
* and not using the value, there is no real need to verify the nonce. |
| 20 |
*/ |
| 21 |
if ( |
| 22 |
! empty( $_GET['new_activation'] ) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 23 |
! get_option( 'permalink_structure' ) |
| 24 |
) : |
| 25 |
?> |
| 26 |
<div class="wp-header-end"> |
| 27 |
<div class="notice notice-warning is-dismissible" style="margin: 16px;"> |
| 28 |
<p> |
| 29 |
<?php esc_html_e( 'Permalinks are not currently configured. Choose any setting to make your headless development easier.', 'faustwp' ); ?><br /> |
| 30 |
<a href="/wp-admin/options-permalink.php"><?php esc_html_e( 'Go to Permalinks Settings', 'faustwp' ); ?></a> |
| 31 |
</p> |
| 32 |
</div> |
| 33 |
</div> |
| 34 |
<?php endif; ?> |
| 35 |
|
| 36 |
<h2 class="main"><?php esc_html_e( 'Headless Settings', 'faustwp' ); ?></h2> |
| 37 |
|
| 38 |
<div class="with-sidebar"> |
| 39 |
<div> |
| 40 |
<div class="content"> |
| 41 |
<form action="options.php" method="POST"> |
| 42 |
<?php settings_fields( 'faustwp_settings' ); ?> |
| 43 |
|
| 44 |
<?php do_settings_sections( 'faustwp-settings' ); ?> |
| 45 |
|
| 46 |
<?php submit_button(); ?> |
| 47 |
</form> |
| 48 |
</div> |
| 49 |
<div class="sidebar"> |
| 50 |
<div class="box get-started primary"> |
| 51 |
<h3><?php esc_html_e( 'Get Started With Faust.js', 'faustwp' ); ?></h3> |
| 52 |
<section> |
| 53 |
<h4><?php esc_html_e( 'Install WPGraphQL', 'faustwp' ); ?></h4> |
| 54 |
<p><a href="https://www.wpgraphql.com/docs/quick-start/" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Learn about the plugin', 'faustwp' ); ?></a>.</p> |
| 55 |
<?php if ( function_exists( 'graphql' ) ) : ?> |
| 56 |
<button class="button-primary" disabled><?php esc_html_e( '☑️ WPGraphQL is active', 'faustwp' ); ?></button> |
| 57 |
<?php else : ?> |
| 58 |
<button class="button-primary" id="faustwp-button-install-graphql" aria-label="<?php esc_html_e( 'Install and Activate the WPGraphQL plugin', 'faustwp' ); ?>"><?php esc_html_e( 'Install and Activate', 'faustwp' ); ?></button> |
| 59 |
<span class="spinner"></span> |
| 60 |
<p class="error-message"></p> |
| 61 |
<?php endif; ?> |
| 62 |
</section> |
| 63 |
<?php if ( ! get_option( 'permalink_structure' ) ) : ?> |
| 64 |
<section> |
| 65 |
<h4><?php esc_html_e( 'Enable Permalinks', 'faustwp' ); ?></h4> |
| 66 |
<p><?php esc_html_e( 'Headless is easier with pretty permalinks! If you are unsure of which option to choose, go with "Post Name".', 'faustwp' ); ?></p> |
| 67 |
<p><a href="/wp-admin/options-permalink.php"><?php esc_html_e( 'Go to Settings', 'faustwp' ); ?></a></p> |
| 68 |
</section> |
| 69 |
<?php endif; ?> |
| 70 |
<section> |
| 71 |
<h4><?php esc_html_e( 'Create Your Headless App', 'faustwp' ); ?></h4> |
| 72 |
<p><a href="https://faustjs.org/docs/next/getting-started" target="_blank" rel="noopener noreferrer">Follow our quick start guide</a>.</p> |
| 73 |
</section> |
| 74 |
</div> |
| 75 |
<div class="box docs"> |
| 76 |
<h3>Faust.js Documentation</h3> |
| 77 |
<section> |
| 78 |
<ul> |
| 79 |
<li><a href="https://faustjs.org/docs/tutorial/dev-env-setup" target="_blank" rel="noopener noreferrer">In-depth Tutorial</a></li> |
| 80 |
<li><a href="https://faustjs.org/docs/next/getting-started" target="_blank" rel="noopener noreferrer">Quick Start</a></li> |
| 81 |
<li><a href="https://faustjs.org/docs/next/guides/fetching-data" target="_blank" rel="noopener noreferrer">Fetching Data</a></li> |
| 82 |
<li><a href="https://faustjs.org/docs/next/guides/post-page-previews" target="_blank" rel="noopener noreferrer">Previews</a></li> |
| 83 |
<li><a href="https://faustjs.org/docs/next/guides/auth" target="_blank" rel="noopener noreferrer">Authentication</a></li> |
| 84 |
</ul> |
| 85 |
<p><a class="button-primary" href="https://github.com/wpengine/faustjs/" target="_blank" rel="noopener noreferrer">Faust.js on GitHub</a></p> |
| 86 |
</section> |
| 87 |
</div> |
| 88 |
</div> |
| 89 |
</div> |
| 90 |
</div> |
| 91 |
</div> |
| 92 |
|