Initial Commit

This commit is contained in:
David Stone
2024-11-30 18:24:12 -07:00
commit e8f7955c1c
5432 changed files with 1397750 additions and 0 deletions

View File

@ -0,0 +1,110 @@
<?php
/**
* Host integrations activation view.
*
* @since 2.0.0
*/
?>
<h1>
<?php printf(__('Activate %s Integration', 'wp-ultimo'), $integration->get_title()); ?>
</h1>
<p class="wu-text-lg wu-text-gray-600 wu-my-4">
<?php echo $integration->get_description(); ?>
</p>
<div class="wu-bg-white wu-p-4 wu--mx-6">
<div class="wu-flex wu-justify-center">
<div class="wu-flex wu-content-center">
<img style="width: 150px;" class="wu-self-center" src="<?php echo wu_get_network_logo(); ?>">
</div>
<div class="wu-text-2xl wu-self-center wu-m-8">&rarr;</div>
<div class="wu-flex wu-content-center">
<img style="width: 150px;" class="wu-self-center" src="<?php echo esc_url($integration->get_logo()); ?>">
</div>
</div>
<div>
<span class="wu-text-sm wu-text-gray-800 wu-inline-block wu-py-4">
<?php _e('This integration will:', 'wp-ultimo'); ?>
</span>
<ul class="wu--mx-5 wu-my-0 wu-border-t wu-border-solid wu-border-l-0 wu-border-r-0 wu-border-b-0 wu-border-gray-300">
<?php foreach ($will as $line) : ?>
<li class="wu-flex wu-content-center wu-py-2 wu-px-4 wu-bg-gray-100 wu-border-t-0 wu-border-solid wu-border-l-0 wu-border-r-0 wu-border-b wu-border-gray-300 wu-m-0">
<span class="dashicons dashicons-yes-alt wu-text-green-400 wu-self-center wu-mr-2"></span>
<span><?php echo $line; ?></span>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php if (!empty($will_not)) : ?>
<div>
<span class="wu-text-sm wu-text-gray-800 wu-inline-block wu-py-4">
<?php _e('This integration will <strong>not</strong>:', 'wp-ultimo'); ?>
</span>
<ul class="wu--mx-5 wu-my-0 wu-border-t wu-border-solid wu-border-l-0 wu-border-r-0 wu-border-b-0 wu-border-gray-300">
<?php foreach ($will_not as $line) : ?>
<li class="wu-flex wu-content-center wu-py-2 wu-px-4 wu-bg-gray-100 wu-border-t-0 wu-border-solid wu-border-l-0 wu-border-r-0 wu-border-b wu-border-gray-300 wu-m-0">
<span class="dashicons dashicons-dismiss wu-text-red-400 wu-self-center wu-mr-2"></span>
<span><?php echo $line; ?></span>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
</div>
<!-- Submit Box -->
<div class="wu-flex wu-justify-between wu-bg-gray-100 wu--m-in wu-mt-4 wu-p-4 wu-overflow-hidden wu-border-t wu-border-solid wu-border-l-0 wu-border-r-0 wu-border-b-0 wu-border-gray-300">
<a href="<?php echo esc_url(wu_network_admin_url('wp-ultimo-settings&tab=integrations')); ?>" class="wu-self-center button button-large wu-float-left"><?php _e('&larr; Cancel', 'wp-ultimo'); ?></a>
<span class="wu-self-center wu-content-center wu-flex">
<?php if ($integration->is_enabled()) : ?>
<span class="wu-self-center wu-text-green-800 wu-mr-4">
<?php _e('Integration already activated.', 'wp-ultimo'); ?>
</span>
<?php endif; ?>
<button name="submit" value="1" class="button button-primary button-large">
<?php echo $integration->is_enabled() ? __('Deactivate', 'wp-ultimo') : __('Activate', 'wp-ultimo'); ?>
</button>
&nbsp;
<?php if ($integration->is_enabled()) : ?>
<a href="<?php echo esc_attr($page->get_next_section_link()); ?>" class="button button-large">
<?php _e('Continue', 'wp-ultimo'); ?>
</a>
<?php endif; ?>
</span>
</div>
<!-- End Submit Box -->

