84% floating-window-music-player

Code Review | Floating Window Music Player

WordPress plugin Floating Window Music Player scored84%from 54 tests.

About plugin

  • Plugin page: floating-window-m...
  • Plugin version: 3.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.9
  • WordPress version: 6.3.1
  • First release: Sep 20, 2016
  • Latest release: Feb 4, 2022
  • Number of updates: 166
  • Update frequency: every 11.8 days
  • Top authors: ericzane (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /26,006 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.16MB] [CPU: ▼0.70ms] Passed 4 tests

Server-side resources used by Floating Window Music Player
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1854.72 ▲9.14
Dashboard /wp-admin3.48 ▲0.1354.33 ▼15.17
Posts /wp-admin/edit.php3.60 ▲0.2373.18 ▲16.99
Add New Post /wp-admin/post-new.php6.06 ▲0.17102.09 ▼2.47
Media Library /wp-admin/upload.php3.40 ▲0.1744.24 ▲5.71

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Floating Window Music Player: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲8214.30 ▼0.084.57 ▲2.5641.68 ▲3.39
Dashboard /wp-admin2,198 ▲215.70 ▼0.0285.21 ▼7.4179.65 ▲37.04
Posts /wp-admin/edit.php2,118 ▲182.01 ▼0.0237.94 ▲2.6234.39 ▼1.57
Add New Post /wp-admin/post-new.php1,539 ▼1117.50 ▼5.90753.54 ▲109.6561.53 ▲10.21
Media Library /wp-admin/upload.php1,415 ▲154.23 ▲0.06103.81 ▼1.7873.73 ▲26.54

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/floating-window-music-player/floating-window-music-player.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
Please take inspiration from this readme.txt

floating-window-music-player/floating-window-music-player.php Passed 13 tests

The main PHP file in "Floating Window Music Player" ver. 3.4.2 adds more information about the plugin and also serves as the entry point for this plugin
103 characters long description:
The plugin supports Netease, Tencent, Xiami, Kugou and Baidu Music online playing on a floating window.

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
Everything looks great! No dangerous files found in this plugin2,985 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP4114301,874
JavaScript3153517
PO File1127128309
CSS100285

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity142.00
▷ Minimum class complexity142.00
▷ Maximum class complexity142.00
Average method complexity4.14
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods44
▷ Static methods00.00%
▷ Public methods1329.55%
▷ Protected methods613.64%
▷ Private methods2556.82%
Functions21
▷ Named functions2095.24%
▷ Anonymous functions14.76%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.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
No PNG files were detected