65% embed-video-thumbnail

Code Review | Embed Video Thumbnail

WordPress plugin Embed Video Thumbnail scored65%from 54 tests.

About plugin

  • Plugin page: embed-video-thumb...
  • Plugin version: 2.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.4
  • WordPress version: 6.3.1
  • First release: Feb 12, 2017
  • Latest release: May 2, 2020
  • Number of updates: 122
  • Update frequency: every 9.6 days
  • Top authors: ikanaweb (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

500+ active /25,043 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲1.81MB] [CPU: ▲1,143.87ms] 50% from 4 tests

An overview of server-side resources used by Embed Video Thumbnail
The following require your attention
  • CPU: Try to keep total CPU usage under 500.00ms (currently 805.34ms on /wp-admin/tools.php?page=ikanaweb_evt_options)
  • Extra CPU: Extra CPU usage must be kept under 200.00ms (currently 1,143.87ms on /wp-admin/tools.php?page=ikanaweb_evt_options)
PageMemory (MB)CPU Time (ms)
Home /5.29 ▲1.7958.28 ▲16.24
Dashboard /wp-admin5.52 ▲2.183,630.40 ▲3,579.82
Posts /wp-admin/edit.php5.25 ▲1.86653.94 ▲599.95
Add New Post /wp-admin/post-new.php7.73 ▲1.80690.17 ▲585.11
Media Library /wp-admin/upload.php5.08 ▲1.813,413.05 ▲3,374.16
Redux Framework /wp-admin/tools.php?page=redux-about5.06626.23
Embed Video Thumbnail /wp-admin/tools.php?page=ikanaweb_evt_options5.66805.34

Server storage [IO: ▲2.92MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 396 new files
Database: no new tables, 10 new options
New WordPress options
ikanaweb_evt
db_upgraded
can_compress_scripts
widget_ikevt_widget
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
ikanaweb_evt-transients
widget_recent-posts
redux_version_upgraded_from

Browser metrics Passed 4 tests

Embed Video Thumbnail: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,967 ▲20613.52 ▼1.0111.61 ▲9.8539.04 ▼7.48
Dashboard /wp-admin2,268 ▲885.63 ▼0.0283.13 ▼4.3345.62 ▲2.95
Posts /wp-admin/edit.php2,108 ▲81.97 ▼0.0534.46 ▼5.2235.15 ▼1.11
Add New Post /wp-admin/post-new.php1,543 ▲1518.07 ▼4.93619.08 ▲8.7664.55 ▲12.83
Media Library /wp-admin/upload.php1,408 ▲84.12 ▼0.0894.10 ▼10.7146.23 ▲1.57
Redux Framework /wp-admin/tools.php?page=redux-about1,0843.6272.7365.50
Embed Video Thumbnail /wp-admin/tools.php?page=ikanaweb_evt_options2,3134.5885.31103.08

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 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
  • This plugin does not fully uninstall, leaving 10 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • redux_version_upgraded_from
    • ikanaweb_evt-transients
    • widget_recent-comments
    • widget_ikevt_widget
    • ikanaweb_evt
    • widget_recent-posts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/tools.php?page=ikanaweb_evt_options
    • > Error in wp-includes/Requests/src/Exception/InvalidArgument.php+29
    Uncaught WpOrg\Requests\Exception\InvalidArgument: WpOrg\Requests\Cookie::__construct(): Argument #1 ($name) must be of type string, integer given in wp-includes/Requests/src/Exception/InvalidArgument.php:29
    Stack trace:
    #0 wp-includes/Requests/src/Cookie.php(84): WpOrg\Requests\Exception\InvalidArgument::create()
    #1 wp-includes/class-wp-http.php(472): WpOrg\Requests\Cookie->__construct()
    #2 wp-includes/class-wp-http.php(352): WP_Http::normalize_cookies()
    #3 wp-includes/http.php(150): WP_Http->request()
    #4 wp-content/plugins/embed-video-thumbnail/admin/redux-framework/inc/class.p.php(219): wp_remote_request()
    #5 wp-includes/class-wp-hook.php(310): Redux_P->proxy()
    #6 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #7 wp-includes/plugin.php(517): WP_Hook->do_action()
    #8 wp-admin/admin-ajax.php(188): do_action()

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
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/embed-video-thumbnail/src/Template/iframe.php
    • > /wp-content/plugins/embed-video-thumbnail/src/Template/srcdoc.php
    • > /wp-content/plugins/embed-video-thumbnail/src/Template/ie.php
  • 55× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/embed-video-thumbnail/admin/redux-framework/templates/panel/container.tpl.php:9
    • > PHP Notice
      Undefined variable: templateVars in wp-content/plugins/embed-video-thumbnail/src/Template/ie.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/embed-video-thumbnail/src/Template/ie.php on line 2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/embed-video-thumbnail/admin/redux-framework/templates/panel/footer.tpl.php:14
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/embed-video-thumbnail/src/Template/ie.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Panel' not found in wp-content/plugins/embed-video-thumbnail/admin/redux-framework/inc/extensions/customizer/inc/customizer_panel.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Ikana\\EmbedVideoThumbnail\\Provider\\AbstractProvider' not found in wp-content/plugins/embed-video-thumbnail/src/Provider/Twitch.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/embed-video-thumbnail/admin/redux-framework/inc/welcome/views/credits.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Section' not found in wp-content/plugins/embed-video-thumbnail/admin/redux-framework/inc/extensions/customizer/inc/customizer_section.php:12
    • > PHP Notice
      Undefined variable: templateVars in wp-content/plugins/embed-video-thumbnail/src/Template/ie.php on line 4

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
    • > GET request to /wp-admin/tools.php?page=ikanaweb_evt_options
    • > Deprecation (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1 Listener added for a synchronous 'DOMSubtreeModified' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead.
    • > GET request to /wp-admin/tools.php?page=ikanaweb_evt_options
    • > Network (severe)
    wp-admin/admin-ajax.php?action=redux_p&nonce=e223b7ec25&url=http%3A%2F%2Flook.redux.io%2Fapi%2Findex.php%3Fjs%26g%261%26v%3D2&proxy=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin-ajax.php%3Faction%3Dredux_p%26nonce%3De223b7ec25%26url%3D - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/tools.php?page=ikanaweb_evt_options
    • > Security (severe) in unknown
    /wp-admin/tools.php?page=ikanaweb_evt_options - Refused to execute script from '/wp-admin/admin-ajax.php?action=redux_p&nonce=e223b7ec25&url=http%3A%2F%2Flook.redux.io%2Fapi%2Findex.php%3Fjs%26g%261%26v%3D2&proxy=http%3A%2F%2Fwp.com%2Fwp-admin%2Fadmin-ajax.php%3Faction%3Dredux_p%26nonce%3De223b7ec25%26url%3D' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

Optimizations

Plugin configuration 83% 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
These attributes need your attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === embed-video-thumbnail === )
  • Contributors: The plugin contributors field is not present
  • Tags: Please reduce the number of tags, currently 16 tag instead of maximum 10
The official readme.txt is a good inspiration

embed-video-thumbnail/embed-video-thumbnail.php 85% from 13 tests

"Embed Video Thumbnail" version 2.0.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Domain Path: You should use only dashes and lowercase characters for the domain path ("lang")
  • Domain Path: The domain path should be prefixed with a forward slash character ("/lang")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin44,874 lines of code in 422 files:
LanguageFilesBlank linesComment linesLines of code
PHP1393,8426,82918,550
JavaScript1683,2552,54815,402
Sass541,187607,580
CSS5116554996
JSON41840979
SVG100934
PO File278102245
Markdown134080
Bourne Shell124055
LESS10053

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please tend to the following items
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 113)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity29.25
▷ Minimum class complexity1.00
▷ Maximum class complexity883.00
Average method complexity5.85
▷ Minimum method complexity1.00
▷ Maximum method complexity113.00
Code structure
Namespaces6
Interfaces1
Traits0
Classes123
▷ Abstract classes21.63%
▷ Concrete classes12198.37%
▷ Final classes10.83%
Methods731
▷ Static methods11615.87%
▷ Public methods57578.66%
▷ Protected methods9913.54%
▷ Private methods577.80%
Functions14
▷ Named functions1285.71%
▷ Anonymous functions214.29%
Constants76
▷ Global constants1013.16%
▷ Class constants6686.84%
▷ Public constants66100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
35 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/redux-framework/assets/css/vendor/jquery-ui-bootstrap/images/ui-icons_f6cf3b_256x240.png8.68KB4.11KB▼ 52.68%
admin/redux-framework/assets/css/vendor/jquery-ui-bootstrap/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
admin/redux-framework/inc/fields/switch/slider-control.png1.65KB0.75KB▼ 54.62%
admin/redux-framework/assets/img/toggle_tabs.png0.35KB0.35KB0.00%
admin/redux-framework/assets/img/1c.png0.13KB0.13KB▼ 0.72%