74% everlightbox

Code Review | Lightbox - EverlightBox Gallery

WordPress plugin Lightbox - EverlightBox Gallery scored74%from 54 tests.

About plugin

  • Plugin page: everlightbox
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.3
  • WordPress version: 6.3.1
  • First release: Sep 13, 2016
  • Latest release: Aug 9, 2023
  • Number of updates: 91
  • Update frequency: every 27.7 days
  • Top authors: GreenTreeLabs (76.92%)giucu91 (13.19%)raldea89 (8.79%)machothemes (3.3%)wpchill (2.2%)

Code review

54 tests

User reviews

37 reviews

Install metrics

1,000+ active /54,973 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.15MB] [CPU: ▲23.78ms] 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.15MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.87 ▲5.4166.00 ▲28.48
Dashboard /wp-admin8.89 ▲5.5975.40 ▲27.22
Posts /wp-admin/edit.php8.90 ▲5.5472.88 ▲25.14
Add New Post /wp-admin/post-new.php9.93 ▲4.04107.12 ▲14.29
Media Library /wp-admin/upload.php8.90 ▲5.6771.77 ▲39.33
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.9062.18

Server storage [IO: ▲6.70MB] [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: 613 new files
Database: no new tables, 10 new options
New WordPress options
fs_debug_mode
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
fs_active_plugins
db_upgraded
widget_theysaidso_widget
fs_accounts
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 /2,955 ▲19413.53 ▼0.8310.75 ▲9.1427.01 ▼18.02
Dashboard /wp-admin2,228 ▲475.69 ▼0.0390.58 ▼5.7884.27 ▲40.31
Posts /wp-admin/edit.php2,152 ▲551.99 ▲0.0437.57 ▼0.4235.84 ▲2.31
Add New Post /wp-admin/post-new.php1,725 ▲19723.51 ▲0.29682.34 ▲5.5052.00 ▼3.98
Media Library /wp-admin/upload.php1,448 ▲514.14 ▼0.0596.53 ▼5.6584.31 ▲39.29
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1161.6823.9725.81

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+8486
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 10 options
    • widget_recent-posts
    • fs_accounts
    • everlightbox_options
    • fs_active_plugins
    • fs_debug_mode
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% 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 50% 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
  • 46× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to a member function is_free_plan() on null in wp-content/plugins/everlightbox/admin/partials/everlightbox-admin-display.php:18
    • > PHP Notice
      Undefined variable: evebox_fs in wp-content/plugins/everlightbox/admin/partials/everlightbox-admin-display.php on line 18
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/everlightbox/admin/cmb2/includes/types/CMB2_Type_Colorpicker.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/everlightbox/admin/cmb2/includes/types/CMB2_Type_Title.php:13
    • > 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: Class 'CMB2_Base' not found in wp-content/plugins/everlightbox/admin/cmb2/includes/CMB2.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_hookup' not found in wp-content/plugins/everlightbox/admin/cmb2/includes/CMB2_Options_Hookup.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/everlightbox/admin/cmb2/includes/types/CMB2_Type_Taxonomy_Radio.php:13
    • > 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_Textarea' not found in wp-content/plugins/everlightbox/admin/cmb2/includes/types/CMB2_Type_Wysiwyg.php:16

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: gallery, video gallery, lightbox, social, video lightbox...

everlightbox/everlightbox.php Passed 13 tests

The entry point to "Lightbox - EverlightBox Gallery" version 1.2.0 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 plugin84,050 lines of code in 383 files:
LanguageFilesBlank linesComment linesLines of code
PHP18710,31623,62240,976
PO File12214,52118,76032,812
CSS311,2131,1685,622
JavaScript176165792,566
Sass16300251,378
Markdown22020594
SVG831102

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 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity45.63
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.12
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes126
▷ Abstract classes107.94%
▷ Concrete classes11692.06%
▷ Final classes00.00%
Methods1,836
▷ Static methods28515.52%
▷ Public methods1,34773.37%
▷ Protected methods1065.77%
▷ Private methods38320.86%
Functions137
▷ Named functions13699.27%
▷ Anonymous functions10.73%
Constants161
▷ Global constants10867.08%
▷ Class constants5332.92%
▷ Public constants53100.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
images/banner-772x250.png55.65KB58.76KB0.00%
public/patterns-premium/15-min.png5.44KB6.32KB0.00%
public/patterns-premium/13-min.png0.12KB0.12KB0.00%
admin/cmb2/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
admin/cmb2/images/ico-delete.png0.70KB0.72KB0.00%