78% wp-block-referral-spam

Code Review | Block Referral Spam

WordPress plugin Block Referral Spam scored78%from 54 tests.

About plugin

  • Plugin page: wp-block-referral...
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5.0-4.8
  • WordPress version: 6.3.1
  • First release: May 20, 2015
  • Latest release: Jun 9, 2017
  • Number of updates: 17
  • Update frequency: every 44.2 days
  • Top authors: Asif2BD (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

400+ active /8,434 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 gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼14.93ms] Passed 4 tests

Server-side resources used by Block Referral Spam
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.76 ▼11.51
Dashboard /wp-admin3.31 ▲0.0147.61 ▼5.06
Posts /wp-admin/edit.php3.36 ▲0.0150.38 ▼16.46
Add New Post /wp-admin/post-new.php5.89 ▲0.0190.03 ▼26.69
Media Library /wp-admin/upload.php3.24 ▲0.0139.39 ▲3.97

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Block Referral Spam
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,854 ▲9314.48 ▲0.121.91 ▲0.2446.24 ▲0.48
Dashboard /wp-admin2,231 ▲285.83 ▲0.95102.63 ▼7.4837.92 ▼3.63
Posts /wp-admin/edit.php2,113 ▲92.00 ▼0.1336.64 ▼3.8637.33 ▲4.51
Add New Post /wp-admin/post-new.php1,558 ▲1323.22 ▲0.11709.52 ▲69.2873.31 ▲8.47
Media Library /wp-admin/upload.php1,416 ▲164.24 ▲0.02112.16 ▲1.2851.58 ▲2.27

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-block-referral-spam/blocker.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-block-referral-spam/block-referral-spam.php:17

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 90% 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
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
Please take inspiration from this readme.txt

wp-block-referral-spam/block-referral-spam.php 85% from 13 tests

The principal PHP file in "Block Referral Spam" v. 1.2.1 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-block-referral-spam.php" instead of "block-referral-spam.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected423 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP21517423

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.32
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
There were not PNG files found in your plugin