78% wc-sms-notification

Code Review | WC SMS Notification

WordPress plugin WC SMS Notification scored78%from 54 tests.

About plugin

  • Plugin page: wc-sms-notification
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: May 12, 2022
  • Latest release: Jun 13, 2022
  • Number of updates: 3
  • Update frequency: every 10.7 days
  • Top authors: ok9xnirab (66.67%)springdevs (66.67%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /221 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.25MB] [CPU: ▼4.31ms] Passed 4 tests

An overview of server-side resources used by WC SMS Notification
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2545.14 ▼5.77
Dashboard /wp-admin3.59 ▲0.2953.23 ▲6.56
Posts /wp-admin/edit.php3.64 ▲0.2851.48 ▲1.33
Add New Post /wp-admin/post-new.php6.13 ▲0.2489.60 ▼18.10
Media Library /wp-admin/upload.php3.45 ▲0.2237.49 ▲5.32
Setup /wp-admin/admin.php?page=sdevs-sms-setup3.4235.13
WooCommerce /wp-admin/admin.php?page=sdevs-sms-woocommerce3.4437.41
Template /wp-admin/admin.php?page=sdevs-sms-template3.4334.66

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 1,653 new files
Database: no new tables, 18 new options
New WordPress options
sms_order_status_notifications
can_compress_scripts
widget_recent-posts
order_refund_template
theysaidso_admin_options
widget_recent-comments
admin_new_order_sms_template
order_cancell_template
order_failed_template
user_sms_notification
...

Browser metrics Passed 4 tests

Checking browser requirements for WC SMS Notification
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲3014.40 ▼0.021.81 ▼0.1646.97 ▲5.60
Dashboard /wp-admin2,222 ▲455.64 ▲0.0896.79 ▲2.3344.15 ▲3.07
Posts /wp-admin/edit.php2,124 ▲212.03 ▲0.0935.54 ▼3.5835.60 ▼1.92
Add New Post /wp-admin/post-new.php1,548 ▲3123.38 ▲4.43596.73 ▲114.3250.97 ▲0.74
Media Library /wp-admin/upload.php1,430 ▲304.17 ▲0.1198.10 ▼12.0343.47 ▼5.72
Setup /wp-admin/admin.php?page=sdevs-sms-setup9382.5251.9229.84
WooCommerce /wp-admin/admin.php?page=sdevs-sms-woocommerce1,0282.3564.1030.36
Template /wp-admin/admin.php?page=sdevs-sms-template1,0702.2829.9634.28

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 18 options
    • new_order_sms_notification
    • order_complete_template
    • widget_recent-comments
    • widget_recent-posts
    • order_processing_template
    • theysaidso_admin_options
    • new_order_sms_template
    • sms_order_status_notifications
    • user_sms_notification
    • widget_theysaidso_widget
    • ...

Smoke tests 50% 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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 61× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wc-sms-notification/vendor/giggsey/libphonenumber-for-php/tests/core/PhoneNumberUtilTest.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wc-sms-notification/vendor/giggsey/libphonenumber-for-php/tests/Issues/CodeCoverageTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wc-sms-notification/vendor/giggsey/libphonenumber-for-php/tests/Issues/Issue175Test.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wc-sms-notification/vendor/giggsey/libphonenumber-for-php/tests/Issues/Issue35Test.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'libphonenumber\\Leniency\\AbstractLeniency' not found in wp-content/plugins/wc-sms-notification/vendor/giggsey/libphonenumber-for-php/src/Leniency/ExactGrouping.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wc-sms-notification/vendor/giggsey/libphonenumber-for-php/tests/core/PhoneNumberMatcherTest.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wc-sms-notification/vendor/giggsey/libphonenumber-for-php/tests/carrier/PhoneNumberToCarrierMapperTest.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/wc-sms-notification/includes/Admin/views/template.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wc-sms-notification/vendor/giggsey/libphonenumber-for-php/tests/buildtools/GeneratePhonePrefixDataTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wc-sms-notification/vendor/giggsey/libphonenumber-for-php/tests/Issues/Issue44Test.php:10

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
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sdevs-sms-template
    • > Console-api (severe) in wp-content/plugins/wc-sms-notification/assets/js/app.js?ver=1.0.0+4702:14
    [Vue warn]: Cannot find element: #sdevs_sms_setup

Optimizations

Plugin configuration 90% 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
3 plugin tags: sms, woocommerce, woocommerce-sms

wc-sms-notification/sms.php 77% from 13 tests

This is the main PHP file of "WC SMS Notification" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Main file name: Name the main plugin file the same as the plugin slug ("wc-sms-notification.php" instead of "sms.php")

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
There were no executable files found in this plugin622,788 lines of code in 1,513 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,4895,25919,678609,170
JavaScript51,7802,30412,123
Markdown103150650
JSON510399
Vuejs Component170218
Ant1360187
XML13125
YAML11016

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity14.16
▷ Minimum class complexity1.00
▷ Maximum class complexity367.00
Average method complexity2.28
▷ Minimum method complexity1.00
▷ Maximum method complexity48.00
Code structure
Namespaces23
Interfaces3
Traits1
Classes112
▷ Abstract classes10.89%
▷ Concrete classes11199.11%
▷ Final classes21.80%
Methods1,170
▷ Static methods17314.79%
▷ Public methods1,00485.81%
▷ Protected methods877.44%
▷ Private methods796.75%
Functions89
▷ Named functions8089.89%
▷ Anonymous functions910.11%
Constants196
▷ Global constants126.12%
▷ Class constants18493.88%
▷ Public constants184100.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