94% wp-lazy-load

Code Review | wp-lazy-load

WordPress plugin wp-lazy-load scored 94% from 53 tests.

About plugin

  • Plugin page: wp-lazy-load
  • Plugin version: 0.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-3.9.2
  • WordPress version: 5.8.1
  • First release: May 16, 2014
  • Latest release: Sep 27, 2014
  • Number of updates: 14
  • Update frequency: every 9.6 days
  • Top authors: dsawardekar (100%)

Code review

53 tests

User reviews

1 review

Install metrics

20+ active / 1,724 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.12MB] [CPU: ▼495.20ms] Passed 4 tests

Analyzing server-side resources used by wp-lazy-load
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.94 ▲0.2235.06 ▲17.07
Dashboard /wp-admin3.18 ▲0.1244.57 ▲1.27
Posts /wp-admin/edit.php3.23 ▲0.1247.94 ▲6.77
Add New Post /wp-admin/post-new.php5.54 ▲0.1185.69 ▼1,978.67
Media Library /wp-admin/upload.php3.12 ▲0.1132.93 ▼10.17
WP Lazy Load /wp-admin/options-general.php?page=wp-lazy-load3.0627.45

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 245 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for wp-lazy-load
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,678 ▲7215.83 ▲0.317.13 ▼1.8148.03 ▲4.28
Dashboard /wp-admin2,935 ▲855.93 ▲0.01133.20 ▲1.23103.20 ▼4.55
Posts /wp-admin/edit.php2,708 ▲22.70 ▲0.0262.08 ▼2.6687.36 ▼7.87
Add New Post /wp-admin/post-new.php1,656 ▼19718.79 ▼0.33365.95 ▼14.41106.47 ▼4.87
Media Library /wp-admin/upload.php1,780 ▲55.01 ▼0.02145.28 ▼13.96112.04 ▲1.02
WP Lazy Load /wp-admin/options-general.php?page=wp-lazy-load1,1872.3257.1666.85

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 143× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/wp-lazy-load/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/wp-lazy-load/vendor/twig/twig/lib/Twig/Node/Import.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_TokenParser' not found in wp-content/plugins/wp-lazy-load/vendor/twig/twig/lib/Twig/TokenParser/Flush.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_TokenParser' not found in wp-content/plugins/wp-lazy-load/vendor/twig/twig/lib/Twig/TokenParser/Do.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_TokenParser' not found in wp-content/plugins/wp-lazy-load/vendor/twig/twig/lib/Twig/TokenParser/From.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig_TestInterface' not found in wp-content/plugins/wp-lazy-load/vendor/twig/twig/lib/Twig/Test.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_TokenParser' not found in wp-content/plugins/wp-lazy-load/vendor/twig/twig/lib/Twig/TokenParser/Import.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Extension' not found in wp-content/plugins/wp-lazy-load/vendor/twig/twig/lib/Twig/Extension/Sandbox.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Error' not found in wp-content/plugins/wp-lazy-load/vendor/twig/twig/lib/Twig/Error/Runtime.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Call' not found in wp-content/plugins/wp-lazy-load/vendor/twig/twig/lib/Twig/Node/Expression/Test.php:11

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 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Screenshot 1), #2 (Screenshot 2)
You can take inspiration from this readme.txt

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

This is the main PHP file of "wp-lazy-load" version 0.3.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
40 characters long description:
Lazy Load images using jQuery Lazy Load.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin12,806 lines of code in 235 files:
LanguageFilesBlank linesComment linesLines of code
PHP2282,9115,68612,126
JavaScript38635349
JSON100248
HTML11061
YAML15016
CSS1206

PHP code Passed 2 tests

A brief analysis 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.40
Average class complexity7.78
▷ Minimum class complexity1.00
▷ Maximum class complexity121.00
Average method complexity2.32
▷ Minimum method complexity1.00
▷ Maximum method complexity72.00
Code structure
Namespaces11
Interfaces21
Traits0
Classes202
▷ Abstract classes104.95%
▷ Concrete classes19295.05%
▷ Final classes00.00%
Methods1,185
▷ Static methods322.70%
▷ Public methods1,05388.86%
▷ Protected methods1089.11%
▷ Private methods242.03%
Functions54
▷ Named functions5194.44%
▷ Anonymous functions35.56%
Constants45
▷ Global constants36.67%
▷ Class constants4293.33%
▷ Public constants42100.00%

Plugin size Passed 1 test

Image compression Passed 1 test

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin