78% bomb-sms-notifier

Code Review | Bomb - SMS Notifier

WordPress plugin Bomb - SMS Notifier scored78%from 54 tests.

About plugin

  • Plugin page: bomb-sms-notifier
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.5.1
  • WordPress version: 6.3.1
  • First release: Oct 22, 2020
  • Latest release: Oct 29, 2020
  • Number of updates: 6
  • Update frequency: every 1.3 days
  • Top authors: redq (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /631 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

An overview of server-side resources used by Bomb - SMS Notifier
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0343.06 ▲4.37
Dashboard /wp-admin3.33 ▲0.0353.56 ▲2.58
Posts /wp-admin/edit.php3.44 ▲0.0951.94 ▼9.98
Add New Post /wp-admin/post-new.php5.93 ▲0.0589.47 ▼17.73
Media Library /wp-admin/upload.php3.25 ▲0.0335.39 ▼0.62
Quick SMS /wp-admin/admin.php?page=sms-notifier-quick-sms3.3135.56
SMS Notifier /wp-admin/admin.php?page=sms-notifier-settings3.2535.33

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 2,517 new files
Database: no new tables, 7 new options
New WordPress options
recovery_mode_email_last_sent
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Bomb - SMS Notifier
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5814.26 ▼0.091.79 ▼0.0144.64 ▲2.98
Dashboard /wp-admin2,219 ▲425.57 ▼0.0686.46 ▼10.9142.26 ▼0.96
Posts /wp-admin/edit.php2,132 ▲322.18 ▲0.2040.64 ▼1.3936.07 ▼2.01
Add New Post /wp-admin/post-new.php1,563 ▲3418.51 ▼4.59639.73 ▲22.5961.72 ▲11.17
Media Library /wp-admin/upload.php1,433 ▲364.20 ▼0.0397.39 ▼12.1549.84 ▲1.11
Quick SMS /wp-admin/admin.php?page=sms-notifier-quick-sms8661.8323.7730.18
SMS Notifier /wp-admin/admin.php?page=sms-notifier-settings7061.518.2620.26

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=sms-notifier-settings
    • > Error in wp-content/plugins/bomb-sms-notifier/Admin/SettingsGenerator.php+45
    Uncaught Error: Call to undefined function SmsNotifier\Admin\wc_get_order_statuses() in wp-content/plugins/bomb-sms-notifier/Admin/SettingsGenerator.php:45
    Stack trace:
    #0 wp-content/plugins/bomb-sms-notifier/Admin/Settings.php(63): SmsNotifier\Admin\SettingsGenerator->show_fields()
    #1 wp-includes/class-wp-hook.php(310): SmsNotifier\Admin\Settings->sms_notifier_settings_func()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 2158× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\InstanceContext' not found in wp-content/plugins/bomb-sms-notifier/vendor/twilio/sdk/src/Twilio/Rest/Sync/V1/Service/SyncListContext.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Page' not found in wp-content/plugins/bomb-sms-notifier/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V2/Service/RolePage.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\ListResource' not found in wp-content/plugins/bomb-sms-notifier/vendor/twilio/sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityList.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\ListResource' not found in wp-content/plugins/bomb-sms-notifier/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackList.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\ListResource' not found in wp-content/plugins/bomb-sms-notifier/vendor/twilio/sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryList.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\InstanceContext' not found in wp-content/plugins/bomb-sms-notifier/vendor/twilio/sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageContext.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\InstanceContext' not found in wp-content/plugins/bomb-sms-notifier/vendor/twilio/sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelContext.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\InstanceContext' not found in wp-content/plugins/bomb-sms-notifier/vendor/twilio/sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberContext.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Page' not found in wp-content/plugins/bomb-sms-notifier/vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/RecordingPage.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Twilio\\Page' not found in wp-content/plugins/bomb-sms-notifier/vendor/twilio/sdk/src/Twilio/Rest/Preview/TrustedComms/BrandedCallPage.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
9 plugin tags: twilio, notification, sms, woocommerce, order message...

bomb-sms-notifier/bomb.php 85% from 13 tests

"Bomb - SMS Notifier" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("bomb-sms-notifier.php" instead of "bomb.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
Good job! No executable or dangerous file extensions detected127,644 lines of code in 2,478 files:
LanguageFilesBlank linesComment linesLines of code
PHP2,40533,714125,059119,604
Markdown352,43805,626
JSON18001,704
CSS1361287
YAML8275232
XML75091
JavaScript12757
PO File15526
make1409
Dockerfile1308

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity3.08
▷ Minimum class complexity1.00
▷ Maximum class complexity87.00
Average method complexity1.37
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces265
Interfaces61
Traits22
Classes2,785
▷ Abstract classes28610.27%
▷ Concrete classes2,49989.73%
▷ Final classes361.44%
Methods15,773
▷ Static methods7624.83%
▷ Public methods14,17089.84%
▷ Protected methods1,3928.83%
▷ Private methods2111.34%
Functions293
▷ Named functions7224.57%
▷ Anonymous functions22175.43%
Constants269
▷ Global constants72.60%
▷ Class constants26297.40%
▷ Public constants26199.62%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected