Skip to content

Commit

Permalink
make code uglier for checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
diosmosis committed Nov 1, 2023
1 parent 9d3639d commit c36c142
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion classes/WpMatomo/Admin/SystemReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public function errors_present() {
$cache_key = 'matomo_system_report_has_errors';
$cache_value = get_transient( $cache_key );

if ( $cache_value === false ) {
if ( false === $cache_value ) {
// pre-record that there were no errors found. in case the system report fails to execute, this will
// allow the rest of Matomo for WordPress to continue to still be usable.
set_transient( $cache_key, 0, WEEK_IN_SECONDS );
Expand Down
11 changes: 6 additions & 5 deletions classes/WpMatomo/ErrorNotice.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ public function check_errors() {
if ( isset( $_GET['page'] ) && substr( sanitize_text_field( wp_unslash( $_GET['page'] ) ), 0, 7 ) === 'matomo-' ) {
$system_report = new \WpMatomo\Admin\SystemReport( $this->settings );
if ( ! get_user_meta( get_current_user_id(), self::OPTION_NAME_SYSTEM_REPORT_ERRORS_DISMISSED ) && $system_report->errors_present() ) {
$message = 'There are some errors in the %sMatomo Diagnostics System report%s that may prevent the plugin for working normally.';
$link_start = '<a href="' . esc_url( admin_url( 'admin.php?page=matomo-systemreport' ) ) . '">';
$link_end = '</a>';

echo '<div class="notice notice-warning is-dismissible" id="matomo-systemreporterrors"><p>'
. sprintf( esc_html__( $message, 'matomo' ), $link_start, $link_end ) . '</p></div>';
. sprintf(
esc_html__( 'There are some errors in the %1$sMatomo Diagnostics System report%2$s that may prevent the plugin for working normally.', 'matomo' ),
'<a href="' . esc_url( admin_url( 'admin.php?page=matomo-systemreport' ) ) . '">',
'</a>'
)
. '</p></div>';
}
}
}
Expand Down

0 comments on commit c36c142

Please sign in to comment.