78% bootstrap-modals

Code Review | Bootstrap Modals

WordPress plugin Bootstrap Modals scored78%from 54 tests.

About plugin

  • Plugin page: bootstrap-modals
  • Plugin version: 1.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.2
  • WordPress version: 6.3.1
  • First release: Jun 18, 2014
  • Latest release: May 17, 2019
  • Number of updates: 46
  • Update frequency: every 39.0 days
  • Top authors: neilgee (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

2,000+ active /41,722 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

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

Server-side resources used by Bootstrap Modals
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0841.75 ▼1.40
Dashboard /wp-admin3.40 ▲0.0948.48 ▼2.81
Posts /wp-admin/edit.php3.51 ▲0.1549.43 ▲3.72
Add New Post /wp-admin/post-new.php5.98 ▲0.0996.53 ▼2.85
Media Library /wp-admin/upload.php3.32 ▲0.0936.80 ▲3.19
Bootstrap Modal /wp-admin/options-general.php?page=bootstrap-modal3.3136.15

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Bootstrap Modals
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,887 ▲14113.75 ▼0.625.31 ▲3.4237.73 ▼9.18
Dashboard /wp-admin2,207 ▲164.85 ▼0.04113.60 ▲3.4640.93 ▼1.67
Posts /wp-admin/edit.php2,093 ▲42.04 ▲0.0839.74 ▲1.0435.38 ▲2.00
Add New Post /wp-admin/post-new.php1,522 ▼1023.09 ▲0.06656.45 ▲12.1459.71 ▼8.72
Media Library /wp-admin/upload.php1,395 ▲134.14 ▼0.1895.96 ▼4.1947.76 ▲5.54
Bootstrap Modal /wp-admin/options-general.php?page=bootstrap-modal2,1443.64117.5533.74

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 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
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/bootstrap-modals/inc/options-page-wrapper.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=bootstrap-modal
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.defaultLabel is deprecated since version 5.5.0! Use wp.i18n instead.
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=bootstrap-modal
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.pick is deprecated since version 5.5.0! Use wp.i18n instead.
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=bootstrap-modal
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.defaultString is deprecated since version 5.5.0! Use wp.i18n instead.
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=bootstrap-modal
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.defaultAriaLabel is deprecated since version 5.5.0! Use wp.i18n instead.

Optimizations

Plugin configuration 90% 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 your attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === bootstrap-modals === )
The official readme.txt is a good inspiration

bootstrap-modals/modal.php 85% from 13 tests

The primary PHP file in "Bootstrap Modals" version 1.3.2 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("bootstrap-modals.php" instead of "modal.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin788 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP2177166638
CSS137147
JavaScript21203

PHP code Passed 2 tests

Analyzing 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.21
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
PNG images were not found in this plugin