83% lazy-load-images-and-background-images

Code Review | Lazy load images and background images

WordPress plugin Lazy load images and background images scored83%from 54 tests.

About plugin

  • Plugin page: lazy-load-images-...
  • Plugin version: 1.0.5
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4
  • WordPress version: 6.3.1
  • First release: Dec 15, 2021
  • Latest release: Nov 11, 2023
  • Number of updates: 12
  • Update frequency: every 58.0 days
  • Top authors: jahidcse (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,569 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▼7.06ms] Passed 4 tests

Server-side resources used by Lazy load images and background images
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1841.56 ▼1.14
Dashboard /wp-admin3.46 ▲0.1247.43 ▼19.03
Posts /wp-admin/edit.php3.58 ▲0.2250.20 ▲5.30
Add New Post /wp-admin/post-new.php6.04 ▲0.1687.77 ▼10.50
Media Library /wp-admin/upload.php3.39 ▲0.1638.05 ▲2.44
Codestar Framework /wp-admin/tools.php?page=csf-welcome3.4439.50

Server storage [IO: ▲1.16MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 127 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
bgimglazy_option

Browser metrics Passed 4 tests

Lazy load images and background images: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,941 ▲17913.46 ▼0.4813.02 ▲11.1943.68 ▲1.06
Dashboard /wp-admin2,222 ▲425.55 ▼0.0685.79 ▼10.3939.72 ▲0.48
Posts /wp-admin/edit.php2,127 ▲271.99 ▲0.0536.81 ▼0.3235.02 ▼0.51
Add New Post /wp-admin/post-new.php1,544 ▲1823.35 ▲0.13661.42 ▲47.1354.82 ▲5.71
Media Library /wp-admin/upload.php1,421 ▲244.18 ▲0.04102.46 ▼0.1341.43 ▼5.74
Codestar Framework /wp-admin/tools.php?page=csf-welcome1,4483.5047.1158.17

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • widget_recent-posts
    • bgimglazy_option
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_file_data() in wp-content/plugins/lazy-load-images-and-background-images/background-and-image-lazy-load.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

lazy-load-images-and-background-images/background-and-image-lazy-load.php 85% from 13 tests

The primary PHP file in "Lazy load images and background images" version 1.0.5 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: The principal plugin file should be the same as the plugin slug ("lazy-load-images-and-background-images.php" instead of "background-and-image-lazy-load.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected16,696 lines of code in 102 files:
LanguageFilesBlank linesComment linesLines of code
PHP712,1931,0089,657
PO File203,1983,5916,500
Markdown2850379
JavaScript4123145
CSS30013
SVG2002

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity20.24
▷ Minimum class complexity1.00
▷ Maximum class complexity150.00
Average method complexity6.63
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes55
▷ Abstract classes23.64%
▷ Concrete classes5396.36%
▷ Final classes00.00%
Methods188
▷ Static methods3116.49%
▷ Public methods188100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions21
▷ Named functions21100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/framework/assets/images/checkerboard.png2.29KB2.54KB0.00%