10% lb-colorbox

Code Review | LB ColorBox

WordPress plugin LB ColorBox scored 10% from 54 tests.

About plugin

  • Plugin page: lb-colorbox
  • Plugin version: 0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.3.2
  • WordPress version: 6.3.1
  • First release: Apr 17, 2012
  • Latest release: Apr 25, 2012
  • Number of updates: 21
  • Update frequency: every 19.0 days
  • Top authors: ZaMoose (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,412 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/lb-colorbox/include/lbcb-list-table.php+124
    Declaration of LBCB_Kuler_List_Table::prepare_items($criteria) should be compatible with WP_List_Table::prepare_items()

Server metrics [RAM: ▼1.83MB] [CPU: ▼50.81ms] Passed 4 tests

Server-side resources used by LB ColorBox
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2143.17 ▼8.70
Dashboard /wp-admin2.12 ▼1.196.82 ▼45.20
Posts /wp-admin/edit.php2.12 ▼1.247.28 ▼37.12
Add New Post /wp-admin/post-new.php2.12 ▼3.777.69 ▼93.92
Media Library /wp-admin/upload.php2.12 ▼1.117.43 ▼27.01
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=colorbox2.127.80
ColorBox /wp-admin/options-general.php?page=lbcb-options2.126.42
Add ColorBox /wp-admin/post-new.php?post_type=colorbox2.126.48
ColorBoxes /wp-admin/edit.php?post_type=colorbox2.127.69

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

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

Browser metrics Passed 4 tests

A check of browser resources used by LB ColorBox
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,846 ▲10013.56 ▼0.741.75 ▼0.0639.39 ▼8.09
Dashboard /wp-admin2,235 ▲505.84 ▲0.95113.57 ▼4.7772.09 ▲24.12
Posts /wp-admin/edit.php2,133 ▲442.00 ▼0.0138.69 ▲3.9533.14 ▲0.27
Add New Post /wp-admin/post-new.php1,569 ▲2523.02 ▼0.29689.40 ▼45.4555.12 ▼5.16
Media Library /wp-admin/upload.php1,426 ▲384.23 ▲0.03102.42 ▼5.2474.31 ▲28.86
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=colorbox1,3452.1529.2732.46
ColorBox /wp-admin/options-general.php?page=lbcb-options9131.6927.0726.34
Add ColorBox /wp-admin/post-new.php?post_type=colorbox2,3874.3498.1489.71
ColorBoxes /wp-admin/edit.php?post_type=colorbox1,1641.9534.0631.56

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/lb-colorbox/include/lbcb-list-table.php+124
    Declaration of LBCB_Kuler_List_Table::prepare_items($criteria) should be compatible with WP_List_Table::prepare_items()
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=colorbox
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/lb-colorbox/include/lbcb-list-table.php+124
    Declaration of LBCB_Kuler_List_Table::prepare_items($criteria) should be compatible with WP_List_Table::prepare_items()
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=colorbox
    • > Notice in wp-content/plugins/lb-colorbox/include/lbcb-options.php+32
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=lbcb-options
    • > Warning in wp-admin/includes/template.php+1771
    call_user_func() expects parameter 1 to be a valid callback, function 'lbcb_kuler_header' not found or invalid function name

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
The following issues need your attention
  • 9× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lb-colorbox/include/lbcb-cpt.php:53
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/lb-colorbox/include/lbcb-list-table.php on line 15
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/lb-colorbox/include/lbcb-list-table.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/lb-colorbox/include/metaboxes/init.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lb-colorbox/include/lbcb-ajax.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/lb-colorbox/lb-colorbox.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lb-colorbox/include/lbcb-options.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/lb-colorbox/include/lbcb-output.php:56
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/lb-colorbox/include/lbcb-list-table.php on line 15

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
    • > GET request to /wp-admin/post-new.php?post_type=colorbox
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,underscore,thickbox,shortcode,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/lb-colorbox/include/metaboxes/js/cmb.js?ver=6.3.1:67:26)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,underscore,thickbox,shortcode,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,underscore,thickbox,shortcode,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/post-new.php?post_type=colorbox
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,underscore,thickbox,shortcode,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Donate link: Invalid url: ""
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === lb-colorbox === )
The official readme.txt might help

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

"LB ColorBox" version 0.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
84 characters long description:
Store custom color swatches as custom posts for fun and profit (and use in themes!).

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected1,805 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP122296771,241
CSS21016357
Markdown2270114
JavaScript3174593

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity24.29
▷ Minimum class complexity1.00
▷ Maximum class complexity146.00
Average method complexity4.70
▷ Minimum method complexity1.00
▷ Maximum method complexity89.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods44
▷ Static methods511.36%
▷ Public methods3784.09%
▷ Protected methods715.91%
▷ Private methods00.00%
Functions31
▷ Named functions31100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants225.00%
▷ Class constants675.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
24 PNG files occupy 0.17MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png56.30KB16.57KB▼ 70.57%
screenshot-4.png35.42KB10.29KB▼ 70.96%
include/metaboxes/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%
include/images/swatch16-color.png1.15KB0.48KB▼ 57.91%
include/metaboxes/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%