84% what-the-file

Code Review | What The File

WordPress plugin What The File scored84%from 54 tests.

About plugin

  • Plugin page: what-the-file
  • Plugin version: 1.6.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-6.3
  • WordPress version: 6.3.1
  • First release: Aug 26, 2012
  • Latest release: Aug 25, 2023
  • Number of updates: 90
  • Update frequency: every 44.6 days
  • Top authors: barrykooij (100%)

Code review

54 tests

User reviews

866 reviews

Install metrics

50,000+ active /504,245 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.05MB] [CPU: ▼2.58ms] Passed 4 tests

This is a short check of server-side resources used by What The File
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0645.64 ▲2.93
Dashboard /wp-admin3.35 ▲0.0548.65 ▼9.00
Posts /wp-admin/edit.php3.46 ▲0.1148.42 ▲1.09
Add New Post /wp-admin/post-new.php5.93 ▲0.0591.10 ▼5.32
Media Library /wp-admin/upload.php3.27 ▲0.0545.24 ▲7.74

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for What The File
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,853 ▲10714.78 ▲0.432.42 ▲0.4842.50 ▲0.42
Dashboard /wp-admin2,203 ▲184.89 ▼0.97110.74 ▲0.5442.30 ▼1.15
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0136.55 ▲2.0134.13 ▼1.80
Add New Post /wp-admin/post-new.php1,520 ▼823.16 ▼0.11662.47 ▼13.0570.20 ▲17.46
Media Library /wp-admin/upload.php1,388 ▼04.19 ▼0.0596.56 ▼25.0241.72 ▼7.73

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
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/what-the-file/what-the-file.php:337

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

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

what-the-file/what-the-file.php 92% from 13 tests

Analyzing the main PHP file in "What The File" version 1.6.0
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 374 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin251 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP388170224
JavaScript17527

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.31
Average class complexity11.00
▷ Minimum class complexity1.00
▷ Maximum class complexity22.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods1669.57%
▷ Protected methods00.00%
▷ Private methods730.43%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/never5-logo.png1.81KB1.32KB▼ 27.04%