77% hdw-player-video-player-video-gallery

Code Review | HDW Player Plugin (Video Player & Video Gallery)

WordPress plugin HDW Player Plugin (Video Player & Video Gallery) scored 77% from 54 tests.

About plugin

  • Plugin page: hdw-player-video-...
  • Plugin version: 5.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8.6-5.1
  • WordPress version: 6.3.1
  • First release: Jul 27, 2013
  • Latest release: Mar 5, 2019
  • Number of updates: 71
  • Update frequency: every 28.8 days
  • Top authors: hdw player (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

1,000+ active / 88,429 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.14MB] [CPU: ▼2.69ms] Passed 4 tests

An overview of server-side resources used by HDW Player Plugin (Video Player & Video Gallery)
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1340.19 ▲2.88
Dashboard /wp-admin3.44 ▲0.1447.82 ▼1.42
Posts /wp-admin/edit.php3.56 ▲0.2046.65 ▼3.18
Add New Post /wp-admin/post-new.php6.02 ▲0.1490.55 ▼9.05
Media Library /wp-admin/upload.php3.37 ▲0.1440.12 ▲3.97
Playlist /wp-admin/admin.php?page=playlist3.3234.30
Documentation /wp-admin/admin.php?page=documentation3.3432.17
Gallery /wp-admin/admin.php?page=gallery3.3232.92
Videos /wp-admin/admin.php?page=videos3.3333.78
HDW Player /wp-admin/admin.php?page=hdwplayer3.3336.22

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 57 new files
Database: 4 new tables, 7 new options
New tables
wp_hdwplayer
wp_hdwplayer_videos
wp_hdwplayer_gallery
wp_hdwplayer_playlist
New WordPress options
hdwplayer_version
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

HDW Player Plugin (Video Player & Video Gallery): an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,962 ▲22713.87 ▼0.528.23 ▲6.6339.02 ▼2.83
Dashboard /wp-admin2,247 ▲594.84 ▼0.05106.05 ▼8.7438.91 ▼5.69
Posts /wp-admin/edit.php2,130 ▲381.98 ▼0.0735.25 ▼3.8035.21 ▲0.17
Add New Post /wp-admin/post-new.php1,561 ▲2823.60 ▲0.37658.35 ▼4.6851.61 ▼3.62
Media Library /wp-admin/upload.php1,432 ▲414.28 ▼0.0898.18 ▲1.7740.34 ▼1.93
Playlist /wp-admin/admin.php?page=playlist9402.0323.8525.83
Documentation /wp-admin/admin.php?page=documentation9342.1423.7727.33
Gallery /wp-admin/admin.php?page=gallery9402.0924.2525.45
Videos /wp-admin/admin.php?page=videos1,0262.0724.0926.64
HDW Player /wp-admin/admin.php?page=hdwplayer1,0282.0424.7425.70

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=hdwplayer
    • > Notice in wp-content/plugins/hdw-player-video-player-video-gallery/hdwplayer/__default.php+17
    Undefined index: opt
    • > GET request to /wp-admin/admin.php?page=playlist
    • > Warning in wp-content/plugins/hdw-player-video-player-video-gallery/playlist/__grid.php+54
    Declaration of Hdwplayer_Playlist_Table::prepare_items($data, $table_name, $wpdb) should be compatible with WP_List_Table::prepare_items()
    • > GET request to /wp-admin/admin.php?page=gallery
    • > Warning in wp-content/plugins/hdw-player-video-player-video-gallery/gallery/__grid.php+54
    Declaration of Hdwplayer_Gallery_Table::prepare_items($data, $table_name, $wpdb) should be compatible with WP_List_Table::prepare_items()
    • > GET request to /wp-admin/admin.php?page=videos
    • > Warning in wp-content/plugins/hdw-player-video-player-video-gallery/videos/__grid.php+109
    Declaration of Hdwplayer_Videos_Table::prepare_items($data, $table_name, $wpdb, $category) should be compatible with WP_List_Table::prepare_items()
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=videos
    • > Notice in wp-content/plugins/hdw-player-video-player-video-gallery/videos/__grid.php+44
    Undefined offset: 1
    • > GET request to /wp-admin/admin.php?page=videos
    • > Notice in wp-content/plugins/hdw-player-video-player-video-gallery/videos/__grid.php+41
    Undefined offset: -1
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=videos
    • > Notice in wp-content/plugins/hdw-player-video-player-video-gallery/videos/__grid.php+44
    Trying to get property 'playlistid' of non-object
    • > GET request to /wp-admin/admin.php?page=hdwplayer
    • > Warning in wp-content/plugins/hdw-player-video-player-video-gallery/hdwplayer/__grid.php+73
    Declaration of Hdwplayer_Table::prepare_items($data, $table_name, $wpdb, $category) should be compatible with WP_List_Table::prepare_items()

SRP 50% 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
  • 56× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/hdw-player-video-player-video-gallery/videos/__add.php:67
    • > PHP Notice
      Undefined index: edited in wp-content/plugins/hdw-player-video-player-video-gallery/gallery/__edit.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/hdw-player-video-player-video-gallery/config.php:9
    • > PHP Notice
      Undefined index: page in wp-content/plugins/hdw-player-video-player-video-gallery/playlist/__delete.php on line 6
    • > PHP Notice
      Undefined index: opt in wp-content/plugins/hdw-player-video-player-video-gallery/playlist/__default.php on line 10
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/hdw-player-video-player-video-gallery/playlist/__grid.php on line 3
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/hdw-player-video-player-video-gallery/videos/__default.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/hdw-player-video-player-video-gallery/videos/__grid.php on line 3
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/hdw-player-video-player-video-gallery/gallery/__default.php on line 4
    • > PHP Notice
      Undefined index: edited in wp-content/plugins/hdw-player-video-player-video-gallery/gallery/__add.php on line 6

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
  • Screenshots: Please add descriptions for these screenshots #10, #11, #9, #0, #0 in hdw-player-video-player-video-gallery/assets to your readme.txt
  • Screenshots: Add an image for screenshot #5 (Playlist page)
The official readme.txt might help

hdw-player-video-player-video-gallery/index.php 92% from 13 tests

This is the main PHP file of "HDW Player Plugin (Video Player & Video Gallery)" version 5.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("hdw-player-video-player-video-gallery.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin4,050 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
PHP292841332,352
JavaScript757291,412
CSS2171286

PHP code Passed 2 tests

This is a very shot review 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.22
Average class complexity8.40
▷ Minimum class complexity4.00
▷ Maximum class complexity15.00
Average method complexity2.09
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods34
▷ Static methods00.00%
▷ Public methods3397.06%
▷ Protected methods12.94%
▷ Private methods00.00%
Functions21
▷ Named functions21100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
6 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/buttons.png3.12KB0.20KB▼ 93.48%
assets/inner1.png0.91KB0.84KB▼ 7.53%
assets/outer.png1.33KB1.34KB0.00%
assets/inner.png1.35KB1.35KB0.22%
assets/outer1.png0.93KB0.84KB▼ 9.48%