83% wordpress-automatic-image-hotlink-protection

Code Review | Hotlink Protection

WordPress plugin Hotlink Protection scored83%from 54 tests.

About plugin

  • Plugin page: wordpress-automat...
  • Plugin version: 3.3.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.9.8
  • WordPress version: 6.3.1
  • First release: Jun 8, 2009
  • Latest release: Aug 16, 2018
  • Number of updates: 29
  • Update frequency: every 120.2 days
  • Top authors: christopherross (75.86%)horshipsrectors (20.69%)zuda (10.34%)

Code review

54 tests

User reviews

5 reviews

Install metrics

500+ active /53,399 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼0.13ms] Passed 4 tests

Server-side resources used by Hotlink Protection
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0041.10 ▼0.31
Dashboard /wp-admin3.31 ▲0.0146.72 ▼6.71
Posts /wp-admin/edit.php3.36 ▲0.0051.35 ▲4.42
Add New Post /wp-admin/post-new.php5.89 ▲0.0093.61 ▲5.77
Media Library /wp-admin/upload.php3.23 ▲0.0036.15 ▲2.10

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

Input-output and database impact of this plugin
Just a few items left to fix
  • There were 1 file (1.04KB) illegally modified outside of "wp-content/plugins/wordpress-automatic-image-hotlink-protection/" and "wp-content/uploads/"
    • (modified) .htaccess
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Hotlink Protection
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲2814.69 ▲0.022.02 ▼0.3044.22 ▼0.67
Dashboard /wp-admin2,198 ▲215.62 ▼0.0593.49 ▼2.9443.82 ▲2.08
Posts /wp-admin/edit.php2,097 ▼61.99 ▼0.0339.72 ▲0.3636.66 ▼0.95
Add New Post /wp-admin/post-new.php1,526 ▼023.62 ▲0.00687.67 ▼28.5253.14 ▼9.15
Media Library /wp-admin/upload.php1,400 ▼04.23 ▲0.0597.26 ▼13.2143.18 ▼3.43

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/wordpress-automatic-image-hotlink-protection/wordpress-automatic-image-hotlink-protection.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Donate link: Invalid URI found ("")
The official readme.txt is a good inspiration

wordpress-automatic-image-hotlink-protection/wordpress-automatic-image-hotlink-protection.php 92% from 13 tests

"Hotlink Protection" version 3.3.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 188 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin47 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1243047

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.15
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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin