73% ultimate-sms-notifications

Code Review | Ultimate SMS Notifications for WooCommerce

WordPress plugin Ultimate SMS Notifications for WooCommerce scored73%from 54 tests.

About plugin

  • Plugin page: ultimate-sms-noti...
  • Plugin version: 1.10
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4
  • WordPress version: 6.3.1
  • First release: Feb 20, 2019
  • Latest release: Nov 7, 2023
  • Number of updates: 173
  • Update frequency: every 10.0 days
  • Top authors: homescript (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

20+ active /7,701 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲5.21MB] [CPU: ▲28.91ms] 75% from 4 tests

Server-side resources used by Ultimate SMS Notifications for WooCommerce
Please have a look at the following items
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 5.21MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.89 ▲5.4368.89 ▲26.57
Dashboard /wp-admin8.91 ▲5.6185.04 ▲35.66
Posts /wp-admin/edit.php8.91 ▲5.5685.03 ▲35.30
Add New Post /wp-admin/post-new.php10.13 ▲4.25119.68 ▲18.09
Media Library /wp-admin/upload.php8.91 ▲5.6877.24 ▲40.61
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius8.9164.13

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 251 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-comments
db_upgraded
fs_accounts
widget_recent-posts
fs_active_plugins
fs_debug_mode
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Ultimate SMS Notifications for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,983 ▲22114.44 ▲0.041.88 ▲0.1829.18 ▼14.26
Dashboard /wp-admin2,347 ▲1675.87 ▲0.2998.17 ▲6.3883.35 ▲47.12
Posts /wp-admin/edit.php2,268 ▲1682.44 ▲0.4837.06 ▼3.7636.91 ▲0.55
Add New Post /wp-admin/post-new.php1,690 ▲16420.38 ▼2.67682.41 ▲2.4541.09 ▼13.63
Media Library /wp-admin/upload.php1,558 ▲1674.59 ▲0.37105.37 ▲3.0383.68 ▲38.94
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,0932.0229.0430.10

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-admin/includes/plugin.php+1941
    Undefined offset: 2
  • Zombie WordPress options detected upon uninstall: 9 options
    • widget_recent-posts
    • fs_active_plugins
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • fs_debug_mode
    • fs_accounts
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ultimate-sms-notifications/public/class-woo-usn-public.php:223
    • > PHP Warning
      require_once(WOO_USN_PATH../vendor/freemius/start.php): failed to open stream: No such file or directory in wp-content/plugins/ultimate-sms-notifications/abstract/premium_loading.php on line 17
    • > PHP Fatal error
      require(): Failed opening required 'WOO_USN_PATHpremium_loading.php' (include_path='.:/usr/share/php') in wp-content/plugins/ultimate-sms-notifications/require.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ultimate-sms-notifications/core/class-woo-usn-rest-api.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ultimate-sms-notifications/abstract/constants.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ultimate-sms-notifications/core/class-woo-usn-whatsapp.php:442
    • > PHP Warning
      Use of undefined constant WOO_USN_PATH - assumed 'WOO_USN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ultimate-sms-notifications/require.php on line 3
    • > PHP Warning
      require(WOO_USN_PATHpremium_loading.php): failed to open stream: No such file or directory in wp-content/plugins/ultimate-sms-notifications/require.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'WOO_USN_PATH../vendor/freemius/start.php' (include_path='.:/usr/share/php') in wp-content/plugins/ultimate-sms-notifications/abstract/premium_loading.php on line 17
    • > PHP Warning
      Use of undefined constant WOO_USN_PATH - assumed 'WOO_USN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ultimate-sms-notifications/abstract/premium_loading.php on line 17

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)
No browser errors were detected

Optimizations

Plugin configuration 93% 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
Please fix the following attributes:
  • Screenshots: Please add descriptions for these screenshots #1, #10, #11, #12, #13, #2, #3, #4, #5, #6, #7, #8, #9 in ultimate-sms-notifications/assets to your readme.txt
You can take inspiration from this readme.txt

ultimate-sms-notifications/woo-usn.php 92% from 13 tests

The principal PHP file in "Ultimate SMS Notifications for WooCommerce" v. 1.10 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ultimate-sms-notifications.php" instead of "woo-usn.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin65,576 lines of code in 194 files:
LanguageFilesBlank linesComment linesLines of code
PHP1498,66018,35538,825
JavaScript191,4781,15413,724
CSS232,5865212,713
JSON100177
Markdown120081
SVG10156

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity70.34
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.44
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces2
Interfaces1
Traits0
Classes69
▷ Abstract classes22.90%
▷ Concrete classes6797.10%
▷ Final classes00.00%
Methods1,438
▷ Static methods28920.10%
▷ Public methods1,02971.56%
▷ Protected methods171.18%
▷ Private methods39227.26%
Functions112
▷ Named functions10896.43%
▷ Anonymous functions43.57%
Constants151
▷ Global constants10468.87%
▷ Class constants4731.13%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.49MB with 0.29MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/flags.png69.20KB23.42KB▼ 66.16%
admin/img/flags@2x.png170.28KB68.04KB▼ 60.04%
public/img/flags@2x.png170.28KB68.04KB▼ 60.04%
public/img/flags.png69.20KB23.42KB▼ 66.16%
vendor/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%