93% media-element-html5-video-and-audio-player

Code Review | MediaElement.js - HTML5 Video & Audio Player

WordPress plugin MediaElement.js - HTML5 Video & Audio Player scored 93% from 54 tests.

About plugin

  • Plugin page: media-element-htm...
  • Plugin version: 4.2.8
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9-4.9
  • WordPress version: 5.8.1
  • First release: Sep 24, 2010
  • Latest release: Jan 17, 2018
  • Number of updates: 59
  • Update frequency: every 45.3 days
  • Top authors: johndyer (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

10,000+ active / 622,836 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼140.60ms] Passed 4 tests

Analyzing server-side resources used by MediaElement.js - HTML5 Video & Audio Player
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.0536.15 ▲4.57
Dashboard /wp-admin3.11 ▲0.0550.51 ▲4.57
Posts /wp-admin/edit.php3.16 ▲0.0546.14 ▼0.16
Add New Post /wp-admin/post-new.php5.47 ▲0.0388.68 ▼566.41
Media Library /wp-admin/upload.php3.05 ▲0.0529.91 ▼0.38
MediaElement.js /wp-admin/options-general.php?page=media-element-html5-video-and-audio-player/mediaelement-js-wp.php3.0227.24

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 50 new files
Database: no new tables, 7 new options
New WordPress options
mep_default_audio_width
mep_default_audio_height
mep_video_skin
mep_default_video_type
mep_default_video_height
mep_default_audio_type
mep_default_video_width

Browser metrics Passed 4 tests

This is an overview of browser requirements for MediaElement.js - HTML5 Video & Audio Player
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,730 ▲13416.06 ▲0.5212.17 ▲3.4849.98 ▲5.14
Dashboard /wp-admin2,972 ▲385.87 ▼0.09134.43 ▼2.49112.58 ▼8.61
Posts /wp-admin/edit.php2,741 ▲22.72 ▲0.0263.31 ▼2.5792.43 ▲4.12
Add New Post /wp-admin/post-new.php2,316 ▲64619.80 ▲0.67399.99 ▲7.99110.19 ▼0.73
Media Library /wp-admin/upload.php1,815 ▲55.03 ▲0.00153.35 ▲2.03118.88 ▲2.16
MediaElement.js /wp-admin/options-general.php?page=media-element-html5-video-and-audio-player/mediaelement-js-wp.php1,2272.0859.4982.26

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller ran successfully

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
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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/media-element-html5-video-and-audio-player/mediaelement-js-wp.php:24

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)
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (Video player) image not found
  • Tags: There are too many tags (17 tag instead of maximum 10)
You can look at the official readme.txt

media-element-html5-video-and-audio-player/mediaelement-js-wp.php 85% from 13 tests

"MediaElement.js - HTML5 Video & Audio Player" version 4.2.8's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 277 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("media-element-html5-video-and-audio-player.php" instead of "mediaelement-js-wp.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected15,055 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript352,47139613,456
CSS4204441,302
PHP19566296
SVG1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
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%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
mediaelement/v4/mejs-controls.png2.82KB3.07KB0.00%