72% netease-music

Code Review | Netease Music

WordPress plugin Netease Music scored72%from 54 tests.

About plugin

  • Plugin page: netease-music
  • Plugin version: 3.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4.1
  • WordPress version: 6.3.1
  • First release: Dec 18, 2014
  • Latest release: May 19, 2020
  • Number of updates: 116
  • Update frequency: every 17.1 days
  • Top authors: fatesinger (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /52,857 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.23MB] [CPU: ▲185.90ms] Passed 4 tests

Analyzing server-side resources used by Netease Music
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.28244.01 ▲201.74
Dashboard /wp-admin3.57 ▲0.26233.00 ▲186.40
Posts /wp-admin/edit.php3.62 ▲0.26264.09 ▲219.79
Add New Post /wp-admin/post-new.php6.09 ▲0.20276.76 ▲175.75
Media Library /wp-admin/upload.php3.43 ▲0.20212.93 ▲179.69
自定义歌单 /wp-admin/admin.php?page=neteasemusic-list3.40243.19
设置 /wp-admin/admin.php?page=neteasemusic3.44215.44

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Netease Music
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲7113.17 ▼1.131.76 ▼0.0642.00 ▼2.48
Dashboard /wp-admin2,230 ▲425.80 ▲0.9394.72 ▼19.2245.01 ▼1.69
Posts /wp-admin/edit.php2,116 ▲272.02 ▲0.0236.15 ▲3.5543.61 ▲5.74
Add New Post /wp-admin/post-new.php1,554 ▲4021.03 ▲3.29619.20 ▼49.6553.95 ▼1.95
Media Library /wp-admin/upload.php1,412 ▲274.31 ▲0.08104.07 ▼5.1752.84 ▲5.96
自定义歌单 /wp-admin/admin.php?page=neteasemusic-list8942.0036.1959.71
设置 /wp-admin/admin.php?page=neteasemusic1,0992.0322.0680.13

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/netease-music/functions/nm-list.php
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/netease-music/functions/static.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'nmjson' not found in wp-content/plugins/netease-music/functions/shortcode.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/netease-music/functions/pr-list.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/netease-music/functions/nm-setting.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'nmjson' not found in wp-content/plugins/netease-music/functions/core.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/netease-music/functions/tpl-nm.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'nmjson' not found in wp-content/plugins/netease-music/functions/embed.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/netease-music/neteasemusic.php:12

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=neteasemusic-list
    • > Network (severe)
    wp-admin/%7B%7B%20item.img%20%7D%7D - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: music, 163, wordpress

netease-music/neteasemusic.php 92% from 13 tests

The main file in "Netease Music" v. 3.2.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("netease-music.php" instead of "neteasemusic.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin1,781 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP111938031,615
JavaScript611566
Markdown118041
JSON10032
SVG10024
CSS3003

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity102.00
▷ Minimum class complexity77.00
▷ Maximum class complexity127.00
Average method complexity4.61
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods56
▷ Static methods00.00%
▷ Public methods2850.00%
▷ Protected methods00.00%
▷ Private methods2850.00%
Functions39
▷ Named functions39100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin