89% 2bc-image-gallery

Code Review | 2BC Image Gallery

WordPress plugin 2BC Image Gallery scored 89% 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: 5.9.2
  • 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 / 2,972 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by 2BC Image Gallery
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.93 ▲0.3860.88 ▲8.05
Dashboard /wp-admin3.79 ▲0.3536.75 ▲3.80
Posts /wp-admin/edit.php4.02 ▲0.3438.80 ▲1.67
Add New Post /wp-admin/post-new.php7.26 ▲0.2593.90 ▼1,182.75
Media Library /wp-admin/upload.php3.74 ▲0.4128.88 ▲4.13
Galleries /wp-admin/edit-tags.php?taxonomy=twobc_img_galleries&post_type=attachment3.7428.70
2BC Image Gallery /wp-admin/options-general.php?page=twobc_imagegallery3.6525.02

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 23 new files
Database: no new tables, 1 new option
New WordPress options

Browser metrics Passed 4 tests

An overview of browser requirements for 2BC Image Gallery
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,805 ▲6116.23 ▲0.215.87 ▲0.072.60 ▲0.18
Dashboard /wp-admin2,902 ▲446.06 ▼0.27118.06 ▼17.14157.20 ▼4.43
Posts /wp-admin/edit.php2,701 ▲443.23 ▼0.0161.61 ▼3.99139.91 ▼4.87
Add New Post /wp-admin/post-new.php1,725 ▲6416.93 ▲1.42406.45 ▼40.89158.84 ▼0.33
Media Library /wp-admin/upload.php1,713 ▲185.57 ▲0.13152.86 ▲9.97192.41 ▲5.07
Galleries /wp-admin/edit-tags.php?taxonomy=twobc_img_galleries&post_type=attachment1,6422.7654.74100.93
2BC Image Gallery /wp-admin/options-general.php?page=twobc_imagegallery1,9533.5077.14148.08

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
  • This plugin does not fully uninstall, leaving 1 option in the database
    • twobc_image_gallery_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

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


Plugin configuration 97% 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
These attributes need to be fixed:
  • Tags: There are too many tags (20 tag instead of maximum 10)
Please take inspiration from this readme.txt

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

The main file in "2BC Image Gallery" v. 2.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
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 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin3,447 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PO File2193205506

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please tend to the following items
  • Please reduce cyclomatic complexity of methods 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
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
▷ Static methods3990.70%
▷ Public methods3376.74%
▷ Protected methods00.00%
▷ Private methods1023.26%
▷ Named functions1100.00%
▷ Anonymous functions00.00%
▷ 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%