88% twitter-bootstrap-galleries

Code Review | Twitter Bootstrap Galleries

WordPress plugin Twitter Bootstrap Galleries scored 88% from 54 tests.

About plugin

  • Plugin page: twitter-bootstrap...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-3.9
  • WordPress version: 5.9.2
  • First release: Nov 3, 2013
  • Latest release: Dec 25, 2013
  • Number of updates: 8
  • Update frequency: every 6.5 days
  • Top authors: bassjobsen (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

400+ active / 3,950 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼302.74ms] Passed 4 tests

A check of server-side resources used by Twitter Bootstrap Galleries
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.4454.35 ▲29.88
Dashboard /wp-admin3.46 ▲0.0632.94 ▼2.34
Posts /wp-admin/edit.php3.69 ▲0.0538.94 ▼10.33
Add New Post /wp-admin/post-new.php6.92 ▼0.0592.57 ▼1,198.58
Media Library /wp-admin/upload.php3.34 ▲0.0424.85 ▲0.31
Twitter Bootstrap Galleries /wp-admin/options-general.php?page=twitterbootstrap-galleries3.3023.27

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 10 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Twitter Bootstrap Galleries
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,770 ▲4815.87 ▼0.145.97 ▲0.332.41 ▼0.09
Dashboard /wp-admin2,897 ▲396.08 ▼0.09119.92 ▼16.87155.73 ▼1.03
Posts /wp-admin/edit.php2,696 ▲53.24 ▲0.0163.51 ▼1.84138.73 ▼6.93
Add New Post /wp-admin/post-new.php1,671 ▼8119.05 ▼1.86394.18 ▼71.15156.59 ▲1.11
Media Library /wp-admin/upload.php1,703 ▲55.50 ▼0.02143.88 ▼3.68186.57 ▼2.27
Twitter Bootstrap Galleries /wp-admin/options-general.php?page=twitterbootstrap-galleries8501.9736.8086.85

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=twitterbootstrap-galleries
    • > Error in wp-admin/includes/template.php+1720
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/twitter-bootstrap-galleries/templates/settings.php on line 7 and exactly 2 expected in wp-admin/includes/template.php:1720
    Stack trace:
    #0 wp-content/plugins/twitter-bootstrap-galleries/templates/settings.php(7): do_settings_fields()
    #1 wp-content/plugins/twitter-bootstrap-galleries/twitter-bootstrap-galleries.php(148): include('/var/www/wordpr...')
    #2 wp-includes/class-wp-hook.php(307): Twitterbootstrap_Galleries->plugin_settings_page()
    #3 wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(474): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #7 {main}
    thrown

SRP 50% 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 fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/twitter-bootstrap-galleries/twitter-bootstrap-galleries.php:360
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/twitter-bootstrap-galleries/templates/settings.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: Screenshot #1 (Settings panel of WooCommerce Twitter's Bootstrap) image not found
The official readme.txt might help

twitter-bootstrap-galleries/twitter-bootstrap-galleries.php Passed 13 tests

"Twitter Bootstrap Galleries" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
76 characters long description:
Wraps the content of a WordPress media gallery in a Twitter's Bootstrap grid

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 detected303 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP27685249
PO File2182054

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity45.00
▷ Minimum class complexity45.00
▷ Maximum class complexity45.00
Average method complexity5.78
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods330.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png10.26KB4.70KB▼ 54.22%