68% foobox-image-lightbox

Code Review | Lightbox & Modal Popup WordPress Plugin - FooBox

WordPress plugin Lightbox & Modal Popup WordPress Plugin - FooBox scored 68% from 54 tests.

About plugin

  • Plugin page: foobox-image-ligh...
  • Plugin version: 2.7.27
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-6.3
  • WordPress version: 6.3.1
  • First release: Apr 8, 2014
  • Latest release: Aug 15, 2023
  • Number of updates: 81
  • Update frequency: every 42.2 days
  • Top authors: bradvin (100%)

Code review

54 tests

User reviews

83 reviews

Install metrics

100,000+ active / 2,233,499 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.65MB] [CPU: ▼3.38ms] Passed 4 tests

Server-side resources used by Lightbox & Modal Popup WordPress Plugin - FooBox
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.07 ▲0.6138.81 ▼1.59
Dashboard /wp-admin3.99 ▲0.6850.58 ▲1.73
Posts /wp-admin/edit.php4.04 ▲0.6853.02 ▲3.90
Add New Post /wp-admin/post-new.php6.51 ▲0.6387.86 ▼17.56
Media Library /wp-admin/upload.php3.91 ▲0.6840.60 ▲5.21
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius4.2639.94

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Lightbox & Modal Popup WordPress Plugin - FooBox
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,945 ▲21013.69 ▼0.898.95 ▲7.3928.23 ▼20.79
Dashboard /wp-admin2,234 ▲435.83 ▲0.96112.22 ▲6.3046.06 ▲2.39
Posts /wp-admin/edit.php2,123 ▲342.00 ▼0.0141.56 ▲4.5238.81 ▲4.31
Add New Post /wp-admin/post-new.php6,479 ▲4,96520.26 ▲2.75857.38 ▲164.9264.03 ▲14.37
Media Library /wp-admin/upload.php1,425 ▲344.30 ▲0.0796.51 ▼4.8843.58 ▼2.44
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0761.7125.2024.98

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/foobox-image-lightbox/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_recent-posts
    • fs_debug_mode
    • theysaidso_admin_options
    • fs_active_plugins
    • widget_theysaidso_widget
    • fs_accounts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/foobox-image-lightbox/free/includes/upgrade.php
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Exception: This settings view has not been included correctly! in wp-content/plugins/foobox-image-lightbox/free/includes/foopluginbase/views/settings.php:9
    • > PHP Warning
      require_once(FOOBOX_BASE_PATHcompatibility/class-elementor.php): failed to open stream: No such file or directory in wp-content/plugins/foobox-image-lightbox/compatibility/includes.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/foobox-image-lightbox/free/foobox-free.php:7
    • > PHP Fatal error
      require_once(): Failed opening required 'FOOBOX_BASE_PATHcompatibility/class-elementor.php' (include_path='.:/usr/share/php') in wp-content/plugins/foobox-image-lightbox/compatibility/includes.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/foobox-image-lightbox/includes/admin/view-getting-started.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/foobox-image-lightbox/free/includes/view-getting-started.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/foobox-image-lightbox/foobox-free.php:25
    • > PHP Warning
      Use of undefined constant FOOBOX_BASE_PATH - assumed 'FOOBOX_BASE_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/foobox-image-lightbox/compatibility/includes.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Attributes that require attention:
  • Screenshots: Screenshot #1 (Frontend example) image required
Please take inspiration from this readme.txt

foobox-image-lightbox/foobox-free.php 92% from 13 tests

The primary PHP file in "Lightbox & Modal Popup WordPress Plugin - FooBox" version 2.7.27 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("foobox-image-lightbox.php" instead of "foobox-free.php")

Code Analysis 97% from 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 detected35,581 lines of code in 170 files:
LanguageFilesBlank linesComment linesLines of code
PHP1458,45717,63634,952
JavaScript79476337
PO File15252150
CSS16310139
Markdown1103

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity75.42
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.47
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes62
▷ Abstract classes34.84%
▷ Concrete classes5995.16%
▷ Final classes00.00%
Methods1,360
▷ Static methods20615.15%
▷ Public methods96871.18%
▷ Protected methods171.25%
▷ Private methods37527.57%
Functions122
▷ Named functions122100.00%
▷ Anonymous functions00.00%
Constants165
▷ Global constants11469.09%
▷ Class constants5130.91%
▷ Public constants51100.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
8 PNG files occupy 0.19MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
free/css/img/tick3.png0.25KB0.16KB▼ 34.51%
free/css/img/tick2.png0.25KB0.16KB▼ 34.25%
assets/img/foobot_red.png149.28KB49.81KB▼ 66.63%
assets/img/foobot.png16.50KB8.13KB▼ 50.71%