89% nines-music

Code Review | 网易云音乐

WordPress plugin 网易云音乐 scored89%from 54 tests.

About plugin

  • Plugin page: nines-music
  • Plugin version: 1.6.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1.1-6.8
  • WordPress version: 6.3.1
  • First release: May 4, 2019
  • Latest release: Jul 13, 2023
  • Number of updates: 69
  • Update frequency: every 22.2 days
  • Top authors: jiutu (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /10,681 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
Installer ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▼5.47ms] Passed 4 tests

A check of server-side resources used by 网易云音乐
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1638.46 ▼3.89
Dashboard /wp-admin3.45 ▲0.1549.62 ▼2.05
Posts /wp-admin/edit.php3.57 ▲0.2146.08 ▼3.08
Add New Post /wp-admin/post-new.php6.03 ▲0.1583.80 ▼12.87
Media Library /wp-admin/upload.php3.37 ▲0.1535.30 ▼1.20

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 87 new files
Database: no new tables, 7 new options
New WordPress options
jiutu_musics_config
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

网易云音乐: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲5914.20 ▼0.201.75 ▲0.1437.49 ▼8.62
Dashboard /wp-admin2,223 ▲465.67 ▲0.1397.78 ▲3.3954.55 ▲11.30
Posts /wp-admin/edit.php2,125 ▲252.04 ▲0.0733.36 ▼5.8141.64 ▲5.51
Add New Post /wp-admin/post-new.php1,563 ▲3723.65 ▲0.06628.83 ▲20.8665.85 ▲6.05
Media Library /wp-admin/upload.php1,425 ▲254.21 ▼0.0394.47 ▼6.9649.79 ▲1.80

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • jiutu_musics_config
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests Passed 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 Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Screenshots: Add images for these screenshots: #1 (`已添加歌曲列表截图`), #2 (`插件配置截图1`), #3 (`插件配置截图2`), #4 (`前台音乐播放器截图`)
Please take inspiration from this readme.txt

nines-music/NinesMusic.php 92% from 13 tests

This is the main PHP file of "网易云音乐" version 1.6.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("nines-music.php" instead of "NinesMusic.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected15,683 lines of code in 72 files:
LanguageFilesBlank linesComment linesLines of code
PHP591,5947976,096
CSS41,042215,748
JavaScript61762493,503
PO File1161177334
SVG2002

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.64
Average class complexity20.88
▷ Minimum class complexity1.00
▷ Maximum class complexity150.00
Average method complexity6.88
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes52
▷ Abstract classes23.85%
▷ Concrete classes5096.15%
▷ Final classes00.00%
Methods176
▷ Static methods2815.91%
▷ Public methods176100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions29
▷ Named functions2793.10%
▷ Anonymous functions26.90%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
7 PNG files occupy 1.38MB with 0.93MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png56.66KB14.12KB▼ 75.08%
screenshot-2.png76.09KB19.69KB▼ 74.12%
screenshot-4.png99.52KB29.31KB▼ 70.55%
static/img/aplayer.png36.13KB13.64KB▼ 62.25%
static/img/player.png8.05KB3.47KB▼ 56.92%