94% mhm-lazyloadvideo

Code Review | Lazy load video players

WordPress plugin Lazy load video players scored 94% from 54 tests.

About plugin

  • Plugin page: mhm-lazyloadvideo
  • Plugin version: 1.3.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6.0-4.9.8
  • WordPress version: 5.8.1
  • First release: Mar 6, 2017
  • Latest release: Nov 19, 2018
  • Number of updates: 10
  • Update frequency: every 62.2 days
  • Top authors: markhowellsmead (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 599 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼140.44ms] Passed 4 tests

A check of server-side resources used by Lazy load video players
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1432.74 ▲1.41
Dashboard /wp-admin3.08 ▲0.0346.77 ▲1.32
Posts /wp-admin/edit.php3.13 ▲0.0245.09 ▼0.19
Add New Post /wp-admin/post-new.php5.44 ▲0.0090.93 ▼559.40
Media Library /wp-admin/upload.php3.02 ▲0.0232.24 ▼3.49

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Lazy load video players
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,706 ▲11015.90 ▲0.438.83 ▲1.0845.16 ▼5.56
Dashboard /wp-admin2,970 ▲365.88 ▼0.03130.52 ▼8.68114.38 ▼4.18
Posts /wp-admin/edit.php2,736 ▼32.82 ▲0.1261.97 ▼2.6196.21 ▲14.42
Add New Post /wp-admin/post-new.php1,683 ▼018.72 ▼0.03368.06 ▼4.87107.50 ▼5.87
Media Library /wp-admin/upload.php1,807 ▼05.01 ▲0.01140.71 ▼14.04115.97 ▼6.33

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/mhm-lazyloadvideo/Plugin.php on line 40
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/mhm-lazyloadvideo/Plugin.php on line 40
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/mhm-lazyloadvideo/Plugin.php on line 40

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: video player, performance, video, lazy load

mhm-lazyloadvideo/Plugin.php 85% from 13 tests

"Lazy load video players" version 1.3.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("mhm-lazyloadvideo.php" instead of "Plugin.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 324 characters long)

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
Everything looks great! No dangerous files found in this plugin95 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1143460
JavaScript262735

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.17
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected