74% dragon-video

Code Review | Dragon Video

WordPress plugin Dragon Video scored 74% from 54 tests.

About plugin

  • Plugin page: dragon-video
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.9
  • WordPress version: 6.3.1
  • First release: Jul 10, 2013
  • Latest release: Apr 17, 2014
  • Number of updates: 9
  • Update frequency: every 31.2 days
  • Top authors: DexterTheDragon (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,674 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

A check of server-side resources used by Dragon Video
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1546.13 ▲5.95
Dashboard /wp-admin3.45 ▲0.1446.14 ▼2.15
Posts /wp-admin/edit.php3.56 ▲0.2043.62 ▼3.24
Add New Post /wp-admin/post-new.php6.03 ▲0.1486.75 ▼12.74
Media Library /wp-admin/upload.php3.37 ▲0.1436.72 ▲2.11

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 336 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Dragon Video
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲8413.27 ▼0.761.95 ▲0.0141.88 ▲0.43
Dashboard /wp-admin2,225 ▲335.83 ▲0.86103.61 ▼1.7537.68 ▼4.23
Posts /wp-admin/edit.php2,105 ▲162.01 ▼0.0136.99 ▲2.0731.47 ▼0.56
Add New Post /wp-admin/post-new.php1,556 ▲2318.10 ▼4.67611.48 ▼63.7684.71 ▲9.38
Media Library /wp-admin/upload.php1,407 ▲194.24 ▲0.1198.94 ▼9.1241.54 ▼4.07

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

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
Even though everything seems fine, this is not an exhaustive test

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
  • 38× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function DragonVideo\\get_option() in wp-content/plugins/dragon-video/lib/DragonVideo/DragonVideo.php:37
    • > PHP Fatal error
      Uncaught Error: Class 'Services_Zencoder_Object' not found in wp-content/plugins/dragon-video/trunk/vendor/zencoder/zencoder-php/Services/Zencoder/Thumbnail.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function DragonVideo\\get_option() in wp-content/plugins/dragon-video/trunk/lib/DragonVideo/ZencoderEncoder.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Services_Zencoder_Object' not found in wp-content/plugins/dragon-video/trunk/vendor/zencoder/zencoder-php/Services/Zencoder/Error.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function DragonVideo\\add_action() in wp-content/plugins/dragon-video/lib/DragonVideo/VideoJsPlayer.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function DragonVideo\\get_option() in wp-content/plugins/dragon-video/lib/DragonVideo/ZencoderEncoder.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Services_Zencoder_HttpProxy' not found in wp-content/plugins/dragon-video/vendor/zencoder/zencoder-php/Services/Zencoder/Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Services_Zencoder_Base' not found in wp-content/plugins/dragon-video/trunk/vendor/zencoder/zencoder-php/Services/Zencoder/Jobs.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Services_Zencoder_Exception' not found in wp-content/plugins/dragon-video/trunk/vendor/zencoder/zencoder-php/Services/Zencoder/Http.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Services_Zencoder_Base' not found in wp-content/plugins/dragon-video/vendor/zencoder/zencoder-php/Services/Zencoder/Outputs.php:13

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
2 plugin tags: html5, video

dragon-video/videojs-player.php 92% from 13 tests

The main PHP file in "Dragon Video" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("dragon-video.php" instead of "videojs-player.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
These items require your attention
  • For security reasons, never distribute binary or executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/dragon-video/vendor/zencoder/zencoder-php/Services/Zencoder/zencoder_ca_chain.crt
      • wp-content/plugins/dragon-video/trunk/vendor/zencoder/zencoder-php/Services/Zencoder/zencoder_ca_chain.crt
28,709 lines of code in 117 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript383,3494,52513,321
HTML31936,237
CSS92031495,537
XML1201,577
PHP312266611,390
SVG3144369
Markdown2500209
JSON20069

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.41
Average class complexity8.65
▷ Minimum class complexity1.00
▷ Maximum class complexity77.00
Average method complexity3.26
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces2
Interfaces2
Traits0
Classes50
▷ Abstract classes24.00%
▷ Concrete classes4896.00%
▷ Final classes00.00%
Methods184
▷ Static methods63.26%
▷ Public methods16690.22%
▷ Protected methods42.17%
▷ Private methods147.61%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
60 PNG files occupy 0.24MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/zencoder/zencoder-php/Documentation/img/iviewer/iviewer.zoom_fit.png1.22KB0.30KB▼ 75.72%
trunk/vendor/zencoder/zencoder-php/Documentation/img/apple-touch-icon.png8.16KB3.82KB▼ 53.23%
trunk/vendor/zencoder/zencoder-php/Documentation/img/icons/icon-th-big.png0.10KB0.10KB0.00%
vendor/zencoder/zencoder-php/Documentation/img/icons/visibility_public.png3.37KB0.89KB▼ 73.57%
trunk/vendor/zencoder/zencoder-php/Documentation/img/icons/ok.png3.60KB0.90KB▼ 74.95%