84% wp-lozad

Code Review | WP Lozad

WordPress plugin WP Lozad scored84%from 54 tests.

About plugin

  • Plugin page: wp-lozad
  • Plugin version: 1.8.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Oct 5, 2020
  • Latest release: Oct 4, 2023
  • Number of updates: 92
  • Update frequency: every 11.9 days
  • Top authors: john1302 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /3,104 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.14MB] [CPU: ▼5.29ms] Passed 4 tests

A check of server-side resources used by WP Lozad
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1540.52 ▲1.93
Dashboard /wp-admin3.45 ▲0.1450.24 ▲5.29
Posts /wp-admin/edit.php3.56 ▲0.2048.31 ▼3.95
Add New Post /wp-admin/post-new.php6.03 ▲0.1484.06 ▼15.94
Media Library /wp-admin/upload.php3.37 ▲0.1433.41 ▼3.19
WP Lozad /wp-admin/options-general.php?page=lozad-setting-page3.3331.46

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by WP Lozad
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.35 ▲0.002.70 ▲1.1941.32 ▼2.30
Dashboard /wp-admin2,187 ▲105.56 ▼0.0280.43 ▼6.0575.79 ▲35.96
Posts /wp-admin/edit.php2,101 ▲11.99 ▼0.0133.98 ▼0.3833.31 ▼1.02
Add New Post /wp-admin/post-new.php1,530 ▲423.21 ▲2.06685.83 ▲35.7057.84 ▼3.14
Media Library /wp-admin/upload.php1,404 ▲14.21 ▲0.0299.98 ▼13.2271.25 ▲23.43
WP Lozad /wp-admin/options-general.php?page=lozad-setting-page9642.0924.0127.36

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

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 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× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Lozad\\add_filter() in wp-content/plugins/wp-lozad/classes/FrontPageProcessing.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: image, front, posts, html processing, lazyload...

wp-lozad/lozad.php 92% from 13 tests

This is the main PHP file of "WP Lozad" version 1.8.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-lozad.php" instead of "lozad.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin1,167 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP12200173822
JavaScript26320340
CSS1005

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity17.86
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity3.21
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods50
▷ Static methods714.00%
▷ Public methods3570.00%
▷ Protected methods00.00%
▷ Private methods1530.00%
Functions11
▷ Named functions19.09%
▷ Anonymous functions1090.91%
Constants21
▷ Global constants14.76%
▷ Class constants2095.24%
▷ Public constants20100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/def@2x.png0.31KB0.20KB▼ 35.51%
img/def.png0.31KB0.20KB▼ 35.51%