View File

@ -0,0 +1,69 @@
<?php
/**
* Runcloud instructions view.
*
* @since 2.0.0
*/
?>
<h1>
<?php _e('Instructions', 'wp-ultimo'); ?></h1>
<p class="wu-text-lg wu-text-gray-600 wu-my-4 wu-mb-6">
<?php _e('Youll need to get your', 'wp-ultimo'); ?> <strong><?php _e('API Key', 'wp-ultimo'); ?></strong> <?php _e('and', 'wp-ultimo'); ?> <strong><?php _e('Zone ID', 'wp-ultimo'); ?></strong> <?php _e('for your Cloudflare DNS zone.', 'wp-ultimo'); ?>
</p>
<p class="wu-text-sm wu-bg-blue-100 wu-p-4 wu-text-blue-600 wu-rounded">
<strong><?php _e('Before we start...', 'wp-ultimo'); ?></strong><br>
<?php printf(__('This integration is really aimed at people that do not have access to an Enterprise Cloudflare account, since that particular tier supports proxying on wildcard DNS entries, which makes adding each subdomain unecessary. If you own an enterprise tier account, you can simply follow <a class="wu-no-underline" href="%s" target="_blank">this tutorial</a> to create the wildcard entry and deactivate this integration entirely.', 'wp-ultimo'), 'https://support.cloudflare.com/hc/en-us/articles/200169356-How-do-I-use-WordPress-Multi-Site-WPMU-With-Cloudflare'); ?>
</p>
<h3 class="wu-m-0 wu-py-4 wu-text-lg" id="step-1-getting-the-api-key-and-secret">
<?php _e('Getting the Zone ID and API Key', 'wp-ultimo'); ?>
</h3>
<p class="wu-text-sm">
<?php _e('On the Cloudflare overview page of your Zone (the domain managed), you\'ll see a block on the sidebar containing the Zone ID. Copy that value.', 'wp-ultimo'); ?>
</p>
<div class="">
<img class="wu-w-full" src="https://wpultimo.com/wp-content/uploads/2021/04/Captura-de-Pantalla-2021-04-01-a-las-23.08.14.png">
</div>
<p class="wu-text-center"><i><?php _e('DNS Zone ID on the Sidebar', 'wp-ultimo'); ?></i></p>
<p class="wu-text-sm"><?php _e('On that same sidebar block, you will see the Get your API token link. Click on it to go to the token generation screen.', 'wp-ultimo'); ?></p>
<div class="">
<img class="wu-w-full" src="https://wpultimo.com/wp-content/uploads/2021/04/Captura-de-Pantalla-2021-04-01-a-las-23.12.19.png">
</div>
<p class="wu-text-center"><i><?php _e('Go to the API Tokens tab, then click on Create Token', 'wp-ultimo'); ?></i></p>
<p class="wu-text-sm"><?php _e('We want an API token that will allow us to edit DNS records, so select the Edit zone DNS template.', 'wp-ultimo'); ?></p>
<div class="">
<img class="wu-w-full" src="https://wpultimo.com/wp-content/uploads/2021/04/Captura-de-Pantalla-2021-04-01-a-las-23.15.03.png">
</div>
<p class="wu-text-center"><i><?php _e('Use the Edit Zone DNS template', 'wp-ultimo'); ?></i></p>
<p class="wu-text-sm"><?php _e('On the next screen, set the permissions to Edit, and select the zone that corresponds to your target domain. Then, move to the next step.', 'wp-ultimo'); ?></p>
<div class="">
<img class="wu-w-full" src="https://wpultimo.com/wp-content/uploads/2021/04/Captura-de-Pantalla-2021-04-01-a-las-23.17.58.png">
</div>
<p class="wu-text-center"><i><?php _e('Permission and Zone Settings', 'wp-ultimo'); ?></i></p>
<p class="wu-text-sm"><?php _e('Finally, click Create Token.', 'wp-ultimo'); ?></p>
<div class="">
<img class="wu-w-full" src="https://wpultimo.com/wp-content/uploads/2021/04/Captura-de-Pantalla-2021-04-01-a-las-23.19.52.png">
</div>
<p class="wu-text-center"><i><?php _e('Finishing up.', 'wp-ultimo'); ?></i></p>
<p class="wu-text-sm"><?php _e('Copy the API Token (it won\'t be shown again, so you need to copy it now!). We will use it on the next step alongside with the Zone ID', 'wp-ultimo'); ?></p>
<div class="">
<img class="wu-w-full" src="https://wpultimo.com/wp-content/uploads/2021/04/Captura-de-Pantalla-2021-04-01-a-las-23.21.47.png">
</div>
<p class="wu-text-center"><i><?php _e('Done!', 'wp-ultimo'); ?></i></p>

