78% be-lazy

Code Review | Be Lazy

WordPress plugin Be Lazy scored78%from 54 tests.

About plugin

  • Plugin page: be-lazy
  • Plugin version: 1.2.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2
  • WordPress version: 6.3.1
  • First release: May 13, 2019
  • Latest release: Jun 18, 2019
  • Number of updates: 44
  • Update frequency: every 0.8 days
  • Top authors: fayne (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

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

A check of server-side resources used by Be Lazy
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0845.80 ▲3.67
Dashboard /wp-admin3.38 ▲0.0844.93 ▼2.51
Posts /wp-admin/edit.php3.49 ▲0.1447.06 ▼2.18
Add New Post /wp-admin/post-new.php5.98 ▲0.0993.40 ▼2.93
Media Library /wp-admin/upload.php3.30 ▲0.0735.51 ▲2.21

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 31 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Be Lazy: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,892 ▲14613.31 ▼1.282.63 ▲0.8239.11 ▼3.84
Dashboard /wp-admin2,296 ▲1145.88 ▼0.0299.74 ▲0.8770.79 ▲26.40
Posts /wp-admin/edit.php2,176 ▲902.05 ▲0.0539.81 ▼0.0634.95 ▼3.18
Add New Post /wp-admin/post-new.php1,762 ▲24224.22 ▲1.09711.24 ▲29.7464.71 ▲8.27
Media Library /wp-admin/upload.php1,466 ▲784.15 ▼0.04102.09 ▼7.2473.42 ▲29.19

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/be-lazy/app/Views/radio.php
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Undefined variable: name in wp-content/plugins/be-lazy/app/Views/radio.php on line 2
    • > PHP Notice
      Undefined variable: value in wp-content/plugins/be-lazy/app/Views/radio.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/be-lazy/app/Config/Constants.php:7
    • > PHP Notice
      Undefined variable: checked in wp-content/plugins/be-lazy/app/Views/radio.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/be-lazy/app/Views/options_page.php:7
    • > PHP Notice
      Undefined variable: label in wp-content/plugins/be-lazy/app/Views/radio.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/be-lazy/app/Config/Constants.php:7

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 issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
7 plugin tags: lazy, loading, speed, performance, lazyload...

be-lazy/be-lazy.php 92% from 13 tests

The entry point to "Be Lazy" version 1.2.1 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Description: Please improve your description making it at least 10 characters long (currently 0 characters long)

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
Success! There were no dangerous files found in this plugin783 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP17138178580
SVG100111
JavaScript41236
Sass27032
JSON30022
CSS2002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity8.33
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods45
▷ Static methods817.78%
▷ Public methods4497.78%
▷ Protected methods00.00%
▷ Private methods12.22%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants9
▷ Global constants222.22%
▷ Class constants777.78%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin