78% reportattacks

Code Review | WordPress Report Brute Force Attacks and Login Protection ReportAttacks Plugins

WordPress plugin WordPress Report Brute Force Attacks and Login Protection ReportAttacks Plugins scored78%from 54 tests.

About plugin

  • Plugin page: reportattacks
  • Plugin version: 2.29
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Jul 8, 2016
  • Latest release: Aug 30, 2023
  • Number of updates: 314
  • Update frequency: every 8.3 days
  • Top authors: sminozzi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /5,850 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.09MB] [CPU: ▲6.44ms] Passed 4 tests

Analyzing server-side resources used by WordPress Report Brute Force Attacks and Login Protection ReportAttacks Plugins
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1040.35 ▼0.05
Dashboard /wp-admin3.39 ▲0.0950.46 ▲3.68
Posts /wp-admin/edit.php3.50 ▲0.1552.75 ▲9.31
Add New Post /wp-admin/post-new.php5.97 ▲0.0998.06 ▲12.82
Media Library /wp-admin/upload.php3.32 ▲0.0960.90 ▲28.60
Request API Key /wp-admin/admin.php?page=reportattacks_getapi3.2836.14
Report Attacks /wp-admin/admin.php?page=report-attacks3.2737.03
Failed Logins Table /wp-admin/admin.php?page=ra_my-custom-submenu-page3.3238.73

Server storage [IO: ▲0.49MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 42 new files
Database: 1 new table, 11 new options
New tables
wp_reportattacks_loginlog
New WordPress options
rh_was_activated
widget_theysaidso_widget
reportattacks_installed
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
reportattacks_optin
db_upgraded
bill_last_feedback
widget_recent-posts
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for WordPress Report Brute Force Attacks and Login Protection ReportAttacks Plugins
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,882 ▲14713.18 ▼1.571.69 ▼0.2936.86 ▼13.88
Dashboard /wp-admin2,263 ▲784.92 ▼0.94114.14 ▼6.4241.97 ▼3.47
Posts /wp-admin/edit.php2,145 ▲562.03 ▲0.0134.76 ▼1.1335.24 ▼1.51
Add New Post /wp-admin/post-new.php1,575 ▲4222.99 ▼0.23599.25 ▼31.9850.35 ▲0.39
Media Library /wp-admin/upload.php1,445 ▲574.22 ▲0.0398.04 ▲4.6143.75 ▲3.00
Request API Key /wp-admin/admin.php?page=reportattacks_getapi9512.0525.2930.54
Report Attacks /wp-admin/admin.php?page=report-attacks9842.1327.5828.15
Failed Logins Table /wp-admin/admin.php?page=ra_my-custom-submenu-page1,0902.0529.4329.55

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 75% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 11 options
    • db_upgraded
    • widget_recent-comments
    • rh_was_activated
    • widget_recent-posts
    • bill_last_feedback
    • reportattacks_installed
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • bill_show_warnings
    • can_compress_scripts
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/reportattacks/includes/checkup/class_bill_catch_errors.php
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined variable: notification_url in wp-content/plugins/reportattacks/includes/checkup/bill_class_diagnose.php on line 619
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/reportattacks/includes/checkup/bill_class_diagnose.php on line 4
    • > PHP Notice
      Undefined variable: plugin_text_domain in wp-content/plugins/reportattacks/includes/checkup/bill_class_diagnose.php on line 621
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/reportattacks/includes/checkup/bill_class_diagnose.php on line 4
    • > PHP Notice
      Undefined variable: notification_url2 in wp-content/plugins/reportattacks/includes/checkup/bill_class_diagnose.php on line 620
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_theme_root() in wp-content/plugins/reportattacks/includes/checkup/bill_class_diagnose.php:124
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/reportattacks/includes/feedback/feedback-last.php:5
    • > PHP Notice
      Undefined variable: plugin_slug in wp-content/plugins/reportattacks/includes/checkup/bill_class_diagnose.php on line 622
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/reportattacks/includes/checkup/bill_class_diagnose.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'reportattacksWPSettings\\Page' not found in wp-content/plugins/reportattacks/settings/options/plugin_options_tabbed.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (Control Panel), #2 (Default IP Black List)
The official readme.txt is a good inspiration

reportattacks/reportattacks.php Passed 13 tests

The primary PHP file in "WordPress Report Brute Force Attacks and Login Protection ReportAttacks Plugins" version 2.29 is used by WordPress to initiate all plugin functionality
79 characters long description:
Report login brute force attacks and improve login security. Firewall Included.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected4,626 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP216173013,554
PO File1162226478
JavaScript611833439
CSS2114155

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity12.14
▷ Minimum class complexity1.00
▷ Maximum class complexity80.00
Average method complexity3.61
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes00.00%
Methods94
▷ Static methods1010.64%
▷ Public methods8792.55%
▷ Protected methods66.38%
▷ Private methods11.06%
Functions55
▷ Named functions5294.55%
▷ Anonymous functions35.45%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
settings/images/handle.png0.21KB0.20KB▼ 5.66%
includes/checkup/bell.png1.07KB0.27KB▼ 74.45%
images/infox350.png60.29KB12.54KB▼ 79.21%
images/logo.png11.39KB3.07KB▼ 73.05%