Skip to content

Commit 265830c

Browse files
committed
Merge branch 'monitor' into develop
2 parents 59bbef0 + b110b3f commit 265830c

File tree

6 files changed

+190
-194
lines changed

6 files changed

+190
-194
lines changed

10up-experience.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: 10up Experience
44
* Plugin URI: https://github.com/10up/10up-experience
55
* Description: The 10up Experience plugin configures WordPress to better protect and inform clients, aligned to 10up’s best practices.
6-
* Version: 1.13.1
6+
* Version: 1.14.0
77
* Author: 10up
88
* Author URI: https://10up.com
99
* License: GPLv2 or later
@@ -19,7 +19,7 @@
1919

2020
use YahnisElsts\PluginUpdateChecker\v5\PucFactory;
2121

22-
define( 'TENUP_EXPERIENCE_VERSION', '1.13.1' );
22+
define( 'TENUP_EXPERIENCE_VERSION', '1.14.0' );
2323
define( 'TENUP_EXPERIENCE_DIR', __DIR__ );
2424
define( 'TENUP_EXPERIENCE_FILE', __FILE__ );
2525

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
All notable changes to this project will be documented in this file, per [the Keep a Changelog standard](http://keepachangelog.com/).
44

5+
## [1.14.0] - 2025-02-05
6+
* Configure Monitor to use new API.
7+
58
## [1.13.1] - 2024-12-12
69
* Fix SSO bug with @10up.com emails
710

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Password protecting post functionality is removed both in Gutenberg and the clas
6868

6969
*Configured in `Settings > Writing`.*
7070

71-
### Support Monitor
71+
### Monitor
7272

7373
Sends non-PII information about the website back to 10up including plugins installed, constants defined in `wp-config.php`, 10up user accounts, and more.
7474

@@ -102,7 +102,7 @@ There are 2 filters available here:
102102

103103
### Activity Log
104104

105-
The Activity Log tracks key actions taken by logged in users and stores them in Support Monitor. Note that no PII is stored. This feature can be disabled by defining `TENUP_DISABLE_ACTIVITYLOG` as `true`.
105+
The Activity Log tracks key actions taken by logged in users and stores them in Monitor. Note that no PII is stored. This feature can be disabled by defining `TENUP_DISABLE_ACTIVITYLOG` as `true`.
106106

107107
#### Logged Actions
108108

includes/classes/SupportMonitor/ActivityLog.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Logs critical user activities inside Support Monitor
3+
* Logs critical user activities inside Monitor
44
*
55
* @since 2.0
66
* @package 10up-experience

includes/classes/SupportMonitor/Debug.php

+22-26
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* 10up support monitor debugger. This can be enabled by setting the following in wp-config.php:
3+
* 10up monitor debugger. This can be enabled by setting the following in wp-config.php:
44
* define( 'SUPPORT_MONITOR_DEBUG', true );
55
*
66
* @since 1.7
@@ -42,33 +42,33 @@ public function setup() {
4242

4343

4444
/**
45-
* Regisers the Support Monitor log link under the 'Tools' menu
45+
* Regisers the Monitor log link under the 'Tools' menu
4646
*
4747
* @since 1.7
4848
*/
4949
public function register_menu() {
5050

5151
add_submenu_page(
5252
'tools.php',
53-
esc_html__( '10up Support Monitor Debug', 'tenup' ),
54-
esc_html__( '10up Support Monitor Debug', 'tenup' ),
53+
esc_html__( 'Monitor Debug', 'tenup' ),
54+
esc_html__( 'Monitor Debug', 'tenup' ),
5555
'manage_options',
5656
'tenup_support_monitor',
5757
[ $this, 'debug_screen' ]
5858
);
5959
}
6060

6161
/**
62-
* Regisers the Support Monitor log link under the network settings
62+
* Regisers the Monitor log link under the network settings
6363
*
6464
* @since 1.7
6565
*/
6666
public function register_network_menu() {
6767

6868
add_submenu_page(
6969
'settings.php',
70-
esc_html__( '10up Support Monitor Debug', 'tenup' ),
71-
esc_html__( '10up Support Monitor Debug', 'tenup' ),
70+
esc_html__( 'Monitor Debug', 'tenup' ),
71+
esc_html__( 'Monitor Debug', 'tenup' ),
7272
'manage_network_options',
7373
'tenup_support_monitor',
7474
[ $this, 'debug_screen' ]
@@ -137,26 +137,21 @@ public function debug_screen() {
137137
?>
138138

139139
<div class="wrap">
140-
<h2><?php esc_html_e( 'Support Monitor Message Log', 'tenup' ); ?></h2>
140+
<h2><?php esc_html_e( 'Monitor Message Log', 'tenup' ); ?></h2>
141141

142142
<p>
143143
<a href="<?php echo esc_url( add_query_arg( 'tenup_support_monitor_nonce', wp_create_nonce( 'tenup_sm_empty_action' ) ) ); ?>" class="button"><?php esc_html_e( 'Empty Log', 'tenup' ); ?></a>
144144
<a href="<?php echo esc_url( add_query_arg( 'tenup_support_monitor_nonce', wp_create_nonce( 'tenup_sm_test_message_action' ) ) ); ?>" class="button"><?php esc_html_e( 'Send Test Message', 'tenup' ); ?></a>
145145
</p>
146146

147147
<?php if ( ! empty( $log ) ) : ?>
148-
<?php foreach ( $log as $message_array ) : ?>
149-
<?php foreach ( $message_array['messages'] as $message ) : ?>
150-
<div>
151-
<strong><?php echo esc_html( gmdate( 'F j, Y, g:i a', $message['time'] ) ); ?>:</strong><br>
152-
<strong><?php esc_html_e( 'API URL:', 'tenup' ); ?></strong> <?php echo esc_html( $message_array['url'] ); ?><br>
153-
<strong><?php esc_html_e( 'Response Code:', 'tenup' ); ?></strong> <?php echo esc_html( $message_array['messages_response'] ); ?><br>
154-
<strong><?php esc_html_e( 'Type:', 'tenup' ); ?></strong> <?php echo esc_html( $message['type'] ); ?><br>
155-
<strong><?php esc_html_e( 'Group:', 'tenup' ); ?></strong> <?php echo esc_html( $message['group'] ); ?><br>
156-
<strong><?php esc_html_e( 'ID:', 'tenup' ); ?></strong> <?php echo esc_html( $message['message_id'] ); ?><br>
157-
<pre><?php echo esc_html( wp_json_encode( $message['data'], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ) ); ?></pre>
158-
</div>
159-
<?php endforeach; ?>
148+
<?php foreach ( $log as $message ) : ?>
149+
<div>
150+
<strong><?php echo esc_html( gmdate( 'F j, Y, g:i a', $message['time'] ) ); ?>:</strong><br>
151+
<strong><?php esc_html_e( 'API URL:', 'tenup' ); ?></strong> <?php echo esc_html( $message['url'] ); ?><br>
152+
<strong><?php esc_html_e( 'Response Code:', 'tenup' ); ?></strong> <?php echo esc_html( $message['message_response'] ); ?><br>
153+
<pre><?php echo esc_html( wp_json_encode( $message['message'], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ) ); ?></pre>
154+
</div>
160155
<?php endforeach; ?>
161156
<?php else : ?>
162157
<p><?php esc_html_e( 'No messages.', 'tenup' ); ?></p>
@@ -166,15 +161,15 @@ public function debug_screen() {
166161
}
167162

168163
/**
169-
* Logs an entry if the support monitor debugger has been enabled
164+
* Logs an entry if the monitor debugger has been enabled
170165
*
171166
* @param string $url - Full URL message was sent to
172-
* @param array $messages - Array of messages
167+
* @param array $message - Single message
173168
* @param array $response_code - Response code
174169
* @since 1.7
175170
* @return void
176171
*/
177-
public function maybe_add_log_entry( $url, $messages, $response_code ) {
172+
public function maybe_add_log_entry( $url, $message, $response_code ) {
178173

179174
if ( ! $this->is_debug_enabled() ) {
180175
return;
@@ -187,9 +182,10 @@ public function maybe_add_log_entry( $url, $messages, $response_code ) {
187182
}
188183

189184
$prepared = [
190-
'messages' => $messages,
191-
'messages_response' => $response_code,
192-
'url' => $url,
185+
'message' => $message,
186+
'time' => time(),
187+
'message_response' => $response_code,
188+
'url' => $url,
193189
];
194190

195191
array_unshift( $log, $prepared );

0 commit comments

Comments
 (0)