78% music-player-for-woocommerce

Code Review | Music Player for WooCommerce

WordPress plugin Music Player for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: music-player-for-...
  • Plugin version: 1.1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-6.3
  • WordPress version: 6.3.1
  • First release: Jul 28, 2016
  • Latest release: Oct 19, 2023
  • Number of updates: 229
  • Update frequency: every 11.5 days
  • Top authors: codepeople (100%)

Code review

54 tests

User reviews

51 reviews

Install metrics

2,000+ active /199,693 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.35MB] [CPU: ▼5.16ms] Passed 4 tests

An overview of server-side resources used by Music Player for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.84 ▲0.3744.96 ▲2.74
Dashboard /wp-admin3.67 ▲0.3248.63 ▼7.33
Posts /wp-admin/edit.php3.78 ▲0.4247.10 ▼2.06
Add New Post /wp-admin/post-new.php6.25 ▲0.3689.73 ▼13.99
Media Library /wp-admin/upload.php3.59 ▲0.3638.32 ▲4.38

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 66 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts
installed_music-player-for-woocommerce

Browser metrics Passed 4 tests

Checking browser requirements for Music Player for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.27 ▼0.352.17 ▲0.5843.76 ▲5.30
Dashboard /wp-admin2,195 ▲185.55 ▼0.1182.51 ▼3.7538.94 ▼2.60
Posts /wp-admin/edit.php2,097 ▼32.01 ▲0.0236.79 ▲1.4433.42 ▼0.45
Add New Post /wp-admin/post-new.php1,528 ▲223.06 ▲0.01658.64 ▼36.6157.27 ▲9.48
Media Library /wp-admin/upload.php1,400 ▼04.17 ▼0.0394.62 ▼14.4743.99 ▼0.85

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • installed_music-player-for-woocommerce
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/music-player-for-woocommerce/views/global_options.php
    • > /wp-content/plugins/music-player-for-woocommerce/views/player_options.php
    • > /wp-content/plugins/music-player-for-woocommerce/addons/dokan/player_options.php
    • > /wp-content/plugins/music-player-for-woocommerce/pagebuilders/beaverbuilder/wcmp/includes/frontend.php
  • 24× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/music-player-for-woocommerce/addons/ap-cp-media-player.addon.php:9
    • > PHP Notice
      Undefined variable: wcmp in wp-content/plugins/music-player-for-woocommerce/addons/ap-html5-audio-player.addon.php on line 109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/music-player-for-woocommerce/addons/ap-compact-audio-player.addon.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/music-player-for-woocommerce/banner.php:105
    • > PHP Notice
      Undefined variable: wcmp in wp-content/plugins/music-player-for-woocommerce/addons/wcfm.addon.php on line 93
    • > PHP Fatal error
      Uncaught Error: Class 'ET_Builder_Module' not found in wp-content/plugins/music-player-for-woocommerce/pagebuilders/divi/divi.pb.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'SiteOrigin_Widget' not found in wp-content/plugins/music-player-for-woocommerce/pagebuilders/siteorigin/siteorigin-wcmp/siteorigin-wcmp.php:8
    • > PHP Notice
      Undefined variable: wcmp in wp-content/plugins/music-player-for-woocommerce/addons/dokan.addon.php on line 57
    • > PHP Notice
      Undefined variable: wcmp in wp-content/plugins/music-player-for-woocommerce/addons/wcv.addon.php on line 51
    • > PHP Notice
      Undefined variable: products_ids in wp-content/plugins/music-player-for-woocommerce/pagebuilders/beaverbuilder/wcmp/includes/frontend.php on line 10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: Too many tags (16 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

music-player-for-woocommerce/wcmp.php 85% from 13 tests

"Music Player for WooCommerce" version 1.1.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 219 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("music-player-for-woocommerce.php" instead of "wcmp.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin5,311 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
PHP244921523,834
JavaScript98440584
PO File1210255554
HTML110169
CSS10184150
JSON10019
SVG1001

PHP code Passed 2 tests

Analyzing 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.44
Average class complexity35.06
▷ Minimum class complexity1.00
▷ Maximum class complexity368.00
Average method complexity3.99
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods154
▷ Static methods31.95%
▷ Public methods11373.38%
▷ Protected methods21.30%
▷ Private methods3925.32%
Functions8
▷ Named functions225.00%
▷ Anonymous functions675.00%
Constants9
▷ Global constants9100.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
15 PNG files occupy 0.12MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
views/assets/skin3_btn.png3.76KB2.06KB▼ 45.11%
views/assets/skin1.png1.83KB1.42KB▼ 22.31%
feedback/screenshots/screen3.png18.42KB18.52KB0.00%
feedback/screenshots/screen1.png25.46KB25.70KB0.00%
vendors/mejs-skins/controls-wmp.png5.38KB3.02KB▼ 43.93%