Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
tlovett1 committed Feb 5, 2025
2 parents 808ac83 + 265830c commit 7ff294b
Show file tree
Hide file tree
Showing 6 changed files with 190 additions and 194 deletions.
4 changes: 2 additions & 2 deletions 10up-experience.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: 10up Experience
* Plugin URI: https://github.com/10up/10up-experience
* Description: The 10up Experience plugin configures WordPress to better protect and inform clients, aligned to 10up’s best practices.
* Version: 1.13.1
* Version: 1.14.0
* Author: 10up
* Author URI: https://10up.com
* License: GPLv2 or later
Expand All @@ -19,7 +19,7 @@

use YahnisElsts\PluginUpdateChecker\v5\PucFactory;

define( 'TENUP_EXPERIENCE_VERSION', '1.13.1' );
define( 'TENUP_EXPERIENCE_VERSION', '1.14.0' );
define( 'TENUP_EXPERIENCE_DIR', __DIR__ );
define( 'TENUP_EXPERIENCE_FILE', __FILE__ );

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

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

## [1.14.0] - 2025-02-05
* Configure Monitor to use new API.

## [1.13.1] - 2024-12-12
* Fix SSO bug with @10up.com emails

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Password protecting post functionality is removed both in Gutenberg and the clas

*Configured in `Settings > Writing`.*

### Support Monitor
### Monitor

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

Expand Down Expand Up @@ -102,7 +102,7 @@ There are 2 filters available here:

### Activity Log

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`.
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`.

#### Logged Actions

Expand Down
2 changes: 1 addition & 1 deletion includes/classes/SupportMonitor/ActivityLog.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Logs critical user activities inside Support Monitor
* Logs critical user activities inside Monitor
*
* @since 2.0
* @package 10up-experience
Expand Down
48 changes: 22 additions & 26 deletions includes/classes/SupportMonitor/Debug.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* 10up support monitor debugger. This can be enabled by setting the following in wp-config.php:
* 10up monitor debugger. This can be enabled by setting the following in wp-config.php:
* define( 'SUPPORT_MONITOR_DEBUG', true );
*
* @since 1.7
Expand Down Expand Up @@ -42,33 +42,33 @@ public function setup() {


/**
* Regisers the Support Monitor log link under the 'Tools' menu
* Regisers the Monitor log link under the 'Tools' menu
*
* @since 1.7
*/
public function register_menu() {

add_submenu_page(
'tools.php',
esc_html__( '10up Support Monitor Debug', 'tenup' ),
esc_html__( '10up Support Monitor Debug', 'tenup' ),
esc_html__( 'Monitor Debug', 'tenup' ),
esc_html__( 'Monitor Debug', 'tenup' ),
'manage_options',
'tenup_support_monitor',
[ $this, 'debug_screen' ]
);
}

/**
* Regisers the Support Monitor log link under the network settings
* Regisers the Monitor log link under the network settings
*
* @since 1.7
*/
public function register_network_menu() {

add_submenu_page(
'settings.php',
esc_html__( '10up Support Monitor Debug', 'tenup' ),
esc_html__( '10up Support Monitor Debug', 'tenup' ),
esc_html__( 'Monitor Debug', 'tenup' ),
esc_html__( 'Monitor Debug', 'tenup' ),
'manage_network_options',
'tenup_support_monitor',
[ $this, 'debug_screen' ]
Expand Down Expand Up @@ -137,26 +137,21 @@ public function debug_screen() {
?>

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

<p>
<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>
<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>
</p>

<?php if ( ! empty( $log ) ) : ?>
<?php foreach ( $log as $message_array ) : ?>
<?php foreach ( $message_array['messages'] as $message ) : ?>
<div>
<strong><?php echo esc_html( gmdate( 'F j, Y, g:i a', $message['time'] ) ); ?>:</strong><br>
<strong><?php esc_html_e( 'API URL:', 'tenup' ); ?></strong> <?php echo esc_html( $message_array['url'] ); ?><br>
<strong><?php esc_html_e( 'Response Code:', 'tenup' ); ?></strong> <?php echo esc_html( $message_array['messages_response'] ); ?><br>
<strong><?php esc_html_e( 'Type:', 'tenup' ); ?></strong> <?php echo esc_html( $message['type'] ); ?><br>
<strong><?php esc_html_e( 'Group:', 'tenup' ); ?></strong> <?php echo esc_html( $message['group'] ); ?><br>
<strong><?php esc_html_e( 'ID:', 'tenup' ); ?></strong> <?php echo esc_html( $message['message_id'] ); ?><br>
<pre><?php echo esc_html( wp_json_encode( $message['data'], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ) ); ?></pre>
</div>
<?php endforeach; ?>
<?php foreach ( $log as $message ) : ?>
<div>
<strong><?php echo esc_html( gmdate( 'F j, Y, g:i a', $message['time'] ) ); ?>:</strong><br>
<strong><?php esc_html_e( 'API URL:', 'tenup' ); ?></strong> <?php echo esc_html( $message['url'] ); ?><br>
<strong><?php esc_html_e( 'Response Code:', 'tenup' ); ?></strong> <?php echo esc_html( $message['message_response'] ); ?><br>
<pre><?php echo esc_html( wp_json_encode( $message['message'], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ) ); ?></pre>
</div>
<?php endforeach; ?>
<?php else : ?>
<p><?php esc_html_e( 'No messages.', 'tenup' ); ?></p>
Expand All @@ -166,15 +161,15 @@ public function debug_screen() {
}

/**
* Logs an entry if the support monitor debugger has been enabled
* Logs an entry if the monitor debugger has been enabled
*
* @param string $url - Full URL message was sent to
* @param array $messages - Array of messages
* @param array $message - Single message
* @param array $response_code - Response code
* @since 1.7
* @return void
*/
public function maybe_add_log_entry( $url, $messages, $response_code ) {
public function maybe_add_log_entry( $url, $message, $response_code ) {

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

$prepared = [
'messages' => $messages,
'messages_response' => $response_code,
'url' => $url,
'message' => $message,
'time' => time(),
'message_response' => $response_code,
'url' => $url,
];

array_unshift( $log, $prepared );
Expand Down
Loading

0 comments on commit 7ff294b

Please sign in to comment.