84% static-file-browser

Code Review | Static File Browser

WordPress plugin Static File Browser scored 84% from 54 tests.

About plugin

  • Plugin page: static-file-browser
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 28, 2018
  • Latest release: Aug 28, 2018
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: fabianscheidt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 463 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
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by Static File Browser
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.29 ▼3.93
Dashboard /wp-admin3.32 ▲0.0145.45 ▲0.30
Posts /wp-admin/edit.php3.37 ▲0.0153.33 ▲0.05
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.48 ▼14.85
Media Library /wp-admin/upload.php3.24 ▲0.0140.62 ▲3.72

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Static File Browser
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.22 ▼1.161.63 ▼0.6241.22 ▼6.15
Dashboard /wp-admin2,203 ▲155.81 ▼0.13100.43 ▼15.9741.30 ▼2.69
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0538.03 ▼2.9635.16 ▼4.29
Add New Post /wp-admin/post-new.php1,514 ▼1417.63 ▼0.71704.36 ▲98.5051.08 ▲2.73
Media Library /wp-admin/upload.php1,388 ▼04.23 ▲0.0299.89 ▲2.2644.65 ▼0.38

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/static-file-browser/static-file-browser.php:123

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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Screenshots: Please add an image for screenshot #1 (\"Static File Browser\" tab)
You can take inspiration from this readme.txt

static-file-browser/static-file-browser.php Passed 13 tests

The primary PHP file in "Static File Browser" version 1.0 is used by WordPress to initiate all plugin functionality
80 characters long description:
Lists the contents of /wp-content/uploads/static/ in the media selection popover

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin85 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1142881
Markdown1304

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
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%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.05MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png48.45KB11.95KB▼ 75.35%