10% spamreferrerblock

Code Review | SpamReferrerBlock

WordPress plugin SpamReferrerBlock scored 10% from 54 tests.

About plugin

  • Plugin page: spamreferrerblock
  • Plugin version: 2.22
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.1.1
  • WordPress version: 5.9.2
  • First release: Dec 30, 2014
  • Latest release: Jun 16, 2015
  • Number of updates: 8
  • Update frequency: every 21.1 days
  • Top authors: dsampaolo (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

2,000+ active / 20,088 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/spamreferrerblock/spam_referrer_block.php+104
    Invalid argument supplied for foreach()

Server metrics [RAM: ▲0.02MB] [CPU: ▼291.25ms] Passed 4 tests

This is a short check of server-side resources used by SpamReferrerBlock
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0455.48 ▲5.63
Dashboard /wp-admin3.45 ▲0.0433.63 ▼0.12
Posts /wp-admin/edit.php3.68 ▲0.0435.91 ▼1.68
Add New Post /wp-admin/post-new.php6.92 ▼0.0589.81 ▼1,165.87
Media Library /wp-admin/upload.php3.33 ▲0.0426.83 ▲2.66
Spam Referrer Block /wp-admin/options-general.php?page=srb3.35179.76

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 4 new files
Database: 1 new table, 2 new options
New tables
wp_srb_blacklist
New WordPress options
srb_response
srb_db_version

Browser metrics Passed 4 tests

A check of browser resources used by SpamReferrerBlock
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,800 ▲4615.82 ▲0.246.18 ▼0.442.79 ▲0.33
Dashboard /wp-admin2,897 ▲366.11 ▼0.06115.76 ▼20.40153.17 ▼6.45
Posts /wp-admin/edit.php2,693 ▼13.24 ▼0.0062.63 ▼4.47141.07 ▼3.55
Add New Post /wp-admin/post-new.php1,714 ▲321.44 ▲0.16469.87 ▲19.64164.80 ▲10.12
Media Library /wp-admin/upload.php1,703 ▲55.50 ▼0.03137.53 ▼11.11187.18 ▲2.93
Spam Referrer Block /wp-admin/options-general.php?page=srb1,2682.4158.18104.62

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_srb_blacklist
  • Zombie WordPress options detected upon uninstall: 2 options
    • srb_db_version
    • srb_response

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=srb
    • > Warning in wp-content/plugins/spamreferrerblock/spam_referrer_block.php+104
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/options-general.php?page=srb
    • > Warning in wp-content/plugins/spamreferrerblock/spam_referrer_block.php+118
    count(): Parameter must be an array or an object that implements Countable

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/spamreferrerblock/admin_page.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_multisite() in wp-content/plugins/spamreferrerblock/spam_referrer_block.php:23

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: statistics, spam, analytics, dsampaolo, referrer

spamreferrerblock/spam_referrer_block.php 92% from 13 tests

The principal PHP file in "SpamReferrerBlock" v. 2.22 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("spamreferrerblock.php" instead of "spam_referrer_block.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
There were no executable files found in this plugin336 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2729324
CSS10012

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity36.00
▷ Minimum class complexity36.00
▷ Maximum class complexity36.00
Average method complexity3.92
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.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

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin