64% external-files-in-media-library

Code Review | External files in media library

WordPress plugin External files in media library scored64%from 54 tests.

About plugin

  • Plugin page: external-files-in...
  • Plugin version: 1.0.1
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.4
  • WordPress version: 6.3.1
  • First release: Sep 13, 2023
  • Latest release: Oct 21, 2023
  • Number of updates: 3
  • Update frequency: every 12.7 days
  • Top authors: threadi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /185 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by External files in media library
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0036.99 ▼0.90
Dashboard /wp-admin3.31 ▲0.0047.90 ▲0.96
Posts /wp-admin/edit.php3.36 ▲0.0045.19 ▼0.86
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.90 ▼17.43
Media Library /wp-admin/upload.php3.23 ▲0.0032.81 ▼1.69

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for External files in media library
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.32 ▲0.111.80 ▲0.1043.74 ▲3.07
Dashboard /wp-admin2,198 ▲245.59 ▲0.0584.47 ▼0.4042.11 ▲3.68
Posts /wp-admin/edit.php2,100 ▼02.01 ▼0.0233.15 ▼7.1335.17 ▼4.65
Add New Post /wp-admin/post-new.php1,526 ▼223.32 ▲0.27651.93 ▲51.9447.57 ▼18.38
Media Library /wp-admin/upload.php1,403 ▼04.27 ▲0.0596.99 ▼0.9241.34 ▼3.28

Uninstaller [IO: ▲0.18MB] [DB: ▲0.00MB] 25% 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
  • Uninstall procedure validation failed for this plugin
    • > Parse error in wp-content/plugins/external-files-in-media-library/classes/eml/Controller/class-external-files.php+390
    syntax error, unexpected '|', expecting ';' or '{'
  • The plugin did not uninstall correctly, leaving 25 files (0.18MB) in the plugin directory
    • (new file) admin/js.js
    • (new file) classes/eml/Controller/class-init.php
    • (new file) classes/eml/Controller/class-uninstall.php
    • (new file) classes/eml/Model/class-log.php
    • (new file) classes/eml/Controller/class-external-files.php
    • (new file) classes/eml/Model/class-external-file.php
    • (new file) classes/eml/Controller/class-cli.php
    • (new file) classes/eml/Controller/class-install.php
    • (new file) admin/style.css
    • (new file) classes/eml/Controller/class-proxy.php
    • ...
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Parse error
      syntax error, unexpected '|', expecting ';' or '{' in wp-content/plugins/external-files-in-media-library/classes/eml/Controller/class-external-files.php on line 390
    • > PHP Parse error
      syntax error, unexpected '|', expecting variable (T_VARIABLE) in wp-content/plugins/external-files-in-media-library/classes/eml/Controller/class-init.php on line 283
    • > PHP Parse error
      syntax error, unexpected '|', expecting ';' or '{' in wp-content/plugins/external-files-in-media-library/classes/eml/class-transient.php on line 245
    • > PHP Parse error
      syntax error, unexpected '|', expecting variable (T_VARIABLE) in wp-content/plugins/external-files-in-media-library/inc/admin.php on line 1161

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Please add an image for screenshot #1 ()
The official readme.txt is a good inspiration

external-files-in-media-library/external-files-in-media-library.php Passed 13 tests

The principal PHP file in "External files in media library" v. 1.0.1 is loaded by WordPress automatically on each request
48 characters long description:
Enables the Media Library to use external files.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected2,878 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP175321,6862,252
PO File2176214529
JavaScript191666
CSS16031

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity17.08
▷ Minimum class complexity4.00
▷ Maximum class complexity62.00
Average method complexity2.31
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods142
▷ Static methods1510.56%
▷ Public methods11178.17%
▷ Protected methods00.00%
▷ Private methods3121.83%
Functions28
▷ Named functions2796.43%
▷ Anonymous functions13.57%
Constants8
▷ Global constants00.00%
▷ Class constants8100.00%
▷ Public constants8100.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
No PNG files were detected