84% shopmagic-for-twilio

Code Review | Free Twilio SMS integration for WooCommerce by ShopMagic

WordPress plugin Free Twilio SMS integration for WooCommerce by ShopMagic scored84%from 54 tests.

About plugin

  • Plugin page: shopmagic-for-twilio
  • Plugin version: 2.1.7
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Jan 13, 2021
  • Latest release: Nov 14, 2023
  • Number of updates: 50
  • Update frequency: every 20.8 days
  • Top authors: wpdesk (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

500+ active /12,242 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲1.44MB] [CPU: ▲3.57ms] Passed 4 tests

A check of server-side resources used by Free Twilio SMS integration for WooCommerce by ShopMagic
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.92 ▲1.4641.43 ▲2.92
Dashboard /wp-admin4.76 ▲1.4153.25 ▼6.97
Posts /wp-admin/edit.php4.81 ▲1.4587.65 ▲40.34
Add New Post /wp-admin/post-new.php7.34 ▲1.4595.74 ▲9.60
Media Library /wp-admin/upload.php4.68 ▲1.4541.69 ▲8.72

Server storage [IO: ▲13.58MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 2,621 new files
Database: no new tables, 8 new options
New WordPress options
plugin_activation_shopmagic-for-twilio/shopmagic-for-twilio.php
widget_recent-comments
widget_recent-posts
wpdesk_requirements_plugins_data
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Free Twilio SMS integration for WooCommerce by ShopMagic
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲7114.26 ▼0.092.02 ▲0.1738.93 ▼6.69
Dashboard /wp-admin2,192 ▲175.54 ▼0.1794.70 ▼23.3843.80 ▲1.44
Posts /wp-admin/edit.php2,103 ▲62.01 ▼0.0139.86 ▲4.2736.76 ▲3.79
Add New Post /wp-admin/post-new.php1,538 ▲1224.89 ▲1.60642.62 ▼126.8181.46 ▲18.39
Media Library /wp-admin/upload.php1,406 ▲64.21 ▲0.0399.90 ▲4.2342.47 ▲2.17

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • plugin_activation_shopmagic-for-twilio/shopmagic-for-twilio.php
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

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
Good news, no errors were detected

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
  • 2460× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ShopMagicTwilioVendor\\Twilio\\InstanceContext' not found in wp-content/plugins/shopmagic-for-twilio/vendor_prefixed/twilio/sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberContext.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'ShopMagicTwilioVendor\\Twilio\\InstanceContext' not found in wp-content/plugins/shopmagic-for-twilio/vendor_prefixed/twilio/sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnContext.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'ShopMagicTwilioVendor\\Twilio\\Options' not found in wp-content/plugins/shopmagic-for-twilio/vendor_prefixed/twilio/sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionOptions.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'ShopMagicTwilioVendor\\Twilio\\InstanceResource' not found in wp-content/plugins/shopmagic-for-twilio/vendor_prefixed/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdInstance.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'ShopMagicTwilioVendor\\Twilio\\Options' not found in wp-content/plugins/shopmagic-for-twilio/vendor_prefixed/twilio/sdk/src/Twilio/Rest/Routes/V2/SipDomainOptions.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'ShopMagicTwilioVendor\\Twilio\\ListResource' not found in wp-content/plugins/shopmagic-for-twilio/vendor_prefixed/twilio/sdk/src/Twilio/Rest/Numbers/V2/HostedNumberOrderList.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'ShopMagicTwilioVendor\\Twilio\\Rest\\AccountsBase' not found in wp-content/plugins/shopmagic-for-twilio/vendor_prefixed/twilio/sdk/src/Twilio/Rest/Accounts.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ShopMagicTwilioVendor\\Twilio\\InstanceResource' not found in wp-content/plugins/shopmagic-for-twilio/vendor_prefixed/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppInstance.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'ShopMagicTwilioVendor\\Twilio\\InstanceContext' not found in wp-content/plugins/shopmagic-for-twilio/vendor_prefixed/twilio/sdk/src/Twilio/Rest/Video/V1/Room/ParticipantContext.php:37
    • > PHP Fatal error
      Uncaught Error: Class 'ShopMagicTwilioVendor\\Twilio\\ListResource' not found in wp-content/plugins/shopmagic-for-twilio/vendor_prefixed/twilio/sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonList.php:25

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

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: sms reminders, sms marketing, sms notification, woocommerce twilio sms notifications, twilio

shopmagic-for-twilio/shopmagic-for-twilio.php Passed 13 tests

The main PHP script in "Free Twilio SMS integration for WooCommerce by ShopMagic" version 2.1.7 is automatically included on every request by WordPress
46 characters long description:
Allows users to send SMS using Twilio account.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin128,787 lines of code in 2,613 files:
LanguageFilesBlank linesComment linesLines of code
PHP2,5945,364146,050128,088
JSON1300538
CSS219283
JavaScript21053
Markdown25025

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity2.34
▷ Minimum class complexity1.00
▷ Maximum class complexity79.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces248
Interfaces31
Traits7
Classes3,115
▷ Abstract classes34811.17%
▷ Concrete classes2,76788.83%
▷ Final classes50.18%
Methods16,769
▷ Static methods6513.88%
▷ Public methods15,08689.96%
▷ Protected methods1,6289.71%
▷ Private methods550.33%
Functions143
▷ Named functions1611.19%
▷ Anonymous functions12788.81%
Constants70
▷ Global constants00.00%
▷ Class constants70100.00%
▷ Public constants70100.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.10MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/wpdesk.net.png2.36KB2.43KB0.00%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/flexibleshipping.com.png5.63KB3.68KB▼ 34.58%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/octolize.com.png88.91KB39.07KB▼ 56.06%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/logo@2x.png4.17KB4.47KB0.00%
vendor_prefixed/wpdesk/wp-wpdesk-tracker/src/assets/images/logo.png2.36KB2.43KB0.00%