83% messagemedia-for-woocommerce

Code Review | Messagemedia for WooCommerce

WordPress plugin Messagemedia for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: messagemedia-for-...
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8.0
  • WordPress version: 6.3.1
  • First release: Nov 19, 2020
  • Latest release: Aug 13, 2021
  • Number of updates: 8
  • Update frequency: every 33.4 days
  • Top authors: chilidevs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /443 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
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▲0.44ms] Passed 4 tests

Server-side resources used by Messagemedia for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0044.76 ▲3.12
Dashboard /wp-admin3.31 ▲0.0158.47 ▲10.43
Posts /wp-admin/edit.php3.36 ▲0.0055.93 ▲3.43
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.88 ▼4.49
Media Library /wp-admin/upload.php3.23 ▲0.0037.88 ▼0.31

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 110 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Messagemedia for WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲5214.72 ▲0.371.62 ▼0.1339.61 ▼4.27
Dashboard /wp-admin2,213 ▲395.57 ▼0.0388.88 ▼8.7243.66 ▲4.70
Posts /wp-admin/edit.php2,125 ▲251.96 ▼0.0236.44 ▼3.2734.77 ▼1.05
Add New Post /wp-admin/post-new.php1,545 ▼023.21 ▲4.93658.66 ▲29.8358.51 ▼7.72
Media Library /wp-admin/upload.php1,424 ▲214.18 ▼0.06112.23 ▲10.4752.00 ▲10.19

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 21× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      require_once(vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/messagemedia-for-woocommerce/vendor/messagemedia/messages-sdk/examples/sendMessage.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/messagemedia-for-woocommerce/vendor/mashape/unirest-php/tests/Unirest/RequestTest.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/messagemedia-for-woocommerce/vendor/mashape/unirest-php/tests/Unirest/BodyTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'MessageMediaMessagesLib\\Controllers\\BaseController' not found in wp-content/plugins/messagemedia-for-woocommerce/vendor/messagemedia/messages-sdk/src/Controllers/MessagesController.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'MessageMediaMessagesLib\\Controllers\\BaseController' not found in wp-content/plugins/messagemedia-for-woocommerce/vendor/messagemedia/messages-sdk/src/Controllers/DeliveryReportsController.php:20
    • > PHP Fatal error
      require_once(): Failed opening required 'vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/messagemedia-for-woocommerce/vendor/messagemedia/messages-sdk/examples/checkDeliveryReports.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/messagemedia-for-woocommerce/vendor/mashape/unirest-php/tests/Unirest/ResponseTest.php:10
    • > PHP Warning
      require_once(vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/messagemedia-for-woocommerce/vendor/messagemedia/messages-sdk/examples/checkDeliveryReports.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'MessageMediaMessagesLib\\APIException' not found in wp-content/plugins/messagemedia-for-woocommerce/vendor/messagemedia/messages-sdk/src/Exceptions/SendMessages400ResponseException.php:12
    • > PHP Warning
      require_once(vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/messagemedia-for-woocommerce/vendor/messagemedia/messages-sdk/examples/checkReplies.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 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: woocommerce-messagemedia, sms-notification, messagemedia, sms, woocommerce

messagemedia-for-woocommerce/wc-messagemedia.php 69% from 13 tests

"Messagemedia for WooCommerce" version 1.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("messagemedia-for-woocommerce.php" instead of "wc-messagemedia.php")
  • Requires at least: The required version number must match the one declared in readme.txt ("4.4" instead of "4.0")
  • Description: Please don't use more than 140 characters for the plugin description (currently 142 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected6,837 lines of code in 101 files:
LanguageFilesBlank linesComment linesLines of code
PHP861,2753,0965,269
Markdown22240515
XML3340420
JSON500248
reStructuredText1155136217
CSS113361
JavaScript19358
YAML28049

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity7.03
▷ Minimum class complexity1.00
▷ Maximum class complexity107.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces16
Interfaces1
Traits0
Classes72
▷ Abstract classes00.00%
▷ Concrete classes72100.00%
▷ Final classes00.00%
Methods377
▷ Static methods8021.22%
▷ Public methods34792.04%
▷ Protected methods195.04%
▷ Private methods112.92%
Functions7
▷ Named functions457.14%
▷ Anonymous functions342.86%
Constants81
▷ Global constants67.41%
▷ Class constants7592.59%
▷ Public constants75100.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
No PNG images were found in this plugin