58% radio-player

Code Review | Radio Player - Live Shoutcast, Icecast and Any Audio Stream Player for WordPress

WordPress plugin Radio Player - Live Shoutcast, Icecast and Any Audio Stream Player for WordPress scored58%from 54 tests.

About plugin

  • Plugin page: radio-player
  • Plugin version: 2.0.73
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Jun 24, 2021
  • Latest release: Oct 31, 2023
  • Number of updates: 40
  • Update frequency: every 21.5 days
  • Top authors: princeahmed (100%)

Code review

54 tests

User reviews

77 reviews

Install metrics

5,000+ active /60,770 total downloads

Benchmarks

Plugin footprint 47% 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲5.46MB] [CPU: ▲29.94ms] 75% from 4 tests

An overview of server-side resources used by Radio Player - Live Shoutcast, Icecast and Any Audio Stream Player for WordPress
The following require your attention
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.46MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.27 ▲5.8067.36 ▲26.79
Dashboard /wp-admin9.29 ▲5.9485.47 ▲26.18
Posts /wp-admin/edit.php9.29 ▲5.9394.58 ▲44.25
Add New Post /wp-admin/post-new.php10.05 ▲4.16117.63 ▲24.42
Media Library /wp-admin/upload.php9.29 ▲6.0578.62 ▲42.38
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius9.2960.93

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 283 new files
Database: 2 new tables, 12 new options
New tables
wp_radio_player_players
wp_radio_player_statistics
New WordPress options
widget_recent-comments
fs_active_plugins
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
radio_player_notices
radio_player_version
radio_player_install_time
fs_debug_mode
db_upgraded
...

Browser metrics Passed 4 tests

Checking browser requirements for Radio Player - Live Shoutcast, Icecast and Any Audio Stream Player for WordPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,966 ▲20920.66 ▲6.311.69 ▼0.1627.98 ▼13.78
Dashboard /wp-admin2,367 ▲19011.08 ▲5.42298.01 ▲206.00128.00 ▲87.99
Posts /wp-admin/edit.php2,307 ▲2079.15 ▲7.1592.57 ▲57.0388.44 ▲51.12
Add New Post /wp-admin/post-new.php1,601 ▲7523.87 ▲0.86592.30 ▼40.1441.43 ▼2.72
Media Library /wp-admin/upload.php1,658 ▲25811.73 ▲7.50147.36 ▲48.39120.97 ▲78.47
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,2348.9479.3893.78

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/radio-player/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_radio_player_players
    • wp_radio_player_statistics
  • Zombie WordPress options were found after uninstall: 12 options
    • fs_active_plugins
    • fs_debug_mode
    • radio_player_install_time
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • fs_accounts
    • db_upgraded
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
Almost there! Just fix the following items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/radio-player/includes/views/getting-started/what-new.php
    • > /wp-content/plugins/radio-player/includes/views/email-report.php
  • 10× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/radio-player/includes/views/statistics.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/radio-player/includes/views/getting-started/proxy-player-addon.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/radio-player/includes/views/getting-started/introduction.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/radio-player/includes/views/getting-started/ads-player-addon.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/radio-player/includes/views/notice/radio-player-proxy-addon.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/radio-player/includes/views/getting-started/help.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/radio-player/includes/views/getting-started/basic-usage.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/radio-player/plugin.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/radio-player/includes/views/getting-started/get-pro.php:5
    • > PHP Warning
      Use of undefined constant RADIO_PLAYER_ASSETS - assumed 'RADIO_PLAYER_ASSETS' (this will throw an Error in a future version of PHP) in wp-content/plugins/radio-player/includes/views/notice/radio-player-proxy-addon.php on line 9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
9 plugin tags: music, shoutcast, stream, mp3, audio...

radio-player/plugin.php 92% from 13 tests

This is the main PHP file of "Radio Player - Live Shoutcast, Icecast and Any Audio Stream Player for WordPress" version 2.0.73, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("radio-player.php" instead of "plugin.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin37,395 lines of code in 189 files:
LanguageFilesBlank linesComment linesLines of code
PHP1488,72317,64636,835
JavaScript105980322
SVG1010155
JSON30065
CSS180018

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity70.99
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.44
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes66
▷ Abstract classes23.03%
▷ Concrete classes6496.97%
▷ Final classes11.56%
Methods1,382
▷ Static methods21615.63%
▷ Public methods97670.62%
▷ Protected methods171.23%
▷ Private methods38928.15%
Functions117
▷ Named functions11094.02%
▷ Anonymous functions75.98%
Constants152
▷ Global constants10569.08%
▷ Class constants4730.92%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
51 compressed PNG files occupy 0.72MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/getting-started/gutenberg-block.png2.67KB2.75KB0.00%
assets/images/getting-started/schedule.png34.09KB37.66KB0.00%
assets/images/placeholder.png5.96KB6.16KB0.00%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
assets/images/radio-player-proxy-icon.png22.40KB23.99KB0.00%