10% knr-player

Code Review | KNR Player

WordPress plugin KNR Player scored10%from 54 tests.

About plugin

  • Plugin page: knr-player
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.3
  • WordPress version: 6.3.1
  • First release: Dec 5, 2019
  • Latest release: Dec 5, 2019
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: prorakib (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /805 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/knr-player/includes/class-knr-player-activator.php+58
    Non-static method Knr_Player_Activator::knrPlayerTable() should not be called statically

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

Analyzing server-side resources used by KNR Player
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1539.02 ▼0.04
Dashboard /wp-admin3.45 ▲0.1547.82 ▼0.22
Posts /wp-admin/edit.php3.56 ▲0.2144.77 ▼0.85
Add New Post /wp-admin/post-new.php6.05 ▲0.1680.72 ▼8.94
Media Library /wp-admin/upload.php3.37 ▲0.1536.23 ▲2.57
Add new audio /wp-admin/admin.php?page=knr_audio3.3430.76
KNR Player /wp-admin/admin.php?page=knr_player3.3429.30

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 41 new files
Database: 1 new table, 6 new options
New tables
wp_knr_player
New WordPress options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for KNR Player
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,951 ▲20513.73 ▼0.937.40 ▲5.7134.35 ▼7.87
Dashboard /wp-admin2,235 ▲475.89 ▲0.8495.74 ▼7.4233.20 ▼10.07
Posts /wp-admin/edit.php2,121 ▲322.08 ▲0.1135.19 ▼2.9026.02 ▼7.29
Add New Post /wp-admin/post-new.php1,551 ▲2318.29 ▼5.05607.86 ▼84.2659.14 ▲3.65
Media Library /wp-admin/upload.php1,423 ▲324.21 ▼0.1096.65 ▼6.5639.97 ▼6.90
Add new audio /wp-admin/admin.php?page=knr_audio9261.9932.6123.58
KNR Player /wp-admin/admin.php?page=knr_player8181.8024.7519.29

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

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 no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/knr-player/public/partials/knr-player-public-display.php
    • > /wp-content/plugins/knr-player/admin/partials/knr-player-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
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 important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (14 tag instead of maximum 10)
You can look at the official readme.txt

knr-player/knr-player.php Passed 13 tests

The main file in "KNR Player" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
107 characters long description:
Create awesome audio player that is compatible with all major browsers and devices (Android, iPhone, iPad).

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected1,992 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP12213580685
CSS25026590
JavaScript210062406
SVG505227
PO File1303184

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity8.43
▷ Minimum class complexity1.00
▷ Maximum class complexity40.00
Average method complexity2.68
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods31
▷ Static methods26.45%
▷ Public methods2580.65%
▷ Protected methods00.00%
▷ Private methods619.35%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
7 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/player/next.png3.94KB1.54KB▼ 60.95%
includes/images/player/prev.png4.38KB1.55KB▼ 64.66%
includes/images/player-bg.png3.08KB1.83KB▼ 40.65%
includes/images/player/stop.png3.28KB0.59KB▼ 81.93%
includes/images/player/pause.png3.36KB0.66KB▼ 80.52%