83% wplightbox

Code Review | wplightbox

WordPress plugin wplightbox scored83%from 54 tests.

About plugin

  • Plugin page: wplightbox
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 6, 2019
  • Latest release: Feb 6, 2023
  • Number of updates: 9
  • Update frequency: every 128.8 days
  • Top authors: welrachid (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /954 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼9.15ms] Passed 4 tests

Server-side resources used by wplightbox
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.21 ▼4.24
Dashboard /wp-admin3.32 ▲0.0144.62 ▼1.23
Posts /wp-admin/edit.php3.37 ▲0.0143.63 ▼8.12
Add New Post /wp-admin/post-new.php5.90 ▲0.0179.43 ▼23.01
Media Library /wp-admin/upload.php3.24 ▲0.0134.03 ▼1.21

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by wplightbox
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,884 ▲12314.38 ▼0.281.85 ▲0.2543.23 ▲3.83
Dashboard /wp-admin2,213 ▲335.60 ▼0.0478.91 ▼13.7976.06 ▲36.06
Posts /wp-admin/edit.php2,112 ▲121.99 ▲0.0236.24 ▼0.6832.73 ▼3.32
Add New Post /wp-admin/post-new.php1,692 ▲16422.29 ▼0.77749.59 ▲108.8942.49 ▼11.15
Media Library /wp-admin/upload.php1,415 ▲154.16 ▼0.0793.19 ▼23.2474.41 ▲25.34

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wplightbox/settings.php
    • > /wp-content/plugins/wplightbox/wplightbox.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 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
These attributes need your attention:
  • Plugin Name: Please specify the plugin name on the first line ( === wplightbox === )
  • Screenshots: Please add an image for screenshot #3 (Front-end Mobile)
You can look at the official readme.txt

wplightbox/wplightbox.php 92% from 13 tests

"wplightbox" version 1.0.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 152 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected141 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript11252
CSS11049
PHP24840

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.63MB with 0.20MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png605.98KB218.00KB▼ 64.03%
assets/icon.png0.53KB0.50KB▼ 7.31%
assets/close.png1.49KB1.59KB0.00%
assets/screenshot-1.png38.07KB17.02KB▼ 55.29%