84% terms-before-download

Code Review | Terms Before Download

WordPress plugin Terms Before Download scored84%from 54 tests.

About plugin

  • Plugin page: terms-before-down...
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.8.1
  • WordPress version: 6.3.1
  • First release: Jun 26, 2014
  • Latest release: Oct 4, 2021
  • Number of updates: 11
  • Update frequency: every 252.7 days
  • Top authors: hiroprot (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /2,819 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.01MB] [CPU: ▼4.88ms] Passed 4 tests

An overview of server-side resources used by Terms Before Download
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.47 ▼4.07
Dashboard /wp-admin3.32 ▲0.0145.84 ▼3.28
Posts /wp-admin/edit.php3.37 ▲0.0147.04 ▲0.02
Add New Post /wp-admin/post-new.php5.90 ▲0.0185.05 ▼12.20
Media Library /wp-admin/upload.php3.24 ▲0.0134.44 ▲0.48

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Terms Before Download
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.78 ▼0.874.33 ▲2.3939.82 ▼10.91
Dashboard /wp-admin2,209 ▲214.89 ▼0.0196.93 ▼11.1941.39 ▼2.77
Posts /wp-admin/edit.php2,092 ▲32.02 ▲0.0034.86 ▼2.6432.05 ▼0.38
Add New Post /wp-admin/post-new.php1,538 ▲2423.10 ▲5.49592.59 ▼86.7942.05 ▼10.34
Media Library /wp-admin/upload.php1,388 ▼04.23 ▲0.0195.89 ▼18.2041.11 ▼6.86

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 does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/terms-before-download/terms-before-download.php:29

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: download, terms, license, eula

terms-before-download/terms-before-download.php Passed 13 tests

The main file in "Terms Before Download" v. 1.0.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
107 characters long description:
Shows a popup dialog with terms and conditions (EULA) that must be accepted before a file can be downloaded

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 detected94 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1255994

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin