84% media-downloader

Code Review | Media Downloader

WordPress plugin Media Downloader scored84%from 54 tests.

About plugin

  • Plugin page: media-downloader
  • Plugin version: 0.4.7.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Feb 3, 2010
  • Latest release: Aug 10, 2023
  • Number of updates: 175
  • Update frequency: every 28.2 days
  • Top authors: edersonpeka (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /18,876 total downloads

Benchmarks

Plugin footprint 83% 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.45MB] [CPU: ▼3.70ms] Passed 4 tests

An overview of server-side resources used by Media Downloader
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.94 ▲0.4744.63 ▼1.34
Dashboard /wp-admin3.79 ▲0.4849.44 ▼0.62
Posts /wp-admin/edit.php3.84 ▲0.4848.08 ▼3.43
Add New Post /wp-admin/post-new.php6.31 ▲0.4285.43 ▼9.39
Media Library /wp-admin/upload.php3.65 ▲0.4245.87 ▲11.19

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 110 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Media Downloader: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,929 ▲19414.03 ▼0.536.12 ▲4.1345.33 ▲0.78
Dashboard /wp-admin2,224 ▲365.88 ▲0.0198.06 ▼20.5937.67 ▼6.03
Posts /wp-admin/edit.php2,107 ▲182.03 ▼0.0135.51 ▼3.8333.38 ▲1.06
Add New Post /wp-admin/post-new.php1,532 ▼123.55 ▲0.28682.30 ▲20.4939.70 ▼12.42
Media Library /wp-admin/upload.php1,406 ▲214.23 ▲0.0796.42 ▼2.9542.78 ▲0.65

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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 fix the following
  • 82× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'getid3_lib' not found in wp-content/plugins/media-downloader/getid3/module.tag.id3v2.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'getid3_handler' not found in wp-content/plugins/media-downloader/getid3/module.audio.voc.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'getid3_lib' not found in wp-content/plugins/media-downloader/getid3/module.audio-video.asf.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'getid3_handler' not found in wp-content/plugins/media-downloader/getid3/module.misc.cue.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/media-downloader/media-downloader.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'getid3_handler' not found in wp-content/plugins/media-downloader/getid3/module.graphic.pcd.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'getid3_handler' not found in wp-content/plugins/media-downloader/getid3/module.audio-video.wtv.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'getID3' not found in wp-content/plugins/media-downloader/getid3/extension.cache.sqlite3.php:98
    • > PHP Fatal error
      Uncaught Error: Class 'getid3_handler' not found in wp-content/plugins/media-downloader/getid3/module.archive.tar.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'getid3_handler' not found in wp-content/plugins/media-downloader/getid3/module.tag.lyrics3.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
7 plugin tags: media, player, mp3, post, audio...

media-downloader/media-downloader.php Passed 13 tests

The primary PHP file in "Media Downloader" version 0.4.7.3 is used by WordPress to initiate all plugin functionality
94 characters long description:
Media Downloader plugin lists MP3 files from a folder through the [mediadownloader] shortcode.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected31,077 lines of code in 102 files:
LanguageFilesBlank linesComment linesLines of code
PHP935,61310,96530,205
PO File1154195386
JavaScript31644368
CSS33570
Markdown130047
JSON1001

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 426)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity71.82
▷ Minimum class complexity1.00
▷ Maximum class complexity594.00
Average method complexity10.17
▷ Minimum method complexity1.00
▷ Maximum method complexity426.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes84
▷ Abstract classes11.19%
▷ Concrete classes8398.81%
▷ Final classes00.00%
Methods647
▷ Static methods21433.08%
▷ Public methods56887.79%
▷ Protected methods528.04%
▷ Private methods274.17%
Functions77
▷ Named functions7394.81%
▷ Anonymous functions45.19%
Constants241
▷ Global constants22392.53%
▷ Class constants187.47%
▷ Public constants18100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin