73% wp-denyhosts

Code Review | WP-DenyHosts

WordPress plugin WP-DenyHosts scored73%from 54 tests.

About plugin

  • Plugin page: wp-denyhosts
  • Plugin version: 0.9.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.6
  • WordPress version: 6.3.1
  • First release: Apr 29, 2013
  • Latest release: Apr 30, 2013
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: pross (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /2,656 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.23ms] Passed 4 tests

This is a short check of server-side resources used by WP-DenyHosts
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0439.84 ▼0.17
Dashboard /wp-admin3.35 ▲0.0044.69 ▼14.03
Posts /wp-admin/edit.php3.40 ▲0.0447.67 ▲1.74
Add New Post /wp-admin/post-new.php5.95 ▲0.0695.01 ▼1.70
Media Library /wp-admin/upload.php3.28 ▲0.0435.20 ▼1.03
WP DenyHosts /wp-admin/options-general.php?page=wp-denyhosts3.2239.90

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP-DenyHosts
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲9914.48 ▼0.111.85 ▼0.0342.91 ▼1.97
Dashboard /wp-admin2,215 ▲305.81 ▼0.0799.17 ▼9.5037.86 ▼6.14
Posts /wp-admin/edit.php2,095 ▲62.02 ▲0.0239.38 ▼1.9534.82 ▼2.89
Add New Post /wp-admin/post-new.php1,541 ▲1323.14 ▲4.92648.17 ▲13.8054.31 ▼12.07
Media Library /wp-admin/upload.php1,400 ▲124.18 ▼0.0797.26 ▲0.8143.10 ▲0.91
WP DenyHosts /wp-admin/options-general.php?page=wp-denyhosts8462.0727.2425.79

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-denyhosts
    • > Warning in wp-content/plugins/wp-denyhosts/wp-denyhosts.php+113
    count(): Parameter must be an array or an object that implements Countable
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-denyhosts
    • > Notice in wp-content/plugins/wp-denyhosts/wp-denyhosts.php+113
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-denyhosts/wp-denyhosts.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=wp-denyhosts
    • > Javascript (severe) in unknown
    /wp-content/plugins/wp-denyhosts/js/jquery.placeholder.min.js?ver=6.3.1 10:804 Uncaught TypeError: Cannot read properties of undefined (reading 'msie')

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: login, spam, block, bruteforce

wp-denyhosts/wp-denyhosts.php Passed 13 tests

"WP-DenyHosts" version 0.9.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
35 characters long description:
Distributed anti bruteforce plugin.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin182 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP15710176
JavaScript1066

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity26.00
▷ Minimum class complexity26.00
▷ Maximum class complexity26.00
Average method complexity2.56
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/denyhosts.png32.72KB8.66KB▼ 73.55%