89% tor-blocker-by-inazo

Code Review | Tor Blocker by Inazo

WordPress plugin Tor Blocker by Inazo scored89%from 54 tests.

About plugin

  • Plugin page: tor-blocker-by-inazo
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.1-4.9.1
  • WordPress version: 6.3.1
  • First release: Jan 6, 2017
  • Latest release: Dec 15, 2017
  • Number of updates: 7
  • Update frequency: every 48.6 days
  • Top authors: inazo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,202 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.11MB] [CPU: ▼0.41ms] Passed 4 tests

Server-side resources used by Tor Blocker by Inazo
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1137.61 ▼6.78
Dashboard /wp-admin3.42 ▲0.1151.97 ▼4.03
Posts /wp-admin/edit.php3.53 ▲0.1756.96 ▲6.73
Add New Post /wp-admin/post-new.php6.00 ▲0.11101.97 ▲4.63
Media Library /wp-admin/upload.php3.34 ▲0.1141.09 ▲4.55

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 89 new files
Database: 1 new table, 7 new options
New tables
wp_inazo_tor_logs
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
inazo.real.tor.blocker_db_version

Browser metrics Passed 4 tests

A check of browser resources used by Tor Blocker by Inazo
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.18 ▼1.204.43 ▲2.3237.95 ▼5.75
Dashboard /wp-admin2,206 ▲184.88 ▼0.02109.43 ▼9.9642.15 ▼6.84
Posts /wp-admin/edit.php2,092 ▲32.00 ▼0.0240.29 ▲3.1034.81 ▼1.47
Add New Post /wp-admin/post-new.php1,514 ▼517.59 ▼5.83657.12 ▲11.7962.20 ▲8.63
Media Library /wp-admin/upload.php1,391 ▲34.24 ▼0.02101.16 ▼2.2444.03 ▼1.37

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === tor-blocker-by-inazo === )
The official readme.txt is a good inspiration

tor-blocker-by-inazo/inazo.real.tor.blocker.php 92% from 13 tests

This is the main PHP file of "Tor Blocker by Inazo" version 1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("tor-blocker-by-inazo.php" instead of "inazo.real.tor.blocker.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
Everything looks great! No dangerous files found in this plugin7,085 lines of code in 87 files:
LanguageFilesBlank linesComment linesLines of code
PHP842,55111,6146,534
XML110499
JSON10027
Markdown115025

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity9.25
▷ Minimum class complexity1.00
▷ Maximum class complexity104.00
Average method complexity3.12
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes81
▷ Abstract classes22.47%
▷ Concrete classes7997.53%
▷ Final classes00.00%
Methods323
▷ Static methods134.02%
▷ Public methods8626.63%
▷ Protected methods22770.28%
▷ Private methods103.10%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants146
▷ Global constants21.37%
▷ Class constants14498.63%
▷ Public constants144100.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
No PNG files were detected