PluginProbe
Patchstack – WordPress & Plugins Security / 2.2.8
Patchstack – WordPress & Plugins Security v2.2.8
2.3.7 trunk 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.17 2.1.18 2.1.19 2.1.2 2.1.20 2.1.21 2.1.22 2.1.23 2.1.24 2.1.25 2.1.3 2.1.4 2.1.5 2.1.6 All 49 releases
patchstack / includes / views / pages / multisite-activation.php

multisite-activation.php in Patchstack – WordPress & Plugins Security 2.2.8, at includes/views/pages/multisite-activation.php

59 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // Do not allow the file to be called directly.
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit;
6 }
7
8 // Determine which sites need activation or not.
9 $i = 0;
10 $checkbox_list = '';
11 $activated = '';
12 $sites = get_sites();
13 foreach ( $sites as $site ) {
14 if ( get_blog_option( $site->id, 'patchstack_clientid' ) == '' ) {
15 $checkbox_list .= '<div style="margin-bottom: 10px;"><input type="checkbox" name="sites[]" id="site-' . esc_attr( $site->blog_id ) . '" value="' . esc_url( $site->siteurl ) . '"><label for="site-' . esc_attr( $site->blog_id ) . '">' . esc_url( $site->siteurl ) . '</label></div>';
16 $i++;
17 } else {
18 $activated .= esc_url( $site->siteurl ) . '<br />';
19 }
20 }
21
22 $has_token = !is_null( $this->plugin->api->get_access_token() );
23 $main_host = parse_url( get_home_url( get_main_site_id() ) );
24 $main_admin_url = get_admin_url( get_main_site_id() ) . '/options-general.php?page=patchstack&tab=license';
25 ?>
26 <div class="patchstack-font">
27 <h2 style="padding: 0;">Multisite Activation</h2>
28 <p><?php echo wp_kses( $this->plugin->multisite->error, $this->allowed_html ); ?>
29 <?php
30 if ( ! $has_token ) {
31 ?>
32 You must first manually add your WordPress network's primary site (<?php echo esc_html( $main_host['host'] ); ?>) to Patchstack before you can add the others.<br><br>You can do so by creating an account <a href="https://app.patchstack.com/register" target="_blank">here</a> and then by adding this site <a href="https://app.patchstack.com/apps/overview?add=1" target="_blank">here</a>.<br><br>Once you have obtained the API credentials, the credentials for your site <?php echo esc_html( $main_host['host'] ); ?> can be added <a href="<?php echo esc_url( $main_admin_url ); ?>">here</a>.
33 <?php
34 } else {
35 ?>
36 Select the sites on which you would like to activate the Patchstack plugin. These sites must be accessible from the public internet.<br /><br>
37 Note that these sites must be added to Patchstack as well, which you can do at <a href="https://app.patchstack.com/apps/overview?add=1" target="_blank">app.patchstack.com</a>. Keep in mind that this might affect your upcoming bill depending on your current subscription plan.<br /><br />
38 If you are an AppSumo user or have a limited amount of sites you can add, you must select the proper number of sites that can still be added to your account.</p>
39
40 <h2 style="padding: 20px 0 0 0; display: <?php echo $i > 0 ? 'block' : 'none'; ?>;">Not Activated</h2>
41 <form action="" method="POST" style="display: <?php echo $i > 0 ? 'block' : 'none'; ?>;">
42 <input type="hidden" name="patchstack_do" value="do_licenses">
43 <input type="hidden" value="<?php echo wp_create_nonce( 'patchstack-multisite-activation' ); ?>" name="PatchstackNonce">
44 <?php echo wp_kses( $checkbox_list, $this->allowed_html ); ?>
45 <input type="submit" class="button-primary" value="Activate" />
46 </form>
47
48 <?php
49 if ( $activated != '' ) {
50 ?>
51 <br />
52 <h2 style="padding: 0;">Activated</h2>
53 <?php
54 echo wp_kses( $activated, $this->allowed_html );
55 }
56 }
57 ?>
58 </div>
59