90% wp-colorbox

Code Review | WordPress Colorbox Lightbox

WordPress plugin WordPress Colorbox Lightbox scored90%from 54 tests.

About plugin

  • Plugin page: wp-colorbox
  • Plugin version: 1.1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3
  • WordPress version: 6.3.1
  • First release: Jan 10, 2014
  • Latest release: Aug 9, 2023
  • Number of updates: 54
  • Update frequency: every 64.8 days
  • Top authors: naa986 (100%)

Code review

54 tests

User reviews

23 reviews

Install metrics

9,000+ active /143,484 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
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼3.77ms] Passed 4 tests

A check of server-side resources used by WordPress Colorbox Lightbox
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0434.52 ▼14.08
Dashboard /wp-admin3.34 ▲0.0445.60 ▼1.50
Posts /wp-admin/edit.php3.39 ▲0.0447.34 ▲1.91
Add New Post /wp-admin/post-new.php5.92 ▲0.0491.60 ▲3.06
Media Library /wp-admin/upload.php3.26 ▲0.0433.43 ▼1.41
WP Colorbox /wp-admin/options-general.php?page=wp-colorbox-settings3.2331.43

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

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

Browser metrics Passed 4 tests

WordPress Colorbox Lightbox: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,941 ▲19513.68 ▼0.9710.88 ▲9.0539.27 ▼3.94
Dashboard /wp-admin2,213 ▲244.85 ▼0.04109.42 ▼12.2838.61 ▼5.26
Posts /wp-admin/edit.php2,093 ▲41.99 ▼0.0139.02 ▲1.2235.37 ▲1.03
Add New Post /wp-admin/post-new.php1,536 ▼123.20 ▲0.13593.43 ▼72.6750.35 ▼1.48
Media Library /wp-admin/upload.php1,392 ▲44.21 ▼0.0395.18 ▲0.7739.13 ▼4.34
WP Colorbox /wp-admin/options-general.php?page=wp-colorbox-settings7582.0324.2624.18

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
The SRP test was a success

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 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: photo, colorbox, gallery, lightbox, image

wp-colorbox/main.php 92% from 13 tests

The main file in "WordPress Colorbox Lightbox" v. 1.1.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-colorbox.php" instead of "main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin1,021 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript319983838
PHP1611141
CSS151142

PHP code Passed 2 tests

An short overview of 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.33
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
example5/images/controls.png1.98KB2.04KB0.00%
example5/images/loading_background.png0.13KB0.15KB0.00%
example5/images/border.png0.14KB0.16KB0.00%