78% a3-lazy-load

Code Review | a3 Lazy Load

WordPress plugin a3 Lazy Load scored78%from 54 tests.

About plugin

  • Plugin page: a3-lazy-load
  • Plugin version: 2.7.1
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Dec 20, 2014
  • Latest release: Nov 23, 2023
  • Number of updates: 136
  • Update frequency: every 24.0 days
  • Top authors: a3rev (100%)

Code review

54 tests

User reviews

138 reviews

Install metrics

100,000+ active /3,616,416 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.13MB] [CPU: ▼3.87ms] Passed 4 tests

Analyzing server-side resources used by a3 Lazy Load
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2646.67 ▲4.87
Dashboard /wp-admin3.47 ▲0.1348.05 ▼16.68
Posts /wp-admin/edit.php3.53 ▲0.1747.84 ▲2.85
Add New Post /wp-admin/post-new.php5.99 ▲0.1085.29 ▼3.97
Media Library /wp-admin/upload.php3.33 ▲0.1034.31 ▲2.32
a3 Lazy Load /wp-admin/options-general.php?page=a3-lazy-load3.3848.05

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 162 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
a3_lazy_load_clean_on_deletion
a3_lazy_load_global_settings
can_compress_scripts
db_upgraded
widget_recent-posts
a3_lazy_load_version

Browser metrics Passed 4 tests

Checking browser requirements for a3 Lazy Load
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,898 ▲14713.50 ▼1.2114.78 ▲12.7542.05 ▼1.71
Dashboard /wp-admin2,200 ▲235.65 ▼0.0196.79 ▼1.8241.31 ▼5.71
Posts /wp-admin/edit.php2,105 ▲21.95 ▼0.0540.66 ▲2.0936.94 ▼0.04
Add New Post /wp-admin/post-new.php1,533 ▲723.49 ▲0.31680.78 ▲36.8255.88 ▲0.69
Media Library /wp-admin/upload.php1,408 ▲54.18 ▼0.0294.58 ▼7.3742.61 ▲0.74
a3 Lazy Load /wp-admin/options-general.php?page=a3-lazy-load3,5064.70124.68124.42

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 9 options
    • a3_lazy_load_global_settings
    • widget_recent-comments
    • a3_lazy_load_version
    • can_compress_scripts
    • a3_lazy_load_clean_on_deletion
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/a3-lazy-load/includes/customized_style.php
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/a3-lazy-load/a3-lazy-load.php:24
    • > PHP Notice
      Undefined index: A3_LAZY_LOAD_PREFIXadmin_init in wp-content/plugins/a3-lazy-load/admin/a3-lazy-load-admin.php on line 28
    • > PHP Warning
      Use of undefined constant A3_LAZY_LOAD_PREFIX - assumed 'A3_LAZY_LOAD_PREFIX' (this will throw an Error in a future version of PHP) in wp-content/plugins/a3-lazy-load/admin/a3-lazy-load-admin.php on line 28
    • > PHP Fatal error
      Uncaught Error: Call to a member function init() on null in wp-content/plugins/a3-lazy-load/admin/a3-lazy-load-admin.php:28

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 Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: a3 lazy load, lazyload, image lazy load, lazy loading

a3-lazy-load/a3-lazy-load.php Passed 13 tests

This is the main PHP file of "a3 Lazy Load" version 2.7.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
111 characters long description:
Speed up your site and enhance frontend user's visual experience in PC's, Tablets and mobile with a3 Lazy Load.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected40,220 lines of code in 99 files:
LanguageFilesBlank linesComment linesLines of code
JSON10013,203
JavaScript312,1101,58412,774
PHP292,2921,8119,441
CSS252971553,289
LESS78826734
SVG431430
PO File1131171320
HTML12029

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
These items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 410)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity81.40
▷ Minimum class complexity1.00
▷ Maximum class complexity801.00
Average method complexity6.03
▷ Minimum method complexity1.00
▷ Maximum method complexity410.00
Code structure
Namespaces8
Interfaces0
Traits0
Classes25
▷ Abstract classes00.00%
▷ Concrete classes25100.00%
▷ Final classes00.00%
Methods401
▷ Static methods5313.22%
▷ Public methods22856.86%
▷ Protected methods14536.16%
▷ Private methods286.98%
Functions14
▷ Named functions1392.86%
▷ Anonymous functions17.14%
Constants20
▷ Global constants1365.00%
▷ Class constants735.00%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
32 PNG files occupy 0.26MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/follow-facebook.png1.56KB0.43KB▼ 72.77%
admin/assets/images/slider-handle1.png1.14KB1.17KB0.00%
admin/assets/images/slider-bg-disable.png1.04KB0.14KB▼ 86.45%
assets/banner-772x250.png24.02KB9.75KB▼ 59.39%
admin/assets/images/slider-container-end-disable.png1.59KB0.55KB▼ 65.24%