84% velocity

Code Review | Velocity - Video Lazy Loading for YouTube, Twitch and Vimeo

WordPress plugin Velocity - Video Lazy Loading for YouTube, Twitch and Vimeo scored 84% from 54 tests.

About plugin

  • Plugin page: velocity
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.3.2
  • WordPress version: 6.3.1
  • First release: Mar 3, 2016
  • Latest release: Jan 4, 2020
  • Number of updates: 25
  • Update frequency: every 56.1 days
  • Top authors: dcooney (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

500+ active / 7,569 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼0.99ms] Passed 4 tests

Analyzing server-side resources used by Velocity - Video Lazy Loading for YouTube, Twitch and Vimeo
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.09 ▼1.08
Dashboard /wp-admin3.33 ▲0.0344.77 ▼1.88
Posts /wp-admin/edit.php3.38 ▲0.0249.23 ▲4.76
Add New Post /wp-admin/post-new.php5.94 ▲0.0696.11 ▼1.42
Media Library /wp-admin/upload.php3.25 ▲0.0234.12 ▲0.44
Velocity /wp-admin/options-general.php?page=velocity3.2934.74

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 30 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Velocity - Video Lazy Loading for YouTube, Twitch and Vimeo: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,915 ▲18013.63 ▼0.745.80 ▲4.0544.03 ▼2.94
Dashboard /wp-admin2,215 ▲265.80 ▼0.11116.25 ▼0.3938.61 ▼12.60
Posts /wp-admin/edit.php2,098 ▲92.01 ▲0.0141.26 ▲6.7731.25 ▼2.22
Add New Post /wp-admin/post-new.php1,524 ▼1817.77 ▼0.60648.43 ▲10.8452.18 ▲1.23
Media Library /wp-admin/upload.php1,397 ▲94.20 ▼0.0195.67 ▼16.0536.56 ▼12.23
Velocity /wp-admin/options-general.php?page=velocity1,1703.0341.8594.35

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

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
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/velocity/admin/builder/elements.php:5
    • > PHP Warning
      Use of undefined constant VELOCITY_TAGLINE - assumed 'VELOCITY_TAGLINE' (this will throw an Error in a future version of PHP) in wp-content/plugins/velocity/admin/views/settings.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/velocity/admin/builder/builder.php:2
    • > PHP Warning
      Use of undefined constant VELOCITY_NAME - assumed 'VELOCITY_NAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/velocity/admin/views/settings.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/velocity/admin/builder/popup.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/velocity/admin/views/settings.php:21
    • > PHP Warning
      Use of undefined constant VELOCITY_VERSION - assumed 'VELOCITY_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/velocity/admin/views/settings.php on line 15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 97% 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
Attributes that require attention:
  • Tags: There are too many tags (14 tag instead of maximum 10)
You can take inspiration from this readme.txt

velocity/velocity.php Passed 13 tests

Analyzing the main PHP file in "Velocity - Video Lazy Loading for YouTube, Twitch and Vimeo" version 1.2.1
56 characters long description:
Speed up your website by lazy loading your media embeds.

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 plugin1,951 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
CSS25310815
PHP7207162696
JavaScript4141116440

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity11.00
▷ Minimum class complexity3.00
▷ Maximum class complexity27.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods15
▷ Static methods426.67%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
11 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/plugins/alm-logo-48x48.png2.34KB1.24KB▼ 46.99%
admin/img/plugins/eq-logo-48x48.png2.48KB1.33KB▼ 46.34%
admin/img/plugins/usp-logo-48x48.png2.18KB1.06KB▼ 51.10%
admin/img/bkg-chkbox_on.png1.02KB0.11KB▼ 89.63%
admin/img/bkg-chkbox_selected.png1.26KB0.32KB▼ 74.55%