65% haru-vidi

Code Review | Haru Vidi - Video Manager WordPress

WordPress plugin Haru Vidi - Video Manager WordPress scored 65% from 54 tests.

About plugin

  • Plugin page: haru-vidi
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.5
  • WordPress version: 5.8.1
  • First release: Aug 19, 2020
  • Latest release: Nov 2, 2020
  • Number of updates: 13
  • Update frequency: every 5.8 days
  • Top authors: harutheme (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 613 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲5.99MB] [CPU: ▼86.81ms] 50% from 4 tests

This is a short check of server-side resources used by Haru Vidi - Video Manager WordPress
The following require your attention
  • RAM: Total memory usage must be kept under 10MB (currently 12.74MB on /wp-admin/post-new.php?post_type=haru_video)
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.99MB on /wp-admin/edit-tags.php?taxonomy=director_category&post_type=haru_director)
PageMemory (MB)CPU Time (ms)
Home /8.20 ▲5.3784.11 ▲46.79
Dashboard /wp-admin9.25 ▲6.19105.30 ▲67.34
Posts /wp-admin/edit.php9.33 ▲6.2293.43 ▲44.75
Add New Post /wp-admin/post-new.php13.20 ▲7.77147.91 ▼495.64
Media Library /wp-admin/upload.php9.18 ▲6.1886.95 ▲56.86
Videos /wp-admin/edit.php?post_type=haru_video9.2282.98
Add New /wp-admin/post-new.php?post_type=haru_video_report9.5695.34
Directors /wp-admin/admin.php?page=vidi-directors-settings9.5082.31
Add New /wp-admin/post-new.php?post_type=haru_playlist13.44157.72
Add New /wp-admin/post-new.php?post_type=haru_video12.74143.58
Videos /wp-admin/admin.php?page=vidi-videos-settings9.5082.79
Categories /wp-admin/edit-tags.php?taxonomy=shortcode_category&post_type=haru_shortcode9.1879.58
Series /wp-admin/edit.php?post_type=haru_series9.2283.50
Categories /wp-admin/edit-tags.php?taxonomy=actor_category&post_type=haru_actor9.1878.65
Categories /wp-admin/edit-tags.php?taxonomy=director_category&post_type=haru_director9.1882.04

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 511 new files
Database: no new tables, 8 new options
New WordPress options
widget_haru_widget_video_search
widget_haru_widget_video_videos
widget_haru_widget_video_categories
widget_haru_widget_video_top
widget_haru_widget_playlist_top
widget_haru_widget_video_tags
widget_haru_widget_series_top
widget_haru_widget_channel_top

Browser metrics Passed 4 tests

