57% usmsgh-wc-sms-notification

Code Review | USMS-GH WooCommerce SMS Notification

WordPress plugin USMS-GH WooCommerce SMS Notification scored57%from 54 tests.

About plugin

  • Plugin page: usmsgh-wc-sms-not...
  • Plugin version: 2.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.8.1
  • WordPress version: 6.3.1
  • First release: Nov 18, 2021
  • Latest release: Oct 25, 2023
  • Number of updates: 10
  • Update frequency: every 72.2 days
  • Top authors: urhitech (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /433 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲6.66MB] [CPU: ▲44.50ms] 50% from 4 tests

A check of server-side resources used by USMS-GH WooCommerce SMS Notification
Please have a look at the following items
  • RAM: Total memory usage must be kept under 10MB (currently 10.15MB on /wp-admin/tools.php?page=action-scheduler)
  • Extra RAM: The extra memory usage must be under 5MB (currently 6.66MB on /wp-admin/tools.php?page=action-scheduler)
PageMemory (MB)CPU Time (ms)
Home /10.05 ▲6.5985.99 ▲49.16
Dashboard /wp-admin9.99 ▲6.6590.88 ▲30.19
Posts /wp-admin/edit.php10.06 ▲6.7195.16 ▲48.22
Add New Post /wp-admin/post-new.php12.59 ▲6.70141.19 ▲50.43
Media Library /wp-admin/upload.php9.91 ▲6.6985.42 ▲52.06
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius10.1792.18
/wp-admin/admin.php?page=usmsgh-download-file9.9172.93
UsmsGH-API SMS Settings /wp-admin/options-general.php?page=usmsgh-woocoommerce-setting10.1481.47
Scheduled Actions /wp-admin/tools.php?page=action-scheduler10.1589.91

