84% native-image-lazy-loading

Code Review | Native Image Lazy Loading

WordPress plugin Native Image Lazy Loading scored84%from 54 tests.

About plugin

  • Plugin page: native-image-lazy...
  • Plugin version: 1.1
  • PHP compatiblity: 5.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.2
  • WordPress version: 6.3.1
  • First release: May 21, 2019
  • Latest release: May 21, 2019
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: JDM-labs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /950 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.95ms] Passed 4 tests

Server-side resources used by Native Image Lazy Loading
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0243.81 ▼4.04
Dashboard /wp-admin3.33 ▲0.0353.75 ▼3.77
Posts /wp-admin/edit.php3.38 ▲0.0251.96 ▼0.22
Add New Post /wp-admin/post-new.php5.91 ▲0.0387.84 ▼19.76
Media Library /wp-admin/upload.php3.25 ▲0.0240.70 ▲4.62
Native Lazy Loading /wp-admin/options-general.php?page=jdm-native-lazy-loading3.2236.01

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Native Image Lazy Loading
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.26 ▼0.091.75 ▲0.0744.13 ▼0.65
Dashboard /wp-admin2,199 ▲255.63 ▲0.0597.62 ▼15.2544.21 ▼5.07
Posts /wp-admin/edit.php2,101 ▲12.01 ▲0.0236.00 ▼5.3833.86 ▼3.50
Add New Post /wp-admin/post-new.php1,529 ▲322.91 ▼0.75697.02 ▼17.3050.81 ▼9.95
Media Library /wp-admin/upload.php1,404 ▲44.16 ▼0.14108.76 ▲7.6649.02 ▲6.33
Native Lazy Loading /wp-admin/options-general.php?page=jdm-native-lazy-loading9122.1724.3328.54

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 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/native-image-lazy-loading/settings.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 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
5 plugin tags: lazy load, performance, loading, lazyload, images

native-image-lazy-loading/native-image-lazy-loading.php Passed 13 tests

The main PHP script in "Native Image Lazy Loading" version 1.1 is automatically included on every request by WordPress
113 characters long description:
Automatically add the new `loading` attribute to images within your content to support native image lazy loading.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected128 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP32529104
Markdown116024

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 compressed PNG files occupy 0.13MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
loading-attribute-plugin.png43.56KB45.52KB0.00%
loading-attribute-plugin@2x.png85.40KB86.43KB0.00%