74% htaccess-ip-blocker

Code Review | HTACCESS IP Blocker

WordPress plugin HTACCESS IP Blocker scored74%from 54 tests.

About plugin

  • Plugin page: htaccess-ip-blocker
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.4.2
  • WordPress version: 6.3.1
  • First release: Nov 21, 2017
  • Latest release: Jul 21, 2020
  • Number of updates: 5
  • Update frequency: every 194.6 days
  • Top authors: swain.tara (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,617 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.92MB] [CPU: ▼35.56ms] Passed 4 tests

Server-side resources used by HTACCESS IP Blocker
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.76 ▼0.39
Dashboard /wp-admin3.02 ▼0.2824.55 ▼26.88
Posts /wp-admin/edit.php3.02 ▼0.3424.52 ▼24.81
Add New Post /wp-admin/post-new.php3.02 ▼2.8720.77 ▼68.37
Media Library /wp-admin/upload.php3.02 ▼0.2122.09 ▼22.16
HTACCESS IP Blocker /wp-admin/tools.php?page=ipblockersettings3.0225.09

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for HTACCESS IP Blocker
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.30 ▼1.464.15 ▲2.3141.51 ▼2.98
Dashboard /wp-admin2,204 ▲134.86 ▼0.10151.35 ▲19.4748.34 ▼4.94
Posts /wp-admin/edit.php2,096 ▲72.00 ▼0.0253.02 ▲2.0738.84 ▲3.91
Add New Post /wp-admin/post-new.php1,538 ▲122.95 ▼0.11665.93 ▲30.7762.89 ▲3.57
Media Library /wp-admin/upload.php1,386 ▼24.30 ▲0.09122.17 ▲14.8845.25 ▼5.71
HTACCESS IP Blocker /wp-admin/tools.php?page=ipblockersettings8452.0427.2028.51

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/tools.php?page=ipblockersettings
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=ipblockersettings
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+204
    Undefined offset: 0
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=ipblockersettings
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+205
    Trying to get property 'guid' of non-object
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=ipblockersettings
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+221
    Trying to get property 'ID' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=ipblockersettings
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+222
    Trying to get property 'post_title' of non-object

SRP Passed 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
Congratulations! This plugin passed the SRP test

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (screenshot-1.png) image not found
You can look at the official readme.txt

htaccess-ip-blocker/functions.php 92% from 13 tests

The primary PHP file in "HTACCESS IP Blocker" version 1.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("htaccess-ip-blocker.php" instead of "functions.php")

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
No dangerous file extensions were detected130 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP13718130

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png72.10KB31.98KB▼ 55.65%