83% wp-miniaudioplayer

Code Review | mb.miniAudioPlayer - an HTML5 audio player for your mp3 files

WordPress plugin mb.miniAudioPlayer - an HTML5 audio player for your mp3 files scored83%from 54 tests.

About plugin

  • Plugin page: wp-miniaudioplayer
  • Plugin version: 1.9.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.5.8
  • WordPress version: 6.3.1
  • First release: Oct 18, 2012
  • Latest release: Nov 13, 2021
  • Number of updates: 265
  • Update frequency: every 12.5 days
  • Top authors: pupunzi (100%)

Code review

54 tests

User reviews

57 reviews

Install metrics

6,000+ active /362,224 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.20MB] [CPU: ▼2.08ms] Passed 4 tests

Server-side resources used by mb.miniAudioPlayer - an HTML5 audio player for your mp3 files
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0842.99 ▲5.64
Dashboard /wp-admin3.52 ▲0.2246.65 ▲0.47
Posts /wp-admin/edit.php3.62 ▲0.2648.47 ▼1.76
Add New Post /wp-admin/post-new.php6.35 ▲0.4688.83 ▼6.18
Media Library /wp-admin/upload.php3.44 ▲0.2237.00 ▼0.84
mb.miniAudioPlayer /wp-admin/options-general.php?page=wp-miniaudioplayer/miniAudioPlayer-admin.php3.4234.70

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 47 new files
Database: no new tables, 29 new options
New WordPress options
miniAudioPlayer_showTime
miniAudioPlayer_animate
miniAudioPlayer_use_html5_download
miniAudioPlayer_replaceDefault_show_title
miniAudioPlayer_excluded
miniAudioPlayer_replaceDefault
theysaidso_admin_options
widget_recent-posts
miniAudioPlayer_width
miniAudioPlayer_showRew
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for mb.miniAudioPlayer - an HTML5 audio player for your mp3 files
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,210 ▲46414.08 ▼0.338.62 ▲6.8037.73 ▼2.10
Dashboard /wp-admin2,501 ▲3105.84 ▼0.09100.35 ▼0.5243.61 ▲2.03
Posts /wp-admin/edit.php2,384 ▲2981.96 ▼0.0235.92 ▼3.7935.66 ▼3.06
Add New Post /wp-admin/post-new.php1,837 ▲30823.08 ▲4.60581.46 ▼75.3550.87 ▼1.63
Media Library /wp-admin/upload.php1,683 ▲2954.31 ▲0.0798.97 ▼15.5340.62 ▼7.89
mb.miniAudioPlayer /wp-admin/options-general.php?page=wp-miniaudioplayer/miniAudioPlayer-admin.php1,7674.87113.9664.97

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 11 options
    • widget_recent-posts
    • miniAudioPlayer_active_all
    • widget_recent-comments
    • miniAudioPlayer_replaceDefault
    • miniAudioPlayer_allowMute
    • db_upgraded
    • can_compress_scripts
    • miniAudioPlayer_use_html5_download
    • theysaidso_admin_options
    • miniAudioPlayer_replaceDefault_show_title
    • ...

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-miniaudioplayer/miniAudioPlayer-admin.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/wp-miniaudioplayer/miniAudioPlayer.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-miniaudioplayer/inc/popup.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (The settings panel.), #2 (The player closed with a black skin.), #3 (The player opened with a green skin.), #4 (The edit properties button available in the post editor toolbar.), #5 (The properties window in the post editor.)
You can take inspiration from this readme.txt

wp-miniaudioplayer/miniAudioPlayer.php 85% from 13 tests

The main PHP script in "mb.miniAudioPlayer - an HTML5 audio player for your mp3 files" version 1.9.7 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-miniaudioplayer.php" instead of "miniAudioPlayer.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 272 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
Good job! No executable or dangerous file extensions detected4,234 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP42571701,452
PO File3368496918
JavaScript5225156897
CSS613988645
SVG3211298
HTML1101924

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.33
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions1694.12%
▷ Anonymous functions15.88%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
9 PNG files occupy 1.53MB with 0.95MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png380.23KB155.21KB▼ 59.18%
images/editorButton.png145.17KB42.67KB▼ 70.61%
screenshot-3.png294.04KB108.03KB▼ 63.26%
images/excludeimg.png76.47KB24.99KB▼ 67.32%
images/bgnd.png15.70KB7.89KB▼ 49.75%