94% dplayer-for-wp

Code Review | DPlayer for WordPress

WordPress plugin DPlayer for WordPress scored 94% from 54 tests.

About plugin

  • Plugin page: dplayer-for-wp
  • Plugin version: 1.2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.8
  • WordPress version: 5.9.2
  • First release: Sep 23, 2016
  • Latest release: Nov 13, 2018
  • Number of updates: 41
  • Update frequency: every 19.1 days
  • Top authors: 0xbbc (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active / 6,601 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼309.61ms] Passed 4 tests

A check of server-side resources used by DPlayer for WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.07326.38 ▲271.74
Dashboard /wp-admin3.43 ▲0.0234.87 ▲0.29
Posts /wp-admin/edit.php3.65 ▲0.0141.70 ▼0.35
Add New Post /wp-admin/post-new.php6.89 ▼0.0896.55 ▼1,239.01
Media Library /wp-admin/upload.php3.30 ▲0.0123.73 ▲0.63
DPlayer /wp-admin/options-general.php?page=kblog-dplayer3.2723.72

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 4 new options
New WordPress options
kblog_danmaku_dplayer_version_check
kblog_danmaku_token
kblog_danmaku_dplayer_version
kblog_danmaku_url

Browser metrics Passed 4 tests

DPlayer for WordPress: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,806 ▲5216.04 ▲0.0416.26 ▲9.342.37 ▼0.24
Dashboard /wp-admin2,897 ▲366.14 ▼0.05118.72 ▼32.78161.76 ▼12.24
Posts /wp-admin/edit.php2,696 ▲23.24 ▲0.0163.44 ▼0.68145.21 ▼9.04
Add New Post /wp-admin/post-new.php1,664 ▲716.01 ▼3.47442.13 ▲7.55160.78 ▼31.29
Media Library /wp-admin/upload.php1,703 ▲55.53 ▲0.03139.55 ▼11.45189.95 ▼2.05
DPlayer /wp-admin/options-general.php?page=kblog-dplayer1,1092.3853.41184.88

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
The following issues need your attention
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/dplayer-for-wp/dplayer-admin.php:147
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/dplayer-for-wp/dplayer-admin.php:147

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 issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: You should set the name of your plugin on the first line ( === dplayer-for-wp === )
Please take inspiration from this readme.txt

dplayer-for-wp/dplayer.php 92% from 13 tests

"DPlayer for WordPress" version 1.2.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("dplayer-for-wp.php" instead of "dplayer.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
Everything looks great! No dangerous files found in this plugin323 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP24537290
JavaScript30133

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity35.00
▷ Minimum class complexity10.00
▷ Maximum class complexity60.00
Average method complexity5.53
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods853.33%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin