77% block-referer-spam

Code Review | Block Referer Spam

WordPress plugin Block Referer Spam scored77%from 54 tests.

About plugin

  • Plugin page: block-referer-spam
  • Plugin version: 1.1.9.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.2-6.2
  • WordPress version: 6.3.1
  • First release: Jul 16, 2015
  • Latest release: May 4, 2023
  • Number of updates: 68
  • Update frequency: every 41.9 days
  • Top authors: supersoju (54.41%)codestic (47.06%)

Code review

54 tests

User reviews

21 reviews

Install metrics

800+ active /22,625 total downloads

Benchmarks

Plugin footprint 82% 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.10MB] [CPU: ▼2.22ms] Passed 4 tests

Server-side resources used by Block Referer Spam
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1037.11 ▼0.13
Dashboard /wp-admin3.41 ▲0.1048.45 ▲2.35
Posts /wp-admin/edit.php3.52 ▲0.1747.63 ▲0.73
Add New Post /wp-admin/post-new.php5.99 ▲0.1079.75 ▼11.04
Media Library /wp-admin/upload.php3.33 ▲0.1036.08 ▲1.55
Referer Spam /wp-admin/admin.php?page=ref-spam-block3.3535.57
All Blocked Sites /wp-admin/admin.php?page=ref-spam-list3.3032.73

Server storage [IO: ▲0.82MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
These are issues you should consider
  • You have illegally modified 2 files (1.40KB) outside of "wp-content/plugins/block-referer-spam/" and "wp-content/uploads/"
    • (modified) .htaccess
    • (new file) .htaccess.bak
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Block Referer Spam
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲5514.36 ▲0.001.94 ▲0.3543.58 ▲3.66
Dashboard /wp-admin2,219 ▲455.57 ▲0.0596.02 ▲12.3743.21 ▼0.52
Posts /wp-admin/edit.php2,127 ▲272.01 ▲0.0334.89 ▼1.0635.81 ▼2.69
Add New Post /wp-admin/post-new.php1,548 ▲2223.21 ▲0.06632.60 ▼59.8760.65 ▲3.84
Media Library /wp-admin/upload.php1,430 ▲334.23 ▲0.03104.51 ▼3.5543.90 ▼1.60
Referer Spam /wp-admin/admin.php?page=ref-spam-block1,0692.0526.9332.70
All Blocked Sites /wp-admin/admin.php?page=ref-spam-list9051.9923.9726.40

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

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 errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ref-spam-list
    • > Notice in wp-content/plugins/block-referer-spam/admin/blocked-list.php+72
    Undefined variable: _SESSION

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      require_once(REFSPAMBLOCKER_PATHlib/RefSpamBlocker.php): failed to open stream: No such file or directory in wp-content/plugins/block-referer-spam/ref-spam-blocker.php on line 43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/block-referer-spam/admin/_sidebar.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/block-referer-spam/admin/blocked-list.php:2
    • > PHP Warning
      Use of undefined constant REFSPAMBLOCKER_PATH - assumed 'REFSPAMBLOCKER_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/block-referer-spam/ref-spam-blocker.php on line 43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/block-referer-spam/admin/dashboard.php:2
    • > PHP Fatal error
      require_once(): Failed opening required 'REFSPAMBLOCKER_PATHlib/RefSpamBlocker.php' (include_path='.:/usr/share/php') in wp-content/plugins/block-referer-spam/ref-spam-blocker.php on line 43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/block-referer-spam/admin/pro-options.php:2

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 errors were detected

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (Admin Interface) image required
  • Tags: There are too many tags (33 tag instead of maximum 10)
You can look at the official readme.txt

block-referer-spam/ref-spam-blocker.php 77% from 13 tests

The entry point to "Block Referer Spam" version 1.1.9.5 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Domain Path: The domain path folder does not exist ("/languages")
  • Main file name: The principal plugin file should be the same as the plugin slug ("block-referer-spam.php" instead of "ref-spam-blocker.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected4,457 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP122345704,048
PO File28483386
CSS14323

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity104.33
▷ Minimum class complexity33.00
▷ Maximum class complexity213.00
Average method complexity6.54
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods56
▷ Static methods1017.86%
▷ Public methods2544.64%
▷ Protected methods1730.36%
▷ Private methods1425.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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
2 PNG files occupy 0.41MB with 0.24MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png407.50KB134.26KB▼ 67.05%
assets/images/brand.png10.70KB5.52KB▼ 48.46%