View File

@ -0,0 +1,35 @@
<?php
/**
* Cloudways instructions view.
*
* @since 2.0.0
*/
?>
<article id="fullArticle">
<h1 id="step-1-getting-a-cloudways-api-key" class="intercom-align-left" data-post-processed="true">Step 1: Getting a Cloudways API Key</h1>
<p class="intercom-align-left">Follow the steps 1 and 2 of the official Cloudways tutorial to obtain an API key for your account (<a href="http://support.cloudways.com/how-to-use-the-cloudways-api/" rel="nofollow noopener noreferrer" target="_blank">Read the tutorial</a>). <b>Copy the API Key as we will need it in the following steps.</b></p>
<h1 id="step-2-get-the-server-id" class="intercom-align-left" data-post-processed="true">Step 2: Get the Server ID</h1>
<p class="intercom-align-left">The next piece of information we will need is the <b>server ID</b> of the server hosting your WordPress install on Cloudways. To discover the server ID, visit the <b>Server Management </b>screen of the server. The server ID will be present on the URL of that page after the “/server/” portion of it.</p>
<div class="intercom-container intercom-align-left">
<a href="https://s3.amazonaws.com/helpscout.net/docs/assets/6017c85715d41b7c717cdcf9/images/602125ca1f25b9041bebc76b/602125c8fb34b55df443e494-CSCslOPtZ-Capto_Capture-2018-04-20_14-38-46_.png" rel="nofollow noopener noreferrer" target="_blank"><img class="wu-w-full" src="//d33v4339jhl8k0.cloudfront.net/docs/assets/6017c85715d41b7c717cdcf9/images/602125ca1f25b9041bebc76b/602125c8fb34b55df443e494-CSCslOPtZ-Capto_Capture-2018-04-20_14-38-46_.png"></a>
</div>
<p class="intercom-align-center"><i>The URL takes the form of </i><i>https://platform.cloudways.com/server/</i><i></i><b><i>SERVER_ID_HERE</i></b><i>/access_detail</i></p>
<h1 id="step-3-get-the-app-id" class="intercom-align-left" data-post-processed="true">Step 3: Get the App ID</h1>
<p class="intercom-align-left">Well need to do a similar thing to obtain the App ID for your WordPress installation. Go to Application Management screen of your WordPress app and the App ID will be present on the URL, after the “/apps/” portion of it.</p>
<div class="intercom-container intercom-align-left">
<a href="https://s3.amazonaws.com/helpscout.net/docs/assets/6017c85715d41b7c717cdcf9/images/602125cb6867724dfc6f0a37/602125c8fb34b55df443e494-5FWGW2RK2-Capto_Capture-2018-04-20_14-56-24_.png" rel="nofollow noopener noreferrer" target="_blank"><img class="wu-w-full" src="//d33v4339jhl8k0.cloudfront.net/docs/assets/6017c85715d41b7c717cdcf9/images/602125cb6867724dfc6f0a37/602125c8fb34b55df443e494-5FWGW2RK2-Capto_Capture-2018-04-20_14-56-24_.png"></a>
</div>
<p class="intercom-align-center"><i>The same thing happens here: the URL takes the form of </i><i>https://platform.cloudways.com/apps/</i><i></i><b><i>YOUR_APP_ID_HERE</i></b><i>/access_detail</i></p>
<h1 id="since-161--additional-step--extra-domains" class="intercom-align-left" data-post-processed="true">Additional Step Extra Domains</h1>
<p class="intercom-align-left">The Cloudways API is a bit strange in that it doesnt offer a way to add or remove just one domain, only a way to update the whole domain list. That means that WP Ultimo <b>will replace all domains</b> you might have there with the list of mapped domains of the network every time a new domain is added.</p>
<p class="intercom-align-left">If there are domains you want to keep on the list, use the <b>WU_CLOUDWAYS_EXTRA_DOMAINS</b> as demonstrated below, with a comma-separated list of the domains you wanna keep (this is useful if you need a wildcard setting, for example, that needs to be on that list at all times).</p>
<pre class="wu-overflow-auto wu-p-4 wu-m-0 wu-mt-2 wu-rounded wu-content-center wu-bg-gray-800 wu-text-white wu-font-mono wu-border wu-border-solid wu-border-gray-300 wu-max-h-screen wu-overflow-y-auto">define('WU_CLOUDWAYS_EXTRA_DOMAINS', '*.yourdomain.com,extradomain1.com,extradomain2.com');</pre>
<p class="intercom-align-left">Heres how it should look on your wp-config.php (fake values used below):</p>
<div class="intercom-container intercom-align-left">
<a href="https://s3.amazonaws.com/helpscout.net/docs/assets/6017c85715d41b7c717cdcf9/images/602125ccfb34b55df443e495/602125c8fb34b55df443e494-meGSy675Z-Screen-Shot-2018-04-23-at-21.34.56.png" rel="nofollow noopener noreferrer" target="_blank"><img class="wu-w-full" src="//d33v4339jhl8k0.cloudfront.net/docs/assets/6017c85715d41b7c717cdcf9/images/602125ccfb34b55df443e495/602125c8fb34b55df443e494-meGSy675Z-Screen-Shot-2018-04-23-at-21.34.56.png"></a>
</div>
<p class="intercom-align-center"><i>Youre all set!</i></p>
<p class="intercom-align-left">Now, every time a new domain is mapped in the network (via the Aliases tab by the network admin or via the custom domain meta-box on the users Account page) will be added to the Cloudways platform automatically.</p>
<p class="intercom-align-left">The same is true for domain removals. Every time a domain is deleted from the network, that change will be communicated to your Cloudways account instantly!</p>
</article>

View File

@ -0,0 +1,56 @@
<?php
/**
* Host integrations configuration results view.
*
* @since 2.0.0
*/
?>
<h1>
<?php _e('We are almost there!', 'wp-ultimo'); ?>
</h1>
<p class="wu-text-lg wu-text-gray-600 wu-my-4">
<?php _e('You should have all the information we need in hand right now. The next step is to configure it.', 'wp-ultimo'); ?>
</p>
<div class="wu-mt-6">
<?php if (!$integration->is_enabled()) : ?>
<li class="wu-flex wu-rounded wu-content-center wu-py-2 wu-px-4 wu-bg-gray-100 wu-border wu-border-solid wu-border-gray-300 wu-m-0">
<span class="dashicons dashicons-yes-alt wu-text-green-400 wu-self-center wu-mr-2"></span>
<span>
<?php _e('All set! We have made all the adjustments to and the Integration should work.', 'wp-ultimo'); ?>
</span>
</li>
<?php else : ?>
<li class="wu-flex wu-rounded wu-content-center wu-py-2 wu-px-4 wu-bg-gray-100 wu-border wu-border-solid wu-border-gray-300 wu-m-0">
<span><?php _e('You will need to edit your wp-config.php file manually. Copy the contents of the box below and paste it on your wp-config.php file, right before the line containing <code>/* That\'s all, stop editing! Happy publishing. */</code>', 'wp-ultimo') ; ?></span>
</li>
<h3 class="wu-mt-6"><?php _e('Your wp-config.php settings:', 'wp-ultimo'); ?></h3>
<pre class="wu-overflow-auto wu-p-4 wu-rounded wu-content-center wu-bg-gray-800 wu-text-white wu-font-mono wu-border wu-border-solid wu-border-gray-300"><?php echo $integration->get_constants_string($post); ?></pre>
<?php endif; ?>
</div>
<!-- Submit Box -->
<div class="wu-flex wu-justify-between wu-bg-gray-100 wu--m-in wu-mt-4 wu-p-4 wu-overflow-hidden wu-border-t wu-border-solid wu-border-l-0 wu-border-r-0 wu-border-b-0 wu-border-gray-300">
<a href="<?php echo esc_url(wu_network_admin_url('wp-ultimo-settings&tab=integrations')); ?>" class="wu-self-center button button-large wu-float-left"><?php _e('&larr; Cancel', 'wp-ultimo'); ?></a>
<span class="wu-self-center wu-content-center wu-flex">
<button name="submit" value="3" class="wu-ml-2 button button-primary button-large">
<?php _e('Test Integration &rarr;', 'wp-ultimo') ; ?>
</button>
</span>
</div>
<!-- End Submit Box -->

View File

@ -0,0 +1,53 @@
<?php
/**
* Host integrations configuration view.
*
* @since 2.0.0
*/
?>
<h1>
<?php _e('We are almost there!', 'wp-ultimo'); ?>
</h1>
<p class="wu-text-lg wu-text-gray-600 wu-my-4">
<?php _e('You should have all the information we need in hand right now. The next step is to configure it.', 'wp-ultimo'); ?>
</p>
<div class="wu-mt-6 wu--mx-4">
<?php
/**
* Renders the form.
*/
$form->render();
?>
</div>
<!-- Submit Box -->
<div class="wu-flex wu-justify-between wu-bg-gray-100 wu--m-in wu-mt-4 wu-p-4 wu-overflow-hidden wu-border-t wu-border-solid wu-border-l-0 wu-border-r-0 wu-border-b-0 wu-border-gray-300">
<a
href="<?php echo esc_url(wu_network_admin_url('wp-ultimo-settings', array('tab' => 'integrations'))); ?>"
class="wu-self-center button button-large wu-float-left"
>
<?php _e('&larr; Cancel', 'wp-ultimo'); ?>
</a>
<span class="wu-self-center wu-content-center">
<button name="submit" value="0" class="button button-large">
<?php _e('Add manually', 'wp-ultimo') ; ?>
</button>
<button name="submit" value="1" class="wu-ml-2 button button-primary button-large">
<?php _e('Add automatically', 'wp-ultimo') ; ?>
</button>
</span>
</div>
<!-- End Submit Box -->

View File

@ -0,0 +1,32 @@
<?php
/**
* Gridpane instructions view.
*
* @since 2.0.0
*/
?>
<h1><?php _e('Instructions', 'wp-ultimo'); ?></h1>
<p class="wu-text-lg wu-text-gray-600 wu-my-4 wu-mb-6"><?php _e('Setting up GridPane with WP Ultimo is as easy as toggling a switch', 'wp-ultimo'); ?>!</p>
<p class="wu-text-sm">
<?php _e('On the GridPane panel, go to', 'wp-ultimo'); ?> <a class="wu-no-underline" href="https://my.gridpane.com/sites" target="_blank"><?php _e('Sites', 'wp-ultimo'); ?></a>. <?php _e('Click on your network site to bring up the options modal', 'wp-ultimo'); ?>.
</p>
<div class="">
<img class="wu-w-full" src="<?php echo wu_get_asset('gridpane-1.png', 'img/hosts'); ?>">
</div>
<p class="wu-text-sm">
<?php _e('Go to the', 'wp-ultimo'); ?> <strong><?php _e('Multisite', 'wp-ultimo'); ?></strong> <?php _e('tab and toggle the', 'wp-ultimo'); ?> <strong><?php _e('WP Ultimo Integration', 'wp-ultimo'); ?></strong> <?php _e('switch', 'wp-ultimo'); ?>.
</p>
<div class="">
<img class="wu-w-full" src="<?php echo wu_get_asset('gridpane-2.png', 'img/hosts'); ?>">
</div>
<p class="wu-text-sm">
<?php _e("You're all set", 'wp-ultimo'); ?>!
</p>

