83% ithoughts-lightbox

Code Review | iThoughts Lightbox

WordPress plugin iThoughts Lightbox scored83%from 54 tests.

About plugin

  • Plugin page: ithoughts-lightbox
  • Plugin version: 0.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.4
  • WordPress version: 6.3.1
  • First release: Jan 1, 2016
  • Latest release: Jan 23, 2016
  • Number of updates: 6
  • Update frequency: every 3.8 days
  • Top authors: Gerkin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,107 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.09MB] [CPU: ▼2.27ms] Passed 4 tests

A check of server-side resources used by iThoughts Lightbox
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0639.70 ▼9.64
Dashboard /wp-admin3.40 ▲0.1052.46 ▲1.76
Posts /wp-admin/edit.php3.52 ▲0.1656.55 ▲5.79
Add New Post /wp-admin/post-new.php5.99 ▲0.0989.58 ▼5.49
Media Library /wp-admin/upload.php3.33 ▲0.0939.26 ▲4.30
iThoughts Lightbox /wp-admin/options-general.php?page=ithoughts_lightbox3.2936.63

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 38 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for iThoughts Lightbox
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲2814.27 ▼0.061.87 ▼0.3841.86 ▼2.61
Dashboard /wp-admin2,214 ▲475.64 ▼0.02100.06 ▼4.7546.65 ▲2.93
Posts /wp-admin/edit.php2,122 ▲192.17 ▲0.1537.86 ▼0.7135.07 ▼1.16
Add New Post /wp-admin/post-new.php1,533 ▲723.56 ▲0.46654.76 ▼3.5050.17 ▼1.57
Media Library /wp-admin/upload.php1,416 ▲164.29 ▲0.08107.67 ▼1.5346.54 ▲0.78
iThoughts Lightbox /wp-admin/options-general.php?page=ithoughts_lightbox1,0162.5044.5350.70

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'ithoughts_lightbox_interface' not found in wp-content/plugins/ithoughts-lightbox/class/ithoughts_lightbox-admin.class.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/ithoughts-lightbox/class/ithoughts_lightbox.class.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Example base layout used for demonstration), #2 (A lightbox view with dark theme and loopbox enabled (you can go from first to last going backward and from last to first going forward)), #3 (A lightbox view on a small screen), #4 (The same view with ImageZoom active), #5 (Display on 320x480px screen), #6 (TinyMCE lightbox configuration form. Orange shadowed won't be added to lightbox, blue will, and no shadowed will follow the default option), #7 (The new TinyMCE button)
You can take inspiration from this readme.txt

ithoughts-lightbox/ithoughts_lightbox.php 85% from 13 tests

"iThoughts Lightbox" version 0.1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("ithoughts-lightbox.php" instead of "ithoughts_lightbox.php")
  • Text Domain: Please use dashes and lowercase characters for text domains

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected2,188 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript64223865
CSS6423622
PHP66965537
SVG21284
JSON10051
HTML10028
Markdown1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity19.50
▷ Minimum class complexity1.00
▷ Maximum class complexity61.00
Average method complexity3.39
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods31
▷ Static methods1032.26%
▷ Public methods2993.55%
▷ Protected methods00.00%
▷ Private methods26.45%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 3.72MB with 2.67MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png234.55KB62.60KB▼ 73.31%
screenshot-1.png846.35KB245.10KB▼ 71.04%
screenshot-3.png759.87KB207.89KB▼ 72.64%
screenshot-7.png39.17KB14.16KB▼ 63.86%
screenshot-6.png250.69KB56.77KB▼ 77.36%