73% wp-xiami

Code Review | WP-Xiami 虾米音乐同步

WordPress plugin WP-Xiami 虾米音乐同步 scored73%from 54 tests.

About plugin

  • Plugin page: wp-xiami
  • Plugin version: 0.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.9.1
  • WordPress version: 6.3.1
  • First release: May 12, 2014
  • Latest release: Jun 12, 2014
  • Number of updates: 15
  • Update frequency: every 2.1 days
  • Top authors: afcold (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,023 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.11MB] [CPU: ▼11.18ms] Passed 4 tests

This is a short check of server-side resources used by WP-Xiami 虾米音乐同步
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.89 ▼0.5821.50 ▼22.71
Dashboard /wp-admin3.37 ▲0.0255.90 ▼11.31
Posts /wp-admin/edit.php3.48 ▲0.1251.33 ▼3.81
Add New Post /wp-admin/post-new.php5.95 ▲0.0689.55 ▼6.90
Media Library /wp-admin/upload.php3.29 ▲0.0638.82 ▲2.10
虾米音乐同步 /wp-admin/admin.php?page=wp-xiami3.1929.94
基础设置 /wp-admin/admin.php?page=wp-xiami-option3.2734.68

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP-Xiami 虾米音乐同步
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5414.25 ▼0.121.72 ▼0.0443.65 ▲2.67
Dashboard /wp-admin2,215 ▲355.55 ▼0.0392.99 ▼4.4387.85 ▲47.18
Posts /wp-admin/edit.php2,129 ▲261.99 ▼0.0334.51 ▼7.1743.04 ▲7.16
Add New Post /wp-admin/post-new.php1,567 ▲3123.05 ▲4.55699.67 ▲36.2953.61 ▼44.46
Media Library /wp-admin/upload.php1,426 ▲234.15 ▼0.0793.42 ▼18.5180.27 ▲32.60
虾米音乐同步 /wp-admin/admin.php?page=wp-xiami9902.6556.4551.34
基础设置 /wp-admin/admin.php?page=wp-xiami-option9851.6925.3471.31

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-xiami-option
    • > Notice in wp-content/plugins/wp-xiami/class.xiami.php+176
    Trying to access array offset on value of type bool

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
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-xiami/include/wp-xiami.php
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-xiami/wp-xiami.php:13
    • > PHP Warning
      require(WP_XIAMI_PATH/class.fetchjs.php): failed to open stream: No such file or directory in wp-content/plugins/wp-xiami/function.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wp-xiami/static/tmpl/tpl-wp-xiami.php:5
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-xiami/include/wp-xiami-option.php:37
    • > PHP Warning
      Use of undefined constant WP_XIAMI_PATH - assumed 'WP_XIAMI_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-xiami/function.php on line 4
    • > PHP Fatal error
      require(): Failed opening required 'WP_XIAMI_PATH/class.fetchjs.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-xiami/function.php on line 4

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: xiami, html5, flash

wp-xiami/wp-xiami.php Passed 13 tests

The primary PHP file in "WP-Xiami 虾米音乐同步" version 0.0.8 is used by WordPress to initiate all plugin functionality
60 characters long description:
虾米音乐同步 WP-Xiami for wordpress xiami music player

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin869 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP815029696
JavaScript5098146
HTML30025
CSS22182

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity29.00
▷ Minimum class complexity11.00
▷ Maximum class complexity43.00
Average method complexity3.55
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods33
▷ Static methods00.00%
▷ Public methods3193.94%
▷ Protected methods00.00%
▷ Private methods26.06%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants22
▷ Global constants418.18%
▷ Class constants1881.82%
▷ Public constants18100.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
static/images/wpxm.png2.61KB1.24KB▼ 52.43%
static/images/icon.png1.64KB0.65KB▼ 60.19%