56% jquery-colorbox

Code Review | jQuery Colorbox

WordPress plugin jQuery Colorbox scored56%from 54 tests.

About plugin

  • Plugin page: jquery-colorbox
  • Plugin version: 4.6.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-5.1
  • WordPress version: 6.3.1
  • First release: Dec 28, 2009
  • Latest release: Aug 1, 2022
  • Number of updates: 366
  • Update frequency: every 12.6 days
  • Top authors: techotronic (99.18%)grimmdude (1.09%)

Code review

54 tests

User reviews

35 reviews

Install metrics

30,000+ active /518,130 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▼1.47MB] [CPU: ▼48.37ms] Passed 4 tests

This is a short check of server-side resources used by jQuery Colorbox
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.53 ▼0.9310.40 ▼32.56
Dashboard /wp-admin2.54 ▼0.7713.01 ▼39.15
Posts /wp-admin/edit.php2.54 ▼0.8211.61 ▼40.83
Add New Post /wp-admin/post-new.php2.54 ▼3.3513.58 ▼80.92
Media Library /wp-admin/upload.php2.54 ▼0.6912.51 ▼26.12
jQuery Colorbox /wp-admin/options-general.php?page=jquery-colorbox/jquery-colorbox.php2.5411.38

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 155 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
jquery-colorbox_settings
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for jQuery Colorbox
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,018 ▲25713.51 ▼0.9113.22 ▲10.7742.45 ▲2.91
Dashboard /wp-admin2,211 ▲315.56 ▼0.0295.70 ▲2.5045.25 ▲3.63
Posts /wp-admin/edit.php2,114 ▲141.97 ▲0.0135.50 ▼3.3236.22 ▼0.31
Add New Post /wp-admin/post-new.php1,547 ▲1918.28 ▼4.88609.90 ▼25.1773.92 ▲16.63
Media Library /wp-admin/upload.php1,416 ▲164.23 ▲0.0796.75 ▼7.7543.75 ▼1.20
jQuery Colorbox /wp-admin/options-general.php?page=jquery-colorbox/jquery-colorbox.php1,7192.3938.0134.58

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/jquery-colorbox/includes/jquery-colorbox-backend.php+11
    Methods with the same name as their class will not be constructors in a future version of PHP; JQueryColorboxBackend has a deprecated constructor
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=jquery-colorbox/jquery-colorbox.php
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/jquery-colorbox/includes/jquery-colorbox-backend.php+11
    Methods with the same name as their class will not be constructors in a future version of PHP; JQueryColorboxBackend has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=jquery-colorbox/jquery-colorbox.php
    • > Deprecated in wp-content/plugins/jquery-colorbox/includes/donationloader.php+19
    Methods with the same name as their class will not be constructors in a future version of PHP; JQueryColorboxDonationLoader has a deprecated constructor

SRP 0% 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
Almost there! Just fix the following items
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/jquery-colorbox/includes/settings-page.php
    • > /wp-content/plugins/jquery-colorbox/includes/settings-page/sp-javascript-header.php
    • > /wp-content/plugins/jquery-colorbox/includes/settings-page/sp-footer.php
  • 64× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Use of undefined constant JQUERYCOLORBOX_SETTINGSNAME - assumed 'JQUERYCOLORBOX_SETTINGSNAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/jquery-colorbox/includes/settings-page/sp-javascript-header.php on line 68
    • > PHP Warning
      Use of undefined constant JQUERYCOLORBOX_SETTINGSNAME - assumed 'JQUERYCOLORBOX_SETTINGSNAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/jquery-colorbox/includes/settings-page/sp-javascript-header.php on line 70
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/jquery-colorbox/includes/settings-page/sp-donations.php:14
    • > PHP Warning
      Use of undefined constant JQUERYCOLORBOX_SETTINGSNAME - assumed 'JQUERYCOLORBOX_SETTINGSNAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/jquery-colorbox/includes/settings-page/sp-javascript-header.php on line 68
    • > PHP Warning
      Use of undefined constant JQUERYCOLORBOX_SETTINGSNAME - assumed 'JQUERYCOLORBOX_SETTINGSNAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/jquery-colorbox/includes/settings-page/sp-javascript-header.php on line 33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/jquery-colorbox/includes/settings-page/sp-translation.php:14
    • > PHP Warning
      Use of undefined constant JQUERYCOLORBOX_SETTINGSNAME - assumed 'JQUERYCOLORBOX_SETTINGSNAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/jquery-colorbox/includes/settings-page/sp-javascript-header.php on line 23
    • > PHP Warning
      Use of undefined constant JQUERYCOLORBOX_SETTINGSNAME - assumed 'JQUERYCOLORBOX_SETTINGSNAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/jquery-colorbox/includes/settings-page/sp-javascript-header.php on line 19
    • > PHP Warning
      Use of undefined constant JQUERYCOLORBOX_PLUGIN_URL - assumed 'JQUERYCOLORBOX_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/jquery-colorbox/includes/settings-page/sp-javascript-header.php on line 107
    • > PHP Warning
      Use of undefined constant JQUERYCOLORBOX_SETTINGSNAME - assumed 'JQUERYCOLORBOX_SETTINGSNAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/jquery-colorbox/includes/settings-page/sp-javascript-header.php on line 98

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=jquery-colorbox/jquery-colorbox.php
    • > Network (severe)
    wp-admin/admin-ajax.php - Failed to load resource: the server responded with a status of 400 (Bad Request)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Tags: There are too many tags (18 tag instead of maximum 10)
  • Plugin Name: Please specify the plugin name on the first line ( === jquery-colorbox === )
The official readme.txt is a good inspiration

jquery-colorbox/jquery-colorbox.php Passed 13 tests

The entry point to "jQuery Colorbox" version 4.6.2 is a PHP file that has certain tags in its header comment area
89 characters long description:
Used to overlay images on the current page. Images in one post are grouped automatically.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected12,958 lines of code in 62 files:
LanguageFilesBlank linesComment linesLines of code
PO File263,4674,0309,784
PHP161737661,236
JavaScript62612521,180
CSS1245139426
Markdown1670301
JSON10031

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity17.40
▷ Minimum class complexity3.00
▷ Maximum class complexity31.00
Average method complexity3.16
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods38
▷ Static methods00.00%
▷ Public methods38100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants13100.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
34 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/zoom.png3.45KB0.70KB▼ 79.73%
themes/theme7/images/overlay.png0.18KB0.15KB▼ 15.93%
themes/theme5/images/loading_background.png0.16KB0.15KB▼ 6.02%
themes/theme10/images/close.png0.69KB0.34KB▼ 50.57%
themes/theme2/images/controls.png0.56KB0.57KB0.00%