This is an overview of browser requirements for Haru Vidi - Video Manager WordPress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,301 ▲70616.70 ▲1.2121.43 ▲11.9748.51 ▲2.86
Dashboard /wp-admin3,401 ▲4676.06 ▲0.10150.59 ▼4.15117.17 ▲0.74
Posts /wp-admin/edit.php3,172 ▲4332.91 ▲0.2163.66 ▼16.9089.25 ▲5.23
Add New Post /wp-admin/post-new.php1,904 ▲30021.63 ▲3.10333.13 ▼49.72102.98 ▼7.92
Media Library /wp-admin/upload.php2,241 ▲4315.14 ▲0.13155.87 ▼1.05121.96 ▲3.42
Videos /wp-admin/edit.php?post_type=haru_video1,9892.8773.0079.63
Add New /wp-admin/post-new.php?post_type=haru_video_report2,4063.54120.1083.34
Directors /wp-admin/admin.php?page=vidi-directors-settings2,4793.4894.6782.91
Add New /wp-admin/post-new.php?post_type=haru_playlist6,20616.77511.05121.54
Add New /wp-admin/post-new.php?post_type=haru_video7,28425.05463.72154.96
Videos /wp-admin/admin.php?page=vidi-videos-settings2,4663.58101.6280.94
Categories /wp-admin/edit-tags.php?taxonomy=shortcode_category&post_type=haru_shortcode2,1712.6666.0779.78
Series /wp-admin/edit.php?post_type=haru_series1,9432.8776.7676.09
Categories /wp-admin/edit-tags.php?taxonomy=actor_category&post_type=haru_actor2,1742.6469.3481.99
Categories /wp-admin/edit-tags.php?taxonomy=director_category&post_type=haru_director2,1742.6370.5186.14

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_haru_widget_video_search
    • widget_haru_widget_video_top
    • widget_haru_widget_series_top
    • widget_haru_widget_video_tags
    • widget_haru_widget_playlist_top
    • widget_haru_widget_video_categories
    • widget_haru_widget_video_videos
    • widget_haru_widget_channel_top

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/post-new.php?post_type=haru_video
    • > Warning in wp-admin/includes/template.php+1395
    call_user_func() expects parameter 1 to be a valid callback, function 'pmpro_page_meta' not found or invalid function name

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
Almost there! Just fix the following items
  • 8× PHP files output text when accessed directly:
    • > /wp-content/plugins/haru-vidi/includes/posttypes/video-report.php
    • > /wp-content/plugins/haru-vidi/includes/posttypes/playlist.php
    • > /wp-content/plugins/haru-vidi/includes/posttypes/shortcode-generate.php
    • > /wp-content/plugins/haru-vidi/includes/posttypes/video.php
    • > /wp-content/plugins/haru-vidi/includes/posttypes/channel.php
    • > /wp-content/plugins/haru-vidi/includes/posttypes/actor.php
    • > /wp-content/plugins/haru-vidi/includes/posttypes/director.php
    • > /wp-content/plugins/haru-vidi/includes/posttypes/series.php
  • 185× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/haru-vidi/templates/vidi/director/content-director.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function haru_vidi_get_setting() in wp-content/plugins/haru-vidi/templates/vidi/elements/single-video-player.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/haru-vidi/includes/libraries/cmb2-conditionals/cmb2-conditionals.php:293
    • > PHP Notice
      Undefined variable: count in wp-content/plugins/haru-vidi/templates/vidi/shortcodes/video-list-category.php on line 18
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/haru-vidi/includes/widgets/haru-widget.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function haru_vidi_get_setting() in wp-content/plugins/haru-vidi/templates/vidi/shortcodes/watch-later.php:20
    • > PHP Warning
      Use of undefined constant PLUGIN_HARU_VIDI_DIR - assumed 'PLUGIN_HARU_VIDI_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/haru-vidi/includes/widgets/widgets.php on line 15
    • > PHP Warning
      include_once(): Failed opening 'PLUGIN_HARU_VIDI_DIRincludes/widgets/haru-video-videos.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/haru-vidi/includes/widgets/widgets.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/haru-vidi/includes/libraries/cmb-field-select2/cmb-field-select2.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/haru-vidi/includes/libraries/cmb2/includes/types/CMB2_Type_Taxonomy_Radio.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/post-new.php?post_type=haru_video
    • > Intervention (severe) in unknown
    /wp-admin/post-new.php?post_type=haru_playlist - Blocked attempt to show a 'beforeunload' confirmation panel for a frame that never had a user gesture since its load. https://www.chromestatus.com/feature/5082396709879808
    • > GET request to /wp-admin/admin.php?page=vidi-videos-settings
    • > Intervention (severe) in unknown
    /wp-admin/post-new.php?post_type=haru_video - Blocked attempt to show a 'beforeunload' confirmation panel for a frame that never had a user gesture since its load. https://www.chromestatus.com/feature/5082396709879808

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% 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: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

haru-vidi/haru-vidi.php Passed 13 tests

Analyzing the main PHP file in "Haru Vidi - Video Manager WordPress" version 1.0.2
50 characters long description:
Haru Vidi - A Video WordPress plugin by HaruTheme.

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected104,258 lines of code in 396 files:
LanguageFilesBlank linesComment linesLines of code
PHP2047,80911,88337,776
Sass1054,95256725,491
CSS233,0781,21919,491
SVG310169,126
JavaScript231,4221,7127,187
JSON4004,329
Markdown62800858

PHP code 0% from 2 tests

Analyzing cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 1,209)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 358)
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity34.28
▷ Minimum class complexity1.00
▷ Maximum class complexity1,209.00
Average method complexity4.77
▷ Minimum method complexity1.00
▷ Maximum method complexity358.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes127
▷ Abstract classes129.45%
▷ Concrete classes11590.55%
▷ Final classes00.00%
Methods1,108
▷ Static methods1059.48%
▷ Public methods71064.08%
▷ Protected methods38434.66%
▷ Private methods141.26%
Functions241
▷ Named functions22894.61%
▷ Anonymous functions135.39%
Constants91
▷ Global constants1213.19%
▷ Class constants7986.81%
▷ Public constants79100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
37 PNG files occupy 0.82MB with 0.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/libraries/cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
assets/images/video-single-style-1.png99.02KB31.13KB▼ 68.56%
admin/assets/images/vimeo.png11.25KB4.82KB▼ 57.13%
includes/libraries/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
includes/libraries/cmb2/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%