84% lock-bad-user

Code Review | Lock Bad User

WordPress plugin Lock Bad User scored84%from 54 tests.

About plugin

  • Plugin page: lock-bad-user
  • Plugin version: 1.1.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Aug 25, 2021
  • Latest release: Aug 2, 2023
  • Number of updates: 7
  • Update frequency: every 101.0 days
  • Top authors: nabiabdi (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /773 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

A check of server-side resources used by Lock Bad User
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0940.00 ▼0.68
Dashboard /wp-admin3.39 ▲0.0955.35 ▲8.88
Posts /wp-admin/edit.php3.50 ▲0.1547.19 ▲3.19
Add New Post /wp-admin/post-new.php5.97 ▲0.0988.52 ▼6.08
Media Library /wp-admin/upload.php3.31 ▲0.0934.25 ▲2.46

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 135 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Lock Bad User: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.30 ▼1.281.84 ▼0.4243.23 ▲0.25
Dashboard /wp-admin2,206 ▲184.87 ▼1.04106.55 ▼7.2036.18 ▼8.00
Posts /wp-admin/edit.php2,089 ▲32.03 ▲0.0539.16 ▲2.0032.67 ▼6.82
Add New Post /wp-admin/post-new.php1,514 ▼517.49 ▼5.89693.07 ▲0.7362.48 ▲3.00
Media Library /wp-admin/upload.php1,388 ▲64.19 ▼0.0393.91 ▼3.9042.34 ▲0.21

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 57× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Container\otFoundExceptionInterface' not found in wp-content/plugins/lock-bad-user/vendor/php-di/php-di/src/NotFoundException.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Invoker\\Exception\\InvocationException' not found in wp-content/plugins/lock-bad-user/vendor/php-di/invoker/src/Exception/NotEnoughParametersException.php:8
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/lock-bad-user/vendor/php-di/php-di/src/Compiler/Template.php:4
    • > PHP Fatal error
      Uncaught Error: Interface 'DI\\Definition\\Resolver\\DefinitionResolver' not found in wp-content/plugins/lock-bad-user/vendor/php-di/php-di/src/Definition/Resolver/FactoryResolver.php:26
    • > PHP Fatal error
      Uncaught Error: Interface 'DI\\Definition\\Definition' not found in wp-content/plugins/lock-bad-user/vendor/php-di/php-di/src/Definition/Reference.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Container\\ContainerInterface' not found in wp-content/plugins/lock-bad-user/vendor/php-di/php-di/src/Container.php:39
    • > PHP Fatal error
      Uncaught Error: Interface 'DI\\Definition\\Helper\\DefinitionHelper' not found in wp-content/plugins/lock-bad-user/vendor/php-di/php-di/src/Definition/Helper/FactoryDefinitionHelper.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Container\\ContainerExceptionInterface' not found in wp-content/plugins/lock-bad-user/vendor/php-di/php-di/src/DependencyException.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'DI\\Definition\\Source\\DefinitionSource' not found in wp-content/plugins/lock-bad-user/vendor/php-di/php-di/src/Definition/Source/SourceChain.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'DI\\Definition\\Definition' not found in wp-content/plugins/lock-bad-user/vendor/php-di/php-di/src/Definition/ObjectDefinition/MethodInjection.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 96% 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
10 plugin tags: lock users, iranian, ban bad users, farsi, parsi...

lock-bad-user/lock-bad-user.php 92% from 13 tests

The principal PHP file in "Lock Bad User" v. 1.1.5 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Domain Path: The domain path folder was not found ("/languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected7,692 lines of code in 129 files:
LanguageFilesBlank linesComment linesLines of code
PHP1111,5882,9576,504
Markdown123230721
JSON100302
YAML391132
XML29333

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity11.28
▷ Minimum class complexity1.00
▷ Maximum class complexity318.00
Average method complexity2.96
▷ Minimum method complexity1.00
▷ Maximum method complexity63.00
Code structure
Namespaces30
Interfaces17
Traits0
Classes83
▷ Abstract classes11.20%
▷ Concrete classes8298.80%
▷ Final classes22.44%
Methods434
▷ Static methods398.99%
▷ Public methods35882.49%
▷ Protected methods184.15%
▷ Private methods5813.36%
Functions27
▷ Named functions933.33%
▷ Anonymous functions1866.67%
Constants15
▷ Global constants640.00%
▷ Class constants960.00%
▷ Public constants777.78%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected