Skip to content

Commit

Permalink
fix the way we get the site host for the SS command (#17)
Browse files Browse the repository at this point in the history
fix the way we get the site host for the SSH command
  • Loading branch information
oskosk authored Aug 3, 2018
1 parent f329020 commit b2b992c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions companion.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Companion Plugin
Plugin URI: https://github.com/Automattic/companion
Description: Helps keep the launched WordPress in order.
Version: 1.3.0
Version: 1.3.1
Author: Osk
*/

Expand All @@ -30,14 +30,14 @@ function companion_admin_notices() {
$sysuser_option_key = 'jurassic_ninja_sysuser';
$admin_password = is_multisite() ? get_blog_option( 1, $password_option_key ) : get_option( $password_option_key );
$sysuser = is_multisite() ? get_blog_option( 1, $sysuser_option_key ) : get_option( $sysuser_option_key );
$url_without_scheme = str_replace( 'https://', '', str_replace( 'http://', '', network_site_url() ) );
$host = parse_url( network_site_url(), PHP_URL_HOST );
?>
<div class="notice notice-success is-dismissible">
<h3><?php echo esc_html__( 'Welcome to Jurassic Ninja!' ); ?></h3>
<p><strong><span id="jurassic_url"><?php echo esc_html( network_site_url() ); ?></span></strong> <?php echo esc_html__( 'will be destroyed 7 days after the last time anybody logged in.' ); ?></p>
<p>
<strong>WP user:</strong> <code><span id="jurassic_username">demo</span></code>
<strong>SSH:</strong> <code><span id="jurassic_ssh_command">ssh <?php echo esc_html( $sysuser ); ?>@<?php echo esc_html( $url_without_scheme ); ?></span></code>
<strong>SSH:</strong> <code><span id="jurassic_ssh_command">ssh <?php echo esc_html( $sysuser ); ?>@<?php echo esc_html( $host ); ?></span></code>
</p>
<p>
<strong>WP/SSH password:</strong> <code><span id="jurassic_password"><?php echo esc_html( $admin_password ); ?></span></code>
Expand Down

0 comments on commit b2b992c

Please sign in to comment.