mirror of
https://github.com/mainwp/mainwp-child.git
synced 2025-09-06 11:10:43 +08:00
Merge pull request #89 from mainwp/bogdan01-cf-autofix
Apply fixes from CodeFactor
This commit is contained in:
commit
103c6080cb
1 changed files with 14 additions and 15 deletions
|
@ -9,8 +9,7 @@
|
|||
*
|
||||
* The code is used for the MainWP Wordfence Extension
|
||||
* Extension URL: https://mainwp.com/extension/wordfence/
|
||||
*
|
||||
*/
|
||||
*/
|
||||
|
||||
class MainWP_Child_Wordfence {
|
||||
public static $instance = null;
|
||||
|
@ -1792,7 +1791,7 @@ class MainWP_Child_Wordfence {
|
|||
$data['whitelistedURLParams'] = array();
|
||||
foreach ( $whitelistedURLParams as $urlParamKey => $rules ) {
|
||||
list( $path, $paramKey ) = explode( '|', $urlParamKey );
|
||||
$whitelistData = null;
|
||||
$whitelistData = null;
|
||||
foreach ( $rules as $ruleID => $whitelistedData ) {
|
||||
if ( null === $whitelistData ) {
|
||||
$whitelistData = $whitelistedData;
|
||||
|
@ -1820,7 +1819,7 @@ class MainWP_Child_Wordfence {
|
|||
}
|
||||
|
||||
$data['disabledRules'] = (array) wfWAF::getInstance()->getStorageEngine()->getConfig( 'disabledRules' );
|
||||
$lastUpdated = wfWAF::getInstance()->getStorageEngine()->getConfig( 'rulesLastUpdated' );
|
||||
$lastUpdated = wfWAF::getInstance()->getStorageEngine()->getConfig( 'rulesLastUpdated' );
|
||||
if ( $lastUpdated ) {
|
||||
$data['rulesLastUpdated'] = $lastUpdated;
|
||||
}
|
||||
|
@ -2357,17 +2356,17 @@ class MainWP_Child_Wordfence {
|
|||
<div id="wf-diagnostics">
|
||||
<form id="wfConfigForm" style="overflow-x: auto;">
|
||||
<?php
|
||||
foreach ( $diagnostic->getResults() as $title => $tests ) :
|
||||
$key = sanitize_key( 'wf-diagnostics-' . $title );
|
||||
$hasFailingTest = false;
|
||||
foreach ( $tests['results'] as $result ) {
|
||||
if ( ! $result['test'] ) {
|
||||
$hasFailingTest = true;
|
||||
break;
|
||||
}
|
||||
foreach ( $diagnostic->getResults() as $title => $tests ) :
|
||||
$key = sanitize_key( 'wf-diagnostics-' . $title );
|
||||
$hasFailingTest = false;
|
||||
foreach ( $tests['results'] as $result ) {
|
||||
if ( ! $result['test'] ) {
|
||||
$hasFailingTest = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $inEmail ) :
|
||||
if ( $inEmail ) :
|
||||
?>
|
||||
<table>
|
||||
<thead>
|
||||
|
@ -2403,7 +2402,7 @@ class MainWP_Child_Wordfence {
|
|||
</tbody>
|
||||
</table>
|
||||
<?php else : ?>
|
||||
<div class="wf-block <?php echo ( wfPersistenceController::shared()->isActive( $key ) ? ' wf-active' : '' ) . ( $hasFailingTest ? ' wf-diagnostic-fail' : '' ) ?>" data-persistence-key="<?php echo esc_attr( $key ); ?>">
|
||||
<div class="wf-block <?php echo ( wfPersistenceController::shared()->isActive( $key ) ? ' wf-active' : '' ) . ( $hasFailingTest ? ' wf-diagnostic-fail' : '' ); ?>" data-persistence-key="<?php echo esc_attr( $key ); ?>">
|
||||
<div class="wf-block-header">
|
||||
<div class="wf-block-header-content">
|
||||
<div class="wf-block-title">
|
||||
|
@ -2897,7 +2896,7 @@ class MainWP_Child_Wordfence {
|
|||
$q = $wfdb->querySelect( 'SHOW TABLE STATUS WHERE Name IN (' . implode( ',', $tables ) . ')' );
|
||||
if ( $q ) :
|
||||
$databaseCols = count( $q[0] );
|
||||
?>
|
||||
?>
|
||||
<div class="wf-block<?php echo( wfPersistenceController::shared()->isActive( 'wf-diagnostics-database-tables' ) ? ' wf-active' : '' ); ?>" data-persistence-key="<?php echo esc_attr( 'wf-diagnostics-database-tables' ); ?>">
|
||||
<div class="wf-block-header">
|
||||
<div class="wf-block-header-content">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue