73% wc-sms

Code Review | SMS for WooCommerce

WordPress plugin SMS for WooCommerce scored73%from 54 tests.

About plugin

  • Plugin page: wc-sms
  • Plugin version: 2.7
  • PHP compatiblity: 5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Mar 19, 2022
  • Latest release: Aug 17, 2023
  • Number of updates: 21
  • Update frequency: every 24.6 days
  • Top authors: theafricanboss (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /2,010 total downloads

Benchmarks

Plugin footprint 65% 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.52MB] [CPU: ▲2.25ms] Passed 4 tests

A check of server-side resources used by SMS for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.03 ▲0.5751.83 ▲9.58
Dashboard /wp-admin3.89 ▲0.5855.50 ▲2.21
Posts /wp-admin/edit.php3.94 ▲0.5851.78 ▲2.08
Add New Post /wp-admin/post-new.php6.41 ▲0.5288.21 ▼4.89
Media Library /wp-admin/upload.php3.65 ▲0.4244.91 ▲11.90
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius4.0241.14

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 223 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
widget_recent-comments
fs_accounts
can_compress_scripts
widget_theysaidso_widget
fs_active_plugins
theysaidso_admin_options
widget_recent-posts
fs_debug_mode

Browser metrics Passed 4 tests

This is an overview of browser requirements for SMS for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲7214.70 ▲0.111.61 ▼0.2732.75 ▼11.62
Dashboard /wp-admin2,233 ▲535.58 ▼0.0493.21 ▲2.5446.12 ▲5.18
Posts /wp-admin/edit.php2,148 ▲452.10 ▲0.1035.40 ▼0.8036.71 ▼1.83
Add New Post /wp-admin/post-new.php1,555 ▲2723.13 ▲0.09645.53 ▲5.6951.81 ▼10.56
Media Library /wp-admin/upload.php1,444 ▲474.24 ▲0.05109.67 ▲0.5249.66 ▲0.52
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0981.6927.0129.94

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/wc-sms/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 9 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • fs_accounts
    • fs_active_plugins
    • widget_theysaidso_widget
    • db_upgraded
    • fs_debug_mode
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/wc-sms/languages/index.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
9 plugin tags: woocommerce, order notifications, sms, sms order updates, customer sms...

wc-sms/wc-sms.php Passed 13 tests

The main file in "SMS for WooCommerce" v. 2.7 serves as a complement to information provided in readme.txt and as the entry point to the plugin
39 characters long description:
Order SMS Notifications for Woocommerce

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected36,139 lines of code in 154 files:
LanguageFilesBlank linesComment linesLines of code
PHP1358,35117,75035,835
JavaScript55367290
CSS140014

PHP code 0% from 2 tests

A short review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,073)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 109)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity86.71
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.61
▷ Minimum method complexity1.00
▷ Maximum method complexity109.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes54
▷ Abstract classes23.70%
▷ Concrete classes5296.30%
▷ Final classes00.00%
Methods1,336
▷ Static methods19714.75%
▷ Public methods93870.21%
▷ Protected methods261.95%
▷ Private methods37227.84%
Functions106
▷ Named functions10498.11%
▷ Anonymous functions21.89%
Constants153
▷ Global constants10669.28%
▷ Class constants4730.72%
▷ Public constants47100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 0.58MB with 0.34MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assets/images/wc_sms_250.png15.56KB6.57KB▼ 57.77%
assets/images/wcsms-settings.png296.10KB103.72KB▼ 64.97%
assets/images/icon-256x256.png15.85KB6.55KB▼ 58.70%
assets/images/sms-texts.png95.94KB33.57KB▼ 65.01%