83% advanced-lazy-load

Code Review | Advanced lazy load

WordPress plugin Advanced lazy load scored 83% from 54 tests.

About plugin

  • Plugin page: advanced-lazy-load
  • Plugin version: 1.6.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.1.0
  • WordPress version: 6.3.1
  • First release: Dec 17, 2012
  • Latest release: Dec 30, 2014
  • Number of updates: 40
  • Update frequency: every 19.2 days
  • Top authors: kasonzhao (100%)

Code review

54 tests

User reviews

27 reviews

Install metrics

300+ active / 36,440 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.34MB] [CPU: ▼16.94ms] Passed 4 tests

Analyzing server-side resources used by Advanced lazy load
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.374.14 ▼40.68
Dashboard /wp-admin3.31 ▲0.0142.94 ▼6.23
Posts /wp-admin/edit.php3.36 ▲0.0146.12 ▼2.72
Add New Post /wp-admin/post-new.php5.89 ▲0.0180.82 ▼18.13
Media Library /wp-admin/upload.php3.23 ▲0.0133.58 ▼2.02
Advanced lazy load /wp-admin/options-general.php?page=Advanced-lazy-load3.2031.39

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 9 new options
New WordPress options
ifd_pixel
can_compress_scripts
db_upgraded
ifd_duration
widget_recent-posts
widget_theysaidso_widget
cb_adlzylad_mobile
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Advanced lazy load
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,028 ▲29313.82 ▼0.5414.33 ▲12.6039.45 ▼4.83
Dashboard /wp-admin2,210 ▲255.81 ▼0.0696.33 ▼15.3440.80 ▼13.00
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0238.69 ▼3.1433.80 ▼3.12
Add New Post /wp-admin/post-new.php1,517 ▼1717.70 ▼5.48644.73 ▲36.2152.47 ▲3.92
Media Library /wp-admin/upload.php1,392 ▲74.13 ▼0.1193.67 ▼4.8144.10 ▼0.52
Advanced lazy load /wp-admin/options-general.php?page=Advanced-lazy-load1,0072.0222.5333.02

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 9 options in the database
    • db_upgraded
    • ifd_pixel
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • ifd_duration
    • theysaidso_admin_options
    • widget_recent-comments
    • cb_adlzylad_mobile

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means 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
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-lazy-load/advanced_lazyload.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 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
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (/screenshot-1.jpg), #2 (/screenshot-2.jpg), #3 (/screenshot-3.jpg)
  • Donate link: Invalid URI ("")
The official readme.txt might help

advanced-lazy-load/advanced_lazyload.php 85% from 13 tests

Analyzing the main PHP file in "Advanced lazy load" version 1.6.0
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 183 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("advanced-lazy-load.php" instead of "advanced_lazyload.php")

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
Good job! No executable or dangerous file extensions detected6,737 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP31362,0806,731
JavaScript1406

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity55.62
▷ Minimum class complexity1.00
▷ Maximum class complexity555.00
Average method complexity4.23
▷ Minimum method complexity1.00
▷ Maximum method complexity80.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes28
▷ Abstract classes27.14%
▷ Concrete classes2692.86%
▷ Final classes00.00%
Methods493
▷ Static methods7515.21%
▷ Public methods38477.89%
▷ Protected methods10721.70%
▷ Private methods20.41%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants55
▷ Global constants47.27%
▷ Class constants5192.73%
▷ Public constants51100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
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
imgs/star.png9.27KB4.68KB▼ 49.50%