89% 2bc-image-gallery

Code Review | 2BC Image Gallery

WordPress plugin 2BC Image Gallery scored89%from 54 tests.

About plugin

  • Plugin page: 2bc-image-gallery
  • Plugin version: 2.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.2.2
  • WordPress version: 6.3.1
  • First release: Nov 25, 2014
  • Latest release: May 30, 2015
  • Number of updates: 17
  • Update frequency: every 10.9 days
  • Top authors: 2bc_jason (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,309 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.33MB] [CPU: ▼3.06ms] Passed 4 tests

Server-side resources used by 2BC Image Gallery
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3344.17 ▲4.58
Dashboard /wp-admin3.65 ▲0.3047.23 ▼13.17
Posts /wp-admin/edit.php3.77 ▲0.4149.60 ▼0.86
Add New Post /wp-admin/post-new.php6.23 ▲0.3495.00 ▼1.58
Media Library /wp-admin/upload.php3.58 ▲0.3540.32 ▲3.36
Galleries /wp-admin/edit-tags.php?taxonomy=twobc_img_galleries&post_type=attachment3.5735.50
2BC Image Gallery /wp-admin/options-general.php?page=twobc_imagegallery3.5534.85

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for 2BC Image Gallery
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6213.24 ▼1.131.81 ▲0.3245.55 ▲2.52
Dashboard /wp-admin2,217 ▲325.84 ▲0.03106.74 ▲4.7337.63 ▼8.33
Posts /wp-admin/edit.php2,097 ▲82.02 ▲0.0240.22 ▼0.6034.93 ▲1.08
Add New Post /wp-admin/post-new.php1,539 ▲1823.10 ▼0.01649.78 ▼12.1764.13 ▲13.06
Media Library /wp-admin/upload.php1,398 ▲74.34 ▲0.1293.99 ▼5.7141.37 ▼1.67
Galleries /wp-admin/edit-tags.php?taxonomy=twobc_img_galleries&post_type=attachment1,2842.1326.8729.38
2BC Image Gallery /wp-admin/options-general.php?page=twobc_imagegallery1,4322.4951.7527.57

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • twobc_image_gallery_options
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

Smoke tests Passed 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 everything seems fine, this is not an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% 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
Attributes that require attention:
  • Tags: You are using too many tags: 20 tag instead of maximum 10
You can look at the official readme.txt

2bc-image-gallery/2bc-image-gallery.php Passed 13 tests

The main PHP script in "2BC Image Gallery" version 2.0.1 is automatically included on every request by WordPress
124 characters long description:
Add tags to images and group them into galleries, easily set options to display the lightbox galleries, or use the shortcode

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin3,447 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP34057472,191
PO File2193205506
JavaScript38266476
CSS24921274

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 124)
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity175.00
▷ Minimum class complexity124.00
▷ Maximum class complexity226.00
Average method complexity9.09
▷ Minimum method complexity1.00
▷ Maximum method complexity124.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods43
▷ Static methods3990.70%
▷ Public methods3376.74%
▷ Protected methods00.00%
▷ Private methods1023.26%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/scsheet60a.png6.82KB4.00KB▼ 41.30%
includes/images/loading_overlay.png0.11KB0.09KB▼ 13.64%