View File

@ -0,0 +1,35 @@
<?php
/**
* Host integrations ready view.
*
* @since 2.0.0
*/
?>
<div class="wu-bg-white wu-p-4 wu--mx-6 wu-flex wu-content-center" style="height: 250px;">
<div class="wu-self-center wu-text-center wu-w-full">
<span class="dashicons dashicons-yes-alt wu-text-green-400 wu-w-auto wu-h-auto wu-text-5xl wu-mb-2"></span>
<h1>
<?php _e('That\'s it! We are ready!', 'wp-ultimo'); ?>
</h1>
<p class="wu-text-lg wu-text-gray-600 wu-my-4">
<?php printf(__('The integration with %s was correctly setup and is now ready! Now, every time a new domain is added to your platform, WP Ultimo will sync that with your application automatically.', 'wp-ultimo'), $integration->get_title()); ?>
</p>
</div>
</div>
<!-- Submit Box -->
<div class="wu-bg-gray-100 wu--m-in wu-mt-4 wu-p-4 wu-overflow-hidden wu-border-t wu-border-solid wu-border-l-0 wu-border-r-0 wu-border-b-0 wu-border-gray-300">
<span class="wu-float-right">
<a href="<?php echo esc_url(wu_network_admin_url('wp-ultimo')); ?>" class="button button-primary button-large">
<?php _e('Finish!', 'wp-ultimo'); ?>
</a>
</span>
</div>
<!-- End Submit Box -->

View File

