83% woo-smsapi-pl

Code Review | SMSAPI WooCommerce

WordPress plugin SMSAPI WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: woo-smsapi-pl
  • Plugin version: 2.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-5.4.2
  • WordPress version: 6.3.1
  • First release: Jan 23, 2018
  • Latest release: Aug 27, 2021
  • Number of updates: 16
  • Update frequency: every 82.0 days
  • Top authors: smsapi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /1,645 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.06MB] [CPU: ▼3.25ms] Passed 4 tests

A check of server-side resources used by SMSAPI WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0635.79 ▼7.28
Dashboard /wp-admin3.37 ▲0.0645.15 ▲3.55
Posts /wp-admin/edit.php3.48 ▲0.1347.09 ▼1.81
Add New Post /wp-admin/post-new.php5.95 ▲0.0692.11 ▼6.90
Media Library /wp-admin/upload.php3.29 ▲0.0633.05 ▲2.98

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 421 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for SMSAPI WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲3113.36 ▼1.001.73 ▼0.7142.72 ▼6.04
Dashboard /wp-admin2,208 ▲175.86 ▲0.82106.87 ▲6.6040.06 ▲1.19
Posts /wp-admin/edit.php2,091 ▲22.05 ▲0.0238.80 ▼2.5934.27 ▼2.41
Add New Post /wp-admin/post-new.php1,539 ▲418.48 ▼4.75612.48 ▲14.4165.01 ▲5.00
Media Library /wp-admin/upload.php1,390 ▼14.22 ▲0.0294.85 ▲1.0641.62 ▲0.68

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

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 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
  • 131× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/woo-smsapi-pl/class/vendor/guzzlehttp/promises/src/CancellationException.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/woo-smsapi-pl/class/vendor/guzzlehttp/promises/src/FulfilledPromise.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'MabeEnum\\Enum' not found in wp-content/plugins/woo-smsapi-pl/class/vendor/smsapi/php-client/tests/ServiceName.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/woo-smsapi-pl/class/vendor/guzzlehttp/psr7/src/LimitStream.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\Assert' not found in wp-content/plugins/woo-smsapi-pl/class/vendor/smsapi/php-client/tests/Assert/SubuserAssert.php:13
    • > PHP Fatal error
      Trait 'Smsapi\\Client\\Feature\\Bag\\PaginationBag' not found in wp-content/plugins/woo-smsapi-pl/class/vendor/smsapi/php-client/src/Feature/Contacts/Bag/FindContactsBag.php on line 21
    • > PHP Fatal error
      Uncaught Error: Interface 'Smsapi\\Client\\Feature\\Profile\\ProfileFeature' not found in wp-content/plugins/woo-smsapi-pl/class/vendor/smsapi/php-client/src/Feature/Profile/SmsapiPlProfileFeature.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Smsapi\\Client\\Tests\\SmsapiClientIntegrationTestCase' not found in wp-content/plugins/woo-smsapi-pl/class/vendor/smsapi/php-client/tests/Integration/Feature/Contacts/Groups/ContactsGroupsFeatureTest.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Smsapi\\Client\\Feature\\Mfa\\MfaFeature' not found in wp-content/plugins/woo-smsapi-pl/class/vendor/smsapi/php-client/src/Feature/Mfa/MfaHttpFeature.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Smsapi\\Client\\Tests\\SmsapiClientUnitTestCase' not found in wp-content/plugins/woo-smsapi-pl/class/vendor/smsapi/php-client/tests/Unit/Infrastructure/ResponseMapper/RestResponseMapperTest.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: smsapi, woocommerce, sms

woo-smsapi-pl/woocommerce-smsapi.php 77% from 13 tests

The main file in "SMSAPI WooCommerce" v. 2.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woo-smsapi-pl.php" instead of "woocommerce-smsapi.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.0" instead of "3.9")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin24,954 lines of code in 401 files:
LanguageFilesBlank linesComment linesLines of code
PHP3564,2297,30419,782
Markdown171,16303,557
JSON16001,062
JavaScript28212213
PO File14552142
XML24083
Ant11043
CSS15127
make210021
YAML20014
Dockerfile18010

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity5.23
▷ Minimum class complexity1.00
▷ Maximum class complexity153.00
Average method complexity2.02
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces101
Interfaces38
Traits8
Classes290
▷ Abstract classes62.07%
▷ Concrete classes28497.93%
▷ Final classes134.58%
Methods1,442
▷ Static methods16711.58%
▷ Public methods1,24286.13%
▷ Protected methods251.73%
▷ Private methods17512.14%
Functions199
▷ Named functions10653.27%
▷ Anonymous functions9346.73%
Constants134
▷ Global constants4835.82%
▷ Class constants8664.18%
▷ Public constants86100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.24MB with 0.15MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/screenshot-1.png126.91KB36.02KB▼ 71.62%
assets/images/screenshot-2.png100.12KB27.53KB▼ 72.50%
assets/images/wpdesk-woocommerce-plugins.png17.02KB8.66KB▼ 49.12%