83% ni-youtube-video-gallery

Code Review | Ni Youtube Video Gallery

WordPress plugin Ni Youtube Video Gallery scored83%from 54 tests.

About plugin

  • Plugin page: ni-youtube-video-...
  • Plugin version: 2.1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2
  • WordPress version: 6.3.1
  • First release: Apr 22, 2015
  • Latest release: May 12, 2023
  • Number of updates: 30
  • Update frequency: every 98.1 days
  • Top authors: anzia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /883 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.04MB] [CPU: ▼2.52ms] Passed 4 tests

Server-side resources used by Ni Youtube Video Gallery
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0541.85 ▼3.08
Dashboard /wp-admin3.35 ▲0.0451.37 ▼3.15
Posts /wp-admin/edit.php3.40 ▲0.0450.79 ▲2.17
Add New Post /wp-admin/post-new.php5.93 ▲0.0489.28 ▼0.87
Media Library /wp-admin/upload.php3.27 ▲0.0436.38 ▼2.96
Video /wp-admin/edit.php?post_type=video_post_type3.3135.54
Video Category /wp-admin/edit-tags.php?taxonomy=video_taxonomy&post_type=video_post_type3.2632.48
Add New /wp-admin/post-new.php?post_type=video_post_type3.4051.79

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Ni Youtube Video Gallery
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲9113.28 ▼1.101.89 ▼0.2545.05 ▲0.93
Dashboard /wp-admin2,239 ▲515.84 ▼0.02102.02 ▼9.7171.33 ▲24.96
Posts /wp-admin/edit.php2,116 ▲272.01 ▲0.0233.99 ▼3.4039.35 ▲1.65
Add New Post /wp-admin/post-new.php1,540 ▲1817.50 ▼5.49733.12 ▲53.6856.23 ▼3.17
Media Library /wp-admin/upload.php1,418 ▲334.13 ▼0.02110.92 ▼6.2951.38 ▲3.83
Video /wp-admin/edit.php?post_type=video_post_type1,1241.9633.3330.13
Video Category /wp-admin/edit-tags.php?taxonomy=video_taxonomy&post_type=video_post_type1,2922.1428.1934.09
Add New /wp-admin/post-new.php?post_type=video_post_type2,3177.71166.47142.49

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/ni-youtube-video-gallery/include/single-video_post_type.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ni-youtube-video-gallery/include/ni-page-templater.php:139
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/ni-youtube-video-gallery/include/video-list-template.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ni-youtube-video-gallery/include/ni-video.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% 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 take inspiration from this readme.txt

ni-youtube-video-gallery/ni-youtube-video-gallery.php 92% from 13 tests

The entry point to "Ni Youtube Video Gallery" version 2.1.1 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 190 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
Everything looks great! No dangerous files found in this plugin362 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP57695328
CSS151834

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity10.50
▷ Minimum class complexity5.00
▷ Maximum class complexity16.00
Average method complexity2.27
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods16.67%
▷ Public methods1493.33%
▷ Protected methods00.00%
▷ Private methods16.67%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
17 PNG files occupy 1.52MB with 0.46MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png92.24KB28.22KB▼ 69.40%
images/play-arrow.png1.28KB1.42KB0.00%
screenshot-4.png87.93KB27.34KB▼ 68.90%
images/video2.png1.17KB1.03KB▼ 12.41%
images/icon.png0.41KB0.52KB0.00%