68% everlightbox

Code Review | Lightbox - EverlightBox Gallery

WordPress plugin Lightbox - EverlightBox Gallery scored 68% from 54 tests.

About plugin

  • Plugin page: everlightbox
  • Plugin version: 1.1.16
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.8
  • WordPress version: 5.8.1
  • First release: Sep 13, 2016
  • Latest release: Jul 28, 2021
  • Number of updates: 82
  • Update frequency: every 21.7 days
  • Top authors: GreenTreeLabs (85.37%)giucu91 (12.2%)machothemes (3.66%)wpchill (2.44%)

Code review

54 tests

User reviews

35 reviews

Install metrics

2,000+ active / 46,453 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲5.17MB] [CPU: ▼120.20ms] 75% from 4 tests

An overview of server-side resources used by Lightbox - EverlightBox Gallery
Please take the time to fix the following items
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.17MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.55 ▲5.7164.68 ▲30.40
Dashboard /wp-admin8.56 ▲5.5174.30 ▲26.26
Posts /wp-admin/edit.php8.56 ▲5.4674.80 ▲22.54
Add New Post /wp-admin/post-new.php9.58 ▲4.15122.07 ▼555.72
Media Library /wp-admin/upload.php8.56 ▲5.5665.49 ▲26.11
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius8.5659.30

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 578 new files
Database: no new tables, 5 new options
New WordPress options
fs_gdpr
fs_active_plugins
fs_accounts
fs_debug_mode
everlightbox_options

Browser metrics Passed 4 tests

Lightbox - EverlightBox Gallery: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,863 ▲26716.37 ▲0.8615.95 ▲7.0953.17 ▼0.23
Dashboard /wp-admin3,026 ▲925.98 ▼0.14145.22 ▼12.30151.71 ▲36.15
Posts /wp-admin/edit.php2,788 ▲492.60 ▼0.0769.48 ▼1.95100.62 ▲3.12
Add New Post /wp-admin/post-new.php1,654 ▲6321.89 ▲3.28301.95 ▼90.77102.53 ▼13.49
Media Library /wp-admin/upload.php1,815 ▲85.05 ▲0.03136.01 ▼27.88151.47 ▲24.71
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius1,5202.1157.2877.71

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
    • > Notice in wp-content/plugins/everlightbox/freemius/includes/class-freemius.php+8552
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 5 options
    • everlightbox_options
    • fs_accounts
    • fs_debug_mode
    • fs_gdpr
    • fs_active_plugins

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 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
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/everlightbox/freemius/templates/ajax-loader.php
  • 50× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/everlightbox/admin/cmb2/init.php:126
    • > PHP Fatal error
      Uncaught Error: Call to undefined function cmb2_dir() in wp-content/plugins/everlightbox/admin/cmb2/includes/rest-api/CMB2_REST_Controller.php:4
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/everlightbox/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/everlightbox/freemius/templates/account/partials/addon.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/everlightbox/freemius/templates/account/partials/addon.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/everlightbox/admin/cmb2/includes/types/CMB2_Type_Taxonomy_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Multicheck' not found in wp-content/plugins/everlightbox/admin/cmb2/includes/types/CMB2_Type_Taxonomy_Multicheck_Hierarchical.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/everlightbox/admin/cmb2/includes/types/CMB2_Type_Multi_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/everlightbox/admin/cmb2/includes/types/CMB2_Type_Checkbox.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/everlightbox/admin/cmb2/includes/types/CMB2_Type_Radio.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
10 plugin tags: images, lightbox image, lightbox, video gallery, image gallery...

everlightbox/everlightbox.php Passed 13 tests

The entry point to "Lightbox - EverlightBox Gallery" version 1.1.16 is a PHP file that has certain tags in its header comment area
40 characters long description:
Light and stylish lightbox for WordPress

Code Analysis 97% from 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
Everything looks great! No dangerous files found in this plugin80,600 lines of code in 356 files:
LanguageFilesBlank linesComment linesLines of code
PHP1739,48622,49338,083
PO File12214,52118,76032,812
CSS251,2071,1655,301
JavaScript125555712,374
Sass16300251,378
Markdown22020594
SVG61158

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
It is recommended to fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 2,907)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity44.74
▷ Minimum class complexity1.00
▷ Maximum class complexity2,907.00
Average method complexity4.14
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes119
▷ Abstract classes108.40%
▷ Concrete classes10991.60%
▷ Final classes00.00%
Methods1,691
▷ Static methods26115.43%
▷ Public methods1,25173.98%
▷ Protected methods1046.15%
▷ Private methods33619.87%
Functions132
▷ Named functions13199.24%
▷ Anonymous functions10.76%
Constants135
▷ Global constants10477.04%
▷ Class constants3122.96%
▷ Public constants31100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
40 compressed PNG files occupy 0.59MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
admin/images/logo.png4.21KB2.08KB▼ 50.61%
public/patterns-premium/6-min.png0.19KB0.19KB0.00%
public/patterns-premium/13-min.png0.12KB0.12KB0.00%
public/patterns-premium/14-min.png8.20KB8.82KB0.00%