72% yt-video-importer-lite

Code Review | YouTube Video Importer Lite

WordPress plugin YouTube Video Importer Lite scored72%from 54 tests.

About plugin

  • Plugin page: yt-video-importer...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.3
  • WordPress version: 6.3.1
  • First release: Jan 25, 2018
  • Latest release: Nov 19, 2019
  • Number of updates: 12
  • Update frequency: every 55.3 days
  • Top authors: constantin.boiangiu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /4,625 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

Analyzing server-side resources used by YouTube Video Importer Lite
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1142.66 ▲2.06
Dashboard /wp-admin3.32 ▼0.0336.67 ▼30.63
Posts /wp-admin/edit.php3.39 ▲0.0438.88 ▼13.46
Add New Post /wp-admin/post-new.php5.73 ▼0.1577.14 ▼20.99
Media Library /wp-admin/upload.php3.32 ▲0.1039.05 ▲0.92
Videos /wp-admin/admin.php?page=cbc_videos3.4329.85
Go PRO! /wp-admin/edit.php?post_type=video&page=go-pro3.2932.94
Add new /wp-admin/post-new.php?post_type=video3.3040.93
All videos /wp-admin/edit.php?post_type=video3.3737.11
Video categories /wp-admin/edit-tags.php?taxonomy=videos&post_type=video3.5134.96
Video tags /wp-admin/edit-tags.php?taxonomy=video_tag&post_type=video3.3135.73
Import videos /wp-admin/edit.php?post_type=video&page=cbc_import3.3028.50
About /wp-admin/admin.php?page=cbc_about3.2933.11
Settings /wp-admin/edit.php?post_type=video&page=cbc_settings3.3041.19

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 67 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
cbc_plugin_review_callout
db_upgraded
can_compress_scripts
widget_cbc-latest-videos-widget
theysaidso_admin_options
widget_recent-posts
widget_cbc-taxonomy-video-widget

Browser metrics Passed 4 tests

YouTube Video Importer Lite: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲9214.31 ▼0.072.36 ▲0.4744.92 ▲2.55
Dashboard /wp-admin2,241 ▲645.63 ▲0.0383.87 ▼4.0774.78 ▲34.55
Posts /wp-admin/edit.php2,146 ▲432.16 ▲0.1235.86 ▼1.3836.32 ▲0.82
Add New Post /wp-admin/post-new.php6,498 ▲4,95328.71 ▲5.331,068.64 ▲409.1437.78 ▼13.51
Media Library /wp-admin/upload.php1,440 ▲374.19 ▼0.03103.49 ▼1.5580.85 ▲33.30
Videos /wp-admin/admin.php?page=cbc_videos2511.179.336.16
Go PRO! /wp-admin/edit.php?post_type=video&page=go-pro1,2416.9978.2269.67
Add new /wp-admin/post-new.php?post_type=video1,0962.0928.5629.32
All videos /wp-admin/edit.php?post_type=video1,2242.0833.5233.06
Video categories /wp-admin/edit-tags.php?taxonomy=videos&post_type=video1,3202.1425.2329.65
Video tags /wp-admin/edit-tags.php?taxonomy=video_tag&post_type=video1,2952.1530.9136.14
Import videos /wp-admin/edit.php?post_type=video&page=cbc_import1,0232.2729.5829.67
About /wp-admin/admin.php?page=cbc_about1,5088.69215.1354.53
Settings /wp-admin/edit.php?post_type=video&page=cbc_settings2,3352.3347.8152.57

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options detected upon uninstall: 9 options
    • widget_cbc-latest-videos-widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_cbc-taxonomy-video-widget
    • cbc_plugin_review_callout
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=video&page=cbc_settings
    • > User deprecated in wp-includes/functions.php+5828
    Hook contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.
    • > GET request to /wp-admin/post-new.php?post_type=video
    • > Notice in wp-includes/admin-bar.php+794
    Trying to get property 'post_type' of non-object

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 30× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'YVIL_PATHincludes/libs/video.class.php' (include_path='.:/usr/share/php') in wp-content/plugins/yt-video-importer-lite/includes/libs/youtube-api-query.class.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/yt-video-importer-lite/views/import_videos.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'YVIL_Page_Init' not found in wp-content/plugins/yt-video-importer-lite/includes/admin/libs/settings.page.class.php:3
    • > PHP Warning
      require_once(YVIL_PATHincludes/libs/custom-post-type.class.php): failed to open stream: No such file or directory in wp-content/plugins/yt-video-importer-lite/includes/admin/libs/class-cbc-admin-ajax.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'YVIL_PATHincludes/admin/libs/class-cbc-admin-ajax.php' (include_path='.:/usr/share/php') in wp-content/plugins/yt-video-importer-lite/includes/admin/libs/class-cbc-admin.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'YVIL_PATHincludes/libs/custom-post-type.class.php' (include_path='.:/usr/share/php') in wp-content/plugins/yt-video-importer-lite/includes/admin/libs/class-cbc-admin-ajax.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'YVIL_Page_Init' not found in wp-content/plugins/yt-video-importer-lite/includes/admin/libs/manual-import.page.class.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/yt-video-importer-lite/includes/libs/videos-taxonomy-widget.class.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/yt-video-importer-lite/views/plugin_settings.php:5
    • > 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/yt-video-importer-lite/includes/admin/libs/video-list-table.class.php on line 6

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=cbc_videos
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'split')" "TypeError: Cannot read properties of undefined (reading 'split')\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/yt-video-importer-lite/assets/back-end/js/video-list-modal.js?ver=1.0:23:48)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=cbc_videos
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: Cannot read properties of undefined (reading 'split')
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cbc_about
    • > Other (warning) in unknown
    https://www.youtube.com/s/player/99faf012/www-widgetapi.vflset/www-widgetapi.js 1235 Unrecognized feature: 'web-share'.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: video import, youtube channel, video post, youtube importer, youtube video post

yt-video-importer-lite/main.php 85% from 13 tests

The main PHP file in "YouTube Video Importer Lite" ver. 1.0.3 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("yt-video-importer-lite.php" instead of "main.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 145 characters long)

Code Analysis Passed 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
There were no executable files found in this plugin7,149 lines of code in 55 files:
LanguageFilesBlank linesComment linesLines of code
PHP339902,2755,832
JavaScript13170137869
CSS9687448

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity16.63
▷ Minimum class complexity1.00
▷ Maximum class complexity74.00
Average method complexity2.96
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes26
▷ Abstract classes27.69%
▷ Concrete classes2492.31%
▷ Final classes00.00%
Methods217
▷ Static methods00.00%
▷ Public methods17781.57%
▷ Protected methods00.00%
▷ Private methods4018.43%
Functions61
▷ Named functions61100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
8 PNG files occupy 0.03MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/back-end/images/delete-small.png0.81KB0.59KB▼ 27.37%
themes/default/assets/images/collapse.png0.38KB0.39KB0.00%
themes/default/assets/images/expand.png0.38KB0.40KB0.00%
assets/back-end/images/yt-video-id-example.png21.85KB10.42KB▼ 52.32%
assets/back-end/images/success-small.png0.58KB0.58KB0.00%