67% message-business

Code Review | Marketing automation, Email and SMS for Woocommerce and Wordpress

WordPress plugin Marketing automation, Email and SMS for Woocommerce and Wordpress scored67%from 54 tests.

About plugin

  • Plugin page: message-business
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.4.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-4.9.6
  • WordPress version: 6.3.1
  • First release: Apr 18, 2018
  • Latest release: Jun 27, 2018
  • Number of updates: 8
  • Update frequency: every 8.8 days
  • Top authors: msgbusiness (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,057 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
Installer ran successfully

Server metrics [RAM: ▲0.99MB] [CPU: ▲1.69ms] Passed 4 tests

An overview of server-side resources used by Marketing automation, Email and SMS for Woocommerce and Wordpress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.49 ▲0.9951.58 ▲7.43
Dashboard /wp-admin4.33 ▲0.9855.46 ▲4.45
Posts /wp-admin/edit.php4.44 ▲1.0458.20 ▲0.80
Add New Post /wp-admin/post-new.php6.93 ▲1.0092.49 ▼5.91
Media Library /wp-admin/upload.php4.25 ▲0.9852.17 ▲14.73
Message Business /wp-admin/plugins.php?page=messagebusiness4.3740.49

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 2,860 new files
Database: no new tables, 10 new options
New WordPress options
widget_message_business_newsletter_widget
widget_recent-posts
widget_recent-comments
MESSAGE_BUSINESS_WIDGETFORMHTML
MESSAGE_BUSINESS_INPUTSUBMITBUTTONTEXT
can_compress_scripts
theysaidso_admin_options
MESSAGE_BUSINESS_FORMBUILDEROPTIONS
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Marketing automation, Email and SMS for Woocommerce and Wordpress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,912 ▲15113.60 ▼1.028.35 ▲6.4048.11 ▲4.23
Dashboard /wp-admin2,210 ▲305.79 ▲0.1790.82 ▼0.6638.68 ▼2.16
Posts /wp-admin/edit.php2,116 ▲132.31 ▲0.3251.25 ▲9.0739.34 ▲2.23
Add New Post /wp-admin/post-new.php1,540 ▲1423.25 ▲0.12676.89 ▼11.2936.53 ▼11.45
Media Library /wp-admin/upload.php1,415 ▲154.27 ▲0.15104.85 ▼10.5444.12 ▼3.43
Message Business /wp-admin/plugins.php?page=messagebusiness9751.9333.5031.38

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_message_business_newsletter_widget
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/message-business/vendor/automattic/woocommerce/tests/bootstrap.php
    • > /wp-content/plugins/message-business/vendor/squizlabs/php_codesniffer/scripts/build-phar.php
  • 1460× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_MockObject_Matcher_InvokedRecorder' not found in wp-content/plugins/message-business/vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/InvokedAtMostCount.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer_Sniff' not found in wp-content/plugins/message-business/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Files/LineLengthSniff.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_Constraint' not found in wp-content/plugins/message-business/vendor/phpunit/phpunit/src/Framework/Constraint/IsJson.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Guzzle\\Plugin\\Backoff\\AbstractErrorCodeBackoffStrategy' not found in wp-content/plugins/message-business/vendor/guzzle/guzzle/src/Guzzle/Plugin/Backoff/ReasonPhraseBackoffStrategy.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/message-business/vendor/phpunit/phpunit/tests/_files/CoverageNoneTest.php:2
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer_Sniff' not found in wp-content/plugins/message-business/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Formatting/NoSpaceAfterCastSniff.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer_Exception' not found in wp-content/plugins/message-business/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/WhiteSpace/ScopeIndentSniff.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Guzzle\\Common\\ToArrayInterface' not found in wp-content/plugins/message-business/vendor/guzzle/guzzle/src/Guzzle/Service/Description/OperationInterface.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/message-business/vendor/symfony/config/Tests/Loader/LoaderTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Guzzle\\Tests\\GuzzleTestCase' not found in wp-content/plugins/message-business/vendor/guzzle/guzzle/tests/Guzzle/Tests/Service/Builder/ServiceBuilderTest.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (13 tag instead of maximum 10)
The official readme.txt might help

message-business/message-business.php 85% from 13 tests

The principal PHP file in "Marketing automation, Email and SMS for Woocommerce and Wordpress" v. 1.1.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 202 characters long)
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.0.1" instead of "2.6.0")

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Please make sure to remedy the following
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/message-business/vendor/bin/coveralls.bat
      • wp-content/plugins/message-business/vendor/bin/phpcbf.bat
      • wp-content/plugins/message-business/vendor/squizlabs/php_codesniffer/scripts/phpcbf.bat
      • wp-content/plugins/message-business/vendor/bin/phpcs.bat
      • wp-content/plugins/message-business/vendor/squizlabs/php_codesniffer/scripts/phpcs.bat
      • wp-content/plugins/message-business/vendor/bin/phpunit.bat
    • .exe - Executable in Windows
      • wp-content/plugins/message-business/vendor/symfony/console/Resources/bin/hiddeninput.exe
193,490 lines of code in 2,631 files:
LanguageFilesBlank linesComment linesLines of code
PHP2,09337,35780,429166,240
XML1982701485,613
JSON962605,439
Markdown891,95504,856
YAML61218893,647
reStructuredText301,2361,7941,824
JavaScript171204701,726
CSS12129601,677
Ant121283786
PO File2175179481
SVG100288
XSD220271
C1528223
make1245124
HTML216095
Python1222349
m41111141
C/C++ Header112840
Bourne Shell512438
DOS Batch622232

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 270)
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity8.78
▷ Minimum class complexity1.00
▷ Maximum class complexity542.00
Average method complexity2.47
▷ Minimum method complexity1.00
▷ Maximum method complexity270.00
Code structure
Namespaces245
Interfaces162
Traits8
Classes1,996
▷ Abstract classes733.66%
▷ Concrete classes1,92396.34%
▷ Final classes613.17%
Methods11,812
▷ Static methods8767.42%
▷ Public methods10,29887.18%
▷ Protected methods1,0298.71%
▷ Private methods4854.11%
Functions598
▷ Named functions22737.96%
▷ Anonymous functions37162.04%
Constants340
▷ Global constants11533.82%
▷ Class constants22566.18%
▷ Public constants225100.00%

Plugin size 0% from 2 tests

Image compression 0% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
6 PNG files occupy 0.49MB with 0.27MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
widget/img/flags.png64.41KB23.38KB▼ 63.70%
vendor/guzzle/guzzle/docs/_static/guzzle-icon.png0.78KB0.94KB0.00%
(invalid) admin/images/icon.png14.73KB0.00KB▼ 100.00%
vendor/guzzle/guzzle/docs/_static/logo.png241.87KB69.68KB▼ 71.19%
admin/images/logo.png11.81KB6.53KB▼ 44.66%