72% lazy-load-for-videos

Code Review | Lazy Load for Videos

WordPress plugin Lazy Load for Videos scored72%from 54 tests.

About plugin

  • Plugin page: lazy-load-for-videos
  • Plugin version: 2.18.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3.1
  • WordPress version: 6.3.1
  • First release: Mar 11, 2013
  • Latest release: Oct 17, 2023
  • Number of updates: 241
  • Update frequency: every 16.1 days
  • Top authors: kevinweber (100%)

Code review

54 tests

User reviews

103 reviews

Install metrics

10,000+ active /394,030 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.19MB] [CPU: ▲2.60ms] Passed 4 tests

Server-side resources used by Lazy Load for Videos
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2051.46 ▲4.30
Dashboard /wp-admin3.47 ▲0.1749.95 ▼2.06
Posts /wp-admin/edit.php3.59 ▲0.2352.93 ▲1.93
Add New Post /wp-admin/post-new.php6.12 ▲0.23100.74 ▲6.23
Media Library /wp-admin/upload.php3.40 ▲0.1743.79 ▲6.62

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 80 new files
Database: no new tables, 7 new options
New WordPress options
lazyloadvideos_version
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Lazy Load for Videos
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,855 ▲6914.42 ▲0.073.74 ▲1.6441.81 ▼4.74
Dashboard /wp-admin2,199 ▲225.55 ▼0.1090.51 ▲4.8840.09 ▼0.72
Posts /wp-admin/edit.php2,107 ▲71.98 ▼0.0040.37 ▲2.1535.56 ▼1.57
Add New Post /wp-admin/post-new.php6,450 ▲4,91927.33 ▲4.02957.29 ▲306.4365.04 ▲7.93
Media Library /wp-admin/upload.php1,407 ▲104.11 ▼0.10101.23 ▼10.1745.47 ▲1.62
Lazy Load for Videos /wp-admin/lazyload.php260.420.0915.08

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • lazyloadvideos_version
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 25% 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 0% 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
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/lazy-load-for-videos/src/php/inc/signup.php
  • 16× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/lazy-load-for-videos/src/php/inc/support_for_widgets.php:6
    • > PHP Warning
      Use of undefined constant LL_NEWS_TEXT - assumed 'LL_NEWS_TEXT' (this will throw an Error in a future version of PHP) in wp-content/plugins/lazy-load-for-videos/src/php/inc/signup.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/lazy-load-for-videos/codeispoetry.php:47
    • > PHP Warning
      require_once(LL_PATHsrc/php/static-update-posts.php): failed to open stream: No such file or directory in wp-content/plugins/lazy-load-for-videos/src/php/class-register.php on line 2
    • > PHP Warning
      Use of undefined constant LL_NEWS_ACTION_URL - assumed 'LL_NEWS_ACTION_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/lazy-load-for-videos/src/php/inc/signup.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/lazy-load-for-videos/src/php/inc/define.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/lazy-load-for-videos/src/php/inc/support_for_tablepress.php:6
    • > PHP Fatal error
      require_once(): Failed opening required 'LL_PATHsrc/php/static-update-posts.php' (include_path='.:/usr/share/php') in wp-content/plugins/lazy-load-for-videos/src/php/class-register.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lazy-load-for-videos/src/php/class-meta.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lazy-load-for-videos/src/php/class-admin-options.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/lazyload.php
    • > Network (severe)
    wp-admin/lazyload.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (14 tag instead of maximum 10)
The official readme.txt might help

lazy-load-for-videos/codeispoetry.php 85% from 13 tests

The primary PHP file in "Lazy Load for Videos" version 2.18.3 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("lazy-load-for-videos.php" instead of "codeispoetry.php")
  • Description: The description should be shorter than 140 characters (currently 173 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected30,434 lines of code in 60 files:
LanguageFilesBlank linesComment linesLines of code
JSON30026,811
PHP161831971,012
JavaScript21181100965
PO File2196206582
TypeScript1060118517
Sass3844512
Markdown212030
CSS2303
YAML1102

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity14.11
▷ Minimum class complexity1.00
▷ Maximum class complexity41.00
Average method complexity3.36
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods50
▷ Static methods2040.00%
▷ Public methods50100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions866.67%
▷ Anonymous functions433.33%
Constants13
▷ Global constants13100.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
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/frontend/admin/images/gray-grad.png0.08KB0.18KB0.00%
public/play-y-red.png0.92KB1.35KB0.00%
public/play-youtube.png3.15KB2.69KB▼ 14.68%