90% pojo-lightbox

Code Review | Pojo Lightbox

WordPress plugin Pojo Lightbox scored90%from 54 tests.

About plugin

  • Plugin page: pojo-lightbox
  • Plugin version: 2.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.3
  • WordPress version: 6.3.1
  • First release: Aug 19, 2014
  • Latest release: Jul 23, 2023
  • Number of updates: 46
  • Update frequency: every 70.9 days
  • Top authors: KingYes (97.83%)ariel.k (4.35%)

Code review

54 tests

User reviews

1 review

Install metrics

8,000+ active /64,945 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.03MB] [CPU: ▼1.58ms] Passed 4 tests

Server-side resources used by Pojo Lightbox
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.47 ▼2.55
Dashboard /wp-admin3.34 ▲0.0446.01 ▼3.24
Posts /wp-admin/edit.php3.39 ▲0.0346.86 ▲0.19
Add New Post /wp-admin/post-new.php5.92 ▲0.0393.57 ▲8.57
Media Library /wp-admin/upload.php3.27 ▲0.0337.58 ▼0.72

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

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

Browser metrics Passed 4 tests

Pojo Lightbox: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.25 ▼1.121.58 ▼0.5443.24 ▼4.40
Dashboard /wp-admin2,212 ▲244.85 ▼0.05100.56 ▼19.8640.52 ▼2.41
Posts /wp-admin/edit.php2,094 ▲52.04 ▲0.0339.53 ▲0.9436.48 ▲2.70
Add New Post /wp-admin/post-new.php1,520 ▲617.69 ▲0.20608.32 ▼101.4157.17 ▲3.33
Media Library /wp-admin/upload.php1,394 ▲34.20 ▲0.0295.84 ▼7.1643.58 ▼2.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
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests Passed 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 Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
10 plugin tags: slideshow, images, overlay, media, lightbox...

pojo-lightbox/pojo-lightbox.php Passed 13 tests

"Pojo Lightbox" version 2.0.8's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
111 characters long description:
This plugin used to add the lightbox (overlay) effect to all images on your WordPress site with Pojo Framework.

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
There were no executable files found in this plugin8,438 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript101,5937525,524
CSS61372161,716
PHP59735514
LESS18929424
PO File16781,375259
SVG1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity6.25
▷ Minimum class complexity1.00
▷ Maximum class complexity11.00
Average method complexity2.05
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes375.00%
Methods20
▷ Static methods15.00%
▷ Public methods1785.00%
▷ Protected methods315.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
28 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/prettyPhoto/themes/default/sprite_y.png1.13KB0.13KB▼ 88.81%
assets/prettyPhoto/themes/dark_rounded/contentPattern.png0.13KB0.09KB▼ 25.38%
assets/prettyPhoto/themes/light_rounded/sprite.png4.00KB2.56KB▼ 36.16%
assets/prettyPhoto/themes/dark_rounded/btnNext.png1.38KB1.14KB▼ 17.29%
assets/prettyPhoto/themes/default/sprite_x.png1.07KB0.11KB▼ 89.79%