84% wp-imagelightbox

Code Review | ImageLightbox.js

WordPress plugin ImageLightbox.js scored84%from 54 tests.

About plugin

  • Plugin page: wp-imagelightbox
  • Plugin version: r13...
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.3
  • WordPress version: 6.3.1
  • First release: Feb 11, 2014
  • Latest release: Jul 1, 2019
  • Number of updates: 18
  • Update frequency: every 109.3 days
  • Top authors: Znuff (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active /3,833 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.45ms] Passed 4 tests

This is a short check of server-side resources used by ImageLightbox.js
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0032.91 ▼2.55
Dashboard /wp-admin3.31 ▲0.0044.73 ▼4.34
Posts /wp-admin/edit.php3.36 ▲0.0047.47 ▲2.18
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.83 ▼2.26
Media Library /wp-admin/upload.php3.23 ▲0.0031.10 ▼0.63

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for ImageLightbox.js
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2914.47 ▲0.061.74 ▼0.0540.56 ▼3.24
Dashboard /wp-admin2,203 ▲155.83 ▲0.9699.02 ▼3.5444.72 ▲0.77
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0540.25 ▲5.7835.76 ▼1.98
Add New Post /wp-admin/post-new.php1,542 ▲1218.34 ▼4.95581.66 ▼93.4248.06 ▼7.15
Media Library /wp-admin/upload.php1,388 ▲34.16 ▼0.0394.16 ▼7.2543.00 ▲0.98

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-imagelightbox/wp-imagelightbox.php:68

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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
Attributes that require attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === wp-imagelightbox === )
The official readme.txt is a good inspiration

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

"ImageLightbox.js" version r13...'s main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Version: Use periods and digits only for your plugin's version number (ex. "1.0.3" instead of "r13...")

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
Good job! No executable or dangerous file extensions detected1,018 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript15414753
CSS1318222
PHP1111543

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.08
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 Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin