77% mp3-music-player-by-sonaar

Code Review | MP3 Audio Player for Music, Radio & Podcast by Sonaar

WordPress plugin MP3 Audio Player for Music, Radio & Podcast by Sonaar scored 77% from 53 tests.

About plugin

  • Plugin page: mp3-music-player-...
  • Plugin version: 2.4.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8
  • WordPress version: 5.8.1
  • First release: Apr 27, 2018
  • Latest release: Sep 29, 2021
  • Number of updates: 43
  • Update frequency: every 29.1 days
  • Top authors: sonaar (100%)

Code review

53 tests

User reviews

140 reviews

Install metrics

10,000+ active / 183,004 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲2.10MB] [CPU: ▼233.59ms] Passed 4 tests

This is a short check of server-side resources used by MP3 Audio Player for Music, Radio & Podcast by Sonaar
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.39 ▲1.6752.93 ▲33.84
Dashboard /wp-admin5.16 ▲2.1067.68 ▲33.30
Posts /wp-admin/edit.php5.63 ▲2.5274.54 ▲31.12
Add New Post /wp-admin/post-new.php7.97 ▲2.54117.18 ▼1,018.72
Media Library /wp-admin/upload.php5.11 ▲2.1159.82 ▲19.95
Add New Playlist /wp-admin/post-new.php?post_type=sr_playlist5.8482.33
Settings /wp-admin/edit.php?post_type=sr_playlist&page=iron_music_player5.7667.43
All Playlists /wp-admin/edit.php?post_type=sr_playlist5.6166.03
Go Pro /wp-admin/edit.php?post_type=sr_playlist&page=sonaar_music_promo5.5563.92
Playlist Categories /wp-admin/edit-tags.php?taxonomy=playlist-category&post_type=sr_playlist5.5767.32

Server storage [IO: ▲9.92MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 531 new files
Database: no new tables, 2 new options
New WordPress options
sonaar_music_show_review_box_after
widget_sonaar-music

Browser metrics Passed 4 tests

A check of browser resources used by MP3 Audio Player for Music, Radio & Podcast by Sonaar
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,774 ▲16816.71 ▲0.8015.15 ▲7.1646.80 ▼3.54
Dashboard /wp-admin2,997 ▲1476.21 ▲0.37140.19 ▲6.4998.84 ▲1.27
Posts /wp-admin/edit.php3,576 ▲8734.88 ▲2.1997.62 ▲31.9487.64 ▼2.94
Add New Post /wp-admin/post-new.php2,308 ▲27216.29 ▼1.48407.52 ▲35.05104.79 ▼4.50
Media Library /wp-admin/upload.php1,845 ▲734.83 ▼0.21124.20 ▼31.99112.07 ▼10.85
Add New Playlist /wp-admin/post-new.php?post_type=sr_playlist4,8569.53253.20196.59
Settings /wp-admin/edit.php?post_type=sr_playlist&page=iron_music_player21,39115.54435.22101.88
All Playlists /wp-admin/edit.php?post_type=sr_playlist2,3114.3585.7258.16
Go Pro /wp-admin/edit.php?post_type=sr_playlist&page=sonaar_music_promo2,1577.83171.2764.38
Playlist Categories /wp-admin/edit-tags.php?taxonomy=playlist-category&post_type=sr_playlist2,6224.42107.2661.61

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 2 options in the database
    • sonaar_music_show_review_box_after
    • widget_sonaar-music

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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 take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/mp3-music-player-by-sonaar/public/partials/sonaar-music-public-display.php
  • 64× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/mp3-music-player-by-sonaar/admin/library/cmb2/includes/types/CMB2_Type_File_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/mp3-music-player-by-sonaar/admin/library/cmb2/includes/types/CMB2_Type_Text_Datetime_Timestamp.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/mp3-music-player-by-sonaar/admin/library/cmb2/includes/types/CMB2_Type_Oembed.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/mp3-music-player-by-sonaar/admin/library/cmb2-store-list/class-cmb2-render-store-list-field.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/mp3-music-player-by-sonaar/templates/single-album.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ElementorSonaarPlugin\\add_action() in wp-content/plugins/mp3-music-player-by-sonaar/includes/plugin.php:110
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mp3-music-player-by-sonaar/admin/library/cmb2/example-functions.php:105
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/mp3-music-player-by-sonaar/admin/partials/sonaar-music-admin-display.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mp3-music-player-by-sonaar/admin/library/cmb2-switch-button-metafield/switch_metafield.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/mp3-music-player-by-sonaar/admin/library/cmb2/includes/types/CMB2_Type_Select.php:13

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% 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
Please fix the following attributes:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
You can look at the official readme.txt

mp3-music-player-by-sonaar/sonaar-music.php 77% from 13 tests

The main PHP file in "MP3 Audio Player for Music, Radio & Podcast by Sonaar" ver. 2.4.3 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("mp3-music-player-by-sonaar.php" instead of "sonaar-music.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 152 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected103,331 lines of code in 319 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
SVG50826,002
PHP963,3188,14115,567
CSS212,1131,2589,585
JavaScript289821,1458,075
JSON4006,649
Sass35398904,066
Markdown933701,056
XML1428

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
The following items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 277)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity26.65
▷ Minimum class complexity1.00
▷ Maximum class complexity362.00
Average method complexity4.22
▷ Minimum method complexity1.00
▷ Maximum method complexity277.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes91
▷ Abstract classes99.89%
▷ Concrete classes8290.11%
▷ Final classes11.22%
Methods718
▷ Static methods11916.57%
▷ Public methods59783.15%
▷ Protected methods9813.65%
▷ Private methods233.20%
Functions53
▷ Named functions5298.11%
▷ Anonymous functions11.89%
Constants28
▷ Global constants1346.43%
▷ Class constants1553.57%
▷ Public constants15100.00%

Plugin size 0% from 1 test

Image compression 0% from 1 test

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
22 PNG files occupy 0.68MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/library/cmb2/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
admin/library/cmb2/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
admin/library/cmb2/images/ico-delete.png0.70KB0.72KB0.00%
admin/library/cmb2/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
admin/img/sonaar-icon-white.png0.88KB0.58KB▼ 33.44%