90% lazy-load-videos-and-sticky-control

Code Review | Lazy load videos and sticky control

WordPress plugin Lazy load videos and sticky control scored90%from 54 tests.

About plugin

  • Plugin page: lazy-load-videos-...
  • Plugin version: 2.0.2
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.2
  • WordPress version: 6.3.1
  • First release: Jul 6, 2019
  • Latest release: Apr 18, 2023
  • Number of updates: 60
  • Update frequency: every 23.1 days
  • Top authors: aishan (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active /3,507 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by Lazy load videos and sticky control
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.16 ▼0.40
Dashboard /wp-admin3.31 ▼0.0450.33 ▼13.86
Posts /wp-admin/edit.php3.36 ▲0.0045.57 ▲1.06
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.78 ▼8.19
Media Library /wp-admin/upload.php3.23 ▲0.0033.55 ▼0.71

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Lazy load videos and sticky control
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.24 ▼1.131.75 ▼0.0244.88 ▼2.42
Dashboard /wp-admin2,206 ▲184.84 ▼1.09113.35 ▼0.7242.19 ▼6.25
Posts /wp-admin/edit.php2,089 ▼02.02 ▲0.0032.67 ▼2.4533.72 ▼1.97
Add New Post /wp-admin/post-new.php1,514 ▼2017.51 ▼5.60670.21 ▲95.2954.83 ▲6.18
Media Library /wp-admin/upload.php1,385 ▼64.19 ▼0.01102.90 ▲5.9045.50 ▲2.99

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

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 need to be fixed:
  • Contributors: Plugin contributors field is missing
The official readme.txt is a good inspiration

lazy-load-videos-and-sticky-control/lazy-load-videos-and-sticky-control.php Passed 13 tests

The entry point to "Lazy load videos and sticky control" version 2.0.2 is a PHP file that has certain tags in its header comment area
52 characters long description:
Lazy load and sticky your video. Super-easy and fun!

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin821 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP12114625758
PO File1181958
JavaScript3003
CSS2002

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity11.00
▷ Minimum class complexity1.00
▷ Maximum class complexity69.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods64
▷ Static methods23.12%
▷ Public methods5992.19%
▷ Protected methods00.00%
▷ Private methods57.81%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants6
▷ Global constants6100.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/play.png10.90KB6.24KB▼ 42.77%