83% tornevall-networks-dnsbl-implementation

Code Review | Tornevall Networks AntiSpam and Fraud Blacklist (DNSBL w/FraudBL) implementation

WordPress plugin Tornevall Networks AntiSpam and Fraud Blacklist (DNSBL w/FraudBL) implementation scored83%from 54 tests.

About plugin

  • Plugin page: tornevall-network...
  • Plugin version: 2.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2.2
  • WordPress version: 6.3.1
  • First release: Nov 13, 2014
  • Latest release: Aug 8, 2019
  • Number of updates: 43
  • Update frequency: every 40.4 days
  • Top authors: Tornevall (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,128 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
Install script ran successfully

Server metrics [RAM: ▲0.29MB] [CPU: ▲1.44ms] Passed 4 tests

Analyzing server-side resources used by Tornevall Networks AntiSpam and Fraud Blacklist (DNSBL w/FraudBL) implementation
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2545.43 ▲1.05
Dashboard /wp-admin3.60 ▲0.2951.43 ▼2.56
Posts /wp-admin/edit.php3.71 ▲0.3552.16 ▲4.80
Add New Post /wp-admin/post-new.php6.20 ▲0.3195.68 ▲2.46
Media Library /wp-admin/upload.php3.52 ▲0.2941.14 ▲6.05

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 19 new files
Database: 2 new tables, 7 new options
New tables
wp_dnsblcache
wp_dnsblstats
New WordPress options
can_compress_scripts
tornevall_dnsbl_database_version
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Tornevall Networks AntiSpam and Fraud Blacklist (DNSBL w/FraudBL) implementation: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,930 ▲19513.58 ▼1.068.90 ▲7.0039.94 ▼4.61
Dashboard /wp-admin2,221 ▲335.84 ▲0.93102.68 ▼17.3341.44 ▼7.26
Posts /wp-admin/edit.php2,110 ▲212.01 ▼0.0537.87 ▲1.1834.49 ▼2.90
Add New Post /wp-admin/post-new.php1,555 ▲2218.16 ▼4.82621.47 ▼33.2950.82 ▲1.31
Media Library /wp-admin/upload.php1,409 ▲274.25 ▲0.01101.49 ▼2.6942.68 ▲1.02

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • tornevall_dnsbl_database_version
    • db_upgraded
    • widget_theysaidso_widget

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 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
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/tornevall-networks-dnsbl-implementation/tornevall-wp-dnsbl.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function dnsbl_check_blacklist() in wp-content/plugins/tornevall-networks-dnsbl-implementation/comments.php:3

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 87% from 29 tests

readme.txt 88% 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
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Screenshot that shows custom CSS, when comments section is disabled due to blacklisted address), #2 (A part of the new DNSBL configuration interface)
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

tornevall-networks-dnsbl-implementation/tornevall-wp-dnsbl.php 85% from 13 tests

"Tornevall Networks AntiSpam and Fraud Blacklist (DNSBL w/FraudBL) implementation" version 2.0.8's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 154 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("tornevall-networks-dnsbl-implementation.php" instead of "tornevall-wp-dnsbl.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin2,265 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP72424051,967
PO File1153325297
JavaScript1001

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.47
Average class complexity28.75
▷ Minimum class complexity1.00
▷ Maximum class complexity91.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods37
▷ Static methods12.70%
▷ Public methods3491.89%
▷ Protected methods00.00%
▷ Private methods38.11%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/d.png0.44KB0.42KB▼ 5.93%
images/q.png0.32KB0.41KB0.00%