Skip to content

Commit

Permalink
Merge pull request #923 from matomo-org/ninja-firewall-warning-tweak
Browse files Browse the repository at this point in the history
show ninja firewall warning as a row in the system report
  • Loading branch information
diosmosis authored Nov 1, 2023
2 parents 133d921 + f5b5af8 commit 8b72e08
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions classes/WpMatomo/Admin/SystemReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -1757,11 +1757,17 @@ private function get_plugins_info() {

$plugins = get_plugins();

foreach ( $plugins as $plugin ) {
foreach ( $plugins as $plugin_file => $plugin ) {
$comment = '';
if ( ! empty( $plugin['Network'] ) ) {
$comment = esc_html__( 'Network enabled', 'matomo' );
}

if ( strpos( $plugin_file, 'ninjafirewall/' ) === 0 ) {
$comment .= '<br/><br/>' . esc_html__( 'We noticed you are using Matomo with Ninja Firewall. This can result in Matomo cache file changes showing up in Ninja Firewall which likely undesired.', 'matomo' ) . '
<a href="https://matomo.org/faq/wordpress/how-do-i-prevent-matomo-cache-file-changes-to-show-up-in-ninja-firewall/" rel="noreferrer noopener" target="_blank">' . esc_html__( 'Read our FAQ to learn how to prevent these entries.', 'matomo' ) . '</a>';
}

$rows[] = [
'name' => $plugin['Name'],
'value' => $plugin['Version'],
Expand Down Expand Up @@ -1823,14 +1829,6 @@ function ( $plugin_with_version ) {
];
}
}

if ( in_array( 'ninjafirewall', $active_plugins, true ) ) {
echo '<div class="notice notice-warning">
<p><strong>' . esc_html__( 'We noticed you are using Matomo with Ninja Firewall.', 'matomo' ) . '</strong> ' . esc_html__( 'This can result in Matomo cache file changes showing up in Ninja Firewall which likely undesired.', 'matomo' ) . '
<a href="https://matomo.org/faq/wordpress/how-do-i-prevent-matomo-cache-file-changes-to-show-up-in-ninja-firewall/" rel="noreferrer noopener" target="_blank">' . esc_html__( 'Read our FAQ to learn how to prevent these entries.', 'matomo' ) . '</a>
</p>
</div>';
}
}

$rows[] = [
Expand Down

0 comments on commit 8b72e08

Please sign in to comment.