84% anti-brute-force-login-fraud-detector

Code Review | Anti-Brute Force, Login Fraud Detector Wordpress plugin

WordPress plugin Anti-Brute Force, Login Fraud Detector Wordpress plugin scored84%from 54 tests.

About plugin

  • Plugin page: anti-brute-force-...
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.2
  • WordPress version: 6.3.1
  • First release: Apr 28, 2023
  • Latest release: Jul 19, 2023
  • Number of updates: 27
  • Update frequency: every 3.0 days
  • Top authors: aispera31 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /443 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.27MB] [CPU: ▼1.26ms] Passed 4 tests

This is a short check of server-side resources used by Anti-Brute Force, Login Fraud Detector Wordpress plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2639.03 ▼8.28
Dashboard /wp-admin3.57 ▲0.2750.83 ▼2.75
Posts /wp-admin/edit.php3.68 ▲0.3354.28 ▲2.17
Add New Post /wp-admin/post-new.php6.17 ▲0.2898.20 ▲3.84
Media Library /wp-admin/upload.php3.49 ▲0.2741.95 ▲4.32

Server storage [IO: ▲0.89MB] [DB: ▲0.00MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 21 new files
Database: 1 new table, 6 new options
New tables
wp_criminalip
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Anti-Brute Force, Login Fraud Detector Wordpress plugin
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5813.74 ▼0.971.91 ▲0.2239.33 ▼6.34
Dashboard /wp-admin2,213 ▲365.76 ▲0.1594.17 ▼1.4376.11 ▲33.28
Posts /wp-admin/edit.php2,130 ▲272.73 ▲0.7843.79 ▲3.9536.08 ▼0.54
Add New Post /wp-admin/post-new.php1,554 ▲2623.54 ▲0.53627.45 ▼53.8133.24 ▼21.49
Media Library /wp-admin/upload.php1,421 ▲245.26 ▲1.06108.33 ▼0.6688.35 ▲42.27

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/screen.php): failed to open stream: No such file or directory in wp-content/plugins/anti-brute-force-login-fraud-detector/admin/partials/wp-list-table.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/anti-brute-force-login-fraud-detector/index.php:47
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/anti-brute-force-login-fraud-detector/admin/partials/wp-list-table.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/screen.php' (include_path='.:/usr/share/php') in wp-content/plugins/anti-brute-force-login-fraud-detector/admin/partials/wp-list-table.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
7 plugin tags: brute force protection, login security, anti-brute force, limit login, security...

anti-brute-force-login-fraud-detector/index.php 85% from 13 tests

Analyzing the main PHP file in "Anti-Brute Force, Login Fraud Detector Wordpress plugin" version 1.0.3
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 446 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("anti-brute-force-login-fraud-detector.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin1,580 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP3167181,031
PO File3191306541
JavaScript30295
SVG1003

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity9.00
▷ Minimum class complexity1.00
▷ Maximum class complexity21.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods12
▷ Static methods325.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions24
▷ Named functions24100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.20MB with 0.11MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icon.png8.66KB4.28KB▼ 50.56%
images/logout.png1.95KB0.94KB▼ 52.02%
images/banner.png185.32KB63.38KB▼ 65.80%
images/logo.png5.94KB2.95KB▼ 50.41%