@ -0,0 +1,51 @@
<?php
/**
* Runcloud instructions view.
*
* @since 2.0.0
*/
?>
<h1>
<?php _e('Instructions', 'wp-ultimo'); ?></h1>
<p class="wu-text-lg wu-text-gray-600 wu-my-4 wu-mb-6">
<?php _e('Youll need to get your', 'wp-ultimo'); ?> <strong><?php _e('API Key', 'wp-ultimo'); ?></strong> <?php _e('and', 'wp-ultimo'); ?> <strong><?php _e('API Secret', 'wp-ultimo'); ?></strong>, <?php _e('as well as find the', 'wp-ultimo'); ?> <strong><?php _e('Server ID', 'wp-ultimo'); ?></strong> <?php _e('and', 'wp-ultimo'); ?> <strong><?php _e('APP ID', 'wp-ultimo'); ?></strong> <?php _e('for your WordPress application', 'wp-ultimo'); ?>.
</p>
<h3 class="wu-m-0 wu-py-4 wu-text-lg" id="step-1-getting-the-api-key-and-secret">
<?php _e('Getting the API Key and API Secret', 'wp-ultimo'); ?>
</h3>
<p class="wu-text-sm">
<?php _e('On your RunCloud admin panel, click the cog icon (settings) to go to the settings page', 'wp-ultimo'); ?>.
</p>
<div class="">
<img class="wu-w-full" src="<?php echo wu_get_asset('runcloud-1.png', 'img/hosts'); ?>">
</div>
<p class="wu-text-center"><i><?php _e('Settings Page Link', 'wp-ultimo'); ?></i></p>
<p class="wu-text-sm"><?php _e('On the new page, click in the', 'wp-ultimo'); ?><b> <?php _e('API Key', 'wp-ultimo'); ?> </b> <?php _e('menu item on the left', 'wp-ultimo'); ?>.</p>
<div class="">
<img class="wu-w-full" src="<?php echo wu_get_asset('runcloud-2.png', 'img/hosts'); ?>">
</div>
<p class="wu-text-center"><i><?php _e('API Key page link', 'wp-ultimo'); ?></i></p>
<p class="wu-text-sm"> <?php _e('Copy the', 'wp-ultimo'); ?> <b> <?php _e('API Key and Secret values', 'wp-ultimo'); ?> </b>, <?php _e('we will need them in the next steps', 'wp-ultimo'); ?>. <b> <?php _e('Make sure the RunCloud API toggle is turned ON', 'wp-ultimo'); ?>, </b> <?php _e('otherwise RunCloud wont accept WP Ultimo API calls', 'wp-ultimo'); ?>.</p>
<div class="">
<img class="wu-w-full" src="<?php echo wu_get_asset('runcloud-3.png', 'img/hosts'); ?>">
</div>
<p class="wu-text-center"><i><?php _e('Copy the API Key and API Secret values', 'wp-ultimo'); ?></i></p>
<h3 class="wu-m-0 wu-py-4 wu-text-lg" id="step-1-getting-the-api-key-and-secret">
<?php _e('Getting the Server and App IDs', 'wp-ultimo'); ?>
</h3>
<p class="wu-text-sm"><?php _e('To find what are the server and app ids for your application, navigate to your web application manage page inside the RunCloud panel. Once you are there, youll be able to extract the values from the URL', 'wp-ultimo'); ?>.</p>
<div class="">
<img class="wu-w-full" src="<?php echo wu_get_asset('runcloud-4.png', 'img/hosts'); ?>">
</div>
<p class="wu-text-center"><i><?php _e('Server ID is the first one, the second one is App ID.', 'wp-ultimo'); ?></i></p>
<p class="wu-text-sm"><?php _e('Save the Server and APP id values as they will be necessary in the next step', 'wp-ultimo'); ?>.</p>

View File

@ -0,0 +1,29 @@
<?php
/**
* ServerPilot instructions view.
*
* @since 2.1.2
*/
?>
<article id="fullArticle">
<h1 id="step-1-getting-a-serverpilot-api-key" class="intercom-align-left" data-post-processed="true">Step 1: Getting the API Key and the Client ID</h1>
<p class="intercom-align-left">In Your ServerPilot admin panel, first go to the Account Settings page and navigate to the API link, there you can get the API Key and Client ID (if the API Key field is empty, click the New API Key button). <b>Paste those values somewhere as we'll need them in a later step.</b> </p>
<div class="intercom-container intercom-align-left">
<img class="wu-w-full" src="<?php echo wu_get_asset('serverpilot-1.png', 'img/hosts'); ?>">
</div>
<h1 id="step-2-get-the-server-id" class="intercom-align-left" data-post-processed="true">Step 2: Getting the App ID</h1>
<p class="intercom-align-left">Next, well need to get the App ID for your WordPress site. To find that ID, navigate to your apps manage page:</p>
<div class="intercom-container intercom-align-left">
<img class="wu-w-full" src="<?php echo wu_get_asset('serverpilot-2.png', 'img/hosts'); ?>">
</div>
<p class="intercom-align-left">Then, take a look at the URL at the top of your browser. The APP ID is the portion between the app/ and the /settings segments of the URL.</p>
<div class="intercom-container intercom-align-left">
<img class="wu-w-full" src="<?php echo wu_get_asset('serverpilot-3.png', 'img/hosts'); ?>">
</div>
<p class="intercom-align-left">After this you can proceed to the next integration step where you can paste these values in the related fields.</p>
</article>

View File

@ -0,0 +1,120 @@
<?php
/**
* Test view.
*
* @since 2.0.0
*/
?>
<h1><?php _e('Testing the Integration', 'wp-ultimo'); ?></h1>
<p class="wu-text-lg wu-text-gray-600 wu-my-4 wu-mb-6">
<?php printf(__('We will send a test API call to %s to make sure we are able to connect. This will confirm if everything we did so far have worked.', 'wp-ultimo'), $integration->get_title()); ?>
</p>
<div id="integration-test">
<div v-if="loading" class="wu-flex wu-rounded wu-content-center wu-py-2 wu-px-4 wu-bg-gray-100 wu-border wu-border-solid wu-border-gray-300 wu-m-0">
<span class="dashicons dashicons-warning wu-text-blue-400 wu-self-center wu-mr-2"></span>
<span>
<?php _e('Sending API call...', 'wp-ultimo'); ?>
</span>
</div>
<div v-cloak v-if="!loading && success" class="wu-flex wu-rounded wu-content-center wu-py-2 wu-px-4 wu-bg-gray-100 wu-border wu-border-solid wu-border-gray-300 wu-m-0">
<span class="dashicons dashicons-yes-alt wu-text-green-400 wu-self-center wu-mr-2"></span>
<span>
<?php _e('Yey! Everything seems to be working!', 'wp-ultimo'); ?>
</span>
</div>
<div v-cloak v-if="!loading && !success" class="wu-flex wu-rounded wu-content-center wu-py-2 wu-px-4 wu-bg-gray-100 wu-border wu-border-solid wu-border-gray-300 wu-m-0">
<span class="dashicons dashicons-dismiss wu-text-red-400 wu-self-center wu-mr-2"></span>
<span>
<?php _e('Something wrong happened... We might need to make some adjustments to make this work.', 'wp-ultimo'); ?>
</span>
</div>
<pre class="wu-overflow-auto wu-p-4 wu-rounded wu-content-center wu-bg-gray-800 wu-text-white wu-font-mono wu-border wu-border-solid wu-border-gray-300" v-html="results"><?php _e('Waiting for results...', 'wp-ultimo'); ?></pre>
<div v-cloak v-if="!loading && !success">
<h1><?php _e('Troubleshooting', 'wp-ultimo'); ?></h1>
<ol>
<li>
<?php _e('Go back to the <strong>Configuration</strong> step - if available - and make sure you entered all the necessary information correctly;', 'wp-ultimo'); ?>
</li>
<li>
<?php _e('If you have added the constants to your wp-config.php file manually, double check to make sure you\'ve added them to the right wp-config.php file and in the right place (just above the <code>/* That\'s all, stop editing! Happy publishing. */)', 'wp-ultimo'); ?></code>);
</li>
<li>
<?php _e('If you are sure everything is right, take a screenshot of this screen and contact support.', 'wp-ultimo'); ?>
</li>
</ol>
</div>
<!-- Submit Box -->
<div v-cloak v-if="!loading && !success" class="wu-flex wu-justify-between wu-bg-gray-100 wu--m-in wu-mt-4 wu-p-4 wu-overflow-hidden wu-border-t wu-border-solid wu-border-l-0 wu-border-r-0 wu-border-b-0 wu-border-gray-300">
<a href="<?php echo esc_url($page->get_prev_section_link()); ?>" class="wu-self-center button button-large wu-float-left">
<?php _e('&larr; Go Back', 'wp-ultimo'); ?>
</a>
</div>
<!-- End Submit Box -->
<div v-cloak v-if="!loading && success">
<?php
/**
* Default Submit box
*/
$page->render_submit_box();
?>
</div>
</div>
<script>
(function($) {
$(document).ready(function() {
new Vue({
el: "#integration-test",
data: {
success: false,
loading: false,
results: '<?php echo esc_js(__('Waiting for results...', 'wp-ultimo')); ?>',
},
mounted: function() {
var that = this;
this.loading = true;
setTimeout(() => {
$.ajax({
url: ajaxurl,
method: 'POST',
data: {
action: 'wu_test_hosting_integration',
integration: '<?php echo esc_js($integration->get_id()); ?>',
},
success: function(response) {
console.log(response);
that.loading = false;
that.success = response.success;
that.results = response.data;
}
});
}, 1000);
},
});
});
})(jQuery);
</script>