Server storage [IO: ▲5.46MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 423 new files
Database: 5 new tables, 23 new options
New tables
usmsgh_wc_send_sms_outbox
wp_actionscheduler_claims
wp_actionscheduler_actions
wp_actionscheduler_logs
wp_actionscheduler_groups
New WordPress options
fs_active_plugins
can_compress_scripts
widget_recent-posts
action_scheduler_hybrid_store_demarkation
schema-ActionScheduler_StoreSchema
usmsgh_customer_setting
fs_gdpr
action_scheduler_lock_async-request-runner
usmsgh_multivendor_setting
usmsgh_setting
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for USMS-GH WooCommerce SMS Notification
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,191 ▼58012.01 ▼2.361.89 ▲0.1631.19 ▼8.84
Dashboard /wp-admin1,600 ▼5741.71 ▼3.9619.48 ▼65.1532.45 ▼7.16
Posts /wp-admin/edit.php2,315 ▲2183.66 ▲1.6664.12 ▲29.2043.28 ▲7.71
Add New Post /wp-admin/post-new.php1,569 ▲4121.29 ▼1.88701.00 ▲41.6837.09 ▼23.66
Media Library /wp-admin/upload.php1,457 ▲574.31 ▲0.1681.36 ▼12.3944.46 ▲2.32
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,2653.2450.8328.18
/wp-admin/admin.php?page=usmsgh-download-file6971.509.7221.62
UsmsGH-API SMS Settings /wp-admin/options-general.php?page=usmsgh-woocoommerce-setting1,2023.2043.9785.63
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,5543.4043.6432.17

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/usmsgh-wc-sms-notification/lib/freemius/includes/class-freemius.php+8575
    Undefined property: stdClass::$plugins
  • Zombie tables were found after uninstall: 5 tables
    • wp_actionscheduler_claims
    • wp_actionscheduler_logs
    • usmsgh_wc_send_sms_outbox
    • wp_actionscheduler_actions
    • wp_actionscheduler_groups
  • This plugin does not fully uninstall, leaving 22 options in the database
    • usmsgh_customer_setting
    • usmsgh_help_setting
    • recovery_mode_email_last_sent
    • db_upgraded
    • action_scheduler_lock_async-request-runner
    • widget_theysaidso_widget
    • usmsgh_smsoutbox_setting
    • fs_accounts
    • fs_active_plugins
    • fs_gdpr
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=freemius
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 120× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Action_Scheduler\\Tests\\DataStores\\AbstractStoreTest' not found in wp-content/plugins/usmsgh-wc-sms-notification/lib/action-scheduler/tests/phpunit/jobstore/ActionScheduler_wpPostStore_Test.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/usmsgh-wc-sms-notification/lib/action-scheduler/tests/phpunit/deprecated/ActionScheduler_UnitTestCase.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_Schedule' not found in wp-content/plugins/usmsgh-wc-sms-notification/lib/action-scheduler/classes/abstracts/ActionScheduler_Abstract_RecurringSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'CronExpression_FieldInterface' not found in wp-content/plugins/usmsgh-wc-sms-notification/lib/action-scheduler/lib/cron-expression/CronExpression_AbstractField.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Store' not found in wp-content/plugins/usmsgh-wc-sms-notification/lib/action-scheduler/classes/data-stores/ActionScheduler_wpPostStore.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_UnitTestCase' not found in wp-content/plugins/usmsgh-wc-sms-notification/lib/action-scheduler/tests/phpunit/migration/Runner_Test.php:13
    • > PHP Warning
      require_once(wp-content/plugins/usmsgh-wc-sms-notification/lib/action-scheduler/tests/../vendor/yoast/phpunit-polyfills/phpunitpolyfills-autoload.php): failed to open stream: No such file or directory in wp-content/plugins/usmsgh-wc-sms-notification/lib/action-scheduler/tests/bootstrap.php on line 19
    • > PHP Fatal error
      Uncaught Error: Interface 'Usmsgh_Register_Interface' not found in wp-content/plugins/usmsgh-wc-sms-notification/admin/automation.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_RecurringSchedule' not found in wp-content/plugins/usmsgh-wc-sms-notification/lib/action-scheduler/classes/schedules/ActionScheduler_IntervalSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Usmsgh_WooCommerce_Notification' not found in wp-content/plugins/usmsgh-wc-sms-notification/includes/multivendor/class-usmsgh-multivendor-notification.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: Please delete some tags, you are using 14 tag instead of maximum 10
The official readme.txt is a good inspiration

usmsgh-wc-sms-notification/usmsgh-woocommerce.php 85% from 13 tests

The main PHP file in "USMS-GH WooCommerce SMS Notification" ver. 2.0.1 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Git Repository: There should be no Git repositories present in your plugin
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("usmsgh-wc-sms-notification.php" instead of "usmsgh-woocommerce.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin65,928 lines of code in 369 files:
LanguageFilesBlank linesComment linesLines of code
PHP30611,75422,87250,995
CSS1412279,231
JSON10003,561
Markdown134610917
JavaScript78999576
XML1083251
Bourne Shell12311147
YAML4156111
HTML28052
Sass110047
SVG10040

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity27.16
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity3.32
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces10
Interfaces7
Traits0
Classes219
▷ Abstract classes209.13%
▷ Concrete classes19990.87%
▷ Final classes00.00%
Methods2,641
▷ Static methods30411.51%
▷ Public methods1,99275.43%
▷ Protected methods1867.04%
▷ Private methods46317.53%
Functions144
▷ Named functions12083.33%
▷ Anonymous functions2416.67%
Constants164
▷ Global constants10664.63%
▷ Class constants5835.37%
▷ Public constants58100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
9 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
lib/freemius/assets/img/usmsgh-wc-sms-notification.png28.63KB10.43KB▼ 63.57%
lib/action-scheduler/docs/favicon-32x32.png1.16KB0.71KB▼ 39.02%
lib/action-scheduler/docs/mstile-150x150.png4.15KB3.67KB▼ 11.47%
lib/action-scheduler/docs/android-chrome-256x256.png2.93KB3.03KB0.00%