Skip to content

Commit b8e2cd3

Browse files
committed
Protect Module: adding current user's IP to the config page
This will aid them in they want to quickly add their IP to the whitelist.
1 parent 7f610ee commit b8e2cd3

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

modules/protect.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,9 @@ public function configuration_load() {
441441
}
442442
}
443443

444-
$this->api_key = get_site_option( 'jetpack_protect_key', false );
445-
$this->whitelist = get_site_option( 'jetpack_protect_whitelist', array() );
444+
$this->api_key = get_site_option( 'jetpack_protect_key', false );
445+
$this->whitelist = get_site_option( 'jetpack_protect_whitelist', array() );
446+
$this->user_ip = $this->get_ip();
446447
}
447448

448449
public function configuration_head() {

modules/protect/config-ui.php

+1-7
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@
2525

2626
<?php else : // api key is good, show white list options ?>
2727

28-
<?php if( ! empty( $this->whitelist_error ) ) : ?>
29-
<p class="error">
30-
<?php _e( 'One or more of your IP Addresses were not valid.', 'jetpack' ); ?>
31-
</p>
32-
<?php endif; ?>
33-
3428
<div class="protect-status working">
3529
<p>
3630
<?php _e( 'Protect is set-up and running!', 'jetpack' ); ?>
@@ -130,7 +124,7 @@
130124
IPv4 and IPv6 are acceptable.
131125
</p>
132126
<p>
133-
<strong>Your current IP: [value]</strong>
127+
<strong><?php _e('Your current IP:'); ?> <?php echo $this->user_ip; ?></strong>
134128
</p>
135129
<?php wp_nonce_field( 'jetpack-protect' ); ?>
136130
<input type='hidden' name='action' value='jetpack_protect_save_whitelist' />

0 commit comments

Comments
 (0)