84% sw-lazy-load

Code Review | SW Lazy Load

WordPress plugin SW Lazy Load scored84%from 54 tests.

About plugin

  • Plugin page: sw-lazy-load
  • Plugin version: 0.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9
  • WordPress version: 6.3.1
  • First release: Mar 19, 2014
  • Latest release: Aug 27, 2014
  • Number of updates: 10
  • Update frequency: every 16.1 days
  • Top authors: josedasilva (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,110 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.35MB] [CPU: ▼14.79ms] Passed 4 tests

This is a short check of server-side resources used by SW Lazy Load
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.418.65 ▼31.60
Dashboard /wp-admin3.31 ▲0.0144.91 ▼4.23
Posts /wp-admin/edit.php3.37 ▲0.0147.62 ▼7.28
Add New Post /wp-admin/post-new.php5.90 ▲0.0184.63 ▼16.03
Media Library /wp-admin/upload.php3.24 ▲0.0033.70 ▲1.02

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by SW Lazy Load
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,988 ▲25313.77 ▼0.548.71 ▲7.0138.39 ▼5.57
Dashboard /wp-admin2,206 ▲154.84 ▼0.05103.43 ▼4.7340.41 ▼3.62
Posts /wp-admin/edit.php2,089 ▼32.00 ▼0.0134.06 ▼9.7832.35 ▼2.92
Add New Post /wp-admin/post-new.php1,542 ▲2118.44 ▼4.82590.90 ▼97.0154.17 ▼1.48
Media Library /wp-admin/upload.php1,388 ▲64.22 ▲0.0196.24 ▼16.4442.59 ▼7.69

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% 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 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 is_admin() in wp-content/plugins/sw-lazy-load/sw_lazyload.php:69

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: lazy load, image, performance, speed

sw-lazy-load/sw_lazyload.php 92% from 13 tests

The main PHP file in "SW Lazy Load" ver. 0.4.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("sw-lazy-load.php" instead of "sw_lazyload.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected36 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1212131
JavaScript1295

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin