Skip to content

Commit

Permalink
Add selectable ssh command in notice. (#16)
Browse files Browse the repository at this point in the history
* Replace SSH user for SSH command in notice

* Bump version to 1.3.0

* fix

* Fix.

* typo
  • Loading branch information
oskosk authored Aug 3, 2018
1 parent 5af58a7 commit f329020
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 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.2.0
Version: 1.3.0
Author: Osk
*/

Expand All @@ -30,19 +30,25 @@ 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() ) );
?>
<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 user:</strong> <code><span id="jurassic_ssh_user"><?php echo esc_html( $sysuser ); ?></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>
</p>
<p>
<strong>WP/SSH password:</strong> <code><span id="jurassic_password"><?php echo esc_html( $admin_password ); ?></span></code>
<strong>SSH server path:</strong> <code><span id="jurassic_ssh_server_path"><?php echo esc_html( get_home_path() ); ?></span></code>
</p>
</div>
<style type="text/css">
#jurassic_ssh_command {
user-select: all;
}
</style>
<?php
}

Expand Down

0 comments on commit f329020

Please sign in to comment.